@fibrae/semi-foundation 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/anchor/foundation.d.ts +1 -1
  2. package/dist/anchor/foundation.js +21 -21
  3. package/dist/audio-player/foundation.d.ts +10 -10
  4. package/dist/audio-player/foundation.js +19 -19
  5. package/dist/auto-complete/foundation.d.ts +12 -12
  6. package/dist/auto-complete/foundation.js +51 -51
  7. package/dist/avatar/foundation.d.ts +5 -5
  8. package/dist/avatar/foundation.js +16 -16
  9. package/dist/backtop/foundation.d.ts +2 -2
  10. package/dist/backtop/foundation.js +7 -7
  11. package/dist/banner/foundation.d.ts +1 -1
  12. package/dist/banner/foundation.js +4 -4
  13. package/dist/base/auto-close-foundation.d.ts +8 -8
  14. package/dist/base/auto-close-foundation.js +15 -15
  15. package/dist/base/foundation.d.ts +4 -3
  16. package/dist/base/foundation.js +12 -11
  17. package/dist/breadcrumb/foundation.d.ts +5 -5
  18. package/dist/breadcrumb/foundation.js +9 -10
  19. package/dist/breadcrumb/item-foundation.d.ts +3 -3
  20. package/dist/breadcrumb/item-foundation.js +6 -6
  21. package/dist/calendar/event-util.js +1 -1
  22. package/dist/calendar/foundation.js +4 -4
  23. package/dist/calendar/month-foundation.d.ts +2 -2
  24. package/dist/calendar/month-foundation.js +6 -6
  25. package/dist/carousel/foundation.d.ts +17 -17
  26. package/dist/carousel/foundation.js +51 -51
  27. package/dist/cascader/foundation.d.ts +34 -26
  28. package/dist/cascader/foundation.js +143 -121
  29. package/dist/checkbox/checkbox-foundation.d.ts +2 -2
  30. package/dist/checkbox/checkbox-foundation.js +15 -15
  31. package/dist/checkbox/checkbox-group-foundation.d.ts +2 -2
  32. package/dist/checkbox/checkbox-group-foundation.js +8 -8
  33. package/dist/code-highlight/index.d.ts +1 -1
  34. package/dist/code-highlight/index.js +3 -3
  35. package/dist/collapse/foundation.d.ts +2 -2
  36. package/dist/collapse/foundation.js +7 -7
  37. package/dist/collapsible/foundation.d.ts +3 -3
  38. package/dist/collapsible/foundation.js +8 -8
  39. package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
  40. package/dist/color-picker/alpha-slider-foundation.js +10 -10
  41. package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
  42. package/dist/color-picker/color-choose-area-foundation.js +14 -14
  43. package/dist/color-picker/color-slider-foundation.d.ts +2 -4
  44. package/dist/color-picker/color-slider-foundation.js +10 -10
  45. package/dist/color-picker/data-part-foundation.d.ts +5 -5
  46. package/dist/color-picker/data-part-foundation.js +11 -11
  47. package/dist/color-picker/foundation.d.ts +4 -4
  48. package/dist/color-picker/foundation.js +10 -10
  49. package/dist/config-provider/breakpoint-observer.d.ts +3 -3
  50. package/dist/config-provider/breakpoint-observer.js +6 -6
  51. package/dist/cropper/foundation.d.ts +15 -15
  52. package/dist/cropper/foundation.js +26 -23
  53. package/dist/date-picker/_utils/picker-type.d.ts +1 -1
  54. package/dist/date-picker/foundation.d.ts +36 -36
  55. package/dist/date-picker/foundation.js +125 -129
  56. package/dist/date-picker/input-foundation.d.ts +9 -9
  57. package/dist/date-picker/input-foundation.js +28 -28
  58. package/dist/date-picker/months-grid-foundation.d.ts +16 -16
  59. package/dist/date-picker/months-grid-foundation.js +64 -65
  60. package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
  61. package/dist/date-picker/year-and-month-foundation.js +11 -11
  62. package/dist/drag-move/foundation.d.ts +2 -2
  63. package/dist/drag-move/foundation.js +15 -13
  64. package/dist/dropdown/foundation.d.ts +8 -5
  65. package/dist/dropdown/foundation.js +32 -28
  66. package/dist/dropdown/menu-foundation.d.ts +1 -1
  67. package/dist/dropdown/menu-foundation.js +11 -11
  68. package/dist/feedback/foundation.d.ts +9 -9
  69. package/dist/feedback/foundation.js +33 -33
  70. package/dist/form/form-api-proxy.d.ts +8 -7
  71. package/dist/form/form-api-proxy.js +25 -25
  72. package/dist/form/foundation.d.ts +5 -5
  73. package/dist/form/foundation.js +60 -61
  74. package/dist/highlight/foundation.js +1 -1
  75. package/dist/hot-keys/foundation.d.ts +2 -2
  76. package/dist/hot-keys/foundation.js +5 -5
  77. package/dist/image/image-foundation.d.ts +4 -4
  78. package/dist/image/image-foundation.js +10 -10
  79. package/dist/image/preview-footer-foundation.d.ts +3 -3
  80. package/dist/image/preview-footer-foundation.js +10 -10
  81. package/dist/image/preview-foundation.js +7 -6
  82. package/dist/image/preview-image-foundation.d.ts +6 -8
  83. package/dist/image/preview-image-foundation.js +14 -14
  84. package/dist/image/preview-inner-foundation.d.ts +9 -9
  85. package/dist/image/preview-inner-foundation.js +38 -38
  86. package/dist/input/foundation.d.ts +10 -10
  87. package/dist/input/foundation.js +47 -49
  88. package/dist/input/text-entry-foundation.d.ts +3 -3
  89. package/dist/input/text-entry-foundation.js +14 -14
  90. package/dist/input/textarea-foundation.d.ts +7 -7
  91. package/dist/input/textarea-foundation.js +36 -36
  92. package/dist/input-number/foundation.d.ts +16 -14
  93. package/dist/input-number/foundation.js +54 -53
  94. package/dist/json-viewer/foundation.d.ts +8 -8
  95. package/dist/json-viewer/foundation.js +23 -23
  96. package/dist/lottie/foundation.d.ts +1 -1
  97. package/dist/lottie/foundation.js +4 -4
  98. package/dist/markdown-render/foundation.d.ts +1 -1
  99. package/dist/markdown-render/foundation.js +4 -4
  100. package/dist/modal/modal-content-foundation.d.ts +7 -7
  101. package/dist/modal/modal-content-foundation.js +20 -20
  102. package/dist/modal/modal-foundation.d.ts +6 -6
  103. package/dist/modal/modal-foundation.js +24 -24
  104. package/dist/navigation/foundation.d.ts +1 -1
  105. package/dist/navigation/foundation.js +14 -14
  106. package/dist/navigation/item-foundation.d.ts +1 -1
  107. package/dist/navigation/item-foundation.js +8 -8
  108. package/dist/navigation/sub-nav-foundation.d.ts +3 -3
  109. package/dist/navigation/sub-nav-foundation.js +17 -17
  110. package/dist/notification/notification-list-foundation.d.ts +7 -7
  111. package/dist/notification/notification-list-foundation.js +12 -12
  112. package/dist/overflow-list/foundation.d.ts +4 -4
  113. package/dist/overflow-list/foundation.js +18 -18
  114. package/dist/pagination/foundation.d.ts +8 -8
  115. package/dist/pagination/foundation.js +28 -28
  116. package/dist/pincode/foundation.d.ts +5 -5
  117. package/dist/pincode/foundation.js +22 -22
  118. package/dist/popconfirm/popconfirm-foundation.d.ts +7 -7
  119. package/dist/popconfirm/popconfirm-foundation.js +26 -26
  120. package/dist/radio/radio-foundation.d.ts +5 -5
  121. package/dist/radio/radio-foundation.js +15 -15
  122. package/dist/radio/radio-group-foundation.d.ts +2 -2
  123. package/dist/radio/radio-group-foundation.js +9 -9
  124. package/dist/rating/foundation.d.ts +10 -10
  125. package/dist/rating/foundation.js +35 -35
  126. package/dist/resizable/group/index.d.ts +6 -6
  127. package/dist/resizable/group/index.js +40 -40
  128. package/dist/resizable/single/index.d.ts +2 -2
  129. package/dist/resizable/single/index.js +9 -9
  130. package/dist/scroll-list/item-foundation.d.ts +7 -7
  131. package/dist/scroll-list/item-foundation.js +35 -35
  132. package/dist/select/foundation.d.ts +42 -56
  133. package/dist/select/foundation.js +214 -279
  134. package/dist/select/option-foundation.d.ts +23 -27
  135. package/dist/select/option-foundation.js +10 -18
  136. package/dist/side-sheet/side-sheet-foundation.d.ts +6 -6
  137. package/dist/side-sheet/side-sheet-foundation.js +22 -22
  138. package/dist/slider/foundation.d.ts +16 -16
  139. package/dist/slider/foundation.js +46 -46
  140. package/dist/sortable/accessibility.d.ts +1 -1
  141. package/dist/sortable/accessibility.js +2 -2
  142. package/dist/spin/foundation.d.ts +2 -2
  143. package/dist/spin/foundation.js +6 -6
  144. package/dist/steps/utils.d.ts +1 -1
  145. package/dist/switch/foundation.d.ts +2 -2
  146. package/dist/switch/foundation.js +7 -7
  147. package/dist/table/foundation.d.ts +14 -14
  148. package/dist/table/foundation.js +93 -93
  149. package/dist/table/utils.d.ts +2 -2
  150. package/dist/tabs/foundation.d.ts +5 -5
  151. package/dist/tabs/foundation.js +17 -17
  152. package/dist/tag-input/foundation.d.ts +11 -11
  153. package/dist/tag-input/foundation.js +52 -52
  154. package/dist/time-picker/foundation.d.ts +13 -13
  155. package/dist/time-picker/foundation.js +39 -39
  156. package/dist/time-picker/input-foundation.d.ts +4 -4
  157. package/dist/time-picker/input-foundation.js +13 -13
  158. package/dist/toast/toast-list-foundation.d.ts +7 -7
  159. package/dist/toast/toast-list-foundation.js +14 -14
  160. package/dist/tooltip/foundation.d.ts +9 -9
  161. package/dist/tooltip/foundation.js +67 -61
  162. package/dist/transfer/foundation.d.ts +22 -9
  163. package/dist/transfer/foundation.js +38 -23
  164. package/dist/tree/foundation.d.ts +14 -14
  165. package/dist/tree/foundation.js +61 -61
  166. package/dist/tree/shared.d.ts +1 -1
  167. package/dist/tree-select/foundation.d.ts +26 -20
  168. package/dist/tree-select/foundation.js +91 -83
  169. package/dist/typography/ellipsis.d.ts +4 -4
  170. package/dist/typography/ellipsis.js +8 -8
  171. package/dist/typography/format-numeral.d.ts +1 -1
  172. package/dist/typography/format-numeral.js +2 -2
  173. package/dist/upload/constants.d.ts +1 -1
  174. package/dist/upload/foundation.d.ts +17 -17
  175. package/dist/upload/foundation.js +92 -92
  176. package/dist/upload/utils.d.ts +3 -3
  177. package/dist/upload/utils.js +6 -6
  178. package/dist/user-guide/foundation.d.ts +3 -3
  179. package/dist/user-guide/foundation.js +19 -19
  180. package/dist/utils/a11y.d.ts +1 -1
  181. package/dist/utils/announcer.d.ts +2 -2
  182. package/dist/utils/announcer.js +4 -4
  183. package/dist/utils/focus-handle.d.ts +1 -1
  184. package/dist/utils/focus-handle.js +1 -2
  185. package/dist/utils/focus-scope.d.ts +5 -5
  186. package/dist/utils/focus-scope.js +10 -10
  187. package/dist/utils/is-promise.d.ts +1 -1
  188. package/dist/utils/release-holder.d.ts +2 -2
  189. package/dist/utils/release-holder.js +4 -4
  190. package/dist/video-player/foundation.d.ts +15 -15
  191. package/dist/video-player/foundation.js +89 -89
  192. package/dist/video-player/progress-foundation.d.ts +2 -2
  193. package/dist/video-player/progress-foundation.js +12 -12
  194. package/package.json +2 -2
