@oceanbase/design 1.0.0-alpha.2 → 1.0.0-alpha.4
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/_util/genComponentStyleHook.d.ts +2 -2
- package/es/_util/genComponentStyleHook.js +15 -2
- package/es/alert/index.d.ts +2 -2
- package/es/alert/index.js +13 -4
- package/es/alert/style/index.d.ts +1 -1
- package/es/alert/style/index.js +152 -58
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +36 -1
- package/es/app/style/index.d.ts +9 -0
- package/es/{_util/genStyle.js → app/style/index.js} +10 -11
- package/es/badge/index.js +2 -3
- package/es/badge/style/index.d.ts +1 -1
- package/es/badge/style/index.js +1 -3
- package/es/button/style/index.d.ts +1 -1
- package/es/card/index.d.ts +4 -0
- package/es/card/index.js +64 -7
- package/es/card/style/index.d.ts +1 -1
- package/es/card/style/index.js +32 -8
- package/es/checkbox/style/index.d.ts +1 -1
- package/es/config-provider/context.d.ts +11 -0
- package/es/config-provider/context.js +2 -1
- package/es/config-provider/index.d.ts +2 -2
- package/es/config-provider/index.js +57 -34
- package/es/descriptions/style/index.d.ts +1 -1
- package/es/drawer/index.js +7 -5
- package/es/drawer/style/index.d.ts +1 -1
- package/es/drawer/style/index.js +31 -9
- package/es/empty/index.js +1 -1
- package/es/empty/style/index.d.ts +1 -1
- package/es/form/FormItem.d.ts +2 -1
- package/es/form/FormItem.js +14 -4
- package/es/form/style/index.d.ts +1 -1
- package/es/form/style/index.js +13 -2
- package/es/index.d.ts +4 -2
- package/es/index.js +1 -0
- package/es/input-number/index.d.ts +2 -1
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +28 -0
- package/es/modal/Modal.js +20 -6
- package/es/modal/style/index.d.ts +1 -1
- package/es/modal/style/index.js +62 -19
- package/es/radio/style/index.d.ts +1 -1
- package/es/result/index.d.ts +2 -2
- package/es/result/index.js +5 -4
- package/es/result/style/index.d.ts +1 -1
- package/es/select/style/index.d.ts +1 -1
- package/es/slider/style/index.d.ts +1 -1
- package/es/space/style/index.d.ts +1 -1
- package/es/spin/style/index.d.ts +1 -1
- package/es/static-function/index.js +13 -4
- package/es/switch/style/index.d.ts +1 -1
- package/es/table/style/index.d.ts +1 -1
- package/es/table/style/index.js +3 -4
- package/es/tabs/style/index.d.ts +1 -1
- package/es/tabs/style/index.js +4 -2
- package/es/tag/index.d.ts +1 -0
- package/es/tag/index.js +3 -2
- package/es/tag/style/index.d.ts +2 -4
- package/es/tag/style/index.js +20 -31
- package/es/theme/dark.d.ts +1 -48
- package/es/theme/default.d.ts +4 -2
- package/es/theme/default.js +59 -28
- package/es/theme/index.d.ts +20 -57
- package/es/theme/interface.d.ts +66 -0
- package/es/theme/interface.js +4 -1
- package/es/theme/style/aliyun.less +40 -40
- package/es/theme/style/compact.less +79 -72
- package/es/theme/style/dark.less +53 -53
- package/es/theme/style/default.less +79 -72
- package/es/tooltip/style/index.d.ts +1 -1
- package/es/tree-select/style/index.d.ts +1 -1
- package/lib/_util/genComponentStyleHook.d.ts +2 -2
- package/lib/_util/genComponentStyleHook.js +20 -4
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +18 -9
- package/lib/alert/style/index.d.ts +1 -1
- package/lib/alert/style/index.js +170 -71
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +36 -1
- package/lib/app/style/index.d.ts +9 -0
- package/lib/{_util/getWeakenBorderColor.js → app/style/index.js} +20 -10
- package/lib/badge/index.js +23 -20
- package/lib/badge/style/index.d.ts +1 -1
- package/lib/badge/style/index.js +1 -3
- package/lib/button/index.js +2 -1
- package/lib/button/style/index.d.ts +1 -1
- package/lib/card/index.d.ts +4 -0
- package/lib/card/index.js +70 -9
- package/lib/card/style/index.d.ts +1 -1
- package/lib/card/style/index.js +56 -10
- package/lib/checkbox/index.js +2 -1
- package/lib/checkbox/style/index.d.ts +1 -1
- package/lib/config-provider/DefaultRenderEmpty.js +4 -3
- package/lib/config-provider/context.d.ts +11 -0
- package/lib/config-provider/index.d.ts +2 -2
- package/lib/config-provider/index.js +70 -26
- package/lib/descriptions/hooks/useItems.js +5 -4
- package/lib/descriptions/index.js +3 -2
- package/lib/descriptions/style/index.d.ts +1 -1
- package/lib/drawer/index.js +44 -33
- package/lib/drawer/style/index.d.ts +1 -1
- package/lib/drawer/style/index.js +33 -6
- package/lib/dropdown/dropdown-button.js +3 -13
- package/lib/dropdown/index.js +2 -2
- package/lib/empty/colored.js +413 -327
- package/lib/empty/database.js +267 -222
- package/lib/empty/default.js +16 -21
- package/lib/empty/guide.js +201 -184
- package/lib/empty/index.js +23 -18
- package/lib/empty/style/index.d.ts +1 -1
- package/lib/form/FormItem.d.ts +2 -1
- package/lib/form/FormItem.js +18 -6
- package/lib/form/index.js +6 -3
- package/lib/form/style/index.d.ts +1 -1
- package/lib/form/style/index.js +19 -0
- package/lib/grid/col.js +2 -1
- package/lib/grid/row.js +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +3 -0
- package/lib/input/Input.js +3 -2
- package/lib/input/Password.js +3 -2
- package/lib/input/Search.js +3 -2
- package/lib/input/TextArea.js +3 -2
- package/lib/input-number/index.d.ts +2 -1
- package/lib/input-number/index.js +2 -1
- package/lib/list/index.js +3 -2
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +60 -0
- package/lib/lottie/index.js +2 -1
- package/lib/modal/Modal.js +33 -9
- package/lib/modal/Progress.js +9 -5
- package/lib/modal/style/index.d.ts +1 -1
- package/lib/modal/style/index.js +76 -17
- package/lib/radio/index.js +2 -1
- package/lib/radio/style/index.d.ts +1 -1
- package/lib/result/403.js +156 -121
- package/lib/result/404.js +328 -267
- package/lib/result/500.js +295 -257
- package/lib/result/Error.js +127 -99
- package/lib/result/Processing.js +246 -213
- package/lib/result/Success.js +233 -169
- package/lib/result/Warning.js +611 -515
- package/lib/result/index.d.ts +2 -2
- package/lib/result/index.js +12 -11
- package/lib/result/style/index.d.ts +1 -1
- package/lib/segmented/index.js +8 -4
- package/lib/select/index.js +2 -1
- package/lib/select/style/index.d.ts +1 -1
- package/lib/slider/index.js +2 -1
- package/lib/slider/style/index.d.ts +1 -1
- package/lib/space/index.js +2 -1
- package/lib/space/style/index.d.ts +1 -1
- package/lib/spin/index.js +5 -4
- package/lib/spin/style/index.d.ts +1 -1
- package/lib/static-function/index.js +7 -1
- package/lib/switch/index.js +2 -1
- package/lib/switch/style/index.d.ts +1 -1
- package/lib/table/index.js +44 -31
- package/lib/table/style/index.d.ts +1 -1
- package/lib/table/style/index.js +3 -4
- package/lib/tabs/index.js +10 -5
- package/lib/tabs/style/index.d.ts +1 -1
- package/lib/tabs/style/index.js +5 -0
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +12 -6
- package/lib/tag/style/index.d.ts +2 -4
- package/lib/tag/style/index.js +20 -27
- package/lib/theme/dark.d.ts +1 -48
- package/lib/theme/default.d.ts +4 -2
- package/lib/theme/default.js +67 -27
- package/lib/theme/index.d.ts +20 -57
- package/lib/theme/interface.d.ts +66 -0
- package/lib/theme/style/aliyun.less +40 -40
- package/lib/theme/style/compact.less +79 -72
- package/lib/theme/style/dark.less +53 -53
- package/lib/theme/style/default.less +79 -72
- package/lib/tooltip/MouseTooltip.js +43 -39
- package/lib/tooltip/ReactStickyMouseTooltip.js +5 -4
- package/lib/tooltip/index.js +14 -10
- package/lib/tooltip/style/index.d.ts +1 -1
- package/lib/tree-select/index.js +2 -1
- package/lib/tree-select/style/index.d.ts +1 -1
- package/lib/typography/Link.js +5 -4
- package/lib/typography/Paragraph.js +5 -4
- package/lib/typography/Text.js +5 -4
- package/lib/typography/Title.js +5 -4
- package/package.json +7 -6
- package/es/_util/genStyle.d.ts +0 -2
- package/es/_util/getWeakenBorderColor.d.ts +0 -1
- package/es/_util/getWeakenBorderColor.js +0 -4
- package/lib/_util/genStyle.d.ts +0 -2
- package/lib/_util/genStyle.js +0 -43
- package/lib/_util/getWeakenBorderColor.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type ButtonToken = FullToken<'Button'>;
|
|
4
4
|
export declare const genButtonStyle: GenerateStyle<ButtonToken>;
|
|
5
5
|
declare const _default: (prefixCls: string, isAliyun?: boolean) => {
|
package/lib/card/index.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export interface CardTabListType extends AntCardTabListType {
|
|
|
8
8
|
export interface CardProps extends AntCardProps {
|
|
9
9
|
divided?: boolean;
|
|
10
10
|
tabList?: CardTabListType[];
|
|
11
|
+
collapsible?: boolean;
|
|
12
|
+
defaultCollapsed?: boolean;
|
|
13
|
+
collapsed?: boolean;
|
|
14
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
11
15
|
}
|
|
12
16
|
declare const _default: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
13
17
|
Grid: React.FC<import("antd/es/card").CardGridProps>;
|
package/lib/card/index.js
CHANGED
|
@@ -37,11 +37,14 @@ var import_util = require("@oceanbase/util");
|
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
|
+
var import_icons = require("@oceanbase/icons");
|
|
40
41
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
41
42
|
var import_util2 = require("../_util");
|
|
43
|
+
var import_theme = __toESM(require("../theme"));
|
|
42
44
|
var import_style = __toESM(require("./style"));
|
|
43
45
|
__reExport(card_exports, require("antd/es/card/Card"), module.exports);
|
|
44
46
|
__reExport(card_exports, require("antd/es/card"), module.exports);
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
48
|
var Card = import_react.default.forwardRef(
|
|
46
49
|
({
|
|
47
50
|
children,
|
|
@@ -54,20 +57,72 @@ var Card = import_react.default.forwardRef(
|
|
|
54
57
|
bodyStyle,
|
|
55
58
|
styles,
|
|
56
59
|
className,
|
|
60
|
+
collapsible,
|
|
61
|
+
defaultCollapsed,
|
|
62
|
+
collapsed: outerCollapsed,
|
|
63
|
+
onCollapse,
|
|
64
|
+
extra,
|
|
57
65
|
...restProps
|
|
58
66
|
}, ref) => {
|
|
59
67
|
var _a;
|
|
60
|
-
const {
|
|
68
|
+
const {
|
|
69
|
+
getPrefixCls,
|
|
70
|
+
card: contextCard,
|
|
71
|
+
iconPrefixCls
|
|
72
|
+
} = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
73
|
+
const { token } = import_theme.default.useToken();
|
|
61
74
|
const divided = outerDivided ?? (contextCard == null ? void 0 : contextCard.divided) ?? true;
|
|
62
75
|
const prefixCls = getPrefixCls("card", customizePrefixCls);
|
|
63
76
|
const tabsPrefixCls = getPrefixCls("tabs", customizePrefixCls);
|
|
64
77
|
const { wrapSSR } = (0, import_style.default)(prefixCls, tabsPrefixCls);
|
|
78
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react.useState)(defaultCollapsed ?? false);
|
|
79
|
+
const collapsed = outerCollapsed !== void 0 ? outerCollapsed : internalCollapsed;
|
|
80
|
+
const handleCollapse = (0, import_react.useCallback)(() => {
|
|
81
|
+
const newCollapsed = !collapsed;
|
|
82
|
+
if (outerCollapsed === void 0) {
|
|
83
|
+
setInternalCollapsed(newCollapsed);
|
|
84
|
+
}
|
|
85
|
+
onCollapse == null ? void 0 : onCollapse(newCollapsed);
|
|
86
|
+
}, [collapsed, outerCollapsed, onCollapse]);
|
|
87
|
+
const cardTitle = (0, import_react.useMemo)(() => {
|
|
88
|
+
if (!collapsible) {
|
|
89
|
+
return title;
|
|
90
|
+
}
|
|
91
|
+
if (!title) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: `${prefixCls}-title-wrapper`,
|
|
98
|
+
onClick: handleCollapse,
|
|
99
|
+
style: { cursor: "pointer", display: "flex", alignItems: "center" },
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
import_icons.CaretRightFilled,
|
|
103
|
+
{
|
|
104
|
+
className: `${prefixCls}-collapsible-icon`,
|
|
105
|
+
style: {
|
|
106
|
+
transition: `transform ${token.motionDurationMid}`,
|
|
107
|
+
transform: collapsed ? void 0 : "rotate(90deg)",
|
|
108
|
+
color: token.colorIcon,
|
|
109
|
+
marginRight: token.marginXS
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: title })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}, [collapsible, title, collapsed, prefixCls, token, handleCollapse]);
|
|
65
118
|
const noBodyHorizontalPadding = (0, import_util2.isHorizontalPaddingZero)(bodyStyle == null ? void 0 : bodyStyle.padding) || (0, import_util2.isHorizontalPaddingZero)((_a = styles == null ? void 0 : styles.body) == null ? void 0 : _a.padding);
|
|
66
119
|
const cardCls = (0, import_classnames.default)(
|
|
67
120
|
{
|
|
68
121
|
[`${prefixCls}-has-title`]: !!title,
|
|
69
122
|
[`${prefixCls}-no-divider`]: !divided,
|
|
70
|
-
[`${prefixCls}-no-body-horizontal-padding`]: noBodyHorizontalPadding
|
|
123
|
+
[`${prefixCls}-no-body-horizontal-padding`]: noBodyHorizontalPadding,
|
|
124
|
+
[`${prefixCls}-collapsible`]: collapsible,
|
|
125
|
+
[`${prefixCls}-collapsed`]: collapsed
|
|
71
126
|
},
|
|
72
127
|
className
|
|
73
128
|
);
|
|
@@ -75,30 +130,36 @@ var Card = import_react.default.forwardRef(
|
|
|
75
130
|
if (!(0, import_util.isNullValue)(item.tag)) {
|
|
76
131
|
return {
|
|
77
132
|
...item,
|
|
78
|
-
tab: /* @__PURE__ */
|
|
133
|
+
tab: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: 4, children: [
|
|
134
|
+
item.tab,
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Tag, { bordered: false, className: `${tabsPrefixCls}-tab-tag`, children: item.tag })
|
|
136
|
+
] })
|
|
79
137
|
};
|
|
80
138
|
}
|
|
81
139
|
return item;
|
|
82
140
|
});
|
|
83
141
|
return wrapSSR(
|
|
84
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
143
|
import_antd.Card,
|
|
86
144
|
{
|
|
87
145
|
ref,
|
|
88
146
|
size,
|
|
89
|
-
title,
|
|
147
|
+
title: cardTitle,
|
|
90
148
|
tabList: newTabList,
|
|
91
149
|
tabProps: {
|
|
92
150
|
size: "middle",
|
|
93
151
|
...tabProps
|
|
94
152
|
},
|
|
95
153
|
prefixCls: customizePrefixCls,
|
|
96
|
-
bodyStyle
|
|
154
|
+
bodyStyle: {
|
|
155
|
+
...bodyStyle
|
|
156
|
+
},
|
|
97
157
|
styles,
|
|
98
158
|
className: cardCls,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
159
|
+
extra,
|
|
160
|
+
...restProps,
|
|
161
|
+
children
|
|
162
|
+
}
|
|
102
163
|
)
|
|
103
164
|
);
|
|
104
165
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
export type CardToken = FullToken<'Card'> & {
|
|
5
5
|
tabsComponentCls: string;
|
|
6
6
|
tabsPrefixCls: string;
|
package/lib/card/style/index.js
CHANGED
|
@@ -59,16 +59,19 @@ var genCardStyle = (token) => {
|
|
|
59
59
|
const tableComponentCls = `${antCls}-table`;
|
|
60
60
|
return {
|
|
61
61
|
[`${componentCls}`]: {
|
|
62
|
+
[`${componentCls}-body`]: {
|
|
63
|
+
paddingTop: token.padding
|
|
64
|
+
},
|
|
62
65
|
// nested Card style
|
|
63
66
|
[`${componentCls}:not(${componentCls}-bordered):not(${componentCls}-type-inner)`]: {
|
|
64
67
|
boxShadow: "none"
|
|
65
68
|
},
|
|
66
|
-
// nested Card
|
|
67
|
-
[`${componentCls}`]: {
|
|
69
|
+
// nested and bordered Card radius
|
|
70
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
68
71
|
borderRadius: token.borderRadiusLG - 2,
|
|
69
|
-
[`${componentCls}`]: {
|
|
72
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
70
73
|
borderRadius: token.borderRadius,
|
|
71
|
-
[`${componentCls}`]: {
|
|
74
|
+
[`${componentCls}${componentCls}-bordered`]: {
|
|
72
75
|
borderRadius: token.borderRadiusSM
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -78,6 +81,8 @@ var genCardStyle = (token) => {
|
|
|
78
81
|
[`${componentCls}-head`]: {
|
|
79
82
|
// should not remove border-bottom to avoid tabs inkbar display correctly
|
|
80
83
|
borderBottomColor: "transparent",
|
|
84
|
+
paddingTop: token.paddingLG,
|
|
85
|
+
paddingBottom: token.padding,
|
|
81
86
|
// remove divider for top and bottom tabs
|
|
82
87
|
[tabsComponentCls]: {
|
|
83
88
|
[`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
|
|
@@ -93,6 +98,11 @@ var genCardStyle = (token) => {
|
|
|
93
98
|
padding: `0 ${paddingLG}px ${paddingLG}px ${paddingLG}px`
|
|
94
99
|
}
|
|
95
100
|
},
|
|
101
|
+
[`${componentCls}-small`]: {
|
|
102
|
+
[`${componentCls}-body`]: {
|
|
103
|
+
paddingTop: token.paddingXS
|
|
104
|
+
}
|
|
105
|
+
},
|
|
96
106
|
[`${componentCls}-small${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
97
107
|
[`${componentCls}-body`]: {
|
|
98
108
|
padding: `0 ${paddingSM}px ${paddingSM}px ${paddingSM}px`
|
|
@@ -104,11 +114,20 @@ var genCardStyle = (token) => {
|
|
|
104
114
|
}
|
|
105
115
|
},
|
|
106
116
|
[`${componentCls}${componentCls}-contain-tabs`]: {
|
|
107
|
-
[`${componentCls}-head`]:
|
|
108
|
-
...
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
[`${componentCls}-head`]: {
|
|
118
|
+
...(0, import_style.genTabsStyle)({
|
|
119
|
+
...token,
|
|
120
|
+
componentCls: tabsComponentCls,
|
|
121
|
+
prefixCls: tabsPrefixCls
|
|
122
|
+
}),
|
|
123
|
+
[tabsComponentCls]: {
|
|
124
|
+
[`&${tabsComponentCls}-top, &${tabsComponentCls}-bottom`]: {
|
|
125
|
+
[`${tabsComponentCls}-tab`]: {
|
|
126
|
+
paddingBlock: token.padding
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
112
131
|
},
|
|
113
132
|
[`${componentCls}${componentCls}-contain-grid`]: {
|
|
114
133
|
[`${componentCls}-head`]: {
|
|
@@ -133,7 +152,34 @@ var genCardStyle = (token) => {
|
|
|
133
152
|
// no body horizontal padding card
|
|
134
153
|
[`${componentCls}${componentCls}-no-body-horizontal-padding`]: genTableStyle(paddingLG, token),
|
|
135
154
|
// no body horizontal padding small card
|
|
136
|
-
[`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-small`]: genTableStyle(paddingSM, token)
|
|
155
|
+
[`${componentCls}${componentCls}-no-body-horizontal-padding${componentCls}-small`]: genTableStyle(paddingSM, token),
|
|
156
|
+
// collapsible card style
|
|
157
|
+
[`${componentCls}${componentCls}-collapsible`]: {
|
|
158
|
+
[`${componentCls}-title-wrapper`]: {
|
|
159
|
+
userSelect: "none",
|
|
160
|
+
[`${componentCls}-collapsible-icon`]: {
|
|
161
|
+
fontSize: token.fontSizeLG
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
[`${componentCls}-body`]: {
|
|
165
|
+
overflow: "hidden"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
[`${componentCls}${componentCls}-collapsible${componentCls}-collapsed`]: {
|
|
169
|
+
[`${componentCls}-body`]: {
|
|
170
|
+
maxHeight: 0,
|
|
171
|
+
paddingTop: 0,
|
|
172
|
+
paddingBottom: 0,
|
|
173
|
+
opacity: 0,
|
|
174
|
+
overflow: "hidden",
|
|
175
|
+
border: "none",
|
|
176
|
+
margin: 0
|
|
177
|
+
},
|
|
178
|
+
// hide bottom border of head when collapsed, avoid double border
|
|
179
|
+
[`${componentCls}-head`]: {
|
|
180
|
+
borderBottom: "none"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
137
183
|
};
|
|
138
184
|
};
|
|
139
185
|
var style_default = (prefixCls, tabsPrefixCls) => {
|
package/lib/checkbox/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var import_react = __toESM(require("react"));
|
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_style = __toESM(require("./style"));
|
|
41
41
|
__reExport(checkbox_exports, require("antd/es/checkbox"), module.exports);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
43
|
var InternalCheckbox = import_react.default.forwardRef(
|
|
43
44
|
({ prefixCls: customizePrefixCls, className, ...restProps }, ref) => {
|
|
44
45
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
@@ -46,7 +47,7 @@ var InternalCheckbox = import_react.default.forwardRef(
|
|
|
46
47
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
47
48
|
const checkboxCls = (0, import_classnames.default)(className);
|
|
48
49
|
return wrapSSR(
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
51
|
import_antd.Checkbox,
|
|
51
52
|
{
|
|
52
53
|
ref,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FullToken, GenerateStyle } from '
|
|
2
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
3
3
|
export type CheckboxToken = FullToken<'Checkbox'>;
|
|
4
4
|
export declare const genCheckboxStyle: GenerateStyle<CheckboxToken>;
|
|
5
5
|
declare const _default: (prefixCls: string) => {
|
|
@@ -32,9 +32,10 @@ __export(DefaultRenderEmpty_exports, {
|
|
|
32
32
|
default: () => DefaultRenderEmpty_default
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(DefaultRenderEmpty_exports);
|
|
35
|
-
var import_react =
|
|
35
|
+
var import_react = require("react");
|
|
36
36
|
var import__ = require(".");
|
|
37
37
|
var import_empty = __toESM(require("../empty"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
39
|
var DefaultRenderEmpty = (props) => {
|
|
39
40
|
const { componentName } = props;
|
|
40
41
|
const { getPrefixCls } = (0, import_react.useContext)(import__.ConfigContext);
|
|
@@ -45,9 +46,9 @@ var DefaultRenderEmpty = (props) => {
|
|
|
45
46
|
case "Cascader":
|
|
46
47
|
case "Transfer":
|
|
47
48
|
case "Mentions":
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE, className: `${prefix}-small` });
|
|
49
50
|
default:
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { image: import_empty.default.PRESENTED_IMAGE_SIMPLE });
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
var DefaultRenderEmpty_default = DefaultRenderEmpty;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import type { ThemeConfig as AntThemeConfig, MappingAlgorithm } from 'antd';
|
|
2
|
+
import type { AliasToken, OverrideToken } from '../theme/interface';
|
|
1
3
|
export * from 'antd/es/config-provider/context';
|
|
4
|
+
type ComponentsConfig = {
|
|
5
|
+
[key in keyof OverrideToken]?: OverrideToken[key] & {
|
|
6
|
+
algorithm?: boolean | MappingAlgorithm | MappingAlgorithm[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export interface ThemeConfig extends AntThemeConfig {
|
|
10
|
+
token?: Partial<AliasToken>;
|
|
11
|
+
components?: ComponentsConfig;
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ConfigProvider as AntConfigProvider } from 'antd';
|
|
3
3
|
import type { ConfigProviderProps as AntConfigProviderProps, ConfigConsumerProps as AntConfigConsumerProps, ThemeConfig as AntThemeConfig } from 'antd/es/config-provider';
|
|
4
|
-
import type { ComponentStyleConfig, CardConfig as AntCardConfig } from 'antd/es/config-provider/context';
|
|
4
|
+
import type { ComponentStyleConfig, CardConfig as AntCardConfig, TableConfig as AntTableConfig } from 'antd/es/config-provider/context';
|
|
5
5
|
import type { AppProps } from 'antd/es/app';
|
|
6
6
|
import type { PaginationConfig } from 'antd/es/pagination';
|
|
7
7
|
import type { SpinIndicator } from 'antd/es/spin';
|
|
@@ -23,7 +23,7 @@ export type CardConfig = AntCardConfig & {
|
|
|
23
23
|
export type SpinConfig = ComponentStyleConfig & {
|
|
24
24
|
indicator?: SpinIndicator;
|
|
25
25
|
};
|
|
26
|
-
export type TableConfig =
|
|
26
|
+
export type TableConfig = AntTableConfig & {
|
|
27
27
|
selectionColumnWidth?: number;
|
|
28
28
|
};
|
|
29
29
|
export interface ConfigConsumerProps extends AntConfigConsumerProps {
|
|
@@ -40,6 +40,7 @@ var import_StyleContext = __toESM(require("@ant-design/cssinjs/es/StyleContext")
|
|
|
40
40
|
var import_icons = require("@oceanbase/icons");
|
|
41
41
|
var import_aliyun_theme = __toESM(require("@oceanbase/aliyun-theme"));
|
|
42
42
|
var import_lodash = require("lodash");
|
|
43
|
+
var import_app = __toESM(require("../app"));
|
|
43
44
|
var import_static_function = __toESM(require("../static-function"));
|
|
44
45
|
var import_theme = __toESM(require("../theme"));
|
|
45
46
|
var import_default = __toESM(require("../theme/default"));
|
|
@@ -50,11 +51,15 @@ __reExport(config_provider_exports, require("antd/es/config-provider/context"),
|
|
|
50
51
|
__reExport(config_provider_exports, require("antd/es/config-provider/SizeContext"), module.exports);
|
|
51
52
|
__reExport(config_provider_exports, require("antd/es/config-provider/DisabledContext"), module.exports);
|
|
52
53
|
__reExport(config_provider_exports, require("antd/es/config-provider"), module.exports);
|
|
54
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
55
|
var ExtendedConfigContext = import_react.default.createContext({
|
|
54
56
|
navigate: void 0,
|
|
55
57
|
hideOnSinglePage: false,
|
|
56
58
|
injectStaticFunction: true
|
|
57
59
|
});
|
|
60
|
+
var getLocaleTokenValue = (locale, tokenKey, tokenValue, tokenValueEn) => {
|
|
61
|
+
return tokenValue !== import_default.default.token[tokenKey] ? { [tokenKey]: tokenValue } : ["en", "en-gb"].includes(locale.locale) ? { [tokenKey]: tokenValueEn } : {};
|
|
62
|
+
};
|
|
58
63
|
var ConfigProvider = ({
|
|
59
64
|
children,
|
|
60
65
|
theme,
|
|
@@ -71,7 +76,7 @@ var ConfigProvider = ({
|
|
|
71
76
|
appProps,
|
|
72
77
|
...restProps
|
|
73
78
|
}) => {
|
|
74
|
-
var _a, _b;
|
|
79
|
+
var _a, _b, _c, _d;
|
|
75
80
|
const parentContext = import_react.default.useContext(import_antd.ConfigProvider.ConfigContext);
|
|
76
81
|
const parentExtendedContext = import_react.default.useContext(ExtendedConfigContext);
|
|
77
82
|
const { isDark, isAliyun } = (0, import_lodash.merge)({}, parentContext.theme, theme);
|
|
@@ -85,10 +90,12 @@ var ConfigProvider = ({
|
|
|
85
90
|
);
|
|
86
91
|
const { token } = import_theme.default.useToken();
|
|
87
92
|
const fontFamily = ((_a = mergedTheme.token) == null ? void 0 : _a.fontFamily) || token.fontFamily;
|
|
93
|
+
const fontWeight = ((_b = mergedTheme.token) == null ? void 0 : _b.fontWeight) || token.fontWeight;
|
|
94
|
+
const fontWeightStrong = ((_c = mergedTheme.token) == null ? void 0 : _c.fontWeightStrong) || token.fontWeightStrong;
|
|
88
95
|
const parentStyleContext = import_react.default.useContext(import_StyleContext.default);
|
|
89
96
|
const mergedStyleProviderProps = (0, import_lodash.merge)({}, parentStyleContext, styleProviderProps);
|
|
90
97
|
const mergedLocale = (0, import_lodash.merge)({}, parentContext.locale, locale);
|
|
91
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
99
|
import_antd.ConfigProvider,
|
|
93
100
|
{
|
|
94
101
|
locale: mergedLocale,
|
|
@@ -96,7 +103,18 @@ var ConfigProvider = ({
|
|
|
96
103
|
collapse: (0, import_lodash.merge)(
|
|
97
104
|
{},
|
|
98
105
|
{
|
|
99
|
-
expandIcon: ({ isActive }) =>
|
|
106
|
+
expandIcon: ({ isActive }) => {
|
|
107
|
+
var _a2, _b2;
|
|
108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
|
+
import_icons.CaretRightOutlined,
|
|
110
|
+
{
|
|
111
|
+
rotate: isActive ? 90 : 0,
|
|
112
|
+
style: {
|
|
113
|
+
color: ((_a2 = mergedTheme.token) == null ? void 0 : _a2.colorIcon) || ((_b2 = mergedTheme.token) == null ? void 0 : _b2.colorTextSecondary)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
100
118
|
},
|
|
101
119
|
parentContext.collapse,
|
|
102
120
|
collapse
|
|
@@ -110,34 +128,60 @@ var ConfigProvider = ({
|
|
|
110
128
|
form
|
|
111
129
|
),
|
|
112
130
|
spin: (0, import_lodash.merge)({}, parentContext.spin, spin),
|
|
113
|
-
table: (0, import_lodash.merge)(
|
|
131
|
+
table: (0, import_lodash.merge)(
|
|
132
|
+
{},
|
|
133
|
+
{
|
|
134
|
+
expandable: {
|
|
135
|
+
expandIcon: ({ expandable, expanded, onExpand, record }) => {
|
|
136
|
+
var _a2, _b2;
|
|
137
|
+
return expandable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
import_icons.CaretRightOutlined,
|
|
139
|
+
{
|
|
140
|
+
onClick: (e) => onExpand(record, e),
|
|
141
|
+
style: {
|
|
142
|
+
transition: `transform 0.2s`,
|
|
143
|
+
transform: expanded ? "rotate(90deg)" : void 0,
|
|
144
|
+
color: ((_a2 = mergedTheme.token) == null ? void 0 : _a2.colorIcon) || ((_b2 = mergedTheme.token) == null ? void 0 : _b2.colorTextSecondary)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
parentContext.table,
|
|
152
|
+
table
|
|
153
|
+
),
|
|
114
154
|
tabs: (0, import_lodash.merge)({}, parentContext.tabs, tabs),
|
|
115
155
|
theme: (0, import_lodash.merge)({}, mergedTheme, {
|
|
116
|
-
token:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
156
|
+
token: {
|
|
157
|
+
...getLocaleTokenValue(mergedLocale, "fontFamily", fontFamily, import_default.fontFamilyEn),
|
|
158
|
+
...getLocaleTokenValue(mergedLocale, "fontWeight", fontWeight, import_default.fontWeightEn),
|
|
159
|
+
...getLocaleTokenValue(
|
|
160
|
+
mergedLocale,
|
|
161
|
+
"fontWeightStrong",
|
|
162
|
+
fontWeightStrong,
|
|
163
|
+
import_default.fontWeightStrongEn
|
|
123
164
|
)
|
|
124
|
-
|
|
165
|
+
}
|
|
125
166
|
}),
|
|
126
|
-
renderEmpty: parentContext.renderEmpty || ((componentName) => /* @__PURE__ */
|
|
127
|
-
...restProps
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
167
|
+
renderEmpty: parentContext.renderEmpty || ((componentName) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultRenderEmpty.default, { componentName })),
|
|
168
|
+
...restProps,
|
|
169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
ExtendedConfigContext.Provider,
|
|
171
|
+
{
|
|
172
|
+
value: {
|
|
173
|
+
navigate: navigate === void 0 ? parentExtendedContext.navigate : navigate,
|
|
174
|
+
hideOnSinglePage: ((_d = parentContext.pagination) == null ? void 0 : _d.showSizeChanger) ? false : hideOnSinglePage !== void 0 ? hideOnSinglePage : parentExtendedContext.hideOnSinglePage,
|
|
175
|
+
// inject static function to outermost ConfigProvider only
|
|
176
|
+
injectStaticFunction: false
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
|
|
179
|
+
children,
|
|
180
|
+
parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
|
|
181
|
+
] }) })
|
|
137
182
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
183
|
+
)
|
|
184
|
+
}
|
|
141
185
|
);
|
|
142
186
|
};
|
|
143
187
|
ConfigProvider.ConfigContext = import_antd.ConfigProvider.ConfigContext;
|
|
@@ -37,6 +37,7 @@ var import_warning = __toESM(require("antd/es/_util/warning"));
|
|
|
37
37
|
var import_toArray = __toESM(require("rc-util/lib/Children/toArray"));
|
|
38
38
|
var import_typography = __toESM(require("../../typography"));
|
|
39
39
|
var import_getEllipsisConfig = require("../../_util/getEllipsisConfig");
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
41
|
var children2Items = (children) => {
|
|
41
42
|
const childrenItems = (0, import_toArray.default)(children).map((node) => {
|
|
42
43
|
if (import_react.default.isValidElement(node)) {
|
|
@@ -63,7 +64,7 @@ function convertItem(props, bordered) {
|
|
|
63
64
|
return {
|
|
64
65
|
...restItemProps,
|
|
65
66
|
// 无边框并且子元素非 Typography 时外面包一层 Typography.Text,以实现自动省略
|
|
66
|
-
children: bordered || (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TYPOGRAPHY) ? itemChildren : /* @__PURE__ */
|
|
67
|
+
children: bordered || (itemChildrenType == null ? void 0 : itemChildrenType.__ANT_TYPOGRAPHY) ? itemChildren : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
68
|
import_typography.default.Text,
|
|
68
69
|
{
|
|
69
70
|
...restContentProps,
|
|
@@ -76,9 +77,9 @@ function convertItem(props, bordered) {
|
|
|
76
77
|
} : editable === true ? {
|
|
77
78
|
autoSize: false
|
|
78
79
|
} : editable
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
),
|
|
81
|
+
children: itemChildren
|
|
82
|
+
}
|
|
82
83
|
)
|
|
83
84
|
};
|
|
84
85
|
}
|
|
@@ -35,12 +35,13 @@ __export(descriptions_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(descriptions_exports);
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_classnames = __toESM(require("classnames"));
|
|
38
|
-
var import_react =
|
|
38
|
+
var import_react = require("react");
|
|
39
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
40
40
|
var import_Item = __toESM(require("./Item"));
|
|
41
41
|
var import_useItems = __toESM(require("./hooks/useItems"));
|
|
42
42
|
var import_style = __toESM(require("./style"));
|
|
43
43
|
__reExport(descriptions_exports, require("antd/es/descriptions"), module.exports);
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
45
|
var Descriptions = ({
|
|
45
46
|
children,
|
|
46
47
|
bordered,
|
|
@@ -61,7 +62,7 @@ var Descriptions = ({
|
|
|
61
62
|
});
|
|
62
63
|
const newItems = (0, import_useItems.default)(items, children, bordered);
|
|
63
64
|
return wrapSSR(
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
66
|
import_antd.Descriptions,
|
|
66
67
|
{
|
|
67
68
|
layout,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
3
|
-
import type { FullToken, GenerateStyle } from '
|
|
3
|
+
import type { FullToken, GenerateStyle } from '../../theme/interface';
|
|
4
4
|
import type { DescriptionsProps } from '..';
|
|
5
5
|
export type DescriptionsToken = FullToken<'Alert'> & {
|
|
6
6
|
typographyPrefixCls: string;
|