PromoCursed/node_modules/.cache/babel-loader/ed183307149be6d34d8b37d3f901eaa90abf470f0a52ce2c1cea5b0955b31295.json
2024-08-20 23:25:37 +04:00

1 line
9.6 KiB
JSON

{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport { FormContext, FormItemInputContext } from '../context';\nimport { getStatus } from '../util';\nconst iconMap = {\n success: CheckCircleFilled,\n warning: ExclamationCircleFilled,\n error: CloseCircleFilled,\n validating: LoadingOutlined\n};\nexport default function StatusProvider(_ref) {\n let {\n children,\n errors,\n warnings,\n hasFeedback,\n validateStatus,\n prefixCls,\n meta,\n noStyle\n } = _ref;\n const itemPrefixCls = `${prefixCls}-item`;\n const {\n feedbackIcons\n } = React.useContext(FormContext);\n const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);\n const {\n isFormItemInput: parentIsFormItemInput,\n status: parentStatus,\n hasFeedback: parentHasFeedback,\n feedbackIcon: parentFeedbackIcon\n } = React.useContext(FormItemInputContext);\n // ====================== Context =======================\n const formItemStatusContext = React.useMemo(() => {\n var _a;\n let feedbackIcon;\n if (hasFeedback) {\n const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;\n const customIconNode = mergedValidateStatus && ((_a = customIcons === null || customIcons === void 0 ? void 0 : customIcons({\n status: mergedValidateStatus,\n errors,\n warnings\n })) === null || _a === void 0 ? void 0 : _a[mergedValidateStatus]);\n const IconNode = mergedValidateStatus && iconMap[mergedValidateStatus];\n feedbackIcon = customIconNode !== false && IconNode ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)\n }, customIconNode || /*#__PURE__*/React.createElement(IconNode, null))) : null;\n }\n const context = {\n status: mergedValidateStatus || '',\n errors,\n warnings,\n hasFeedback: !!hasFeedback,\n feedbackIcon,\n isFormItemInput: true\n };\n // No style will follow parent context\n if (noStyle) {\n context.status = (mergedValidateStatus !== null && mergedValidateStatus !== void 0 ? mergedValidateStatus : parentStatus) || '';\n context.isFormItemInput = parentIsFormItemInput;\n context.hasFeedback = !!(hasFeedback !== null && hasFeedback !== void 0 ? hasFeedback : parentHasFeedback);\n context.feedbackIcon = hasFeedback !== undefined ? context.feedbackIcon : parentFeedbackIcon;\n }\n return context;\n }, [mergedValidateStatus, hasFeedback, noStyle, parentIsFormItemInput, parentStatus]);\n // ======================= Render =======================\n return /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {\n value: formItemStatusContext\n }, children);\n}","map":{"version":3,"names":["React","CheckCircleFilled","CloseCircleFilled","ExclamationCircleFilled","LoadingOutlined","classNames","FormContext","FormItemInputContext","getStatus","iconMap","success","warning","error","validating","StatusProvider","_ref","children","errors","warnings","hasFeedback","validateStatus","prefixCls","meta","noStyle","itemPrefixCls","feedbackIcons","useContext","mergedValidateStatus","isFormItemInput","parentIsFormItemInput","status","parentStatus","parentHasFeedback","feedbackIcon","parentFeedbackIcon","formItemStatusContext","useMemo","_a","customIcons","icons","customIconNode","IconNode","createElement","className","context","undefined","Provider","value"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/form/FormItem/StatusProvider.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport { FormContext, FormItemInputContext } from '../context';\nimport { getStatus } from '../util';\nconst iconMap = {\n success: CheckCircleFilled,\n warning: ExclamationCircleFilled,\n error: CloseCircleFilled,\n validating: LoadingOutlined\n};\nexport default function StatusProvider(_ref) {\n let {\n children,\n errors,\n warnings,\n hasFeedback,\n validateStatus,\n prefixCls,\n meta,\n noStyle\n } = _ref;\n const itemPrefixCls = `${prefixCls}-item`;\n const {\n feedbackIcons\n } = React.useContext(FormContext);\n const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);\n const {\n isFormItemInput: parentIsFormItemInput,\n status: parentStatus,\n hasFeedback: parentHasFeedback,\n feedbackIcon: parentFeedbackIcon\n } = React.useContext(FormItemInputContext);\n // ====================== Context =======================\n const formItemStatusContext = React.useMemo(() => {\n var _a;\n let feedbackIcon;\n if (hasFeedback) {\n const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;\n const customIconNode = mergedValidateStatus && ((_a = customIcons === null || customIcons === void 0 ? void 0 : customIcons({\n status: mergedValidateStatus,\n errors,\n warnings\n })) === null || _a === void 0 ? void 0 : _a[mergedValidateStatus]);\n const IconNode = mergedValidateStatus && iconMap[mergedValidateStatus];\n feedbackIcon = customIconNode !== false && IconNode ? ( /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)\n }, customIconNode || /*#__PURE__*/React.createElement(IconNode, null))) : null;\n }\n const context = {\n status: mergedValidateStatus || '',\n errors,\n warnings,\n hasFeedback: !!hasFeedback,\n feedbackIcon,\n isFormItemInput: true\n };\n // No style will follow parent context\n if (noStyle) {\n context.status = (mergedValidateStatus !== null && mergedValidateStatus !== void 0 ? mergedValidateStatus : parentStatus) || '';\n context.isFormItemInput = parentIsFormItemInput;\n context.hasFeedback = !!(hasFeedback !== null && hasFeedback !== void 0 ? hasFeedback : parentHasFeedback);\n context.feedbackIcon = hasFeedback !== undefined ? context.feedbackIcon : parentFeedbackIcon;\n }\n return context;\n }, [mergedValidateStatus, hasFeedback, noStyle, parentIsFormItemInput, parentStatus]);\n // ======================= Render =======================\n return /*#__PURE__*/React.createElement(FormItemInputContext.Provider, {\n value: formItemStatusContext\n }, children);\n}"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,uBAAuB,MAAM,oDAAoD;AACxF,OAAOC,eAAe,MAAM,4CAA4C;AACxE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,YAAY;AAC9D,SAASC,SAAS,QAAQ,SAAS;AACnC,MAAMC,OAAO,GAAG;EACdC,OAAO,EAAET,iBAAiB;EAC1BU,OAAO,EAAER,uBAAuB;EAChCS,KAAK,EAAEV,iBAAiB;EACxBW,UAAU,EAAET;AACd,CAAC;AACD,eAAe,SAASU,cAAcA,CAACC,IAAI,EAAE;EAC3C,IAAI;IACFC,QAAQ;IACRC,MAAM;IACNC,QAAQ;IACRC,WAAW;IACXC,cAAc;IACdC,SAAS;IACTC,IAAI;IACJC;EACF,CAAC,GAAGR,IAAI;EACR,MAAMS,aAAa,GAAG,GAAGH,SAAS,OAAO;EACzC,MAAM;IACJI;EACF,CAAC,GAAGzB,KAAK,CAAC0B,UAAU,CAACpB,WAAW,CAAC;EACjC,MAAMqB,oBAAoB,GAAGnB,SAAS,CAACS,MAAM,EAAEC,QAAQ,EAAEI,IAAI,EAAE,IAAI,EAAE,CAAC,CAACH,WAAW,EAAEC,cAAc,CAAC;EACnG,MAAM;IACJQ,eAAe,EAAEC,qBAAqB;IACtCC,MAAM,EAAEC,YAAY;IACpBZ,WAAW,EAAEa,iBAAiB;IAC9BC,YAAY,EAAEC;EAChB,CAAC,GAAGlC,KAAK,CAAC0B,UAAU,CAACnB,oBAAoB,CAAC;EAC1C;EACA,MAAM4B,qBAAqB,G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