@oscarpalmer/oui 0.40.0 → 0.42.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 +14 -14
- 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 -2
- package/dist/js/combobox/combobox.misc.d.mts +2 -2
- package/dist/js/combobox/combobox.misc.mjs +1 -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 -2
- 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-Dv_h9Kns.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/floatable.standalone.mjs +1 -2
- 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/focus-trap.standalone.mjs +1 -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 +22 -0
- package/dist/js/internal/option-list/option-list.data.mjs +1 -0
- package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
- package/dist/js/internal/option-list/option-list.dom.mjs +1 -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 +1 -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 +1 -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 +1 -0
- package/dist/js/listbox/listbox.event.d.mts +9 -0
- package/dist/js/listbox/listbox.event.mjs +1 -0
- package/dist/js/listbox/listbox.misc.d.mts +2 -0
- package/dist/js/listbox/listbox.misc.mjs +1 -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 +1 -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 +10 -6
- 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/movable.standalone.mjs +1 -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.embedded.mjs +16 -7
- package/dist/js/resizable/resizable.model.d.mts +2 -2
- package/dist/js/resizable/resizable.model.mjs +4 -1
- package/dist/js/resizable/resizable.standalone.d.mts +2 -2
- package/dist/js/resizable/resizable.standalone.mjs +1 -2
- package/dist/js/{resizable.embedded-Bf1qBUdt.d.mts → resizable.embedded-D9mb-Wm_.d.mts} +2 -2
- package/dist/js/{resizable.model-BwzJcTVJ.d.mts → resizable.model-vCxaFdOA.d.mts} +10 -4
- 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/sortable.standalone.mjs +1 -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/index.mjs +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/index.mjs +1 -1
- 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 +3 -3
- 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,65 +0,0 @@
|
|
|
1
|
-
import { a as OuiListboxGroup, c as OuiListboxPreview, f as OuiListboxType, l as OuiListboxState, n as OuiListboxAutoComplete, s as OuiListboxOptions, t as OuiListboxAttributes } from "../../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
//#region src/js/internal/listbox/listbox.dom.d.ts
|
|
3
|
-
export type CreateListboxContent = {
|
|
4
|
-
element: HTMLDivElement;
|
|
5
|
-
filter?: CreateListboxFilter;
|
|
6
|
-
list: CreateListboxList;
|
|
7
|
-
message: HTMLDivElement;
|
|
8
|
-
value: HTMLSpanElement;
|
|
9
|
-
};
|
|
10
|
-
export type CreateListboxContentParameters = {
|
|
11
|
-
attributes: OuiListboxAttributes;
|
|
12
|
-
autocomplete: OuiListboxAutoComplete;
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
id: string;
|
|
15
|
-
label: HTMLLabelElement;
|
|
16
|
-
listbox: boolean;
|
|
17
|
-
multiple: boolean;
|
|
18
|
-
select: HTMLSelectElement;
|
|
19
|
-
type: OuiListboxType;
|
|
20
|
-
};
|
|
21
|
-
export type CreateListboxFilter = {
|
|
22
|
-
container: HTMLElement;
|
|
23
|
-
element: HTMLInputElement;
|
|
24
|
-
};
|
|
25
|
-
type CreateListboxGroupParameters = {
|
|
26
|
-
group: HTMLOptGroupElement;
|
|
27
|
-
groupOptions: HTMLOptionElement[];
|
|
28
|
-
original: CreateListboxContentParameters;
|
|
29
|
-
selected: HTMLElement[];
|
|
30
|
-
type: OuiListboxType;
|
|
31
|
-
};
|
|
32
|
-
export type CreateListboxList = {
|
|
33
|
-
element: HTMLUListElement;
|
|
34
|
-
groups?: OuiListboxGroup[];
|
|
35
|
-
options: OuiListboxOptions;
|
|
36
|
-
};
|
|
37
|
-
type CreateListboxOptionParameters = {
|
|
38
|
-
group?: string;
|
|
39
|
-
index: number;
|
|
40
|
-
option: HTMLOptionElement;
|
|
41
|
-
original: CreateListboxContentParameters;
|
|
42
|
-
type: OuiListboxType;
|
|
43
|
-
};
|
|
44
|
-
type CreateListboxOptionsParameters = {
|
|
45
|
-
group?: string;
|
|
46
|
-
list: HTMLElement;
|
|
47
|
-
options: HTMLOptionElement[];
|
|
48
|
-
original: CreateListboxContentParameters;
|
|
49
|
-
selected: HTMLElement[];
|
|
50
|
-
type: OuiListboxType;
|
|
51
|
-
};
|
|
52
|
-
export declare function createListboxContent(parameters: CreateListboxContentParameters): CreateListboxContent;
|
|
53
|
-
export declare function createListboxFilter(parameters: CreateListboxContentParameters): CreateListboxFilter | undefined;
|
|
54
|
-
export declare function createListboxGroup(parameters: CreateListboxGroupParameters): OuiListboxGroup;
|
|
55
|
-
export declare function createListboxHeader(parameters: CreateListboxGroupParameters, group: HTMLOptGroupElement): HTMLElement;
|
|
56
|
-
export declare function createListboxInput(parameters: CreateListboxContentParameters, value: string): HTMLInputElement;
|
|
57
|
-
export declare function createListboxList(parameters: CreateListboxContentParameters): CreateListboxList;
|
|
58
|
-
export declare function createListboxMessage(attribute: string): HTMLDivElement;
|
|
59
|
-
export declare function createListboxOption(parameters: CreateListboxOptionParameters): HTMLElement;
|
|
60
|
-
export declare function createListboxOptions(parameters: CreateListboxOptionsParameters): HTMLElement[];
|
|
61
|
-
export declare function createListboxValueLabel(id: string): HTMLSpanElement;
|
|
62
|
-
export declare function updateListboxMessage(state: OuiListboxState): void;
|
|
63
|
-
export declare function updateListboxPreview<State extends OuiListboxState>(preview: OuiListboxPreview, state: State, active?: HTMLElement, scroll?: boolean): void;
|
|
64
|
-
export declare function updateListboxValueLabel<State extends OuiListboxState>(state: State): void;
|
|
65
|
-
//#endregion
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { _ as createListboxValueLabel, b as updateListboxValueLabel, c as createListboxContent, d as createListboxHeader, f as createListboxInput, g as createListboxOptions, h as createListboxOption, l as createListboxFilter, m as createListboxMessage, p as createListboxList, u as createListboxGroup, v as updateListboxMessage, y as updateListboxPreview } from "../../listbox.data-BQyZGKgr.mjs";
|
|
2
|
-
export { createListboxContent, createListboxFilter, createListboxGroup, createListboxHeader, createListboxInput, createListboxList, createListboxMessage, createListboxOption, createListboxOptions, createListboxValueLabel, updateListboxMessage, updateListboxPreview, updateListboxValueLabel };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
//#region src/js/internal/listbox/listbox.form.d.ts
|
|
3
|
-
export declare function updateListboxForm<State extends OuiListboxState>(state: State, values: string[], emit?: boolean): void;
|
|
4
|
-
export declare function updateListboxValidity(state: OuiListboxState): void;
|
|
5
|
-
//#endregion
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
//#region src/js/internal/listbox/listbox.misc.d.ts
|
|
3
|
-
export declare function generateListboxIds(prefix: string, select: HTMLSelectElement): void;
|
|
4
|
-
export declare function getListboxVisibleOptions(state: OuiListboxState): HTMLElement[];
|
|
5
|
-
export declare function setListboxDisabled<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
6
|
-
export declare function setListboxFilter<State extends OuiListboxState>(state: State, value: unknown): void;
|
|
7
|
-
export declare function setListboxLimit<State extends OuiListboxState>(type: "max" | "min", state: State, value?: unknown): void;
|
|
8
|
-
export declare function setListboxMultiple(element: HTMLElement, value: boolean): void;
|
|
9
|
-
export declare function setListboxReadonly<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
10
|
-
export declare function setListboxRequired<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
11
|
-
//#endregion
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { C as setListboxDisabled, D as setListboxReadonly, E as setListboxMultiple, O as setListboxRequired, S as getListboxVisibleOptions, T as setListboxLimit, w as setListboxFilter, x as generateListboxIds } from "../../listbox.data-BQyZGKgr.mjs";
|
|
2
|
-
export { generateListboxIds, getListboxVisibleOptions, setListboxDisabled, setListboxFilter, setListboxLimit, setListboxMultiple, setListboxReadonly, setListboxRequired };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as OuiListboxGroup, c as OuiListboxPreview, d as OuiListboxStateForm, f as OuiListboxType, i as OuiListboxCallbacks, l as OuiListboxState, n as OuiListboxAutoComplete, o as OuiListboxLocalizations, r as OuiListboxAutoCompleteType, s as OuiListboxOptions, t as OuiListboxAttributes, u as OuiListboxStateComponent } from "../../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
export { OuiListboxAttributes, OuiListboxAutoComplete, OuiListboxAutoCompleteType, OuiListboxCallbacks, OuiListboxGroup, OuiListboxLocalizations, OuiListboxOptions, OuiListboxPreview, OuiListboxState, OuiListboxStateComponent, OuiListboxStateForm, OuiListboxType };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
//#region src/js/internal/listbox/listbox.state.d.ts
|
|
3
|
-
export declare function attachListbox<State extends OuiListboxState>(state: State, set: Set<State>, onAttach: (state: State) => void): void;
|
|
4
|
-
export declare function detachListbox<State extends OuiListboxState>(state: State, set: Set<State>, onDetach: (state: State) => void): void;
|
|
5
|
-
export declare function initializeListboxState<State extends OuiListboxState>(state: State, set: Set<State>, onAttach: (state: State) => void): State;
|
|
6
|
-
//#endregion
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { updateListboxForm } from "./listbox.form.mjs";
|
|
2
|
-
import { C as setListboxDisabled, D as setListboxReadonly, E as setListboxMultiple, O as setListboxRequired, T as setListboxLimit, b as updateListboxValueLabel, i as filterListboxOptions, v as updateListboxMessage, y as updateListboxPreview } from "../../listbox.data-BQyZGKgr.mjs";
|
|
3
|
-
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
4
|
-
//#region src/js/internal/listbox/listbox.state.ts
|
|
5
|
-
function attachListbox(state, set, onAttach) {
|
|
6
|
-
const { filter, id, label } = state.component;
|
|
7
|
-
label.element.htmlFor = filter.element.id;
|
|
8
|
-
label.element.id = `${id}_label`;
|
|
9
|
-
onAttach(state);
|
|
10
|
-
set.add(state);
|
|
11
|
-
}
|
|
12
|
-
function detachListbox(state, set, onDetach) {
|
|
13
|
-
const { label, select } = state.component;
|
|
14
|
-
const listeners = state.component.listeners.splice(0);
|
|
15
|
-
const { length } = listeners;
|
|
16
|
-
for (let index = 0; index < length; index += 1) listeners[index]();
|
|
17
|
-
label.element.htmlFor = select.id;
|
|
18
|
-
label.element.id = label.id;
|
|
19
|
-
onDetach(state);
|
|
20
|
-
set.delete(state);
|
|
21
|
-
}
|
|
22
|
-
function initializeListboxState(state, set, onAttach) {
|
|
23
|
-
const { component } = state;
|
|
24
|
-
attachListbox(state, set, onAttach);
|
|
25
|
-
setListboxDisabled(state, component.disabled);
|
|
26
|
-
setListboxLimit("max", state, getAttribute(component.host, "max"));
|
|
27
|
-
setListboxLimit("min", state, getAttribute(component.host, "min"));
|
|
28
|
-
setListboxMultiple(component.host, component.multiple);
|
|
29
|
-
setListboxReadonly(state, component.readonly);
|
|
30
|
-
setListboxRequired(state, component.required);
|
|
31
|
-
filterListboxOptions(state);
|
|
32
|
-
updateListboxForm(state, component.values.current, false);
|
|
33
|
-
updateListboxMessage(state);
|
|
34
|
-
updateListboxValueLabel(state);
|
|
35
|
-
if (component.options.selected.length > 0) updateListboxPreview("none", state, component.options.selected[0], false);
|
|
36
|
-
return state;
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
export { attachListbox, detachListbox, initializeListboxState };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as L10N_MESSAGE_OBJECT_UPDATE, c as OuiLocalizations, i as L10N_MESSAGE_OBJECT_CREATE, l as OuiLocalizationsState, n as L10N_MESSAGE_ITEM_UPDATE_KEY, o as L10N_SYMBOL, r as L10N_MESSAGE_ITEM_UPDATE_VALUE, s as OuiLocalizationParameters, t as L10N_MESSAGE_ITEM_CREATE, u as OuiLocalizationsValues } from "../l10n.model-D6a9frgl.mjs";
|
|
2
|
-
export { L10N_MESSAGE_ITEM_CREATE, L10N_MESSAGE_ITEM_UPDATE_KEY, L10N_MESSAGE_ITEM_UPDATE_VALUE, L10N_MESSAGE_OBJECT_CREATE, L10N_MESSAGE_OBJECT_UPDATE, L10N_SYMBOL, OuiLocalizationParameters, OuiLocalizations, OuiLocalizationsState, OuiLocalizationsValues };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { GenericCallback } from "@oscarpalmer/atoms/models";
|
|
2
|
-
//#region src/js/l10n/l10n.model.d.ts
|
|
3
|
-
type OuiLocalizationParameters<Localization> = Localization extends GenericCallback ? Parameters<Localization> : never;
|
|
4
|
-
type OuiLocalizations<Localizations extends OuiLocalizationsValues> = {
|
|
5
|
-
[L10N_SYMBOL]: OuiLocalizationsState<Localizations>;
|
|
6
|
-
get defaults(): Localizations;
|
|
7
|
-
get keys(): Set<keyof Localizations>;
|
|
8
|
-
get values(): Record<string, Partial<Localizations>>;
|
|
9
|
-
get<Key extends keyof Localizations>(element: Element, key: Key, localizations: Record<string, Partial<Localizations>>): string | GenericCallback;
|
|
10
|
-
set(language: string, localizations: Partial<Localizations>): void;
|
|
11
|
-
set(localizations: Record<string, Partial<Localizations>>): void;
|
|
12
|
-
};
|
|
13
|
-
type OuiLocalizationsState<Localizations extends OuiLocalizationsValues> = {
|
|
14
|
-
readonly defaults: Localizations;
|
|
15
|
-
readonly keys: Set<string>;
|
|
16
|
-
readonly values: Record<string, Partial<Localizations>>;
|
|
17
|
-
};
|
|
18
|
-
type OuiLocalizationsValues = Record<string, string | GenericCallback>;
|
|
19
|
-
declare const L10N_MESSAGE_ITEM_CREATE = "Localization item must be a string or a function.";
|
|
20
|
-
declare const L10N_MESSAGE_ITEM_UPDATE_KEY = "Localization item key must be known.";
|
|
21
|
-
declare const L10N_MESSAGE_ITEM_UPDATE_VALUE = "Localization item value must be a string or a function.";
|
|
22
|
-
declare const L10N_MESSAGE_OBJECT_CREATE = "Default localizations must be a non-empty plain object.";
|
|
23
|
-
declare const L10N_MESSAGE_OBJECT_UPDATE = "Localizations update object must be a plain object.";
|
|
24
|
-
declare const L10N_SYMBOL: unique symbol;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { L10N_MESSAGE_OBJECT_UPDATE as a, OuiLocalizations as c, L10N_MESSAGE_OBJECT_CREATE as i, OuiLocalizationsState as l, L10N_MESSAGE_ITEM_UPDATE_KEY as n, L10N_SYMBOL as o, L10N_MESSAGE_ITEM_UPDATE_VALUE as r, OuiLocalizationParameters as s, L10N_MESSAGE_ITEM_CREATE as t, OuiLocalizationsValues as u };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { c as OuiListboxPreview, l as OuiListboxState } from "../listbox.model-CuBOj4qe.mjs";
|
|
2
|
-
//#region src/js/listbox/event.listbox.d.ts
|
|
3
|
-
export declare function onListboxEnter(state: OuiListboxState): void;
|
|
4
|
-
export declare function onListboxFilter(preview: OuiListboxPreview, state: OuiListboxState, _: boolean, active?: HTMLElement): void;
|
|
5
|
-
export declare function onListboxNavigation(preview: OuiListboxPreview, state: OuiListboxState, active?: HTMLElement): void;
|
|
6
|
-
export declare function onListboxToggle(state: OuiListboxState): void;
|
|
7
|
-
//#endregion
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { n as filterListbox, s as toggleListboxOption, t as applyListboxSelection, y as updateListboxPreview } from "../listbox.data-BQyZGKgr.mjs";
|
|
2
|
-
import { processListboxKeydown } from "../internal/listbox/listbox.event.mjs";
|
|
3
|
-
import { LISTBOX_SYMBOL, LISTBOX_TAGNAME, listboxSelectors } from "./constants.listbox.mjs";
|
|
4
|
-
import { on } from "@oscarpalmer/toretto/event";
|
|
5
|
-
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
6
|
-
//#region src/js/listbox/event.listbox.ts
|
|
7
|
-
function onListboxClick(event) {
|
|
8
|
-
const listbox = findAncestor(event, LISTBOX_TAGNAME);
|
|
9
|
-
const state = listbox?.[LISTBOX_SYMBOL];
|
|
10
|
-
if (listbox == null || state == null) return;
|
|
11
|
-
const option = findAncestor(event, listboxSelectors.option);
|
|
12
|
-
if (option == null) return;
|
|
13
|
-
const { disabled, filter, readonly } = state.component;
|
|
14
|
-
if (disabled) filter.element.focus();
|
|
15
|
-
else if (readonly) updateListboxPreview("none", state, option, false);
|
|
16
|
-
else toggleListboxOption(state, option);
|
|
17
|
-
}
|
|
18
|
-
function onListboxEnter(state) {
|
|
19
|
-
if (!state.component.disabled && !state.component.readonly) toggleListboxOption(state, state.component.active);
|
|
20
|
-
}
|
|
21
|
-
function onListboxFilter(preview, state, _, active) {
|
|
22
|
-
updateListboxPreview(preview, state, active);
|
|
23
|
-
}
|
|
24
|
-
function onListboxInput(event) {
|
|
25
|
-
const state = findAncestor(event, LISTBOX_TAGNAME)?.[LISTBOX_SYMBOL];
|
|
26
|
-
if (state?.component.filter.element === event.target) filterListbox(event.inputType, state);
|
|
27
|
-
}
|
|
28
|
-
function onListboxKeydown(event) {
|
|
29
|
-
const state = findAncestor(event, LISTBOX_TAGNAME)?.[LISTBOX_SYMBOL];
|
|
30
|
-
if (state?.component.filter.element === event.target) processListboxKeydown(event, state);
|
|
31
|
-
}
|
|
32
|
-
function onListboxNavigation(preview, state, active) {
|
|
33
|
-
if (state.component.multiple || state.component.readonly) updateListboxPreview(preview, state, active);
|
|
34
|
-
else applyListboxSelection({
|
|
35
|
-
state,
|
|
36
|
-
option: active,
|
|
37
|
-
added: true,
|
|
38
|
-
selected: active == null ? [] : [active]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function onListboxToggle(state) {
|
|
42
|
-
state.component.filter.element.focus();
|
|
43
|
-
}
|
|
44
|
-
on(document, "click", onListboxClick);
|
|
45
|
-
on(document, "input", onListboxInput);
|
|
46
|
-
on(document, "keydown", onListboxKeydown, { passive: false });
|
|
47
|
-
//#endregion
|
|
48
|
-
export { onListboxEnter, onListboxFilter, onListboxNavigation, onListboxToggle };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { c as OuiLocalizations } from "../l10n.model-D6a9frgl.mjs";
|
|
2
|
-
import { l as OuiListboxState, o as OuiListboxLocalizations } from "../listbox.model-CuBOj4qe.mjs";
|
|
3
|
-
//#region src/js/listbox/state.listbox.d.ts
|
|
4
|
-
export declare function initializeListbox(element: HTMLElement, state: OuiListboxState): void;
|
|
5
|
-
export declare function onAttachListbox(state: OuiListboxState): void;
|
|
6
|
-
export declare function onDetachListbox(state: OuiListboxState): void;
|
|
7
|
-
export declare const listboxLocalizations: OuiLocalizations<OuiListboxLocalizations>;
|
|
8
|
-
export declare const listboxes: Set<OuiListboxState>;
|
|
9
|
-
//#endregion
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { c as OuiLocalizations, u as OuiLocalizationsValues } from "./l10n.model-D6a9frgl.mjs";
|
|
2
|
-
import { PlainObject } from "@oscarpalmer/atoms/models";
|
|
3
|
-
import { RemovableEventListener } from "@oscarpalmer/toretto/models";
|
|
4
|
-
//#region src/js/internal/listbox/listbox.model.d.ts
|
|
5
|
-
type OuiListboxAttributes = {
|
|
6
|
-
active: string;
|
|
7
|
-
content: string;
|
|
8
|
-
empty: string;
|
|
9
|
-
filter: string;
|
|
10
|
-
group: string;
|
|
11
|
-
header: string;
|
|
12
|
-
hidden: string;
|
|
13
|
-
input: string;
|
|
14
|
-
list: string;
|
|
15
|
-
message: string;
|
|
16
|
-
option: string;
|
|
17
|
-
};
|
|
18
|
-
type OuiListboxAutoComplete = Record<OuiListboxAutoCompleteType, boolean> & {
|
|
19
|
-
value?: OuiListboxAutoCompleteType;
|
|
20
|
-
};
|
|
21
|
-
type OuiListboxAutoCompleteType = "both" | "inline" | "list" | "none";
|
|
22
|
-
type OuiListboxCallbacks<State extends OuiListboxState = OuiListboxState> = {
|
|
23
|
-
data: OuiListboxCallbacksData<State>;
|
|
24
|
-
keydown: OuiListboxCallbacksKeydown<State>;
|
|
25
|
-
};
|
|
26
|
-
type OuiListboxCallbacksData<State extends OuiListboxState = OuiListboxState> = {
|
|
27
|
-
onApply: OuiListboxCallbacksDataOnApply<State>;
|
|
28
|
-
onFilter: OuiListboxCallbacksDataOnFilter<State>;
|
|
29
|
-
onForm: (state: State) => void;
|
|
30
|
-
onPreview: OuiListboxCallbacksDataOnPreview<State>;
|
|
31
|
-
onToggle: (state: State) => void;
|
|
32
|
-
};
|
|
33
|
-
type OuiListboxCallbacksDataOnApply<State extends OuiListboxState = OuiListboxState> = (state: State, option: HTMLElement | undefined, values: string[], added: boolean, selected?: HTMLElement[], emit?: boolean) => void;
|
|
34
|
-
type OuiListboxCallbacksDataOnFilter<State extends OuiListboxState = OuiListboxState> = (preview: OuiListboxPreview, state: State, update: boolean, active?: HTMLElement, emit?: boolean) => void;
|
|
35
|
-
type OuiListboxCallbacksDataOnPreview<State extends OuiListboxState = OuiListboxState> = (preview: OuiListboxPreview, state: State, active?: HTMLElement) => void;
|
|
36
|
-
type OuiListboxCallbacksKeydown<State extends OuiListboxState = OuiListboxState> = {
|
|
37
|
-
onActivation?: (state: State) => void;
|
|
38
|
-
onEnter?: (state: State) => void;
|
|
39
|
-
onEscape?: (state: State) => void;
|
|
40
|
-
onNavigation: OuiListboxCallbacksDataOnNavigation<State>;
|
|
41
|
-
onSelection?: (state: State) => void;
|
|
42
|
-
onTab?: (state: State) => void;
|
|
43
|
-
onToggle?: (state: State) => void;
|
|
44
|
-
preventActivation?: (state: State) => boolean;
|
|
45
|
-
skipNavigation?: (state: State) => boolean;
|
|
46
|
-
};
|
|
47
|
-
type OuiListboxCallbacksDataOnNavigation<State extends OuiListboxState = OuiListboxState> = (preview: OuiListboxPreview, state: State, active?: HTMLElement) => void;
|
|
48
|
-
type OuiListboxFilter = {
|
|
49
|
-
element: HTMLInputElement;
|
|
50
|
-
value: string;
|
|
51
|
-
};
|
|
52
|
-
type OuiListboxFooter = {
|
|
53
|
-
container: HTMLElement;
|
|
54
|
-
message: HTMLElement;
|
|
55
|
-
};
|
|
56
|
-
type OuiListboxGroup = {
|
|
57
|
-
element: HTMLElement;
|
|
58
|
-
header: HTMLElement;
|
|
59
|
-
options: HTMLElement[];
|
|
60
|
-
};
|
|
61
|
-
type OuiListboxLabel = {
|
|
62
|
-
element: HTMLLabelElement;
|
|
63
|
-
id: string;
|
|
64
|
-
};
|
|
65
|
-
type OuiListboxLocalization<Localizations extends OuiLocalizationsValues> = {
|
|
66
|
-
component: Record<string, Partial<Localizations>>;
|
|
67
|
-
global: OuiLocalizations<Localizations>;
|
|
68
|
-
};
|
|
69
|
-
type OuiListboxLocalizations = {
|
|
70
|
-
empty: string | (() => string);
|
|
71
|
-
input: string | (() => string);
|
|
72
|
-
invalid: string | (() => string);
|
|
73
|
-
max: string | ((max: number) => string);
|
|
74
|
-
min: string | ((min: number) => string);
|
|
75
|
-
remove: string | ((label: string, value: string) => string);
|
|
76
|
-
results: string | ((amount: number) => string);
|
|
77
|
-
selected: string | ((amount: number) => string);
|
|
78
|
-
};
|
|
79
|
-
type OuiListboxOptions = {
|
|
80
|
-
all: HTMLElement[];
|
|
81
|
-
selected: HTMLElement[];
|
|
82
|
-
};
|
|
83
|
-
type OuiListboxPreview = "none" | "set" | "typed";
|
|
84
|
-
type OuiListboxState<State extends PlainObject = PlainObject> = {
|
|
85
|
-
component: OuiListboxStateComponent<State>;
|
|
86
|
-
form: OuiListboxStateForm;
|
|
87
|
-
};
|
|
88
|
-
type OuiListboxStateComponent<State extends PlainObject> = {
|
|
89
|
-
active?: HTMLElement;
|
|
90
|
-
attributes: OuiListboxAttributes;
|
|
91
|
-
autocomplete: OuiListboxAutoComplete;
|
|
92
|
-
callbacks: OuiListboxCallbacks;
|
|
93
|
-
content: HTMLDivElement;
|
|
94
|
-
disabled: boolean;
|
|
95
|
-
elements: Array<HTMLElement | undefined>;
|
|
96
|
-
filter: OuiListboxFilter;
|
|
97
|
-
footer?: OuiListboxFooter;
|
|
98
|
-
groups?: OuiListboxGroup[];
|
|
99
|
-
host: HTMLElement;
|
|
100
|
-
id: string;
|
|
101
|
-
label: OuiListboxLabel;
|
|
102
|
-
list: HTMLUListElement;
|
|
103
|
-
listbox: boolean;
|
|
104
|
-
listeners: RemovableEventListener[];
|
|
105
|
-
localizations: OuiListboxLocalization<OuiListboxLocalizations>;
|
|
106
|
-
max?: number;
|
|
107
|
-
min?: number;
|
|
108
|
-
message: HTMLElement;
|
|
109
|
-
multiple: boolean;
|
|
110
|
-
name: string;
|
|
111
|
-
options: OuiListboxOptions;
|
|
112
|
-
readonly: boolean;
|
|
113
|
-
required: boolean;
|
|
114
|
-
select: HTMLSelectElement;
|
|
115
|
-
type: OuiListboxType;
|
|
116
|
-
values: OuiListboxValues;
|
|
117
|
-
} & State;
|
|
118
|
-
type OuiListboxStateForm = {
|
|
119
|
-
internals: ElementInternals;
|
|
120
|
-
restored?: unknown[];
|
|
121
|
-
};
|
|
122
|
-
type OuiListboxType = "autocomplete" | "select";
|
|
123
|
-
type OuiListboxValues = {
|
|
124
|
-
current: string[];
|
|
125
|
-
initial: string[];
|
|
126
|
-
label: HTMLElement;
|
|
127
|
-
};
|
|
128
|
-
//#endregion
|
|
129
|
-
export { OuiListboxGroup as a, OuiListboxPreview as c, OuiListboxStateForm as d, OuiListboxType as f, OuiListboxCallbacks as i, OuiListboxState as l, OuiListboxAutoComplete as n, OuiListboxLocalizations as o, OuiListboxAutoCompleteType as r, OuiListboxOptions as s, OuiListboxAttributes as t, OuiListboxStateComponent as u };
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { createLocalizations, updateLocalizations } from "./l10n/index.mjs";
|
|
2
|
-
import { getBooleanAriaValue } from "./internal/misc.mjs";
|
|
3
|
-
import { b as updateListboxValueLabel, c as createListboxContent, o as setListboxValues, v as updateListboxMessage, x as generateListboxIds } from "./listbox.data-BQyZGKgr.mjs";
|
|
4
|
-
import { initializeListboxState } from "./internal/listbox/listbox.state.mjs";
|
|
5
|
-
import { listboxAttributes, listboxMessages } from "./listbox/constants.listbox.mjs";
|
|
6
|
-
import { onListboxEnter, onListboxFilter, onListboxNavigation, onListboxToggle } from "./listbox/event.listbox.mjs";
|
|
7
|
-
import { setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
8
|
-
import { noop } from "@oscarpalmer/atoms/function";
|
|
9
|
-
import { getData } from "@oscarpalmer/toretto/data";
|
|
10
|
-
//#region src/js/listbox/state.listbox.ts
|
|
11
|
-
function createComponentState(element, state) {
|
|
12
|
-
const select = element.querySelector("select");
|
|
13
|
-
if (select == null) throw new Error(listboxMessages.select);
|
|
14
|
-
const label = element.querySelector(`label[for="${select.id}"]`);
|
|
15
|
-
if (label == null) throw new Error(listboxMessages.label);
|
|
16
|
-
element.id = select.id;
|
|
17
|
-
const disabled = getBooleanAriaValue(element, "disabled") || select.disabled;
|
|
18
|
-
const multiple = element.multiple || select.multiple;
|
|
19
|
-
const readonly = getBooleanAriaValue(element, "readonly");
|
|
20
|
-
const required = getBooleanAriaValue(element, "required") || select.required;
|
|
21
|
-
setAttributes(element, {
|
|
22
|
-
autocomplete: "none",
|
|
23
|
-
name: select.name === "" ? select.id : select.name
|
|
24
|
-
});
|
|
25
|
-
const id = getListboxId();
|
|
26
|
-
const labelId = label.id;
|
|
27
|
-
label.htmlFor = id;
|
|
28
|
-
label.id = `${id}_label`;
|
|
29
|
-
generateListboxIds(id, select);
|
|
30
|
-
const type = "select";
|
|
31
|
-
const content = createListboxContent({
|
|
32
|
-
element,
|
|
33
|
-
id,
|
|
34
|
-
label,
|
|
35
|
-
multiple,
|
|
36
|
-
select,
|
|
37
|
-
type,
|
|
38
|
-
attributes: listboxAttributes,
|
|
39
|
-
autocomplete: listboxAutoComplete,
|
|
40
|
-
listbox: true
|
|
41
|
-
});
|
|
42
|
-
const { selected } = content.list.options;
|
|
43
|
-
const values = selected.length === 0 ? [""] : selected.map((option) => getData(option, "value", false) ?? "");
|
|
44
|
-
state.component = {
|
|
45
|
-
disabled,
|
|
46
|
-
id,
|
|
47
|
-
multiple,
|
|
48
|
-
readonly,
|
|
49
|
-
required,
|
|
50
|
-
select,
|
|
51
|
-
type,
|
|
52
|
-
active: selected[0],
|
|
53
|
-
attributes: listboxAttributes,
|
|
54
|
-
autocomplete: listboxAutoComplete,
|
|
55
|
-
callbacks: listboxCallbacks,
|
|
56
|
-
content: content.element,
|
|
57
|
-
elements: [element, content.filter.element],
|
|
58
|
-
filter: {
|
|
59
|
-
element: content.filter.element,
|
|
60
|
-
value: ""
|
|
61
|
-
},
|
|
62
|
-
host: element,
|
|
63
|
-
label: {
|
|
64
|
-
id: labelId,
|
|
65
|
-
element: label
|
|
66
|
-
},
|
|
67
|
-
list: content.list.element,
|
|
68
|
-
listeners: [],
|
|
69
|
-
listbox: true,
|
|
70
|
-
localizations: {
|
|
71
|
-
component: {},
|
|
72
|
-
global: listboxLocalizations
|
|
73
|
-
},
|
|
74
|
-
message: content.message,
|
|
75
|
-
name: element.name,
|
|
76
|
-
options: content.list.options,
|
|
77
|
-
values: {
|
|
78
|
-
current: values.slice(),
|
|
79
|
-
initial: values.slice(),
|
|
80
|
-
label: content.value
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
return initializeListboxState(state, listboxes, onAttachListbox);
|
|
84
|
-
}
|
|
85
|
-
function initializeListbox(element, state) {
|
|
86
|
-
createComponentState(element, state);
|
|
87
|
-
if (state.form.restored != null) {
|
|
88
|
-
setListboxValues(state, state.form.restored);
|
|
89
|
-
state.form.restored = void 0;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function onAttachListbox(state) {
|
|
93
|
-
const { content, select } = state.component;
|
|
94
|
-
select.hidden = true;
|
|
95
|
-
select.insertAdjacentElement("afterend", content);
|
|
96
|
-
select.remove();
|
|
97
|
-
}
|
|
98
|
-
function onDetachListbox(state) {
|
|
99
|
-
const { content, select } = state.component;
|
|
100
|
-
content.insertAdjacentElement("beforebegin", select);
|
|
101
|
-
content.remove();
|
|
102
|
-
select.hidden = false;
|
|
103
|
-
}
|
|
104
|
-
const listboxAutoComplete = {
|
|
105
|
-
both: false,
|
|
106
|
-
inline: false,
|
|
107
|
-
list: false,
|
|
108
|
-
none: true
|
|
109
|
-
};
|
|
110
|
-
const listboxCallbacks = {
|
|
111
|
-
data: {
|
|
112
|
-
onApply: noop,
|
|
113
|
-
onFilter: onListboxFilter,
|
|
114
|
-
onForm: noop,
|
|
115
|
-
onPreview: noop,
|
|
116
|
-
onToggle: onListboxToggle
|
|
117
|
-
},
|
|
118
|
-
keydown: {
|
|
119
|
-
onEnter: onListboxEnter,
|
|
120
|
-
onNavigation: onListboxNavigation,
|
|
121
|
-
onToggle: onListboxToggle
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const listboxLocalizations = createLocalizations({
|
|
125
|
-
empty: "No results found",
|
|
126
|
-
input: "",
|
|
127
|
-
invalid: "Please select an option from the list",
|
|
128
|
-
max: (max) => `Please select fewer options (maximum is ${max})`,
|
|
129
|
-
min: (min) => `Please select more options (minimum is ${min})`,
|
|
130
|
-
remove: "",
|
|
131
|
-
results: (amount) => `${amount} results available`,
|
|
132
|
-
selected: (amount) => `${amount} selected`
|
|
133
|
-
});
|
|
134
|
-
const listboxes = /* @__PURE__ */ new Set();
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/js/listbox/misc.listbox.ts
|
|
137
|
-
function getListboxId() {
|
|
138
|
-
index += 1;
|
|
139
|
-
return `oui_listbox_${index}`;
|
|
140
|
-
}
|
|
141
|
-
function setListboxLocalizations(first, second) {
|
|
142
|
-
updateListboxLocalizations(listboxLocalizations, listboxLocalizations.values, first, second);
|
|
143
|
-
}
|
|
144
|
-
function updateListboxLocalizations(instance, destination, first, second) {
|
|
145
|
-
updateLocalizations(instance, typeof first === "string" ? { [first]: second } : first, destination, () => {
|
|
146
|
-
for (const state of listboxes) {
|
|
147
|
-
updateListboxMessage(state);
|
|
148
|
-
updateListboxValueLabel(state);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
let index = 0;
|
|
153
|
-
//#endregion
|
|
154
|
-
export { listboxLocalizations as a, onDetachListbox as c, initializeListbox as i, setListboxLocalizations as n, listboxes as o, updateListboxLocalizations as r, onAttachListbox as s, getListboxId as t };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { c as OuiLocalizations } from "./l10n.model-D6a9frgl.mjs";
|
|
2
|
-
import { o as OuiListboxLocalizations } from "./listbox.model-CuBOj4qe.mjs";
|
|
3
|
-
//#region src/js/listbox/misc.listbox.d.ts
|
|
4
|
-
declare function getListboxId(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Set listbox localizations for a specific language
|
|
7
|
-
*
|
|
8
|
-
* @param language Language code
|
|
9
|
-
* @param localizations Localizations for language
|
|
10
|
-
*/
|
|
11
|
-
declare function setListboxLocalizations(language: string, localizations: Partial<OuiListboxLocalizations>): void;
|
|
12
|
-
/**
|
|
13
|
-
* Set listbox localizations for one or more languages
|
|
14
|
-
*
|
|
15
|
-
* @param localizations Localizations for one or more languages
|
|
16
|
-
*/
|
|
17
|
-
declare function setListboxLocalizations(localizations: Record<string, Partial<OuiListboxLocalizations>>): void;
|
|
18
|
-
declare function updateListboxLocalizations(instance: OuiLocalizations<OuiListboxLocalizations>, destination: Record<string, Partial<OuiListboxLocalizations>>, first: string | Record<string, Partial<OuiListboxLocalizations>>, second?: Partial<OuiListboxLocalizations>): void;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { setListboxLocalizations as n, updateListboxLocalizations as r, getListboxId as t };
|
|
File without changes
|