af77a934d1308190d5195d0f81a460b3.json
13.6 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\"; // TODO: remove this lint\n// SFC has specified a displayName, but not worked.\n\n/* eslint-disable react/display-name */\n\nimport * as React from 'react';\nimport { FormProvider as RcFormProvider } from 'rc-field-form';\nimport LocaleProvider, { ANT_MARK } from '../locale-provider';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigConsumer, ConfigContext } from './context';\nimport { SizeContextProvider } from './SizeContext';\nimport message from '../message';\nimport notification from '../notification';\nexport { ConfigContext, ConfigConsumer };\nexport var configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale', 'pageHeader'];\n\nvar ConfigProvider = function ConfigProvider(props) {\n React.useEffect(function () {\n if (props.direction) {\n message.config({\n rtl: props.direction === 'rtl'\n });\n notification.config({\n rtl: props.direction === 'rtl'\n });\n }\n }, [props.direction]);\n\n var getPrefixClsWrapper = function getPrefixClsWrapper(context) {\n return function (suffixCls, customizePrefixCls) {\n var prefixCls = props.prefixCls;\n if (customizePrefixCls) return customizePrefixCls;\n var mergedPrefixCls = prefixCls || context.getPrefixCls('');\n return suffixCls ? \"\".concat(mergedPrefixCls, \"-\").concat(suffixCls) : mergedPrefixCls;\n };\n };\n\n var renderProvider = function renderProvider(context, legacyLocale) {\n var children = props.children,\n getTargetContainer = props.getTargetContainer,\n getPopupContainer = props.getPopupContainer,\n renderEmpty = props.renderEmpty,\n csp = props.csp,\n autoInsertSpaceInButton = props.autoInsertSpaceInButton,\n form = props.form,\n input = props.input,\n locale = props.locale,\n pageHeader = props.pageHeader,\n componentSize = props.componentSize,\n direction = props.direction,\n space = props.space,\n virtual = props.virtual,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth;\n\n var config = _extends(_extends({}, context), {\n getPrefixCls: getPrefixClsWrapper(context),\n csp: csp,\n autoInsertSpaceInButton: autoInsertSpaceInButton,\n locale: locale || legacyLocale,\n direction: direction,\n space: space,\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth\n });\n\n if (getTargetContainer) {\n config.getTargetContainer = getTargetContainer;\n }\n\n if (getPopupContainer) {\n config.getPopupContainer = getPopupContainer;\n }\n\n if (renderEmpty) {\n config.renderEmpty = renderEmpty;\n }\n\n if (pageHeader) {\n config.pageHeader = pageHeader;\n }\n\n if (input) {\n config.input = input;\n }\n\n if (form) {\n config.form = form;\n }\n\n var childNode = children; // Additional Form provider\n\n var validateMessages = {};\n\n if (locale && locale.Form && locale.Form.defaultValidateMessages) {\n validateMessages = locale.Form.defaultValidateMessages;\n }\n\n if (form && form.validateMessages) {\n validateMessages = _extends(_extends({}, validateMessages), form.validateMessages);\n }\n\n if (Object.keys(validateMessages).length > 0) {\n childNode = /*#__PURE__*/React.createElement(RcFormProvider, {\n validateMessages: validateMessages\n }, children);\n }\n\n var childrenWithLocale = locale === undefined ? childNode : /*#__PURE__*/React.createElement(LocaleProvider, {\n locale: locale || legacyLocale,\n _ANT_MARK__: ANT_MARK\n }, childNode);\n return /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: componentSize\n }, /*#__PURE__*/React.createElement(ConfigContext.Provider, {\n value: config\n }, childrenWithLocale));\n };\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, null, function (_, __, legacyLocale) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (context) {\n return renderProvider(context, legacyLocale);\n });\n });\n};\n/** @private internal usage. do not use in your production */\n\n\nConfigProvider.ConfigContext = ConfigContext;\nexport default ConfigProvider;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/config-provider/index.js"],"names":["_extends","React","FormProvider","RcFormProvider","LocaleProvider","ANT_MARK","LocaleReceiver","ConfigConsumer","ConfigContext","SizeContextProvider","message","notification","configConsumerProps","ConfigProvider","props","useEffect","direction","config","rtl","getPrefixClsWrapper","context","suffixCls","customizePrefixCls","prefixCls","mergedPrefixCls","getPrefixCls","concat","renderProvider","legacyLocale","children","getTargetContainer","getPopupContainer","renderEmpty","csp","autoInsertSpaceInButton","form","input","locale","pageHeader","componentSize","space","virtual","dropdownMatchSelectWidth","childNode","validateMessages","Form","defaultValidateMessages","Object","keys","length","createElement","childrenWithLocale","undefined","_ANT_MARK__","size","Provider","value","_","__"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB,C,CACA;AACA;;AAEA;;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,YAAY,IAAIC,cAAzB,QAA+C,eAA/C;AACA,OAAOC,cAAP,IAAyBC,QAAzB,QAAyC,oBAAzC;AACA,OAAOC,cAAP,MAA2B,mCAA3B;AACA,SAASC,cAAT,EAAyBC,aAAzB,QAA8C,WAA9C;AACA,SAASC,mBAAT,QAAoC,eAApC;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,SAASH,aAAT,EAAwBD,cAAxB;AACA,OAAO,IAAIK,mBAAmB,GAAG,CAAC,oBAAD,EAAuB,mBAAvB,EAA4C,eAA5C,EAA6D,cAA7D,EAA6E,aAA7E,EAA4F,KAA5F,EAAmG,yBAAnG,EAA8H,QAA9H,EAAwI,YAAxI,CAA1B;;AAEP,IAAIC,cAAc,GAAG,SAASA,cAAT,CAAwBC,KAAxB,EAA+B;AAClDb,EAAAA,KAAK,CAACc,SAAN,CAAgB,YAAY;AAC1B,QAAID,KAAK,CAACE,SAAV,EAAqB;AACnBN,MAAAA,OAAO,CAACO,MAAR,CAAe;AACbC,QAAAA,GAAG,EAAEJ,KAAK,CAACE,SAAN,KAAoB;AADZ,OAAf;AAGAL,MAAAA,YAAY,CAACM,MAAb,CAAoB;AAClBC,QAAAA,GAAG,EAAEJ,KAAK,CAACE,SAAN,KAAoB;AADP,OAApB;AAGD;AACF,GATD,EASG,CAACF,KAAK,CAACE,SAAP,CATH;;AAWA,MAAIG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AeK,cAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\n// TODO: remove this lint\n// SFC has specified a displayName, but not worked.\n\n/* eslint-disable react/display-name */\nimport * as React from 'react';\nimport { FormProvider as RcFormProvider } from 'rc-field-form';\nimport LocaleProvider, { ANT_MARK } from '../locale-provider';\nimport LocaleReceiver from '../locale-provider/LocaleReceiver';\nimport { ConfigConsumer, ConfigContext } from './context';\nimport { SizeContextProvider } from './SizeContext';\nimport message from '../message';\nimport notification from '../notification';\nexport { ConfigContext, ConfigConsumer };\nexport var configConsumerProps = ['getTargetContainer', 'getPopupContainer', 'rootPrefixCls', 'getPrefixCls', 'renderEmpty', 'csp', 'autoInsertSpaceInButton', 'locale', 'pageHeader'];\n\nvar ConfigProvider = function ConfigProvider(props) {\n React.useEffect(function () {\n if (props.direction) {\n message.config({\n rtl: props.direction === 'rtl'\n });\n notification.config({\n rtl: props.direction === 'rtl'\n });\n }\n }, [props.direction]);\n\n var getPrefixClsWrapper = function getPrefixClsWrapper(context) {\n return function (suffixCls, customizePrefixCls) {\n var prefixCls = props.prefixCls;\n if (customizePrefixCls) return customizePrefixCls;\n var mergedPrefixCls = prefixCls || context.getPrefixCls('');\n return suffixCls ? \"\".concat(mergedPrefixCls, \"-\").concat(suffixCls) : mergedPrefixCls;\n };\n };\n\n var renderProvider = function renderProvider(context, legacyLocale) {\n var children = props.children,\n getTargetContainer = props.getTargetContainer,\n getPopupContainer = props.getPopupContainer,\n renderEmpty = props.renderEmpty,\n csp = props.csp,\n autoInsertSpaceInButton = props.autoInsertSpaceInButton,\n form = props.form,\n input = props.input,\n locale = props.locale,\n pageHeader = props.pageHeader,\n componentSize = props.componentSize,\n direction = props.direction,\n space = props.space,\n virtual = props.virtual,\n dropdownMatchSelectWidth = props.dropdownMatchSelectWidth;\n\n var config = _extends(_extends({}, context), {\n getPrefixCls: getPrefixClsWrapper(context),\n csp: csp,\n autoInsertSpaceInButton: autoInsertSpaceInButton,\n locale: locale || legacyLocale,\n direction: direction,\n space: space,\n virtual: virtual,\n dropdownMatchSelectWidth: dropdownMatchSelectWidth\n });\n\n if (getTargetContainer) {\n config.getTargetContainer = getTargetContainer;\n }\n\n if (getPopupContainer) {\n config.getPopupContainer = getPopupContainer;\n }\n\n if (renderEmpty) {\n config.renderEmpty = renderEmpty;\n }\n\n if (pageHeader) {\n config.pageHeader = pageHeader;\n }\n\n if (input) {\n config.input = input;\n }\n\n if (form) {\n config.form = form;\n }\n\n var childNode = children; // Additional Form provider\n\n var validateMessages = {};\n\n if (locale && locale.Form && locale.Form.defaultValidateMessages) {\n validateMessages = locale.Form.defaultValidateMessages;\n }\n\n if (form && form.validateMessages) {\n validateMessages = _extends(_extends({}, validateMessages), form.validateMessages);\n }\n\n if (Object.keys(validateMessages).length > 0) {\n childNode = /*#__PURE__*/React.createElement(RcFormProvider, {\n validateMessages: validateMessages\n }, children);\n }\n\n var childrenWithLocale = locale === undefined ? childNode : /*#__PURE__*/React.createElement(LocaleProvider, {\n locale: locale || legacyLocale,\n _ANT_MARK__: ANT_MARK\n }, childNode);\n return /*#__PURE__*/React.createElement(SizeContextProvider, {\n size: componentSize\n }, /*#__PURE__*/React.createElement(ConfigContext.Provider, {\n value: config\n }, childrenWithLocale));\n };\n\n return /*#__PURE__*/React.createElement(LocaleReceiver, null, function (_, __, legacyLocale) {\n return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (context) {\n return renderProvider(context, legacyLocale);\n });\n });\n};\n/** @private internal usage. do not use in your production */\n\n\nConfigProvider.ConfigContext = ConfigContext;\nexport default ConfigProvider;"]},"metadata":{},"sourceType":"module"}