1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { mergeToken } from '../../theme/internal';\nfunction genSizeStyle(token, suffix) {\n const {\n componentCls,\n inputPaddingHorizontalBase,\n borderRadius\n } = token;\n const selectHeightWithoutBorder = token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal();\n const suffixCls = suffix ? `${componentCls}-${suffix}` : '';\n return {\n [`${componentCls}-single${suffixCls}`]: {\n fontSize: token.fontSize,\n height: token.controlHeight,\n // ========================= Selector =========================\n [`${componentCls}-selector`]: Object.assign(Object.assign({}, resetComponent(token, true)), {\n display: 'flex',\n borderRadius,\n [`${componentCls}-selection-search`]: {\n position: 'absolute',\n top: 0,\n insetInlineStart: inputPaddingHorizontalBase,\n insetInlineEnd: inputPaddingHorizontalBase,\n bottom: 0,\n '&-input': {\n width: '100%',\n WebkitAppearance: 'textfield'\n }\n },\n [`\n ${componentCls}-selection-item,\n ${componentCls}-selection-placeholder\n `]: {\n padding: 0,\n lineHeight: unit(selectHeightWithoutBorder),\n transition: `all ${token.motionDurationSlow}, visibility 0s`,\n alignSelf: 'center'\n },\n [`${componentCls}-selection-placeholder`]: {\n transition: 'none',\n pointerEvents: 'none'\n },\n // For common baseline align\n [['&:after', /* For '' value baseline align */\n `${componentCls}-selection-item:empty:after`, /* For undefined value baseline align */\n `${componentCls}-selection-placeholder:empty:after`].join(',')]: {\n display: 'inline-block',\n width: 0,\n visibility: 'hidden',\n content: '\"\\\\a0\"'\n }\n }),\n [`\n &${componentCls}-show-arrow ${componentCls}-selection-item,\n &${componentCls}-show-arrow ${componentCls}-selection-placeholder\n `]: {\n paddingInlineEnd: token.showArrowPaddingInlineEnd\n },\n // Opacity selection if open\n [`&${componentCls}-open ${componentCls}-selection-item`]: {\n color: token.colorTextPlaceholder\n },\n // ========================== Input ==========================\n // We only change the style of non-customize input which is only support by `combobox` mode.\n // Not customize\n [`&:not(${componentCls}-customize-input)`]: {\n [`${componentCls}-selector`]: {\n width: '100%',\n height: '100%',\n padding: `0 ${unit(inputPaddingHorizontalBase)}`,\n [`${componentCls}-selection-search-input`]: {\n height: selectHeightWithoutBorder\n },\n '&:after': {\n lineHeight: unit(selectHeightWithoutBorder)\n }\n }\n },\n [`&${componentCls}-customize-input`]: {\n [`${componentCls}-selector`]: {\n '&:after': {\n display: 'none'\n },\n [`${componentCls}-selection-search`]: {\n position: 'static',\n width: '100%'\n },\n [`${componentCls}-selection-placeholder`]: {\n position: 'absolute',\n insetInlineStart: 0,\n insetInlineEnd: 0,\n padding: `0 ${unit(inputPaddingHorizontalBase)}`,\n '&:after': {\n display: 'none'\n }\n }\n }\n }\n }\n };\n}\nexport default function genSingleStyle(token) {\n const {\n componentCls\n } = token;\n const inputPaddingHorizontalSM = token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal();\n return [genSizeStyle(token),\n // ======================== Small ========================\n // Shared\n genSizeStyle(mergeToken(token, {\n controlHeight: token.controlHeightSM,\n borderRadius: token.borderRadiusSM\n }), 'sm'),\n // padding\n {\n [`${componentCls}-single${componentCls}-sm`]: {\n [`&:not(${componentCls}-customize-input)`]: {\n [`${componentCls}-selection-search`]: {\n insetInlineStart: inputPaddingHorizontalSM,\n insetInlineEnd: inputPaddingHorizontalSM\n },\n [`${componentCls}-selector`]: {\n padding: `0 ${unit(inputPaddingHorizontalSM)}`\n },\n // With arrow should provides `padding-right` to show the arrow\n [`&${componentCls}-show-arrow ${componentCls}-selection-search`]: {\n insetInlineEnd: token.calc(inputPaddingHorizontalSM).add(token.calc(token.fontSize).mul(1.5)).equal()\n },\n [`\n &${componentCls}-show-arrow ${componentCls}-selection-item,\n &${componentCls}-show-arrow ${componentCls}-selection-placeholder\n `]: {\n paddingInlineEnd: token.calc(token.fontSize).mul(1.5).equal()\n }\n }\n }\n },\n // ======================== Large ========================\n // Shared\n genSizeStyle(mergeToken(token, {\n controlHeight: token.singleItemHeightLG,\n fontSize: token.fontSizeLG,\n borderRadius: token.borderRadiusLG\n }), 'lg')];\n}","map":{"version":3,"names":["unit","resetComponent","mergeToken","genSizeStyle","token","suffix","componentCls","inputPaddingHorizontalBase","borderRadius","selectHeightWithoutBorder","calc","controlHeight","sub","lineWidth","mul","equal","suffixCls","fontSize","height","Object","assign","display","position","top","insetInlineStart","insetInlineEnd","bottom","width","WebkitAppearance","padding","lineHeight","transition","motionDurationSlow","alignSelf","pointerEvents","join","visibility","content","paddingInlineEnd","showArrowPaddingInlineEnd","color","colorTextPlaceholder","genSingleStyle","inputPaddingHorizontalSM","controlPaddingHorizontalSM","controlHeightSM","borderRadiusSM","add","singleItemHeightLG","fontSizeLG","borderRadiusLG"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/select/style/single.js"],"sourcesContent":["import { unit } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { mergeToken } from '../../theme/internal';\nfunction genSizeStyle(token, suffix) {\n const {\n componentCls,\n inputPaddingHorizontalBase,\n borderRadius\n } = token;\n const selectHeightWithoutBorder = token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal();\n const suffixCls = suffix ? `${componentCls}-${suffix}` : '';\n return {\n [`${componentCls}-single${suffixCls}`]: {\n fontSize: token.fontSize,\n height: token.controlHeight,\n // ========================= Selector =========================\n [`${componentCls}-selector`]: Object.assign(Object.assign({}, resetComponent(token, true)), {\n display: 'flex',\n borderRadius,\n [`${componentCls}-selection-search`]: {\n position: 'absolute',\n top: 0,\n insetInlineStart: inputPaddingHorizontalBase,\n insetInlineEnd: inputPaddingHorizontalBase,\n bottom: 0,\n '&-input': {\n width: '100%',\n WebkitAppearance: 'textfield'\n }\n },\n [`\n ${componentCls}-selection-item,\n ${componentCls}-selection-placeholder\n `]: {\n padding: 0,\n lineHeight: unit(selectHeightWithoutBorder),\n transition: `all ${token.motionDurationSlow}, visibility 0s`,\n alignSelf: 'center'\n },\n [`${componentCls}-selection-placeholder`]: {\n transition: 'none',\n pointerEvents: 'none'\n },\n // For common baseline align\n [['&:after', /* For '' value baseline align */\n `${componentCls}-selection-item:empty:after`, /* For undefined value baseline align */\n `${componentCls}-selection-placeholder:empty:after`].join(',')]: {\n display: 'inline-block',\n width: 0,\n visibility: 'hidden',\n content: '\"\\\\a0\"'\n }\n }),\n [`\n &${componentCls}-show-arrow ${componentCls}-selection-item,\n &${componentCls}-show-arrow ${componentCls}-selection-placeholder\n `]: {\n paddingInlineEnd: token.showArrowPaddingInlineEnd\n },\n // Opacity selection if open\n [`&${componentCls}-open ${componentCls}-selection-item`]: {\n color: token.colorTextPlaceholder\n },\n // ========================== Input ==========================\n // We only change the style of non-customize input which is only support by `combobox` mode.\n // Not customize\n [`&:not(${componentCls}-customize-input)`]: {\n [`${componentCls}-selector`]: {\n width: '100%',\n height: '100%',\n padding: `0 ${unit(inputPaddingHorizontalBase)}`,\n [`${componentCls}-selection-search-input`]: {\n height: selectHeightWithoutBorder\n },\n '&:after': {\n lineHeight: unit(selectHeightWithoutBorder)\n }\n }\n },\n [`&${componentCls}-customize-input`]: {\n [`${componentCls}-selector`]: {\n '&:after': {\n display: 'none'\n },\n [`${componentCls}-selection-search`]: {\n position: 'static',\n width: '100%'\n },\n [`${componentCls}-selection-placeholder`]: {\n position: 'absolute',\n insetInlineStart: 0,\n insetInlineEnd: 0,\n padding: `0 ${unit(inputPaddingHorizontalBase)}`,\n '&:after': {\n display: 'none'\n }\n }\n }\n }\n }\n };\n}\nexport default function genSingleStyle(token) {\n const {\n componentCls\n } = token;\n const inputPaddingHorizontalSM = token.calc(token.controlPaddingHorizontalSM).sub(token.lineWidth).equal();\n return [genSizeStyle(token),\n // ======================== Small ========================\n // Shared\n genSizeStyle(mergeToken(token, {\n controlHeight: token.controlHeightSM,\n borderRadius: token.borderRadiusSM\n }), 'sm'),\n // padding\n {\n [`${componentCls}-single${componentCls}-sm`]: {\n [`&:not(${componentCls}-customize-input)`]: {\n [`${componentCls}-selection-search`]: {\n insetInlineStart: inputPaddingHorizontalSM,\n insetInlineEnd: inputPaddingHorizontalSM\n },\n [`${componentCls}-selector`]: {\n padding: `0 ${unit(inputPaddingHorizontalSM)}`\n },\n // With arrow should provides `padding-right` to show the arrow\n [`&${componentCls}-show-arrow ${componentCls}-selection-search`]: {\n insetInlineEnd: token.calc(inputPaddingHorizontalSM).add(token.calc(token.fontSize).mul(1.5)).equal()\n },\n [`\n &${componentCls}-show-arrow ${componentCls}-selection-item,\n &${componentCls}-show-arrow ${componentCls}-selection-placeholder\n `]: {\n paddingInlineEnd: token.calc(token.fontSize).mul(1.5).equal()\n }\n }\n }\n },\n // ======================== Large ========================\n // Shared\n genSizeStyle(mergeToken(token, {\n controlHeight: token.singleItemHeightLG,\n fontSize: token.fontSizeLG,\n borderRadius: token.borderRadiusLG\n }), 'lg')];\n}"],"mappings":"AAAA,SAASA,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,cAAc,QAAQ,aAAa;AAC5C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,YAAYA,CAACC,KAAK,EAAEC,MAAM,EAAE;EACnC,MAAM;IACJC,YAAY;IACZC,0BAA0B;IAC1BC;EACF,CAAC,GAAGJ,KAAK;EACT,MAAMK,yBAAyB,GAAGL,KAAK,CAACM,IAAI,CAACN,KAAK,CAACO,aAAa,CAAC,CAACC,GAAG,CAACR,KAAK,CAACM,IAAI,CAACN,KAAK,CAACS,SAAS,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC;EACjH,MAAMC,SAAS,GAAGX,MAAM,GAAG,GAAGC,YAAY,IAAID,MAAM,EAAE,GAAG,EAAE;EAC3D,OAAO;IACL,CAAC,GAAGC,YAAY,UAAUU,SAAS,EAAE,GAAG;MACtCC,QAAQ,EAAEb,KAAK,CAACa,QAAQ;MACxBC,MAAM,EAAEd,KAAK,CAACO,aAAa;MAC3B;MACA,CAAC,GAAGL,YAAY,WAAW,GAAGa,MAAM,CAACC,MAA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