@kdcloudjs/kdesign 1.7.18 → 1.7.20

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 (88) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/kdesign-complete.less +362 -244
  3. package/dist/kdesign.css +270 -239
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +716 -788
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +2 -2
  8. package/dist/kdesign.min.js +6 -6
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/button/style/token.less +1 -0
  11. package/es/carousel/style/index.css +4 -0
  12. package/es/carousel/style/index.less +31 -5
  13. package/es/cascader/cascader.js +4 -2
  14. package/es/checkbox/checkbox.js +5 -5
  15. package/es/checkbox/style/index.css +2 -0
  16. package/es/checkbox/style/index.less +2 -0
  17. package/es/checkbox/style/token.less +1 -1
  18. package/es/city-picker/city-picker.d.ts +3 -23
  19. package/es/city-picker/city-picker.js +351 -124
  20. package/es/city-picker/interface.d.ts +57 -0
  21. package/es/city-picker/interface.js +3 -0
  22. package/es/city-picker/option.d.ts +4 -0
  23. package/es/city-picker/option.js +42 -0
  24. package/es/city-picker/style/index.css +264 -239
  25. package/es/city-picker/style/index.less +262 -218
  26. package/es/city-picker/style/mixin.less +26 -3
  27. package/es/city-picker/style/token.less +42 -14
  28. package/es/collapse/collapse.d.ts +1 -1
  29. package/es/config-provider/compDefaultProps.d.ts +13 -0
  30. package/es/config-provider/compDefaultProps.js +13 -0
  31. package/es/dropdown/dropdown.d.ts +1 -0
  32. package/es/dropdown/dropdown.js +7 -2
  33. package/es/input/style/token.less +2 -8
  34. package/es/upload/upload.js +87 -63
  35. package/lib/button/style/token.less +1 -0
  36. package/lib/carousel/style/index.css +4 -0
  37. package/lib/carousel/style/index.less +31 -5
  38. package/lib/cascader/cascader.js +4 -2
  39. package/lib/checkbox/checkbox.js +4 -4
  40. package/lib/checkbox/style/index.css +2 -0
  41. package/lib/checkbox/style/index.less +2 -0
  42. package/lib/checkbox/style/token.less +1 -1
  43. package/lib/city-picker/city-picker.d.ts +3 -23
  44. package/lib/city-picker/city-picker.js +350 -123
  45. package/lib/city-picker/interface.d.ts +57 -0
  46. package/lib/city-picker/interface.js +11 -0
  47. package/lib/city-picker/option.d.ts +4 -0
  48. package/lib/city-picker/option.js +55 -0
  49. package/lib/city-picker/style/index.css +264 -239
  50. package/lib/city-picker/style/index.less +262 -218
  51. package/lib/city-picker/style/mixin.less +26 -3
  52. package/lib/city-picker/style/token.less +42 -14
  53. package/lib/collapse/collapse.d.ts +1 -1
  54. package/lib/config-provider/compDefaultProps.d.ts +13 -0
  55. package/lib/config-provider/compDefaultProps.js +13 -0
  56. package/lib/dropdown/dropdown.d.ts +1 -0
  57. package/lib/dropdown/dropdown.js +7 -2
  58. package/lib/input/style/token.less +2 -8
  59. package/lib/upload/upload.js +86 -62
  60. package/package.json +1 -1
  61. package/es/city-picker/city-group.d.ts +0 -8
  62. package/es/city-picker/city-group.js +0 -38
  63. package/es/city-picker/city-list.d.ts +0 -12
  64. package/es/city-picker/city-list.js +0 -55
  65. package/es/city-picker/city-panel-item.d.ts +0 -13
  66. package/es/city-picker/city-panel-item.js +0 -22
  67. package/es/city-picker/city-panel.d.ts +0 -17
  68. package/es/city-picker/city-panel.js +0 -153
  69. package/es/city-picker/city-search-panel.d.ts +0 -9
  70. package/es/city-picker/city-search-panel.js +0 -44
  71. package/es/city-picker/no-data.d.ts +0 -3
  72. package/es/city-picker/no-data.js +0 -18
  73. package/es/city-picker/utils/grouping.d.ts +0 -7
  74. package/es/city-picker/utils/grouping.js +0 -24
  75. package/lib/city-picker/city-group.d.ts +0 -8
  76. package/lib/city-picker/city-group.js +0 -51
  77. package/lib/city-picker/city-list.d.ts +0 -12
  78. package/lib/city-picker/city-list.js +0 -68
  79. package/lib/city-picker/city-panel-item.d.ts +0 -13
  80. package/lib/city-picker/city-panel-item.js +0 -35
  81. package/lib/city-picker/city-panel.d.ts +0 -17
  82. package/lib/city-picker/city-panel.js +0 -166
  83. package/lib/city-picker/city-search-panel.d.ts +0 -9
  84. package/lib/city-picker/city-search-panel.js +0 -57
  85. package/lib/city-picker/no-data.d.ts +0 -3
  86. package/lib/city-picker/no-data.js +0 -31
  87. package/lib/city-picker/utils/grouping.d.ts +0 -7
  88. package/lib/city-picker/utils/grouping.js +0 -30
