@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
@@ -8,44 +8,40 @@ export interface BasicOptionProps {
8
8
  className?: string;
9
9
  style?: Record<string, any>;
10
10
  }
11
- /** The keys Select adds to a collected option; SelectFoundation reads and writes them and strips them from callbacks */
12
- export interface OptionRecordKeys<G extends {
13
- label?: unknown;
14
- } = {
11
+ /**
12
+ * What Select keeps for an option. `data` is what the host read from an optionList item or an option child, and is
13
+ * all that callbacks and the selections receive; the rest is Select's own state, kept off the user's object.
14
+ */
15
+ export interface OptionRecord<D = BasicOptionProps, G = {
15
16
  label?: unknown;
16
17
  }> {
17
- _show?: boolean;
18
- _selected?: boolean;
18
+ data: D;
19
19
  /** Position among all collected options, which keeps a row's key while filtering moves it */
20
- _scrollIndex?: number;
21
- _parentGroup?: G;
22
- _keyInJsx?: string;
23
- _inputCreateOnly?: boolean;
24
- _notExist?: boolean;
20
+ index: number;
21
+ group?: G;
22
+ /** Only an option child has one: its key prefixed with the group's, so options in different groups stay apart */
23
+ childKey?: string;
24
+ show: boolean;
25
+ selected: boolean;
26
+ /** The option the search text would create under allowCreate, until it is selected */
27
+ create?: boolean;
25
28
  }
26
- /**
27
- * The record Select keeps for an option: `data` is what the host read from an optionList item or an option child.
28
- * Only a child has `keyInJsx`, its key prefixed with the group's so options in different groups stay apart; an
29
- * optionList item passes neither and keeps its own keys.
30
- */
31
- export declare function toOptionRecord<D extends object, G extends {
32
- label?: unknown;
33
- }>(data: D, index: number, group?: G, keyInJsx?: string): D & OptionRecordKeys<G>;
34
- export interface OptionRun<O extends {
35
- _parentGroup?: unknown;
29
+ export declare function toOptionRecord<D, G>(data: D, index: number, group?: G, childKey?: string): OptionRecord<D, G>;
30
+ export interface OptionRun<R extends {
31
+ group?: unknown;
36
32
  }> {
37
- group: O['_parentGroup'];
33
+ group: R['group'];
38
34
  first: number;
39
35
  rows: {
40
- option: O;
36
+ option: R;
41
37
  index: number;
42
38
  }[];
43
39
  }
44
40
  /** Splits the visible options into runs of adjacent options of the same group, keeping each option's visible index */
45
- export declare function getOptionRuns<O extends {
46
- _parentGroup?: {
41
+ export declare function getOptionRuns<R extends {
42
+ group?: {
47
43
  key?: unknown;
48
44
  };
49
- }>(options: readonly O[]): OptionRun<O>[];
45
+ }>(options: readonly R[]): OptionRun<R>[];
50
46
  /** The records of a non-empty `optionList`; undefined when the hosts must read their option children instead */
51
- export declare function optionListToRecords<D extends object>(optionList?: readonly D[]): (D & OptionRecordKeys)[] | undefined;
47
+ export declare function optionListToRecords<D>(optionList?: readonly D[]): OptionRecord<D>[] | undefined;
@@ -1,20 +1,12 @@
1
1
  // src/select/option-foundation.ts
2
- /**
3
- * The record Select keeps for an option: `data` is what the host read from an optionList item or an option child.
4
- * Only a child has `keyInJsx`, its key prefixed with the group's so options in different groups stay apart; an
5
- * optionList item passes neither and keeps its own keys.
6
- */
7
- function toOptionRecord(data, index, group, keyInJsx) {
8
- const record = {
9
- _show: true,
10
- _selected: false,
11
- _scrollIndex: index,
12
- ...data
13
- };
14
- return keyInJsx === void 0 ? record : {
15
- ...record,
16
- _parentGroup: group,
17
- _keyInJsx: keyInJsx
2
+ function toOptionRecord(data, index, group, childKey) {
3
+ return {
4
+ data,
5
+ index,
6
+ group,
7
+ childKey,
8
+ show: true,
9
+ selected: false
18
10
  };
19
11
  }
20
12
  /** Splits the visible options into runs of adjacent options of the same group, keeping each option's visible index */
@@ -22,12 +14,12 @@ function getOptionRuns(options) {
22
14
  const runs = [];
23
15
  options.forEach((option, index) => {
24
16
  const last = runs.at(-1);
25
- if (last && last.group?.key === option._parentGroup?.key) last.rows.push({
17
+ if (last && last.group?.key === option.group?.key) last.rows.push({
26
18
  option,
27
19
  index
28
20
  });
29
21
  else runs.push({
30
- group: option._parentGroup,
22
+ group: option.group,
31
23
  first: index,
32
24
  rows: [{
33
25
  option,
@@ -60,10 +60,10 @@ export default class SideSheetFoundation<P extends SideSheetProps = SideSheetPro
60
60
  static getSheetSize({ placement, canVerticalSetWidth, width, height, mask }: Pick<SideSheetProps, 'placement' | 'width' | 'height' | 'mask'> & {
61
61
  canVerticalSetWidth?: boolean;
62
62
  }): SheetSize;
63
- handleCancel(e: any): void;
64
- beforeShow(): void;
65
- afterHide(): void;
66
- restoreFocus(): void;
67
- onVisibleChange(visible: boolean): void;
68
- toggleDisplayNone(displayNone: boolean): void;
63
+ handleCancel: (e: unknown) => void;
64
+ beforeShow: () => void;
65
+ afterHide: () => void;
66
+ restoreFocus: () => void;
67
+ onVisibleChange: (visible: boolean) => void;
68
+ toggleDisplayNone: (displayNone: boolean) => void;
69
69
  }
@@ -26,29 +26,29 @@ var SideSheetFoundation = class extends BaseFoundation {
26
26
  dialogHeight
27
27
  };
28
28
  }
29
- handleCancel(e) {
29
+ handleCancel = (e) => {
30
30
  if (!this.getProp("visible")) return;
31
- this._adapter.notifyCancel(e);
32
- }
33
- beforeShow() {
34
- if (this.getProp("disableScroll")) this._adapter.disabledBodyScroll();
35
- this._adapter.openLayer(this.#handleEscape);
36
- this._adapter.trapFocus();
37
- }
38
- afterHide() {
39
- this._adapter.enabledBodyScroll();
40
- this._adapter.closeLayer();
41
- this._adapter.releaseFocus();
31
+ this.adapter.notifyCancel(e);
32
+ };
33
+ beforeShow = () => {
34
+ if (this.getProp("disableScroll")) this.adapter.disabledBodyScroll();
35
+ this.adapter.openLayer(this.#handleEscape);
36
+ this.adapter.trapFocus();
37
+ };
38
+ afterHide = () => {
39
+ this.adapter.enabledBodyScroll();
40
+ this.adapter.closeLayer();
41
+ this.adapter.releaseFocus();
42
42
  this.restoreFocus();
43
- }
44
- restoreFocus() {
45
- this._adapter.restoreFocus();
46
- }
47
- onVisibleChange(visible) {
48
- this._adapter.notifyVisibleChange(visible);
49
- }
50
- toggleDisplayNone(displayNone) {
51
- this._adapter.toggleDisplayNone(displayNone);
52
- }
43
+ };
44
+ restoreFocus = () => {
45
+ this.adapter.restoreFocus();
46
+ };
47
+ onVisibleChange = (visible) => {
48
+ this.adapter.notifyVisibleChange(visible);
49
+ };
50
+ toggleDisplayNone = (displayNone) => {
51
+ this.adapter.toggleDisplayNone(displayNone);
52
+ };
53
53
  };
54
54
  export { SideSheetFoundation as default };
@@ -131,37 +131,37 @@ export default class SliderFoundation<P extends SliderProps = SliderProps, S ext
131
131
  /**
132
132
  * Syncs a changed value prop, clamped to min and max
133
133
  */
134
- handleValueChange(nextValue: SliderProps['value']): void;
134
+ handleValueChange: (nextValue: SliderProps["value"]) => void;
135
135
  /** A value prop back to undefined (a Form reset) returns to the default position */
136
- resetValue(): void;
137
- onHandleDown(e: Pick<PointerEvent, 'pointerId' | 'pointerType' | 'button' | 'clientX' | 'clientY'> & {
136
+ resetValue: () => void;
137
+ onHandleDown: (e: Pick<PointerEvent, "pointerId" | "pointerType" | "button" | "clientX" | "clientY"> & {
138
138
  currentTarget: HTMLElement;
139
- }, pos: 'min' | 'max'): boolean;
140
- onHandleEnter(pos: SliderState['activeHandle']): void;
141
- onHandleLeave(): void;
139
+ }, pos: "min" | "max") => boolean;
140
+ onHandleEnter: (pos: SliderState["activeHandle"]) => void;
141
+ onHandleLeave: () => void;
142
142
  /**
143
143
  * Both native inputs span min to max, so a range handle is stopped at the other one here
144
144
  */
145
- handleInputChange(value: number, pos: 'min' | 'max'): void;
145
+ handleInputChange: (value: number, pos: "min" | "max") => void;
146
146
  /**
147
147
  * A value key stays with the slider unless the consumer's handler already prevented it. Page, Home and End keep
148
148
  * the native range's change; arrows step here, since engines map them differently over a vertical or RTL range
149
149
  * (Chrome follows the visual direction, Firefox not when vertical, Safari in neither case). The arrow pointing
150
150
  * towards max increases; the cross-axis arrow follows Up and Right.
151
151
  */
152
- handleKeyDown(event: Pick<KeyboardEvent, 'key' | 'defaultPrevented' | 'stopPropagation' | 'preventDefault' | KeyModifiers>, pos: 'min' | 'max'): void;
152
+ handleKeyDown: (event: Pick<KeyboardEvent, "key" | "defaultPrevented" | "stopPropagation" | "preventDefault" | KeyModifiers>, pos: "min" | "max") => void;
153
153
  /**
154
154
  * Releasing a value key ends the change, like releasing the mouse
155
155
  */
156
- handleKeyUp(event: Pick<KeyboardEvent, 'key' | KeyModifiers>): void;
157
- onFocus(e: {
156
+ handleKeyUp: (event: Pick<KeyboardEvent, "key" | KeyModifiers | "stopPropagation" | "preventDefault">) => void;
157
+ onFocus: (e: {
158
158
  target: Element;
159
- }, pos: 'min' | 'max'): void;
160
- onBlur(pos: 'min' | 'max'): void;
161
- handleWrapClick: (e: any) => void;
159
+ }, pos: "min" | "max") => void;
160
+ onBlur: (pos: "min" | "max") => void;
161
+ handleWrapClick: (e: Pick<MouseEvent, "clientX" | "clientY">) => void;
162
162
  /** A mark label is a wide target: it selects the mark's own value, not the value under the pointer */
163
- handleMarkClick(markValue: number): void;
164
- handleWrapperEnter(): void;
165
- handleWrapperLeave(): void;
163
+ handleMarkClick: (markValue: number) => void;
164
+ handleWrapperEnter: () => void;
165
+ handleWrapperLeave: () => void;
166
166
  }
167
167
  export {};
@@ -55,10 +55,10 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
55
55
  return typeof e.pointerId === "number" && e.pointerId !== this.#pointerId;
56
56
  }
57
57
  #getParentRect() {
58
- return this._adapter.getSliderNode()?.offsetParent?.getBoundingClientRect();
58
+ return this.adapter.getSliderNode()?.offsetParent?.getBoundingClientRect();
59
59
  }
60
60
  #getSliderLengths() {
61
- const slider = this._adapter.getSliderNode();
61
+ const slider = this.adapter.getSliderNode();
62
62
  if (!slider) return {
63
63
  sliderX: 0,
64
64
  sliderY: 0,
@@ -75,19 +75,19 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
75
75
  };
76
76
  }
77
77
  #notifyAfterChange() {
78
- this._adapter.notifyAfterChange(this.normalizeValue(this.getState("currentValue")));
78
+ this.adapter.notifyAfterChange(this.normalizeValue(this.getState("currentValue")));
79
79
  }
80
80
  /** A controlled value only moves through the value prop */
81
81
  #moveHandle(nextValue, callback) {
82
82
  this.syncIsInRenderTree();
83
83
  if (!this.getState("isInRenderTree")) return;
84
84
  if (isEqual(this.normalizeValue(this.getState("currentValue")), nextValue)) return;
85
- if (this._isControlledComponent()) return;
85
+ if (this.isControlledComponent()) return;
86
86
  this.setState({ currentValue: nextValue }, callback);
87
87
  }
88
88
  #commitClick(nextValue) {
89
- this._adapter.notifyChange(nextValue);
90
- if (this._isControlledComponent()) return;
89
+ this.adapter.notifyChange(nextValue);
90
+ if (this.isControlledComponent()) return;
91
91
  this.#moveHandle(nextValue, () => this.#notifyAfterChange());
92
92
  }
93
93
  #onHandleMove = (e) => {
@@ -102,14 +102,14 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
102
102
  if (this.getState("isDrag")) {
103
103
  const nextValue = this.calculateOutputValue(pagePos, chooseMovePos === "min");
104
104
  if (nextValue === void 0) return false;
105
- this._adapter.notifyChange(nextValue);
105
+ this.adapter.notifyChange(nextValue);
106
106
  this.#moveHandle(nextValue);
107
107
  }
108
108
  return true;
109
109
  };
110
110
  #onHandleUp = (e) => {
111
111
  if (this.#isOtherPointer(e)) return false;
112
- this._adapter.notifyMouseUp(e);
112
+ this.adapter.notifyMouseUp(e);
113
113
  handlePrevent(e);
114
114
  this.#unbindDragEvents();
115
115
  const wasDragging = this.getState("isDrag");
@@ -138,8 +138,8 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
138
138
  * Clamps a pointer position to the slider's start and end
139
139
  */
140
140
  checkMeetMinMax(position) {
141
- const { vertical, verticalReverse } = this._adapter.getProps();
142
- const isRTL = this._adapter.getContext("direction") === "rtl" && !vertical;
141
+ const { vertical, verticalReverse } = this.adapter.getProps();
142
+ const isRTL = this.adapter.getContext("direction") === "rtl" && !vertical;
143
143
  const { sliderX, sliderY, sliderWidth, sliderHeight } = this.#getSliderLengths();
144
144
  const len = vertical ? sliderHeight : sliderWidth;
145
145
  let startPos;
@@ -160,9 +160,9 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
160
160
  /** Position to value snapped to step; false when nothing changes or the slider has no layout */
161
161
  transPosToValue(mousePos, isMin) {
162
162
  const pos = this.checkMeetMinMax(mousePos);
163
- const { currentValue } = this._adapter.getStates();
164
- const { range, vertical, step, verticalReverse, min, max } = this._adapter.getProps();
165
- const isRTL = this._adapter.getContext("direction") === "rtl" && !vertical;
163
+ const { currentValue } = this.adapter.getStates();
164
+ const { range, vertical, step, verticalReverse, min, max } = this.adapter.getProps();
165
+ const isRTL = this.adapter.getContext("direction") === "rtl" && !vertical;
166
166
  const { sliderX, sliderY, sliderWidth, sliderHeight } = this.#getSliderLengths();
167
167
  const startPos = vertical ? sliderY : sliderX;
168
168
  const len = vertical ? sliderHeight : sliderWidth;
@@ -181,8 +181,8 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
181
181
  else return false;
182
182
  }
183
183
  transValueToPos(value) {
184
- const { vertical, range, verticalReverse, min, max } = this._adapter.getProps();
185
- const isRTL = this._adapter.getContext("direction") === "rtl" && !vertical;
184
+ const { vertical, range, verticalReverse, min, max } = this.adapter.getProps();
185
+ const isRTL = this.adapter.getContext("direction") === "rtl" && !vertical;
186
186
  const { sliderX, sliderY, sliderWidth, sliderHeight } = this.#getSliderLengths();
187
187
  const startPos = vertical ? sliderY : sliderX;
188
188
  const len = vertical ? sliderHeight : sliderWidth;
@@ -204,7 +204,7 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
204
204
  return this.normalizeValue(moveValue);
205
205
  }
206
206
  checkWhichHandle(pagePos) {
207
- const { currentValue } = this._adapter.getStates();
207
+ const { currentValue } = this.adapter.getStates();
208
208
  const currentPos = this.transValueToPos(currentValue);
209
209
  if (!Array.isArray(currentPos)) return true;
210
210
  return Math.abs(pagePos - currentPos[0]) <= Math.abs(pagePos - currentPos[1]);
@@ -314,25 +314,25 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
314
314
  }
315
315
  /** An event handler, so the tooltips follow a container that was hidden */
316
316
  syncIsInRenderTree = () => {
317
- const slider = this._adapter.getSliderNode();
317
+ const slider = this.adapter.getSliderNode();
318
318
  const isInRenderTree = Boolean(slider && (slider.offsetWidth || slider.offsetHeight || slider.getClientRects().length));
319
319
  if (isInRenderTree !== this.getState("isInRenderTree")) this.setState({ isInRenderTree });
320
320
  };
321
321
  /**
322
322
  * Syncs a changed value prop, clamped to min and max
323
323
  */
324
- handleValueChange(nextValue) {
324
+ handleValueChange = (nextValue) => {
325
325
  if (!this.valueFormatIsCorrect(nextValue)) return;
326
326
  this.setState({ currentValue: this.#clampToRange(nextValue) });
327
- }
327
+ };
328
328
  /** A value prop back to undefined (a Form reset) returns to the default position */
329
- resetValue() {
329
+ resetValue = () => {
330
330
  const { defaultValue, range, min } = this.getProps();
331
331
  const fallback = range ? [min, min] : min;
332
332
  this.setState({ currentValue: this.valueFormatIsCorrect(defaultValue) ? defaultValue : fallback });
333
333
  this.#checkCurrentValue();
334
- }
335
- onHandleDown(e, pos) {
334
+ };
335
+ onHandleDown = (e, pos) => {
336
336
  if (isSecondaryPress(e)) return false;
337
337
  this.#bindDragEvents(e.pointerId);
338
338
  try {
@@ -348,38 +348,38 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
348
348
  const pointerPos = vertical ? mousePos.y : mousePos.x;
349
349
  this.#dragOffset = pointerPos - this.#getHandleCenterPosition(vertical, e.currentTarget);
350
350
  return true;
351
- }
352
- onHandleEnter(pos) {
351
+ };
352
+ onHandleEnter = (pos) => {
353
353
  const { activeHandle } = this.getStates();
354
354
  if (!this.getProp("disabled") && !activeHandle && pos !== activeHandle) this.setState({ activeHandle: pos });
355
- }
356
- onHandleLeave() {
355
+ };
356
+ onHandleLeave = () => {
357
357
  if (!this.getState("isDrag")) this.setState({ activeHandle: "" });
358
- }
358
+ };
359
359
  /**
360
360
  * Both native inputs span min to max, so a range handle is stopped at the other one here
361
361
  */
362
- handleInputChange(value, pos) {
362
+ handleInputChange = (value, pos) => {
363
363
  if (this.getProp("disabled")) return;
364
364
  const { currentValue } = this.getStates();
365
365
  let outputValue = value;
366
366
  if (Array.isArray(currentValue)) outputValue = pos === "min" ? [Math.min(value, currentValue[1]), currentValue[1]] : [currentValue[0], Math.max(value, currentValue[0])];
367
367
  if (!isEqual(currentValue, outputValue)) {
368
- if (!this._isControlledComponent()) this.setState({ currentValue: outputValue });
369
- this._adapter.notifyChange(outputValue);
368
+ if (!this.isControlledComponent()) this.setState({ currentValue: outputValue });
369
+ this.adapter.notifyChange(outputValue);
370
370
  }
371
- }
371
+ };
372
372
  /**
373
373
  * A value key stays with the slider unless the consumer's handler already prevented it. Page, Home and End keep
374
374
  * the native range's change; arrows step here, since engines map them differently over a vertical or RTL range
375
375
  * (Chrome follows the visual direction, Firefox not when vertical, Safari in neither case). The arrow pointing
376
376
  * towards max increases; the cross-axis arrow follows Up and Right.
377
377
  */
378
- handleKeyDown(event, pos) {
378
+ handleKeyDown = (event, pos) => {
379
379
  if (event.defaultPrevented || !VALUE_KEYS.includes(event.key) || hasModifier(event)) return;
380
380
  event.stopPropagation();
381
381
  const { vertical, verticalReverse, step, min, max } = this.getProps();
382
- const increase = [vertical ? verticalReverse ? "ArrowUp" : "ArrowDown" : this._adapter.getContext("direction") === "rtl" ? "ArrowLeft" : "ArrowRight", vertical ? "ArrowRight" : "ArrowUp"];
382
+ const increase = [vertical ? verticalReverse ? "ArrowUp" : "ArrowDown" : this.adapter.getContext("direction") === "rtl" ? "ArrowLeft" : "ArrowRight", vertical ? "ArrowRight" : "ArrowUp"];
383
383
  const opposite = {
384
384
  ArrowUp: "ArrowDown",
385
385
  ArrowDown: "ArrowUp",
@@ -393,20 +393,20 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
393
393
  const value = Array.isArray(currentValue) ? currentValue[pos === "min" ? 0 : 1] : currentValue;
394
394
  const next = this.normalizeValue(value + delta * (step > 0 ? step : 1));
395
395
  if (next >= min && next <= max) this.handleInputChange(next, pos);
396
- }
396
+ };
397
397
  /**
398
398
  * Releasing a value key ends the change, like releasing the mouse
399
399
  */
400
- handleKeyUp(event) {
400
+ handleKeyUp = (event) => {
401
401
  if (VALUE_KEYS.includes(event.key) && !hasModifier(event)) this.#onHandleUp(event);
402
- }
403
- onFocus(e, pos) {
402
+ };
403
+ onFocus = (e, pos) => {
404
404
  if (this.#noTooltip()) return;
405
405
  if (e.target.matches(":focus-visible")) this.setState({ focusVisibleHandle: pos });
406
- }
407
- onBlur(pos) {
406
+ };
407
+ onBlur = (pos) => {
408
408
  if (!this.#noTooltip() && this.getState("focusVisibleHandle") === pos) this.setState({ focusVisibleHandle: "" });
409
- }
409
+ };
410
410
  handleWrapClick = (e) => {
411
411
  if (this.getState("isDrag") || this.getProp("disabled")) return;
412
412
  const { vertical } = this.getProps();
@@ -418,7 +418,7 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
418
418
  this.#commitClick(nextValue);
419
419
  };
420
420
  /** A mark label is a wide target: it selects the mark's own value, not the value under the pointer */
421
- handleMarkClick(markValue) {
421
+ handleMarkClick = (markValue) => {
422
422
  if (this.getState("isDrag") || this.getProp("disabled")) return;
423
423
  const { range } = this.getProps();
424
424
  const currentValue = this.getState("currentValue");
@@ -430,12 +430,12 @@ var SliderFoundation = class SliderFoundation extends BaseFoundation {
430
430
  }
431
431
  if (isEqual(this.normalizeValue(currentValue), nextValue)) return;
432
432
  this.#commitClick(nextValue);
433
- }
434
- handleWrapperEnter() {
433
+ };
434
+ handleWrapperEnter = () => {
435
435
  this.setState({ showBoundary: true });
436
- }
437
- handleWrapperLeave() {
436
+ };
437
+ handleWrapperLeave = () => {
438
438
  this.setState({ showBoundary: false });
439
- }
439
+ };
440
440
  };
441
441
  export { SliderFoundation as default };
@@ -9,6 +9,6 @@ export declare class SortableAnnouncer {
9
9
  #private;
10
10
  readonly plugin: ReturnType<typeof Accessibility.configure>;
11
11
  constructor(locale: SortableLocale, total: number);
12
- update(locale: SortableLocale, total: number): void;
12
+ update: (locale: SortableLocale, total: number) => void;
13
13
  }
14
14
  export {};
@@ -32,7 +32,7 @@ var SortableAnnouncer = class {
32
32
  }
33
33
  });
34
34
  }
35
- update(locale, total) {
35
+ update = (locale, total) => {
36
36
  if (locale.instructions !== this.#instructions.draggable) {
37
37
  this.#instructions.draggable = locale.instructions;
38
38
  const description = document.getElementById(`${descriptionPrefix}-${this.#id}`);
@@ -40,6 +40,6 @@ var SortableAnnouncer = class {
40
40
  }
41
41
  this.#locale = locale;
42
42
  this.#total = total;
43
- }
43
+ };
44
44
  };
45
45
  export { SortableAnnouncer };
@@ -9,12 +9,12 @@ export interface SpinBaseProps {
9
9
  export default class SpinFoundation<P extends SpinBaseProps = SpinBaseProps, S extends object = object> extends BaseFoundation<SpinAdapter<P, S>, P, S> {
10
10
  #private;
11
11
  /** Shows the spinner after `delay`; stopping hides it at once and drops a pending show */
12
- handleSpinningChange(spinning: boolean): void;
12
+ handleSpinningChange: (spinning: boolean) => void;
13
13
  /**
14
14
  * Called when the content under `root` becomes inert (`blocked`) or interactive again. inert drops focus to <body> on
15
15
  * the next frame, which would restart keyboard users from the top of the page; the root holds it meanwhile and hands
16
16
  * it back afterwards.
17
17
  */
18
- handleBlockedChange(root: HTMLElement, blocked: boolean): void;
18
+ handleBlockedChange: (root: HTMLElement, blocked: boolean) => void;
19
19
  destroy(): void;
20
20
  }
@@ -9,21 +9,21 @@ var SpinFoundation = class extends BaseFoundation {
9
9
  this.#timer = null;
10
10
  }
11
11
  /** Shows the spinner after `delay`; stopping hides it at once and drops a pending show */
12
- handleSpinningChange(spinning) {
12
+ handleSpinningChange = (spinning) => {
13
13
  this.#clearTimer();
14
14
  const { delay } = this.getProps();
15
15
  if (spinning && delay) this.#timer = setTimeout(() => {
16
16
  this.#timer = null;
17
- this._adapter.setLoading(true);
17
+ this.adapter.setLoading(true);
18
18
  }, delay);
19
- else this._adapter.setLoading(spinning);
20
- }
19
+ else this.adapter.setLoading(spinning);
20
+ };
21
21
  /**
22
22
  * Called when the content under `root` becomes inert (`blocked`) or interactive again. inert drops focus to <body> on
23
23
  * the next frame, which would restart keyboard users from the top of the page; the root holds it meanwhile and hands
24
24
  * it back afterwards.
25
25
  */
26
- handleBlockedChange(root, blocked) {
26
+ handleBlockedChange = (root, blocked) => {
27
27
  if (blocked) {
28
28
  const active = FocusTrapHandle.getActiveElement(root);
29
29
  if (active instanceof HTMLElement && active !== root && root.contains(active)) {
@@ -35,7 +35,7 @@ var SpinFoundation = class extends BaseFoundation {
35
35
  this.#heldFocus = null;
36
36
  if (held.isConnected && (FocusTrapHandle.getActiveElement(root) === root || document.activeElement === document.body)) held.focus();
37
37
  }
38
- }
38
+ };
39
39
  destroy() {
40
40
  this.#clearTimer();
41
41
  }
@@ -1,7 +1,7 @@
1
1
  export type StepStatus = 'wait' | 'process' | 'finish' | 'error' | 'warning';
2
2
  export interface StepState {
3
3
  /** Undefined when the step has its own status */
4
- status: StepStatus | undefined;
4
+ status?: StepStatus;
5
5
  active: boolean;
6
6
  done: boolean;
7
7
  /** The step before the current one while the flow is in error */
@@ -18,7 +18,7 @@ export interface SwitchBaseProps extends SwitchCheckedProps {
18
18
  export default class SwitchFoundation<P extends SwitchBaseProps = SwitchBaseProps, S extends SwitchState = SwitchState, E = unknown> extends BaseFoundation<SwitchAdapter<P, S, E>, P, S> {
19
19
  static getInitialState(props: SwitchCheckedProps): SwitchState;
20
20
  static deriveChecked(props: SwitchCheckedProps, state: Pick<SwitchState, 'checked'>): boolean;
21
- setChecked(checked?: boolean): void;
22
- handleChange(checked: boolean, e: E): void;
21
+ setChecked: (checked?: boolean) => void;
22
+ handleChange: (checked: boolean, e: E) => void;
23
23
  }
24
24
  export {};
@@ -7,13 +7,13 @@ var SwitchFoundation = class extends BaseFoundation {
7
7
  static deriveChecked(props, state) {
8
8
  return Boolean(props.checked !== void 0 ? props.checked : state.checked);
9
9
  }
10
- setChecked(checked) {
11
- this._adapter.setChecked(checked);
12
- }
13
- handleChange(checked, e) {
10
+ setChecked = (checked) => {
11
+ this.adapter.setChecked(checked);
12
+ };
13
+ handleChange = (checked, e) => {
14
14
  if (this.getProp("loading")) return;
15
- if (!this._isControlledComponent("checked")) this.setChecked(checked);
16
- this._adapter.notifyChange(checked, e);
17
- }
15
+ if (!this.isControlledComponent("checked")) this.setChecked(checked);
16
+ this.adapter.notifyChange(checked, e);
17
+ };
18
18
  };
19
19
  export { SwitchFoundation as default };