@douyinfe/semi-ui 2.14.0 → 2.15.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 (178) hide show
  1. package/autoComplete/index.tsx +0 -1
  2. package/cascader/__test__/cascader.test.js +13 -10
  3. package/cascader/_story/cascader.stories.js +22 -0
  4. package/cascader/index.tsx +53 -35
  5. package/checkbox/checkbox.tsx +1 -0
  6. package/checkbox/checkboxInner.tsx +4 -1
  7. package/datePicker/datePicker.tsx +7 -5
  8. package/dist/css/semi.css +34 -6
  9. package/dist/css/semi.min.css +1 -1
  10. package/dist/umd/semi-ui.js +1089 -329
  11. package/dist/umd/semi-ui.js.map +1 -1
  12. package/dist/umd/semi-ui.min.js +1 -1
  13. package/dist/umd/semi-ui.min.js.map +1 -1
  14. package/dropdown/context.ts +2 -0
  15. package/dropdown/dropdownItem.tsx +2 -1
  16. package/dropdown/dropdownMenu.tsx +24 -1
  17. package/dropdown/index.tsx +10 -2
  18. package/form/_story/form.stories.tsx +23 -15
  19. package/form/hoc/withField.tsx +1 -1
  20. package/form/interface.ts +1 -1
  21. package/input/__test__/input.test.js +31 -0
  22. package/input/_story/input.stories.js +24 -1
  23. package/input/index.tsx +5 -2
  24. package/input/inputGroup.tsx +7 -6
  25. package/inputNumber/index.tsx +5 -3
  26. package/lib/cjs/autoComplete/index.d.ts +0 -1
  27. package/lib/cjs/autoComplete/index.js +0 -1
  28. package/lib/cjs/cascader/index.d.ts +1 -1
  29. package/lib/cjs/cascader/index.js +36 -9
  30. package/lib/cjs/checkbox/checkbox.d.ts +1 -0
  31. package/lib/cjs/checkbox/checkbox.js +2 -1
  32. package/lib/cjs/checkbox/checkboxInner.d.ts +2 -0
  33. package/lib/cjs/checkbox/checkboxInner.js +8 -2
  34. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  35. package/lib/cjs/datePicker/datePicker.js +21 -6
  36. package/lib/cjs/dropdown/context.d.ts +2 -0
  37. package/lib/cjs/dropdown/dropdownItem.js +3 -1
  38. package/lib/cjs/dropdown/dropdownMenu.d.ts +18 -1
  39. package/lib/cjs/dropdown/dropdownMenu.js +23 -2
  40. package/lib/cjs/dropdown/index.d.ts +4 -0
  41. package/lib/cjs/dropdown/index.js +13 -5
  42. package/lib/cjs/form/baseForm.d.ts +16 -15
  43. package/lib/cjs/form/field.d.ts +16 -15
  44. package/lib/cjs/form/hoc/withField.d.ts +1 -1
  45. package/lib/cjs/form/interface.d.ts +1 -1
  46. package/lib/cjs/input/index.d.ts +2 -1
  47. package/lib/cjs/input/index.js +11 -5
  48. package/lib/cjs/input/inputGroup.js +16 -9
  49. package/lib/cjs/inputNumber/index.d.ts +1 -0
  50. package/lib/cjs/inputNumber/index.js +8 -3
  51. package/lib/cjs/locale/source/de.d.ts +3 -0
  52. package/lib/cjs/locale/source/de.js +165 -0
  53. package/lib/cjs/locale/source/fr.d.ts +3 -0
  54. package/lib/cjs/locale/source/fr.js +165 -0
  55. package/lib/cjs/locale/source/it.d.ts +3 -0
  56. package/lib/cjs/locale/source/it.js +165 -0
  57. package/lib/cjs/modal/ModalContent.d.ts +1 -0
  58. package/lib/cjs/modal/ModalContent.js +17 -4
  59. package/lib/cjs/modal/confirm.d.ts +5 -0
  60. package/lib/cjs/radio/radio.d.ts +2 -0
  61. package/lib/cjs/radio/radio.js +2 -1
  62. package/lib/cjs/radio/radioInner.d.ts +2 -0
  63. package/lib/cjs/radio/radioInner.js +8 -2
  64. package/lib/cjs/rating/index.d.ts +7 -0
  65. package/lib/cjs/rating/index.js +135 -68
  66. package/lib/cjs/rating/item.d.ts +27 -3
  67. package/lib/cjs/rating/item.js +145 -38
  68. package/lib/cjs/select/index.d.ts +2 -0
  69. package/lib/cjs/select/index.js +15 -3
  70. package/lib/cjs/table/Body/index.js +1 -1
  71. package/lib/cjs/tabs/index.d.ts +1 -0
  72. package/lib/cjs/tabs/index.js +2 -1
  73. package/lib/cjs/tabs/interface.d.ts +1 -0
  74. package/lib/cjs/tag/index.js +4 -5
  75. package/lib/cjs/tag/interface.d.ts +1 -0
  76. package/lib/cjs/tagInput/index.d.ts +2 -0
  77. package/lib/cjs/tagInput/index.js +19 -5
  78. package/lib/cjs/timePicker/TimeInput.d.ts +2 -1
  79. package/lib/cjs/timePicker/TimeInput.js +7 -3
  80. package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
  81. package/lib/cjs/timePicker/TimePicker.js +2 -1
  82. package/lib/cjs/timePicker/index.d.ts +1 -0
  83. package/lib/cjs/tooltip/index.d.ts +2 -0
  84. package/lib/cjs/tooltip/index.js +12 -4
  85. package/lib/cjs/tree/index.d.ts +1 -0
  86. package/lib/cjs/tree/index.js +9 -2
  87. package/lib/cjs/tree/treeNode.js +12 -18
  88. package/lib/cjs/treeSelect/index.js +8 -1
  89. package/lib/es/autoComplete/index.d.ts +0 -1
  90. package/lib/es/autoComplete/index.js +0 -1
  91. package/lib/es/cascader/index.d.ts +1 -1
  92. package/lib/es/cascader/index.js +36 -9
  93. package/lib/es/checkbox/checkbox.d.ts +1 -0
  94. package/lib/es/checkbox/checkbox.js +2 -1
  95. package/lib/es/checkbox/checkboxInner.d.ts +2 -0
  96. package/lib/es/checkbox/checkboxInner.js +8 -2
  97. package/lib/es/datePicker/datePicker.d.ts +1 -1
  98. package/lib/es/datePicker/datePicker.js +21 -6
  99. package/lib/es/dropdown/context.d.ts +2 -0
  100. package/lib/es/dropdown/dropdownItem.js +3 -1
  101. package/lib/es/dropdown/dropdownMenu.d.ts +18 -1
  102. package/lib/es/dropdown/dropdownMenu.js +21 -2
  103. package/lib/es/dropdown/index.d.ts +4 -0
  104. package/lib/es/dropdown/index.js +13 -5
  105. package/lib/es/form/baseForm.d.ts +16 -15
  106. package/lib/es/form/field.d.ts +16 -15
  107. package/lib/es/form/hoc/withField.d.ts +1 -1
  108. package/lib/es/form/interface.d.ts +1 -1
  109. package/lib/es/input/index.d.ts +2 -1
  110. package/lib/es/input/index.js +11 -5
  111. package/lib/es/input/inputGroup.js +15 -9
  112. package/lib/es/inputNumber/index.d.ts +1 -0
  113. package/lib/es/inputNumber/index.js +8 -3
  114. package/lib/es/locale/source/de.d.ts +3 -0
  115. package/lib/es/locale/source/de.js +153 -0
  116. package/lib/es/locale/source/fr.d.ts +3 -0
  117. package/lib/es/locale/source/fr.js +153 -0
  118. package/lib/es/locale/source/it.d.ts +3 -0
  119. package/lib/es/locale/source/it.js +153 -0
  120. package/lib/es/modal/ModalContent.d.ts +1 -0
  121. package/lib/es/modal/ModalContent.js +17 -4
  122. package/lib/es/modal/confirm.d.ts +5 -0
  123. package/lib/es/radio/radio.d.ts +2 -0
  124. package/lib/es/radio/radio.js +2 -1
  125. package/lib/es/radio/radioInner.d.ts +2 -0
  126. package/lib/es/radio/radioInner.js +8 -2
  127. package/lib/es/rating/index.d.ts +7 -0
  128. package/lib/es/rating/index.js +133 -65
  129. package/lib/es/rating/item.d.ts +27 -3
  130. package/lib/es/rating/item.js +145 -32
  131. package/lib/es/select/index.d.ts +2 -0
  132. package/lib/es/select/index.js +15 -3
  133. package/lib/es/table/Body/index.js +1 -1
  134. package/lib/es/tabs/index.d.ts +1 -0
  135. package/lib/es/tabs/index.js +2 -1
  136. package/lib/es/tabs/interface.d.ts +1 -0
  137. package/lib/es/tag/index.js +4 -5
  138. package/lib/es/tag/interface.d.ts +1 -0
  139. package/lib/es/tagInput/index.d.ts +2 -0
  140. package/lib/es/tagInput/index.js +19 -5
  141. package/lib/es/timePicker/TimeInput.d.ts +2 -1
  142. package/lib/es/timePicker/TimeInput.js +7 -3
  143. package/lib/es/timePicker/TimePicker.d.ts +2 -0
  144. package/lib/es/timePicker/TimePicker.js +2 -1
  145. package/lib/es/timePicker/index.d.ts +1 -0
  146. package/lib/es/tooltip/index.d.ts +2 -0
  147. package/lib/es/tooltip/index.js +13 -4
  148. package/lib/es/tree/index.d.ts +1 -0
  149. package/lib/es/tree/index.js +9 -2
  150. package/lib/es/tree/treeNode.js +11 -19
  151. package/lib/es/treeSelect/index.js +8 -1
  152. package/locale/source/de.ts +156 -0
  153. package/locale/source/fr.ts +156 -0
  154. package/locale/source/it.ts +156 -0
  155. package/modal/ModalContent.tsx +7 -4
  156. package/package.json +8 -8
  157. package/radio/radio.tsx +2 -0
  158. package/radio/radioInner.tsx +4 -1
  159. package/rating/__test__/rating.test.js +13 -31
  160. package/rating/_story/rating.stories.js +13 -2
  161. package/rating/index.tsx +63 -18
  162. package/rating/item.tsx +141 -26
  163. package/select/index.tsx +6 -2
  164. package/table/Body/index.tsx +1 -1
  165. package/table/_story/v2/FixedVirtualizedEmpty.tsx +76 -0
  166. package/table/_story/v2/index.js +2 -1
  167. package/tabs/index.tsx +1 -0
  168. package/tabs/interface.ts +1 -0
  169. package/tag/index.tsx +2 -3
  170. package/tag/interface.ts +1 -0
  171. package/tagInput/index.tsx +8 -4
  172. package/timePicker/TimeInput.tsx +5 -3
  173. package/timePicker/TimePicker.tsx +2 -0
  174. package/tooltip/index.tsx +7 -2
  175. package/tree/index.tsx +3 -1
  176. package/tree/treeNode.tsx +9 -12
  177. package/treeSelect/index.tsx +4 -1
  178. package/upload/_story/upload.stories.tsx +9 -6
@@ -25959,6 +25959,112 @@ var dom = __webpack_require__("0J6L");
25959
25959
  var define_property = __webpack_require__("K1iI");
25960
25960
  var define_property_default = /*#__PURE__*/__webpack_require__.n(define_property);
25961
25961
 
