PromoCursed/node_modules/.cache/babel-loader/47d45cc1fcaa538615fabcc281283610a5f56f69ced4fce23befb38edb6301dc.json

1 line
21 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 _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"id\", \"prefixCls\", \"className\", \"items\", \"direction\", \"activeKey\", \"defaultActiveKey\", \"editable\", \"animated\", \"tabPosition\", \"tabBarGutter\", \"tabBarStyle\", \"tabBarExtraContent\", \"locale\", \"more\", \"destroyInactiveTabPane\", \"renderTabBar\", \"onChange\", \"onTabClick\", \"onTabScroll\", \"getPopupContainer\", \"popupClassName\", \"indicator\"];\n// Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Tab_Role\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport isMobile from \"rc-util/es/isMobile\";\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport TabContext from \"./TabContext\";\nimport TabNavListWrapper from \"./TabNavList/Wrapper\";\nimport TabPanelList from \"./TabPanelList\";\nimport useAnimateConfig from \"./hooks/useAnimateConfig\";\n/**\n * Should added antd:\n * - type\n *\n * Removed:\n * - onNextClick\n * - onPrevClick\n * - keyboard\n */\n\n// Used for accessibility\nvar uuid = 0;\nvar Tabs = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var id = props.id,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-tabs' : _props$prefixCls,\n className = props.className,\n items = props.items,\n direction = props.direction,\n activeKey = props.activeKey,\n defaultActiveKey = props.defaultActiveKey,\n editable = props.editable,\n animated = props.animated,\n _props$tabPosition = props.tabPosition,\n tabPosition = _props$tabPosition === void 0 ? 'top' : _props$tabPosition,\n tabBarGutter = props.tabBarGutter,\n tabBarStyle = props.tabBarStyle,\n tabBarExtraContent = props.tabBarExtraContent,\n locale = props.locale,\n more = props.more,\n destroyInactiveTabPane = props.destroyInactiveTabPane,\n renderTabBar = props.renderTabBar,\n onChange = props.onChange,\n onTabClick = props.onTabClick,\n onTabScroll = props.onTabScroll,\n getPopupContainer = props.getPopupContainer,\n popupClassName = props.popupClassName,\n indicator = props.indicator,\n restProps = _objectWithoutProperties(props, _excluded);\n var tabs = React.useMemo(function () {\n return (items || []).filter(function (item) {\n return item && _typeof(item) === 'object' && 'key' in item;\n });\n }, [items]);\n var rtl = direction === 'rtl';\n var mergedAnimated = useAnimateConfig(animated);\n\n // ======================== Mobile ========================\n var _useState = useState(false),\n _useState2 = _slicedToArray(_useState, 2),\n mobile = _useState2[0],\n setMobile = _useState2[1];\n useEffect(function () {\n // Only update on the client side\n setMobile(isMobile());\n }, []);\n\n // ====================== Active Key ======================\n var _useMergedState = useMergedState(function () {\n var _tabs$;\n return (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key;\n }, {\n value: activeKey,\n defaultValue: defaultActiveKey\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n mergedActiveKey = _useMergedState2[0],\n setMergedActiveKey = _useMergedState2[1];\n var _useState3 = useState(function () {\n return tabs.findIndex(function (tab) {\n return tab.key === mergedActiveKey;\n });\n }),\n _useState4 = _slicedToArray(_useState3, 2),\n activeIndex = _useState4[0],\n setActiveIndex = _useState4[1];\n\n // Reset active key if not exist anymore\n useEffect(function () {\n var newActi