@@ -77,10 +77,10 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
77
77
  else if (checkRelation === "unRelated") keyList = key;
78
78
  const props = this.getProps();
79
79
  const nodes = keyList.map((key) => TreeSelectFoundation.getNodeData(key, keyEntities, props));
80
- if (this.getProp("onChangeWithObject")) this._adapter.notifyChangeWithObject(nodes, e);
80
+ if (this.getProp("onChangeWithObject")) this.adapter.notifyChangeWithObject(nodes, e);
81
81
  else {
82
82
  const value = getValueOrKey(nodes, keyMaps);
83
- this._adapter.notifyChange(value, nodes, e);
83
+ this.adapter.notifyChange(value, nodes, e);
84
84
  }
85
85
  }
86
86
  #notifyChange(key, e) {
@@ -90,19 +90,19 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
90
90
  else {
91
91
  const nodes = key === void 0 ? key : keyEntities[key].data;
92
92
  const value = key === void 0 ? key : getValueOrKey(nodes, keyMaps);
93
- if (this.getProp("onChangeWithObject")) this._adapter.notifyChangeWithObject(nodes, e);
94
- else this._adapter.notifyChange(value, nodes, e);
93
+ if (this.getProp("onChangeWithObject")) this.adapter.notifyChangeWithObject(nodes, e);
94
+ else this.adapter.notifyChange(value, nodes, e);
95
95
  }
