1 line
19 KiB
JSON
1 line
19 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport EllipsisOutlined from \"@ant-design/icons/es/icons/EllipsisOutlined\";\nimport PlusOutlined from \"@ant-design/icons/es/icons/PlusOutlined\";\nimport classNames from 'classnames';\nimport RcTabs from 'rc-tabs';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport useSize from '../config-provider/hooks/useSize';\nimport useAnimateConfig from './hooks/useAnimateConfig';\nimport useLegacyItems from './hooks/useLegacyItems';\nimport useStyle from './style';\nimport TabPane from './TabPane';\nconst Tabs = props => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n const {\n type,\n className,\n rootClassName,\n size: customSize,\n onEdit,\n hideAdd,\n centered,\n addIcon,\n removeIcon,\n moreIcon,\n more,\n popupClassName,\n children,\n items,\n animated,\n style,\n indicatorSize,\n indicator\n } = props,\n otherProps = __rest(props, [\"type\", \"className\", \"rootClassName\", \"size\", \"onEdit\", \"hideAdd\", \"centered\", \"addIcon\", \"removeIcon\", \"moreIcon\", \"more\", \"popupClassName\", \"children\", \"items\", \"animated\", \"style\", \"indicatorSize\", \"indicator\"]);\n const {\n prefixCls: customizePrefixCls\n } = otherProps;\n const {\n direction,\n tabs,\n getPrefixCls,\n getPopupContainer\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('tabs', customizePrefixCls);\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n let editable;\n if (type === 'editable-card') {\n editable = {\n onEdit: (editType, _ref) => {\n let {\n key,\n event\n } = _ref;\n onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === 'add' ? event : key, editType);\n },\n removeIcon: (_a = removeIcon !== null && removeIcon !== void 0 ? removeIcon : tabs === null || tabs === void 0 ? void 0 : tabs.removeIcon) !== null && _a !== void 0 ? _a : /*#__PURE__*/React.createElement(CloseOutlined, null),\n addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /*#__PURE__*/React.createElement(PlusOutlined, null),\n showAdd: hideAdd !== true\n };\n }\n const rootPrefixCls = getPrefixCls();\n if (process.env.NODE_ENV !== 'production') {\n const warning = devUseWarning('Tabs');\n process.env.NODE_ENV !== \"production\" ? warning(!('onPrevClick' in props) && !('onNextClick' in props), 'breaking', '`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.') : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(indicatorSize || (tabs === null || tabs === void 0 ? void 0 : tabs.indicatorSize)), 'deprecated', '`indicatorSize` has been deprecated. Please use `indicator={{ size: ... }}` instead.') : void 0;\n }\n const size = useSize(customSize);\n const mergedItems = useLegacyItems(items, children);\n const mergedAnimated = useAnimateConfig(prefixCls, animated);\n const mergedStyle = Object.assign(Object.assign({}, tabs === null || tabs === void 0 ? void 0 : tabs.style), style);\n const mergedIndicator = {\n align: (_b = indicator === null || indicator === void 0 ? void 0 : indicator.align) !== null && _b !== void 0 ? _b : (_c = tabs === n
|