bef0153834fd7b60e7c84b65df1566a5.json
55.4 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useState, useRef, useEffect } from 'react';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport ResizeObserver from 'rc-resize-observer';\nimport useRaf, { useRafState } from '../hooks/useRaf';\nimport TabNode from './TabNode';\nimport useOffsets from '../hooks/useOffsets';\nimport useVisibleRange from '../hooks/useVisibleRange';\nimport OperationNode from './OperationNode';\nimport TabContext from '../TabContext';\nimport useTouchMove from '../hooks/useTouchMove';\nimport useRefs from '../hooks/useRefs';\nimport AddButton from './AddButton';\nimport useSyncState from '../hooks/useSyncState';\n\nvar ExtraContent = function ExtraContent(_ref) {\n var position = _ref.position,\n prefixCls = _ref.prefixCls,\n extra = _ref.extra;\n if (!extra) return null;\n var content;\n var assertExtra = extra;\n\n if (position === 'right') {\n content = assertExtra.right || !assertExtra.left && assertExtra || null;\n }\n\n if (position === 'left') {\n content = assertExtra.left || null;\n }\n\n return content ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra-content\")\n }, content) : null;\n};\n\nfunction TabNavList(props, ref) {\n var _classNames;\n\n var _React$useContext = React.useContext(TabContext),\n prefixCls = _React$useContext.prefixCls,\n tabs = _React$useContext.tabs;\n\n var className = props.className,\n style = props.style,\n id = props.id,\n animated = props.animated,\n activeKey = props.activeKey,\n rtl = props.rtl,\n extra = props.extra,\n editable = props.editable,\n locale = props.locale,\n tabPosition = props.tabPosition,\n tabBarGutter = props.tabBarGutter,\n children = props.children,\n onTabClick = props.onTabClick,\n onTabScroll = props.onTabScroll;\n var tabsWrapperRef = useRef();\n var tabListRef = useRef();\n var operationsRef = useRef();\n var innerAddButtonRef = useRef();\n\n var _useRefs = useRefs(),\n _useRefs2 = _slicedToArray(_useRefs, 2),\n getBtnRef = _useRefs2[0],\n removeBtnRef = _useRefs2[1];\n\n var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';\n\n var _useSyncState = useSyncState(0, function (next, prev) {\n if (tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'left' : 'right'\n });\n }\n }),\n _useSyncState2 = _slicedToArray(_useSyncState, 2),\n transformLeft = _useSyncState2[0],\n setTransformLeft = _useSyncState2[1];\n\n var _useSyncState3 = useSyncState(0, function (next, prev) {\n if (!tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'top' : 'bottom'\n });\n }\n }),\n _useSyncState4 = _slicedToArray(_useSyncState3, 2),\n transformTop = _useSyncState4[0],\n setTransformTop = _useSyncState4[1];\n\n var _useState = useState(0),\n _useState2 = _slicedToArray(_useState, 2),\n wrapperScrollWidth = _useState2[0],\n setWrapperScrollWidth = _useState2[1];\n\n var _useState3 = useState(0),\n _useState4 = _slicedToArray(_useState3, 2),\n wrapperScrollHeight = _useState4[0],\n setWrapperScrollHeight = _useState4[1];\n\n var _useState5 = useState(0),\n _useState6 = _slicedToArray(_useState5, 2),\n wrapperContentWidth = _useState6[0],\n setWrapperContentWidth = _useState6[1];\n\n var _useState7 = useState(0),\n _useState8 = _slicedToArray(_useState7, 2),\n wrapperContentHeight = _useState8[0],\n setWrapperContentHeight = _useState8[1];\n\n var _useState9 = useState(null),\n _useState10 = _slicedToArray(_useState9, 2),\n wrapperWidth = _useState10[0],\n setWrapperWidth = _useState10[1];\n\n var _useState11 = useState(null),\n _useState12 = _slicedToArray(_useState11, 2),\n wrapperHeight = _useState12[0],\n setWrapperHeight = _useState12[1];\n\n var _useState13 = useState(0),\n _useState14 = _slicedToArray(_useState13, 2),\n addWidth = _useState14[0],\n setAddWidth = _useState14[1];\n\n var _useState15 = useState(0),\n _useState16 = _slicedToArray(_useState15, 2),\n addHeight = _useState16[0],\n setAddHeight = _useState16[1];\n\n var _useRafState = useRafState(new Map()),\n _useRafState2 = _slicedToArray(_useRafState, 2),\n tabSizes = _useRafState2[0],\n setTabSizes = _useRafState2[1];\n\n var tabOffsets = useOffsets(tabs, tabSizes, wrapperScrollWidth); // ========================== Util =========================\n\n var operationsHiddenClassName = \"\".concat(prefixCls, \"-nav-operations-hidden\");\n var transformMin = 0;\n var transformMax = 0;\n\n if (!tabPositionTopOrBottom) {\n transformMin = Math.min(0, wrapperHeight - wrapperScrollHeight);\n transformMax = 0;\n } else if (rtl) {\n transformMin = 0;\n transformMax = Math.max(0, wrapperScrollWidth - wrapperWidth);\n } else {\n transformMin = Math.min(0, wrapperWidth - wrapperScrollWidth);\n transformMax = 0;\n }\n\n function alignInRange(value) {\n if (value < transformMin) {\n return transformMin;\n }\n\n if (value > transformMax) {\n return transformMax;\n }\n\n return value;\n } // ========================= Mobile ========================\n\n\n var touchMovingRef = useRef();\n\n var _useState17 = useState(),\n _useState18 = _slicedToArray(_useState17, 2),\n lockAnimation = _useState18[0],\n setLockAnimation = _useState18[1];\n\n function doLockAnimation() {\n setLockAnimation(Date.now());\n }\n\n function clearTouchMoving() {\n window.clearTimeout(touchMovingRef.current);\n }\n\n useTouchMove(tabsWrapperRef, function (offsetX, offsetY) {\n function doMove(setState, offset) {\n setState(function (value) {\n var newValue = alignInRange(value + offset);\n return newValue;\n });\n }\n\n if (tabPositionTopOrBottom) {\n // Skip scroll if place is enough\n if (wrapperWidth >= wrapperScrollWidth) {\n return false;\n }\n\n doMove(setTransformLeft, offsetX);\n } else {\n if (wrapperHeight >= wrapperScrollHeight) {\n return false;\n }\n\n doMove(setTransformTop, offsetY);\n }\n\n clearTouchMoving();\n doLockAnimation();\n return true;\n });\n useEffect(function () {\n clearTouchMoving();\n\n if (lockAnimation) {\n touchMovingRef.current = window.setTimeout(function () {\n setLockAnimation(0);\n }, 100);\n }\n\n return clearTouchMoving;\n }, [lockAnimation]); // ========================= Scroll ========================\n\n function scrollToTab() {\n var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;\n var tabOffset = tabOffsets.get(key) || {\n width: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0\n };\n\n if (tabPositionTopOrBottom) {\n // ============ Align with top & bottom ============\n var newTransform = transformLeft; // RTL\n\n if (rtl) {\n if (tabOffset.right < transformLeft) {\n newTransform = tabOffset.right;\n } else if (tabOffset.right + tabOffset.width > transformLeft + wrapperWidth) {\n newTransform = tabOffset.right + tabOffset.width - wrapperWidth;\n }\n } // LTR\n else if (tabOffset.left < -transformLeft) {\n newTransform = -tabOffset.left;\n } else if (tabOffset.left + tabOffset.width > -transformLeft + wrapperWidth) {\n newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth);\n }\n\n setTransformTop(0);\n setTransformLeft(alignInRange(newTransform));\n } else {\n // ============ Align with left & right ============\n var _newTransform = transformTop;\n\n if (tabOffset.top < -transformTop) {\n _newTransform = -tabOffset.top;\n } else if (tabOffset.top + tabOffset.height > -transformTop + wrapperHeight) {\n _newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight);\n }\n\n setTransformLeft(0);\n setTransformTop(alignInRange(_newTransform));\n }\n } // ========================== Tab ==========================\n // Render tab node & collect tab offset\n\n\n var _useVisibleRange = useVisibleRange(tabOffsets, {\n width: wrapperWidth,\n height: wrapperHeight,\n left: transformLeft,\n top: transformTop\n }, {\n width: wrapperContentWidth,\n height: wrapperContentHeight\n }, {\n width: addWidth,\n height: addHeight\n }, _objectSpread(_objectSpread({}, props), {}, {\n tabs: tabs\n })),\n _useVisibleRange2 = _slicedToArray(_useVisibleRange, 2),\n visibleStart = _useVisibleRange2[0],\n visibleEnd = _useVisibleRange2[1];\n\n var tabNodes = tabs.map(function (tab) {\n var key = tab.key;\n return /*#__PURE__*/React.createElement(TabNode, {\n id: id,\n prefixCls: prefixCls,\n key: key,\n rtl: rtl,\n tab: tab,\n closable: tab.closable,\n editable: editable,\n active: key === activeKey,\n tabPosition: tabPosition,\n tabBarGutter: tabBarGutter,\n renderWrapper: children,\n removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,\n ref: getBtnRef(key),\n onClick: function onClick(e) {\n onTabClick(key, e);\n },\n onRemove: function onRemove() {\n removeBtnRef(key);\n },\n onFocus: function onFocus() {\n scrollToTab(key);\n doLockAnimation(); // Focus element will make scrollLeft change which we should reset back\n\n if (!rtl) {\n tabsWrapperRef.current.scrollLeft = 0;\n }\n\n tabsWrapperRef.current.scrollTop = 0;\n }\n });\n });\n var onListHolderResize = useRaf(function () {\n var _tabsWrapperRef$curre, _tabsWrapperRef$curre2, _innerAddButtonRef$cu, _innerAddButtonRef$cu2, _operationsRef$curren, _operationsRef$curren2, _tabListRef$current, _tabListRef$current2, _operationsRef$curren3; // Update wrapper records\n\n\n var offsetWidth = ((_tabsWrapperRef$curre = tabsWrapperRef.current) === null || _tabsWrapperRef$curre === void 0 ? void 0 : _tabsWrapperRef$curre.offsetWidth) || 0;\n var offsetHeight = ((_tabsWrapperRef$curre2 = tabsWrapperRef.current) === null || _tabsWrapperRef$curre2 === void 0 ? void 0 : _tabsWrapperRef$curre2.offsetHeight) || 0;\n var newAddWidth = ((_innerAddButtonRef$cu = innerAddButtonRef.current) === null || _innerAddButtonRef$cu === void 0 ? void 0 : _innerAddButtonRef$cu.offsetWidth) || 0;\n var newAddHeight = ((_innerAddButtonRef$cu2 = innerAddButtonRef.current) === null || _innerAddButtonRef$cu2 === void 0 ? void 0 : _innerAddButtonRef$cu2.offsetHeight) || 0;\n var newOperationWidth = ((_operationsRef$curren = operationsRef.current) === null || _operationsRef$curren === void 0 ? void 0 : _operationsRef$curren.offsetWidth) || 0;\n var newOperationHeight = ((_operationsRef$curren2 = operationsRef.current) === null || _operationsRef$curren2 === void 0 ? void 0 : _operationsRef$curren2.offsetHeight) || 0;\n setWrapperWidth(offsetWidth);\n setWrapperHeight(offsetHeight);\n setAddWidth(newAddWidth);\n setAddHeight(newAddHeight);\n var newWrapperScrollWidth = (((_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.offsetWidth) || 0) - newAddWidth;\n var newWrapperScrollHeight = (((_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.offsetHeight) || 0) - newAddHeight;\n setWrapperScrollWidth(newWrapperScrollWidth);\n setWrapperScrollHeight(newWrapperScrollHeight);\n var isOperationHidden = (_operationsRef$curren3 = operationsRef.current) === null || _operationsRef$curren3 === void 0 ? void 0 : _operationsRef$curren3.className.includes(operationsHiddenClassName);\n setWrapperContentWidth(newWrapperScrollWidth - (isOperationHidden ? 0 : newOperationWidth));\n setWrapperContentHeight(newWrapperScrollHeight - (isOperationHidden ? 0 : newOperationHeight)); // Update buttons records\n\n setTabSizes(function () {\n var newSizes = new Map();\n tabs.forEach(function (_ref2) {\n var key = _ref2.key;\n var btnNode = getBtnRef(key).current;\n\n if (btnNode) {\n newSizes.set(key, {\n width: btnNode.offsetWidth,\n height: btnNode.offsetHeight,\n left: btnNode.offsetLeft,\n top: btnNode.offsetTop\n });\n }\n });\n return newSizes;\n });\n }); // ======================== Dropdown =======================\n\n var startHiddenTabs = tabs.slice(0, visibleStart);\n var endHiddenTabs = tabs.slice(visibleEnd + 1);\n var hiddenTabs = [].concat(_toConsumableArray(startHiddenTabs), _toConsumableArray(endHiddenTabs)); // =================== Link & Operations ===================\n\n var _useState19 = useState(),\n _useState20 = _slicedToArray(_useState19, 2),\n inkStyle = _useState20[0],\n setInkStyle = _useState20[1];\n\n var activeTabOffset = tabOffsets.get(activeKey); // Delay set ink style to avoid remove tab blink\n\n var inkBarRafRef = useRef();\n\n function cleanInkBarRaf() {\n raf.cancel(inkBarRafRef.current);\n }\n\n useEffect(function () {\n var newInkStyle = {};\n\n if (activeTabOffset) {\n if (tabPositionTopOrBottom) {\n if (rtl) {\n newInkStyle.right = activeTabOffset.right;\n } else {\n newInkStyle.left = activeTabOffset.left;\n }\n\n newInkStyle.width = activeTabOffset.width;\n } else {\n newInkStyle.top = activeTabOffset.top;\n newInkStyle.height = activeTabOffset.height;\n }\n }\n\n cleanInkBarRaf();\n inkBarRafRef.current = raf(function () {\n setInkStyle(newInkStyle);\n });\n return cleanInkBarRaf;\n }, [activeTabOffset, tabPositionTopOrBottom, rtl]); // ========================= Effect ========================\n\n useEffect(function () {\n scrollToTab();\n }, [activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom]); // Should recalculate when rtl changed\n\n useEffect(function () {\n onListHolderResize();\n }, [rtl, tabBarGutter, activeKey, tabs.map(function (tab) {\n return tab.key;\n }).join('_')]); // ========================= Render ========================\n\n var hasDropdown = !!hiddenTabs.length;\n var wrapPrefix = \"\".concat(prefixCls, \"-nav-wrap\");\n var pingLeft;\n var pingRight;\n var pingTop;\n var pingBottom;\n\n if (tabPositionTopOrBottom) {\n if (rtl) {\n pingRight = transformLeft > 0;\n pingLeft = transformLeft + wrapperWidth < wrapperScrollWidth;\n } else {\n pingLeft = transformLeft < 0;\n pingRight = -transformLeft + wrapperWidth < wrapperScrollWidth;\n }\n } else {\n pingTop = transformTop < 0;\n pingBottom = -transformTop + wrapperHeight < wrapperScrollHeight;\n }\n /* eslint-disable jsx-a11y/interactive-supports-focus */\n\n\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: ref,\n role: \"tablist\",\n className: classNames(\"\".concat(prefixCls, \"-nav\"), className),\n style: style,\n onKeyDown: function onKeyDown() {\n // No need animation when use keyboard\n doLockAnimation();\n }\n }, /*#__PURE__*/React.createElement(ExtraContent, {\n position: \"left\",\n extra: extra,\n prefixCls: prefixCls\n }), /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(wrapPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-left\"), pingLeft), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-right\"), pingRight), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-top\"), pingTop), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-bottom\"), pingBottom), _classNames)),\n ref: tabsWrapperRef\n }, /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: tabListRef,\n className: \"\".concat(prefixCls, \"-nav-list\"),\n style: {\n transform: \"translate(\".concat(transformLeft, \"px, \").concat(transformTop, \"px)\"),\n transition: lockAnimation ? 'none' : undefined\n }\n }, tabNodes, /*#__PURE__*/React.createElement(AddButton, {\n ref: innerAddButtonRef,\n prefixCls: prefixCls,\n locale: locale,\n editable: editable,\n style: {\n visibility: hasDropdown ? 'hidden' : null\n }\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-ink-bar\"), _defineProperty({}, \"\".concat(prefixCls, \"-ink-bar-animated\"), animated.inkBar)),\n style: inkStyle\n }))))), /*#__PURE__*/React.createElement(OperationNode, Object.assign({}, props, {\n ref: operationsRef,\n prefixCls: prefixCls,\n tabs: hiddenTabs,\n className: !hasDropdown && operationsHiddenClassName\n })), /*#__PURE__*/React.createElement(ExtraContent, {\n position: \"right\",\n extra: extra,\n prefixCls: prefixCls\n }));\n /* eslint-enable */\n}\n\nexport default /*#__PURE__*/React.forwardRef(TabNavList);","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-tabs/es/TabNavList/index.js"],"names":["_defineProperty","_toConsumableArray","_objectSpread","_slicedToArray","React","useState","useRef","useEffect","classNames","raf","ResizeObserver","useRaf","useRafState","TabNode","useOffsets","useVisibleRange","OperationNode","TabContext","useTouchMove","useRefs","AddButton","useSyncState","ExtraContent","_ref","position","prefixCls","extra","content","assertExtra","right","left","createElement","className","concat","TabNavList","props","ref","_classNames","_React$useContext","useContext","tabs","style","id","animated","activeKey","rtl","editable","locale","tabPosition","tabBarGutter","children","onTabClick","onTabScroll","tabsWrapperRef","tabListRef","operationsRef","innerAddButtonRef","_useRefs","_useRefs2","getBtnRef","removeBtnRef","tabPositionTopOrBottom","_useSyncState","next","prev","direction","_useSyncState2","transformLeft","setTransformLeft","_useSyncState3","_useSyncState4","transformTop","setTransformTop","_useState","_useState2","wrapperScrollWidth","setWrapperScrollWidth","_useState3","_useState4","wrapperScrollHeight","setWrapperScrollHeight","_useState5","_useState6","wrapperContentWidth","setWrapperContentWidth","_useState7","_useState8","wrapperContentHeight","setWrapperContentHeight","_useState9","_useState10","wrapperWidth","setWrapperWidth","_useState11","_useState12","wrapperHeight","setWrapperHeight","_useState13","_useState14","addWidth","setAddWidth","_useState15","_useState16","addHeight","setAddHeight","_useRafState","Map","_useRafState2","tabSizes","setTabSizes","tabOffsets","operationsHiddenClassName","transformMin","transformMax","Math","min","max","alignInRange","value","touchMovingRef","_useState17","_useState18","lockAnimation","setLockAnimation","doLockAnimation","Date","now","clearTouchMoving","window","clearTimeout","current","offsetX","offsetY","doMove","setState","offset","newValue","setTimeout","scrollToTab","key","arguments","length","undefined","tabOffset","get","width","height","top","newTransform","_newTransform","_useVisibleRange","_useVisibleRange2","visibleStart","visibleEnd","tabNodes","map","tab","closable","active","renderWrapper","removeAriaLabel","onClick","e","onRemove","onFocus","scrollLeft","scrollTop","onListHolderResize","_tabsWrapperRef$curre","_tabsWrapperRef$curre2","_innerAddButtonRef$cu","_innerAddButtonRef$cu2","_operationsRef$curren","_operationsRef$curren2","_tabListRef$current","_tabListRef$current2","_operationsRef$curren3","offsetWidth","offsetHeight","newAddWidth","newAddHeight","newOperationWidth","newOperationHeight","newWrapperScrollWidth","newWrapperScrollHeight","isOperationHidden","includes","newSizes","forEach","_ref2","btnNode","set","offsetLeft","offsetTop","startHiddenTabs","slice","endHiddenTabs","hiddenTabs","_useState19","_useState20","inkStyle","setInkStyle","activeTabOffset","inkBarRafRef","cleanInkBarRaf","cancel","newInkStyle","join","hasDropdown","wrapPrefix","pingLeft","pingRight","pingTop","pingBottom","role","onKeyDown","onResize","transform","transition","visibility","inkBar","Object","assign","forwardRef"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,kBAAP,MAA+B,8CAA/B;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,MAAnB,EAA2BC,SAA3B,QAA4C,OAA5C;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,MAAP,IAAiBC,WAAjB,QAAoC,iBAApC;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AACA,OAAOC,eAAP,MAA4B,0BAA5B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,YAAP,MAAyB,uBAAzB;AACA,OAAOC,OAAP,MAAoB,kBAApB;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,YAAP,MAAyB,uBAAzB;;AAEA,IAAIC,YAAY,GAAG,SAASA,YAAT,CAAsBC,IAAtB,EAA4B;AAC7C,MAAIC,QAAQ,GAAGD,IAAI,CAACC,QAApB;AAAA,MACIC,SAAS,GAAGF,IAAI,CAACE,SADrB;AAAA,MAEIC,KAAK,GAAGH,IAAI,CAACG,KAFjB;AAGA,MAAI,CAACA,KAAL,EAAY,OAAO,IAAP;AACZ,MAAIC,OAAJ;AACA,MAAIC,WAAW,GAAGF,KAAlB;;AAEA,MAAIF,QAAQ,KAAK,OAAjB,EAA0B;AACxBG,IAAAA,OAAO,GAAGC,WAAW,CAACC,KAAZ,IAAqB,CAACD,WAAW,CAACE,IAAb,IAAqBF,WAA1C,IAAyD,IAAnE;AACD;;AAED,MAAIJ,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,eAAe,aAAarB,KAAK,CAAC2N,UAAN,CAAiB7L,UAAjB,CAA5B","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport { useState, useRef, useEffect } from 'react';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport ResizeObserver from 'rc-resize-observer';\nimport useRaf, { useRafState } from '../hooks/useRaf';\nimport TabNode from './TabNode';\nimport useOffsets from '../hooks/useOffsets';\nimport useVisibleRange from '../hooks/useVisibleRange';\nimport OperationNode from './OperationNode';\nimport TabContext from '../TabContext';\nimport useTouchMove from '../hooks/useTouchMove';\nimport useRefs from '../hooks/useRefs';\nimport AddButton from './AddButton';\nimport useSyncState from '../hooks/useSyncState';\n\nvar ExtraContent = function ExtraContent(_ref) {\n var position = _ref.position,\n prefixCls = _ref.prefixCls,\n extra = _ref.extra;\n if (!extra) return null;\n var content;\n var assertExtra = extra;\n\n if (position === 'right') {\n content = assertExtra.right || !assertExtra.left && assertExtra || null;\n }\n\n if (position === 'left') {\n content = assertExtra.left || null;\n }\n\n return content ? /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra-content\")\n }, content) : null;\n};\n\nfunction TabNavList(props, ref) {\n var _classNames;\n\n var _React$useContext = React.useContext(TabContext),\n prefixCls = _React$useContext.prefixCls,\n tabs = _React$useContext.tabs;\n\n var className = props.className,\n style = props.style,\n id = props.id,\n animated = props.animated,\n activeKey = props.activeKey,\n rtl = props.rtl,\n extra = props.extra,\n editable = props.editable,\n locale = props.locale,\n tabPosition = props.tabPosition,\n tabBarGutter = props.tabBarGutter,\n children = props.children,\n onTabClick = props.onTabClick,\n onTabScroll = props.onTabScroll;\n var tabsWrapperRef = useRef();\n var tabListRef = useRef();\n var operationsRef = useRef();\n var innerAddButtonRef = useRef();\n\n var _useRefs = useRefs(),\n _useRefs2 = _slicedToArray(_useRefs, 2),\n getBtnRef = _useRefs2[0],\n removeBtnRef = _useRefs2[1];\n\n var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';\n\n var _useSyncState = useSyncState(0, function (next, prev) {\n if (tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'left' : 'right'\n });\n }\n }),\n _useSyncState2 = _slicedToArray(_useSyncState, 2),\n transformLeft = _useSyncState2[0],\n setTransformLeft = _useSyncState2[1];\n\n var _useSyncState3 = useSyncState(0, function (next, prev) {\n if (!tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n direction: next > prev ? 'top' : 'bottom'\n });\n }\n }),\n _useSyncState4 = _slicedToArray(_useSyncState3, 2),\n transformTop = _useSyncState4[0],\n setTransformTop = _useSyncState4[1];\n\n var _useState = useState(0),\n _useState2 = _slicedToArray(_useState, 2),\n wrapperScrollWidth = _useState2[0],\n setWrapperScrollWidth = _useState2[1];\n\n var _useState3 = useState(0),\n _useState4 = _slicedToArray(_useState3, 2),\n wrapperScrollHeight = _useState4[0],\n setWrapperScrollHeight = _useState4[1];\n\n var _useState5 = useState(0),\n _useState6 = _slicedToArray(_useState5, 2),\n wrapperContentWidth = _useState6[0],\n setWrapperContentWidth = _useState6[1];\n\n var _useState7 = useState(0),\n _useState8 = _slicedToArray(_useState7, 2),\n wrapperContentHeight = _useState8[0],\n setWrapperContentHeight = _useState8[1];\n\n var _useState9 = useState(null),\n _useState10 = _slicedToArray(_useState9, 2),\n wrapperWidth = _useState10[0],\n setWrapperWidth = _useState10[1];\n\n var _useState11 = useState(null),\n _useState12 = _slicedToArray(_useState11, 2),\n wrapperHeight = _useState12[0],\n setWrapperHeight = _useState12[1];\n\n var _useState13 = useState(0),\n _useState14 = _slicedToArray(_useState13, 2),\n addWidth = _useState14[0],\n setAddWidth = _useState14[1];\n\n var _useState15 = useState(0),\n _useState16 = _slicedToArray(_useState15, 2),\n addHeight = _useState16[0],\n setAddHeight = _useState16[1];\n\n var _useRafState = useRafState(new Map()),\n _useRafState2 = _slicedToArray(_useRafState, 2),\n tabSizes = _useRafState2[0],\n setTabSizes = _useRafState2[1];\n\n var tabOffsets = useOffsets(tabs, tabSizes, wrapperScrollWidth); // ========================== Util =========================\n\n var operationsHiddenClassName = \"\".concat(prefixCls, \"-nav-operations-hidden\");\n var transformMin = 0;\n var transformMax = 0;\n\n if (!tabPositionTopOrBottom) {\n transformMin = Math.min(0, wrapperHeight - wrapperScrollHeight);\n transformMax = 0;\n } else if (rtl) {\n transformMin = 0;\n transformMax = Math.max(0, wrapperScrollWidth - wrapperWidth);\n } else {\n transformMin = Math.min(0, wrapperWidth - wrapperScrollWidth);\n transformMax = 0;\n }\n\n function alignInRange(value) {\n if (value < transformMin) {\n return transformMin;\n }\n\n if (value > transformMax) {\n return transformMax;\n }\n\n return value;\n } // ========================= Mobile ========================\n\n\n var touchMovingRef = useRef();\n\n var _useState17 = useState(),\n _useState18 = _slicedToArray(_useState17, 2),\n lockAnimation = _useState18[0],\n setLockAnimation = _useState18[1];\n\n function doLockAnimation() {\n setLockAnimation(Date.now());\n }\n\n function clearTouchMoving() {\n window.clearTimeout(touchMovingRef.current);\n }\n\n useTouchMove(tabsWrapperRef, function (offsetX, offsetY) {\n function doMove(setState, offset) {\n setState(function (value) {\n var newValue = alignInRange(value + offset);\n return newValue;\n });\n }\n\n if (tabPositionTopOrBottom) {\n // Skip scroll if place is enough\n if (wrapperWidth >= wrapperScrollWidth) {\n return false;\n }\n\n doMove(setTransformLeft, offsetX);\n } else {\n if (wrapperHeight >= wrapperScrollHeight) {\n return false;\n }\n\n doMove(setTransformTop, offsetY);\n }\n\n clearTouchMoving();\n doLockAnimation();\n return true;\n });\n useEffect(function () {\n clearTouchMoving();\n\n if (lockAnimation) {\n touchMovingRef.current = window.setTimeout(function () {\n setLockAnimation(0);\n }, 100);\n }\n\n return clearTouchMoving;\n }, [lockAnimation]); // ========================= Scroll ========================\n\n function scrollToTab() {\n var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;\n var tabOffset = tabOffsets.get(key) || {\n width: 0,\n height: 0,\n left: 0,\n right: 0,\n top: 0\n };\n\n if (tabPositionTopOrBottom) {\n // ============ Align with top & bottom ============\n var newTransform = transformLeft; // RTL\n\n if (rtl) {\n if (tabOffset.right < transformLeft) {\n newTransform = tabOffset.right;\n } else if (tabOffset.right + tabOffset.width > transformLeft + wrapperWidth) {\n newTransform = tabOffset.right + tabOffset.width - wrapperWidth;\n }\n } // LTR\n else if (tabOffset.left < -transformLeft) {\n newTransform = -tabOffset.left;\n } else if (tabOffset.left + tabOffset.width > -transformLeft + wrapperWidth) {\n newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth);\n }\n\n setTransformTop(0);\n setTransformLeft(alignInRange(newTransform));\n } else {\n // ============ Align with left & right ============\n var _newTransform = transformTop;\n\n if (tabOffset.top < -transformTop) {\n _newTransform = -tabOffset.top;\n } else if (tabOffset.top + tabOffset.height > -transformTop + wrapperHeight) {\n _newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight);\n }\n\n setTransformLeft(0);\n setTransformTop(alignInRange(_newTransform));\n }\n } // ========================== Tab ==========================\n // Render tab node & collect tab offset\n\n\n var _useVisibleRange = useVisibleRange(tabOffsets, {\n width: wrapperWidth,\n height: wrapperHeight,\n left: transformLeft,\n top: transformTop\n }, {\n width: wrapperContentWidth,\n height: wrapperContentHeight\n }, {\n width: addWidth,\n height: addHeight\n }, _objectSpread(_objectSpread({}, props), {}, {\n tabs: tabs\n })),\n _useVisibleRange2 = _slicedToArray(_useVisibleRange, 2),\n visibleStart = _useVisibleRange2[0],\n visibleEnd = _useVisibleRange2[1];\n\n var tabNodes = tabs.map(function (tab) {\n var key = tab.key;\n return /*#__PURE__*/React.createElement(TabNode, {\n id: id,\n prefixCls: prefixCls,\n key: key,\n rtl: rtl,\n tab: tab,\n closable: tab.closable,\n editable: editable,\n active: key === activeKey,\n tabPosition: tabPosition,\n tabBarGutter: tabBarGutter,\n renderWrapper: children,\n removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,\n ref: getBtnRef(key),\n onClick: function onClick(e) {\n onTabClick(key, e);\n },\n onRemove: function onRemove() {\n removeBtnRef(key);\n },\n onFocus: function onFocus() {\n scrollToTab(key);\n doLockAnimation(); // Focus element will make scrollLeft change which we should reset back\n\n if (!rtl) {\n tabsWrapperRef.current.scrollLeft = 0;\n }\n\n tabsWrapperRef.current.scrollTop = 0;\n }\n });\n });\n var onListHolderResize = useRaf(function () {\n var _tabsWrapperRef$curre, _tabsWrapperRef$curre2, _innerAddButtonRef$cu, _innerAddButtonRef$cu2, _operationsRef$curren, _operationsRef$curren2, _tabListRef$current, _tabListRef$current2, _operationsRef$curren3;\n\n // Update wrapper records\n var offsetWidth = ((_tabsWrapperRef$curre = tabsWrapperRef.current) === null || _tabsWrapperRef$curre === void 0 ? void 0 : _tabsWrapperRef$curre.offsetWidth) || 0;\n var offsetHeight = ((_tabsWrapperRef$curre2 = tabsWrapperRef.current) === null || _tabsWrapperRef$curre2 === void 0 ? void 0 : _tabsWrapperRef$curre2.offsetHeight) || 0;\n var newAddWidth = ((_innerAddButtonRef$cu = innerAddButtonRef.current) === null || _innerAddButtonRef$cu === void 0 ? void 0 : _innerAddButtonRef$cu.offsetWidth) || 0;\n var newAddHeight = ((_innerAddButtonRef$cu2 = innerAddButtonRef.current) === null || _innerAddButtonRef$cu2 === void 0 ? void 0 : _innerAddButtonRef$cu2.offsetHeight) || 0;\n var newOperationWidth = ((_operationsRef$curren = operationsRef.current) === null || _operationsRef$curren === void 0 ? void 0 : _operationsRef$curren.offsetWidth) || 0;\n var newOperationHeight = ((_operationsRef$curren2 = operationsRef.current) === null || _operationsRef$curren2 === void 0 ? void 0 : _operationsRef$curren2.offsetHeight) || 0;\n setWrapperWidth(offsetWidth);\n setWrapperHeight(offsetHeight);\n setAddWidth(newAddWidth);\n setAddHeight(newAddHeight);\n var newWrapperScrollWidth = (((_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.offsetWidth) || 0) - newAddWidth;\n var newWrapperScrollHeight = (((_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.offsetHeight) || 0) - newAddHeight;\n setWrapperScrollWidth(newWrapperScrollWidth);\n setWrapperScrollHeight(newWrapperScrollHeight);\n var isOperationHidden = (_operationsRef$curren3 = operationsRef.current) === null || _operationsRef$curren3 === void 0 ? void 0 : _operationsRef$curren3.className.includes(operationsHiddenClassName);\n setWrapperContentWidth(newWrapperScrollWidth - (isOperationHidden ? 0 : newOperationWidth));\n setWrapperContentHeight(newWrapperScrollHeight - (isOperationHidden ? 0 : newOperationHeight)); // Update buttons records\n\n setTabSizes(function () {\n var newSizes = new Map();\n tabs.forEach(function (_ref2) {\n var key = _ref2.key;\n var btnNode = getBtnRef(key).current;\n\n if (btnNode) {\n newSizes.set(key, {\n width: btnNode.offsetWidth,\n height: btnNode.offsetHeight,\n left: btnNode.offsetLeft,\n top: btnNode.offsetTop\n });\n }\n });\n return newSizes;\n });\n }); // ======================== Dropdown =======================\n\n var startHiddenTabs = tabs.slice(0, visibleStart);\n var endHiddenTabs = tabs.slice(visibleEnd + 1);\n var hiddenTabs = [].concat(_toConsumableArray(startHiddenTabs), _toConsumableArray(endHiddenTabs)); // =================== Link & Operations ===================\n\n var _useState19 = useState(),\n _useState20 = _slicedToArray(_useState19, 2),\n inkStyle = _useState20[0],\n setInkStyle = _useState20[1];\n\n var activeTabOffset = tabOffsets.get(activeKey); // Delay set ink style to avoid remove tab blink\n\n var inkBarRafRef = useRef();\n\n function cleanInkBarRaf() {\n raf.cancel(inkBarRafRef.current);\n }\n\n useEffect(function () {\n var newInkStyle = {};\n\n if (activeTabOffset) {\n if (tabPositionTopOrBottom) {\n if (rtl) {\n newInkStyle.right = activeTabOffset.right;\n } else {\n newInkStyle.left = activeTabOffset.left;\n }\n\n newInkStyle.width = activeTabOffset.width;\n } else {\n newInkStyle.top = activeTabOffset.top;\n newInkStyle.height = activeTabOffset.height;\n }\n }\n\n cleanInkBarRaf();\n inkBarRafRef.current = raf(function () {\n setInkStyle(newInkStyle);\n });\n return cleanInkBarRaf;\n }, [activeTabOffset, tabPositionTopOrBottom, rtl]); // ========================= Effect ========================\n\n useEffect(function () {\n scrollToTab();\n }, [activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom]); // Should recalculate when rtl changed\n\n useEffect(function () {\n onListHolderResize();\n }, [rtl, tabBarGutter, activeKey, tabs.map(function (tab) {\n return tab.key;\n }).join('_')]); // ========================= Render ========================\n\n var hasDropdown = !!hiddenTabs.length;\n var wrapPrefix = \"\".concat(prefixCls, \"-nav-wrap\");\n var pingLeft;\n var pingRight;\n var pingTop;\n var pingBottom;\n\n if (tabPositionTopOrBottom) {\n if (rtl) {\n pingRight = transformLeft > 0;\n pingLeft = transformLeft + wrapperWidth < wrapperScrollWidth;\n } else {\n pingLeft = transformLeft < 0;\n pingRight = -transformLeft + wrapperWidth < wrapperScrollWidth;\n }\n } else {\n pingTop = transformTop < 0;\n pingBottom = -transformTop + wrapperHeight < wrapperScrollHeight;\n }\n /* eslint-disable jsx-a11y/interactive-supports-focus */\n\n\n return /*#__PURE__*/React.createElement(\"div\", {\n ref: ref,\n role: \"tablist\",\n className: classNames(\"\".concat(prefixCls, \"-nav\"), className),\n style: style,\n onKeyDown: function onKeyDown() {\n // No need animation when use keyboard\n doLockAnimation();\n }\n }, /*#__PURE__*/React.createElement(ExtraContent, {\n position: \"left\",\n extra: extra,\n prefixCls: prefixCls\n }), /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(wrapPrefix, (_classNames = {}, _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-left\"), pingLeft), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-right\"), pingRight), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-top\"), pingTop), _defineProperty(_classNames, \"\".concat(wrapPrefix, \"-ping-bottom\"), pingBottom), _classNames)),\n ref: tabsWrapperRef\n }, /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: onListHolderResize\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: tabListRef,\n className: \"\".concat(prefixCls, \"-nav-list\"),\n style: {\n transform: \"translate(\".concat(transformLeft, \"px, \").concat(transformTop, \"px)\"),\n transition: lockAnimation ? 'none' : undefined\n }\n }, tabNodes, /*#__PURE__*/React.createElement(AddButton, {\n ref: innerAddButtonRef,\n prefixCls: prefixCls,\n locale: locale,\n editable: editable,\n style: {\n visibility: hasDropdown ? 'hidden' : null\n }\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(\"\".concat(prefixCls, \"-ink-bar\"), _defineProperty({}, \"\".concat(prefixCls, \"-ink-bar-animated\"), animated.inkBar)),\n style: inkStyle\n }))))), /*#__PURE__*/React.createElement(OperationNode, Object.assign({}, props, {\n ref: operationsRef,\n prefixCls: prefixCls,\n tabs: hiddenTabs,\n className: !hasDropdown && operationsHiddenClassName\n })), /*#__PURE__*/React.createElement(ExtraContent, {\n position: \"right\",\n extra: extra,\n prefixCls: prefixCls\n }));\n /* eslint-enable */\n}\n\nexport default /*#__PURE__*/React.forwardRef(TabNavList);"]},"metadata":{},"sourceType":"module"}