@fibrae/semi-foundation 0.1.0 → 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 +17 -17
  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
@@ -4,7 +4,7 @@ import { isEqual } from "es-toolkit";
4
4
  // src/navigation/foundation.ts
5
5
  var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
6
6
  #getItemKeysMap() {
7
- return NavigationFoundation.getFormattedItems(this.getProps(), this._adapter.getItemsFromChildren()).itemKeysMap;
7
+ return NavigationFoundation.getFormattedItems(this.getProps(), this.adapter.getItemsFromChildren()).itemKeysMap;
8
8
  }
9
9
  #rebuild() {
10
10
  const props = this.getProps();
@@ -12,8 +12,8 @@ var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
12
12
  const willOpenKeys = NavigationFoundation.getWillOpenKeys(props, this.getState("openKeys"), itemKeysMap);
13
13
  const willSelectedKeys = props.selectedKeys || props.defaultSelectedKeys || [];
14
14
  const selectedKeys = willSelectedKeys.concat(NavigationFoundation.getZeroParentKeys(itemKeysMap, ...willSelectedKeys));
15
- if (!isEqual(selectedKeys, this.getState("selectedKeys"))) this._adapter.updateSelectedKeys(selectedKeys);
16
- if (!isEqual(willOpenKeys, this.getState("openKeys"))) this._adapter.updateOpenKeys(willOpenKeys);
15
+ if (!isEqual(selectedKeys, this.getState("selectedKeys"))) this.adapter.updateSelectedKeys(selectedKeys);
16
+ if (!isEqual(willOpenKeys, this.getState("openKeys"))) this.adapter.updateOpenKeys(willOpenKeys);
17
17
  }