96
96
  }
97
97
  #notifyFocus(e) {
98
98
  if (!this.#blurPending && !this.#isDisabled()) {
99
99
  this.#blurPending = true;
100
- this._adapter.notifyFocus(e);
100
+ this.adapter.notifyFocus(e);
101
101
  }
102
102
  }
103
103
  #notifyBlur(e) {
104
104
  this.#blurPending = false;
105
- this._adapter.notifyBlur(e);
105
+ this.adapter.notifyBlur(e);
106
106
  }
107
107
  /** Loads a node's children once, after it is expanded */
108
108
  #handleNodeLoad(key, data) {
@@ -113,30 +113,30 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
113
113
  const newLoadedKeys = new Set(this.getState("loadedKeys")).add(key);
114
114
  const newLoadingKeys = new Set(this.getState("loadingKeys"));
115
115
  newLoadingKeys.delete(key);
116
- this._adapter.notifyLoad(newLoadedKeys, data);
117
- if (!this.#isLoadControlled()) this._adapter.updateState({ loadedKeys: newLoadedKeys });
118
- this._adapter.updateState({ loadingKeys: newLoadingKeys });
116
+ this.adapter.notifyLoad(newLoadedKeys, data);
117
+ if (!this.#isLoadControlled()) this.adapter.updateState({ loadedKeys: newLoadedKeys });
118
+ this.adapter.updateState({ loadingKeys: newLoadingKeys });
119
119
  }).finally(() => {
120
120
  const currentLoadingKeys = this.getState("loadingKeys");
121
121
  if (currentLoadingKeys.has(key)) {
122
122
  const newLoadingKeys = new Set(currentLoadingKeys);
123
123
  newLoadingKeys.delete(key);
124
- this._adapter.updateState({ loadingKeys: newLoadingKeys });
124
+ this.adapter.updateState({ loadingKeys: newLoadingKeys });
125
125
  }
126
126
  });
