@douyinfe/semi-ui 2.14.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) 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/__test__/datePicker.test.js +1 -0
  8. package/datePicker/_story/v2/FixTriggerRender.tsx +36 -0
  9. package/datePicker/_story/v2/index.js +1 -0
  10. package/datePicker/datePicker.tsx +7 -5
  11. package/dist/css/semi.css +39 -11
  12. package/dist/css/semi.min.css +1 -1
  13. package/dist/umd/semi-ui.js +1150 -346
  14. package/dist/umd/semi-ui.js.map +1 -1
  15. package/dist/umd/semi-ui.min.js +1 -1
  16. package/dist/umd/semi-ui.min.js.map +1 -1
  17. package/dropdown/context.ts +2 -0
  18. package/dropdown/dropdownItem.tsx +2 -1
  19. package/dropdown/dropdownMenu.tsx +24 -1
  20. package/dropdown/index.tsx +10 -2
  21. package/form/_story/form.stories.tsx +23 -15
  22. package/form/hoc/withField.tsx +1 -1
  23. package/form/interface.ts +1 -1
  24. package/input/__test__/input.test.js +31 -0
  25. package/input/_story/input.stories.js +24 -1
  26. package/input/index.tsx +5 -2
  27. package/input/inputGroup.tsx +7 -6
  28. package/inputNumber/index.tsx +5 -3
  29. package/lib/cjs/autoComplete/index.d.ts +0 -1
  30. package/lib/cjs/autoComplete/index.js +0 -1
  31. package/lib/cjs/cascader/index.d.ts +1 -1
  32. package/lib/cjs/cascader/index.js +36 -9
  33. package/lib/cjs/checkbox/checkbox.d.ts +1 -0
  34. package/lib/cjs/checkbox/checkbox.js +2 -1
  35. package/lib/cjs/checkbox/checkboxInner.d.ts +2 -0
  36. package/lib/cjs/checkbox/checkboxInner.js +8 -2
  37. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  38. package/lib/cjs/datePicker/datePicker.js +21 -6
  39. package/lib/cjs/dropdown/context.d.ts +2 -0
  40. package/lib/cjs/dropdown/dropdownItem.js +3 -1
  41. package/lib/cjs/dropdown/dropdownMenu.d.ts +18 -1
  42. package/lib/cjs/dropdown/dropdownMenu.js +23 -2
  43. package/lib/cjs/dropdown/index.d.ts +4 -0
  44. package/lib/cjs/dropdown/index.js +13 -5
  45. package/lib/cjs/form/baseForm.d.ts +16 -15
  46. package/lib/cjs/form/field.d.ts +16 -15
  47. package/lib/cjs/form/hoc/withField.d.ts +1 -1
  48. package/lib/cjs/form/interface.d.ts +1 -1
  49. package/lib/cjs/input/index.d.ts +2 -1
  50. package/lib/cjs/input/index.js +11 -5
  51. package/lib/cjs/input/inputGroup.js +16 -9
  52. package/lib/cjs/inputNumber/index.d.ts +1 -0
  53. package/lib/cjs/inputNumber/index.js +8 -3
  54. package/lib/cjs/locale/source/de.d.ts +3 -0
  55. package/lib/cjs/locale/source/de.js +165 -0
  56. package/lib/cjs/locale/source/fr.d.ts +3 -0
  57. package/lib/cjs/locale/source/fr.js +165 -0
  58. package/lib/cjs/locale/source/it.d.ts +3 -0
  59. package/lib/cjs/locale/source/it.js +165 -0
  60. package/lib/cjs/modal/ModalContent.d.ts +1 -0
  61. package/lib/cjs/modal/ModalContent.js +17 -4
  62. package/lib/cjs/modal/confirm.d.ts +5 -0
  63. package/lib/cjs/radio/radio.d.ts +2 -0
  64. package/lib/cjs/radio/radio.js +2 -1
  65. package/lib/cjs/radio/radioInner.d.ts +2 -0
  66. package/lib/cjs/radio/radioInner.js +8 -2
  67. package/lib/cjs/rating/index.d.ts +7 -0
  68. package/lib/cjs/rating/index.js +135 -68
  69. package/lib/cjs/rating/item.d.ts +27 -3
  70. package/lib/cjs/rating/item.js +145 -38
  71. package/lib/cjs/select/index.d.ts +2 -0
  72. package/lib/cjs/select/index.js +15 -3
  73. package/lib/cjs/table/Body/index.js +1 -1
  74. package/lib/cjs/tabs/index.d.ts +1 -0
  75. package/lib/cjs/tabs/index.js +2 -1
  76. package/lib/cjs/tabs/interface.d.ts +1 -0
  77. package/lib/cjs/tag/index.js +4 -5
  78. package/lib/cjs/tag/interface.d.ts +1 -0
  79. package/lib/cjs/tagInput/index.d.ts +2 -0
  80. package/lib/cjs/tagInput/index.js +19 -5
  81. package/lib/cjs/timePicker/TimeInput.d.ts +2 -1
  82. package/lib/cjs/timePicker/TimeInput.js +7 -3
  83. package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
  84. package/lib/cjs/timePicker/TimePicker.js +2 -1
  85. package/lib/cjs/timePicker/index.d.ts +1 -0
  86. package/lib/cjs/tooltip/index.d.ts +2 -0
  87. package/lib/cjs/tooltip/index.js +12 -4
  88. package/lib/cjs/tree/index.d.ts +1 -0
  89. package/lib/cjs/tree/index.js +21 -5
  90. package/lib/cjs/tree/treeNode.js +15 -19
  91. package/lib/cjs/treeSelect/index.js +20 -4
  92. package/lib/es/autoComplete/index.d.ts +0 -1
  93. package/lib/es/autoComplete/index.js +0 -1
  94. package/lib/es/cascader/index.d.ts +1 -1
  95. package/lib/es/cascader/index.js +36 -9
  96. package/lib/es/checkbox/checkbox.d.ts +1 -0
  97. package/lib/es/checkbox/checkbox.js +2 -1
  98. package/lib/es/checkbox/checkboxInner.d.ts +2 -0
  99. package/lib/es/checkbox/checkboxInner.js +8 -2
  100. package/lib/es/datePicker/datePicker.d.ts +1 -1
  101. package/lib/es/datePicker/datePicker.js +21 -6
  102. package/lib/es/dropdown/context.d.ts +2 -0
  103. package/lib/es/dropdown/dropdownItem.js +3 -1
  104. package/lib/es/dropdown/dropdownMenu.d.ts +18 -1
  105. package/lib/es/dropdown/dropdownMenu.js +21 -2
  106. package/lib/es/dropdown/index.d.ts +4 -0
  107. package/lib/es/dropdown/index.js +13 -5
  108. package/lib/es/form/baseForm.d.ts +16 -15
  109. package/lib/es/form/field.d.ts +16 -15
  110. package/lib/es/form/hoc/withField.d.ts +1 -1
  111. package/lib/es/form/interface.d.ts +1 -1
  112. package/lib/es/input/index.d.ts +2 -1
  113. package/lib/es/input/index.js +11 -5
  114. package/lib/es/input/inputGroup.js +15 -9
  115. package/lib/es/inputNumber/index.d.ts +1 -0
  116. package/lib/es/inputNumber/index.js +8 -3
  117. package/lib/es/locale/source/de.d.ts +3 -0
  118. package/lib/es/locale/source/de.js +153 -0
  119. package/lib/es/locale/source/fr.d.ts +3 -0
  120. package/lib/es/locale/source/fr.js +153 -0
  121. package/lib/es/locale/source/it.d.ts +3 -0
  122. package/lib/es/locale/source/it.js +153 -0
  123. package/lib/es/modal/ModalContent.d.ts +1 -0
  124. package/lib/es/modal/ModalContent.js +17 -4
  125. package/lib/es/modal/confirm.d.ts +5 -0
  126. package/lib/es/radio/radio.d.ts +2 -0
  127. package/lib/es/radio/radio.js +2 -1
  128. package/lib/es/radio/radioInner.d.ts +2 -0
  129. package/lib/es/radio/radioInner.js +8 -2
  130. package/lib/es/rating/index.d.ts +7 -0
  131. package/lib/es/rating/index.js +133 -65
  132. package/lib/es/rating/item.d.ts +27 -3
  133. package/lib/es/rating/item.js +145 -32
  134. package/lib/es/select/index.d.ts +2 -0
  135. package/lib/es/select/index.js +15 -3
  136. package/lib/es/table/Body/index.js +1 -1
  137. package/lib/es/tabs/index.d.ts +1 -0
  138. package/lib/es/tabs/index.js +2 -1
  139. package/lib/es/tabs/interface.d.ts +1 -0
  140. package/lib/es/tag/index.js +4 -5
  141. package/lib/es/tag/interface.d.ts +1 -0
  142. package/lib/es/tagInput/index.d.ts +2 -0
  143. package/lib/es/tagInput/index.js +19 -5
  144. package/lib/es/timePicker/TimeInput.d.ts +2 -1
  145. package/lib/es/timePicker/TimeInput.js +7 -3
  146. package/lib/es/timePicker/TimePicker.d.ts +2 -0
  147. package/lib/es/timePicker/TimePicker.js +2 -1
  148. package/lib/es/timePicker/index.d.ts +1 -0
  149. package/lib/es/tooltip/index.d.ts +2 -0
  150. package/lib/es/tooltip/index.js +13 -4
  151. package/lib/es/tree/index.d.ts +1 -0
  152. package/lib/es/tree/index.js +19 -5
  153. package/lib/es/tree/treeNode.js +14 -20
  154. package/lib/es/treeSelect/index.js +18 -4
  155. package/locale/source/de.ts +156 -0
  156. package/locale/source/fr.ts +156 -0
  157. package/locale/source/it.ts +156 -0
  158. package/modal/ModalContent.tsx +7 -4
  159. package/package.json +8 -8
  160. package/radio/radio.tsx +2 -0
  161. package/radio/radioInner.tsx +4 -1
  162. package/rating/__test__/rating.test.js +13 -31
  163. package/rating/_story/rating.stories.js +13 -2
  164. package/rating/index.tsx +63 -18
  165. package/rating/item.tsx +141 -26
  166. package/select/index.tsx +6 -2
  167. package/table/Body/index.tsx +1 -1
  168. package/table/_story/v2/FixedVirtualizedEmpty.tsx +76 -0
  169. package/table/_story/v2/index.js +2 -1
  170. package/tabs/index.tsx +1 -0
  171. package/tabs/interface.ts +1 -0
  172. package/tag/index.tsx +2 -3
  173. package/tag/interface.ts +1 -0
  174. package/tagInput/index.tsx +8 -4
  175. package/timePicker/TimeInput.tsx +5 -3
  176. package/timePicker/TimePicker.tsx +2 -0
  177. package/tooltip/index.tsx +7 -2
  178. package/tree/index.tsx +13 -2
  179. package/tree/treeNode.tsx +11 -13
  180. package/treeSelect/_story/treeSelect.stories.js +38 -1
  181. package/treeSelect/index.tsx +13 -3
  182. 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,
