@kdcloudjs/kdesign 1.7.23 → 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 (42) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/kdesign-complete.less +18 -7
  3. package/dist/kdesign.css +46 -8
  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/city-picker/city-picker.js +6 -3
  12. package/es/city-picker/interface.d.ts +1 -0
  13. package/es/city-picker/style/index.css +2 -0
  14. package/es/city-picker/style/index.less +1 -0
  15. package/es/input-number/inputNumber.js +5 -2
  16. package/es/radio/style/index.css +1 -0
  17. package/es/radio/style/index.less +1 -0
  18. package/es/search/search.js +2 -1
  19. package/es/select/select.js +3 -2
  20. package/es/select/style/index.css +6 -3
  21. package/es/select/style/index.less +10 -4
  22. package/es/select/style/token.less +1 -1
  23. package/es/style/core/motion/slide.less +5 -2
  24. package/es/style/index.css +36 -4
  25. package/es/table/api.js +19 -3
  26. package/lib/_utils/usePopper.js +36 -19
  27. package/lib/city-picker/city-picker.js +6 -3
  28. package/lib/city-picker/interface.d.ts +1 -0
  29. package/lib/city-picker/style/index.css +2 -0
  30. package/lib/city-picker/style/index.less +1 -0
  31. package/lib/input-number/inputNumber.js +5 -2
  32. package/lib/radio/style/index.css +1 -0
  33. package/lib/radio/style/index.less +1 -0
  34. package/lib/search/search.js +2 -1
  35. package/lib/select/select.js +3 -2
  36. package/lib/select/style/index.css +6 -3
  37. package/lib/select/style/index.less +10 -4
  38. package/lib/select/style/token.less +1 -1
  39. package/lib/style/core/motion/slide.less +5 -2
  40. package/lib/style/index.css +36 -4
  41. package/lib/table/api.js +19 -3
  42. package/package.json +2 -2
@@ -100,6 +100,19 @@ var getScrollDist = function getScrollDist(el, container) {
100
100
  }
101
101
  return elScroll;
102
102
  };