127
- this._adapter.updateState({ loadingKeys: new Set(loadingKeys).add(key) });
127
+ this.adapter.updateState({ loadingKeys: new Set(loadingKeys).add(key) });
128
128
  }
129
129
  #focusInput() {
130
- this._adapter.focusInput();
130
+ this.adapter.focusInput();
131
131
  }
132
132
  #handleTriggerFocus(e) {
133
- this._adapter.updateIsFocus(true);
133
+ this.adapter.updateIsFocus(true);
134
134
  this.#notifyFocus(e);
135
135
  }
136
136
  #open() {
137
137
  if (this.getProp("filterTreeNode")) this.#clearInput();
138
- this._adapter.openMenu();
139
- this._adapter.notifyVisibleChange(true);
138
+ this.adapter.openMenu();
139
+ this.adapter.notifyVisibleChange(true);
140
140
  }
141
141
  #clearInput() {
142
142
  const { expandedKeys, selectedKeys, keyEntities, treeData } = this.getStates();
@@ -145,7 +145,7 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
145
145
  const expandedOptsKeys = this.#isExpandControlled() ? [] : findAncestorKeys(selectedKeys, keyEntities, false);
146
146
  expandedOptsKeys.forEach((item) => newExpandedKeys.add(item));
147
147
  const newFlattenNodes = flattenTreeData(treeData, newExpandedKeys, keyMaps);
148
- this._adapter.updateState({
148
+ this.adapter.updateState({
149
149
  expandedKeys: newExpandedKeys,
150
150
  flattenNodes: newFlattenNodes,
151
151
  inputValue: "",
@@ -156,11 +156,11 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
156
156
  });
157
157
  }
158
158
  #handleInputChange(searchValue) {
159
- this._adapter.updateInputValue(searchValue);
159
+ this.adapter.updateInputValue(searchValue);
160
160
  const { expandedKeys, selectedKeys, keyEntities, treeData } = this.getStates();
161
161
  const { showFilteredOnly, filterTreeNode, treeNodeFilterProp, keyMaps, remote } = this.getProps();
162
162
  if (remote) {
163
- this._adapter.notifySearch(searchValue, [], []);
163
+ this.adapter.notifySearch(searchValue, [], []);
164
164
  return;
165
165
  }
166
166
  const realFilterProp = getFilterProp(treeNodeFilterProp, keyMaps);
@@ -188,8 +188,8 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
188
188
  newFlattenNodes = flattenTreeData(treeData, new Set(expandedOptsKeys), keyMaps, showFilteredOnly && filteredShownKeys);
189
189
  }
190
190
  const newFilteredExpandedKeys = new Set(expandedOptsKeys);
