ddc3b86cc3e54847e4bb57cc157155bf.json
10.4 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\n\nfunction TabNode(_ref, ref) {\n var _classNames;\n\n var prefixCls = _ref.prefixCls,\n id = _ref.id,\n active = _ref.active,\n rtl = _ref.rtl,\n _ref$tab = _ref.tab,\n key = _ref$tab.key,\n tab = _ref$tab.tab,\n disabled = _ref$tab.disabled,\n closeIcon = _ref$tab.closeIcon,\n tabBarGutter = _ref.tabBarGutter,\n tabPosition = _ref.tabPosition,\n closable = _ref.closable,\n renderWrapper = _ref.renderWrapper,\n removeAriaLabel = _ref.removeAriaLabel,\n editable = _ref.editable,\n onClick = _ref.onClick,\n onRemove = _ref.onRemove,\n onFocus = _ref.onFocus;\n var tabPrefix = \"\".concat(prefixCls, \"-tab\");\n React.useEffect(function () {\n return onRemove;\n }, []);\n var nodeStyle = {};\n\n if (tabPosition === 'top' || tabPosition === 'bottom') {\n nodeStyle[rtl ? 'marginLeft' : 'marginRight'] = tabBarGutter;\n } else {\n nodeStyle.marginBottom = tabBarGutter;\n }\n\n var removable = editable && closable !== false && !disabled;\n\n function onInternalClick(e) {\n if (disabled) return;\n onClick(e);\n }\n\n function onRemoveTab(event) {\n event.preventDefault();\n event.stopPropagation();\n editable.onEdit('remove', {\n key: key,\n event: event\n });\n }\n\n var node = /*#__PURE__*/React.createElement(\"div\", {\n key: key,\n ref: ref,\n className: classNames(tabPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(tabPrefix, \"-with-remove\"), removable), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-active\"), active), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-disabled\"), disabled), _classNames)),\n style: nodeStyle,\n onClick: onInternalClick\n }, /*#__PURE__*/React.createElement(\"div\", {\n role: \"tab\",\n \"aria-selected\": active,\n id: id && \"\".concat(id, \"-tab-\").concat(key),\n className: \"\".concat(tabPrefix, \"-btn\"),\n \"aria-controls\": id && \"\".concat(id, \"-panel-\").concat(key),\n \"aria-disabled\": disabled,\n tabIndex: disabled ? null : 0,\n onClick: function onClick(e) {\n e.stopPropagation();\n onInternalClick(e);\n },\n onKeyDown: function onKeyDown(e) {\n if ([KeyCode.SPACE, KeyCode.ENTER].includes(e.which)) {\n e.preventDefault();\n onInternalClick(e);\n }\n },\n onFocus: onFocus\n }, tab), removable && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": removeAriaLabel || 'remove',\n tabIndex: 0,\n className: \"\".concat(tabPrefix, \"-remove\"),\n onClick: function onClick(e) {\n e.stopPropagation();\n onRemoveTab(e);\n }\n }, closeIcon || editable.removeIcon || '×'));\n\n if (renderWrapper) {\n node = renderWrapper(node);\n }\n\n return node;\n}\n\nexport default /*#__PURE__*/React.forwardRef(TabNode);","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-tabs/es/TabNavList/TabNode.js"],"names":["_defineProperty","React","classNames","KeyCode","TabNode","_ref","ref","_classNames","prefixCls","id","active","rtl","_ref$tab","tab","key","disabled","closeIcon","tabBarGutter","tabPosition","closable","renderWrapper","removeAriaLabel","editable","onClick","onRemove","onFocus","tabPrefix","concat","useEffect","nodeStyle","marginBottom","removable","onInternalClick","e","onRemoveTab","event","preventDefault","stopPropagation","onEdit","node","createElement","className","style","role","tabIndex","onKeyDown","SPACE","ENTER","includes","which","type","removeIcon","forwardRef"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,OAAP,MAAoB,oBAApB;;AAEA,SAASC,OAAT,CAAiBC,IAAjB,EAAuBC,GAAvB,EAA4B;AAC1B,MAAIC,WAAJ;;AAEA,MAAIC,SAAS,GAAGH,IAAI,CAACG,SAArB;AAAA,MACIC,E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,SAAS,IAAIM,QAAQ,CAAC6B,UAAtB,IAAoC,GATJ,CAzBX,CAAxB;;AAoCA,MAAI/B,aAAJ,EAAmB;AACjBmB,IAAAA,IAAI,GAAGnB,aAAa,CAACmB,IAAD,CAApB;AACD;;AAED,SAAOA,IAAP;AACD;;AAED,eAAe,aAAatC,KAAK,CAACmD,UAAN,CAAiBhD,OAAjB,CAA5B","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport KeyCode from \"rc-util/es/KeyCode\";\n\nfunction TabNode(_ref, ref) {\n var _classNames;\n\n var prefixCls = _ref.prefixCls,\n id = _ref.id,\n active = _ref.active,\n rtl = _ref.rtl,\n _ref$tab = _ref.tab,\n key = _ref$tab.key,\n tab = _ref$tab.tab,\n disabled = _ref$tab.disabled,\n closeIcon = _ref$tab.closeIcon,\n tabBarGutter = _ref.tabBarGutter,\n tabPosition = _ref.tabPosition,\n closable = _ref.closable,\n renderWrapper = _ref.renderWrapper,\n removeAriaLabel = _ref.removeAriaLabel,\n editable = _ref.editable,\n onClick = _ref.onClick,\n onRemove = _ref.onRemove,\n onFocus = _ref.onFocus;\n var tabPrefix = \"\".concat(prefixCls, \"-tab\");\n React.useEffect(function () {\n return onRemove;\n }, []);\n var nodeStyle = {};\n\n if (tabPosition === 'top' || tabPosition === 'bottom') {\n nodeStyle[rtl ? 'marginLeft' : 'marginRight'] = tabBarGutter;\n } else {\n nodeStyle.marginBottom = tabBarGutter;\n }\n\n var removable = editable && closable !== false && !disabled;\n\n function onInternalClick(e) {\n if (disabled) return;\n onClick(e);\n }\n\n function onRemoveTab(event) {\n event.preventDefault();\n event.stopPropagation();\n editable.onEdit('remove', {\n key: key,\n event: event\n });\n }\n\n var node = /*#__PURE__*/React.createElement(\"div\", {\n key: key,\n ref: ref,\n className: classNames(tabPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(tabPrefix, \"-with-remove\"), removable), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-active\"), active), _defineProperty(_classNames, \"\".concat(tabPrefix, \"-disabled\"), disabled), _classNames)),\n style: nodeStyle,\n onClick: onInternalClick\n }, /*#__PURE__*/React.createElement(\"div\", {\n role: \"tab\",\n \"aria-selected\": active,\n id: id && \"\".concat(id, \"-tab-\").concat(key),\n className: \"\".concat(tabPrefix, \"-btn\"),\n \"aria-controls\": id && \"\".concat(id, \"-panel-\").concat(key),\n \"aria-disabled\": disabled,\n tabIndex: disabled ? null : 0,\n onClick: function onClick(e) {\n e.stopPropagation();\n onInternalClick(e);\n },\n onKeyDown: function onKeyDown(e) {\n if ([KeyCode.SPACE, KeyCode.ENTER].includes(e.which)) {\n e.preventDefault();\n onInternalClick(e);\n }\n },\n onFocus: onFocus\n }, tab), removable && /*#__PURE__*/React.createElement(\"button\", {\n type: \"button\",\n \"aria-label\": removeAriaLabel || 'remove',\n tabIndex: 0,\n className: \"\".concat(tabPrefix, \"-remove\"),\n onClick: function onClick(e) {\n e.stopPropagation();\n onRemoveTab(e);\n }\n }, closeIcon || editable.removeIcon || '×'));\n\n if (renderWrapper) {\n node = renderWrapper(node);\n }\n\n return node;\n}\n\nexport default /*#__PURE__*/React.forwardRef(TabNode);"]},"metadata":{},"sourceType":"module"}