96c8e84830d969130d4edcb4a21718ae.json
14.2 KB
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\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};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nexport var LayoutContext = /*#__PURE__*/React.createContext({\n siderHook: {\n addSider: function addSider() {\n return null;\n },\n removeSider: function removeSider() {\n return null;\n }\n }\n});\n\nfunction generator(_ref) {\n var suffixCls = _ref.suffixCls,\n tagName = _ref.tagName,\n displayName = _ref.displayName;\n return function (BasicComponent) {\n var Adapter = function Adapter(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n\n var customizePrefixCls = props.prefixCls;\n var prefixCls = getPrefixCls(suffixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(BasicComponent, _extends({\n prefixCls: prefixCls,\n tagName: tagName\n }, props));\n };\n\n Adapter.displayName = displayName;\n return Adapter;\n };\n}\n\nvar Basic = function Basic(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n tagName = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"tagName\"]);\n\n var classString = classNames(prefixCls, className);\n return /*#__PURE__*/React.createElement(tagName, _extends({\n className: classString\n }, others), children);\n};\n\nvar BasicLayout = function BasicLayout(props) {\n var _classNames;\n\n var _React$useContext2 = React.useContext(ConfigContext),\n direction = _React$useContext2.direction;\n\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n siders = _React$useState2[0],\n setSiders = _React$useState2[1];\n\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n hasSider = props.hasSider,\n Tag = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"hasSider\", \"tagName\"]);\n\n var classString = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-sider\"), typeof hasSider === 'boolean' ? hasSider : siders.length > 0), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(LayoutContext.Provider, {\n value: {\n siderHook: {\n addSider: function addSider(id) {\n setSiders(function (prev) {\n return [].concat(_toConsumableArray(prev), [id]);\n });\n },\n removeSider: function removeSider(id) {\n setSiders(function (prev) {\n return prev.filter(function (currentId) {\n return currentId !== id;\n });\n });\n }\n }\n }\n }, /*#__PURE__*/React.createElement(Tag, _extends({\n className: classString\n }, others), children));\n};\n\nvar Layout = generator({\n suffixCls: 'layout',\n tagName: 'section',\n displayName: 'Layout'\n})(BasicLayout);\nvar Header = generator({\n suffixCls: 'layout-header',\n tagName: 'header',\n displayName: 'Header'\n})(Basic);\nvar Footer = generator({\n suffixCls: 'layout-footer',\n tagName: 'footer',\n displayName: 'Footer'\n})(Basic);\nvar Content = generator({\n suffixCls: 'layout-content',\n tagName: 'main',\n displayName: 'Content'\n})(Basic);\nexport { Header, Footer, Content };\nexport default Layout;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/layout/layout.js"],"names":["_toConsumableArray","_defineProperty","_slicedToArray","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","ConfigContext","LayoutContext","createContext","siderHook","addSider","removeSider","generator","_ref","suffixCls","tagName","displayName","BasicComponent","Adapter","props","_React$useContext","useContext","getPrefixCls","customizePrefixCls","prefixCls","createElement","Basic","className","children","others","classString","BasicLayout","_classNames","_React$useContext2","direction","_React$useState","useState","_React$useState2","siders","setSiders","hasSider","Tag","concat","Provider","value","id","prev","filter","currentId","Layout","Header","Footer","Content"],"mappings":"AAAA,OAAOA,kBAAP,MAA+B,0CAA/B;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,cAAP,MAA2B,sCAA3B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;AAEA,IAAIC,MAAM,GAAG,QAAQ,KAAKA,MAAb,IAAuB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AAClD,MAAIC,CAAC,GAAG,EAAR;;AAEA,OAAK,IAAIC,CAAT,IAAcH,CAAd,EAAiB;AACf,QAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EAAoED,CAAC,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;AACrE;;AAED,MAAIH,CAAC,IAAI,IAAL,IAAa,OAAOI,MAAM,CAACK,qBAAd,KAAwC,UAAzD,EAAqE,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWP,CAAC,GAAGC,MAAM,CAACK,qBAAP,CAA6BT,CAA7B,CAApB,EAAqDU,CAAC,GAAGP,CAAC,CAACQ,MAA3D,EAAmED,CAAC,EAApE,EAAwE;AAC3I,QAAIT,CAAC,CAACO,OAAF,CAAUL,CAAC,CAACO,CAAD,CAAX,IAAkB,CAAlB,IAAuBN,MAAM,CAACC,SAAP,CAAiBO,oBAAjB,CAAsCL,IAAtC,CAA2CP,CAA3C,EAA8CG,CAAC,CAACO,CAAD,CAA/C,CAA3B,EAAgFR,CAAC,CAACC,CAAC,CAACO,CAAD,CAAF,CAAD,GAA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,GAA5C,EAiBjB,aAAazC,KAAK,CAACqB,aAAN,CAAoBgB,GAApB,EAAyBpD,QAAQ,CAAC;AAChDsC,IAAAA,SAAS,EAAEG;AADqC,GAAD,EAE9CD,MAF8C,CAAjC,EAEJD,QAFI,CAjBI,CAApB;AAoBD,CAvCD;;AAyCA,IAAIqB,MAAM,GAAGrC,SAAS,CAAC;AACrBE,EAAAA,SAAS,EAAE,QADU;AAErBC,EAAAA,OAAO,EAAE,SAFY;AAGrBC,EAAAA,WAAW,EAAE;AAHQ,CAAD,CAAT,CAIVe,WAJU,CAAb;AAKA,IAAImB,MAAM,GAAGtC,SAAS,CAAC;AACrBE,EAAAA,SAAS,EAAE,eADU;AAErBC,EAAAA,OAAO,EAAE,QAFY;AAGrBC,EAAAA,WAAW,EAAE;AAHQ,CAAD,CAAT,CAIVU,KAJU,CAAb;AAKA,IAAIyB,MAAM,GAAGvC,SAAS,CAAC;AACrBE,EAAAA,SAAS,EAAE,eADU;AAErBC,EAAAA,OAAO,EAAE,QAFY;AAGrBC,EAAAA,WAAW,EAAE;AAHQ,CAAD,CAAT,CAIVU,KAJU,CAAb;AAKA,IAAI0B,OAAO,GAAGxC,SAAS,CAAC;AACtBE,EAAAA,SAAS,EAAE,gBADW;AAEtBC,EAAAA,OAAO,EAAE,MAFa;AAGtBC,EAAAA,WAAW,EAAE;AAHS,CAAD,CAAT,CAIXU,KAJW,CAAd;AAKA,SAASwB,MAAT,EAAiBC,MAAjB,EAAyBC,OAAzB;AACA,eAAeH,MAAf","sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\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};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nexport var LayoutContext = /*#__PURE__*/React.createContext({\n siderHook: {\n addSider: function addSider() {\n return null;\n },\n removeSider: function removeSider() {\n return null;\n }\n }\n});\n\nfunction generator(_ref) {\n var suffixCls = _ref.suffixCls,\n tagName = _ref.tagName,\n displayName = _ref.displayName;\n return function (BasicComponent) {\n var Adapter = function Adapter(props) {\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls;\n\n var customizePrefixCls = props.prefixCls;\n var prefixCls = getPrefixCls(suffixCls, customizePrefixCls);\n return /*#__PURE__*/React.createElement(BasicComponent, _extends({\n prefixCls: prefixCls,\n tagName: tagName\n }, props));\n };\n\n Adapter.displayName = displayName;\n return Adapter;\n };\n}\n\nvar Basic = function Basic(props) {\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n tagName = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"tagName\"]);\n\n var classString = classNames(prefixCls, className);\n return /*#__PURE__*/React.createElement(tagName, _extends({\n className: classString\n }, others), children);\n};\n\nvar BasicLayout = function BasicLayout(props) {\n var _classNames;\n\n var _React$useContext2 = React.useContext(ConfigContext),\n direction = _React$useContext2.direction;\n\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n siders = _React$useState2[0],\n setSiders = _React$useState2[1];\n\n var prefixCls = props.prefixCls,\n className = props.className,\n children = props.children,\n hasSider = props.hasSider,\n Tag = props.tagName,\n others = __rest(props, [\"prefixCls\", \"className\", \"children\", \"hasSider\", \"tagName\"]);\n\n var classString = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-has-sider\"), typeof hasSider === 'boolean' ? hasSider : siders.length > 0), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _classNames), className);\n return /*#__PURE__*/React.createElement(LayoutContext.Provider, {\n value: {\n siderHook: {\n addSider: function addSider(id) {\n setSiders(function (prev) {\n return [].concat(_toConsumableArray(prev), [id]);\n });\n },\n removeSider: function removeSider(id) {\n setSiders(function (prev) {\n return prev.filter(function (currentId) {\n return currentId !== id;\n });\n });\n }\n }\n }\n }, /*#__PURE__*/React.createElement(Tag, _extends({\n className: classString\n }, others), children));\n};\n\nvar Layout = generator({\n suffixCls: 'layout',\n tagName: 'section',\n displayName: 'Layout'\n})(BasicLayout);\nvar Header = generator({\n suffixCls: 'layout-header',\n tagName: 'header',\n displayName: 'Header'\n})(Basic);\nvar Footer = generator({\n suffixCls: 'layout-footer',\n tagName: 'footer',\n displayName: 'Footer'\n})(Basic);\nvar Content = generator({\n suffixCls: 'layout-content',\n tagName: 'main',\n displayName: 'Content'\n})(Basic);\nexport { Header, Footer, Content };\nexport default Layout;"]},"metadata":{},"sourceType":"module"}