@fibrae/semi-foundation 0.1.1 → 0.3.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 (282) hide show
  1. package/dist/anchor/foundation.d.ts +1 -4
  2. package/dist/anchor/foundation.js +21 -22
  3. package/dist/audio-player/foundation.d.ts +10 -13
  4. package/dist/audio-player/foundation.js +19 -20
  5. package/dist/auto-complete/foundation.d.ts +12 -14
  6. package/dist/auto-complete/foundation.js +51 -52
  7. package/dist/avatar/foundation.d.ts +5 -6
  8. package/dist/avatar/foundation.js +16 -16
  9. package/dist/avatar/variables.scss +0 -1
  10. package/dist/backtop/foundation.d.ts +2 -5
  11. package/dist/backtop/foundation.js +7 -8
  12. package/dist/banner/foundation.d.ts +1 -1
  13. package/dist/banner/foundation.js +4 -4
  14. package/dist/base/auto-close-foundation.d.ts +8 -9
  15. package/dist/base/auto-close-foundation.js +15 -15
  16. package/dist/base/foundation.d.ts +4 -4
  17. package/dist/base/foundation.js +12 -11
  18. package/dist/base/list-store.d.ts +0 -1
  19. package/dist/breadcrumb/foundation.d.ts +5 -5
  20. package/dist/breadcrumb/foundation.js +9 -10
  21. package/dist/breadcrumb/item-foundation.d.ts +3 -3
  22. package/dist/breadcrumb/item-foundation.js +6 -6
  23. package/dist/calendar/event-util.d.ts +0 -10
  24. package/dist/calendar/event-util.js +1 -11
  25. package/dist/calendar/foundation.d.ts +1 -6
  26. package/dist/calendar/foundation.js +5 -9
  27. package/dist/calendar/month-foundation.d.ts +2 -3
  28. package/dist/calendar/month-foundation.js +6 -7
  29. package/dist/carousel/foundation.d.ts +17 -19
  30. package/dist/carousel/foundation.js +51 -51
  31. package/dist/cascader/foundation.d.ts +36 -32
  32. package/dist/cascader/foundation.js +145 -132
  33. package/dist/cascader/util.d.ts +1 -8
  34. package/dist/cascader/util.js +1 -8
  35. package/dist/checkbox/checkbox-foundation.d.ts +3 -7
  36. package/dist/checkbox/checkbox-foundation.js +15 -17
  37. package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
  38. package/dist/checkbox/checkbox-group-foundation.js +8 -8
  39. package/dist/code-highlight/index.d.ts +1 -2
  40. package/dist/code-highlight/index.js +3 -3
  41. package/dist/collapse/foundation.d.ts +2 -2
  42. package/dist/collapse/foundation.js +7 -7
  43. package/dist/collapsible/foundation.d.ts +3 -3
  44. package/dist/collapsible/foundation.js +8 -8
  45. package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
  46. package/dist/color-picker/alpha-slider-foundation.js +10 -10
  47. package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
  48. package/dist/color-picker/color-choose-area-foundation.js +14 -14
  49. package/dist/color-picker/color-picker.scss +0 -2
  50. package/dist/color-picker/color-slider-foundation.d.ts +2 -4
  51. package/dist/color-picker/color-slider-foundation.js +10 -10
  52. package/dist/color-picker/data-part-foundation.d.ts +5 -5
  53. package/dist/color-picker/data-part-foundation.js +11 -11
  54. package/dist/color-picker/foundation.d.ts +4 -4
  55. package/dist/color-picker/foundation.js +10 -10
  56. package/dist/color-picker/interface.d.ts +0 -1
  57. package/dist/config-provider/breakpoint-observer.d.ts +3 -3
  58. package/dist/config-provider/breakpoint-observer.js +6 -6
  59. package/dist/config-provider/responsive-types.d.ts +0 -16
  60. package/dist/cropper/foundation.d.ts +15 -16
  61. package/dist/cropper/foundation.js +26 -24
  62. package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
  63. package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
  64. package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
  65. package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
  66. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
  67. package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
  68. package/dist/date-picker/_utils/parser.d.ts +0 -3
  69. package/dist/date-picker/_utils/parser.js +0 -7
  70. package/dist/date-picker/_utils/picker-type.d.ts +1 -3
  71. package/dist/date-picker/_utils/picker-type.js +0 -2
  72. package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
  73. package/dist/date-picker/_utils/to-callback-args.js +0 -1
  74. package/dist/date-picker/date-picker.scss +0 -3
  75. package/dist/date-picker/foundation.d.ts +39 -58
  76. package/dist/date-picker/foundation.js +126 -153
  77. package/dist/date-picker/input-foundation.d.ts +10 -16
  78. package/dist/date-picker/input-foundation.js +28 -30
  79. package/dist/date-picker/month-foundation.d.ts +0 -3
  80. package/dist/date-picker/month-foundation.js +0 -2
  81. package/dist/date-picker/months-grid-foundation.d.ts +17 -26
  82. package/dist/date-picker/months-grid-foundation.js +65 -75
  83. package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
  84. package/dist/date-picker/year-and-month-foundation.js +11 -11
  85. package/dist/drag-move/foundation.d.ts +2 -3
  86. package/dist/drag-move/foundation.js +15 -13
  87. package/dist/dropdown/foundation.d.ts +8 -7
  88. package/dist/dropdown/foundation.js +32 -28
  89. package/dist/dropdown/menu-foundation.d.ts +1 -2
  90. package/dist/dropdown/menu-foundation.js +11 -11
  91. package/dist/feedback/foundation.d.ts +9 -10
  92. package/dist/feedback/foundation.js +33 -33
  93. package/dist/feedback/variables.scss +1 -5
  94. package/dist/float-button/float-button.css +0 -1
  95. package/dist/float-button/float-button.scss +0 -2
  96. package/dist/form/form-api-proxy.d.ts +8 -7
  97. package/dist/form/form-api-proxy.js +25 -25
  98. package/dist/form/form.scss +0 -12
  99. package/dist/form/foundation.d.ts +5 -5
  100. package/dist/form/foundation.js +60 -76
  101. package/dist/form/interface.d.ts +2 -15
  102. package/dist/form/utils.d.ts +0 -8
  103. package/dist/form/utils.js +0 -7
  104. package/dist/form/variables.scss +1 -4
  105. package/dist/grid/variables.scss +0 -10
  106. package/dist/highlight/foundation.d.ts +0 -2
  107. package/dist/highlight/foundation.js +1 -3
  108. package/dist/hot-keys/foundation.d.ts +2 -3
  109. package/dist/hot-keys/foundation.js +5 -5
  110. package/dist/image/image-foundation.d.ts +4 -6
  111. package/dist/image/image-foundation.js +10 -10
  112. package/dist/image/preview-footer-foundation.d.ts +3 -4
  113. package/dist/image/preview-footer-foundation.js +10 -10
  114. package/dist/image/preview-foundation.d.ts +0 -3
  115. package/dist/image/preview-foundation.js +7 -6
  116. package/dist/image/preview-image-foundation.d.ts +6 -9
  117. package/dist/image/preview-image-foundation.js +14 -14
  118. package/dist/image/preview-inner-foundation.d.ts +9 -10
  119. package/dist/image/preview-inner-foundation.js +38 -38
  120. package/dist/input/foundation.d.ts +10 -11
  121. package/dist/input/foundation.js +47 -49
  122. package/dist/input/text-entry-foundation.d.ts +3 -5
  123. package/dist/input/text-entry-foundation.js +14 -15
  124. package/dist/input/textarea-foundation.d.ts +7 -8
  125. package/dist/input/textarea-foundation.js +36 -36
  126. package/dist/input-number/caret.d.ts +0 -1
  127. package/dist/input-number/caret.js +0 -1
  128. package/dist/input-number/foundation.d.ts +16 -19
  129. package/dist/input-number/foundation.js +54 -58
  130. package/dist/json-viewer/foundation.d.ts +8 -10
  131. package/dist/json-viewer/foundation.js +23 -24
  132. package/dist/locale/interface.d.ts +0 -3
  133. package/dist/lottie/foundation.d.ts +1 -1
  134. package/dist/lottie/foundation.js +4 -4
  135. package/dist/markdown-render/foundation.d.ts +2 -7
  136. package/dist/markdown-render/foundation.js +5 -9
  137. package/dist/modal/modal-content-foundation.d.ts +7 -7
  138. package/dist/modal/modal-content-foundation.js +20 -20
  139. package/dist/modal/modal-foundation.d.ts +6 -6
  140. package/dist/modal/modal-foundation.js +24 -24
  141. package/dist/navigation/foundation.d.ts +1 -8
  142. package/dist/navigation/foundation.js +14 -20
  143. package/dist/navigation/item-foundation.d.ts +1 -1
  144. package/dist/navigation/item-foundation.js +8 -8
  145. package/dist/navigation/sub-nav-foundation.d.ts +3 -4
  146. package/dist/navigation/sub-nav-foundation.js +17 -17
  147. package/dist/notification/notification-list-foundation.d.ts +7 -8
  148. package/dist/notification/notification-list-foundation.js +12 -13
  149. package/dist/notification/variables.scss +0 -1
  150. package/dist/overflow-list/foundation.d.ts +4 -6
  151. package/dist/overflow-list/foundation.js +18 -19
  152. package/dist/pagination/foundation.d.ts +8 -10
  153. package/dist/pagination/foundation.js +28 -28
  154. package/dist/pincode/foundation.d.ts +6 -9
  155. package/dist/pincode/foundation.js +23 -26
  156. package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
  157. package/dist/popconfirm/popconfirm-foundation.js +26 -26
  158. package/dist/progress/generates.d.ts +1 -4
  159. package/dist/progress/generates.js +1 -4
  160. package/dist/progress/utils.d.ts +1 -1
  161. package/dist/progress/utils.js +1 -1
  162. package/dist/radio/radio-foundation.d.ts +5 -9
  163. package/dist/radio/radio-foundation.js +15 -16
  164. package/dist/radio/radio-group-foundation.d.ts +2 -3
  165. package/dist/radio/radio-group-foundation.js +9 -9
  166. package/dist/rating/foundation.d.ts +10 -15
  167. package/dist/rating/foundation.js +35 -38
  168. package/dist/resizable/group/index.d.ts +6 -10
  169. package/dist/resizable/group/index.js +40 -44
  170. package/dist/resizable/resizable.scss +0 -1
  171. package/dist/resizable/single/index.d.ts +3 -7
  172. package/dist/resizable/single/index.js +10 -13
  173. package/dist/scroll-list/item-foundation.d.ts +7 -9
  174. package/dist/scroll-list/item-foundation.js +35 -36
  175. package/dist/scroll-list/variables.scss +1 -6
  176. package/dist/select/foundation.d.ts +42 -57
  177. package/dist/select/foundation.js +214 -279
  178. package/dist/select/option-foundation.d.ts +23 -28
  179. package/dist/select/option-foundation.js +10 -19
  180. package/dist/select/variables.scss +1 -8
  181. package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
  182. package/dist/side-sheet/side-sheet-foundation.js +23 -27
  183. package/dist/side-sheet/variables.scss +1 -3
  184. package/dist/slider/foundation.d.ts +17 -28
  185. package/dist/slider/foundation.js +47 -59
  186. package/dist/slider/variables.scss +1 -5
  187. package/dist/sortable/accessibility.d.ts +1 -1
  188. package/dist/sortable/accessibility.js +2 -2
  189. package/dist/spin/foundation.d.ts +2 -4
  190. package/dist/spin/foundation.js +6 -7
  191. package/dist/spin/variables.scss +1 -3
  192. package/dist/steps/utils.d.ts +1 -1
  193. package/dist/switch/foundation.d.ts +2 -3
  194. package/dist/switch/foundation.js +7 -7
  195. package/dist/switch/switch.scss +1 -1
  196. package/dist/switch/variables.scss +1 -5
  197. package/dist/table/foundation.d.ts +24 -33
  198. package/dist/table/foundation.js +144 -108
  199. package/dist/table/table.scss +0 -1
  200. package/dist/table/utils.d.ts +2 -10
  201. package/dist/table/utils.js +0 -13
  202. package/dist/table/variables.scss +1 -5
  203. package/dist/tabs/foundation.d.ts +5 -14
  204. package/dist/tabs/foundation.js +17 -21
  205. package/dist/tabs/tabs.scss +1 -1
  206. package/dist/tag/focus.js +0 -1
  207. package/dist/tag-input/foundation.d.ts +11 -13
  208. package/dist/tag-input/foundation.js +52 -53
  209. package/dist/tag-input/tag-input.scss +0 -1
  210. package/dist/tag-input/utils/tag-focus.d.ts +0 -1
  211. package/dist/tag-input/utils/tag-focus.js +0 -1
  212. package/dist/time-picker/combox-foundation.d.ts +3 -11
  213. package/dist/time-picker/combox-foundation.js +3 -10
  214. package/dist/time-picker/foundation.d.ts +13 -23
  215. package/dist/time-picker/foundation.js +39 -48
  216. package/dist/time-picker/input-foundation.d.ts +4 -4
  217. package/dist/time-picker/input-foundation.js +13 -13
  218. package/dist/time-picker/utils/index.d.ts +0 -11
  219. package/dist/time-picker/utils/index.js +0 -11
  220. package/dist/toast/toast-list-foundation.d.ts +7 -7
  221. package/dist/toast/toast-list-foundation.js +14 -14
  222. package/dist/tooltip/adjust-position.d.ts +1 -2
  223. package/dist/tooltip/constants.d.ts +0 -3
  224. package/dist/tooltip/constants.js +0 -3
  225. package/dist/tooltip/foundation.d.ts +9 -12
  226. package/dist/tooltip/foundation.js +67 -63
  227. package/dist/tooltip/position.scss +0 -1
  228. package/dist/transfer/foundation.d.ts +22 -13
  229. package/dist/transfer/foundation.js +38 -24
  230. package/dist/tree/foundation.d.ts +14 -16
  231. package/dist/tree/foundation.js +61 -62
  232. package/dist/tree/shared.d.ts +2 -4
  233. package/dist/tree/shared.js +0 -2
  234. package/dist/tree/tree-util.d.ts +0 -5
  235. package/dist/tree/tree-util.js +0 -5
  236. package/dist/tree-select/foundation.d.ts +26 -22
  237. package/dist/tree-select/foundation.js +91 -86
  238. package/dist/typography/ellipsis.d.ts +5 -7
  239. package/dist/typography/ellipsis.js +8 -10
  240. package/dist/typography/format-numeral.d.ts +1 -1
  241. package/dist/typography/format-numeral.js +2 -2
  242. package/dist/typography/typography.scss +0 -1
  243. package/dist/upload/constants.d.ts +1 -1
  244. package/dist/upload/foundation.d.ts +17 -23
  245. package/dist/upload/foundation.js +93 -103
  246. package/dist/upload/utils.d.ts +3 -8
  247. package/dist/upload/utils.js +6 -11
  248. package/dist/user-guide/foundation.d.ts +3 -5
  249. package/dist/user-guide/foundation.js +19 -19
  250. package/dist/utils/a11y.d.ts +2 -6
  251. package/dist/utils/a11y.js +1 -4
  252. package/dist/utils/announcer.d.ts +2 -2
  253. package/dist/utils/announcer.js +4 -4
  254. package/dist/utils/array.d.ts +0 -6
  255. package/dist/utils/array.js +0 -6
  256. package/dist/utils/date-fns-extra.js +1 -5
  257. package/dist/utils/dom.d.ts +0 -1
  258. package/dist/utils/dom.js +0 -1
  259. package/dist/utils/escape-html.js +0 -3
  260. package/dist/utils/field-sizing.d.ts +0 -2
  261. package/dist/utils/field-sizing.js +0 -2
  262. package/dist/utils/focus-handle.d.ts +1 -2
  263. package/dist/utils/focus-handle.js +1 -3
  264. package/dist/utils/focus-scope.d.ts +5 -6
  265. package/dist/utils/focus-scope.js +10 -11
  266. package/dist/utils/is-promise.d.ts +1 -1
  267. package/dist/utils/release-holder.d.ts +2 -2
  268. package/dist/utils/release-holder.js +4 -4
  269. package/dist/utils/scroll-lock.d.ts +3 -4
  270. package/dist/utils/scroll-lock.js +3 -4
  271. package/dist/utils/tween.d.ts +0 -1
  272. package/dist/utils/tween.js +0 -1
  273. package/dist/utils/uuid.d.ts +0 -1
  274. package/dist/utils/uuid.js +0 -1
  275. package/dist/utils/warning.d.ts +0 -1
  276. package/dist/utils/warning.js +0 -1
  277. package/dist/video-player/foundation.d.ts +15 -15
  278. package/dist/video-player/foundation.js +89 -89
  279. package/dist/video-player/progress-foundation.d.ts +2 -3
  280. package/dist/video-player/progress-foundation.js +12 -13
  281. package/dist/video-player/variables.scss +1 -1
  282. package/package.json +2 -2
