304e1e8a8d7c011c6e54b1e966f84fc2.json
6.54 KB
{"ast":null,"code":"import _typeof from \"@babel/runtime/helpers/typeof\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport LoadingOutlined from '@ant-design/icons/LoadingOutlined';\nimport FileOutlined from '@ant-design/icons/FileOutlined';\nimport MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined';\nimport PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined';\nimport CaretDownFilled from '@ant-design/icons/CaretDownFilled';\nimport { isValidElement, cloneElement } from '../../_util/reactNode';\nexport default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, _ref) {\n var isLeaf = _ref.isLeaf,\n expanded = _ref.expanded,\n loading = _ref.loading;\n\n if (loading) {\n return /*#__PURE__*/React.createElement(LoadingOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-loading-icon\")\n });\n }\n\n var showLeafIcon;\n\n if (showLine && _typeof(showLine) === 'object') {\n showLeafIcon = showLine.showLeafIcon;\n }\n\n if (isLeaf) {\n if (showLine) {\n if (_typeof(showLine) === 'object' && !showLeafIcon) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-switcher-leaf-line\")\n });\n }\n\n return /*#__PURE__*/React.createElement(FileOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n });\n }\n\n return null;\n }\n\n var switcherCls = \"\".concat(prefixCls, \"-switcher-icon\");\n\n if (isValidElement(switcherIcon)) {\n return cloneElement(switcherIcon, {\n className: classNames(switcherIcon.props.className || '', switcherCls)\n });\n }\n\n if (switcherIcon) {\n return switcherIcon;\n }\n\n if (showLine) {\n return expanded ? /*#__PURE__*/React.createElement(MinusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n }) : /*#__PURE__*/React.createElement(PlusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n });\n }\n\n return /*#__PURE__*/React.createElement(CaretDownFilled, {\n className: switcherCls\n });\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/tree/utils/iconUtil.js"],"names":["_typeof","React","classNames","LoadingOutlined","FileOutlined","MinusSquareOutlined","PlusSquareOutlined","CaretDownFilled","isValidElement","cloneElement","renderSwitcherIcon","prefixCls","switcherIcon","showLine","_ref","isLeaf","expanded","loading","createElement","className","concat","showLeafIcon","switcherCls","props"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,+BAApB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,eAAP,MAA4B,mCAA5B;AACA,OAAOC,YAAP,MAAyB,gCAAzB;AACA,OAAOC,mBAAP,MAAgC,uCAAhC;AACA,OAAOC,kBAAP,MAA+B,sCAA/B;AACA,OAAOC,eAAP,MAA4B,mCAA5B;AACA,SAASC,cAAT,EAAyBC,YAAzB,QAA6C,uBAA7C;AACA,eAAe,SAASC,kBAAT,CAA4BC,SAA5B,EAAuCC,YAAvC,EAAqDC,QAArD,EAA+DC,IAA/D,EAAqE;AAClF,MAAIC,MAAM,GAAGD,IAAI,CAACC,MAAlB;AAAA,MACIC,QAAQ,GAAGF,IAAI,CAACE,QADpB;AAAA,MAEIC,OAAO,GAAGH,IAAI,CAACG,OAFnB;;AAIA,MAAIA,OAAJ,EAAa;AACX,WAAO,aAAahB,KAAK,CAACiB,aAAN,CAAoBf,eAApB,EAAqC;AACvDgB,MAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUT,SAAV,EAAqB,wBAArB;AAD4C,KAArC,CAApB;AAGD;;AAED,MAAIU,YAAJ;;AAEA,MAAIR,QAAQ,IAAIb,OAAO,CAACa,QAAD,CAAP,KAAsB,QAAtC,EAAgD;AAC9CQ,IAAAA,YAAY,GAAGR,QAAQ,CAACQ,YAAxB;AACD;;AAED,MAAIN,MAAJ,EAAY;AACV,QAAIF,QAAJ,EAAc;AACZ,UAAIb,OAAO,CAACa,QAAD,CAAP,KAAsB,QAAtB,IAAkC,CAACQ,YAAvC,EAAqD;AACnD,eAAO,aAAapB,KAAK,CAACiB,aAAN,CAAoB,MAApB,EAA4B;AAC9CC,UAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUT,SAAV,EAAqB,qBAArB;AADmC,SAA5B,CAApB;AAGD;;AAED,aAAO,aAAaV,KAAK,CAACiB,aAAN,CAAoBd,YAApB,EAAkC;AACpDe,QAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUT,SAAV,EAAqB,qBAArB;AADyC,OAAlC,CAApB;AAGD;;AAED,WAAO,IAAP;AACD;;AAED,MAAIW,WAAW,GAAG,GAAGF,MAAH,CAAUT,SAAV,EAAqB,gBAArB,CAAlB;;AAEA,MAAIH,cAAc,CAACI,YAAD,CAAlB,EAAkC;AAChC,WAAOH,YAAY,CAACG,YAAD,EAAe;AAChCO,MAAAA,SAAS,EAAEjB,UAAU,CAACU,YAAY,CAACW,KAAb,CAAmBJ,SAAnB,IAAgC,EAAjC,EAAqCG,WAArC;AADW,KAAf,CAAnB;AAGD;;AAED,MAAIV,YAAJ,EAAkB;AAChB,WAAOA,YAAP;AACD;;AAED,MAAIC,QAAJ,EAAc;AACZ,WAAOG,QAAQ,GAAG,aAAaf,KAAK,CAACiB,aAAN,CAAoBb,mBAApB,EAAyC;AACtEc,MAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUT,SAAV,EAAqB,qBAArB;AAD2D,KAAzC,CAAhB,GAEV,aAAaV,KAAK,CAACiB,aAAN,CAAoBZ,kBAApB,EAAwC;AACxDa,MAAAA,SAAS,EAAE,GAAGC,MAAH,CAAUT,SAAV,EAAqB,qBAArB;AAD6C,KAAxC,CAFlB;AAKD;;AAED,SAAO,aAAaV,KAAK,CAACiB,aAAN,CAAoBX,eAApB,EAAqC;AACvDY,IAAAA,SAAS,EAAEG;AAD4C,GAArC,CAApB;AAGD","sourcesContent":["import _typeof from \"@babel/runtime/helpers/typeof\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport LoadingOutlined from '@ant-design/icons/LoadingOutlined';\nimport FileOutlined from '@ant-design/icons/FileOutlined';\nimport MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined';\nimport PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined';\nimport CaretDownFilled from '@ant-design/icons/CaretDownFilled';\nimport { isValidElement, cloneElement } from '../../_util/reactNode';\nexport default function renderSwitcherIcon(prefixCls, switcherIcon, showLine, _ref) {\n var isLeaf = _ref.isLeaf,\n expanded = _ref.expanded,\n loading = _ref.loading;\n\n if (loading) {\n return /*#__PURE__*/React.createElement(LoadingOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-loading-icon\")\n });\n }\n\n var showLeafIcon;\n\n if (showLine && _typeof(showLine) === 'object') {\n showLeafIcon = showLine.showLeafIcon;\n }\n\n if (isLeaf) {\n if (showLine) {\n if (_typeof(showLine) === 'object' && !showLeafIcon) {\n return /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-switcher-leaf-line\")\n });\n }\n\n return /*#__PURE__*/React.createElement(FileOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n });\n }\n\n return null;\n }\n\n var switcherCls = \"\".concat(prefixCls, \"-switcher-icon\");\n\n if (isValidElement(switcherIcon)) {\n return cloneElement(switcherIcon, {\n className: classNames(switcherIcon.props.className || '', switcherCls)\n });\n }\n\n if (switcherIcon) {\n return switcherIcon;\n }\n\n if (showLine) {\n return expanded ? /*#__PURE__*/React.createElement(MinusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n }) : /*#__PURE__*/React.createElement(PlusSquareOutlined, {\n className: \"\".concat(prefixCls, \"-switcher-line-icon\")\n });\n }\n\n return /*#__PURE__*/React.createElement(CaretDownFilled, {\n className: switcherCls\n });\n}"]},"metadata":{},"sourceType":"module"}