@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,54 +4,54 @@ import isPromise from "../utils/is-promise.js";
4
4
  var PopConfirmFoundation = class extends BaseFoundation {
5
5
  #closeCount = 0;
6
6
  #isOpen() {
7
- return Boolean(this._isControlledComponent("visible") ? this.getProps().visible : this.getStates().visible);
7
+ return Boolean(this.isControlledComponent("visible") ? this.getProps().visible : this.getStates().visible);
8
8
  }
9
9
  #closeIfUnchanged(closeCountAtStart) {
10
10
  if (closeCountAtStart === this.#closeCount && this.#isOpen()) this.handleVisibleChange(false);
11
11
  }
12
- handleCancel(e) {
12
+ handleCancel = (e) => {
13
13
  if (this.getStates().cancelLoading) return;
14
14
  const closeCountAtStart = this.#closeCount;
15
- const maybePromise = this._adapter.notifyCancel(e);
15
+ const maybePromise = this.adapter.notifyCancel(e);
16
16
  if (isPromise(maybePromise)) {
17
- this._adapter.updateCancelLoading(true);
17
+ this.adapter.updateCancelLoading(true);
18
18
  maybePromise.then(() => {
19
19
  this.#closeIfUnchanged(closeCountAtStart);
20
- this._adapter.updateCancelLoading(false);
20
+ this.adapter.updateCancelLoading(false);
21
21
  }, () => {
22
- this._adapter.updateCancelLoading(false);
22
+ this.adapter.updateCancelLoading(false);
23
23
  });
24
24
  } else this.handleVisibleChange(false);
25
- }
26
- handleConfirm(e) {
25
+ };
26
+ handleConfirm = (e) => {
27
27
  const closeCountAtStart = this.#closeCount;
28
- const maybePromise = this._adapter.notifyConfirm(e);
28
+ const maybePromise = this.adapter.notifyConfirm(e);
29
29
  if (isPromise(maybePromise)) {
30
- this._adapter.updateConfirmLoading(true);
30
+ this.adapter.updateConfirmLoading(true);
31
31
  maybePromise.then(() => {
32
- this._adapter.updateConfirmLoading(false);
32
+ this.adapter.updateConfirmLoading(false);
33
33
  this.#closeIfUnchanged(closeCountAtStart);
34
34
  }, () => {
35
- this._adapter.updateConfirmLoading(false);
35
+ this.adapter.updateConfirmLoading(false);
36
36
  });
37
37
  } else this.handleVisibleChange(false);
38
- }
39
- handleVisibleChange(visible) {
40
- if (!this._isControlledComponent("visible") || !visible) this._adapter.setVisible(visible);
38
+ };
39
+ handleVisibleChange = (visible) => {
40
+ if (!this.isControlledComponent("visible") || !visible) this.adapter.setVisible(visible);
41
41
  if (!visible) this.#closeCount++;
42
- this._adapter.notifyVisibleChange(visible);
43
- }
42
+ this.adapter.notifyVisibleChange(visible);
43
+ };
44
44
  /** Hosts call this when the popup really opens, whoever set `visible` */
45
- handlePopupOpen() {
46
- const { cancelButtonProps, okButtonProps } = this._adapter.getProps();
47
- if (cancelButtonProps?.autoFocus && !cancelButtonProps.disabled) this._adapter.focusCancelButton();
48
- else if (okButtonProps?.autoFocus && !okButtonProps.disabled) this._adapter.focusOkButton();
49
- }
45
+ handlePopupOpen = () => {
46
+ const { cancelButtonProps, okButtonProps } = this.adapter.getProps();
47
+ if (cancelButtonProps?.autoFocus && !cancelButtonProps.disabled) this.adapter.focusCancelButton();
48
+ else if (okButtonProps?.autoFocus && !okButtonProps.disabled) this.adapter.focusOkButton();
49
+ };
50
50
  /** Hosts call this when the popup really closes, whoever set `visible`; the card is still mounted */
51
- handlePopupClose() {
52
- this._adapter.setVisible(false);
51
+ handlePopupClose = () => {
52
+ this.adapter.setVisible(false);
53
53
  this.#closeCount++;
54
- this._adapter.focusPrevFocusElement();
55
- }
54
+ this.adapter.focusPrevFocusElement();
55
+ };
56
56
  };
57
57
  export { PopConfirmFoundation as default };
