@oscarpalmer/oui 0.41.0 → 0.43.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 (179) hide show
  1. package/dist/css/grid.css +38 -0
  2. package/dist/js/color-picker/color-picker.constants.d.mts +1 -1
  3. package/dist/js/color-picker/color-picker.constants.mjs +1 -2
  4. package/dist/js/color-picker/color-picker.dom.d.mts +2 -4
  5. package/dist/js/color-picker/color-picker.dom.mjs +1 -2
  6. package/dist/js/color-picker/color-picker.event.d.mts +2 -4
  7. package/dist/js/color-picker/color-picker.event.mjs +8 -9
  8. package/dist/js/color-picker/color-picker.form.d.mts +2 -4
  9. package/dist/js/color-picker/color-picker.form.mjs +2 -3
  10. package/dist/js/color-picker/color-picker.misc.d.mts +1 -1
  11. package/dist/js/color-picker/color-picker.misc.mjs +1 -2
  12. package/dist/js/color-picker/color-picker.model.d.mts +1 -1
  13. package/dist/js/color-picker/color-picker.model.mjs +1 -2
  14. package/dist/js/color-picker/color-picker.output.d.mts +2 -4
  15. package/dist/js/color-picker/color-picker.output.mjs +4 -5
  16. package/dist/js/color-picker/color-picker.state.d.mts +2 -4
  17. package/dist/js/color-picker/color-picker.state.mjs +4 -5
  18. package/dist/js/color-picker/index.d.mts +5 -7
  19. package/dist/js/color-picker/index.mjs +3 -4
  20. package/dist/js/{color-picker.constants-BZgXQr5o.d.mts → color-picker.constants-DdttC4ab.d.mts} +3 -8
  21. package/dist/js/{color-picker.misc-BIS3R6jk.d.mts → color-picker.misc-BH_tFyWR.d.mts} +1 -3
  22. package/dist/js/combobox/combobox.constants.d.mts +2 -2
  23. package/dist/js/combobox/combobox.constants.mjs +3 -3
  24. package/dist/js/combobox/combobox.dom.d.mts +3 -4
  25. package/dist/js/combobox/combobox.dom.mjs +3 -3
  26. package/dist/js/combobox/combobox.event.d.mts +3 -5
  27. package/dist/js/combobox/combobox.event.mjs +1 -2
  28. package/dist/js/combobox/combobox.misc.d.mts +1 -1
  29. package/dist/js/combobox/combobox.misc.mjs +1 -2
  30. package/dist/js/combobox/combobox.model.d.mts +1 -1
  31. package/dist/js/combobox/combobox.state.d.mts +3 -5
  32. package/dist/js/combobox/combobox.state.mjs +1 -2
  33. package/dist/js/combobox/index.d.mts +7 -9
  34. package/dist/js/combobox/index.mjs +3 -4
  35. package/dist/js/{combobox.constants-Hb3bqqQJ.d.mts → combobox.constants-CDnBNJC0.d.mts} +3 -4
  36. package/dist/js/{combobox.misc-DRDFk6X8.d.mts → combobox.misc-Csh9lm9_.d.mts} +1 -3
  37. package/dist/js/{combobox.model-gjEI2VqZ.d.mts → combobox.model-BRGQDuRl.d.mts} +2 -4
  38. package/dist/js/{combobox.state-AstCICiH.mjs → combobox.state-Bjt0dwe3.mjs} +29 -29
  39. package/dist/js/dialog/dialog.model.d.mts +1 -1
  40. package/dist/js/dialog/dialog.model.mjs +1 -2
  41. package/dist/js/dialog/index.d.mts +1 -3
  42. package/dist/js/dialog/index.mjs +2 -3
  43. package/dist/js/{dialog.model-HVzYWoDo.d.mts → dialog.model-cYq7rTKL.d.mts} +2 -4
  44. package/dist/js/floatable/floatable.embedded.d.mts +1 -1
  45. package/dist/js/floatable/floatable.embedded.mjs +1 -2
  46. package/dist/js/floatable/floatable.model.d.mts +1 -1
  47. package/dist/js/floatable/floatable.model.mjs +1 -2
  48. package/dist/js/floatable/floatable.standalone.d.mts +2 -2
  49. package/dist/js/floatable/floatable.standalone.mjs +1 -2
  50. package/dist/js/{floatable.embedded-ncshL3Sa.d.mts → floatable.embedded-Cr1KX6GZ.d.mts} +1 -3
  51. package/dist/js/{floatable.model-DXsQgoU7.d.mts → floatable.model-jS5Ui5Av.d.mts} +0 -2
  52. package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
  53. package/dist/js/focus-trap/focus-trap.embedded.mjs +4 -5
  54. package/dist/js/focus-trap/focus-trap.model.d.mts +2 -2
  55. package/dist/js/focus-trap/focus-trap.model.mjs +3 -3
  56. package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -2
  57. package/dist/js/focus-trap/focus-trap.standalone.mjs +1 -2
  58. package/dist/js/{focus-trap.embedded-DpcPkP7c.d.mts → focus-trap.embedded-BVXcd4OO.d.mts} +1 -3
  59. package/dist/js/{focus-trap.model-CpltX5B5.d.mts → focus-trap.model-wg0iAZ7x.d.mts} +2 -3
  60. package/dist/js/grid/grid.dom.d.mts +7 -0
  61. package/dist/js/grid/grid.dom.mjs +171 -0
  62. package/dist/js/grid/grid.event.d.mts +7 -0
  63. package/dist/js/grid/grid.event.mjs +1 -0
  64. package/dist/js/grid/grid.misc.d.mts +6 -0
  65. package/dist/js/grid/grid.misc.mjs +1 -0
  66. package/dist/js/grid/grid.model.d.mts +2 -0
  67. package/dist/js/grid/grid.model.mjs +39 -0
  68. package/dist/js/grid/index.d.mts +22 -0
  69. package/dist/js/grid/index.mjs +48 -0
  70. package/dist/js/grid.event-K_pG2vmS.mjs +192 -0
  71. package/dist/js/grid.model-SiNst5db.d.mts +90 -0
  72. package/dist/js/index.d.mts +22 -21
  73. package/dist/js/index.mjs +5 -3
  74. package/dist/js/internal/attributable.d.mts +1 -3
  75. package/dist/js/internal/attributable.mjs +3 -3
  76. package/dist/js/internal/draggable/draggable.model.d.mts +2 -2
  77. package/dist/js/internal/draggable/draggable.model.mjs +3 -3
  78. package/dist/js/internal/draggable/index.d.mts +2 -4
  79. package/dist/js/internal/draggable/index.mjs +18 -14
  80. package/dist/js/internal/l10n/index.d.mts +2 -4
  81. package/dist/js/internal/l10n/index.mjs +30 -22
  82. package/dist/js/internal/l10n/l10n.model.d.mts +1 -1
  83. package/dist/js/internal/l10n/l10n.model.mjs +1 -2
  84. package/dist/js/internal/misc.d.mts +2 -3
  85. package/dist/js/internal/misc.mjs +5 -3
  86. package/dist/js/internal/navigable/index.d.mts +2 -4
  87. package/dist/js/internal/navigable/index.mjs +1 -2
  88. package/dist/js/internal/navigable/navigable.model.d.mts +1 -1
  89. package/dist/js/internal/navigable/navigable.model.mjs +1 -2
  90. package/dist/js/internal/option-list/option-list.constants.d.mts +3 -5
  91. package/dist/js/internal/option-list/option-list.constants.mjs +3 -4
  92. package/dist/js/internal/option-list/option-list.data.d.mts +3 -4
  93. package/dist/js/internal/option-list/option-list.data.mjs +1 -2
  94. package/dist/js/internal/option-list/option-list.dom.d.mts +3 -5
  95. package/dist/js/internal/option-list/option-list.dom.mjs +1 -2
  96. package/dist/js/internal/option-list/option-list.event.d.mts +3 -5
  97. package/dist/js/internal/option-list/option-list.event.mjs +4 -5
  98. package/dist/js/internal/option-list/option-list.form.d.mts +3 -5
  99. package/dist/js/internal/option-list/option-list.form.mjs +2 -3
  100. package/dist/js/internal/option-list/option-list.misc.d.mts +3 -5
  101. package/dist/js/internal/option-list/option-list.misc.mjs +1 -2
  102. package/dist/js/internal/option-list/option-list.model.d.mts +2 -2
  103. package/dist/js/internal/option-list/option-list.model.mjs +7 -1
  104. package/dist/js/internal/option-list/option-list.state.d.mts +3 -5
  105. package/dist/js/internal/option-list/option-list.state.mjs +2 -3
  106. package/dist/js/l10n/index.d.mts +1 -1
  107. package/dist/js/l10n/index.mjs +1 -2
  108. package/dist/js/{l10n.model-D1E1u35L.d.mts → l10n.model-DxwLXnFl.d.mts} +0 -2
  109. package/dist/js/listbox/index.d.mts +6 -8
  110. package/dist/js/listbox/index.mjs +3 -4
  111. package/dist/js/listbox/listbox.constants.d.mts +1 -1
  112. package/dist/js/listbox/listbox.constants.mjs +1 -2
  113. package/dist/js/listbox/listbox.dom.d.mts +2 -4
  114. package/dist/js/listbox/listbox.dom.mjs +1 -2
  115. package/dist/js/listbox/listbox.event.d.mts +3 -5
  116. package/dist/js/listbox/listbox.event.mjs +1 -2
  117. package/dist/js/listbox/listbox.misc.d.mts +1 -1
  118. package/dist/js/listbox/listbox.misc.mjs +1 -2
  119. package/dist/js/listbox/listbox.model.d.mts +1 -1
  120. package/dist/js/listbox/listbox.state.d.mts +3 -5
  121. package/dist/js/listbox/listbox.state.mjs +1 -2
  122. package/dist/js/{listbox.constants-DOBMwKup.d.mts → listbox.constants-1yMPRl2C.d.mts} +1 -3
  123. package/dist/js/{listbox.misc-DwfB4Mu_.d.mts → listbox.misc-CkW28nUS.d.mts} +1 -3
  124. package/dist/js/{listbox.model-C0MYWXZe.d.mts → listbox.model-CUA_DaR9.d.mts} +1 -3
  125. package/dist/js/{listbox.state-BrN296BM.mjs → listbox.state-DO58GDqc.mjs} +8 -12
  126. package/dist/js/menu/index.mjs +5 -6
  127. package/dist/js/menu/menu.model.d.mts +3 -5
  128. package/dist/js/menu/menu.model.mjs +1 -2
  129. package/dist/js/movable/movable.embedded.d.mts +1 -1
  130. package/dist/js/movable/movable.embedded.mjs +3 -4
  131. package/dist/js/movable/movable.model.d.mts +2 -2
  132. package/dist/js/movable/movable.model.mjs +3 -3
  133. package/dist/js/movable/movable.standalone.d.mts +2 -2
  134. package/dist/js/movable/movable.standalone.mjs +1 -2
  135. package/dist/js/{movable.embedded-C1bDTLGs.d.mts → movable.embedded-HjPPob-Z.d.mts} +1 -3
  136. package/dist/js/{movable.model-D9nnPWKk.d.mts → movable.model-CQ3AbTrq.d.mts} +13 -7
  137. package/dist/js/{navigable.model-BqoR6iBv.d.mts → navigable.model-CrzJqKE7.d.mts} +0 -2
  138. package/dist/js/{option-list.data-CgMyUwPc.mjs → option-list.data-Be6wopy9.mjs} +7 -10
  139. package/dist/js/{option-list.model-CCPUlPeX.d.mts → option-list.model-DNZq-X0d.d.mts} +7 -4
  140. package/dist/js/popover/index.d.mts +1 -3
  141. package/dist/js/popover/index.mjs +3 -4
  142. package/dist/js/popover/popover.model.d.mts +1 -1
  143. package/dist/js/popover/popover.model.mjs +1 -2
  144. package/dist/js/{popover.model-DiLdz0Hc.d.mts → popover.model-CrrIdSmS.d.mts} +2 -4
  145. package/dist/js/resizable/resizable.embedded.d.mts +2 -2
  146. package/dist/js/resizable/resizable.embedded.mjs +122 -38
  147. package/dist/js/resizable/resizable.model.d.mts +2 -2
  148. package/dist/js/resizable/resizable.model.mjs +11 -3
  149. package/dist/js/resizable/resizable.standalone.d.mts +3 -3
  150. package/dist/js/resizable/resizable.standalone.mjs +2 -1
  151. package/dist/js/{resizable.embedded-BemH-7Re.d.mts → resizable.embedded-DQclAEP-.d.mts} +3 -4
  152. package/dist/js/resizable.model-BOufXDXx.d.mts +67 -0
  153. package/dist/js/sortable/sortable.embedded.d.mts +1 -1
  154. package/dist/js/sortable/sortable.embedded.mjs +5 -6
  155. package/dist/js/sortable/sortable.model.d.mts +2 -2
  156. package/dist/js/sortable/sortable.model.mjs +4 -3
  157. package/dist/js/sortable/sortable.standalone.d.mts +2 -2
  158. package/dist/js/sortable/sortable.standalone.mjs +1 -2
  159. package/dist/js/{sortable.embedded-CrEGff9k.d.mts → sortable.embedded-B5LPz-c_.d.mts} +1 -3
  160. package/dist/js/splitter/index.d.mts +2 -4
  161. package/dist/js/splitter/index.mjs +5 -5
  162. package/dist/js/splitter/splitter.model.d.mts +1 -1
  163. package/dist/js/splitter/splitter.model.mjs +1 -2
  164. package/dist/js/{splitter.model-C24W6eZ7.d.mts → splitter.model-DQDbIe4P.d.mts} +0 -2
  165. package/dist/js/tabs/index.d.mts +2 -4
  166. package/dist/js/tabs/index.mjs +10 -11
  167. package/dist/js/tabs/tabs.model.d.mts +1 -1
  168. package/dist/js/tabs/tabs.model.mjs +1 -2
  169. package/dist/js/{tabs.model-BHPy7fPo.d.mts → tabs.model-CvylbR2o.d.mts} +1 -3
  170. package/dist/js/toolbar/index.mjs +1 -2
  171. package/dist/js/toolbar/toolbar.model.d.mts +2 -4
  172. package/dist/js/toolbar/toolbar.model.mjs +1 -2
  173. package/dist/js/tooltip/index.d.mts +1 -3
  174. package/dist/js/tooltip/index.mjs +2 -3
  175. package/dist/js/tooltip/tooltip.model.d.mts +1 -1
  176. package/dist/js/tooltip/tooltip.model.mjs +1 -2
  177. package/dist/js/{tooltip.model-BpNStw5z.d.mts → tooltip.model-BI3UK-VU.d.mts} +1 -3
  178. package/package.json +11 -8
  179. package/dist/js/resizable.model-YEtcC9li.d.mts +0 -46
