@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.
- package/dist/css/color-picker.css +80 -69
- package/dist/css/listbox.css +169 -0
- package/dist/js/color-picker/color-picker.constants.d.mts +2 -2
- package/dist/js/color-picker/color-picker.constants.mjs +5 -3
- package/dist/js/color-picker/color-picker.dom.d.mts +1 -1
- package/dist/js/color-picker/color-picker.dom.mjs +31 -14
- package/dist/js/color-picker/color-picker.event.d.mts +2 -2
- package/dist/js/color-picker/color-picker.event.mjs +232 -1
- package/dist/js/color-picker/color-picker.form.d.mts +1 -1
- package/dist/js/color-picker/color-picker.form.mjs +1 -3
- package/dist/js/color-picker/color-picker.misc.d.mts +2 -2
- package/dist/js/color-picker/color-picker.misc.mjs +104 -2
- package/dist/js/color-picker/color-picker.model.d.mts +2 -2
- package/dist/js/color-picker/color-picker.output.d.mts +1 -1
- package/dist/js/color-picker/color-picker.output.mjs +7 -8
- package/dist/js/color-picker/color-picker.state.d.mts +1 -1
- package/dist/js/color-picker/color-picker.state.mjs +167 -1
- package/dist/js/color-picker/index.d.mts +7 -15
- package/dist/js/color-picker/index.mjs +11 -6
- package/dist/js/{color-picker.constants-D1mxw_Le.d.mts → color-picker.constants-BZgXQr5o.d.mts} +6 -8
- package/dist/js/{color-picker.misc-CtsXGrOe.d.mts → color-picker.misc-BIS3R6jk.d.mts} +8 -4
- package/dist/js/combobox/combobox.constants.d.mts +1 -1
- package/dist/js/combobox/combobox.dom.d.mts +12 -13
- package/dist/js/combobox/combobox.dom.mjs +15 -17
- package/dist/js/combobox/combobox.event.d.mts +8 -8
- package/dist/js/combobox/combobox.event.mjs +1 -1
- package/dist/js/combobox/combobox.misc.d.mts +2 -2
- package/dist/js/combobox/combobox.misc.mjs +2 -2
- package/dist/js/combobox/combobox.model.d.mts +2 -2
- package/dist/js/combobox/combobox.state.d.mts +3 -4
- package/dist/js/combobox/combobox.state.mjs +1 -1
- package/dist/js/combobox/index.d.mts +8 -19
- package/dist/js/combobox/index.mjs +21 -23
- package/dist/js/{combobox.constants-DZVkMP5g.d.mts → combobox.constants-Hb3bqqQJ.d.mts} +3 -3
- package/dist/js/combobox.misc-DRDFk6X8.d.mts +26 -0
- package/dist/js/combobox.model-gjEI2VqZ.d.mts +46 -0
- package/dist/js/{combobox.state-BfJ3Hxg8.mjs → combobox.state-AstCICiH.mjs} +30 -41
- package/dist/js/dialog/dialog.model.d.mts +1 -1
- package/dist/js/dialog/index.d.mts +1 -1
- package/dist/js/{dialog.model-DX2mndMh.d.mts → dialog.model-HVzYWoDo.d.mts} +3 -3
- package/dist/js/floatable/floatable.embedded.d.mts +1 -1
- package/dist/js/floatable/floatable.embedded.mjs +2 -2
- package/dist/js/floatable/floatable.standalone.d.mts +1 -1
- package/dist/js/{floatable.embedded-MeTyXjFn.d.mts → floatable.embedded-ncshL3Sa.d.mts} +3 -3
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.mjs +10 -9
- package/dist/js/focus-trap/focus-trap.model.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -2
- package/dist/js/{focus-trap.embedded-DIU05m1z.d.mts → focus-trap.embedded-DpcPkP7c.d.mts} +3 -3
- package/dist/js/{focus-trap.model-BeX6UYlw.d.mts → focus-trap.model-CpltX5B5.d.mts} +1 -1
- package/dist/js/index.d.mts +16 -16
- package/dist/js/index.mjs +3 -3
- package/dist/js/internal/attributable.d.mts +1 -1
- package/dist/js/internal/draggable/draggable.model.d.mts +1 -1
- package/dist/js/internal/draggable/index.d.mts +8 -8
- package/dist/js/internal/draggable/index.mjs +27 -18
- package/dist/js/internal/l10n/index.d.mts +5 -0
- package/dist/js/internal/l10n/index.mjs +147 -0
- package/dist/js/internal/l10n/l10n.model.d.mts +2 -0
- package/dist/js/{l10n → internal/l10n}/l10n.model.mjs +5 -2
- package/dist/js/internal/misc.d.mts +2 -2
- package/dist/js/internal/navigable/index.d.mts +3 -3
- package/dist/js/internal/navigable/index.mjs +1 -1
- package/dist/js/internal/navigable/navigable.model.d.mts +1 -1
- package/dist/js/internal/option-list/option-list.constants.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.constants.mjs +22 -0
- package/dist/js/internal/option-list/option-list.data.d.mts +21 -0
- package/dist/js/internal/option-list/option-list.data.mjs +2 -0
- package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
- package/dist/js/internal/option-list/option-list.dom.mjs +2 -0
- package/dist/js/internal/option-list/option-list.event.d.mts +6 -0
- package/dist/js/internal/{listbox/listbox.event.mjs → option-list/option-list.event.mjs} +7 -7
- package/dist/js/internal/option-list/option-list.form.d.mts +7 -0
- package/dist/js/internal/{listbox/listbox.form.mjs → option-list/option-list.form.mjs} +10 -13
- package/dist/js/internal/option-list/option-list.misc.d.mts +13 -0
- package/dist/js/internal/option-list/option-list.misc.mjs +2 -0
- package/dist/js/internal/option-list/option-list.model.d.mts +2 -0
- package/dist/js/internal/option-list/option-list.state.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.state.mjs +39 -0
- package/dist/js/l10n/index.d.mts +3 -9
- package/dist/js/l10n/index.mjs +2 -107
- package/dist/js/l10n.model-D1E1u35L.d.mts +54 -0
- package/dist/js/listbox/index.d.mts +6 -17
- package/dist/js/listbox/index.mjs +22 -23
- package/dist/js/listbox/{constants.listbox.d.mts → listbox.constants.d.mts} +1 -1
- package/dist/js/listbox/{constants.listbox.mjs → listbox.constants.mjs} +1 -1
- package/dist/js/listbox/listbox.dom.d.mts +5 -0
- package/dist/js/listbox/listbox.dom.mjs +2 -0
- package/dist/js/listbox/listbox.event.d.mts +9 -0
- package/dist/js/listbox/listbox.event.mjs +2 -0
- package/dist/js/listbox/listbox.misc.d.mts +2 -0
- package/dist/js/listbox/listbox.misc.mjs +2 -0
- package/dist/js/listbox/listbox.model.d.mts +2 -0
- package/dist/js/listbox/listbox.model.mjs +1 -0
- package/dist/js/listbox/listbox.state.d.mts +9 -0
- package/dist/js/listbox/listbox.state.mjs +2 -0
- package/dist/js/{constants.listbox-C5Ap6Ag_.d.mts → listbox.constants-DOBMwKup.d.mts} +3 -3
- package/dist/js/listbox.misc-DwfB4Mu_.d.mts +24 -0
- package/dist/js/listbox.model-C0MYWXZe.d.mts +20 -0
- package/dist/js/listbox.state-BrN296BM.mjs +240 -0
- package/dist/js/menu/index.mjs +7 -3
- package/dist/js/menu/menu.model.d.mts +7 -7
- package/dist/js/movable/movable.embedded.d.mts +1 -1
- package/dist/js/movable/movable.embedded.mjs +21 -18
- package/dist/js/movable/movable.model.d.mts +1 -1
- package/dist/js/movable/movable.standalone.d.mts +2 -2
- package/dist/js/{movable.embedded-DoyXLegc.d.mts → movable.embedded-C1bDTLGs.d.mts} +2 -2
- package/dist/js/{movable.model-BHaK_mKw.d.mts → movable.model-D9nnPWKk.d.mts} +41 -41
- package/dist/js/{navigable.model-BPOM8DZk.d.mts → navigable.model-BqoR6iBv.d.mts} +1 -1
- package/dist/js/{listbox.data-BQyZGKgr.mjs → option-list.data-CgMyUwPc.mjs} +70 -71
- package/dist/js/option-list.model-CCPUlPeX.d.mts +169 -0
- package/dist/js/popover/index.d.mts +2 -2
- package/dist/js/popover/index.mjs +1 -1
- package/dist/js/popover/popover.model.d.mts +1 -1
- package/dist/js/{popover.model-ubKNG612.d.mts → popover.model-DiLdz0Hc.d.mts} +4 -4
- package/dist/js/resizable/resizable.embedded.d.mts +1 -1
- package/dist/js/resizable/resizable.model.d.mts +1 -1
- package/dist/js/resizable/resizable.standalone.d.mts +2 -2
- package/dist/js/{resizable.embedded-Bf1qBUdt.d.mts → resizable.embedded-BemH-7Re.d.mts} +2 -2
- package/dist/js/{resizable.model-BwzJcTVJ.d.mts → resizable.model-YEtcC9li.d.mts} +3 -3
- package/dist/js/sortable/sortable.embedded.d.mts +1 -1
- package/dist/js/sortable/sortable.embedded.mjs +46 -38
- package/dist/js/sortable/sortable.model.d.mts +1 -1
- package/dist/js/sortable/sortable.standalone.d.mts +2 -2
- package/dist/js/{sortable.embedded-DzBKAwSG.d.mts → sortable.embedded-CrEGff9k.d.mts} +2 -2
- package/dist/js/splitter/index.d.mts +1 -1
- package/dist/js/splitter/splitter.model.d.mts +1 -1
- package/dist/js/{splitter.model-DOLNjLVS.d.mts → splitter.model-C24W6eZ7.d.mts} +2 -2
- package/dist/js/tabs/index.d.mts +2 -2
- package/dist/js/tabs/index.mjs +1 -1
- package/dist/js/tabs/tabs.model.d.mts +1 -1
- package/dist/js/{tabs.model-DRBX_JtI.d.mts → tabs.model-BHPy7fPo.d.mts} +1 -1
- package/dist/js/toolbar/toolbar.model.d.mts +2 -2
- package/dist/js/tooltip/index.d.mts +2 -2
- package/dist/js/tooltip/tooltip.model.d.mts +1 -1
- package/dist/js/{tooltip.model-DRkY_BsL.d.mts → tooltip.model-BpNStw5z.d.mts} +3 -3
- package/package.json +1 -1
- package/dist/js/color-picker.event-Cksj5TvS.mjs +0 -500
- package/dist/js/combobox.misc-C1tPZZDi.d.mts +0 -22
- package/dist/js/combobox.model-oDV06XCN.d.mts +0 -44
- package/dist/js/internal/listbox/listbox.constants.d.mts +0 -8
- package/dist/js/internal/listbox/listbox.constants.mjs +0 -22
- package/dist/js/internal/listbox/listbox.data.d.mts +0 -19
- package/dist/js/internal/listbox/listbox.data.mjs +0 -2
- package/dist/js/internal/listbox/listbox.dom.d.mts +0 -65
- package/dist/js/internal/listbox/listbox.dom.mjs +0 -2
- package/dist/js/internal/listbox/listbox.event.d.mts +0 -4
- package/dist/js/internal/listbox/listbox.form.d.mts +0 -5
- package/dist/js/internal/listbox/listbox.misc.d.mts +0 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +0 -2
- package/dist/js/internal/listbox/listbox.model.d.mts +0 -2
- package/dist/js/internal/listbox/listbox.state.d.mts +0 -6
- package/dist/js/internal/listbox/listbox.state.mjs +0 -39
- package/dist/js/l10n/l10n.model.d.mts +0 -2
- package/dist/js/l10n.model-D6a9frgl.d.mts +0 -26
- package/dist/js/listbox/event.listbox.d.mts +0 -7
- package/dist/js/listbox/event.listbox.mjs +0 -48
- package/dist/js/listbox/misc.listbox.d.mts +0 -2
- package/dist/js/listbox/misc.listbox.mjs +0 -2
- package/dist/js/listbox/state.listbox.d.mts +0 -9
- package/dist/js/listbox/state.listbox.mjs +0 -2
- package/dist/js/listbox.model-CuBOj4qe.d.mts +0 -129
- package/dist/js/misc.listbox-CjfBUbHD.mjs +0 -154
- package/dist/js/misc.listbox-CtoGvXQo.d.mts +0 -20
- /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
|
|
1
|
+
import { COLOR_PICKER_SYMBOL, COLOR_PICKER_TAGNAME } from "./color-picker.constants.mjs";
|
|
2
2
|
import { OuiColorPickerEvent } from "./color-picker.model.mjs";
|
|
3
|
-
import {
|
|
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:
|
|
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
|
package/dist/js/{color-picker.constants-D1mxw_Le.d.mts → color-picker.constants-BZgXQr5o.d.mts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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:
|
|
175
|
+
declare const colorPickerLocalizations: OuiDefaultLocalizations<OuiColorPickerLocalizations>;
|
|
178
176
|
//#endregion
|
|
179
|
-
export {
|
|
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 {
|
|
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
|
|
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-
|
|
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 {
|
|
2
|
-
import {
|
|
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?:
|
|
5
|
+
container?: Element;
|
|
7
6
|
element: HTMLElement;
|
|
8
7
|
selection?: OuiComboboxSelection;
|
|
9
8
|
};
|
|
10
9
|
type CreateSelectionItemsParameters = {
|
|
11
|
-
container:
|
|
10
|
+
container: Element;
|
|
12
11
|
items: OuiComboboxSelectionItem[];
|
|
13
|
-
options:
|
|
12
|
+
options: Element[];
|
|
14
13
|
state?: OuiComboboxState;
|
|
15
14
|
};
|
|
16
|
-
export declare function createComboboxAnchor(parameters:
|
|
17
|
-
export declare function createComboboxButton(parameters:
|
|
18
|
-
export declare function createComboboxContent(parameters:
|
|
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:
|
|
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?:
|
|
23
|
-
export declare function updateComboboxAutocomplete(preview:
|
|
24
|
-
export declare function updateComboboxSelection(state: OuiComboboxState, active:
|
|
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 {
|
|
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 =
|
|
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 =
|
|
61
|
-
const list =
|
|
62
|
-
const message =
|
|
63
|
-
const value =
|
|
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 :
|
|
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:
|
|
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(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
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:
|
|
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:
|
|
14
|
-
export declare function onComboboxPreview(preview:
|
|
15
|
-
export declare function onComboboxRemoveSelection(state: OuiComboboxState, item:
|
|
16
|
-
export declare function onComboboxNavigation(preview:
|
|
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-
|
|
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 {
|
|
2
|
-
export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations
|
|
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,
|
|
2
|
-
export { getComboboxAutoComplete, getComboboxId, hasTextSelection, setComboboxLocalizations
|
|
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
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
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-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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():
|
|
88
|
+
get selected(): Element[];
|
|
87
89
|
/**
|
|
88
90
|
* Type of combobox
|
|
89
91
|
*/
|
|
90
|
-
get type():
|
|
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 {
|
|
2
|
-
import {
|
|
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-
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
207
|
+
else attachOptionList(state, comboboxes, onAttachCombobox);
|
|
206
208
|
}
|
|
207
209
|
disconnectedCallback() {
|
|
208
210
|
const state = this[COMBOBOX_SYMBOL];
|
|
209
|
-
if (state.component != null)
|
|
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)
|
|
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
|
|
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 {
|
|
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<
|
|
7
|
+
declare const COMBOBOX_AUTOCOMPLETES: Set<OptionListAutoCompleteType>;
|
|
8
8
|
declare const COMBOBOX_SYMBOL: unique symbol;
|
|
9
|
-
declare const comboboxAttributes:
|
|
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 };
|