@@ -91,6 +91,7 @@
91
91
  @btn-middle-height: var(~'@{button-custom-prefix}-sizing-height-middle', 28px); // 中号 高度 高度配置
92
92
  @btn-middle-min-width: var(~'@{button-custom-prefix}-sizing-min-width-middle', 60px); // 中号 最小宽度
93
93
  @btn-large-height: var(~'@{button-custom-prefix}-sizing-height-large', 32px); // 大号 高度
94
+ @btn-middle-max-width: var(~'@{button-custom-prefix}-sizing-max-width-middle'); // 中号 最大宽度
94
95
  @btn-large-min-width: var(~'@{button-custom-prefix}-sizing-min-width-large', 80px); // 大号 最小宽度
95
96
  @btn-group-dropdown-item-height: var(~'@{button-custom-prefix}--group-dropdown-item-height', 30px);
96
97
  @btn-group-dropdown-min-width: var(~'@{button-custom-prefix}-group-dropdown-min-width', 80px);
@@ -167,9 +167,11 @@
167
167
  }
168
168
  .kd-carousel-list-fade .kd-carousel-list-item-not-hidden {
169
169
  opacity: 1;
170
+ z-index: 1;
170
171
  }
171
172
  .kd-carousel-list-fade .kd-carousel-list-item-hidden {
172
173
  opacity: 0;
174
+ z-index: 0;
173
175
  }
174
176
  .kd-carousel-list-display {
175
177
  width: 100%;
@@ -187,6 +189,7 @@
187
189
  position: absolute;
188
190
  list-style: none;
189
191
  padding: 0;
192
+ z-index: 1;
190
193
  }
191
194
  .kd-carousel-slidebar-left {
192
195
  display: -webkit-box;
@@ -299,6 +302,7 @@
299
302
  right: 16px;
300
303
  -webkit-transform: translateY(-50%);
301
304
  transform: translateY(-50%);
305
+ z-index: 1;
302
306
  }
