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 RcSegmented from 'rc-segmented';\nimport useId from \"rc-util/es/hooks/useId\";\nimport { useComponentConfig } from '../config-provider/context';\nimport useSize from '../config-provider/hooks/useSize';\nimport useStyle from './style';\nfunction isSegmentedLabeledOptionWithIcon(option) {\n return typeof option === 'object' && !!(option === null || option === void 0 ? void 0 : option.icon);\n}\nconst InternalSegmented = /*#__PURE__*/React.forwardRef((props, ref) => {\n const defaultName = useId();\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n block,\n options = [],\n size: customSize = 'middle',\n style,\n vertical,\n shape = 'default',\n name = defaultName\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"rootClassName\", \"block\", \"options\", \"size\", \"style\", \"vertical\", \"shape\", \"name\"]);\n const {\n getPrefixCls,\n direction,\n className: contextClassName,\n style: contextStyle\n } = useComponentConfig('segmented');\n const prefixCls = getPrefixCls('segmented', customizePrefixCls);\n // Style\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n // ===================== Size =====================\n const mergedSize = useSize(customSize);\n // syntactic sugar to support `icon` for Segmented Item\n const extendedOptions = React.useMemo(() => options.map(option => {\n if (isSegmentedLabeledOptionWithIcon(option)) {\n const {\n icon,\n label\n } = option,\n restOption = __rest(option, [\"icon\", \"label\"]);\n return Object.assign(Object.assign({}, restOption), {\n label: (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-item-icon`\n }, icon), label && /*#__PURE__*/React.createElement(\"span\", null, label)))\n });\n }\n return option;\n }), [options, prefixCls]);\n const cls = classNames(className, rootClassName, contextClassName, {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-sm`]: mergedSize === 'small',\n [`${prefixCls}-lg`]: mergedSize === 'large',\n [`${prefixCls}-vertical`]: vertical,\n [`${prefixCls}-shape-${shape}`]: shape === 'round'\n }, hashId, cssVarCls);\n const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);\n return wrapCSSVar(/*#__PURE__*/React.createElement(RcSegmented, Object.assign({}, restProps, {\n name: name,\n className: cls,\n style: mergedStyle,\n options: extendedOptions,\n ref: ref,\n prefixCls: prefixCls,\n direction: direction,\n vertical: vertical\n })));\n});\nconst Segmented = InternalSegmented;\nif (process.env.NODE_ENV !== 'production') {\n Segmented.displayName = 'Segmented';\n}\nexport default Segmented;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","RcSegmented","useId","useComponentConfig","useSize","useStyle","isSegmentedLabeledOptionWithIcon","option","icon","InternalSegmented","forwardRef","props","ref","defaultName","prefixCls","customizePrefixCls","className","rootClassName","block","options","size","customSize","style","vertical","shape","name","restProps","getPrefixCls","direction","contextClassName","contextStyle","wrapCSSVar","hashId","cssVarCls","mergedSize","extendedOptions","useMemo","map","label","restOption","assign","createElement","Fragment","cls","mergedStyle","Segmented","process","env","NODE_ENV","displayName"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/segmented/index.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 RcSegmented from 'rc-segmented';\nimport useId from \"rc-util/es/hooks/useId\";\nimport { useComponentConfig } from '../config-provider/context';\nimport useSize from '../config-provider/hooks/useSize';\nimport useStyle from './style';\nfunction isSegmentedLabeledOptionWithIcon(option) {\n return typeof option === 'object' && !!(option === null || option === void 0 ? void 0 : option.icon);\n}\nconst InternalSegmented = /*#__PURE__*/React.forwardRef((props, ref) => {\n const defaultName = useId();\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n block,\n options = [],\n size: customSize = 'middle',\n style,\n vertical,\n shape = 'default',\n name = defaultName\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"rootClassName\", \"block\", \"options\", \"size\", \"style\", \"vertical\", \"shape\", \"name\"]);\n const {\n getPrefixCls,\n direction,\n className: contextClassName,\n style: contextStyle\n } = useComponentConfig('segmented');\n const prefixCls = getPrefixCls('segmented', customizePrefixCls);\n // Style\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n // ===================== Size =====================\n const mergedSize = useSize(customSize);\n // syntactic sugar to support `icon` for Segmented Item\n const extendedOptions = React.useMemo(() => options.map(option => {\n if (isSegmentedLabeledOptionWithIcon(option)) {\n const {\n icon,\n label\n } = option,\n restOption = __rest(option, [\"icon\", \"label\"]);\n return Object.assign(Object.assign({}, restOption), {\n label: (/*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-item-icon`\n }, icon), label && /*#__PURE__*/React.createElement(\"span\", null, label)))\n });\n }\n return option;\n }), [options, prefixCls]);\n const cls = classNames(className, rootClassName, contextClassName, {\n [`${prefixCls}-block`]: block,\n [`${prefixCls}-sm`]: mergedSize === 'small',\n [`${prefixCls}-lg`]: mergedSize === 'large',\n [`${prefixCls}-vertical`]: vertical,\n [`${prefixCls}-shape-${shape}`]: shape === 'round'\n }, hashId, cssVarCls);\n const mergedStyle = Object.assign(Object.assign({}, contextStyle), style);\n return wrapCSSVar(/*#__PURE__*/React.createElement(RcSegmented, Object.assign({}, restProps, {\n name: name,\n className: cls,\n style: mergedStyle,\n options: extendedOptions,\n ref: ref,\n prefixCls: prefixCls,\n direction: direction,\n vertical: vertical\n })));\n});\nconst Segmented = InternalSegmented;\nif (process.env.NODE_ENV !== 'production') {\n Segmented.displayName = 'Segmented';\n}\nexport default Segmented;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAA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