@@ -57616,6 +57830,7 @@ function getInsetInputValueFromInsetInputStr(options) {
57616
57830
 
57617
57831
 
57618
57832
 
57833
+
57619
57834
 
57620
57835
  /* eslint-disable no-nested-ternary */
57621
57836
 
@@ -57736,6 +57951,27 @@ class foundation_DatePickerFoundation extends foundation {
57736
57951
  this._adapter.updateValue(result);
57737
57952
 
57738
57953
  this.resetCachedSelectedValue(result);
57954
+ this.initRangeInputFocus(result);
57955
+
57956
+ if (this._adapter.needConfirm()) {
57957
+ this._adapter.updateCachedSelectedValue(result);
57958
+ }
57959
+ }
57960
+ /**
57961
+ * 如果用户传了一个空的 value,需要把 range input focus 设置为 rangeStart,这样用户可以清除完之后继续从开始选择
57962
+ *
57963
+ * If the user passes an empty value, you need to set the range input focus to rangeStart, so that the user can continue to select from the beginning after clearing
57964
+ */
57965
+
57966
+
57967
+ initRangeInputFocus(result) {
57968
+ const {
57969
+ triggerRender
57970
+ } = this.getProps();
57971
+
57972
+ if (this._isRangeType() && isFunction_default()(triggerRender) && result.length === 0) {
57973
+ this._adapter.setRangeInputFocus('rangeStart');
57974
+ }
57739
57975
  }
57740
57976
 
57741
57977
  parseWithTimezone(value, timeZone, prevTimeZone) {
@@ -58993,7 +59229,8 @@ class foundation_DatePickerFoundation extends foundation {
58993
59229
 
58994
59230
  handleTriggerWrapperClick(e) {
58995
59231
  const {
58996
- disabled
59232
+ disabled,
59233
+ triggerRender
58997
59234
  } = this._adapter.getProps();
58998
59235
 
58999
59236
  const {
@@ -59012,12 +59249,19 @@ class foundation_DatePickerFoundation extends foundation {
59012
59249
  */
59013
59250
 
59014
59251
 
59015
- if (this._isRangeType() && !rangeInputFocus && this._adapter.isEventTarget(e)) {
59016
- set_timeout_default()(() => {
59017
- // using setTimeout get correct state value 'rangeInputFocus'
59018
- this.handleInputFocus(e, 'rangeStart');
59019
- this.openPanel();
59020
- }, 0);
59252
+ if (this._isRangeType() && !rangeInputFocus) {
59253
+ if (this._adapter.isEventTarget(e)) {
59254
+ set_timeout_default()(() => {
59255
+ // using setTimeout get correct state value 'rangeInputFocus'
59256
+ this.handleInputFocus(e, 'rangeStart');
59257
+ }, 0);
59258
+ } else if (isFunction_default()(triggerRender)) {
59259
+ // 如果是 triggerRender 场景,因为没有 input,因此打开面板时默认 focus 在 rangeStart
59260
+ // If it is a triggerRender scene, because there is no input, the default focus is rangeStart when the panel is opened
59261
+ this._adapter.setRangeInputFocus('rangeStart');
59262
+ }
59263
+
59264
+ this.openPanel();
59021
59265
  } else {
59022
59266
  this.openPanel();
59023
59267
  }
@@ -60615,7 +60859,6 @@ const getMonthTable = (month, weekStartsOn) => {
60615
60859
 
60616
60860
 
60617
60861
 
60618
-
60619
60862
  /* eslint-disable max-len */
60620
60863
 
60621
60864
 
@@ -61404,11 +61647,10 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
61404
61647
  /**
61405
61648
  * no need to check focus then
61406
61649
  * - dateRange and isDateRangeAndHasOffset
61407
- * - dateRange and triggerRender
61408
61650
  */
61409
61651
 
61410
61652
 
61411
- const needCheckFocusRecord = !(type === 'dateRange' && (isDateRangeAndHasOffset || isFunction_default()(triggerRender)));
61653
+ const needCheckFocusRecord = !(type === 'dateRange' && isDateRangeAndHasOffset);
61412
61654
 
61413
61655
  this._adapter.notifySelectedChange(date, {
61414
61656
  needCheckFocusRecord
@@ -65565,6 +65807,10 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65565
65807
  motionEnd
65566
65808
  }),
65567
65809
  setRangeInputFocus: rangeInputFocus => {
65810
+ const {
65811
+ preventScroll
65812
+ } = this.props;
65813
+
65568
65814
  if (rangeInputFocus !== this.state.rangeInputFocus) {
65569
65815
  this.setState({
65570
65816
  rangeInputFocus
@@ -65575,7 +65821,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65575
65821
  case 'rangeStart':
65576
65822
  const inputStartNode = get_default()(this, 'rangeInputStartRef.current');
65577
65823
 
65578
- inputStartNode && inputStartNode.focus();
65824
+ inputStartNode && inputStartNode.focus({
65825
+ preventScroll
65826
+ });
65579
65827
  /**
65580
65828
  * 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
65581
65829
  * 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
@@ -65599,7 +65847,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65599
65847
  case 'rangeEnd':
65600
65848
  const inputEndNode = get_default()(this, 'rangeInputEndRef.current');
65601
65849
 
65602
- inputEndNode && inputEndNode.focus();
65850
+ inputEndNode && inputEndNode.focus({
65851
+ preventScroll
65852
+ });
65603
65853
  /**
65604
65854
  * 解决选择完startDate,切换到endDate后panel被立马关闭的问题。
65605
65855
  * 用户打开panel,选了startDate后,会执行setRangeInputFocus('rangeEnd'),focus到endDateInput,
@@ -65627,6 +65877,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65627
65877
  couldPanelClosed: () => this.focusRecordsRef.current.rangeStart && this.focusRecordsRef.current.rangeEnd,
65628
65878
  isEventTarget: e => e && e.target === e.currentTarget,
65629
65879
  setInsetInputFocus: () => {
65880
+ const {
65881
+ preventScroll
65882
+ } = this.props;
65630
65883
  const {
65631
65884
  rangeInputFocus
65632
65885
  } = this.state;
@@ -65636,7 +65889,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65636
65889
  if (document.activeElement !== this.rangeInputEndRef.current) {
65637
65890
  const inputEndNode = get_default()(this, 'rangeInputEndRef.current');
65638
65891
 
65639
- inputEndNode && inputEndNode.focus();
65892
+ inputEndNode && inputEndNode.focus({
65893
+ preventScroll
65894
+ });
65640
65895
  }
65641
65896
 
65642
65897
  break;
@@ -65646,7 +65901,9 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
65646
65901
  if (document.activeElement !== this.rangeInputStartRef.current) {
65647
65902
  const inputStartNode = get_default()(this, 'rangeInputStartRef.current');
65648
65903
 
65649
- inputStartNode && inputStartNode.focus();
65904
+ inputStartNode && inputStartNode.focus({
65905
+ preventScroll
65906
+ });
65650
65907
  }
65651
65908
 
65652
65909
  break;
@@ -65961,7 +66218,8 @@ datePicker_DatePicker.propTypes = {
65961
66218
  syncSwitchMonth: prop_types_default.a.bool,
65962
66219
  // Callback function for panel date switching
65963
66220
  onPanelChange: prop_types_default.a.func,
65964
- rangeSeparator: prop_types_default.a.string
66221
+ rangeSeparator: prop_types_default.a.string,
66222
+ preventScroll: prop_types_default.a.bool
65965
66223
  };
65966
66224
  datePicker_DatePicker.defaultProps = {
65967
66225
  onChangeWithDateFirst: true,
@@ -65974,7 +66232,6 @@ datePicker_DatePicker.defaultProps = {
65974
66232
  type: 'date',
65975
66233
  size: 'default',
65976
66234
  density: 'default',
65977
- disabled: false,
65978
66235
  multiple: false,
65979
66236
  defaultOpen: false,
65980
66237
  disabledHours: noop_default.a,
@@ -66648,7 +66905,12 @@ class FocusHandle_FocusTrapHandle {
66648
66905
  };
66649
66906
 
66650
66907
  this.focusElement = (element, event) => {
66651
- element === null || element === void 0 ? void 0 : element.focus();
66908
+ const {
66909
+ preventScroll
66910
+ } = this.options;
66911
+ element === null || element === void 0 ? void 0 : element.focus({
66912
+ preventScroll
66913
+ });
66652
66914
  event.preventDefault(); // prevent browser default tab move behavior
66653
66915
  };
66654
66916
 
@@ -67003,17 +67265,24 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
67003
67265
  modalDialogFocus: () => {
67004
67266
  var _a, _b, _c;
67005
67267
 
67268
+ const {
67269
+ preventScroll
67270
+ } = this.props;
67006
67271
  let activeElementInDialog;
67007
67272
 
67008
67273
  if (this.modalDialogRef) {
67009
67274
  const activeElement = FocusHandle.getActiveElement();
67010
67275
  activeElementInDialog = this.modalDialogRef.current.contains(activeElement);
67011
67276
  (_a = this.focusTrapHandle) === null || _a === void 0 ? void 0 : _a.destroy();
67012
- this.focusTrapHandle = new FocusHandle(this.modalDialogRef.current);
67277
+ this.focusTrapHandle = new FocusHandle(this.modalDialogRef.current, {
67278
+ preventScroll
67279
+ });
67013
67280
  }
67014
67281
 
67015
67282
  if (!activeElementInDialog) {
67016
- (_c = (_b = this.modalDialogRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.focus();
67283
+ (_c = (_b = this.modalDialogRef) === null || _b === void 0 ? void 0 : _b.current) === null || _c === void 0 ? void 0 : _c.focus({
67284
+ preventScroll
67285
+ });
67017
67286
  }
67018
67287
  },
67019
67288
  modalDialogBlur: () => {
@@ -67026,10 +67295,15 @@ class ModalContent_ModalContent extends baseComponent_BaseComponent {
67026
67295
  const {
67027
67296
  prevFocusElement
67028
67297
  } = this.state;
67298
+ const {
67299
+ preventScroll
67300
+ } = this.props;
67029
67301
 
67030
67302
  const focus = get_default()(prevFocusElement, 'focus');
67031
67303
 
67032
- isFunction_default()(focus) && prevFocusElement.focus();
67304
+ isFunction_default()(focus) && prevFocusElement.focus({
67305
+ preventScroll
67306
+ });
67033
67307
  }
67034
67308
  });
67035
67309
  }
@@ -67083,7 +67357,8 @@ ModalContent_ModalContent.propTypes = {
67083
67357
  getContainerContext: prop_types_default.a.func,
67084
67358
  contentClassName: prop_types_default.a.string,
67085
67359
  maskClassName: prop_types_default.a.string,
67086
- onAnimationEnd: prop_types_default.a.func
67360
+ onAnimationEnd: prop_types_default.a.func,
67361
+ preventScroll: prop_types_default.a.bool
67087
67362
  };
67088
67363
  ModalContent_ModalContent.defaultProps = {
67089
67364
  close: noop_default.a,
@@ -67864,6 +68139,9 @@ const dropdown_constants_numbers = {
67864
68139
 
67865
68140
  // CONCATENATED MODULE: ../semi-foundation/dropdown/foundation.ts
67866
68141
 
68142
+
68143
+
68144
+
67867
68145
  class foundation_DropdownFoundation extends foundation {
67868
68146
  handleVisibleChange(visible) {
67869
68147
  this._adapter.setPopVisible(visible);
@@ -67871,7 +68149,155 @@ class foundation_DropdownFoundation extends foundation {
67871
68149
  this._adapter.notifyVisibleChange(visible);
67872
68150
  }
67873
68151
 
68152
+ getMenuItemNodes(target) {
68153
+ var _context;
68154
+
68155
+ const id = target.attributes['data-popupid'].value;
68156
+ const menuWrapper = document.getElementById(id); // if has dropdown item, the item must wrapped by li
68157
+
68158
+ return menuWrapper ? filter_default()(_context = from_default()(menuWrapper.getElementsByTagName('li'))).call(_context, item => item.ariaDisabled === "false") : null;
68159
+ }
68160
+
68161
+ setFocusToFirstMenuItem(target) {
68162
+ const menuItemNodes = this.getMenuItemNodes(target);
68163
+ menuItemNodes && setFocusToFirstItem(menuItemNodes);
68164
+ }
68165
+
68166
+ setFocusToLastMenuItem(target) {
68167
+ const menuItemNodes = this.getMenuItemNodes(target);
68168
+ menuItemNodes && setFocusToLastItem(menuItemNodes);
68169
+ }
68170
+
68171
+ handleKeyDown(event) {
68172
+ switch (event.key) {
68173
+ case ' ':
68174
+ case 'Enter':
68175
+ event.target.click();
68176
+ handlePrevent(event);
68177
+ break;
68178
+
68179
+ case 'ArrowDown':
68180
+ this.setFocusToFirstMenuItem(event.target);
68181
+ handlePrevent(event);
68182
+ break;
68183
+
68184
+ case 'ArrowUp':
68185
+ this.setFocusToLastMenuItem(event.target);
68186
+ handlePrevent(event);
68187
+ break;
68188
+
68189
+ default:
68190
+ break;
68191
+ }
68192
+ }
68193
+
68194
+ }
68195
+ // CONCATENATED MODULE: ../semi-foundation/dropdown/menuFoundation.ts
68196
+
68197
+
68198
+
68199
+
68200
+
68201
+
68202
+ class menuFoundation_DropdownMenuFoundation extends foundation {
68203
+ constructor() {
68204
+ super(...arguments);
68205
+ this.menuItemNodes = null;
68206
+ this.firstChars = [];
68207
+ } // if trigger is click, auto focus to the first menu item
68208
+
68209
+
68210
+ autoFocus(ulElement) {
68211
+ const trigger = this._adapter.getContext('trigger');
68212
+
68213
+ if (trigger === 'click') {
68214
+ var _context;
68215
+
68216
+ // find all non-disabled li under this menu and set focus to the first menu
68217
+ this.menuItemNodes = filter_default()(_context = [...ulElement.getElementsByTagName('li')]).call(_context, item => item.ariaDisabled !== "true");
68218
+ setFocusToFirstItem(this.menuItemNodes);
68219
+ }
68220
+ }
68221
+
68222
+ handleEscape(menu) {
68223
+ const trigger = this._adapter.getContext('trigger');
68224
+
68225
+ if (trigger === 'custom') {
68226
+ const menuButton = menu && getMenuButton(document.querySelectorAll("[data-popupid]"), menu.id);
68227
+ menuButton.focus();
68228
+ }
68229
+ }
68230
+
68231
+ setFocusByFirstCharacter(curItem, char) {
68232
+ const index = findIndexByCharacter(this.menuItemNodes, curItem, this.firstChars, char);
68233
+
68234
+ if (index >= 0) {
68235
+ setFocusToItem(this.menuItemNodes, this.menuItemNodes[index]);
68236
+ }
68237
+ }
68238
+
68239
+ onMenuKeydown(event) {
68240
+ var _context5;
68241
+
68242
+ const menu = getAncestorNodeByRole(event.target, 'tooltip');
68243
+
68244
+ if (!this.menuItemNodes) {
68245
+ var _context2;
68246
+
68247
+ this.menuItemNodes = filter_default()(_context2 = [...event.target.parentNode.getElementsByTagName('li')]).call(_context2, item => item.ariaDisabled !== "true");
68248
+ }
68249
+
68250
+ if (this.firstChars.length === 0) {
68251
+ var _context3;
68252
+
68253
+ for_each_default()(_context3 = this.menuItemNodes).call(_context3, item => {
68254
+ var _context4;
68255
+
68256
+ this.firstChars.push(trim_default()(_context4 = item.textContent).call(_context4)[0].toLowerCase());
68257
+ });
68258
+ } // get the currently focused menu item
68259
+
68260
+
68261
+ const curItem = find_default()(_context5 = this.menuItemNodes).call(_context5, item => item.tabIndex === 0);
68262
+
68263
+ switch (event.key) {
68264
+ case ' ':
68265
+ case 'Enter':
68266
+ event.target.click();
68267
+ handlePrevent(event);
68268
+ break;
68269
+
68270
+ case 'Escape':
68271
+ this.handleEscape(menu);
68272
+ break;
68273
+
68274
+ case 'ArrowUp':
68275
+ setFocusToPreviousMenuItem(this.menuItemNodes, curItem);
68276
+ handlePrevent(event);
68277
+ break;
68278
+
68279
+ case 'ArrowDown':
68280
+ setFocusToNextMenuitem(this.menuItemNodes, curItem);
68281
+ handlePrevent(event);
68282
+ break;
68283
+
68284
+ default:
68285
+ if (isPrintableCharacter(event.key)) {
68286
+ this.setFocusByFirstCharacter(curItem, event.key);
68287
+ handlePrevent(event);
68288
+ }
68289
+
68290
+ break;
68291
+ }
68292
+ }
68293
+
67874
68294
  }
68295
+ // CONCATENATED MODULE: ./dropdown/context.ts
68296
+
68297
+ const DropdownContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createContext({
68298
+ level: 0
68299
+ });
68300
+ /* harmony default export */ var dropdown_context = (DropdownContext);
67875
68301
  // CONCATENATED MODULE: ./dropdown/dropdownMenu.tsx
67876
68302
 
67877
68303
 
@@ -67893,9 +68319,25 @@ var dropdownMenu_rest = undefined && undefined.__rest || function (s, e) {
67893
68319
 
67894
68320
 
67895
68321
 
68322
+
68323
+
67896
68324
  const dropdownMenu_prefixCls = dropdown_constants_cssClasses.PREFIX;
67897
68325
 
67898
68326
  class dropdownMenu_DropdownMenu extends baseComponent_BaseComponent {
68327
+ constructor(props) {
68328
+ super(props);
68329
+ this.menuRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
68330
+ this.foundation = new menuFoundation_DropdownMenuFoundation(this.adapter);
68331
+ }
68332
+
68333
+ get adapter() {
68334
+ return assign_default()({}, super.adapter);
68335
+ }
68336
+
68337
+ componentDidMount() {
68338
+ this.foundation.autoFocus(this.menuRef.current);
68339
+ }
68340
+
67899
68341
  render() {
67900
68342
  const _a = this.props,
67901
68343
  {
@@ -67907,10 +68349,12 @@ class dropdownMenu_DropdownMenu extends baseComponent_BaseComponent {
67907
68349
 
67908
68350
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", assign_default()({
67909
68351
  role: "menu",
67910
- "aria-orientation": "vertical"
68352
+ "aria-orientation": "vertical",
68353
+ ref: this.menuRef
67911
68354
  }, rest, {
67912
68355
  className: classnames_default()("".concat(dropdownMenu_prefixCls, "-menu"), className),
67913
- style: style
68356
+ style: style,
68357
+ onKeyDown: e => this.foundation.onMenuKeydown(e)
67914
68358
  }), children);
67915
68359
  }
67916
68360
 
@@ -67921,13 +68365,8 @@ dropdownMenu_DropdownMenu.propTypes = {
67921
68365
  className: prop_types_default.a.string,
67922
68366
  style: prop_types_default.a.object
67923
68367
  };
68368
+ dropdownMenu_DropdownMenu.contextType = dropdown_context;
67924
68369
  /* 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
68370
  // CONCATENATED MODULE: ./dropdown/dropdownItem.tsx
67932
68371
 
67933
68372
 
@@ -68005,7 +68444,9 @@ class dropdownItem_DropdownItem extends baseComponent_BaseComponent {
68005
68444
  }
68006
68445
 
68007
68446
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", assign_default()({
68008
- role: "menuitem"
68447
+ role: "menuitem",
68448
+ tabIndex: -1,
68449
+ "aria-disabled": disabled
68009
68450
  }, events, {
68010
68451
  ref: ref => forwardRef(ref),
68011
68452
  className: itemclass,
@@ -68174,7 +68615,8 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68174
68615
  contentClassName,
68175
68616
  style,
68176
68617
  showTick,
68177
- prefixCls
68618
+ prefixCls,
68619
+ trigger
68178
68620
  } = this.props;
68179
68621
  const className = classnames_default()(prefixCls, contentClassName);
68180
68622
  const {
@@ -68182,7 +68624,8 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68182
68624
  } = this.context;
68183
68625
  const contextValue = {
68184
68626
  showTick,
68185
- level: level + 1
68627
+ level: level + 1,
68628
+ trigger
68186
68629
  };
68187
68630
  let content = null;
68188
68631
 
@@ -68319,11 +68762,15 @@ class dropdown_Dropdown extends baseComponent_BaseComponent {
68319
68762
  position: position,
68320
68763
  trigger: trigger,
68321
68764
  onVisibleChange: this.handleVisibleChange,
68322
- showArrow: false
68765
+ showArrow: false,
68766
+ returnFocusOnClose: true
68323
68767
  }, 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
68768
  className: classnames_default()(get_default()(children, 'props.className'), {
68325
68769
  ["".concat(prefixCls, "-showing")]: popVisible
68326
- })
68770
+ }),
68771
+ 'aria-haspopup': true,
68772
+ 'aria-expanded': popVisible,
68773
+ onKeyDown: e => this.foundation.handleKeyDown(e)
68327
68774
  }) : children);
68328
68775
  }
68329
68776
 
@@ -68363,7 +68810,9 @@ dropdown_Dropdown.defaultProps = {
68363
68810
  trigger: 'hover',
68364
68811
  position: 'bottom',
68365
68812
  mouseLeaveDelay: dropdown_constants_strings.DEFAULT_LEAVE_DELAY,
68366
- showTick: false
68813
+ showTick: false,
68814
+ closeOnEsc: true,
68815
+ onEscKeyDown: noop_default.a
68367
68816
  };
68368
68817
  /* harmony default export */ var dropdown_0 = (dropdown_Dropdown);
68369
68818
  // CONCATENATED MODULE: ../semi-foundation/grid/constants.ts
@@ -69403,6 +69852,7 @@ label_Label.propTypes = {
69403
69852
 
69404
69853
 
69405
69854
 
69855
+
69406
69856
  var inputGroup_rest = undefined && undefined.__rest || function (s, e) {
69407
69857
  var t = {};
69408
69858
 
@@ -69475,9 +69925,10 @@ class inputGroup_inputGroup extends baseComponent_BaseComponent {
69475
69925
  children,
69476
69926
  label,
69477
69927
  onBlur: groupOnBlur,
69478
- onFocus: groupOnFocus
69928
+ onFocus: groupOnFocus,
69929
+ disabled: groupDisabled
69479
69930
  } = _a,
69480
- rest = inputGroup_rest(_a, ["size", "style", "className", "children", "label", "onBlur", "onFocus"]);
69931
+ rest = inputGroup_rest(_a, ["size", "style", "className", "children", "label", "onBlur", "onFocus", "disabled"]);
69481
69932
 
69482
69933
  const groupCls = classnames_default()("".concat(inputGroup_prefixCls, "-group"), {
69483
69934
  [concat_default()(_context2 = "".concat(inputGroup_prefixCls, "-")).call(_context2, size)]: size !== 'default'
@@ -69491,16 +69942,20 @@ class inputGroup_inputGroup extends baseComponent_BaseComponent {
69491
69942
  if (item) {
69492
69943
  const {
69493
69944
  onBlur: itemOnBlur,
69494
- onFocus: itemOnFocus
69945
+ onFocus: itemOnFocus,
69946
+ disabled: itemDisabled
69495
69947
  } = 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,
69948
+ const onBlur = isFunction_default()(itemOnBlur) && get_default()(itemOnBlur, 'name') !== 'noop' ? itemOnBlur : groupOnBlur;
69949
+ const onFocus = isFunction_default()(itemOnFocus) && get_default()(itemOnFocus, 'name') !== 'noop' ? itemOnFocus : groupOnFocus;
69950
+ const disabled = typeof itemDisabled === 'boolean' ? itemDisabled : groupDisabled;
69951
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(item, assign_default()(assign_default()({
69952
+ key: index
69953
+ }, rest), {
69500
69954
  size,
69501
69955
  onBlur,
69502
- onFocus
69503
- }, rest));
69956
+ onFocus,
69957
+ disabled
69958
+ }));
69504
69959
  }
69505
69960
 
69506
69961
  return null;
@@ -71067,6 +71522,8 @@ var inputNumber_rest = undefined && undefined.__rest || function (s, e) {
71067
71522
  }
71068
71523
  return t;
71069
71524
  };
71525
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
71526
+
71070
71527
  /* eslint-disable @typescript-eslint/no-unused-vars */
71071
71528
 
71072
71529
  /* eslint-disable no-unused-vars */
@@ -71326,7 +71783,8 @@ class inputNumber_InputNumber extends baseComponent_BaseComponent {
71326
71783
 
71327
71784
  componentDidUpdate(prevProps) {
71328
71785
  const {
71329
- value
71786
+ value,
71787
+ preventScroll
71330
71788
  } = this.props;
71331
71789
  const {
71332
71790
  focusing
@@ -71441,7 +71899,9 @@ class inputNumber_InputNumber extends baseComponent_BaseComponent {
71441
71899
 
71442
71900
  if (this.props.keepFocus && this.state.focusing) {
71443
71901
  if (document.activeElement !== this.inputNode) {
71444
- this.inputNode.focus();
71902
+ this.inputNode.focus({
71903
+ preventScroll
71904
+ });
71445
71905
  }
71446
71906
  }
71447
71907
  }
@@ -71551,6 +72011,7 @@ inputNumber_InputNumber.propTypes = {
71551
72011
  prefixCls: prop_types_default.a.string,
71552
72012
  pressInterval: prop_types_default.a.number,
71553
72013
  pressTimeout: prop_types_default.a.number,
72014
+ preventScroll: prop_types_default.a.bool,
71554
72015
  shiftStep: prop_types_default.a.number,
71555
72016
  step: prop_types_default.a.number,
71556
72017
  style: prop_types_default.a.object,
@@ -71564,7 +72025,6 @@ inputNumber_InputNumber.propTypes = {
71564
72025
  onUpClick: prop_types_default.a.func
71565
72026
  };
71566
72027
  inputNumber_InputNumber.defaultProps = {
71567
- disabled: false,
71568
72028
  forwardedRef: noop_default.a,
71569
72029
  innerButtons: false,
71570
72030
  keepFocus: false,
@@ -79321,8 +79781,14 @@ class select_Select extends baseComponent_BaseComponent {
79321
79781
  });
79322
79782
  },
79323
79783
  focusInput: () => {
79784
+ const {
79785
+ preventScroll
79786
+ } = this.props;
79787
+
79324
79788
  if (this.inputRef && this.inputRef.current) {
79325
- this.inputRef.current.focus();
79789
+ this.inputRef.current.focus({
79790
+ preventScroll
79791
+ });
79326
79792
  }
79327
79793
  }
79328
79794
  };
@@ -79474,8 +79940,13 @@ class select_Select extends baseComponent_BaseComponent {
79474
79940
  },
79475
79941
  focusTrigger: () => {
79476
79942
  try {
79943
+ const {
79944
+ preventScroll
79945
+ } = this.props;
79477
79946
  const el = this.triggerRef.current;
79478
- el.focus();
79947
+ el.focus({
79948
+ preventScroll
79949
+ });
79479
79950
  } catch (error) {}
79480
79951
  },
79481
79952
  updateScrollTop: index => {
@@ -80278,7 +80749,8 @@ select_Select.propTypes = {
80278
80749
  virtualize: prop_types_default.a.object,
80279
80750
  renderOptionItem: prop_types_default.a.func,
80280
80751
  onListScroll: prop_types_default.a.func,
80281
- arrowIcon: prop_types_default.a.node // open: PropTypes.bool,
80752
+ arrowIcon: prop_types_default.a.node,
80753
+ preventScroll: prop_types_default.a.bool // open: PropTypes.bool,
80282
80754
  // tagClosable: PropTypes.bool,
80283
80755
 
80284
80756
  };
@@ -82464,7 +82936,12 @@ class radioInner_RadioInner extends baseComponent_BaseComponent {
82464
82936
  }
82465
82937
 
82466
82938
  focus() {
82467
- this.inputEntity.focus();
82939
+ const {
82940
+ preventScroll
82941
+ } = this.props;
82942
+ this.inputEntity.focus({
82943
+ preventScroll
82944
+ });
82468
82945
  }
82469
82946
 
82470
82947
  onChange(e) {
@@ -82535,7 +83012,8 @@ radioInner_RadioInner.propTypes = {
82535
83012
  'aria-label': prop_types_default.a.string,
82536
83013
  focusInner: prop_types_default.a.bool,
82537
83014
  onInputFocus: prop_types_default.a.func,
82538
- onInputBlur: prop_types_default.a.func
83015
+ onInputBlur: prop_types_default.a.func,
83016
+ preventScroll: prop_types_default.a.bool
82539
83017
  };
82540
83018
  radioInner_RadioInner.defaultProps = {
82541
83019
  onChange: noop_default.a,
@@ -82783,7 +83261,8 @@ radio_Radio.propTypes = {
82783
83261
  addonStyle: prop_types_default.a.object,
82784
83262
  addonClassName: prop_types_default.a.string,
82785
83263
  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
83264
+ 'aria-label': prop_types_default.a.string,
83265
+ preventScroll: prop_types_default.a.bool
82787
83266
  };
82788
83267
  radio_Radio.defaultProps = {
82789
83268
  autoFocus: false,
@@ -83007,139 +83486,44 @@ const rating_constants_strings = {
83007
83486
  // EXTERNAL MODULE: ../semi-foundation/rating/rating.scss
83008
83487
  var rating = __webpack_require__("F3GA");
83009
83488
 
83010
- // CONCATENATED MODULE: ./rating/item.tsx
83011
-
83012
-
83013
-
83489
+ // CONCATENATED MODULE: ../semi-foundation/rating/foundation.ts
83014
83490
 
83015
83491
 
83016
83492
 
83017
83493
 
83494
+ /* eslint-disable no-param-reassign */
83018
83495
 
83019
- class rating_item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
83020
- constructor() {
83021
- super(...arguments);
83022
83496
 
83023
- this.onHover = e => {
83024
- const {
83025
- onHover,
83026
- index
83027
- } = this.props;
83028
- onHover(e, index);
83029
- };
83497
+ class foundation_RatingFoundation extends foundation {
83498
+ constructor(adapter) {
83499
+ super(assign_default()(assign_default()({}, foundation_RatingFoundation.defaultAdapter), adapter));
83030
83500
 
83031
- this.onClick = e => {
83501
+ this.handleStarFocusVisible = event => {
83032
83502
  const {
83033
- onClick,
83034
- index
83035
- } = this.props;
83036
- onClick(e, index);
83037
- };
83038
-
83039
- this.onKeyDown = e => {
83503
+ target
83504
+ } = event;
83040
83505
  const {
83041
- onClick,
83042
- index
83043
- } = this.props;
83506
+ count
83507
+ } = this.getProps(); // when rating 0 is focus visible
83044
83508
 
83045
- if (e.keyCode === 13) {
83046
- onClick(e, index);
83509
+ try {
83510
+ if (target.matches(':focus-visible')) {
83511
+ this._adapter.setEmptyStarFocusVisible(true);
83512
+ }
83513
+ } catch (error) {
83514
+ Object(warning["a" /* default */])(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
83047
83515
  }
83048
83516
  };
83049
- }
83050
-
83051
- render() {
83052
- var _context;
83053
83517
 
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;
83518
+ this.handleStarBlur = event => {
83519
+ const {
83520
+ emptyStarFocusVisible
83521
+ } = this.getStates();
83068
83522
 
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, "%")
83523
+ if (emptyStarFocusVisible) {
83524
+ this._adapter.setEmptyStarFocusVisible(false);
83109
83525
  }
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));
83526
+ };
83143
83527
  }
83144
83528
 
83145
83529
  init() {
@@ -83269,8 +83653,10 @@ class foundation_RatingFoundation extends foundation {
83269
83653
  }
83270
83654
 
83271
83655
  handleKeyDown(event, value) {
83656
+ var _context;
83657
+
83272
83658
  const {
83273
- keyCode
83659
+ key
83274
83660
  } = event;
83275
83661
  const {
83276
83662
  count,
@@ -83280,41 +83666,331 @@ class foundation_RatingFoundation extends foundation {
83280
83666
  const direction = this._adapter.getContext('direction');
83281
83667
 
83282
83668
  const reverse = direction === 'rtl';
83669
+ const step = allowHalf ? 0.5 : 1;
83670
+ let tempValue;
83671
+ let newValue;
83283
83672
 
83284
- if (keyCode === KeyCode.RIGHT && value < count && !reverse) {
83285
- if (allowHalf) {
83286
- value += 0.5;
83287
- } else {
83288
- value += 1;
83673
+ if (key === 'ArrowRight' || key === 'ArrowUp') {
83674
+ tempValue = value + (reverse ? -step : step);
83675
+ } else if (key === 'ArrowLeft' || key === 'ArrowDown') {
83676
+ tempValue = value + (reverse ? step : -step);
83677
+ }
83678
+
83679
+ if (tempValue > count) {
83680
+ newValue = 0;
83681
+ } else if (tempValue < 0) {
83682
+ newValue = count;
83683
+ } else {
83684
+ newValue = tempValue;
83685
+ }
83686
+
83687
+ if (includes_default()(_context = ['ArrowRight', 'ArrowUp', 'ArrowLeft', 'ArrowDown']).call(_context, key)) {
83688
+ this._adapter.notifyKeyDown(event);
83689
+
83690
+ this._adapter.updateValue(newValue);
83691
+
83692
+ this.changeFocusStar(newValue, event);
83693
+ event.preventDefault();
83694
+
83695
+ this._adapter.notifyHoverChange(undefined, null);
83696
+ }
83697
+ }
83698
+
83699
+ changeFocusStar(value, event) {
83700
+ var _context2;
83701
+
83702
+ const {
83703
+ count,
83704
+ allowHalf,
83705
+ preventScroll
83706
+ } = this.getProps();
83707
+ const index = Math.ceil(value) - 1;
83708
+
83709
+ const starElement = map_default()(_context2 = [...event.currentTarget.childNodes]).call(_context2, item => item.childNodes[0].childNodes);
83710
+
83711
+ if (index < 0) {
83712
+ starElement[count][0].focus({
83713
+ preventScroll
83714
+ });
83715
+ } else {
83716
+ starElement[index][allowHalf ? value * 10 % 10 === 5 ? 0 : 1 : 0].focus({
83717
+ preventScroll
83718
+ });
83719
+ }
83720
+ }
83721
+
83722
+ }
83723
+ class foundation_RatingItemFoundation extends foundation {
83724
+ constructor(adapter) {
83725
+ super(assign_default()(assign_default()({}, foundation_RatingItemFoundation.defaultAdapter), adapter));
83726
+
83727
+ this.handleFocusVisible = (event, star) => {
83728
+ const {
83729
+ target
83730
+ } = event; // when rating 0 is focus visible
83731
+
83732
+ try {
83733
+ if (target.matches(':focus-visible')) {
83734
+ if (star === 'first') {
83735
+ this._adapter.setFirstStarFocus(true);
83736
+ } else {
83737
+ this._adapter.setSecondStarFocus(true);
83738
+ }
83739
+ }
83740
+ } catch (error) {
83741
+ Object(warning["a" /* default */])(true, 'Warning: [Semi Rating] The current browser does not support the focus-visible');
83289
83742
  }
83290
- } else if (keyCode === KeyCode.LEFT && value > 0 && !reverse) {
83291
- if (allowHalf) {
83292
- value -= 0.5;
83743
+ };
83744
+
83745
+ this.handleBlur = (event, star) => {
83746
+ const {
83747
+ firstStarFocus,
83748
+ secondStarFocus
83749
+ } = this.getStates();
83750
+
83751
+ if (star === 'first') {
83752
+ firstStarFocus && this._adapter.setFirstStarFocus(false);
83293
83753
  } else {
83294
- value -= 1;
83754
+ secondStarFocus && this._adapter.setSecondStarFocus(false);
83295
83755
  }
83296
- } else if (keyCode === KeyCode.RIGHT && value > 0 && reverse) {
83297
- if (allowHalf) {
83298
- value -= 0.5;
83299
- } else {
83300
- value -= 1;
83756
+ };
83757
+ }
83758
+
83759
+ }
83760
+ // CONCATENATED MODULE: ./rating/item.tsx
83761
+
83762
+
83763
+
83764
+
83765
+
83766
+
83767
+
83768
+
83769
+
83770
+
83771
+ class rating_item_Item extends baseComponent_BaseComponent {
83772
+ constructor(props) {
83773
+ super(props);
83774
+ this.firstStar = null;
83775
+ this.secondStar = null;
83776
+
83777
+ this.onHover = e => {
83778
+ const {
83779
+ onHover,
83780
+ index
83781
+ } = this.props;
83782
+ onHover(e, index);
83783
+ };
83784
+
83785
+ this.onClick = e => {
83786
+ const {
83787
+ onClick,
83788
+ index
83789
+ } = this.props;
83790
+ onClick(e, index);
83791
+ };
83792
+
83793
+ this.onFocus = (e, star) => {
83794
+ const {
83795
+ onFocus
83796
+ } = this.props;
83797
+ onFocus && onFocus(e);
83798
+ this.foundation.handleFocusVisible(e, star);
83799
+ };
83800
+
83801
+ this.onBlur = (e, star) => {
83802
+ const {
83803
+ onBlur
83804
+ } = this.props;
83805
+ onBlur && onBlur(e);
83806
+ this.foundation.handleBlur(e, star);
83807
+ };
83808
+
83809
+ this.onKeyDown = e => {
83810
+ const {
83811
+ onClick,
83812
+ index
83813
+ } = this.props;
83814
+
83815
+ if (e.keyCode === 13) {
83816
+ onClick(e, index);
83301
83817
  }
83302
- } else if (keyCode === KeyCode.LEFT && value < count && reverse) {
83303
- if (allowHalf) {
83304
- value += 0.5;
83818
+ };
83819
+
83820
+ this.starFocus = () => {
83821
+ const {
83822
+ value,
83823
+ index,
83824
+ preventScroll
83825
+ } = this.props;
83826
+
83827
+ if (value - index === 0.5) {
83828
+ this.firstStar.focus({
83829
+ preventScroll
83830
+ });
83305
83831
  } else {
83306
- value += 1;
83832
+ this.secondStar.focus({
83833
+ preventScroll
83834
+ });
83307
83835
  }
83308
- }
83836
+ };
83309
83837
 
83310
- this._adapter.updateValue(value);
83838
+ this.saveFirstStar = node => {
83839
+ this.firstStar = node;
83840
+ };
83311
83841
 
83312
- event.preventDefault();
83842
+ this.saveSecondStar = node => {
83843
+ this.secondStar = node;
83844
+ };
83313
83845
 
83314
- this._adapter.notifyKeyDown(event);
83846
+ this.state = {
83847
+ firstStarFocus: false,
83848
+ secondStarFocus: false
83849
+ };
83850
+ this.foundation = new foundation_RatingItemFoundation(this.adapter);
83851
+ }
83852
+
83853
+ get adapter() {
83854
+ return assign_default()(assign_default()({}, super.adapter), {
83855
+ setFirstStarFocus: value => {
83856
+ this.setState({
83857
+ firstStarFocus: value
83858
+ });
83859
+ },
83860
+ setSecondStarFocus: value => {
83861
+ this.setState({
83862
+ secondStarFocus: value
83863
+ });
83864
+ }
83865
+ });
83866
+ }
83867
+
83868
+ render() {
83869
+ var _context, _context2, _context3, _context4;
83870
+
83871
+ const {
83872
+ index,
83873
+ prefixCls,
83874
+ character,
83875
+ count,
83876
+ value,
83877
+ disabled,
83878
+ allowHalf,
83879
+ focused,
83880
+ size,
83881
+ ariaLabelPrefix
83882
+ } = this.props;
83883
+ const {
83884
+ firstStarFocus,
83885
+ secondStarFocus
83886
+ } = this.state;
83887
+ const starValue = index + 1;
83888
+ const diff = starValue - value; // const isHalf = allowHalf && value + 0.5 === starValue;
83889
+
83890
+ const isHalf = allowHalf && diff < 1 && diff > 0;
83891
+ const firstWidth = 1 - diff;
83892
+ const isFull = starValue <= value;
83893
+ const isCustomSize = typeof size === 'number';
83894
+ const starCls = classnames_default()(prefixCls, {
83895
+ ["".concat(prefixCls, "-half")]: isHalf,
83896
+ ["".concat(prefixCls, "-full")]: isFull,
83897
+ [concat_default()(_context = "".concat(prefixCls, "-")).call(_context, size)]: !isCustomSize
83898
+ });
83899
+ const sizeStyle = isCustomSize ? {
83900
+ width: size,
83901
+ height: size,
83902
+ fontSize: size
83903
+ } : {};
83904
+ const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
83905
+ const content = character ? character : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconStar, {
83906
+ size: iconSize,
83907
+ style: {
83908
+ display: 'block'
83909
+ }
83910
+ });
83911
+ const isEmpty = index === count;
83912
+ const starWrapCls = classnames_default()("".concat(prefixCls, "-wrapper"), {
83913
+ ["".concat(prefixCls, "-disabled")]: disabled,
83914
+ ["".concat(rating_constants_cssClasses.PREFIX, "-focus")]: (firstStarFocus || secondStarFocus) && value !== 0
83915
+ });
83916
+ const starWrapProps = {
83917
+ onClick: disabled ? null : this.onClick,
83918
+ onKeyDown: disabled ? null : this.onKeyDown,
83919
+ onMouseMove: disabled ? null : this.onHover,
83920
+ className: starWrapCls
83921
+ };
83922
+ const AriaSetSize = allowHalf ? count * 2 + 1 : count + 1;
83923
+ const firstStarProps = {
83924
+ ref: this.saveFirstStar,
83925
+ role: "radio",
83926
+ 'aria-checked': value === index + 0.5,
83927
+ 'aria-posinset': 2 * index + 1,
83928
+ 'aria-setsize': AriaSetSize,
83929
+ 'aria-disabled': disabled,
83930
+ 'aria-label': concat_default()(_context2 = "".concat(index + 0.5, " ")).call(_context2, ariaLabelPrefix, "s"),
83931
+ 'aria-labelledby': this.props['aria-describedby'],
83932
+ 'aria-describedby': this.props['aria-describedby'],
83933
+ className: classnames_default()("".concat(prefixCls, "-first"), "".concat(rating_constants_cssClasses.PREFIX, "-no-focus")),
83934
+ tabIndex: !disabled && value === index + 0.5 ? 0 : -1,
83935
+ onFocus: e => {
83936
+ this.onFocus(e, 'first');
83937
+ },
83938
+ onBlur: e => {
83939
+ this.onBlur(e, 'first');
83940
+ }
83941
+ };
83942
+ const secondStarTabIndex = !disabled && (value === index + 1 || isEmpty && value === 0) ? 0 : -1;
83943
+ const secondStarProps = {
83944
+ ref: this.saveSecondStar,
83945
+ role: "radio",
83946
+ 'aria-checked': isEmpty ? value === 0 : value === index + 1,
83947
+ 'aria-posinset': allowHalf ? 2 * (index + 1) : index + 1,
83948
+ 'aria-setsize': AriaSetSize,
83949
+ 'aria-disabled': disabled,
83950
+ 'aria-label': concat_default()(_context3 = concat_default()(_context4 = "".concat(isEmpty ? 0 : index + 1, " ")).call(_context4, ariaLabelPrefix)).call(_context3, index === 0 ? '' : 's'),
83951
+ 'aria-labelledby': this.props['aria-describedby'],
83952
+ 'aria-describedby': this.props['aria-describedby'],
83953
+ className: classnames_default()("".concat(prefixCls, "-second"), "".concat(rating_constants_cssClasses.PREFIX, "-no-focus")),
83954
+ tabIndex: secondStarTabIndex,
83955
+ onFocus: e => {
83956
+ this.onFocus(e, 'second');
83957
+ },
83958
+ onBlur: e => {
83959
+ this.onBlur(e, 'second');
83960
+ }
83961
+ };
83962
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
83963
+ className: starCls,
83964
+ style: assign_default()({}, sizeStyle),
83965
+ key: index
83966
+ }, /*#__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, {
83967
+ style: {
83968
+ width: "".concat(firstWidth * 100, "%")
83969
+ }
83970
+ }), content), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, secondStarProps, {
83971
+ "x-semi-prop": "character"
83972
+ }), content)));
83315
83973
  }
83316
83974
 
83317
83975
  }
83976
+ rating_item_Item.propTypes = {
83977
+ value: prop_types_default.a.number,
83978
+ index: prop_types_default.a.number,
83979
+ prefixCls: prop_types_default.a.string,
83980
+ allowHalf: prop_types_default.a.bool,
83981
+ onHover: prop_types_default.a.func,
83982
+ onClick: prop_types_default.a.func,
83983
+ character: prop_types_default.a.node,
83984
+ focused: prop_types_default.a.bool,
83985
+ disabled: prop_types_default.a.bool,
83986
+ count: prop_types_default.a.number,
83987
+ ariaLabelPrefix: prop_types_default.a.string,
83988
+ size: prop_types_default.a.oneOfType([prop_types_default.a.oneOf(rating_constants_strings.SIZE_SET), prop_types_default.a.number]),
83989
+ 'aria-describedby': prop_types_default.a.string,
83990
+ onFocus: prop_types_default.a.func,
83991
+ onBlur: prop_types_default.a.func,
83992
+ preventScroll: prop_types_default.a.bool
83993
+ };
83318
83994
  // CONCATENATED MODULE: ./rating/index.tsx
83319
83995
 
83320
83996
 
@@ -83367,11 +84043,14 @@ class rating_Rating extends baseComponent_BaseComponent {
83367
84043
 
83368
84044
  this.focus = () => {
83369
84045
  const {
83370
- disabled
84046
+ disabled,
84047
+ preventScroll
83371
84048
  } = this.props;
83372
84049
 
83373
84050
  if (!disabled) {
83374
- this.rate.focus();
84051
+ this.rate.focus({
84052
+ preventScroll
84053
+ });
83375
84054
  }
83376
84055
  };
83377
84056
 
@@ -83393,13 +84072,96 @@ class rating_Rating extends baseComponent_BaseComponent {
83393
84072
  this.rate = node;
83394
84073
  };
83395
84074
 
84075
+ this.handleStarFocusVisible = event => {
84076
+ this.foundation.handleStarFocusVisible(event);
84077
+ };
84078
+
84079
+ this.handleStarBlur = event => {
84080
+ this.foundation.handleStarBlur(event);
84081
+ };
84082
+
84083
+ this.getAriaLabelPrefix = () => {
84084
+ if (this.props['aria-label']) {
84085
+ return this.props['aria-label'];
84086
+ }
84087
+
84088
+ let prefix = 'star';
84089
+ const {
84090
+ character
84091
+ } = this.props;
84092
+
84093
+ if (typeof character === 'string') {
84094
+ prefix = character;
84095
+ }
84096
+
84097
+ return prefix;
84098
+ };
84099
+
84100
+ this.getItemList = ariaLabelPrefix => {
84101
+ var _context, _context2;
84102
+
84103
+ const {
84104
+ count,
84105
+ allowHalf,
84106
+ prefixCls,
84107
+ disabled,
84108
+ character,
84109
+ size,
84110
+ tooltips
84111
+ } = this.props;
84112
+ const {
84113
+ value,
84114
+ hoverValue,
84115
+ focused
84116
+ } = this.state; // index == count is for Empty rating
84117
+
84118
+ const itemList = map_default()(_context = [...instance_keys_default()(_context2 = Array(count + 1)).call(_context2)]).call(_context, ind => {
84119
+ const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(rating_item_Item, {
84120
+ ref: this.saveRef(ind),
84121
+ index: ind,
84122
+ count: count,
84123
+ prefixCls: "".concat(prefixCls, "-star"),
84124
+ allowHalf: allowHalf,
84125
+ value: hoverValue === undefined ? value : hoverValue,
84126
+ onClick: disabled ? function_noop : this.onClick,
84127
+ onHover: disabled ? function_noop : this.onHover,
84128
+ key: ind,
84129
+ disabled: disabled,
84130
+ character: character,
84131
+ focused: focused,
84132
+ size: ind === count ? 0 : size,
84133
+ ariaLabelPrefix: ariaLabelPrefix,
84134
+ onFocus: disabled || count !== ind ? function_noop : this.handleStarFocusVisible,
84135
+ onBlur: disabled || count !== ind ? function_noop : this.handleStarBlur
84136
+ });
84137
+
84138
+ if (tooltips) {
84139
+ var _context3;
84140
+
84141
+ const text = tooltips[ind] ? tooltips[ind] : '';
84142
+ const showTips = hoverValue - 1 === ind;
84143
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
84144
+ visible: showTips,
84145
+ trigger: "custom",
84146
+ content: text,
84147
+ key: concat_default()(_context3 = "".concat(ind, "-")).call(_context3, showTips)
84148
+ }, content);
84149
+ }
84150
+
84151
+ return content;
84152
+ });
84153
+
84154
+ return itemList;
84155
+ };
84156
+
83396
84157
  const value = props.value === undefined ? props.defaultValue : props.value;
83397
84158
  this.stars = {};
83398
84159
  this.state = {
83399
84160
  value,
83400
84161
  focused: false,
83401
84162
  hoverValue: undefined,
83402
- clearedValue: null
84163
+ clearedValue: null,
84164
+ emptyStarFocusVisible: false
83403
84165
  };
83404
84166
  this.foundation = new foundation_RatingFoundation(this.adapter);
83405
84167
  }
@@ -83418,11 +84180,16 @@ class rating_Rating extends baseComponent_BaseComponent {
83418
84180
  return assign_default()(assign_default()({}, super.adapter), {
83419
84181
  focus: () => {
83420
84182
  const {
83421
- disabled
84183
+ disabled,
84184
+ count
83422
84185
  } = this.props;
84186
+ const {
84187
+ value
84188
+ } = this.state;
83423
84189
 
83424
84190
  if (!disabled) {
83425
- this.rate.focus();
84191
+ const index = Math.ceil(value) - 1;
84192
+ this.stars[index < 0 ? count : index].starFocus();
83426
84193
  }
83427
84194
  },
83428
84195
  getStarDOM: index => {
@@ -83484,6 +84251,11 @@ class rating_Rating extends baseComponent_BaseComponent {
83484
84251
  focused: false
83485
84252
  });
83486
84253
  onKeyDown && onKeyDown(e);
84254
+ },
84255
+ setEmptyStarFocusVisible: focusVisible => {
84256
+ this.setState({
84257
+ emptyStarFocusVisible: focusVisible
84258
+ });
83487
84259
  }
83488
84260
  });
83489
84261
  }
@@ -83497,77 +84269,48 @@ class rating_Rating extends baseComponent_BaseComponent {
83497
84269
  }
83498
84270
 
83499
84271
  render() {
83500
- var _context, _context2;
84272
+ var _context4, _context5, _context6;
83501
84273
 
83502
84274
  const {
83503
- count,
83504
- allowHalf,
83505
84275
  style,
83506
84276
  prefixCls,
83507
84277
  disabled,
83508
84278
  className,
83509
- character,
83510
- tabIndex,
83511
- size,
83512
- tooltips,
83513
- id
84279
+ id,
84280
+ count,
84281
+ tabIndex
83514
84282
  } = this.props;
83515
84283
  const {
83516
84284
  value,
83517
- hoverValue,
83518
- focused
84285
+ emptyStarFocusVisible
83519
84286
  } = this.state;
84287
+ const ariaLabelPrefix = this.getAriaLabelPrefix();
83520
84288
 
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
- });
84289
+ 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
84290
 
84291
+ const itemList = this.getItemList(ariaLabelPrefix);
83554
84292
  const listCls = classnames_default()(prefixCls, {
83555
- ["".concat(prefixCls, "-disabled")]: disabled
84293
+ ["".concat(prefixCls, "-disabled")]: disabled,
84294
+ ["".concat(prefixCls, "-focus")]: emptyStarFocusVisible
83556
84295
  }, 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);
84296
+ return (
84297
+ /*#__PURE__*/
84298
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
84299
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
84300
+ "aria-label": ariaLabel,
84301
+ "aria-labelledby": this.props['aria-labelledby'],
84302
+ "aria-describedby": this.props['aria-describedby'],
84303
+ className: listCls,
84304
+ style: style,
84305
+ onMouseLeave: disabled ? function_noop : this.onMouseLeave,
84306
+ tabIndex: disabled ? -1 : tabIndex,
84307
+ onFocus: disabled ? function_noop : this.onFocus,
84308
+ onBlur: disabled ? function_noop : this.onBlur,
84309
+ onKeyDown: disabled ? function_noop : this.onKeyDown,
84310
+ ref: this.saveRate,
84311
+ id: id
84312
+ }, itemList)
84313
+ );
83571
84314
  }
83572
84315
 
83573
84316
  }
@@ -83598,7 +84341,8 @@ rating_Rating.propTypes = {
83598
84341
  autoFocus: prop_types_default.a.bool,
83599
84342
  size: prop_types_default.a.oneOfType([prop_types_default.a.oneOf(rating_constants_strings.SIZE_SET), prop_types_default.a.number]),
83600
84343
  tooltips: prop_types_default.a.arrayOf(prop_types_default.a.string),
83601
- id: prop_types_default.a.string
84344
+ id: prop_types_default.a.string,
84345
+ preventScroll: prop_types_default.a.bool
83602
84346
  };
83603
84347
  rating_Rating.defaultProps = {
83604
84348
  defaultValue: 0,
@@ -83609,7 +84353,7 @@ rating_Rating.defaultProps = {
83609
84353
  prefixCls: rating_constants_cssClasses.PREFIX,
83610
84354
  onChange: function_noop,
83611
84355
  onHoverChange: function_noop,
83612
- tabIndex: 0,
84356
+ tabIndex: -1,
83613
84357
  size: 'default'
83614
84358
  };
83615
84359
  // CONCATENATED MODULE: ../semi-foundation/sideSheet/constants.ts
@@ -91869,7 +92613,7 @@ class Body_Body extends baseComponent_BaseComponent {
91869
92613
 
91870
92614
  const listStyle = {
91871
92615
  width: '100%',
91872
- height: y,
92616
+ height: (virtualizedData === null || virtualizedData === void 0 ? void 0 : virtualizedData.length) ? y : 0,
91873
92617
  overflowX: 'auto',
91874
92618
  overflowY: 'auto'
91875
92619
  };
@@ -94403,6 +95147,10 @@ class foundation_TabsFoundation extends foundation {
94403
95147
  this.handleKeyDown = (event, itemKey, closable) => {
94404
95148
  var _context;
94405
95149
 
95150
+ const {
95151
+ preventScroll
95152
+ } = this.getProps();
95153
+
94406
95154
  const tabs = filter_default()(_context = [...event.target.parentNode.childNodes]).call(_context, item => {
94407
95155
  var _context2;
94408
95156
 
@@ -94429,13 +95177,17 @@ class foundation_TabsFoundation extends foundation {
94429
95177
  break;
94430
95178
 
94431
95179
  case "Home":
94432
- tabs[0].focus(); // focus first tab
95180
+ tabs[0].focus({
95181
+ preventScroll
95182
+ }); // focus first tab
94433
95183
 
94434
95184
  this.handlePrevent(event);
94435
95185
  break;
94436
95186
 
94437
95187
  case "End":
94438
- tabs[tabs.length - 1].focus(); // focus last tab
95188
+ tabs[tabs.length - 1].focus({
95189
+ preventScroll
95190
+ }); // focus last tab
94439
95191
 
94440
95192
  this.handlePrevent(event);
94441
95193
  break;
@@ -94530,6 +95282,10 @@ class foundation_TabsFoundation extends foundation {
94530
95282
  }
94531
95283
 
94532
95284
  handleDeleteKeyDown(event, tabs, itemKey, closable) {
95285
+ const {
95286
+ preventScroll
95287
+ } = this.getProps();
95288
+
94533
95289
  if (closable) {
94534
95290
  this.handleTabDelete(itemKey);
94535
95291
 
@@ -94538,12 +95294,18 @@ class foundation_TabsFoundation extends foundation {
94538
95294
 
94539
95295
 
94540
95296
  if (tabs.length !== 1) {
94541
- tabs[index + 1 >= tabs.length ? index - 1 : index + 1].focus();
95297
+ tabs[index + 1 >= tabs.length ? index - 1 : index + 1].focus({
95298
+ preventScroll
95299
+ });
94542
95300
  }
94543
95301
  }
94544
95302
  }
94545
95303
 
94546
95304
  switchTabOnArrowPress(event, tabs) {
95305
+ const {
95306
+ preventScroll
95307
+ } = this.getProps();
95308
+
94547
95309
  const index = index_of_default()(tabs).call(tabs, event.target);
94548
95310
 
94549
95311
  const direction = {
@@ -94556,11 +95318,17 @@ class foundation_TabsFoundation extends foundation {
94556
95318
  if (direction[event.key]) {
94557
95319
  if (index !== undefined) {
94558
95320
  if (tabs[index + direction[event.key]]) {
94559
- tabs[index + direction[event.key]].focus();
95321
+ tabs[index + direction[event.key]].focus({
95322
+ preventScroll
95323
+ });
94560
95324
  } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
94561
- tabs[tabs.length - 1].focus(); // focus last tab
95325
+ tabs[tabs.length - 1].focus({
95326
+ preventScroll
95327
+ }); // focus last tab
94562
95328
  } else if (event.key === "ArrowRight" || event.key == "ArrowDown") {
94563
- tabs[0].focus(); // focus first tab
95329
+ tabs[0].focus({
95330
+ preventScroll
95331
+ }); // focus first tab
94564
95332
  }
94565
95333
  }
94566
95334
  }
@@ -95503,7 +96271,8 @@ tabs_Tabs.propTypes = {
95503
96271
  tabPaneMotion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.object, prop_types_default.a.func]),
95504
96272
  tabPosition: prop_types_default.a.oneOf(tabs_constants_strings.POSITION_MAP),
95505
96273
  type: prop_types_default.a.oneOf(tabs_constants_strings.TYPE_MAP),
95506
- onTabClose: prop_types_default.a.func
96274
+ onTabClose: prop_types_default.a.func,
96275
+ preventScroll: prop_types_default.a.bool
95507
96276
  };
95508
96277
  tabs_Tabs.defaultProps = {
95509
96278
  children: [],
@@ -96459,7 +97228,8 @@ class TimeInput_TimeInput extends baseComponent_BaseComponent {
96459
97228
  componentDidMount() {
96460
97229
  super.componentDidMount();
96461
97230
  const {
96462
- focusOnOpen
97231
+ focusOnOpen,
97232
+ preventScroll
96463
97233
  } = this.props;
96464
97234
 
96465
97235
  if (focusOnOpen) {
@@ -96468,7 +97238,9 @@ class TimeInput_TimeInput extends baseComponent_BaseComponent {
96468
97238
  const inputNode = this.adapter.getCache('inputNode');
96469
97239
 
96470
97240
  if (inputNode) {
96471
- inputNode.focus();
97241
+ inputNode.focus({
97242
+ preventScroll
97243
+ });
96472
97244
  inputNode.select();
96473
97245
  }
96474
97246
  });
@@ -96597,7 +97369,8 @@ TimeInput_TimeInput.propTypes = {
96597
97369
  locale: prop_types_default.a.object,
96598
97370
  localeCode: prop_types_default.a.string,
96599
97371
  insetLabel: prop_types_default.a.node,
96600
- validateStatus: prop_types_default.a.string
97372
+ validateStatus: prop_types_default.a.string,
97373
+ preventScroll: prop_types_default.a.bool
96601
97374
  };
96602
97375
  TimeInput_TimeInput.defaultProps = {
96603
97376
  inputReadOnly: false,
@@ -97080,7 +97853,8 @@ TimePicker_TimePicker.propTypes = assign_default()(assign_default()({
97080
97853
  motion: prop_types_default.a.oneOfType([prop_types_default.a.bool, prop_types_default.a.func, prop_types_default.a.object]),
97081
97854
  autoAdjustOverflow: prop_types_default.a.bool
97082
97855
  }, PanelShape), {
97083
- inputStyle: prop_types_default.a.object
97856
+ inputStyle: prop_types_default.a.object,
97857
+ preventScroll: prop_types_default.a.bool
97084
97858
  });
97085
97859
  TimePicker_TimePicker.defaultProps = assign_default()({
97086
97860
  autoAdjustOverflow: true,
@@ -98757,7 +99531,6 @@ const TreeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
98757
99531
 
98758
99532
 
98759
99533
 
98760
-
98761
99534
  var treeNode_rest = undefined && undefined.__rest || function (s, e) {
98762
99535
  var t = {};
98763
99536
 
@@ -98778,6 +99551,7 @@ var treeNode_rest = undefined && undefined.__rest || function (s, e) {
98778
99551
 
98779
99552
 
98780
99553
 
99554
+
98781
99555
  const treeNode_prefixcls = tree_constants_cssClasses.PREFIX_OPTION;
98782
99556
  class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
98783
99557
  constructor(props) {
@@ -98997,22 +99771,14 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
98997
99771
  if (isFunction_default()(renderLabel)) {
98998
99772
  return renderLabel(label, data);
98999
99773
  } 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));
99774
+ return Object(_utils["d" /* getHighLightTextHTML */])({
99775
+ sourceString: label,
99776
+ searchWords: [keyword],
99777
+ option: {
99778
+ highlightTag: 'span',
99779
+ highlightClassName: "".concat(treeNode_prefixcls, "-highlight")
99010
99780
  }
99011
-
99012
- content.push(node);
99013
99781
  });
99014
-
99015
- return content;
99016
99782
  } else {
99017
99783
  return label;
99018
99784
  }
@@ -99060,7 +99826,8 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99060
99826
  renderCheckbox() {
99061
99827
  const {
99062
99828
  checked,
99063
- halfChecked
99829
+ halfChecked,
99830
+ eventKey
99064
99831
  } = this.props;
99065
99832
  const disabled = this.isDisabled();
99066
99833
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
@@ -99069,6 +99836,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99069
99836
  onKeyPress: this.handleCheckEnterPress
99070
99837
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkbox_checkbox_0, {
99071
99838
  "aria-label": 'Toggle the checked state of checkbox',
99839
+ value: eventKey,
99072
99840
  indeterminate: halfChecked,
99073
99841
  checked: checked,
99074
99842
  disabled: Boolean(disabled)
@@ -99111,7 +99879,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99111
99879
  }
99112
99880
 
99113
99881
  renderEmptyNode() {
99114
- var _context2;
99882
+ var _context;
99115
99883
 
99116
99884
  const {
99117
99885
  emptyContent
@@ -99122,14 +99890,14 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99122
99890
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("ul", {
99123
99891
  className: wrapperCls
99124
99892
  }, /*#__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"),
99893
+ className: concat_default()(_context = "".concat(treeNode_prefixcls, "-label ")).call(_context, treeNode_prefixcls, "-label-empty"),
99126
99894
  "x-semi-prop": "emptyContent"
99127
99895
  }, emptyContent));
99128
99896
  } // eslint-disable-next-line max-lines-per-function
99129
99897
 
99130
99898
 
99131
99899
  render() {
99132
- var _context3;
99900
+ var _context2;
99133
99901
 
99134
99902
  const _a = this.props,
99135
99903
  {
@@ -99167,7 +99935,7 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
99167
99935
  const dragOverGapTop = dragOverNodeKey === eventKey && dropPosition === -1;
99168
99936
  const dragOverGapBottom = dragOverNodeKey === eventKey && dropPosition === 1;
99169
99937
  const nodeCls = classnames_default()(treeNode_prefixcls, {
99170
- [concat_default()(_context3 = "".concat(treeNode_prefixcls, "-level-")).call(_context3, level + 1)]: true,
99938
+ [concat_default()(_context2 = "".concat(treeNode_prefixcls, "-level-")).call(_context2, level + 1)]: true,
99171
99939
  ["".concat(treeNode_prefixcls, "-collapsed")]: !expanded,
99172
99940
  ["".concat(treeNode_prefixcls, "-disabled")]: Boolean(disabled),
99173
99941
  ["".concat(treeNode_prefixcls, "-selected")]: selected,
@@ -99565,6 +100333,7 @@ var tree = __webpack_require__("Q8Yr");
99565
100333
 
99566
100334
 
99567
100335
 
100336
+
99568
100337
  /* eslint-disable max-lines-per-function */
99569
100338
 
99570
100339
 
@@ -99585,6 +100354,7 @@ var tree = __webpack_require__("Q8Yr");
99585
100354
 
99586
100355
 
99587
100356
 
100357
+
99588
100358
 
99589
100359
  const tree_prefixcls = tree_constants_cssClasses.PREFIX;
99590
100360
 
@@ -99982,8 +100752,14 @@ class tree_Tree extends baseComponent_BaseComponent {
99982
100752
  });
99983
100753
  },
99984
100754
  focusInput: () => {
100755
+ const {
100756
+ preventScroll
100757
+ } = this.props;
100758
+
99985
100759
  if (this.inputRef && this.inputRef.current) {
99986
- this.inputRef.current.focus();
100760
+ this.inputRef.current.focus({
100761
+ preventScroll
100762
+ });
99987
100763
  }
99988
100764
  }
99989
100765
  };
@@ -100145,7 +100921,9 @@ class tree_Tree extends baseComponent_BaseComponent {
100145
100921
  inputValue,
100146
100922
  filteredKeys,
100147
100923
  dragOverNodeKey,
100148
- dropPosition
100924
+ dropPosition,
100925
+ checkedKeys,
100926
+ realCheckedKeys
100149
100927
  } = this.state;
100150
100928
  const {
100151
100929
  blockNode,
@@ -100164,7 +100942,8 @@ class tree_Tree extends baseComponent_BaseComponent {
100164
100942
  draggable,
100165
100943
  renderFullLabel,
100166
100944
  labelEllipsis,
100167
- virtualize
100945
+ virtualize,
100946
+ checkRelation
100168
100947
  } = this.props;
100169
100948
  const wrapperCls = classnames_default()("".concat(tree_prefixcls, "-wrapper"), className);
100170
100949
  const listCls = classnames_default()("".concat(tree_prefixcls, "-option-list"), {
@@ -100222,7 +101001,9 @@ class tree_Tree extends baseComponent_BaseComponent {
100222
101001
  style: style
100223
101002
  }, filterTreeNode ? this.renderInput() : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({
100224
101003
  className: listCls
100225
- }, ariaAttr), noData ? this.renderEmpty() : this.renderNodeList())));
101004
+ }, ariaAttr), noData ? this.renderEmpty() : multiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkboxGroup, {
101005
+ value: from_default()(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
101006
+ }, this.renderNodeList()) : this.renderNodeList())));
100226
101007
  }
100227
101008
 
100228
101009
  }
@@ -100289,7 +101070,8 @@ tree_Tree.propTypes = {
100289
101070
  onDrop: prop_types_default.a.func,
100290
101071
  labelEllipsis: prop_types_default.a.bool,
100291
101072
  checkRelation: prop_types_default.a.string,
100292
- 'aria-label': prop_types_default.a.string
101073
+ 'aria-label': prop_types_default.a.string,
101074
+ preventScroll: prop_types_default.a.bool
100293
101075
  };
100294
101076
  tree_Tree.defaultProps = {
100295
101077
  showClear: true,
@@ -100649,8 +101431,12 @@ class foundation_TreeSelectFoundation extends foundation {
100649
101431
  const isDisabled = this._isDisabled();
100650
101432
 
100651
101433
  const {
100652
- isOpen
101434
+ isOpen,
101435
+ inputValue
100653
101436
  } = this.getStates();
101437
+ const {
101438
+ searchPosition
101439
+ } = this.getProps();
100654
101440
 
100655
101441
  if (isDisabled) {
100656
101442
  return;
@@ -100659,6 +101445,10 @@ class foundation_TreeSelectFoundation extends foundation {
100659
101445
 
100660
101446
  this._notifyFocus(e);
100661
101447
  } else if (isOpen) {
101448
+ if (searchPosition === 'trigger' && inputValue) {
101449
+ return;
101450
+ }
101451
+
100662
101452
  this.close(e);
100663
101453
  }
100664
101454
  }
@@ -101247,6 +102037,8 @@ var treeSelect = __webpack_require__("uw59");
101247
102037
 
101248
102038
 
101249
102039
 
102040
+
102041
+
101250
102042
 
101251
102043
 
101252
102044
 
@@ -101535,6 +102327,14 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
101535
102327
  };
101536
102328
 
101537
102329
  this.search = value => {
102330
+ const {
102331
+ isOpen
102332
+ } = this.state;
102333
+
102334
+ if (!isOpen) {
102335
+ this.foundation.open();
102336
+ }
102337
+
101538
102338
  this.foundation.handleInputChange(value);
101539
102339
  };
101540
102340
 
@@ -102024,7 +102824,9 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
102024
102824
  motionType,
102025
102825
  inputValue,
102026
102826
  filteredKeys,
102027
- flattenNodes
102827
+ flattenNodes,
102828
+ checkedKeys,
102829
+ realCheckedKeys
102028
102830
  } = this.state;
102029
102831
  const {
102030
102832
  loadData,
@@ -102041,7 +102843,8 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
102041
102843
  optionListStyle,
102042
102844
  searchPosition,
102043
102845
  renderLabel,
102044
- renderFullLabel
102846
+ renderFullLabel,
102847
+ checkRelation
102045
102848
  } = this.props;
102046
102849
  const wrapperCls = classnames_default()("".concat(prefixTree, "-wrapper"));
102047
102850
  const listCls = classnames_default()("".concat(prefixTree, "-option-list"), {
@@ -102082,7 +102885,9 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
102082
102885
  role: "tree",
102083
102886
  "aria-multiselectable": multiple ? true : false,
102084
102887
  style: optionListStyle
102085
- }, noData ? this.renderEmpty() : this.renderNodeList()), outerBottomSlot));
102888
+ }, noData ? this.renderEmpty() : multiple ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(checkboxGroup, {
102889
+ value: from_default()(checkRelation === 'related' ? checkedKeys : realCheckedKeys)
102890
+ }, this.renderNodeList()) : this.renderNodeList()), outerBottomSlot));
102086
102891
  };
102087
102892
 
102088
102893
  this.state = {
@@ -102526,7 +103331,6 @@ treeSelect_TreeSelect.defaultProps = {
102526
103331
  motionExpand: true,
102527
103332
  expandAll: false,
102528
103333
  zIndex: constants_numbers.DEFAULT_Z_INDEX,
102529
- disabled: false,
102530
103334
  disableStrictly: false,
102531
103335
  multiple: false,
102532
103336
  filterTreeNode: false,