@douyinfe/semi-foundation 2.30.0-alpha.0 → 2.30.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 (224) hide show
  1. package/datePicker/monthsGridFoundation.ts +9 -3
  2. package/lib/cjs/anchor/constants.js +1 -1
  3. package/lib/cjs/anchor/foundation.js +3 -3
  4. package/lib/cjs/autoComplete/constants.js +3 -3
  5. package/lib/cjs/avatar/constants.js +1 -1
  6. package/lib/cjs/backtop/constants.js +1 -1
  7. package/lib/cjs/badge/constants.js +1 -1
  8. package/lib/cjs/banner/constants.js +1 -1
  9. package/lib/cjs/breadcrumb/constants.js +1 -1
  10. package/lib/cjs/button/constants.js +1 -1
  11. package/lib/cjs/calendar/constants.js +1 -1
  12. package/lib/cjs/card/constants.js +1 -1
  13. package/lib/cjs/carousel/constants.js +9 -9
  14. package/lib/cjs/cascader/constants.js +2 -2
  15. package/lib/cjs/cascader/foundation.js +1 -1
  16. package/lib/cjs/cascader/util.js +2 -2
  17. package/lib/cjs/checkbox/constants.js +13 -13
  18. package/lib/cjs/collapse/constants.js +1 -1
  19. package/lib/cjs/collapsible/constants.js +1 -1
  20. package/lib/cjs/datePicker/_utils/getInsetInputFormatToken.js +1 -1
  21. package/lib/cjs/datePicker/_utils/getMonthTable.js +4 -4
  22. package/lib/cjs/datePicker/_utils/getMonthsInYear.js +1 -1
  23. package/lib/cjs/datePicker/constants.js +27 -27
  24. package/lib/cjs/datePicker/foundation.js +3 -3
  25. package/lib/cjs/datePicker/inputFoundation.js +2 -2
  26. package/lib/cjs/datePicker/monthsGridFoundation.js +15 -4
  27. package/lib/cjs/descriptions/constants.js +1 -1
  28. package/lib/cjs/divider/constants.js +1 -1
  29. package/lib/cjs/dropdown/constants.js +3 -3
  30. package/lib/cjs/dropdown/menuFoundation.js +1 -1
  31. package/lib/cjs/empty/constants.js +1 -1
  32. package/lib/cjs/form/constants.js +1 -1
  33. package/lib/cjs/form/foundation.js +1 -1
  34. package/lib/cjs/form/utils.js +1 -1
  35. package/lib/cjs/grid/constants.js +1 -1
  36. package/lib/cjs/highlight/constants.js +1 -1
  37. package/lib/cjs/icons/constants.js +1 -1
  38. package/lib/cjs/image/constants.js +1 -1
  39. package/lib/cjs/input/constants.js +1 -1
  40. package/lib/cjs/input/textareaFoundation.js +1 -1
  41. package/lib/cjs/layout/constants.js +1 -1
  42. package/lib/cjs/list/constants.js +1 -1
  43. package/lib/cjs/modal/constants.js +1 -1
  44. package/lib/cjs/navigation/constants.js +1 -1
  45. package/lib/cjs/notification/constants.js +3 -3
  46. package/lib/cjs/pagination/constants.js +1 -1
  47. package/lib/cjs/popconfirm/constants.js +2 -2
  48. package/lib/cjs/popconfirm/popconfirmFoundation.d.ts +4 -0
  49. package/lib/cjs/popconfirm/popconfirmFoundation.js +21 -1
  50. package/lib/cjs/popover/constants.js +2 -2
  51. package/lib/cjs/progress/constants.js +1 -1
  52. package/lib/cjs/progress/generates.js +14 -14
  53. package/lib/cjs/radio/constants.js +13 -13
  54. package/lib/cjs/rating/constants.js +1 -1
  55. package/lib/cjs/scrollList/constants.js +2 -2
  56. package/lib/cjs/select/constants.js +3 -3
  57. package/lib/cjs/select/foundation.js +2 -1
  58. package/lib/cjs/select/select.css +1 -0
  59. package/lib/cjs/select/select.scss +1 -0
  60. package/lib/cjs/select/variables.scss +1 -0
  61. package/lib/cjs/sideSheet/constants.js +2 -2
  62. package/lib/cjs/skeleton/constants.js +1 -1
  63. package/lib/cjs/slider/constants.js +7 -7
  64. package/lib/cjs/space/constants.js +1 -1
  65. package/lib/cjs/spin/constants.js +1 -1
  66. package/lib/cjs/steps/bacisSteps.scss +238 -286
  67. package/lib/cjs/steps/constants.js +2 -2
  68. package/lib/cjs/steps/fillSteps.scss +142 -148
  69. package/lib/cjs/steps/navSteps.scss +40 -60
  70. package/lib/cjs/steps/steps.css +14 -377
  71. package/lib/cjs/switch/constants.js +13 -13
  72. package/lib/cjs/table/constants.js +7 -7
  73. package/lib/cjs/table/utils.js +2 -2
  74. package/lib/cjs/tabs/constants.js +21 -21
  75. package/lib/cjs/tag/constants.js +1 -1
  76. package/lib/cjs/tag/tag.css +9 -2
  77. package/lib/cjs/tag/tag.scss +13 -4
  78. package/lib/cjs/tagInput/constants.js +1 -1
  79. package/lib/cjs/timePicker/ComboxFoundation.js +2 -2
  80. package/lib/cjs/timePicker/constants.js +3 -3
  81. package/lib/cjs/timePicker/utils/index.js +3 -3
  82. package/lib/cjs/timeline/constants.js +2 -2
  83. package/lib/cjs/toast/constants.js +3 -3
  84. package/lib/cjs/tooltip/constants.js +1 -1
  85. package/lib/cjs/tooltip/foundation.d.ts +1 -1
  86. package/lib/cjs/tooltip/foundation.js +15 -12
  87. package/lib/cjs/transfer/constants.js +1 -1
  88. package/lib/cjs/tree/constants.js +2 -2
  89. package/lib/cjs/tree/treeUtil.d.ts +1 -1
  90. package/lib/cjs/tree/treeUtil.js +1 -1
  91. package/lib/cjs/treeSelect/constants.js +3 -3
  92. package/lib/cjs/treeSelect/foundation.d.ts +5 -2
  93. package/lib/cjs/treeSelect/foundation.js +42 -17
  94. package/lib/cjs/treeSelect/treeSelect.css +5 -1
  95. package/lib/cjs/treeSelect/treeSelect.scss +6 -0
  96. package/lib/cjs/treeSelect/variables.scss +1 -1
  97. package/lib/cjs/typography/constants.js +1 -1
  98. package/lib/cjs/typography/formatNumeral.js +6 -11
  99. package/lib/cjs/upload/constants.d.ts +1 -1
  100. package/lib/cjs/upload/constants.js +2 -2
  101. package/lib/cjs/upload/foundation.js +1 -1
  102. package/lib/cjs/upload/utils.js +4 -4
  103. package/lib/cjs/utils/getMotionObjFromProps.js +2 -2
  104. package/lib/cjs/utils/touchPolyfill.js +1 -1
  105. package/lib/cjs/utils/uuid.js +2 -2
  106. package/lib/cjs/utils/warning.js +1 -1
  107. package/lib/es/anchor/constants.js +1 -1
  108. package/lib/es/anchor/foundation.js +3 -3
  109. package/lib/es/autoComplete/constants.js +3 -3
  110. package/lib/es/avatar/constants.js +1 -1
  111. package/lib/es/backtop/constants.js +1 -1
  112. package/lib/es/badge/constants.js +1 -1
  113. package/lib/es/banner/constants.js +1 -1
  114. package/lib/es/breadcrumb/constants.js +1 -1
  115. package/lib/es/button/constants.js +1 -1
  116. package/lib/es/calendar/constants.js +1 -1
  117. package/lib/es/card/constants.js +1 -1
  118. package/lib/es/carousel/constants.js +9 -9
  119. package/lib/es/cascader/constants.js +2 -2
  120. package/lib/es/cascader/foundation.js +1 -1
  121. package/lib/es/cascader/util.js +2 -2
  122. package/lib/es/checkbox/constants.js +13 -13
  123. package/lib/es/collapse/constants.js +1 -1
  124. package/lib/es/collapsible/constants.js +1 -1
  125. package/lib/es/datePicker/_utils/getInsetInputFormatToken.js +1 -1
  126. package/lib/es/datePicker/_utils/getMonthTable.js +4 -4
  127. package/lib/es/datePicker/_utils/getMonthsInYear.js +1 -1
  128. package/lib/es/datePicker/constants.js +27 -27
  129. package/lib/es/datePicker/foundation.js +3 -3
  130. package/lib/es/datePicker/inputFoundation.js +2 -2
  131. package/lib/es/datePicker/monthsGridFoundation.js +15 -4
  132. package/lib/es/descriptions/constants.js +1 -1
  133. package/lib/es/divider/constants.js +1 -1
  134. package/lib/es/dropdown/constants.js +3 -3
  135. package/lib/es/dropdown/menuFoundation.js +1 -1
  136. package/lib/es/empty/constants.js +1 -1
  137. package/lib/es/form/constants.js +1 -1
  138. package/lib/es/form/foundation.js +1 -1
  139. package/lib/es/form/utils.js +1 -1
  140. package/lib/es/grid/constants.js +1 -1
  141. package/lib/es/highlight/constants.js +1 -1
  142. package/lib/es/icons/constants.js +1 -1
  143. package/lib/es/image/constants.js +1 -1
  144. package/lib/es/input/constants.js +1 -1
  145. package/lib/es/input/textareaFoundation.js +1 -1
  146. package/lib/es/layout/constants.js +1 -1
  147. package/lib/es/list/constants.js +1 -1
  148. package/lib/es/modal/constants.js +1 -1
  149. package/lib/es/navigation/constants.js +1 -1
  150. package/lib/es/notification/constants.js +3 -3
  151. package/lib/es/pagination/constants.js +1 -1
  152. package/lib/es/popconfirm/constants.js +2 -2
  153. package/lib/es/popconfirm/popconfirmFoundation.d.ts +4 -0
  154. package/lib/es/popconfirm/popconfirmFoundation.js +20 -1
  155. package/lib/es/popover/constants.js +2 -2
  156. package/lib/es/progress/constants.js +1 -1
  157. package/lib/es/progress/generates.js +14 -14
  158. package/lib/es/radio/constants.js +13 -13
  159. package/lib/es/rating/constants.js +1 -1
  160. package/lib/es/scrollList/constants.js +2 -2
  161. package/lib/es/select/constants.js +3 -3
  162. package/lib/es/select/foundation.js +2 -1
  163. package/lib/es/select/select.css +1 -0
  164. package/lib/es/select/select.scss +1 -0
  165. package/lib/es/select/variables.scss +1 -0
  166. package/lib/es/sideSheet/constants.js +2 -2
  167. package/lib/es/skeleton/constants.js +1 -1
  168. package/lib/es/slider/constants.js +7 -7
  169. package/lib/es/space/constants.js +1 -1
  170. package/lib/es/spin/constants.js +1 -1
  171. package/lib/es/steps/bacisSteps.scss +238 -286
  172. package/lib/es/steps/constants.js +2 -2
  173. package/lib/es/steps/fillSteps.scss +142 -148
  174. package/lib/es/steps/navSteps.scss +40 -60
  175. package/lib/es/steps/steps.css +14 -377
  176. package/lib/es/switch/constants.js +13 -13
  177. package/lib/es/table/constants.js +7 -7
  178. package/lib/es/table/utils.js +2 -2
  179. package/lib/es/tabs/constants.js +21 -21
  180. package/lib/es/tag/constants.js +1 -1
  181. package/lib/es/tag/tag.css +9 -2
  182. package/lib/es/tag/tag.scss +13 -4
  183. package/lib/es/tagInput/constants.js +1 -1
  184. package/lib/es/timePicker/ComboxFoundation.js +2 -2
  185. package/lib/es/timePicker/constants.js +3 -3
  186. package/lib/es/timePicker/utils/index.js +3 -3
  187. package/lib/es/timeline/constants.js +2 -2
  188. package/lib/es/toast/constants.js +3 -3
  189. package/lib/es/tooltip/constants.js +1 -1
  190. package/lib/es/tooltip/foundation.d.ts +1 -1
  191. package/lib/es/tooltip/foundation.js +15 -12
  192. package/lib/es/transfer/constants.js +1 -1
  193. package/lib/es/tree/constants.js +2 -2
  194. package/lib/es/tree/treeUtil.d.ts +1 -1
  195. package/lib/es/tree/treeUtil.js +1 -1
  196. package/lib/es/treeSelect/constants.js +3 -3
  197. package/lib/es/treeSelect/foundation.d.ts +5 -2
  198. package/lib/es/treeSelect/foundation.js +42 -17
  199. package/lib/es/treeSelect/treeSelect.css +5 -1
  200. package/lib/es/treeSelect/treeSelect.scss +6 -0
  201. package/lib/es/treeSelect/variables.scss +1 -1
  202. package/lib/es/typography/constants.js +1 -1
  203. package/lib/es/typography/formatNumeral.js +6 -11
  204. package/lib/es/upload/constants.d.ts +1 -1
  205. package/lib/es/upload/constants.js +2 -2
  206. package/lib/es/upload/foundation.js +1 -1
  207. package/lib/es/upload/utils.js +4 -4
  208. package/lib/es/utils/getMotionObjFromProps.js +2 -2
  209. package/lib/es/utils/touchPolyfill.js +1 -1
  210. package/lib/es/utils/uuid.js +2 -2
  211. package/lib/es/utils/warning.js +1 -1
  212. package/package.json +3 -3
  213. package/popconfirm/popconfirmFoundation.ts +20 -1
  214. package/select/select.scss +1 -0
  215. package/select/variables.scss +1 -0
  216. package/steps/bacisSteps.scss +238 -286
  217. package/steps/fillSteps.scss +142 -148
  218. package/steps/navSteps.scss +40 -60
  219. package/tag/tag.scss +13 -4
  220. package/tooltip/foundation.ts +8 -5
  221. package/treeSelect/foundation.ts +39 -15
  222. package/treeSelect/treeSelect.scss +6 -0
  223. package/treeSelect/variables.scss +1 -1
  224. package/typography/formatNumeral.ts +2 -5
