@douyinfe/semi-ui 2.22.3 → 2.23.0-beta.1

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 (57) hide show
  1. package/dist/css/semi.css +20 -1
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +440 -117
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/cascader/item.d.ts +1 -1
  8. package/lib/cjs/cascader/item.js +12 -6
  9. package/lib/cjs/form/baseForm.d.ts +4 -4
  10. package/lib/cjs/form/errorMessage.d.ts +2 -1
  11. package/lib/cjs/form/hooks/useFormState.d.ts +2 -1
  12. package/lib/cjs/form/interface.d.ts +15 -15
  13. package/lib/cjs/image/image.js +12 -0
  14. package/lib/cjs/image/interface.d.ts +1 -1
  15. package/lib/cjs/image/preview.d.ts +1 -1
  16. package/lib/cjs/image/preview.js +2 -2
  17. package/lib/cjs/image/previewImage.d.ts +1 -1
  18. package/lib/cjs/image/previewImage.js +1 -1
  19. package/lib/cjs/image/previewInner.d.ts +1 -1
  20. package/lib/cjs/image/previewInner.js +13 -5
  21. package/lib/cjs/locale/source/tr_TR.js +2 -2
  22. package/lib/cjs/navigation/Item.d.ts +3 -0
  23. package/lib/cjs/navigation/Item.js +9 -5
  24. package/lib/cjs/table/Body/index.js +2 -2
  25. package/lib/cjs/table/Table.js +3 -2
  26. package/lib/cjs/tagInput/index.d.ts +1 -1
  27. package/lib/cjs/tagInput/index.js +6 -4
  28. package/lib/cjs/tooltip/index.d.ts +8 -0
  29. package/lib/cjs/tooltip/index.js +2 -0
  30. package/lib/cjs/transfer/index.d.ts +1 -0
  31. package/lib/cjs/transfer/index.js +7 -1
  32. package/lib/es/cascader/item.d.ts +1 -1
  33. package/lib/es/cascader/item.js +12 -6
  34. package/lib/es/form/baseForm.d.ts +4 -4
  35. package/lib/es/form/errorMessage.d.ts +2 -1
  36. package/lib/es/form/hooks/useFormState.d.ts +2 -1
  37. package/lib/es/form/interface.d.ts +15 -15
  38. package/lib/es/image/image.js +11 -0
  39. package/lib/es/image/interface.d.ts +1 -1
  40. package/lib/es/image/preview.d.ts +1 -1
  41. package/lib/es/image/preview.js +2 -2
  42. package/lib/es/image/previewImage.d.ts +1 -1
  43. package/lib/es/image/previewImage.js +1 -1
  44. package/lib/es/image/previewInner.d.ts +1 -1
  45. package/lib/es/image/previewInner.js +13 -5
  46. package/lib/es/locale/source/tr_TR.js +2 -2
  47. package/lib/es/navigation/Item.d.ts +3 -0
  48. package/lib/es/navigation/Item.js +9 -5
  49. package/lib/es/table/Body/index.js +3 -3
  50. package/lib/es/table/Table.js +3 -2
  51. package/lib/es/tagInput/index.d.ts +1 -1
  52. package/lib/es/tagInput/index.js +6 -4
  53. package/lib/es/tooltip/index.d.ts +8 -0
  54. package/lib/es/tooltip/index.js +2 -0
  55. package/lib/es/transfer/index.d.ts +1 -0
  56. package/lib/es/transfer/index.js +7 -1
  57. package/package.json +7 -7
@@ -18234,9 +18234,11 @@ class foundation_Tooltip extends foundation {
18234
18234
  this._togglePortalVisible(true);
18235
18235
  });
18236
18236
 
18237
- const position = this.calcPosition(null, null, null, false);
18237
+ this._adapter.insertPortal(content, {
18238
+ left: -9990,
18239
+ top: -9999
18240
+ }); // offscreen rendering
18238
18241
 
18239
- this._adapter.insertPortal(content, position);
18240
18242
 
