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 { ConfigContext } from '../config-provider';\nimport SkeletonAvatar from './Avatar';\nimport SkeletonButton from './Button';\nimport Element from './Element';\nimport SkeletonImage from './Image';\nimport SkeletonInput from './Input';\nimport SkeletonNode from './Node';\nimport Paragraph from './Paragraph';\nimport useStyle from './style';\nimport Title from './Title';\nfunction getComponentProps(prop) {\n if (prop && typeof prop === 'object') {\n return prop;\n }\n return {};\n}\nfunction getAvatarBasicProps(hasTitle, hasParagraph) {\n if (hasTitle && !hasParagraph) {\n // Square avatar\n return {\n size: 'large',\n shape: 'square'\n };\n }\n return {\n size: 'large',\n shape: 'circle'\n };\n}\nfunction getTitleBasicProps(hasAvatar, hasParagraph) {\n if (!hasAvatar && hasParagraph) {\n return {\n width: '38%'\n };\n }\n if (hasAvatar && hasParagraph) {\n return {\n width: '50%'\n };\n }\n return {};\n}\nfunction getParagraphBasicProps(hasAvatar, hasTitle) {\n const basicProps = {};\n // Width\n if (!hasAvatar || !hasTitle) {\n basicProps.width = '61%';\n }\n // Rows\n if (!hasAvatar && hasTitle) {\n basicProps.rows = 3;\n } else {\n basicProps.rows = 2;\n }\n return basicProps;\n}\nconst Skeleton = props => {\n const {\n prefixCls: customizePrefixCls,\n loading,\n className,\n rootClassName,\n style,\n children,\n avatar = false,\n title = true,\n paragraph = true,\n active,\n round\n } = props;\n const {\n getPrefixCls,\n direction,\n skeleton\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n if (loading || !('loading' in props)) {\n const hasAvatar = !!avatar;\n const hasTitle = !!title;\n const hasParagraph = !!paragraph;\n // Avatar\n let avatarNode;\n if (hasAvatar) {\n const avatarProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-avatar`\n }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));\n // We direct use SkeletonElement as avatar in skeleton internal.\n avatarNode = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-header`\n }, /*#__PURE__*/React.createElement(Element, Object.assign({}, avatarProps)));\n }\n let contentNode;\n if (hasTitle || hasParagraph) {\n // Title\n let $title;\n if (hasTitle) {\n const titleProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-title`\n }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));\n $title = /*#__PURE__*/React.createElement(Title, Object.assign({}, titleProps));\n }\n // Paragraph\n let paragraphNode;\n if (hasParagraph) {\n const paragraphProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-paragraph`\n }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));\n paragraphNode = /*#__PURE__*/React.createElement(Paragraph, Object.assign({}, paragraphProps));\n }\n contentNode = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, $title, paragraphNode);\n }\n const cls = classNames(prefixCls, {\n [`${prefixCls}-with-avatar`]: hasAvatar,\n [`${prefixCls}-active`]: active,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n [`${prefixCls}-round`]: round\n }, skeleton === null || skeleton === void 0 ? void 0 : skeleton.className, className, rootClassName, hashId, cssVarCls);\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: Object.assign(Object.assign({}, skeleton === null || skeleton === void 0 ? void 0 : skeleton.style), style)\n }, avatarNode, contentNode));\n }\n return children !== null && children !== void 0 ? children : null;\n};\nSkeleton.Button = SkeletonButton;\nSkeleton.Avatar = SkeletonAvatar;\nSkeleton.Input = SkeletonInput;\nSkeleton.Image = SkeletonImage;\nSkeleton.Node = SkeletonNode;\nif (process.env.NODE_ENV !== 'production') {\n Skeleton.displayName = 'Skeleton';\n}\nexport default Skeleton;","map":{"version":3,"names":["React","classNames","ConfigContext","SkeletonAvatar","SkeletonButton","Element","SkeletonImage","SkeletonInput","SkeletonNode","Paragraph","useStyle","Title","getComponentProps","prop","getAvatarBasicProps","hasTitle","hasParagraph","size","shape","getTitleBasicProps","hasAvatar","width","getParagraphBasicProps","basicProps","rows","Skeleton","props","prefixCls","customizePrefixCls","loading","className","rootClassName","style","children","avatar","title","paragraph","active","round","getPrefixCls","direction","skeleton","useContext","wrapCSSVar","hashId","cssVarCls","avatarNode","avatarProps","Object","assign","createElement","contentNode","$title","titleProps","paragraphNode","paragraphProps","cls","Button","Avatar","Input","Image","Node","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/skeleton/Skeleton.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport SkeletonAvatar from './Avatar';\nimport SkeletonButton from './Button';\nimport Element from './Element';\nimport SkeletonImage from './Image';\nimport SkeletonInput from './Input';\nimport SkeletonNode from './Node';\nimport Paragraph from './Paragraph';\nimport useStyle from './style';\nimport Title from './Title';\nfunction getComponentProps(prop) {\n if (prop && typeof prop === 'object') {\n return prop;\n }\n return {};\n}\nfunction getAvatarBasicProps(hasTitle, hasParagraph) {\n if (hasTitle && !hasParagraph) {\n // Square avatar\n return {\n size: 'large',\n shape: 'square'\n };\n }\n return {\n size: 'large',\n shape: 'circle'\n };\n}\nfunction getTitleBasicProps(hasAvatar, hasParagraph) {\n if (!hasAvatar && hasParagraph) {\n return {\n width: '38%'\n };\n }\n if (hasAvatar && hasParagraph) {\n return {\n width: '50%'\n };\n }\n return {};\n}\nfunction getParagraphBasicProps(hasAvatar, hasTitle) {\n const basicProps = {};\n // Width\n if (!hasAvatar || !hasTitle) {\n basicProps.width = '61%';\n }\n // Rows\n if (!hasAvatar && hasTitle) {\n basicProps.rows = 3;\n } else {\n basicProps.rows = 2;\n }\n return basicProps;\n}\nconst Skeleton = props => {\n const {\n prefixCls: customizePrefixCls,\n loading,\n className,\n rootClassName,\n style,\n children,\n avatar = false,\n title = true,\n paragraph = true,\n active,\n round\n } = props;\n const {\n getPrefixCls,\n direction,\n skeleton\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('skeleton', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n if (loading || !('loading' in props)) {\n const hasAvatar = !!avatar;\n const hasTitle = !!title;\n const hasParagraph = !!paragraph;\n // Avatar\n let avatarNode;\n if (hasAvatar) {\n const avatarProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-avatar`\n }, getAvatarBasicProps(hasTitle, hasParagraph)), getComponentProps(avatar));\n // We direct use SkeletonElement as avatar in skeleton internal.\n avatarNode = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-header`\n }, /*#__PURE__*/React.createElement(Element, Object.assign({}, avatarProps)));\n }\n let contentNode;\n if (hasTitle || hasParagraph) {\n // Title\n let $title;\n if (hasTitle) {\n const titleProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-title`\n }, getTitleBasicProps(hasAvatar, hasParagraph)), getComponentProps(title));\n $title = /*#__PURE__*/React.createElement(Title, Object.assign({}, titleProps));\n }\n // Paragraph\n let paragraphNode;\n if (hasParagraph) {\n const paragraphProps = Object.assign(Object.assign({\n prefixCls: `${prefixCls}-paragraph`\n }, getParagraphBasicProps(hasAvatar, hasTitle)), getComponentProps(paragraph));\n paragraphNode = /*#__PURE__*/React.createElement(Paragraph, Object.assign({}, paragraphProps));\n }\n contentNode = /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-content`\n }, $title, paragraphNode);\n }\n const cls = classNames(prefixCls, {\n [`${prefixCls}-with-avatar`]: hasAvatar,\n [`${prefixCls}-active`]: active,\n [`${prefixCls}-rtl`]: direction === 'rtl',\n [`${prefixCls}-round`]: round\n }, skeleton === null || skeleton === void 0 ? void 0 : skeleton.className, className, rootClassName, hashId, cssVarCls);\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", {\n className: cls,\n style: Object.assign(Object.assign({}, skeleton === null || skeleton === void 0 ? void 0 : skeleton.style), style)\n }, avatarNode, contentNode));\n }\n return children !== null && children !== void 0 ? children : null;\n};\nSkeleton.Button = SkeletonButton;\nSkeleton.Avatar = SkeletonAvatar;\nSkeleton.Input = SkeletonInput;\nSkeleton.Image = SkeletonImage;\nSkeleton.Node = SkeletonNode;\nif (process.env.NODE_ENV !== 'production') {\n Skeleton.displayName = 'Skeleton';\n}\nexport default Skeleton;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,cAAc,MAAM,UAAU;AACrC,OAAOC,cAAc,MAAM,UAAU;AACrC,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAOC,aAAa,MAAM,SAAS;AACnC,OAAOC,aAAa,MAAM,SAAS;AACnC,OAAOC,YAAY,MAAM,QAAQ;AACjC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,QAAQ,MAAM,SAAS;AAC9B,OAAOC,KAAK,MAAM,SAAS;AAC3B,SAASC,iBAAiBA,CAACC,IAAI,EAAE;EAC/B,IAAIA,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IACpC,OAAOA,IAAI;EACb;EACA,OAAO,CAAC,CAAC;AACX;AACA,SAASC,mBAAmBA,CAACC,QAAQ,EAAEC,YAAY,EAAE;EACnD,IAAID,QAAQ,IAAI,CAACC,YAAY,EAAE;IAC7B;IACA,OAAO;MACLC,IAAI,EAAE,OAAO;MACbC,KAAK,EAAE;IACT,CAAC;EACH;EACA,OAAO;IACLD,IAAI,EAAE,OAAO;IACbC,KAAK,EAAE;EACT,CAAC;AACH;AACA,SAASC,kBAAkBA,CAACC,SAAS,EAAEJ,YAAY,EAAE;EACnD,IAAI,CAACI,SAAS,IAAIJ,YAAY,EAAE;IAC9B,OAAO;MACLK,KAAK,EAAE;IACT,CAAC;EACH;EACA,IAAID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