25962
+ // CONCATENATED MODULE: ../semi-foundation/utils/a11y.ts
25963
+
25964
+
25965
+ function handlePrevent(event) {
25966
+ event.stopPropagation();
25967
+ event.preventDefault();
25968
+ }
25969
+ function isPrintableCharacter(string) {
25970
+ return string.length === 1 && string.match(/\S/);
25971
+ } // set focus to the target item in item list
25972
+
25973
+ function setFocusToItem(itemNodes, targetItem) {
25974
+ for (let i = 0; i < itemNodes.length; i++) {
25975
+ if (itemNodes[i] === targetItem) {
25976
+ itemNodes[i].tabIndex = 0;
25977
+ itemNodes[i].focus();
25978
+ } else {
25979
+ itemNodes[i].tabIndex = -1;
25980
+ }
25981
+ }
25982
+ } // set focus to the first item in item list
25983
+
25984
+ function setFocusToFirstItem(itemNodes) {
25985
+ itemNodes.length > 0 && setFocusToItem(itemNodes, itemNodes[0]);
25986
+ } // set focus to the last item in item list
25987
+
25988
+ function setFocusToLastItem(itemNodes) {
25989
+ itemNodes.length > 0 && setFocusToItem(itemNodes, itemNodes[itemNodes.length - 1]);
25990
+ } // set focus to the previous item in item list
25991
+
25992
+ function setFocusToPreviousMenuItem(itemNodes, currentItem) {
25993
+ let newMenuItem, index;
25994
+
25995
+ if (itemNodes.length > 0) {
25996
+ if (currentItem === itemNodes[0]) {
25997
+ newMenuItem = itemNodes[itemNodes.length - 1];
25998
+ } else {
25999
+ index = index_of_default()(itemNodes).call(itemNodes, currentItem);
26000
+ newMenuItem = itemNodes[index - 1];
26001
+ }
26002
+
26003
+ setFocusToItem(itemNodes, newMenuItem);
26004
+ }
26005
+ } // set focus to the next item in item list
26006
+
26007
+ function setFocusToNextMenuitem(itemNodes, currentItem) {
26008
+ let newMenuItem, index;
26009
+
26010
+ if (itemNodes.length > 0) {
26011
+ if (currentItem === itemNodes[itemNodes.length - 1]) {
26012
+ newMenuItem = itemNodes[0];
26013
+ } else {
26014
+ index = index_of_default()(itemNodes).call(itemNodes, currentItem);
26015
+ newMenuItem = itemNodes[index + 1];
26016
+ }
26017
+
26018
+ setFocusToItem(itemNodes, newMenuItem);
26019
+ }
26020
+ }
26021
+ function findIndexByCharacter(itemList, curItem, firstCharList, char) {
26022
+ let start, index;
26023
+
26024
+ if (!itemList || !firstCharList || !char || char.length > 1) {
26025
+ return -1;
26026
+ }
26027
+
26028
+ char = char.toLowerCase(); // Get start index for search based on position of currentItem
26029
+
26030
+ start = index_of_default()(itemList).call(itemList, curItem) + 1;
26031
+
26032
+ if (start >= itemList.length) {
26033
+ start = 0;
26034
+ } // Check remaining menu items in the menu
26035
+
26036
+
26037
+ index = index_of_default()(firstCharList).call(firstCharList, char, start); // If not found in remaining menu items, check from beginning
26038
+
26039
+ if (index === -1) {
26040
+ index = index_of_default()(firstCharList).call(firstCharList, char, 0);
26041
+ }
26042
+
26043
+ return index >= 0 ? index : -1;
26044
+ }
26045
+ function getAncestorNodeByRole(curElement, role) {
26046
+ if (!curElement) {
26047
+ return null;
26048
+ }
26049
+
26050
+ while (curElement.parentElement && get_default()(curElement.parentElement, 'attributes.role.value', '') !== role) {
26051
+ curElement = curElement.parentElement;
26052
+ }
26053
+
26054
+ return curElement.parentElement;
26055
+ } // According to the Id, find the corresponding data-popupId element
26056
+
26057
+ function getMenuButton(focusableEle, Id) {
26058
+ for (let i = 0; i < focusableEle.length; i++) {
26059
+ const curAriDescribedby = focusableEle[i].attributes['data-popupId'];
26060
+
26061
+ if (curAriDescribedby && curAriDescribedby.value === Id) {
26062
+ return focusableEle[i];
26063
+ }
26064
+ }
26065
+
26066
+ return null;
26067
+ }
25962
26068
  // CONCATENATED MODULE: ../semi-foundation/tooltip/foundation.ts
25963
26069
 
25964
26070
 
@@ -25969,6 +26075,7 @@ var define_property_default = /*#__PURE__*/__webpack_require__.n(define_property
25969
26075
 
25970
26076
 
25971
26077
 
26078
+
25972
26079
  const REGS = {
25973
26080
  TOP: /top/i,
25974
26081
  RIGHT: /right/i,
@@ -26898,6 +27005,7 @@ class foundation_Tooltip extends foundation {
26898
27005
 
26899
27006
  switch (event && event.key) {
26900
27007
  case "Escape":
27008
+ handlePrevent(event);
26901
27009
  closeOnEsc && this._handleEscKeyDown(event);
26902
27010
  break;
26903
27011
 
@@ -26927,14 +27035,17 @@ class foundation_Tooltip extends foundation {
26927
27035
  _focusTrigger() {
26928
27036
  const {
26929
27037
  trigger,
26930
- returnFocusOnClose
27038
+ returnFocusOnClose,
27039
+ preventScroll
26931
27040
  } = this.getProps();
26932
27041
 
26933
- if (returnFocusOnClose && trigger === 'click') {
27042
+ if (returnFocusOnClose && trigger !== 'custom') {
26934
27043
  const triggerNode = this._adapter.getTriggerNode();
26935
27044
 
26936
27045
  if (triggerNode && 'focus' in triggerNode) {
26937
- triggerNode.focus();
27046
+ triggerNode.focus({
27047
+ preventScroll
27048
+ });
26938
27049
  }
26939
27050
  }
26940
27051
  }
@@ -26945,43 +27056,67 @@ class foundation_Tooltip extends foundation {
26945
27056
  } = this.getProps();
26946
27057
 
26947
27058
  if (trigger !== 'custom') {
26948
- this.hide();
26949
-
27059
+ // Move the focus into the trigger first and then close the pop-up layer
27060
+ // 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
26950
27061
  this._focusTrigger();
27062
+
27063
+ this.hide();
26951
27064
  }
26952
27065
 
26953
27066
  this._adapter.notifyEscKeydown(event);
26954
27067
  }
26955
27068
 
26956
27069
  _handleContainerTabKeyDown(focusableElements, event) {
27070
+ const {
27071
+ preventScroll
27072
+ } = this.getProps();
27073
+
26957
27074
  const activeElement = this._adapter.getActiveElement();
26958
27075
 
26959
27076
  const isLastCurrentFocus = focusableElements[focusableElements.length - 1] === activeElement;
26960
27077
 
26961
27078
  if (isLastCurrentFocus) {
26962
- focusableElements[0].focus();
27079
+ focusableElements[0].focus({
27080
+ preventScroll
27081
+ });
26963
27082
  event.preventDefault(); // prevent browser default tab move behavior
26964
27083
  }
26965
27084
  }
26966
27085
 
26967
27086
  _handleContainerShiftTabKeyDown(focusableElements, event) {
27087
+ const {
27088
+ preventScroll
27089
+ } = this.getProps();
27090
+
26968
27091
  const activeElement = this._adapter.getActiveElement();
26969
27092
 
26970
27093
  const isFirstCurrentFocus = focusableElements[0] === activeElement;
26971
27094
 
26972
27095
  if (isFirstCurrentFocus) {
26973
- focusableElements[focusableElements.length - 1].focus();
27096
+ focusableElements[focusableElements.length - 1].focus({
27097
+ preventScroll
27098
+ });
26974
27099
  event.preventDefault(); // prevent browser default tab move behavior
26975
27100
  }
26976
27101
  }
26977
27102
 
26978
27103
  _handleTriggerArrowDownKeydown(focusableElements, event) {
26979
- focusableElements[0].focus();
27104
+ const {
27105
+ preventScroll
27106
+ } = this.getProps();
27107
+ focusableElements[0].focus({
27108
+ preventScroll
27109
+ });
26980
27110
  event.preventDefault(); // prevent browser default scroll behavior
26981
27111
  }
26982
27112
 
26983
27113
  _handleTriggerArrowUpKeydown(focusableElements, event) {
26984
- focusableElements[focusableElements.length - 1].focus();
27114
+ const {
27115
+ preventScroll
27116
+ } = this.getProps();
27117
+ focusableElements[focusableElements.length - 1].focus({
27118
+ preventScroll
27119
+ });
26985
27120
  event.preventDefault(); // prevent browser default scroll behavior
26986
27121
  }
26987
27122
 
@@ -29368,7 +29503,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
29368
29503
 
29369
29504
  if (block || includes_default()(blockDisplays).call(blockDisplays, display)) {
29370
29505
  style.width = '100%';
29371
- }
29506
+ } // eslint-disable-next-line jsx-a11y/no-static-element-interactions
29507
+
29372
29508
 
29373
29509
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
29374
29510
  className: wrapperClassName,
@@ -29671,10 +29807,16 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
29671
29807
  return Object(_utils["b" /* getActiveElement */])();
29672
29808
  },
29673
29809
  setInitialFocus: () => {
29810
+ const {
29811
+ preventScroll
29812
+ } = this.props;
29813
+
29674
29814
  const focusRefNode = get_default()(this, 'initialFocusRef.current');
29675
29815
 
29676
29816
  if (focusRefNode && 'focus' in focusRefNode) {
29677
- focusRefNode.focus();
29817
+ focusRefNode.focus({
29818
+ preventScroll
29819
+ });
29678
29820
  }
29679
29821
  },
29680
29822
  notifyEscKeydown: event => {
@@ -29793,7 +29935,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
29793
29935
  ref.current = node;
29794
29936
  }
29795
29937
  },
29796
- tabIndex: trigger === 'hover' ? 0 : undefined
29938
+ tabIndex: 0,
29939
+ 'data-popupId': id
29797
29940
  })); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
29798
29941
  // So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
29799
29942
 
@@ -29834,7 +29977,8 @@ tooltip_Tooltip.propTypes = {
29834
29977
  role: prop_types_default.a.string,
29835
29978
  wrapWhenSpecial: prop_types_default.a.bool,
29836
29979
  guardFocus: prop_types_default.a.bool,
29837
- returnFocusOnClose: prop_types_default.a.bool
29980
+ returnFocusOnClose: prop_types_default.a.bool,
29981
+ preventScroll: prop_types_default.a.bool
29838
29982
  };
29839
29983
  tooltip_Tooltip.defaultProps = {
29840
29984
  arrowBounding: numbers.ARROW_BOUNDING,
@@ -36015,10 +36159,15 @@ class input_Input extends baseComponent_BaseComponent {
36015
36159
  eyeClosed: value
36016
36160
  }),
