@kdcloudjs/kdesign 1.0.4 → 1.1.0
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/kdesign-complete.less +77 -59
- package/dist/kdesign.css +64 -60
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +30 -46
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +6 -6
- package/dist/kdesign.min.js.map +1 -1
- package/es/anchor/style/index.css +5 -0
- package/es/anchor/style/index.less +5 -0
- package/es/button/style/index.css +4 -4
- package/es/button/style/index.less +1 -1
- package/es/button/style/token.less +9 -9
- package/es/card/card.d.ts +1 -0
- package/es/card/card.js +4 -1
- package/es/card/style/index.css +16 -0
- package/es/card/style/index.less +19 -0
- package/es/config-provider/compDefaultProps.d.ts +0 -1
- package/es/config-provider/compDefaultProps.js +1 -2
- package/es/drawer/drawer.d.ts +0 -1
- package/es/drawer/drawer.js +6 -26
- package/es/drawer/style/index.css +8 -11
- package/es/drawer/style/index.less +7 -9
- package/es/drawer/style/token.less +3 -1
- package/es/dropdown/dropdown.d.ts +1 -0
- package/es/dropdown/dropdown.js +9 -6
- package/es/dropdown/menu.d.ts +1 -1
- package/es/dropdown/menu.js +3 -3
- package/es/menu/menuItem.js +1 -2
- package/es/notification/content.js +1 -1
- package/es/notification/style/index.css +1 -1
- package/es/notification/style/index.less +1 -1
- package/es/pagination/pagination.js +2 -2
- package/es/split-panel/style/index.css +24 -42
- package/es/split-panel/style/index.less +14 -33
- package/es/split-panel/style/token.less +15 -4
- package/es/transfer/operation.js +2 -2
- package/es/transfer/style/index.css +5 -1
- package/es/transfer/style/index.less +4 -0
- package/es/transfer/style/token.less +1 -1
- package/lib/anchor/style/index.css +5 -0
- package/lib/anchor/style/index.less +5 -0
- package/lib/button/style/index.css +4 -4
- package/lib/button/style/index.less +1 -1
- package/lib/button/style/token.less +9 -9
- package/lib/card/card.d.ts +1 -0
- package/lib/card/card.js +4 -1
- package/lib/card/style/index.css +16 -0
- package/lib/card/style/index.less +19 -0
- package/lib/config-provider/compDefaultProps.d.ts +0 -1
- package/lib/config-provider/compDefaultProps.js +1 -2
- package/lib/drawer/drawer.d.ts +0 -1
- package/lib/drawer/drawer.js +6 -26
- package/lib/drawer/style/index.css +8 -11
- package/lib/drawer/style/index.less +7 -9
- package/lib/drawer/style/token.less +3 -1
- package/lib/dropdown/dropdown.d.ts +1 -0
- package/lib/dropdown/dropdown.js +9 -6
- package/lib/dropdown/menu.d.ts +1 -1
- package/lib/dropdown/menu.js +3 -3
- package/lib/menu/menuItem.js +1 -2
- package/lib/notification/content.js +1 -1
- package/lib/notification/style/index.css +1 -1
- package/lib/notification/style/index.less +1 -1
- package/lib/pagination/pagination.js +2 -2
- package/lib/split-panel/style/index.css +24 -42
- package/lib/split-panel/style/index.less +14 -33
- package/lib/split-panel/style/token.less +15 -4
- package/lib/transfer/operation.js +2 -2
- package/lib/transfer/style/index.css +5 -1
- package/lib/transfer/style/index.less +4 -0
- package/lib/transfer/style/token.less +1 -1
- package/package.json +1 -1
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
margin-right: 10px;
|
|
132
132
|
font-size: var(--kd-c-anchor-icon-font-size, 16px);
|
|
133
133
|
color: #666;
|
|
134
|
+
cursor: pointer;
|
|
134
135
|
}
|
|
135
136
|
.kd-anchor-menu-left-arrows:hover:not(.kd-anchor-menu-left-arrows-disabled) {
|
|
136
137
|
color: var(--kd-c-anchor-color-theme, var(--kd-g-color-theme, #5582f3));
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
margin-left: 10px;
|
|
144
145
|
font-size: var(--kd-c-anchor-icon-font-size, 16px);
|
|
145
146
|
color: #666;
|
|
147
|
+
cursor: pointer;
|
|
146
148
|
}
|
|
147
149
|
.kd-anchor-menu-right-arrows:hover:not(.kd-anchor-menu-right-arrows-disabled) {
|
|
148
150
|
color: var(--kd-c-anchor-color-theme, var(--kd-g-color-theme, #5582f3));
|
|
@@ -193,6 +195,7 @@
|
|
|
193
195
|
.kd-anchor-advanced-arrows {
|
|
194
196
|
color: var(--kd-c-anchor-advanced-arrows-color-text, #666);
|
|
195
197
|
font-size: var(--kd-c-anchor-icon-font-size, 16px);
|
|
198
|
+
cursor: pointer;
|
|
196
199
|
}
|
|
197
200
|
.kd-anchor-advanced-arrows:hover {
|
|
198
201
|
color: var(--kd-c-anchor-color-theme, var(--kd-g-color-theme, #5582f3));
|
|
@@ -219,6 +222,7 @@
|
|
|
219
222
|
padding: 0 8px 8px 0;
|
|
220
223
|
font-size: var(--kd-c-anchor-advanced-lock-font-size, 16px);
|
|
221
224
|
color: var(--kd-c-anchor-advanced-arrows-color-text, #666);
|
|
225
|
+
cursor: pointer;
|
|
222
226
|
}
|
|
223
227
|
.kd-anchor-advanced .kd-anchor {
|
|
224
228
|
max-width: var(--kd-c-anchor-advanced-sizing-width, 160px);
|
|
@@ -262,6 +266,7 @@
|
|
|
262
266
|
white-space: nowrap;
|
|
263
267
|
text-overflow: ellipsis;
|
|
264
268
|
line-height: 1.5;
|
|
269
|
+
cursor: pointer;
|
|
265
270
|
}
|
|
266
271
|
.kd-anchor-link-title:only-child {
|
|
267
272
|
margin-bottom: 0;
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
margin-right: 10px;
|
|
29
29
|
font-size: @anchor-icon-font-size;
|
|
30
30
|
color: #666;
|
|
31
|
+
cursor: pointer;
|
|
31
32
|
&:hover:not(&-disabled) {
|
|
32
33
|
color: @anchor-color-theme;
|
|
33
34
|
}
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
margin-left: 10px;
|
|
39
40
|
font-size: @anchor-icon-font-size;
|
|
40
41
|
color: #666;
|
|
42
|
+
cursor: pointer;
|
|
41
43
|
&:hover:not(&-disabled) {
|
|
42
44
|
color: @anchor-color-theme;
|
|
43
45
|
}
|
|
@@ -89,6 +91,7 @@
|
|
|
89
91
|
&-advanced-arrows {
|
|
90
92
|
color: @anchor-advanced-arrows-color;
|
|
91
93
|
font-size: @anchor-icon-font-size;
|
|
94
|
+
cursor: pointer;
|
|
92
95
|
&:hover {
|
|
93
96
|
color: @anchor-color-theme;
|
|
94
97
|
}
|
|
@@ -112,6 +115,7 @@
|
|
|
112
115
|
padding: 0 8px 8px 0;
|
|
113
116
|
font-size: @anchor-advanced-lock-size;
|
|
114
117
|
color: @anchor-advanced-arrows-color;
|
|
118
|
+
cursor: pointer;
|
|
115
119
|
}
|
|
116
120
|
|
|
117
121
|
.@{anchor-prefix-cls} {
|
|
@@ -159,6 +163,7 @@
|
|
|
159
163
|
white-space: nowrap;
|
|
160
164
|
text-overflow: ellipsis;
|
|
161
165
|
line-height: 1.5;
|
|
166
|
+
cursor: pointer;
|
|
162
167
|
&:only-child {
|
|
163
168
|
margin-bottom: 0;
|
|
164
169
|
}
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
.kd-btn-ghost:disabled {
|
|
198
198
|
background-color: var(--kd-c-button-ghost-color-background-disabled, var(--kd-g-color-background-contain-disabled, #f5f5f5)) !important;
|
|
199
199
|
border-color: var(--kd-c-button-ghost-color-border-disabled, var(--kd-g-color-disabled, #b2b2b2)) !important;
|
|
200
|
-
color: var(--kd-c-button-ghost-color-border-
|
|
200
|
+
color: var(--kd-c-button-ghost-color-border-disabled, var(--kd-g-color-disabled, #b2b2b2)) !important;
|
|
201
201
|
}
|
|
202
202
|
.kd-btn-iconWrapper-left {
|
|
203
203
|
display: -webkit-box;
|
|
@@ -231,21 +231,21 @@
|
|
|
231
231
|
}
|
|
232
232
|
.kd-btn-size-small {
|
|
233
233
|
height: var(--kd-c-button-sizing-height-small, 24px);
|
|
234
|
-
min-width: var(--kd-c-button-sizing-min-
|
|
234
|
+
min-width: var(--kd-c-button-sizing-min-width-small, 60px);
|
|
235
235
|
line-height: calc(var(--kd-c-button-sizing-height-small, 24px) - (var(--kd-c-button-spacing-padding-vertical-small, 3px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
236
236
|
font-size: var(--kd-c-button-font-size-small, var(--kd-g-font-size-small, 12px));
|
|
237
237
|
padding: var(--kd-c-button-spacing-padding-vertical-small, 3px) var(--kd-c-button-spacing-padding-horizontal-small, 8px);
|
|
238
238
|
}
|
|
239
239
|
.kd-btn-size-middle {
|
|
240
240
|
height: var(--kd-c-button-sizing-height-middle, 28px);
|
|
241
|
-
min-width: var(--kd-c-button-sizing-min-
|
|
241
|
+
min-width: var(--kd-c-button-sizing-min-width-middle, 60px);
|
|
242
242
|
line-height: calc(var(--kd-c-button-sizing-height-middle, 28px) - (var(--kd-c-button-spacing-padding-vertical-middle, 5px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
243
243
|
font-size: var(--kd-c-button-font-size-middle, var(--kd-g-font-size-small, 12px));
|
|
244
244
|
padding: var(--kd-c-button-spacing-padding-vertical-middle, 5px) var(--kd-c-button-spacing-padding-horizontal-middle, 8px);
|
|
245
245
|
}
|
|
246
246
|
.kd-btn-size-large {
|
|
247
247
|
height: var(--kd-c-button-sizing-height-large, 32px);
|
|
248
|
-
min-width: var(--kd-c-button-sizing-min-
|
|
248
|
+
min-width: var(--kd-c-button-sizing-min-width-large, 80px);
|
|
249
249
|
line-height: calc(var(--kd-c-button-sizing-height-large, 32px) - (var(--kd-c-button-spacing-padding-vertical-large, 6px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
250
250
|
font-size: var(--kd-c-button-font-size-large, var(--kd-g-font-size-large, 16px));
|
|
251
251
|
padding: var(--kd-c-button-spacing-padding-vertical-large, 6px) var(--kd-c-button-spacing-padding-horizontal-large, 8px);
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
&:disabled {
|
|
78
78
|
background-color: @btn-ghost-background-color-disabled !important;
|
|
79
79
|
border-color: @btn-ghost-border-color-disabled !important;
|
|
80
|
-
color: @btn-ghost-border-color-
|
|
80
|
+
color: @btn-ghost-border-color-disabled !important;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
&-iconWrapper-left {
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
@btn-ghost-border-color-disabled: var(~'@{button-custom-prefix}-ghost-color-border-disabled', @color-disabled); //幽灵disabled边框颜色
|
|
25
25
|
@btn-ghost-font-color-disabled: var(~'@{button-custom-prefix}-ghost-color-text-disabled', @color-disabled); // 幽灵disabled按钮文字颜色
|
|
26
26
|
|
|
27
|
-
@btn-second-background-color:
|
|
27
|
+
@btn-second-background-color: var(~'@{button-custom-prefix}-second-color-background', @color-background-3); // 次要背景颜色
|
|
28
28
|
@btn-second-border-color: var(~'@{button-custom-prefix}-second-color-border', @color-border-strong-3); // 次要边框颜色
|
|
29
29
|
@btn-second-font-color: var(~'@{button-custom-prefix}-second-color-text', @color-text-secondary-3); // 次要文字颜色
|
|
30
|
-
@btn-second-background-color-hover:
|
|
30
|
+
@btn-second-background-color-hover: var(~'@{button-custom-prefix}-second-color-background-hover', @color-white); // 次要hover背景颜色
|
|
31
31
|
@btn-second-border-color-hover: var(~'@{button-custom-prefix}-second-color-border-hover', @color-border-strong); // 次要hover边框颜色
|
|
32
32
|
@btn-second-font-color-hover: var(~'@{button-custom-prefix}-second-color-text-hover', @color-text-secondary); // 次要hover文字颜色
|
|
33
|
-
@btn-second-background-color-active:
|
|
33
|
+
@btn-second-background-color-active: var(~'@{button-custom-prefix}-second-color-background-active', @color-white); // 次要active背景颜色
|
|
34
34
|
@btn-second-border-color-active: var(~'@{button-custom-prefix}-second-color-border-active', @color-border-strong); // 次要active边框颜色
|
|
35
35
|
@btn-second-font-color-active: var(~'@{button-custom-prefix}-second-color-text-active', @color-text-secondary); // 次要active文字颜色
|
|
36
|
-
@btn-second-background-color-disabled:
|
|
36
|
+
@btn-second-background-color-disabled: var(~'@{button-custom-prefix}-second-color-background-disabled', @color-background-3); // 次要disabled背景颜色
|
|
37
37
|
@btn-second-border-color-disabled: var(~'@{button-custom-prefix}-second-color-border-disabled', @color-text-secondary-3); // 次要disabled边框颜色
|
|
38
38
|
@btn-second-font-color-disabled: var(~'@{button-custom-prefix}-second-color-text-disabled', @color-text-secondary-3); // 次要disabled文字颜色
|
|
39
39
|
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
@btn-large-font-size: var(~'@{button-custom-prefix}-font-size-large', @font-size-large); // 大号 文字大小
|
|
69
69
|
|
|
70
70
|
// radius
|
|
71
|
-
@btn-g-radius-border: var(~'@{button-custom-prefix}-radius-border', @radius-border)
|
|
71
|
+
@btn-g-radius-border: var(~'@{button-custom-prefix}-radius-border', @radius-border); //圆角
|
|
72
72
|
|
|
73
73
|
// sizing
|
|
74
74
|
@btn-border-width: var(~'@{button-custom-prefix}-sizing-border', 1px);
|
|
75
75
|
@btn-small-height: var(~'@{button-custom-prefix}-sizing-height-small', 24px); // 小号 高度
|
|
76
|
-
@btn-small-min-width: var(~'@{button-custom-prefix}-sizing-min-
|
|
76
|
+
@btn-small-min-width: var(~'@{button-custom-prefix}-sizing-min-width-small', 60px); // 小号 最小宽度
|
|
77
77
|
@btn-middle-height: var(~'@{button-custom-prefix}-sizing-height-middle', 28px); // 中号 高度 高度配置
|
|
78
|
-
@btn-middle-min-width: var(~'@{button-custom-prefix}-sizing-min-
|
|
78
|
+
@btn-middle-min-width: var(~'@{button-custom-prefix}-sizing-min-width-middle', 60px); // 中号 最小宽度
|
|
79
79
|
@btn-large-height: var(~'@{button-custom-prefix}-sizing-height-large', 32px); // 大号 高度
|
|
80
|
-
@btn-large-min-width: var(~'@{button-custom-prefix}-sizing-min-
|
|
80
|
+
@btn-large-min-width: var(~'@{button-custom-prefix}-sizing-min-width-large', 80px); // 大号 最小宽度
|
|
81
81
|
|
|
82
82
|
// spacing
|
|
83
83
|
@btn-small-padding-vertical: var(~'@{button-custom-prefix}-spacing-padding-vertical-small', 3px); // 小号 内间距 纵向
|
|
@@ -85,4 +85,4 @@
|
|
|
85
85
|
@btn-middle-padding-vertical: var(~'@{button-custom-prefix}-spacing-padding-vertical-middle', 5px); // 中号 内间距 纵向
|
|
86
86
|
@btn-middle-padding-horizontal: var(~'@{button-custom-prefix}-spacing-padding-horizontal-middle', 8px); // 中号 内间距 纵向 宽度配置
|
|
87
87
|
@btn-large-padding-vertical: var(~'@{button-custom-prefix}-spacing-padding-vertical-large', 6px); // 大号 内间距 纵向
|
|
88
|
-
@btn-large-padding-horizontal: var(~'@{button-custom-prefix}-spacing-padding-horizontal-large', 8px); // 大号 内间距 横向
|
|
88
|
+
@btn-large-padding-horizontal: var(~'@{button-custom-prefix}-spacing-padding-horizontal-large', 8px); // 大号 内间距 横向
|
package/es/card/card.d.ts
CHANGED
package/es/card/card.js
CHANGED
|
@@ -18,6 +18,7 @@ var Card = function Card(props) {
|
|
|
18
18
|
title = _getCompProps.title,
|
|
19
19
|
avatar = _getCompProps.avatar,
|
|
20
20
|
actions = _getCompProps.actions,
|
|
21
|
+
extra = _getCompProps.extra,
|
|
21
22
|
children = _getCompProps.children,
|
|
22
23
|
className = _getCompProps.className,
|
|
23
24
|
hoverable = _getCompProps.hoverable,
|
|
@@ -57,7 +58,9 @@ var Card = function Card(props) {
|
|
|
57
58
|
style: bodyStyle
|
|
58
59
|
}, children), actions && /*#__PURE__*/React.createElement("div", {
|
|
59
60
|
className: "".concat(prefixCls, "-actions")
|
|
60
|
-
}, actions)
|
|
61
|
+
}, actions), extra && /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: "".concat(prefixCls, "-extra")
|
|
63
|
+
}, extra));
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
Card.displayName = 'Card';
|
package/es/card/style/index.css
CHANGED
|
@@ -189,3 +189,19 @@
|
|
|
189
189
|
.kd-card .kd-card-actions > a:active {
|
|
190
190
|
color: var(--kd-c-card-actions-color-active, var(--kd-g-color-theme-7, #375cca));
|
|
191
191
|
}
|
|
192
|
+
.kd-card-extra {
|
|
193
|
+
position: absolute;
|
|
194
|
+
top: 6px;
|
|
195
|
+
right: 4px;
|
|
196
|
+
}
|
|
197
|
+
.kd-card-extra i {
|
|
198
|
+
font-size: 22px;
|
|
199
|
+
width: 32px;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
}
|
|
202
|
+
.kd-card-lists-icon {
|
|
203
|
+
font-size: 32px;
|
|
204
|
+
position: absolute;
|
|
205
|
+
top: 6px;
|
|
206
|
+
right: 40px;
|
|
207
|
+
}
|
package/es/card/style/index.less
CHANGED
|
@@ -97,3 +97,22 @@
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
.@{card-prefix-cls}-extra {
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: 6px;
|
|
105
|
+
right: 4px;
|
|
106
|
+
i {
|
|
107
|
+
font-size: 22px;
|
|
108
|
+
width: 32px;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.@{card-prefix-cls}-lists-icon {
|
|
114
|
+
font-size: 32px;
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 6px;
|
|
117
|
+
right: 40px;
|
|
118
|
+
}
|
|
@@ -102,12 +102,11 @@ var compDefaultProps = {
|
|
|
102
102
|
destroyOnClose: false,
|
|
103
103
|
forceRender: false,
|
|
104
104
|
getContainer: document.body,
|
|
105
|
-
height: 220,
|
|
106
105
|
keyboard: true,
|
|
107
106
|
mask: true,
|
|
108
107
|
maskClosable: true,
|
|
109
108
|
placement: 'right',
|
|
110
|
-
width:
|
|
109
|
+
width: 320,
|
|
111
110
|
zIndex: 1050
|
|
112
111
|
},
|
|
113
112
|
Empty: {},
|
package/es/drawer/drawer.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export interface IDrawerProps {
|
|
|
21
21
|
getContainer?: (() => Element | CSSSelector | false | null) | Element | false;
|
|
22
22
|
headerStyle?: CSSProperties;
|
|
23
23
|
headerClassName?: string;
|
|
24
|
-
height?: string | number;
|
|
25
24
|
keyboard?: boolean;
|
|
26
25
|
mask?: boolean;
|
|
27
26
|
maskClassName?: string;
|
package/es/drawer/drawer.js
CHANGED
|
@@ -63,7 +63,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
63
63
|
footerClassName = drawerProps.footerClassName,
|
|
64
64
|
visible = drawerProps.visible,
|
|
65
65
|
width = drawerProps.width,
|
|
66
|
-
height = drawerProps.height,
|
|
67
66
|
headerStyle = drawerProps.headerStyle,
|
|
68
67
|
headerClassName = drawerProps.headerClassName,
|
|
69
68
|
zindex = drawerProps.zIndex,
|
|
@@ -81,12 +80,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
81
80
|
var _useState3 = useState(width),
|
|
82
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
83
82
|
currentWidth = _useState4[0],
|
|
84
|
-
setCurrentWidth = _useState4[1];
|
|
85
|
-
|
|
86
|
-
var _useState5 = useState(height),
|
|
87
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
88
|
-
currentHeight = _useState6[0],
|
|
89
|
-
setCurrentHeight = _useState6[1]; // const previousWidthRef = usePrevious(currentWidth)
|
|
83
|
+
setCurrentWidth = _useState4[1]; // const previousWidthRef = usePrevious(currentWidth)
|
|
90
84
|
// const previousHeightRef = usePrevious(currentHeight)
|
|
91
85
|
|
|
92
86
|
|
|
@@ -125,9 +119,8 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
125
119
|
}
|
|
126
120
|
}, [drawerContainer, isBody, isAtOriginalPlace, containerRef]);
|
|
127
121
|
var handleContainerResize = useCallback(function (_ref) {
|
|
128
|
-
var containerWidth = _ref.width
|
|
129
|
-
|
|
130
|
-
if (!visible && width === currentWidth && height === currentHeight) return;
|
|
122
|
+
var containerWidth = _ref.width;
|
|
123
|
+
if (!visible && width === currentWidth) return;
|
|
131
124
|
|
|
132
125
|
if (containerWidth < currentWidth) {
|
|
133
126
|
// 这里改成操作DOM?
|
|
@@ -137,13 +130,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
137
130
|
} else {
|
|
138
131
|
setCurrentWidth(width);
|
|
139
132
|
}
|
|
140
|
-
|
|
141
|
-
if (containerHeight < currentHeight) {
|
|
142
|
-
setCurrentHeight(containerHeight);
|
|
143
|
-
} else {
|
|
144
|
-
setCurrentHeight(height);
|
|
145
|
-
}
|
|
146
|
-
}, [width, height, visible, currentWidth, currentHeight]);
|
|
133
|
+
}, [width, visible, currentWidth]);
|
|
147
134
|
useResizeObserver(function () {
|
|
148
135
|
var _a;
|
|
149
136
|
|
|
@@ -154,9 +141,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
154
141
|
useEffect(function () {
|
|
155
142
|
setCurrentWidth(width);
|
|
156
143
|
}, [width]);
|
|
157
|
-
useEffect(function () {
|
|
158
|
-
setCurrentHeight(height);
|
|
159
|
-
}, [height]);
|
|
160
144
|
var closeDrawer = useCallback(function () {
|
|
161
145
|
onClose && onClose();
|
|
162
146
|
destroyOnClose && setShowChildren(false);
|
|
@@ -189,10 +173,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
189
173
|
var containerStyle = _extends(_defineProperty({}, placement, 0), _includesInstanceProperty(horizontalPlacements).call(horizontalPlacements, placement) ? {
|
|
190
174
|
width: currentWidth,
|
|
191
175
|
transform: "translateX(".concat(visible ? 0 : transformSize(currentWidth, placement), ")")
|
|
192
|
-
} : {
|
|
193
|
-
height: currentHeight,
|
|
194
|
-
transform: "translateY(".concat(visible ? 0 : transformSize(currentHeight, placement), ")")
|
|
195
|
-
});
|
|
176
|
+
} : {});
|
|
196
177
|
|
|
197
178
|
var container = /*#__PURE__*/React.createElement("div", {
|
|
198
179
|
className: classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(drawerPrefixCls, "-container-box"), true), _defineProperty(_classNames2, "".concat(drawerPrefixCls, "-has-container-box"), drawerContainer), _defineProperty(_classNames2, _concatInstanceProperty(_context2 = "".concat(drawerPrefixCls, "-container-")).call(_context2, placement), true), _classNames2)),
|
|
@@ -222,8 +203,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
222
203
|
return p !== placement;
|
|
223
204
|
})[0] : '';
|
|
224
205
|
var noneMaskStyle = !mask ? {
|
|
225
|
-
width: containerStyle.width
|
|
226
|
-
height: containerStyle.height
|
|
206
|
+
width: containerStyle.width
|
|
227
207
|
} : {};
|
|
228
208
|
var comp = /*#__PURE__*/React.createElement("div", {
|
|
229
209
|
className: drawerClasses,
|
|
@@ -155,22 +155,21 @@
|
|
|
155
155
|
.kd-drawer-not-at-body .kd-drawer-mask {
|
|
156
156
|
position: absolute;
|
|
157
157
|
}
|
|
158
|
-
.kd-drawer-container-left
|
|
159
|
-
top: 0;
|
|
160
|
-
bottom: 0;
|
|
161
|
-
}
|
|
158
|
+
.kd-drawer-container-left,
|
|
162
159
|
.kd-drawer-container-right {
|
|
163
160
|
top: 0;
|
|
164
161
|
bottom: 0;
|
|
165
162
|
}
|
|
166
|
-
.kd-drawer-container-top
|
|
167
|
-
left: 0;
|
|
168
|
-
right: 0;
|
|
169
|
-
}
|
|
163
|
+
.kd-drawer-container-top,
|
|
170
164
|
.kd-drawer-container-bottom {
|
|
171
165
|
left: 0;
|
|
172
166
|
right: 0;
|
|
173
167
|
}
|
|
168
|
+
.kd-drawer-container-top .kd-drawer-body,
|
|
169
|
+
.kd-drawer-container-bottom .kd-drawer-body {
|
|
170
|
+
max-height: var(--kd-c-drawer-body-max-height-vertical, 470px);
|
|
171
|
+
overflow-y: auto;
|
|
172
|
+
}
|
|
174
173
|
.kd-drawer-container-box {
|
|
175
174
|
display: -webkit-box;
|
|
176
175
|
display: -ms-flexbox;
|
|
@@ -196,18 +195,16 @@
|
|
|
196
195
|
-webkit-box-align: center;
|
|
197
196
|
-ms-flex-align: center;
|
|
198
197
|
align-items: center;
|
|
199
|
-
padding: var(--kd-c-drawer-header-sizing-padding, 12px);
|
|
198
|
+
padding: var(--kd-c-drawer-header-sizing-padding-vertical, 12px) var(--kd-c-drawer-header-sizing-padding-horizontal, 16px);
|
|
200
199
|
border-bottom: var(--kd-c-drawer-dividing-sizing-width, 1px) solid var(--kd-c-drawer-dividing-color-border, var(--kd-g-color-border-disabled, #ccc));
|
|
201
200
|
}
|
|
202
201
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-title {
|
|
203
|
-
margin-left: 20px;
|
|
204
202
|
letter-spacing: 0;
|
|
205
203
|
line-height: 26px;
|
|
206
204
|
font-size: var(--kd-c-drawer-title-font-size, var(--kd-g-font-size-x-large, 18px));
|
|
207
205
|
color: var(--kd-c-drawer-title-color-text, var(--kd-g-color-text-primary, #212121));
|
|
208
206
|
}
|
|
209
207
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon {
|
|
210
|
-
margin-right: 10px;
|
|
211
208
|
cursor: pointer;
|
|
212
209
|
}
|
|
213
210
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon i {
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
position: absolute;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
&-container-left
|
|
36
|
-
.drawer-container-placement-horizontal();
|
|
37
|
-
}
|
|
35
|
+
&-container-left,
|
|
38
36
|
&-container-right {
|
|
39
37
|
.drawer-container-placement-horizontal();
|
|
40
38
|
}
|
|
41
|
-
&-container-top
|
|
42
|
-
.drawer-container-placement-vertical();
|
|
43
|
-
}
|
|
39
|
+
&-container-top,
|
|
44
40
|
&-container-bottom {
|
|
45
41
|
.drawer-container-placement-vertical();
|
|
42
|
+
.@{drawer-prefix-cls}-body {
|
|
43
|
+
max-height: @drawer-body-max-height-vertical;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&-container-box {
|
|
@@ -56,10 +56,9 @@
|
|
|
56
56
|
display: flex;
|
|
57
57
|
justify-content: space-between;
|
|
58
58
|
align-items: center;
|
|
59
|
-
padding: @drawer-header-padding;
|
|
59
|
+
padding: @drawer-header-padding-vertical @drawer-header-padding-horizontal;
|
|
60
60
|
border-bottom: @drawer-dividing-width solid @drawer-dividing-color;
|
|
61
61
|
.@{drawer-prefix-cls}-title {
|
|
62
|
-
margin-left: 20px;
|
|
63
62
|
letter-spacing: 0;
|
|
64
63
|
line-height: 26px;
|
|
65
64
|
font-size: @drawer-title-font-size;
|
|
@@ -70,7 +69,6 @@
|
|
|
70
69
|
color: @drawer-close-icon-color;
|
|
71
70
|
font-size: @drawer-close-icon-font-size;
|
|
72
71
|
}
|
|
73
|
-
margin-right: 10px;
|
|
74
72
|
cursor: pointer;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
@drawer-close-icon-font-size: var(~'@{drawer-custom-prefix}-close-icon-font-size', @font-size-large);
|
|
15
15
|
|
|
16
16
|
// sizing
|
|
17
|
+
@drawer-body-max-height-vertical: var(~'@{drawer-custom-prefix}-body-max-height-vertical', 470px);
|
|
17
18
|
@drawer-dividing-width: var(~'@{drawer-custom-prefix}-dividing-sizing-width', 1px);
|
|
18
19
|
|
|
19
20
|
// spacing
|
|
20
|
-
@drawer-header-padding: var(~'@{drawer-custom-prefix}-header-sizing-padding', 12px);
|
|
21
|
+
@drawer-header-padding-vertical: var(~'@{drawer-custom-prefix}-header-sizing-padding-vertical', 12px);
|
|
22
|
+
@drawer-header-padding-horizontal: var(~'@{drawer-custom-prefix}-header-sizing-padding-horizontal', 16px);
|
|
21
23
|
@drawer-body-padding: var(~'@{drawer-custom-prefix}-body-sizing-padding', 16px);
|
package/es/dropdown/dropdown.js
CHANGED
|
@@ -44,11 +44,14 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
44
44
|
});
|
|
45
45
|
var isMenu = menu.type === Menu;
|
|
46
46
|
|
|
47
|
-
var _React$useState3 = React.useState(((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
|
|
47
|
+
var _React$useState3 = React.useState(props.selectedKey || ((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
|
|
48
48
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
selectedKey = _React$useState4[0],
|
|
50
|
+
setSelectedKey = _React$useState4[1];
|
|
51
51
|
|
|
52
|
+
React.useEffect(function () {
|
|
53
|
+
setSelectedKey(props.selectedKey);
|
|
54
|
+
}, [props.selectedKey]);
|
|
52
55
|
var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
|
|
53
56
|
|
|
54
57
|
var handleItemClick = function handleItemClick(e) {
|
|
@@ -65,13 +68,13 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
65
68
|
onItemClick(key);
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
menuSelectable &&
|
|
71
|
+
menuSelectable && setSelectedKey(key);
|
|
69
72
|
props.visible === undefined && setVisible(false);
|
|
70
73
|
}
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
var menuElement = isMenu ? /*#__PURE__*/React.cloneElement(menu, {
|
|
74
|
-
|
|
77
|
+
selectedKey: selectedKey,
|
|
75
78
|
onClick: handleItemClick,
|
|
76
79
|
selectable: menuSelectable
|
|
77
80
|
}) : /*#__PURE__*/React.createElement("ul", {
|
|
@@ -91,7 +94,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
91
94
|
rel: 'noopener noreferrer'
|
|
92
95
|
};
|
|
93
96
|
var key = itemKey || label;
|
|
94
|
-
var selected = selectable && String(
|
|
97
|
+
var selected = selectable && String(selectedKey) === String(key);
|
|
95
98
|
return /*#__PURE__*/React.createElement("li", {
|
|
96
99
|
title: label,
|
|
97
100
|
key: key,
|
package/es/dropdown/menu.d.ts
CHANGED
package/es/dropdown/menu.js
CHANGED
|
@@ -32,16 +32,16 @@ export var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
32
32
|
customPrefixcls = _a.prefixCls,
|
|
33
33
|
children = _a.children,
|
|
34
34
|
selectable = _a.selectable,
|
|
35
|
-
|
|
35
|
+
selectedKey = _a.selectedKey,
|
|
36
36
|
className = _a.className,
|
|
37
|
-
restProps = __rest(_a, ["prefixCls", "children", "selectable", "
|
|
37
|
+
restProps = __rest(_a, ["prefixCls", "children", "selectable", "selectedKey", "className"]); // className前缀
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu', customPrefixcls);
|
|
41
41
|
|
|
42
42
|
var cloneItem = function cloneItem(item, index) {
|
|
43
43
|
var key = item.key || index;
|
|
44
|
-
var selected = selectable && String(
|
|
44
|
+
var selected = selectable && String(selectedKey) === String(key);
|
|
45
45
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
46
46
|
key: key,
|
|
47
47
|
selected: selected,
|
package/es/menu/menuItem.js
CHANGED
|
@@ -132,8 +132,7 @@ var InternalMenuItem = function InternalMenuItem(props, ref) {
|
|
|
132
132
|
className: classNames(className, (_classNames = {}, _defineProperty(_classNames, prefixCls, subMenuMode !== 'horizontal'), _defineProperty(_classNames, "".concat(prefixCls, "-collapsed"), collapsed && level === 1), _defineProperty(_classNames, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(prefixCls, "-active"), selectedKey === keyValue), _classNames)),
|
|
133
133
|
role: "menuitem",
|
|
134
134
|
style: style,
|
|
135
|
-
key: keyValue
|
|
136
|
-
title: children
|
|
135
|
+
key: keyValue
|
|
137
136
|
}, mouseEvent), /*#__PURE__*/React.createElement("div", {
|
|
138
137
|
className: classNames("".concat(prefixCls, "-title")),
|
|
139
138
|
style: titleStyle
|
|
@@ -115,7 +115,7 @@ var Content = function Content(args) {
|
|
|
115
115
|
var getMainElement = function getMainElement() {
|
|
116
116
|
if (typeof content === 'string') {
|
|
117
117
|
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: classNames("".concat(classPrefix, "-
|
|
118
|
+
className: classNames("".concat(classPrefix, "-description"))
|
|
119
119
|
}, content);
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -244,7 +244,7 @@ var Pagination = function Pagination(props) {
|
|
|
244
244
|
className: "".concat(prefixCls, "-selector")
|
|
245
245
|
}, /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
246
246
|
selectable: true,
|
|
247
|
-
|
|
247
|
+
selectedKey: size,
|
|
248
248
|
menu: sizeOptions,
|
|
249
249
|
trigger: "click",
|
|
250
250
|
disabled: disabled,
|
|
@@ -395,7 +395,7 @@ var Pagination = function Pagination(props) {
|
|
|
395
395
|
size: /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
396
396
|
selectable: true,
|
|
397
397
|
trigger: "click",
|
|
398
|
-
|
|
398
|
+
selectedKey: size,
|
|
399
399
|
menu: sizeOptions,
|
|
400
400
|
disabled: disabled,
|
|
401
401
|
popperStyle: {
|