@@ -152,14 +152,14 @@ const isTimeFormatLike = (time, formatToken) => {
152
152
  let isLike = true;
153
153
  const dateFnsSupportFormatCh = 'BDEGHKLMOPQRSTXYabcehimopqstuwxyz'; // dateFns support format character
154
154
 
155
- const formatSupportChReg = new RegExp("[".concat(dateFnsSupportFormatCh, "]"), 'g');
156
- const formatNotSupportChReg = new RegExp("[^".concat(dateFnsSupportFormatCh, "]"), 'g');
155
+ const formatSupportChReg = new RegExp(`[${dateFnsSupportFormatCh}]`, 'g');
156
+ const formatNotSupportChReg = new RegExp(`[^${dateFnsSupportFormatCh}]`, 'g');
157
157
  const hmsReg = /[H|m|s]{1,2}/;
158
158
  const formatSplitted = formatToken.split(formatNotSupportChReg); // => ['HH', 'mm'];
159
159
 
160
160
  const timeSeparator = formatToken.replace(formatSupportChReg, ''); // => :
161
161
 
162
- const timeReg = new RegExp("[".concat(timeSeparator, "]"), 'g'); // => /[:]/g
162
+ const timeReg = new RegExp(`[${timeSeparator}]`, 'g'); // => /[:]/g
163
163
 
164
164
  const timeSplitted = time.split(timeReg); // => ['12', '0]
165
165
 
@@ -8,8 +8,8 @@ exports.strings = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-timeline"),
12
- ITEM: "".concat(_constants.BASE_CLASS_PREFIX, "-timeline-item")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-timeline`,
12
+ ITEM: `${_constants.BASE_CLASS_PREFIX}-timeline-item`
13
13
  };
14
14
  exports.cssClasses = cssClasses;
15
15
  const strings = {
@@ -7,11 +7,11 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
7
7
 
8
8
  var _constants = require("../base/constants");
9
9
 
10
- const PREFIX = "".concat(_constants.BASE_CLASS_PREFIX, "-toast");
10
+ const PREFIX = `${_constants.BASE_CLASS_PREFIX}-toast`;
11
11
  const cssClasses = {
12
12
  PREFIX,
13
- WRAPPER: "".concat(PREFIX, "-wrapper"),
14
- LIST: "".concat(PREFIX, "-list")
13
+ WRAPPER: `${PREFIX}-wrapper`,
14
+ LIST: `${PREFIX}-list`
15
15
  };
16
16
  exports.cssClasses = cssClasses;
17
17
  const strings = {
@@ -8,7 +8,7 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-tooltip")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-tooltip`
12
12
  };
