@oceanbase/design 1.0.0-alpha.4 → 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.js +3 -0
- package/es/alert/style/index.js +10 -9
- package/es/card/style/index.js +7 -5
- package/es/checkbox/style/index.js +4 -2
- package/es/descriptions/style/index.js +3 -2
- package/es/drawer/style/index.js +7 -5
- package/es/empty/style/index.js +6 -4
- package/es/form/style/index.js +3 -2
- package/es/modal/style/index.js +7 -6
- 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/table/style/index.js +17 -16
- package/es/typography/style/index.js +25 -20
- package/lib/alert/index.js +2 -0
- package/lib/alert/style/index.js +9 -9
- package/lib/card/style/index.js +6 -5
- package/lib/checkbox/style/index.js +3 -2
- package/lib/descriptions/style/index.js +2 -2
- package/lib/drawer/style/index.js +6 -5
- package/lib/empty/style/index.js +5 -4
- package/lib/form/style/index.js +2 -2
- package/lib/modal/style/index.js +7 -6
- 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/table/style/index.js +17 -16
- package/lib/typography/style/index.js +24 -20
- package/package.json +2 -3
package/lib/alert/style/index.js
CHANGED
|
@@ -54,10 +54,10 @@ var genAlertTypeStyle = (type, token) => {
|
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
var genAlertStyle = (token) => {
|
|
57
|
-
const { componentCls, colorIcon, colorIconHover, motionDurationMid } = token;
|
|
58
|
-
const height = token.fontSize
|
|
57
|
+
const { componentCls, colorIcon, colorIconHover, motionDurationMid, calc } = token;
|
|
58
|
+
const height = calc(token.fontSize).mul(token.lineHeight).equal();
|
|
59
59
|
const iconWidth = token.fontSizeLG;
|
|
60
|
-
const contentStartOffset = iconWidth
|
|
60
|
+
const contentStartOffset = calc(iconWidth).add(token.marginXS).equal();
|
|
61
61
|
const closeIconWidth = height;
|
|
62
62
|
return {
|
|
63
63
|
[`${componentCls}`]: {
|
|
@@ -104,13 +104,13 @@ var genAlertStyle = (token) => {
|
|
|
104
104
|
[`${componentCls}:not(${componentCls}-with-description)`]: {
|
|
105
105
|
flexWrap: "wrap",
|
|
106
106
|
[`${componentCls}-content`]: {
|
|
107
|
-
flex: `1 1 calc(100%
|
|
107
|
+
flex: `1 1 ${calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()}`,
|
|
108
108
|
minWidth: 0,
|
|
109
|
-
maxWidth:
|
|
109
|
+
maxWidth: calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
|
|
110
110
|
wordBreak: "break-word"
|
|
111
111
|
},
|
|
112
112
|
[`${componentCls}-action`]: {
|
|
113
|
-
width:
|
|
113
|
+
width: calc("100%").sub(contentStartOffset).sub(token.padding).equal(),
|
|
114
114
|
marginInlineStart: contentStartOffset,
|
|
115
115
|
marginTop: token.marginXS
|
|
116
116
|
}
|
|
@@ -128,13 +128,13 @@ var genAlertStyle = (token) => {
|
|
|
128
128
|
wordBreak: "break-word"
|
|
129
129
|
},
|
|
130
130
|
[`${componentCls}-content`]: {
|
|
131
|
-
flex: `1 1 calc(100%
|
|
131
|
+
flex: `1 1 ${calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal()}`,
|
|
132
132
|
minWidth: 0,
|
|
133
|
-
maxWidth:
|
|
133
|
+
maxWidth: calc("100%").sub(contentStartOffset).sub(closeIconWidth).sub(token.padding).equal(),
|
|
134
134
|
wordBreak: "break-word"
|
|
135
135
|
},
|
|
136
136
|
[`${componentCls}-action`]: {
|
|
137
|
-
width:
|
|
137
|
+
width: calc("100%").sub(contentStartOffset).sub(token.padding).equal(),
|
|
138
138
|
marginInlineStart: contentStartOffset,
|
|
139
139
|
marginTop: token.marginSM
|
|
140
140
|
},
|
package/lib/card/style/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(style_exports, {
|
|
|
24
24
|
genTableStyle: () => genTableStyle
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(style_exports);
|
|
27
|
+
var import_cssinjs = require("@ant-design/cssinjs");
|
|
27
28
|
var import_style = require("../../tabs/style");
|
|
28
29
|
var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
|
|
29
30
|
var genTableStyle = (padding, token) => {
|
|
@@ -55,7 +56,7 @@ var genTableStyle = (padding, token) => {
|
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
58
|
var genCardStyle = (token) => {
|
|
58
|
-
const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG } = token;
|
|
59
|
+
const { componentCls, antCls, tabsComponentCls, tabsPrefixCls, paddingSM, paddingLG, calc } = token;
|
|
59
60
|
const tableComponentCls = `${antCls}-table`;
|
|
60
61
|
return {
|
|
61
62
|
[`${componentCls}`]: {
|
|
@@ -68,7 +69,7 @@ var genCardStyle = (token) => {
|
|
|
68
69
|
},
|
|
69
70
|
// nested and bordered Card radius
|
|
70
71
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
71
|
-
borderRadius: token.borderRadiusLG
|
|
72
|
+
borderRadius: calc(token.borderRadiusLG).sub(2).equal(),
|
|
72
73
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
73
74
|
borderRadius: token.borderRadius,
|
|
74
75
|
[`${componentCls}${componentCls}-bordered`]: {
|
|
@@ -95,7 +96,7 @@ var genCardStyle = (token) => {
|
|
|
95
96
|
},
|
|
96
97
|
[`${componentCls}${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
97
98
|
[`${componentCls}-body`]: {
|
|
98
|
-
padding: `0 ${paddingLG}
|
|
99
|
+
padding: `0 ${(0, import_cssinjs.unit)(paddingLG)} ${(0, import_cssinjs.unit)(paddingLG)} ${(0, import_cssinjs.unit)(paddingLG)}`
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
[`${componentCls}-small`]: {
|
|
@@ -105,7 +106,7 @@ var genCardStyle = (token) => {
|
|
|
105
106
|
},
|
|
106
107
|
[`${componentCls}-small${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
107
108
|
[`${componentCls}-body`]: {
|
|
108
|
-
padding: `0 ${paddingSM}
|
|
109
|
+
padding: `0 ${(0, import_cssinjs.unit)(paddingSM)} ${(0, import_cssinjs.unit)(paddingSM)} ${(0, import_cssinjs.unit)(paddingSM)}`
|
|
109
110
|
}
|
|
110
111
|
},
|
|
111
112
|
[`${componentCls}-small${componentCls}-contain-tabs >${componentCls}-head`]: {
|
|
@@ -145,7 +146,7 @@ var genCardStyle = (token) => {
|
|
|
145
146
|
[`&${componentCls}-has-title${componentCls}-no-divider:not(${componentCls}-contain-tabs)`]: {
|
|
146
147
|
[`${componentCls}-body`]: {
|
|
147
148
|
[`& > ${tableComponentCls}-wrapper ${tableComponentCls}:not(${tableComponentCls}-bordered):first-child`]: {
|
|
148
|
-
marginTop:
|
|
149
|
+
marginTop: calc(token.marginSM).mul(-1).equal()
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
},
|
|
@@ -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 genCheckboxStyle = (token) => {
|
|
28
|
-
const { componentCls, fontSize, fontSizeLG, lineHeight } = token;
|
|
28
|
+
const { componentCls, fontSize, fontSizeLG, lineHeight, calc } = token;
|
|
29
|
+
const translateY = calc(calc(fontSize).mul(lineHeight).equal()).sub(fontSizeLG).div(2).equal();
|
|
29
30
|
return {
|
|
30
31
|
[`${componentCls}-wrapper`]: {
|
|
31
32
|
[`${componentCls}`]: {
|
|
32
33
|
alignSelf: "baseline",
|
|
33
34
|
[`${componentCls}-inner`]: {
|
|
34
|
-
transform: `translate(0px, ${
|
|
35
|
+
transform: `translate(0px, ${translateY})`
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -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,9 +23,10 @@ __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, fontSizeHeading3, colorSplit } = token;
|
|
29
|
+
const { componentCls, antCls, fontSizeHeading3, colorSplit, calc } = token;
|
|
29
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)";
|
|
@@ -35,7 +36,7 @@ var genDrawerStyle = (token) => {
|
|
|
35
36
|
[`${componentCls}-content`]: {
|
|
36
37
|
[`${componentCls}-header`]: {
|
|
37
38
|
position: "relative",
|
|
38
|
-
padding: `${token.padding}
|
|
39
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
39
40
|
borderBottom: "none",
|
|
40
41
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
41
42
|
// ensure header box-shadow cover body content
|
|
@@ -53,8 +54,8 @@ var genDrawerStyle = (token) => {
|
|
|
53
54
|
height: "1px",
|
|
54
55
|
backgroundColor: colorSplit,
|
|
55
56
|
// 使用负margin让分割线贯通到content边缘
|
|
56
|
-
marginLeft:
|
|
57
|
-
marginRight:
|
|
57
|
+
marginLeft: calc(token.paddingLG).mul(-1).equal(),
|
|
58
|
+
marginRight: calc(token.paddingLG).mul(-1).equal()
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
[`${componentCls}-header-shadow`]: {
|
|
@@ -71,7 +72,7 @@ var genDrawerStyle = (token) => {
|
|
|
71
72
|
},
|
|
72
73
|
[`${componentCls}-footer-container`]: {
|
|
73
74
|
position: "sticky",
|
|
74
|
-
padding: `${token.padding}
|
|
75
|
+
padding: `${(0, import_cssinjs.unit)(token.padding)} ${(0, import_cssinjs.unit)(token.paddingLG)}`,
|
|
75
76
|
transition: `box-shadow ${token.motionDurationMid}`,
|
|
76
77
|
// ensure footer box-shadow cover body content
|
|
77
78
|
zIndex: 10,
|
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/style/index.js
CHANGED
|
@@ -25,7 +25,7 @@ __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
30
|
[componentCls]: {
|
|
31
31
|
[`${componentCls}-item-extra`]: {
|
|
@@ -51,7 +51,7 @@ var genFormStyle = (token) => {
|
|
|
51
51
|
paddingBottom: token.paddingXXS
|
|
52
52
|
},
|
|
53
53
|
[`${componentCls}-item-description`]: {
|
|
54
|
-
paddingBottom: token.paddingXXS
|
|
54
|
+
paddingBottom: calc(token.paddingXXS).add(2).equal(),
|
|
55
55
|
fontSize: token.fontSizeSM,
|
|
56
56
|
color: token.colorTextDescription
|
|
57
57
|
}
|
package/lib/modal/style/index.js
CHANGED
|
@@ -32,11 +32,12 @@ var genModalStyle = (token) => {
|
|
|
32
32
|
fontSizeHeading5,
|
|
33
33
|
lineHeightHeading5,
|
|
34
34
|
fontSizeHeading3,
|
|
35
|
-
colorSplit
|
|
35
|
+
colorSplit,
|
|
36
|
+
calc
|
|
36
37
|
} = token;
|
|
37
38
|
const top = 100;
|
|
38
39
|
const bottom = 100;
|
|
39
|
-
const titleHeight = fontSizeHeading5
|
|
40
|
+
const titleHeight = calc(fontSizeHeading5).mul(lineHeightHeading5).equal();
|
|
40
41
|
return {
|
|
41
42
|
/* Modal */
|
|
42
43
|
[`${componentCls}:not(${componentCls}-confirm):not(${componentCls}-progress)`]: {
|
|
@@ -64,13 +65,13 @@ var genModalStyle = (token) => {
|
|
|
64
65
|
backgroundColor: colorSplit,
|
|
65
66
|
// antd Modal content默认padding通常是24px,使用负margin让分割线贯通
|
|
66
67
|
// 如果antd使用其他padding值,可能需要调整
|
|
67
|
-
marginLeft:
|
|
68
|
-
marginRight:
|
|
68
|
+
marginLeft: calc(token.paddingLG).mul(-1).equal(),
|
|
69
|
+
marginRight: calc(token.paddingLG).mul(-1).equal()
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
[`${componentCls}-body`]: {
|
|
72
73
|
paddingTop: token.paddingLG,
|
|
73
|
-
marginInline:
|
|
74
|
+
marginInline: calc(token.marginLG).mul(-1).equal(),
|
|
74
75
|
paddingInline: token.paddingLG
|
|
75
76
|
}
|
|
76
77
|
},
|
|
@@ -142,7 +143,7 @@ var genModalStyle = (token) => {
|
|
|
142
143
|
fontSize: fontSizeHeading3
|
|
143
144
|
},
|
|
144
145
|
[`${componentCls}-confirm-body > ${token.iconCls}`]: {
|
|
145
|
-
height: token.fontSizeHeading3
|
|
146
|
+
height: calc(token.fontSizeHeading3).mul(token.lineHeight).equal()
|
|
146
147
|
},
|
|
147
148
|
[`${componentCls}-confirm-paragraph`]: {
|
|
148
149
|
rowGap: token.marginSM
|
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
|
];
|
package/lib/table/style/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(style_exports, {
|
|
|
23
23
|
genTableStyle: () => genTableStyle
|
|
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 genTableStyle = (token) => {
|
|
28
29
|
const {
|
|
@@ -38,9 +39,9 @@ var genTableStyle = (token) => {
|
|
|
38
39
|
colorBorderSecondary,
|
|
39
40
|
padding,
|
|
40
41
|
marginLG,
|
|
41
|
-
marginXS
|
|
42
|
+
marginXS,
|
|
43
|
+
calc
|
|
42
44
|
} = token;
|
|
43
|
-
console.log(token.fontWeight);
|
|
44
45
|
return {
|
|
45
46
|
// 表格通用样式
|
|
46
47
|
[`${componentCls}-wrapper ${componentCls}`]: {
|
|
@@ -93,7 +94,7 @@ var genTableStyle = (token) => {
|
|
|
93
94
|
// empty style
|
|
94
95
|
[`${componentCls}-placeholder td`]: {},
|
|
95
96
|
[`${componentCls}-empty-wrapper`]: {
|
|
96
|
-
minHeight: 360
|
|
97
|
+
minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
|
|
97
98
|
display: "flex",
|
|
98
99
|
justifyContent: "center",
|
|
99
100
|
alignItems: "center"
|
|
@@ -123,7 +124,7 @@ var genTableStyle = (token) => {
|
|
|
123
124
|
[`${componentCls}-wrapper ${componentCls}${componentCls}-middle`]: {
|
|
124
125
|
[`${componentCls}-tbody`]: {
|
|
125
126
|
[`${componentCls}-empty-wrapper`]: {
|
|
126
|
-
minHeight: 260
|
|
127
|
+
minHeight: calc(260).sub(calc(token.paddingXS).mul(2).equal()).equal()
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
},
|
|
@@ -131,14 +132,14 @@ var genTableStyle = (token) => {
|
|
|
131
132
|
[`${componentCls}-wrapper ${componentCls}${componentCls}-small`]: {
|
|
132
133
|
[`${componentCls}-tbody`]: {
|
|
133
134
|
[`${componentCls}-empty-wrapper`]: {
|
|
134
|
-
minHeight: 160
|
|
135
|
+
minHeight: calc(160).sub(calc(token.paddingXXS).mul(2).equal()).equal()
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
},
|
|
138
139
|
// 带边框的表格样式
|
|
139
140
|
[`${componentCls}-wrapper ${componentCls}${componentCls}-bordered`]: {
|
|
140
141
|
[`${componentCls}-footer`]: {
|
|
141
|
-
borderRadius: `0px 0px ${token.borderRadiusLG}
|
|
142
|
+
borderRadius: `0px 0px ${(0, import_cssinjs.unit)(token.borderRadiusLG)} ${(0, import_cssinjs.unit)(token.borderRadiusLG)}`
|
|
142
143
|
}
|
|
143
144
|
},
|
|
144
145
|
// 带内部边框的表格样式
|
|
@@ -201,15 +202,15 @@ var genTableStyle = (token) => {
|
|
|
201
202
|
[`${componentCls}-expanded-row > td`]: {
|
|
202
203
|
// 除内嵌子表格外,设置其他内嵌元素样式
|
|
203
204
|
[`& > *:not(${componentCls}-wrapper):not(${componentCls}-expanded-row-fixed)`]: {
|
|
204
|
-
marginLeft: token.marginXL
|
|
205
|
+
marginLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
205
206
|
},
|
|
206
207
|
[`& > *${componentCls}-expanded-row-fixed`]: {
|
|
207
|
-
paddingLeft: token.marginXL
|
|
208
|
+
paddingLeft: calc(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
|
|
208
209
|
}
|
|
209
210
|
},
|
|
210
211
|
// 嵌套子表格和父表格第一列对齐
|
|
211
212
|
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
212
|
-
marginLeft: token.margin
|
|
213
|
+
marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
},
|
|
@@ -217,7 +218,7 @@ var genTableStyle = (token) => {
|
|
|
217
218
|
[`${componentCls}-tbody`]: {
|
|
218
219
|
// 嵌套子表格和父表格第一列对齐
|
|
219
220
|
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
220
|
-
marginLeft: token.margin
|
|
221
|
+
marginLeft: calc(token.margin).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
}
|
|
@@ -229,15 +230,15 @@ var genTableStyle = (token) => {
|
|
|
229
230
|
[`${componentCls}-expanded-row > td`]: {
|
|
230
231
|
// 除内嵌子表格外,设置其他内嵌元素样式
|
|
231
232
|
[`& > *:not(${componentCls}-wrapper):not(${componentCls}-expanded-row-fixed)`]: {
|
|
232
|
-
marginLeft: token.marginXL
|
|
233
|
+
marginLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
233
234
|
},
|
|
234
235
|
[`& > *${componentCls}-expanded-row-fixed`]: {
|
|
235
|
-
paddingLeft: token.marginXL
|
|
236
|
+
paddingLeft: calc(token.marginXL).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.padding).equal()
|
|
236
237
|
}
|
|
237
238
|
},
|
|
238
239
|
// 嵌套子表格和父表格第一列对齐
|
|
239
240
|
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
240
|
-
marginLeft: token.margin
|
|
241
|
+
marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).equal()
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
},
|
|
@@ -245,7 +246,7 @@ var genTableStyle = (token) => {
|
|
|
245
246
|
[`${componentCls}-tbody`]: {
|
|
246
247
|
// 嵌套子表格和父表格第一列对齐
|
|
247
248
|
[`tr > td > ${componentCls}-wrapper:only-child ${componentCls}`]: {
|
|
248
|
-
marginLeft: token.margin
|
|
249
|
+
marginLeft: calc(token.margin).add(token.marginXL).add(calc(token.lineWidth).mul(2).equal()).add(token.margin).equal()
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
}
|
|
@@ -263,7 +264,7 @@ var genTableStyle = (token) => {
|
|
|
263
264
|
[`${componentCls}-wrapper`]: {
|
|
264
265
|
[`${componentCls}-pagination`]: {
|
|
265
266
|
[`&${antCls}-pagination`]: {
|
|
266
|
-
padding: `${padding}
|
|
267
|
+
padding: `${(0, import_cssinjs.unit)(padding)} 0`,
|
|
267
268
|
margin: "0 !important"
|
|
268
269
|
},
|
|
269
270
|
// 批量操作栏样式
|
|
@@ -276,7 +277,7 @@ var genTableStyle = (token) => {
|
|
|
276
277
|
color: colorTextSecondary,
|
|
277
278
|
fontWeight: token.fontWeightStrong,
|
|
278
279
|
[`${componentCls}-batch-operation-selection-count`]: {
|
|
279
|
-
margin: `0 ${marginXS}
|
|
280
|
+
margin: `0 ${(0, import_cssinjs.unit)(marginXS)}`,
|
|
280
281
|
color: colorLink
|
|
281
282
|
}
|
|
282
283
|
}
|
|
@@ -23,10 +23,14 @@ __export(style_exports, {
|
|
|
23
23
|
genTypographyStyle: () => genTypographyStyle
|
|
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 genTypographyStyle = (token) => {
|
|
28
|
-
const { componentCls, controlHeight, fontSize, lineHeight } = token;
|
|
29
|
-
const marginOffset = (controlHeight
|
|
29
|
+
const { componentCls, controlHeight, fontSize, lineHeight, calc } = token;
|
|
30
|
+
const marginOffset = calc(controlHeight).sub(calc(fontSize).mul(lineHeight).equal()).div(2).equal();
|
|
31
|
+
const paddingTop = calc(marginOffset).sub(token.lineWidth).equal();
|
|
32
|
+
const paddingInline = calc(token.paddingSM).sub(token.lineWidth).equal();
|
|
33
|
+
const negativeMarginOffset = calc(marginOffset).mul(-1).equal();
|
|
30
34
|
return {
|
|
31
35
|
// inherit color and lineHeight from parent instead of fixed colorText
|
|
32
36
|
[`${componentCls}`]: {
|
|
@@ -40,43 +44,43 @@ var genTypographyStyle = (token) => {
|
|
|
40
44
|
[`${componentCls}${componentCls}-editable-text:not(${componentCls}-edit-content)`]: {
|
|
41
45
|
"&:hover": {
|
|
42
46
|
background: token.colorBgContainer,
|
|
43
|
-
border: `${token.lineWidth}
|
|
47
|
+
border: `${(0, import_cssinjs.unit)(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
|
|
44
48
|
borderRadius: token.borderRadius,
|
|
45
49
|
position: "relative",
|
|
46
|
-
insetInlineStart:
|
|
47
|
-
padding: `${
|
|
50
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
51
|
+
padding: `${paddingTop} ${paddingInline}`
|
|
48
52
|
},
|
|
49
53
|
"div&:hover": {
|
|
50
54
|
height: token.controlHeight,
|
|
51
|
-
marginTop:
|
|
52
|
-
marginBottom:
|
|
55
|
+
marginTop: negativeMarginOffset,
|
|
56
|
+
marginBottom: calc("1em").sub(marginOffset).equal()
|
|
53
57
|
},
|
|
54
58
|
"span&:hover": {
|
|
55
59
|
display: "inline-block",
|
|
56
60
|
height: token.controlHeight,
|
|
57
|
-
marginTop:
|
|
58
|
-
marginBottom:
|
|
61
|
+
marginTop: negativeMarginOffset,
|
|
62
|
+
marginBottom: negativeMarginOffset
|
|
59
63
|
},
|
|
60
64
|
"h1&:hover, h2&:hover, h3&:hover, h4&:hover, h5&:hover": {
|
|
61
|
-
marginTop: `${
|
|
62
|
-
marginBottom: `${
|
|
65
|
+
marginTop: `${negativeMarginOffset} !important`,
|
|
66
|
+
marginBottom: `${negativeMarginOffset} !important`
|
|
63
67
|
}
|
|
64
68
|
},
|
|
65
69
|
[`${componentCls}${componentCls}-edit-content`]: {
|
|
66
70
|
[`${componentCls}-div&`]: {
|
|
67
|
-
insetInlineStart:
|
|
68
|
-
marginTop:
|
|
69
|
-
marginBottom:
|
|
71
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
72
|
+
marginTop: negativeMarginOffset,
|
|
73
|
+
marginBottom: calc("1em").sub(marginOffset).equal()
|
|
70
74
|
},
|
|
71
75
|
[`${componentCls}-span&`]: {
|
|
72
|
-
insetInlineStart:
|
|
73
|
-
marginTop:
|
|
74
|
-
marginBottom:
|
|
76
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
77
|
+
marginTop: negativeMarginOffset,
|
|
78
|
+
marginBottom: negativeMarginOffset
|
|
75
79
|
},
|
|
76
80
|
[`${componentCls}-h1&, ${componentCls}-h2&, ${componentCls}-h3&, ${componentCls}-h4&, ${componentCls}-h5&`]: {
|
|
77
|
-
insetInlineStart:
|
|
78
|
-
marginTop: `${
|
|
79
|
-
marginBottom: `${
|
|
81
|
+
insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
|
|
82
|
+
marginTop: `${negativeMarginOffset} !important`,
|
|
83
|
+
marginBottom: `${negativeMarginOffset} !important`
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oceanbase/design",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "The Design System of OceanBase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oceanbase",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"LICENSE"
|
|
32
32
|
],
|
|
33
33
|
"sideEffects": [
|
|
34
|
-
"**/*.less",
|
|
35
34
|
"**/*.css"
|
|
36
35
|
],
|
|
37
36
|
"scripts": {
|
|
@@ -66,5 +65,5 @@
|
|
|
66
65
|
"react": ">=16.9.0",
|
|
67
66
|
"react-dom": ">=16.9.0"
|
|
68
67
|
},
|
|
69
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "c716061dd0da7a44ab09515d43972d2212e59d0f"
|
|
70
69
|
}
|