@oceanbase/design 0.4.16 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/design.min.js +1 -1
- package/es/card/style/index.js +4 -2
- package/es/form/FormItem.d.ts +1 -0
- package/es/form/FormItem.js +1 -0
- package/es/table/style/index.js +1 -3
- package/es/tabs/index.d.ts +8 -6
- package/es/tabs/index.js +10 -7
- package/es/tabs/style/index.js +2 -3
- package/es/typography/style/index.js +2 -6
- package/lib/card/style/index.js +9 -1
- package/lib/form/FormItem.d.ts +1 -0
- package/lib/form/FormItem.js +6 -0
- package/lib/table/style/index.js +2 -4
- package/lib/tabs/index.d.ts +8 -6
- package/lib/tabs/index.js +68 -62
- package/lib/tabs/style/index.js +6 -4
- package/lib/typography/style/index.js +2 -9
- package/package.json +7 -7
package/es/card/style/index.js
CHANGED
|
@@ -30,10 +30,12 @@ export var genCardStyle = function genCardStyle(token) {
|
|
|
30
30
|
var tableComponentCls = "".concat(antCls, "-table");
|
|
31
31
|
return _ref2 = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref2, "".concat(componentCls), _defineProperty({}, "".concat(componentCls, ":not(").concat(componentCls, "-bordered):not(").concat(componentCls, "-type-inner)"), {
|
|
32
32
|
boxShadow: 'none'
|
|
33
|
-
})), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), {
|
|
33
|
+
})), "".concat(componentCls).concat(componentCls, "-no-divider"), _defineProperty({}, "".concat(componentCls, "-head"), _defineProperty({
|
|
34
34
|
// should not remove border-bottom to avoid tabs inkbar display correctly
|
|
35
35
|
borderBottomColor: 'transparent'
|
|
36
|
-
}
|
|
36
|
+
}, tabsComponentCls, _defineProperty({}, "&".concat(tabsComponentCls, "-top, &").concat(tabsComponentCls, "-bottom"), _defineProperty({}, "".concat(tabsComponentCls, "-nav::before"), {
|
|
37
|
+
border: 'none'
|
|
38
|
+
}))))), "".concat(componentCls).concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
37
39
|
padding: "0 ".concat(paddingLG, "px ").concat(paddingLG, "px ").concat(paddingLG, "px")
|
|
38
40
|
})), "".concat(componentCls, "-small").concat(componentCls, "-no-divider:not(").concat(componentCls, "-contain-tabs)"), _defineProperty({}, "".concat(componentCls, "-body"), {
|
|
39
41
|
padding: "0 ".concat(paddingSM, "px ").concat(paddingSM, "px ").concat(paddingSM, "px")
|
package/es/form/FormItem.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => R
|
|
|
9
9
|
warnings: React.ReactNode[];
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
+
export * from 'antd/es/form/FormItem';
|
|
12
13
|
export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
|
|
13
14
|
icon?: React.ReactElement;
|
|
14
15
|
};
|
package/es/form/FormItem.js
CHANGED
|
@@ -20,6 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
var AntFormItem = AntForm.Item;
|
|
23
|
+
export * from 'antd/es/form/FormItem';
|
|
23
24
|
var FormItem = function FormItem(_ref) {
|
|
24
25
|
var _children$type;
|
|
25
26
|
var children = _ref.children,
|
package/es/table/style/index.js
CHANGED
|
@@ -54,9 +54,7 @@ export var genTableStyle = function genTableStyle(token) {
|
|
|
54
54
|
borderBottom: 'none'
|
|
55
55
|
})), "tr > td", {
|
|
56
56
|
transition: "background ".concat(token.motionDurationMid)
|
|
57
|
-
}), "".concat(componentCls, "-placeholder td"), {
|
|
58
|
-
borderBottom: 'none'
|
|
59
|
-
}), "".concat(componentCls, "-empty-wrapper"), {
|
|
57
|
+
}), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
|
|
60
58
|
minHeight: 360 - token.paddingSM * 2,
|
|
61
59
|
display: 'flex',
|
|
62
60
|
justifyContent: 'center',
|
package/es/tabs/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
|
|
2
|
+
import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition, TabsRef } from 'antd/es/tabs';
|
|
3
3
|
import type { Tab as AntTab } from 'rc-tabs/es/interface';
|
|
4
|
+
import { genTabsStyle } from './style';
|
|
5
|
+
import TabPane from './TabPane';
|
|
4
6
|
import type { TabPaneProps } from './TabPane';
|
|
5
7
|
import type { BadgeProps } from '../badge';
|
|
6
8
|
export * from 'antd/es/tabs';
|
|
@@ -17,13 +19,13 @@ export type Tab = {
|
|
|
17
19
|
badge?: BadgeType;
|
|
18
20
|
} & (AntTab | AntTabOptional);
|
|
19
21
|
export interface TabsProps extends Omit<AntTabsProps, 'items'> {
|
|
22
|
+
divider?: boolean;
|
|
20
23
|
items?: Tab[];
|
|
21
24
|
}
|
|
22
25
|
export type TabsPosition = AntTabsPosition;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
genTabsStyle: (token: Partial<import("./style").TabsToken>) => import("@ant-design/cssinjs").CSSObject;
|
|
27
|
-
displayName: string;
|
|
26
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>> & {
|
|
27
|
+
TabPane: typeof TabPane;
|
|
28
|
+
genTabsStyle: typeof genTabsStyle;
|
|
28
29
|
};
|
|
30
|
+
declare const Tabs: CompoundedComponent;
|
|
29
31
|
export default Tabs;
|
package/es/tabs/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var _excluded = ["children", "items", "type", "tabPosition", "prefixCls", "className"];
|
|
1
|
+
var _excluded = ["children", "divider", "items", "type", "tabPosition", "prefixCls", "className"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
import { isNullValue } from '@oceanbase/util';
|
|
11
|
-
import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
|
|
12
10
|
import React, { useCallback, useContext } from 'react';
|
|
11
|
+
import { Divider, Space, Tabs as AntTabs, Tag } from 'antd';
|
|
12
|
+
import { isNullValue } from '@oceanbase/util';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import Badge from "../badge";
|
|
15
15
|
import ConfigProvider from "../config-provider";
|
|
@@ -22,9 +22,11 @@ export * from 'antd/es/tabs';
|
|
|
22
22
|
var isReactNode = function isReactNode(item) {
|
|
23
23
|
return /*#__PURE__*/React.isValidElement(item);
|
|
24
24
|
};
|
|
25
|
-
var Tabs = function
|
|
25
|
+
var Tabs = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
26
26
|
var _newItems;
|
|
27
27
|
var children = _ref.children,
|
|
28
|
+
_ref$divider = _ref.divider,
|
|
29
|
+
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
28
30
|
items = _ref.items,
|
|
29
31
|
type = _ref.type,
|
|
30
32
|
tabPosition = _ref.tabPosition,
|
|
@@ -36,7 +38,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
36
38
|
var prefixCls = getPrefixCls('tabs', customizePrefixCls);
|
|
37
39
|
var _useStyle = useStyle(prefixCls),
|
|
38
40
|
wrapSSR = _useStyle.wrapSSR;
|
|
39
|
-
var tabsCls = classNames(className);
|
|
41
|
+
var tabsCls = classNames(className, _defineProperty({}, "".concat(prefixCls, "-no-divider"), !divider));
|
|
40
42
|
var isHorizontal = !tabPosition || tabPosition === 'top' || tabPosition === 'bottom';
|
|
41
43
|
var dividerList = (items === null || items === void 0 ? void 0 : items.filter(function (item) {
|
|
42
44
|
return item.divider;
|
|
@@ -80,13 +82,14 @@ var Tabs = function Tabs(_ref) {
|
|
|
80
82
|
return item;
|
|
81
83
|
});
|
|
82
84
|
return wrapSSR( /*#__PURE__*/_jsx(AntTabs, _objectSpread({
|
|
85
|
+
ref: ref,
|
|
83
86
|
items: newItems,
|
|
84
87
|
type: type,
|
|
85
88
|
tabPosition: tabPosition,
|
|
86
89
|
prefixCls: customizePrefixCls,
|
|
87
90
|
className: tabsCls
|
|
88
91
|
}, restProps)));
|
|
89
|
-
};
|
|
92
|
+
});
|
|
90
93
|
Tabs.TabPane = TabPane;
|
|
91
94
|
Tabs.genTabsStyle = genTabsStyle;
|
|
92
95
|
if (process.env.NODE_ENV !== 'production') {
|
package/es/tabs/style/index.js
CHANGED
|
@@ -10,10 +10,9 @@ export var genTabsStyle = function genTabsStyle(token) {
|
|
|
10
10
|
colorInfoBg = token.colorInfoBg,
|
|
11
11
|
colorTextSecondary = token.colorTextSecondary,
|
|
12
12
|
colorFillQuaternary = token.colorFillQuaternary;
|
|
13
|
-
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
|
|
14
|
-
// 页签位置为 top 和 bottom 时,去掉分割线
|
|
13
|
+
return _defineProperty({}, componentCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "&".concat(componentCls, "-no-divider"), _defineProperty({}, "&".concat(componentCls, "-top, &").concat(componentCls, "-bottom"), _defineProperty({}, "".concat(componentCls, "-nav::before"), {
|
|
15
14
|
border: 'none'
|
|
16
|
-
})), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
|
|
15
|
+
}))), "".concat(componentCls, "-tab"), _defineProperty(_defineProperty({}, "".concat(componentCls, "-tab-tag"), {
|
|
17
16
|
color: colorTextSecondary,
|
|
18
17
|
fontFamily: 'PingFangSC',
|
|
19
18
|
fontSize: 12,
|
|
@@ -9,15 +9,11 @@ export var genTypographyStyle = function genTypographyStyle(token) {
|
|
|
9
9
|
fontSize = token.fontSize,
|
|
10
10
|
lineHeight = token.lineHeight;
|
|
11
11
|
var marginOffset = (controlHeight - fontSize * lineHeight) / 2;
|
|
12
|
-
return _defineProperty(_defineProperty(_defineProperty(
|
|
12
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls), _defineProperty({
|
|
13
13
|
lineHeight: 'inherit',
|
|
14
14
|
color: 'inherit',
|
|
15
15
|
fontSize: 'inherit'
|
|
16
|
-
}
|
|
17
|
-
lineHeight: 'inherit',
|
|
18
|
-
color: 'inherit',
|
|
19
|
-
fontSize: 'inherit'
|
|
20
|
-
}), "".concat(componentCls), _defineProperty({}, "".concat(componentCls, "-edit"), {
|
|
16
|
+
}, "".concat(componentCls, "-edit"), {
|
|
21
17
|
fontSize: token.fontSize
|
|
22
18
|
})), "".concat(componentCls).concat(componentCls, "-editable-text:not(").concat(componentCls, "-edit-content)"), {
|
|
23
19
|
'&:hover': {
|
package/lib/card/style/index.js
CHANGED
|
@@ -67,7 +67,15 @@ var genCardStyle = (token) => {
|
|
|
67
67
|
[`${componentCls}${componentCls}-no-divider`]: {
|
|
68
68
|
[`${componentCls}-head`]: {
|
|
69
69
|
// should not remove border-bottom to avoid tabs inkbar display correctly
|
|
70
|
-
borderBottomColor: "transparent"
|
|
70
|
+
borderBottomColor: "transparent",
|
|
71
|
+
// remove divider for top and bottom tabs
|
|
72
|
+
[tabsComponentCls]: {
|
|
73
|
+
[`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
|
|
74
|
+
[`${tabsComponentCls}-nav::before`]: {
|
|
75
|
+
border: "none"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
71
79
|
}
|
|
72
80
|
},
|
|
73
81
|
[`${componentCls}${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
package/lib/form/FormItem.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => R
|
|
|
9
9
|
warnings: React.ReactNode[];
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
+
export * from 'antd/es/form/FormItem';
|
|
12
13
|
export type WrapperTooltipProps = Omit<TooltipProps, 'mouseFollow'> & {
|
|
13
14
|
icon?: React.ReactElement;
|
|
14
15
|
};
|
package/lib/form/FormItem.js
CHANGED
|
@@ -16,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -40,6 +41,7 @@ var import_classnames = __toESM(require("classnames"));
|
|
|
40
41
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
42
|
var import_useTooltipTypeList = require("../tooltip/hooks/useTooltipTypeList");
|
|
42
43
|
var import_style = __toESM(require("./style"));
|
|
44
|
+
__reExport(FormItem_exports, require("antd/es/form/FormItem"), module.exports);
|
|
43
45
|
var AntFormItem = import_antd.Form.Item;
|
|
44
46
|
var FormItem = ({
|
|
45
47
|
children,
|
|
@@ -95,3 +97,7 @@ var FormItem = ({
|
|
|
95
97
|
};
|
|
96
98
|
FormItem.useStatus = AntFormItem.useStatus;
|
|
97
99
|
var FormItem_default = FormItem;
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
...require("antd/es/form/FormItem")
|
|
103
|
+
});
|
package/lib/table/style/index.js
CHANGED
|
@@ -106,9 +106,7 @@ var genTableStyle = (token) => {
|
|
|
106
106
|
transition: `background ${token.motionDurationMid}`
|
|
107
107
|
},
|
|
108
108
|
// empty style
|
|
109
|
-
[`${componentCls}-placeholder td`]: {
|
|
110
|
-
borderBottom: "none"
|
|
111
|
-
},
|
|
109
|
+
[`${componentCls}-placeholder td`]: {},
|
|
112
110
|
[`${componentCls}-empty-wrapper`]: {
|
|
113
111
|
minHeight: 360 - token.paddingSM * 2,
|
|
114
112
|
display: "flex",
|
|
@@ -178,7 +176,7 @@ var genTableStyle = (token) => {
|
|
|
178
176
|
borderRadius: `0px 0px ${token.borderRadiusLG}px ${token.borderRadiusLG}px`
|
|
179
177
|
}
|
|
180
178
|
},
|
|
181
|
-
//
|
|
179
|
+
// 带内部边框的表格样式
|
|
182
180
|
[`${componentCls}-wrapper${componentCls}-inner-bordered ${componentCls}-bordered`]: {
|
|
183
181
|
[`${componentCls}-container`]: {
|
|
184
182
|
borderInlineStart: "none",
|
package/lib/tabs/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition } from 'antd/es/tabs';
|
|
2
|
+
import type { TabsProps as AntTabsProps, TabsPosition as AntTabsPosition, TabsRef } from 'antd/es/tabs';
|
|
3
3
|
import type { Tab as AntTab } from 'rc-tabs/es/interface';
|
|
4
|
+
import { genTabsStyle } from './style';
|
|
5
|
+
import TabPane from './TabPane';
|
|
4
6
|
import type { TabPaneProps } from './TabPane';
|
|
5
7
|
import type { BadgeProps } from '../badge';
|
|
6
8
|
export * from 'antd/es/tabs';
|
|
@@ -17,13 +19,13 @@ export type Tab = {
|
|
|
17
19
|
badge?: BadgeType;
|
|
18
20
|
} & (AntTab | AntTabOptional);
|
|
19
21
|
export interface TabsProps extends Omit<AntTabsProps, 'items'> {
|
|
22
|
+
divider?: boolean;
|
|
20
23
|
items?: Tab[];
|
|
21
24
|
}
|
|
22
25
|
export type TabsPosition = AntTabsPosition;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
genTabsStyle: (token: Partial<import("./style").TabsToken>) => import("@ant-design/cssinjs").CSSObject;
|
|
27
|
-
displayName: string;
|
|
26
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<TabsRef>> & {
|
|
27
|
+
TabPane: typeof TabPane;
|
|
28
|
+
genTabsStyle: typeof genTabsStyle;
|
|
28
29
|
};
|
|
30
|
+
declare const Tabs: CompoundedComponent;
|
|
29
31
|
export default Tabs;
|
package/lib/tabs/index.js
CHANGED
|
@@ -33,9 +33,9 @@ __export(tabs_exports, {
|
|
|
33
33
|
default: () => tabs_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(tabs_exports);
|
|
36
|
-
var import_util = require("@oceanbase/util");
|
|
37
|
-
var import_antd = require("antd");
|
|
38
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_util = require("@oceanbase/util");
|
|
39
39
|
var import_classnames = __toESM(require("classnames"));
|
|
40
40
|
var import_badge = __toESM(require("../badge"));
|
|
41
41
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
@@ -46,67 +46,73 @@ __reExport(tabs_exports, require("antd/es/tabs"), module.exports);
|
|
|
46
46
|
var isReactNode = (item) => {
|
|
47
47
|
return import_react.default.isValidElement(item);
|
|
48
48
|
};
|
|
49
|
-
var Tabs = (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
var Tabs = import_react.default.forwardRef(
|
|
50
|
+
({
|
|
51
|
+
children,
|
|
52
|
+
divider = false,
|
|
53
|
+
items,
|
|
54
|
+
type,
|
|
55
|
+
tabPosition,
|
|
56
|
+
prefixCls: customizePrefixCls,
|
|
57
|
+
className,
|
|
58
|
+
...restProps
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
61
|
+
const prefixCls = getPrefixCls("tabs", customizePrefixCls);
|
|
62
|
+
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
63
|
+
const tabsCls = (0, import_classnames.default)(className, {
|
|
64
|
+
[`${prefixCls}-no-divider`]: !divider
|
|
65
|
+
});
|
|
66
|
+
const isHorizontal = !tabPosition || tabPosition === "top" || tabPosition === "bottom";
|
|
67
|
+
const dividerList = (items == null ? void 0 : items.filter((item) => item.divider)) || [];
|
|
68
|
+
const renderBadge = (0, import_react.useCallback)(
|
|
69
|
+
(badge) => {
|
|
70
|
+
if (typeof badge === "object" && !isReactNode(badge)) {
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { ...badge, className: (0, import_classnames.default)(`${prefixCls}-tab-badge`, badge.className) });
|
|
72
|
+
}
|
|
73
|
+
return /* @__PURE__ */ import_react.default.createElement(import_badge.default, { className: `${prefixCls}-tab-badge`, count: badge });
|
|
74
|
+
},
|
|
75
|
+
[prefixCls]
|
|
76
|
+
);
|
|
77
|
+
let newItems = (0, import_useLegacyItems.default)(items, children);
|
|
78
|
+
newItems = newItems == null ? void 0 : newItems.map((item) => {
|
|
79
|
+
if (!(0, import_util.isNullValue)(item.divider)) {
|
|
80
|
+
return {
|
|
81
|
+
...item,
|
|
82
|
+
key: `divider-${dividerList == null ? void 0 : dividerList.indexOf(item)}`,
|
|
83
|
+
label: /* @__PURE__ */ import_react.default.createElement(
|
|
84
|
+
import_antd.Divider,
|
|
85
|
+
{
|
|
86
|
+
type: isHorizontal ? "vertical" : "horizontal",
|
|
87
|
+
className: `${prefixCls}-divider`
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
disabled: true
|
|
91
|
+
};
|
|
92
|
+
} else if (!(0, import_util.isNullValue)(item.tag) || !(0, import_util.isNullValue)(item.badge)) {
|
|
93
|
+
return {
|
|
94
|
+
...item,
|
|
95
|
+
label: /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, item.label, item.badge && renderBadge(item.badge), !(0, import_util.isNullValue)(item.tag) && /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { bordered: false, className: `${prefixCls}-tab-tag` }, item.tag))
|
|
96
|
+
};
|
|
68
97
|
}
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
} else if (!(0, import_util.isNullValue)(item.tag) || !(0, import_util.isNullValue)(item.badge)) {
|
|
89
|
-
return {
|
|
90
|
-
...item,
|
|
91
|
-
label: /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, item.label, item.badge && renderBadge(item.badge), !(0, import_util.isNullValue)(item.tag) && /* @__PURE__ */ import_react.default.createElement(import_antd.Tag, { bordered: false, className: `${prefixCls}-tab-tag` }, item.tag))
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
return item;
|
|
95
|
-
});
|
|
96
|
-
return wrapSSR(
|
|
97
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
98
|
-
import_antd.Tabs,
|
|
99
|
-
{
|
|
100
|
-
items: newItems,
|
|
101
|
-
type,
|
|
102
|
-
tabPosition,
|
|
103
|
-
prefixCls: customizePrefixCls,
|
|
104
|
-
className: tabsCls,
|
|
105
|
-
...restProps
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
);
|
|
109
|
-
};
|
|
98
|
+
return item;
|
|
99
|
+
});
|
|
100
|
+
return wrapSSR(
|
|
101
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
import_antd.Tabs,
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
items: newItems,
|
|
106
|
+
type,
|
|
107
|
+
tabPosition,
|
|
108
|
+
prefixCls: customizePrefixCls,
|
|
109
|
+
className: tabsCls,
|
|
110
|
+
...restProps
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
110
116
|
Tabs.TabPane = import_TabPane.default;
|
|
111
117
|
Tabs.genTabsStyle = import_style.genTabsStyle;
|
|
112
118
|
if (process.env.NODE_ENV !== "production") {
|
package/lib/tabs/style/index.js
CHANGED
|
@@ -28,10 +28,12 @@ var genTabsStyle = (token) => {
|
|
|
28
28
|
const { antCls, componentCls, colorInfo, colorInfoBg, colorTextSecondary, colorFillQuaternary } = token;
|
|
29
29
|
return {
|
|
30
30
|
[componentCls]: {
|
|
31
|
-
[`&${componentCls}-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
[`&${componentCls}-no-divider`]: {
|
|
32
|
+
// divider prop work for top and bottom tabs
|
|
33
|
+
[`&${componentCls}-top, &${componentCls}-bottom`]: {
|
|
34
|
+
[`${componentCls}-nav::before`]: {
|
|
35
|
+
border: "none"
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
[`${componentCls}-tab`]: {
|
|
@@ -29,17 +29,10 @@ var genTypographyStyle = (token) => {
|
|
|
29
29
|
const marginOffset = (controlHeight - fontSize * lineHeight) / 2;
|
|
30
30
|
return {
|
|
31
31
|
// inherit color and lineHeight from parent instead of fixed colorText
|
|
32
|
-
[
|
|
33
|
-
lineHeight: "inherit",
|
|
34
|
-
color: "inherit",
|
|
35
|
-
fontSize: "inherit"
|
|
36
|
-
},
|
|
37
|
-
[`div${componentCls}`]: {
|
|
32
|
+
[`${componentCls}`]: {
|
|
38
33
|
lineHeight: "inherit",
|
|
39
34
|
color: "inherit",
|
|
40
|
-
fontSize: "inherit"
|
|
41
|
-
},
|
|
42
|
-
[`${componentCls}`]: {
|
|
35
|
+
fontSize: "inherit",
|
|
43
36
|
[`${componentCls}-edit`]: {
|
|
44
37
|
fontSize: token.fontSize
|
|
45
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/design",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "The Design System of OceanBase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@ant-design/cssinjs": "^1.24.0",
|
|
42
|
-
"@ctrl/tinycolor": "^4.
|
|
42
|
+
"@ctrl/tinycolor": "^4.2.0",
|
|
43
43
|
"@inline-svg-unique-id/react": "^1.2.3",
|
|
44
44
|
"@oceanbase/aliyun-theme": "^0.1.6",
|
|
45
45
|
"@oceanbase/icons": "^0.4.7",
|
|
46
|
-
"@oceanbase/util": "^0.4.
|
|
46
|
+
"@oceanbase/util": "^0.4.5",
|
|
47
47
|
"ahooks": "^2.10.14",
|
|
48
|
-
"antd": "^5.27.
|
|
48
|
+
"antd": "^5.27.4",
|
|
49
49
|
"classnames": "^2.5.1",
|
|
50
50
|
"lodash": "^4.17.21",
|
|
51
51
|
"lottie-web": "^5.13.0",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@babel/preset-env": "^7.28.3",
|
|
58
58
|
"antd-token-previewer": "^2.0.8",
|
|
59
59
|
"rc-select": "^14.16.8",
|
|
60
|
-
"rc-slider": "^11.1.
|
|
61
|
-
"rc-table": "^7.
|
|
60
|
+
"rc-slider": "^11.1.9",
|
|
61
|
+
"rc-table": "^7.54.0",
|
|
62
62
|
"rc-tree-select": "^5.27.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": ">=16.9.0",
|
|
66
66
|
"react-dom": ">=16.9.0"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "17cf4a2e042c5c3a2b099b8f4d305eb3b543ca66"
|
|
69
69
|
}
|