18241
18243
  if (trigger === 'custom') {
18242
18244
  // eslint-disable-next-line
@@ -18282,17 +18284,32 @@ class foundation_Tooltip extends foundation {
18282
18284
  containerRect = (isEmpty_default()(containerRect) ? _this._adapter.getPopupContainerRect() : containerRect) || Object.assign({}, defaultRect);
18283
18285
  wrapperRect = (isEmpty_default()(wrapperRect) ? _this._adapter.getWrapperBounding() : wrapperRect) || Object.assign({}, defaultRect); // console.log('containerRect: ', containerRect, 'triggerRect: ', triggerRect, 'wrapperRect: ', wrapperRect);
18284
18286
 
18285
- let style = _this.calcPosStyle(triggerRect, wrapperRect, containerRect);
18287
+ let style = _this.calcPosStyle({
18288
+ triggerRect,
18289
+ wrapperRect,
18290
+ containerRect
18291
+ });
18286
18292
 
18287
18293
  let position = _this.getProp('position');
18288
18294
 
18289
18295
  if (_this.getProp('autoAdjustOverflow')) {
18290
18296
  // console.log('style: ', style, '\ntriggerRect: ', triggerRect, '\nwrapperRect: ', wrapperRect);
18291
- const adjustedPos = _this.adjustPosIfNeed(position, style, triggerRect, wrapperRect, containerRect);
18297
+ const {
18298
+ position: adjustedPos,
18299
+ isHeightOverFlow,
18300
+ isWidthOverFlow
18301
+ } = _this.adjustPosIfNeed(position, style, triggerRect, wrapperRect, containerRect);
18292
18302
 
18293
- if (position !== adjustedPos) {
18303
+ if (position !== adjustedPos || isHeightOverFlow || isWidthOverFlow) {
18294
18304
  position = adjustedPos;
18295
- style = _this.calcPosStyle(triggerRect, wrapperRect, containerRect, position);
18305
+ style = _this.calcPosStyle({
18306
+ triggerRect,
18307
+ wrapperRect,
18308
+ containerRect,
18309
+ position,
18310
+ spacing: null,
18311
+ isOverFlow: [isHeightOverFlow, isWidthOverFlow]
18312
+ });
18296
18313
  }
18297
18314
  }
18298
18315
 
@@ -18430,6 +18447,29 @@ class foundation_Tooltip extends foundation {
18430
18447
  this._adapter.unregisterResizeHandler(this.onResize);
18431
18448
  }
18432
18449
 
18450
+ _adjustPos() {
18451
+ let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18452
+ let isVertical = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
18453
+ let adjustType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'reverse';
18454
+ let concatPos = arguments.length > 3 ? arguments[3] : undefined;
18455
+
18456
+ switch (adjustType) {
18457
+ case 'reverse':
18458
+ return this._reversePos(position, isVertical);
18459
+
18460
+ case 'expand':
18461
+ // only happens when position is top/bottom/left/right
18462
+ return this._expandPos(position, concatPos);
18463
+
18464
+ case 'reduce':
18465
+ // only happens when position other than top/bottom/left/right
18466
+ return this._reducePos(position);
18467
+
18468
+ default:
18469
+ return this._reversePos(position, isVertical);
18470
+ }
18471
+ }
18472
+
18433
18473
  _reversePos() {
18434
18474
  let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18435
18475
  let isVertical = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -18449,6 +18489,19 @@ class foundation_Tooltip extends foundation {
18449
18489
  return position;
18450
18490
  }
18451
18491
 
18492
+ _expandPos() {
18493
+ let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18494
+ let concatPos = arguments.length > 1 ? arguments[1] : undefined;
18495
+ return position.concat(concatPos);
18496
+ }
18497
+
18498
+ _reducePos() {
18499
+ let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18500
+ // if cur position consists of two directions, remove the last position
18501
+ const found = ['Top', 'Bottom', 'Left', 'Right'].find(pos => position.endsWith(pos));
18502
+ return found ? position.replace(found, '') : position;
18503
+ }
18504
+
18452
18505
  clearDelayTimer() {
18453
18506
  if (this._timer) {
18454
18507
  clearTimeout(this._timer);
@@ -18609,12 +18662,16 @@ class foundation_Tooltip extends foundation {
18609
18662
  return null;
18610
18663
  }
18611
18664
 
18612
- calcPosStyle(triggerRect, wrapperRect, containerRect, position, spacing) {
18613
- triggerRect = (isEmpty_default()(triggerRect) ? triggerRect : this._adapter.getTriggerBounding()) || Object.assign({}, defaultRect);
18614
- containerRect = (isEmpty_default()(containerRect) ? containerRect : this._adapter.getPopupContainerRect()) || Object.assign({}, defaultRect);
18615
- wrapperRect = (isEmpty_default()(wrapperRect) ? wrapperRect : this._adapter.getWrapperBounding()) || Object.assign({}, defaultRect); // eslint-disable-next-line
18665
+ calcPosStyle(props) {
18666
+ const {
18667
+ spacing,
18668
+ isOverFlow
18669
+ } = props;
18670
+ const triggerRect = (isEmpty_default()(props.triggerRect) ? props.triggerRect : this._adapter.getTriggerBounding()) || Object.assign({}, defaultRect);
18671
+ const containerRect = (isEmpty_default()(props.containerRect) ? props.containerRect : this._adapter.getPopupContainerRect()) || Object.assign({}, defaultRect);
18672
+ const wrapperRect = (isEmpty_default()(props.wrapperRect) ? props.wrapperRect : this._adapter.getWrapperBounding()) || Object.assign({}, defaultRect); // eslint-disable-next-line
18616
18673
 
18617
- position = position != null ? position : this.getProp('position'); // eslint-disable-next-line
18674
+ const position = props.position != null ? props.position : this.getProp('position'); // eslint-disable-next-line
18618
18675
 
18619
18676
  const SPACING = spacing != null ? spacing : this.getProp('spacing');
18620
18677
  const {
@@ -18644,79 +18701,112 @@ class foundation_Tooltip extends foundation {
18644
18701
  const middleY = triggerRect.top + triggerRect.height / 2;
18645
18702
  const offsetXWithArrow = positionOffsetX + horizontalArrowWidth / 2;
18646
18703
  const offsetYWithArrow = positionOffsetY + verticalArrowHeight / 2;
18704
+ const heightDifference = wrapperRect.height - containerRect.height;
18705
+ const widthDifference = wrapperRect.width - containerRect.width;
18706
+ const offsetHeight = heightDifference > 0 ? heightDifference : 0;
18707
+ const offsetWidth = widthDifference > 0 ? widthDifference : 0;
18708
+ const isHeightOverFlow = isOverFlow && isOverFlow[0];
18709
+ const isWidthOverFlow = isOverFlow && isOverFlow[1];
18710
+ const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
18711
+ const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
18647
18712
 
18648
18713
  switch (position) {
18649
18714
  case 'top':
18650
- left = middleX;
18651
- top = triggerRect.top - SPACING;
18715
+ // left = middleX;
18716
+ // top = triggerRect.top - SPACING;
18717
+ left = isWidthOverFlow ? isTriggerNearLeft ? containerRect.left + wrapperRect.width / 2 : containerRect.right - wrapperRect.width / 2 + offsetWidth : middleX;
18718
+ top = isHeightOverFlow ? containerRect.bottom + offsetHeight : triggerRect.top - SPACING;
18652
18719
  translateX = -0.5;
18653
18720
  translateY = -1;
18654
18721
  break;
18655
18722
 
18656
18723
  case 'topLeft':
18657
- left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18658
- top = triggerRect.top - SPACING;
18724
+ // left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18725
+ // top = triggerRect.top - SPACING;
18726
+ left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18727
+ top = isHeightOverFlow ? containerRect.bottom + offsetHeight : triggerRect.top - SPACING;
18659
18728
  translateY = -1;
18660
18729
  break;
18661
18730
 
18662
18731
  case 'topRight':
18663
- left = pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18664
- top = triggerRect.top - SPACING;
18732
+ // left = pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18733
+ // top = triggerRect.top - SPACING;
18734
+ left = isWidthOverFlow ? containerRect.right + offsetWidth : pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18735
+ top = isHeightOverFlow ? containerRect.bottom + offsetHeight : triggerRect.top - SPACING;
18665
18736
  translateY = -1;
18666
18737
  translateX = -1;
18667
18738
  break;
18668
18739
 
18669
18740
  case 'left':
18670
- left = triggerRect.left - SPACING;
18671
- top = middleY;
18741
+ // left = triggerRect.left - SPACING;
18742
+ // top = middleY;
18743
+ // left = isWidthOverFlow? containerRect.right - SPACING : triggerRect.left - SPACING;
18744
+ left = isWidthOverFlow ? containerRect.right + offsetWidth - SPACING + offsetXWithArrow : triggerRect.left - SPACING;
18745
+ top = isHeightOverFlow ? isTriggerNearTop ? containerRect.top + wrapperRect.height / 2 : containerRect.bottom - wrapperRect.height / 2 + offsetHeight : middleY;
18672
18746
  translateX = -1;
18673
18747
  translateY = -0.5;
18674
18748
  break;
18675
18749
 
18676
18750
  case 'leftTop':
18677
- left = triggerRect.left - SPACING;
18678
- top = pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18751
+ // left = triggerRect.left - SPACING;
18752
+ // top = pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18753
+ left = isWidthOverFlow ? containerRect.right + offsetWidth - SPACING + offsetXWithArrow : triggerRect.left - SPACING;
18754
+ top = isHeightOverFlow ? containerRect.top : pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18679
18755
  translateX = -1;
18680
18756
  break;
18681
18757
 
18682
18758
  case 'leftBottom':
18683
- left = triggerRect.left - SPACING;
18684
- top = pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18759
+ // left = triggerRect.left - SPACING;
18760
+ // top = pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18761
+ left = isWidthOverFlow ? containerRect.right + offsetWidth - SPACING + offsetXWithArrow : triggerRect.left - SPACING;
18762
+ top = isHeightOverFlow ? containerRect.bottom + offsetHeight : pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18685
18763
  translateX = -1;
18686
18764
  translateY = -1;
18687
18765
  break;
18688
18766
 
18689
18767
  case 'bottom':
18690
- left = middleX;
18691
- top = triggerRect.top + triggerRect.height + SPACING;
18768
+ // left = middleX;
18769
+ // top = triggerRect.top + triggerRect.height + SPACING;
18770
+ left = isWidthOverFlow ? isTriggerNearLeft ? containerRect.left + wrapperRect.width / 2 : containerRect.right - wrapperRect.width / 2 + offsetWidth : middleX;
18771
+ top = isHeightOverFlow ? containerRect.top + offsetYWithArrow - SPACING : triggerRect.top + triggerRect.height + SPACING;
18692
18772
  translateX = -0.5;
18693
18773
  break;
18694
18774
 
18695
18775
  case 'bottomLeft':
18696
- left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18697
- top = triggerRect.bottom + SPACING;
18776
+ // left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18777
+ // top = triggerRect.bottom + SPACING;
18778
+ left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
18779
+ top = isHeightOverFlow ? containerRect.top + offsetYWithArrow - SPACING : triggerRect.top + triggerRect.height + SPACING;
18698
18780
  break;
18699
18781
 
18700
18782
  case 'bottomRight':
18701
- left = pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18702
- top = triggerRect.bottom + SPACING;
18783
+ // left = pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18784
+ // top = triggerRect.bottom + SPACING;
18785
+ left = isWidthOverFlow ? containerRect.right + offsetWidth : pointAtCenter ? middleX + offsetXWithArrow : triggerRect.right;
18786
+ top = isHeightOverFlow ? containerRect.top + offsetYWithArrow - SPACING : triggerRect.top + triggerRect.height + SPACING;
18703
18787
  translateX = -1;
18704
18788
  break;
18705
18789
 
18706
18790
  case 'right':
18707
- left = triggerRect.right + SPACING;
18708
- top = middleY;
18791
+ // left = triggerRect.right + SPACING;
18792
+ // top = middleY;
18793
+ left = isWidthOverFlow ? containerRect.left - SPACING + offsetXWithArrow : triggerRect.right + SPACING;
18794
+ top = isHeightOverFlow ? isTriggerNearTop ? containerRect.top + wrapperRect.height / 2 : containerRect.bottom - wrapperRect.height / 2 + offsetHeight : middleY;
18709
18795
  translateY = -0.5;
18710
18796
  break;
18711
18797
 
18712
18798
  case 'rightTop':
18713
- left = triggerRect.right + SPACING;
18714
- top = pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18799
+ // left = triggerRect.right + SPACING;
18800
+ // top = pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18801
+ left = isWidthOverFlow ? containerRect.left - SPACING + offsetXWithArrow : triggerRect.right + SPACING;
18802
+ top = isHeightOverFlow ? containerRect.top : pointAtCenter ? middleY - offsetYWithArrow : triggerRect.top;
18715
18803
  break;
18716
18804
 
18717
18805
  case 'rightBottom':
18718
- left = triggerRect.right + SPACING;
18719
- top = pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18806
+ // left = triggerRect.right + SPACING;
18807
+ // top = pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18808
+ left = isWidthOverFlow ? containerRect.left - SPACING + offsetXWithArrow : triggerRect.right + SPACING;
18809
+ top = isHeightOverFlow ? containerRect.bottom + offsetHeight : pointAtCenter ? middleY + offsetYWithArrow : triggerRect.bottom;
18720
18810
  translateY = -1;
18721
18811
  break;
18722
18812
 
@@ -18823,12 +18913,53 @@ class foundation_Tooltip extends foundation {
18823
18913
 
18824
18914
  isLR() {
18825
18915
  let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18826
- return position.indexOf('left') === 0 || position.indexOf('right') === 0;
18916
+ return position.includes('left') || position.includes('right');
18827
18917
  }
18828
18918
 
18829
18919
  isTB() {
18830
18920
  let position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
18831
- return position.indexOf('top') === 0 || position.indexOf('bottom') === 0;
18921
+ return position.includes('top') || position.includes('bottom');
18922
+ }
18923
+
18924
+ isReverse(rowSpace, reverseSpace, size) {
18925
+ // 原空间不足,反向空间足够
18926
+ // Insufficient original space, enough reverse space
18927
+ return rowSpace < size && reverseSpace > size;
18928
+ }
18929
+
18930
+ isOverFlow(rowSpace, reverseSpace, size) {
18931
+ // 原空间且反向空间都不足
18932
+ // The original space and the reverse space are not enough
18933
+ return rowSpace < size && reverseSpace < size;
18934
+ }
18935
+
18936
+ isHalfOverFlow(posSpace, negSpace, size) {
18937
+ // 正半空间或者负半空间不足,即表示有遮挡,需要偏移
18938
+ // Insufficient positive half space or negative half space means that there is occlusion and needs to be offset
18939
+ return posSpace < size || negSpace < size;
18940
+ }
18941
+
18942
+ isHalfAllEnough(posSpace, negSpace, size) {
18943
+ // 正半空间和负半空间都足够,即表示可以从 topLeft/topRight 变成 top
18944
+ // Both positive and negative half-spaces are sufficient, which means you can change from topLeft/topRight to top
18945
+ return posSpace >= size || negSpace >= size;
18946
+ }
18947
+
18948
+ getReverse(viewOverFlow, containerOverFlow, shouldReverseView, shouldReverseContainer) {
18949
+ /**
18950
+ * 基于视口和容器一起判断,以下几种情况允许从原方向转到反方向,以判断是否应该由top->bottom为例子
18951
+ *
18952
+ * 1. 视口上下空间不足 且 容器上空间❌下空间✅
18953
+ * 2. 视口上空间❌下空间✅ 且 容器上下空间不足
18954
+ * 3. 视口上空间❌下空间✅ 且 容器上空间❌下空间✅
18955
+ *
18956
+ * Based on the judgment of the viewport and the container, the following situations are allowed to turn from the original direction to the opposite direction
18957
+ * to judge whether it should be top->bottom as an example
18958
+ * 1. There is insufficient space above and below the viewport and the space above the container ❌ the space below ✅
18959
+ * 2. The space above the viewport ❌ the space below ✅ and the space above and below the container is insufficient
18960
+ * 3. Viewport upper space ❌ lower space✅ and container upper space ❌ lower space✅
18961
+ */
18962
+ return viewOverFlow && shouldReverseContainer || shouldReverseView && containerOverFlow || shouldReverseView && shouldReverseContainer;
18832
18963
  } // place the dom correctly
18833
18964
 
18834
18965
 
@@ -18838,8 +18969,15 @@ class foundation_Tooltip extends foundation {
18838
18969
  innerHeight
18839
18970
  } = window;
18840
18971
  const {
18841
- spacing
18972
+ spacing,
18973
+ margin
18842
18974
  } = this.getProps();
18975
+ const marginLeft = typeof margin === 'number' ? margin : margin.marginLeft;
18976
+ const marginTop = typeof margin === 'number' ? margin : margin.marginTop;
18977
+ const marginRight = typeof margin === 'number' ? margin : margin.marginRight;
18978
+ const marginBottom = typeof margin === 'number' ? margin : margin.marginBottom;
18979
+ let isHeightOverFlow = false;
18980
+ let isWidthOverFlow = false;
18843
18981
 
18844
18982
  if (wrapperRect.width > 0 && wrapperRect.height > 0) {
18845
18983
  // let clientLeft = left + translateX * wrapperRect.width - containerRect.scrollLeft;
@@ -18862,187 +19000,324 @@ class foundation_Tooltip extends foundation {
18862
19000
  const restClientBottom = innerHeight - clientBottom;
18863
19001
  const widthIsBigger = wrapperRect.width > triggerRect.width;
18864
19002
  const heightIsBigger = wrapperRect.height > triggerRect.height; // The wrapperR ect.top|bottom equivalent cannot be directly used here for comparison, which is easy to cause jitter
18865
-
18866
- const shouldReverseTop = clientTop < wrapperRect.height + spacing && restClientBottom > wrapperRect.height + spacing;
18867
- const shouldReverseLeft = clientLeft < wrapperRect.width + spacing && restClientRight > wrapperRect.width + spacing;
18868
- const shouldReverseBottom = restClientBottom < wrapperRect.height + spacing && clientTop > wrapperRect.height + spacing;
18869
- const shouldReverseRight = restClientRight < wrapperRect.width + spacing && clientLeft > wrapperRect.width + spacing;
19003
+ // 基于视口的微调判断
19004
+ // Fine-tuning judgment based on viewport
19005
+
19006
+ const shouldViewReverseTop = clientTop - marginTop < wrapperRect.height + spacing && restClientBottom - marginBottom > wrapperRect.height + spacing;
19007
+ const shouldViewReverseLeft = clientLeft - marginLeft < wrapperRect.width + spacing && restClientRight - marginRight > wrapperRect.width + spacing;
19008
+ const shouldViewReverseBottom = restClientBottom - marginBottom < wrapperRect.height + spacing && clientTop - marginTop > wrapperRect.height + spacing;
19009
+ const shouldViewReverseRight = restClientRight - marginRight < wrapperRect.width + spacing && clientLeft - marginLeft > wrapperRect.width + spacing;
19010
+ const shouldViewReverseTopOver = restClientTop - marginBottom < wrapperRect.height + spacing && clientBottom - marginTop > wrapperRect.height + spacing;
19011
+ const shouldViewReverseBottomOver = clientBottom - marginTop < wrapperRect.height + spacing && restClientTop - marginBottom > wrapperRect.height + spacing;
19012
+ const shouldViewReverseTopSide = restClientTop < wrapperRect.height && clientBottom > wrapperRect.height;
19013
+ const shouldViewReverseBottomSide = clientBottom < wrapperRect.height && restClientTop > wrapperRect.height;
19014
+ const shouldViewReverseLeftSide = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
19015
+ const shouldViewReverseRightSide = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
18870
19016
  const shouldReverseTopOver = restClientTop < wrapperRect.height + spacing && clientBottom > wrapperRect.height + spacing;
18871
19017
  const shouldReverseBottomOver = clientBottom < wrapperRect.height + spacing && restClientTop > wrapperRect.height + spacing;
18872
- const shouldReverseTopSide = restClientTop < wrapperRect.height && clientBottom > wrapperRect.height;
18873
- const shouldReverseBottomSide = clientBottom < wrapperRect.height && restClientTop > wrapperRect.height;
18874
- const shouldReverseLeftSide = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
18875
- const shouldReverseRightSide = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
18876
19018
  const shouldReverseLeftOver = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
18877
- const shouldReverseRightOver = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
19019
+ const shouldReverseRightOver = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width; // 基于容器的微调判断
19020
+ // Fine-tuning judgment based on container
19021
+
19022
+ const clientTopInContainer = clientTop - containerRect.top;
19023
+ const clientLeftInContainer = clientLeft - containerRect.left;
19024
+ const clientBottomInContainer = clientTopInContainer + triggerRect.height;
19025
+ const clientRightInContainer = clientLeftInContainer + triggerRect.width;
19026
+ const restClientBottomInContainer = containerRect.bottom - clientBottom;
19027
+ const restClientRightInContainer = containerRect.right - clientRight;
19028
+ const restClientTopInContainer = restClientBottomInContainer + triggerRect.height;
19029
+ const restClientLeftInContainer = restClientRightInContainer + triggerRect.width; // 当原空间不足,反向空间足够时,可以反向。
19030
+ // When the original space is insufficient and the reverse space is sufficient, the reverse can be performed.
19031
+
19032
+ const shouldContainerReverseTop = this.isReverse(clientTopInContainer - marginTop, restClientBottomInContainer - marginBottom, wrapperRect.height + spacing);
19033
+ const shouldContainerReverseLeft = this.isReverse(clientLeftInContainer - marginLeft, restClientRightInContainer - marginRight, wrapperRect.width + spacing);
19034
+ const shouldContainerReverseBottom = this.isReverse(restClientBottomInContainer - marginBottom, clientTopInContainer - marginTop, wrapperRect.height + spacing);
19035
+ const shouldContainerReverseRight = this.isReverse(restClientRightInContainer - marginRight, clientLeftInContainer - marginLeft, wrapperRect.width + spacing);
19036
+ const shouldContainerReverseTopOver = this.isReverse(restClientTopInContainer - marginBottom, clientBottomInContainer - marginTop, wrapperRect.height + spacing);
19037
+ const shouldContainerReverseBottomOver = this.isReverse(clientBottomInContainer - marginTop, restClientTopInContainer - marginBottom, wrapperRect.height + spacing);
19038
+ const shouldContainerReverseTopSide = this.isReverse(restClientTopInContainer, clientBottomInContainer, wrapperRect.height);
19039
+ const shouldContainerReverseBottomSide = this.isReverse(clientBottomInContainer, restClientTopInContainer, wrapperRect.height);
19040
+ const shouldContainerReverseLeftSide = this.isReverse(restClientLeftInContainer, clientRightInContainer, wrapperRect.width);
19041
+ const shouldContainerReverseRightSide = this.isReverse(clientRightInContainer, restClientLeftInContainer, wrapperRect.width);
19042
+ const halfHeight = triggerRect.height / 2;
19043
+ const halfWidth = triggerRect.width / 2; // 视口, 原空间与反向空间是否都不足判断
19044
+ // Viewport, whether the original space and the reverse space are insufficient to judge
19045
+
19046
+ const isViewYOverFlow = this.isOverFlow(clientTop - marginTop, restClientBottom - marginBottom, wrapperRect.height + spacing);
19047
+ const isViewXOverFlow = this.isOverFlow(clientLeft - marginLeft, restClientRight - marginRight, wrapperRect.width + spacing);
19048
+ const isViewYOverFlowSide = this.isOverFlow(clientBottom - marginTop, restClientTop - marginBottom, wrapperRect.height + spacing);
19049
+ const isViewXOverFlowSide = this.isOverFlow(clientRight - marginLeft, restClientLeft - marginRight, wrapperRect.width + spacing);
19050
+ const isViewYOverFlowSideHalf = this.isHalfOverFlow(clientBottom - halfHeight, restClientTop - halfHeight, wrapperRect.height / 2);
19051
+ const isViewXOverFlowSideHalf = this.isHalfOverFlow(clientRight - halfWidth, restClientLeft - halfWidth, wrapperRect.width / 2);
19052
+ const isViewYEnoughSideHalf = this.isHalfAllEnough(clientBottom - halfHeight, restClientTop - halfHeight, wrapperRect.height / 2);
19053
+ const isViewXEnoughSideHalf = this.isHalfAllEnough(clientRight - halfWidth, restClientLeft - halfWidth, wrapperRect.width / 2); // 容器, 原空间与反向空间是否都不足判断
19054
+ // container, whether the original space and the reverse space are insufficient to judge
19055
+
19056
+ const isContainerYOverFlow = this.isOverFlow(clientTopInContainer - marginTop, restClientBottomInContainer - marginBottom, wrapperRect.height + spacing);
19057
+ const isContainerXOverFlow = this.isOverFlow(clientLeftInContainer - marginLeft, restClientRightInContainer - marginRight, wrapperRect.width + spacing);
19058
+ const isContainerYOverFlowSide = this.isOverFlow(clientBottomInContainer - marginTop, restClientTopInContainer - marginBottom, wrapperRect.height + spacing);
19059
+ const isContainerXOverFlowSide = this.isOverFlow(clientRightInContainer - marginLeft, restClientLeftInContainer - marginRight, wrapperRect.width + spacing);
19060
+ const isContainerYOverFlowSideHalf = this.isHalfOverFlow(clientBottomInContainer - halfHeight, restClientTopInContainer - halfHeight, wrapperRect.height / 2);
19061
+ const isContainerXOverFlowSideHalf = this.isHalfOverFlow(clientRightInContainer - halfWidth, restClientLeftInContainer - halfWidth, wrapperRect.width / 2);
19062
+ const isContainerYEnoughSideHalf = this.isHalfAllEnough(clientBottomInContainer - halfHeight, restClientTopInContainer - halfHeight, wrapperRect.height / 2);
19063
+ const isContainerXEnoughSideHalf = this.isHalfAllEnough(clientRightInContainer - halfWidth, restClientLeftInContainer - halfWidth, wrapperRect.width / 2); // 综合 viewport + container 判断微调,即视口 + 容器都放置不行时才能考虑位置调整
19064
+ // Comprehensive viewport + container judgment fine-tuning, that is, the position adjustment can only be considered when the viewport + container cannot be placed.
19065
+
19066
+ const shouldReverseTop = this.getReverse(isViewYOverFlow, isContainerYOverFlow, shouldViewReverseTop, shouldContainerReverseTop);
19067
+ const shouldReverseLeft = this.getReverse(isViewXOverFlow, isContainerXOverFlow, shouldViewReverseLeft, shouldContainerReverseLeft);
19068
+ const shouldReverseBottom = this.getReverse(isViewYOverFlow, isContainerYOverFlow, shouldViewReverseBottom, shouldContainerReverseBottom);
19069
+ const shouldReverseRight = this.getReverse(isViewXOverFlow, isContainerXOverFlow, shouldViewReverseRight, shouldContainerReverseRight); // const shouldReverseTopOver = this.getReverse(isViewYOverFlowSide, isContainerYOverFlowSide, shouldViewReverseTopOver, shouldContainerReverseTopOver);
19070
+ // const shouldReverseBottomOver = this.getReverse(isViewYOverFlowSide, isContainerYOverFlowSide, shouldViewReverseBottomOver, shouldContainerReverseBottomOver);
19071
+
19072
+ const shouldReverseTopSide = this.getReverse(isViewYOverFlowSide, isContainerYOverFlowSide, shouldViewReverseTopSide, shouldContainerReverseTopSide);
19073
+ const shouldReverseBottomSide = this.getReverse(isViewYOverFlowSide, isContainerYOverFlowSide, shouldViewReverseBottomSide, shouldContainerReverseBottomSide);
19074
+ const shouldReverseLeftSide = this.getReverse(isViewXOverFlowSide, isContainerXOverFlowSide, shouldViewReverseLeftSide, shouldContainerReverseLeftSide);
19075
+ const shouldReverseRightSide = this.getReverse(isViewXOverFlowSide, isContainerXOverFlowSide, shouldViewReverseRightSide, shouldContainerReverseRightSide);
19076
+ const isYOverFlowSideHalf = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf;
19077
+ const isXOverFlowSideHalf = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf;
18878
19078
 
18879
19079
  switch (position) {
18880
19080
  case 'top':
18881
19081
  if (shouldReverseTop) {
18882
- position = this._reversePos(position, true);
19082
+ position = this._adjustPos(position, true);
19083
+ }
19084
+
19085
+ if (isXOverFlowSideHalf && (shouldReverseLeftSide || shouldReverseRightSide)) {
19086
+ position = this._adjustPos(position, true, 'expand', shouldReverseLeftSide ? 'Right' : 'Left');
18883
19087
  }
18884
19088
 
18885
19089
  break;
18886
19090
 
18887
19091
  case 'topLeft':
18888
19092
  if (shouldReverseTop) {
18889
- position = this._reversePos(position, true);
19093
+ position = this._adjustPos(position, true);
18890
19094
  }
18891
19095
 
18892
19096
  if (shouldReverseLeftSide && widthIsBigger) {
18893
- position = this._reversePos(position);
19097
+ position = this._adjustPos(position, true);
19098
+ }
19099
+
19100
+ if (isWidthOverFlow && (isViewXEnoughSideHalf || isContainerXEnoughSideHalf)) {
19101
+ position = this._adjustPos(position, true, 'reduce');
18894
19102
  }
18895
19103
 
18896
19104
  break;
18897
19105
 
18898
19106
  case 'topRight':
18899
19107
  if (shouldReverseTop) {
18900
- position = this._reversePos(position, true);
19108
+ position = this._adjustPos(position, true);
18901
19109
  }
18902
19110
 
18903
19111
  if (shouldReverseRightSide && widthIsBigger) {
18904
- position = this._reversePos(position);
19112
+ position = this._adjustPos(position);
19113
+ }
19114
+
19115
+ if (isWidthOverFlow && (isViewXEnoughSideHalf || isContainerXEnoughSideHalf)) {
19116
+ position = this._adjustPos(position, true, 'reduce');
18905
19117
  }
18906
19118
 
18907
19119
  break;
18908
19120
 
18909
19121
  case 'left':
18910
19122
  if (shouldReverseLeft) {
18911
- position = this._reversePos(position);
19123
+ position = this._adjustPos(position);
19124
+ }
19125
+
19126
+ if (isYOverFlowSideHalf && (shouldReverseTopSide || shouldReverseBottomSide)) {
19127
+ position = this._adjustPos(position, false, 'expand', shouldReverseTopSide ? 'Bottom' : 'Top');
18912
19128
  }
18913
19129
 
18914
19130
  break;
18915
19131
 
18916
19132
  case 'leftTop':
18917
19133
  if (shouldReverseLeft) {
18918
- position = this._reversePos(position);
19134
+ position = this._adjustPos(position);
18919
19135
  }
18920
19136
 
18921
19137
  if (shouldReverseTopSide && heightIsBigger) {
18922
- position = this._reversePos(position, true);
19138
+ position = this._adjustPos(position, true);
19139
+ }
19140
+
19141
+ if (isHeightOverFlow && (isViewYEnoughSideHalf || isContainerYEnoughSideHalf)) {
19142
+ position = this._adjustPos(position, false, 'reduce');
18923
19143
  }
18924
19144
 
18925
19145
  break;
18926
19146
 
18927
19147
  case 'leftBottom':
18928
19148
  if (shouldReverseLeft) {
18929
- position = this._reversePos(position);
19149
+ position = this._adjustPos(position);
18930
19150
  }
18931
19151
 
18932
19152
  if (shouldReverseBottomSide && heightIsBigger) {
18933
- position = this._reversePos(position, true);
19153
+ position = this._adjustPos(position, true);
19154
+ }
19155
+
19156
+ if (isHeightOverFlow && (isViewYEnoughSideHalf || isContainerYEnoughSideHalf)) {
19157
+ position = this._adjustPos(position, false, 'reduce');
18934
19158
  }
18935
19159
 
18936
19160
  break;
18937
19161
 
18938
19162
  case 'bottom':
18939
19163
  if (shouldReverseBottom) {
18940
- position = this._reversePos(position, true);
19164
+ position = this._adjustPos(position, true);
19165
+ }
19166
+
19167
+ if (isXOverFlowSideHalf && (shouldReverseLeftSide || shouldReverseRightSide)) {
19168
+ position = this._adjustPos(position, true, 'expand', shouldReverseLeftSide ? 'Right' : 'Left');
18941
19169
  }
18942
19170
 
18943
19171
  break;
18944
19172
 
18945
19173
  case 'bottomLeft':
18946
19174
  if (shouldReverseBottom) {
18947
- position = this._reversePos(position, true);
19175
+ position = this._adjustPos(position, true);
18948
19176
  }
18949
19177
 
18950
19178
  if (shouldReverseLeftSide && widthIsBigger) {
18951
- position = this._reversePos(position);
19179
+ position = this._adjustPos(position);
19180
+ }
19181
+
19182
+ if (isWidthOverFlow && (isViewXEnoughSideHalf || isContainerXEnoughSideHalf)) {
19183
+ position = this._adjustPos(position, true, 'reduce');
18952
19184
  }
18953
19185
 
18954
19186
  break;
18955
19187
 
18956
19188
  case 'bottomRight':
18957
19189
  if (shouldReverseBottom) {
18958
- position = this._reversePos(position, true);
19190
+ position = this._adjustPos(position, true);
18959
19191
  }
18960
19192
 
18961
19193
  if (shouldReverseRightSide && widthIsBigger) {
18962
- position = this._reversePos(position);
19194
+ position = this._adjustPos(position);
19195
+ }
19196
+
19197
+ if (isWidthOverFlow && (isViewXEnoughSideHalf || isContainerXEnoughSideHalf)) {
19198
+ position = this._adjustPos(position, true, 'reduce');
18963
19199
  }
18964
19200
 
18965
19201
  break;
18966
19202
 
18967
19203
  case 'right':
18968
19204
  if (shouldReverseRight) {
18969
- position = this._reversePos(position);
19205
+ position = this._adjustPos(position);
19206
+ }
19207
+
19208
+ if (isYOverFlowSideHalf && (shouldReverseTopSide || shouldReverseBottomSide)) {
19209
+ position = this._adjustPos(position, false, 'expand', shouldReverseTopSide ? 'Bottom' : 'Top');
18970
19210
  }
18971
19211
 
18972
19212
  break;
18973
19213
 
18974
19214
  case 'rightTop':
18975
19215
  if (shouldReverseRight) {
18976
- position = this._reversePos(position);
19216
+ position = this._adjustPos(position);
18977
19217
  }
18978
19218
 
18979
19219
  if (shouldReverseTopSide && heightIsBigger) {
18980
- position = this._reversePos(position, true);
19220
+ position = this._adjustPos(position, true);
19221
+ }
19222
+
19223
+ if (isHeightOverFlow && (isViewYEnoughSideHalf || isContainerYEnoughSideHalf)) {
19224
+ position = this._adjustPos(position, false, 'reduce');
18981
19225
  }
18982
19226
 
18983
19227
  break;
18984
19228
 
18985
19229
  case 'rightBottom':
18986
19230
  if (shouldReverseRight) {
18987
- position = this._reversePos(position);
19231
+ position = this._adjustPos(position);
18988
19232
  }
18989
19233
 
18990
19234
  if (shouldReverseBottomSide && heightIsBigger) {
18991
- position = this._reversePos(position, true);
19235
+ position = this._adjustPos(position, true);
19236
+ }
19237
+
19238
+ if (isHeightOverFlow && (isViewYEnoughSideHalf || isContainerYEnoughSideHalf)) {
19239
+ position = this._adjustPos(position, false, 'reduce');
18992
19240
  }
18993
19241
 
18994
19242
  break;
18995
19243
 
18996
19244
  case 'leftTopOver':
18997
19245
  if (shouldReverseTopOver) {
18998
- position = this._reversePos(position, true);
19246
+ position = this._adjustPos(position, true);
18999
19247
  }
19000
19248
 
19001
19249
  if (shouldReverseLeftOver) {
19002
- position = this._reversePos(position);
19250
+ position = this._adjustPos(position);
19003
19251
  }
19004
19252
 
19005
19253
  break;
19006
19254
 
19007
19255
  case 'leftBottomOver':
19008
19256
  if (shouldReverseBottomOver) {
19009
- position = this._reversePos(position, true);
19257
+ position = this._adjustPos(position, true);
19010
19258
  }
19011
19259
 
19012
19260
  if (shouldReverseLeftOver) {
19013
- position = this._reversePos(position);
19261
+ position = this._adjustPos(position);
19014
19262
  }
19015
19263
 
19016
19264
  break;
19017
19265
 
19018
19266
  case 'rightTopOver':
19019
19267
  if (shouldReverseTopOver) {
19020
- position = this._reversePos(position, true);
19268
+ position = this._adjustPos(position, true);
19021
19269
  }
19022
19270
 
19023
19271
  if (shouldReverseRightOver) {
19024
- position = this._reversePos(position);
19272
+ position = this._adjustPos(position);
19025
19273
  }
19026
19274
 
19027
19275
  break;
19028
19276
 
19029
19277
  case 'rightBottomOver':
19030
19278
  if (shouldReverseBottomOver) {
19031
- position = this._reversePos(position, true);
19279
+ position = this._adjustPos(position, true);
19032
19280
  }
19033
19281
 
19034
19282
  if (shouldReverseRightOver) {
19035
- position = this._reversePos(position);
19283
+ position = this._adjustPos(position);
19036
19284
  }
19037
19285
 
19038
19286
  break;
19039
19287
 
19040
19288
  default:
19041
19289
  break;
19290
+ } // 判断溢出 Judgment overflow
19291
+ // 上下方向 top and bottom
19292
+
19293
+
19294
+ if (this.isTB(position)) {
19295
+ isHeightOverFlow = isViewYOverFlow && isContainerYOverFlow;
19296
+
19297
+ if (position === 'top' || position === 'bottom') {
19298
+ isWidthOverFlow = isViewXOverFlowSideHalf && isContainerXOverFlowSideHalf;
19299
+ } else {
19300
+ isWidthOverFlow = isViewXOverFlowSide && isContainerXOverFlowSide;
19301
+ }
19302
+ } // 左右方向 left and right
19303
+
19304
+
19305
+ if (this.isLR(position)) {
19306
+ isWidthOverFlow = isViewXOverFlow && isContainerXOverFlow;
19307
+
19308
+ if (position === 'left' || position === 'right') {
19309
+ isHeightOverFlow = isViewYOverFlowSideHalf && isContainerYOverFlowSideHalf;
19310
+ } else {
19311
+ isHeightOverFlow = isViewYOverFlowSide && isContainerYOverFlowSide;
19312
+ }
19042
19313
  }
19043
19314
  }
19044
19315
 
19045
- return position;
19316
+ return {
19317
+ position,
19318
+ isHeightOverFlow,
19319
+ isWidthOverFlow
19320
+ };
19046
19321
  }
19047
19322
 
19048
19323
  _bindScrollEvent() {
@@ -19211,8 +19486,8 @@ const numbers = {
19211
19486
  DEFAULT_Z_INDEX: 1060,
19212
19487
  MOUSE_ENTER_DELAY: 50,
19213
19488
  MOUSE_LEAVE_DELAY: 50,
19214
- SPACING: 8 // Values are consistent with spacing-tight in scss
19215
-
19489
+ SPACING: 8,
19490
+ MARGIN: 0
19216
19491
  };
19217
19492
 
19218
19493
  // CONCATENATED MODULE: ../semi-foundation/utils/uuid.ts
@@ -20320,6 +20595,7 @@ tooltip_Tooltip.propTypes = {
20320
20595
  onVisibleChange: prop_types_default.a.func,
20321
20596
  onClickOutSide: prop_types_default.a.func,
20322
20597
  spacing: prop_types_default.a.number,
20598
+ margin: prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.object]),
20323
20599
  showArrow: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.node]),
20324
20600
  zIndex: prop_types_default.a.number,
20325
20601
  rePosKey: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.number]),
@@ -20349,6 +20625,7 @@ tooltip_Tooltip.defaultProps = {
20349
20625
  onVisibleChange: noop_default.a,
20350
20626
  onClickOutSide: noop_default.a,
20351
20627
  spacing: numbers.SPACING,
20628
+ margin: numbers.MARGIN,
20352
20629
  showArrow: true,
20353
20630
  wrapWhenSpecial: true,
20354
20631
  zIndex: numbers.DEFAULT_Z_INDEX,
@@ -22859,6 +23136,13 @@ const IconWindowAdaptionStroked_IconComponent = convertIcon(IconWindowAdaptionSt
22859
23136
 
22860
23137
 
22861
23138
 
23139
+
23140
+
23141
+
23142
+
23143
+
23144
+
23145
+
22862
23146
 
22863
23147
 
22864
23148
 
@@ -40525,27 +40809,33 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
40525
40809
  return state;
40526
40810
  };
40527
40811
 
40528
- this.renderIcon = type => {
40812
+ this.renderIcon = function (type) {
40813
+ let haveMarginLeft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
40814
+
40815
+ const finalCls = style => {
40816
+ return style + (haveMarginLeft ? " ".concat(item_prefixcls, "-icon-left") : '');
40817
+ };
40818
+
40529
40819
  switch (type) {
40530
40820
  case 'child':
40531
40821
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronRight, {
40532
- className: "".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-expand")
40822
+ className: finalCls("".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-expand"))
40533
40823
  });
40534
40824
 
40535
40825
  case 'tick':
40536
40826
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconTick, {
40537
- className: "".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-active")
40827
+ className: finalCls("".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-active"))
40538
40828
  });
40539
40829
 
40540
40830
  case 'loading':
40541
40831
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(spin_0, {
40542
- wrapperClassName: "".concat(item_prefixcls, "-spin-icon")
40832
+ wrapperClassName: finalCls("".concat(item_prefixcls, "-spin-icon"))
40543
40833
  });
40544
40834
 
40545
40835
  case 'empty':
40546
40836
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
40547
40837
  "aria-hidden": true,
40548
- className: "".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-empty")
40838
+ className: finalCls("".concat(item_prefixcls, "-icon ").concat(item_prefixcls, "-icon-empty"))
40549
40839
  });
40550
40840
 
40551
40841
  default:
@@ -40693,7 +40983,7 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
40693
40983
  indeterminate: halfCheckedKeys.has(item.key),
40694
40984
  checked: checkedKeys.has(item.key),
40695
40985
  className: "".concat(item_prefixcls, "-label-checkbox")
40696
- }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, label)), showExpand ? this.renderIcon(loading ? 'loading' : 'child') : null);
40986
+ }), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, label)), showExpand ? this.renderIcon(loading ? 'loading' : 'child', true) : null);
40697
40987
  })));