@@ -67,12 +67,12 @@ export default class RadioFoundation<P extends RadioBaseProps = RadioBaseProps,
67
67
  static deriveView(props: RadioBaseProps, state: RadioBaseState, context?: RadioContextView | null): RadioView;
68
68
  init(): void;
69
69
  destroy(): void;
70
- setChecked(checked: boolean): void;
70
+ setChecked: (checked: boolean) => void;
71
71
  /** `checked` is the value the native input reports, or false for the uncheck of advanced mode */
72
- handleChange(checked: boolean, e: RadioSourceEvent): void;
73
- handleClick(e: RadioSourceEvent): void;
74
- handleKeyUp(e: RadioSourceEvent & {
72
+ handleChange: (checked: boolean, e: RadioSourceEvent) => void;
73
+ handleClick: (e: RadioSourceEvent) => void;
74
+ handleKeyUp: (e: RadioSourceEvent & {
75
75
  key: string;
76
- }): void;
76
+ }) => void;
77
77
  }
78
78
  export {};
@@ -7,14 +7,14 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
7
7
  return RadioFoundation.deriveView(this.getProps(), this.getStates(), this.getContexts());
8
8
  }
9
9
  #isStandalone() {
10
- return !this.getContexts()?.radioGroup && !this._isControlledComponent("checked");
10
+ return !this.getContexts()?.radioGroup && !this.isControlledComponent("checked");
11
11
  }
12
12
  /** Unchecks, without notifying, the standalone radios that share this one's native group (same form and name) */
13
13
  #uncheckPeers() {