36017
36161
  toggleFocusing: isFocus => {
36162
+ const {
36163
+ preventScroll
36164
+ } = this.props;
36018
36165
  const input = this.inputRef && this.inputRef.current;
36019
36166
 
36020
36167
  if (isFocus) {
36021
- input && input.focus();
36168
+ input && input.focus({
36169
+ preventScroll
36170
+ });
36022
36171
  } else {
36023
36172
  input && input.blur();
36024
36173
  }
@@ -36260,9 +36409,10 @@ class input_Input extends baseComponent_BaseComponent {
36260
36409
  inputStyle,
36261
36410
  forwardRef,
36262
36411
  maxLength,
36263
- getValueLength
36412
+ getValueLength,
36413
+ preventScroll
36264
36414
  } = _a,
36265
- rest = input_rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
36415
+ rest = input_rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "defaultValue", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength", "preventScroll"]);
36266
36416
 
36267
36417
  const {
36268
36418
  value,
@@ -36387,14 +36537,14 @@ input_Input.propTypes = {
36387
36537
  insetLabel: prop_types_default.a.node,
36388
36538
  insetLabelId: prop_types_default.a.string,
36389
36539
  inputStyle: prop_types_default.a.object,
36390
- getValueLength: prop_types_default.a.func
36540
+ getValueLength: prop_types_default.a.func,
36541
+ preventScroll: prop_types_default.a.bool
36391
36542
  };
36392
36543
  input_Input.defaultProps = {
36393
36544
  addonBefore: '',
36394
36545
  addonAfter: '',
36395
36546
  prefix: '',
36396
36547
  suffix: '',
36397
- disabled: false,
36398
36548
  readonly: false,
36399
36549
  type: 'text',
36400
36550
  showClear: false,
@@ -37083,7 +37233,6 @@ autoComplete_AutoComplete.defaultProps = {
37083
37233
  position: 'bottomLeft',
37084
37234
  data: [],
37085
37235
  showClear: false,
37086
- disabled: false,
37087
37236
  size: 'default',
37088
37237
  onFocus: noop_default.a,
37089
37238
  onSearch: noop_default.a,
@@ -37173,11 +37322,6 @@ class foundation_AvatarFoundation extends foundation {
37173
37322
  // EXTERNAL MODULE: ../semi-foundation/avatar/avatar.scss
37174
37323
  var avatar_avatar = __webpack_require__("R8rS");
37175
37324
 
37176
- // CONCATENATED MODULE: ../semi-foundation/utils/a11y.ts
37177
- function handlePrevent(event) {
37178
- event.stopPropagation();
37179
- event.preventDefault();
37180
- }
37181
37325
  // CONCATENATED MODULE: ./avatar/index.tsx
37182
37326
 
37183
37327
 
@@ -48584,10 +48728,16 @@ class foundation_CascaderFoundation extends foundation {
48584
48728
  open() {
48585
48729
  const filterable = this._isFilterable();
48586
48730
 
48731
+ const {
48732
+ multiple
48733
+ } = this.getProps();
48734
+
48587
48735
  this._adapter.openMenu();
48588
48736
 
48589
48737
  if (filterable) {
48590
48738
  this._clearInput();
48739
+
48740
+ !multiple && this.toggle2SearchInput(true);
48591
48741
  }
48592
48742
 
48593
48743
  if (this._isControlledComponent()) {
@@ -48647,11 +48797,28 @@ class foundation_CascaderFoundation extends foundation {
48647
48797
  this._adapter.updateStates({
48648
48798
  inputValue
48649
48799
  });
48800
+
48801
+ !multiple && this.toggle2SearchInput(false);
48802
+ !multiple && this._adapter.updateFocusState(false);
48650
48803
  }
48651
48804
 
48652
48805
  this._notifyBlur(e);
48653
48806
  }
48654
48807
 
48808
+ toggle2SearchInput(isShow) {
48809
+ if (isShow) {
48810
+ this._adapter.toggleInputShow(isShow, () => this.focusInput());
48811
+ } else {
48812
+ this._adapter.toggleInputShow(isShow, () => undefined);
48813
+ }
48814
+ }
48815
+
48816
+ focusInput() {
48817
+ this._adapter.focusInput();
48818
+
48819
+ this._adapter.updateFocusState(true);
48820
+ }
48821
+
48655
48822
  handleItemClick(e, item) {
48656
48823
  const isDisabled = this._isDisabled();
48657
48824
 
@@ -49481,7 +49648,12 @@ class checkboxInner_CheckboxInner extends external_root_React_commonjs2_react_co
49481
49648
  }
49482
49649
 
49483
49650
  focus() {
49484
- this.inputEntity.focus();
49651
+ const {
49652
+ preventScroll
49653
+ } = this.props;
49654
+ this.inputEntity.focus({
49655
+ preventScroll
49656
+ });
49485
49657
  }
49486
49658
 
49487
49659
  render() {
@@ -49559,7 +49731,8 @@ checkboxInner_CheckboxInner.propTypes = {
49559
49731
  extraId: prop_types_default.a.string,
49560
49732
  focusInner: prop_types_default.a.bool,
49561
49733
  onInputFocus: prop_types_default.a.func,
49562
- onInputBlur: prop_types_default.a.func
49734
+ onInputBlur: prop_types_default.a.func,
49735
+ preventScroll: prop_types_default.a.bool
49563
49736
  };
49564
49737
  checkboxInner_CheckboxInner.defaultProps = {
49565
49738
  onChange: noop_default.a
@@ -49817,7 +49990,8 @@ checkbox_Checkbox.propTypes = {
49817
49990
  extra: prop_types_default.a.node,
49818
49991
  index: prop_types_default.a.number,
49819
49992
  'aria-label': prop_types_default.a.string,
49820
- tabIndex: prop_types_default.a.number
49993
+ tabIndex: prop_types_default.a.number,
49994
+ preventScroll: prop_types_default.a.bool
49821
49995
  };
49822
49996
  checkbox_Checkbox.defaultProps = {
49823
49997
  defaultChecked: false,
@@ -50487,10 +50661,6 @@ var tag_rest = undefined && undefined.__rest || function (s, e) {
50487
50661
  };
50488
50662
  /* eslint-disable jsx-a11y/no-static-element-interactions */
50489
50663
 
50490
- /* eslint-disable no-unused-vars */
50491
-
50492
- /* eslint-disable max-len */
50493
-
50494
50664
 
50495
50665
 
50496
50666
 
@@ -50555,7 +50725,8 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50555
50725
  handleKeyDown(event) {
50556
50726
  const {
50557
50727
  closable,
50558
- onClick
50728
+ onClick,
50729
+ onKeyDown
50559
50730
  } = this.props;
50560
50731
 
50561
50732
  switch (event.key) {
@@ -50577,6 +50748,8 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
50577
50748
  default:
50578
50749
  break;
50579
50750
  }
50751
+
50752
+ onKeyDown && onKeyDown(event);
50580
50753
  }
50581
50754
 
50582
50755
  renderAvatar() {
@@ -51134,10 +51307,15 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
51134
51307
  });
51135
51308
  },
51136
51309
  toggleFocusing: isFocus => {
51310
+ const {
51311
+ preventScroll
51312
+ } = this.props;
51137
51313
  const input = this.inputRef && this.inputRef.current;
51138
51314
 
51139
51315
  if (isFocus) {
51140
- input && input.focus();
51316
+ input && input.focus({
51317
+ preventScroll
51318
+ });
51141
51319
  } else {
51142
51320
  input && input.blur();
51143
51321
  }
@@ -51178,11 +51356,14 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
51178
51356
  componentDidMount() {
51179
51357
  const {
51180
51358
  disabled,
51181
- autoFocus
51359
+ autoFocus,
51360
+ preventScroll
51182
51361
  } = this.props;
51183
51362
 
51184
51363
  if (!disabled && autoFocus) {
51185
- this.inputRef.current.focus();
51364
+ this.inputRef.current.focus({
51365
+ preventScroll
51366
+ });
51186
51367
  }
51187
51368
  }
51188
51369
 
@@ -51351,7 +51532,12 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
51351
51532
  }
51352
51533
 
51353
51534
  focus() {
51354
- this.inputRef.current.focus();
51535
+ const {
51536
+ preventScroll
51537
+ } = this.props;
51538
+ this.inputRef.current.focus({
51539
+ preventScroll
51540
+ });
51355
51541
  }
51356
51542
 
51357
51543
  render() {
@@ -51451,7 +51637,8 @@ tagInput_TagInput.propTypes = {
51451
51637
  validateStatus: prop_types_default.a.oneOf(tagInput_constants_strings.STATUS),
51452
51638
  prefix: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.node]),
51453
51639
  suffix: prop_types_default.a.oneOfType([prop_types_default.a.string, prop_types_default.a.node]),
51454
- 'aria-label': prop_types_default.a.string
51640
+ 'aria-label': prop_types_default.a.string,
51641
+ preventScroll: prop_types_default.a.bool
51455
51642
  };
51456
51643
  tagInput_TagInput.defaultProps = {
51457
51644
  showClear: false,
@@ -52033,7 +52220,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52033
52220
  loadingKeys: new set_default.a(),
52034
52221
 
52035
52222
  /* Mark whether this rendering has triggered asynchronous loading of data */
52036
- loading: false
52223
+ loading: false,
52224
+ showInput: false
52037
52225
  };
52038
52226
  this.options = {};
52039
52227
  this.isEmpty = false;
@@ -52060,9 +52248,15 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52060
52248
  });
52061
52249
  },
52062
52250
  focusInput: () => {
52251
+ const {
52252
+ preventScroll
52253
+ } = this.props;
52254
+
52063
52255
  if (this.inputRef && this.inputRef.current) {
52064
52256
  // TODO: check the reason
52065
- this.inputRef.current.focus();
52257
+ this.inputRef.current.focus({
52258
+ preventScroll
52259
+ });
52066
52260
  }
52067
52261
  }
52068
52262
  };
@@ -52171,7 +52365,19 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52171
52365
  });
52172
52366
  },
52173
52367
  notifyOnExceed: data => this.props.onExceed(data),
52174
- notifyClear: () => this.props.onClear()
52368
+ notifyClear: () => this.props.onClear(),
52369
+ toggleInputShow: (showInput, cb) => {
52370
+ this.setState({
52371
+ showInput
52372
+ }, () => {
52373
+ cb();
52374
+ });
52375
+ },
52376
+ updateFocusState: isFocus => {
52377
+ this.setState({
52378
+ isFocus
52379
+ });
52380
+ }
52175
52381
  });
52176
52382
  }
52177
52383
 
@@ -52347,21 +52553,29 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52347
52553
  const inputcls = classnames_default()("".concat(cascader_prefixcls, "-input"));
52348
52554
  const {
52349
52555
  inputValue,
52350
- inputPlaceHolder
52556
+ inputPlaceHolder,
52557
+ showInput
52351
52558
  } = this.state;
52352
52559
  const inputProps = {
52353
52560
  disabled,
52354
52561
  value: inputValue,
52355
52562
  className: inputcls,
52356
- onChange: this.handleInputChange,
52357
- placeholder: inputPlaceHolder
52563
+ onChange: this.handleInputChange
52358
52564
  };
52359
52565
  const wrappercls = classnames_default()({
52360
52566
  ["".concat(cascader_prefixcls, "-search-wrapper")]: true
52361
52567
  });
52568
+ const displayText = this.renderDisplayText();
52569
+ const spanCls = classnames_default()({
52570
+ ["".concat(cascader_prefixcls, "-selection-placeholder")]: !displayText,
52571
+ ["".concat(cascader_prefixcls, "-selection-text-hide")]: showInput && inputValue,
52572
+ ["".concat(cascader_prefixcls, "-selection-text-inactive")]: showInput && !inputValue
52573
+ });
52362
52574
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
52363
52575
  className: wrappercls
52364
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(input_0, assign_default()({
52576
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
52577
+ className: spanCls
52578
+ }, displayText ? displayText : inputPlaceHolder), showInput && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(input_0, assign_default()({
52365
52579
  ref: this.inputRef,
52366
52580
  size: size
52367
52581
  }, inputProps)));
@@ -52478,7 +52692,8 @@ cascader_Cascader.propTypes = {
52478
52692
  loadedKeys: prop_types_default.a.array,
52479
52693
  disableStrictly: prop_types_default.a.bool,
52480
52694
  leafOnly: prop_types_default.a.bool,
52481
- enableLeafClick: prop_types_default.a.bool
52695
+ enableLeafClick: prop_types_default.a.bool,
52696
+ preventScroll: prop_types_default.a.bool
52482
52697
  };
52483
52698
  cascader_Cascader.defaultProps = {
52484
52699
  leafOnly: false,
@@ -52490,7 +52705,6 @@ cascader_Cascader.defaultProps = {
52490
52705
  showClear: false,
52491
52706
  autoClearSearchValue: true,
52492
52707
  changeOnSelect: false,
52493
- disabled: false,
52494
52708
  disableStrictly: false,
52495
52709
  autoMergeValue: true,
52496
52710
  multiple: false,
@@ -65565,6 +65779,10 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65565
65779
  motionEnd
65566
65780
  }),
