1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"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 Group = props => {\n var _a, _b, _c;\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 warning.deprecated(!maxCount, 'maxCount', 'max={{ count: number }}');\n warning.deprecated(!maxStyle, 'maxStyle', 'max={{ style: CSSProperties }}');\n warning.deprecated(!maxPopoverPlacement, 'maxPopoverPlacement', 'max={{ popover: PopoverProps }}');\n warning.deprecated(!maxPopoverTrigger, 'maxPopoverTrigger', 'max={{ popover: PopoverProps }}');\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 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 overlayClassName: classNames(`${groupPrefixCls}-popover`, (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.overlayClassName),\n placement: mergePopoverPlacement,\n trigger: mergePopoverTrigger\n });\n childrenShow.push( /*#__PURE__*/React.createElement(Popover, Object.assign({\n key: \"avatar-popover-key\",\n destroyTooltipOnHide: 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 Group;","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","Group","_a","_b","_c","getPrefixCls","direction","prefixCls","customizePrefixCls","className","rootClassName","style","maxCount","maxStyle","maxPopoverPlacement","maxPopoverTrigger","max","process","env","NODE_ENV","warning","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","overlayClassName","push","destroyTooltipOnHide"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/avatar/group.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 Group = props => {\n var _a, _b, _c;\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 warning.deprecated(!maxCount, 'maxCount', 'max={{ count: number }}');\n warning.deprecated(!maxStyle, 'maxStyle', 'max={{ style: CSSProperties }}');\n warning.deprecated(!maxPopoverPlacement, 'maxPopoverPlacement', 'max={{ popover: PopoverProps }}');\n warning.deprecated(!maxPopoverTrigger, 'maxPopoverTrigger', 'max={{ popover: PopoverProps }}');\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 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 overlayClassName: classNames(`${groupPrefixCls}-popover`, (_c = max === null || max === void 0 ? void 0 : max.popover) === null || _c === void 0 ? void 0 : _c.overlayClassName),\n placement: mergePopoverPlacement,\n trigger: mergePopoverTrigger\n });\n childrenShow.push( /*#__PURE__*/React.createElement(Popover, Object.assign({\n key: \"avatar-popover-key\",\n destroyTooltipOnHide: 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 Group;"],"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,KAAK,GAAGV,KAAK,IAAI;EACrB,IAAIW,EAAE,EAAEC,EAAE,EAAEC,EAAE;EACd,MAAM;IACJC,YAAY;IACZC;EACF,CAAC,GAAG3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