14
- const input = this._adapter.getInput();
14
+ const input = this.adapter.getInput();
15
15
  if (!input?.name || !this.#isStandalone()) return;
16
16
  for (const peer of RadioFoundation.#standalone) {
17
- const peerInput = peer._adapter.getInput();
17
+ const peerInput = peer.adapter.getInput();
18
18
  if (peer !== this && peer.#isStandalone() && peerInput?.name === input.name && peerInput.form === input.form && peerInput.getRootNode() === input.getRootNode() && peer.getState("checked")) peer.setChecked(false);
19
19
  }
20
20
  }
@@ -54,11 +54,11 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
54
54
  destroy() {
55
55
  RadioFoundation.#standalone.delete(this);
56
56
  }
57
- setChecked(checked) {
58
- this._adapter.setChecked(checked);
59
- }
57
+ setChecked = (checked) => {
58
+ this.adapter.setChecked(checked);
59
+ };
60
60
  /** `checked` is the value the native input reports, or false for the uncheck of advanced mode */
61
- handleChange(checked, e) {
61
+ handleChange = (checked, e) => {
62
62
  const props = this.getProps();
63
63
  const group = this.getContexts()?.radioGroup;
64
64
  const event = {
@@ -72,23 +72,23 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
72
72
  stopPropagation: () => e.stopPropagation(),
73
73
  preventDefault: () => e.preventDefault()
74
74
  };
75
- this._adapter.notifyGroupChange(event);
76
- if (!this._isControlledComponent("checked")) {
75
+ this.adapter.notifyGroupChange(event);
76
+ if (!this.isControlledComponent("checked")) {
77
77
  if (checked) this.#uncheckPeers();
78
78
  this.setChecked(checked);
79
79
  }
80
- this._adapter.notifyChange(event);
81
- }
82
- handleClick(e) {
80
+ this.adapter.notifyChange(event);
81
+ };
82
+ handleClick = (e) => {
83
83
  const { checked, mode } = this.#getView();
84
84
  if (mode === "advanced" && checked) this.handleChange(false, e);
85
- }
86
- handleKeyUp(e) {
85
+ };
86
+ handleKeyUp = (e) => {
87
87
  const { checked, mode } = this.#getView();
88
88
  if (e.key === " " && mode === "advanced" && checked) {
89
89
  e.preventDefault();
90
90
  this.handleChange(false, e);
91
91
  }
92
- }
92
+ };
93
93
  };
94
94
  export { RadioFoundation as default };
@@ -13,6 +13,6 @@ export interface RadioGroupBaseState {
13
13
  value?: any;
14
14
  }
15
15
  export default class RadioGroupFoundation<P extends RadioGroupBaseProps = RadioGroupBaseProps, S extends RadioGroupBaseState = RadioGroupBaseState> extends BaseFoundation<RadioGroupAdapter<P, S>, P, S> {
16
- handleChange(evt: RadioChangeEvent): void;
17
- handlePropValueChange(propValue: string | number | boolean): void;
16
+ handleChange: (evt: RadioChangeEvent) => void;
17
+ handlePropValueChange: (propValue: string | number | boolean) => void;
18
18
  }
@@ -1,11 +1,11 @@
1
1
  import BaseFoundation from "../base/foundation.js";
2
2
  // src/radio/radio-group-foundation.ts
3
3
  var RadioGroupFoundation = class extends BaseFoundation {
4
- handleChange(evt) {
4
+ handleChange = (evt) => {
5
5
  const mode = this.getProp("mode");
6
6
  const lastValue = this.getState("value");
7
7
  const { checked, value } = evt.target;
8
- const isControlledComponent = this._isControlledComponent();
8
+ const isControlledComponent = this.isControlledComponent();
9
9
  const cbValue = {
10
10
  ...evt,
11
11
  target: {
@@ -15,13 +15,13 @@ var RadioGroupFoundation = class extends BaseFoundation {
15
15
  };
16
16
  if (mode === "advanced" && !checked) cbValue.target.value = void 0;
17
17
  if (!isControlledComponent) {
18
- if (mode === "advanced" && !checked) this._adapter.setValue(void 0);
19
- else this._adapter.setValue(value);
18
+ if (mode === "advanced" && !checked) this.adapter.setValue(void 0);
19
+ else this.adapter.setValue(value);
20
20
  }
21
- if (mode === "advanced" || lastValue !== value) this._adapter.notifyChange(cbValue);
22
- }
23
- handlePropValueChange(propValue) {
24
- this._adapter.setValue(propValue);
25
- }
21
+ if (mode === "advanced" || lastValue !== value) this.adapter.notifyChange(cbValue);
22
+ };
23
+ handlePropValueChange = (propValue) => {
24
+ this.adapter.setValue(propValue);
25
+ };
26
26
  };
27
27
  export { RadioGroupFoundation as default };
@@ -92,18 +92,18 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
92
92
  static isTipVisible(index: number, hoverValue?: number, focusVisibleStar?: number, tip?: string): boolean;
93
93
  init(): void;
94
94
  /** A value prop that goes back to undefined (a form reset) returns to defaultValue, like Slider (Switch and Checkbox become unchecked) */
95
- resetValue(): void;
96
- handleHover(event: Pick<MouseEvent, 'pageX'>, index: number): void;
97
- handleMouseLeave(): void;
98
- handleClick(event: CE & Pick<MouseEvent, 'pageX'>, index: number): void;
95
+ resetValue: () => void;
96
+ handleHover: (event: Pick<MouseEvent, "pageX">, index: number) => void;
97
+ handleMouseLeave: () => void;
98
+ handleClick: (event: CE & Pick<MouseEvent, "pageX">, index: number) => void;
99
99
  /** Commits `newValue` for the star at `index`; selecting the current value clears it when allowClear is on */
100
- handleSelect(event: CE, index: number, newValue: number): void;
101
- handleFocus(e: FE): void;
100
+ handleSelect: (event: CE, index: number, newValue: number) => void;
101
+ handleFocus: (e: FE) => void;
102
102
  /** A radio of the star at `index` got focus; index === count is the empty star */
103
- handleStarFocus(e: {
103
+ handleStarFocus: (e: {
104
104
  target: Element;
105
- }, index: number): void;
106
- handleBlur(e: FE): void;
107
- handleKeyDown(event: KE, value: number): void;
105
+ }, index: number) => void;
106
+ handleBlur: (e: FE) => void;
107
+ handleKeyDown: (event: KE, value: number) => void;
108
108
  }
109
109
  export {};
@@ -6,20 +6,20 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
6
6
  return el.getBoundingClientRect().left + el.ownerDocument.defaultView.scrollX;
7
7
  }
8
8
  #changeHover(hoverValue, clearedValue) {
9
- this._adapter.setHover(hoverValue, clearedValue);
10
- this._adapter.notifyHoverChange(hoverValue);
9
+ this.adapter.setHover(hoverValue, clearedValue);
10
+ this.adapter.notifyHoverChange(hoverValue);
11
11
  }
12
12
  #updateValue(value) {
13
- if (!this._isControlledComponent()) this._adapter.setValue(value);
14
- this._adapter.notifyChange(value);
13
+ if (!this.isControlledComponent()) this.adapter.setValue(value);
14
+ this.adapter.notifyChange(value);
15
15
  }
