@douyinfe/semi-foundation 2.51.4 → 2.52.0-beta.0

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 (70) hide show
  1. package/avatar/animation.scss +19 -0
  2. package/avatar/avatar.scss +313 -0
  3. package/avatar/variables.scss +66 -10
  4. package/cascader/foundation.ts +7 -13
  5. package/cascader/util.ts +0 -13
  6. package/datePicker/foundation.ts +7 -7
  7. package/input/input.scss +12 -3
  8. package/input/variables.scss +5 -0
  9. package/lib/cjs/avatar/animation.scss +19 -0
  10. package/lib/cjs/avatar/avatar.css +261 -0
  11. package/lib/cjs/avatar/avatar.scss +313 -0
  12. package/lib/cjs/avatar/variables.scss +66 -10
  13. package/lib/cjs/cascader/foundation.d.ts +11 -4
  14. package/lib/cjs/cascader/foundation.js +14 -22
  15. package/lib/cjs/cascader/util.d.ts +0 -1
  16. package/lib/cjs/cascader/util.js +0 -14
  17. package/lib/cjs/datePicker/foundation.d.ts +2 -2
  18. package/lib/cjs/datePicker/foundation.js +4 -5
  19. package/lib/cjs/input/input.css +12 -0
  20. package/lib/cjs/input/input.scss +12 -3
  21. package/lib/cjs/input/variables.scss +5 -0
  22. package/lib/cjs/modal/modal.css +3 -0
  23. package/lib/cjs/modal/modal.scss +5 -1
  24. package/lib/cjs/modal/modalFoundation.d.ts +1 -0
  25. package/lib/cjs/modal/variables.scss +4 -0
  26. package/lib/cjs/slider/constants.d.ts +1 -0
  27. package/lib/cjs/slider/constants.js +2 -1
  28. package/lib/cjs/slider/foundation.d.ts +7 -0
  29. package/lib/cjs/slider/slider.css +9 -0
  30. package/lib/cjs/slider/slider.scss +10 -0
  31. package/lib/cjs/slider/variables.scss +2 -0
  32. package/lib/cjs/tooltip/foundation.js +0 -11
  33. package/lib/cjs/treeSelect/foundation.d.ts +1 -0
  34. package/lib/cjs/treeSelect/foundation.js +1 -0
  35. package/lib/es/avatar/animation.scss +19 -0
  36. package/lib/es/avatar/avatar.css +261 -0
  37. package/lib/es/avatar/avatar.scss +313 -0
  38. package/lib/es/avatar/variables.scss +66 -10
  39. package/lib/es/cascader/foundation.d.ts +11 -4
  40. package/lib/es/cascader/foundation.js +15 -23
  41. package/lib/es/cascader/util.d.ts +0 -1
  42. package/lib/es/cascader/util.js +0 -13
  43. package/lib/es/datePicker/foundation.d.ts +2 -2
  44. package/lib/es/datePicker/foundation.js +4 -5
  45. package/lib/es/input/input.css +12 -0
  46. package/lib/es/input/input.scss +12 -3
  47. package/lib/es/input/variables.scss +5 -0
  48. package/lib/es/modal/modal.css +3 -0
  49. package/lib/es/modal/modal.scss +5 -1
  50. package/lib/es/modal/modalFoundation.d.ts +1 -0
  51. package/lib/es/modal/variables.scss +4 -0
  52. package/lib/es/slider/constants.d.ts +1 -0
  53. package/lib/es/slider/constants.js +2 -1
  54. package/lib/es/slider/foundation.d.ts +7 -0
  55. package/lib/es/slider/slider.css +9 -0
  56. package/lib/es/slider/slider.scss +10 -0
  57. package/lib/es/slider/variables.scss +2 -0
  58. package/lib/es/tooltip/foundation.js +0 -11
  59. package/lib/es/treeSelect/foundation.d.ts +1 -0
  60. package/lib/es/treeSelect/foundation.js +1 -0
  61. package/modal/modal.scss +5 -1
  62. package/modal/modalFoundation.ts +2 -1
  63. package/modal/variables.scss +4 -0
  64. package/package.json +3 -3
  65. package/slider/constants.ts +1 -0
  66. package/slider/foundation.ts +8 -1
  67. package/slider/slider.scss +10 -0
  68. package/slider/variables.scss +2 -0
  69. package/tooltip/foundation.ts +2 -12
  70. package/treeSelect/foundation.ts +2 -0
