1 |
- {"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { cloneElement } from '../_util/reactNode';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport Popover from '../popover';\nimport Avatar from './Avatar';\nimport AvatarContext from './AvatarContext';\nimport useStyle from './style';\nconst AvatarContextProvider = props => {\n const {\n size,\n shape\n } = React.useContext(AvatarContext);\n const avatarContextValue = React.useMemo(() => ({\n size: props.size || size,\n shape: props.shape || shape\n }), [props.size, props.shape, size, shape]);\n return /*#__PURE__*/React.createElement(AvatarContext.Provider, {\n value: avatarContextValue\n }, props.children);\n};\nconst AvatarGroup = props => {\n var _a, _b, _c, _d;\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n style,\n maxCount,\n maxStyle,\n size,\n shape,\n maxPopoverPlacement,\n maxPopoverTrigger,\n children,\n max\n } = props;\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Avatar.Group');\n [['maxCount', 'max={{ count: number }}'], ['maxStyle', 'max={{ style: CSSProperties }}'], ['maxPopoverPlacement', 'max={{ popover: PopoverProps }}'], ['maxPopoverTrigger', 'max={{ popover: PopoverProps }}']].forEach(([deprecatedName, newName]) => {\n warning.deprecated(!(deprecatedName in props), deprecatedName, newName);\n });\n }\n const prefixCls = getPrefixCls('avatar', customizePrefixCls);\n const groupPrefixCls = `${prefixCls}-group`;\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const cls = classNames(groupPrefixCls, {\n [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n }, cssVarCls, rootCls, className, rootClassName, hashId);\n const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {\n // eslint-disable-next-line react/no-array-index-key\n key: `avatar-key-${index}`\n }));\n const mergeCount = (max === null || max === void 0 ? void 0 : max.count) || maxCount;\n const numOfChildren = childrenWithProps.length;\n if (mergeCount && mergeCount < numOfChildren) {\n const childrenShow = childrenWithProps.slice(0, mergeCount);\n const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);\n const mergeStyle = (max === null || max === void 0 ? void 0 : max.style) || maxStyle;\n const mergePopoverTrigger = ((_a = max === null || max === void 0 ? void 0 : max.popover) === null || _a === void 0 ? void 0 : _a.trigger) || maxPopoverTrigger || 'hover';\n const mergePopoverPlacement = ((_b = max === null || max === void 0 ? void 0 : max.popover) === null || _b === void 0 ? void 0 : _b.placement) || maxPopoverPlacement || 'top';\n const mergeProps = Object.assign(Object.assign({\n content: childrenHidden\n }, max === null || max === void 0 ? void 0 : max.popover), {\n classNames: {\n root: classNames(`${groupPrefixCls}-popover`, (_d = (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.classNames) === null || _d === void 0 ? void 0 : _d.root)\n },\n placement: mergePopoverPlacement,\n trigger: mergePopoverTrigger\n });\n childrenShow.push(/*#__PURE__*/React.createElement(Popover, Object.assign({\n key: \"avatar-popover-key\",\n destroyOnHidden: true\n }, mergeProps), /*#__PURE__*/React.createElement(Avatar, {\n style: mergeStyle\n }, `+${numOfChildren - mergeCount}`)));\n return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {\n shape: shape,\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style\n }, childrenShow)));\n }\n return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {\n shape: shape,\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style\n }, childrenWithProps)));\n};\nexport default AvatarGroup;","map":{"version":3,"names":["React","classNames","toArray","cloneElement","devUseWarning","ConfigContext","useCSSVarCls","Popover","Avatar","AvatarContext","useStyle","AvatarContextProvider","props","size","shape","useContext","avatarContextValue","useMemo","createElement","Provider","value","children","AvatarGroup","_a","_b","_c","_d","getPrefixCls","direction","prefixCls","customizePrefixCls","className","rootClassName","style","maxCount","maxStyle","maxPopoverPlacement","maxPopoverTrigger","max","process","env","NODE_ENV","warning","forEach","deprecatedName","newName","deprecated","groupPrefixCls","rootCls","wrapCSSVar","hashId","cssVarCls","cls","childrenWithProps","map","child","index","key","mergeCount","count","numOfChildren","length","childrenShow","slice","childrenHidden","mergeStyle","mergePopoverTrigger","popover","trigger","mergePopoverPlacement","placement","mergeProps","Object","assign","content","root","push","destroyOnHidden"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/antd/es/avatar/AvatarGroup.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { cloneElement } from '../_util/reactNode';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport Popover from '../popover';\nimport Avatar from './Avatar';\nimport AvatarContext from './AvatarContext';\nimport useStyle from './style';\nconst AvatarContextProvider = props => {\n const {\n size,\n shape\n } = React.useContext(AvatarContext);\n const avatarContextValue = React.useMemo(() => ({\n size: props.size || size,\n shape: props.shape || shape\n }), [props.size, props.shape, size, shape]);\n return /*#__PURE__*/React.createElement(AvatarContext.Provider, {\n value: avatarContextValue\n }, props.children);\n};\nconst AvatarGroup = props => {\n var _a, _b, _c, _d;\n const {\n getPrefixCls,\n direction\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n style,\n maxCount,\n maxStyle,\n size,\n shape,\n maxPopoverPlacement,\n maxPopoverTrigger,\n children,\n max\n } = props;\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Avatar.Group');\n [['maxCount', 'max={{ count: number }}'], ['maxStyle', 'max={{ style: CSSProperties }}'], ['maxPopoverPlacement', 'max={{ popover: PopoverProps }}'], ['maxPopoverTrigger', 'max={{ popover: PopoverProps }}']].forEach(([deprecatedName, newName]) => {\n warning.deprecated(!(deprecatedName in props), deprecatedName, newName);\n });\n }\n const prefixCls = getPrefixCls('avatar', customizePrefixCls);\n const groupPrefixCls = `${prefixCls}-group`;\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const cls = classNames(groupPrefixCls, {\n [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n }, cssVarCls, rootCls, className, rootClassName, hashId);\n const childrenWithProps = toArray(children).map((child, index) => cloneElement(child, {\n // eslint-disable-next-line react/no-array-index-key\n key: `avatar-key-${index}`\n }));\n const mergeCount = (max === null || max === void 0 ? void 0 : max.count) || maxCount;\n const numOfChildren = childrenWithProps.length;\n if (mergeCount && mergeCount < numOfChildren) {\n const childrenShow = childrenWithProps.slice(0, mergeCount);\n const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);\n const mergeStyle = (max === null || max === void 0 ? void 0 : max.style) || maxStyle;\n const mergePopoverTrigger = ((_a = max === null || max === void 0 ? void 0 : max.popover) === null || _a === void 0 ? void 0 : _a.trigger) || maxPopoverTrigger || 'hover';\n const mergePopoverPlacement = ((_b = max === null || max === void 0 ? void 0 : max.popover) === null || _b === void 0 ? void 0 : _b.placement) || maxPopoverPlacement || 'top';\n const mergeProps = Object.assign(Object.assign({\n content: childrenHidden\n }, max === null || max === void 0 ? void 0 : max.popover), {\n classNames: {\n root: classNames(`${groupPrefixCls}-popover`, (_d = (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.classNames) === null || _d === void 0 ? void 0 : _d.root)\n },\n placement: mergePopoverPlacement,\n trigger: mergePopoverTrigger\n });\n childrenShow.push(/*#__PURE__*/React.createElement(Popover, Object.assign({\n key: \"avatar-popover-key\",\n destroyOnHidden: true\n }, mergeProps), /*#__PURE__*/React.createElement(Avatar, {\n style: mergeStyle\n }, `+${numOfChildren - mergeCount}`)));\n return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {\n shape: shape,\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style\n }, childrenShow)));\n }\n return wrapCSSVar(/*#__PURE__*/React.createElement(AvatarContextProvider, {\n shape: shape,\n size: size\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: style\n }, childrenWithProps)));\n};\nexport default AvatarGroup;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,YAAY,MAAM,uCAAuC;AAChE,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,MAAM,MAAM,UAAU;AAC7B,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,QAAQ,MAAM,SAAS;AAC9B,MAAMC,qBAAqB,GAAGC,KAAK,IAAI;EACrC,MAAM;IACJC,IAAI;IACJC;EACF,CAAC,GAAGd,KAAK,CAACe,UAAU,CAACN,aAAa,CAAC;EACnC,MAAMO,kBAAkB,GAAGhB,KAAK,CAACiB,OAAO,CAAC,OAAO;IAC9CJ,IAAI,EAAED,KAAK,CAACC,IAAI,IAAIA,IAAI;IACxBC,KAAK,EAAEF,KAAK,CAACE,KAAK,IAAIA;EACxB,CAAC,CAAC,EAAE,CAACF,KAAK,CAACC,IAAI,EAAED,KAAK,CAACE,KAAK,EAAED,IAAI,EAAEC,KAAK,CAAC,CAAC;EAC3C,OAAO,aAAad,KAAK,CAACkB,aAAa,CAACT,aAAa,CAACU,QAAQ,EAAE;IAC9DC,KAAK,EAAEJ;EACT,CAAC,EAAEJ,KAAK,CAACS,QAAQ,CAAC;AACpB,CAAC;AACD,MAAMC,WAAW,GAAGV,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