1 line
33 KiB
JSON
1 line
33 KiB
JSON
|
{"ast":null,"code":"import { Keyframes, unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { initFadeMotion } from '../../style/motion/fade';\nimport { initMotion } from '../../style/motion/motion';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nimport getOffset from '../util';\nconst initFloatButtonGroupMotion = token => {\n const {\n componentCls,\n floatButtonSize,\n motionDurationSlow,\n motionEaseInOutCirc\n } = token;\n const groupPrefixCls = `${componentCls}-group`;\n const moveDownIn = new Keyframes('antFloatButtonMoveDownIn', {\n '0%': {\n transform: `translate3d(0, ${unit(floatButtonSize)}, 0)`,\n transformOrigin: '0 0',\n opacity: 0\n },\n '100%': {\n transform: 'translate3d(0, 0, 0)',\n transformOrigin: '0 0',\n opacity: 1\n }\n });\n const moveDownOut = new Keyframes('antFloatButtonMoveDownOut', {\n '0%': {\n transform: 'translate3d(0, 0, 0)',\n transformOrigin: '0 0',\n opacity: 1\n },\n '100%': {\n transform: `translate3d(0, ${unit(floatButtonSize)}, 0)`,\n transformOrigin: '0 0',\n opacity: 0\n }\n });\n return [{\n [`${groupPrefixCls}-wrap`]: Object.assign({}, initMotion(`${groupPrefixCls}-wrap`, moveDownIn, moveDownOut, motionDurationSlow, true))\n }, {\n [`${groupPrefixCls}-wrap`]: {\n [`\n &${groupPrefixCls}-wrap-enter,\n &${groupPrefixCls}-wrap-appear\n `]: {\n opacity: 0,\n animationTimingFunction: motionEaseInOutCirc\n },\n [`&${groupPrefixCls}-wrap-leave`]: {\n animationTimingFunction: motionEaseInOutCirc\n }\n }\n }];\n};\n// ============================== Group ==============================\nconst floatButtonGroupStyle = token => {\n const {\n antCls,\n componentCls,\n floatButtonSize,\n margin,\n borderRadiusLG,\n borderRadiusSM,\n badgeOffset,\n floatButtonBodyPadding,\n calc\n } = token;\n const groupPrefixCls = `${componentCls}-group`;\n return {\n [groupPrefixCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n zIndex: token.zIndexPopupBase,\n display: 'block',\n border: 'none',\n position: 'fixed',\n width: floatButtonSize,\n height: 'auto',\n boxShadow: 'none',\n minHeight: floatButtonSize,\n insetInlineEnd: token.floatButtonInsetInlineEnd,\n insetBlockEnd: token.floatButtonInsetBlockEnd,\n borderRadius: borderRadiusLG,\n [`${groupPrefixCls}-wrap`]: {\n zIndex: -1,\n display: 'block',\n position: 'relative',\n marginBottom: margin\n },\n [`&${groupPrefixCls}-rtl`]: {\n direction: 'rtl'\n },\n [componentCls]: {\n position: 'static'\n }\n }),\n [`${groupPrefixCls}-circle`]: {\n [`${componentCls}-circle:not(:last-child)`]: {\n marginBottom: token.margin,\n [`${componentCls}-body`]: {\n width: floatButtonSize,\n height: floatButtonSize,\n borderRadius: '50%'\n }\n }\n },\n [`${groupPrefixCls}-square`]: {\n [`${componentCls}-square`]: {\n borderRadius: 0,\n padding: 0,\n '&:first-child': {\n borderStartStartRadius: borderRadiusLG,\n borderStartEndRadius: borderRadiusLG\n },\n '&:last-child': {\n borderEndStartRadius: borderRadiusLG,\n borderEndEndRadius: borderRadiusLG\n },\n '&:not(:last-child)': {\n borderBottom: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`\n },\n [`${antCls}-badge`]: {\n [`${antCls}-badge-count`]: {\n top: calc(calc(floatButtonBodyPadding).add(badgeOffset)).mul(-1).equal(),\n insetInlineEnd: calc(calc(floatButtonBodyPadding).add(badgeOffset)).mul(-1).equal()\n }\n }\n },\n [`${groupPrefixCls}-wrap`]: {\n display: 'block',\n borderRadius: borderRadiusLG,\n boxShadow: token.boxShadowSecondar
|