1 line
6.6 KiB
JSON
1 line
6.6 KiB
JSON
|
{"ast":null,"code":"// handle border collapse\nfunction compactItemBorder(token, parentCls, options) {\n const {\n focusElCls,\n focus,\n borderElCls\n } = options;\n const childCombinator = borderElCls ? '> *' : '';\n const hoverEffects = ['hover', focus ? 'focus' : null, 'active'].filter(Boolean).map(n => `&:${n} ${childCombinator}`).join(',');\n return {\n [`&-item:not(${parentCls}-last-item)`]: {\n marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()\n },\n '&-item': Object.assign(Object.assign({\n [hoverEffects]: {\n zIndex: 2\n }\n }, focusElCls ? {\n [`&${focusElCls}`]: {\n zIndex: 2\n }\n } : {}), {\n [`&[disabled] ${childCombinator}`]: {\n zIndex: 0\n }\n })\n };\n}\n// handle border-radius\nfunction compactItemBorderRadius(prefixCls, parentCls, options) {\n const {\n borderElCls\n } = options;\n const childCombinator = borderElCls ? `> ${borderElCls}` : '';\n return {\n [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {\n borderRadius: 0\n },\n [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {\n [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {\n borderStartEndRadius: 0,\n borderEndEndRadius: 0\n }\n },\n [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {\n [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {\n borderStartStartRadius: 0,\n borderEndStartRadius: 0\n }\n }\n };\n}\nexport function genCompactItemStyle(token) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n focus: true\n };\n const {\n componentCls\n } = token;\n const compactCls = `${componentCls}-compact`;\n return {\n [compactCls]: Object.assign(Object.assign({}, compactItemBorder(token, compactCls, options)), compactItemBorderRadius(componentCls, compactCls, options))\n };\n}","map":{"version":3,"names":["compactItemBorder","token","parentCls","options","focusElCls","focus","borderElCls","childCombinator","hoverEffects","filter","Boolean","map","n","join","marginInlineEnd","calc","lineWidth","mul","equal","Object","assign","zIndex","compactItemBorderRadius","prefixCls","borderRadius","borderStartEndRadius","borderEndEndRadius","borderStartStartRadius","borderEndStartRadius","genCompactItemStyle","arguments","length","undefined","componentCls","compactCls"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/style/compact-item.js"],"sourcesContent":["// handle border collapse\nfunction compactItemBorder(token, parentCls, options) {\n const {\n focusElCls,\n focus,\n borderElCls\n } = options;\n const childCombinator = borderElCls ? '> *' : '';\n const hoverEffects = ['hover', focus ? 'focus' : null, 'active'].filter(Boolean).map(n => `&:${n} ${childCombinator}`).join(',');\n return {\n [`&-item:not(${parentCls}-last-item)`]: {\n marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal()\n },\n '&-item': Object.assign(Object.assign({\n [hoverEffects]: {\n zIndex: 2\n }\n }, focusElCls ? {\n [`&${focusElCls}`]: {\n zIndex: 2\n }\n } : {}), {\n [`&[disabled] ${childCombinator}`]: {\n zIndex: 0\n }\n })\n };\n}\n// handle border-radius\nfunction compactItemBorderRadius(prefixCls, parentCls, options) {\n const {\n borderElCls\n } = options;\n const childCombinator = borderElCls ? `> ${borderElCls}` : '';\n return {\n [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {\n borderRadius: 0\n },\n [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {\n [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {\n borderStartEndRadius: 0,\n borderEndEndRadius: 0\n }\n },\n [`&-item:not(${parentCls}-first-item)${p
|