PromoCursed/node_modules/.cache/babel-loader/47bfe2d28428be2cf64c12f6e19426a45103dbaa4f65f2474da466785971f261.json

1 line
42 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 { createTheme } from '@ant-design/cssinjs';\nimport IconContext from \"@ant-design/icons/es/components/Context\";\nimport useMemo from \"rc-util/es/hooks/useMemo\";\nimport { merge } from \"rc-util/es/utils/set\";\nimport warning, { devUseWarning, WarningContext } from '../_util/warning';\nimport ValidateMessagesContext from '../form/validateMessagesContext';\nimport LocaleProvider, { ANT_MARK } from '../locale';\nimport LocaleContext from '../locale/context';\nimport defaultLocale from '../locale/en_US';\nimport { defaultTheme, DesignTokenContext } from '../theme/context';\nimport defaultSeedToken from '../theme/themes/seed';\nimport { ConfigConsumer, ConfigContext, defaultIconPrefixCls, defaultPrefixCls, Variants } from './context';\nimport { registerTheme } from './cssVariables';\nimport { DisabledContextProvider } from './DisabledContext';\nimport useConfig from './hooks/useConfig';\nimport useTheme from './hooks/useTheme';\nimport MotionWrapper from './MotionWrapper';\nimport PropWarning from './PropWarning';\nimport SizeContext, { SizeContextProvider } from './SizeContext';\nimport useStyle from './style';\nexport { Variants };\n/**\n * Since too many feedback using static method like `Modal.confirm` not getting theme, we record the\n * theme register info here to help developer get warning info.\n */\nlet existThemeConfig = false;\nexport const warnContext = process.env.NODE_ENV !== 'production' ? componentName => {\n process.env.NODE_ENV !== \"production\" ? warning(!existThemeConfig, componentName, `Static function can not consume context like dynamic theme. Please use 'App' component instead.`) : void 0;\n} : /* istanbul ignore next */\nnull;\nexport { ConfigConsumer, ConfigContext, defaultPrefixCls, defaultIconPrefixCls };\nexport const configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale'];\n// These props is used by `useContext` directly in sub component\nconst PASSED_PROPS = ['getTargetContainer', 'getPopupContainer', 'renderEmpty', 'input', 'pagination', 'form', 'select', 'button'];\nlet globalPrefixCls;\nlet globalIconPrefixCls;\nlet globalTheme;\nlet globalHolderRender;\nfunction getGlobalPrefixCls() {\n return globalPrefixCls || defaultPrefixCls;\n}\nfunction getGlobalIconPrefixCls() {\n return globalIconPrefixCls || defaultIconPrefixCls;\n}\nfunction isLegacyTheme(theme) {\n return Object.keys(theme).some(key => key.endsWith('Color'));\n}\nconst setGlobalConfig = props => {\n const {\n prefixCls,\n iconPrefixCls,\n theme,\n holderRender\n } = props;\n if (prefixCls !== undefined) {\n globalPrefixCls = prefixCls;\n }\n if (iconPrefixCls !== undefined) {\n globalIconPrefixCls = iconPrefixCls;\n }\n if ('holderRender' in props) {\n globalHolderRender = holderRender;\n }\n if (theme) {\n if (isLegacyTheme(theme)) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'ConfigProvider', '`config` of css variable theme is not work in v5. Please use new `theme` config instead.') : void 0;\n registerTheme(getGlobalPrefixCls(), theme);\n } else {\n globalTheme = theme;\n }\n }\n};\nexport const globalConfig = () => ({\n getPrefixCls: (suffixCls, customizePrefixCls) => {\n if (customizePrefixCls) {\n return customizePrefixCls;\n }\n return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls();\n },\n getIconPrefixCls: getGlobalIconPrefixCls,\n getRootPrefixCls: () => {\n // If Global prefixCls