@oceanbase/design 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +16 -4
- package/es/alert/style/index.js +155 -60
- 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 +36 -10
- package/es/checkbox/style/index.js +4 -2
- 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/descriptions/style/index.js +3 -2
- package/es/drawer/style/index.js +28 -8
- package/es/empty/style/index.js +6 -4
- package/es/form/FormItem.d.ts +1 -0
- package/es/form/FormItem.js +14 -4
- package/es/form/style/index.js +15 -3
- 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 +64 -20
- package/es/radio/style/index.js +4 -2
- package/es/slider/style/index.js +7 -5
- package/es/spin/style/index.js +14 -11
- package/es/static-function/index.js +13 -4
- package/es/table/style/index.js +19 -19
- 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/es/typography/style/index.js +25 -20
- package/lib/alert/index.d.ts +2 -2
- package/lib/alert/index.js +13 -3
- package/lib/alert/style/index.js +171 -72
- 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 +58 -11
- package/lib/checkbox/style/index.js +3 -2
- 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/descriptions/style/index.js +2 -2
- package/lib/drawer/style/index.js +28 -6
- package/lib/empty/style/index.js +5 -4
- package/lib/form/FormItem.d.ts +1 -0
- package/lib/form/FormItem.js +10 -2
- package/lib/form/style/index.js +20 -1
- 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 +78 -18
- package/lib/radio/style/index.js +3 -2
- package/lib/slider/style/index.js +6 -5
- package/lib/spin/style/index.js +12 -11
- package/lib/static-function/index.js +7 -1
- package/lib/table/style/index.js +19 -19
- 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/lib/typography/style/index.js +24 -20
- package/package.json +5 -6
|
@@ -64,7 +64,7 @@ var genVerticalStyle = (size, token) => {
|
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
66
|
var genDescriptionsStyle = (token) => {
|
|
67
|
-
const { componentCls, typographyComponentCls } = token;
|
|
67
|
+
const { componentCls, typographyComponentCls, calc } = token;
|
|
68
68
|
return {
|
|
69
69
|
[`${componentCls}`]: {
|
|
70
70
|
...genVerticalStyle("default", token),
|
|
@@ -80,7 +80,7 @@ var genDescriptionsStyle = (token) => {
|
|
|
80
80
|
},
|
|
81
81
|
[`${componentCls}-item-container:has(${`${typographyComponentCls}-edit-content`})`]: {
|
|
82
82
|
alignItems: "center",
|
|
83
|
-
height: token.fontSize
|
|
83
|
+
height: calc(token.fontSize).mul(token.lineHeight).equal()
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
[`${componentCls}${componentCls}-middle`]: genVerticalStyle("middle", token),
|
|
@@ -23,10 +23,11 @@ __export(style_exports, {
|
|
|
23
23
|
genDrawerStyle: () => genDrawerStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genDrawerStyle = (token) => {
|
|
28
|
-
const { componentCls, antCls } = token;
|
|
29
|
-
const contentPadding =
|
|
29
|
+
const { componentCls, antCls, fontSizeHeading3, colorSplit, calc } = token;
|
|
30
|
+
const contentPadding = token.paddingLG;
|
|
30
31
|
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
32
|
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
33
|
return {
|
|
@@ -34,11 +35,28 @@ var genDrawerStyle = (token) => {
|
|
|
34
35
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
35
36
|
[`${componentCls}-content`]: {
|
|
36
37
|
[`${componentCls}-header`]: {
|
|
37
|
-
|
|
38
|
+
position: "relative",
|
|
39
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
38
40
|
borderBottom: "none",
|
|
39
41
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
40
42
|
// ensure header box-shadow cover body content
|
|
41
|
-
zIndex: 10
|
|
43
|
+
zIndex: 10,
|
|
44
|
+
[`${componentCls}-title`]: {
|
|
45
|
+
fontSize: fontSizeHeading3
|
|
46
|
+
},
|
|
47
|
+
// 标题栏底部增加分割线
|
|
48
|
+
"&::after": {
|
|
49
|
+
content: '""',
|
|
50
|
+
position: "absolute",
|
|
51
|
+
bottom: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
right: 0,
|
|
54
|
+
height: "1px",
|
|
55
|
+
backgroundColor: colorSplit,
|
|
56
|
+
// 使用负margin让分割线贯通到content边缘
|
|
57
|
+
marginLeft: calc(token.paddingLG).mul(-1).equal(),
|
|
58
|
+
marginRight: calc(token.paddingLG).mul(-1).equal()
|
|
59
|
+
}
|
|
42
60
|
},
|
|
43
61
|
[`${componentCls}-header-shadow`]: {
|
|
44
62
|
boxShadow: boxShadowBottom
|
|
@@ -54,7 +72,7 @@ var genDrawerStyle = (token) => {
|
|
|
54
72
|
},
|
|
55
73
|
[`${componentCls}-footer-container`]: {
|
|
56
74
|
position: "sticky",
|
|
57
|
-
padding: `${token.padding}
|
|
75
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
58
76
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
59
77
|
// ensure footer box-shadow cover body content
|
|
60
78
|
zIndex: 10,
|
|
@@ -65,6 +83,10 @@ var genDrawerStyle = (token) => {
|
|
|
65
83
|
alignItems: "center"
|
|
66
84
|
}
|
|
67
85
|
},
|
|
86
|
+
// footer 跟随内容或滚动到底部时,padding-top 设为 0
|
|
87
|
+
[`${componentCls}-footer-container-no-padding-top`]: {
|
|
88
|
+
paddingTop: 0
|
|
89
|
+
},
|
|
68
90
|
[`${componentCls}-footer-container-shadow`]: {
|
|
69
91
|
boxShadow: boxShadowTop
|
|
70
92
|
}
|
|
@@ -79,7 +101,7 @@ var genDrawerStyle = (token) => {
|
|
|
79
101
|
// should be wrapped by `${componentCls}-content` to overwritten antd style
|
|
80
102
|
[`${componentCls}-content`]: {
|
|
81
103
|
[`${componentCls}-body-content`]: {
|
|
82
|
-
|
|
104
|
+
paddingBottom: token.paddingXS
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
107
|
}
|
package/lib/empty/style/index.js
CHANGED
|
@@ -23,9 +23,10 @@ __export(style_exports, {
|
|
|
23
23
|
genEmptyStyle: () => genEmptyStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
26
27
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
28
|
var genEmptyStyle = (token) => {
|
|
28
|
-
const { antCls, componentCls, colorTextTertiary, colorText, colorTextSecondary } = token;
|
|
29
|
+
const { antCls, componentCls, colorTextTertiary, colorText, colorTextSecondary, calc } = token;
|
|
29
30
|
return {
|
|
30
31
|
[`${componentCls}`]: {
|
|
31
32
|
[`${componentCls}-image`]: {
|
|
@@ -59,7 +60,7 @@ var genEmptyStyle = (token) => {
|
|
|
59
60
|
[`${antCls}-steps-item-icon`]: {
|
|
60
61
|
height: token.controlHeightSM,
|
|
61
62
|
width: token.controlHeightSM,
|
|
62
|
-
lineHeight:
|
|
63
|
+
lineHeight: (0, import_cssinjs.unit)(token.controlHeightSM),
|
|
63
64
|
backgroundColor: token.colorFillSecondary,
|
|
64
65
|
// override default border color
|
|
65
66
|
borderColor: token.colorFillSecondary,
|
|
@@ -73,9 +74,9 @@ var genEmptyStyle = (token) => {
|
|
|
73
74
|
color: colorText,
|
|
74
75
|
fontSize: token.fontSize,
|
|
75
76
|
fontWeight: token.fontWeightStrong,
|
|
76
|
-
lineHeight:
|
|
77
|
+
lineHeight: (0, import_cssinjs.unit)(token.controlHeightSM),
|
|
77
78
|
"&::after": {
|
|
78
|
-
top: token.controlHeightSM
|
|
79
|
+
top: calc(token.controlHeightSM).div(2).equal()
|
|
79
80
|
}
|
|
80
81
|
},
|
|
81
82
|
[`${antCls}-steps-item-description`]: {
|
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
|
@@ -25,8 +25,14 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genFormStyle = (token) => {
|
|
28
|
-
const { componentCls } = token;
|
|
28
|
+
const { componentCls, calc } = 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: calc(token.paddingXXS).add(2).equal(),
|
|
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,60 @@ 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,
|
|
36
|
+
calc
|
|
38
37
|
} = token;
|
|
39
38
|
const top = 100;
|
|
40
39
|
const bottom = 100;
|
|
41
|
-
const titleHeight = fontSizeHeading5
|
|
40
|
+
const titleHeight = calc(fontSizeHeading5).mul(lineHeightHeading5).equal();
|
|
42
41
|
return {
|
|
43
42
|
/* Modal */
|
|
44
|
-
[`${componentCls}:not(${componentCls}-confirm)`]: {
|
|
45
|
-
[`${componentCls}-
|
|
46
|
-
|
|
43
|
+
[`${componentCls}:not(${componentCls}-confirm):not(${componentCls}-progress)`]: {
|
|
44
|
+
[`${componentCls}-content`]: {
|
|
45
|
+
paddingBlock: token.padding,
|
|
46
|
+
[`${componentCls}-close`]: {
|
|
47
|
+
marginTop: token.marginXXS,
|
|
48
|
+
marginRight: token.marginXXS
|
|
49
|
+
},
|
|
50
|
+
[`${componentCls}-header`]: {
|
|
51
|
+
position: "relative",
|
|
52
|
+
marginBottom: 0,
|
|
53
|
+
paddingBottom: token.padding,
|
|
54
|
+
[`${componentCls}-title`]: {
|
|
55
|
+
fontSize: fontSizeHeading3
|
|
56
|
+
},
|
|
57
|
+
// 使用伪元素创建贯通的分割线
|
|
58
|
+
"&::after": {
|
|
59
|
+
content: '""',
|
|
60
|
+
position: "absolute",
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
right: 0,
|
|
64
|
+
height: "1px",
|
|
65
|
+
backgroundColor: colorSplit,
|
|
66
|
+
// antd Modal content默认padding通常是24px,使用负margin让分割线贯通
|
|
67
|
+
// 如果antd使用其他padding值,可能需要调整
|
|
68
|
+
marginLeft: calc(token.paddingLG).mul(-1).equal(),
|
|
69
|
+
marginRight: calc(token.paddingLG).mul(-1).equal()
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
[`${componentCls}-body`]: {
|
|
73
|
+
paddingTop: token.paddingLG,
|
|
74
|
+
marginInline: calc(token.marginLG).mul(-1).equal(),
|
|
75
|
+
paddingInline: token.paddingLG
|
|
76
|
+
}
|
|
47
77
|
},
|
|
48
78
|
[`${componentCls}-footer`]: {
|
|
49
|
-
|
|
79
|
+
paddingTop: token.paddingLG,
|
|
80
|
+
marginTop: 0,
|
|
81
|
+
[`${antCls}-btn`]: {
|
|
82
|
+
height: 28,
|
|
83
|
+
minHeight: 28
|
|
84
|
+
},
|
|
50
85
|
[`${componentCls}-footer-content`]: {
|
|
51
86
|
display: "flex",
|
|
52
87
|
justifyContent: "space-between",
|
|
@@ -62,12 +97,16 @@ var genModalStyle = (token) => {
|
|
|
62
97
|
/* Modal.Progress */
|
|
63
98
|
[`${componentCls}${componentCls}-progress`]: {
|
|
64
99
|
[`${componentCls}-content`]: {
|
|
65
|
-
padding:
|
|
100
|
+
padding: token.paddingLG,
|
|
101
|
+
[`${componentCls}-close`]: {
|
|
102
|
+
marginTop: token.marginSM,
|
|
103
|
+
marginRight: token.marginXXS
|
|
104
|
+
},
|
|
66
105
|
[`${componentCls}-header`]: {
|
|
67
106
|
textAlign: "center",
|
|
68
107
|
marginBottom: token.marginXXL,
|
|
69
108
|
[`${componentCls}-title`]: {
|
|
70
|
-
fontSize:
|
|
109
|
+
fontSize: fontSizeHeading3
|
|
71
110
|
}
|
|
72
111
|
},
|
|
73
112
|
[`${componentCls}-body`]: {
|
|
@@ -86,18 +125,39 @@ var genModalStyle = (token) => {
|
|
|
86
125
|
}
|
|
87
126
|
},
|
|
88
127
|
[`${componentCls}-footer`]: {
|
|
89
|
-
textAlign: "center"
|
|
128
|
+
textAlign: "center",
|
|
129
|
+
[`${antCls}-btn`]: {
|
|
130
|
+
height: 28,
|
|
131
|
+
minHeight: 28
|
|
132
|
+
}
|
|
90
133
|
}
|
|
91
134
|
}
|
|
92
135
|
},
|
|
93
136
|
/* Modal.method() */
|
|
94
137
|
[`${componentCls}-confirm`]: {
|
|
95
|
-
[`${componentCls}-
|
|
96
|
-
|
|
97
|
-
color: token.colorTextSecondary
|
|
138
|
+
[`${componentCls}-content`]: {
|
|
139
|
+
padding: token.paddingLG
|
|
98
140
|
},
|
|
99
|
-
[`${componentCls}-
|
|
100
|
-
|
|
141
|
+
[`${componentCls}-body`]: {
|
|
142
|
+
[`${componentCls}-confirm-title`]: {
|
|
143
|
+
fontSize: fontSizeHeading3
|
|
144
|
+
},
|
|
145
|
+
[`${componentCls}-confirm-body > ${token.iconCls}`]: {
|
|
146
|
+
height: calc(token.fontSizeHeading3).mul(token.lineHeight).equal()
|
|
147
|
+
},
|
|
148
|
+
[`${componentCls}-confirm-paragraph`]: {
|
|
149
|
+
rowGap: token.marginSM
|
|
150
|
+
},
|
|
151
|
+
[`${componentCls}-confirm-content`]: {
|
|
152
|
+
color: token.colorTextSecondary
|
|
153
|
+
},
|
|
154
|
+
[`${componentCls}-confirm-btns`]: {
|
|
155
|
+
marginTop: marginLG,
|
|
156
|
+
[`${antCls}-btn`]: {
|
|
157
|
+
height: 28,
|
|
158
|
+
minHeight: 28
|
|
159
|
+
}
|
|
160
|
+
}
|
|
101
161
|
}
|
|
102
162
|
}
|
|
103
163
|
};
|
package/lib/radio/style/index.js
CHANGED
|
@@ -25,13 +25,14 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genRadioStyle = (token) => {
|
|
28
|
-
const { componentCls, radioSize, fontSize, fontSizeLG, lineHeight } = token;
|
|
28
|
+
const { componentCls, radioSize, fontSize, fontSizeLG, lineHeight, calc } = token;
|
|
29
|
+
const marginBottom = calc(calc(fontSize).mul(lineHeight).equal()).sub(radioSize || fontSizeLG).div(-2).equal();
|
|
29
30
|
return {
|
|
30
31
|
[`${componentCls}-wrapper`]: {
|
|
31
32
|
[`${componentCls}`]: {
|
|
32
33
|
alignSelf: "baseline",
|
|
33
34
|
[`${componentCls}-inner`]: {
|
|
34
|
-
marginBottom
|
|
35
|
+
marginBottom
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -23,21 +23,22 @@ __export(style_exports, {
|
|
|
23
23
|
genSliderStyle: () => genSliderStyle
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
|
-
var import_lodash = require("lodash");
|
|
27
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
28
27
|
var genSliderStyle = (token) => {
|
|
29
|
-
const { componentCls, dotSize = 8, handleSize = 10, handleLineWidth = 2 } = token;
|
|
28
|
+
const { componentCls, dotSize = 8, handleSize = 10, handleLineWidth = 2, calc } = token;
|
|
29
|
+
const dotSizeHalf = calc(dotSize).div(2).equal();
|
|
30
|
+
const handleOffset = calc(handleSize).add(calc(handleLineWidth).mul(2).equal()).div(2).equal();
|
|
30
31
|
return {
|
|
31
32
|
[`${componentCls}${componentCls}-horizontal`]: {
|
|
32
33
|
[`${componentCls}-mark`]: {
|
|
33
34
|
[`${componentCls}-mark-text[style*="left: 0%;"]`]: {
|
|
34
|
-
transform: `translateX(calc(0% - ${
|
|
35
|
+
transform: `translateX(calc(0% - ${dotSizeHalf})) !important`
|
|
35
36
|
},
|
|
36
37
|
[`${componentCls}-mark-text[style*="left: 100%;"]`]: {
|
|
37
|
-
transform: `translateX(calc(-100% + ${
|
|
38
|
+
transform: `translateX(calc(-100% + ${dotSizeHalf})) !important`
|
|
38
39
|
},
|
|
39
40
|
[`${componentCls}-mark-text[style="transform: translateX(-50%);"]`]: {
|
|
40
|
-
transform: `translateX(calc(0% - ${
|
|
41
|
+
transform: `translateX(calc(0% - ${handleOffset})) !important`
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
}
|
package/lib/spin/style/index.js
CHANGED
|
@@ -25,9 +25,9 @@ __export(style_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(style_exports);
|
|
26
26
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
27
27
|
var genSizeStyle = (spinDotSize, token) => {
|
|
28
|
-
const { componentCls, colorText } = token;
|
|
28
|
+
const { componentCls, colorText, calc } = token;
|
|
29
29
|
const spinDotWidth = spinDotSize;
|
|
30
|
-
const spinDotHight = spinDotWidth
|
|
30
|
+
const spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
|
|
31
31
|
return {
|
|
32
32
|
// only work for oceanbase indicator
|
|
33
33
|
[`&${componentCls}-oceanbase`]: {
|
|
@@ -43,12 +43,12 @@ var genSizeStyle = (spinDotSize, token) => {
|
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
var genNestedSizeStyle = (spinDotSize, token) => {
|
|
46
|
-
const { componentCls, fontSize } = token;
|
|
46
|
+
const { componentCls, fontSize, calc } = token;
|
|
47
47
|
const spinDotWidth = spinDotSize;
|
|
48
|
-
const spinDotHight = spinDotWidth
|
|
49
|
-
const dotMarginLeft = -
|
|
50
|
-
const dotMarginTop = -
|
|
51
|
-
const textPaddingTop = (spinDotHight
|
|
48
|
+
const spinDotHight = calc(spinDotWidth).mul(295).div(397).equal();
|
|
49
|
+
const dotMarginLeft = calc(spinDotWidth).div(-2).equal();
|
|
50
|
+
const dotMarginTop = calc(spinDotHight).div(-2).equal();
|
|
51
|
+
const textPaddingTop = calc(spinDotHight).sub(fontSize).div(2).add(2).equal();
|
|
52
52
|
return {
|
|
53
53
|
// only work for oceanbase indicator
|
|
54
54
|
// `& > ${componentCls}-oceanbase` is compatible with double .ant-spin like Table loading
|
|
@@ -61,7 +61,7 @@ var genNestedSizeStyle = (spinDotSize, token) => {
|
|
|
61
61
|
paddingTop: textPaddingTop
|
|
62
62
|
},
|
|
63
63
|
[`&${componentCls}-show-text ${componentCls}-dot`]: {
|
|
64
|
-
marginTop: dotMarginTop
|
|
64
|
+
marginTop: calc(dotMarginTop).sub(10).equal()
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
@@ -85,6 +85,7 @@ var genSpinStyle = (token) => {
|
|
|
85
85
|
};
|
|
86
86
|
var style_default = (prefixCls) => {
|
|
87
87
|
const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Spin", (token) => {
|
|
88
|
+
const { calc } = token;
|
|
88
89
|
return [
|
|
89
90
|
genSpinStyle({
|
|
90
91
|
...token,
|
|
@@ -92,11 +93,11 @@ var style_default = (prefixCls) => {
|
|
|
92
93
|
// spinDotSize: (token.controlHeightLG / 2) * ratio,
|
|
93
94
|
// spinDotSizeSM: token.controlHeightLG * 0.35 * ratio,
|
|
94
95
|
// spinDotSizeLG: token.controlHeight * ratio,
|
|
95
|
-
spinDotSize: token.controlHeight
|
|
96
|
+
spinDotSize: calc(token.controlHeight).mul(1.75).equal(),
|
|
96
97
|
// 56,
|
|
97
|
-
spinDotSizeSM: token.controlHeight
|
|
98
|
+
spinDotSizeSM: calc(token.controlHeight).mul(1.125).equal(),
|
|
98
99
|
// 36
|
|
99
|
-
spinDotSizeLG: token.controlHeight
|
|
100
|
+
spinDotSizeLG: calc(token.controlHeight).mul(2.25).equal()
|
|
100
101
|
// 72
|
|
101
102
|
})
|
|
102
103
|
];
|
|
@@ -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,
|