@kdcloudjs/kdesign 1.3.6 → 1.3.9

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/kdesign-complete.less +132 -127
  3. package/dist/kdesign.css +168 -121
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +55 -28
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +2 -2
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/anchor/anchor.js +3 -3
  11. package/es/anchor/style/index.css +7 -7
  12. package/es/anchor/style/index.less +5 -5
  13. package/es/anchor/style/token.less +1 -1
  14. package/es/button/style/index.css +36 -0
  15. package/es/button/style/index.less +14 -2
  16. package/es/checkbox/checkbox.js +7 -3
  17. package/es/config-provider/compDefaultProps.d.ts +1 -0
  18. package/es/config-provider/compDefaultProps.js +2 -1
  19. package/es/menu/menu.js +22 -8
  20. package/es/menu/style/index.css +122 -110
  21. package/es/menu/style/index.less +51 -73
  22. package/es/menu/style/mixin.less +59 -42
  23. package/es/menu/subMenu.js +5 -4
  24. package/es/radio/radio.js +7 -3
  25. package/es/select/select.js +6 -4
  26. package/es/switch/style/index.css +1 -1
  27. package/es/switch/style/token.less +1 -1
  28. package/es/table/table.js +2 -0
  29. package/es/tree/style/index.css +1 -2
  30. package/es/tree/style/index.less +1 -2
  31. package/es/tree/style/token.less +0 -1
  32. package/es/tree/tree.js +1 -2
  33. package/es/tree/treeNode.js +1 -1
  34. package/lib/anchor/anchor.js +3 -3
  35. package/lib/anchor/style/index.css +7 -7
  36. package/lib/anchor/style/index.less +5 -5
  37. package/lib/anchor/style/token.less +1 -1
  38. package/lib/button/style/index.css +36 -0
  39. package/lib/button/style/index.less +14 -2
  40. package/lib/checkbox/checkbox.js +7 -3
  41. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  42. package/lib/config-provider/compDefaultProps.js +2 -1
  43. package/lib/menu/menu.js +22 -8
  44. package/lib/menu/style/index.css +122 -110
  45. package/lib/menu/style/index.less +51 -73
  46. package/lib/menu/style/mixin.less +59 -42
  47. package/lib/menu/subMenu.js +5 -4
  48. package/lib/radio/radio.js +7 -3
  49. package/lib/select/select.js +6 -4
  50. package/lib/switch/style/index.css +1 -1
  51. package/lib/switch/style/token.less +1 -1
  52. package/lib/table/table.js +2 -0
  53. package/lib/tree/style/index.css +1 -2
  54. package/lib/tree/style/index.less +1 -2
  55. package/lib/tree/style/token.less +0 -1
  56. package/lib/tree/tree.js +1 -2
  57. package/lib/tree/treeNode.js +1 -1
  58. package/package.json +1 -1
@@ -139,7 +139,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
139
139
 
140
140
  var anchorMenuClass = classNames(_defineProperty({}, "".concat(anchorPrefixCls, "-menu"), true));
141
141
  var anchorAdvancedClass = classNames(_defineProperty({}, "".concat(anchorPrefixCls, "-advanced"), true));