package/dist/js/index.mjs CHANGED
@@ -6,6 +6,7 @@ import { createFocusTrap } from "./focus-trap/focus-trap.embedded.mjs";
6
6
  import "./focus-trap/focus-trap.standalone.mjs";
7
7
  import { createMovable } from "./movable/movable.embedded.mjs";
8
8
  import "./movable/movable.standalone.mjs";
9
+ import { OuiResizableEvent } from "./resizable/resizable.model.mjs";
9
10
  import { createResizable } from "./resizable/resizable.embedded.mjs";
10
11
  import "./resizable/resizable.standalone.mjs";
11
12
  import { createSortable } from "./sortable/sortable.embedded.mjs";
@@ -13,14 +14,15 @@ import "./sortable/sortable.standalone.mjs";
13
14
  import { OuiColorPickerEvent } from "./color-picker/color-picker.model.mjs";
14
15
  import { setColorPickerLocalizations } from "./color-picker/color-picker.misc.mjs";
15
16
  import { OuiColorPickerElement } from "./color-picker/index.mjs";
16
- import { D as setComboboxLocalizations } from "./combobox.state-AstCICiH.mjs";
17
+ import { D as setComboboxLocalizations } from "./combobox.state-Bjt0dwe3.mjs";
17
18
  import { OuiComboboxElement } from "./combobox/index.mjs";
18
19
  import { getDialog } from "./dialog/index.mjs";
19
- import { s as setListboxLocalizations } from "./listbox.state-BrN296BM.mjs";
20
+ import { OuiGridElement } from "./grid/index.mjs";
21
+ import { s as setListboxLocalizations } from "./listbox.state-DO58GDqc.mjs";
20
22
  import { OuiListboxElement } from "./listbox/index.mjs";
21
23
  import { getPopover } from "./popover/index.mjs";
22
24
  import { OuiSplitterElement } from "./splitter/index.mjs";
23
25
  import { OuiTabsEvent } from "./tabs/tabs.model.mjs";
24
26
  import { OuiTabsElement } from "./tabs/index.mjs";
25
27
  import { getTooltip, setTooltipDelay } from "./tooltip/index.mjs";
