@oscarpalmer/oui 0.40.0 → 0.41.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 (165) hide show
  1. package/dist/css/color-picker.css +80 -69
  2. package/dist/css/listbox.css +169 -0
  3. package/dist/js/color-picker/color-picker.constants.d.mts +2 -2
  4. package/dist/js/color-picker/color-picker.constants.mjs +5 -3
  5. package/dist/js/color-picker/color-picker.dom.d.mts +1 -1
  6. package/dist/js/color-picker/color-picker.dom.mjs +31 -14
  7. package/dist/js/color-picker/color-picker.event.d.mts +2 -2
  8. package/dist/js/color-picker/color-picker.event.mjs +232 -1
  9. package/dist/js/color-picker/color-picker.form.d.mts +1 -1
  10. package/dist/js/color-picker/color-picker.form.mjs +1 -3
  11. package/dist/js/color-picker/color-picker.misc.d.mts +2 -2
  12. package/dist/js/color-picker/color-picker.misc.mjs +104 -2
  13. package/dist/js/color-picker/color-picker.model.d.mts +2 -2
  14. package/dist/js/color-picker/color-picker.output.d.mts +1 -1
  15. package/dist/js/color-picker/color-picker.output.mjs +7 -8
  16. package/dist/js/color-picker/color-picker.state.d.mts +1 -1
  17. package/dist/js/color-picker/color-picker.state.mjs +167 -1
  18. package/dist/js/color-picker/index.d.mts +7 -15
  19. package/dist/js/color-picker/index.mjs +11 -6
  20. package/dist/js/{color-picker.constants-D1mxw_Le.d.mts → color-picker.constants-BZgXQr5o.d.mts} +6 -8
  21. package/dist/js/{color-picker.misc-CtsXGrOe.d.mts → color-picker.misc-BIS3R6jk.d.mts} +8 -4
  22. package/dist/js/combobox/combobox.constants.d.mts +1 -1
  23. package/dist/js/combobox/combobox.dom.d.mts +12 -13
  24. package/dist/js/combobox/combobox.dom.mjs +15 -17
  25. package/dist/js/combobox/combobox.event.d.mts +8 -8
  26. package/dist/js/combobox/combobox.event.mjs +1 -1
  27. package/dist/js/combobox/combobox.misc.d.mts +2 -2
  28. package/dist/js/combobox/combobox.misc.mjs +2 -2
  29. package/dist/js/combobox/combobox.model.d.mts +2 -2
  30. package/dist/js/combobox/combobox.state.d.mts +3 -4
  31. package/dist/js/combobox/combobox.state.mjs +1 -1
  32. package/dist/js/combobox/index.d.mts +8 -19
  33. package/dist/js/combobox/index.mjs +21 -23
  34. package/dist/js/{combobox.constants-DZVkMP5g.d.mts → combobox.constants-Hb3bqqQJ.d.mts} +3 -3
  35. package/dist/js/combobox.misc-DRDFk6X8.d.mts +26 -0
  36. package/dist/js/combobox.model-gjEI2VqZ.d.mts +46 -0
  37. package/dist/js/{combobox.state-BfJ3Hxg8.mjs → combobox.state-AstCICiH.mjs} +30 -41
  38. package/dist/js/dialog/dialog.model.d.mts +1 -1
  39. package/dist/js/dialog/index.d.mts +1 -1
  40. package/dist/js/{dialog.model-DX2mndMh.d.mts → dialog.model-HVzYWoDo.d.mts} +3 -3
  41. package/dist/js/floatable/floatable.embedded.d.mts +1 -1
  42. package/dist/js/floatable/floatable.embedded.mjs +2 -2
  43. package/dist/js/floatable/floatable.standalone.d.mts +1 -1
  44. package/dist/js/{floatable.embedded-MeTyXjFn.d.mts → floatable.embedded-ncshL3Sa.d.mts} +3 -3
  45. package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
  46. package/dist/js/focus-trap/focus-trap.embedded.mjs +10 -9
  47. package/dist/js/focus-trap/focus-trap.model.d.mts +1 -1
  48. package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -2
  49. package/dist/js/{focus-trap.embedded-DIU05m1z.d.mts → focus-trap.embedded-DpcPkP7c.d.mts} +3 -3
  50. package/dist/js/{focus-trap.model-BeX6UYlw.d.mts → focus-trap.model-CpltX5B5.d.mts} +1 -1
  51. package/dist/js/index.d.mts +16 -16
  52. package/dist/js/index.mjs +3 -3
  53. package/dist/js/internal/attributable.d.mts +1 -1
  54. package/dist/js/internal/draggable/draggable.model.d.mts +1 -1
  55. package/dist/js/internal/draggable/index.d.mts +8 -8
  56. package/dist/js/internal/draggable/index.mjs +27 -18
  57. package/dist/js/internal/l10n/index.d.mts +5 -0
  58. package/dist/js/internal/l10n/index.mjs +147 -0
  59. package/dist/js/internal/l10n/l10n.model.d.mts +2 -0
  60. package/dist/js/{l10n → internal/l10n}/l10n.model.mjs +5 -2
  61. package/dist/js/internal/misc.d.mts +2 -2
  62. package/dist/js/internal/navigable/index.d.mts +3 -3
  63. package/dist/js/internal/navigable/index.mjs +1 -1
  64. package/dist/js/internal/navigable/navigable.model.d.mts +1 -1
  65. package/dist/js/internal/option-list/option-list.constants.d.mts +8 -0
  66. package/dist/js/internal/option-list/option-list.constants.mjs +22 -0
  67. package/dist/js/internal/option-list/option-list.data.d.mts +21 -0
  68. package/dist/js/internal/option-list/option-list.data.mjs +2 -0
  69. package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
  70. package/dist/js/internal/option-list/option-list.dom.mjs +2 -0
  71. package/dist/js/internal/option-list/option-list.event.d.mts +6 -0
  72. package/dist/js/internal/{listbox/listbox.event.mjs → option-list/option-list.event.mjs} +7 -7
  73. package/dist/js/internal/option-list/option-list.form.d.mts +7 -0
  74. package/dist/js/internal/{listbox/listbox.form.mjs → option-list/option-list.form.mjs} +10 -13
  75. package/dist/js/internal/option-list/option-list.misc.d.mts +13 -0
  76. package/dist/js/internal/option-list/option-list.misc.mjs +2 -0
  77. package/dist/js/internal/option-list/option-list.model.d.mts +2 -0
  78. package/dist/js/internal/option-list/option-list.state.d.mts +8 -0
  79. package/dist/js/internal/option-list/option-list.state.mjs +39 -0
  80. package/dist/js/l10n/index.d.mts +3 -9
  81. package/dist/js/l10n/index.mjs +2 -107
  82. package/dist/js/l10n.model-D1E1u35L.d.mts +54 -0
  83. package/dist/js/listbox/index.d.mts +6 -17
  84. package/dist/js/listbox/index.mjs +22 -23
  85. package/dist/js/listbox/{constants.listbox.d.mts → listbox.constants.d.mts} +1 -1
  86. package/dist/js/listbox/{constants.listbox.mjs → listbox.constants.mjs} +1 -1
  87. package/dist/js/listbox/listbox.dom.d.mts +5 -0
  88. package/dist/js/listbox/listbox.dom.mjs +2 -0
  89. package/dist/js/listbox/listbox.event.d.mts +9 -0
  90. package/dist/js/listbox/listbox.event.mjs +2 -0
  91. package/dist/js/listbox/listbox.misc.d.mts +2 -0
  92. package/dist/js/listbox/listbox.misc.mjs +2 -0
  93. package/dist/js/listbox/listbox.model.d.mts +2 -0
  94. package/dist/js/listbox/listbox.model.mjs +1 -0
  95. package/dist/js/listbox/listbox.state.d.mts +9 -0
  96. package/dist/js/listbox/listbox.state.mjs +2 -0
  97. package/dist/js/{constants.listbox-C5Ap6Ag_.d.mts → listbox.constants-DOBMwKup.d.mts} +3 -3
  98. package/dist/js/listbox.misc-DwfB4Mu_.d.mts +24 -0
  99. package/dist/js/listbox.model-C0MYWXZe.d.mts +20 -0
  100. package/dist/js/listbox.state-BrN296BM.mjs +240 -0
  101. package/dist/js/menu/index.mjs +7 -3
  102. package/dist/js/menu/menu.model.d.mts +7 -7
  103. package/dist/js/movable/movable.embedded.d.mts +1 -1
  104. package/dist/js/movable/movable.embedded.mjs +21 -18
  105. package/dist/js/movable/movable.model.d.mts +1 -1
  106. package/dist/js/movable/movable.standalone.d.mts +2 -2
  107. package/dist/js/{movable.embedded-DoyXLegc.d.mts → movable.embedded-C1bDTLGs.d.mts} +2 -2
  108. package/dist/js/{movable.model-BHaK_mKw.d.mts → movable.model-D9nnPWKk.d.mts} +41 -41
  109. package/dist/js/{navigable.model-BPOM8DZk.d.mts → navigable.model-BqoR6iBv.d.mts} +1 -1
  110. package/dist/js/{listbox.data-BQyZGKgr.mjs → option-list.data-CgMyUwPc.mjs} +70 -71
  111. package/dist/js/option-list.model-CCPUlPeX.d.mts +169 -0
  112. package/dist/js/popover/index.d.mts +2 -2
  113. package/dist/js/popover/index.mjs +1 -1
  114. package/dist/js/popover/popover.model.d.mts +1 -1
  115. package/dist/js/{popover.model-ubKNG612.d.mts → popover.model-DiLdz0Hc.d.mts} +4 -4
  116. package/dist/js/resizable/resizable.embedded.d.mts +1 -1
  117. package/dist/js/resizable/resizable.model.d.mts +1 -1
  118. package/dist/js/resizable/resizable.standalone.d.mts +2 -2
  119. package/dist/js/{resizable.embedded-Bf1qBUdt.d.mts → resizable.embedded-BemH-7Re.d.mts} +2 -2
  120. package/dist/js/{resizable.model-BwzJcTVJ.d.mts → resizable.model-YEtcC9li.d.mts} +3 -3
  121. package/dist/js/sortable/sortable.embedded.d.mts +1 -1
  122. package/dist/js/sortable/sortable.embedded.mjs +46 -38
  123. package/dist/js/sortable/sortable.model.d.mts +1 -1
  124. package/dist/js/sortable/sortable.standalone.d.mts +2 -2
  125. package/dist/js/{sortable.embedded-DzBKAwSG.d.mts → sortable.embedded-CrEGff9k.d.mts} +2 -2
  126. package/dist/js/splitter/index.d.mts +1 -1
  127. package/dist/js/splitter/splitter.model.d.mts +1 -1
  128. package/dist/js/{splitter.model-DOLNjLVS.d.mts → splitter.model-C24W6eZ7.d.mts} +2 -2
  129. package/dist/js/tabs/index.d.mts +2 -2
  130. package/dist/js/tabs/index.mjs +1 -1
  131. package/dist/js/tabs/tabs.model.d.mts +1 -1
  132. package/dist/js/{tabs.model-DRBX_JtI.d.mts → tabs.model-BHPy7fPo.d.mts} +1 -1
  133. package/dist/js/toolbar/toolbar.model.d.mts +2 -2
  134. package/dist/js/tooltip/index.d.mts +2 -2
  135. package/dist/js/tooltip/tooltip.model.d.mts +1 -1
  136. package/dist/js/{tooltip.model-DRkY_BsL.d.mts → tooltip.model-BpNStw5z.d.mts} +3 -3
  137. package/package.json +1 -1
  138. package/dist/js/color-picker.event-Cksj5TvS.mjs +0 -500
  139. package/dist/js/combobox.misc-C1tPZZDi.d.mts +0 -22
  140. package/dist/js/combobox.model-oDV06XCN.d.mts +0 -44
  141. package/dist/js/internal/listbox/listbox.constants.d.mts +0 -8
  142. package/dist/js/internal/listbox/listbox.constants.mjs +0 -22
  143. package/dist/js/internal/listbox/listbox.data.d.mts +0 -19
  144. package/dist/js/internal/listbox/listbox.data.mjs +0 -2
  145. package/dist/js/internal/listbox/listbox.dom.d.mts +0 -65
  146. package/dist/js/internal/listbox/listbox.dom.mjs +0 -2
  147. package/dist/js/internal/listbox/listbox.event.d.mts +0 -4
  148. package/dist/js/internal/listbox/listbox.form.d.mts +0 -5
  149. package/dist/js/internal/listbox/listbox.misc.d.mts +0 -11
  150. package/dist/js/internal/listbox/listbox.misc.mjs +0 -2
  151. package/dist/js/internal/listbox/listbox.model.d.mts +0 -2
  152. package/dist/js/internal/listbox/listbox.state.d.mts +0 -6
  153. package/dist/js/internal/listbox/listbox.state.mjs +0 -39
  154. package/dist/js/l10n/l10n.model.d.mts +0 -2
  155. package/dist/js/l10n.model-D6a9frgl.d.mts +0 -26
  156. package/dist/js/listbox/event.listbox.d.mts +0 -7
  157. package/dist/js/listbox/event.listbox.mjs +0 -48
  158. package/dist/js/listbox/misc.listbox.d.mts +0 -2
  159. package/dist/js/listbox/misc.listbox.mjs +0 -2
  160. package/dist/js/listbox/state.listbox.d.mts +0 -9
  161. package/dist/js/listbox/state.listbox.mjs +0 -2
  162. package/dist/js/listbox.model-CuBOj4qe.d.mts +0 -129
  163. package/dist/js/misc.listbox-CjfBUbHD.mjs +0 -154
  164. package/dist/js/misc.listbox-CtoGvXQo.d.mts +0 -20
  165. /package/dist/js/internal/{listbox/listbox.model.mjs → option-list/option-list.model.mjs} +0 -0
