002ecb4ccc4cf61224c21a583d742969.json
15.7 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\n/* eslint-disable react/prop-types */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport shallowEqual from 'shallowequal';\nimport PanelContent from './PanelContent';\n\nvar CollapsePanel = /*#__PURE__*/function (_React$Component) {\n _inherits(CollapsePanel, _React$Component);\n\n var _super = _createSuper(CollapsePanel);\n\n function CollapsePanel() {\n var _this;\n\n _classCallCheck(this, CollapsePanel);\n\n _this = _super.apply(this, arguments);\n\n _this.handleItemClick = function () {\n var _this$props = _this.props,\n onItemClick = _this$props.onItemClick,\n panelKey = _this$props.panelKey;\n\n if (typeof onItemClick === 'function') {\n onItemClick(panelKey);\n }\n };\n\n _this.handleKeyPress = function (e) {\n if (e.key === 'Enter' || e.keyCode === 13 || e.which === 13) {\n _this.handleItemClick();\n }\n };\n\n return _this;\n }\n\n _createClass(CollapsePanel, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return !shallowEqual(this.props, nextProps);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames,\n _classNames2,\n _this2 = this;\n\n var _this$props2 = this.props,\n className = _this$props2.className,\n id = _this$props2.id,\n style = _this$props2.style,\n prefixCls = _this$props2.prefixCls,\n header = _this$props2.header,\n headerClass = _this$props2.headerClass,\n children = _this$props2.children,\n isActive = _this$props2.isActive,\n showArrow = _this$props2.showArrow,\n destroyInactivePanel = _this$props2.destroyInactivePanel,\n accordion = _this$props2.accordion,\n forceRender = _this$props2.forceRender,\n openMotion = _this$props2.openMotion,\n expandIcon = _this$props2.expandIcon,\n extra = _this$props2.extra,\n collapsible = _this$props2.collapsible;\n var disabled = collapsible === 'disabled';\n var headerCls = classNames(\"\".concat(prefixCls, \"-header\"), (_classNames = {}, _defineProperty(_classNames, headerClass, headerClass), _defineProperty(_classNames, \"\".concat(prefixCls, \"-header-collapsible-only\"), collapsible === 'header'), _classNames));\n var itemCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item\"), true), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-active\"), isActive), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-disabled\"), disabled), _classNames2), className);\n var icon = React.createElement(\"i\", {\n className: \"arrow\"\n });\n\n if (showArrow && typeof expandIcon === 'function') {\n icon = expandIcon(this.props);\n }\n\n return React.createElement(\"div\", {\n className: itemCls,\n style: style,\n id: id\n }, React.createElement(\"div\", {\n className: headerCls,\n onClick: function onClick() {\n return collapsible !== 'header' && _this2.handleItemClick();\n },\n role: accordion ? 'tab' : 'button',\n tabIndex: disabled ? -1 : 0,\n \"aria-expanded\": isActive,\n onKeyPress: this.handleKeyPress\n }, showArrow && icon, collapsible === 'header' ? React.createElement(\"span\", {\n onClick: this.handleItemClick,\n className: \"\".concat(prefixCls, \"-header-text\")\n }, header) : header, extra && React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), React.createElement(CSSMotion, Object.assign({\n visible: isActive,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n }, openMotion, {\n forceRender: forceRender,\n removeOnLeave: destroyInactivePanel\n }), function (_ref, ref) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return React.createElement(PanelContent, {\n ref: ref,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n isActive: isActive,\n forceRender: forceRender,\n role: accordion ? 'tabpanel' : null\n }, children);\n }));\n }\n }]);\n\n return CollapsePanel;\n}(React.Component);\n\nCollapsePanel.defaultProps = {\n showArrow: true,\n isActive: false,\n onItemClick: function onItemClick() {},\n headerClass: '',\n forceRender: false\n};\nexport default CollapsePanel;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-collapse/es/Panel.js"],"names":["_defineProperty","_classCallCheck","_createClass","_inherits","_createSuper","React","classNames","CSSMotion","shallowEqual","PanelContent","CollapsePanel","_React$Component","_super","_this","apply","arguments","handleItemClick","_this$props","props","onItemClick","panelKey","handleKeyPress","e","key","keyCode","which","value","shouldComponentUpdate","nextProps","render","_classNames","_classNames2","_this2","_this$props2","className","id","style","prefixCls","header","headerClass","children","isActive","showArrow","destroyInactivePanel","accordion","forceRender","openMotion","expandIcon","extra","collapsible","disabled","headerCls","concat","itemCls","icon","createElement","onClick","role","tabIndex","onKeyPress","Object","assign","visible","leavedClassName","removeOnLeave","_ref","ref","motionClassName","motionStyle","Component","defaultProps"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,SAAP,MAAsB,qCAAtB;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AAEA;;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,WAAtB;AACA,OAAOC,YAAP,MAAyB,cAAzB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;;AAEA,IAAIC,aAAa,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AAC3DR,EAAAA,SAAS,CAACO,aAAD,EAAgBC,gBAAhB,CAAT;;AAEA,MAAIC,MAAM,GAAGR,YAAY,CAACM,aAAD,CAAzB;;AAEA,WAASA,aAAT,GAAyB;AACvB,QAAIG,KAAJ;;AAEAZ,IAAAA,eAAe,CAAC,IAAD,EAAOS,aAAP,CAAf;;AAEAG,IAAAA,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAR;;AAEAF,IAAAA,KAAK,CA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AAE;AALc,CAA7B;AAOA,eAAenC,aAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\n\n/* eslint-disable react/prop-types */\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport shallowEqual from 'shallowequal';\nimport PanelContent from './PanelContent';\n\nvar CollapsePanel = /*#__PURE__*/function (_React$Component) {\n _inherits(CollapsePanel, _React$Component);\n\n var _super = _createSuper(CollapsePanel);\n\n function CollapsePanel() {\n var _this;\n\n _classCallCheck(this, CollapsePanel);\n\n _this = _super.apply(this, arguments);\n\n _this.handleItemClick = function () {\n var _this$props = _this.props,\n onItemClick = _this$props.onItemClick,\n panelKey = _this$props.panelKey;\n\n if (typeof onItemClick === 'function') {\n onItemClick(panelKey);\n }\n };\n\n _this.handleKeyPress = function (e) {\n if (e.key === 'Enter' || e.keyCode === 13 || e.which === 13) {\n _this.handleItemClick();\n }\n };\n\n return _this;\n }\n\n _createClass(CollapsePanel, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return !shallowEqual(this.props, nextProps);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames,\n _classNames2,\n _this2 = this;\n\n var _this$props2 = this.props,\n className = _this$props2.className,\n id = _this$props2.id,\n style = _this$props2.style,\n prefixCls = _this$props2.prefixCls,\n header = _this$props2.header,\n headerClass = _this$props2.headerClass,\n children = _this$props2.children,\n isActive = _this$props2.isActive,\n showArrow = _this$props2.showArrow,\n destroyInactivePanel = _this$props2.destroyInactivePanel,\n accordion = _this$props2.accordion,\n forceRender = _this$props2.forceRender,\n openMotion = _this$props2.openMotion,\n expandIcon = _this$props2.expandIcon,\n extra = _this$props2.extra,\n collapsible = _this$props2.collapsible;\n var disabled = collapsible === 'disabled';\n var headerCls = classNames(\"\".concat(prefixCls, \"-header\"), (_classNames = {}, _defineProperty(_classNames, headerClass, headerClass), _defineProperty(_classNames, \"\".concat(prefixCls, \"-header-collapsible-only\"), collapsible === 'header'), _classNames));\n var itemCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item\"), true), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-active\"), isActive), _defineProperty(_classNames2, \"\".concat(prefixCls, \"-item-disabled\"), disabled), _classNames2), className);\n var icon = React.createElement(\"i\", {\n className: \"arrow\"\n });\n\n if (showArrow && typeof expandIcon === 'function') {\n icon = expandIcon(this.props);\n }\n\n return React.createElement(\"div\", {\n className: itemCls,\n style: style,\n id: id\n }, React.createElement(\"div\", {\n className: headerCls,\n onClick: function onClick() {\n return collapsible !== 'header' && _this2.handleItemClick();\n },\n role: accordion ? 'tab' : 'button',\n tabIndex: disabled ? -1 : 0,\n \"aria-expanded\": isActive,\n onKeyPress: this.handleKeyPress\n }, showArrow && icon, collapsible === 'header' ? React.createElement(\"span\", {\n onClick: this.handleItemClick,\n className: \"\".concat(prefixCls, \"-header-text\")\n }, header) : header, extra && React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), React.createElement(CSSMotion, Object.assign({\n visible: isActive,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n }, openMotion, {\n forceRender: forceRender,\n removeOnLeave: destroyInactivePanel\n }), function (_ref, ref) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return React.createElement(PanelContent, {\n ref: ref,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n isActive: isActive,\n forceRender: forceRender,\n role: accordion ? 'tabpanel' : null\n }, children);\n }));\n }\n }]);\n\n return CollapsePanel;\n}(React.Component);\n\nCollapsePanel.defaultProps = {\n showArrow: true,\n isActive: false,\n onItemClick: function onItemClick() {},\n headerClass: '',\n forceRender: false\n};\nexport default CollapsePanel;"]},"metadata":{},"sourceType":"module"}