@kdcloudjs/kdesign 1.7.22 → 1.7.24

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 (108) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/kdesign-complete.less +75 -21
  3. package/dist/kdesign.css +79 -12
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +425 -180
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +4 -4
  8. package/dist/kdesign.min.js +8 -8
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/_utils/usePopper.js +36 -19
  11. package/es/button/style/index.css +3 -0
  12. package/es/button/style/index.less +3 -3
  13. package/es/button/style/mixin.less +2 -1
  14. package/es/button/style/token.less +3 -0
  15. package/es/checkbox/style/index.css +1 -0
  16. package/es/checkbox/style/index.less +1 -0
  17. package/es/checkbox/style/token.less +1 -0
  18. package/es/city-picker/city-picker.js +6 -3
  19. package/es/city-picker/interface.d.ts +1 -0
  20. package/es/city-picker/style/index.css +2 -0
  21. package/es/city-picker/style/index.less +1 -0
  22. package/es/filter/style/index.css +6 -0
  23. package/es/filter/style/index.less +7 -0
  24. package/es/filter/style/token.less +4 -0
  25. package/es/form/style/index.css +1 -1
  26. package/es/form/style/index.less +1 -1
  27. package/es/form/style/token.less +1 -1
  28. package/es/input-number/inputNumber.js +5 -2
  29. package/es/menu/style/index.css +2 -1
  30. package/es/menu/style/mixin.less +2 -1
  31. package/es/menu/style/token.less +2 -0
  32. package/es/radio/style/index.css +8 -0
  33. package/es/radio/style/index.less +6 -1
  34. package/es/radio/style/token.less +3 -0
  35. package/es/search/search.js +2 -1
  36. package/es/search/style/index.css +1 -0
  37. package/es/search/style/index.less +1 -0
  38. package/es/search/style/token.less +1 -0
  39. package/es/select/select.js +3 -2
  40. package/es/select/style/index.css +6 -3
  41. package/es/select/style/index.less +10 -4
  42. package/es/select/style/token.less +1 -1
  43. package/es/style/core/motion/slide.less +5 -2
  44. package/es/style/index.css +36 -4
  45. package/es/table/api.js +19 -3
  46. package/es/tag/style/index.css +6 -0
  47. package/es/tag/style/index.less +3 -3
  48. package/es/tag/style/mixin.less +3 -1
  49. package/es/tag/style/token.less +2 -0
  50. package/es/timeline/style/index.css +2 -0
  51. package/es/timeline/style/index.less +3 -0
  52. package/es/timeline/style/token.less +2 -0
  53. package/es/transfer/style/index.css +2 -2
  54. package/es/transfer/style/index.less +2 -2
  55. package/es/transfer/style/token.less +1 -0
  56. package/es/tree/style/index.css +2 -0
  57. package/es/tree/style/index.less +2 -0
  58. package/es/tree/style/token.less +2 -0
  59. package/lib/_utils/usePopper.js +36 -19
  60. package/lib/button/style/index.css +3 -0
  61. package/lib/button/style/index.less +3 -3
  62. package/lib/button/style/mixin.less +2 -1
  63. package/lib/button/style/token.less +3 -0
  64. package/lib/checkbox/style/index.css +1 -0
  65. package/lib/checkbox/style/index.less +1 -0
  66. package/lib/checkbox/style/token.less +1 -0
  67. package/lib/city-picker/city-picker.js +6 -3
  68. package/lib/city-picker/interface.d.ts +1 -0
  69. package/lib/city-picker/style/index.css +2 -0
  70. package/lib/city-picker/style/index.less +1 -0
  71. package/lib/filter/style/index.css +6 -0
  72. package/lib/filter/style/index.less +7 -0
  73. package/lib/filter/style/token.less +4 -0
  74. package/lib/form/style/index.css +1 -1
  75. package/lib/form/style/index.less +1 -1
  76. package/lib/form/style/token.less +1 -1
  77. package/lib/input-number/inputNumber.js +5 -2
  78. package/lib/menu/style/index.css +2 -1
  79. package/lib/menu/style/mixin.less +2 -1
  80. package/lib/menu/style/token.less +2 -0
  81. package/lib/radio/style/index.css +8 -0
  82. package/lib/radio/style/index.less +6 -1
  83. package/lib/radio/style/token.less +3 -0
  84. package/lib/search/search.js +2 -1
  85. package/lib/search/style/index.css +1 -0
  86. package/lib/search/style/index.less +1 -0
  87. package/lib/search/style/token.less +1 -0
  88. package/lib/select/select.js +3 -2
  89. package/lib/select/style/index.css +6 -3
  90. package/lib/select/style/index.less +10 -4
  91. package/lib/select/style/token.less +1 -1
  92. package/lib/style/core/motion/slide.less +5 -2
  93. package/lib/style/index.css +36 -4
  94. package/lib/table/api.js +19 -3
  95. package/lib/tag/style/index.css +6 -0
  96. package/lib/tag/style/index.less +3 -3
  97. package/lib/tag/style/mixin.less +3 -1
  98. package/lib/tag/style/token.less +2 -0
  99. package/lib/timeline/style/index.css +2 -0
  100. package/lib/timeline/style/index.less +3 -0
  101. package/lib/timeline/style/token.less +2 -0
  102. package/lib/transfer/style/index.css +2 -2
  103. package/lib/transfer/style/index.less +2 -2
  104. package/lib/transfer/style/token.less +1 -0
  105. package/lib/tree/style/index.css +2 -0
  106. package/lib/tree/style/index.less +2 -0
  107. package/lib/tree/style/token.less +2 -0
  108. package/package.json +2 -2
