1 |
- {"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nconst genBaseStyle = token => {\n const {\n antCls,\n componentCls,\n iconCls,\n avatarBg,\n avatarColor,\n containerSize,\n containerSizeLG,\n containerSizeSM,\n textFontSize,\n textFontSizeLG,\n textFontSizeSM,\n iconFontSize,\n iconFontSizeLG,\n iconFontSizeSM,\n borderRadius,\n borderRadiusLG,\n borderRadiusSM,\n lineWidth,\n lineType\n } = token;\n // Avatar size style\n const avatarSizeStyle = (size, fontSize, iconFontSize, radius) => ({\n width: size,\n height: size,\n borderRadius: '50%',\n fontSize,\n [`&${componentCls}-square`]: {\n borderRadius: radius\n },\n [`&${componentCls}-icon`]: {\n fontSize: iconFontSize,\n [`> ${iconCls}`]: {\n margin: 0\n }\n }\n });\n return {\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n overflow: 'hidden',\n color: avatarColor,\n whiteSpace: 'nowrap',\n textAlign: 'center',\n verticalAlign: 'middle',\n background: avatarBg,\n border: `${unit(lineWidth)} ${lineType} transparent`,\n '&-image': {\n background: 'transparent'\n },\n [`${antCls}-image-img`]: {\n display: 'block'\n }\n }), avatarSizeStyle(containerSize, textFontSize, iconFontSize, borderRadius)), {\n '&-lg': Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, iconFontSizeLG, borderRadiusLG)),\n '&-sm': Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, iconFontSizeSM, borderRadiusSM)),\n '> img': {\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'cover'\n }\n })\n };\n};\nconst genGroupStyle = token => {\n const {\n componentCls,\n groupBorderColor,\n groupOverlapping,\n groupSpace\n } = token;\n return {\n [`${componentCls}-group`]: {\n display: 'inline-flex',\n [componentCls]: {\n borderColor: groupBorderColor\n },\n '> *:not(:first-child)': {\n marginInlineStart: groupOverlapping\n }\n },\n [`${componentCls}-group-popover`]: {\n [`${componentCls} + ${componentCls}`]: {\n marginInlineStart: groupSpace\n }\n }\n };\n};\nexport const prepareComponentToken = token => {\n const {\n controlHeight,\n controlHeightLG,\n controlHeightSM,\n fontSize,\n fontSizeLG,\n fontSizeXL,\n fontSizeHeading3,\n marginXS,\n marginXXS,\n colorBorderBg\n } = token;\n return {\n containerSize: controlHeight,\n containerSizeLG: controlHeightLG,\n containerSizeSM: controlHeightSM,\n textFontSize: fontSize,\n textFontSizeLG: fontSize,\n textFontSizeSM: fontSize,\n iconFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),\n iconFontSizeLG: fontSizeHeading3,\n iconFontSizeSM: fontSize,\n groupSpace: marginXXS,\n groupOverlapping: -marginXS,\n groupBorderColor: colorBorderBg\n };\n};\nexport default genStyleHooks('Avatar', token => {\n const {\n colorTextLightSolid,\n colorTextPlaceholder\n } = token;\n const avatarToken = mergeToken(token, {\n avatarBg: colorTextPlaceholder,\n avatarColor: colorTextLightSolid\n });\n return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];\n}, prepareComponentToken);","map":{"version":3,"names":["unit","resetComponent","genStyleHooks","mergeToken","genBaseStyle","token","antCls","componentCls","iconCls","avatarBg","avatarColor","containerSize","containerSizeLG","containerSizeSM","textFontSize","textFontSizeLG","textFontSizeSM","iconFontSize","iconFontSizeLG","iconFontSizeSM","borderRadius","borderRadiusLG","borderRadiusSM","lineWidth","lineType","avatarSizeStyle","size","fontSize","radius","width","height","margin","Object","assign","position","display","justifyContent","alignItems","overflow","color","whiteSpace","textAlign","verticalAlign","background","border","objectFit","genGroupStyle","groupBorderColor","groupOverlapping","groupSpace","borderColor","marginInlineStart","prepareComponentToken","controlHeight","controlHeightLG","controlHeightSM","fontSizeLG","fontSizeXL","fontSizeHeading3","marginXS","marginXXS","colorBorderBg","Math","round","colorTextLightSolid","colorTextPlaceholder","avatarToken"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/avatar/style/index.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\nconst genBaseStyle = token => {\n const {\n antCls,\n componentCls,\n iconCls,\n avatarBg,\n avatarColor,\n containerSize,\n containerSizeLG,\n containerSizeSM,\n textFontSize,\n textFontSizeLG,\n textFontSizeSM,\n iconFontSize,\n iconFontSizeLG,\n iconFontSizeSM,\n borderRadius,\n borderRadiusLG,\n borderRadiusSM,\n lineWidth,\n lineType\n } = token;\n // Avatar size style\n const avatarSizeStyle = (size, fontSize, iconFontSize, radius) => ({\n width: size,\n height: size,\n borderRadius: '50%',\n fontSize,\n [`&${componentCls}-square`]: {\n borderRadius: radius\n },\n [`&${componentCls}-icon`]: {\n fontSize: iconFontSize,\n [`> ${iconCls}`]: {\n margin: 0\n }\n }\n });\n return {\n [componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n overflow: 'hidden',\n color: avatarColor,\n whiteSpace: 'nowrap',\n textAlign: 'center',\n verticalAlign: 'middle',\n background: avatarBg,\n border: `${unit(lineWidth)} ${lineType} transparent`,\n '&-image': {\n background: 'transparent'\n },\n [`${antCls}-image-img`]: {\n display: 'block'\n }\n }), avatarSizeStyle(containerSize, textFontSize, iconFontSize, borderRadius)), {\n '&-lg': Object.assign({}, avatarSizeStyle(containerSizeLG, textFontSizeLG, iconFontSizeLG, borderRadiusLG)),\n '&-sm': Object.assign({}, avatarSizeStyle(containerSizeSM, textFontSizeSM, iconFontSizeSM, borderRadiusSM)),\n '> img': {\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'cover'\n }\n })\n };\n};\nconst genGroupStyle = token => {\n const {\n componentCls,\n groupBorderColor,\n groupOverlapping,\n groupSpace\n } = token;\n return {\n [`${componentCls}-group`]: {\n display: 'inline-flex',\n [componentCls]: {\n borderColor: groupBorderColor\n },\n '> *:not(:first-child)': {\n marginInlineStart: groupOverlapping\n }\n },\n [`${componentCls}-group-popover`]: {\n [`${componentCls} + ${componentCls}`]: {\n marginInlineStart: groupSpace\n }\n }\n };\n};\nexport const prepareComponentToken = token => {\n const {\n controlHeight,\n controlHeightLG,\n controlHeightSM,\n fontSize,\n fontSizeLG,\n fontSizeXL,\n fontSizeHeading3,\n marginXS,\n marginXXS,\n colorBorderBg\n } = token;\n return {\n containerSize: controlHeight,\n containerSizeLG: controlHeightLG,\n containerSizeSM: controlHeightSM,\n textFontSize: fontSize,\n textFontSizeLG: fontSize,\n textFontSizeSM: fontSize,\n iconFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),\n iconFontSizeLG: fontSizeHeading3,\n iconFontSizeSM: fontSize,\n groupSpace: marginXXS,\n groupOverlapping: -marginXS,\n groupBorderColor: colorBorderBg\n };\n};\nexport default genStyleHooks('Avatar', token => {\n const {\n colorTextLightSolid,\n colorTextPlaceholder\n } = token;\n const avatarToken = mergeToken(token, {\n avatarBg: colorTextPlaceholder,\n avatarColor: colorTextLightSolid\n });\n return [genBaseStyle(avatarToken), genGroupStyle(avatarToken)];\n}, prepareComponentToken);"],"mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,aAAa,EAAEC,UAAU,QAAQ,sBAAsB;AAChE,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,MAAM;IACNC,YAAY;IACZC,OAAO;IACPC,QAAQ;IACRC,WAAW;IACXC,aAAa;IACbC,eAAe;IACfC,eAAe;IACfC,YAAY;IACZC,cAAc;IACdC,cAAc;IACdC,YAAY;IACZC,cAAc;IACdC,cAAc;IACdC,YAAY;IACZC,cAAc;IACdC,cAAc;IACdC,SAAS;IACTC;EACF,CAAC,GAAGnB,KAAK;EACT;EACA,MAAMoB,eAAe,GAAGA,C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