16
16
  getStarValue(index, pos) {
17
17
  const { allowHalf, count } = this.getProps();
18
18
  if (index === count) return 0;
19
- const reverse = this._adapter.getContext("direction") === "rtl";
19
+ const reverse = this.adapter.getContext("direction") === "rtl";
20
20
  let value = index + 1;
21
21
  if (allowHalf) {
22
- const starEle = this._adapter.getStarDOM(index);
22
+ const starEle = this.adapter.getStarDOM(index);
23
23
  if (!starEle) return value;
24
24
  const leftDis = this.#getOffsetLeft(starEle);
25
25
  const width = starEle.clientWidth;
@@ -93,51 +93,51 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
93
93
  if (this.#initialized) return;
94
94
  this.#initialized = true;
95
95
  const { autoFocus, disabled } = this.getProps();
96
- if (autoFocus && !disabled) this._adapter.focusStar(RatingFoundation.deriveValue(this.getProps(), this.getStates()));
96
+ if (autoFocus && !disabled) this.adapter.focusStar(RatingFoundation.deriveValue(this.getProps(), this.getStates()));
97
97
  }
98
98
  /** A value prop that goes back to undefined (a form reset) returns to defaultValue, like Slider (Switch and Checkbox become unchecked) */
99
- resetValue() {
100
- this._adapter.setValue(this.getProps().defaultValue);
101
- }
102
- handleHover(event, index) {
99
+ resetValue = () => {
100
+ this.adapter.setValue(this.getProps().defaultValue);
101
+ };
102
+ handleHover = (event, index) => {
103
103
  const currValue = this.getStarValue(index, event.pageX);
104
104
  const { clearedValue, hoverValue } = this.getStates();
105
105
  if (currValue !== hoverValue && currValue !== clearedValue) this.#changeHover(currValue, null);
106
- }
107
- handleMouseLeave() {
106
+ };
107
+ handleMouseLeave = () => {
108
108
  this.#changeHover(void 0, null);
109
- }
110
- handleClick(event, index) {
109
+ };
110
+ handleClick = (event, index) => {
111
111
  this.handleSelect(event, index, this.getStarValue(index, event.pageX));
112
- }
112
+ };
113
113
  /** Commits `newValue` for the star at `index`; selecting the current value clears it when allowClear is on */
114
- handleSelect(event, index, newValue) {
114
+ handleSelect = (event, index, newValue) => {
115
115
  const { allowClear } = this.getProps();
116
116
  const value = RatingFoundation.deriveValue(this.getProps(), this.getStates());
117
117
  const isReset = allowClear ? newValue === value : false;
118
118
  this.#updateValue(isReset ? 0 : newValue);
119
119
  if (isReset) this.#changeHover(void 0, newValue);
120
- else this._adapter.setClearedValue(null);
121
- this._adapter.notifyClick(event, index);
122
- }
123
- handleFocus(e) {
124
- if (!e.currentTarget.contains(e.relatedTarget)) this._adapter.notifyFocus(e);
125
- }
120
+ else this.adapter.setClearedValue(null);
121
+ this.adapter.notifyClick(event, index);
122
+ };
123
+ handleFocus = (e) => {
124
+ if (!e.currentTarget.contains(e.relatedTarget)) this.adapter.notifyFocus(e);
125
+ };
126
126
  /** A radio of the star at `index` got focus; index === count is the empty star */
127
- handleStarFocus(e, index) {
128
- if (e.target.matches(":focus-visible") || this.getStates().focusVisibleStar !== void 0) this._adapter.setFocusVisibleStar(index);
129
- }
130
- handleBlur(e) {
127
+ handleStarFocus = (e, index) => {
128
+ if (e.target.matches(":focus-visible") || this.getStates().focusVisibleStar !== void 0) this.adapter.setFocusVisibleStar(index);
129
+ };
130
+ handleBlur = (e) => {
131
131
  if (!e.currentTarget.contains(e.relatedTarget)) {
132
- this._adapter.notifyBlur(e);
133
- this._adapter.setFocusVisibleStar(void 0);
132
+ this.adapter.notifyBlur(e);
133
+ this.adapter.setFocusVisibleStar(void 0);
134
134
  }
135
- }
136
- handleKeyDown(event, value) {
135
+ };
136
+ handleKeyDown = (event, value) => {
137
137
  if (event.altKey || event.ctrlKey || event.metaKey) return;
138
138
  const { key } = event;
139
139
  const { count, allowHalf } = this.getProps();
140
- const reverse = this._adapter.getContext("direction") === "rtl";
140
+ const reverse = this.adapter.getContext("direction") === "rtl";
141
141
  const step = allowHalf ? .5 : 1;
142
142
  const next = (Math.floor(value / step) + 1) * step;
143
143
  const previous = (Math.ceil(value / step) - 1) * step;
@@ -156,12 +156,12 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
156
156
  "ArrowLeft",
157
157
  "ArrowDown"
158
158
  ].includes(key)) {
159
- this._adapter.notifyKeyDown(event);
159
+ this.adapter.notifyKeyDown(event);
160
160
  this.#updateValue(newValue);
161
- this._adapter.focusStar(newValue);
161
+ this.adapter.focusStar(newValue);
162
162
  event.preventDefault();
163
163
  this.#changeHover(void 0, null);
164
164
  }
165
- }
165
+ };
166
166
  };
