first commit
This commit is contained in:
7
frontend/node_modules/antd/lib/tabs/TabPane.d.ts
generated
vendored
Normal file
7
frontend/node_modules/antd/lib/tabs/TabPane.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type * as React from 'react';
|
||||
import type { TabPaneProps as RcTabPaneProps } from 'rc-tabs/lib/TabPanelList/TabPane';
|
||||
import type { CompatibilityProps } from '.';
|
||||
type TabPaneProps = CompatibilityProps & Omit<RcTabPaneProps, 'destroyInactiveTabPane'>;
|
||||
declare const TabPane: React.FC<TabPaneProps>;
|
||||
export type { TabPaneProps };
|
||||
export default TabPane;
|
||||
11
frontend/node_modules/antd/lib/tabs/TabPane.js
generated
vendored
Normal file
11
frontend/node_modules/antd/lib/tabs/TabPane.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
const TabPane = () => null;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
TabPane.displayName = 'DeprecatedTabPane';
|
||||
}
|
||||
var _default = exports.default = TabPane;
|
||||
3
frontend/node_modules/antd/lib/tabs/hooks/useAnimateConfig.d.ts
generated
vendored
Normal file
3
frontend/node_modules/antd/lib/tabs/hooks/useAnimateConfig.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { AnimatedConfig } from 'rc-tabs/lib/interface';
|
||||
import type { TabsProps } from '..';
|
||||
export default function useAnimateConfig(prefixCls: string, animated?: TabsProps['animated']): AnimatedConfig;
|
||||
39
frontend/node_modules/antd/lib/tabs/hooks/useAnimateConfig.js
generated
vendored
Normal file
39
frontend/node_modules/antd/lib/tabs/hooks/useAnimateConfig.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = useAnimateConfig;
|
||||
var _motion = require("../../_util/motion");
|
||||
const motion = {
|
||||
motionAppear: false,
|
||||
motionEnter: true,
|
||||
motionLeave: true
|
||||
};
|
||||
function useAnimateConfig(prefixCls, animated = {
|
||||
inkBar: true,
|
||||
tabPane: false
|
||||
}) {
|
||||
let mergedAnimated;
|
||||
if (animated === false) {
|
||||
mergedAnimated = {
|
||||
inkBar: false,
|
||||
tabPane: false
|
||||
};
|
||||
} else if (animated === true) {
|
||||
mergedAnimated = {
|
||||
inkBar: true,
|
||||
tabPane: true
|
||||
};
|
||||
} else {
|
||||
mergedAnimated = Object.assign({
|
||||
inkBar: true
|
||||
}, typeof animated === 'object' ? animated : {});
|
||||
}
|
||||
if (mergedAnimated.tabPane) {
|
||||
mergedAnimated.tabPaneMotion = Object.assign(Object.assign({}, motion), {
|
||||
motionName: (0, _motion.getTransitionName)(prefixCls, 'switch')
|
||||
});
|
||||
}
|
||||
return mergedAnimated;
|
||||
}
|
||||
5
frontend/node_modules/antd/lib/tabs/hooks/useLegacyItems.d.ts
generated
vendored
Normal file
5
frontend/node_modules/antd/lib/tabs/hooks/useLegacyItems.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import type { Tab } from 'rc-tabs/lib/interface';
|
||||
import type { TabsProps } from '..';
|
||||
declare function useLegacyItems(items?: TabsProps['items'], children?: React.ReactNode): Tab[];
|
||||
export default useLegacyItems;
|
||||
60
frontend/node_modules/antd/lib/tabs/hooks/useLegacyItems.js
generated
vendored
Normal file
60
frontend/node_modules/antd/lib/tabs/hooks/useLegacyItems.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _toArray = _interopRequireDefault(require("rc-util/lib/Children/toArray"));
|
||||
var _warning = require("../../_util/warning");
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
function filter(items) {
|
||||
return items.filter(item => item);
|
||||
}
|
||||
function useLegacyItems(items, children) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Tabs');
|
||||
warning.deprecated(!children, 'Tabs.TabPane', 'items');
|
||||
}
|
||||
if (items) {
|
||||
return items.map(item => {
|
||||
var _a;
|
||||
const mergedDestroyOnHidden = (_a = item.destroyOnHidden) !== null && _a !== void 0 ? _a : item.destroyInactiveTabPane;
|
||||
return Object.assign(Object.assign({}, item), {
|
||||
// TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
|
||||
destroyInactiveTabPane: mergedDestroyOnHidden
|
||||
});
|
||||
});
|
||||
}
|
||||
const childrenItems = (0, _toArray.default)(children).map(node => {
|
||||
if (/*#__PURE__*/React.isValidElement(node)) {
|
||||
const {
|
||||
key,
|
||||
props
|
||||
} = node;
|
||||
const _a = props || {},
|
||||
{
|
||||
tab
|
||||
} = _a,
|
||||
restProps = __rest(_a, ["tab"]);
|
||||
const item = Object.assign(Object.assign({
|
||||
key: String(key)
|
||||
}, restProps), {
|
||||
label: tab
|
||||
});
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
return filter(childrenItems);
|
||||
}
|
||||
var _default = exports.default = useLegacyItems;
|
||||
44
frontend/node_modules/antd/lib/tabs/index.d.ts
generated
vendored
Normal file
44
frontend/node_modules/antd/lib/tabs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import * as React from 'react';
|
||||
import type { TabsProps as RcTabsProps } from 'rc-tabs';
|
||||
import RcTabs from 'rc-tabs';
|
||||
import type { GetIndicatorSize } from 'rc-tabs/lib/hooks/useIndicator';
|
||||
import type { MoreProps, Tab } from 'rc-tabs/lib/interface';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
import TabPane from './TabPane';
|
||||
import type { TabPaneProps } from './TabPane';
|
||||
export type TabsType = 'line' | 'card' | 'editable-card';
|
||||
export type TabsPosition = 'top' | 'right' | 'bottom' | 'left';
|
||||
export type { TabPaneProps };
|
||||
export interface CompatibilityProps {
|
||||
/** @deprecated Please use `destroyOnHidden` instead */
|
||||
destroyInactiveTabPane?: boolean;
|
||||
/**
|
||||
* @since 5.25.0
|
||||
*/
|
||||
destroyOnHidden?: boolean;
|
||||
}
|
||||
export interface TabsRef {
|
||||
nativeElement: React.ComponentRef<typeof RcTabs> | null;
|
||||
}
|
||||
export interface TabsProps extends CompatibilityProps, Omit<RcTabsProps, 'editable' | 'destroyInactiveTabPane' | 'items'> {
|
||||
rootClassName?: string;
|
||||
type?: TabsType;
|
||||
size?: SizeType;
|
||||
hideAdd?: boolean;
|
||||
centered?: boolean;
|
||||
addIcon?: React.ReactNode;
|
||||
moreIcon?: React.ReactNode;
|
||||
more?: MoreProps;
|
||||
removeIcon?: React.ReactNode;
|
||||
onEdit?: (e: React.MouseEvent | React.KeyboardEvent | string, action: 'add' | 'remove') => void;
|
||||
children?: React.ReactNode;
|
||||
/** @deprecated Please use `indicator={{ size: ... }}` instead */
|
||||
indicatorSize?: GetIndicatorSize;
|
||||
items?: (Omit<Tab, 'destroyInactiveTabPane'> & CompatibilityProps)[];
|
||||
}
|
||||
declare const InternalTabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>>;
|
||||
type CompoundedComponent = typeof InternalTabs & {
|
||||
TabPane: typeof TabPane;
|
||||
};
|
||||
declare const Tabs: CompoundedComponent;
|
||||
export default Tabs;
|
||||
133
frontend/node_modules/antd/lib/tabs/index.js
generated
vendored
Normal file
133
frontend/node_modules/antd/lib/tabs/index.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
"use client";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var React = _interopRequireWildcard(require("react"));
|
||||
var _CloseOutlined = _interopRequireDefault(require("@ant-design/icons/CloseOutlined"));
|
||||
var _EllipsisOutlined = _interopRequireDefault(require("@ant-design/icons/EllipsisOutlined"));
|
||||
var _PlusOutlined = _interopRequireDefault(require("@ant-design/icons/PlusOutlined"));
|
||||
var _classnames = _interopRequireDefault(require("classnames"));
|
||||
var _rcTabs = _interopRequireDefault(require("rc-tabs"));
|
||||
var _warning = require("../_util/warning");
|
||||
var _configProvider = require("../config-provider");
|
||||
var _useCSSVarCls = _interopRequireDefault(require("../config-provider/hooks/useCSSVarCls"));
|
||||
var _useSize = _interopRequireDefault(require("../config-provider/hooks/useSize"));
|
||||
var _useAnimateConfig = _interopRequireDefault(require("./hooks/useAnimateConfig"));
|
||||
var _useLegacyItems = _interopRequireDefault(require("./hooks/useLegacyItems"));
|
||||
var _style = _interopRequireDefault(require("./style"));
|
||||
var _TabPane = _interopRequireDefault(require("./TabPane"));
|
||||
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
||||
var t = {};
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
||||
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
||||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
const InternalTabs = /*#__PURE__*/React.forwardRef((props, ref) => {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
||||
const {
|
||||
type,
|
||||
className,
|
||||
rootClassName,
|
||||
size: customSize,
|
||||
onEdit,
|
||||
hideAdd,
|
||||
centered,
|
||||
addIcon,
|
||||
removeIcon,
|
||||
moreIcon,
|
||||
more,
|
||||
popupClassName,
|
||||
children,
|
||||
items,
|
||||
animated,
|
||||
style,
|
||||
indicatorSize,
|
||||
indicator,
|
||||
destroyInactiveTabPane,
|
||||
destroyOnHidden
|
||||
} = props,
|
||||
otherProps = __rest(props, ["type", "className", "rootClassName", "size", "onEdit", "hideAdd", "centered", "addIcon", "removeIcon", "moreIcon", "more", "popupClassName", "children", "items", "animated", "style", "indicatorSize", "indicator", "destroyInactiveTabPane", "destroyOnHidden"]);
|
||||
const {
|
||||
prefixCls: customizePrefixCls
|
||||
} = otherProps;
|
||||
const {
|
||||
direction,
|
||||
tabs,
|
||||
getPrefixCls,
|
||||
getPopupContainer
|
||||
} = React.useContext(_configProvider.ConfigContext);
|
||||
const prefixCls = getPrefixCls('tabs', customizePrefixCls);
|
||||
const rootCls = (0, _useCSSVarCls.default)(prefixCls);
|
||||
const [wrapCSSVar, hashId, cssVarCls] = (0, _style.default)(prefixCls, rootCls);
|
||||
const tabsRef = React.useRef(null);
|
||||
React.useImperativeHandle(ref, () => ({
|
||||
nativeElement: tabsRef.current
|
||||
}));
|
||||
let editable;
|
||||
if (type === 'editable-card') {
|
||||
editable = {
|
||||
onEdit: (editType, {
|
||||
key,
|
||||
event
|
||||
}) => {
|
||||
onEdit === null || onEdit === void 0 ? void 0 : onEdit(editType === 'add' ? event : key, editType);
|
||||
},
|
||||
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.default, null),
|
||||
addIcon: (addIcon !== null && addIcon !== void 0 ? addIcon : tabs === null || tabs === void 0 ? void 0 : tabs.addIcon) || /*#__PURE__*/React.createElement(_PlusOutlined.default, null),
|
||||
showAdd: hideAdd !== true
|
||||
};
|
||||
}
|
||||
const rootPrefixCls = getPrefixCls();
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = (0, _warning.devUseWarning)('Tabs');
|
||||
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;
|
||||
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;
|
||||
warning.deprecated(!('destroyInactiveTabPane' in props || (items === null || items === void 0 ? void 0 : items.some(item => 'destroyInactiveTabPane' in item))), 'destroyInactiveTabPane', 'destroyOnHidden');
|
||||
}
|
||||
const size = (0, _useSize.default)(customSize);
|
||||
const mergedItems = (0, _useLegacyItems.default)(items, children);
|
||||
const mergedAnimated = (0, _useAnimateConfig.default)(prefixCls, animated);
|
||||
const mergedStyle = Object.assign(Object.assign({}, tabs === null || tabs === void 0 ? void 0 : tabs.style), style);
|
||||
const mergedIndicator = {
|
||||
align: (_b = indicator === null || indicator === void 0 ? void 0 : indicator.align) !== null && _b !== void 0 ? _b : (_c = tabs === null || tabs === void 0 ? void 0 : tabs.indicator) === null || _c === void 0 ? void 0 : _c.align,
|
||||
size: (_g = (_e = (_d = indicator === null || indicator === void 0 ? void 0 : indicator.size) !== null && _d !== void 0 ? _d : indicatorSize) !== null && _e !== void 0 ? _e : (_f = tabs === null || tabs === void 0 ? void 0 : tabs.indicator) === null || _f === void 0 ? void 0 : _f.size) !== null && _g !== void 0 ? _g : tabs === null || tabs === void 0 ? void 0 : tabs.indicatorSize
|
||||
};
|
||||
return wrapCSSVar(/*#__PURE__*/React.createElement(_rcTabs.default, Object.assign({
|
||||
ref: tabsRef,
|
||||
direction: direction,
|
||||
getPopupContainer: getPopupContainer
|
||||
}, otherProps, {
|
||||
items: mergedItems,
|
||||
className: (0, _classnames.default)({
|
||||
[`${prefixCls}-${size}`]: size,
|
||||
[`${prefixCls}-card`]: ['card', 'editable-card'].includes(type),
|
||||
[`${prefixCls}-editable-card`]: type === 'editable-card',
|
||||
[`${prefixCls}-centered`]: centered
|
||||
}, tabs === null || tabs === void 0 ? void 0 : tabs.className, className, rootClassName, hashId, cssVarCls, rootCls),
|
||||
popupClassName: (0, _classnames.default)(popupClassName, hashId, cssVarCls, rootCls),
|
||||
style: mergedStyle,
|
||||
editable: editable,
|
||||
more: Object.assign({
|
||||
icon: (_l = (_k = (_j = (_h = tabs === null || tabs === void 0 ? void 0 : tabs.more) === null || _h === void 0 ? void 0 : _h.icon) !== null && _j !== void 0 ? _j : tabs === null || tabs === void 0 ? void 0 : tabs.moreIcon) !== null && _k !== void 0 ? _k : moreIcon) !== null && _l !== void 0 ? _l : /*#__PURE__*/React.createElement(_EllipsisOutlined.default, null),
|
||||
transitionName: `${rootPrefixCls}-slide-up`
|
||||
}, more),
|
||||
prefixCls: prefixCls,
|
||||
animated: mergedAnimated,
|
||||
indicator: mergedIndicator,
|
||||
// TODO: In the future, destroyInactiveTabPane in rc-tabs needs to be upgrade to destroyOnHidden
|
||||
destroyInactiveTabPane: destroyOnHidden !== null && destroyOnHidden !== void 0 ? destroyOnHidden : destroyInactiveTabPane
|
||||
})));
|
||||
});
|
||||
const Tabs = InternalTabs;
|
||||
Tabs.TabPane = _TabPane.default;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
Tabs.displayName = 'Tabs';
|
||||
}
|
||||
var _default = exports.default = Tabs;
|
||||
146
frontend/node_modules/antd/lib/tabs/style/index.d.ts
generated
vendored
Normal file
146
frontend/node_modules/antd/lib/tabs/style/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import type { FullToken, GetDefaultToken } from '../../theme/internal';
|
||||
export interface ComponentToken {
|
||||
/**
|
||||
* @desc 下拉菜单 z-index
|
||||
* @descEN z-index of dropdown menu
|
||||
*/
|
||||
zIndexPopup: number;
|
||||
/**
|
||||
* @desc 卡片标签页背景色
|
||||
* @descEN Background color of card tab
|
||||
*/
|
||||
cardBg: string;
|
||||
/**
|
||||
* @desc 卡片标签页高度
|
||||
* @descEN Height of card tab
|
||||
*/
|
||||
cardHeight: number;
|
||||
/**
|
||||
* @desc 小尺寸卡片标签页高度
|
||||
* @descEN Height of small card tab
|
||||
*/
|
||||
cardHeightSM: number;
|
||||
/**
|
||||
* @desc 大尺寸卡片标签页高度
|
||||
* @descEN Height of large card tab
|
||||
*/
|
||||
cardHeightLG: number;
|
||||
/**
|
||||
* @desc 卡片标签页内间距
|
||||
* @descEN Padding of card tab
|
||||
*/
|
||||
cardPadding: string;
|
||||
/**
|
||||
* @desc 小号卡片标签页内间距
|
||||
* @descEN Padding of small card tab
|
||||
*/
|
||||
cardPaddingSM: string;
|
||||
/**
|
||||
* @desc 大号卡片标签页内间距
|
||||
* @descEN Padding of large card tab
|
||||
*/
|
||||
cardPaddingLG: string;
|
||||
/**
|
||||
* @desc 标签页标题文本大小
|
||||
* @descEN Font size of title
|
||||
*/
|
||||
titleFontSize: number;
|
||||
/**
|
||||
* @desc 大号标签页标题文本大小
|
||||
* @descEN Font size of large title
|
||||
*/
|
||||
titleFontSizeLG: number;
|
||||
/**
|
||||
* @desc 小号标签页标题文本大小
|
||||
* @descEN Font size of small title
|
||||
*/
|
||||
titleFontSizeSM: number;
|
||||
/**
|
||||
* @desc 指示条颜色
|
||||
* @descEN Color of indicator
|
||||
*/
|
||||
inkBarColor: string;
|
||||
/**
|
||||
* @desc 横向标签页外间距
|
||||
* @descEN Horizontal margin of horizontal tab
|
||||
*/
|
||||
horizontalMargin: string;
|
||||
/**
|
||||
* @desc 横向标签页标签间距
|
||||
* @descEN Horizontal gutter of horizontal tab
|
||||
*/
|
||||
horizontalItemGutter: number;
|
||||
/**
|
||||
* @desc 横向标签页标签外间距
|
||||
* @descEN Horizontal margin of horizontal tab item
|
||||
*/
|
||||
horizontalItemMargin: string;
|
||||
/**
|
||||
* @desc 横向标签页标签外间距(RTL)
|
||||
* @descEN Horizontal margin of horizontal tab item (RTL)
|
||||
*/
|
||||
horizontalItemMarginRTL: string;
|
||||
/**
|
||||
* @desc 横向标签页标签内间距
|
||||
* @descEN Horizontal padding of horizontal tab item
|
||||
*/
|
||||
horizontalItemPadding: string;
|
||||
/**
|
||||
* @desc 大号横向标签页标签内间距
|
||||
* @descEN Horizontal padding of large horizontal tab item
|
||||
*/
|
||||
horizontalItemPaddingLG: string;
|
||||
/**
|
||||
* @desc 小号横向标签页标签内间距
|
||||
* @descEN Horizontal padding of small horizontal tab item
|
||||
*/
|
||||
horizontalItemPaddingSM: string;
|
||||
/**
|
||||
* @desc 纵向标签页标签内间距
|
||||
* @descEN Vertical padding of vertical tab item
|
||||
*/
|
||||
verticalItemPadding: string;
|
||||
/**
|
||||
* @desc 纵向标签页标签外间距
|
||||
* @descEN Vertical margin of vertical tab item
|
||||
*/
|
||||
verticalItemMargin: string;
|
||||
/**
|
||||
* @desc 标签文本颜色
|
||||
* @descEN Text color of tab
|
||||
*/
|
||||
itemColor: string;
|
||||
/**
|
||||
* @desc 标签激活态文本颜色
|
||||
* @descEN Text color of active tab
|
||||
*/
|
||||
itemActiveColor: string;
|
||||
/**
|
||||
* @desc 标签悬浮态文本颜色
|
||||
* @descEN Text color of hover tab
|
||||
*/
|
||||
itemHoverColor: string;
|
||||
/**
|
||||
* @desc 标签选中态文本颜色
|
||||
* @descEN Text color of selected tab
|
||||
*/
|
||||
itemSelectedColor: string;
|
||||
/**
|
||||
* @desc 卡片标签间距
|
||||
* @descEN Gutter of card tab
|
||||
*/
|
||||
cardGutter: number;
|
||||
}
|
||||
export interface TabsToken extends FullToken<'Tabs'> {
|
||||
tabsCardPadding: string;
|
||||
dropdownEdgeChildVerticalPadding: number;
|
||||
tabsNavWrapPseudoWidth: number;
|
||||
tabsActiveTextShadow: string;
|
||||
tabsDropdownHeight: number | string;
|
||||
tabsDropdownWidth: number | string;
|
||||
tabsHorizontalItemMargin: string;
|
||||
tabsHorizontalItemMarginRTL: string;
|
||||
}
|
||||
export declare const prepareComponentToken: GetDefaultToken<'Tabs'>;
|
||||
declare const _default: (prefixCls: string, rootCls?: string) => readonly [(node: React.ReactElement) => React.ReactElement, string, string];
|
||||
export default _default;
|
||||
872
frontend/node_modules/antd/lib/tabs/style/index.js
generated
vendored
Normal file
872
frontend/node_modules/antd/lib/tabs/style/index.js
generated
vendored
Normal file
@@ -0,0 +1,872 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.prepareComponentToken = exports.default = void 0;
|
||||
var _cssinjs = require("@ant-design/cssinjs");
|
||||
var _style = require("../../style");
|
||||
var _internal = require("../../theme/internal");
|
||||
var _motion = _interopRequireDefault(require("./motion"));
|
||||
const genCardStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
tabsCardPadding,
|
||||
cardBg,
|
||||
cardGutter,
|
||||
colorBorderSecondary,
|
||||
itemSelectedColor
|
||||
} = token;
|
||||
return {
|
||||
[`${componentCls}-card`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
margin: 0,
|
||||
padding: tabsCardPadding,
|
||||
background: cardBg,
|
||||
border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
|
||||
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`
|
||||
},
|
||||
[`${componentCls}-tab-active`]: {
|
||||
color: itemSelectedColor,
|
||||
background: token.colorBgContainer
|
||||
},
|
||||
[`${componentCls}-tab-focus:has(${componentCls}-tab-btn:focus-visible)`]: (0, _style.genFocusOutline)(token, -3),
|
||||
[`& ${componentCls}-tab${componentCls}-tab-focus ${componentCls}-tab-btn:focus-visible`]: {
|
||||
outline: 'none'
|
||||
},
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
},
|
||||
// ========================== Top & Bottom ==========================
|
||||
[`&${componentCls}-top, &${componentCls}-bottom`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab + ${componentCls}-tab`]: {
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: (0, _cssinjs.unit)(cardGutter)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-top`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
borderRadius: `${(0, _cssinjs.unit)(token.borderRadiusLG)} ${(0, _cssinjs.unit)(token.borderRadiusLG)} 0 0`
|
||||
},
|
||||
[`${componentCls}-tab-active`]: {
|
||||
borderBottomColor: token.colorBgContainer
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-bottom`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
borderRadius: `0 0 ${(0, _cssinjs.unit)(token.borderRadiusLG)} ${(0, _cssinjs.unit)(token.borderRadiusLG)}`
|
||||
},
|
||||
[`${componentCls}-tab-active`]: {
|
||||
borderTopColor: token.colorBgContainer
|
||||
}
|
||||
}
|
||||
},
|
||||
// ========================== Left & Right ==========================
|
||||
[`&${componentCls}-left, &${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab + ${componentCls}-tab`]: {
|
||||
marginTop: (0, _cssinjs.unit)(cardGutter)
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-left`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
borderRadius: {
|
||||
_skip_check_: true,
|
||||
value: `${(0, _cssinjs.unit)(token.borderRadiusLG)} 0 0 ${(0, _cssinjs.unit)(token.borderRadiusLG)}`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-tab-active`]: {
|
||||
borderRightColor: {
|
||||
_skip_check_: true,
|
||||
value: token.colorBgContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
borderRadius: {
|
||||
_skip_check_: true,
|
||||
value: `0 ${(0, _cssinjs.unit)(token.borderRadiusLG)} ${(0, _cssinjs.unit)(token.borderRadiusLG)} 0`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-tab-active`]: {
|
||||
borderLeftColor: {
|
||||
_skip_check_: true,
|
||||
value: token.colorBgContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genDropdownStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
itemHoverColor,
|
||||
dropdownEdgeChildVerticalPadding
|
||||
} = token;
|
||||
return {
|
||||
[`${componentCls}-dropdown`]: Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
position: 'absolute',
|
||||
top: -9999,
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: -9999
|
||||
},
|
||||
zIndex: token.zIndexPopup,
|
||||
display: 'block',
|
||||
'&-hidden': {
|
||||
display: 'none'
|
||||
},
|
||||
[`${componentCls}-dropdown-menu`]: {
|
||||
maxHeight: token.tabsDropdownHeight,
|
||||
margin: 0,
|
||||
padding: `${(0, _cssinjs.unit)(dropdownEdgeChildVerticalPadding)} 0`,
|
||||
overflowX: 'hidden',
|
||||
overflowY: 'auto',
|
||||
textAlign: {
|
||||
_skip_check_: true,
|
||||
value: 'left'
|
||||
},
|
||||
listStyleType: 'none',
|
||||
backgroundColor: token.colorBgContainer,
|
||||
backgroundClip: 'padding-box',
|
||||
borderRadius: token.borderRadiusLG,
|
||||
outline: 'none',
|
||||
boxShadow: token.boxShadowSecondary,
|
||||
'&-item': Object.assign(Object.assign({}, _style.textEllipsis), {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
minWidth: token.tabsDropdownWidth,
|
||||
margin: 0,
|
||||
padding: `${(0, _cssinjs.unit)(token.paddingXXS)} ${(0, _cssinjs.unit)(token.paddingSM)}`,
|
||||
color: token.colorText,
|
||||
fontWeight: 'normal',
|
||||
fontSize: token.fontSize,
|
||||
lineHeight: token.lineHeight,
|
||||
cursor: 'pointer',
|
||||
transition: `all ${token.motionDurationSlow}`,
|
||||
'> span': {
|
||||
flex: 1,
|
||||
whiteSpace: 'nowrap'
|
||||
},
|
||||
'&-remove': {
|
||||
flex: 'none',
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: token.marginSM
|
||||
},
|
||||
color: token.colorIcon,
|
||||
fontSize: token.fontSizeSM,
|
||||
background: 'transparent',
|
||||
border: 0,
|
||||
cursor: 'pointer',
|
||||
'&:hover': {
|
||||
color: itemHoverColor
|
||||
}
|
||||
},
|
||||
'&:hover': {
|
||||
background: token.controlItemBgHover
|
||||
},
|
||||
'&-disabled': {
|
||||
'&, &:hover': {
|
||||
color: token.colorTextDisabled,
|
||||
background: 'transparent',
|
||||
cursor: 'not-allowed'
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
};
|
||||
};
|
||||
const genPositionStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
margin,
|
||||
colorBorderSecondary,
|
||||
horizontalMargin,
|
||||
verticalItemPadding,
|
||||
verticalItemMargin,
|
||||
calc
|
||||
} = token;
|
||||
return {
|
||||
// ========================== Top & Bottom ==========================
|
||||
[`${componentCls}-top, ${componentCls}-bottom`]: {
|
||||
flexDirection: 'column',
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
margin: horizontalMargin,
|
||||
'&::before': {
|
||||
position: 'absolute',
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
borderBottom: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
|
||||
content: "''"
|
||||
},
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
height: token.lineWidthBold,
|
||||
'&-animated': {
|
||||
transition: `width ${token.motionDurationSlow}, left ${token.motionDurationSlow},
|
||||
right ${token.motionDurationSlow}`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-nav-wrap`]: {
|
||||
'&::before, &::after': {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
width: token.controlHeight
|
||||
},
|
||||
'&::before': {
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
boxShadow: token.boxShadowTabsOverflowLeft
|
||||
},
|
||||
'&::after': {
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
boxShadow: token.boxShadowTabsOverflowRight
|
||||
},
|
||||
[`&${componentCls}-nav-wrap-ping-left::before`]: {
|
||||
opacity: 1
|
||||
},
|
||||
[`&${componentCls}-nav-wrap-ping-right::after`]: {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-top`]: {
|
||||
[`> ${componentCls}-nav,
|
||||
> div > ${componentCls}-nav`]: {
|
||||
'&::before': {
|
||||
bottom: 0
|
||||
},
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
bottom: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-bottom`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
order: 1,
|
||||
marginTop: margin,
|
||||
marginBottom: 0,
|
||||
'&::before': {
|
||||
top: 0
|
||||
},
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
top: 0
|
||||
}
|
||||
},
|
||||
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
|
||||
order: 0
|
||||
}
|
||||
},
|
||||
// ========================== Left & Right ==========================
|
||||
[`${componentCls}-left, ${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
flexDirection: 'column',
|
||||
minWidth: calc(token.controlHeight).mul(1.25).equal(),
|
||||
// >>>>>>>>>>> Tab
|
||||
[`${componentCls}-tab`]: {
|
||||
padding: verticalItemPadding,
|
||||
textAlign: 'center'
|
||||
},
|
||||
[`${componentCls}-tab + ${componentCls}-tab`]: {
|
||||
margin: verticalItemMargin
|
||||
},
|
||||
// >>>>>>>>>>> Nav
|
||||
[`${componentCls}-nav-wrap`]: {
|
||||
flexDirection: 'column',
|
||||
'&::before, &::after': {
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
height: token.controlHeight
|
||||
},
|
||||
'&::before': {
|
||||
top: 0,
|
||||
boxShadow: token.boxShadowTabsOverflowTop
|
||||
},
|
||||
'&::after': {
|
||||
bottom: 0,
|
||||
boxShadow: token.boxShadowTabsOverflowBottom
|
||||
},
|
||||
[`&${componentCls}-nav-wrap-ping-top::before`]: {
|
||||
opacity: 1
|
||||
},
|
||||
[`&${componentCls}-nav-wrap-ping-bottom::after`]: {
|
||||
opacity: 1
|
||||
}
|
||||
},
|
||||
// >>>>>>>>>>> Ink Bar
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
width: token.lineWidthBold,
|
||||
'&-animated': {
|
||||
transition: `height ${token.motionDurationSlow}, top ${token.motionDurationSlow}`
|
||||
}
|
||||
},
|
||||
[`${componentCls}-nav-list, ${componentCls}-nav-operations`]: {
|
||||
flex: '1 0 auto',
|
||||
// fix safari scroll problem
|
||||
flexDirection: 'column'
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-left`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: (0, _cssinjs.unit)(calc(token.lineWidth).mul(-1).equal())
|
||||
},
|
||||
borderLeft: {
|
||||
_skip_check_: true,
|
||||
value: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
||||
},
|
||||
[`> ${componentCls}-content > ${componentCls}-tabpane`]: {
|
||||
paddingLeft: {
|
||||
_skip_check_: true,
|
||||
value: token.paddingLG
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
order: 1,
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
|
||||
order: 0,
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: calc(token.lineWidth).mul(-1).equal()
|
||||
},
|
||||
borderRight: {
|
||||
_skip_check_: true,
|
||||
value: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
|
||||
},
|
||||
[`> ${componentCls}-content > ${componentCls}-tabpane`]: {
|
||||
paddingRight: {
|
||||
_skip_check_: true,
|
||||
value: token.paddingLG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genSizeStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
cardPaddingSM,
|
||||
cardPaddingLG,
|
||||
cardHeightSM,
|
||||
cardHeightLG,
|
||||
horizontalItemPaddingSM,
|
||||
horizontalItemPaddingLG
|
||||
} = token;
|
||||
return {
|
||||
// >>>>> shared
|
||||
[componentCls]: {
|
||||
'&-small': {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
padding: horizontalItemPaddingSM,
|
||||
fontSize: token.titleFontSizeSM
|
||||
}
|
||||
}
|
||||
},
|
||||
'&-large': {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
padding: horizontalItemPaddingLG,
|
||||
fontSize: token.titleFontSizeLG,
|
||||
lineHeight: token.lineHeightLG
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// >>>>> card
|
||||
[`${componentCls}-card`]: {
|
||||
// Small
|
||||
[`&${componentCls}-small`]: {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
padding: cardPaddingSM
|
||||
},
|
||||
[`${componentCls}-nav-add`]: {
|
||||
minWidth: cardHeightSM,
|
||||
minHeight: cardHeightSM
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-bottom`]: {
|
||||
[`> ${componentCls}-nav ${componentCls}-tab`]: {
|
||||
borderRadius: `0 0 ${(0, _cssinjs.unit)(token.borderRadius)} ${(0, _cssinjs.unit)(token.borderRadius)}`
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-top`]: {
|
||||
[`> ${componentCls}-nav ${componentCls}-tab`]: {
|
||||
borderRadius: `${(0, _cssinjs.unit)(token.borderRadius)} ${(0, _cssinjs.unit)(token.borderRadius)} 0 0`
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav ${componentCls}-tab`]: {
|
||||
borderRadius: {
|
||||
_skip_check_: true,
|
||||
value: `0 ${(0, _cssinjs.unit)(token.borderRadius)} ${(0, _cssinjs.unit)(token.borderRadius)} 0`
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-left`]: {
|
||||
[`> ${componentCls}-nav ${componentCls}-tab`]: {
|
||||
borderRadius: {
|
||||
_skip_check_: true,
|
||||
value: `${(0, _cssinjs.unit)(token.borderRadius)} 0 0 ${(0, _cssinjs.unit)(token.borderRadius)}`
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Large
|
||||
[`&${componentCls}-large`]: {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
padding: cardPaddingLG
|
||||
},
|
||||
[`${componentCls}-nav-add`]: {
|
||||
minWidth: cardHeightLG,
|
||||
minHeight: cardHeightLG
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genTabStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
itemActiveColor,
|
||||
itemHoverColor,
|
||||
iconCls,
|
||||
tabsHorizontalItemMargin,
|
||||
horizontalItemPadding,
|
||||
itemSelectedColor,
|
||||
itemColor
|
||||
} = token;
|
||||
const tabCls = `${componentCls}-tab`;
|
||||
return {
|
||||
[tabCls]: {
|
||||
position: 'relative',
|
||||
WebkitTouchCallout: 'none',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
padding: horizontalItemPadding,
|
||||
fontSize: token.titleFontSize,
|
||||
background: 'transparent',
|
||||
border: 0,
|
||||
outline: 'none',
|
||||
cursor: 'pointer',
|
||||
color: itemColor,
|
||||
'&-btn, &-remove': {
|
||||
'&:focus:not(:focus-visible), &:active': {
|
||||
color: itemActiveColor
|
||||
}
|
||||
},
|
||||
'&-btn': {
|
||||
outline: 'none',
|
||||
transition: `all ${token.motionDurationSlow}`,
|
||||
[`${tabCls}-icon:not(:last-child)`]: {
|
||||
marginInlineEnd: token.marginSM
|
||||
}
|
||||
},
|
||||
'&-remove': Object.assign({
|
||||
flex: 'none',
|
||||
lineHeight: 1,
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: token.calc(token.marginXXS).mul(-1).equal()
|
||||
},
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: token.marginXS
|
||||
},
|
||||
color: token.colorIcon,
|
||||
fontSize: token.fontSizeSM,
|
||||
background: 'transparent',
|
||||
border: 'none',
|
||||
outline: 'none',
|
||||
cursor: 'pointer',
|
||||
transition: `all ${token.motionDurationSlow}`,
|
||||
'&:hover': {
|
||||
color: token.colorTextHeading
|
||||
}
|
||||
}, (0, _style.genFocusStyle)(token)),
|
||||
'&:hover': {
|
||||
color: itemHoverColor
|
||||
},
|
||||
[`&${tabCls}-active ${tabCls}-btn`]: {
|
||||
color: itemSelectedColor,
|
||||
textShadow: token.tabsActiveTextShadow
|
||||
},
|
||||
[`&${tabCls}-focus ${tabCls}-btn:focus-visible`]: (0, _style.genFocusOutline)(token),
|
||||
[`&${tabCls}-disabled`]: {
|
||||
color: token.colorTextDisabled,
|
||||
cursor: 'not-allowed'
|
||||
},
|
||||
[`&${tabCls}-disabled ${tabCls}-btn, &${tabCls}-disabled ${componentCls}-remove`]: {
|
||||
'&:focus, &:active': {
|
||||
color: token.colorTextDisabled
|
||||
}
|
||||
},
|
||||
[`& ${tabCls}-remove ${iconCls}`]: {
|
||||
margin: 0,
|
||||
verticalAlign: 'middle'
|
||||
},
|
||||
[`${iconCls}:not(:last-child)`]: {
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: token.marginSM
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${tabCls} + ${tabCls}`]: {
|
||||
margin: {
|
||||
_skip_check_: true,
|
||||
value: tabsHorizontalItemMargin
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genRtlStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
tabsHorizontalItemMarginRTL,
|
||||
iconCls,
|
||||
cardGutter,
|
||||
calc
|
||||
} = token;
|
||||
const rtlCls = `${componentCls}-rtl`;
|
||||
return {
|
||||
[rtlCls]: {
|
||||
direction: 'rtl',
|
||||
[`${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab`]: {
|
||||
margin: {
|
||||
_skip_check_: true,
|
||||
value: tabsHorizontalItemMarginRTL
|
||||
},
|
||||
[`${componentCls}-tab:last-of-type`]: {
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
}
|
||||
},
|
||||
[iconCls]: {
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: (0, _cssinjs.unit)(token.marginSM)
|
||||
}
|
||||
},
|
||||
[`${componentCls}-tab-remove`]: {
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: (0, _cssinjs.unit)(token.marginXS)
|
||||
},
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: (0, _cssinjs.unit)(calc(token.marginXXS).mul(-1).equal())
|
||||
},
|
||||
[iconCls]: {
|
||||
margin: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-left`]: {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
order: 1
|
||||
},
|
||||
[`> ${componentCls}-content-holder`]: {
|
||||
order: 0
|
||||
}
|
||||
},
|
||||
[`&${componentCls}-right`]: {
|
||||
[`> ${componentCls}-nav`]: {
|
||||
order: 0
|
||||
},
|
||||
[`> ${componentCls}-content-holder`]: {
|
||||
order: 1
|
||||
}
|
||||
},
|
||||
// ====================== Card ======================
|
||||
[`&${componentCls}-card${componentCls}-top, &${componentCls}-card${componentCls}-bottom`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-tab + ${componentCls}-tab`]: {
|
||||
marginRight: {
|
||||
_skip_check_: true,
|
||||
value: cardGutter
|
||||
},
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
[`${componentCls}-dropdown-rtl`]: {
|
||||
direction: 'rtl'
|
||||
},
|
||||
[`${componentCls}-menu-item`]: {
|
||||
[`${componentCls}-dropdown-rtl`]: {
|
||||
textAlign: {
|
||||
_skip_check_: true,
|
||||
value: 'right'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const genTabsStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
tabsCardPadding,
|
||||
cardHeight,
|
||||
cardGutter,
|
||||
itemHoverColor,
|
||||
itemActiveColor,
|
||||
colorBorderSecondary
|
||||
} = token;
|
||||
return {
|
||||
[componentCls]: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, _style.resetComponent)(token)), {
|
||||
display: 'flex',
|
||||
// ========================== Navigation ==========================
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
flex: 'none',
|
||||
alignItems: 'center',
|
||||
[`${componentCls}-nav-wrap`]: {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
flex: 'auto',
|
||||
alignSelf: 'stretch',
|
||||
overflow: 'hidden',
|
||||
whiteSpace: 'nowrap',
|
||||
transform: 'translate(0)',
|
||||
// Fix chrome render bug
|
||||
// >>>>> Ping shadow
|
||||
'&::before, &::after': {
|
||||
position: 'absolute',
|
||||
zIndex: 1,
|
||||
opacity: 0,
|
||||
transition: `opacity ${token.motionDurationSlow}`,
|
||||
content: "''",
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
},
|
||||
[`${componentCls}-nav-list`]: {
|
||||
position: 'relative',
|
||||
display: 'flex',
|
||||
transition: `opacity ${token.motionDurationSlow}`
|
||||
},
|
||||
// >>>>>>>> Operations
|
||||
[`${componentCls}-nav-operations`]: {
|
||||
display: 'flex',
|
||||
alignSelf: 'stretch'
|
||||
},
|
||||
[`${componentCls}-nav-operations-hidden`]: {
|
||||
position: 'absolute',
|
||||
visibility: 'hidden',
|
||||
pointerEvents: 'none'
|
||||
},
|
||||
[`${componentCls}-nav-more`]: {
|
||||
position: 'relative',
|
||||
padding: tabsCardPadding,
|
||||
background: 'transparent',
|
||||
border: 0,
|
||||
color: token.colorText,
|
||||
'&::after': {
|
||||
position: 'absolute',
|
||||
right: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
bottom: 0,
|
||||
left: {
|
||||
_skip_check_: true,
|
||||
value: 0
|
||||
},
|
||||
height: token.calc(token.controlHeightLG).div(8).equal(),
|
||||
transform: 'translateY(100%)',
|
||||
content: "''"
|
||||
}
|
||||
},
|
||||
[`${componentCls}-nav-add`]: Object.assign({
|
||||
minWidth: cardHeight,
|
||||
minHeight: cardHeight,
|
||||
marginLeft: {
|
||||
_skip_check_: true,
|
||||
value: cardGutter
|
||||
},
|
||||
background: 'transparent',
|
||||
border: `${(0, _cssinjs.unit)(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
|
||||
borderRadius: `${(0, _cssinjs.unit)(token.borderRadiusLG)} ${(0, _cssinjs.unit)(token.borderRadiusLG)} 0 0`,
|
||||
outline: 'none',
|
||||
cursor: 'pointer',
|
||||
color: token.colorText,
|
||||
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
||||
'&:hover': {
|
||||
color: itemHoverColor
|
||||
},
|
||||
'&:active, &:focus:not(:focus-visible)': {
|
||||
color: itemActiveColor
|
||||
}
|
||||
}, (0, _style.genFocusStyle)(token, -3))
|
||||
},
|
||||
[`${componentCls}-extra-content`]: {
|
||||
flex: 'none'
|
||||
},
|
||||
// ============================ InkBar ============================
|
||||
[`${componentCls}-ink-bar`]: {
|
||||
position: 'absolute',
|
||||
background: token.inkBarColor,
|
||||
pointerEvents: 'none'
|
||||
}
|
||||
}), genTabStyle(token)), {
|
||||
// =========================== TabPanes ===========================
|
||||
[`${componentCls}-content`]: {
|
||||
position: 'relative',
|
||||
width: '100%'
|
||||
},
|
||||
[`${componentCls}-content-holder`]: {
|
||||
flex: 'auto',
|
||||
minWidth: 0,
|
||||
minHeight: 0
|
||||
},
|
||||
[`${componentCls}-tabpane`]: Object.assign(Object.assign({}, (0, _style.genFocusStyle)(token)), {
|
||||
'&-hidden': {
|
||||
display: 'none'
|
||||
}
|
||||
})
|
||||
}),
|
||||
[`${componentCls}-centered`]: {
|
||||
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
|
||||
[`${componentCls}-nav-wrap`]: {
|
||||
[`&:not([class*='${componentCls}-nav-wrap-ping']) > ${componentCls}-nav-list`]: {
|
||||
margin: 'auto'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
const prepareComponentToken = token => {
|
||||
const {
|
||||
cardHeight,
|
||||
cardHeightSM,
|
||||
cardHeightLG,
|
||||
controlHeight,
|
||||
controlHeightLG
|
||||
} = token;
|
||||
const mergedCardHeight = cardHeight || controlHeightLG;
|
||||
const mergedCardHeightSM = cardHeightSM || controlHeight;
|
||||
// `controlHeight` missing XL variable, so we directly write it here:
|
||||
const mergedCardHeightLG = cardHeightLG || controlHeightLG + 8;
|
||||
return {
|
||||
zIndexPopup: token.zIndexPopupBase + 50,
|
||||
cardBg: token.colorFillAlter,
|
||||
// We can not pass this as valid value,
|
||||
// Since `cardHeight` will lock nav add button height.
|
||||
cardHeight: mergedCardHeight,
|
||||
cardHeightSM: mergedCardHeightSM,
|
||||
cardHeightLG: mergedCardHeightLG,
|
||||
// Initialize with empty string, because cardPadding will be calculated with cardHeight by default.
|
||||
cardPadding: `${(mergedCardHeight - token.fontHeight) / 2 - token.lineWidth}px ${token.padding}px`,
|
||||
cardPaddingSM: `${(mergedCardHeightSM - token.fontHeight) / 2 - token.lineWidth}px ${token.paddingXS}px`,
|
||||
cardPaddingLG: `${(mergedCardHeightLG - token.fontHeightLG) / 2 - token.lineWidth}px ${token.padding}px`,
|
||||
titleFontSize: token.fontSize,
|
||||
titleFontSizeLG: token.fontSizeLG,
|
||||
titleFontSizeSM: token.fontSize,
|
||||
inkBarColor: token.colorPrimary,
|
||||
horizontalMargin: `0 0 ${token.margin}px 0`,
|
||||
horizontalItemGutter: 32,
|
||||
// Fixed Value
|
||||
// Initialize with empty string, because horizontalItemMargin will be calculated with horizontalItemGutter by default.
|
||||
horizontalItemMargin: ``,
|
||||
horizontalItemMarginRTL: ``,
|
||||
horizontalItemPadding: `${token.paddingSM}px 0`,
|
||||
horizontalItemPaddingSM: `${token.paddingXS}px 0`,
|
||||
horizontalItemPaddingLG: `${token.padding}px 0`,
|
||||
verticalItemPadding: `${token.paddingXS}px ${token.paddingLG}px`,
|
||||
verticalItemMargin: `${token.margin}px 0 0 0`,
|
||||
itemColor: token.colorText,
|
||||
itemSelectedColor: token.colorPrimary,
|
||||
itemHoverColor: token.colorPrimaryHover,
|
||||
itemActiveColor: token.colorPrimaryActive,
|
||||
cardGutter: token.marginXXS / 2
|
||||
};
|
||||
};
|
||||
// ============================== Export ==============================
|
||||
exports.prepareComponentToken = prepareComponentToken;
|
||||
var _default = exports.default = (0, _internal.genStyleHooks)('Tabs', token => {
|
||||
const tabsToken = (0, _internal.mergeToken)(token, {
|
||||
// `cardPadding` is empty by default, so we could calculate with dynamic `cardHeight`
|
||||
tabsCardPadding: token.cardPadding,
|
||||
dropdownEdgeChildVerticalPadding: token.paddingXXS,
|
||||
tabsActiveTextShadow: '0 0 0.25px currentcolor',
|
||||
tabsDropdownHeight: 200,
|
||||
tabsDropdownWidth: 120,
|
||||
tabsHorizontalItemMargin: `0 0 0 ${(0, _cssinjs.unit)(token.horizontalItemGutter)}`,
|
||||
tabsHorizontalItemMarginRTL: `0 0 0 ${(0, _cssinjs.unit)(token.horizontalItemGutter)}`
|
||||
});
|
||||
return [genSizeStyle(tabsToken), genRtlStyle(tabsToken), genPositionStyle(tabsToken), genDropdownStyle(tabsToken), genCardStyle(tabsToken), genTabsStyle(tabsToken), (0, _motion.default)(tabsToken)];
|
||||
}, prepareComponentToken);
|
||||
4
frontend/node_modules/antd/lib/tabs/style/motion.d.ts
generated
vendored
Normal file
4
frontend/node_modules/antd/lib/tabs/style/motion.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { TabsToken } from '.';
|
||||
import type { GenerateStyle } from '../../theme/internal';
|
||||
declare const genMotionStyle: GenerateStyle<TabsToken>;
|
||||
export default genMotionStyle;
|
||||
44
frontend/node_modules/antd/lib/tabs/style/motion.js
generated
vendored
Normal file
44
frontend/node_modules/antd/lib/tabs/style/motion.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _motion = require("../../style/motion");
|
||||
const genMotionStyle = token => {
|
||||
const {
|
||||
componentCls,
|
||||
motionDurationSlow
|
||||
} = token;
|
||||
return [{
|
||||
[componentCls]: {
|
||||
[`${componentCls}-switch`]: {
|
||||
'&-appear, &-enter': {
|
||||
transition: 'none',
|
||||
'&-start': {
|
||||
opacity: 0
|
||||
},
|
||||
'&-active': {
|
||||
opacity: 1,
|
||||
transition: `opacity ${motionDurationSlow}`
|
||||
}
|
||||
},
|
||||
'&-leave': {
|
||||
position: 'absolute',
|
||||
transition: 'none',
|
||||
inset: 0,
|
||||
'&-start': {
|
||||
opacity: 1
|
||||
},
|
||||
'&-active': {
|
||||
opacity: 0,
|
||||
transition: `opacity ${motionDurationSlow}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Follow code may reuse in other components
|
||||
[(0, _motion.initSlideMotion)(token, 'slide-up'), (0, _motion.initSlideMotion)(token, 'slide-down')]];
|
||||
};
|
||||
var _default = exports.default = genMotionStyle;
|
||||
Reference in New Issue
Block a user