40698
40988
 
40699
40989
  if (showChildItem) {
@@ -43320,20 +43610,22 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
43320
43610
  return tagsArray.map((value, index) => {
43321
43611
  const elementKey = showIconHandler ? value : "".concat(index).concat(value);
43322
43612
 
43613
+ const onClose = () => {
43614
+ !disabled && this.handleTagClose(index);
43615
+ };
43616
+
43323
43617
  if (isFunction_default()(renderTagItem)) {
43324
43618
  return showIconHandler ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
43325
43619
  className: itemWrapperCls,
43326
43620
  key: elementKey
43327
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(DragHandle, null), renderTagItem(value, index)) : renderTagItem(value, index);
43621
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(DragHandle, null), renderTagItem(value, index, onClose)) : renderTagItem(value, index, onClose);
43328
43622
  } else {
43329
43623
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tag_Tag, {
43330
43624
  className: tagCls,
43331
43625
  color: "white",
43332
43626
  size: size === 'small' ? 'small' : 'large',
43333
43627
  type: "light",
43334
- onClose: () => {
43335
- !disabled && this.handleTagClose(index);
43336
- },
43628
+ onClose: onClose,
43337
43629
  closable: !disabled,
43338
43630
  key: elementKey,
43339
43631
  visible: true,
@@ -64606,7 +64898,8 @@ class Item_NavItem extends baseComponent_BaseComponent {
64606
64898
  link,
64607
64899
  linkOptions,
64608
64900
  disabled,
64609
- level = 0
64901
+ level = 0,
64902
+ tabIndex
64610
64903
  } = this.props;
64611
64904
  const {
64612
64905
  mode,
@@ -64669,7 +64962,8 @@ class Item_NavItem extends baseComponent_BaseComponent {
64669
64962
  ["".concat(Item_clsPrefix, "-sub")]: isSubNav,
64670
64963
  ["".concat(Item_clsPrefix, "-selected")]: selected && !isSubNav,
64671
64964
  ["".concat(Item_clsPrefix, "-collapsed")]: isCollapsed,
64672
- ["".concat(Item_clsPrefix, "-disabled")]: disabled
64965
+ ["".concat(Item_clsPrefix, "-disabled")]: disabled,
64966
+ ["".concat(Item_clsPrefix, "-has-link")]: typeof link === 'string'
64673
64967
  });
64674
64968
  const ariaProps = {
64675
64969
  'aria-disabled': disabled
@@ -64686,7 +64980,7 @@ class Item_NavItem extends baseComponent_BaseComponent {
64686
64980
  external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", Object.assign({
64687
64981
  // if role = menuitem, the narration will read all expanded li
64688
64982
  role: isSubNav ? null : "menuitem",
64689
- tabIndex: isSubNav ? -1 : 0
64983
+ tabIndex: isSubNav ? -1 : tabIndex
64690
64984
  }, ariaProps, {
64691
64985
  style: style,
64692
64986
  ref: this.setItemRef,
@@ -64725,7 +65019,8 @@ Item_NavItem.propTypes = {
64725
65019
  isSubNav: prop_types_default.a.bool,
64726
65020
  link: prop_types_default.a.string,
64727
65021
  linkOptions: prop_types_default.a.object,
64728
- disabled: prop_types_default.a.bool
65022
+ disabled: prop_types_default.a.bool,
65023
+ tabIndex: prop_types_default.a.number
64729
65024
  };
64730
65025
  Item_NavItem.defaultProps = {
64731
65026
  isSubNav: false,
@@ -64735,7 +65030,8 @@ Item_NavItem.defaultProps = {
64735
65030
  onClick: noop_default.a,
64736
65031
  onMouseEnter: noop_default.a,
64737
65032
  onMouseLeave: noop_default.a,
64738
- disabled: false
65033
+ disabled: false,
65034
+ tabIndex: 0
64739
65035
  };
64740
65036
  // CONCATENATED MODULE: ./navigation/SubNav.tsx
64741
65037
 
@@ -79057,7 +79353,8 @@ const DEFAULT_CELL_MIDDLE_PADDING_TOP = 12;
79057
79353
  const DEFAULT_CELL_MIDDLE_PADDING_BOTTOM = 12;
79058
79354
  const DEFAULT_CELL_SMALL_PADDING_TOP = 8;
79059
79355
  const DEFAULT_CELL_SMALL_PADDING_BOTTOM = 8;
79060
- const DEFAULT_CELL_LINE_HEIGHT = 20; // normal size
79356
+ const DEFAULT_CELL_LINE_HEIGHT = 20;
79357
+ const DEFAULT_EMPTYSLOT_HEIGHT = 52; // normal size
79061
79358
 
79062
79359
  const DEFAULT_VIRTUALIZED_ROW_HEIGHT = DEFAULT_CELL_LINE_HEIGHT + DEFAULT_CELL_BORDER_WITH_BOTTOM + DEFAULT_CELL_BORDER_WITH_TOP + DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM;
79063
79360
  const DEFAULT_VIRTUALIZED_ROW_MIN_HEIGHT = DEFAULT_CELL_PADDING_TOP + DEFAULT_CELL_PADDING_BOTTOM + DEFAULT_CELL_BORDER_WITH_BOTTOM; // middle size
@@ -79093,7 +79390,8 @@ const table_constants_numbers = {
79093
79390
  DEFAULT_VIRTUALIZED_ROW_MIDDLE_MIN_HEIGHT,
79094
79391
  DEFAULT_VIRTUALIZED_SECTION_ROW_SMALL_HEIGHT: DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
79095
79392
  DEFAULT_VIRTUALIZED_ROW_SMALL_HEIGHT,
79096
- DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT
79393
+ DEFAULT_VIRTUALIZED_ROW_SMALL_MIN_HEIGHT,
79394
+ DEFAULT_EMPTYSLOT_HEIGHT
79097
79395
  };
79098
79396
 
79099
79397
  // CONCATENATED MODULE: ../semi-foundation/utils/Logger.ts
@@ -83792,7 +84090,7 @@ class Body_Body extends baseComponent_BaseComponent {
83792
84090
  width: tableWidth
83793
84091
  },
83794
84092
  className: tableCls
83795
- }, size_default()(dataSource) === 0 ? emptySlot : children));
84093
+ }, children), size_default()(dataSource) === 0 && emptySlot);
83796
84094
  });