303
307
  .kd-carousel-jump-left {
304
308
  left: 16px;
@@ -1,6 +1,7 @@
1
1
  @import '../../style/themes/index';
2
2
  @import './mixin.less';
3
3
  @carousel-prefix-cls: ~'@{kd-prefix}-carousel';
4
+
4
5
  .@{carousel-prefix-cls} {
5
6
  &-root {
6
7
  position: relative;
@@ -27,18 +28,23 @@
27
28
 
28
29
  &-slide {
29
30
  width: 100%;
31
+
30
32
  .@{carousel-prefix-cls}-list-item {
31
33
  opacity: 1;
32
34
  border-radius: @carousel-boder-radius;
35
+
33
36
  &-animation {
34
37
  transition: opacity 0.3s ease;
35
38
  }
39
+
36
40
  &-none-animation {
37
41
  transition: none;
38
42
  }
43
+
39
44
  &-not-hidden {
40
45
  opacity: 1;
41
46
  }
47
+
42
48
  &-hidden {
43
49
  opacity: 0;
44
50
  }
@@ -47,30 +53,40 @@
47
53
 
48
54
  &-fade {
49
55
  flex: 1;
56
+
50
57
  .@{carousel-prefix-cls}-list-item {
51
58
  opacity: 1;
59
+
52
60
  &-animation {
53
61
  transition: opacity 0.3s ease;
54
62
  }
63
+
55
64
  &-none-animation {
56
65
  transition: none;
57
66
  }
67
+
58
68
  &-not-hidden {
59
69
  opacity: 1;
70
+ z-index: 1;
60
71
  }
72
+
61
73
  &-hidden {
62
74
  opacity: 0;
75
+ z-index: 0;
63
76
  }
64
77
  }
65
78
  }
66
79
 
67
80
  &-display {
68
81
  width: 100%;
82
+
69
83
  .@{carousel-prefix-cls}-list-item {
70
84
  display: block;
85
+
71
86
  &-not-hidden {
72
87
  display: block;
73
88
  }
89
+
74
90
  &-hidden {
75
91
  display: none;
76
92
  }
@@ -82,25 +98,29 @@
82
98
  position: absolute;
83
99
  list-style: none;
84
100
  padding: 0;
101
+ z-index: 1;
85
102
 
86
103
  &-left {
87
104
  .vertical;
88
105
  left: @carousel-dots-margin-left;
89
106
  }
107
+
90
108
  &-right {
91
109
  .vertical;
92
110
  right: @carousel-dots-margin-right;
93
111
  }
112
+
94
113
  &-bottom {
95
114
  .horizontal;
96
115
  bottom: @carousel-dots-margin-bottom;
97
116
  }
117
+
98
118
  &-top {
99
119
  .horizontal;
100
120
  top: @carousel-dots-margin-top;
101
121
  }
102
122
 
103
- &-dot > button {
123
+ &-dot>button {
104
124
  display: block;
105
125
  border-radius: @carousel-dots-boder-radius;
106
126
  box-sizing: border-box;
@@ -123,9 +143,11 @@
123
143
  width: 100%;
124
144
  cursor: pointer;
125
145
  outline: none;
146
+
126
147
  &-active {
127
148
  opacity: 1;
128
- & > button {
149
+
150
+ &>button {
129
151
  background-color: @carousel-dots-color-background-active;
130
152
  opacity: 1;
131
153
  }
@@ -139,6 +161,7 @@
139
161
  left: unset;
140
162
  right: 16px;
141
163
  transform: translateY(-50%);
164
+ z-index: 1;
142
165
 
143
166
  &-left {
144
167
  left: 16px;
@@ -149,7 +172,7 @@
149
172
  cursor: pointer;
150
173
  }
151
174
 
152
- > *:first-child {
175
+ >*:first-child {
153
176
  display: flex;
154
177
  align-items: center;
155
178
  justify-content: center;
@@ -173,12 +196,14 @@
173
196
  }
174
197
  }
175
198
  }
199
+
176
200
  .vertical {
177
201
  display: flex;
178
202
  flex-direction: column;
179
203
  top: 50%;
180
204
  transform: translateY(-50%);
181
- & > li {
205
+
206
+ &>li {
182
207
  margin: @carousel-dots-marigin 0;
183
208
  width: @carousel-dots-height;
184
209
  height: @carousel-dots-width;
@@ -190,7 +215,8 @@
190
215
  flex-direction: row;
191
216
  left: 50%;
192
217
  transform: translateX(-50%);
193
- & > li {
218
+
219
+ &>li {
194
220
  margin: 0 @carousel-dots-marigin;
195
221
  height: @carousel-dots-height;
196
222
  width: @carousel-dots-width;
@@ -357,8 +357,10 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
357
357
  var value = _ref5[fieldNames.value];
358
358
  return value;
359
359
  });
360
- setCurrentOptions(selectedOptions);
361
- props.value === undefined && setValue(selectedValue);
360
+ if (typeof props.value === 'undefined') {
361
+ setCurrentOptions(selectedOptions);
362
+ setValue(selectedValue);
363
+ }
362
364
  props.onChange && props.onChange(selectedValue, selectedOptions);
363
365
  };
364
366
  var onVisibleChange = function onVisibleChange(visible) {
@@ -11,7 +11,7 @@ var __rest = this && this.__rest || function (s, e) {
11
11
  }
12
12
  return t;
13
13
  };
14
- import React, { useCallback, useContext, useEffect, useState, useRef } from 'react';
14
+ import React, { useContext, useEffect, useState, useRef } from 'react';
15
15
  import classNames from 'classnames';
16
16
  import { GroupContext, CheckboxTypes, CheckboxSizes } from './group';
17
17
  import ConfigContext from '../config-provider/ConfigContext';
@@ -63,20 +63,20 @@ var InternalCheckbox = function InternalCheckbox(props, ref) {
63
63
  var getIndeterminate = function getIndeterminate() {
64
64
  return selected ? false : indeterminate;
65
65
  };
66
- var getDefaultClassName = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(checkboxPrefixCls, "-")).call(_context, mergedSize), true && !!children), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(checkboxPrefixCls, "-")).call(_context2, mergedCheckboxType), true), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(checkboxPrefixCls, "-")).call(_context3, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames, "checked", selected), _classNames));
67
- var getSquareClassName = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), true && !!children), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
66
+ var getDefaultClassName = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames, "".concat(checkboxPrefixCls, "-no-child"), !children), _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(checkboxPrefixCls, "-")).call(_context, mergedSize), !!children), _defineProperty(_classNames, _concatInstanceProperty(_context2 = "".concat(checkboxPrefixCls, "-")).call(_context2, mergedCheckboxType), true), _defineProperty(_classNames, _concatInstanceProperty(_context3 = "".concat(checkboxPrefixCls, "-")).call(_context3, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames, "checked", selected), _classNames));
67
+ var getSquareClassName = classNames(className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(checkboxPrefixCls), true), _defineProperty(_classNames2, _concatInstanceProperty(_context4 = "".concat(checkboxPrefixCls, "-")).call(_context4, mergedCheckboxType), true), _defineProperty(_classNames2, _concatInstanceProperty(_context5 = "".concat(checkboxPrefixCls, "-")).call(_context5, mergedSize), !!children), _defineProperty(_classNames2, _concatInstanceProperty(_context6 = "".concat(checkboxPrefixCls, "-")).call(_context6, mergedCheckboxType, "-disabled"), mergedDisabled), _defineProperty(_classNames2, _concatInstanceProperty(_context7 = "".concat(checkboxPrefixCls, "-")).call(_context7, mergedCheckboxType, "-checked"), selected && !mergedDisabled), _defineProperty(_classNames2, "checked", selected), _classNames2));
68
68
  var getRootClassName = isDefaultType() ? getDefaultClassName : getSquareClassName;