167
167
  export { RatingFoundation as default };
@@ -37,19 +37,19 @@ export declare class ResizeGroupFoundation<P extends ResizeGroupBaseProps = Resi
37
37
  /**
38
38
  * Re-runs initSpace the first time the group is measurable (#3336); later resizes must not, or the drag is lost.
39
39
  */
40
- handleGroupResize(): void;
40
+ handleGroupResize: () => void;
41
41
  /**
42
42
  * Moves each item's inline size to the new axis, where the handlers take a different length
43
43
  */
44
- handleDirectionChange(): void;
44
+ handleDirectionChange: () => void;
45
45
  /**
46
46
  * Keyboard resize, reported like a drag: arrows move 1% of the group (Shift: 10%), Home and End go to the
47
47
  * limits. Returns whether the key was handled.
48
48
  */
49
- resizeByKey(handlerIndex: number, e: KeyboardEvent): boolean;
50
- onResizeStart(handlerIndex: number, e: PointerEvent): void;
51
- onResizing(e: PointerEvent): void;
52
- onResizeEnd(e: PointerEvent): void;
49
+ resizeByKey: (handlerIndex: number, e: KeyboardEvent) => boolean;
50
+ onResizeStart: (handlerIndex: number, e: PointerEvent) => void;
51
+ onResizing: (e: PointerEvent) => void;
52
+ onResizeEnd: (e: PointerEvent) => void;
53
53
  ensureConstraint: import("es-toolkit").DebouncedFunction<() => void>;
54
54
  destroy(): void;
55
55
  }
@@ -12,7 +12,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
12
12
  return this.getProp("direction");
13
13
  }
14
14
  get #groupRef() {
15
- return this._adapter.getGroupRef();
15
+ return this.adapter.getGroupRef();
16
16
  }
17
17
  get #groupSize() {
18
18
  return this.#direction === "horizontal" ? this.#groupRef.offsetWidth : this.#groupRef.offsetHeight;
@@ -29,11 +29,11 @@ var ResizeGroupFoundation = class extends BaseFoundation {
29
29
  }
30
30
  #clampItem(index, size) {
31
31
  const groupSize = this.#groupSize;
32
- return clamp$1(size, this.#toPixels(this._adapter.getItemMin(index) ?? "0%", groupSize), this.#toPixels(this._adapter.getItemMax(index) ?? "100%", groupSize));
32
+ return clamp$1(size, this.#toPixels(this.adapter.getItemMin(index) ?? "0%", groupSize), this.#toPixels(this.adapter.getItemMax(index) ?? "100%", groupSize));
33
33
  }
34
34
  #applyDelta(curHandler, { lastItemSize, nextItemSize }, delta, e) {
35
35
  const direction = this.#direction;
36
- let lastItem = this._adapter.getItem(curHandler), nextItem = this._adapter.getItem(curHandler + 1);
36
+ let lastItem = this.adapter.getItem(curHandler), nextItem = this.adapter.getItem(curHandler + 1);
37
37
  let parentSize = this.#groupSize;
38
38
  let lastNewSize = lastItemSize + delta;
39
39
  let nextNewSize = nextItemSize - delta;
@@ -59,7 +59,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
59
59
  lastItem.style.height = `calc(${lastNewPercent}% - ${this.#itemMinusMap.get(curHandler)}px)`;
60
60
  nextItem.style.height = `calc(${nextNewPercent}% - ${this.#itemMinusMap.get(curHandler + 1)}px)`;
61
61
  }