18
18
  static getZeroParentKeys(itemKeysMap = {}, ...itemKeys) {
19
19
  const willAddKeys = [];
@@ -119,7 +119,7 @@ var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
119
119
  * New items or children rebuild the menu from the props, otherwise a changed (deep compared) selectedKeys or
120
120
  * openKeys is copied into state
121
121
  */
122
- handlePropsUpdate(prevProps) {
122
+ handlePropsUpdate = (prevProps) => {
123
123
  const props = this.getProps();
124
124
  if (prevProps.items !== props.items || prevProps.children !== props.children) {
125
125
  this.#rebuild();
@@ -127,32 +127,32 @@ var NavigationFoundation = class NavigationFoundation extends BaseFoundation {
127
127
  }
128
128
  if (props.selectedKeys && !isEqual(prevProps.selectedKeys, props.selectedKeys)) {
129
129
  this.updateSelectedKeys(props.selectedKeys);
130
- this._adapter.updateOpenKeys(NavigationFoundation.getWillOpenKeys(props, this.getState("openKeys"), this.#getItemKeysMap()));
131
- } else if (prevProps.selectedKeys !== void 0 && props.selectedKeys === void 0) this._adapter.updateSelectedKeys([]);
132
- if (props.openKeys && !isEqual(prevProps.openKeys, props.openKeys)) this._adapter.updateOpenKeys(props.openKeys);
133
- else if (prevProps.openKeys !== void 0 && props.openKeys === void 0) this._adapter.updateOpenKeys(NavigationFoundation.getWillOpenKeys(props, [], this.#getItemKeysMap()));
134
- }
130
+ this.adapter.updateOpenKeys(NavigationFoundation.getWillOpenKeys(props, this.getState("openKeys"), this.#getItemKeysMap()));
131
+ } else if (prevProps.selectedKeys !== void 0 && props.selectedKeys === void 0) this.adapter.updateSelectedKeys([]);
132
+ if (props.openKeys && !isEqual(prevProps.openKeys, props.openKeys)) this.adapter.updateOpenKeys(props.openKeys);
133
+ else if (prevProps.openKeys !== void 0 && props.openKeys === void 0) this.adapter.updateOpenKeys(NavigationFoundation.getWillOpenKeys(props, [], this.#getItemKeysMap()));
134
+ };
135
135
  /**
136
136
  * Selects keys together with their top level parents
137
137
  */
138
138
  updateSelectedKeys = (keys) => {
139
139
  const parentKeys = NavigationFoundation.getZeroParentKeys(this.#getItemKeysMap(), ...keys);
140
- this._adapter.updateSelectedKeys(Array.from(new Set(keys.concat(parentKeys))));
140
+ this.adapter.updateSelectedKeys(Array.from(new Set(keys.concat(parentKeys))));
141
141
  };
142
142
  addOpenKey = (itemKey) => {
143
143
  const openKeys = new Set(this.getState("openKeys"));
144
144
  if (itemKey != null) openKeys.add(itemKey);
145
- this._adapter.updateOpenKeys(Array.from(openKeys));
145
+ this.adapter.updateOpenKeys(Array.from(openKeys));
146
146
  };
147
147
  removeOpenKey = (itemKey) => {
148
148
  const openKeys = new Set(this.getState("openKeys"));
149
149
  if (itemKey != null) openKeys.delete(itemKey);
150
- this._adapter.updateOpenKeys(Array.from(openKeys));
150
+ this.adapter.updateOpenKeys(Array.from(openKeys));
151
151
  };
152
152
  handleCollapseChange = () => {
153
153
  const isCollapsed = !NavigationFoundation.getIsCollapsed(this.getProps(), this.getStates());
154
- if (!this._isControlledComponent("isCollapsed")) this._adapter.setIsCollapsed(isCollapsed);
155
- this._adapter.notifyCollapseChange(isCollapsed);
154
+ if (!this.isControlledComponent("isCollapsed")) this.adapter.setIsCollapsed(isCollapsed);
155
+ this.adapter.notifyCollapseChange(isCollapsed);
156
156
  };
157
157
  };
158
158
  export { NavigationFoundation as default };
@@ -40,5 +40,5 @@ export declare function countPlaceholderIcons({ mode, limitIndent, isCollapsed,
40
40
  }): number;
41
41
  export default class ItemFoundation<P extends ItemProps = ItemProps, S extends object = object> extends BaseFoundation<ItemAdapter<P, S>, P, S> {
42
42
  protected isValidKey(itemKey: string): boolean;
43
- handleClick(e: MouseEvent | KeyboardEvent): void;
43
+ handleClick: (e: MouseEvent | KeyboardEvent) => void;
44
44
  }
@@ -10,33 +10,33 @@ var ItemFoundation = class extends BaseFoundation {
10
10
  isValidKey(itemKey) {
11
11
  return itemKey != null && (typeof itemKey === "string" || typeof itemKey === "number");
12
12
  }
13
- handleClick(e) {
13
+ handleClick = (e) => {
14
14
  const { isSubNav, itemKey, text, disabled } = this.getProps();
15
15
  if (disabled) return;
16
- const wasSelected = this._adapter.getSelected();
17
- if (!isSubNav && this.isValidKey(itemKey) && !this._adapter.getSelectedKeysIsControlled() && !wasSelected) this._adapter.selectSelf();
16
+ const wasSelected = this.adapter.getSelected();
17
+ if (!isSubNav && this.isValidKey(itemKey) && !this.adapter.getSelectedKeysIsControlled() && !wasSelected) this.adapter.selectSelf();
18
18
  const selectedKeys = [itemKey];
19
19
  if (!isSubNav) {
20
20
  if (!wasSelected) {
21
- const selectedItems = [this._adapter.cloneDeep(this.getProps())];
22
- this._adapter.notifyGlobalOnSelect({
21
+ const selectedItems = [this.adapter.cloneDeep(this.getProps())];
22
+ this.adapter.notifyGlobalOnSelect({
23
23
  itemKey,
24
24
  selectedKeys,
25
25
  selectedItems,
26
26
  domEvent: e
27
27
  });
28
28
  }
29
- this._adapter.notifyGlobalOnClick({
29
+ this.adapter.notifyGlobalOnClick({
30
30
  itemKey,
31
31
  text,
32
32
  domEvent: e
33
33
  });
34
34
  }
35
- this._adapter.notifyClick({
35
+ this.adapter.notifyClick({
36
36
  itemKey,
37
37
  text,
38
38
  domEvent: e
39
39
  });
40
- }
40
+ };
41
41
  };
42
42
  export { countPlaceholderIcons, ItemFoundation as default };
@@ -21,11 +21,11 @@ export interface SubNavBaseProps {
21
21
  disabled?: boolean;
22
22
  }
23
23
  export default class SubNavFoundation<P extends SubNavBaseProps = SubNavBaseProps, S extends object = object> extends BaseFoundation<SubNavAdapter<P, S>, P, S> {
24
- handleDropdownVisibleChange(visible: boolean): void;
25
- handleClick(e: MouseEvent | KeyboardEvent): void;
24
+ handleDropdownVisibleChange: (visible: boolean) => void;
25
+ handleClick: (e: MouseEvent | KeyboardEvent) => void;
26
26
  /**
27
27
  * Only reports the click: the Dropdown owns the open state and reports it through handleDropdownVisibleChange,
28
28
  * so toggling here would emit a second, possibly contradictory openChange.
29
29
  */
30
- handlePopupClick(e: MouseEvent | KeyboardEvent): void;
30
+ handlePopupClick: (e: MouseEvent | KeyboardEvent) => void;
31
31
  }
@@ -11,44 +11,44 @@ function removeKeys(originKeys = [], ...willRemoveKeys) {
11
11
  return Array.from(keySet);
12
12
  }
13
13
  var SubNavFoundation = class extends BaseFoundation {
14
- handleDropdownVisibleChange(visible) {
14
+ handleDropdownVisibleChange = (visible) => {
15
15
  const itemKey = this.getProp("itemKey");
16
- const rawOpenKeys = this._adapter.getOpenKeys();
16
+ const rawOpenKeys = this.adapter.getOpenKeys();
17
17
  const openKeys = visible ? addKeys(rawOpenKeys, itemKey) : removeKeys(rawOpenKeys, itemKey);
18
- this._adapter.updateOpen(visible);
19
- this._adapter.notifyGlobalOpenChange({
18
+ this.adapter.updateOpen(visible);
19
+ this.adapter.notifyGlobalOpenChange({
20
20
  itemKey,
21
21
  openKeys,
22
22
  isOpen: visible
23
23
  });
24
- }
25
- handleClick(e) {
24
+ };
25
+ handleClick = (e) => {
26
26
  const { itemKey, disabled } = this.getProps();
27
27
  if (disabled) return;
28
- const isOpen = !this._adapter.getIsOpen();
28
+ const isOpen = !this.adapter.getIsOpen();
29
29
  const cbVal = {
30
30
  itemKey,
31
- openKeys: isOpen ? addKeys(this._adapter.getOpenKeys(), itemKey) : removeKeys(this._adapter.getOpenKeys(), itemKey),
31
+ openKeys: isOpen ? addKeys(this.adapter.getOpenKeys(), itemKey) : removeKeys(this.adapter.getOpenKeys(), itemKey),
32
32
  isOpen,
33
33
  domEvent: e
34
34
  };
35
- if (!this._adapter.getOpenKeysIsControlled()) this._adapter.updateOpen(isOpen);
36
- this._adapter.notifyGlobalOpenChange(cbVal);
37
- this._adapter.notifyGlobalOnClick(cbVal);
38
- }
35
+ if (!this.adapter.getOpenKeysIsControlled()) this.adapter.updateOpen(isOpen);
36
+ this.adapter.notifyGlobalOpenChange(cbVal);
37
+ this.adapter.notifyGlobalOnClick(cbVal);
38
+ };
39
39
  /**
40
40
  * Only reports the click: the Dropdown owns the open state and reports it through handleDropdownVisibleChange,
41
41
  * so toggling here would emit a second, possibly contradictory openChange.
42
42
  */
43
- handlePopupClick(e) {
43
+ handlePopupClick = (e) => {
44
44
  const { itemKey, disabled } = this.getProps();
45
45
  if (disabled) return;
46
- this._adapter.notifyGlobalOnClick({
46
+ this.adapter.notifyGlobalOnClick({
47
47
  itemKey,
48
- openKeys: this._adapter.getOpenKeys(),
49
- isOpen: this._adapter.getIsOpen(),
48
+ openKeys: this.adapter.getOpenKeys(),
49
+ isOpen: this.adapter.getIsOpen(),
50
50
  domEvent: e
51
51
  });
52
- }
52
+ };
53
53
  };
54
54
  export { SubNavFoundation as default };
@@ -35,7 +35,7 @@ export default class NotificationListStore {
35
35
  icon?: any;
36
36
  getPopupContainer?: () => HTMLElement;
37
37
  theme?: NoticeTheme;
38
- direction?: "ltr" | "rtl";
38
+ direction?: "rtl" | "ltr";
39
39
  className?: string;
40
40
  style?: any;
41
41
  stack?: boolean | number;
@@ -47,10 +47,10 @@ export default class NotificationListStore {
47
47
  subscribe: (listener: () => void) => () => void;
48
48
  getSnapshot: () => NotificationListState;
49
49
  /** Shows a notice, or updates the shown one with the same id */
50
- add(notice: NoticeInstance): void;
51
- remove(id: string): void;
52
- finishLeave(id: string): void;
53
- clear(): void;
54
- config(opts: ConfigProps): void;
55
- resetConfig(): void;
50
+ add: (notice: NoticeInstance) => void;
51
+ remove: (id: string) => void;
52
+ finishLeave: (id: string) => void;
53
+ clear: () => void;
54
+ config: (opts: ConfigProps) => void;
55
+ resetConfig: () => void;
56
56
  }
@@ -18,19 +18,19 @@ var NotificationListStore = class {
18
18
  subscribe = (listener) => this.#items.subscribe(listener);
19
19
  getSnapshot = () => this.#items.getSnapshot();
20
20
  /** Shows a notice, or updates the shown one with the same id */
21
- add(notice) {
21
+ add = (notice) => {
22
22
  this.#items.add(notice);
23
- }
24
- remove(id) {
23
+ };
24
+ remove = (id) => {
25
25
  this.#items.remove(id);
26
- }
27
- finishLeave(id) {
26
+ };
27
+ finishLeave = (id) => {
28
28
  this.#items.finishLeave(id);
29
- }
30
- clear() {
29
+ };
30
+ clear = () => {
31
31
  this.#items.clear();
32
- }
33
- config(opts) {
32
+ };
33
+ config = (opts) => {
34
34
  for (const pos of [
35
35
  "top",
36
36
  "left",
@@ -41,9 +41,9 @@ var NotificationListStore = class {
41
41
  if (typeof opts.duration === "number") this.defaults.duration = opts.duration;
42
42
  if (typeof opts.position === "string") this.defaults.position = opts.position;
43
43
  if ("stack" in opts) this.defaults.stack = opts.stack;
44
- }
45
- resetConfig() {
44
+ };
45
+ resetConfig = () => {
46
46
  this.defaults = { ...builtInDefaults };
47
- }
47
+ };
48
48
  };
49
49
  export { NotificationListStore as default };
@@ -71,8 +71,8 @@ export default class OverflowListFoundation<P extends OverflowListBaseProps = Ov
71
71
  /** The view a change of items or style starts from; the measurement then settles it */
72
72
  static resetView({ items, style, renderMode, collapseFrom, itemKey }: OverflowListBaseProps, view: OverflowListView, containerWidth: number): OverflowListView;
73
73
  /** Returns whether the list must be measured again: an item changed width, or every visible item has reported */
74
- recordItemSize(key: ItemKey, width: number, maxCount: number): boolean;
75
- handleKeysChange(keys: ItemKey[]): void;
76
- handleIntersect(entries: Array<IntersectionObserverEntry>): void;
77
- handleCollapseOverflow(): void;
74
+ recordItemSize: (key: ItemKey, width: number, maxCount: number) => boolean;
75
+ handleKeysChange: (keys: ItemKey[]) => void;
76
+ handleIntersect: (entries: Array<IntersectionObserverEntry>) => void;
77
+ handleCollapseOverflow: () => void;
78
78
  }
@@ -20,12 +20,12 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
20
20
  if (!this.isScrollMode()) return;
21
21
  const { items, itemKey } = this.getProps();
22
22
  const scrollOverflow = computeScrollOverflow(items, itemKey, nextVisibleState);
23
- if (scrollOverflow) this._adapter.updateView({ scrollOverflow });
23
+ if (scrollOverflow) this.adapter.updateView({ scrollOverflow });
24
24
  }
25
25
  #notifyOverflow(overflow) {
26
26
  if (!isEqual(this.#notifiedOverflow, overflow)) {
27
27
  this.#notifiedOverflow = overflow;
28
- this._adapter.notifyOverflow(overflow);
28
+ this.adapter.notifyOverflow(overflow);
29
29
  }
30
30
  }
31
31
  isScrollMode() {
@@ -101,21 +101,21 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
101
101
  };
102
102
  }
103
103
  /** Returns whether the list must be measured again: an item changed width, or every visible item has reported */
104
- recordItemSize(key, width, maxCount) {
104
+ recordItemSize = (key, width, maxCount) => {
105
105
  const previous = this.#itemSizes.get(key);
106
106
  this.#itemSizes.set(key, width);
107
107
  return Boolean(previous && previous !== width) || this.#itemSizes.size === maxCount;
108
- }
109
- handleKeysChange(keys) {
108
+ };
109
+ handleKeysChange = (keys) => {
110
110
  const keySet = new Set(keys);
111
111
  this.#itemSizes.forEach((_, key) => keySet.has(key) || this.#itemSizes.delete(key));
112
112
  this.setState({ visibleState: /* @__PURE__ */ new Map() });
113
- }
114
- handleIntersect(entries) {
113
+ };
114
+ handleIntersect = (entries) => {
115
115
  const visibleState = new Map(this.getState("visibleState"));
116
116
  const res = {};
117
117
  entries.forEach((entry) => {
118
- const itemKey = (entry?.target)?.dataset?.scrollkey;
118
+ const itemKey = entry?.target?.getAttribute("data-scrollkey") ?? void 0;
119
119
  const visible = entry.isIntersecting;
120
120
  res[itemKey] = entry;
121
121
  visibleState.set(itemKey, visible);
@@ -128,18 +128,18 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
128
128
  return;
129
129
  }
130
130
  this.#previousY = currentY;
131
- this._adapter.updateVisibleState(visibleState);
131
+ this.adapter.updateVisibleState(visibleState);
132
132
  this.#syncScrollOverflowCache(visibleState);
133
- this._adapter.notifyIntersect(res);
134
- }
135
- handleCollapseOverflow() {
133
+ this.adapter.notifyIntersect(res);
134
+ };
135
+ handleCollapseOverflow = () => {
136
136
  const { minVisibleItems, collapseFrom, itemKey } = this.getProps();
137
137
  const { overflowWidth, containerWidth } = this.getStates();
138
138
  const { items } = this.getProps();
139
139
  let itemWidths = 0, _pivot = 0;
140
140
  let overflowed = false;
141
141
  if (items.length === 0) {
142
- this._adapter.updateView({
142
+ this.adapter.updateView({
143
143
  overflowStatus: "normal",
144
144
  pivot: -1,
145
145
  visible: items,
@@ -159,7 +159,7 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
159
159
  break;
160
160
  }
161
161
  if (isLast) {
162
- this._adapter.updateView({
162
+ this.adapter.updateView({
163
163
  overflowStatus: "normal",
164
164
  pivot: items.length - 1,
165
165
  visible: items,
@@ -173,9 +173,9 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
173
173
  if (overflowed) {
174
174
  const pivot = Math.max(minVisibleItems, _pivot);
175
175
  const isCollapseFromStart = collapseFrom === Boundary.START;
176
- const visible = isCollapseFromStart ? this.getReversedItems().slice(0, pivot).reverse() : items.slice(0, pivot);
177
- const overflow = isCollapseFromStart ? this.getReversedItems().slice(pivot).reverse() : items.slice(pivot);
178
- this._adapter.updateView({
176
+ const visible = isCollapseFromStart ? this.getReversedItems().slice(0, pivot).toReversed() : items.slice(0, pivot);
177
+ const overflow = isCollapseFromStart ? this.getReversedItems().slice(pivot).toReversed() : items.slice(pivot);
178
+ this.adapter.updateView({
179
179
  overflowStatus: "overflowed",
180
180
  pivot,
181
181
  visible,
@@ -184,6 +184,6 @@ var OverflowListFoundation = class OverflowListFoundation extends BaseFoundation
184
184
  this.#notifyOverflow(overflow);
185
185
  return;
186
186
  }
187
- }
187
+ };
188
188
  };
189
189
  export { OverflowListFoundation as default };
@@ -50,12 +50,12 @@ export default class PaginationFoundation<P extends PaginationBaseProps = Pagina
50
50
  };
51
51
  static getPageList(currentPage: number, total: number, pageSize: number): AdapterPageList;
52
52
  static getPageSizeOpts(pageSizeOpts: readonly number[], pageSize: number): number[];
53
- goPage(targetPageIndex: number | '...'): void;
54
- updatePage(targetPageIndex?: number, pageSize?: number): void;
55
- goPrev(): void;
56
- goNext(): void;
57
- changePageSize(newPageSize: number): void;
58
- handleQuickJumpNumberChange(targetPage: string | number): void;
59
- handleQuickJumpBlur(): void;
60
- handleQuickJumpEnterPress(targetPage: string): void;
53
+ goPage: (targetPageIndex: number | "...") => void;
54
+ updatePage: (targetPageIndex?: number, pageSize?: number) => void;
55
+ goPrev: () => void;
56
+ goNext: () => void;
57
+ changePageSize: (newPageSize: number) => void;
58
+ handleQuickJumpNumberChange: (targetPage: string | number) => void;
59
+ handleQuickJumpBlur: () => void;
60
+ handleQuickJumpEnterPress: (targetPage: string) => void;
61
61
  }
@@ -10,7 +10,7 @@ var PaginationFoundation = class PaginationFoundation extends BaseFoundation {
10
10
  page = Math.trunc(page);
11
11
  if (page > totalPageNum) page = totalPageNum;
12
12
  if (page <= 0) page = 1;
13
- this._adapter.updateQuickJumpPage("");
13
+ this.adapter.updateQuickJumpPage("");
14
14
  this.goPage(page);
15
15
  }
16
16
  static getInitialState(props) {
@@ -126,50 +126,50 @@ var PaginationFoundation = class PaginationFoundation extends BaseFoundation {
126
126
  const firstLargerIndex = pageSizeOpts.findIndex((el) => el > pageSize);
127
127
  return firstLargerIndex === -1 ? [...pageSizeOpts, pageSize] : pageSizeOpts.toSpliced(firstLargerIndex, 0, pageSize);
128
128
  }
129
- goPage(targetPageIndex) {
129
+ goPage = (targetPageIndex) => {
130
130
  if (targetPageIndex === "...") return;
131
131
  const { pageSize, currentPage } = this.getStates();
132
132
  if (targetPageIndex === currentPage) return;
133
- if (!this._isControlledComponent("currentPage")) this.updatePage(targetPageIndex);
134
- this._adapter.notifyPageChange(targetPageIndex);
135
- this._adapter.notifyChange(targetPageIndex, pageSize);
136
- }
137
- updatePage(targetPageIndex = 1, pageSize) {
133
+ if (!this.isControlledComponent("currentPage")) this.updatePage(targetPageIndex);
134
+ this.adapter.notifyPageChange(targetPageIndex);
135
+ this.adapter.notifyChange(targetPageIndex, pageSize);
136
+ };
137
+ updatePage = (targetPageIndex = 1, pageSize) => {
138
138
  const { currentPage, pageSize: currentPageSize } = this.getStates();
139
139
  const newPageSize = pageSize ?? currentPageSize;
140
- if (targetPageIndex !== currentPage) this._adapter.setCurrentPage(targetPageIndex);
141
- if (newPageSize !== currentPageSize) this._adapter.updatePageSize(newPageSize);
142
- }
143
- goPrev() {
140
+ if (targetPageIndex !== currentPage) this.adapter.setCurrentPage(targetPageIndex);
141
+ if (newPageSize !== currentPageSize) this.adapter.updatePageSize(newPageSize);
142
+ };
143
+ goPrev = () => {
144
144
  const { currentPage } = this.getStates();
145
145
  if (currentPage > 1) this.goPage(currentPage - 1);
146
- }
147
- goNext() {
146
+ };
147
+ goNext = () => {
148
148
  const { currentPage, pageSize } = this.getStates();
149
149
  if (currentPage <= PaginationFoundation.getTotalPageNumber(this.getProp("total"), pageSize) - 1) this.goPage(currentPage + 1);
150
- }
151
- changePageSize(newPageSize) {
150
+ };
151
+ changePageSize = (newPageSize) => {
152
152
  const { pageSize, currentPage } = this.getStates();
153
- this._adapter.updatePageSize(newPageSize);
154
- this._adapter.notifyPageSizeChange(newPageSize);
153
+ this.adapter.updatePageSize(newPageSize);
154
+ this.adapter.notifyPageSizeChange(newPageSize);
155
155
  let newCurrentPage = currentPage;
156
156
  if (!this.getProp("preventPageChangeOnPageSizeChange")) {
157
157
  const currentPageFirstItemIndex = (currentPage - 1) * pageSize + 1;
158
158
  newCurrentPage = Math.ceil(currentPageFirstItemIndex / newPageSize);
159
159
  }
160
- if (!this._isControlledComponent("currentPage")) this.updatePage(newCurrentPage, newPageSize);
161
- if (currentPage !== newCurrentPage) this._adapter.notifyPageChange(newCurrentPage);
162
- this._adapter.notifyChange(newCurrentPage, newPageSize);
163
- }
164
- handleQuickJumpNumberChange(targetPage) {
165
- this._adapter.updateQuickJumpPage(targetPage);
166
- }
167
- handleQuickJumpBlur() {
160
+ if (!this.isControlledComponent("currentPage")) this.updatePage(newCurrentPage, newPageSize);
161
+ if (currentPage !== newCurrentPage) this.adapter.notifyPageChange(newCurrentPage);
162
+ this.adapter.notifyChange(newCurrentPage, newPageSize);
163
+ };
164
+ handleQuickJumpNumberChange = (targetPage) => {
165
+ this.adapter.updateQuickJumpPage(targetPage);
166
+ };
167
+ handleQuickJumpBlur = () => {
168
168
  const { quickJumpPage } = this.getStates();
169
169
  if (typeof quickJumpPage === "string" && quickJumpPage || typeof quickJumpPage === "number") this.#handleQuickJump(quickJumpPage);
170
- }
171
- handleQuickJumpEnterPress(targetPage) {
170
+ };
171
+ handleQuickJumpEnterPress = (targetPage) => {
172
172
  this.#handleQuickJump(targetPage);
173
- }
173
+ };
174
174
  };
175
175
  export { PaginationFoundation as default };
@@ -23,17 +23,17 @@ export interface PinCodeAdapter<P extends PinCodeBaseProps = PinCodeBaseProps, S
23
23
  export default class PinCodeFoundation<P extends PinCodeBaseProps = PinCodeBaseProps, S extends PinCodeBaseState = PinCodeBaseState> extends BaseFoundation<PinCodeAdapter<P, S>, P, S> {
24
24
  static numberReg: RegExp;
25
25
  static mixedReg: RegExp;
26
- handleCurrentActiveIndexChange(index: number, state: 'focus' | 'blur'): void;
26
+ handleCurrentActiveIndexChange: (index: number, state: "focus" | "blur") => void;
27
27
  completeSingleInput(i: number, singleInputValue: string): Promise<void>;
28
28
  /** `data` is the InputEvent or CompositionEvent data of the change, if any */
29
- handleCellChange(index: number, value: string, data?: string | null): void;
29
+ handleCellChange: (index: number, value: string, data?: string | null) => void;
30
30
  validateValue(value?: string): boolean;
31
- updateValueList(newValueList: PinCodeBaseState['valueList']): Promise<void>;
32
- handlePaste(e: ClipboardEvent, startInputIndex: number): Promise<void>;
31
+ updateValueList: (newValueList: PinCodeBaseState["valueList"]) => Promise<void>;
32
+ handlePaste: (e: ClipboardEvent, startInputIndex: number) => Promise<void>;
33
33
  /**
34
34
  * Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
35
35
  * virtual keyboard's delete).
36
36
  */
37
37
  removeCell(index: number): void;
38
- handleKeyDownOnSingleInput(e: KeyboardEvent, index: number): void;
38
+ handleKeyDownOnSingleInput: (e: KeyboardEvent, index: number) => void;
39
39
  }
@@ -3,31 +3,31 @@ import BaseFoundation from "../base/foundation.js";
3
3
  var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
4
4
  static numberReg = /^\d*$/;
5
5
  static mixedReg = /^[0-9a-zA-Z]$/;
6
- handleCurrentActiveIndexChange(index, state) {
7
- if (state === "focus") this._adapter.onCurrentActiveIndexChange(index);
8
- }
6
+ handleCurrentActiveIndexChange = (index, state) => {
7
+ if (state === "focus") this.adapter.onCurrentActiveIndexChange(index);
8
+ };
9
9
  async completeSingleInput(i, singleInputValue) {
10
- const isControlledComponent = this._isControlledComponent("value");
10
+ const isControlledComponent = this.isControlledComponent("value");
11
11
  const index = Math.min(i, this.getState("valueList").length);
12
- await this._adapter.onCurrentActiveIndexChange(index + 1);
12
+ await this.adapter.onCurrentActiveIndexChange(index + 1);
13
13
  const valueList = [...this.getState("valueList")];
14
14
  valueList[index] = singleInputValue;
15
- this._adapter.notifyValueChange(valueList);
15
+ this.adapter.notifyValueChange(valueList);
16
16
  if (!isControlledComponent) await this.updateValueList(valueList);
17
17
  const count = this.getProp("count");
18
- if (index + 1 > count - 1) this._adapter.changeSpecificInputFocusState(index, "blur");
19
- else this._adapter.changeSpecificInputFocusState(index + 1, "focus");
20
- if (valueList.length === count) this._adapter.notifyComplete(valueList.join(""));
18
+ if (index + 1 > count - 1) this.adapter.changeSpecificInputFocusState(index, "blur");
19
+ else this.adapter.changeSpecificInputFocusState(index + 1, "focus");
20
+ if (valueList.length === count) this.adapter.notifyComplete(valueList.join(""));
21
21
  }
22
22
  /** `data` is the InputEvent or CompositionEvent data of the change, if any */
23
- handleCellChange(index, value, data) {
23
+ handleCellChange = (index, value, data) => {
24
24
  if (value === "") {
25
25
  this.removeCell(index);
26
26
  return;
27
27
  }
28
28
  const char = data && Array.from(data).length === 1 ? data : Array.from(value).at(-1);
29
29
  if (this.validateValue(char)) this.completeSingleInput(index, char);
30
- }
30
+ };
31
31
  validateValue(value = "") {
32
32
  const format = this.getProp("format");
33
33
  let validateFunction = (_value) => true;
@@ -41,10 +41,10 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
41
41
  else if (typeof format === "function") validateFunction = format;
42
42
  return validateFunction(value);
43
43
  }
44
- async updateValueList(newValueList) {
45
- await this._adapter.updateValueList(newValueList);
46
- }
47
- async handlePaste(e, startInputIndex) {
44
+ updateValueList = async (newValueList) => {
45
+ await this.adapter.updateValueList(newValueList);
46
+ };
47
+ handlePaste = async (e, startInputIndex) => {
48
48
  e.preventDefault();
49
49
  const textWillPaste = Array.from(e.clipboardData.getData("text"));
50
50
  const count = this.getProp("count");
@@ -54,7 +54,7 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
54
54
  if (this.validateValue(currentChar)) await this.completeSingleInput(i, currentChar);
55
55
  else break;
56
56
  }
57
- }
57
+ };
58
58
  /**
59
59
  * Removes the character and closes the gap. Also covers a cell emptied without Backspace or Delete (cut, a
60
60
  * virtual keyboard's delete).
@@ -62,25 +62,25 @@ var PinCodeFoundation = class PinCodeFoundation extends BaseFoundation {
62
62
  removeCell(index) {
63
63
  const valueList = this.getState("valueList").toSpliced(index, 1);
64
64
  this.updateValueList(valueList);
65
- this._adapter.notifyValueChange(valueList);
65
+ this.adapter.notifyValueChange(valueList);
66
66
  }
67
- handleKeyDownOnSingleInput(e, index) {
67
+ handleKeyDownOnSingleInput = (e, index) => {
68
68
  const lastIndex = this.getProp("count") - 1;
69
69
  if (e.key === "Backspace") {
70
70
  this.removeCell(index);
71
- this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
71
+ this.adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
72
72
  e.preventDefault();
73
73
  } else if (e.key === "Delete") {
74
74
  this.removeCell(index);
75
75
  e.preventDefault();
76
76
  } else if (e.altKey || e.ctrlKey || e.metaKey) return;
77
77
  else if (e.key === "ArrowLeft") {
78
- this._adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
78
+ this.adapter.changeSpecificInputFocusState(Math.max(0, index - 1), "focus");
79
79
  e.preventDefault();
80
80
  } else if (e.key === "ArrowRight") {
81
- this._adapter.changeSpecificInputFocusState(Math.min(lastIndex, index + 1), "focus");
81
+ this.adapter.changeSpecificInputFocusState(Math.min(lastIndex, index + 1), "focus");
82
82
  e.preventDefault();
83
83
  }
84
- }
84
+ };
85
85
  };
86
86
  export { PinCodeFoundation as default };
@@ -3,8 +3,8 @@ export interface PopconfirmAdapter<P extends PopconfirmBaseProps = PopconfirmBas
3
3
  setVisible: (visible: boolean) => void;
4
4
  updateConfirmLoading: (loading: boolean) => void;
5
5
  updateCancelLoading: (loading: boolean) => void;
6
- notifyConfirm: (e: any) => unknown;
7
- notifyCancel: (e: any) => unknown;
6
+ notifyConfirm: (e: MouseEvent) => unknown;
7
+ notifyCancel: (e: MouseEvent) => unknown;
8
8
  notifyVisibleChange: (visible: boolean) => void;
9
9
  focusCancelButton: () => void;
10
10
  focusOkButton: () => void;
@@ -27,12 +27,12 @@ export interface PopconfirmBaseState {
27
27
  }
28
28
  export default class PopConfirmFoundation<P extends PopconfirmBaseProps = PopconfirmBaseProps, S extends PopconfirmBaseState = PopconfirmBaseState> extends BaseFoundation<PopconfirmAdapter<P, S>, P, S> {
29
29
  #private;
30
- handleCancel(e: any): void;
31
- handleConfirm(e: any): void;
32
- handleVisibleChange(visible: boolean): void;
30
+ handleCancel: (e: MouseEvent) => void;
31
+ handleConfirm: (e: MouseEvent) => void;
32
+ handleVisibleChange: (visible: boolean) => void;
33
33
  /** Hosts call this when the popup really opens, whoever set `visible` */
34
- handlePopupOpen(): void;
34
+ handlePopupOpen: () => void;
35
35
  /** Hosts call this when the popup really closes, whoever set `visible`; the card is still mounted */
36
- handlePopupClose(): void;
36
+ handlePopupClose: () => void;
37
37
  }
38
38
  export {};