26
- export { OuiColorPickerElement, OuiColorPickerEvent, OuiComboboxElement, OuiListboxElement, OuiSplitterElement, OuiTabsElement, OuiTabsEvent, createFloatable, createFocusTrap, createMovable, createResizable as createOuiResizable, createSortable, getDialog, getPopover, getTooltip, setColorPickerLocalizations, setComboboxLocalizations, setListboxLocalizations, setTooltipDelay };
28
+ export { OuiColorPickerElement, OuiColorPickerEvent, OuiComboboxElement, OuiGridElement, OuiListboxElement, OuiResizableEvent, OuiSplitterElement, OuiTabsElement, OuiTabsEvent, createFloatable, createFocusTrap, createMovable, createResizable as createOuiResizable, createSortable, getDialog, getPopover, getTooltip, setColorPickerLocalizations, setComboboxLocalizations, setListboxLocalizations, setTooltipDelay };
@@ -1,3 +1 @@
1
- //#region src/js/internal/attributable.d.ts
2
- export declare function attributable(attribute: string, add: (element: Element) => void, remove: (element: Element) => void): void;
3
- //#endregion
1
+ export declare function attributable(attribute: string, add: (element: Element) => void, remove: (element: Element) => void): void;
@@ -1,5 +1,5 @@
1
1
  import { filter } from "@oscarpalmer/atoms/array/filter";