@@ -200,6 +200,7 @@
200
200
  padding: 8px 0;
201
201
  max-height: 320px;
202
202
  overflow-y: auto;
203
+ box-sizing: content-box;
203
204
 
204
205
  // 下拉列表选项
205
206
  &-item {
@@ -145,6 +145,7 @@
145
145
  white-space: nowrap;
146
146
  overflow: hidden;
147
147
  text-overflow: ellipsis;
148
+ display: block;
148
149
  }
149
150
  .kd-filter .kd-filter-header-search {
150
151
  min-width: 200px;
@@ -240,6 +241,7 @@
240
241
  padding: 11px 0 10px;
241
242
  color: var(--kd-g-color-text-third, #999);
242
243
  line-height: 18px;
244
+ width: var(--kd-c-filter-body-condition-label-width);
243
245
  }
244
246
  .kd-filter .kd-filter-body-condition-options {
245
247
  display: -webkit-box;
@@ -269,6 +271,10 @@
269
271
  border: 1px solid transparent;
270
272
  cursor: pointer;
271
273
  white-space: nowrap;
274
+ max-width: var(--kd-c-filter-body-condition-option-max-width);
275
+ overflow: hidden;
276
+ display: inline-block;
277
+ text-overflow: ellipsis;
272
278
  }
273
279
  .kd-filter .kd-filter-body-condition-option:not(:last-child) {
274
280
  margin-right: 24px;
@@ -36,6 +36,7 @@
36
36
  &-item-text {
37
37
  max-width: 224px;
38
38
  .ellipsis;
39
+ display: block;
39
40
  }
40
41
  }
41
42
 
@@ -130,6 +131,7 @@
130
131
  padding: 11px 0 10px;
131
132
  color: @color-text-third;
132
133
  line-height: 18px;
134
+ width: @filter-body-condition-label-width;
133
135
  }
134
136
 