191
- this._adapter.notifySearch(searchValue, Array.from(newFilteredExpandedKeys), filteredNodes);
192
- this._adapter.updateState({
191
+ this.adapter.notifySearch(searchValue, Array.from(newFilteredExpandedKeys), filteredNodes);
192
+ this.adapter.updateState({
193
193
  expandedKeys: newExpandedKeys,
194
194
  flattenNodes: newFlattenNodes,
195
195
  motionKeys: /* @__PURE__ */ new Set([]),
@@ -201,14 +201,14 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
201
201
  #handleSingleSelect(e, { selected, eventKey, data, children }) {
202
202
  let selectedKeys = [...this.getState("selectedKeys")];
203
203
  const { clickToHide } = this.getProps();
204
- this._adapter.notifySelect(eventKey, true, data);
204
+ this.adapter.notifySelect(eventKey, true, data);
205
205
  if (!selectedKeys.includes(eventKey) && !selected) {
206
206
  selectedKeys = [eventKey];
207
207
  this.#notifyChange(eventKey, e);
208
- if (!this._isControlledComponent()) this._adapter.updateState({ selectedKeys });
208
+ if (!this.isControlledComponent()) this.adapter.updateState({ selectedKeys });
209
209
  }
210
210
  if (clickToHide && (this.#isSelectToClose() || !children)) {
211
- if (this.#blurPending) this._adapter.focusTrigger();
211
+ if (this.#blurPending) this.adapter.focusTrigger();
212
212
  this.close();
213
213
  this.handleTriggerBlur(e);
214
214
  }
@@ -218,9 +218,9 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
218
218
  const state = this.getStates();
219
219
  const result = getMultipleSelectResult(treeNode, props, state);
220
220
  if (result) {
221
- this._adapter.notifySelect(treeNode.eventKey, result.targetStatus, treeNode.data);
221
+ this.adapter.notifySelect(treeNode.eventKey, result.targetStatus, treeNode.data);
222
222
  this.#notifyChange(result.keys, e);
223
- if (!this._isControlledComponent()) this._adapter.updateState(result.state);
223
+ if (!this.isControlledComponent()) this.adapter.updateState(result.state);
224
224
  }
225
225
  if (props.searchPosition === strings.SEARCH_POSITION_TRIGGER && state.inputValue !== "") this.#handleInputChange("");
226
226
  }
@@ -235,7 +235,7 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
235
235
  filteredExpandedKeys.delete(eventKey);
236
236
  motionType = "hide";
237
237
  }
238
- this._adapter.setCachedFlattenNodes(motionType === "hide" && this.#isAnimated() ? this.getState("flattenNodes") : void 0);
238
+ this.adapter.setCachedFlattenNodes(motionType === "hide" && this.#isAnimated() ? this.getState("flattenNodes") : void 0);
239
239
  if (!this.#isExpandControlled()) {
240
240
  const flattenNodes = flattenTreeData(treeData, filteredExpandedKeys, keyMaps, showFilteredOnly && filteredShownKeys);
241
241
  let motionKeys = this.#isAnimated() ? getMotionKeys(eventKey, filteredExpandedKeys, keyEntities) : [];
@@ -246,9 +246,9 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
246
246
  motionKeys: new Set(motionKeys),
247
247
  motionType
248
248
  };
249
- this._adapter.updateState(newState);
249
+ this.adapter.updateState(newState);
250
250
  }
251
- this._adapter.notifyExpand(filteredExpandedKeys, {
251
+ this.adapter.notifyExpand(filteredExpandedKeys, {
252
252
  expanded: !expanded,
253
253
  node: data
254
254
  });
@@ -398,8 +398,7 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
398
398
  };
399
399
  }
400
400
  /** The keys the trigger shows: the selection, or in multiple mode the checked keys merged as onChange reports them */
401
- static getTriggerKeys(props, state) {
402
- const { checkedKeys, realCheckedKeys, keyEntities, selectedKeys } = state;
401
+ static getTriggerKeys(props, { checkedKeys, realCheckedKeys, keyEntities, selectedKeys }) {
403
402
  if (!props.multiple) return selectedKeys;
404
403
  if (props.checkRelation === "unRelated") return [...realCheckedKeys];
405
404
  if (props.autoMergeValue || props.leafOnly) return normalizeKeyList([...checkedKeys], keyEntities, props.leafOnly, true);
@@ -435,50 +434,59 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
435
434
  if (triggerSearchAutoFocus && able) this.#handleTriggerFocus(null);
436
435
  }
437
436
  /** Writes the state derived from new props back, so handlers read what was rendered */
438
- syncDerivedState(derived) {
439
- this._adapter.updateState(derived);
440
- }
437
+ syncDerivedState = (derived) => {
438
+ this.adapter.updateState(derived);
439
+ };
441
440
  /** Searches as if `value` were typed, opening the dropdown first */
442
- search(value) {
441
+ search = (value) => {
443
442
  if (!this.getState("isOpen")) this.#open();
444
443
  this.#handleInputChange(value);
445
- }
444
+ };
446
445
  /** Focus entering the trigger (its search input, tags, clear button) or the dropdown from outside */
447
- handleTriggerFocus(e) {
446
+ handleTriggerFocus = (e) => {
448
447
  this.#notifyFocus(e);
449
- }
448
+ };
450
449
  /**
451
450
  * Reports the blur once per focus: on a mousedown outside, a single pick that closes, or the focus leaving the
452
451
  * trigger and the dropdown (the component checks where it went)
453
452
  */
454
453
  handleTriggerBlur(e) {
455
454
  if (!this.#blurPending) return;
456
- this._adapter.updateIsFocus(false);
455
+ this.adapter.updateIsFocus(false);
457
456
  this.#notifyBlur(e);
458
457
  }
458
+ /**
459
+ * The focus left the trigger and the dropdown (the component checks where it went): reports the blur, and closes
460
+ * an open dropdown when the focus went to another element (APG combobox). A window blur has no target and keeps
461
+ * the dropdown, as the native select does.
462
+ */
463
+ handleFocusLeave = (e) => {
464
+ this.handleTriggerBlur(e);
465
+ if (e.relatedTarget && this.getState("isOpen")) this.close();
466
+ };
459
467
  /** A mousedown outside the trigger and the dropdown, listened to while the TreeSelect is focused or open */
460
- handleClickOutside(e) {
468
+ handleClickOutside = (e) => {
461
469
  this.handleTriggerBlur(e);
462
470
  if (this.getState("isOpen")) this.close();
463
- }
464
- handleKeyDown(e) {
471
+ };
472
+ handleKeyDown = (e) => {
465
473
  if (e.key === "Escape") {
466
474
  if (this.getState("isOpen")) {
467
475
  e.preventDefault();
468
- this._adapter.focusTrigger();
476
+ this.adapter.focusTrigger();
469
477
  this.close();
470
478
  }
471
479
  }
472
- }
473
- onClickSingleTriggerSearchItem() {
480
+ };
481
+ onClickSingleTriggerSearchItem = () => {
474
482
  this.#focusInput();
475
- }
476
- close() {
477
- this._adapter.closeMenu();
478
- this._adapter.notifyVisibleChange(false);
479
- if (this.getProp("motionExpand")) this._adapter.updateState({ motionKeys: /* @__PURE__ */ new Set([]) });
480
- }
481
- handleClick(e) {
483
+ };
484
+ close = () => {
485
+ this.adapter.closeMenu();
486
+ this.adapter.notifyVisibleChange(false);
487
+ if (this.getProp("motionExpand")) this.adapter.updateState({ motionKeys: /* @__PURE__ */ new Set([]) });
488
+ };
489
+ handleClick = (e) => {
482
490
  const isDisabled = this.#isDisabled();
483
491
  const { isOpen, inputValue, isFocus } = this.getStates();
484
492
  const { searchPosition, clickTriggerToHide } = this.getProps();
@@ -491,27 +499,27 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
491
499
  if (clickTriggerToHide) this.close();
492
500
  } else this.#open();
493
501
  }
494
- }
502
+ };
495
503
  /**
496
504
  * Enter toggles the popup like a click; Down and Up open a closed one (APG combobox). Outside a text field (the
497
505
  * select-only combobox) Space toggles it like Enter, and Home and End open a closed one: the view moves to the
498
506
  * first or the last row, which lives in the view.
499
507
  */
500
- handleSelectionKeyDown(e) {
508
+ handleSelectionKeyDown = (e) => {
501
509
  const editing = isTextEditor(e.target);
502
510
  if (!this.getState("isOpen") && (e.key === "ArrowDown" || e.key === "ArrowUp" || !editing && (e.key === "Home" || e.key === "End")) || isEnterPress(e) || e.key === " " && !editing) {
503
511
  e.preventDefault();
504
512
  this.handleClick(e);
505
513
  }
506
- }
507
- handleClear(e) {
514
+ };
515
+ handleClear = (e) => {
508
516
  const { searchPosition, filterTreeNode } = this.getProps();
509
517
  const { inputValue, selectedKeys } = this.getStates();
510
- const isControlled = this._isControlledComponent();
518
+ const isControlled = this.isControlledComponent();
511
519
  const value = this.#isMultiple() ? [] : void 0;
512
520
  const hasValue = TreeSelectFoundation.hasValue(this.getProps(), this.getStates());
513
521
  if (hasValue) this.#notifyChange(value, e);
514
- if (hasValue && !isControlled) this._adapter.updateState({
522
+ if (hasValue && !isControlled) this.adapter.updateState({
515
523
  selectedKeys: [],
516
524
  checkedKeys: /* @__PURE__ */ new Set(),
517
525
  halfCheckedKeys: /* @__PURE__ */ new Set(),
@@ -523,9 +531,9 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
523
531
  else this.#clearInput();
524
532
  }
525
533
  }
526
- this._adapter.notifyClear(e);
527
- }
528
- removeTag(eventKey) {
534
+ this.adapter.notifyClear(e);
535
+ };
536
+ removeTag = (eventKey) => {
529
537
  const props = this.getProps();
530
538
  const { disableStrictly, checkRelation, keyMaps } = props;
531
539
  const state = this.getStates();
@@ -536,23 +544,23 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
536
544
  const newRealCheckedKeys = new Set(realCheckedKeys);
537
545
  newRealCheckedKeys.delete(eventKey);
538
546
  this.#notifyChange([...newRealCheckedKeys], null);
539
- if (!this._isControlledComponent()) this._adapter.updateState({ realCheckedKeys: newRealCheckedKeys });
547
+ if (!this.isControlledComponent()) this.adapter.updateState({ realCheckedKeys: newRealCheckedKeys });
540
548
  } else if (checkRelation === "related") {
541
549
  const { checkedKeys, halfCheckedKeys } = calcRelatedCheckedKeys(eventKey, false, disableStrictly, state);
542
550
  this.#notifyChange([...checkedKeys], null);
543
- if (!this._isControlledComponent()) this._adapter.updateState({
551
+ if (!this.isControlledComponent()) this.adapter.updateState({
544
552
  checkedKeys,
545
553
  halfCheckedKeys
546
554
  });
547
555
  }
548
- this._adapter.notifySelect(eventKey, false, item);
549
- }
550
- handleNodeSelect(e, treeNode) {
556
+ this.adapter.notifySelect(eventKey, false, item);
557
+ };
558
+ handleNodeSelect = (e, treeNode) => {
551
559
  if (this.#isDisabled(treeNode)) return;
552
560
  if (!this.#isMultiple()) this.#handleSingleSelect(e, treeNode);
553
561
  else this.#handleMultipleSelect(e, treeNode);
554
- }
555
- handleNodeExpand(e, treeNode) {
562
+ };
563
+ handleNodeExpand = (e, treeNode) => {
556
564
  const { loadData, keyMaps } = this.getProps();
557
565
  const { inputValue, keyEntities } = this.getStates();
558
566
  const isSearching = Boolean(inputValue);
@@ -571,7 +579,7 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
571
579
  expandedKeys.delete(eventKey);
572
580
  motionType = "hide";
573
581
  }
574
- this._adapter.setCachedFlattenNodes(motionType === "hide" && this.#isAnimated() ? this.getState("flattenNodes") : void 0);
582
+ this.adapter.setCachedFlattenNodes(motionType === "hide" && this.#isAnimated() ? this.getState("flattenNodes") : void 0);
575
583
  if (!isExpandControlled) {
576
584
  const flattenNodes = flattenTreeData(treeData, expandedKeys, keyMaps);
577
585
  const motionKeys = this.#isAnimated() ? getMotionKeys(eventKey, expandedKeys, keyEntities) : [];
@@ -581,30 +589,30 @@ var TreeSelectFoundation = class TreeSelectFoundation extends BaseFoundation {
581
589
  motionKeys: new Set(motionKeys),
582
590
  motionType
583
591
  };
584
- this._adapter.updateState(newState);
592
+ this.adapter.updateState(newState);
585
593
  }
586
- this._adapter.notifyExpand(expandedKeys, {
594
+ this.adapter.notifyExpand(expandedKeys, {
587
595
  expanded: !expanded,
588
596
  node: data
589
597
  });
590
598
  if (!expanded) this.#handleNodeLoad(eventKey, data);
591
- }
592
- handleInputTriggerBlur(e) {
593
- if (this._adapter.isInTrigger(e?.relatedTarget)) return;
594
- this._adapter.updateState({ inputTriggerFocus: false });
595
- }
596
- handleInputTriggerFocus(e) {
597
- if (this._adapter.isInTrigger(e?.relatedTarget)) return;
599
+ };
600
+ handleInputTriggerBlur = (e) => {
601
+ if (this.adapter.isInTrigger(e?.relatedTarget)) return;
602
+ this.adapter.updateState({ inputTriggerFocus: false });
603
+ };
604
+ handleInputTriggerFocus = (e) => {
605
+ if (this.adapter.isInTrigger(e?.relatedTarget)) return;
598
606
  this.#clearInput();
599
- this._adapter.updateState({ inputTriggerFocus: true });
600
- }
601
- handlePopoverOpen() {
607
+ this.adapter.updateState({ inputTriggerFocus: true });
608
+ };
609
+ handlePopoverOpen = () => {
602
610
  const { filterTreeNode, searchAutoFocus, searchPosition } = this.getProps();
603
611
  if (filterTreeNode && searchPosition === strings.SEARCH_POSITION_DROPDOWN && searchAutoFocus) this.#focusInput();
604
- }
605
- handleAfterClose() {
612
+ };
613
+ handleAfterClose = () => {
606
614
  const { filterTreeNode } = this.getProps();
607
615
  if (filterTreeNode) this.#clearInput();
608
- }
616
+ };
609
617
  };
610
618
  export { TreeSelectFoundation as default, treeSelectDerivedPropKeys };
@@ -29,8 +29,8 @@ export declare function isOverflowing(node: HTMLElement, rows: number): boolean;
29
29
  */
30
30
  export declare class EllipsisRuntime {
31
31
  #private;
32
- connect(measure: () => void): void;
33
- disconnect(): void;
34
- schedule(): void;
35
- handleResize(): void;
32
+ connect: (measure: () => void) => void;
33
+ disconnect: () => void;
34
+ schedule: () => void;
35
+ handleResize: () => void;
36
36
  }
@@ -131,26 +131,26 @@ var EllipsisRuntime = class {
131
131
  #gateTimer;
132
132
  #observing = false;
133
133
  #measure = () => void 0;
134
- connect(measure) {
134
+ connect = (measure) => {
135
135
  this.#measure = measure;
136
136
  this.#gateFrame = requestAnimationFrame(() => {
137
137
  this.#gateTimer = setTimeout(() => {
138
138
  this.#observing = true;
139
139
  });
140
140
  });
141
- }
142
- disconnect() {
141
+ };
142
+ disconnect = () => {
143
143
  cancelAnimationFrame(this.#frame);
144
144
  cancelAnimationFrame(this.#gateFrame);
145
145
  clearTimeout(this.#gateTimer);
146
146
  this.#observing = false;
147
- }
148
- schedule() {
147
+ };
148
+ schedule = () => {
149
149
  cancelAnimationFrame(this.#frame);
150
150
  this.#frame = requestAnimationFrame(() => this.#measure());
151
- }
152
- handleResize() {
151
+ };
152
+ handleResize = () => {
153
153
  if (this.#observing) this.schedule();
154
- }
154
+ };
155
155
  };
156
156
  export { EllipsisRuntime, canUseCSSEllipsis, getEllipsisOpt, getRenderText, isInsideWidgetItem, isOverflowing };
@@ -5,6 +5,6 @@ type Parser = (value: string) => string;
5
5
  export default class FormatNumeral {
6
6
  #private;
7
7
  constructor(content: string, rule: Rule, precision: number, truncate: Truncate, parser?: Parser);
8
- format(): string;
8
+ format: () => string;
9
9
  }
10
10
  export {};
@@ -78,12 +78,12 @@ var FormatNumeral = class {
78
78
  if (cTLength < this.#precision) return `${cArr[0]}.${cArr[1]}${"0".repeat(this.#precision - cTLength)}`;
79
79
  return cTruncated.toString();
80
80
  }
81
- format() {
81
+ format = () => {
82
82
  if (this.#parser !== void 0) return this.#parser(this.#content);
83
83
  if (this.#rule === "text") return extractNumbers(this.#content).map((item) => checkIsNumeral(item) ? this.#truncatePrecision(item) : item).join("");
84
84
  if (this.#rule === "numbers") return extractNumbers(this.#content).filter((item) => checkIsNumeral(item)).map((item) => this.#truncatePrecision(item)).join(",");
85
85
  return extractNumbers(this.#content).map((item) => checkIsNumeral(item) ? this.#ruleMethods[this.#rule](Number(item)) : item).join("");
86
- }
86
+ };
87
87
  };
88
88
  function shiftDecimal(value, places) {
89
89
  if (!Number.isFinite(value)) return value;
@@ -11,7 +11,7 @@ export declare const strings: {
11
11
  FILE_STATUS_WAIT_UPLOAD: string;
12
12
  FILE_LIST_PIC: "picture";
13
13
  FILE_LIST_DEFAULT: "list";
14
- LIST_TYPE: ("none" | "picture" | "list")[];
14
+ LIST_TYPE: ("list" | "picture" | "none")[];
15
15
  DRAG_AREA_DEFAULT: string;
16
16
  DRAG_AREA_LEGAL: string;
17
17
  TRIGGER_AUTO: "auto";
@@ -158,30 +158,30 @@ export default class UploadFoundation<P extends UploadBaseProps = UploadBaseProp
158
158
  protected buildFileItem(fileInstance: CustomFile, uploadTrigger: string): BaseFileItem;
159
159
  protected checkFileFormat(accept: string, file: File): boolean;
160
160
  /** Closes the cropper and drops the queue; the files already cropped are discarded */
161
- cancelCrop(): void;
161
+ cancelCrop: () => void;
162
162
  /** Crops the current image, then moves to the next queued one or adds every result once the queue drains */
163
- confirmCrop(): Promise<void>;
163
+ confirmCrop: () => Promise<void>;
164
164
  /** Keep the synchronous snapshot aligned with an externally controlled fileList. */
165
- syncLatestFileList(fileList: Array<BaseFileItem>): void;
165
+ syncLatestFileList: (fileList: Array<BaseFileItem>) => void;
166
166
  /** A fileList prop that goes back to undefined clears the list (a form reset) and leaves it uncontrolled */
167
- handleFileListPropChange(fileList?: Array<BaseFileItem>): void;
167
+ handleFileListPropChange: (fileList?: Array<BaseFileItem>) => void;
168
168
  /** The list on screen: the fileList prop when controlled, otherwise the fileList state. */
169
169
  getFileList(): BaseFileItem[];
170
170
  init(): void;
171
171
  /** Adds the files of a paste on the page; the host listens only while addOnPasting is on and not disabled */
172
- handlePasting(e: ClipboardEvent): void;
172
+ handlePasting: (e: ClipboardEvent) => void;
173
173
  /** Entry for picked, dropped and pasted files: with crop on, images are cropped before they are added */
174
- addFiles(currentFileList: FileList | Array<File>): void;
174
+ addFiles: (currentFileList: FileList | Array<File>) => void;
175
175
  /** Entry for the file picked to replace the item `replaceUid` names; with crop on, an image is cropped first */
176
- handleReplaceChange(currentFileList: FileList | Array<File>): void;
177
- insertFileToList(files: Array<CustomFile>, index?: number): void;
178
- manualUpload(): void;
179
- handleRemove(file: BaseFileItem): void;
180
- handleClear(): void;
181
- handleDragEnter(e: UploadDragEvent): void;
182
- handleDrop(e: E): void;
183
- handleDragOver(e: UploadDragEvent): void;
184
- handleDragLeave(e: UploadDragEvent): void;
185
- retry(fileItem: BaseFileItem): void;
186
- handlePreviewClick(fileItem: BaseFileItem): void;
176
+ handleReplaceChange: (currentFileList: FileList | Array<File>) => void;
177
+ insertFileToList: (files: Array<CustomFile>, index?: number) => void;
178
+ manualUpload: () => void;
179
+ handleRemove: (file: BaseFileItem) => void;
180
+ handleClear: () => void;
181
+ handleDragEnter: (e: UploadDragEvent) => void;
182
+ handleDrop: (e: E) => void;
183
+ handleDragOver: (e: UploadDragEvent) => void;
184
+ handleDragLeave: (e: UploadDragEvent) => void;
185
+ retry: (fileItem: BaseFileItem) => void;
186
+ handlePreviewClick: (fileItem: BaseFileItem) => void;
187
187
  }