2
- //#region src/js/internal/attributable.ts
2
+ // src/js/internal/attributable.ts
3
3
  function attributable(attribute, add, remove) {
4
4
  new MutationObserver((entries) => {
5
5
  const { length } = entries;
@@ -7,7 +7,7 @@ function attributable(attribute, add, remove) {
7
7
  const entry = entries[index];
8
8
  if (entry.type === "attributes" && entry.target instanceof Element) {
9
9
  if (entry.target.hasAttribute(attribute)) handleAdded(attribute, [entry.target], add);
10
- else handleRemoved([entry.target], remove);
10
+ else remove(entry.target);
11
11
  } else if (entry.type === "childList") {
12
12
  handleAdded(attribute, entry.addedNodes, add);
13
13
  handleRemoved(entry.removedNodes, remove);
@@ -37,9 +37,9 @@ function handleRemoved(nodes, remove) {
37
37
  const { length } = elements;
38
38
  for (let index = 0; index < length; index += 1) {
39
39
  const element = elements[index];
40
+ if (element.isConnected) continue;
40
41
  remove(element);
41
42
  if (element.hasChildNodes()) handleRemoved(element.childNodes, remove);
42
43
  }
43
44
  }
44
- //#endregion
45
45
  export { attributable };
@@ -1,2 +1,2 @@
1
- import { A as OuiDraggableGlobals, B as OuiDraggableOptionsDrag, C as OuiDragCancel, D as OuiDraggable, E as OuiDragMovePosition, F as OuiDraggableOptionsContainer, G as OuiDraggableStates, H as OuiDraggableOptionsPositionGetOffset, I as OuiDraggableOptionsContainerOnDestroy, J as draggableHorizontals, K as draggableContainers, L as OuiDraggableOptionsContainerOnInitialize, M as OuiDraggableInstances, N as OuiDraggableItem, O as OuiDraggableBound, P as OuiDraggableOptions, Q as draggableVerticals, R as OuiDraggableOptionsDirection, S as OuiDragBegin, T as OuiDragMove, U as OuiDraggableOptionsPositionGetOriginal, V as OuiDraggableOptionsPosition, W as OuiDraggableState, X as draggableStyleToggler, Y as draggableProperties, Z as draggableStyles, _ as DRAGGABLE_SELECTOR, b as DRAGGABLE_SELECTOR_SORTABLE_ITEM, g as DRAGGABLE_KEY_ESCAPE, h as DRAGGABLE_ATTRIBUTE_SORTABLE, j as OuiDraggableGlobalsElement, k as OuiDraggableDirection, m as DRAGGABLE_ATTRIBUTE_MOVABLE, p as CreateOuiDraggableOptions, q as draggableGlobals, v as DRAGGABLE_SELECTOR_MOVABLE_HANDLE, w as OuiDragEnd, x as DRAGGABLE_SYMBOL, y as DRAGGABLE_SELECTOR_SORTABLE_HANDLE, z as OuiDraggableOptionsDirectionOnAfter } from "../../movable.model-D9nnPWKk.mjs";
2
- export { CreateOuiDraggableOptions, DRAGGABLE_ATTRIBUTE_MOVABLE, DRAGGABLE_ATTRIBUTE_SORTABLE, DRAGGABLE_KEY_ESCAPE, DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, OuiDragBegin, OuiDragCancel, OuiDragEnd, OuiDragMove, OuiDragMovePosition, OuiDraggable, OuiDraggableBound, OuiDraggableDirection, OuiDraggableGlobals, OuiDraggableGlobalsElement, OuiDraggableInstances, OuiDraggableItem, OuiDraggableOptions, OuiDraggableOptionsContainer, OuiDraggableOptionsContainerOnDestroy, OuiDraggableOptionsContainerOnInitialize, OuiDraggableOptionsDirection, OuiDraggableOptionsDirectionOnAfter, OuiDraggableOptionsDrag, OuiDraggableOptionsPosition, OuiDraggableOptionsPositionGetOffset, OuiDraggableOptionsPositionGetOriginal, OuiDraggableState, OuiDraggableStates, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals };
1
+ import { $ as draggableStyleToggler, A as OuiDraggableDirection, B as OuiDraggableOptionsContainerOnInitialize, C as OuiDragBegin, D as OuiDragMovePosition, E as OuiDragMove, F as OuiDraggableInstances, G as OuiDraggableOptionsPositionGetOffset, H as OuiDraggableOptionsDirectionOnAfter, I as OuiDraggableItem, J as OuiDraggableStates, K as OuiDraggableOptionsPositionGetOriginal, L as OuiDraggableOptions, M as OuiDraggableEventDetail, N as OuiDraggableGlobals, O as OuiDraggable, P as OuiDraggableGlobalsElement, Q as draggableProperties, R as OuiDraggableOptionsContainer, S as DRAGGABLE_SYMBOL, T as OuiDragEnd, U as OuiDraggableOptionsDrag, V as OuiDraggableOptionsDirection, W as OuiDraggableOptionsPosition, X as draggableGlobals, Y as draggableContainers, Z as draggableHorizontals, _ as DRAGGABLE_KEY_ESCAPE, b as DRAGGABLE_SELECTOR_SORTABLE_HANDLE, et as draggableStyles, g as DRAGGABLE_ATTRIBUTE_SORTABLE, h as DRAGGABLE_ATTRIBUTE_MOVABLE, j as OuiDraggableEvent, k as OuiDraggableBound, m as CreateOuiDraggableOptions, q as OuiDraggableState, tt as draggableVerticals, v as DRAGGABLE_SELECTOR, w as OuiDragCancel, x as DRAGGABLE_SELECTOR_SORTABLE_ITEM, y as DRAGGABLE_SELECTOR_MOVABLE_HANDLE, z as OuiDraggableOptionsContainerOnDestroy } from "../../movable.model-CQ3AbTrq.mjs";
2
+ export { CreateOuiDraggableOptions, DRAGGABLE_ATTRIBUTE_MOVABLE, DRAGGABLE_ATTRIBUTE_SORTABLE, DRAGGABLE_KEY_ESCAPE, DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, OuiDragBegin, OuiDragCancel, OuiDragEnd, OuiDragMove, OuiDragMovePosition, OuiDraggable, OuiDraggableBound, OuiDraggableDirection, OuiDraggableEvent, OuiDraggableEventDetail, OuiDraggableGlobals, OuiDraggableGlobalsElement, OuiDraggableInstances, OuiDraggableItem, OuiDraggableOptions, OuiDraggableOptionsContainer, OuiDraggableOptionsContainerOnDestroy, OuiDraggableOptionsContainerOnInitialize, OuiDraggableOptionsDirection, OuiDraggableOptionsDirectionOnAfter, OuiDraggableOptionsDrag, OuiDraggableOptionsPosition, OuiDraggableOptionsPositionGetOffset, OuiDraggableOptionsPositionGetOriginal, OuiDraggableState, OuiDraggableStates, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals };
@@ -1,5 +1,6 @@
1
1
  import { toggleStyles } from "@oscarpalmer/toretto/style";
2
- //#region src/js/internal/draggable/draggable.model.ts
2
+ // src/js/internal/draggable/draggable.model.ts
3
+ var OuiDraggableEvent = class extends CustomEvent {};
3
4
  const DRAGGABLE_ATTRIBUTE_MOVABLE = "oui-movable";
4
5
  const DRAGGABLE_ATTRIBUTE_SORTABLE = "oui-sortable";
5
6
  const DRAGGABLE_KEY_ESCAPE = "Escape";
@@ -33,5 +34,4 @@ const draggableStyles = {
33
34
  };
34
35
  const draggableStyleToggler = toggleStyles(document.body, draggableStyles);
35
36
  const draggableVerticals = /* @__PURE__ */ new Set(["vertical", "y"]);
36
- //#endregion
37
- export { DRAGGABLE_ATTRIBUTE_MOVABLE, DRAGGABLE_ATTRIBUTE_SORTABLE, DRAGGABLE_KEY_ESCAPE, DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals };
37
+ export { DRAGGABLE_ATTRIBUTE_MOVABLE, DRAGGABLE_ATTRIBUTE_SORTABLE, DRAGGABLE_KEY_ESCAPE, DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, OuiDraggableEvent, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals };
@@ -1,6 +1,5 @@
1
- import { D as OuiDraggable, G as OuiDraggableStates, M as OuiDraggableInstances, O as OuiDraggableBound, P as OuiDraggableOptions, W as OuiDraggableState, p as CreateOuiDraggableOptions } from "../../movable.model-D9nnPWKk.mjs";
1
+ import { F as OuiDraggableInstances, J as OuiDraggableStates, L as OuiDraggableOptions, O as OuiDraggable, k as OuiDraggableBound, m as CreateOuiDraggableOptions, q as OuiDraggableState } from "../../movable.model-CQ3AbTrq.mjs";
2
2
  import { PlainObject } from "@oscarpalmer/atoms/models";
3
- //#region src/js/internal/draggable/index.d.ts
4
3
  export declare function addDraggable<Property extends keyof OuiDraggableInstances, Instance extends OuiDraggableInstances[Property]>(this: OuiDraggableBound<Property, Instance>, element: Element, options?: CreateOuiDraggableOptions): Instance;
5
4
  export declare function destroyDraggable<ExtraState extends PlainObject>(draggable: OuiDraggable<ExtraState>): void;
6
5
  export declare function getDraggableStates(element: Element): OuiDraggableStates | undefined;
@@ -9,5 +8,4 @@ export declare function initializeDraggable<ExtraState extends PlainObject>(drag
9
8
  export declare function removeDraggable<Property extends keyof OuiDraggableInstances, Instance extends OuiDraggableInstances[Property]>(this: {
10
9
  constructor: new (element: Element) => Instance;
11
10
  property: Property;
12
- }, element: Element): void;
13
- //#endregion
11
+ }, element: Element): void;
@@ -1,5 +1,6 @@
1
- import { DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals } from "./draggable.model.mjs";
2
1
  import { MOVABLE_ATTRIBUTE } from "../../movable/movable.model.mjs";
2
+ import { ignoreEvent } from "../misc.mjs";
3
+ import { DRAGGABLE_SELECTOR, DRAGGABLE_SELECTOR_MOVABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_HANDLE, DRAGGABLE_SELECTOR_SORTABLE_ITEM, DRAGGABLE_SYMBOL, OuiDraggableEvent, draggableContainers, draggableGlobals, draggableHorizontals, draggableProperties, draggableStyleToggler, draggableStyles, draggableVerticals } from "./draggable.model.mjs";
3
4
  import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
4
5
  import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
5
6
  import { findAncestor } from "@oscarpalmer/toretto/find";
@@ -7,7 +8,7 @@ import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
7
8
  import { setStyle, setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
8
9
  import { clamp } from "@oscarpalmer/atoms/number";
9
10
  import { supportsTouch } from "@oscarpalmer/toretto/touch";
10
- //#region src/js/internal/draggable/index.ts
11
+ // src/js/internal/draggable/index.ts
11
12
  function addDraggable(element, options) {
12
13
  let instances = draggableGlobals.instances.get(element);
13
14
  if (instances == null) {
@@ -20,7 +21,7 @@ function addDraggable(element, options) {
20
21
  function cancelDrag(item) {
21
22
  if (item == null) return;
22
23
  item.state.options.drag.onCancel?.(item);
23
- dispatch(item.state.element, `oui:${item.state.name}:cancel`, { detail: { element: item.state.options.getOrigin() } });
24
+ dispatch(item.state.element, new OuiDraggableEvent(`oui-${item.state.name}:cancel`, { detail: { element: item.state.options.getOrigin() } }));
24
25
  reset();
25
26
  }
26
27
  function destroyDraggable(draggable) {
@@ -96,7 +97,7 @@ function onKeydown(event) {
96
97
  if (current != null && event.key === "Escape") cancelDrag(current);
97
98
  }
98
99
  function onPointerdown(event) {
99
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || (supportsTouch.value ? event.type === "mousedown" : event.type === "touchstart" || event.button !== 0)) return;
100
+ if (ignoreEvent(event, supportsTouch.value)) return;
100
101
  const container = findAncestor(event, DRAGGABLE_SELECTOR);
101
102
  if (container == null) return;
102
103
  const instances = draggableGlobals.instances.get(container);
@@ -112,7 +113,7 @@ function onPointerdown(event) {
112
113
  let element = container;
113
114
  if (!isMovable) {
114
115
  element = findAncestor(event, DRAGGABLE_SELECTOR_SORTABLE_ITEM);
115
- if (element == null || element.parentElement !== container) return;
116
+ if (element?.parentElement !== container) return;
116
117
  }
117
118
  let handle = element;
118
119
  item.state.hasHandles ??= element.querySelector(DRAGGABLE_SELECTOR_SORTABLE_HANDLE) != null;
@@ -132,10 +133,11 @@ function onPointerdown(event) {
132
133
  };
133
134
  draggableGlobals.offset = item.state.options.position.getOffset(item, element, position);
134
135
  draggableGlobals.original = item.state.options.position.getOriginal(item, position);
135
- if (dispatch(item.state.element, `oui:${item.state.name}:begin`, { detail: {
136
+ const dispatched = new OuiDraggableEvent(`oui-${item.state.name}:begin`, { detail: {
136
137
  element,
137
- position: { ...draggableGlobals.original }
138
- } }).defaultPrevented) {
138
+ position: { original: { ...draggableGlobals.original } }
139
+ } });
140
+ if (dispatch(item.state.element, dispatched).defaultPrevented) {
139
141
  item.state.options.drag.onCancel?.(item);
140
142
  reset();
141
143
  return;
@@ -156,11 +158,14 @@ function onPointermove(event) {
156
158
  if (position == null) return;
157
159
  const next = getNextPosition(current, position);
158
160
  if (draggableGlobals.element != null) setStyle(draggableGlobals.element.node, "inset", `${next.y}px auto auto ${next.x}px`);
159
- const detail = current.state.options.drag.onMove(event, current, {
160
- calculated: next,
161
- original: position
162
- });
163
- if (dispatch(current.state.element, `oui:${current.state.name}:move`, { detail }).defaultPrevented) cancelDrag(current);
161
+ const dispatched = new OuiDraggableEvent(`oui-${current.state.name}:move`, { detail: {
162
+ element: current.state.options.getOrigin(),
163
+ position: {
164
+ next,
165
+ original: position
166
+ }
167
+ } });
168
+ if (dispatch(current.state.element, dispatched).defaultPrevented) cancelDrag(current);
164
169
  }
165
170
  function onPointerup(event) {
166
171
  current?.state.options.drag.onEnd?.(event, current, reset);
@@ -239,5 +244,4 @@ on(document, "pointermove", onPointermove);
239
244
  on(document, "pointerup", onPointerup);
240
245
  on(document, "touchcancel", onPointerup);
241
246
  on(document, "touchstart", onPointerdown, { passive: false });
242
- //#endregion
243
247
  export { addDraggable, destroyDraggable, getDraggableElement, getDraggableStates, initializeDraggable, removeDraggable };
@@ -1,5 +1,3 @@
1
- import { _ as OuiLocalizationsValues, p as OuiLocalizations, u as OuiDefaultLocalizations } from "../../l10n.model-D1E1u35L.mjs";
2
- //#region src/js/internal/l10n/index.d.ts
1
+ import { _ as OuiLocalizationsValues, p as OuiLocalizations, u as OuiDefaultLocalizations } from "../../l10n.model-DxwLXnFl.mjs";
3
2
  export declare function createDefaultLocalizations<Localizations extends OuiLocalizationsValues>(values: Localizations): OuiDefaultLocalizations<Localizations>;
4
- export declare function createLocalizations<Localizations extends OuiLocalizationsValues>(defaults: OuiDefaultLocalizations<Localizations>): OuiLocalizations<Localizations>;
5
- //#endregion
3
+ export declare function createLocalizations<Localizations extends OuiLocalizationsValues>(defaults: OuiDefaultLocalizations<Localizations>): OuiLocalizations<Localizations>;
@@ -1,6 +1,8 @@
1
1
  import { L10N_MESSAGE_DEFAULT, L10N_MESSAGE_ITEM_CREATE, L10N_MESSAGE_ITEM_UPDATE_KEY, L10N_MESSAGE_ITEM_UPDATE_VALUE, L10N_MESSAGE_OBJECT_CREATE, L10N_MESSAGE_OBJECT_UPDATE, L10N_SYMBOL, L10N_TYPE_DEFAULT, L10N_TYPE_INSTANCE } from "./l10n.model.mjs";
2
2
  import { isPlainObject } from "@oscarpalmer/atoms/is";
3
- //#region src/js/internal/l10n/index.ts
3
+ import { promises } from "@oscarpalmer/atoms/promise";
4
+ import { isFulfilled } from "@oscarpalmer/atoms/promise/misc";
5
+ // src/js/internal/l10n/index.ts
4
6
  function OuiDefaultLocalizations(values) {
5
7
  this[L10N_SYMBOL] = {
6
8
  defaults: values,
@@ -57,7 +59,9 @@ function getLocalization(key, parameters, defaultLocalizations, instanceLocaliza
57
59
  const defaultState = defaultLocalizations?.[L10N_SYMBOL];
58
60
  const instanceState = instanceLocalizations?.[L10N_SYMBOL];
59
61
  const language = getLanguage(parameters);
60
- const values = defaultState == null ? instanceState == null ? [] : [instanceState.values, instanceState.defaults.values.languages] : [defaultState.values];
62
+ let values;
63
+ if (defaultState == null) values = instanceState == null ? [] : [instanceState.values, instanceState.defaults.values.languages];
64
+ else values = [defaultState.values];
61
65
  const { length } = values;
62
66
  let localization;
63
67
  let shortLanguage;
@@ -104,18 +108,18 @@ function setLocalizations(first, second) {
104
108
  }
105
109
  async function updateLocalizationValues(state, to, from) {
106
110
  const keys = Object.keys(from);
107
- const keysLength = keys.length;
111
+ const { length } = keys;
108
112
  const toAsPlainObject = to;
109
113
  let count = 0;
110
- for (let keysIndex = 0; keysIndex < keysLength; keysIndex += 1) {
111
- const key = keys[keysIndex];
112
- const keyValue = from[key];
113
- const normalizedKey = key.toLowerCase();
114
- if (!state.keys.has(normalizedKey)) throw new TypeError(L10N_MESSAGE_ITEM_UPDATE_KEY);
115
- if (!isValidLocalization(keyValue)) throw new TypeError(L10N_MESSAGE_ITEM_UPDATE_VALUE);
116
- if (state.keys.has(normalizedKey) && isValidLocalization(keyValue)) {
114
+ for (let index = 0; index < length; index += 1) {
115
+ const key = keys[index];
116
+ const value = from[key];
117
+ const lowercased = key.toLowerCase();
118
+ if (!state.keys.has(lowercased)) throw new TypeError(L10N_MESSAGE_ITEM_UPDATE_KEY);
119
+ if (!isValidLocalization(value)) throw new TypeError(L10N_MESSAGE_ITEM_UPDATE_VALUE);
120
+ if (state.keys.has(lowercased) && isValidLocalization(value)) {
117
121
  count += 1;
118
- toAsPlainObject[normalizedKey] = keyValue;
122
+ toAsPlainObject[lowercased] = value;
119
123
  }
120
124
  }
121
125
  return count;
@@ -124,17 +128,22 @@ async function updateLocalizations(localizations, values) {
124
128
  if (typeof values !== "object" || values == null) throw new TypeError(L10N_MESSAGE_OBJECT_UPDATE);
125
129
  const state = localizations[L10N_SYMBOL];
126
130
  const languages = Object.keys(values);
127
- const languagesLength = languages.length;
128
- let count = 0;
129
- for (let languagesIndex = 0; languagesIndex < languagesLength; languagesIndex += 1) {
130
- const language = languages[languagesIndex];
131
- const languageValue = values[language];
132
- if (typeof languageValue !== "object" || languageValue == null) throw new TypeError(L10N_MESSAGE_OBJECT_UPDATE);
133
- const normalizedLanguage = language.toLowerCase();
134
- state.values[normalizedLanguage] ??= {};
135
- count += await updateLocalizationValues(state, state.values[normalizedLanguage], languageValue);
131
+ const { length } = languages;
132
+ const updates = [];
133
+ for (let index = 0; index < length; index += 1) {
134
+ const language = languages[index];
135
+ const value = values[language];
136
+ if (typeof value !== "object" || value == null) throw new TypeError(L10N_MESSAGE_OBJECT_UPDATE);
137
+ const lowercased = language.toLowerCase();
138
+ state.values[lowercased] ??= {};
139
+ updates.push(updateLocalizationValues(state, state.values[lowercased], value));
136
140
  }
137
- return count > 0;
141
+ return promises(updates).then((results) => {
142
+ let count = 0;
143
+ const { length } = results;
144
+ for (let index = 0; index < length; index += 1) count += isFulfilled(results[index]) ? results[index].value : 0;
145
+ return count > 0;
146
+ });
138
147
  }
139
148
  function validateDefaultInstance(value) {
140
149
  if (typeof value !== "object" || value === null || !(L10N_SYMBOL in value)) throw new TypeError(L10N_MESSAGE_DEFAULT);
@@ -143,5 +152,4 @@ function validateDefaultValues(value) {
143
152
  if (!isPlainObject(value) || Object.keys(value).length === 0) throw new TypeError(L10N_MESSAGE_OBJECT_CREATE);
144
153
  if (!Object.values(value).every(isValidLocalization)) throw new TypeError(L10N_MESSAGE_ITEM_CREATE);
145
154
  }
146
- //#endregion
147
155
  export { createDefaultLocalizations, createLocalizations };
@@ -1,2 +1,2 @@
1
- import { _ as OuiLocalizationsValues, a as L10N_MESSAGE_OBJECT_CREATE, c as L10N_TYPE_DEFAULT, d as OuiDefaultLocalizationsState, f as OuiDefaultLocalizationsValues, g as OuiLocalizationsType, h as OuiLocalizationsState, i as L10N_MESSAGE_ITEM_UPDATE_VALUE, l as L10N_TYPE_INSTANCE, m as OuiLocalizationsParameters, n as L10N_MESSAGE_ITEM_CREATE, o as L10N_MESSAGE_OBJECT_UPDATE, p as OuiLocalizations, r as L10N_MESSAGE_ITEM_UPDATE_KEY, s as L10N_SYMBOL, t as L10N_MESSAGE_DEFAULT, u as OuiDefaultLocalizations } from "../../l10n.model-D1E1u35L.mjs";
1
+ import { _ as OuiLocalizationsValues, a as L10N_MESSAGE_OBJECT_CREATE, c as L10N_TYPE_DEFAULT, d as OuiDefaultLocalizationsState, f as OuiDefaultLocalizationsValues, g as OuiLocalizationsType, h as OuiLocalizationsState, i as L10N_MESSAGE_ITEM_UPDATE_VALUE, l as L10N_TYPE_INSTANCE, m as OuiLocalizationsParameters, n as L10N_MESSAGE_ITEM_CREATE, o as L10N_MESSAGE_OBJECT_UPDATE, p as OuiLocalizations, r as L10N_MESSAGE_ITEM_UPDATE_KEY, s as L10N_SYMBOL, t as L10N_MESSAGE_DEFAULT, u as OuiDefaultLocalizations } from "../../l10n.model-DxwLXnFl.mjs";
2
2
  export { L10N_MESSAGE_DEFAULT, L10N_MESSAGE_ITEM_CREATE, L10N_MESSAGE_ITEM_UPDATE_KEY, L10N_MESSAGE_ITEM_UPDATE_VALUE, L10N_MESSAGE_OBJECT_CREATE, L10N_MESSAGE_OBJECT_UPDATE, L10N_SYMBOL, L10N_TYPE_DEFAULT, L10N_TYPE_INSTANCE, OuiDefaultLocalizations, OuiDefaultLocalizationsState, OuiDefaultLocalizationsValues, OuiLocalizations, OuiLocalizationsParameters, OuiLocalizationsState, OuiLocalizationsType, OuiLocalizationsValues };
@@ -1,4 +1,4 @@
1
- //#region src/js/internal/l10n/l10n.model.ts
1
+ // src/js/internal/l10n/l10n.model.ts
2
2
  const L10N_MESSAGE_DEFAULT = "Default localizations must be an instance of OuiDefaultLocalizations.";
3
3
  const L10N_MESSAGE_ITEM_CREATE = "Localization item must be a string or a function.";
4
4
  const L10N_MESSAGE_ITEM_UPDATE_KEY = "Localization item key must be known.";
@@ -8,5 +8,4 @@ const L10N_MESSAGE_OBJECT_UPDATE = "Localizations update object must be a plain
8
8
  const L10N_TYPE_DEFAULT = "default";
9
9
  const L10N_TYPE_INSTANCE = "instance";
10
10
  const L10N_SYMBOL = Symbol("l10n");
11
- //#endregion
12
11
  export { L10N_MESSAGE_DEFAULT, L10N_MESSAGE_ITEM_CREATE, L10N_MESSAGE_ITEM_UPDATE_KEY, L10N_MESSAGE_ITEM_UPDATE_VALUE, L10N_MESSAGE_OBJECT_CREATE, L10N_MESSAGE_OBJECT_UPDATE, L10N_SYMBOL, L10N_TYPE_DEFAULT, L10N_TYPE_INSTANCE };
@@ -1,7 +1,6 @@
1
1
  import { AnyAriaBooleanAttribute } from "@oscarpalmer/toretto/models";
2
- //#region src/js/internal/misc.d.ts
3
2
  export declare function copyValue(value: string, onSuccess?: () => void, onError?: () => void): void;
4
3
  export declare function getAttributeValue<Value>(element: Element, attribute: string, possible: Set<Value>, defaultValue: Value): Value;
5
4
  export declare function getBooleanAriaValue(element: Element, attribute: AnyAriaBooleanAttribute): boolean;
6
- export declare const EXPRESSION_WHITESPACE: RegExp;
7
- //#endregion
5
+ export declare function ignoreEvent(event: MouseEvent | TouchEvent, supportsTouch: boolean): boolean;
6
+ export declare const EXPRESSION_WHITESPACE: RegExp;
@@ -2,7 +2,7 @@ import { getAria } from "@oscarpalmer/toretto/aria";
2
2
  import { getAttribute } from "@oscarpalmer/toretto/attribute";
3
3
  import { noop } from "@oscarpalmer/atoms/function";
4
4
  import { attempt } from "@oscarpalmer/atoms/result";
5
- //#region src/js/internal/misc.ts
5
+ // src/js/internal/misc.ts
6
6
  function copyValue(value, onSuccess, onError) {
7
7
  if (!attempt(() => navigator.clipboard.writeText(value).then(onSuccess ?? noop, onError ?? noop)).ok) onError?.();
8
8
  }
@@ -14,6 +14,8 @@ function getBooleanAriaValue(element, attribute) {
14
14
  const value = getAria(element, attribute);
15
15
  return value === true || value === "true";
16
16
  }
17
+ function ignoreEvent(event, supportsTouch) {
18
+ return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || (supportsTouch ? event.type === "mousedown" : event.type === "touchstart" || event.button !== 0);
19
+ }
17
20
  const EXPRESSION_WHITESPACE = /\s+/;
18
- //#endregion
19
- export { EXPRESSION_WHITESPACE, copyValue, getAttributeValue, getBooleanAriaValue };
21
+ export { EXPRESSION_WHITESPACE, copyValue, getAttributeValue, getBooleanAriaValue, ignoreEvent };
@@ -1,6 +1,4 @@
1
- import { d as OuiNavigable, h as OuiNavigableOrientation, m as OuiNavigableOptions } from "../../navigable.model-BqoR6iBv.mjs";
2
- //#region src/js/internal/navigable/index.d.ts
1
+ import { d as OuiNavigable, h as OuiNavigableOrientation, m as OuiNavigableOptions } from "../../navigable.model-CrzJqKE7.mjs";
3
2
  export declare function getNavigable(element: Element, options: OuiNavigableOptions): OuiNavigable;
4
3
  export declare function getNavigableOrientation(element: Element, vertical: boolean, aria?: boolean): OuiNavigableOrientation;
5
- export declare function updateNavigableFocus(navigable: OuiNavigable, focus: boolean, items?: HTMLElement[]): void;
6
- //#endregion
4
+ export declare function updateNavigableFocus(navigable: OuiNavigable, focus: boolean, items?: HTMLElement[]): void;
@@ -6,7 +6,7 @@ import { findAncestor } from "@oscarpalmer/toretto/find";
6
6
  import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
7
7
  import { filter } from "@oscarpalmer/atoms/array/filter";
8
8
  import { clamp } from "@oscarpalmer/atoms/number";
9
- //#region src/js/internal/navigable/index.ts
9
+ // src/js/internal/navigable/index.ts
10
10
  function OuiNavigable(element, options) {
11
11
  this[NAVIGABLE_SYMBOL] = {
12
12
  element,
@@ -121,5 +121,4 @@ function updateNavigableFocus(navigable, focus, items) {
121
121
  active.element ??= updated[active.index];
122
122
  if (focus) active.element?.focus();
123
123
  }
124
- //#endregion
125
124
  export { getNavigable, getNavigableOrientation, updateNavigableFocus };
@@ -1,2 +1,2 @@
1
- import { a as NAVIGABLE_KEYS_NEXT, c as NAVIGABLE_ORIENTATION_HORIZONTAL, d as OuiNavigable, f as OuiNavigableActive, g as OuiNavigableState, h as OuiNavigableOrientation, i as NAVIGABLE_KEYS_HORIZONTAL, l as NAVIGABLE_ORIENTATION_VERTICAL, m as OuiNavigableOptions, n as NAVIGABLE_KEYS_ACTIVATE, o as NAVIGABLE_KEYS_VERTICAL, p as OuiNavigableCallback, r as NAVIGABLE_KEYS_ALL, s as NAVIGABLE_ORIENTATIONS, t as NAVIGABLE_KEYS_ABSOLUTE, u as NAVIGABLE_SYMBOL } from "../../navigable.model-BqoR6iBv.mjs";
1
+ import { a as NAVIGABLE_KEYS_NEXT, c as NAVIGABLE_ORIENTATION_HORIZONTAL, d as OuiNavigable, f as OuiNavigableActive, g as OuiNavigableState, h as OuiNavigableOrientation, i as NAVIGABLE_KEYS_HORIZONTAL, l as NAVIGABLE_ORIENTATION_VERTICAL, m as OuiNavigableOptions, n as NAVIGABLE_KEYS_ACTIVATE, o as NAVIGABLE_KEYS_VERTICAL, p as OuiNavigableCallback, r as NAVIGABLE_KEYS_ALL, s as NAVIGABLE_ORIENTATIONS, t as NAVIGABLE_KEYS_ABSOLUTE, u as NAVIGABLE_SYMBOL } from "../../navigable.model-CrzJqKE7.mjs";
2
2
  export { NAVIGABLE_KEYS_ABSOLUTE, NAVIGABLE_KEYS_ACTIVATE, NAVIGABLE_KEYS_ALL, NAVIGABLE_KEYS_HORIZONTAL, NAVIGABLE_KEYS_NEXT, NAVIGABLE_KEYS_VERTICAL, NAVIGABLE_ORIENTATIONS, NAVIGABLE_ORIENTATION_HORIZONTAL, NAVIGABLE_ORIENTATION_VERTICAL, NAVIGABLE_SYMBOL, OuiNavigable, OuiNavigableActive, OuiNavigableCallback, OuiNavigableOptions, OuiNavigableOrientation, OuiNavigableState };
@@ -1,4 +1,4 @@
1
- //#region src/js/internal/navigable/navigable.model.ts
1
+ // src/js/internal/navigable/navigable.model.ts
2
2
  const NAVIGABLE_KEYS_ABSOLUTE = /* @__PURE__ */ new Set(["End", "Home"]);
3
3
  const NAVIGABLE_KEYS_ACTIVATE = /* @__PURE__ */ new Set(["Enter", " "]);
4
4
  const NAVIGABLE_KEYS_HORIZONTAL = /* @__PURE__ */ new Set(["ArrowRight", "ArrowLeft"]);
@@ -14,5 +14,4 @@ const NAVIGABLE_ORIENTATION_HORIZONTAL = "horizontal";
14
14
  const NAVIGABLE_ORIENTATION_VERTICAL = "vertical";
15
15
  const NAVIGABLE_ORIENTATIONS = /* @__PURE__ */ new Set([NAVIGABLE_ORIENTATION_HORIZONTAL, NAVIGABLE_ORIENTATION_VERTICAL]);
16
16
  const NAVIGABLE_SYMBOL = Symbol("oui-navigable");
17
- //#endregion
18
17
  export { NAVIGABLE_KEYS_ABSOLUTE, NAVIGABLE_KEYS_ACTIVATE, NAVIGABLE_KEYS_ALL, NAVIGABLE_KEYS_HORIZONTAL, NAVIGABLE_KEYS_NEXT, NAVIGABLE_KEYS_VERTICAL, NAVIGABLE_ORIENTATIONS, NAVIGABLE_ORIENTATION_HORIZONTAL, NAVIGABLE_ORIENTATION_VERTICAL, NAVIGABLE_SYMBOL };
@@ -1,8 +1,6 @@
1
- import { _ as OptionListType } from "../../option-list.model-CCPUlPeX.mjs";
2
- //#region src/js/internal/option-list/option-list.constants.d.ts
1
+ import { S as OptionListType } from "../../option-list.model-DNZq-X0d.mjs";
3
2
  export declare const OPTION_LIST_KEYS_ACTIVATION: Set<string>;
4
- export declare const LISTBOX_KEYS_NAVIGATION: Set<string>;
3
+ export declare const OPTION_LIST_KEYS_NAVIGATION: Set<string>;
5
4
  export declare const OPTION_LIST_KEYS_SELECTION: Set<string>;
6
5
  export declare const OPTION_LIST_TYPES: Set<OptionListType>;
7
- export declare const optionListScrollOptions: ScrollIntoViewOptions;
8
- //#endregion
6
+ export declare const optionListScrollOptions: ScrollIntoViewOptions;
@@ -1,11 +1,11 @@
1
- //#region src/js/internal/option-list/option-list.constants.ts
1
+ // src/js/internal/option-list/option-list.constants.ts
2
2
  const OPTION_LIST_KEYS_ACTIVATION = /* @__PURE__ */ new Set([
3
3
  " ",
4
4
  "Backspace",
5
5
  "Delete",
6
6
  "Enter"
7
7
  ]);
8
- const LISTBOX_KEYS_NAVIGATION = /* @__PURE__ */ new Set([
8
+ const OPTION_LIST_KEYS_NAVIGATION = /* @__PURE__ */ new Set([
9
9
  "ArrowDown",
10
10
  "ArrowUp",
11
11
  "PageDown",
@@ -18,5 +18,4 @@ const optionListScrollOptions = {
18
18
  block: "nearest",
19
19
  inline: "nearest"
20
20
  };
21
- //#endregion
22
- export { LISTBOX_KEYS_NAVIGATION, OPTION_LIST_KEYS_ACTIVATION, OPTION_LIST_KEYS_SELECTION, OPTION_LIST_TYPES, optionListScrollOptions };
21
+ export { OPTION_LIST_KEYS_ACTIVATION, OPTION_LIST_KEYS_NAVIGATION, OPTION_LIST_KEYS_SELECTION, OPTION_LIST_TYPES, optionListScrollOptions };
@@ -1,7 +1,6 @@
1
- import { _ as OuiLocalizationsValues } from "../../l10n.model-D1E1u35L.mjs";
2
- import { g as OptionListState } from "../../option-list.model-CCPUlPeX.mjs";
1
+ import { _ as OuiLocalizationsValues } from "../../l10n.model-DxwLXnFl.mjs";
2
+ import { x as OptionListState } from "../../option-list.model-DNZq-X0d.mjs";
3
3
  import { PlainObject } from "@oscarpalmer/atoms/models";
4
- //#region src/js/internal/option-list/option-list.data.d.ts
5
4
  type ApplySelectionParameters<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
6
5
  added: boolean;
7
6
  emit?: boolean;
@@ -18,4 +17,4 @@ export declare function filterOptionListOptions<State extends PlainObject, Local
18
17
  export declare function setOptionListValue<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: unknown, emit?: boolean): void;
19
18
  export declare function setOptionListValues<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: unknown[], emit?: boolean): void;
20
19
  export declare function toggleOptionListOption<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, option?: HTMLElement): void;
21
- //#endregion
20
+ export {};
@@ -1,2 +1 @@
1
- import { a as setOptionListValue, i as filterOptionListOptions, n as filterOptionList, o as setOptionListValues, r as filterOptionListOption, s as toggleOptionListOption, t as applyOptionListSelection } from "../../option-list.data-CgMyUwPc.mjs";
2
- export { applyOptionListSelection, filterOptionList, filterOptionListOption, filterOptionListOptions, setOptionListValue, setOptionListValues, toggleOptionListOption };
1
+ export { t as applyOptionListSelection, n as filterOptionList, r as filterOptionListOption, i as filterOptionListOptions, a as setOptionListValue, o as setOptionListValues, s as toggleOptionListOption } from "../../option-list.data-Be6wopy9.mjs";
@@ -1,7 +1,6 @@
1
- import { _ as OuiLocalizationsValues } from "../../l10n.model-D1E1u35L.mjs";
2
- import { a as CreateOptionListList, f as OptionListGroup, g as OptionListState, h as OptionListPreview, i as CreateOptionListGroupParameters, n as CreateOptionListContentParameters, o as CreateOptionListOptionParameters, r as CreateOptionListFilter, s as CreateOptionListOptionsParameters, t as CreateOptionListContent } from "../../option-list.model-CCPUlPeX.mjs";
1
+ import { _ as OuiLocalizationsValues } from "../../l10n.model-DxwLXnFl.mjs";
2
+ import { _ as OptionListGroup, a as CreateOptionListList, b as OptionListPreview, i as CreateOptionListGroupParameters, n as CreateOptionListContentParameters, o as CreateOptionListOptionParameters, r as CreateOptionListFilter, s as CreateOptionListOptionsParameters, t as CreateOptionListContent, x as OptionListState } from "../../option-list.model-DNZq-X0d.mjs";
3
3
  import { PlainObject } from "@oscarpalmer/atoms/models";
4
- //#region src/js/internal/option-list/option-list.dom.d.ts
5
4
  export declare function createOptionListContent(parameters: CreateOptionListContentParameters): CreateOptionListContent;
6
5
  export declare function createOptionListFilter(parameters: CreateOptionListContentParameters): CreateOptionListFilter | undefined;
7
6
  export declare function createOptionListGroup(parameters: CreateOptionListGroupParameters): OptionListGroup;
@@ -14,5 +13,4 @@ export declare function createOptionListOptions(parameters: CreateOptionListOpti
14
13
  export declare function createOptionListValueLabel(id: string): HTMLSpanElement;
15
14
  export declare function updateOptionListMessage<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): void;
16
15
  export declare function updateOptionListPreview<State extends PlainObject, Localizations extends OuiLocalizationsValues>(preview: OptionListPreview, state: OptionListState<State, Localizations>, active?: HTMLElement, scroll?: boolean): void;
17
- export declare function updateOptionListValueLabel<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): void;
18
- //#endregion
16
+ export declare function updateOptionListValueLabel<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): void;
@@ -1,2 +1 @@
1
- import { _ as createOptionListValueLabel, b as updateOptionListValueLabel, c as createOptionListContent, d as createOptionListHeader, f as createOptionListInput, g as createOptionListOptions, h as createOptionListOption, l as createOptionListFilter, m as createOptionListMessage, p as createOptionListList, u as createOptionListGroup, v as updateOptionListMessage, y as updateOptionListPreview } from "../../option-list.data-CgMyUwPc.mjs";
2
- export { createOptionListContent, createOptionListFilter, createOptionListGroup, createOptionListHeader, createOptionListInput, createOptionListList, createOptionListMessage, createOptionListOption, createOptionListOptions, createOptionListValueLabel, updateOptionListMessage, updateOptionListPreview, updateOptionListValueLabel };
1
+ export { c as createOptionListContent, l as createOptionListFilter, u as createOptionListGroup, d as createOptionListHeader, f as createOptionListInput, p as createOptionListList, m as createOptionListMessage, h as createOptionListOption, g as createOptionListOptions, _ as createOptionListValueLabel, v as updateOptionListMessage, y as updateOptionListPreview, b as updateOptionListValueLabel } from "../../option-list.data-Be6wopy9.mjs";
@@ -1,6 +1,4 @@
1
- import { _ as OuiLocalizationsValues } from "../../l10n.model-D1E1u35L.mjs";
2
- import { g as OptionListState } from "../../option-list.model-CCPUlPeX.mjs";
1
+ import { _ as OuiLocalizationsValues } from "../../l10n.model-DxwLXnFl.mjs";
2
+ import { x as OptionListState } from "../../option-list.model-DNZq-X0d.mjs";
3
3
  import { PlainObject } from "@oscarpalmer/atoms/models";
4
- //#region src/js/internal/option-list/option-list.event.d.ts
5
- export declare function processOptionListKeydown<State extends PlainObject, Localizations extends OuiLocalizationsValues>(event: KeyboardEvent, state: OptionListState<State, Localizations>): void;
6
- //#endregion
4
+ export declare function processOptionListKeydown<State extends PlainObject, Localizations extends OuiLocalizationsValues>(event: KeyboardEvent, state: OptionListState<State, Localizations>): void;
@@ -1,7 +1,7 @@
1
- import { LISTBOX_KEYS_NAVIGATION, OPTION_LIST_KEYS_SELECTION } from "./option-list.constants.mjs";
2
- import { S as getOptionListVisibleOptions } from "../../option-list.data-CgMyUwPc.mjs";
1
+ import { OPTION_LIST_KEYS_NAVIGATION, OPTION_LIST_KEYS_SELECTION } from "./option-list.constants.mjs";
2
+ import { S as getOptionListVisibleOptions } from "../../option-list.data-Be6wopy9.mjs";
3
3
  import { clamp } from "@oscarpalmer/atoms/number";
4
- //#region src/js/internal/option-list/option-list.event.ts
4
+ // src/js/internal/option-list/option-list.event.ts
5
5
  function processOptionListKeydown(event, state) {
6
6
  const { component, form } = state;
7
7
  const { callbacks, disabled, readonly, type } = component;
@@ -25,7 +25,7 @@ function processOptionListKeydown(event, state) {
25
25
  case !isSelect && OPTION_LIST_KEYS_SELECTION.has(event.key):
26
26
  if (!ignore) callbacks.keydown.onSelection?.(state);
27
27
  break;
28
- case LISTBOX_KEYS_NAVIGATION.has(event.key):
28
+ case OPTION_LIST_KEYS_NAVIGATION.has(event.key):
29
29
  if (!disabled) onNavigation(event, state);
30
30
  break;
31
31
  default:
@@ -62,5 +62,4 @@ function onNavigation(event, state) {
62
62
  else preview = "none";
63
63
  callbacks.keydown.onNavigation(preview, state, next ?? active ?? visible[0]);
64
64
  }
65
- //#endregion
66
65
  export { processOptionListKeydown };
@@ -1,7 +1,5 @@
1
- import { _ as OuiLocalizationsValues } from "../../l10n.model-D1E1u35L.mjs";
2
- import { g as OptionListState } from "../../option-list.model-CCPUlPeX.mjs";
1
+ import { _ as OuiLocalizationsValues } from "../../l10n.model-DxwLXnFl.mjs";
2
+ import { x as OptionListState } from "../../option-list.model-DNZq-X0d.mjs";
3
3
  import { PlainObject } from "@oscarpalmer/atoms/models";
4
- //#region src/js/internal/option-list/option-list.form.d.ts
5
4
  export declare function updateOptionListForm<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, values: string[], emit?: boolean): void;
6
- export declare function updateOptionListValidity<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): void;
7
- //#endregion
5
+ export declare function updateOptionListValidity<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): void;
@@ -1,5 +1,5 @@
1
1
  import { dispatch } from "@oscarpalmer/toretto/event";
2
- //#region src/js/internal/option-list/option-list.form.ts
2
+ // src/js/internal/option-list/option-list.form.ts
3
3
  function updateOptionListForm(state, values, emit) {
4
4
  const { component, form } = state;
5
5
  const { callbacks, host, multiple, name } = component;
@@ -13,7 +13,7 @@ function updateOptionListForm(state, values, emit) {
13
13
  form.internals.setFormValue(value, JSON.stringify(values));
14
14
  callbacks.data.onForm(state);
15
15
  updateOptionListValidity(state);
16
- if (emit ?? true) dispatch(host, "oui:change");
16
+ if (emit ?? true) dispatch(host, "change");
17
17
  }
18
18
  function updateOptionListValidity(state) {
19
19
  const { component, form } = state;
@@ -49,5 +49,4 @@ function updateOptionListValidity(state) {
49
49
  form.internals.setValidity(error == null ? {} : { [error]: true }, message);
50
50
  form.internals.checkValidity();
51
51
  }
52
- //#endregion
53
52
  export { updateOptionListForm, updateOptionListValidity };
@@ -1,7 +1,6 @@
1
- import { _ as OuiLocalizationsValues } from "../../l10n.model-D1E1u35L.mjs";
2
- import { g as OptionListState } from "../../option-list.model-CCPUlPeX.mjs";
1
+ import { _ as OuiLocalizationsValues } from "../../l10n.model-DxwLXnFl.mjs";
2
+ import { x as OptionListState } from "../../option-list.model-DNZq-X0d.mjs";
3
3
  import { PlainObject } from "@oscarpalmer/atoms/models";
4
- //#region src/js/internal/option-list/option-list.misc.d.ts
5
4
  export declare function generateOptionListIds(prefix: string, select: HTMLSelectElement): void;
6
5
  export declare function getOptionListVisibleOptions<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>): Element[];
7
6
  export declare function setOptionListDisabled<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: boolean): void;
@@ -9,5 +8,4 @@ export declare function setOptionListFilter<State extends PlainObject, Localizat
9
8
  export declare function setOptionListLimit<State extends PlainObject, Localizations extends OuiLocalizationsValues>(type: "max" | "min", state: OptionListState<State, Localizations>, value?: unknown): void;
10
9
  export declare function setOptionListMultiple(element: Element, value: boolean): void;
11
10
  export declare function setOptionListReadonly<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: boolean): void;
12
- export declare function setOptionListRequired<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: boolean): void;
13
- //#endregion
11
+ export declare function setOptionListRequired<State extends PlainObject, Localizations extends OuiLocalizationsValues>(state: OptionListState<State, Localizations>, value: boolean): void;
@@ -1,2 +1 @@
1
- import { C as setOptionListDisabled, D as setOptionListReadonly, E as setOptionListMultiple, O as setOptionListRequired, S as getOptionListVisibleOptions, T as setOptionListLimit, w as setOptionListFilter, x as generateOptionListIds } from "../../option-list.data-CgMyUwPc.mjs";
2
- export { generateOptionListIds, getOptionListVisibleOptions, setOptionListDisabled, setOptionListFilter, setOptionListLimit, setOptionListMultiple, setOptionListReadonly, setOptionListRequired };
1
+ export { x as generateOptionListIds, S as getOptionListVisibleOptions, C as setOptionListDisabled, w as setOptionListFilter, T as setOptionListLimit, E as setOptionListMultiple, D as setOptionListReadonly, O as setOptionListRequired } from "../../option-list.data-Be6wopy9.mjs";
@@ -1,2 +1,2 @@
1
- import { _ as OptionListType, a as CreateOptionListList, c as OptionListAttributes, d as OptionListCallbacks, f as OptionListGroup, g as OptionListState, h as OptionListPreview, i as CreateOptionListGroupParameters, l as OptionListAutoComplete, m as OptionListOptions, n as CreateOptionListContentParameters, o as CreateOptionListOptionParameters, p as OptionListLocalizationValues, r as CreateOptionListFilter, s as CreateOptionListOptionsParameters, t as CreateOptionListContent, u as OptionListAutoCompleteType } from "../../option-list.model-CCPUlPeX.mjs";
2
- export { CreateOptionListContent, CreateOptionListContentParameters, CreateOptionListFilter, CreateOptionListGroupParameters, CreateOptionListList, CreateOptionListOptionParameters, CreateOptionListOptionsParameters, OptionListAttributes, OptionListAutoComplete, OptionListAutoCompleteType, OptionListCallbacks, OptionListGroup, OptionListLocalizationValues, OptionListOptions, OptionListPreview, OptionListState, OptionListType };
1
+ import { S as OptionListType, _ as OptionListGroup, a as CreateOptionListList, b as OptionListPreview, c as OPTION_LIST_PREVIEW_NONE, d as OPTION_LIST_TYPE_AUTOCOMPLETE, f as OPTION_LIST_TYPE_SELECT, g as OptionListCallbacks, h as OptionListAutoCompleteType, i as CreateOptionListGroupParameters, l as OPTION_LIST_PREVIEW_SET, m as OptionListAutoComplete, n as CreateOptionListContentParameters, o as CreateOptionListOptionParameters, p as OptionListAttributes, r as CreateOptionListFilter, s as CreateOptionListOptionsParameters, t as CreateOptionListContent, u as OPTION_LIST_PREVIEW_TYPED, v as OptionListLocalizationValues, x as OptionListState, y as OptionListOptions } from "../../option-list.model-DNZq-X0d.mjs";
2
+ export { CreateOptionListContent, CreateOptionListContentParameters, CreateOptionListFilter, CreateOptionListGroupParameters, CreateOptionListList, CreateOptionListOptionParameters, CreateOptionListOptionsParameters, OPTION_LIST_PREVIEW_NONE, OPTION_LIST_PREVIEW_SET, OPTION_LIST_PREVIEW_TYPED, OPTION_LIST_TYPE_AUTOCOMPLETE, OPTION_LIST_TYPE_SELECT, OptionListAttributes, OptionListAutoComplete, OptionListAutoCompleteType, OptionListCallbacks, OptionListGroup, OptionListLocalizationValues, OptionListOptions, OptionListPreview, OptionListState, OptionListType };
@@ -1 +1,7 @@
1
- export {};
1
+ // src/js/internal/option-list/option-list.model.ts
2
+ const OPTION_LIST_PREVIEW_NONE = "none";
3
+ const OPTION_LIST_PREVIEW_SET = "set";
4
+ const OPTION_LIST_PREVIEW_TYPED = "typed";
5
+ const OPTION_LIST_TYPE_AUTOCOMPLETE = "autocomplete";
6
+ const OPTION_LIST_TYPE_SELECT = "select";
7
+ export { OPTION_LIST_PREVIEW_NONE, OPTION_LIST_PREVIEW_SET, OPTION_LIST_PREVIEW_TYPED, OPTION_LIST_TYPE_AUTOCOMPLETE, OPTION_LIST_TYPE_SELECT };