69
69
  var inputClassName = classNames(_defineProperty({}, "".concat(checkboxPrefixCls, "-input"), true));
70
70
  var checkedWrapperClassName = classNames((_classNames4 = {}, _defineProperty(_classNames4, _concatInstanceProperty(_context8 = "".concat(checkboxPrefixCls, "-")).call(_context8, mergedCheckboxType, "-no-child"), !children), _defineProperty(_classNames4, _concatInstanceProperty(_context9 = "".concat(checkboxPrefixCls, "-")).call(_context9, mergedCheckboxType, "-wrapper"), true), _defineProperty(_classNames4, _concatInstanceProperty(_context10 = "".concat(checkboxPrefixCls, "-")).call(_context10, mergedCheckboxType, "-wrapper-size"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context11 = "".concat(checkboxPrefixCls, "-")).call(_context11, mergedCheckboxType, "-margin"), !!children), _defineProperty(_classNames4, _concatInstanceProperty(_context12 = "".concat(checkboxPrefixCls, "-")).call(_context12, mergedCheckboxType, "-checked"), selected), _defineProperty(_classNames4, _concatInstanceProperty(_context13 = "".concat(checkboxPrefixCls, "-")).call(_context13, mergedCheckboxType, "-indeterminate"), getIndeterminate()), _defineProperty(_classNames4, _concatInstanceProperty(_context14 = "".concat(checkboxPrefixCls, "-")).call(_context14, mergedCheckboxType, "-disabled"), mergedDisabled && !selected), _defineProperty(_classNames4, _concatInstanceProperty(_context15 = "".concat(checkboxPrefixCls, "-")).call(_context15, mergedCheckboxType, "-checked-disabled"), mergedDisabled && selected), _classNames4));
