1 |
- {"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { ConfigContext } from '../config-provider';\nimport useSize from '../config-provider/hooks/useSize';\nimport useStyle from './style';\nexport const SpaceCompactItemContext = /*#__PURE__*/React.createContext(null);\nexport const useCompactItemContext = (prefixCls, direction) => {\n const compactItemContext = React.useContext(SpaceCompactItemContext);\n const compactItemClassnames = React.useMemo(() => {\n if (!compactItemContext) {\n return '';\n }\n const {\n compactDirection,\n isFirstItem,\n isLastItem\n } = compactItemContext;\n const separator = compactDirection === 'vertical' ? '-vertical-' : '-';\n return classNames(`${prefixCls}-compact${separator}item`, {\n [`${prefixCls}-compact${separator}first-item`]: isFirstItem,\n [`${prefixCls}-compact${separator}last-item`]: isLastItem,\n [`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl'\n });\n }, [prefixCls, direction, compactItemContext]);\n return {\n compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,\n compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,\n compactItemClassnames\n };\n};\nexport const NoCompactStyle = props => {\n const {\n children\n } = props;\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: null\n }, children);\n};\nconst CompactItem = props => {\n const {\n children\n } = props,\n others = __rest(props, [\"children\"]);\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: React.useMemo(() => others, [others])\n }, children);\n};\nconst Compact = props => {\n const {\n getPrefixCls,\n direction: directionConfig\n } = React.useContext(ConfigContext);\n const {\n size,\n direction,\n block,\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n children\n } = props,\n restProps = __rest(props, [\"size\", \"direction\", \"block\", \"prefixCls\", \"className\", \"rootClassName\", \"children\"]);\n const mergedSize = useSize(ctx => size !== null && size !== void 0 ? size : ctx);\n const prefixCls = getPrefixCls('space-compact', customizePrefixCls);\n const [wrapCSSVar, hashId] = useStyle(prefixCls);\n const clx = classNames(prefixCls, hashId, {\n [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-vertical`]: direction === 'vertical'\n }, className, rootClassName);\n const compactItemContext = React.useContext(SpaceCompactItemContext);\n const childNodes = toArray(children);\n const nodes = React.useMemo(() => childNodes.map((child, i) => {\n const key = (child === null || child === void 0 ? void 0 : child.key) || `${prefixCls}-item-${i}`;\n return /*#__PURE__*/React.createElement(CompactItem, {\n key: key,\n compactSize: mergedSize,\n compactDirection: direction,\n isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),\n isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))\n }, child);\n }), [size, childNodes, compactItemContext]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n return wrapCSSVar(/*#__PURE__*/React.createElement(\"div\", Object.assign({\n className: clx\n }, restProps), nodes));\n};\nexport default Compact;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","toArray","ConfigContext","useSize","useStyle","SpaceCompactItemContext","createContext","useCompactItemContext","prefixCls","direction","compactItemContext","useContext","compactItemClassnames","useMemo","compactDirection","isFirstItem","isLastItem","separator","compactSize","NoCompactStyle","props","children","createElement","Provider","value","CompactItem","others","Compact","getPrefixCls","directionConfig","size","block","customizePrefixCls","className","rootClassName","restProps","mergedSize","ctx","wrapCSSVar","hashId","clx","childNodes","nodes","map","child","key","assign"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/space/Compact.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { ConfigContext } from '../config-provider';\nimport useSize from '../config-provider/hooks/useSize';\nimport useStyle from './style';\nexport const SpaceCompactItemContext = /*#__PURE__*/React.createContext(null);\nexport const useCompactItemContext = (prefixCls, direction) => {\n const compactItemContext = React.useContext(SpaceCompactItemContext);\n const compactItemClassnames = React.useMemo(() => {\n if (!compactItemContext) {\n return '';\n }\n const {\n compactDirection,\n isFirstItem,\n isLastItem\n } = compactItemContext;\n const separator = compactDirection === 'vertical' ? '-vertical-' : '-';\n return classNames(`${prefixCls}-compact${separator}item`, {\n [`${prefixCls}-compact${separator}first-item`]: isFirstItem,\n [`${prefixCls}-compact${separator}last-item`]: isLastItem,\n [`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl'\n });\n }, [prefixCls, direction, compactItemContext]);\n return {\n compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,\n compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,\n compactItemClassnames\n };\n};\nexport const NoCompactStyle = props => {\n const {\n children\n } = props;\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: null\n }, children);\n};\nconst CompactItem = props => {\n const {\n children\n } = props,\n others = __rest(props, [\"children\"]);\n return /*#__PURE__*/React.createElement(SpaceCompactItemContext.Provider, {\n value: React.useMemo(() => others, [others])\n }, children);\n};\nconst Compact = props => {\n const {\n getPrefixCls,\n direction: directionConfig\n } = React.useContext(ConfigContext);\n const {\n size,\n direction,\n block,\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n children\n } = props,\n restProps = __rest(props, [\"size\", \"direction\", \"block\", \"prefixCls\", \"className\", \"rootClassName\", \"children\"]);\n const mergedSize = useSize(ctx => size !== null && size !== void 0 ? size : ctx);\n const prefixCls = getPrefixCls('space-compact', customizePrefixCls);\n const [wrapCSSVar, hashId] = useStyle(prefixCls);\n const clx = classNames(prefixCls, hashId, {\n [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-vertical`]: direction === 'vertical'\n }, className, rootClassName);\n const compactItemContext = React.useContext(SpaceCompactItemContext);\n const childNodes = toArray(children);\n const nodes = React.useMemo(() => childNodes.map((child, i) => {\n const key = (child === null || child === void 0 ? void 0 : child.key) || `${prefixCls}-item-${i}`;\n return /*#__PURE__*/React.createElement(CompactItem, {\n key: key,\n compactSize: mergedSize,\n compactDirection: direction,\n isFirstItem: i === 0 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isFirstItem)),\n isLastItem: i === childNodes.length - 1 && (!compactItemContext || (compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.isLastItem))\n }, child);\n }), [size, childNodes, compactItemContext]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n return wrapCSSVar(/*#__PURE__*/React.createElement(\"div\", Object.assign({\n className: clx\n }, restProps), nodes));\n};\nexport default Compact;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,C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