@oceanbase/design 1.0.0-alpha.3 → 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/alert/index.d.ts +2 -2
- package/es/alert/index.js +13 -4
- package/es/alert/style/index.js +152 -58
- package/es/badge/index.js +2 -3
- package/es/badge/style/index.js +1 -3
- package/es/card/index.d.ts +4 -0
- package/es/card/index.js +64 -7
- package/es/card/style/index.js +29 -5
- package/es/config-provider/index.d.ts +2 -2
- package/es/config-provider/index.js +26 -2
- package/es/descriptions/hooks/useItems.d.ts +6 -6
- package/es/drawer/style/index.js +24 -6
- package/es/form/FormItem.d.ts +1 -0
- package/es/form/FormItem.js +14 -4
- package/es/form/style/index.js +13 -2
- 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.js +62 -19
- package/es/static-function/index.js +13 -4
- package/es/table/style/index.js +3 -4
- 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.js +8 -2
- package/es/theme/default.js +9 -3
- package/es/theme/style/compact.less +7 -7
- package/es/theme/style/default.less +7 -7
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +11 -3
- package/lib/alert/style/index.js +170 -71
- package/lib/badge/index.js +2 -2
- package/lib/badge/style/index.js +1 -3
- package/lib/card/index.d.ts +4 -0
- package/lib/card/index.js +61 -4
- package/lib/card/style/index.js +52 -6
- package/lib/config-provider/index.d.ts +2 -2
- package/lib/config-provider/index.js +35 -2
- package/lib/descriptions/hooks/useItems.d.ts +6 -6
- package/lib/drawer/style/index.js +25 -4
- package/lib/form/FormItem.d.ts +1 -0
- package/lib/form/FormItem.js +10 -2
- package/lib/form/style/index.js +19 -0
- package/lib/input-number/index.d.ts +2 -1
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +60 -0
- package/lib/modal/Modal.js +26 -6
- package/lib/modal/style/index.js +76 -17
- package/lib/static-function/index.js +7 -1
- package/lib/table/style/index.js +3 -4
- package/lib/tabs/style/index.js +5 -0
- package/lib/tag/index.d.ts +1 -0
- package/lib/tag/index.js +3 -1
- package/lib/tag/style/index.js +8 -0
- package/lib/theme/default.js +9 -3
- package/lib/theme/style/compact.less +7 -7
- package/lib/theme/style/default.less +7 -7
- package/package.json +5 -5
|
@@ -103,7 +103,18 @@ var ConfigProvider = ({
|
|
|
103
103
|
collapse: (0, import_lodash.merge)(
|
|
104
104
|
{},
|
|
105
105
|
{
|
|
106
|
-
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
|
+
}
|
|
107
118
|
},
|
|
108
119
|
parentContext.collapse,
|
|
109
120
|
collapse
|
|
@@ -117,7 +128,29 @@ var ConfigProvider = ({
|
|
|
117
128
|
form
|
|
118
129
|
),
|
|
119
130
|
spin: (0, import_lodash.merge)({}, parentContext.spin, spin),
|
|
120
|
-
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
|
+
),
|
|
121
154
|
tabs: (0, import_lodash.merge)({}, parentContext.tabs, tabs),
|
|
122
155
|
theme: (0, import_lodash.merge)({}, mergedTheme, {
|
|
123
156
|
token: {
|
|
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
|
|
|
5
5
|
key?: React.Key;
|
|
6
6
|
label?: React.ReactNode;
|
|
7
7
|
span?: number | "filled" | {
|
|
8
|
-
xs?: number;
|
|
9
|
-
sm?: number;
|
|
10
|
-
md?: number;
|
|
11
|
-
lg?: number;
|
|
12
|
-
xl?: number;
|
|
13
8
|
xxl?: number;
|
|
9
|
+
xl?: number;
|
|
10
|
+
lg?: number;
|
|
11
|
+
md?: number;
|
|
12
|
+
sm?: number;
|
|
13
|
+
xs?: number;
|
|
14
14
|
};
|
|
15
15
|
style?: React.CSSProperties;
|
|
16
|
+
className?: string;
|
|
16
17
|
classNames?: Partial<Record<"label" | "content", string>>;
|
|
17
18
|
styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
|
|
18
|
-
className?: string;
|
|
19
19
|
labelStyle?: React.CSSProperties;
|
|
20
20
|
contentStyle?: React.CSSProperties;
|
|
21
21
|
}[];
|
|
@@ -25,8 +25,8 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genDrawerStyle = (token) => {
|
|
28
|
-
const { componentCls, antCls } = token;
|
|
29
|
-
const contentPadding =
|
|
28
|
+
const { componentCls, antCls, fontSizeHeading3, colorSplit } = token;
|
|
29
|
+
const contentPadding = token.paddingLG;
|
|
30
30
|
const boxShadowBottom = "0 2px 4px 0 rgba(54,69,99,0.04), 0 1px 6px -1px rgba(54,69,99,0.04), 0 1px 2px 0 rgba(54,69,99,0.06)";
|
|
31
31
|
const boxShadowTop = "0 -2px 4px 0 rgba(54,69,99,0.04), 0 -1px 6px -1px rgba(54,69,99,0.04), 0 -1px 2px 0 rgba(54,69,99,0.06)";
|
|
32
32
|
return {
|
|
@@ -34,11 +34,28 @@ var genDrawerStyle = (token) => {
|
|
|
34
34
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
35
35
|
[`${componentCls}-content`]: {
|
|
36
36
|
[`${componentCls}-header`]: {
|
|
37
|
+
position: "relative",
|
|
37
38
|
padding: `${token.padding}px ${token.paddingLG}px`,
|
|
38
39
|
borderBottom: "none",
|
|
39
40
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
40
41
|
// ensure header box-shadow cover body content
|
|
41
|
-
zIndex: 10
|
|
42
|
+
zIndex: 10,
|
|
43
|
+
[`${componentCls}-title`]: {
|
|
44
|
+
fontSize: fontSizeHeading3
|
|
45
|
+
},
|
|
46
|
+
// 标题栏底部增加分割线
|
|
47
|
+
"&::after": {
|
|
48
|
+
content: '""',
|
|
49
|
+
position: "absolute",
|
|
50
|
+
bottom: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
height: "1px",
|
|
54
|
+
backgroundColor: colorSplit,
|
|
55
|
+
// 使用负margin让分割线贯通到content边缘
|
|
56
|
+
marginLeft: `-${token.paddingLG}px`,
|
|
57
|
+
marginRight: `-${token.paddingLG}px`
|
|
58
|
+
}
|
|
42
59
|
},
|
|
43
60
|
[`${componentCls}-header-shadow`]: {
|
|
44
61
|
boxShadow: boxShadowBottom
|
|
@@ -65,6 +82,10 @@ var genDrawerStyle = (token) => {
|
|
|
65
82
|
alignItems: "center"
|
|
66
83
|
}
|
|
67
84
|
},
|
|
85
|
+
// footer 跟随内容或滚动到底部时,padding-top 设为 0
|
|
86
|
+
[`${componentCls}-footer-container-no-padding-top`]: {
|
|
87
|
+
paddingTop: 0
|
|
88
|
+
},
|
|
68
89
|
[`${componentCls}-footer-container-shadow`]: {
|
|
69
90
|
boxShadow: boxShadowTop
|
|
70
91
|
}
|
|
@@ -79,7 +100,7 @@ var genDrawerStyle = (token) => {
|
|
|
79
100
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
80
101
|
[`${componentCls}-content`]: {
|
|
81
102
|
[`${componentCls}-body-content`]: {
|
|
82
|
-
|
|
103
|
+
paddingBottom: token.paddingXS
|
|
83
104
|
}
|
|
84
105
|
}
|
|
85
106
|
}
|
package/lib/form/FormItem.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type LabelTooltipType = WrapperTooltipProps | React.ReactNode;
|
|
|
17
17
|
export interface FormItemProps extends AntFormItemProps {
|
|
18
18
|
tooltip?: WrapperTooltipProps | ReactNode;
|
|
19
19
|
action?: ReactNode;
|
|
20
|
+
description?: ReactNode;
|
|
20
21
|
}
|
|
21
22
|
type CompoundedComponent = React.FC<FormItemProps> & {
|
|
22
23
|
useStatus: typeof AntFormItem.useStatus;
|
package/lib/form/FormItem.js
CHANGED
|
@@ -49,6 +49,7 @@ var FormItem = ({
|
|
|
49
49
|
label,
|
|
50
50
|
tooltip,
|
|
51
51
|
action,
|
|
52
|
+
description,
|
|
52
53
|
layout: externalLayout,
|
|
53
54
|
prefixCls: customizePrefixCls,
|
|
54
55
|
className,
|
|
@@ -58,7 +59,9 @@ var FormItem = ({
|
|
|
58
59
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
59
60
|
const prefixCls = getPrefixCls("form", customizePrefixCls);
|
|
60
61
|
const { wrapSSR } = (0, import_style.default)(prefixCls);
|
|
61
|
-
const formItemCls = (0, import_classnames.default)(className
|
|
62
|
+
const formItemCls = (0, import_classnames.default)(className, {
|
|
63
|
+
[`${prefixCls}-item-has-description`]: !!description
|
|
64
|
+
});
|
|
62
65
|
const {
|
|
63
66
|
layout: contextLayout,
|
|
64
67
|
// compatible with vertical for version < antd 27.0.0
|
|
@@ -80,6 +83,8 @@ var FormItem = ({
|
|
|
80
83
|
...restTooltipProps
|
|
81
84
|
};
|
|
82
85
|
}
|
|
86
|
+
const isVertical = layout === "vertical" || vertical;
|
|
87
|
+
const descriptionContent = description && isVertical ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-item-description`, children: description }) : null;
|
|
83
88
|
return wrapSSR(
|
|
84
89
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
90
|
AntFormItem,
|
|
@@ -94,7 +99,10 @@ var FormItem = ({
|
|
|
94
99
|
prefixCls: customizePrefixCls,
|
|
95
100
|
className: formItemCls,
|
|
96
101
|
...restProps,
|
|
97
|
-
children
|
|
102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
103
|
+
descriptionContent,
|
|
104
|
+
children
|
|
105
|
+
] })
|
|
98
106
|
}
|
|
99
107
|
)
|
|
100
108
|
);
|
package/lib/form/style/index.js
CHANGED
|
@@ -27,6 +27,12 @@ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
|
27
27
|
var genFormStyle = (token) => {
|
|
28
28
|
const { componentCls } = token;
|
|
29
29
|
return {
|
|
30
|
+
[componentCls]: {
|
|
31
|
+
[`${componentCls}-item-extra`]: {
|
|
32
|
+
paddingTop: token.paddingXXS,
|
|
33
|
+
fontSize: token.fontSizeSM
|
|
34
|
+
}
|
|
35
|
+
},
|
|
30
36
|
[`${componentCls}${componentCls}-vertical`]: {
|
|
31
37
|
[`${componentCls}-item:not(${componentCls}-item-horizontal)`]: {
|
|
32
38
|
[`${componentCls}-item-label > label`]: {
|
|
@@ -36,6 +42,19 @@ var genFormStyle = (token) => {
|
|
|
36
42
|
right: 0
|
|
37
43
|
}
|
|
38
44
|
}
|
|
45
|
+
},
|
|
46
|
+
[`${componentCls}-item-has-description`]: {
|
|
47
|
+
[`${componentCls}-item-control-input`]: {
|
|
48
|
+
minHeight: "auto"
|
|
49
|
+
},
|
|
50
|
+
[`${componentCls}-item-label`]: {
|
|
51
|
+
paddingBottom: token.paddingXXS
|
|
52
|
+
},
|
|
53
|
+
[`${componentCls}-item-description`]: {
|
|
54
|
+
paddingBottom: token.paddingXXS + 2,
|
|
55
|
+
fontSize: token.fontSizeSM,
|
|
56
|
+
color: token.colorTextDescription
|
|
57
|
+
}
|
|
39
58
|
}
|
|
40
59
|
}
|
|
41
60
|
};
|
|
@@ -8,7 +8,8 @@ export interface InputNumberLocale {
|
|
|
8
8
|
export interface InputNumberProps extends AntInputNumberProps {
|
|
9
9
|
locale?: InputNumberLocale;
|
|
10
10
|
}
|
|
11
|
-
type
|
|
11
|
+
type InputNumberRef = React.ComponentRef<typeof AntInputNumber>;
|
|
12
|
+
type CompoundedComponent = React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<InputNumberRef>> & {
|
|
12
13
|
_InternalPanelDoNotUseOrYouWillBeFired: typeof AntInputNumber._InternalPanelDoNotUseOrYouWillBeFired;
|
|
13
14
|
};
|
|
14
15
|
declare const InputNumber: CompoundedComponent;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/locale/ja-JP.ts
|
|
30
|
+
var ja_JP_exports = {};
|
|
31
|
+
__export(ja_JP_exports, {
|
|
32
|
+
default: () => ja_JP_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ja_JP_exports);
|
|
35
|
+
var import_ja_JP = __toESM(require("antd/es/locale/ja_JP"));
|
|
36
|
+
var ja_JP_default = {
|
|
37
|
+
...import_ja_JP.default,
|
|
38
|
+
global: {
|
|
39
|
+
...import_ja_JP.default.global,
|
|
40
|
+
inputPlaceholder: "入力してください"
|
|
41
|
+
},
|
|
42
|
+
Pagination: {
|
|
43
|
+
...import_ja_JP.default.Pagination,
|
|
44
|
+
total: "合計 ${total} 件"
|
|
45
|
+
},
|
|
46
|
+
Drawer: {
|
|
47
|
+
okText: "確定",
|
|
48
|
+
cancelText: "キャンセル"
|
|
49
|
+
},
|
|
50
|
+
Table: {
|
|
51
|
+
...import_ja_JP.default.Table,
|
|
52
|
+
batchOperationBar: {
|
|
53
|
+
selected: "選択済み",
|
|
54
|
+
object: "件",
|
|
55
|
+
cancel: "キャンセル",
|
|
56
|
+
collapse: "折りたたむ",
|
|
57
|
+
open: "展開"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
package/lib/modal/Modal.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(Modal_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Modal_exports);
|
|
35
35
|
var import_antd = require("antd");
|
|
36
|
+
var import_icons = require("@oceanbase/icons");
|
|
36
37
|
var import_classnames = __toESM(require("classnames"));
|
|
37
38
|
var import_react = require("react");
|
|
38
39
|
var import_config_provider = __toESM(require("../config-provider"));
|
|
@@ -67,12 +68,31 @@ var Modal = ({
|
|
|
67
68
|
)
|
|
68
69
|
);
|
|
69
70
|
};
|
|
70
|
-
Modal.info = (props) => import_static_function.modal.info(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
Modal.
|
|
71
|
+
Modal.info = (props) => import_static_function.modal.info({
|
|
72
|
+
// use outlined icon
|
|
73
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.InfoCircleOutlined, {}),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
Modal.success = (props) => import_static_function.modal.success({
|
|
77
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleOutlined, {}),
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
Modal.error = (props) => import_static_function.modal.error({
|
|
81
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseCircleOutlined, {}),
|
|
82
|
+
...props
|
|
83
|
+
});
|
|
84
|
+
Modal.warning = (props) => import_static_function.modal.warning({
|
|
85
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {}),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
Modal.warn = (props) => import_static_function.modal.warning({
|
|
89
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {}),
|
|
90
|
+
...props
|
|
91
|
+
});
|
|
92
|
+
Modal.confirm = (props) => import_static_function.modal.confirm({
|
|
93
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExclamationCircleOutlined, {}),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
76
96
|
Modal.useModal = import_antd.Modal.useModal;
|
|
77
97
|
Modal.destroyAll = import_antd.Modal.destroyAll;
|
|
78
98
|
Modal.config = import_antd.Modal.config;
|
package/lib/modal/style/index.js
CHANGED
|
@@ -28,25 +28,59 @@ var genModalStyle = (token) => {
|
|
|
28
28
|
const {
|
|
29
29
|
antCls,
|
|
30
30
|
componentCls,
|
|
31
|
-
marginXXS,
|
|
32
31
|
marginLG,
|
|
33
|
-
paddingMD,
|
|
34
|
-
borderRadius,
|
|
35
|
-
controlHeight,
|
|
36
32
|
fontSizeHeading5,
|
|
37
|
-
lineHeightHeading5
|
|
33
|
+
lineHeightHeading5,
|
|
34
|
+
fontSizeHeading3,
|
|
35
|
+
colorSplit
|
|
38
36
|
} = token;
|
|
39
37
|
const top = 100;
|
|
40
38
|
const bottom = 100;
|
|
41
39
|
const titleHeight = fontSizeHeading5 * lineHeightHeading5;
|
|
42
40
|
return {
|
|
43
41
|
/* Modal */
|
|
44
|
-
[`${componentCls}:not(${componentCls}-confirm)`]: {
|
|
45
|
-
[`${componentCls}-
|
|
46
|
-
|
|
42
|
+
[`${componentCls}:not(${componentCls}-confirm):not(${componentCls}-progress)`]: {
|
|
43
|
+
[`${componentCls}-content`]: {
|
|
44
|
+
paddingBlock: token.padding,
|
|
45
|
+
[`${componentCls}-close`]: {
|
|
46
|
+
marginTop: token.marginXXS,
|
|
47
|
+
marginRight: token.marginXXS
|
|
48
|
+
},
|
|
49
|
+
[`${componentCls}-header`]: {
|
|
50
|
+
position: "relative",
|
|
51
|
+
marginBottom: 0,
|
|
52
|
+
paddingBottom: token.padding,
|
|
53
|
+
[`${componentCls}-title`]: {
|
|
54
|
+
fontSize: fontSizeHeading3
|
|
55
|
+
},
|
|
56
|
+
// 使用伪元素创建贯通的分割线
|
|
57
|
+
"&::after": {
|
|
58
|
+
content: '""',
|
|
59
|
+
position: "absolute",
|
|
60
|
+
bottom: 0,
|
|
61
|
+
left: 0,
|
|
62
|
+
right: 0,
|
|
63
|
+
height: "1px",
|
|
64
|
+
backgroundColor: colorSplit,
|
|
65
|
+
// antd Modal content默认padding通常是24px,使用负margin让分割线贯通
|
|
66
|
+
// 如果antd使用其他padding值,可能需要调整
|
|
67
|
+
marginLeft: `-${token.paddingLG}px`,
|
|
68
|
+
marginRight: `-${token.paddingLG}px`
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[`${componentCls}-body`]: {
|
|
72
|
+
paddingTop: token.paddingLG,
|
|
73
|
+
marginInline: `-${token.marginLG}px`,
|
|
74
|
+
paddingInline: token.paddingLG
|
|
75
|
+
}
|
|
47
76
|
},
|
|
48
77
|
[`${componentCls}-footer`]: {
|
|
49
|
-
|
|
78
|
+
paddingTop: token.paddingLG,
|
|
79
|
+
marginTop: 0,
|
|
80
|
+
[`${antCls}-btn`]: {
|
|
81
|
+
height: 28,
|
|
82
|
+
minHeight: 28
|
|
83
|
+
},
|
|
50
84
|
[`${componentCls}-footer-content`]: {
|
|
51
85
|
display: "flex",
|
|
52
86
|
justifyContent: "space-between",
|
|
@@ -62,12 +96,16 @@ var genModalStyle = (token) => {
|
|
|
62
96
|
/* Modal.Progress */
|
|
63
97
|
[`${componentCls}${componentCls}-progress`]: {
|
|
64
98
|
[`${componentCls}-content`]: {
|
|
65
|
-
padding:
|
|
99
|
+
padding: token.paddingLG,
|
|
100
|
+
[`${componentCls}-close`]: {
|
|
101
|
+
marginTop: token.marginSM,
|
|
102
|
+
marginRight: token.marginXXS
|
|
103
|
+
},
|
|
66
104
|
[`${componentCls}-header`]: {
|
|
67
105
|
textAlign: "center",
|
|
68
106
|
marginBottom: token.marginXXL,
|
|
69
107
|
[`${componentCls}-title`]: {
|
|
70
|
-
fontSize:
|
|
108
|
+
fontSize: fontSizeHeading3
|
|
71
109
|
}
|
|
72
110
|
},
|
|
73
111
|
[`${componentCls}-body`]: {
|
|
@@ -86,18 +124,39 @@ var genModalStyle = (token) => {
|
|
|
86
124
|
}
|
|
87
125
|
},
|
|
88
126
|
[`${componentCls}-footer`]: {
|
|
89
|
-
textAlign: "center"
|
|
127
|
+
textAlign: "center",
|
|
128
|
+
[`${antCls}-btn`]: {
|
|
129
|
+
height: 28,
|
|
130
|
+
minHeight: 28
|
|
131
|
+
}
|
|
90
132
|
}
|
|
91
133
|
}
|
|
92
134
|
},
|
|
93
135
|
/* Modal.method() */
|
|
94
136
|
[`${componentCls}-confirm`]: {
|
|
95
|
-
[`${componentCls}-
|
|
96
|
-
|
|
97
|
-
color: token.colorTextSecondary
|
|
137
|
+
[`${componentCls}-content`]: {
|
|
138
|
+
padding: token.paddingLG
|
|
98
139
|
},
|
|
99
|
-
[`${componentCls}-
|
|
100
|
-
|
|
140
|
+
[`${componentCls}-body`]: {
|
|
141
|
+
[`${componentCls}-confirm-title`]: {
|
|
142
|
+
fontSize: fontSizeHeading3
|
|
143
|
+
},
|
|
144
|
+
[`${componentCls}-confirm-body > ${token.iconCls}`]: {
|
|
145
|
+
height: token.fontSizeHeading3 * token.lineHeight
|
|
146
|
+
},
|
|
147
|
+
[`${componentCls}-confirm-paragraph`]: {
|
|
148
|
+
rowGap: token.marginSM
|
|
149
|
+
},
|
|
150
|
+
[`${componentCls}-confirm-content`]: {
|
|
151
|
+
color: token.colorTextSecondary
|
|
152
|
+
},
|
|
153
|
+
[`${componentCls}-confirm-btns`]: {
|
|
154
|
+
marginTop: marginLG,
|
|
155
|
+
[`${antCls}-btn`]: {
|
|
156
|
+
height: 28,
|
|
157
|
+
minHeight: 28
|
|
158
|
+
}
|
|
159
|
+
}
|
|
101
160
|
}
|
|
102
161
|
}
|
|
103
162
|
};
|
|
@@ -36,8 +36,11 @@ __export(static_function_exports, {
|
|
|
36
36
|
token: () => token
|
|
37
37
|
});
|
|
38
38
|
module.exports = __toCommonJS(static_function_exports);
|
|
39
|
+
var import_react = require("react");
|
|
39
40
|
var import_antd = require("antd");
|
|
40
41
|
var import_alias = __toESM(require("antd/lib/theme/util/alias"));
|
|
42
|
+
var import_config_provider = __toESM(require("../config-provider"));
|
|
43
|
+
var import_style = __toESM(require("../modal/style"));
|
|
41
44
|
var import_theme = __toESM(require("../theme"));
|
|
42
45
|
var import_default = __toESM(require("../theme/default"));
|
|
43
46
|
var { defaultAlgorithm, defaultSeed, useToken } = import_theme.default;
|
|
@@ -45,7 +48,7 @@ var _a, _b, _c;
|
|
|
45
48
|
var mapToken = {
|
|
46
49
|
...defaultAlgorithm(defaultSeed),
|
|
47
50
|
...import_default.default.token,
|
|
48
|
-
//
|
|
51
|
+
// need to override some Alias Token values
|
|
49
52
|
override: {
|
|
50
53
|
boxShadow: (_a = import_default.default.token) == null ? void 0 : _a.boxShadow,
|
|
51
54
|
boxShadowSecondary: (_b = import_default.default.token) == null ? void 0 : _b.boxShadowSecondary,
|
|
@@ -58,6 +61,9 @@ var notification = import_antd.notification;
|
|
|
58
61
|
var modal = import_antd.Modal;
|
|
59
62
|
var static_function_default = () => {
|
|
60
63
|
token = useToken().token;
|
|
64
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
65
|
+
const prefixCls = getPrefixCls("modal");
|
|
66
|
+
(0, import_style.default)(prefixCls);
|
|
61
67
|
const staticFunction = import_antd.App.useApp();
|
|
62
68
|
message = {
|
|
63
69
|
...staticFunction.message,
|
package/lib/table/style/index.js
CHANGED
|
@@ -40,6 +40,7 @@ var genTableStyle = (token) => {
|
|
|
40
40
|
marginLG,
|
|
41
41
|
marginXS
|
|
42
42
|
} = token;
|
|
43
|
+
console.log(token.fontWeight);
|
|
43
44
|
return {
|
|
44
45
|
// 表格通用样式
|
|
45
46
|
[`${componentCls}-wrapper ${componentCls}`]: {
|
|
@@ -53,9 +54,8 @@ var genTableStyle = (token) => {
|
|
|
53
54
|
// head 样式
|
|
54
55
|
[`${componentCls}-thead > tr`]: {
|
|
55
56
|
["th"]: {
|
|
56
|
-
// 弱化列标题
|
|
57
57
|
color: colorTextSecondary,
|
|
58
|
-
fontWeight:
|
|
58
|
+
fontWeight: token.fontWeight,
|
|
59
59
|
backgroundColor: colorBgBase
|
|
60
60
|
},
|
|
61
61
|
// 去掉排序列表头的灰色背景
|
|
@@ -159,7 +159,6 @@ var genTableStyle = (token) => {
|
|
|
159
159
|
[`${componentCls}-thead, ${componentCls}-tbody`]: {
|
|
160
160
|
["td, th"]: {
|
|
161
161
|
[`&${componentCls}-row-expand-icon-cell`]: {
|
|
162
|
-
backgroundColor: colorBgBase,
|
|
163
162
|
// 设置 paddingRight 即可
|
|
164
163
|
paddingRight: token.paddingXS
|
|
165
164
|
},
|
|
@@ -275,7 +274,7 @@ var genTableStyle = (token) => {
|
|
|
275
274
|
marginRight: marginLG,
|
|
276
275
|
[`${componentCls}-batch-operation-selection`]: {
|
|
277
276
|
color: colorTextSecondary,
|
|
278
|
-
fontWeight:
|
|
277
|
+
fontWeight: token.fontWeightStrong,
|
|
279
278
|
[`${componentCls}-batch-operation-selection-count`]: {
|
|
280
279
|
margin: `0 ${marginXS}px`,
|
|
281
280
|
color: colorLink
|
package/lib/tabs/style/index.js
CHANGED
|
@@ -36,6 +36,11 @@ var genTabsStyle = (token) => {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
+
[`&${componentCls}-left, &${componentCls}-right`]: {
|
|
40
|
+
[`${componentCls}-tab[data-node-key^=divider-]`]: {
|
|
41
|
+
paddingBlock: 0
|
|
42
|
+
}
|
|
43
|
+
},
|
|
39
44
|
[`${componentCls}-tab`]: {
|
|
40
45
|
/** @deprecated */
|
|
41
46
|
[`${componentCls}-tab-tag`]: {
|
package/lib/tag/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Ellipsis } from '../_util/getEllipsisConfig';
|
|
|
4
4
|
export * from 'antd/es/tag';
|
|
5
5
|
export interface TagProps extends AntTagProps {
|
|
6
6
|
ellipsis?: Ellipsis;
|
|
7
|
+
pill?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const _default: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>> & {
|
|
9
10
|
CheckableTag: React.ForwardRefExoticComponent<import("antd/es/tag").CheckableTagProps & React.RefAttributes<HTMLSpanElement>>;
|
package/lib/tag/index.js
CHANGED
|
@@ -53,6 +53,7 @@ var Tag = import_react.default.forwardRef(
|
|
|
53
53
|
title: children
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
+
pill,
|
|
56
57
|
...restProps
|
|
57
58
|
}, ref) => {
|
|
58
59
|
const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
|
|
@@ -61,7 +62,8 @@ var Tag = import_react.default.forwardRef(
|
|
|
61
62
|
const ellipsisConfig = (0, import_getEllipsisConfig.getEllipsisConfig)(ellipsis, children);
|
|
62
63
|
const tagCls = (0, import_classnames.default)(
|
|
63
64
|
{
|
|
64
|
-
[`${prefixCls}-ellipsis`]: !!ellipsisConfig
|
|
65
|
+
[`${prefixCls}-ellipsis`]: !!ellipsisConfig,
|
|
66
|
+
[`${prefixCls}-pill`]: pill
|
|
65
67
|
},
|
|
66
68
|
className
|
|
67
69
|
);
|
package/lib/tag/style/index.js
CHANGED
|
@@ -44,6 +44,9 @@ var genTagStyle = (token) => {
|
|
|
44
44
|
[`${componentCls}`]: {
|
|
45
45
|
paddingInline: token.paddingXS,
|
|
46
46
|
fontSize: token.fontSizeSM,
|
|
47
|
+
[`&:not(${componentCls}-pill)`]: {
|
|
48
|
+
fontWeight: token.fontWeightStrong
|
|
49
|
+
},
|
|
47
50
|
[`${componentCls}-close-icon${iconCls}`]: {
|
|
48
51
|
marginInlineStart: token.marginXXS
|
|
49
52
|
},
|
|
@@ -66,6 +69,11 @@ var genTagStyle = (token) => {
|
|
|
66
69
|
},
|
|
67
70
|
["&-borderless"]: {
|
|
68
71
|
borderColor: "transparent"
|
|
72
|
+
},
|
|
73
|
+
["&-pill"]: {
|
|
74
|
+
borderRadius: 100,
|
|
75
|
+
lineHeight: token.lineHeight,
|
|
76
|
+
marginInlineEnd: token.marginXXS
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
};
|
package/lib/theme/default.js
CHANGED
|
@@ -35,8 +35,8 @@ var colorTextTertiary = "#8592AD";
|
|
|
35
35
|
var colorTextQuaternary = "#B6C0D4";
|
|
36
36
|
var colorFill = "#CDD5E4";
|
|
37
37
|
var colorFillSecondary = "#E2E8F3";
|
|
38
|
-
var colorFillTertiary = "#
|
|
39
|
-
var colorFillQuaternary = "#
|
|
38
|
+
var colorFillTertiary = "#EBEFF7";
|
|
39
|
+
var colorFillQuaternary = "#F5F7FC";
|
|
40
40
|
var colorBorderSecondary = colorFillSecondary;
|
|
41
41
|
var fontSizeSM = 12;
|
|
42
42
|
var tagColorBorder = colorTextQuaternary;
|
|
@@ -98,7 +98,7 @@ var defaultTheme = {
|
|
|
98
98
|
colorIcon: colorTextSecondary,
|
|
99
99
|
colorBgBase: "#ffffff",
|
|
100
100
|
colorBgContainer: "#ffffff",
|
|
101
|
-
colorBgLayout:
|
|
101
|
+
colorBgLayout: "#FBFCFE",
|
|
102
102
|
colorBorder: colorFill,
|
|
103
103
|
colorBorderSecondary,
|
|
104
104
|
colorFill,
|
|
@@ -117,6 +117,12 @@ var defaultTheme = {
|
|
|
117
117
|
lineWidthFocus: 0
|
|
118
118
|
},
|
|
119
119
|
components: {
|
|
120
|
+
Alert: {
|
|
121
|
+
borderRadiusLG: 6
|
|
122
|
+
},
|
|
123
|
+
Badge: {
|
|
124
|
+
statusSize: 8
|
|
125
|
+
},
|
|
120
126
|
Breadcrumb: {
|
|
121
127
|
fontSize: fontSizeSM,
|
|
122
128
|
fontHeight: 20,
|