@@ -1,6 +1,8 @@
1
- import { COLOR_PICKER_SYMBOL, COLOR_PICKER_TAGNAME, colorPickerLocalizations } from "./color-picker.constants.mjs";
1
+ import { COLOR_PICKER_SYMBOL, COLOR_PICKER_TAGNAME } from "./color-picker.constants.mjs";
2
2
  import { OuiColorPickerEvent } from "./color-picker.model.mjs";
3
- import { _ as attachColorPicker, d as setColorPickerLocalizations, f as setColorPickerRequired, g as updateColorPickerLocalizations, p as setColorPickerValue, r as onColorPickerInput, u as setColorPickerDisabled, x as initializeColorPickerComponent, y as detachColorPicker } from "../color-picker.event-Cksj5TvS.mjs";
3
+ import { setColorPickerDisabled, setColorPickerLocalizations, setColorPickerRequired, setColorPickerValue } from "./color-picker.misc.mjs";
4
+ import { onColorPickerInput } from "./color-picker.event.mjs";
5
+ import { attachColorPicker, detachColorPicker, initializeColorPickerComponent } from "./color-picker.state.mjs";
4
6
  import "@oscarpalmer/atoms/color";
5
7
  //#region src/js/color-picker/index.ts
6
8
  var OuiColorPickerElement = class extends HTMLElement {
@@ -132,6 +134,12 @@ var OuiColorPickerElement = class extends HTMLElement {
132
134
  return this[COLOR_PICKER_SYMBOL].form.internals.labels;
133
135
  }
134
136
  /**
137
+ * Localization information for the color picker
138
+ */
139
+ get localizations() {
140
+ return this[COLOR_PICKER_SYMBOL]?.component.localizations;
141
+ }
142
+ /**
135
143
  * Is the color picker readonly?
136
144
  */
137
145
  get readonly() {
@@ -228,7 +236,7 @@ var OuiColorPickerElement = class extends HTMLElement {
228
236
  constructor() {
229
237
  super();
230
238
  this[COLOR_PICKER_SYMBOL] = {
231
- component: null,
239
+ component: void 0,
232
240
  form: { internals: this.attachInternals() }
233
241
  };
234
242
  }
@@ -296,9 +304,6 @@ var OuiColorPickerElement = class extends HTMLElement {
296
304
  setCustomValidity(message) {
297
305
  this[COLOR_PICKER_SYMBOL].form.internals.setValidity({ customError: message !== "" }, message, this);
298
306
  }
299
- setLocalizations(first, second) {
300
- updateColorPickerLocalizations(colorPickerLocalizations, this[COLOR_PICKER_SYMBOL].component.localizations.component, first, second);
301
- }
302
307
  };
303
308
  customElements.define(COLOR_PICKER_TAGNAME, OuiColorPickerElement);
304
309
  //#endregion
@@ -1,4 +1,4 @@
1
- import { c as OuiLocalizations } from "./l10n.model-D6a9frgl.mjs";
1
+ import { p as OuiLocalizations, u as OuiDefaultLocalizations } from "./l10n.model-D1E1u35L.mjs";
2
2
  import { c as OuiFloatable } from "./floatable.model-DXsQgoU7.mjs";
3
3
  import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "@oscarpalmer/atoms/color";
4
4
  import { RemovableEventListener } from "@oscarpalmer/toretto/models";
@@ -36,6 +36,7 @@ type OuiColorPickerContentOpacity = {
36
36
  container: HTMLDivElement;
37
37
  input: HTMLInputElement;
38
38
  label: HTMLLabelElement;
39
+ range: HTMLInputElement;
39
40
  };
40
41
  type OuiColorPickerContentOutput = {
41
42
  container: HTMLDivElement;
@@ -132,7 +133,7 @@ type OuiColorPickerStateComponent = {
132
133
  input: HTMLInputElement;
133
134
  label: OuiColorPickerLabel;
134
135
  listeners: RemovableEventListener[];
135
- localizations: OuiColorPickerStateLocalizations;
136
+ localizations: OuiLocalizations<OuiColorPickerLocalizations>;
136
137
  output: OuiColorPickerOutputType;
137
138
  readonly: boolean;
138
139
  required: boolean;
@@ -143,10 +144,6 @@ type OuiColorPickerStateForm = {
143
144
  internals: ElementInternals;
144
145
  restored?: string;
145
146
  };
146
- type OuiColorPickerStateLocalizations = {
147
- component: Record<string, Partial<OuiColorPickerLocalizations>>;
148
- global: OuiLocalizations<OuiColorPickerLocalizations>;
149
- };
150
147
  type OuiColorPickerValue = {
151
148
  current: string;
152
149
  initial: string;
@@ -159,6 +156,7 @@ declare const COLOR_PICKER_ATTRIBUTE_COPY: string;
159
156
  declare const COLOR_PICKER_ATTRIBUTE_COPY_ERROR: string;
160
157
  declare const COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS: string;
161
158
  declare const COLOR_PICKER_ATTRIBUTE_INPUT: string;
159
+ declare const COLOR_PICKER_ATTRIBUTE_OPACITY: string;
162
160
  declare const COLOR_PICKER_ATTRIBUTE_OUTPUT_INPUT: string;
163
161
  declare const COLOR_PICKER_ATTRIBUTE_WELL: string;
164
162
  declare const COLOR_PICKER_ATTRIBUTE_WELL_KNOB: string;
@@ -174,6 +172,6 @@ declare const COLOR_PICKER_SELECTOR_OUTPUT_INPUT: string;
174
172
  declare const COLOR_PICKER_SELECTOR_WELL: string;
175
173
  declare const COLOR_PICKER_SELECTOR_WELL_KNOB: string;
176
174
  declare const COLOR_PICKER_SYMBOL: unique symbol;
177
- declare const colorPickerLocalizations: OuiLocalizations<OuiColorPickerLocalizations>;
175
+ declare const colorPickerLocalizations: OuiDefaultLocalizations<OuiColorPickerLocalizations>;
178
176
  //#endregion
179
- export { OuiColorPickerCopy as A, OuiColorPickerStateComponent as B, OuiColorPickerAnchor as C, OuiColorPickerContentOpacity as D, OuiColorPickerContentHue as E, OuiColorPickerMovementParameters as F, OuiColorPickerValueType as H, OuiColorPickerOutputColor as I, OuiColorPickerOutputColorProperty as L, OuiColorPickerEvent as M, OuiColorPickerLocalizations as N, OuiColorPickerContentOutput as O, OuiColorPickerMovement as P, OuiColorPickerOutputType as R, GenericOuiColorPickerElement as S, OuiColorPickerContent as T, OuiColorPickerStateLocalizations as V, COLOR_PICKER_SELECTOR_WELL as _, COLOR_PICKER_ATTRIBUTE_OUTPUT_INPUT as a, COLOR_PICKER_TAGNAME as b, COLOR_PICKER_EXPRESSION_HEX_PREFIX as c, COLOR_PICKER_MESSAGE_INPUT as d, COLOR_PICKER_MESSAGE_LABEL as f, COLOR_PICKER_SELECTOR_OUTPUT_INPUT as g, COLOR_PICKER_SELECTOR_INPUT as h, COLOR_PICKER_ATTRIBUTE_INPUT as i, OuiColorPickerCreateParameters as j, OuiColorPickerContentWell as k, COLOR_PICKER_INPUT_TYPES as l, COLOR_PICKER_SELECTOR_COPY as m, COLOR_PICKER_ATTRIBUTE_COPY_ERROR as n, COLOR_PICKER_ATTRIBUTE_WELL as o, COLOR_PICKER_OUTPUTS as p, COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS as r, COLOR_PICKER_ATTRIBUTE_WELL_KNOB as s, COLOR_PICKER_ATTRIBUTE_COPY as t, COLOR_PICKER_KEYS as u, COLOR_PICKER_SELECTOR_WELL_KNOB as v, OuiColorPickerColor as w, colorPickerLocalizations as x, COLOR_PICKER_SYMBOL as y, OuiColorPickerState as z };
177
+ export { OuiColorPickerContentWell as A, OuiColorPickerState as B, GenericOuiColorPickerElement as C, OuiColorPickerContentHue as D, OuiColorPickerContent as E, OuiColorPickerMovement as F, OuiColorPickerValueType as H, OuiColorPickerMovementParameters as I, OuiColorPickerOutputColor as L, OuiColorPickerCreateParameters as M, OuiColorPickerEvent as N, OuiColorPickerContentOpacity as O, OuiColorPickerLocalizations as P, OuiColorPickerOutputColorProperty as R, colorPickerLocalizations as S, OuiColorPickerColor as T, OuiColorPickerStateComponent as V, COLOR_PICKER_SELECTOR_OUTPUT_INPUT as _, COLOR_PICKER_ATTRIBUTE_OPACITY as a, COLOR_PICKER_SYMBOL as b, COLOR_PICKER_ATTRIBUTE_WELL_KNOB as c, COLOR_PICKER_KEYS as d, COLOR_PICKER_MESSAGE_INPUT as f, COLOR_PICKER_SELECTOR_INPUT as g, COLOR_PICKER_SELECTOR_COPY as h, COLOR_PICKER_ATTRIBUTE_INPUT as i, OuiColorPickerCopy as j, OuiColorPickerContentOutput as k, COLOR_PICKER_EXPRESSION_HEX_PREFIX as l, COLOR_PICKER_OUTPUTS as m, COLOR_PICKER_ATTRIBUTE_COPY_ERROR as n, COLOR_PICKER_ATTRIBUTE_OUTPUT_INPUT as o, COLOR_PICKER_MESSAGE_LABEL as p, COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS as r, COLOR_PICKER_ATTRIBUTE_WELL as s, COLOR_PICKER_ATTRIBUTE_COPY as t, COLOR_PICKER_INPUT_TYPES as u, COLOR_PICKER_SELECTOR_WELL as v, OuiColorPickerAnchor as w, COLOR_PICKER_TAGNAME as x, COLOR_PICKER_SELECTOR_WELL_KNOB as y, OuiColorPickerOutputType as z };
@@ -1,5 +1,4 @@
1
- import { c as OuiLocalizations } from "./l10n.model-D6a9frgl.mjs";
2
- import { H as OuiColorPickerValueType, N as OuiColorPickerLocalizations, R as OuiColorPickerOutputType, S as GenericOuiColorPickerElement, z as OuiColorPickerState } from "./color-picker.constants-D1mxw_Le.mjs";
1
+ import { B as OuiColorPickerState, C as GenericOuiColorPickerElement, H as OuiColorPickerValueType, P as OuiColorPickerLocalizations, z as OuiColorPickerOutputType } from "./color-picker.constants-BZgXQr5o.mjs";
3
2
  //#region src/js/color-picker/color-picker.misc.d.ts
4
3
  declare function getColorPickerId(): string;
5
4
  declare function getColorPickerOutput(element: GenericOuiColorPickerElement): OuiColorPickerOutputType;
@@ -11,6 +10,12 @@ declare function getColorPickerValueType(state: OuiColorPickerState, value: unkn
11
10
  * @param localizations Localizations for language
12
11
  */
13
12
  declare function setColorPickerLocalizations(language: string, localizations: Partial<OuiColorPickerLocalizations>): void;
13
+ /**
14
+ * Set default localizations
15
+ *
16
+ * @param localizations Default localizations
17
+ */
18
+ declare function setColorPickerLocalizations(localizations: Partial<OuiColorPickerLocalizations>, defaults: true): void;
14
19
  /**
15
20
  * Set localizations for one or more languages
16
21
  *
@@ -22,6 +27,5 @@ declare function setColorPickerRequired(state: OuiColorPickerState, value: boole
22
27
  declare function setColorPickerValue<Type extends OuiColorPickerValueType>(state: OuiColorPickerState, value: unknown, type?: Type): void;
23
28
  declare function setColorPickerValues(state: OuiColorPickerState, focus: boolean, input?: string): void;
24
29
  declare function updateColorPickerLabels(state: OuiColorPickerState): void;
25
- declare function updateColorPickerLocalizations(instance: OuiLocalizations<OuiColorPickerLocalizations>, destination: Record<string, Partial<OuiColorPickerLocalizations>>, first: string | Record<string, Partial<OuiColorPickerLocalizations>>, second?: Partial<OuiColorPickerLocalizations>): void;
26
30
  //#endregion
27
- export { setColorPickerLocalizations as a, setColorPickerValues as c, setColorPickerDisabled as i, updateColorPickerLabels as l, getColorPickerOutput as n, setColorPickerRequired as o, getColorPickerValueType as r, setColorPickerValue as s, getColorPickerId as t, updateColorPickerLocalizations as u };
31
+ export { setColorPickerLocalizations as a, setColorPickerValues as c, setColorPickerDisabled as i, updateColorPickerLabels as l, getColorPickerOutput as n, setColorPickerRequired as o, getColorPickerValueType as r, setColorPickerValue as s, getColorPickerId as t };
@@ -1,2 +1,2 @@
1
- import { a as COMBOBOX_SYMBOL, c as comboboxMessages, d as messageSelect, f as selectorAnchor, h as selectorSelectionItem, i as COMBOBOX_AUTOCOMPLETES, l as comboboxSelectors, m as selectorOption, n as COMBOBOX_ATTRIBUTE_SELECTION, o as COMBOBOX_TAGNAME, p as selectorContent, r as COMBOBOX_ATTRIBUTE_SELECTION_ITEM, s as comboboxAttributes, t as COMBOBOX_ATTRIBUTE_ANCHOR, u as messageLabel } from "../combobox.constants-DZVkMP5g.mjs";
1
+ import { a as COMBOBOX_SYMBOL, c as comboboxMessages, d as messageSelect, f as selectorAnchor, h as selectorSelectionItem, i as COMBOBOX_AUTOCOMPLETES, l as comboboxSelectors, m as selectorOption, n as COMBOBOX_ATTRIBUTE_SELECTION, o as COMBOBOX_TAGNAME, p as selectorContent, r as COMBOBOX_ATTRIBUTE_SELECTION_ITEM, s as comboboxAttributes, t as COMBOBOX_ATTRIBUTE_ANCHOR, u as messageLabel } from "../combobox.constants-Hb3bqqQJ.mjs";
2
2
  export { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM, COMBOBOX_AUTOCOMPLETES, COMBOBOX_SYMBOL, COMBOBOX_TAGNAME, comboboxAttributes, comboboxMessages, comboboxSelectors, messageLabel, messageSelect, selectorAnchor, selectorContent, selectorOption, selectorSelectionItem };
@@ -1,26 +1,25 @@
1
- import { c as OuiListboxPreview } from "../listbox.model-CuBOj4qe.mjs";
2
- import { CreateListboxContent, CreateListboxContentParameters } from "../internal/listbox/listbox.dom.mjs";
3
- import { c as OuiComboboxState, o as OuiComboboxSelection, s as OuiComboboxSelectionItem } from "../combobox.model-oDV06XCN.mjs";
1
+ import { h as OptionListPreview, n as CreateOptionListContentParameters, t as CreateOptionListContent } from "../option-list.model-CCPUlPeX.mjs";
2
+ import { c as OuiComboboxSelectionItem, l as OuiComboboxState, s as OuiComboboxSelection } from "../combobox.model-gjEI2VqZ.mjs";
4
3
  //#region src/js/combobox/combobox.dom.d.ts
5
4
  type CreateAnchor = {
6
- container?: HTMLElement;
5
+ container?: Element;
7
6
  element: HTMLElement;
8
7
  selection?: OuiComboboxSelection;
9
8
  };
10
9
  type CreateSelectionItemsParameters = {
11
- container: HTMLElement;
10
+ container: Element;
12
11
  items: OuiComboboxSelectionItem[];
13
- options: HTMLElement[];
12
+ options: Element[];
14
13
  state?: OuiComboboxState;
15
14
  };
16
- export declare function createComboboxAnchor(parameters: CreateListboxContentParameters): CreateAnchor;
17
- export declare function createComboboxButton(parameters: CreateListboxContentParameters): CreateAnchor;
18
- export declare function createComboboxContent(parameters: CreateListboxContentParameters): CreateListboxContent;
15
+ export declare function createComboboxAnchor(parameters: CreateOptionListContentParameters): CreateAnchor;
16
+ export declare function createComboboxButton(parameters: CreateOptionListContentParameters): CreateAnchor;
17
+ export declare function createComboboxContent(parameters: CreateOptionListContentParameters): CreateOptionListContent;
19
18
  export declare function createComboboxSelection(id: string, select: HTMLSelectElement): OuiComboboxSelection;
20
- export declare function createComboboxSelectionItem(option: HTMLElement, state?: OuiComboboxState): OuiComboboxSelectionItem;
19
+ export declare function createComboboxSelectionItem(option: Element, state?: OuiComboboxState): OuiComboboxSelectionItem;
21
20
  export declare function createComboboxSelectionItems(parameters: CreateSelectionItemsParameters): void;
22
- export declare function updateComboboxTabindices(state: OuiComboboxState, active?: HTMLElement): void;
23
- export declare function updateComboboxAutocomplete(preview: OuiListboxPreview, state: OuiComboboxState, active?: HTMLElement): void;
24
- export declare function updateComboboxSelection(state: OuiComboboxState, active: HTMLElement | undefined, added: boolean, selected?: HTMLElement[]): void;
21
+ export declare function updateComboboxTabindices(state: OuiComboboxState, active?: Element): void;
22
+ export declare function updateComboboxAutocomplete(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
23
+ export declare function updateComboboxSelection(state: OuiComboboxState, active: Element | undefined, added: boolean, selected?: Element[]): void;
25
24
  export declare function updateComboboxSelectionItems(state: OuiComboboxState): void;
26
25
  //#endregion
@@ -1,5 +1,4 @@
1
- import { getLocalization, localize } from "../l10n/index.mjs";
2
- import { _ as createListboxValueLabel, f as createListboxInput, l as createListboxFilter, m as createListboxMessage, p as createListboxList } from "../listbox.data-BQyZGKgr.mjs";
1
+ import { _ as createOptionListValueLabel, f as createOptionListInput, l as createOptionListFilter, m as createOptionListMessage, p as createOptionListList } from "../option-list.data-CgMyUwPc.mjs";
3
2
  import { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM } from "./combobox.constants.mjs";
4
3
  import { setAria } from "@oscarpalmer/toretto/aria";
5
4
  import { setAttribute } from "@oscarpalmer/toretto/attribute";
@@ -11,7 +10,7 @@ function createComboboxAnchor(parameters) {
11
10
  let container;
12
11
  let element;
13
12
  let selection;
14
- if (parameters.type === "autocomplete") element = createListboxInput(parameters, select.selectedOptions[0]?.textContent ?? "");
13
+ if (parameters.type === "autocomplete") element = createOptionListInput(parameters, select.selectedOptions[0]?.textContent ?? "");
15
14
  else ({container, element, selection} = createComboboxButton(parameters));
16
15
  setAttribute(container ?? element, COMBOBOX_ATTRIBUTE_ANCHOR, "");
17
16
  return {
@@ -57,10 +56,10 @@ function createComboboxContent(parameters) {
57
56
  tabIndex: -1
58
57
  }
59
58
  });
60
- const filter = createListboxFilter(parameters);
61
- const list = createListboxList(parameters);
62
- const message = createListboxMessage(parameters.attributes.message);
63
- const value = createListboxValueLabel(parameters.id);
59
+ const filter = createOptionListFilter(parameters);
60
+ const list = createOptionListList(parameters);
61
+ const message = createOptionListMessage(parameters.attributes.message);
62
+ const value = createOptionListValueLabel(parameters.id);
64
63
  if (filter != null) element.append(filter.container);
65
64
  element.append(list.element, message, value);
66
65
  return {
@@ -94,12 +93,12 @@ function createComboboxSelectionItem(option, state) {
94
93
  const optionLabel = option.textContent;
95
94
  const optionValue = getData(option, "value", false) ?? "";
96
95
  const element = createElement("li");
97
- const localization = state == null ? option.textContent : getLocalization(state.component.localizations.global, state.component.host, "remove", state.component.localizations.component);
96
+ const localization = state == null ? option.textContent : state.component.localizations.localize("remove", {
97
+ arguments: [optionLabel, optionValue],
98
+ element: state.component.host
99
+ });
98
100
  const button = createElement("button", {
99
- aria: { label: localize(localization, {
100
- label: optionLabel,
101
- value: optionValue
102
- }, [optionLabel, optionValue]) },
101
+ aria: { label: localization },
103
102
  attribute: {
104
103
  [COMBOBOX_ATTRIBUTE_SELECTION_ITEM]: "",
105
104
  tabindex: -1
@@ -197,7 +196,6 @@ function updateComboboxSelection(state, active, added, selected) {
197
196
  function updateComboboxSelectionItems(state) {
198
197
  const { host, localizations, options, selection } = state.component;
199
198
  if (selection == null) return;
200
- const localization = getLocalization(localizations.global, host, "remove", localizations.component);
201
199
  const { length } = selection.items;
202
200
  for (let index = 0; index < length; index += 1) {
203
201
  const item = selection.items[index];
@@ -205,10 +203,10 @@ function updateComboboxSelectionItems(state) {
205
203
  if (option == null) continue;
206
204
  const optionLabel = option.textContent;
207
205
  const optionValue = getData(option, "value", false) ?? "";
208
- setAria(item.button, "label", localize(localization, {
209
- label: optionLabel,
210
- value: optionValue
211
- }, [optionLabel, optionValue]));
206
+ setAria(item.button, "label", localizations.localize("remove", {
207
+ arguments: [optionLabel, optionValue],
208
+ element: host
209
+ }));
212
210
  }
213
211
  }
214
212
  //#endregion
@@ -1,19 +1,19 @@
1
- import { c as OuiListboxPreview } from "../listbox.model-CuBOj4qe.mjs";
2
- import { c as OuiComboboxState } from "../combobox.model-oDV06XCN.mjs";
1
+ import { h as OptionListPreview } from "../option-list.model-CCPUlPeX.mjs";
2
+ import { l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
3
3
  //#region src/js/combobox/combobox.event.d.ts
4
4
  export declare function onComboboxActivation(state: OuiComboboxState): void;
5
- export declare function onComboboxApply(state: OuiComboboxState, option: HTMLElement | undefined, _: string[], added: boolean, selected?: HTMLElement[]): void;
5
+ export declare function onComboboxApply(state: OuiComboboxState, option: Element | undefined, _: string[], added: boolean, selected?: Element[]): void;
6
6
  export declare function onComboboxClickContent(event: PointerEvent, state: OuiComboboxState): void;
7
7
  export declare function onComboboxEnter(state: OuiComboboxState): void;
8
8
  export declare function onComboboxEscape(state: OuiComboboxState): void;
9
- export declare function onComboboxFilter(preview: OuiListboxPreview, state: OuiComboboxState, update: boolean, active?: HTMLElement, emit?: boolean): void;
9
+ export declare function onComboboxFilter(preview: OptionListPreview, state: OuiComboboxState, update: boolean, active?: Element, emit?: boolean): void;
10
10
  export declare function onComboboxFocusout(event: FocusEvent): void;
11
11
  export declare function onComboboxInput(event: InputEvent): void;
12
12
  export declare function onComboboxKeydown(event: KeyboardEvent): void;
13
- export declare function onComboboxKeydownSelection(event: KeyboardEvent, state: OuiComboboxState, item: HTMLElement): void;
14
- export declare function onComboboxPreview(preview: OuiListboxPreview, state: OuiComboboxState, active?: HTMLElement): void;
15
- export declare function onComboboxRemoveSelection(state: OuiComboboxState, item: HTMLElement): void;
16
- export declare function onComboboxNavigation(preview: OuiListboxPreview, state: OuiComboboxState, active?: HTMLElement): void;
13
+ export declare function onComboboxKeydownSelection(event: KeyboardEvent, state: OuiComboboxState, item: Element): void;
14
+ export declare function onComboboxPreview(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
15
+ export declare function onComboboxRemoveSelection(state: OuiComboboxState, item: Element): void;
16
+ export declare function onComboboxNavigation(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
17
17
  export declare function onComboboxSelection(state: OuiComboboxState, hasSelection?: boolean): void;
18
18
  export declare function onComboboxTab(state: OuiComboboxState): void;
19
19
  export declare function onComboboxToggle(state: OuiComboboxState): void;
@@ -1,2 +1,2 @@
1
- import { C as skipComboboxNavigation, S as preventComboboxActivation, _ as onComboboxPreview, b as onComboboxTab, c as onComboboxClickContent, d as onComboboxFilter, f as onComboboxFocusout, g as onComboboxNavigation, h as onComboboxKeydownSelection, l as onComboboxEnter, m as onComboboxKeydown, o as onComboboxActivation, p as onComboboxInput, s as onComboboxApply, u as onComboboxEscape, v as onComboboxRemoveSelection, x as onComboboxToggle, y as onComboboxSelection } from "../combobox.state-BfJ3Hxg8.mjs";
1
+ import { C as skipComboboxNavigation, S as preventComboboxActivation, _ as onComboboxPreview, b as onComboboxTab, c as onComboboxClickContent, d as onComboboxFilter, f as onComboboxFocusout, g as onComboboxNavigation, h as onComboboxKeydownSelection, l as onComboboxEnter, m as onComboboxKeydown, o as onComboboxActivation, p as onComboboxInput, s as onComboboxApply, u as onComboboxEscape, v as onComboboxRemoveSelection, x as onComboboxToggle, y as onComboboxSelection } from "../combobox.state-AstCICiH.mjs";
2
2
  export { onComboboxActivation, onComboboxApply, onComboboxClickContent, onComboboxEnter, onComboboxEscape, onComboboxFilter, onComboboxFocusout, onComboboxInput, onComboboxKeydown, onComboboxKeydownSelection, onComboboxNavigation, onComboboxPreview, onComboboxRemoveSelection, onComboboxSelection, onComboboxTab, onComboboxToggle, preventComboboxActivation, skipComboboxNavigation };
@@ -1,2 +1,2 @@
1
- import { a as updateComboboxLocalizations, i as setComboboxLocalizations, n as getComboboxId, r as hasTextSelection, t as getComboboxAutoComplete } from "../combobox.misc-C1tPZZDi.mjs";
2
- export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations, updateComboboxLocalizations };
1
+ import { i as setComboboxLocalizations, n as getComboboxId, r as hasTextSelection, t as getComboboxAutoComplete } from "../combobox.misc-DRDFk6X8.mjs";
2
+ export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations };
@@ -1,2 +1,2 @@
1
- import { D as setComboboxLocalizations, E as hasTextSelection, O as updateComboboxLocalizations, T as getComboboxId, w as getComboboxAutoComplete } from "../combobox.state-BfJ3Hxg8.mjs";
2
- export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations, updateComboboxLocalizations };
1
+ import { D as setComboboxLocalizations, E as hasTextSelection, T as getComboboxId, w as getComboboxAutoComplete } from "../combobox.state-AstCICiH.mjs";
2
+ export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations };
@@ -1,2 +1,2 @@
1
- import { a as OuiComboboxOptions, c as OuiComboboxState, i as OuiComboboxLabel, l as OuiComboboxValues, n as OuiComboboxFilter, o as OuiComboboxSelection, r as OuiComboboxGroup, s as OuiComboboxSelectionItem, t as OuiComboboxAnchor } from "../combobox.model-oDV06XCN.mjs";
2
- export { OuiComboboxAnchor, OuiComboboxFilter, OuiComboboxGroup, OuiComboboxLabel, OuiComboboxOptions, OuiComboboxSelection, OuiComboboxSelectionItem, OuiComboboxState, OuiComboboxValues };
1
+ import { a as OuiComboboxLocalizations, c as OuiComboboxSelectionItem, d as OuiComboboxValues, i as OuiComboboxLabel, l as OuiComboboxState, n as OuiComboboxFilter, o as OuiComboboxOptions, r as OuiComboboxGroup, s as OuiComboboxSelection, t as OuiComboboxAnchor, u as OuiComboboxStateExtras } from "../combobox.model-gjEI2VqZ.mjs";
2
+ export { OuiComboboxAnchor, OuiComboboxFilter, OuiComboboxGroup, OuiComboboxLabel, OuiComboboxLocalizations, OuiComboboxOptions, OuiComboboxSelection, OuiComboboxSelectionItem, OuiComboboxState, OuiComboboxStateExtras, OuiComboboxValues };
@@ -1,10 +1,9 @@
1
- import { c as OuiLocalizations } from "../l10n.model-D6a9frgl.mjs";
2
- import { o as OuiListboxLocalizations } from "../listbox.model-CuBOj4qe.mjs";
3
- import { c as OuiComboboxState } from "../combobox.model-oDV06XCN.mjs";
1
+ import { u as OuiDefaultLocalizations } from "../l10n.model-D1E1u35L.mjs";
2
+ import { a as OuiComboboxLocalizations, l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
4
3
  //#region src/js/combobox/combobox.state.d.ts
5
4
  export declare function initializeCombobox(element: HTMLElement, state: OuiComboboxState): void;
6
5
  export declare function onAttachCombobox(state: OuiComboboxState): void;
7
6
  export declare function onDetachCombobox(state: OuiComboboxState): void;
8
- export declare const comboboxLocalizations: OuiLocalizations<OuiListboxLocalizations>;
7
+ export declare const comboboxLocalizations: OuiDefaultLocalizations<OuiComboboxLocalizations>;
9
8
  export declare const comboboxes: Set<OuiComboboxState>;
10
9
  //#endregion
@@ -1,2 +1,2 @@
1
- import { a as onDetachCombobox, i as onAttachCombobox, n as comboboxes, r as initializeCombobox, t as comboboxLocalizations } from "../combobox.state-BfJ3Hxg8.mjs";
1
+ import { a as onDetachCombobox, i as onAttachCombobox, n as comboboxes, r as initializeCombobox, t as comboboxLocalizations } from "../combobox.state-AstCICiH.mjs";
2
2
  export { comboboxLocalizations, comboboxes, initializeCombobox, onAttachCombobox, onDetachCombobox };
@@ -1,7 +1,8 @@
1
- import { f as OuiListboxType, o as OuiListboxLocalizations } from "../listbox.model-CuBOj4qe.mjs";
2
- import { a as COMBOBOX_SYMBOL, o as COMBOBOX_TAGNAME } from "../combobox.constants-DZVkMP5g.mjs";
3
- import { c as OuiComboboxState } from "../combobox.model-oDV06XCN.mjs";
4
- import { i as setComboboxLocalizations } from "../combobox.misc-C1tPZZDi.mjs";
1
+ import { p as OuiLocalizations } from "../l10n.model-D1E1u35L.mjs";
2
+ import { _ as OptionListType } from "../option-list.model-CCPUlPeX.mjs";
3
+ import { a as COMBOBOX_SYMBOL, o as COMBOBOX_TAGNAME } from "../combobox.constants-Hb3bqqQJ.mjs";
4
+ import { a as OuiComboboxLocalizations, l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
5
+ import { i as setComboboxLocalizations } from "../combobox.misc-DRDFk6X8.mjs";
5
6
  //#region src/js/combobox/index.d.ts
6
7
  declare global {
7
8
  interface HTMLElementTagNameMap {
@@ -40,6 +41,7 @@ export declare class OuiComboboxElement extends HTMLElement {
40
41
  * Label elements associated with the combobox
41
42
  */
42
43
  get labels(): NodeList;
44
+ get localizations(): OuiLocalizations<OuiComboboxLocalizations>;
43
45
  /**
44
46
  * Maximum number of selected options
45
47
  */
@@ -83,11 +85,11 @@ export declare class OuiComboboxElement extends HTMLElement {
83
85
  /**
84
86
  * Selected options
85
87
  */
86
- get selected(): HTMLElement[];
88
+ get selected(): Element[];
87
89
  /**
88
90
  * Type of combobox
89
91
  */
90
- get type(): OuiListboxType;
92
+ get type(): OptionListType;
91
93
  /**
92
94
  * Validation message for the combobox
93
95
  */
@@ -145,19 +147,6 @@ export declare class OuiComboboxElement extends HTMLElement {
145
147
  * @param message Validation message
146
148
  */
147
149
  setCustomValidity(message: string): void;
148
- /**
149
- * Set combobox localizations for a specific language
150
- *
151
- * @param language Language code
152
- * @param localizations Localizations for language
153
- */
154
- setLocalizations(language: string, localizations: Partial<OuiListboxLocalizations>): void;
155
- /**
156
- * Set combobox localizations for one or more languages
157
- *
158
- * @param localizations Localizations for one or more languages
159
- */
160
- setLocalizations(localizations: Record<string, Partial<OuiListboxLocalizations>>): void;
161
150
  }
162
151
  //#endregion
163
152
  export { setComboboxLocalizations };
@@ -1,8 +1,7 @@
1
- import { updateLocalizations } from "../l10n/index.mjs";
2
- import { C as setListboxDisabled, D as setListboxReadonly, O as setListboxRequired, T as setListboxLimit, a as setListboxValue, o as setListboxValues, w as setListboxFilter } from "../listbox.data-BQyZGKgr.mjs";
3
- import { attachListbox, detachListbox } from "../internal/listbox/listbox.state.mjs";
1
+ import { C as setOptionListDisabled, D as setOptionListReadonly, O as setOptionListRequired, T as setOptionListLimit, a as setOptionListValue, o as setOptionListValues, w as setOptionListFilter } from "../option-list.data-CgMyUwPc.mjs";
2
+ import { attachOptionList, detachOptionList } from "../internal/option-list/option-list.state.mjs";
4
3
  import { COMBOBOX_SYMBOL, COMBOBOX_TAGNAME } from "./combobox.constants.mjs";
5
- import { D as setComboboxLocalizations, a as onDetachCombobox, i as onAttachCombobox, n as comboboxes, r as initializeCombobox } from "../combobox.state-BfJ3Hxg8.mjs";
4
+ import { D as setComboboxLocalizations, a as onDetachCombobox, i as onAttachCombobox, n as comboboxes, r as initializeCombobox } from "../combobox.state-AstCICiH.mjs";
6
5
  import { getAttribute } from "@oscarpalmer/toretto/attribute";
7
6
  import { parse } from "@oscarpalmer/atoms/string";
8
7
  //#region src/js/combobox/index.ts
@@ -24,7 +23,7 @@ var OuiComboboxElement = class extends HTMLElement {
24
23
  * Should the combobox be disabled?
25
24
  */
26
25
  set disabled(value) {
27
- if (typeof value === "boolean" && value !== this.disabled) setListboxDisabled(this[COMBOBOX_SYMBOL], value);
26
+ if (typeof value === "boolean" && value !== this.disabled) setOptionListDisabled(this[COMBOBOX_SYMBOL], value);
28
27
  }
29
28
  /**
30
29
  * Current filter value
@@ -36,7 +35,7 @@ var OuiComboboxElement = class extends HTMLElement {
36
35
  * Set the filter value
37
36
  */
38
37
  set filter(value) {
39
- setListboxFilter(this[COMBOBOX_SYMBOL], value);
38
+ setOptionListFilter(this[COMBOBOX_SYMBOL], value);
40
39
  }
41
40
  /**
42
41
  * Form element associated with the combobox
@@ -50,6 +49,9 @@ var OuiComboboxElement = class extends HTMLElement {
50
49
  get labels() {
51
50
  return this[COMBOBOX_SYMBOL].form.internals.labels;
52
51
  }
52
+ get localizations() {
53
+ return this[COMBOBOX_SYMBOL].component?.localizations;
54
+ }
53
55
  /**
54
56
  * Maximum number of selected options
55
57
  */
@@ -60,7 +62,7 @@ var OuiComboboxElement = class extends HTMLElement {
60
62
  * Set the maximum number of selected options
61
63
  */
62
64
  set max(value) {
63
- setListboxLimit("max", this[COMBOBOX_SYMBOL], value);
65
+ setOptionListLimit("max", this[COMBOBOX_SYMBOL], value);
64
66
  }
65
67
  /**
66
68
  * Minimum number of selected options
@@ -72,7 +74,7 @@ var OuiComboboxElement = class extends HTMLElement {
72
74
  * Set the minimum number of selected options
73
75
  */
74
76
  set min(value) {
75
- setListboxLimit("min", this[COMBOBOX_SYMBOL], value);
77
+ setOptionListLimit("min", this[COMBOBOX_SYMBOL], value);
76
78
  }
77
79
  /**
78
80
  * Does the combobox allow multiple values?
@@ -96,7 +98,7 @@ var OuiComboboxElement = class extends HTMLElement {
96
98
  * Should the combobox be readonly?
97
99
  */
98
100
  set readonly(value) {
99
- if (typeof value === "boolean" && value !== this.readonly) setListboxReadonly(this[COMBOBOX_SYMBOL], value);
101
+ if (typeof value === "boolean" && value !== this.readonly) setOptionListReadonly(this[COMBOBOX_SYMBOL], value);
100
102
  }
101
103
  /**
102
104
  * Is the combobox required?
@@ -108,7 +110,7 @@ var OuiComboboxElement = class extends HTMLElement {
108
110
  * Should the combobox be required?
109
111
  */
110
112
  set required(value) {
111
- if (typeof value === "boolean" && value !== this.required) setListboxRequired(this[COMBOBOX_SYMBOL], value);
113
+ if (typeof value === "boolean" && value !== this.required) setOptionListRequired(this[COMBOBOX_SYMBOL], value);
112
114
  }
113
115
  /**
114
116
  * Selected options
@@ -144,7 +146,7 @@ var OuiComboboxElement = class extends HTMLElement {
144
146
  * Set the value
145
147
  */
146
148
  set value(value) {
147
- setListboxValue(this[COMBOBOX_SYMBOL], value);
149
+ setOptionListValue(this[COMBOBOX_SYMBOL], value);
148
150
  }
149
151
  /**
150
152
  * Current values
@@ -156,7 +158,7 @@ var OuiComboboxElement = class extends HTMLElement {
156
158
  * Set the values
157
159
  */
158
160
  set values(values) {
159
- setListboxValues(this[COMBOBOX_SYMBOL], values);
161
+ setOptionListValues(this[COMBOBOX_SYMBOL], values);
160
162
  }
161
163
  /**
162
164
  * Can the combobox be validated?
@@ -167,7 +169,7 @@ var OuiComboboxElement = class extends HTMLElement {
167
169
  constructor() {
168
170
  super();
169
171
  this[COMBOBOX_SYMBOL] = {
170
- component: null,
172
+ component: void 0,
171
173
  form: { internals: this.attachInternals() }
172
174
  };
173
175
  }
@@ -180,7 +182,7 @@ var OuiComboboxElement = class extends HTMLElement {
180
182
  break;
181
183
  case "max":
182
184
  case "min":
183
- setListboxLimit(name, state, value);
185
+ setOptionListLimit(name, state, value);
184
186
  break;
185
187
  case "value": this.value = value ?? "";
186
188
  }
@@ -197,23 +199,23 @@ var OuiComboboxElement = class extends HTMLElement {
197
199
  * Clear all selected options
198
200
  */
199
201
  clear() {
200
- setListboxValues(this[COMBOBOX_SYMBOL], []);
202
+ setOptionListValues(this[COMBOBOX_SYMBOL], []);
201
203
  }
202
204
  connectedCallback() {
203
205
  const state = this[COMBOBOX_SYMBOL];
204
206
  if (state.component == null) initializeCombobox(this, state);
205
- else attachListbox(state, comboboxes, onAttachCombobox);
207
+ else attachOptionList(state, comboboxes, onAttachCombobox);
206
208
  }
207
209
  disconnectedCallback() {
208
210
  const state = this[COMBOBOX_SYMBOL];
209
- if (state.component != null) detachListbox(state, comboboxes, onDetachCombobox);
211
+ if (state.component != null) detachOptionList(state, comboboxes, onDetachCombobox);
210
212
  }
211
213
  formDisabledCallback(disabled) {
212
214
  this.disabled = disabled;
213
215
  }
214
216
  formResetCallback() {
215
217
  const state = this[COMBOBOX_SYMBOL];
216
- if (state.component != null) setListboxValues(state, state.component.values.initial);
218
+ if (state.component != null) setOptionListValues(state, state.component.values.initial);
217
219
  }
218
220
  formStateRestoreCallback(state, reason) {
219
221
  if (reason !== "restore") return;
@@ -221,7 +223,7 @@ var OuiComboboxElement = class extends HTMLElement {
221
223
  if (!Array.isArray(parsed)) return;
222
224
  const { component, form } = this[COMBOBOX_SYMBOL];
223
225
  if (component == null) form.restored = parsed;
224
- else setListboxValues({
226
+ else setOptionListValues({
225
227
  component,
226
228
  form
227
229
  }, parsed);
@@ -242,10 +244,6 @@ var OuiComboboxElement = class extends HTMLElement {
242
244
  setCustomValidity(message) {
243
245
  this[COMBOBOX_SYMBOL].form.internals.setValidity({ customError: message !== "" }, message, this);
244
246
  }
245
- setLocalizations(first, second) {
246
- const { localizations } = this[COMBOBOX_SYMBOL].component;
247
- updateLocalizations(localizations.global, typeof first === "string" ? { [first]: second } : first, localizations.component);
248
- }
249
247
  };
250
248
  customElements.define(COMBOBOX_TAGNAME, OuiComboboxElement);
251
249
  //#endregion
@@ -1,12 +1,12 @@
1
- import { r as OuiListboxAutoCompleteType, t as OuiListboxAttributes } from "./listbox.model-CuBOj4qe.mjs";
1
+ import { c as OptionListAttributes, u as OptionListAutoCompleteType } from "./option-list.model-CCPUlPeX.mjs";
2
2
  //#region src/js/combobox/combobox.constants.d.ts
3
3
  declare const COMBOBOX_TAGNAME = "oui-combobox";
4
4
  declare const COMBOBOX_ATTRIBUTE_ANCHOR: string;
5
5
  declare const COMBOBOX_ATTRIBUTE_SELECTION: string;
6
6
  declare const COMBOBOX_ATTRIBUTE_SELECTION_ITEM: string;
7
- declare const COMBOBOX_AUTOCOMPLETES: Set<OuiListboxAutoCompleteType>;
7
+ declare const COMBOBOX_AUTOCOMPLETES: Set<OptionListAutoCompleteType>;
8
8
  declare const COMBOBOX_SYMBOL: unique symbol;
9
- declare const comboboxAttributes: OuiListboxAttributes;
9
+ declare const comboboxAttributes: OptionListAttributes;
10
10
  declare const messageLabel: string;
11
11
  declare const messageSelect: string;
12
12
  declare const comboboxMessages: Record<string, string>;
@@ -0,0 +1,26 @@
1
+ import { l as OptionListAutoComplete, p as OptionListLocalizationValues } from "./option-list.model-CCPUlPeX.mjs";
2
+ //#region src/js/combobox/combobox.misc.d.ts
3
+ declare function getComboboxAutoComplete(element: Element, select: boolean): OptionListAutoComplete;
4
+ declare function getComboboxId(): string;
5
+ declare function hasTextSelection(element: Element): element is HTMLInputElement;
6
+ /**
7
+ * Set combobox localizations for a specific language
8
+ *
9
+ * @param language Language code
10
+ * @param localizations Localizations for language
11
+ */
12
+ declare function setComboboxLocalizations(language: string, localizations: Partial<OptionListLocalizationValues>): void;
13
+ /**
14
+ * Set default combobox localizations
15
+ *
16
+ * @param localizations Default localizations
17
+ */
18
+ declare function setComboboxLocalizations(localizations: Partial<OptionListLocalizationValues>, defaults: true): void;
19
+ /**
20
+ * Set combobox localizations for one or more languages
21
+ *
22
+ * @param localizations Localizations for one or more languages
23
+ */
24
+ declare function setComboboxLocalizations(localizations: Record<string, Partial<OptionListLocalizationValues>>): void;
25
+ //#endregion
26
+ export { setComboboxLocalizations as i, getComboboxId as n, hasTextSelection as r, getComboboxAutoComplete as t };
@@ -0,0 +1,46 @@
1
+ import { c as OuiFloatable } from "./floatable.model-DXsQgoU7.mjs";
2
+ import { _ as OptionListType, g as OptionListState, p as OptionListLocalizationValues } from "./option-list.model-CCPUlPeX.mjs";
3
+ //#region src/js/combobox/combobox.model.d.ts
4
+ type OuiComboboxAnchor = {
5
+ container?: Element;
6
+ element: HTMLElement;
7
+ };
8
+ type OuiComboboxFilter = {
9
+ element: HTMLInputElement;
10
+ value: string;
11
+ };
12
+ type OuiComboboxGroup = {
13
+ element: Element;
14
+ header: Element;
15
+ options: Element[];
16
+ };
17
+ type OuiComboboxLabel = {
18
+ element: HTMLLabelElement;
19
+ id: string;
20
+ };
21
+ type OuiComboboxLocalizations = OptionListLocalizationValues;
22
+ type OuiComboboxOptions = {
23
+ all: Element[];
24
+ selected: Element[];
25
+ };
26
+ type OuiComboboxSelection = {
27
+ container: Element;
28
+ items: OuiComboboxSelectionItem[];
29
+ };
30
+ type OuiComboboxSelectionItem = {
31
+ button: HTMLButtonElement;
32
+ element: Element;
33
+ };
34
+ type OuiComboboxState = OptionListState<OuiComboboxStateExtras, OuiComboboxLocalizations>;
35
+ type OuiComboboxStateExtras = {
36
+ anchor: OuiComboboxAnchor;
37
+ floatable: OuiFloatable;
38
+ selection?: OuiComboboxSelection;
39
+ type: OptionListType;
40
+ };
41
+ type OuiComboboxValues = {
42
+ current: string[];
43
+ initial: string[];
44
+ };
45
+ //#endregion
46
+ export { OuiComboboxLocalizations as a, OuiComboboxSelectionItem as c, OuiComboboxValues as d, OuiComboboxLabel as i, OuiComboboxState as l, OuiComboboxFilter as n, OuiComboboxOptions as o, OuiComboboxGroup as r, OuiComboboxSelection as s, OuiComboboxAnchor as t, OuiComboboxStateExtras as u };