135
137
  &-options {
@@ -154,6 +156,11 @@
154
156
  border: 1px solid transparent;
155
157
  cursor: pointer;
156
158
  white-space: nowrap;
159
+ max-width: @filter-body-condition-option-max-width;
160
+ overflow: hidden;
161
+ display: inline-block;
162
+ text-overflow: ellipsis;
163
+
157
164
 
158
165
  &:not(:last-child) {
159
166
  margin-right: 24px;
@@ -26,3 +26,7 @@
26
26
  @filter-condition-label-font-size: var(~'@{filter-custom-prefix}-condition-label-font-size', @font-size-middle);
27
27
  @filter-handle-font-size: var(~'@{filter-custom-prefix}-handle-font-size', @font-size-middle);
28
28
  @filter-body-tabs-item-font-size: var(~'@{filter-custom-prefix}-body-tabs-item-font-size', @font-size-middle);
29
+
30
+ //sizing
31
+ @filter-body-condition-label-width: var(~'@{filter-custom-prefix}-body-condition-label-width');
32
+ @filter-body-condition-option-max-width: var(~'@{filter-custom-prefix}-body-condition-option-max-width');
@@ -147,7 +147,7 @@
147
147
  flex-direction: column;
148
148
  }
149
149
  .kd-form-field-vertical .kd-form-field-label {
150
- margin-bottom: 5px;
150
+ margin-bottom: var(--kd-c-form-field-label-spacing-margin-bottom, 5px);
151
151
  }
152
152
  .kd-form-field-hidden {
153
153
  display: none !important;
@@ -39,7 +39,7 @@
39
39
  flex-direction: column;
40
40
 
41
41
  .@{field-label-cls} {
42
- margin-bottom: 5px;
42
+ margin-bottom: @form-field-label-spacing-margin-bottom;
43
43
  }
44
44
  }
45
45
 
@@ -19,4 +19,4 @@
19
19
  @form-field-spacing-margin-bottom: var(~'@{form-prefix}-field-spacing-margin-bottom', 22px);
20
20
  @form-field-message-spacing-padding-horizontal: var(~'@{form-prefix}-field-message-spacing-padding-horizontal', 2px);
21
21
  @form-field-message-spacing-padding-vertical: var(~'@{form-prefix}-field-message-spacing-padding-vertical', 8px);
22
-
22
+ @form-field-label-spacing-margin-bottom: var(~'@{form-prefix}-field-label-spacing-margin-bottom', 5px);
@@ -61,7 +61,8 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
61
61
  suffix = inputNumberProps.suffix,
62
62
  formatter = inputNumberProps.formatter,
63
63
  className = inputNumberProps.className,
64
- others = __rest(inputNumberProps, ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className"]);
64
+ onKeyDown = inputNumberProps.onKeyDown,
65
+ others = __rest(inputNumberProps, ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className", "onKeyDown"]);
65
66
  var initVal = value === undefined ? defaultValue : value;
66
67
  var _useState = (0, _react.useState)((0, _numberUtil.serialization)(initVal !== undefined ? initVal + '' : '')),
67
68
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -185,12 +186,13 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
185
186
  return resultNumerical;
186
187
  };
187
188
  var handleStepChang = function handleStepChang(type) {
189
+ var _a, _b;
188
190
  var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
189
191
  if (typeof step !== 'number') {
190
192
  (0, _devwarning.default)(true, 'inputNumber', "stepOption.step\u5FC5\u987B\u4E3A\u4E00\u4E2A\u6570\u503C");
191
193
  return false;
192
194
  }
193
- var startingNumber = parseFloat(inputNumberRef.current.value) || 0;
195
+ var startingNumber = parseFloat((_b = (_a = inputNumberRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value) || 0;
194
196
  var calculationResults = new _big.default(startingNumber)[type](step).valueOf();
195
197
  var legalNumber = verifiValue(calculationResults);
196
198
  if (legalNumber === false) {
@@ -205,6 +207,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
205
207
  };
206
208
  var handleKeyDown = function handleKeyDown(event) {
207
209
  var _context11;
210
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
208
211
  if (!stepOption || props.disabled || props.readOnly) {
209
212
  return;
210
213
  }
@@ -192,7 +192,8 @@
192
192
  position: relative;
193
193
  width: 100%;
194
194
  height: 100%;
195
- min-width: 138px;
195
+ min-width: var(--kd-c-menu-sizing-min-width, 138px);
196
+ max-width: var(--kd-c-menu-sizing-max-width);
196
197
  background-color: var(--kd-c-menu-color-background, #343848);
197
198
  color: var(--kd-c-menu-sub-color-text, rgba(255, 255, 255, 0.65));
198
199
  }
@@ -10,7 +10,8 @@
10
10
  position: relative;
11
11
  width: 100%;
12
12
  height: 100%;
13
- min-width: 138px;
13
+ min-width: @menu-min-width;
14
+ max-width: @menu-max-width;
14
15
  background-color: @menu-color-background;
15
16
  color: @menu-sub-color;
16
17
  }
@@ -25,6 +25,8 @@
25
25
  @menu-motion-duration: var(~'@{menu-prefix}-motion-duration', @duration-promptly);
26
26
 
27
27
  // sizing
28
+ @menu-max-width: var(~'@{menu-prefix}-sizing-max-width');
29
+ @menu-min-width: var(~'@{menu-prefix}-sizing-min-width',138px);
28
30
  @menu-item-height: var(~'@{menu-prefix}-item-sizing-height', 50px);
29
31
 
30
32
  // z-index
@@ -125,6 +125,9 @@
125
125
  vertical-align: middle;
126
126
  color: var(--kd-c-radio-color-font, var(--kd-g-color-text-primary, #212121));
127
127
  font-size: var(--kd-c-radio-font-size, var(--kd-g-font-size-small, 12px));
128
+ max-width: var(--kd-c-radio-default-label-max-width);
129
+ overflow: hidden;
130
+ min-height: var(--kd-c-radio-square-sizing-width-height, 14px);
128
131
  }
129
132
  .kd-radio::before {
130
133
  position: absolute;
@@ -256,6 +259,7 @@
256
259
  border: var(--kd-c-radio-radius-border-width, 1px) solid var(--kd-c-radio-color-border, var(--kd-g-color-border-strong, #d9d9d9));
257
260
  -webkit-transition: all 0.3s;
258
261
  transition: all 0.3s;
262
+ max-width: var(--kd-c-radio-square-label-max-width);
259
263
  }
260
264
  .kd-radio-square::after {
261
265
  position: absolute;
@@ -348,6 +352,9 @@
348
352
  list-style: none;
349
353
  -webkit-font-feature-settings: 'tnum';
350
354
  font-feature-settings: 'tnum';
355
+ white-space: nowrap;
356
+ overflow: hidden;
357
+ text-overflow: ellipsis;
351
358
  position: relative;
352
359
  display: inline-block;
353
360
  height: var(--kd-c-radio-square-sizing-height, 32px);
@@ -365,6 +372,7 @@
365
372
  border-left: none;
366
373
  -webkit-transition: all 0.3s;
367
374
  transition: all 0.3s;
375
+ max-width: var(--kd-c-radio-button-label-max-width);
368
376
  }
369
377
  .kd-radio-button:first-child {
370
378
  border-radius: 2px 0 0 2px;
@@ -22,6 +22,9 @@
22
22
  vertical-align: middle;
23
23
  color: @radio-font-color;
24
24
  font-size: @radio-font-size;
25
+ max-width: @radio-default-label-max-width;
26
+ overflow: hidden;
27
+ min-height: @radio-circle-size;
25
28
 
26
29
  &::before {
27
30
  position: absolute;
@@ -152,6 +155,7 @@
152
155
  border-radius: @radius-size;
153
156
  border: @radio-border-width solid @radio-color-border;
154
157
  transition: all @transition-duration;
158
+ max-width: @radio-square-label-max-width;
155
159
 
156
160
  &::after {
157
161
  position: absolute;
@@ -241,7 +245,7 @@
241
245
  // 按钮类型(切换按钮)
242
246
  .@{radio-button-prefix-cls} {
243
247
  .reset-component();
244
-
248
+ .ellipsis();
245
249
  // 默认状态
246
250
  position: relative;
247
251
  display: inline-block;
@@ -259,6 +263,7 @@
259
263
  border: @radio-border-width solid @radio-color-border;
260
264
  border-left: none;
261
265
  transition: all @transition-duration;
266
+ max-width: @radio-button-label-max-width;
262
267
 
263
268
  &:first-child {
264
269
  border-radius: @radius-size 0 0 @radius-size;
@@ -22,6 +22,9 @@
22
22
  // sizing
23
23
  @radio-circle-size:var(~'@{radio-prefix}-square-sizing-width-height',14px);//单选图标大小
24
24
  @radio-square-height: var(~'@{radio-prefix}-square-sizing-height',32px);//单选框 高度
25
+ @radio-default-label-max-width: var(~'@{radio-prefix}-default-label-max-width');//单选默认模式 最大宽度
26
+ @radio-square-label-max-width: var(~'@{radio-prefix}-square-label-max-width');//单选框模式 最大宽度
27
+ @radio-button-label-max-width: var(~'@{radio-prefix}-button-label-max-width');//单选按 最大宽度
25
28
 
26
29
  // spacing
27
30
  @radio-margin-right: var(~'@{radio-prefix}-spacing-margin-right',8px);
@@ -71,7 +71,8 @@ var InternalSearch = function InternalSearch(props, ref) {
71
71
  onSearch && (onSearch === null || onSearch === void 0 ? void 0 : onSearch(event));
72
72
  }, [onSearch]);
73
73
  var handlePressEnter = (0, _react.useCallback)(function (_, event) {
74
- onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(searchRef.current.value, event));
74
+ var _a, _b;
75
+ onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter((_b = (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, event));
75
76
  }, [onPressEnter, searchRef]);
76
77
  var handleFocus = (0, _react.useCallback)(function (event) {
77
78
  setFocused(true);
@@ -335,6 +335,7 @@
335
335
  overflow: hidden;
336
336
  white-space: nowrap;
337
337
  text-overflow: ellipsis;
338
+ max-width: var(--kd-c-search-tag-sizing-max-width);
338
339
  }
339
340
  .kd-quick-search-selection-overflow-item-del {
340
341
  height: 14px;
@@ -140,6 +140,7 @@
140
140
  padding: 0 4px;
141
141
  align-self: center;
142
142
  .ellipsis();
143
+ max-width: @search-tag-max-width;
143
144
  }
144
145
  &-del {
145
146
  height: 14px;
@@ -14,6 +14,7 @@
14
14
  @search-panel-height: var(~'@{search-prefix}-panel-sizing-height', 60px);
15
15
  @quick-search-dropdown-option-height: var(~'@{search-prefix}-dropdown-option-sizing-height', 32px);
16
16
  @search-sizing-border-width: var(~'@{search-prefix}-sizing-border-width', 1px);
17
+ @search-tag-max-width: var(~'@{search-prefix}-tag-sizing-max-width');
17
18
 
18
19
  // color
19
20
  @search-icon-color: var(~'@{search-prefix}-icon-color', #B2B2B2);
@@ -34,7 +34,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "functi
34
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
  var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
36
36
  var InternalSelect = function InternalSelect(props, ref) {
37
- var _context, _classNames6, _classNames12;
37
+ var _context, _classNames6, _classNames12, _context5;
38
38
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
39
39
  getPrefixCls = _useContext.getPrefixCls,
40
40
  prefixCls = _useContext.prefixCls,
@@ -806,6 +806,7 @@ var InternalSelect = function InternalSelect(props, ref) {
806
806
  offset = 1;
807
807
  } else if (which === _KeyCode.default.ENTER) {
808
808
  var item = filledOptions[activeIndex];
809
+ if (!item) return;
809
810
  var key = ((_a = item.props) === null || _a === void 0 ? void 0 : _a.value) || item.value;
810
811
  var label = ((_b = item.props) === null || _b === void 0 ? void 0 : _b.children) || item.label;
811
812
  handleOption(key, label, true);
@@ -881,7 +882,7 @@ var InternalSelect = function InternalSelect(props, ref) {
881
882
  }
882
883
  };
883
884
  var popperProps = (0, _extends2.default)((0, _extends2.default)({}, selectProps), {
884
- prefixCls: selectPrefixCls,
885
+ prefixCls: (0, _concat.default)(_context5 = "".concat(selectPrefixCls, "-dropdown-panel")).call(_context5, isMultiple ? " ".concat(selectPrefixCls, "-multiple-dropdown-panel") : ''),
885
886
  placement: 'bottomLeft',
886
887
  popperStyle: catchStyle(),
887
888
  defaultVisible: optionShow,
@@ -359,7 +359,7 @@
359
359
  z-index: var(--kd-c-select-z-index, var(--kd-g-z-index-popper, 1050));
360
360
  -webkit-box-sizing: border-box;
361
361
  box-sizing: border-box;
362
- padding: 8px 0;
362
+ padding: var(--kd-c-select-dropdown-spacing-padding-vertical, 8px) 0;
363
363
  margin: 0;
364
364
  overflow: auto;
365
365
  font-size: var(--kd-c-select-dropdown-font-size, 12px);
@@ -382,6 +382,9 @@
382
382
  .kd-select-dropdown-search-hidden {
383
383
  display: none;
384
384
  }
385
+ .kd-select-multiple-dropdown-panel .kd-select-dropdown {
386
+ padding-bottom: 0;
387
+ }
385
388
  .kd-select-item {
386
389
  position: relative;
387
390
  display: block;
@@ -648,8 +651,8 @@
648
651
  align-items: center;
649
652
  width: 100%;
650
653
  padding: 0 12px;
651
- height: 32px;
652
- line-height: 32px;
654
+ height: 40px;
655
+ line-height: 40px;
653
656
  border-top: 1px solid #d9d9d9;
654
657
  -webkit-box-sizing: border-box;
655
658
  box-sizing: border-box;
@@ -132,10 +132,10 @@
132
132
  left: 0;
133
133
  z-index: @select-z-index;
134
134
  box-sizing: border-box;
135
- padding: 8px 0; // update
135
+ padding: @select-dropdown-padding-vertical 0;
136
136
  margin: 0;
137
137
  overflow: auto;
138
- font-size: @select-list-font-size; // update
138
+ font-size: @select-list-font-size;
139
139
  font-variant: initial;
140
140
  background-color: @select-dropdown-bg;
141
141
  border-radius: @select-g-radius-border;
@@ -159,6 +159,12 @@
159
159
  }
160
160
  }
161
161
 
162
+ &-multiple-dropdown-panel {
163
+ .@{select-prefix-cls}-dropdown {
164
+ padding-bottom: 0;
165
+ }
166
+ }
167
+
162
168
  // 下拉列表选项
163
169
  &-item {
164
170
  .item();
@@ -404,8 +410,8 @@
404
410
  align-items: center;
405
411
  width: 100%;
406
412
  padding: 0 12px;
407
- height: 32px;
408
- line-height: 32px;
413
+ height: 40px;
414
+ line-height: 40px;
409
415
  border-top: 1px solid #d9d9d9;
410
416
  box-sizing: border-box;
411
417
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  @select-custom-prefix: ~'--@{kd-prefix}-c-select';
4
4
 
5
-
6
5
  // color
7
6
  @select-dropdown-bg: var(~'@{select-custom-prefix}-dropdown-color-background', @color-background);
8
7
  @select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled', #fff);
@@ -45,6 +44,7 @@
45
44
  // spacing
46
45
  @select-bordered: var(~'@{select-custom-prefix}-bordered-spacing-padding-left', 8px);
47
46
  @select-wrapper-padding: var(~'@{select-custom-prefix}-wrapper-spacing-padding', 1px 28px 1px 0);
47
+ @select-dropdown-padding-vertical: var(~'@{select-custom-prefix}-dropdown-spacing-padding-vertical', 8px);
48
48
 
49
49
  // radius
50
50
  @select-g-radius-border: var(~'@{select-custom-prefix}-radius-border', @radius-border);
@@ -31,12 +31,15 @@
31
31
  .slide-motion(topLeft, kdSlideDown, kd-cascader-menus);
32
32
  .slide-motion(bottomLeft, kdSlideUp, kd-cascader-menus);
33
33
 
34
- .slide-motion(topLeft, kdSlideDown, kd-select);
35
- .slide-motion(bottomLeft, kdSlideUp, kd-select);
34
+ .slide-motion(topLeft, kdSlideDown, kd-select-dropdown-panel);
35
+ .slide-motion(bottomLeft, kdSlideUp, kd-select-dropdown-panel);
36
36
 
37
37
  .slide-motion(topLeft, kdSlideDown, kd-date-picker-panel);
38
38
  .slide-motion(bottomLeft, kdSlideUp, kd-date-picker-panel);
39
39
 
40
+ .slide-motion(topLeft, kdSlideDown, kd-city-picker-dropdown);
41
+ .slide-motion(bottomLeft, kdSlideUp, kd-city-picker-dropdown);
42
+
40
43
  @keyframes kdSlideCenterIn {
41
44
  0% {
42
45
  opacity: 0;
@@ -1361,7 +1361,7 @@
1361
1361
  -webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1362
1362
  animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1363
1363
  }
1364
- .kd-select.topLeft-active {
1364
+ .kd-select-dropdown-panel.topLeft-active {
1365
1365
  -webkit-animation-name: kdSlideDownIn;
1366
1366
  animation-name: kdSlideDownIn;
1367
1367
  -webkit-animation-duration: calc(0.3s - 0.1s);
@@ -1369,7 +1369,7 @@
1369
1369
  -webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1370
1370
  animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1371
1371
  }
1372
- .kd-select.topLeft.hidden {
1372
+ .kd-select-dropdown-panel.topLeft.hidden {
1373
1373
  -webkit-animation-name: kdSlideDownOut;
1374
1374
  animation-name: kdSlideDownOut;
1375
1375
  -webkit-animation-duration: 0.1s;
@@ -1377,7 +1377,7 @@
1377
1377
  -webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1378
1378
  animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1379
1379
  }
1380
- .kd-select.bottomLeft-active {
1380
+ .kd-select-dropdown-panel.bottomLeft-active {
1381
1381
  -webkit-animation-name: kdSlideUpIn;
1382
1382
  animation-name: kdSlideUpIn;
1383
1383
  -webkit-animation-duration: calc(0.3s - 0.1s);
@@ -1385,7 +1385,7 @@
1385
1385
  -webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1386
1386
  animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1387
1387
  }
1388
- .kd-select.bottomLeft.hidden {
1388
+ .kd-select-dropdown-panel.bottomLeft.hidden {
1389
1389
  -webkit-animation-name: kdSlideUpOut;
1390
1390
  animation-name: kdSlideUpOut;
1391
1391
  -webkit-animation-duration: 0.1s;
@@ -1425,6 +1425,38 @@
1425
1425
  -webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1426
1426
  animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1427
1427
  }
1428
+ .kd-city-picker-dropdown.topLeft-active {
1429
+ -webkit-animation-name: kdSlideDownIn;
1430
+ animation-name: kdSlideDownIn;
1431
+ -webkit-animation-duration: calc(0.3s - 0.1s);
1432
+ animation-duration: calc(0.3s - 0.1s);
1433
+ -webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1434
+ animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1435
+ }
1436
+ .kd-city-picker-dropdown.topLeft.hidden {
1437
+ -webkit-animation-name: kdSlideDownOut;
1438
+ animation-name: kdSlideDownOut;
1439
+ -webkit-animation-duration: 0.1s;
1440
+ animation-duration: 0.1s;
1441
+ -webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1442
+ animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1443
+ }
1444
+ .kd-city-picker-dropdown.bottomLeft-active {
1445
+ -webkit-animation-name: kdSlideUpIn;
1446
+ animation-name: kdSlideUpIn;
1447
+ -webkit-animation-duration: calc(0.3s - 0.1s);
1448
+ animation-duration: calc(0.3s - 0.1s);
1449
+ -webkit-animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1450
+ animation-timing-function: cubic-bezier(0, 0.4, 0.4, 1);
1451
+ }
1452
+ .kd-city-picker-dropdown.bottomLeft.hidden {
1453
+ -webkit-animation-name: kdSlideUpOut;
1454
+ animation-name: kdSlideUpOut;
1455
+ -webkit-animation-duration: 0.1s;
1456
+ animation-duration: 0.1s;
1457
+ -webkit-animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1458
+ animation-timing-function: cubic-bezier(0.4, 0, 1, 0.6);
1459
+ }
1428
1460
  @-webkit-keyframes kdSlideCenterIn {
1429
1461
  0% {
1430
1462
  opacity: 0;
package/lib/table/api.js CHANGED
@@ -84,7 +84,7 @@ function getApi(pipelineRef) {
84
84
  * @returns
85
85
  */
86
86
  function ensureColumnVisible(code) {
87
- var _a, _b;
87
+ var _a, _b, _c, _d;
88
88
  var pipeline = pipelineRef.current;
89
89
  var tableBodyContainer = (_a = pipeline.ref) === null || _a === void 0 ? void 0 : _a.current.domHelper.tableBody;
90
90
  var tableScroll = (_b = pipeline.ref) === null || _b === void 0 ? void 0 : _b.current.domHelper.stickyScroll;
@@ -100,14 +100,30 @@ function getApi(pipelineRef) {
100
100
  var colLeft = (0, _slice.default)(columnNodes).call(columnNodes, 0, index).reduce(function (acc, col) {
101
101
  return acc + col.width;
102
102
  }, 0);
103
+ var lockColumnLeft = 0;
104
+ var lockColumnRight = 0;
105
+ for (var i = 0; i < columnNodes.length; i++) {
106
+ if ((_c = columnNodes[i]) === null || _c === void 0 ? void 0 : _c.lock) {
107
+ lockColumnLeft += columnNodes[i].width;
108
+ } else {
109
+ break;
110
+ }
111
+ }
112
+ for (var _i = columnNodes.length - 1; _i >= 0; _i--) {
113
+ if ((_d = columnNodes[_i]) === null || _d === void 0 ? void 0 : _d.lock) {
114
+ lockColumnRight += columnNodes[_i].width;
115
+ } else {
116
+ break;
117
+ }
118
+ }
103
119
  var colLeftPixel = colLeft; // 目标列前面列宽总和
104
120
  var colRightPixel = colLeftPixel + column.width;
105
121
  var viewportWidth = tableBodyContainer.clientWidth; // 表体容器的宽度
106
122
  var scrollPosition = tableScroll.scrollLeft; // 滚动条滚动的距离
107
123
  var vScrollLeft = scrollPosition;
108
124
  var vScrollRight = scrollPosition + viewportWidth;
109
- var pxLeft = colLeftPixel;
110
- var pxRight = colRightPixel - viewportWidth;
125
+ var pxLeft = colLeftPixel - lockColumnLeft;
126
+ var pxRight = colRightPixel - viewportWidth + lockColumnRight;
111
127
  var colBeforeViewport = vScrollLeft > colLeftPixel; // 滚动距离大于目标列前面列宽总和,说明目标列在视口之前
112
128
  var colPastViewport = vScrollRight < colRightPixel; // 目标列是视口之后
113
129
  var colToSmallForViewport = viewportWidth < column.width;
@@ -126,6 +126,8 @@
126
126
  vertical-align: middle;
127
127
  padding: 0 var(--kd-c-tag-spacing-padding-horizontal-small, 6px);
128
128
  border-radius: calc(var(--kd-c-tag-sizing-height-small, 20px) / 2);
129
+ max-width: var(--kd-c-tag-sizing-max-width);
130
+ min-width: var(--kd-c-tag-sizing-min-width);
129
131
  }
130
132
  .kd-tag-size-middle {
131
133
  font-size: var(--kd-c-tag-font-size-middle, var(--kd-g-font-size-small, 12px));
@@ -141,6 +143,8 @@
141
143
  vertical-align: middle;
142
144
  padding: 0 var(--kd-c-tag-spacing-padding-horizontal-middle, 7px);
143
145
  border-radius: calc(var(--kd-c-tag-sizing-height-middle, 20px) / 2);
146
+ max-width: var(--kd-c-tag-sizing-max-width);
147
+ min-width: var(--kd-c-tag-sizing-min-width);
144
148
  }
145
149
  .kd-tag-size-large {
146
150
  font-size: var(--kd-c-tag-font-size-large, var(--kd-g-font-size-middle, 14px));
@@ -156,6 +160,8 @@
156
160
  vertical-align: middle;
157
161
  padding: 0 var(--kd-c-tag-spacing-padding-horizontal-large, 8px);
158
162
  border-radius: calc(var(--kd-c-tag-sizing-height-large, 24px) / 2);
163
+ max-width: var(--kd-c-tag-sizing-max-width);
164
+ min-width: var(--kd-c-tag-sizing-min-width);
159
165
  }
160
166
  .kd-tag-shape-status {
161
167
  border: 1px solid var(--kd-c-tag-color-process, var(--kd-g-color-ongoing, #276ff5));
@@ -14,15 +14,15 @@
14
14
  }
15
15
 
16
16
  &-size-small {
17
- .tag-size(@tag-small-font-size, @tag-small-height, @tag-small-padding-horizontal);
17
+ .tag-size(@tag-small-font-size, @tag-small-height, @tag-small-padding-horizontal, @tag-max-width, @tag-min-width);
18
18
  }
19
19
 
20
20
  &-size-middle {
21
- .tag-size(@tag-middle-font-size, @tag-middle-height, @tag-middle-padding-horizontal);
21
+ .tag-size(@tag-middle-font-size, @tag-middle-height, @tag-middle-padding-horizontal, @tag-max-width, @tag-min-width);
22
22
  }
23
23
 
24
24
  &-size-large {
25
- .tag-size(@tag-large-font-size, @tag-large-height, @tag-large-padding-horizontal);
25
+ .tag-size(@tag-large-font-size, @tag-large-height, @tag-large-padding-horizontal, @tag-max-width, @tag-min-width);
26
26
  }
27
27
 
28
28
  transition: all @tag-g-motion-duration;
@@ -1,7 +1,7 @@
1
1
  @import './token.less';
2
2
 
3
3
  // code component mixin here
4
- .tag-size(@size, @height, @padding) {
4
+ .tag-size(@size, @height, @padding, @max-width, @min-width) {
5
5
  font-size: @size;
6
6
  height: @height;
7
7
  box-sizing: border-box;
@@ -10,6 +10,8 @@
10
10
  vertical-align: middle;
11
11
  padding: 0 @padding;
12
12
  border-radius: calc(@height / 2);
13
+ max-width: @max-width;
14
+ min-width: @min-width;
13
15
  }
14
16
  .tag-status(@color) {
15
17
  border: 1px solid @color;
@@ -35,6 +35,8 @@
35
35
  @tag-small-height: var(~'@{tag-custom-prefix}-sizing-height-small', 20px);
36
36
  @tag-middle-height: var(~'@{tag-custom-prefix}-sizing-height-middle', 20px);
37
37
  @tag-large-height: var(~'@{tag-custom-prefix}-sizing-height-large', 24px);
38
+ @tag-max-width: var(~'@{tag-custom-prefix}-sizing-max-width');
39
+ @tag-min-width: var(~'@{tag-custom-prefix}-sizing-min-width');
38
40
 
39
41
  // spacing
40
42
  @tag-small-padding-horizontal: var(~'@{tag-custom-prefix}-spacing-padding-horizontal-small', 6px);
@@ -189,6 +189,8 @@
189
189
  margin: 0 0 0 calc(2 * (var(--kd-c-timeline-dot-sizing, 9px) - var(--kd-c-timeline-sizing-width, 1px)) + 8px);
190
190
  word-break: break-word;
191
191
  color: var(--kd-c-timeline-content-color-text, var(--kd-g-color-text-primary, #212121));
192
+ max-width: var(--kd-c-timeline-content-sizing-max-width);
193
+ min-width: var(--kd-c-timeline-content-sizing-min-width);
192
194
  }
193
195
  .kd-timeline .kd-timeline-item-content > * {
194
196
  margin: 0;
@@ -13,6 +13,7 @@
13
13
  overflow: hidden;
14
14
  list-style: none;
15
15
 
16
+
16
17
  .@{timeline-item-prefix-cls} {
17
18
  .reset-component;
18
19
  position: relative;
@@ -84,6 +85,8 @@
84
85
  margin: 0 0 0 calc(2 * (@timeline-dot-size - @timeline-width) + @timeline-gap);
85
86
  word-break: break-word;
86
87
  color: @timeline-content-color-text;
88
+ max-width: @timeline-content-max-width;
89
+ min-width: @timeline-content-min-width;
87
90
 
88
91
  > * {
89
92
  margin: 0;
@@ -21,6 +21,8 @@
21
21
 
22
22
  // sizing
23
23
  @timeline-width: var(~'@{timeline-prefix}-sizing-width',1px);
24
+ @timeline-content-max-width: var(~'@{timeline-prefix}-content-sizing-max-width');
25
+ @timeline-content-min-width: var(~'@{timeline-prefix}-content-sizing-min-width');
24
26
 
25
27
  // spacing
26
28
  @timeline-item-padding-bottom: var(~'@{timeline-prefix}-spacing-padding-bottom',24px);