1 |
- {"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { initZoomMotion } from '../../style/motion';\nimport getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS } from '../../style/placementArrow';\nimport { getArrowToken } from '../../style/roundedArrow';\nimport { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal';\nconst genTooltipStyle = token => {\n const {\n calc,\n componentCls,\n // ant-tooltip\n tooltipMaxWidth,\n tooltipColor,\n tooltipBg,\n tooltipBorderRadius,\n zIndexPopup,\n controlHeight,\n boxShadowSecondary,\n paddingSM,\n paddingXS,\n arrowOffsetHorizontal,\n sizePopupArrow\n } = token;\n // arrowOffsetHorizontal + arrowWidth + borderRadius\n const edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();\n // borderRadius * 2 + arrowWidth\n const centerAlignMinWidth = calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal();\n return [{\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'absolute',\n zIndex: zIndexPopup,\n display: 'block',\n width: 'max-content',\n maxWidth: tooltipMaxWidth,\n visibility: 'visible',\n // When use `autoArrow`, origin will follow the arrow position\n '--valid-offset-x': 'var(--arrow-offset-horizontal, var(--arrow-x))',\n transformOrigin: [`var(--valid-offset-x, 50%)`, `var(--arrow-y, 50%)`].join(' '),\n '&-hidden': {\n display: 'none'\n },\n '--antd-arrow-background-color': tooltipBg,\n // Wrapper for the tooltip content\n [`${componentCls}-inner`]: {\n minWidth: centerAlignMinWidth,\n minHeight: controlHeight,\n padding: `${unit(token.calc(paddingSM).div(2).equal())} ${unit(paddingXS)}`,\n color: `var(--ant-tooltip-color, ${tooltipColor})`,\n textAlign: 'start',\n textDecoration: 'none',\n wordWrap: 'break-word',\n backgroundColor: tooltipBg,\n borderRadius: tooltipBorderRadius,\n boxShadow: boxShadowSecondary,\n boxSizing: 'border-box'\n },\n // Align placement should have another min width\n [[`&-placement-topLeft`, `&-placement-topRight`, `&-placement-bottomLeft`, `&-placement-bottomRight`].join(',')]: {\n minWidth: edgeAlignMinWidth\n },\n // Limit left and right placement radius\n [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(',')]: {\n [`${componentCls}-inner`]: {\n borderRadius: token.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)\n }\n },\n [`${componentCls}-content`]: {\n position: 'relative'\n }\n }), genPresetColor(token, (colorKey, {\n darkColor\n }) => ({\n [`&${componentCls}-${colorKey}`]: {\n [`${componentCls}-inner`]: {\n backgroundColor: darkColor\n },\n [`${componentCls}-arrow`]: {\n '--antd-arrow-background-color': darkColor\n }\n }\n }))), {\n // RTL\n '&-rtl': {\n direction: 'rtl'\n }\n })\n },\n // Arrow Style\n getArrowStyle(token, 'var(--antd-arrow-background-color)'),\n // Pure Render\n {\n [`${componentCls}-pure`]: {\n position: 'relative',\n maxWidth: 'none',\n margin: token.sizePopupArrow\n }\n }];\n};\n// ============================== Export ==============================\nexport const prepareComponentToken = token => Object.assign(Object.assign({\n zIndexPopup: token.zIndexPopupBase + 70\n}, getArrowOffsetToken({\n contentRadius: token.borderRadius,\n limitVerticalRadius: true\n})), getArrowToken(mergeToken(token, {\n borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)\n})));\nexport default (prefixCls, injectStyle = true) => {\n const useStyle = genStyleHooks('Tooltip', token => {\n const {\n borderRadius,\n colorTextLightSolid,\n colorBgSpotlight\n } = token;\n const TooltipToken = mergeToken(token, {\n // default variables\n tooltipMaxWidth: 250,\n tooltipColor: colorTextLightSolid,\n tooltipBorderRadius: borderRadius,\n tooltipBg: colorBgSpotlight\n });\n return [genTooltipStyle(TooltipToken), initZoomMotion(token, 'zoom-big-fast')];\n }, prepareComponentToken, {\n resetStyle: false,\n // Popover use Tooltip as internal component. We do not need to handle this.\n injectStyle\n });\n return useStyle(prefixCls);\n};","map":{"version":3,"names":["unit","resetComponent","initZoomMotion","getArrowStyle","getArrowOffsetToken","MAX_VERTICAL_CONTENT_RADIUS","getArrowToken","genPresetColor","genStyleHooks","mergeToken","genTooltipStyle","token","calc","componentCls","tooltipMaxWidth","tooltipColor","tooltipBg","tooltipBorderRadius","zIndexPopup","controlHeight","boxShadowSecondary","paddingSM","paddingXS","arrowOffsetHorizontal","sizePopupArrow","edgeAlignMinWidth","add","equal","centerAlignMinWidth","mul","Object","assign","position","zIndex","display","width","maxWidth","visibility","transformOrigin","join","minWidth","minHeight","padding","div","color","textAlign","textDecoration","wordWrap","backgroundColor","borderRadius","boxShadow","boxSizing","min","colorKey","darkColor","direction","margin","prepareComponentToken","zIndexPopupBase","contentRadius","limitVerticalRadius","borderRadiusOuter","Math","prefixCls","injectStyle","useStyle","colorTextLightSolid","colorBgSpotlight","TooltipToken","resetStyle"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/tooltip/style/index.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { initZoomMotion } from '../../style/motion';\nimport getArrowStyle, { getArrowOffsetToken, MAX_VERTICAL_CONTENT_RADIUS } from '../../style/placementArrow';\nimport { getArrowToken } from '../../style/roundedArrow';\nimport { genPresetColor, genStyleHooks, mergeToken } from '../../theme/internal';\nconst genTooltipStyle = token => {\n const {\n calc,\n componentCls,\n // ant-tooltip\n tooltipMaxWidth,\n tooltipColor,\n tooltipBg,\n tooltipBorderRadius,\n zIndexPopup,\n controlHeight,\n boxShadowSecondary,\n paddingSM,\n paddingXS,\n arrowOffsetHorizontal,\n sizePopupArrow\n } = token;\n // arrowOffsetHorizontal + arrowWidth + borderRadius\n const edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();\n // borderRadius * 2 + arrowWidth\n const centerAlignMinWidth = calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal();\n return [{\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'absolute',\n zIndex: zIndexPopup,\n display: 'block',\n width: 'max-content',\n maxWidth: tooltipMaxWidth,\n visibility: 'visible',\n // When use `autoArrow`, origin will follow the arrow position\n '--valid-offset-x': 'var(--arrow-offset-horizontal, var(--arrow-x))',\n transformOrigin: [`var(--valid-offset-x, 50%)`, `var(--arrow-y, 50%)`].join(' '),\n '&-hidden': {\n display: 'none'\n },\n '--antd-arrow-background-color': tooltipBg,\n // Wrapper for the tooltip content\n [`${componentCls}-inner`]: {\n minWidth: centerAlignMinWidth,\n minHeight: controlHeight,\n padding: `${unit(token.calc(paddingSM).div(2).equal())} ${unit(paddingXS)}`,\n color: `var(--ant-tooltip-color, ${tooltipColor})`,\n textAlign: 'start',\n textDecoration: 'none',\n wordWrap: 'break-word',\n backgroundColor: tooltipBg,\n borderRadius: tooltipBorderRadius,\n boxShadow: boxShadowSecondary,\n boxSizing: 'border-box'\n },\n // Align placement should have another min width\n [[`&-placement-topLeft`, `&-placement-topRight`, `&-placement-bottomLeft`, `&-placement-bottomRight`].join(',')]: {\n minWidth: edgeAlignMinWidth\n },\n // Limit left and right placement radius\n [[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(',')]: {\n [`${componentCls}-inner`]: {\n borderRadius: token.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)\n }\n },\n [`${componentCls}-content`]: {\n position: 'relative'\n }\n }), genPresetColor(token, (colorKey, {\n darkColor\n }) => ({\n [`&${componentCls}-${colorKey}`]: {\n [`${componentCls}-inner`]: {\n backgroundColor: darkColor\n },\n [`${componentCls}-arrow`]: {\n '--antd-arrow-background-color': darkColor\n }\n }\n }))), {\n // RTL\n '&-rtl': {\n direction: 'rtl'\n }\n })\n },\n // Arrow Style\n getArrowStyle(token, 'var(--antd-arrow-background-color)'),\n // Pure Render\n {\n [`${componentCls}-pure`]: {\n position: 'relative',\n maxWidth: 'none',\n margin: token.sizePopupArrow\n }\n }];\n};\n// ============================== Export ==============================\nexport const prepareComponentToken = token => Object.assign(Object.assign({\n zIndexPopup: token.zIndexPopupBase + 70\n}, getArrowOffsetToken({\n contentRadius: token.borderRadius,\n limitVerticalRadius: true\n})), getArrowToken(mergeToken(token, {\n borderRadiusOuter: Math.min(token.borderRadiusOuter, 4)\n})));\nexport default (prefixCls, injectStyle = true) => {\n const useStyle = genStyleHooks('Tooltip', token => {\n const {\n borderRadius,\n colorTextLightSolid,\n colorBgSpotlight\n } = token;\n const TooltipToken = mergeToken(token, {\n // default variables\n tooltipMaxWidth: 250,\n tooltipColor: colorTextLightSolid,\n tooltipBorderRadius: borderRadius,\n tooltipBg: colorBgSpotlight\n });\n return [genTooltipStyle(TooltipToken), initZoomMotion(token, 'zoom-big-fast')];\n }, prepareComponentToken, {\n resetStyle: false,\n // Popover use Tooltip as internal component. We do not need to handle this.\n injectStyle\n });\n return useStyle(prefixCls);\n};"],"mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,aAAa,IAAIC,mBAAmB,EAAEC,2BAA2B,QAAQ,4BAA4B;AAC5G,SAASC,aAAa,QAAQ,0BAA0B;AACxD,SAASC,cAAc,EAAEC,aAAa,EAAEC,UAAU,QAAQ,sBAAsB;AAChF,MAAMC,eAAe,GAAGC,KAAK,IAAI;EAC/B,MAAM;IACJC,IAAI;IACJC,YAAY;IACZ;IACAC,eAAe;IACfC,YAAY;IACZC,SAAS;IACTC,mBAAmB;IACnBC,WAAW;IACXC,aAAa;IACbC,kBAAkB;IAClBC,SAAS;IACTC,SAAS;IACTC,qBAAqB;IACrBC;EACF,CAAC,GAAGb,KAAK;EACT;EACA,MAAMc,iBAAiB,GAAGb,IAAI,CAACK,mBAAmB,CAAC,CAACS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