65567
65781
  setRangeInputFocus: rangeInputFocus => {
65782
+ const {
65783
+ preventScroll
65784
+ } = this.props;
65785
+
65568
65786
  if (rangeInputFocus !== this.state.rangeInputFocus) {
65569
65787
  this.setState({
65570
65788
  rangeInputFocus
@@ -65575,7 +65793,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65575
65793
  case 'rangeStart':
65576
65794
  const inputStartNode = get_default()(this, 'rangeInputStartRef.current');
65577
65795
 
65578
- inputStartNode && inputStartNode.focus();
65796
+ inputStartNode && inputStartNode.focus({
65797
+ preventScroll
65798
+ });
65579
65799
  /**
65580
65800
  * 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
65581
65801
  * 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
@@ -65599,7 +65819,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65599
65819
  case 'rangeEnd':
65600
65820
  const inputEndNode = get_default()(this, 'rangeInputEndRef.current');
65601
65821
 
65602
- inputEndNode && inputEndNode.focus();
65822
+ inputEndNode && inputEndNode.focus({
65823
+ preventScroll
65824
+ });
65603
65825
  /**
65604
65826
  * 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
65605
65827
  * 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
@@ -65627,6 +65849,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65627
65849
  couldPanelClosed: () => this.focusRecordsRef.current.rangeStart && this.focusRecordsRef.current.rangeEnd,
65628
65850
  isEventTarget: e => e && e.target === e.currentTarget,
65629
65851
  setInsetInputFocus: () => {
65852
+ const {
65853
+ preventScroll
65854
+ } = this.props;
65630
65855
  const {
65631
65856
  rangeInputFocus
65632
65857
  } = this.state;
@@ -65636,7 +65861,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65636
65861
  if (document.activeElement !== this.rangeInputEndRef.current) {
65637
65862
  const inputEndNode = get_default()(this, 'rangeInputEndRef.current');
65638
65863
 
65639
- inputEndNode && inputEndNode.focus();
65864
+ inputEndNode && inputEndNode.focus({
65865
+ preventScroll
65866
+ });
65640
65867
  }
65641
65868
 
65642
65869
  break;
@@ -65646,7 +65873,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65646
65873
  if (document.activeElement !== this.rangeInputStartRef.current) {
65647
65874
  const inputStartNode = get_default()(this, 'rangeInputStartRef.current');
65648
65875
 
65649
- inputStartNode && inputStartNode.focus();
65876
+ inputStartNode && inputStartNode.focus({
65877
+ preventScroll
65878
+ });
65650
65879
  }
65651
65880
 
65652
65881
  break;
@@ -65961,7 +66190,8 @@ datePicker_DatePicker.propTypes = {
65961
66190
  syncSwitchMonth: prop_types_default.a.bool,
65962
66191
  // Callback function for panel date switching
65963
66192
  onPanelChange: prop_types_default.a.func,
65964
- rangeSeparator: prop_types_default.a.string
66193
+ rangeSeparator: prop_types_default.a.string,
66194
+ preventScroll: prop_types_default.a.bool
65965
66195
  };
65966
66196
  datePicker_DatePicker.defaultProps = {
65967
66197
  onChangeWithDateFirst: true,
@@ -65974,7 +66204,6 @@ datePicker_DatePicker.defaultProps = {
65974
66204
  type: 'date',
65975
66205
  size: 'default',
65976
66206
  density: 'default',
65977
- disabled: false,
65978
66207
  multiple: false,
65979
66208
  defaultOpen: false,
65980
66209
  disabledHours: noop_default.a,
@@ -66648,7 +66877,12 @@ class FocusHandle_FocusTrapHandle {
66648
66877
  };
66649
66878
 
66650
66879
  this.focusElement = (element, event) => {
66651
- element === null || element === void 0 ? void 0 : element.focus();
66880
+ const {
66881
+ preventScroll
66882
+ } = this.options;
66883
+ element === null || element === void 0 ? void 0 : element.focus({
66884
+ preventScroll
66885
+ });
66652
66886
  event.preventDefault(); // prevent browser default tab move behavior
66653
66887
  };
66654
66888
 
@@ -67003,17 +67237,24 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
67003
67237
  modalDialogFocus: () => {
67004
67238
  var _a, _b, _c;
67005
67239
 
67240
+ const {
67241
+ preventScroll
67242
+ } = this.props;
67006
67243
  let activeElementInDialog;
67007
67244
 
67008
67245
  if (this.modalDialogRef) {
67009
67246
  const activeElement = FocusHandle.getActiveElement();
67010
67247
  activeElementInDialog = this.modalDialogRef.current.contains(activeElement);
67011
67248
  (_a = this.focusTrapHandle) === null || _a === void 0 ? void 0 : _a.destroy();
67012
- this.focusTrapHandle = new FocusHandle(this.modalDialogRef.current);
67249
+ this.focusTrapHandle = new FocusHandle(this.modalDialogRef.current, {
67250
+ preventScroll
67251
+ });
67013
67252
  }
67014
67253
 
67015
67254
  if (!activeElementInDialog) {
67016
- (_c = (_b = this.modalDialogRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.focus();
67255
+ (_c = (_b = this.modalDialogRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.focus({
67256
+ preventScroll
67257
+ });
67017
67258
  }
67018
67259
  },
67019
67260
  modalDialogBlur: () => {
@@ -67026,10 +67267,15 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
67026
67267
  const {
67027
67268
  prevFocusElement
67028
67269
  } = this.state;
67270
+ const {
67271
+ preventScroll
67272
+ } = this.props;
67029
67273
 
67030
67274
  const focus = get_default()(prevFocusElement, 'focus');
67031
67275
 
67032
- isFunction_default()(focus) && prevFocusElement.focus();
67276
+ isFunction_default()(focus) && prevFocusElement.focus({
67277
+ preventScroll
67278
+ });
67033
67279
  }
67034
67280
  });
67035
67281
  }
@@ -67083,7 +67329,8 @@ ModalContent_ModalContent.propTypes = {
67083
67329
  getContainerContext: prop_types_default.a.func,
67084
67330
  contentClassName: prop_types_default.a.string,
67085
67331
  maskClassName: prop_types_default.a.string,
67086
- onAnimationEnd: prop_types_default.a.func
67332
+ onAnimationEnd: prop_types_default.a.func,
67333
+ preventScroll: prop_types_default.a.bool
67087
67334
  };
67088
67335
  ModalContent_ModalContent.defaultProps = {
67089
67336
  close: noop_default.a,
@@ -67864,6 +68111,9 @@ const dropdown_constants_numbers = {
67864
68111
 
67865
68112
  // CONCATENATED MODULE: ../semi-foundation/dropdown/foundation.ts
67866
68113
 
68114
+
68115
+
68116
+
67867
68117
  class foundation_DropdownFoundation extends foundation {
67868
68118
  handleVisibleChange(visible) {
67869
68119
  this._adapter.setPopVisible(visible);
@@ -67871,7 +68121,155 @@ class foundation_DropdownFoundation extends foundation {
67871
68121
  this._adapter.notifyVisibleChange(visible);
67872
68122
  }
67873
68123
 
68124
+ getMenuItemNodes(target) {
68125
+ var _context;
68126
+
68127
+ const id = target.attributes['data-popupId'].value;
68128
+ const menuWrapper = document.getElementById(id); // if has dropdown item, the item must wrapped by li
68129
+
68130
+ return menuWrapper ? filter_default()(_context = from_default()(menuWrapper.getElementsByTagName('li'))).call(_context, item => item.ariaDisabled === "false") : null;
68131
+ }
68132
+
68133
+ setFocusToFirstMenuItem(target) {
68134
+ const menuItemNodes = this.getMenuItemNodes(target);
68135
+ menuItemNodes && setFocusToFirstItem(menuItemNodes);
68136
+ }
68137
+
68138
+ setFocusToLastMenuItem(target) {
68139
+ const menuItemNodes = this.getMenuItemNodes(target);
68140
+ menuItemNodes && setFocusToLastItem(menuItemNodes);
68141
+ }
68142
+
68143
+ handleKeyDown(event) {
68144
+ switch (event.key) {
68145
+ case ' ':
68146
+ case 'Enter':
68147
+ event.target.click();
68148
+ handlePrevent(event);
68149
+ break;
68150
+
68151
+ case 'ArrowDown':
68152
+ this.setFocusToFirstMenuItem(event.target);
68153
+ handlePrevent(event);
68154
+ break;
68155
+
68156
+ case 'ArrowUp':
68157
+ this.setFocusToLastMenuItem(event.target);
68158
+ handlePrevent(event);
68159
+ break;
68160
+
68161
+ default:
68162
+ break;
68163
+ }
68164
+ }
68165
+
68166
+ }
68167
+ // CONCATENATED MODULE: ../semi-foundation/dropdown/menuFoundation.ts
68168
+
68169
+
68170
+
68171
+
68172
+
68173
+
68174
+ class menuFoundation_DropdownMenuFoundation extends foundation {
68175
+ constructor() {
68176
+ super(...arguments);
68177
+ this.menuItemNodes = null;
68178
+ this.firstChars = [];
68179
+ } // if trigger is click, auto focus to the first menu item
68180
+
68181
+
68182
+ autoFocus(ulElement) {
68183
+ const trigger = this._adapter.getContext('trigger');
68184
+
68185
+ if (trigger === 'click') {
68186
+ var _context;
68187
+
68188
+ // find all non-disabled li under this menu and set focus to the first menu
68189
+ this.menuItemNodes = filter_default()(_context = [...ulElement.getElementsByTagName('li')]).call(_context, item => item.ariaDisabled !== "true");
68190
+ setFocusToFirstItem(this.menuItemNodes);
68191
+ }
68192
+ }
68193
+
68194
+ handleEscape(menu) {
68195
+ const trigger = this._adapter.getContext('trigger');
68196
+
68197
+ if (trigger === 'custom') {
68198
+ const menuButton = menu && getMenuButton(document.querySelectorAll("[data-popupId]"), menu.id);
68199
+ menuButton.focus();
68200
+ }
68201
+ }
68202
+
68203
+ setFocusByFirstCharacter(curItem, char) {
68204
+ const index = findIndexByCharacter(this.menuItemNodes, curItem, this.firstChars, char);
68205
+
68206
+ if (index >= 0) {
68207
+ setFocusToItem(this.menuItemNodes, this.menuItemNodes[index]);
68208
+ }
68209
+ }
68210
+
68211
+ onMenuKeydown(event) {
68212
+ var _context5;
68213
+
68214
+ const menu = getAncestorNodeByRole(event.target, 'tooltip');
68215
+
68216
+ if (!this.menuItemNodes) {
68217
+ var _context2;
68218
+
68219
+ this.menuItemNodes = filter_default()(_context2 = [...event.target.parentNode.getElementsByTagName('li')]).call(_context2, item => item.ariaDisabled !== "true");
68220
+ }
68221
+
68222
+ if (this.firstChars.length === 0) {
68223
+ var _context3;
68224
+
68225
+ for_each_default()(_context3 = this.menuItemNodes).call(_context3, item => {
68226
+ var _context4;
68227
+
68228
+ this.firstChars.push(trim_default()(_context4 = item.textContent).call(_context4)[0].toLowerCase());
68229
+ });
68230
+ } // get the currently focused menu item
68231
+
68232
+
68233
+ const curItem = find_default()(_context5 = this.menuItemNodes).call(_context5, item => item.tabIndex === 0);
68234
+
68235
+ switch (event.key) {
68236
+ case ' ':
68237
+ case 'Enter':
68238
+ event.target.click();
68239
+ handlePrevent(event);
68240
+ break;
68241
+
68242
+ case 'Escape':
68243
+ this.handleEscape(menu);
68244
+ break;
68245
+
68246
+ case 'ArrowUp':
68247
+ setFocusToPreviousMenuItem(this.menuItemNodes, curItem);
68248
+ handlePrevent(event);
68249
+ break;
68250
+
68251
+ case 'ArrowDown':
68252
+ setFocusToNextMenuitem(this.menuItemNodes, curItem);
68253
+ handlePrevent(event);
68254
+ break;
68255
+
68256
+ default:
68257
+ if (isPrintableCharacter(event.key)) {
68258
+ this.setFocusByFirstCharacter(curItem, event.key);
68259
+ handlePrevent(event);
68260
+ }
68261
+
68262
+ break;
68263
+ }
68264
+ }
68265
+
67874
68266
  }
68267
+ // CONCATENATED MODULE: ./dropdown/context.ts
68268
+
68269
+ const DropdownContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createContext({
68270
+ level: 0
68271
+ });
68272
+ /* harmony default export */ var dropdown_context = (DropdownContext);
67875
68273
  // CONCATENATED MODULE: ./dropdown/dropdownMenu.tsx
67876
68274
 
67877
68275
 
@@ -67893,9 +68291,25 @@ var dropdownMenu_rest = undefined && undefined.__rest || function (s, e) {
67893
68291
 
67894
68292
 
67895
68293
 
68294
+
68295
+
67896
68296
  const dropdownMenu_prefixCls = dropdown_constants_cssClasses.PREFIX;
67897
68297
 
67898
68298
  class dropdownMenu_DropdownMenu extends baseComponent_BaseComponent {
68299
+ constructor(props) {
68300
+ super(props);
68301
+ this.menuRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
68302
+ this.foundation = new menuFoundation_DropdownMenuFoundation(this.adapter);
68303
+ }
68304
+
68305
+ get adapter() {
68306
+ return assign_default()({}, super.adapter);
68307
+ }
68308
+
68309
+ componentDidMount() {
68310
+ this.foundation.autoFocus(this.menuRef.current);
68311
+ }
68312
+
67899
68313
  render() {
67900
68314
  const _a = this.props,
67901
68315
  {
@@ -67907,10 +68321,12 @@ class dropdownMenu_DropdownMenu extends baseComponent_BaseComponent {
67907
68321
 
67908
68322
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", assign_default()({
67909
68323
  role: "menu",
67910
- "aria-orientation": "vertical"
68324
+ "aria-orientation": "vertical",
68325
+ ref: this.menuRef
67911
68326
  }, rest, {
67912
68327
  className: classnames_default()("".concat(dropdownMenu_prefixCls, "-menu"), className),
67913
- style: style
68328
+ style: style,
68329
+ onKeyDown: e => this.foundation.onMenuKeydown(e)
67914
68330
  }), children);
67915
68331
  }
67916
68332
 
@@ -67921,13 +68337,8 @@ dropdownMenu_DropdownMenu.propTypes = {
67921
68337
  className: prop_types_default.a.string,
67922
68338
  style: prop_types_default.a.object
67923
68339
  };
68340
+ dropdownMenu_DropdownMenu.contextType = dropdown_context;
67924
68341
  /* harmony default export */ var dropdownMenu = (dropdownMenu_DropdownMenu);
67925
- // CONCATENATED MODULE: ./dropdown/context.ts
67926
-
67927
- const DropdownContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createContext({
67928
- level: 0
67929
- });
67930
- /* harmony default export */ var dropdown_context = (DropdownContext);
67931
68342
  // CONCATENATED MODULE: ./dropdown/dropdownItem.tsx
67932
68343
 
67933
68344
 
@@ -68005,7 +68416,9 @@ class dropdownItem_DropdownItem extends baseComponent_BaseComponent {
68005
68416
  }
68006
68417
 
68007
68418
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", assign_default()({
68008
- role: "menuitem"
68419
+ role: "menuitem",
68420
+ tabIndex: -1,
68421
+ "aria-disabled": disabled
68009
68422
  }, events, {
68010
68423
  ref: ref => forwardRef(ref),
68011
68424
  className: itemclass,
@@ -68174,7 +68587,8 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68174
68587
  contentClassName,
68175
68588
  style,
68176
68589
  showTick,
68177
- prefixCls
68590
+ prefixCls,
68591
+ trigger
68178
68592
  } = this.props;
68179
68593
  const className = classnames_default()(prefixCls, contentClassName);
68180
68594
  const {
@@ -68182,7 +68596,8 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68182
68596
  } = this.context;
68183
68597
  const contextValue = {
68184
68598
  showTick,
68185
- level: level + 1
68599
+ level: level + 1,
68600
+ trigger
68186
68601
  };
68187
68602
  let content = null;
68188
68603
 
@@ -68319,11 +68734,15 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68319
68734
  position: position,
68320
68735
  trigger: trigger,
68321
68736
  onVisibleChange: this.handleVisibleChange,
68322
- showArrow: false
68737
+ showArrow: false,
68738
+ returnFocusOnClose: true
68323
68739
  }, attr), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(children) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(children, {
68324
68740
  className: classnames_default()(get_default()(children, 'props.className'), {
68325
68741
  ["".concat(prefixCls, "-showing")]: popVisible
68326
- })
68742
+ }),
68743
+ 'aria-haspopup': true,
68744
+ 'aria-expanded': popVisible,
68745
+ onKeyDown: e => this.foundation.handleKeyDown(e)
68327
68746
  }) : children);
