12169bb3c7f7bdd1ba6cf765ca2f70d7.json 4.81 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport defaultRenderEmpty from './renderEmpty';\nexport var ConfigContext = /*#__PURE__*/React.createContext({\n  // We provide a default function for Context without provider\n  getPrefixCls: function getPrefixCls(suffixCls, customizePrefixCls) {\n    if (customizePrefixCls) return customizePrefixCls;\n    return suffixCls ? \"ant-\".concat(suffixCls) : 'ant';\n  },\n  renderEmpty: defaultRenderEmpty\n});\nexport var ConfigConsumer = ConfigContext.Consumer;\n/** @deprecated Use hooks instead. This is a legacy function */\n\nexport function withConfigConsumer(config) {\n  return function withConfigConsumerFunc(Component) {\n    // Wrap with ConfigConsumer. Since we need compatible with react 15, be care when using ref methods\n    var SFC = function SFC(props) {\n      return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {\n        var basicPrefixCls = config.prefixCls;\n        var getPrefixCls = configProps.getPrefixCls;\n        var customizePrefixCls = props.prefixCls;\n        var prefixCls = getPrefixCls(basicPrefixCls, customizePrefixCls);\n        return /*#__PURE__*/React.createElement(Component, _extends({}, configProps, props, {\n          prefixCls: prefixCls\n        }));\n      });\n    };\n\n    var cons = Component.constructor;\n    var name = cons && cons.displayName || Component.name || 'Component';\n    SFC.displayName = \"withConfigConsumer(\".concat(name, \")\");\n    return SFC;\n  };\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/config-provider/context.js"],"names":["_extends","React","defaultRenderEmpty","ConfigContext","createContext","getPrefixCls","suffixCls","customizePrefixCls","concat","renderEmpty","ConfigConsumer","Consumer","withConfigConsumer","config","withConfigConsumerFunc","Component","SFC","props","createElement","configProps","basicPrefixCls","prefixCls","cons","constructor","name","displayName"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,kBAAP,MAA+B,eAA/B;AACA,OAAO,IA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tB,CAA6BgB,IAA7B,EAAmC,GAAnC,CAAlB;AACA,WAAOR,GAAP;AACD,GAlBD;AAmBD","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport defaultRenderEmpty from './renderEmpty';\nexport var ConfigContext = /*#__PURE__*/React.createContext({\n  // We provide a default function for Context without provider\n  getPrefixCls: function getPrefixCls(suffixCls, customizePrefixCls) {\n    if (customizePrefixCls) return customizePrefixCls;\n    return suffixCls ? \"ant-\".concat(suffixCls) : 'ant';\n  },\n  renderEmpty: defaultRenderEmpty\n});\nexport var ConfigConsumer = ConfigContext.Consumer;\n/** @deprecated Use hooks instead. This is a legacy function */\n\nexport function withConfigConsumer(config) {\n  return function withConfigConsumerFunc(Component) {\n    // Wrap with ConfigConsumer. Since we need compatible with react 15, be care when using ref methods\n    var SFC = function SFC(props) {\n      return /*#__PURE__*/React.createElement(ConfigConsumer, null, function (configProps) {\n        var basicPrefixCls = config.prefixCls;\n        var getPrefixCls = configProps.getPrefixCls;\n        var customizePrefixCls = props.prefixCls;\n        var prefixCls = getPrefixCls(basicPrefixCls, customizePrefixCls);\n        return /*#__PURE__*/React.createElement(Component, _extends({}, configProps, props, {\n          prefixCls: prefixCls\n        }));\n      });\n    };\n\n    var cons = Component.constructor;\n    var name = cons && cons.displayName || Component.name || 'Component';\n    SFC.displayName = \"withConfigConsumer(\".concat(name, \")\");\n    return SFC;\n  };\n}"]},"metadata":{},"sourceType":"module"}