@@ -8,7 +8,6 @@ export interface RadioChangeEvent {
8
8
  stopPropagation: () => void;
9
9
  preventDefault: () => void;
10
10
  }
11
- /** What a radio reads from the enclosing RadioGroup */
12
11
  export interface RadioGroupView {
13
12
  value?: unknown;
14
13
  disabled?: boolean;
@@ -24,7 +23,6 @@ export interface RadioContextView {
24
23
  mode?: string;
25
24
  radioGroup?: RadioGroupView;
26
25
  }
27
- /** The props the foundation reads with getProps */
28
26
  export interface RadioBaseProps {
29
27
  checked?: boolean;
30
28
  defaultChecked?: boolean;
@@ -55,7 +53,6 @@ export interface RadioView {
55
53
  buttonSize?: string;
56
54
  prefixCls?: string;
57
55
  }
58
- /** The part of the native event the foundation forwards */
59
56
  interface RadioSourceEvent {
60
57
  stopPropagation: () => void;
61
58
  preventDefault: () => void;
@@ -63,16 +60,15 @@ interface RadioSourceEvent {
63
60
  export default class RadioFoundation<P extends RadioBaseProps = RadioBaseProps, S extends RadioBaseState = RadioBaseState> extends BaseFoundation<RadioAdapter<P, S>, P, S> {
64
61
  #private;
65
62
  static getInitialState(props: Pick<RadioBaseProps, 'checked' | 'defaultChecked'>): RadioBaseState;
66
- /** How the radio looks and behaves, from its own props or, inside a group, from the group */
67
63
  static deriveView(props: RadioBaseProps, state: RadioBaseState, context?: RadioContextView | null): RadioView;
68
64
  init(): void;
69
65
  destroy(): void;
70
- setChecked(checked: boolean): void;
66
+ setChecked: (checked: boolean) => void;
71
67
  /** `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 & {
68
+ handleChange: (checked: boolean, e: RadioSourceEvent) => void;
69
+ handleClick: (e: RadioSourceEvent) => void;
70
+ handleKeyUp: (e: RadioSourceEvent & {
75
71
  key: string;
76
- }): void;
72
+ }) => void;
77
73
  }
78
74
  export {};
@@ -7,21 +7,20 @@ 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
  }
21
21
  static getInitialState(props) {
22
22
  return { checked: typeof props.checked === "boolean" ? props.checked : Boolean(props.defaultChecked) };
23
23
  }
24
- /** How the radio looks and behaves, from its own props or, inside a group, from the group */
25
24
  static deriveView(props, state, context) {
26
25
  const group = context?.radioGroup;
27
26
  if (group) return {
@@ -54,11 +53,11 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
54
53
  destroy() {
55
54
  RadioFoundation.#standalone.delete(this);
56
55
  }
57
- setChecked(checked) {
58
- this._adapter.setChecked(checked);
59
- }
56
+ setChecked = (checked) => {
57
+ this.adapter.setChecked(checked);
58
+ };
60
59
  /** `checked` is the value the native input reports, or false for the uncheck of advanced mode */
61
- handleChange(checked, e) {
60
+ handleChange = (checked, e) => {
62
61
  const props = this.getProps();
63
62
  const group = this.getContexts()?.radioGroup;
64
63
  const event = {
@@ -72,23 +71,23 @@ var RadioFoundation = class RadioFoundation extends BaseFoundation {
72
71
  stopPropagation: () => e.stopPropagation(),
73
72
  preventDefault: () => e.preventDefault()
74
73
  };
75
- this._adapter.notifyGroupChange(event);
76
- if (!this._isControlledComponent("checked")) {
74
+ this.adapter.notifyGroupChange(event);
75
+ if (!this.isControlledComponent("checked")) {
77
76
  if (checked) this.#uncheckPeers();
78
77
  this.setChecked(checked);
79
78
  }
80
- this._adapter.notifyChange(event);
81
- }
82
- handleClick(e) {
79
+ this.adapter.notifyChange(event);
80
+ };
81
+ handleClick = (e) => {
83
82
  const { checked, mode } = this.#getView();
84
83
  if (mode === "advanced" && checked) this.handleChange(false, e);
85
- }
86
- handleKeyUp(e) {
84
+ };
85
+ handleKeyUp = (e) => {
87
86
  const { checked, mode } = this.#getView();
88
87
  if (e.key === " " && mode === "advanced" && checked) {
89
88
  e.preventDefault();
90
89
  this.handleChange(false, e);
91
90
  }
92
- }
91
+ };
93
92
  };
94
93
  export { RadioFoundation as default };
@@ -4,7 +4,6 @@ export interface RadioGroupAdapter<P extends RadioGroupBaseProps = RadioGroupBas
4
4
  notifyChange: (e: RadioChangeEvent) => void;
5
5
  setValue: (value: any) => void;
6
6
  }
7
- /** The props the foundation reads with getProp */
8
7
  export interface RadioGroupBaseProps {
9
8
  mode?: string;
10
9
  value?: unknown;
@@ -13,6 +12,6 @@ export interface RadioGroupBaseState {
13
12
  value?: any;
14
13
  }
15
14
  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;
15
+ handleChange: (evt: RadioChangeEvent) => void;
16
+ handlePropValueChange: (propValue: string | number | boolean) => void;
18
17
  }
@@ -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 };
@@ -42,10 +42,8 @@ export interface RatingState {
42
42
  value: number;
43
43
  hoverValue: number;
44
44
  clearedValue: number;
45
- /** index of the star that holds keyboard focus */
46
45
  focusVisibleStar?: number;
47
46
  }
48
- /** The props the foundation reads with getProps */
49
47
  export interface RatingBaseProps extends RatingValueProps {
50
48
  count?: number;
51
49
  allowHalf?: boolean;
@@ -75,7 +73,6 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
75
73
  disabled: boolean;
76
74
  firstTabStop: boolean;
77
75
  }): RatingItemModel;
78
- /** Whether a focus on `value` belongs to the first (half) radio of the star at `index` */
79
76
  static isFirstRadio(value: number, index: number, allowHalf: boolean): boolean;
80
77
  /**
81
78
  * The value a click selects through the radio it hit, or undefined when it is an ordinary pointer click. Detail 0 is
@@ -83,7 +80,6 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
83
80
  * activated radio decides the value
84
81
  */
85
82
  static resolveClickRadio(detail: number, radioValue?: number): number | undefined;
86
- /** What Enter or Space on a radio does: whether to `preventDefault` the key, and the value to select if any */
87
83
  static resolveKeyActivation(key: string, radioValue: number | undefined, value: number): {
88
84
  preventDefault: boolean;
89
85
  selectValue?: number;
@@ -92,18 +88,17 @@ export default class RatingFoundation<P extends RatingBaseProps = RatingBaseProp
92
88
  static isTipVisible(index: number, hoverValue?: number, focusVisibleStar?: number, tip?: string): boolean;
93
89
  init(): void;
94
90
  /** 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;
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;
91
+ resetValue: () => void;
92
+ handleHover: (event: Pick<MouseEvent, "pageX">, index: number) => void;
93
+ handleMouseLeave: () => void;
94
+ handleClick: (event: CE & Pick<MouseEvent, "pageX">, index: number) => void;
95
+ handleSelect: (event: CE, index: number, newValue: number) => void;
96
+ handleFocus: (e: FE) => void;
102
97
  /** A radio of the star at `index` got focus; index === count is the empty star */
103
- handleStarFocus(e: {
98
+ handleStarFocus: (e: {
104
99
  target: Element;
105
- }, index: number): void;
106
- handleBlur(e: FE): void;
107
- handleKeyDown(event: KE, value: number): void;
100
+ }, index: number) => void;
101
+ handleBlur: (e: FE) => void;
102
+ handleKeyDown: (event: KE, value: number) => void;
108
103
  }
109
104
  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;
@@ -64,7 +64,6 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
64
64
  secondPosInSet: allowHalf ? isEmpty ? 2 * count + 1 : 2 * (index + 1) : index + 1
65
65
  };
66
66
  }
67
- /** Whether a focus on `value` belongs to the first (half) radio of the star at `index` */
68
67
  static isFirstRadio(value, index, allowHalf) {
69
68
  return allowHalf && value - index === .5;
70
69
  }
@@ -76,7 +75,6 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
76
75
  static resolveClickRadio(detail, radioValue) {
77
76
  return detail === 0 ? radioValue : void 0;
78
77
  }
79
- /** What Enter or Space on a radio does: whether to `preventDefault` the key, and the value to select if any */
80
78
  static resolveKeyActivation(key, radioValue, value) {
81
79
  const isSpace = key === " ";
82
80
  if (key !== "Enter" && !isSpace || radioValue === void 0) return { preventDefault: false };
@@ -93,51 +91,50 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
93
91
  if (this.#initialized) return;
94
92
  this.#initialized = true;
95
93
  const { autoFocus, disabled } = this.getProps();
96
- if (autoFocus && !disabled) this._adapter.focusStar(RatingFoundation.deriveValue(this.getProps(), this.getStates()));
94
+ if (autoFocus && !disabled) this.adapter.focusStar(RatingFoundation.deriveValue(this.getProps(), this.getStates()));
97
95
  }
98
96
  /** 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) {
97
+ resetValue = () => {
98
+ this.adapter.setValue(this.getProps().defaultValue);
99
+ };
100
+ handleHover = (event, index) => {
103
101
  const currValue = this.getStarValue(index, event.pageX);
104
102
  const { clearedValue, hoverValue } = this.getStates();
105
103
  if (currValue !== hoverValue && currValue !== clearedValue) this.#changeHover(currValue, null);
106
- }
107
- handleMouseLeave() {
104
+ };
105
+ handleMouseLeave = () => {
108
106
  this.#changeHover(void 0, null);
109
- }
110
- handleClick(event, index) {
107
+ };
108
+ handleClick = (event, index) => {
111
109
  this.handleSelect(event, index, this.getStarValue(index, event.pageX));
112
- }
113
- /** Commits `newValue` for the star at `index`; selecting the current value clears it when allowClear is on */
114
- handleSelect(event, index, newValue) {
110
+ };
111
+ handleSelect = (event, index, newValue) => {
115
112
  const { allowClear } = this.getProps();
116
113
  const value = RatingFoundation.deriveValue(this.getProps(), this.getStates());
117
114
  const isReset = allowClear ? newValue === value : false;
118
115
  this.#updateValue(isReset ? 0 : newValue);
119
116
  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
- }
117
+ else this.adapter.setClearedValue(null);
118
+ this.adapter.notifyClick(event, index);
119
+ };
120
+ handleFocus = (e) => {
121
+ if (!e.currentTarget.contains(e.relatedTarget)) this.adapter.notifyFocus(e);
122
+ };
126
123
  /** 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) {
124
+ handleStarFocus = (e, index) => {
125
+ if (e.target.matches(":focus-visible") || this.getStates().focusVisibleStar !== void 0) this.adapter.setFocusVisibleStar(index);
126
+ };
127
+ handleBlur = (e) => {
131
128
  if (!e.currentTarget.contains(e.relatedTarget)) {
132
- this._adapter.notifyBlur(e);
133
- this._adapter.setFocusVisibleStar(void 0);
129
+ this.adapter.notifyBlur(e);
130
+ this.adapter.setFocusVisibleStar(void 0);
134
131
  }
135
- }
136
- handleKeyDown(event, value) {
132
+ };
133
+ handleKeyDown = (event, value) => {
137
134
  if (event.altKey || event.ctrlKey || event.metaKey) return;
138
135
  const { key } = event;
139
136
  const { count, allowHalf } = this.getProps();
140
- const reverse = this._adapter.getContext("direction") === "rtl";
137
+ const reverse = this.adapter.getContext("direction") === "rtl";
141
138
  const step = allowHalf ? .5 : 1;
142
139
  const next = (Math.floor(value / step) + 1) * step;
143
140
  const previous = (Math.ceil(value / step) - 1) * step;
@@ -156,12 +153,12 @@ var RatingFoundation = class RatingFoundation extends BaseFoundation {
156
153
  "ArrowLeft",
157
154
  "ArrowDown"
158
155
  ].includes(key)) {
159
- this._adapter.notifyKeyDown(event);
156
+ this.adapter.notifyKeyDown(event);
160
157
  this.#updateValue(newValue);
161
- this._adapter.focusStar(newValue);
158
+ this.adapter.focusStar(newValue);
162
159
  event.preventDefault();
163
160
  this.#changeHover(void 0, null);
164
161
  }
165
- }
162
+ };
166
163
  };
167
164
  export { RatingFoundation as default };
@@ -19,7 +19,6 @@ export interface ResizeGroupAdapter<P extends ResizeGroupBaseProps = ResizeGroup
19
19
  getItemEnd: (index: number) => ResizeCallback | undefined;
20
20
  getItemDefaultSize: (index: number) => string | number | undefined;
21
21
  }
22
- /** The props the foundation reads with getProp */
23
22
  export interface ResizeGroupBaseProps {
24
23
  direction?: 'horizontal' | 'vertical';
25
24
  }
@@ -37,19 +36,16 @@ export declare class ResizeGroupFoundation<P extends ResizeGroupBaseProps = Resi
37
36
  /**
38
37
  * Re-runs initSpace the first time the group is measurable (#3336); later resizes must not, or the drag is lost.
39
38
  */
40
- handleGroupResize(): void;
41
- /**
42
- * Moves each item's inline size to the new axis, where the handlers take a different length
43
- */
44
- handleDirectionChange(): void;
39
+ handleGroupResize: () => void;
40
+ handleDirectionChange: () => void;
45
41
  /**
46
42
  * Keyboard resize, reported like a drag: arrows move 1% of the group (Shift: 10%), Home and End go to the
47
43
  * limits. Returns whether the key was handled.
48
44
  */
49
- resizeByKey(handlerIndex: number, e: KeyboardEvent): boolean;
50
- onResizeStart(handlerIndex: number, e: PointerEvent): void;
51
- onResizing(e: PointerEvent): void;
52
- onResizeEnd(e: PointerEvent): void;
45
+ resizeByKey: (handlerIndex: number, e: KeyboardEvent) => boolean;
46
+ onResizeStart: (handlerIndex: number, e: PointerEvent) => void;
47
+ onResizing: (e: PointerEvent) => void;
48
+ onResizeEnd: (e: PointerEvent) => void;
53
49
  ensureConstraint: import("es-toolkit").DebouncedFunction<() => void>;
54
50
  destroy(): void;
55
51
  }
@@ -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,
@@ -185,11 +185,10 @@ var ResizeGroupFoundation = class extends BaseFoundation {
185
185
  nextItemSize: (this.#direction === "horizontal" ? nextItem.offsetWidth : nextItem.offsetHeight) + this.#itemMinusMap.get(handlerIndex + 1)
186
186
  };
187
187
  }
188
- /** Returns false when either item's onResizeStart returned false */
189
188
  #notifyResizeStart(handlerIndex, e) {
190
189
  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);
190
+ const lastResult = this.adapter.getItemStart(handlerIndex)?.(e, lastDir);
191
+ const nextResult = this.adapter.getItemStart(handlerIndex + 1)?.(e, nextDir);
193
192
  return lastResult !== false && nextResult !== false;
194
193
  }