@@ -15,6 +15,7 @@ $color-slider_rail: rgba(0, 0, 0, 0.65);
15
15
  $color-slider_track-bg-default: var(--semi-color-primary); // 滑动条轨道颜色 - 已填充
16
16
  $color-slider_track_disabled-bg: var(--semi-color-primary-disabled); // 禁用滑动条轨道颜色 - 已填充
17
17
  $color-slider_handle-focus: var(--semi-color-primary-light-active); // 圆形按钮轮廓 - 聚焦
18
+ $color-slider_handle_dot: var(--semi-color-primary); // 圆形按钮内部圆点颜色
18
19
 
19
20
  // Spacing
20
21
  $spacing-slider-paddingX: 13px; // 滑动条整体水平内边距
@@ -57,6 +58,7 @@ $height-slider_track: 4px; // 滚动条已填充轨道高度
57
58
  $width-slider_dot: 4px; // 滚动条圆形刻度点宽度
58
59
  $width-slider_handle_border_disabled: 1px; // 禁用滚动条圆形按钮按下后描边宽度
59
60
  $width-slider_handle-focus: 2px; // 圆形按钮轮廓 - 聚焦
61
+ $width-slider_handle_dot: 4px; // 圆形按钮内部圆点宽度
60
62
 
61
63
  // Font
62
64
  $font-slider_rail-fontSize: 14px; // 滚动条轨道文本字号
@@ -450,10 +450,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
450
450
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
451
451
 
452
452
  const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
453
- const scaled = Math.abs(wrapperRect?.width - this._adapter.getContainer()?.clientWidth) > 1;
454
- if (scaled) {
455
- SPACING = SPACING * wrapperRect.width/this._adapter.getContainer().clientWidth;
456
- }
453
+
457
454
  switch (position) {
458
455
  case 'top':
459
456
  // left = middleX;
@@ -573,14 +570,6 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
573
570
  left = left - containerRect.left;
574
571
  top = top - containerRect.top;
575
572
 
576
- if (scaled) {
577
- left /= wrapperRect.width/this._adapter.getContainer().clientWidth;
578
- }
579
-
580
- if (scaled) {
581
- top /= wrapperRect.height/this._adapter.getContainer().clientHeight;
582
- }
583
-
584
573
  /**
585
574
  * container为body时,如果position不为relative或absolute,这时trigger计算出的top/left会根据html定位(initial containing block)
586
575
  * 此时如果body有margin,则计算出的位置相对于body会有问题 fix issue #1368
@@ -839,6 +828,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
839
828
 
840
829
  const halfHeight = triggerRect.height / 2;
841
830
  const halfWidth = triggerRect.width / 2;
831
+
842
832
  // 视口, 原空间与反向空间是否都不足判断
843
833
  // Viewport, whether the original space and the reverse space are insufficient to judge
844
834
  const isViewYOverFlow = this.isOverFlow(clientTop - marginTop, restClientBottom - marginBottom, wrapperRect.height + spacing);
@@ -189,6 +189,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
189
189
  closeMenu: (cb?: () => void) => void;
190
190
  getTriggerWidth: () => boolean | number;
191
191
  setOptionWrapperWidth: (width: null | number) => void;
192
+ notifyClear: (e: any) => void;
192
193
  notifyChange: BasicOnChangeWithBasic;
193
194
  notifyChangeWithObject: BasicOnChangeWithObject;
194
195
  notifyExpand: (expandedKeys: Set<string>, expandedOtherProps: BasicExpandedOtherProps) => void;
@@ -548,6 +549,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
548
549
  }
549
550
  }
550
551
  }
552
+ this._adapter.notifyClear(e);
551
553
  }
552
554
 
553
555
  /**