PromoCursed/node_modules/.cache/babel-loader/cb7315381faad2933d1e7ad605aadc29267fee3f69fc28985327ec470909a3a1.json

1 line
25 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"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 omit from \"rc-util/es/omit\";\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useSize from '../config-provider/hooks/useSize';\nimport Skeleton from '../skeleton';\nimport Tabs from '../tabs';\nimport Grid from './Grid';\nimport useStyle from './style';\nconst ActionNode = props => {\n const {\n actionClasses,\n actions = [],\n actionStyle\n } = props;\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: actionClasses,\n style: actionStyle\n }, actions.map((action, index) => {\n // Move this out since eslint not allow index key\n // And eslint-disable makes conflict with rollup\n // ref https://github.com/ant-design/ant-design/issues/46022\n const key = `action-${index}`;\n return /*#__PURE__*/React.createElement(\"li\", {\n style: {\n width: `${100 / actions.length}%`\n },\n key: key\n }, /*#__PURE__*/React.createElement(\"span\", null, action));\n }));\n};\nconst Card = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n prefixCls: customizePrefixCls,\n className,\n rootClassName,\n style,\n extra,\n headStyle = {},\n bodyStyle = {},\n title,\n loading,\n bordered = true,\n size: customizeSize,\n type,\n cover,\n actions,\n tabList,\n children,\n activeTabKey,\n defaultActiveTabKey,\n tabBarExtraContent,\n hoverable,\n tabProps = {},\n classNames: customClassNames,\n styles: customStyles\n } = props,\n others = __rest(props, [\"prefixCls\", \"className\", \"rootClassName\", \"style\", \"extra\", \"headStyle\", \"bodyStyle\", \"title\", \"loading\", \"bordered\", \"size\", \"type\", \"cover\", \"actions\", \"tabList\", \"children\", \"activeTabKey\", \"defaultActiveTabKey\", \"tabBarExtraContent\", \"hoverable\", \"tabProps\", \"classNames\", \"styles\"]);\n const {\n getPrefixCls,\n direction,\n card\n } = React.useContext(ConfigContext);\n // =================Warning===================\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Card');\n [['headStyle', 'styles.header'], ['bodyStyle', 'styles.body']].forEach(_ref => {\n let [deprecatedName, newName] = _ref;\n warning.deprecated(!(deprecatedName in props), deprecatedName, newName);\n });\n }\n const onTabChange = key => {\n var _a;\n (_a = props.onTabChange) === null || _a === void 0 ? void 0 : _a.call(props, key);\n };\n const moduleClass = moduleName => {\n var _a;\n return classNames((_a = card === null || card === void 0 ? void 0 : card.classNames) === null || _a === void 0 ? void 0 : _a[moduleName], customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames[moduleName]);\n };\n const moduleStyle = moduleName => {\n var _a;\n return Object.assign(Object.assign({}, (_a = card === null || card === void 0 ? void 0 : card.styles) === null || _a === void 0 ? void 0 : _a[moduleName]), customStyles === null || customStyles === void 0 ? void 0 : customStyles[moduleName]);\n };\n const isContainGrid = React.useMemo(() => {\n let containGrid = false;\n React.Children.forEach(children, element => {\n if ((element === null || element === void 0 ? void 0 : element.type) === Grid) {\n containGrid = true;\n }\n });\n return containGrid;\n }, [children]);\n const prefixCls = getPrefixCls('card', customizePrefixCls);\n