83797
84095
 
83798
84096
  this.onItemsRendered = props => {
@@ -83832,7 +84130,7 @@ class Body_Body extends baseComponent_BaseComponent {
83832
84130
 
83833
84131
  const listStyle = {
83834
84132
  width: '100%',
83835
- height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y : 0,
84133
+ height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y : table_constants_numbers.DEFAULT_EMPTYSLOT_HEIGHT,
83836
84134
  overflowX: 'auto',
83837
84135
  overflowY: 'auto'
83838
84136
  };
@@ -85030,8 +85328,9 @@ class Table_Table extends baseComponent_BaseComponent {
85030
85328
  useFixedHeader,
85031
85329
  headerRef: this._cacheHeaderRef,
85032
85330
  bodyRef: this.bodyWrapRef,
85033
- includeHeader: !useFixedHeader
85034
- })), emptySlot, this.renderFooter(props)];
85331
+ includeHeader: !useFixedHeader,
85332
+ emptySlot
85333
+ })), this.renderFooter(props)];
85035
85334
  return table;
85036
85335
  };
85037
85336
 
@@ -96668,7 +96967,7 @@ class foundation_TransferFoundation extends foundation {
96668
96967
  return path.map(p => p.label).join(' > ');
96669
96968
  }
96670
96969
 