195
194
  init() {
@@ -200,27 +199,24 @@ var ResizeGroupFoundation = class extends BaseFoundation {
200
199
  /**
201
200
  * Re-runs initSpace the first time the group is measurable (#3336); later resizes must not, or the drag is lost.
202
201
  */
203
- handleGroupResize() {
202
+ handleGroupResize = () => {
204
203
  if (!this.#sizeInitialized && this.#groupSize > 0) this.#initSpace();
205
- }
206
- /**
207
- * Moves each item's inline size to the new axis, where the handlers take a different length
208
- */
209
- handleDirectionChange() {
204
+ };
205
+ handleDirectionChange = () => {
210
206
  const [stale, current] = this.#direction === "horizontal" ? ["height", "width"] : ["width", "height"];
211
207
  this.#measureHandlerRoom();
212
- for (let i = 0; i < this._adapter.getItemCount(); i++) {
213
- const item = this._adapter.getItem(i);
208
+ for (let i = 0; i < this.adapter.getItemCount(); i++) {
209
+ const item = this.adapter.getItem(i);
214
210
  item.style.removeProperty(stale);
215
211
  item.style[current] = `calc(${this.#itemPercentMap.get(i)}% - ${this.#itemMinusMap.get(i)}px)`;
216
212
  }
217
213
  this.#syncAria();
218
- }
214
+ };
219
215
  /**
220
216
  * Keyboard resize, reported like a drag: arrows move 1% of the group (Shift: 10%), Home and End go to the
221
217
  * limits. Returns whether the key was handled.
222
218
  */
223
- resizeByKey(handlerIndex, e) {
219
+ resizeByKey = (handlerIndex, e) => {
224
220
  if (e.altKey || e.ctrlKey || e.metaKey) return false;
225
221
  const [backKey, forwardKey] = this.#direction === "horizontal" ? ["ArrowLeft", "ArrowRight"] : ["ArrowUp", "ArrowDown"];
226
222
  const groupSize = this.#groupSize;
@@ -237,8 +233,8 @@ var ResizeGroupFoundation = class extends BaseFoundation {
237
233
  this.#notifyResizeEnd(handlerIndex, e);
238
234
  }
239
235
  return true;
240
- }
241
- onResizeStart(handlerIndex, e) {
236
+ };
237
+ onResizeStart = (handlerIndex, e) => {
242
238
  if (isSecondaryPress(e) || !this.#notifyResizeStart(handlerIndex, e)) return;
243
239
  const states = this.getStates();
244
240
  this.setState({
@@ -250,15 +246,15 @@ var ResizeGroupFoundation = class extends BaseFoundation {
250
246
  },
251
247
  curHandler: handlerIndex
252
248
  });
253
- }
254
- onResizing(e) {
249
+ };
250
+ onResizing = (e) => {
255
251
  const state = this.getStates();
256
252
  if (!state.isResizing) return;
257
253
  const { curHandler, originalPosition } = state;
258
254
  const delta = this.#direction === "horizontal" ? e.clientX - originalPosition.x : e.clientY - originalPosition.y;
259
255
  this.#applyDelta(curHandler, originalPosition, delta, e);
260
- }
261
- onResizeEnd(e) {
256
+ };
257
+ onResizeEnd = (e) => {
262
258
  const { isResizing, curHandler } = this.getStates();
263
259
  if (!isResizing) return;
264
260
  this.#notifyResizeEnd(curHandler, e);
@@ -266,19 +262,19 @@ var ResizeGroupFoundation = class extends BaseFoundation {
266
262
  isResizing: false,
267
263
  curHandler: null
268
264
  });
269
- }
265
+ };
270
266
  ensureConstraint = debounce(() => {
271
267
  if (!this.#groupSize) return;
272
268
  const direction = this.#direction;
273
- const itemCount = this._adapter.getItemCount();
269
+ const itemCount = this.adapter.getItemCount();
274
270
  let continueFlag = true;
275
271
  for (let i = 0; i < itemCount; i++) {
276
- const child = this._adapter.getItem(i);
272
+ const child = this.adapter.getItem(i);
277
273
  const childSize = direction === "horizontal" ? child.offsetWidth : child.offsetHeight;
278
274
  const childNewSize = this.#clampItem(i, childSize);
279
275
  if (childNewSize !== childSize) {
280
276
  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);
277
+ const item = this.adapter.getItem(index);
282
278
  const itemSize = direction === "horizontal" ? item.offsetWidth : item.offsetHeight;
283
279
  return this.#clampItem(index, itemSize) === itemSize;
284
280
  });
@@ -286,7 +282,7 @@ var ResizeGroupFoundation = class extends BaseFoundation {
286
282
  continueFlag = false;
287
283
  console.warn("[Semi ResizableGroup]: no enough space to adjust min/max size");
288
284
  } else {
289
- const item = this._adapter.getItem(j);
285
+ const item = this.adapter.getItem(j);
290
286
  const childPercent = this.#itemPercentMap.get(i);
291
287
  const itemPercent = this.#itemPercentMap.get(j);
292
288
  const childNewPercent = (childNewSize + this.#itemMinusMap.get(i)) / this.#groupSize * 100;
@@ -111,7 +111,6 @@ $module: #{$prefix}-resizable;
111
111
  &-handler {
112
112
  @include flex-center;
113
113
  z-index: $z-resizable_handler;
114
- // a touch drag would otherwise scroll the page and cancel the pointer
115
114
  touch-action: none;
116
115
  user-select: none;
117
116
  background-color: var(--semi-color-fill-0);
@@ -1,6 +1,5 @@
1
1
  import BaseFoundation, { DefaultAdapter } from "../../base/foundation.js";
2
2
  import { Direction, ResizeCallback, ResizeStartCallback, Size } from "../types.js";
3
- /** The props the foundation reads */
4
3
  export interface ResizableBaseProps extends SizeProps {
5
4
  grid?: [number, number];
6
5
  snap?: {
@@ -73,16 +72,13 @@ export declare class ResizableFoundation<P extends ResizableBaseProps = Resizabl
73
72
  height: string;
74
73
  };
75
74
  init(): void;
76
- /**
77
- * Reads the size and limits for aria-valuenow, -valuemin and -valuemax. A change of the limits alone goes
78
- * unnoticed until the next resize.
79
- */
80
- updateAriaRange(): void;
75
+ /** A change of the limits alone goes unnoticed until the next resize. */
76
+ updateAriaRange: () => void;
81
77
  /**
82
78
  * Keyboard resize along the axis of the edge, KEYBOARD_STEP px per press, reported like a drag.
83
79
  * Returns whether the key was handled.
84
80
  */
85
- resizeByKey(direction: Direction, e: KeyboardEvent): boolean;
81
+ resizeByKey: (direction: Direction, e: KeyboardEvent) => boolean;
86
82
  onResizeStart: (e: PointerEvent, direction: Direction) => void;
87
83
  onResizing: (event: PointerEvent) => void;
88
84
  onResizeEnd: (event: PointerEvent) => void;