13
13
  exports.cssClasses = cssClasses;
14
14
  const strings = {
@@ -133,7 +133,7 @@ export default class Tooltip<P = Record<string, any>, S = Record<string, any>> e
133
133
  * 如果 trigger 是 focus 或者 hover,则它绑定了 onFocus,这里我们如果重新 focus 的话,popup 会再次打开
134
134
  * 因此 returnFocusOnClose 只支持 click trigger
135
135
  */
136
- _focusTrigger(): void;
136
+ focusTrigger(): void;
137
137
  _handleEscKeyDown(event: any): void;
138
138
  _handleContainerTabKeyDown(focusableElements: any[], event: any): void;
139
139
  _handleContainerShiftTabKeyDown(focusableElements: any[], event: any): void;
@@ -494,23 +494,23 @@ class Tooltip extends _foundation.default {
494
494
  if (position && triggerRect && translateX != null && translateY != null) {
495
495
  if (this.getProp('transformFromCenter')) {
496
496
  if (['topLeft', 'bottomLeft'].includes(position)) {
497
- return "".concat(this._roundPixel(triggerRect.width / 2), "px ").concat(-translateY * 100, "%");
497
+ return `${this._roundPixel(triggerRect.width / 2)}px ${-translateY * 100}%`;
498
498
  }
499
499
 
500
500
  if (['topRight', 'bottomRight'].includes(position)) {
501
- return "calc(100% - ".concat(this._roundPixel(triggerRect.width / 2), "px) ").concat(-translateY * 100, "%");
501
+ return `calc(100% - ${this._roundPixel(triggerRect.width / 2)}px) ${-translateY * 100}%`;
502
502
  }
503
503
 
504
504
  if (['leftTop', 'rightTop'].includes(position)) {
505
- return "".concat(-translateX * 100, "% ").concat(this._roundPixel(triggerRect.height / 2), "px");
505
+ return `${-translateX * 100}% ${this._roundPixel(triggerRect.height / 2)}px`;
506
506
  }
507
507
 
508
508
  if (['leftBottom', 'rightBottom'].includes(position)) {
509
- return "".concat(-translateX * 100, "% calc(100% - ").concat(this._roundPixel(triggerRect.height / 2), "px)");
509
+ return `${-translateX * 100}% calc(100% - ${this._roundPixel(triggerRect.height / 2)}px)`;
510
510
  }
511
511
  }
512
512
 
513
- return "".concat(-translateX * 100, "% ").concat(-translateY * 100, "%");
513
+ return `${-translateX * 100}% ${-translateY * 100}%`;
514
514
  }
515
515
 
516
516
  return null;
@@ -521,6 +521,9 @@ class Tooltip extends _foundation.default {
521
521
  spacing,
522
522
  isOverFlow
523
523
  } = props;
524
+ const {
525
+ innerWidth
526
+ } = window;
524
527
  const triggerRect = ((0, _isEmpty2.default)(props.triggerRect) ? props.triggerRect : this._adapter.getTriggerBounding()) || Object.assign({}, defaultRect);
525
528
  const containerRect = ((0, _isEmpty2.default)(props.containerRect) ? props.containerRect : this._adapter.getPopupContainerRect()) || Object.assign({}, defaultRect);
526
529
  const wrapperRect = ((0, _isEmpty2.default)(props.wrapperRect) ? props.wrapperRect : this._adapter.getWrapperBounding()) || Object.assign({}, defaultRect); // eslint-disable-next-line
@@ -559,6 +562,7 @@ class Tooltip extends _foundation.default {
559
562
  const isWidthOverFlow = isOverFlow && isOverFlow[1];
560
563
  const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
561
564
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
565
+ const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
562
566
 
563
567
  switch (position) {
564
568
  case 'top':
@@ -573,7 +577,7 @@ class Tooltip extends _foundation.default {
573
577
  case 'topLeft':
574
578
  // left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
575
579
  // top = triggerRect.top - SPACING;
576
- left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
580
+ left = isWidthOverFlow ? isWrapperWidthOverflow ? containerRect.left : containerRect.right - wrapperRect.width : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
577
581
  top = isHeightOverFlow ? containerRect.bottom + offsetHeight : triggerRect.top - SPACING;
578
582
  translateY = -1;
579
583
  break;
@@ -625,7 +629,7 @@ class Tooltip extends _foundation.default {
625
629
  case 'bottomLeft':
626
630
  // left = pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
627
631
  // top = triggerRect.bottom + SPACING;
628
- left = isWidthOverFlow ? containerRect.left : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
632
+ left = isWidthOverFlow ? isWrapperWidthOverflow ? containerRect.left : containerRect.right - wrapperRect.width : pointAtCenter ? middleX - offsetXWithArrow : triggerRect.left;
629
633
  top = isHeightOverFlow ? containerRect.top + offsetYWithArrow - SPACING : triggerRect.top + triggerRect.height + SPACING;
630
634
  break;
631
635
 
@@ -733,7 +737,7 @@ class Tooltip extends _foundation.default {
733
737
  let transform = ''; // eslint-disable-next-line
734
738
 
735
739
  if (translateX != null) {
736
- transform += "translateX(".concat(translateX * 100, "%) ");
740
+ transform += `translateX(${translateX * 100}%) `;
737
741
  Object.defineProperty(style, 'translateX', {
738
742
  enumerable: false,
739
743
  value: translateX
@@ -742,7 +746,7 @@ class Tooltip extends _foundation.default {
742
746
 
743
747
 
744
748
  if (translateY != null) {
745
- transform += "translateY(".concat(translateY * 100, "%) ");
749
+ transform += `translateY(${translateY * 100}%) `;
746
750
  Object.defineProperty(style, 'translateY', {
747
751
  enumerable: false,
748
752
  value: translateY
@@ -1229,7 +1233,7 @@ class Tooltip extends _foundation.default {
1229
1233
  */
1230
1234
 
1231
1235
 
1232
- _focusTrigger() {
1236
+ focusTrigger() {
1233
1237
  const {
1234
1238
  trigger,
1235
1239
  returnFocusOnClose,
@@ -1255,8 +1259,7 @@ class Tooltip extends _foundation.default {
1255
1259
  if (trigger !== 'custom') {
1256
1260
  // Move the focus into the trigger first and then close the pop-up layer
1257
1261
  // to avoid the problem of opening the pop-up layer again when the focus returns to the trigger in the case of hover and focus
1258
- this._focusTrigger();
1259
-
1262
+ this.focusTrigger();
1260
1263
  this.hide();
1261
1264
  }
1262
1265
 
@@ -8,7 +8,7 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-transfer")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-transfer`
12
12
  };
13
13
  exports.cssClasses = cssClasses;
14
14
  const strings = {
@@ -8,8 +8,8 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-tree"),
12
- PREFIX_OPTION: "".concat(_constants.BASE_CLASS_PREFIX, "-tree-option")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-tree`,
12
+ PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-tree-option`
13
13
  };
14
14
  exports.cssClasses = cssClasses;
15
15
  const strings = {
@@ -75,6 +75,6 @@ export declare function getValueOrKey(data: any): any;
75
75
  export declare function normalizeValue(value: any, withObject: boolean): any;
76
76
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
77
77
  export declare function calcDisabledKeys(keyEntities: KeyEntities): Set<string>;
78
- export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
78
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
79
79
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
80
80
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -55,7 +55,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
55
55
  const DRAG_OFFSET = 0.45;
56
56
 
57
57
  function getPosition(level, index) {
58
- return "".concat(level, "-").concat(index);
58
+ return `${level}-${index}`;
59
59
  }
60
60
 
61
61
  function isValid(val) {
@@ -8,9 +8,9 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-tree-select"),
12
- PREFIX_TREE: "".concat(_constants.BASE_CLASS_PREFIX, "-tree"),
13
- PREFIX_OPTION: "".concat(_constants.BASE_CLASS_PREFIX, "-tree-select-option")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-tree-select`,
12
+ PREFIX_TREE: `${_constants.BASE_CLASS_PREFIX}-tree`,
13
+ PREFIX_OPTION: `${_constants.BASE_CLASS_PREFIX}-tree-select-option`
14
14
  };
15
15
  exports.cssClasses = cssClasses;
16
16
  const strings = {
@@ -27,7 +27,7 @@ export interface BasicOnChange {
27
27
  (node: BasicTreeNodeData[] | BasicTreeNodeData, e: any): void;
28
28
  (value: BasicTreeNodeData['value'] | Array<BasicTreeNodeData['value']>, node: BasicTreeNodeData[] | BasicTreeNodeData, e: any): void;
29
29
  }
30
- export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize' | 'renderFullLabel' | 'renderLabel' | 'autoExpandParent' | 'className' | 'defaultExpandAll' | 'defaultExpandedKeys' | 'defaultValue' | 'disabled' | 'emptyContent' | 'expandAction' | 'expandedKeys' | 'filterTreeNode' | 'labelEllipsis' | 'leafOnly' | 'multiple' | 'onChangeWithObject' | 'showClear' | 'showFilteredOnly' | 'style' | 'treeData' | 'treeNodeFilterProp' | 'value' | 'onExpand' | 'expandAll' | 'disableStrictly' | 'aria-label' | 'checkRelation'> {
30
+ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize' | 'renderFullLabel' | 'renderLabel' | 'autoExpandParent' | 'className' | 'defaultExpandAll' | 'defaultExpandedKeys' | 'defaultValue' | 'disabled' | 'emptyContent' | 'expandAction' | 'expandedKeys' | 'filterTreeNode' | 'labelEllipsis' | 'leafOnly' | 'multiple' | 'onChangeWithObject' | 'showClear' | 'showFilteredOnly' | 'style' | 'treeData' | 'treeNodeFilterProp' | 'value' | 'onExpand' | 'expandAll' | 'disableStrictly' | 'aria-label' | 'checkRelation' | 'preventScroll'> {
31
31
  motion?: Motion;
32
32
  mouseEnterDelay?: number;
33
33
  mouseLeaveDelay?: number;
@@ -74,7 +74,6 @@ export interface BasicTreeSelectProps extends Pick<BasicTreeProps, 'virtualize'
74
74
  export interface BasicTreeSelectInnerData extends Pick<BasicTreeInnerData, 'keyEntities' | 'treeData' | 'flattenNodes' | 'selectedKeys' | 'checkedKeys' | 'halfCheckedKeys' | 'motionKeys' | 'motionType' | 'expandedKeys' | 'filteredKeys' | 'filteredExpandedKeys' | 'filteredShownKeys' | 'cachedKeyValuePairs' | 'inputValue' | 'disabledKeys' | 'loadedKeys' | 'loadingKeys' | 'realCheckedKeys'> {
75
75
  inputTriggerFocus: boolean;
76
76
  isOpen: boolean;
77
- isInput: boolean;
78
77
  rePosKey: number;
79
78
  dropdownMinWidth: null | number;
80
79
  isHovering: boolean;
@@ -102,6 +101,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
102
101
  notifyLoad: (newLoadedKeys: Set<string>, data: BasicTreeNodeData) => void;
103
102
  updateInputFocus: (bool: boolean) => void;
104
103
  updateLoadKeys: (data: BasicTreeNodeData, resolve: (value?: any) => void) => void;
104
+ updateIsFocus: (bool: boolean) => void;
105
105
  }
106
106
  export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
107
107
  constructor(adapter: TreeSelectAdapter<P, S>);
@@ -131,8 +131,11 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
131
131
  focusInput(bool: boolean): void;
132
132
  _notifyMultipleChange(key: string[], e: any): void;
133
133
  _notifyChange(key: any, e: any): void;
134
+ _registerClickOutsideHandler: (e: any) => void;
134
135
  _notifyFocus(e: any): void;
136
+ handleTriggerFocus(e: any): void;
135
137
  _notifyBlur(e: any): void;
138
+ handlerTriggerBlur(e: any): void;
136
139
  toggleHoverState(bool: boolean): void;
137
140
  open(): void;
138
141
  close(e: any): void;
@@ -35,6 +35,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
35
35
  class TreeSelectFoundation extends _foundation.default {
36
36
  constructor(adapter) {
37
37
  super(Object.assign({}, adapter));
38
+
39
+ this._registerClickOutsideHandler = e => {
40
+ this._adapter.registerClickOutsideHandler(e => {
41
+ this.handlerTriggerBlur(e);
42
+ this.close(e);
43
+ });
44
+ };
38
45
  }
39
46
 
40
47
  init() {
@@ -53,6 +60,10 @@ class TreeSelectFoundation extends _foundation.default {
53
60
  if (isOpen) {
54
61
  this.open();
55
62
  }
63
+
64
+ if (triggerSearchAutoFocus) {
65
+ this.handleTriggerFocus(null);
66
+ }
56
67
  }
57
68
 
58
69
  destroy() {
@@ -320,6 +331,14 @@ class TreeSelectFoundation extends _foundation.default {
320
331
 
321
332
  _notifyFocus(e) {
322
333
  this._adapter.notifyFocus(e);
334
+ }
335
+
336
+ handleTriggerFocus(e) {
337
+ this._adapter.updateIsFocus(true);
338
+
339
+ this._notifyFocus(e);
340
+
341
+ this._registerClickOutsideHandler(e);
323
342
  } // Scenes that may trigger blur
324
343
  // 1、clickOutSide
325
344
  // 2、click option / press enter, and then select complete(when multiple is false
@@ -330,6 +349,14 @@ class TreeSelectFoundation extends _foundation.default {
330
349
  this._adapter.notifyBlur(e);
331
350
  }
332
351
 
352
+ handlerTriggerBlur(e) {
353
+ this._adapter.updateIsFocus(false);
354
+
355
+ this._notifyBlur(e);
356
+
357
+ this._adapter.unregisterClickOutsideHandler();
358
+ }
359
+
333
360
  toggleHoverState(bool) {
334
361
  this._adapter.toggleHovering(bool);
335
362
  }
@@ -338,19 +365,11 @@ class TreeSelectFoundation extends _foundation.default {
338
365
  this._adapter.openMenu();
339
366
 
340
367
  this._setDropdownWidth();
341
-
342
- this._adapter.registerClickOutsideHandler(e => {
343
- this.close(e);
344
- });
345
368
  }
346
369
 
347
370
  close(e) {
348
371
  this._adapter.closeMenu();
349
372
 
350
- this._adapter.unregisterClickOutsideHandler();
351
-
352
- this._notifyBlur(e);
353
-
354
373
  if (this.getProp('motionExpand')) {
355
374
  this._adapter.updateState({
356
375
  motionKeys: new Set([])
@@ -363,7 +382,8 @@ class TreeSelectFoundation extends _foundation.default {
363
382
 
364
383
  const {
365
384
  isOpen,
366
- inputValue
385
+ inputValue,
386
+ isFocus
367
387
  } = this.getStates();
368
388
  const {
369
389
  searchPosition
@@ -371,16 +391,20 @@ class TreeSelectFoundation extends _foundation.default {
371
391
 
372
392
  if (isDisabled) {
373
393
  return;
374
- } else if (!isOpen) {
375
- this.open();
376
-
377
- this._notifyFocus(e);
378
- } else if (isOpen) {
379
- if (searchPosition === 'trigger' && inputValue) {
380
- return;
394
+ } else {
395
+ if (!isFocus) {
396
+ this.handleTriggerFocus(e);
381
397
  }
382
398
 
383
- this.close(e);
399
+ if (isOpen) {
400
+ if (searchPosition === 'trigger' && inputValue) {
401
+ return;
402
+ }
403
+
404
+ this.close(e);
405
+ } else {
406
+ this.open();
407
+ }
384
408
  }
385
409
  }
386
410
  /**
@@ -626,6 +650,7 @@ class TreeSelectFoundation extends _foundation.default {
626
650
 
627
651
  if (clickToHide && (this._isSelectToClose() || !data.children)) {
628
652
  this.close(e);
653
+ this.handlerTriggerBlur(e);
629
654
  }
630
655
  }
631
656
 
@@ -17,12 +17,16 @@
17
17
  }
18
18
  .semi-tree-select:hover {
19
19
  background-color: var(--semi-color-fill-1);
20
- border: 1px solid inherit;
20
+ border: 1px solid transparent;
21
21
  }
22
22
  .semi-tree-select-focus {
23
23
  border: 1px solid var(--semi-color-focus-border);
24
24
  outline: 0;
25
25
  }
26
+ .semi-tree-select-focus:hover {
27
+ border: 1px solid var(--semi-color-focus-border);
28
+ outline: 0;
29
+ }
26
30
  .semi-tree-select-warning {
27
31
  background-color: var(--semi-color-warning-light-default);
28
32
  border-color: var(--semi-color-warning-light-default);
@@ -26,6 +26,12 @@ $module: #{$prefix}-tree-select;
26
26
  outline: 0;
27
27
  }
28
28
 
29
+ &-focus:hover {
30
+ border: $width-treeSelect_focus-border solid $color-treeSelect_default-border-focus;
31
+ outline: 0;
32
+ }
33
+
34
+
29
35
  &-warning {
30
36
  background-color: $color-treeSelect_warning-bg-default;
31
37
  border-color: $color-treeSelect_warning-border-default;
@@ -6,7 +6,7 @@ $color-treeSelect_default-icon-hover: var(--semi-color-primary-hover); // 树选
6
6
  $color-treeSelect_default-icon-active: var(--semi-color-primary-active); // 树选择器选择框清空按钮颜色 - 按下
7
7
  $color-treeSelect_default-bg-hover: var(--semi-color-fill-1); // 树选择器选择框背景颜色 - 悬停
8
8
 
9
- $color-treeSelect_default-border-hover: inherit; // 树选择器选择框描边颜色 - 悬浮
9
+ $color-treeSelect_default-border-hover: transparent; // 树选择器选择框描边颜色 - 悬浮
10
10
  $color-treeSelect_default-border-focus: var(--semi-color-focus-border);// 树选择器选择框描边颜色 - 选中
11
11
 
12
12
  $color-treeSelect_search-border-default: var(--semi-color-fill-0); // 树选择器菜单搜索框描边颜色 - 默认
@@ -8,7 +8,7 @@ exports.strings = exports.cssClasses = void 0;
8
8
  var _constants = require("../base/constants");
9
9
 
10
10
  const cssClasses = {
11
- PREFIX: "".concat(_constants.BASE_CLASS_PREFIX, "-typography")
11
+ PREFIX: `${_constants.BASE_CLASS_PREFIX}-typography`
12
12
  };
13
13
  exports.cssClasses = cssClasses;
14
14
  const strings = {
@@ -18,7 +18,7 @@ class FormatNumeral {
18
18
  i++;
19
19
  }
20
20
 
21
- return "".concat(this.truncatePrecision(value), " ").concat(units[i]);
21
+ return `${this.truncatePrecision(value)} ${units[i]}`;
22
22
  },
23
23
  'bytes-binary': value => {
24
24
  const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
@@ -29,21 +29,16 @@ class FormatNumeral {
29
29
  i++;
30
30
  }
31
31
 
32
- return "".concat(this.truncatePrecision(value), " ").concat(units[i]);
32
+ return `${this.truncatePrecision(value)} ${units[i]}`;
33
33
  },
34
34
  percentages: value => {
35
- const cArr = value.toString().split('.');
36
-
37
- if (Number(cArr[0]) === 0) {
38
- return "".concat(this.truncatePrecision(value * 100), "%");
39
- }
40
-
41
- return "".concat(this.truncatePrecision(value), "%");
35
+ // The rules here have been modified in version v2.30.0
36
+ return `${this.truncatePrecision(value * 100)}%`;
42
37
  },
43
38
  exponential: value => {
44
39
  const vExponential = value.toExponential(this.precision + 2);
45
40
  const vArr = vExponential.split('e');
46
- return "".concat(this.truncatePrecision(Number(vArr[0])), "e").concat(vArr[1]);
41
+ return `${this.truncatePrecision(Number(vArr[0]))}e${vArr[1]}`;
47
42
  }
48
43
  }; // A collection of methods for truncating numbers; Methods key: Truncate (strings.Truncate);
49
44
 
@@ -93,7 +88,7 @@ class FormatNumeral {
93
88
  const cTLength = cArr[1].length; // Fill in any missing `0` at the end.
94
89
 
95
90
  if (cTLength < this.precision) {
96
- return "".concat(cArr[0], ".").concat(cArr[1]).concat('0'.repeat(this.precision - cTLength));
91
+ return `${cArr[0]}.${cArr[1]}${'0'.repeat(this.precision - cTLength)}`;
97
92
  }
98
93
 
99
94
  return cTruncated.toString();
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("custom" | "auto")[];
21
+ UPLOAD_TRIGGER: ("auto" | "custom")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -7,14 +7,14 @@ exports.strings = exports.numbers = exports.cssClasses = void 0;
7
7
 
8
8
  var _constants = require("../base/constants");
9
9
 
10
- const PREFIX = "".concat(_constants.BASE_CLASS_PREFIX, "-upload");
10
+ const PREFIX = `${_constants.BASE_CLASS_PREFIX}-upload`;
11
11
  const FILE_LIST_PIC = 'picture';
12
12
  const FILE_LIST_DEFAULT = 'list';
13
13
  const PROGRESS_COEFFICIENT = 0.95;
14
14
  const cssClasses = {
15
15
  PREFIX,
16
16
  // WRAPPER: `${PREFIX}-wrapper`,
17
- LIST: "".concat(PREFIX, "-list")
17
+ LIST: `${PREFIX}-list`
18
18
  };
19
19
  exports.cssClasses = cssClasses;
20
20
  const TRIGGER_AUTO = 'auto';
@@ -77,7 +77,7 @@ class UploadFoundation extends _foundation.default {
77
77
  fileName
78
78
  } = _ref;
79
79
  const status = xhr ? xhr.status : 0;
80
- const msg = message || "cannot post ".concat(fileName, " to ").concat(action, ", xhr status: ").concat(status, "'");
80
+ const msg = message || `cannot post ${fileName} to ${action}, xhr status: ${status}'`;
81
81
  const err = new Error(msg);
82
82
  err.status = status;
83
83
  err.method = 'post';
@@ -48,11 +48,11 @@ exports.byteMB = byteMB;
48
48
 
49
49
  function getFileSize(number) {
50
50
  if (number < byteKB) {
51
- return "".concat((number / byteKB).toFixed(2), "KB");
51
+ return `${(number / byteKB).toFixed(2)}KB`;
52
52
  } else if (number >= byteKB && number < byteMB) {
53
- return "".concat((number / byteKB).toFixed(1), "KB");
53
+ return `${(number / byteKB).toFixed(1)}KB`;
54
54
  } else if (number >= byteMB) {
55
- return "".concat((number / byteMB).toFixed(1), "MB");
55
+ return `${(number / byteMB).toFixed(1)}MB`;
56
56
  }
57
57
 
58
58
  return undefined;
@@ -125,7 +125,7 @@ function mapFileTree(items) {
125
125
 
126
126
  for (let index = 0; index < entries.length; index++) {
127
127
  const entry = entries[index];
128
- yield _traverseFileTree(entry, "".concat(path).concat(item.name, "/"));
128
+ yield _traverseFileTree(entry, `${path}${item.name}/`);
129
129
  }
130
130
  }
131
131
  });
@@ -28,7 +28,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28
28
  */
29
29
  function getMotionObjFromProps(props) {
30
30
  if (typeof props !== 'object' || props === null) {
31
- throw new TypeError("props should be object type, got ".concat(typeof props));
31
+ throw new TypeError(`props should be object type, got ${typeof props}`);
32
32
  }
33
33
 
34
34
  const MOTION_PROPS = ['willEnter', 'didEnter', 'willLeave', 'didLeave', 'onStart', 'onRest', 'state'];
@@ -52,7 +52,7 @@ function getMotionObjFromProps(props) {
52
52
  };
53
53
  }
54
54
  } else {
55
- (0, _warning.default)(true, "[Semi] duplicate motion key '".concat(key, "' from motion prop and props"));
55
+ (0, _warning.default)(true, `[Semi] duplicate motion key '${key}' from motion prop and props`);
56
56
  }
57
57
  }
58
58
  } else if (typeof motionProp === 'function') {
@@ -30,7 +30,7 @@ const touchEventPolyfill = (touch, touchEvent) => {
30
30
  }
31
31
 
32
32
  if (touch[key]) {
33
- (0, _warning.default)(true, "\"The key ".concat(key, "\" exist in Touch."));
33
+ (0, _warning.default)(true, `"The key ${key}" exist in Touch.`);
34
34
  } else {
35
35
  touch[key] = value;
36
36
  }
@@ -8,7 +8,7 @@ exports.getUuidShort = getUuidShort;
8
8
  exports.getUuidv4 = getUuidv4;
9
9
 
10
10
  function getUuid(prefix) {
11
- return "".concat(prefix, "-").concat(new Date().getTime(), "-").concat(Math.random());
11
+ return `${prefix}-${new Date().getTime()}-${Math.random()}`;
12
12
  } // https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
13
13
 
14
14
 
@@ -49,5 +49,5 @@ function getUuidShort() {
49
49
  randomId += characters.charAt(random);
50
50
  }
51
51
 
52
- return prefix ? "".concat(prefix, "-").concat(randomId) : randomId;
52
+ return prefix ? `${prefix}-${randomId}` : randomId;
53
53
  }
@@ -7,6 +7,6 @@ exports.default = warning;
7
7
 
8
8
  function warning(flag, info) {
9
9
  if (flag) {
10
- console.warn("Warning: ".concat(info));
10
+ console.warn(`Warning: ${info}`);
11
11
  }
12
12
  }
@@ -1,6 +1,6 @@
1
1
  import { BASE_CLASS_PREFIX } from '../base/constants';
2
2
  const cssClasses = {
3
- PREFIX: "".concat(BASE_CLASS_PREFIX, "-anchor")
3
+ PREFIX: `${BASE_CLASS_PREFIX}-anchor`
4
4
  };
5
5
  const strings = {
6
6
  SIZE: ['small', 'default'],
@@ -43,12 +43,12 @@ export default class AnchorFoundation extends BaseFoundation {
43
43
 
44
44
 
45
45
  this.setScrollHeight = () => {
46
- const anchorWrapper = ".".concat(prefixCls, "-link-wrapper");
46
+ const anchorWrapper = `.${prefixCls}-link-wrapper`;
47
47
 
48
48
  const anchorNode = this._adapter.getAnchorNode(anchorWrapper);
49
49
 
50
50
  if (anchorNode) {
51
- const scrollHeight = "".concat(anchorNode.scrollHeight, "px");
51
+ const scrollHeight = `${anchorNode.scrollHeight}px`;
52
52
 
53
53
  this._adapter.setScrollHeight(scrollHeight);
54
54
  }
@@ -233,7 +233,7 @@ export default class AnchorFoundation extends BaseFoundation {
233
233
  };
234
234
 
235
235
  this._setActiveSlide = () => {
236
- const activeClass = ".".concat(cssClasses.PREFIX, "-link-title-active");
236
+ const activeClass = `.${cssClasses.PREFIX}-link-title-active`;
237
237
 
238
238
  const linkNode = this._adapter.getAnchorNode(activeClass);
239
239