96671
- handleInputChange(inputVal) {
96970
+ handleInputChange(inputVal, notify) {
96672
96971
  const {
96673
96972
  data
96674
96973
  } = this.getStates();
@@ -96682,7 +96981,7 @@ class foundation_TransferFoundation extends foundation {
96682
96981
 
96683
96982
  this._adapter.searchTree(inputVal);
96684
96983
 
96685
- this._adapter.notifySearch(inputVal);
96984
+ notify && this._adapter.notifySearch(inputVal);
96686
96985
 
96687
96986
  this._adapter.updateInput(inputVal);
96688
96987
 
@@ -96694,8 +96993,7 @@ class foundation_TransferFoundation extends foundation {
96694
96993
  const filterFunc = typeof filter === 'function' ? item => filter(inputVal, item) : item => typeof item.label === 'string' && item.label.includes(inputVal);
96695
96994
  const searchData = data.filter(filterFunc);
96696
96995
  const searchResult = new Set(searchData.map(item => item.key));
96697
-
96698
- this._adapter.notifySearch(inputVal);
96996
+ notify && this._adapter.notifySearch(inputVal);
96699
96997
 
96700
96998
  this._adapter.updateInput(inputVal);
96701
96999
 
@@ -97040,7 +97338,13 @@ class transfer_Transfer extends baseComponent_BaseComponent {
97040
97338
  }
97041
97339
 
97042
97340
  onInputChange(value) {
97043
- this.foundation.handleInputChange(value);
97341
+ this.foundation.handleInputChange(value, true);
97342
+ }
97343
+
97344
+ search(value) {
97345
+ // The search method is used to provide the user with a manually triggered search
97346
+ // Since the method is manually called by the user, setting the second parameter to false does not trigger the onSearch callback to notify the user
97347
+ this.foundation.handleInputChange(value, false);
97044
97348
  }
97045
97349
 
97046
97350
  onSelectOrRemove(item) {
@@ -100352,9 +100656,9 @@ class previewFooterFoundation_PreviewFooterFoundation extends foundation {
100352
100656
  } = this.getProps();
100353
100657
 
100354
100658
  if (value > zoom) {
100355
- onZoomIn(value / 100);
100659
+ onZoomIn(Number((value / 100).toFixed(2)));
100356
100660
  } else {
100357
- onZoomOut(value / 100);
100661
+ onZoomOut(Number((value / 100).toFixed(2)));
100358
100662
  }
100359
100663
 
100360
100664
  this._adapter.setStartMouseOffset(value);
@@ -101281,7 +101585,7 @@ previewImage_PreviewImage.propTypes = {
101281
101585
  zoomStep: prop_types_default.a.number,
101282
101586
  zoom: prop_types_default.a.number,
101283
101587
  ratio: prop_types_default.a.string,
101284
- disableDownload: prop_types_default.a.number,
101588
+ disableDownload: prop_types_default.a.bool,
101285
101589
  clickZoom: prop_types_default.a.number,
101286
101590
  setRatio: prop_types_default.a.func,
101287
101591
  onZoom: prop_types_default.a.func,
@@ -101511,7 +101815,7 @@ class previewInnerFoundation_PreviewInnerFoundation extends foundation {
101511
101815
  });
101512
101816
  }
101513
101817
 
101514
- this._adapter.notifyChange(newIndex);
101818
+ this._adapter.notifyChange(newIndex, direction);
101515
101819
 
101516
101820
  this.setState({
101517
101821
  direction,
@@ -101823,11 +102127,19 @@ class previewInner_PreviewInner extends baseComponent_BaseComponent {
101823
102127
  get adapter() {
101824
102128
  return Object.assign(Object.assign({}, super.adapter), {
101825
102129
  getIsInGroup: () => this.isInGroup(),
101826
- notifyChange: index => {
102130
+ notifyChange: (index, direction) => {
101827
102131
  const {
101828
- onChange
102132
+ onChange,
102133
+ onPrev,
102134
+ onNext
101829
102135
  } = this.props;
101830
102136
  isFunction_default()(onChange) && onChange(index);
102137
+
102138
+ if (direction === "prev") {
102139
+ onPrev && onPrev(index);
102140
+ } else {
102141
+ onNext && onNext(index);
102142
+ }
101831
102143
  },
101832
102144
  notifyZoom: (zoom, increase) => {
101833
102145
  const {
@@ -101861,9 +102173,9 @@ class previewInner_PreviewInner extends baseComponent_BaseComponent {
101861
102173
  },
101862
102174
  notifyRotateChange: angle => {
101863
102175
  const {
101864
- onRotateChange
102176
+ onRotateLeft
101865
102177
  } = this.props;
101866
- isFunction_default()(onRotateChange) && onRotateChange(angle);
102178
+ isFunction_default()(onRotateLeft) && onRotateLeft(angle);
101867
102179
  },
101868
102180
  notifyDownload: (src, index) => {
101869
102181
  const {
@@ -102121,7 +102433,7 @@ previewInner_PreviewInner.propTypes = {
102121
102433
  onNext: prop_types_default.a.func,
102122
102434
  onDownload: prop_types_default.a.func,
102123
102435
  onRatioChange: prop_types_default.a.func,
102124
- onRotateChange: prop_types_default.a.func
102436
+ onRotateLeft: prop_types_default.a.func
102125
102437
  };
102126
102438
  previewInner_PreviewInner.defaultProps = {
102127
102439
  showTooltip: false,
@@ -102198,7 +102510,7 @@ class imageFoundation_ImageFoundation extends foundation {
102198
102510
  } = preview;
102199
102511
  onVisibleChange && onVisibleChange(newVisible);
102200
102512
 
102201
- if (!("visible" in this.getProps())) {
102513
+ if (!("visible" in preview)) {
102202
102514
  this.setState({
102203
102515
  previewVisible: newVisible
102204
102516
  });
@@ -102218,6 +102530,7 @@ var image_image = __webpack_require__("txvO");
102218
102530
  // CONCATENATED MODULE: ./image/image.tsx
102219
102531
 
102220
102532
 
102533
+
102221
102534
  /* eslint-disable jsx-a11y/click-events-have-key-events */
102222
102535
 
102223
102536
  /* eslint-disable jsx-a11y/no-static-element-interactions */
@@ -102349,6 +102662,16 @@ class image_Image extends baseComponent_BaseComponent {
102349
102662
  willUpdateStates.loadStatus = "loading";
102350
102663
  }
102351
102664
 
102665
+ if (isObject_default()(props.preview)) {
102666
+ const {
102667
+ visible
102668
+ } = props.preview;
102669
+
102670
+ if (isBoolean_default()(visible)) {
102671
+ willUpdateStates.previewVisible = visible;
102672
+ }
102673
+ }
102674
+
102352
102675
  return willUpdateStates;
102353
102676
  }
102354
102677
 
@@ -102709,8 +103032,8 @@ preview_Preview.propTypes = {
102709
103032
  onPrev: prop_types_default.a.func,
102710
103033
  onNext: prop_types_default.a.func,
102711
103034
  onDownload: prop_types_default.a.func,
102712
- onRatioChange: prop_types_default.a.func,
102713
- onRotateChange: prop_types_default.a.func
103035
+ onRotateLeft: prop_types_default.a.func,
103036
+ onRatioChange: prop_types_default.a.func
102714
103037
  };
102715
103038
  preview_Preview.defaultProps = {
102716
103039
  src: [],