62
- let lastFunc = this._adapter.getItemChange(curHandler), nextFunc = this._adapter.getItemChange(curHandler + 1);
62
+ let lastFunc = this.adapter.getItemChange(curHandler), nextFunc = this.adapter.getItemChange(curHandler + 1);
63
63
  let [lastDir, nextDir] = getItemDirection(direction);
64
64
  if (lastFunc) lastFunc({
65
65
  width: lastItem.offsetWidth,
@@ -72,8 +72,8 @@ var ResizeGroupFoundation = class extends BaseFoundation {
72
72
  this.#syncAria();
73
73
  }
74
74
  #notifyResizeEnd(curHandler, e) {
75
- let lastItem = this._adapter.getItem(curHandler), nextItem = this._adapter.getItem(curHandler + 1);
76
- let lastFunc = this._adapter.getItemEnd(curHandler), nextFunc = this._adapter.getItemEnd(curHandler + 1);
75
+ let lastItem = this.adapter.getItem(curHandler), nextItem = this.adapter.getItem(curHandler + 1);
76
+ let lastFunc = this.adapter.getItemEnd(curHandler), nextFunc = this.adapter.getItemEnd(curHandler + 1);
77
77
  let [lastDir, nextDir] = getItemDirection(this.#direction);
78
78
  if (lastFunc) lastFunc({
79
79
  width: lastItem.offsetWidth,
@@ -89,8 +89,8 @@ var ResizeGroupFoundation = class extends BaseFoundation {
89
89
  if (!parentSize) return;
90
90
  const percent = (px) => px / parentSize * 100;
91
91
  const limits = (index) => {
92
- const min = this._adapter.getItemMin(index);
93
- const max = this._adapter.getItemMax(index);
92
+ const min = this.adapter.getItemMin(index);
93
+ const max = this.adapter.getItemMax(index);
94
94
  const minus = this.#itemMinusMap.get(index);
95
95
  return {
96
96
  min: percent((min ? this.#toPixels(min, parentSize) : 0) + minus),
@@ -98,9 +98,9 @@ var ResizeGroupFoundation = class extends BaseFoundation {
98
98
  };
99
99
  };
100
100
  const round = (value) => String(Number(value.toFixed(1)));
101
- for (let i = 0; i < this._adapter.getHandlerCount() && i + 1 < this._adapter.getItemCount(); i++) {
102
- const handler = this._adapter.getHandler(i);
103
- const item = this._adapter.getItem(i);
101
+ for (let i = 0; i < this.adapter.getHandlerCount() && i + 1 < this.adapter.getItemCount(); i++) {
102
+ const handler = this.adapter.getHandler(i);
103
+ const item = this.adapter.getItem(i);
104
104
  const last = limits(i);
105
105
  const next = limits(i + 1);
106
106
  const total = this.#itemPercentMap.get(i) + this.#itemPercentMap.get(i + 1);
@@ -113,11 +113,11 @@ var ResizeGroupFoundation = class extends BaseFoundation {
113
113
  }
114
114
  #measureHandlerRoom() {
115
115
  const horizontal = this.#direction === "horizontal";
116
- const handlerSizes = Array.from({ length: this._adapter.getHandlerCount() }, (_, i) => {
117
- const handler = this._adapter.getHandler(i);
116
+ const handlerSizes = Array.from({ length: this.adapter.getHandlerCount() }, (_, i) => {
117
+ const handler = this.adapter.getHandler(i);
118
118
  return horizontal ? handler.offsetWidth : handler.offsetHeight;
119
119
  });
120
- const itemCount = this._adapter.getItemCount();
120
+ const itemCount = this.adapter.getItemCount();
121
121
  for (let i = 0; i < itemCount; i++) {
122
122
  const before = i > 0 ? handlerSizes[i - 1] / 2 : 0;
123
123
  const after = i < itemCount - 1 ? handlerSizes[i] / 2 : 0;
@@ -131,12 +131,12 @@ var ResizeGroupFoundation = class extends BaseFoundation {
131
131
  this.#measureHandlerRoom();
132
132
  let totalSizePercent = 0;
133
133
  let undefineLoc = /* @__PURE__ */ new Map(), undefinedTotal = 0;
134
- for (let i = 0; i < this._adapter.getItemCount(); i++) {
135
- const child = this._adapter.getItem(i);
136
- let minSize = this._adapter.getItemMin(i), maxSize = this._adapter.getItemMax(i);
134
+ for (let i = 0; i < this.adapter.getItemCount(); i++) {
135
+ const child = this.adapter.getItem(i);
136
+ let minSize = this.adapter.getItemMin(i), maxSize = this.adapter.getItemMax(i);
137
137
  let minSizePercent = minSize ? this.#toPixels(minSize, parentSize) / parentSize * 100 : 0, maxSizePercent = maxSize ? this.#toPixels(maxSize, parentSize) / parentSize * 100 : 100;
138
138
  if (minSizePercent > maxSizePercent) console.warn("[Semi ResizableItem]: min size bigger than max size");
139
- let defaultSize = this._adapter.getItemDefaultSize(i);
139
+ let defaultSize = this.adapter.getItemDefaultSize(i);
140
140
  if (defaultSize) {
141
141
  let itemSizePercent;
142
142
  if (typeof defaultSize === "string") {
@@ -168,7 +168,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
168
168
  undefineSizePercent = 10;
169
169
  }
170
170
  undefineLoc.forEach((value, key) => {
171
- const child = this._adapter.getItem(key);
171
+ const child = this.adapter.getItem(key);
172
172
  const percent = value / undefinedTotal * undefineSizePercent;
173
173
  this.#itemPercentMap.set(key, percent);
174
174
  if (direction === "horizontal") child.style.width = `calc(${percent}% - ${this.#itemMinusMap.get(key)}px)`;
@@ -177,7 +177,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
177
177
  this.#syncAria();
178
178
  }
179
179
  #measure(handlerIndex, x, y) {
180
- let lastItem = this._adapter.getItem(handlerIndex), nextItem = this._adapter.getItem(handlerIndex + 1);
180
+ let lastItem = this.adapter.getItem(handlerIndex), nextItem = this.adapter.getItem(handlerIndex + 1);
181
181
  return {
182
182
  x,
183
183
  y,
@@ -188,8 +188,8 @@ var ResizeGroupFoundation = class extends BaseFoundation {
188
188
  /** Returns false when either item's onResizeStart returned false */
189
189
  #notifyResizeStart(handlerIndex, e) {
190
190
  const [lastDir, nextDir] = getItemDirection(this.#direction);
191
- const lastResult = this._adapter.getItemStart(handlerIndex)?.(e, lastDir);
192
- const nextResult = this._adapter.getItemStart(handlerIndex + 1)?.(e, nextDir);
191
+ const lastResult = this.adapter.getItemStart(handlerIndex)?.(e, lastDir);
192
+ const nextResult = this.adapter.getItemStart(handlerIndex + 1)?.(e, nextDir);
193
193
  return lastResult !== false && nextResult !== false;
194
194
  }
195
195
  init() {
@@ -200,27 +200,27 @@ var ResizeGroupFoundation = class extends BaseFoundation {
200
200
  /**
201
201
  * Re-runs initSpace the first time the group is measurable (#3336); later resizes must not, or the drag is lost.
202
202
  */
203
- handleGroupResize() {
203
+ handleGroupResize = () => {
204
204
  if (!this.#sizeInitialized && this.#groupSize > 0) this.#initSpace();
205
- }
205
+ };
206
206
  /**
207
207
  * Moves each item's inline size to the new axis, where the handlers take a different length
208
208
  */
209
- handleDirectionChange() {
209
+ handleDirectionChange = () => {
210
210
  const [stale, current] = this.#direction === "horizontal" ? ["height", "width"] : ["width", "height"];
211
211
  this.#measureHandlerRoom();
212
- for (let i = 0; i < this._adapter.getItemCount(); i++) {
213
- const item = this._adapter.getItem(i);
212
+ for (let i = 0; i < this.adapter.getItemCount(); i++) {
213
+ const item = this.adapter.getItem(i);
214
214
  item.style.removeProperty(stale);
215
215
  item.style[current] = `calc(${this.#itemPercentMap.get(i)}% - ${this.#itemMinusMap.get(i)}px)`;
216
216
  }
217
217
  this.#syncAria();
218
- }
218
+ };
219
219
  /**
220
220
  * Keyboard resize, reported like a drag: arrows move 1% of the group (Shift: 10%), Home and End go to the
221
221
  * limits. Returns whether the key was handled.
222
222
  */
223
- resizeByKey(handlerIndex, e) {
223
+ resizeByKey = (handlerIndex, e) => {
224
224
  if (e.altKey || e.ctrlKey || e.metaKey) return false;
225
225
  const [backKey, forwardKey] = this.#direction === "horizontal" ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"];
226
226
  const groupSize = this.#groupSize;
@@ -237,8 +237,8 @@ var ResizeGroupFoundation = class extends BaseFoundation {
237
237
  this.#notifyResizeEnd(handlerIndex, e);
238
238
  }
239
239
  return true;
240
- }
241
- onResizeStart(handlerIndex, e) {
240
+ };
241
+ onResizeStart = (handlerIndex, e) => {
242
242
  if (isSecondaryPress(e) || !this.#notifyResizeStart(handlerIndex, e)) return;
243
243
  const states = this.getStates();
244
244
  this.setState({
@@ -250,15 +250,15 @@ var ResizeGroupFoundation = class extends BaseFoundation {
250
250
  },
251
251
  curHandler: handlerIndex
252
252
  });
253
- }
254
- onResizing(e) {
253
+ };
254
+ onResizing = (e) => {
255
255
  const state = this.getStates();
256
256
  if (!state.isResizing) return;
257
257
  const { curHandler, originalPosition } = state;
258
258
  const delta = this.#direction === "horizontal" ? e.clientX - originalPosition.x : e.clientY - originalPosition.y;
259
259
  this.#applyDelta(curHandler, originalPosition, delta, e);
260
- }
261
- onResizeEnd(e) {
260
+ };
261
+ onResizeEnd = (e) => {
262
262
  const { isResizing, curHandler } = this.getStates();
263
263
  if (!isResizing) return;
264
264
  this.#notifyResizeEnd(curHandler, e);
@@ -266,19 +266,19 @@ var ResizeGroupFoundation = class extends BaseFoundation {
266
266
  isResizing: false,
267
267
  curHandler: null
268
268
  });
269
- }
269
+ };
270
270
  ensureConstraint = debounce(() => {
271
271
  if (!this.#groupSize) return;
272
272
  const direction = this.#direction;
273
- const itemCount = this._adapter.getItemCount();
273
+ const itemCount = this.adapter.getItemCount();
274
274
  let continueFlag = true;
275
275
  for (let i = 0; i < itemCount; i++) {
276
- const child = this._adapter.getItem(i);
276
+ const child = this.adapter.getItem(i);
277
277
  const childSize = direction === "horizontal" ? child.offsetWidth : child.offsetHeight;
278
278
  const childNewSize = this.#clampItem(i, childSize);
279
279
  if (childNewSize !== childSize) {
280
280
  const j = [...Array.from({ length: itemCount - i - 1 }, (_, k) => i + 1 + k), ...Array.from({ length: i }, (_, k) => i - 1 - k)].find((index) => {
281
- const item = this._adapter.getItem(index);
281
+ const item = this.adapter.getItem(index);
282
282
  const itemSize = direction === "horizontal" ? item.offsetWidth : item.offsetHeight;
283
283
  return this.#clampItem(index, itemSize) === itemSize;
284
284
  });
@@ -286,7 +286,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
286
286
  continueFlag = false;
287
287
  console.warn("[Semi ResizableGroup]: no enough space to adjust min/max size");
288
288
  } else {
289
- const item = this._adapter.getItem(j);
289
+ const item = this.adapter.getItem(j);
290
290
  const childPercent = this.#itemPercentMap.get(i);
291
291
  const itemPercent = this.#itemPercentMap.get(j);
292
292
  const childNewPercent = (childNewSize + this.#itemMinusMap.get(i)) / this.#groupSize * 100;
@@ -77,12 +77,12 @@ export declare class ResizableFoundation<P extends ResizableBaseProps = Resizabl
77
77
  * Reads the size and limits for aria-valuenow, -valuemin and -valuemax. A change of the limits alone goes
78
78
  * unnoticed until the next resize.
79
79
  */
80
- updateAriaRange(): void;
80
+ updateAriaRange: () => void;
81
81
  /**
82
82
  * Keyboard resize along the axis of the edge, KEYBOARD_STEP px per press, reported like a drag.
83
83
  * Returns whether the key was handled.
84
84
  */
85
- resizeByKey(direction: Direction, e: KeyboardEvent): boolean;
85
+ resizeByKey: (direction: Direction, e: KeyboardEvent) => boolean;
86
86
  onResizeStart: (e: PointerEvent, direction: Direction) => void;
87
87
  onResizing: (event: PointerEvent) => void;
88
88
  onResizeEnd: (event: PointerEvent) => void;