103
+ var getRealDom = function getRealDom(locatorRef, locatorElement) {
104
+ var _a;
105
+ if (!locatorRef.current) return locatorRef.current;
106
+ var REF_NAME_OBJ = {
107
+ Input: 'input',
108
+ InputNumber: 'input',
109
+ Select: 'select',
110
+ Upload: 'input'
111
+ };
112
+ if (locatorRef.current.tagName) return locatorRef.current;
113
+ var name = REF_NAME_OBJ[(_a = locatorElement === null || locatorElement === void 0 ? void 0 : locatorElement.type) === null || _a === void 0 ? void 0 : _a.displayName];
114
+ return locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current[name];
115
+ };
103
116
  function usePopper(locatorElement, popperElement, props) {
104
117
  var _context3, _context4, _arrowStyle;
105
118
  var prefixCls = props.prefixCls,
@@ -152,10 +165,11 @@ function usePopper(locatorElement, popperElement, props) {
152
165
  var popperEl = useRef();
153
166
  var locatorRef = locatorElement.ref || locatorEl;
154
167
  var popperRef = popperElement.ref || popperEl;
155
- var container = getPopupContainer(locatorRef.current || document.body);
168
+ var container = getPopupContainer(getRealDom(locatorRef, locatorElement) || document.body);
156
169
  _Promise.resolve().then(function () {
157
- var triggerNode = getTriggerElement(locatorRef.current);
158
- var container = getPopupContainer(locatorRef.current);
170
+ var realDom = getRealDom(locatorRef, locatorElement);
171
+ var triggerNode = getTriggerElement(realDom);
172
+ var container = getPopupContainer(realDom);
159
173
  devWarning(!triggerNode, componentName, "getTriggerElement() must return a HTMLElement, but now it does not return anything");
160
174
  devWarning(!container, componentName, "getPopupContainer() must return a HTMLElement, but now it does not return anything");
161
175
  });
@@ -218,30 +232,31 @@ function usePopper(locatorElement, popperElement, props) {
218
232
  nextPlacement = _useState18[0],
219
233
  setNextPlacement = _useState18[1];
220
234
  var alignPopper = useCallback(function () {
221
- if ((locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current) && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current)) {
235
+ var realDom = getRealDom(locatorRef, locatorElement);
236
+ if (realDom && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current)) {
222
237
  var _popperRef$current$ge = popperRef.current.getBoundingClientRect(),
223
238
  popperWidth = _popperRef$current$ge.width,
224
239
  popperHeight = _popperRef$current$ge.height;
225
- var _locatorRef$current$g = locatorRef.current.getBoundingClientRect(),
226
- top = _locatorRef$current$g.top,
227
- bottom = _locatorRef$current$g.bottom,
228
- left = _locatorRef$current$g.left,
229
- right = _locatorRef$current$g.right,
230
- height = _locatorRef$current$g.height,
231
- width = _locatorRef$current$g.width;
240
+ var _realDom$getBoundingC = realDom.getBoundingClientRect(),
241
+ top = _realDom$getBoundingC.top,
242
+ bottom = _realDom$getBoundingC.bottom,
243
+ left = _realDom$getBoundingC.left,
244
+ right = _realDom$getBoundingC.right,
245
+ height = _realDom$getBoundingC.height,
246
+ width = _realDom$getBoundingC.width;
232
247
  var _getOffsetPos = getOffsetPos(container),
233
248
  containerTop = _getOffsetPos.top,
234
249
  containerLeft = _getOffsetPos.left;
235
- var _getOffsetPos2 = getOffsetPos(locatorRef.current),
250
+ var _getOffsetPos2 = getOffsetPos(realDom),
236
251
  locatorTop = _getOffsetPos2.top,
237
252
  locatorLeft = _getOffsetPos2.left;
238
- var _getTranslatePos = getTranslatePos(locatorRef.current),
253
+ var _getTranslatePos = getTranslatePos(realDom),
239
254
  translateTop = _getTranslatePos.top,
240
255
  translateLeft = _getTranslatePos.left;
241
- var _getBorderWidth = getBorderWidth(locatorRef.current),
256
+ var _getBorderWidth = getBorderWidth(realDom),
242
257
  borderTop = _getBorderWidth.top,
243
258
  borderLeft = _getBorderWidth.left;
244
- var _getScrollDist = getScrollDist(locatorRef.current.parentElement, container),
259
+ var _getScrollDist = getScrollDist(realDom.parentElement, container),
245
260
  scrollTop = _getScrollDist.top,
246
261
  scrollLeft = _getScrollDist.left;
247
262
  var locatorPos = {
@@ -427,7 +442,7 @@ function usePopper(locatorElement, popperElement, props) {
427
442
  }, "".concat(nextPlacement, "-active"), active))
428
443
  };
429
444
  var popperNode = popperRef.current;
430
- var locatorNode = locatorRef.current;
445
+ var locatorNode = getRealDom(locatorRef, locatorElement);
431
446
  useResizeObserver(popperNode || document.body, alignPopper);
432
447
  useResizeObserver(locatorNode || document.body, alignPopper);
433
448
  var showPopper = useCallback(function (evType) {
@@ -458,7 +473,8 @@ function usePopper(locatorElement, popperElement, props) {
458
473
  useEffect(function () {
459
474
  if (exist && visible) {
460
475
  var mouseleaveTimer;
461
- var triggerNode = getTriggerElement(locatorRef.current);
476
+ var realDom = getRealDom(locatorRef, locatorElement);
477
+ var triggerNode = getTriggerElement(realDom);
462
478
  var handleHidePopper = function handleHidePopper(e) {
463
479
  var triggerRect = triggerNode.getBoundingClientRect();
464
480
  var popperRect = popperRef.current.getBoundingClientRect();
@@ -532,8 +548,9 @@ function usePopper(locatorElement, popperElement, props) {
532
548
  };
533
549
  }
534
550
  }, [alignPopper, exist, onVisibleChange, popperNode, props.visible, scrollHidden, locatorNode, visible, popperRef]);
535
- React.useEffect(function () {
536
- var triggerNode = getTriggerElement(locatorRef.current);
551
+ useEffect(function () {
552
+ var realDom = getRealDom(locatorRef, locatorElement);
553
+ var triggerNode = getTriggerElement(realDom);
537
554
  if (triggerNode) {
538
555
  var mouseenterTimer;
539
556
  var clearMouseLeave = function clearMouseLeave() {
@@ -63,7 +63,8 @@ var InternalSelect = function InternalSelect(props, ref) {
63
63
  domesticList = _selectProps$domestic === void 0 ? [] : _selectProps$domestic,
64
64
  _selectProps$foreignL = selectProps.foreignList,
65
65
  foreignList = _selectProps$foreignL === void 0 ? [] : _selectProps$foreignL,
66
- itemRender = selectProps.itemRender;
66
+ itemRender = selectProps.itemRender,
67
+ onTabPaneChange = selectProps.onTabPaneChange;
67
68
  var _useMergedState = useMergedState(undefined, {
68
69
  value: value,
69
70
  defaultValue: defaultValue
@@ -246,6 +247,7 @@ var InternalSelect = function InternalSelect(props, ref) {
246
247
  };
247
248
  var toggleTabPane = function toggleTabPane(type) {
248
249
  setTabsValue(type);
250
+ onTabPaneChange === null || onTabPaneChange === void 0 ? void 0 : onTabPaneChange(type);
249
251
  };
250
252
  // 渲染下拉列表框
251
253
  var renderContent = function renderContent() {
@@ -268,12 +270,13 @@ var InternalSelect = function InternalSelect(props, ref) {
268
270
  if (!data) return null;
269
271
  if (isDomestic(type)) {
270
272
  var _context3;
271
- return _concatInstanceProperty(_context3 = "".concat(flag && (data === null || data === void 0 ? void 0 : data.province) ? symbol : '')).call(_context3, data === null || data === void 0 ? void 0 : data.province);
273
+ var curVal = tabsValue === 'domestic' ? data === null || data === void 0 ? void 0 : data.province : data === null || data === void 0 ? void 0 : data.country;
274
+ return _concatInstanceProperty(_context3 = "".concat(flag && curVal ? symbol : '')).call(_context3, curVal);
272
275
  } else {
273
276
  var _context4, _context5, _context6;
274
277
  return _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = "".concat(flag && (data === null || data === void 0 ? void 0 : data.province) ? symbol : '')).call(_context6, data === null || data === void 0 ? void 0 : data.province)).call(_context5, (data === null || data === void 0 ? void 0 : data.country) ? symbol : '')).call(_context4, data === null || data === void 0 ? void 0 : data.country);
275
278
  }
276
- }, [type]);
279
+ }, [type, tabsValue]);
277
280
  var renderSingle = function renderSingle() {
278
281
  var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
279
282
  visibility: 'hidden'
@@ -43,6 +43,7 @@ export interface CityPickerProps {
43
43
  onSearch?: (value: string) => void;
44
44
  onClear?: () => void;
45
45
  itemRender?: (city: City) => React.ReactNode;
46
+ onTabPaneChange?: (id: Type) => void;
46
47
  }
47
48
  export interface ICityPickerOptionProps {
48
49
  disabled?: boolean;
@@ -307,6 +307,8 @@
307
307
  padding: 8px 0;
308
308
  max-height: 320px;
309
309
  overflow-y: auto;
310
+ -webkit-box-sizing: content-box;
311
+ box-sizing: content-box;
310
312
  }
311
313
  .kd-city-picker-list-item {
312
314
  position: relative;
@@ -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 {
@@ -49,7 +49,8 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
49
49
  suffix = inputNumberProps.suffix,
50
50
  formatter = inputNumberProps.formatter,
51
51
  className = inputNumberProps.className,
52
- 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"]);
52
+ onKeyDown = inputNumberProps.onKeyDown,
53
+ 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"]);
53
54
  var initVal = value === undefined ? defaultValue : value;
54
55
  var _useState = useState(serialization(initVal !== undefined ? initVal + '' : '')),
55
56
  _useState2 = _slicedToArray(_useState, 2),
@@ -173,12 +174,13 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
173
174
  return resultNumerical;
174
175
  };
175
176
  var handleStepChang = function handleStepChang(type) {
177
+ var _a, _b;
176
178
  var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
177
179
  if (typeof step !== 'number') {
178
180
  devWarning(true, 'inputNumber', "stepOption.step\u5FC5\u987B\u4E3A\u4E00\u4E2A\u6570\u503C");
179
181
  return false;
180
182
  }
181
- var startingNumber = parseFloat(inputNumberRef.current.value) || 0;
183
+ var startingNumber = parseFloat((_b = (_a = inputNumberRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value) || 0;
182
184
  var calculationResults = new Big(startingNumber)[type](step).valueOf();
183
185
  var legalNumber = verifiValue(calculationResults);
184
186
  if (legalNumber === false) {
@@ -193,6 +195,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
193
195
  };
194
196
  var handleKeyDown = function handleKeyDown(event) {
195
197
  var _context11;
198
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
196
199
  if (!stepOption || props.disabled || props.readOnly) {
197
200
  return;
198
201
  }
@@ -127,6 +127,7 @@
127
127
  font-size: var(--kd-c-radio-font-size, var(--kd-g-font-size-small, 12px));
128
128
  max-width: var(--kd-c-radio-default-label-max-width);
129
129
  overflow: hidden;
130
+ min-height: var(--kd-c-radio-square-sizing-width-height, 14px);
130
131
  }
131
132
  .kd-radio::before {
132
133
  position: absolute;
@@ -24,6 +24,7 @@
24
24
  font-size: @radio-font-size;
25
25
  max-width: @radio-default-label-max-width;
26
26
  overflow: hidden;
27
+ min-height: @radio-circle-size;
27
28
 
28
29
  &::before {
29
30
  position: absolute;
@@ -59,7 +59,8 @@ var InternalSearch = function InternalSearch(props, ref) {
59
59
  onSearch && (onSearch === null || onSearch === void 0 ? void 0 : onSearch(event));
60
60
  }, [onSearch]);
61
61
  var handlePressEnter = useCallback(function (_, event) {
62
- onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter(searchRef.current.value, event));
62
+ var _a, _b;
63
+ 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));
63
64
  }, [onPressEnter, searchRef]);
64
65
  var handleFocus = useCallback(function (event) {
65
66
  setFocused(true);
@@ -22,7 +22,7 @@ import VirtualList from '../virtual-list';
22
22
  import KeyCode from '../_utils/KeyCode';
23
23
  var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
24
24
  var InternalSelect = function InternalSelect(props, ref) {
25
- var _context, _classNames6, _classNames12;
25
+ var _context, _classNames6, _classNames12, _context5;
26
26
  var _useContext = useContext(ConfigContext),
27
27
  getPrefixCls = _useContext.getPrefixCls,
28
28
  prefixCls = _useContext.prefixCls,
@@ -794,6 +794,7 @@ var InternalSelect = function InternalSelect(props, ref) {
794
794
  offset = 1;
795
795
  } else if (which === KeyCode.ENTER) {
796
796
  var item = filledOptions[activeIndex];
797
+ if (!item) return;
797
798
  var key = ((_a = item.props) === null || _a === void 0 ? void 0 : _a.value) || item.value;
798
799
  var label = ((_b = item.props) === null || _b === void 0 ? void 0 : _b.children) || item.label;
799
800
  handleOption(key, label, true);
@@ -869,7 +870,7 @@ var InternalSelect = function InternalSelect(props, ref) {
869
870
  }
870
871
  };
871
872
  var popperProps = _extends(_extends({}, selectProps), {
872
- prefixCls: selectPrefixCls,
873
+ prefixCls: _concatInstanceProperty(_context5 = "".concat(selectPrefixCls, "-dropdown-panel")).call(_context5, isMultiple ? " ".concat(selectPrefixCls, "-multiple-dropdown-panel") : ''),
873
874
  placement: 'bottomLeft',
874
875
  popperStyle: catchStyle(),
875
876
  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/es/table/api.js CHANGED
@@ -77,7 +77,7 @@ export default function getApi(pipelineRef) {
77
77
  * @returns
78
78
  */
79
79
  function ensureColumnVisible(code) {
80
- var _a, _b;
80
+ var _a, _b, _c, _d;
81
81
  var pipeline = pipelineRef.current;
82
82
  var tableBodyContainer = (_a = pipeline.ref) === null || _a === void 0 ? void 0 : _a.current.domHelper.tableBody;
83
83
  var tableScroll = (_b = pipeline.ref) === null || _b === void 0 ? void 0 : _b.current.domHelper.stickyScroll;
@@ -93,14 +93,30 @@ export default function getApi(pipelineRef) {
93
93
  var colLeft = _sliceInstanceProperty(columnNodes).call(columnNodes, 0, index).reduce(function (acc, col) {
94
94
  return acc + col.width;
95
95
  }, 0);
96
+ var lockColumnLeft = 0;
97
+ var lockColumnRight = 0;
98
+ for (var i = 0; i < columnNodes.length; i++) {
99
+ if ((_c = columnNodes[i]) === null || _c === void 0 ? void 0 : _c.lock) {
100
+ lockColumnLeft += columnNodes[i].width;
101
+ } else {
102
+ break;
103
+ }
104
+ }
105
+ for (var _i = columnNodes.length - 1; _i >= 0; _i--) {
106
+ if ((_d = columnNodes[_i]) === null || _d === void 0 ? void 0 : _d.lock) {
107
+ lockColumnRight += columnNodes[_i].width;
108
+ } else {
109
+ break;
110
+ }
111
+ }
96
112
  var colLeftPixel = colLeft; // 目标列前面列宽总和
97
113
  var colRightPixel = colLeftPixel + column.width;
98
114
  var viewportWidth = tableBodyContainer.clientWidth; // 表体容器的宽度
99
115
  var scrollPosition = tableScroll.scrollLeft; // 滚动条滚动的距离
100
116
  var vScrollLeft = scrollPosition;
101
117
  var vScrollRight = scrollPosition + viewportWidth;
102
- var pxLeft = colLeftPixel;
103
- var pxRight = colRightPixel - viewportWidth;
118
+ var pxLeft = colLeftPixel - lockColumnLeft;
119
+ var pxRight = colRightPixel - viewportWidth + lockColumnRight;
104
120
  var colBeforeViewport = vScrollLeft > colLeftPixel; // 滚动距离大于目标列前面列宽总和,说明目标列在视口之前
105
121
  var colPastViewport = vScrollRight < colRightPixel; // 目标列是视口之后
106
122
  var colToSmallForViewport = viewportWidth < column.width;
@@ -114,6 +114,19 @@ var getScrollDist = function getScrollDist(el, container) {
114
114
  }
115
115
  return elScroll;
116
116
  };
117
+ var getRealDom = function getRealDom(locatorRef, locatorElement) {
118
+ var _a;
119
+ if (!locatorRef.current) return locatorRef.current;
120
+ var REF_NAME_OBJ = {
121
+ Input: 'input',
122
+ InputNumber: 'input',
123
+ Select: 'select',
124
+ Upload: 'input'
125
+ };
126
+ if (locatorRef.current.tagName) return locatorRef.current;
127
+ var name = REF_NAME_OBJ[(_a = locatorElement === null || locatorElement === void 0 ? void 0 : locatorElement.type) === null || _a === void 0 ? void 0 : _a.displayName];
128
+ return locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current[name];
129
+ };
117
130
  function usePopper(locatorElement, popperElement, props) {
118
131
  var _context3, _context4, _arrowStyle;
119
132
  var prefixCls = props.prefixCls,
@@ -166,10 +179,11 @@ function usePopper(locatorElement, popperElement, props) {
166
179
  var popperEl = (0, _react.useRef)();
167
180
  var locatorRef = locatorElement.ref || locatorEl;
168
181
  var popperRef = popperElement.ref || popperEl;
169
- var container = getPopupContainer(locatorRef.current || document.body);
182
+ var container = getPopupContainer(getRealDom(locatorRef, locatorElement) || document.body);
170
183
  _promise.default.resolve().then(function () {
171
- var triggerNode = getTriggerElement(locatorRef.current);
172
- var container = getPopupContainer(locatorRef.current);
184
+ var realDom = getRealDom(locatorRef, locatorElement);
185
+ var triggerNode = getTriggerElement(realDom);
186
+ var container = getPopupContainer(realDom);
173
187
  (0, _devwarning.default)(!triggerNode, componentName, "getTriggerElement() must return a HTMLElement, but now it does not return anything");
174
188
  (0, _devwarning.default)(!container, componentName, "getPopupContainer() must return a HTMLElement, but now it does not return anything");
175
189
  });
@@ -232,30 +246,31 @@ function usePopper(locatorElement, popperElement, props) {
232
246
  nextPlacement = _useState18[0],
233
247
  setNextPlacement = _useState18[1];
234
248
  var alignPopper = (0, _react.useCallback)(function () {
235
- if ((locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current) && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current)) {
249
+ var realDom = getRealDom(locatorRef, locatorElement);
250
+ if (realDom && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current)) {
236
251
  var _popperRef$current$ge = popperRef.current.getBoundingClientRect(),
237
252
  popperWidth = _popperRef$current$ge.width,
238
253
  popperHeight = _popperRef$current$ge.height;
239
- var _locatorRef$current$g = locatorRef.current.getBoundingClientRect(),
240
- top = _locatorRef$current$g.top,
241
- bottom = _locatorRef$current$g.bottom,
242
- left = _locatorRef$current$g.left,
243
- right = _locatorRef$current$g.right,
244
- height = _locatorRef$current$g.height,
245
- width = _locatorRef$current$g.width;
254
+ var _realDom$getBoundingC = realDom.getBoundingClientRect(),
255
+ top = _realDom$getBoundingC.top,
256
+ bottom = _realDom$getBoundingC.bottom,
257
+ left = _realDom$getBoundingC.left,
258
+ right = _realDom$getBoundingC.right,
259
+ height = _realDom$getBoundingC.height,
260
+ width = _realDom$getBoundingC.width;
246
261
  var _getOffsetPos = getOffsetPos(container),
247
262
  containerTop = _getOffsetPos.top,
248
263
  containerLeft = _getOffsetPos.left;
249
- var _getOffsetPos2 = getOffsetPos(locatorRef.current),
264
+ var _getOffsetPos2 = getOffsetPos(realDom),
250
265
  locatorTop = _getOffsetPos2.top,
251
266
  locatorLeft = _getOffsetPos2.left;
252
- var _getTranslatePos = getTranslatePos(locatorRef.current),
267
+ var _getTranslatePos = getTranslatePos(realDom),
253
268
  translateTop = _getTranslatePos.top,
254
269
  translateLeft = _getTranslatePos.left;
255
- var _getBorderWidth = getBorderWidth(locatorRef.current),
270
+ var _getBorderWidth = getBorderWidth(realDom),
256
271
  borderTop = _getBorderWidth.top,
257
272
  borderLeft = _getBorderWidth.left;
258
- var _getScrollDist = getScrollDist(locatorRef.current.parentElement, container),
273
+ var _getScrollDist = getScrollDist(realDom.parentElement, container),
259
274
  scrollTop = _getScrollDist.top,
260
275
  scrollLeft = _getScrollDist.left;
261
276
  var locatorPos = {
@@ -441,7 +456,7 @@ function usePopper(locatorElement, popperElement, props) {
441
456
  }, "".concat(nextPlacement, "-active"), active))
442
457
  };
443
458
  var popperNode = popperRef.current;
444
- var locatorNode = locatorRef.current;
459
+ var locatorNode = getRealDom(locatorRef, locatorElement);
445
460
  (0, _hooks.useResizeObserver)(popperNode || document.body, alignPopper);
446
461
  (0, _hooks.useResizeObserver)(locatorNode || document.body, alignPopper);
447
462
  var showPopper = (0, _react.useCallback)(function (evType) {
@@ -472,7 +487,8 @@ function usePopper(locatorElement, popperElement, props) {
472
487
  (0, _react.useEffect)(function () {
473
488
  if (exist && visible) {
474
489
  var mouseleaveTimer;
475
- var triggerNode = getTriggerElement(locatorRef.current);
490
+ var realDom = getRealDom(locatorRef, locatorElement);
491
+ var triggerNode = getTriggerElement(realDom);
476
492
  var handleHidePopper = function handleHidePopper(e) {
477
493
  var triggerRect = triggerNode.getBoundingClientRect();
478
494
  var popperRect = popperRef.current.getBoundingClientRect();
@@ -546,8 +562,9 @@ function usePopper(locatorElement, popperElement, props) {
546
562
  };
547
563
  }
548
564
  }, [alignPopper, exist, onVisibleChange, popperNode, props.visible, scrollHidden, locatorNode, visible, popperRef]);
549
- _react.default.useEffect(function () {
550
- var triggerNode = getTriggerElement(locatorRef.current);
565
+ (0, _react.useEffect)(function () {
566
+ var realDom = getRealDom(locatorRef, locatorElement);
567
+ var triggerNode = getTriggerElement(realDom);
551
568
  if (triggerNode) {
552
569
  var mouseenterTimer;
553
570
  var clearMouseLeave = function clearMouseLeave() {
@@ -75,7 +75,8 @@ var InternalSelect = function InternalSelect(props, ref) {
75
75
  domesticList = _selectProps$domestic === void 0 ? [] : _selectProps$domestic,
76
76
  _selectProps$foreignL = selectProps.foreignList,
77
77
  foreignList = _selectProps$foreignL === void 0 ? [] : _selectProps$foreignL,
78
- itemRender = selectProps.itemRender;
78
+ itemRender = selectProps.itemRender,
79
+ onTabPaneChange = selectProps.onTabPaneChange;
79
80
  var _useMergedState = (0, _hooks.useMergedState)(undefined, {
80
81
  value: value,
81
82
  defaultValue: defaultValue
@@ -258,6 +259,7 @@ var InternalSelect = function InternalSelect(props, ref) {
258
259
  };
259
260
  var toggleTabPane = function toggleTabPane(type) {
260
261
  setTabsValue(type);
262
+ onTabPaneChange === null || onTabPaneChange === void 0 ? void 0 : onTabPaneChange(type);
261
263
  };
262
264
  // 渲染下拉列表框
263
265
  var renderContent = function renderContent() {
@@ -280,12 +282,13 @@ var InternalSelect = function InternalSelect(props, ref) {
280
282
  if (!data) return null;
281
283
  if (isDomestic(type)) {
282
284
  var _context3;
283
- return (0, _concat.default)(_context3 = "".concat(flag && (data === null || data === void 0 ? void 0 : data.province) ? symbol : '')).call(_context3, data === null || data === void 0 ? void 0 : data.province);
285
+ var curVal = tabsValue === 'domestic' ? data === null || data === void 0 ? void 0 : data.province : data === null || data === void 0 ? void 0 : data.country;
286
+ return (0, _concat.default)(_context3 = "".concat(flag && curVal ? symbol : '')).call(_context3, curVal);
284
287
  } else {
285
288
  var _context4, _context5, _context6;
286
289
  return (0, _concat.default)(_context4 = (0, _concat.default)(_context5 = (0, _concat.default)(_context6 = "".concat(flag && (data === null || data === void 0 ? void 0 : data.province) ? symbol : '')).call(_context6, data === null || data === void 0 ? void 0 : data.province)).call(_context5, (data === null || data === void 0 ? void 0 : data.country) ? symbol : '')).call(_context4, data === null || data === void 0 ? void 0 : data.country);
287
290
  }
288
- }, [type]);
291
+ }, [type, tabsValue]);
289
292
  var renderSingle = function renderSingle() {
290
293
  var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
291
294
  visibility: 'hidden'
@@ -43,6 +43,7 @@ export interface CityPickerProps {
43
43
  onSearch?: (value: string) => void;
44
44
  onClear?: () => void;
45
45
  itemRender?: (city: City) => React.ReactNode;
46
+ onTabPaneChange?: (id: Type) => void;
46
47
  }
47
48
  export interface ICityPickerOptionProps {
48
49
  disabled?: boolean;
@@ -307,6 +307,8 @@
307
307
  padding: 8px 0;
308
308
  max-height: 320px;
309
309
  overflow-y: auto;
310
+ -webkit-box-sizing: content-box;
311
+ box-sizing: content-box;
310
312
  }
311
313
  .kd-city-picker-list-item {
312
314
  position: relative;
@@ -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 {