71
71
  var triangleClassName = classNames((_classNames5 = {}, _defineProperty(_classNames5, _concatInstanceProperty(_context16 = "".concat(checkboxPrefixCls, "-")).call(_context16, mergedCheckboxType, "-triangle"), !selected), _defineProperty(_classNames5, _concatInstanceProperty(_context17 = "".concat(checkboxPrefixCls, "-")).call(_context17, mergedCheckboxType, "-triangle-checked"), selected), _defineProperty(_classNames5, _concatInstanceProperty(_context18 = "".concat(checkboxPrefixCls, "-")).call(_context18, mergedCheckboxType, "-triangle-disabled"), mergedDisabled), _classNames5));
72
72
  var innerIconClassName = classNames(_defineProperty({}, _concatInstanceProperty(_context19 = "".concat(checkboxPrefixCls, "-")).call(_context19, mergedCheckboxType, "-inner"), true));
73
- var handleChange = useCallback(function (e) {
73
+ var handleChange = function handleChange(e) {
74
74
  onChange && onChange(e);
75
75
  (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange) && (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.onCheckboxGroupChange(value, e.target.checked, e));
76
76
  if (!(checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.isControlled)) {
77
77
  setSelected(e.target.checked);
78
78
  }
79
- }, [onChange]);
79
+ };
80
80
  useEffect(function () {
81
81
  isBoolean(checked) && checked !== selected && setSelected(checked);
82
82
  }, [checked, selected]);
@@ -141,6 +141,8 @@
141
141
  width: 100%;
142
142
  cursor: inherit;
143
143
  opacity: 0;
144
+ inset: 0;
145
+ z-index: 1;
144
146
  }
145
147
  .kd-checkbox-children {
146
148
  display: -webkit-inline-box;
@@ -32,6 +32,8 @@
32
32
  width: 100%;
33
33
  cursor: inherit;
34
34
  opacity: 0;
35
+ inset: 0;
36
+ z-index: 1;
35
37
  }
36
38
  &-children {
37
39
  display: inline-flex;
@@ -2,7 +2,7 @@
2
2
 
3
3
  @checkbox-prefix: '--@{kd-prefix}-c-checkbox';
4
4
 
5
- // colors
5
+ // color
6
6
  @checkbox-color-theme: var(~'@{checkbox-prefix}-color-theme', @color-theme);
7
7
  @checkbox-font-color: var(~'@{checkbox-prefix}-color-text-primary', #212121);
8
8
  @checkbox-border-color: var(~'@{checkbox-prefix}-color-border', #d9d9d9);
@@ -1,24 +1,4 @@
1
1
  import React from 'react';
2
- import CityPanelItem from './city-panel-item';
3
- import CityPanel, { Common, Group, List as CityList } from './city-panel';
4
- import SearchPanel from './city-search-panel';
5
- export interface CityPickerProps {
6
- cityList?: CityList;
7
- className?: string;
8
- commons?: Common;
9
- disabled?: boolean;
10
- groups?: Group;
11
- inputClassName?: string;
12
- inputStyle?: React.CSSProperties;
13
- placeholder?: string;
14
- showTitle?: boolean;
15
- style?: React.CSSProperties;
16
- title?: string;
17
- }
18
- export interface MenuType extends React.FC<CityPickerProps> {
19
- PanelItem: typeof CityPanelItem;
20
- Panel: typeof CityPanel;
21
- SearchPanel: typeof SearchPanel;
22
- }
23
- declare const CityPicker: MenuType;
24
- export default CityPicker;
2
+ import { CityPickerProps } from './interface';
3
+ declare const Select: React.ForwardRefExoticComponent<CityPickerProps & React.RefAttributes<unknown>>;
4
+ export default Select;