68328
68747
  }
68329
68748
 
@@ -68363,7 +68782,9 @@ dropdown_Dropdown.defaultProps = {
68363
68782
  trigger: 'hover',
68364
68783
  position: 'bottom',
68365
68784
  mouseLeaveDelay: dropdown_constants_strings.DEFAULT_LEAVE_DELAY,
68366
- showTick: false
68785
+ showTick: false,
68786
+ closeOnEsc: true,
68787
+ onEscKeyDown: noop_default.a
68367
68788
  };
68368
68789
  /* harmony default export */ var dropdown_0 = (dropdown_Dropdown);
68369
68790
  // CONCATENATED MODULE: ../semi-foundation/grid/constants.ts
@@ -69403,6 +69824,7 @@ label_Label.propTypes = {
69403
69824
 
69404
69825
 
69405
69826
 
69827
+
69406
69828
  var inputGroup_rest = undefined && undefined.__rest || function (s, e) {
69407
69829
  var t = {};
69408
69830
 
@@ -69475,9 +69897,10 @@ class inputGroup_inputGroup extends baseComponent_BaseComponent {
69475
69897
  children,
69476
69898
  label,
69477
69899
  onBlur: groupOnBlur,
69478
- onFocus: groupOnFocus
69900
+ onFocus: groupOnFocus,
69901
+ disabled: groupDisabled
69479
69902
  } = _a,
69480
- rest = inputGroup_rest(_a, ["size", "style", "className", "children", "label", "onBlur", "onFocus"]);
69903
+ rest = inputGroup_rest(_a, ["size", "style", "className", "children", "label", "onBlur", "onFocus", "disabled"]);
69481
69904
 
69482
69905
  const groupCls = classnames_default()("".concat(inputGroup_prefixCls, "-group"), {
69483
69906
  [concat_default()(_context2 = "".concat(inputGroup_prefixCls, "-")).call(_context2, size)]: size !== 'default'
@@ -69491,16 +69914,20 @@ class inputGroup_inputGroup extends baseComponent_BaseComponent {
69491
69914
  if (item) {
69492
69915
  const {
69493
69916
  onBlur: itemOnBlur,
69494
- onFocus: itemOnFocus
69917
+ onFocus: itemOnFocus,
69918
+ disabled: itemDisabled
69495
69919
  } = item.props;
69496
- const onBlur = isFunction_default()(itemOnBlur) ? itemOnBlur : groupOnBlur;
69497
- const onFocus = isFunction_default()(itemOnFocus) ? itemOnFocus : groupOnFocus;
69498
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(item, assign_default()({
69499
- key: index,
69920
+ const onBlur = isFunction_default()(itemOnBlur) && get_default()(itemOnBlur, 'name') !== 'noop' ? itemOnBlur : groupOnBlur;
69921
+ const onFocus = isFunction_default()(itemOnFocus) && get_default()(itemOnFocus, 'name') !== 'noop' ? itemOnFocus : groupOnFocus;
69922
+ const disabled = typeof itemDisabled === 'boolean' ? itemDisabled : groupDisabled;
69923
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(item, assign_default()(assign_default()({
69924
+ key: index
69925
+ }, rest), {
69500
69926
  size,
69501
69927
  onBlur,
69502
- onFocus
69503
- }, rest));
69928
+ onFocus,
69929
+ disabled
69930
+ }));
69504
69931
  }
69505
69932
 
69506
69933
  return null;
@@ -71067,6 +71494,8 @@ var inputNumber_rest = undefined && undefined.__rest || function (s, e) {
71067
71494
  }
71068
71495
  return t;
71069
71496
  };
71497
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
71498
+
71070
71499
  /* eslint-disable @typescript-eslint/no-unused-vars */
71071
71500
 
71072
71501
  /* eslint-disable no-unused-vars */
@@ -71326,7 +71755,8 @@ class inputNumber_InputNumber extends baseComponent_BaseComponent {
71326
71755
 
71327
71756
  componentDidUpdate(prevProps) {
71328
71757
  const {
71329
- value
71758
+ value,
71759
+ preventScroll
71330
71760
  } = this.props;
71331
71761
  const {
71332
71762
  focusing
@@ -71441,7 +71871,9 @@ class inputNumber_InputNumber extends baseComponent_BaseComponent {
71441
71871
 
71442
71872
  if (this.props.keepFocus && this.state.focusing) {
71443
71873
  if (document.activeElement !== this.inputNode) {
71444
- this.inputNode.focus();
71874
+ this.inputNode.focus({
71875
+ preventScroll
71876
+ });
71445
71877
  }
71446
71878
  }
71447
71879
  }
@@ -71551,6 +71983,7 @@ inputNumber_InputNumber.propTypes = {
71551
71983
  prefixCls: prop_types_default.a.string,
71552
71984
  pressInterval: prop_types_default.a.number,
71553
71985
  pressTimeout: prop_types_default.a.number,
71986
+ preventScroll: prop_types_default.a.bool,
71554
71987
  shiftStep: prop_types_default.a.number,
71555
71988
  step: prop_types_default.a.number,
71556
71989
  style: prop_types_default.a.object,
@@ -71564,7 +71997,6 @@ inputNumber_InputNumber.propTypes = {
71564
71997
  onUpClick: prop_types_default.a.func
71565
71998
  };
71566
71999
  inputNumber_InputNumber.defaultProps = {
71567
- disabled: false,
71568
72000
  forwardedRef: noop_default.a,
71569
72001
  innerButtons: false,
71570
72002
  keepFocus: false,
@@ -79321,8 +79753,14 @@ class select_Select extends baseComponent_BaseComponent {
79321
79753
  });
79322
79754
  },
79323
79755
  focusInput: () => {
79756
+ const {
79757
+ preventScroll
79758
+ } = this.props;
79759
+
79324
79760
  if (this.inputRef && this.inputRef.current) {
79325
- this.inputRef.current.focus();
79761
+ this.inputRef.current.focus({
79762
+ preventScroll
79763
+ });
79326
79764
  }
79327
79765
  }
79328
79766
  };
@@ -79474,8 +79912,13 @@ class select_Select extends baseComponent_BaseComponent {
79474
79912
  },
79475
79913
  focusTrigger: () => {
79476
79914
  try {
79915
+ const {
79916
+ preventScroll
79917
+ } = this.props;
79477
79918
  const el = this.triggerRef.current;
79478
- el.focus();
79919
+ el.focus({
79920
+ preventScroll
79921
+ });
79479
79922
  } catch (error) {}
79480
79923
  },
79481
79924
  updateScrollTop: index => {
@@ -80278,7 +80721,8 @@ select_Select.propTypes = {
80278
80721
  virtualize: prop_types_default.a.object,
80279
80722
  renderOptionItem: prop_types_default.a.func,
80280
80723
  onListScroll: prop_types_default.a.func,
80281
- arrowIcon: prop_types_default.a.node // open: PropTypes.bool,
80724
+ arrowIcon: prop_types_default.a.node,
80725
+ preventScroll: prop_types_default.a.bool // open: PropTypes.bool,
80282
80726
  // tagClosable: PropTypes.bool,
80283
80727
 
80284
80728
  };
@@ -82464,7 +82908,12 @@ class radioInner_RadioInner extends baseComponent_BaseComponent {
82464
82908
  }
82465
82909
 
82466
82910
  focus() {
82467
- this.inputEntity.focus();
82911
+ const {
82912
+ preventScroll
82913
+ } = this.props;
82914
+ this.inputEntity.focus({
82915
+ preventScroll
82916
+ });
82468
82917
  }
82469
82918
 
82470
82919
  onChange(e) {
@@ -82535,7 +82984,8 @@ radioInner_RadioInner.propTypes = {
82535
82984
  'aria-label': prop_types_default.a.string,
82536
82985
  focusInner: prop_types_default.a.bool,
82537
82986
  onInputFocus: prop_types_default.a.func,
82538
- onInputBlur: prop_types_default.a.func
82987
+ onInputBlur: prop_types_default.a.func,
82988
+ preventScroll: prop_types_default.a.bool
82539
82989
  };
82540
82990
  radioInner_RadioInner.defaultProps = {
82541
82991
  onChange: noop_default.a,
@@ -82783,7 +83233,8 @@ radio_Radio.propTypes = {
82783
83233
  addonStyle: prop_types_default.a.object,
82784
83234
  addonClassName: prop_types_default.a.string,
82785
83235
  type: prop_types_default.a.oneOf([radio_constants_strings.TYPE_DEFAULT, radio_constants_strings.TYPE_BUTTON, radio_constants_strings.TYPE_CARD, radio_constants_strings.TYPE_PURECARD]),
82786
- 'aria-label': prop_types_default.a.string
83236
+ 'aria-label': prop_types_default.a.string,
83237
+ preventScroll: prop_types_default.a.bool
82787
83238
  };
82788
83239
  radio_Radio.defaultProps = {
82789
83240
  autoFocus: false,
@@ -83007,139 +83458,44 @@ const rating_constants_strings = {
83007
83458
  // EXTERNAL MODULE: ../semi-foundation/rating/rating.scss
83008
83459
  var rating = __webpack_require__("F3GA");
83009
83460
 
83010
- // CONCATENATED MODULE: ./rating/item.tsx
83011
-
83012
-
83013
-
83461
+ // CONCATENATED MODULE: ../semi-foundation/rating/foundation.ts
83014
83462
 
83015
83463
 
83016
83464
 
83017
83465
 
83466
+ /* eslint-disable no-param-reassign */
83018
83467
 
83019
- class rating_item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
83020
- constructor() {
83021
- super(...arguments);
83022
83468
 
83023
- this.onHover = e => {
83024
- const {
83025
- onHover,
83026
- index
83027
- } = this.props;
83028
- onHover(e, index);
83029
- };
83469
+ class foundation_RatingFoundation extends foundation {
83470
+ constructor(adapter) {
83471
+ super(assign_default()(assign_default()({}, foundation_RatingFoundation.defaultAdapter), adapter));
83030
83472
 
83031
- this.onClick = e => {
83473
+ this.handleStarFocusVisible = event => {
83032
83474
  const {
83033
- onClick,
83034
- index
83035
- } = this.props;
83036
- onClick(e, index);
83037
- };
83038
-
83039
- this.onKeyDown = e => {
83475
+ target
83476
+ } = event;
83040
83477
  const {
83041
- onClick,
83042
- index
83043
- } = this.props;
83478
+ count
83479
+ } = this.getProps(); // when rating 0 is focus visible
83044
83480
 
83045
- if (e.keyCode === 13) {
83046
- onClick(e, index);
83481
+ try {
83482
+ if (target.matches(':focus-visible')) {
83483
+ this._adapter.setEmptyStarFocusVisible(true);
83484
+ }
83485
+ } catch (error) {
83486
+ Object(warning["a" /* default */])(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
83047
83487
  }
83048
83488
  };
83049
- }
83050
83489
 
83051
- render() {
83052
- var _context;
83053
-
83054
- const {
83055
- index,
83056
- prefixCls,
83057
- character,
83058
- count,
83059
- value,
83060
- disabled,
83061
- allowHalf,
83062
- focused,
83063
- size
83064
- } = this.props;
83065
- const starValue = index + 1;
83066
- const diff = starValue - value;
83067
- const isFocused = value === 0 && index === 0 && focused; // const isHalf = allowHalf && value + 0.5 === starValue;
83490
+ this.handleStarBlur = event => {
83491
+ const {
83492
+ emptyStarFocusVisible
83493
+ } = this.getStates();
83068
83494
 
83069
- const isHalf = allowHalf && diff < 1 && diff > 0;
83070
- const firstWidth = isHalf ? 1 - diff : 0.5;
83071
- const isFull = starValue <= value;
83072
- const isCustomSize = typeof size === 'number';
83073
- const starCls = classnames_default()(prefixCls, {
83074
- ["".concat(prefixCls, "-focused")]: isFocused,
83075
- ["".concat(prefixCls, "-half")]: isHalf,
83076
- ["".concat(prefixCls, "-full")]: isFull,
83077
- [concat_default()(_context = "".concat(prefixCls, "-")).call(_context, size)]: !isCustomSize
83078
- });
83079
- const sizeStyle = isCustomSize ? {
83080
- width: size,
83081
- height: size,
83082
- fontSize: size
83083
- } : {};
83084
- const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
83085
- const content = character ? character : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconStar, {
83086
- size: iconSize
83087
- });
83088
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
83089
- className: starCls,
83090
- style: assign_default()({}, sizeStyle)
83091
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83092
- onClick: disabled ? null : this.onClick,
83093
- onKeyDown: disabled ? null : this.onKeyDown,
83094
- onMouseMove: disabled ? null : this.onHover,
83095
- role: "radio",
83096
- "aria-checked": value > index ? 'true' : 'false',
83097
- "aria-posinset": index + 1,
83098
- "aria-setsize": count,
83099
- "aria-disabled": disabled,
83100
- "aria-label": "Rating ".concat(index + (isHalf ? 0.5 : 1)),
83101
- "aria-labelledby": this.props['aria-describedby'],
83102
- "aria-describedby": this.props['aria-describedby'],
83103
- tabIndex: 0,
83104
- className: "".concat(prefixCls, "-wrapper")
83105
- }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83106
- className: "".concat(prefixCls, "-first"),
83107
- style: {
83108
- width: "".concat(firstWidth * 100, "%")
83495
+ if (emptyStarFocusVisible) {
83496
+ this._adapter.setEmptyStarFocusVisible(false);
83109
83497
  }
83110
- }, content), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
83111
- className: "".concat(prefixCls, "-second"),
83112
- "x-semi-prop": "character"
83113
- }, content)));
83114
- }
83115
-
83116
- }
83117
- rating_item_Item.propTypes = {
83118
- value: prop_types_default.a.number,
83119
- index: prop_types_default.a.number,
83120
- prefixCls: prop_types_default.a.string,
83121
- allowHalf: prop_types_default.a.bool,
83122
- onHover: prop_types_default.a.func,
83123
- onClick: prop_types_default.a.func,
83124
- character: prop_types_default.a.node,
83125
- focused: prop_types_default.a.bool,
83126
- disabled: prop_types_default.a.bool,
83127
- count: prop_types_default.a.number,
83128
- size: prop_types_default.a.oneOfType([prop_types_default.a.oneOf(rating_constants_strings.SIZE_SET), prop_types_default.a.number]),
83129
- 'aria-describedby': prop_types_default.a.string
83130
- };
83131
- // CONCATENATED MODULE: ../semi-foundation/rating/foundation.ts
83132
-
83133
-
83134
- /* eslint-disable no-param-reassign */
83135
-
83136
- const KeyCode = {
83137
- LEFT: 37,
83138
- RIGHT: 39
83139
- };
83140
- class foundation_RatingFoundation extends foundation {
83141
- constructor(adapter) {
83142
- super(assign_default()(assign_default()({}, foundation_RatingFoundation.defaultAdapter), adapter));
83498
+ };
83143
83499
  }
83144
83500
 
83145
83501
  init() {
@@ -83269,8 +83625,10 @@ class foundation_RatingFoundation extends foundation {
83269
83625
  }
83270
83626
 
83271
83627
  handleKeyDown(event, value) {
83628
+ var _context;
83629
+
83272
83630
  const {
83273
- keyCode
83631
+ key
83274
83632
  } = event;
83275
83633
  const {
83276
83634
  count,
@@ -83280,41 +83638,331 @@ class foundation_RatingFoundation extends foundation {
83280
83638
  const direction = this._adapter.getContext('direction');
83281
83639
 
83282
83640
  const reverse = direction === 'rtl';
83641
+ const step = allowHalf ? 0.5 : 1;
83642
+ let tempValue;
83643
+ let newValue;
83283
83644
 
83284
- if (keyCode === KeyCode.RIGHT && value < count && !reverse) {
83285
- if (allowHalf) {
83286
- value += 0.5;
83287
- } else {
83288
- value += 1;
83645
+ if (key === 'ArrowRight' || key === 'ArrowUp') {
83646
+ tempValue = value + (reverse ? -step : step);
83647
+ } else if (key === 'ArrowLeft' || key === 'ArrowDown') {
83648
+ tempValue = value + (reverse ? step : -step);
83649
+ }
83650
+
83651
+ if (tempValue > count) {
83652
+ newValue = 0;
83653
+ } else if (tempValue < 0) {
83654
+ newValue = count;
83655
+ } else {
83656
+ newValue = tempValue;
83657
+ }
83658
+
83659
+ if (includes_default()(_context = ['ArrowRight', 'ArrowUp', 'ArrowLeft', 'ArrowDown']).call(_context, key)) {
83660
+ this._adapter.notifyKeyDown(event);
83661
+
83662
+ this._adapter.updateValue(newValue);
83663
+
83664
+ this.changeFocusStar(newValue, event);
83665
+ event.preventDefault();
83666
+
83667
+ this._adapter.notifyHoverChange(undefined, null);
83668
+ }
83669
+ }
83670
+
83671
+ changeFocusStar(value, event) {
83672
+ var _context2;
83673
+
83674
+ const {
83675
+ count,
83676
+ allowHalf,
83677
+ preventScroll
83678
+ } = this.getProps();
83679
+ const index = Math.ceil(value) - 1;
83680
+
83681
+ const starElement = map_default()(_context2 = [...event.currentTarget.childNodes]).call(_context2, item => item.childNodes[0].childNodes);
83682
+
83683
+ if (index < 0) {
83684
+ starElement[count][0].focus({
83685
+ preventScroll
83686
+ });
83687
+ } else {
83688
+ starElement[index][allowHalf ? value * 10 % 10 === 5 ? 0 : 1 : 0].focus({
83689
+ preventScroll
83690
+ });
83691
+ }
83692
+ }
83693
+
83694
+ }
83695
+ class foundation_RatingItemFoundation extends foundation {
83696
+ constructor(adapter) {
83697
+ super(assign_default()(assign_default()({}, foundation_RatingItemFoundation.defaultAdapter), adapter));
83698
+
83699
+ this.handleFocusVisible = (event, star) => {
83700
+ const {
83701
+ target
83702
+ } = event; // when rating 0 is focus visible
83703
+
83704
+ try {
83705
+ if (target.matches(':focus-visible')) {
83706
+ if (star === 'first') {
83707
+ this._adapter.setFirstStarFocus(true);
83708
+ } else {
83709
+ this._adapter.setSecondStarFocus(true);
83710
+ }
83711
+ }
83712
+ } catch (error) {
83713
+ Object(warning["a" /* default */])(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
83289
83714
  }
83290
- } else if (keyCode === KeyCode.LEFT && value > 0 && !reverse) {
83291
- if (allowHalf) {
83292
- value -= 0.5;
83715
+ };
83716
+
83717
+ this.handleBlur = (event, star) => {
83718
+ const {
83719
+ firstStarFocus,
83720
+ secondStarFocus
83721
+ } = this.getStates();
83722
+
83723
+ if (star === 'first') {
83724
+ firstStarFocus && this._adapter.setFirstStarFocus(false);
83293
83725
  } else {
83294
- value -= 1;
83726
+ secondStarFocus && this._adapter.setSecondStarFocus(false);
83295
83727
  }
83296
- } else if (keyCode === KeyCode.RIGHT && value > 0 && reverse) {
83297
- if (allowHalf) {
83298
- value -= 0.5;
83299
- } else {
83300
- value -= 1;
83728
+ };
83729
+ }
83730
+
83731
+ }
83732
+ // CONCATENATED MODULE: ./rating/item.tsx
83733
+
83734
+
83735
+
83736
+
83737
+
83738
+
83739
+
83740
+
83741
+
83742
+
83743
+ class rating_item_Item extends baseComponent_BaseComponent {
83744
+ constructor(props) {
83745
+ super(props);
83746
+ this.firstStar = null;
83747
+ this.secondStar = null;
83748
+
83749
+ this.onHover = e => {
83750
+ const {
83751
+ onHover,
83752
+ index
83753
+ } = this.props;
83754
+ onHover(e, index);
83755
+ };
83756
+
83757
+ this.onClick = e => {
83758
+ const {
83759
+ onClick,
83760
+ index
83761
+ } = this.props;
83762
+ onClick(e, index);
83763
+ };
83764
+
83765
+ this.onFocus = (e, star) => {
83766
+ const {
83767
+ onFocus
83768
+ } = this.props;
83769
+ onFocus && onFocus(e);
83770
+ this.foundation.handleFocusVisible(e, star);
83771
+ };
83772
+
83773
+ this.onBlur = (e, star) => {
83774
+ const {
83775
+ onBlur
83776
+ } = this.props;
83777
+ onBlur && onBlur(e);
83778
+ this.foundation.handleBlur(e, star);
83779
+ };
83780
+
83781
+ this.onKeyDown = e => {
83782
+ const {
83783
+ onClick,
83784
+ index
83785
+ } = this.props;
83786
+
83787
+ if (e.keyCode === 13) {
83788
+ onClick(e, index);
83301
83789
  }
83302
- } else if (keyCode === KeyCode.LEFT && value < count && reverse) {
83303
- if (allowHalf) {
83304
- value += 0.5;
83790
+ };
83791
+
83792
+ this.starFocus = () => {
83793
+ const {
83794
+ value,
83795
+ index,
83796
+ preventScroll
83797
+ } = this.props;
83798
+
83799
+ if (value - index === 0.5) {
83800
+ this.firstStar.focus({
83801
+ preventScroll
83802
+ });
83305
83803
  } else {
83306
- value += 1;
83804
+ this.secondStar.focus({
83805
+ preventScroll
83806
+ });
83307
83807
  }
83308
- }
83808
+ };
83309
83809
 
83310
- this._adapter.updateValue(value);
83810
+ this.saveFirstStar = node => {
83811
+ this.firstStar = node;
83812
+ };
83311
83813
 
83312
- event.preventDefault();
83814
+ this.saveSecondStar = node => {
83815
+ this.secondStar = node;
83816
+ };
83313
83817
 
83314
- this._adapter.notifyKeyDown(event);
83818
+ this.state = {
83819
+ firstStarFocus: false,
83820
+ secondStarFocus: false
83821
+ };
83822
+ this.foundation = new foundation_RatingItemFoundation(this.adapter);
83823
+ }
83824
+
83825
+ get adapter() {
83826
+ return assign_default()(assign_default()({}, super.adapter), {
83827
+ setFirstStarFocus: value => {
83828
+ this.setState({
83829
+ firstStarFocus: value
83830
+ });
83831
+ },
83832
+ setSecondStarFocus: value => {
83833
+ this.setState({
83834
+ secondStarFocus: value
83835
+ });
83836
+ }
83837
+ });
83838
+ }
83839
+
83840
+ render() {
83841
+ var _context, _context2, _context3, _context4;
83842
+
83843
+ const {
83844
+ index,
83845
+ prefixCls,
83846
+ character,
83847
+ count,
83848
+ value,
83849
+ disabled,
83850
+ allowHalf,
83851
+ focused,
83852
+ size,
83853
+ ariaLabelPrefix
83854
+ } = this.props;
83855
+ const {
83856
+ firstStarFocus,
83857
+ secondStarFocus
83858
+ } = this.state;
83859
+ const starValue = index + 1;
83860
+ const diff = starValue - value; // const isHalf = allowHalf && value + 0.5 === starValue;
83861
+
83862
+ const isHalf = allowHalf && diff < 1 && diff > 0;
83863
+ const firstWidth = 1 - diff;
83864
+ const isFull = starValue <= value;
83865
+ const isCustomSize = typeof size === 'number';
83866
+ const starCls = classnames_default()(prefixCls, {
83867
+ ["".concat(prefixCls, "-half")]: isHalf,
83868
+ ["".concat(prefixCls, "-full")]: isFull,
83869
+ [concat_default()(_context = "".concat(prefixCls, "-")).call(_context, size)]: !isCustomSize
83870
+ });
83871
+ const sizeStyle = isCustomSize ? {
83872
+ width: size,
83873
+ height: size,
83874
+ fontSize: size
83875
+ } : {};
83876
+ const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
83877
+ const content = character ? character : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconStar, {
83878
+ size: iconSize,
83879
+ style: {
83880
+ display: 'block'
83881
+ }
83882
+ });
83883
+ const isEmpty = index === count;
83884
+ const starWrapCls = classnames_default()("".concat(prefixCls, "-wrapper"), {
83885
+ ["".concat(prefixCls, "-disabled")]: disabled,
83886
+ ["".concat(rating_constants_cssClasses.PREFIX, "-focus")]: (firstStarFocus || secondStarFocus) && value !== 0
83887
+ });
83888
+ const starWrapProps = {
83889
+ onClick: disabled ? null : this.onClick,
83890
+ onKeyDown: disabled ? null : this.onKeyDown,
83891
+ onMouseMove: disabled ? null : this.onHover,
83892
+ className: starWrapCls
83893
+ };
83894
+ const AriaSetSize = allowHalf ? count * 2 + 1 : count + 1;
83895
+ const firstStarProps = {
83896
+ ref: this.saveFirstStar,
83897
+ role: "radio",
83898
+ 'aria-checked': value === index + 0.5,
83899
+ 'aria-posinset': 2 * index + 1,
83900
+ 'aria-setsize': AriaSetSize,
83901
+ 'aria-disabled': disabled,
83902
+ 'aria-label': concat_default()(_context2 = "".concat(index + 0.5, " ")).call(_context2, ariaLabelPrefix, "s"),
83903
+ 'aria-labelledby': this.props['aria-describedby'],
83904
+ 'aria-describedby': this.props['aria-describedby'],
83905
+ className: classnames_default()("".concat(prefixCls, "-first"), "".concat(rating_constants_cssClasses.PREFIX, "-no-focus")),
83906
+ tabIndex: !disabled && value === index + 0.5 ? 0 : -1,
83907
+ onFocus: e => {
83908
+ this.onFocus(e, 'first');
83909
+ },
83910
+ onBlur: e => {
83911
+ this.onBlur(e, 'first');
83912
+ }
83913
+ };
83914
+ const secondStarTabIndex = !disabled && (value === index + 1 || isEmpty && value === 0) ? 0 : -1;
83915
+ const secondStarProps = {
83916
+ ref: this.saveSecondStar,
83917
+ role: "radio",
83918
+ 'aria-checked': isEmpty ? value === 0 : value === index + 1,
83919
+ 'aria-posinset': allowHalf ? 2 * (index + 1) : index + 1,
83920
+ 'aria-setsize': AriaSetSize,
83921
+ 'aria-disabled': disabled,
83922
+ 'aria-label': concat_default()(_context3 = concat_default()(_context4 = "".concat(isEmpty ? 0 : index + 1, " ")).call(_context4, ariaLabelPrefix)).call(_context3, index === 0 ? '' : 's'),
83923
+ 'aria-labelledby': this.props['aria-describedby'],
83924
+ 'aria-describedby': this.props['aria-describedby'],
83925
+ className: classnames_default()("".concat(prefixCls, "-second"), "".concat(rating_constants_cssClasses.PREFIX, "-no-focus")),
83926
+ tabIndex: secondStarTabIndex,
83927
+ onFocus: e => {
83928
+ this.onFocus(e, 'second');
83929
+ },
83930
+ onBlur: e => {
83931
+ this.onBlur(e, 'second');
83932
+ }
83933
+ };
83934
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
83935
+ className: starCls,
83936
+ style: assign_default()({}, sizeStyle),
83937
+ key: index
83938
+ }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, starWrapProps), allowHalf && !isEmpty && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, firstStarProps, {
83939
+ style: {
83940
+ width: "".concat(firstWidth * 100, "%")
83941
+ }
83942
+ }), content), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, secondStarProps, {
83943
+ "x-semi-prop": "character"
83944
+ }), content)));
83315
83945
  }
83316
83946
 
83317
83947
  }
83948
+ rating_item_Item.propTypes = {
83949
+ value: prop_types_default.a.number,
83950
+ index: prop_types_default.a.number,
83951
+ prefixCls: prop_types_default.a.string,
83952
+ allowHalf: prop_types_default.a.bool,
83953
+ onHover: prop_types_default.a.func,
83954
+ onClick: prop_types_default.a.func,
83955
+ character: prop_types_default.a.node,
83956
+ focused: prop_types_default.a.bool,
83957
+ disabled: prop_types_default.a.bool,
83958
+ count: prop_types_default.a.number,
83959
+ ariaLabelPrefix: prop_types_default.a.string,
83960
+ size: prop_types_default.a.oneOfType([prop_types_default.a.oneOf(rating_constants_strings.SIZE_SET), prop_types_default.a.number]),
83961
+ 'aria-describedby': prop_types_default.a.string,
83962
+ onFocus: prop_types_default.a.func,
83963
+ onBlur: prop_types_default.a.func,
83964
+ preventScroll: prop_types_default.a.bool
83965
+ };
83318
83966
  // CONCATENATED MODULE: ./rating/index.tsx
83319
83967
 
83320
83968
 
@@ -83367,11 +84015,14 @@ class rating_Rating extends baseComponent_BaseComponent {
83367
84015
 
83368
84016
  this.focus = () => {
83369
84017
  const {
83370
- disabled
84018
+ disabled,
84019
+ preventScroll
83371
84020
  } = this.props;
83372
84021
 
83373
84022
  if (!disabled) {
83374
- this.rate.focus();
84023
+ this.rate.focus({
84024
+ preventScroll
84025
+ });
83375
84026
  }
83376
84027
  };
83377
84028
 
@@ -83393,13 +84044,96 @@ class rating_Rating extends baseComponent_BaseComponent {
83393
84044
  this.rate = node;
83394
84045
  };
83395
84046
 
84047
+ this.handleStarFocusVisible = event => {
84048
+ this.foundation.handleStarFocusVisible(event);
84049
+ };
84050
+
84051
+ this.handleStarBlur = event => {
84052
+ this.foundation.handleStarBlur(event);
84053
+ };
84054
+
84055
+ this.getAriaLabelPrefix = () => {
84056
+ if (this.props['aria-label']) {
84057
+ return this.props['aria-label'];
84058
+ }
84059
+
84060
+ let prefix = 'star';
84061
+ const {
84062
+ character
84063
+ } = this.props;
84064
+
84065
+ if (typeof character === 'string') {
84066
+ prefix = character;
84067
+ }
84068
+
84069
+ return prefix;
84070
+ };
84071
+
84072
+ this.getItemList = ariaLabelPrefix => {
84073
+ var _context, _context2;
84074
+
84075
+ const {
84076
+ count,
84077
+ allowHalf,
84078
+ prefixCls,
84079
+ disabled,
84080
+ character,
84081
+ size,
84082
+ tooltips
84083
+ } = this.props;
84084
+ const {
84085
+ value,
84086
+ hoverValue,
84087
+ focused
84088
+ } = this.state; // index == count is for Empty rating
84089
+
84090
+ const itemList = map_default()(_context = [...instance_keys_default()(_context2 = Array(count + 1)).call(_context2)]).call(_context, ind => {
84091
+ const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(rating_item_Item, {
84092
+ ref: this.saveRef(ind),
84093
+ index: ind,
84094
+ count: count,
84095
+ prefixCls: "".concat(prefixCls, "-star"),
84096
+ allowHalf: allowHalf,
84097
+ value: hoverValue === undefined ? value : hoverValue,
84098
+ onClick: disabled ? function_noop : this.onClick,
84099
+ onHover: disabled ? function_noop : this.onHover,
84100
+ key: ind,
84101
+ disabled: disabled,
84102
+ character: character,
84103
+ focused: focused,
84104
+ size: ind === count ? 0 : size,
84105
+ ariaLabelPrefix: ariaLabelPrefix,
84106
+ onFocus: disabled || count !== ind ? function_noop : this.handleStarFocusVisible,
84107
+ onBlur: disabled || count !== ind ? function_noop : this.handleStarBlur
84108
+ });
84109
+
84110
+ if (tooltips) {
84111
+ var _context3;
84112
+
84113
+ const text = tooltips[ind] ? tooltips[ind] : '';
84114
+ const showTips = hoverValue - 1 === ind;
84115
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
84116
+ visible: showTips,
84117
+ trigger: "custom",
84118
+ content: text,
84119
+ key: concat_default()(_context3 = "".concat(ind, "-")).call(_context3, showTips)
84120
+ }, content);
84121
+ }
84122
+
84123
+ return content;
84124
+ });
84125
+
84126
+ return itemList;
84127
+ };
84128
+
83396
84129
  const value = props.value === undefined ? props.defaultValue : props.value;
83397
84130
  this.stars = {};
83398
84131
  this.state = {
83399
84132
  value,
83400
84133
  focused: false,
83401
84134
  hoverValue: undefined,
83402
- clearedValue: null
84135
+ clearedValue: null,
84136
+ emptyStarFocusVisible: false
83403
84137
  };
83404
84138
  this.foundation = new foundation_RatingFoundation(this.adapter);
83405
84139
  }
@@ -83418,11 +84152,16 @@ class rating_Rating extends baseComponent_BaseComponent {
83418
84152
  return assign_default()(assign_default()({}, super.adapter), {
83419
84153
  focus: () => {
83420
84154
  const {
83421
- disabled
84155
+ disabled,
84156
+ count
83422
84157
  } = this.props;
84158
+ const {
84159
+ value
84160
+ } = this.state;
83423
84161
 
83424
84162
  if (!disabled) {
83425
- this.rate.focus();
84163
+ const index = Math.ceil(value) - 1;
84164
+ this.stars[index < 0 ? count : index].starFocus();
83426
84165
  }
83427
84166
  },
83428
84167
  getStarDOM: index => {
@@ -83484,6 +84223,11 @@ class rating_Rating extends baseComponent_BaseComponent {
83484
84223
  focused: false
83485
84224
  });
83486
84225
  onKeyDown && onKeyDown(e);
84226
+ },
84227
+ setEmptyStarFocusVisible: focusVisible => {
84228
+ this.setState({
84229
+ emptyStarFocusVisible: focusVisible
84230
+ });
83487
84231
  }
83488
84232
  });
83489
84233
  }
@@ -83497,77 +84241,48 @@ class rating_Rating extends baseComponent_BaseComponent {
83497
84241
  }
83498
84242
 
83499
84243
  render() {
83500
- var _context, _context2;
84244
+ var _context4, _context5, _context6;
83501
84245
 
83502
84246
  const {
83503
- count,
83504
- allowHalf,
83505
84247
  style,
83506
84248
  prefixCls,
83507
84249
  disabled,
83508
84250
  className,
83509
- character,
83510
- tabIndex,
83511
- size,
83512
- tooltips,
83513
- id
84251
+ id,
84252
+ count,
84253
+ tabIndex
83514
84254
  } = this.props;
83515
84255
  const {
83516
84256
  value,
83517
- hoverValue,
83518
- focused
84257
+ emptyStarFocusVisible
83519
84258
  } = this.state;
84259
+ const ariaLabelPrefix = this.getAriaLabelPrefix();
83520
84260
 
83521
- const itemList = map_default()(_context = [...instance_keys_default()(_context2 = Array(count)).call(_context2)]).call(_context, ind => {
83522
- const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(rating_item_Item, {
83523
- ref: this.saveRef(ind),
83524
- index: ind,
83525
- count: count,
83526
- prefixCls: "".concat(prefixCls, "-star"),
83527
- allowHalf: allowHalf,
83528
- value: hoverValue === undefined ? value : hoverValue,
83529
- onClick: this.onClick,
83530
- onHover: this.onHover,
83531
- key: ind,
83532
- disabled: disabled,
83533
- character: character,
83534
- focused: focused,
83535
- size: size
83536
- });
83537
-
83538
- if (tooltips) {
83539
- var _context3;
83540
-
83541
- const text = tooltips[ind] ? tooltips[ind] : '';
83542
- const showTips = hoverValue - 1 === ind;
83543
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
83544
- visible: showTips,
83545
- trigger: "custom",
83546
- content: text,
83547
- key: concat_default()(_context3 = "".concat(ind, "-")).call(_context3, showTips)
83548
- }, content);
83549
- }
83550
-
83551
- return content;
83552
- });
84261
+ const ariaLabel = concat_default()(_context4 = concat_default()(_context5 = concat_default()(_context6 = "Rating: ".concat(value, " of ")).call(_context6, count, " ")).call(_context5, ariaLabelPrefix)).call(_context4, value === 1 ? '' : 's', ",");
83553
84262
 
84263
+ const itemList = this.getItemList(ariaLabelPrefix);
83554
84264
  const listCls = classnames_default()(prefixCls, {
83555
- ["".concat(prefixCls, "-disabled")]: disabled
84265
+ ["".concat(prefixCls, "-disabled")]: disabled,
84266
+ ["".concat(prefixCls, "-focus")]: emptyStarFocusVisible
83556
84267
  }, className);
83557
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
83558
- "aria-label": this.props['aria-label'],
83559
- "aria-labelledby": this.props['aria-labelledby'],
83560
- "aria-describedby": this.props['aria-describedby'],
83561
- className: listCls,
83562
- style: style,
83563
- onMouseLeave: disabled ? null : this.onMouseLeave,
83564
- tabIndex: disabled ? -1 : tabIndex,
83565
- onFocus: disabled ? null : this.onFocus,
83566
- onBlur: disabled ? null : this.onBlur,
83567
- onKeyDown: disabled ? null : this.onKeyDown,
83568
- ref: this.saveRate,
83569
- id: id
83570
- }, itemList);
84268
+ return (
84269
+ /*#__PURE__*/
84270
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
84271
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
84272
+ "aria-label": ariaLabel,
84273
+ "aria-labelledby": this.props['aria-labelledby'],
84274
+ "aria-describedby": this.props['aria-describedby'],
84275
+ className: listCls,
84276
+ style: style,
84277
+ onMouseLeave: disabled ? function_noop : this.onMouseLeave,
84278
+ tabIndex: disabled ? -1 : tabIndex,
84279
+ onFocus: disabled ? function_noop : this.onFocus,
84280
+ onBlur: disabled ? function_noop : this.onBlur,
84281
+ onKeyDown: disabled ? function_noop : this.onKeyDown,
84282
+ ref: this.saveRate,
84283
+ id: id
84284
+ }, itemList)
84285
+ );
83571
84286
  }