142
- var inkClass = classNames("".concat(anchorPrefixCls, "-ink-line"), {
142
+ var inkClass = classNames("".concat(anchorPrefixCls, "-line-slider"), {
143
143
  visible: activeLink
144
144
  });
145
145
  React.useEffect(function () {
@@ -296,7 +296,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
296
296
  getScrollContainer().addEventListener('scroll', handleScroll);
297
297
  handleScroll();
298
298
  return function () {
299
- return window.removeEventListener('scroll', handleScroll);
299
+ return getScrollContainer().removeEventListener('scroll', handleScroll);
300
300
  };
301
301
  }, [handleScroll, getScrollContainer]);
302
302
  useEffect(function () {
@@ -371,7 +371,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
371
371
  width: anchorPosition.width
372
372
  } : undefined
373
373
  }, /*#__PURE__*/React.createElement("div", {
374
- className: "".concat(anchorPrefixCls, "-ink")
374
+ className: "".concat(anchorPrefixCls, "-line")
375
375
  }, /*#__PURE__*/React.createElement("span", {
376
376
  className: inkClass,
377
377
  ref: inkRef
@@ -189,7 +189,7 @@
189
189
  content: '';
190
190
  height: 0;
191
191
  width: 40px;
192
- border-bottom: var(--kd-c-anchor-ink-line-spacing-width, 1px) dashed var(--kd-c-anchor-color-border-disabled, var(--kd-g-color-border-disabled, #ccc));
192
+ border-bottom: var(--kd-c-anchor-line-slider-spacing-width, 1px) dashed var(--kd-c-anchor-color-border-disabled, var(--kd-g-color-border-disabled, #ccc));
193
193
  margin: 4px;
194
194
  }
195
195
  .kd-anchor-advanced-arrows {
@@ -227,31 +227,31 @@
227
227
  .kd-anchor-advanced .kd-anchor {
228
228
  max-width: var(--kd-c-anchor-advanced-sizing-width, 160px);
229
229
  }
230
- .kd-anchor-ink {
230
+ .kd-anchor-line {
231
231
  position: absolute;
232
232
  left: var(--kd-c-anchor-spacing-horizontal, 7px);
233
233
  top: 0;
234
234
  height: 100%;
235
235
  }
236
- .kd-anchor-ink::before {
236
+ .kd-anchor-line::before {
237
237
  position: relative;
238
238
  display: block;
239
- width: var(--kd-c-anchor-ink-line-spacing-width, 1px);
239
+ width: var(--kd-c-anchor-line-slider-spacing-width, 1px);
240
240
  height: 100%;
241
241
  margin: 0 auto;
242
242
  background-color: var(--kd-c-anchor-color-border, var(--kd-g-color-border-strong, #d9d9d9));
243
243
  content: '';
244
244
  }
245
- .kd-anchor-ink-line {
245
+ .kd-anchor-line-slider {
246
246
  position: absolute;
247
247
  display: none;
248
248
  width: 0;
249
249
  height: 16px;
250
- border-right: var(--kd-c-anchor-ink-line-spacing-width, 1px) solid var(--kd-c-anchor-color-theme, var(--kd-g-color-theme, #5582f3));
250
+ border-right: var(--kd-c-anchor-line-slider-spacing-width, 1px) solid var(--kd-c-anchor-color-theme, var(--kd-g-color-theme, #5582f3));
251
251
  -webkit-transition: top 0.3s ease-in-out;
252
252
  transition: top 0.3s ease-in-out;
253
253
  }
254
- .kd-anchor-ink-line.visible {
254
+ .kd-anchor-line-slider.visible {
255
255
  display: inline-block;
256
256
  }
257
257
  .kd-anchor-link {
@@ -83,7 +83,7 @@
83
83
  content: '';
84
84
  height: 0;
85
85
  width: 40px;
86
- border-bottom: @anchor-ink-line-width dashed @anchor-disabled-border-color;
86
+ border-bottom: @anchor-line-slider-width dashed @anchor-disabled-border-color;
87
87
  margin: 4px;
88
88
  }
89
89
  }
@@ -123,7 +123,7 @@
123
123
  }
124
124
  }
125
125
 
126
- &-ink {
126
+ &-line {
127
127
  position: absolute;
128
128
  left: @anchor-link-left;
129
129
  top: 0;
@@ -131,19 +131,19 @@
131
131
  &::before {
132
132
  position: relative;
133
133
  display: block;
134
- width: @anchor-ink-line-width;
134
+ width: @anchor-line-slider-width;
135
135
  height: 100%;
136
136
  margin: 0 auto;
137
137
  background-color: @anchor-border-color;
138
138
  content: '';
139
139
  }
140
140
 
141
- &-line {
141
+ &-slider {
142
142
  position: absolute;
143
143
  display: none;
144
144
  width: 0;
145
145
  height: 16px;
146
- border-right: @anchor-ink-line-width solid @anchor-color-theme;
146
+ border-right: @anchor-line-slider-width solid @anchor-color-theme;
147
147
  transition: top 0.3s ease-in-out;
148
148
  &.visible {
149
149
  display: inline-block;
@@ -22,7 +22,7 @@
22
22
  @anchor-link-secondary-padding: var(~'@{anchor-prefix}-secondary-spacing-padding', 12px 8px);
23
23
  @anchor-advanced-padding-top: var(~'@{anchor-prefix}-advanced-spacing-padding-top', 8px);
24
24
  @anchor-advanced-padding-bottom: var(~'@{anchor-prefix}-advanced-spacing-padding-bottom', 7px);
25
- @anchor-ink-line-width: var(~'@{anchor-prefix}-ink-line-spacing-width', 1px);
25
+ @anchor-line-slider-width: var(~'@{anchor-prefix}-line-slider-spacing-width', 1px);
26
26
 
27
27
 
28
28
  // font
@@ -241,6 +241,15 @@
241
241
  .kd-btn-size-small.kd-btn-icon-only {
242
242
  font-size: var(--kd-c-button-icon-font-size-small, 14px);
243
243
  padding: 0 var(--kd-c-button-icon-spacing-padding-horizontal, 4px);
244
+ display: -webkit-inline-box;
245
+ display: -ms-inline-flexbox;
246
+ display: inline-flex;
247
+ -webkit-box-pack: center;
248
+ -ms-flex-pack: center;
249
+ justify-content: center;
250
+ -webkit-box-align: center;
251
+ -ms-flex-align: center;
252
+ align-items: center;
244
253
  }
245
254
  .kd-btn-size-small .kd-btn-group-basic-icon {
246
255
  font-size: var(--kd-c-button-icon-font-size-small, 14px);
@@ -255,6 +264,15 @@
255
264
  .kd-btn-size-middle.kd-btn-icon-only {
256
265
  font-size: var(--kd-c-button-icon-font-size-middle, 16px);
257
266
  padding: 0 var(--kd-c-button-icon-spacing-padding-horizontal, 4px);
267
+ display: -webkit-inline-box;
268
+ display: -ms-inline-flexbox;
269
+ display: inline-flex;
270
+ -webkit-box-pack: center;
271
+ -ms-flex-pack: center;
272
+ justify-content: center;
273
+ -webkit-box-align: center;
274
+ -ms-flex-align: center;
275
+ align-items: center;
258
276
  }
259
277
  .kd-btn-size-middle .kd-btn-group-basic-icon {
260
278
  font-size: var(--kd-c-button-icon-font-size-middle, 16px);
@@ -269,6 +287,15 @@
269
287
  .kd-btn-size-large.kd-btn-icon-only {
270
288
  font-size: var(--kd-c-button-icon-font-size-large, 18px);
271
289
  padding: 0 var(--kd-c-button-icon-spacing-padding-horizontal, 4px);
290
+ display: -webkit-inline-box;
291
+ display: -ms-inline-flexbox;
292
+ display: inline-flex;
293
+ -webkit-box-pack: center;
294
+ -ms-flex-pack: center;
295
+ justify-content: center;
296
+ -webkit-box-align: center;
297
+ -ms-flex-align: center;
298
+ align-items: center;
272
299
  }
273
300
  .kd-btn-size-large .kd-btn-group-basic-icon {
274
301
  font-size: var(--kd-c-button-icon-font-size-large, 18px);
@@ -337,6 +364,15 @@
337
364
  }
338
365
  .kd-btn-loading {
339
366
  cursor: default;
367
+ display: -webkit-inline-box;
368
+ display: -ms-inline-flexbox;
369
+ display: inline-flex;
370
+ -webkit-box-pack: center;
371
+ -ms-flex-pack: center;
372
+ justify-content: center;
373
+ -webkit-box-align: center;
374
+ -ms-flex-align: center;
375
+ align-items: center;
340
376
  }
341
377
  .kd-btn-block {
342
378
  width: 100%;
@@ -114,6 +114,9 @@
114
114
  &.@{btn-prefix-cls}-icon-only {
115
115
  font-size: @btn-icon-small-font-size;
116
116
  padding: 0 @btn-icon-padding-horizontal;
117
+ display: inline-flex;
118
+ justify-content: center;
119
+ align-items: center;
117
120
  }
118
121
 
119
122
  .@{btn-prefix-cls}-group-basic-icon {
@@ -127,6 +130,9 @@
127
130
  &.@{btn-prefix-cls}-icon-only {
128
131
  font-size: @btn-icon-middle-font-size;
129
132
  padding: 0 @btn-icon-padding-horizontal;
133
+ display: inline-flex;
134
+ justify-content: center;
135
+ align-items: center;
130
136
  }
131
137
 
132
138
  .@{btn-prefix-cls}-group-basic-icon {
@@ -140,6 +146,9 @@
140
146
  &.@{btn-prefix-cls}-icon-only {
141
147
  font-size: @btn-icon-large-font-size;
142
148
  padding: 0 @btn-icon-padding-horizontal;
149
+ display: inline-flex;
150
+ justify-content: center;
151
+ align-items: center;
143
152
  }
144
153
 
145
154
  .@{btn-prefix-cls}-group-basic-icon {
@@ -234,6 +243,9 @@
234
243
  // 加载中按钮
235
244
  &-loading {
236
245
  cursor: default;
246
+ display: inline-flex;
247
+ justify-content: center;
248
+ align-items: center;
237
249
  }
238
250
  // 按钮开启块化撑满父元素
239
251
  &-block {
@@ -271,11 +283,11 @@
271
283
  background: @btn-group-trigger-color-background-hover;
272
284
  border-color: @btn-group-trigger-color-background-hover;
273
285
  }
274
-
286
+
275
287
  &:active {
276
288
  background: @btn-group-trigger-color-background-active;
277
289
  }
278
-
290
+
279
291
  &:disabled {
280
292
  background: @btn-group-trigger-color-background-disabled !important;
281
293
  }
@@ -72,6 +72,8 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
72
72
  isBoolean(checked) && checked !== selected && setSelected(checked);
73
73
  }, [checked, selected]);
74
74
  useEffect(function () {
75
+ var _a;
76
+
75
77
  var handleRepeatClick = function handleRepeatClick(e) {
76
78
  var element = e.target;
77
79
 
@@ -80,10 +82,12 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
80
82
  }
81
83
  };
82
84
 
83
- labelRef.current.addEventListener('click', handleRepeatClick);
85
+ (_a = labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('click', handleRepeatClick);
84
86
  return function () {
85
- // eslint-disable-next-line react-hooks/exhaustive-deps
86
- labelRef.current.removeEventListener('click', handleRepeatClick);
87
+ var _a; // eslint-disable-next-line react-hooks/exhaustive-deps
88
+
89
+
90
+ (_a = labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', handleRepeatClick);
87
91
  };
88
92
  }, []);
89
93
 
@@ -305,6 +305,7 @@ declare const compDefaultProps: {
305
305
  draggable: boolean;
306
306
  virtual: boolean;
307
307
  switcherIcon: () => JSX.Element;
308
+ estimatedItemSize: number;
308
309
  };
309
310
  TreeNode: {};
310
311
  ToolTip: {
@@ -319,7 +319,8 @@ var compDefaultProps = {
319
319
  return /*#__PURE__*/React.createElement(Icon, {
320
320
  type: "arrow-right-solid"
321
321
  });
322
- }
322
+ },
323
+ estimatedItemSize: 32
323
324
  },
324
325
  TreeNode: {},
325
326
  ToolTip: {
package/es/menu/menu.js CHANGED
@@ -72,8 +72,13 @@ var Menu = function Menu(props) {
72
72
 
73
73
  var _React$useState3 = React.useState([]),
74
74
  _React$useState4 = _slicedToArray(_React$useState3, 2),
75
- openKeys = _React$useState4[0],
76
- setOpenKeys = _React$useState4[1];
75
+ selectedKeyPath = _React$useState4[0],
76
+ setSelectedKeyPath = _React$useState4[1];
77
+
78
+ var _React$useState5 = React.useState([]),
79
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
80
+ openKeys = _React$useState6[0],
81
+ setOpenKeys = _React$useState6[1];
77
82
 
78
83
  if (mode === 'inline') {
79
84
  restProps.triggerSubMenuAction = 'click';
@@ -82,6 +87,7 @@ var Menu = function Menu(props) {
82
87
  useEffect(function () {
83
88
  setOpenKeys([]);
84
89
  setSelectedKey('');
90
+ setSelectedKeyPath([]);
85
91
  openSubMenuSet.clear();
86
92
  }, [mode]);
87
93
  useEffect(function () {
@@ -92,22 +98,29 @@ var Menu = function Menu(props) {
92
98
  useEffect(function () {
93
99
  if (userOpenKeys !== undefined && Array.isArray(userOpenKeys)) {
94
100
  setOpenKeys(userOpenKeys);
95
- openSubMenuSet.clear();
96
- userOpenKeys.forEach(function (d) {
97
- openSubMenuSet.add(d);
101
+ }
102
+ }, [userOpenKeys]);
103
+ useEffect(function () {
104
+ if (userSelectedKey !== undefined && userOpenKeys !== undefined && Array.isArray(userOpenKeys)) {
105
+ setSelectedKeyPath(userOpenKeys);
106
+ setTimeout(function () {
107
+ userOpenKeys.forEach(function (d) {
108
+ openSubMenuSet.add(d);
109
+ });
98
110
  });
99
111
  }
100
- }, [userOpenKeys]); // React.useEffect(() => {
101
- // setCollapsed(restProps.collapsed)
102
- // }, [restProps.collapsed])
112
+ }, []);
103
113
 
104
114
  var handleOnClick = function handleOnClick(info) {
105
115
  if (userSelectedKey === undefined) {
106
116
  setSelectedKey(info.key);
107
117
  }
108
118
 
119
+ setSelectedKeyPath(info.keyPath);
120
+
109
121
  if (mode !== 'inline' && openKeys.length > 0) {
110
122
  setOpenKeys([]);
123
+ openSubMenuSet.clear();
111
124
  }
112
125
 
113
126
  onClick && onClick(info);
@@ -159,6 +172,7 @@ var Menu = function Menu(props) {
159
172
  mode: mode,
160
173
  openKeys: openKeys,
161
174
  selectedKey: selectedKey,
175
+ selectedKeyPath: selectedKeyPath,
162
176
  theme: theme,
163
177
  triggerSubMenuAction: restProps.triggerSubMenuAction,
164
178
  forceSubMenuRender: forceSubMenuRender,