PromoCursed/node_modules/.cache/babel-loader/ecafff093299a5578ce803973e9865c577d6e9558c77b548c18e8cb7e45f3e90.json

1 line
54 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _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\";\n/* eslint-disable react-hooks/exhaustive-deps */\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\nimport useEvent from \"rc-util/es/hooks/useEvent\";\nimport { useComposeRef } from \"rc-util/es/ref\";\nimport * as React from 'react';\nimport { useEffect, useRef, useState } from 'react';\nimport TabContext from \"../TabContext\";\nimport useIndicator from \"../hooks/useIndicator\";\nimport useOffsets from \"../hooks/useOffsets\";\nimport useSyncState from \"../hooks/useSyncState\";\nimport useTouchMove from \"../hooks/useTouchMove\";\nimport useUpdate, { useUpdateState } from \"../hooks/useUpdate\";\nimport useVisibleRange from \"../hooks/useVisibleRange\";\nimport { genDataNodeKey, stringify } from \"../util\";\nimport AddButton from \"./AddButton\";\nimport ExtraContent from \"./ExtraContent\";\nimport OperationNode from \"./OperationNode\";\nimport TabNode from \"./TabNode\";\nvar getTabSize = function getTabSize(tab, containerRect) {\n // tabListRef\n var offsetWidth = tab.offsetWidth,\n offsetHeight = tab.offsetHeight,\n offsetTop = tab.offsetTop,\n offsetLeft = tab.offsetLeft;\n var _tab$getBoundingClien = tab.getBoundingClientRect(),\n width = _tab$getBoundingClien.width,\n height = _tab$getBoundingClien.height,\n x = _tab$getBoundingClien.x,\n y = _tab$getBoundingClien.y;\n\n // Use getBoundingClientRect to avoid decimal inaccuracy\n if (Math.abs(width - offsetWidth) < 1) {\n return [width, height, x - containerRect.x, y - containerRect.y];\n }\n return [offsetWidth, offsetHeight, offsetLeft, offsetTop];\n};\nvar getSize = function getSize(refObj) {\n var _ref = refObj.current || {},\n _ref$offsetWidth = _ref.offsetWidth,\n offsetWidth = _ref$offsetWidth === void 0 ? 0 : _ref$offsetWidth,\n _ref$offsetHeight = _ref.offsetHeight,\n offsetHeight = _ref$offsetHeight === void 0 ? 0 : _ref$offsetHeight;\n\n // Use getBoundingClientRect to avoid decimal inaccuracy\n if (refObj.current) {\n var _refObj$current$getBo = refObj.current.getBoundingClientRect(),\n width = _refObj$current$getBo.width,\n height = _refObj$current$getBo.height;\n if (Math.abs(width - offsetWidth) < 1) {\n return [width, height];\n }\n }\n return [offsetWidth, offsetHeight];\n};\n\n/**\n * Convert `SizeInfo` to unit value. Such as [123, 456] with `top` position get `123`\n */\nvar getUnitValue = function getUnitValue(size, tabPositionTopOrBottom) {\n return size[tabPositionTopOrBottom ? 0 : 1];\n};\nvar TabNavList = /*#__PURE__*/React.forwardRef(function (props, ref) {\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 indicator = props.indicator;\n var _React$useContext = React.useContext(TabContext),\n prefixCls = _React$useContext.prefixCls,\n tabs = _React$useContext.tabs;\n var containerRef = useRef(null);\n var extraLeftRef = useRef(null);\n var extraRightRef = useRef(null);\n var tabsWrapperRef = useRef(null);\n var tabListRef = useRef(null);\n var operationsRef = useRef(null);\n var innerAddButtonRef = useRef(null);\n var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';\n var _useSyncState = useSyncState(0, function (next, prev) {\n if (tabPositionTopOrBottom && onTabScroll) {\n onTabScroll({\n dire