83572
84287
 
83573
84288
  }
@@ -83598,7 +84313,8 @@ rating_Rating.propTypes = {
83598
84313
  autoFocus: prop_types_default.a.bool,
83599
84314
  size: prop_types_default.a.oneOfType([prop_types_default.a.oneOf(rating_constants_strings.SIZE_SET), prop_types_default.a.number]),
83600
84315
  tooltips: prop_types_default.a.arrayOf(prop_types_default.a.string),
83601
- id: prop_types_default.a.string
84316
+ id: prop_types_default.a.string,
84317
+ preventScroll: prop_types_default.a.bool
83602
84318
  };
83603
84319
  rating_Rating.defaultProps = {
83604
84320
  defaultValue: 0,
@@ -83609,7 +84325,7 @@ rating_Rating.defaultProps = {
83609
84325
  prefixCls: rating_constants_cssClasses.PREFIX,
83610
84326
  onChange: function_noop,
83611
84327
  onHoverChange: function_noop,
83612
- tabIndex: 0,
84328
+ tabIndex: -1,
83613
84329
  size: 'default'
83614
84330
  };
83615
84331
  // CONCATENATED MODULE: ../semi-foundation/sideSheet/constants.ts
@@ -91869,7 +92585,7 @@ class Body_Body extends baseComponent_BaseComponent {
91869
92585
 
91870
92586
  const listStyle = {
91871
92587
  width: '100%',
91872
- height: y,
92588
+ height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y : 0,
91873
92589
  overflowX: 'auto',
91874
92590
  overflowY: 'auto'
91875
92591
  };
@@ -94403,6 +95119,10 @@ class foundation_TabsFoundation extends foundation {
94403
95119
  this.handleKeyDown = (event, itemKey, closable) => {
94404
95120
  var _context;
94405
95121
 
95122
+ const {
95123
+ preventScroll
95124
+ } = this.getProps();
95125
+
94406
95126
  const tabs = filter_default()(_context = [...event.target.parentNode.childNodes]).call(_context, item => {
94407
95127
  var _context2;
94408
95128
 
@@ -94429,13 +95149,17 @@ class foundation_TabsFoundation extends foundation {
94429
95149
  break;
94430
95150
 
94431
95151
  case "Home":
94432
- tabs[0].focus(); // focus first tab
95152
+ tabs[0].focus({
95153
+ preventScroll
95154
+ }); // focus first tab
94433
95155
 
94434
95156
  this.handlePrevent(event);
94435
95157
  break;
94436
95158
 
94437
95159
  case "End":
94438
- tabs[tabs.length - 1].focus(); // focus last tab
95160
+ tabs[tabs.length - 1].focus({
95161
+ preventScroll
95162
+ }); // focus last tab
94439
95163
 
94440
95164
  this.handlePrevent(event);
94441
95165
  break;
@@ -94530,6 +95254,10 @@ class foundation_TabsFoundation extends foundation {
94530
95254
  }
94531
95255
 
94532
95256
  handleDeleteKeyDown(event, tabs, itemKey, closable) {
95257
+ const {
95258
+ preventScroll
95259
+ } = this.getProps();
95260
+
94533
95261
  if (closable) {
94534
95262
  this.handleTabDelete(itemKey);
94535
95263
 
@@ -94538,12 +95266,18 @@ class foundation_TabsFoundation extends foundation {
94538
95266
 
94539
95267
 
94540
95268
  if (tabs.length !== 1) {
94541
- tabs[index + 1 >= tabs.length ? index - 1 : index + 1].focus();
95269
+ tabs[index + 1 >= tabs.length ? index - 1 : index + 1].focus({
95270
+ preventScroll
95271
+ });
94542
95272
  }
94543
95273
  }
94544
95274
  }
94545
95275
 
94546
95276
  switchTabOnArrowPress(event, tabs) {
95277
+ const {
95278
+ preventScroll
95279
+ } = this.getProps();
95280
+
94547
95281
  const index = index_of_default()(tabs).call(tabs, event.target);
94548
95282
 
94549
95283
  const direction = {
@@ -94556,11 +95290,17 @@ class foundation_TabsFoundation extends foundation {
94556
95290
  if (direction[event.key]) {
94557
95291
  if (index !== undefined) {
94558
95292
  if (tabs[index + direction[event.key]]) {
94559
- tabs[index + direction[event.key]].focus();
95293
+ tabs[index + direction[event.key]].focus({
95294
+ preventScroll
95295
+ });
94560
95296
  } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
94561
- tabs[tabs.length - 1].focus(); // focus last tab
95297
+ tabs[tabs.length - 1].focus({
95298
+ preventScroll
95299
+ }); // focus last tab
94562
95300
  } else if (event.key === "ArrowRight" || event.key == "ArrowDown") {
94563
- tabs[0].focus(); // focus first tab
95301
+ tabs[0].focus({
95302
+ preventScroll
95303
+ }); // focus first tab
94564
95304
  }
94565
95305
  }
94566
95306
  }
@@ -95503,7 +96243,8 @@ tabs_Tabs.propTypes = {
95503
96243
  tabPaneMotion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.object, prop_types_default.a.func]),
95504
96244
  tabPosition: prop_types_default.a.oneOf(tabs_constants_strings.POSITION_MAP),
95505
96245
  type: prop_types_default.a.oneOf(tabs_constants_strings.TYPE_MAP),
95506
- onTabClose: prop_types_default.a.func
96246
+ onTabClose: prop_types_default.a.func,
96247
+ preventScroll: prop_types_default.a.bool
95507
96248
  };
95508
96249
  tabs_Tabs.defaultProps = {
95509
96250
  children: [],
@@ -96459,7 +97200,8 @@ class TimeInput_TimeInput extends baseComponent_BaseComponent {
96459
97200
  componentDidMount() {
96460
97201
  super.componentDidMount();
96461
97202
  const {
96462
- focusOnOpen
97203
+ focusOnOpen,
97204
+ preventScroll
96463
97205
  } = this.props;
96464
97206
 
96465
97207
  if (focusOnOpen) {
@@ -96468,7 +97210,9 @@ class TimeInput_TimeInput extends baseComponent_BaseComponent {
96468
97210
  const inputNode = this.adapter.getCache('inputNode');
96469
97211
 
96470
97212
  if (inputNode) {
96471
- inputNode.focus();
97213
+ inputNode.focus({
97214
+ preventScroll
97215
+ });
96472
97216
  inputNode.select();
96473
97217
  }
96474
97218
  });
@@ -96597,7 +97341,8 @@ TimeInput_TimeInput.propTypes = {
96597
97341
  locale: prop_types_default.a.object,
96598
97342
  localeCode: prop_types_default.a.string,
96599
97343
  insetLabel: prop_types_default.a.node,
96600
- validateStatus: prop_types_default.a.string
97344
+ validateStatus: prop_types_default.a.string,
97345
+ preventScroll: prop_types_default.a.bool
96601
97346
  };
96602
97347
  TimeInput_TimeInput.defaultProps = {
96603
97348
  inputReadOnly: false,
@@ -97080,7 +97825,8 @@ TimePicker_TimePicker.propTypes = assign_default()(assign_default()({
97080
97825
  motion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.func, prop_types_default.a.object]),
97081
97826
  autoAdjustOverflow: prop_types_default.a.bool
97082
97827
  }, PanelShape), {
97083
- inputStyle: prop_types_default.a.object
97828
+ inputStyle: prop_types_default.a.object,
97829
+ preventScroll: prop_types_default.a.bool
97084
97830
  });
97085
97831
  TimePicker_TimePicker.defaultProps = assign_default()({
97086
97832
  autoAdjustOverflow: true,
@@ -98757,7 +99503,6 @@ const TreeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
98757
99503
 
98758
99504
 
98759
99505
 
98760
-
98761
99506
  var treeNode_rest = undefined && undefined.__rest || function (s, e) {
98762
99507
  var t = {};
98763
99508
 
@@ -98778,6 +99523,7 @@ var treeNode_rest = undefined && undefined.__rest || function (s, e) {
98778
99523
 
98779
99524
 
98780
99525
 
99526
+
98781
99527
  const treeNode_prefixcls = tree_constants_cssClasses.PREFIX_OPTION;
98782
99528
  class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
98783
99529
  constructor(props) {
@@ -98997,22 +99743,14 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
98997
99743
  if (isFunction_default()(renderLabel)) {
98998
99744
  return renderLabel(label, data);
98999
99745
  } else if (isString_default()(label) && filtered && keyword && treeNodeFilterProp === 'label') {
99000
- var _context;
99001
-
99002
- const content = [];
99003
-
99004
- for_each_default()(_context = label.split(keyword)).call(_context, (node, index) => {
99005
- if (index > 0) {
99006
- content.push( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
99007
- className: "".concat(treeNode_prefixcls, "-highlight"),
99008
- key: index
99009
- }, keyword));
99746
+ return Object(_utils["d" /* getHighLightTextHTML */])({
99747
+ sourceString: label,
99748
+ searchWords: [keyword],
99749
+ option: {
99750
+ highlightTag: 'span',
99751
+ highlightClassName: "".concat(treeNode_prefixcls, "-highlight")
99010
99752
  }
99011
-
99012
- content.push(node);
99013
99753
  });
99014
-
99015
- return content;
99016
99754
  } else {
99017
99755
  return label;
99018
99756
  }
@@ -99111,7 +99849,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99111
99849
  }
99112
99850
 
99113
99851
  renderEmptyNode() {
99114
- var _context2;
99852
+ var _context;
99115
99853
 
99116
99854
  const {
99117
99855
  emptyContent
@@ -99122,14 +99860,14 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99122
99860
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
99123
99861
  className: wrapperCls
99124
99862
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
99125
- className: concat_default()(_context2 = "".concat(treeNode_prefixcls, "-label ")).call(_context2, treeNode_prefixcls, "-label-empty"),
99863
+ className: concat_default()(_context = "".concat(treeNode_prefixcls, "-label ")).call(_context, treeNode_prefixcls, "-label-empty"),
99126
99864
  "x-semi-prop": "emptyContent"
99127
99865
  }, emptyContent));
99128
99866
  } // eslint-disable-next-line max-lines-per-function
99129
99867
 
99130
99868
 
99131
99869
  render() {
99132
- var _context3;
99870
+ var _context2;
99133
99871
 
99134
99872
  const _a = this.props,
99135
99873
  {
@@ -99167,7 +99905,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99167
99905
  const dragOverGapTop = dragOverNodeKey === eventKey && dropPosition === -1;
99168
99906
  const dragOverGapBottom = dragOverNodeKey === eventKey && dropPosition === 1;
99169
99907
  const nodeCls = classnames_default()(treeNode_prefixcls, {
99170
- [concat_default()(_context3 = "".concat(treeNode_prefixcls, "-level-")).call(_context3, level + 1)]: true,
99908
+ [concat_default()(_context2 = "".concat(treeNode_prefixcls, "-level-")).call(_context2, level + 1)]: true,
99171
99909
  ["".concat(treeNode_prefixcls, "-collapsed")]: !expanded,
99172
99910
  ["".concat(treeNode_prefixcls, "-disabled")]: Boolean(disabled),
99173
99911
  ["".concat(treeNode_prefixcls, "-selected")]: selected,
@@ -99982,8 +100720,14 @@ class tree_Tree extends baseComponent_BaseComponent {
99982
100720
  });
99983
100721
  },
99984
100722
  focusInput: () => {
100723
+ const {
100724
+ preventScroll
100725
+ } = this.props;
100726
+
99985
100727
  if (this.inputRef && this.inputRef.current) {
99986
- this.inputRef.current.focus();
100728
+ this.inputRef.current.focus({
100729
+ preventScroll
100730
+ });
99987
100731
  }
99988
100732
  }
99989
100733
  };
@@ -100289,7 +101033,8 @@ tree_Tree.propTypes = {
100289
101033
  onDrop: prop_types_default.a.func,
100290
101034
  labelEllipsis: prop_types_default.a.bool,
100291
101035
  checkRelation: prop_types_default.a.string,
100292
- 'aria-label': prop_types_default.a.string
101036
+ 'aria-label': prop_types_default.a.string,
101037
+ preventScroll: prop_types_default.a.bool
100293
101038
  };
100294
101039
  tree_Tree.defaultProps = {
100295
101040
  showClear: true,
@@ -100649,8 +101394,12 @@ class foundation_TreeSelectFoundation extends foundation {
100649
101394
  const isDisabled = this._isDisabled();
100650
101395
 
100651
101396
  const {
100652
- isOpen
101397
+ isOpen,
101398
+ inputValue
100653
101399
  } = this.getStates();
101400
+ const {
101401
+ searchPosition
101402
+ } = this.getProps();
100654
101403
 
100655
101404
  if (isDisabled) {
100656
101405
  return;
@@ -100659,6 +101408,10 @@ class foundation_TreeSelectFoundation extends foundation {
100659
101408
 
100660
101409
  this._notifyFocus(e);
100661
101410
  } else if (isOpen) {
101411
+ if (searchPosition === 'trigger' && inputValue) {
101412
+ return;
101413
+ }
101414
+
100662
101415
  this.close(e);
100663
101416
  }
100664
101417
  }
@@ -101535,6 +102288,14 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
101535
102288
  };
101536
102289
 
101537
102290
  this.search = value => {
102291
+ const {
102292
+ isOpen
102293
+ } = this.state;
102294
+
102295
+ if (!isOpen) {
102296
+ this.foundation.open();
102297
+ }
102298
+
101538
102299
  this.foundation.handleInputChange(value);
101539
102300
  };
101540
102301
 
@@ -102526,7 +103287,6 @@ treeSelect_TreeSelect.defaultProps = {
102526
103287
  motionExpand: true,
102527
103288
  expandAll: false,
102528
103289
  zIndex: constants_numbers.DEFAULT_Z_INDEX,
102529
- disabled: false,
102530
103290
  disableStrictly: false,
102531
103291
  multiple: false,
102532
103292
  filterTreeNode: false,