1 line
7.3 KiB
JSON
1 line
7.3 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport { useLocale } from '../locale';\nimport NormalCancelBtn from './components/NormalCancelBtn';\nimport NormalOkBtn from './components/NormalOkBtn';\nimport { ModalContextProvider } from './context';\nimport { getConfirmLocale } from './locale';\nexport function renderCloseIcon(prefixCls, closeIcon) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-close-x`\n }, closeIcon || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: `${prefixCls}-close-icon`\n }));\n}\nexport const Footer = props => {\n const {\n okText,\n okType = 'primary',\n cancelText,\n confirmLoading,\n onOk,\n onCancel,\n okButtonProps,\n cancelButtonProps,\n footer\n } = props;\n const [locale] = useLocale('Modal', getConfirmLocale());\n // ================== Locale Text ==================\n const okTextLocale = okText || (locale === null || locale === void 0 ? void 0 : locale.okText);\n const cancelTextLocale = cancelText || (locale === null || locale === void 0 ? void 0 : locale.cancelText);\n // ================= Context Value =================\n const btnCtxValue = {\n confirmLoading,\n okButtonProps,\n cancelButtonProps,\n okTextLocale,\n cancelTextLocale,\n okType,\n onOk,\n onCancel\n };\n const btnCtxValueMemo = React.useMemo(() => btnCtxValue, _toConsumableArray(Object.values(btnCtxValue)));\n let footerNode;\n if (typeof footer === 'function' || typeof footer === 'undefined') {\n footerNode = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NormalCancelBtn, null), /*#__PURE__*/React.createElement(NormalOkBtn, null));\n if (typeof footer === 'function') {\n footerNode = footer(footerNode, {\n OkBtn: NormalOkBtn,\n CancelBtn: NormalCancelBtn\n });\n }\n footerNode = /*#__PURE__*/React.createElement(ModalContextProvider, {\n value: btnCtxValueMemo\n }, footerNode);\n } else {\n footerNode = footer;\n }\n return /*#__PURE__*/React.createElement(DisabledContextProvider, {\n disabled: false\n }, footerNode);\n};","map":{"version":3,"names":["_toConsumableArray","React","CloseOutlined","DisabledContextProvider","useLocale","NormalCancelBtn","NormalOkBtn","ModalContextProvider","getConfirmLocale","renderCloseIcon","prefixCls","closeIcon","createElement","className","Footer","props","okText","okType","cancelText","confirmLoading","onOk","onCancel","okButtonProps","cancelButtonProps","footer","locale","okTextLocale","cancelTextLocale","btnCtxValue","btnCtxValueMemo","useMemo","Object","values","footerNode","Fragment","OkBtn","CancelBtn","value","disabled"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/modal/shared.js"],"sourcesContent":["\"use client\";\n\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport React from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport { DisabledContextProvider } from '../config-provider/DisabledContext';\nimport { useLocale } from '../locale';\nimport NormalCancelBtn from './components/NormalCancelBtn';\nimport NormalOkBtn from './components/NormalOkBtn';\nimport { ModalContextProvider } from './context';\nimport { getConfirmLocale } from './locale';\nexport function renderCloseIcon(prefixCls, closeIcon) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-close-x`\n }, closeIcon || /*#__PURE__*/React.createElement(CloseOutlined, {\n className: `${prefixCls}-close-icon`\n }));\n}\nexport const Footer = props => {\n const {\n okText,\n okType = 'primary',\n cancelText,\n confirmLoading,\n onOk,\n onCancel,\n okButtonProps,\n cancelButtonProps
|