@oscarpalmer/oui 0.38.0 → 0.39.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/badge.css +11 -8
- package/dist/css/button.css +106 -14
- package/dist/css/color-picker.css +555 -73
- package/dist/css/color.css +86 -86
- package/dist/css/combobox.css +98 -4
- package/dist/css/content.css +7 -6
- package/dist/css/floatable.css +1 -3
- package/dist/css/form.css +99 -6
- package/dist/css/icon.css +99 -0
- package/dist/css/listbox.css +3 -0
- package/dist/css/message.css +4 -3
- package/dist/css/mixins/button.mixins.css +1 -0
- package/dist/css/reset.css +1 -1
- package/dist/css/tabs.css +95 -3
- package/dist/css/typography.css +90 -0
- package/dist/js/color-picker/constants.color-picker.d.mts +2 -0
- package/dist/js/color-picker/constants.color-picker.mjs +59 -0
- package/dist/js/color-picker/dom.color-picker.d.mts +8 -0
- package/dist/js/color-picker/dom.color-picker.mjs +191 -0
- package/dist/js/color-picker/event.color-picker.d.mts +9 -0
- package/dist/js/color-picker/event.color-picker.mjs +2 -0
- package/dist/js/color-picker/form.color-picker.d.mts +5 -0
- package/dist/js/color-picker/form.color-picker.mjs +24 -0
- package/dist/js/color-picker/index.d.mts +2 -0
- package/dist/js/color-picker/index.mjs +303 -0
- package/dist/js/color-picker/misc.color-picker.d.mts +2 -0
- package/dist/js/color-picker/misc.color-picker.mjs +2 -0
- package/dist/js/color-picker/models.color-picker.d.mts +2 -0
- package/dist/js/color-picker/models.color-picker.mjs +24 -0
- package/dist/js/color-picker/output.color-picker.d.mts +8 -0
- package/dist/js/color-picker/output.color-picker.mjs +233 -0
- package/dist/js/color-picker/state.color-picker.d.mts +8 -0
- package/dist/js/color-picker/state.color-picker.mjs +2 -0
- package/dist/js/combobox/constants.combobox.d.mts +1 -1
- package/dist/js/combobox/dom.combobox.d.mts +12 -13
- package/dist/js/combobox/dom.combobox.mjs +5 -2
- package/dist/js/combobox/event.combobox.d.mts +20 -21
- package/dist/js/combobox/event.combobox.mjs +1 -1
- package/dist/js/combobox/index.d.mts +1 -1
- package/dist/js/combobox/index.mjs +2 -2
- package/dist/js/combobox/misc.combobox.d.mts +1 -1
- package/dist/js/combobox/misc.combobox.mjs +1 -1
- package/dist/js/combobox/models.combobox.d.mts +12 -13
- package/dist/js/combobox/state.combobox.d.mts +8 -9
- package/dist/js/combobox/state.combobox.mjs +1 -1
- package/dist/js/constants.color-picker-B-gFjL8m.d.mts +364 -0
- package/dist/js/constants.combobox-8EMRmv09.d.mts +18 -0
- package/dist/js/constants.listbox-DGnX32kv.d.mts +8 -0
- package/dist/js/dialog.d.mts +2 -2
- package/dist/js/dialog.mjs +1 -1
- package/dist/js/{draggable-a6w0J1OD.d.mts → draggable-B5-70SZm.d.mts} +5 -4
- package/dist/js/event.color-picker-BEpq0Adu.mjs +485 -0
- 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-Bct4U5Dm.d.mts → floatable.embedded-DQYkXt8X.d.mts} +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.mjs +3 -3
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +1 -1
- package/dist/js/{focus-trap.embedded-DR8NpZfr.d.mts → focus-trap.embedded-CjyFQYow.d.mts} +2 -2
- package/dist/js/{index-DJdFlTLm.d.mts → index-C5D3-oiI.d.mts} +2 -2
- package/dist/js/index.d.mts +7 -7
- package/dist/js/index.mjs +5 -3
- package/dist/js/internal/attributable.d.mts +2 -3
- package/dist/js/internal/draggable.d.mts +1 -1
- package/dist/js/internal/draggable.mjs +5 -5
- package/dist/js/internal/listbox/listbox.constants.d.mts +7 -10
- package/dist/js/internal/listbox/listbox.constants.mjs +15 -16
- package/dist/js/internal/listbox/listbox.data.d.mts +9 -10
- package/dist/js/internal/listbox/listbox.data.mjs +1 -1
- package/dist/js/internal/listbox/listbox.dom.d.mts +19 -20
- package/dist/js/internal/listbox/listbox.dom.mjs +1 -1
- package/dist/js/internal/listbox/listbox.event.d.mts +3 -4
- package/dist/js/internal/listbox/listbox.event.mjs +4 -4
- package/dist/js/internal/listbox/listbox.form.d.mts +4 -5
- package/dist/js/internal/listbox/listbox.misc.d.mts +10 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +1 -1
- package/dist/js/internal/listbox/listbox.model.d.mts +1 -1
- package/dist/js/internal/listbox/listbox.state.d.mts +5 -6
- package/dist/js/internal/listbox/listbox.state.mjs +1 -1
- package/dist/js/internal/misc.d.mts +4 -4
- package/dist/js/internal/misc.mjs +9 -1
- package/dist/js/internal/navigable.d.mts +9 -10
- package/dist/js/internal/navigable.mjs +3 -3
- package/dist/js/listbox/constants.listbox.d.mts +1 -1
- package/dist/js/listbox/event.listbox.d.mts +6 -7
- package/dist/js/listbox/event.listbox.mjs +1 -1
- package/dist/js/listbox/index.d.mts +5 -5
- package/dist/js/listbox/index.mjs +2 -2
- package/dist/js/listbox/misc.listbox.d.mts +1 -1
- package/dist/js/listbox/misc.listbox.mjs +1 -1
- package/dist/js/listbox/state.listbox.d.mts +7 -8
- package/dist/js/listbox/state.listbox.mjs +1 -1
- package/dist/js/{listbox.data-C7CRa5Ya.mjs → listbox.data-DQ7-x2uY.mjs} +5 -5
- package/dist/js/{listbox.model-CRReGOmu.d.mts → listbox.model-BHPA7GM4.d.mts} +3 -3
- package/dist/js/menu.mjs +2 -2
- package/dist/js/{misc.listbox-Cyz2CRDy.mjs → misc.listbox-DKB-j0UK.mjs} +4 -4
- package/dist/js/{misc.listbox-gnoJhrTr.d.mts → misc.listbox-mZMuYOxg.d.mts} +1 -1
- package/dist/js/movable/movable.embedded.d.mts +1 -1
- package/dist/js/movable/movable.embedded.mjs +2 -2
- package/dist/js/movable/movable.standalone.d.mts +1 -1
- package/dist/js/popover.d.mts +2 -2
- package/dist/js/popover.mjs +1 -1
- package/dist/js/resizable/resizable.embedded.d.mts +1 -1
- package/dist/js/resizable/resizable.embedded.mjs +5 -5
- package/dist/js/resizable/resizable.standalone.d.mts +1 -1
- package/dist/js/{resizable.embedded-3qoR0Bjm.d.mts → resizable.embedded-dvhdfQgt.d.mts} +1 -1
- package/dist/js/sortable/sortable.embedded.d.mts +1 -1
- package/dist/js/sortable/sortable.embedded.mjs +4 -4
- package/dist/js/sortable/sortable.standalone.d.mts +1 -1
- package/dist/js/splitter.d.mts +2 -3
- package/dist/js/splitter.mjs +7 -7
- package/dist/js/{state.combobox-Qm3FWzYW.mjs → state.combobox-BWDFHwoi.mjs} +11 -11
- package/dist/js/tabs.d.mts +4 -5
- package/dist/js/tooltip.d.mts +1 -1
- package/dist/js/tooltip.mjs +3 -3
- package/package.json +24 -24
- package/dist/js/color-picker.d.mts +0 -213
- package/dist/js/color-picker.mjs +0 -924
- package/dist/js/constants.combobox-DmRAMC64.d.mts +0 -26
- package/dist/js/constants.listbox-DRsXUxd3.d.mts +0 -14
- package/src/css/a11y.scss +0 -13
- package/src/css/badge.scss +0 -62
- package/src/css/button.scss +0 -50
- package/src/css/color-picker.scss +0 -344
- package/src/css/color.scss +0 -113
- package/src/css/combobox.scss +0 -255
- package/src/css/content.scss +0 -181
- package/src/css/flex.scss +0 -107
- package/src/css/floatable.scss +0 -155
- package/src/css/form.scss +0 -575
- package/src/css/listbox.scss +0 -121
- package/src/css/message.scss +0 -74
- package/src/css/mixins/badge.mixins.scss +0 -53
- package/src/css/mixins/button.mixins.scss +0 -112
- package/src/css/mixins/input.mixins.scss +0 -114
- package/src/css/mixins/message.mixins.scss +0 -41
- package/src/css/mixins/misc.mixins.scss +0 -48
- package/src/css/mixins/shadow.mixins.scss +0 -57
- package/src/css/reset.scss +0 -392
- package/src/css/splitter.scss +0 -89
- package/src/css/table.scss +0 -107
- package/src/css/tabs.scss +0 -74
- package/src/js/color-picker.ts +0 -1653
- package/src/js/combobox/constants.combobox.ts +0 -83
- package/src/js/combobox/dom.combobox.ts +0 -411
- package/src/js/combobox/event.combobox.ts +0 -365
- package/src/js/combobox/index.ts +0 -382
- package/src/js/combobox/misc.combobox.ts +0 -104
- package/src/js/combobox/models.combobox.ts +0 -54
- package/src/js/combobox/state.combobox.ts +0 -246
- package/src/js/dialog.ts +0 -255
- package/src/js/floatable/floatable.embedded.ts +0 -336
- package/src/js/floatable/floatable.standalone.ts +0 -6
- package/src/js/focus-trap/focus-trap.embedded.ts +0 -411
- package/src/js/focus-trap/focus-trap.standalone.ts +0 -1
- package/src/js/index.ts +0 -16
- package/src/js/internal/attributable.ts +0 -73
- package/src/js/internal/draggable.ts +0 -657
- package/src/js/internal/listbox/listbox.constants.ts +0 -25
- package/src/js/internal/listbox/listbox.data.ts +0 -287
- package/src/js/internal/listbox/listbox.dom.ts +0 -446
- package/src/js/internal/listbox/listbox.event.ts +0 -129
- package/src/js/internal/listbox/listbox.form.ts +0 -125
- package/src/js/internal/listbox/listbox.misc.ts +0 -135
- package/src/js/internal/listbox/listbox.model.ts +0 -169
- package/src/js/internal/listbox/listbox.state.ts +0 -82
- package/src/js/internal/misc.ts +0 -27
- package/src/js/internal/navigable.ts +0 -317
- package/src/js/l10n.ts +0 -192
- package/src/js/listbox/constants.listbox.ts +0 -61
- package/src/js/listbox/event.listbox.ts +0 -106
- package/src/js/listbox/index.ts +0 -364
- package/src/js/listbox/misc.listbox.ts +0 -70
- package/src/js/listbox/state.listbox.ts +0 -194
- package/src/js/menu.ts +0 -348
- package/src/js/movable/movable.embedded.ts +0 -318
- package/src/js/movable/movable.standalone.ts +0 -2
- package/src/js/popover.ts +0 -229
- package/src/js/resizable/resizable.embedded.ts +0 -413
- package/src/js/resizable/resizable.standalone.ts +0 -5
- package/src/js/sortable/sortable.embedded.ts +0 -527
- package/src/js/sortable/sortable.standalone.ts +0 -2
- package/src/js/splitter.ts +0 -583
- package/src/js/tabs.ts +0 -441
- package/src/js/toolbar.ts +0 -63
- package/src/js/tooltip.ts +0 -367
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { d as OuiListboxType } from "../../listbox.model-
|
|
1
|
+
import { d as OuiListboxType } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.constants.d.ts
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
declare const listboxScrollOptions: ScrollIntoViewOptions;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { LISTBOX_KEYS, LISTBOX_TYPES, listboxScrollOptions };
|
|
3
|
+
export declare const LISTBOX_KEYS_ACTIVATION: Set<string>;
|
|
4
|
+
export declare const LISTBOX_KEYS_NAVIGATION: Set<string>;
|
|
5
|
+
export declare const LISTBOX_KEYS_SELECTION: Set<string>;
|
|
6
|
+
export declare const LISTBOX_TYPES: Set<OuiListboxType>;
|
|
7
|
+
export declare const listboxScrollOptions: ScrollIntoViewOptions;
|
|
8
|
+
//#endregion
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
1
|
+
//#region src/js/internal/listbox/listbox.constants.ts
|
|
2
|
+
const LISTBOX_KEYS_ACTIVATION = /* @__PURE__ */ new Set([
|
|
3
|
+
" ",
|
|
4
|
+
"Backspace",
|
|
5
|
+
"Delete",
|
|
6
|
+
"Enter"
|
|
7
|
+
]);
|
|
8
|
+
const LISTBOX_KEYS_NAVIGATION = /* @__PURE__ */ new Set([
|
|
9
|
+
"ArrowDown",
|
|
10
|
+
"ArrowUp",
|
|
11
|
+
"PageDown",
|
|
12
|
+
"PageUp"
|
|
13
|
+
]);
|
|
14
|
+
const LISTBOX_KEYS_SELECTION = /* @__PURE__ */ new Set(["ArrowRight", "End"]);
|
|
16
15
|
const LISTBOX_TYPES = /* @__PURE__ */ new Set(["autocomplete", "select"]);
|
|
17
16
|
const listboxScrollOptions = {
|
|
18
17
|
behavior: "auto",
|
|
@@ -20,4 +19,4 @@ const listboxScrollOptions = {
|
|
|
20
19
|
inline: "nearest"
|
|
21
20
|
};
|
|
22
21
|
//#endregion
|
|
23
|
-
export {
|
|
22
|
+
export { LISTBOX_KEYS_ACTIVATION, LISTBOX_KEYS_NAVIGATION, LISTBOX_KEYS_SELECTION, LISTBOX_TYPES, listboxScrollOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-
|
|
1
|
+
import { l as OuiListboxState } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.data.d.ts
|
|
3
3
|
type ApplySelectionParameters<State extends OuiListboxState = OuiListboxState> = {
|
|
4
4
|
added: boolean;
|
|
@@ -9,12 +9,11 @@ type ApplySelectionParameters<State extends OuiListboxState = OuiListboxState> =
|
|
|
9
9
|
state: State;
|
|
10
10
|
values?: string[];
|
|
11
11
|
};
|
|
12
|
-
declare function applyListboxSelection<State extends OuiListboxState>(parameters: ApplySelectionParameters<State>): void;
|
|
13
|
-
declare function filterListbox(type: InputEvent[
|
|
14
|
-
declare function filterListboxOption(state: OuiListboxState, value: unknown, textContent?: boolean): HTMLElement | undefined;
|
|
15
|
-
declare function filterListboxOptions(state: OuiListboxState): HTMLElement | undefined;
|
|
16
|
-
declare function setListboxValue<State extends OuiListboxState>(state: State, value: unknown, emit?: boolean): void;
|
|
17
|
-
declare function setListboxValues<State extends OuiListboxState>(state: State, value: unknown[], emit?: boolean): void;
|
|
18
|
-
declare function toggleListboxOption<State extends OuiListboxState>(state: State, option?: HTMLElement): void;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { applyListboxSelection, filterListbox, filterListboxOption, filterListboxOptions, setListboxValue, setListboxValues, toggleListboxOption };
|
|
12
|
+
export declare function applyListboxSelection<State extends OuiListboxState>(parameters: ApplySelectionParameters<State>): void;
|
|
13
|
+
export declare function filterListbox(type: InputEvent["inputType"], state: OuiListboxState): void;
|
|
14
|
+
export declare function filterListboxOption(state: OuiListboxState, value: unknown, textContent?: boolean): HTMLElement | undefined;
|
|
15
|
+
export declare function filterListboxOptions(state: OuiListboxState): HTMLElement | undefined;
|
|
16
|
+
export declare function setListboxValue<State extends OuiListboxState>(state: State, value: unknown, emit?: boolean): void;
|
|
17
|
+
export declare function setListboxValues<State extends OuiListboxState>(state: State, value: unknown[], emit?: boolean): void;
|
|
18
|
+
export declare function toggleListboxOption<State extends OuiListboxState>(state: State, option?: HTMLElement): void;
|
|
19
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as setListboxValue, i as filterListboxOptions, n as filterListbox, o as setListboxValues, r as filterListboxOption, s as toggleListboxOption, t as applyListboxSelection } from "../../listbox.data-
|
|
1
|
+
import { a as setListboxValue, i as filterListboxOptions, n as filterListbox, o as setListboxValues, r as filterListboxOption, s as toggleListboxOption, t as applyListboxSelection } from "../../listbox.data-DQ7-x2uY.mjs";
|
|
2
2
|
export { applyListboxSelection, filterListbox, filterListboxOption, filterListboxOptions, setListboxValue, setListboxValues, toggleListboxOption };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as OuiListboxGroup, c as OuiListboxPreview, d as OuiListboxType, l as OuiListboxState, n as OuiListboxAutoComplete, s as OuiListboxOptions, t as OuiListboxAttributes } from "../../listbox.model-
|
|
1
|
+
import { a as OuiListboxGroup, c as OuiListboxPreview, d as OuiListboxType, l as OuiListboxState, n as OuiListboxAutoComplete, s as OuiListboxOptions, t as OuiListboxAttributes } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.dom.d.ts
|
|
3
|
-
type CreateListboxContent = {
|
|
3
|
+
export type CreateListboxContent = {
|
|
4
4
|
element: HTMLDivElement;
|
|
5
5
|
filter?: CreateListboxFilter;
|
|
6
6
|
list: CreateListboxList;
|
|
7
7
|
message: HTMLDivElement;
|
|
8
8
|
value: HTMLSpanElement;
|
|
9
9
|
};
|
|
10
|
-
type CreateListboxContentParameters = {
|
|
10
|
+
export type CreateListboxContentParameters = {
|
|
11
11
|
attributes: OuiListboxAttributes;
|
|
12
12
|
autocomplete: OuiListboxAutoComplete;
|
|
13
13
|
element: HTMLElement;
|
|
@@ -18,7 +18,7 @@ type CreateListboxContentParameters = {
|
|
|
18
18
|
select: HTMLSelectElement;
|
|
19
19
|
type: OuiListboxType;
|
|
20
20
|
};
|
|
21
|
-
type CreateListboxFilter = {
|
|
21
|
+
export type CreateListboxFilter = {
|
|
22
22
|
container: HTMLElement;
|
|
23
23
|
element: HTMLInputElement;
|
|
24
24
|
};
|
|
@@ -29,7 +29,7 @@ type CreateListboxGroupParameters = {
|
|
|
29
29
|
selected: HTMLElement[];
|
|
30
30
|
type: OuiListboxType;
|
|
31
31
|
};
|
|
32
|
-
type CreateListboxList = {
|
|
32
|
+
export type CreateListboxList = {
|
|
33
33
|
element: HTMLUListElement;
|
|
34
34
|
groups?: OuiListboxGroup[];
|
|
35
35
|
options: OuiListboxOptions;
|
|
@@ -49,18 +49,17 @@ type CreateListboxOptionsParameters = {
|
|
|
49
49
|
selected: HTMLElement[];
|
|
50
50
|
type: OuiListboxType;
|
|
51
51
|
};
|
|
52
|
-
declare function createListboxContent(parameters: CreateListboxContentParameters): CreateListboxContent;
|
|
53
|
-
declare function createListboxFilter(parameters: CreateListboxContentParameters): CreateListboxFilter | undefined;
|
|
54
|
-
declare function createListboxGroup(parameters: CreateListboxGroupParameters): OuiListboxGroup;
|
|
55
|
-
declare function createListboxHeader(parameters: CreateListboxGroupParameters, group: HTMLOptGroupElement): HTMLElement;
|
|
56
|
-
declare function createListboxInput(parameters: CreateListboxContentParameters, value: string): HTMLInputElement;
|
|
57
|
-
declare function createListboxList(parameters: CreateListboxContentParameters): CreateListboxList;
|
|
58
|
-
declare function createListboxMessage(attribute: string): HTMLDivElement;
|
|
59
|
-
declare function createListboxOption(parameters: CreateListboxOptionParameters): HTMLElement;
|
|
60
|
-
declare function createListboxOptions(parameters: CreateListboxOptionsParameters): HTMLElement[];
|
|
61
|
-
declare function createListboxValueLabel(id: string): HTMLSpanElement;
|
|
62
|
-
declare function updateListboxMessage(state: OuiListboxState): void;
|
|
63
|
-
declare function updateListboxPreview<State extends OuiListboxState>(preview: OuiListboxPreview, state: State, active?: HTMLElement, scroll?: boolean): void;
|
|
64
|
-
declare function updateListboxValueLabel<State extends OuiListboxState>(state: State): void;
|
|
65
|
-
//#endregion
|
|
66
|
-
export { CreateListboxContent, CreateListboxContentParameters, CreateListboxFilter, CreateListboxList, createListboxContent, createListboxFilter, createListboxGroup, createListboxHeader, createListboxInput, createListboxList, createListboxMessage, createListboxOption, createListboxOptions, createListboxValueLabel, updateListboxMessage, updateListboxPreview, updateListboxValueLabel };
|
|
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 +1,2 @@
|
|
|
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-
|
|
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-DQ7-x2uY.mjs";
|
|
2
2
|
export { createListboxContent, createListboxFilter, createListboxGroup, createListboxHeader, createListboxInput, createListboxList, createListboxMessage, createListboxOption, createListboxOptions, createListboxValueLabel, updateListboxMessage, updateListboxPreview, updateListboxValueLabel };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-
|
|
1
|
+
import { l as OuiListboxState } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.event.d.ts
|
|
3
|
-
declare function processListboxKeydown<State extends OuiListboxState>(event: KeyboardEvent, state: State): void;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { processListboxKeydown };
|
|
3
|
+
export declare function processListboxKeydown<State extends OuiListboxState>(event: KeyboardEvent, state: State): void;
|
|
4
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as getListboxVisibleOptions } from "../../listbox.data-
|
|
1
|
+
import { LISTBOX_KEYS_NAVIGATION, LISTBOX_KEYS_SELECTION } from "./listbox.constants.mjs";
|
|
2
|
+
import { S as getListboxVisibleOptions } from "../../listbox.data-DQ7-x2uY.mjs";
|
|
3
3
|
import { clamp } from "@oscarpalmer/atoms/number";
|
|
4
4
|
//#region src/js/internal/listbox/listbox.event.ts
|
|
5
5
|
function processListboxKeydown(event, state) {
|
|
@@ -20,10 +20,10 @@ function processListboxKeydown(event, state) {
|
|
|
20
20
|
preventDefault = false;
|
|
21
21
|
state.callbacks.keydown.onEscape?.(state);
|
|
22
22
|
break;
|
|
23
|
-
case !isSelect &&
|
|
23
|
+
case !isSelect && LISTBOX_KEYS_SELECTION.has(event.key):
|
|
24
24
|
if (!ignore) state.callbacks.keydown.onSelection?.(state);
|
|
25
25
|
break;
|
|
26
|
-
case
|
|
26
|
+
case LISTBOX_KEYS_NAVIGATION.has(event.key):
|
|
27
27
|
if (!state.disabled) onNavigation(event, state);
|
|
28
28
|
break;
|
|
29
29
|
default:
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-
|
|
1
|
+
import { l as OuiListboxState } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.form.d.ts
|
|
3
|
-
declare function updateListboxForm<State extends OuiListboxState>(state: State, values: string[], emit?: boolean): void;
|
|
4
|
-
declare function updateListboxValidity(state: OuiListboxState): void;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { updateListboxForm, updateListboxValidity };
|
|
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,12 +1,11 @@
|
|
|
1
|
-
import { l as OuiListboxState } from "../../listbox.model-
|
|
1
|
+
import { l as OuiListboxState } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.misc.d.ts
|
|
3
|
-
declare function generateListboxIds(prefix: string, select: HTMLSelectElement): void;
|
|
4
|
-
declare function getListboxVisibleOptions(state: OuiListboxState): HTMLElement[];
|
|
5
|
-
declare function setListboxDisabled<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
6
|
-
declare function setListboxFilter<State extends OuiListboxState>(state: State, value: unknown): void;
|
|
7
|
-
declare function setListboxLimit<State extends OuiListboxState>(type:
|
|
8
|
-
declare function setListboxMultiple(element: HTMLElement, value: boolean): void;
|
|
9
|
-
declare function setListboxReadonly<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
10
|
-
declare function setListboxRequired<State extends OuiListboxState>(state: State, value: boolean): void;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { generateListboxIds, getListboxVisibleOptions, setListboxDisabled, setListboxFilter, setListboxLimit, setListboxMultiple, setListboxReadonly, setListboxRequired };
|
|
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 +1,2 @@
|
|
|
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-
|
|
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-DQ7-x2uY.mjs";
|
|
2
2
|
export { generateListboxIds, getListboxVisibleOptions, setListboxDisabled, setListboxFilter, setListboxLimit, setListboxMultiple, setListboxReadonly, setListboxRequired };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiListboxGroup, c as OuiListboxPreview, d 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 OuiListboxStates } from "../../listbox.model-
|
|
1
|
+
import { a as OuiListboxGroup, c as OuiListboxPreview, d 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 OuiListboxStates } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
export { OuiListboxAttributes, OuiListboxAutoComplete, OuiListboxAutoCompleteType, OuiListboxCallbacks, OuiListboxGroup, OuiListboxLocalizations, OuiListboxOptions, OuiListboxPreview, OuiListboxState, OuiListboxStates, OuiListboxType };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { l as OuiListboxState, u as OuiListboxStates } from "../../listbox.model-
|
|
1
|
+
import { l as OuiListboxState, u as OuiListboxStates } from "../../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/internal/listbox/listbox.state.d.ts
|
|
3
|
-
declare function attachListbox<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onAttach: (state: State) => void): void;
|
|
4
|
-
declare function detachListbox<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onDetach: (state: State) => void): void;
|
|
5
|
-
declare function initializeListboxState<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onAttach: (state: State) => void): State;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { attachListbox, detachListbox, initializeListboxState };
|
|
3
|
+
export declare function attachListbox<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onAttach: (state: State) => void): void;
|
|
4
|
+
export declare function detachListbox<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onDetach: (state: State) => void): void;
|
|
5
|
+
export declare function initializeListboxState<State extends OuiListboxState>(state: State, states: OuiListboxStates<State>, onAttach: (state: State) => void): State;
|
|
6
|
+
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
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-DQ7-x2uY.mjs";
|
|
3
3
|
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
4
4
|
//#region src/js/internal/listbox/listbox.state.ts
|
|
5
5
|
function attachListbox(state, states, onAttach) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyAriaBooleanAttribute } from "@oscarpalmer/toretto/models";
|
|
2
2
|
//#region src/js/internal/misc.d.ts
|
|
3
|
-
declare function
|
|
4
|
-
declare function
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare function copyValue(value: string, onSuccess?: () => void, onError?: () => void): void;
|
|
4
|
+
export declare function getAttributeValue<Value>(element: HTMLElement, attribute: string, possible: Set<Value>, defaultValue: Value): Value;
|
|
5
|
+
export declare function getBooleanAriaValue(element: HTMLElement, attribute: AnyAriaBooleanAttribute): boolean;
|
|
6
|
+
//#endregion
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { getAria } from "@oscarpalmer/toretto/aria";
|
|
2
2
|
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
3
|
+
import { noop } from "@oscarpalmer/atoms/function";
|
|
3
4
|
//#region src/js/internal/misc.ts
|
|
5
|
+
function copyValue(value, onSuccess, onError) {
|
|
6
|
+
try {
|
|
7
|
+
navigator.clipboard.writeText(value).then(onSuccess ?? noop, onError ?? noop);
|
|
8
|
+
} catch {
|
|
9
|
+
onError?.();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
function getAttributeValue(element, attribute, possible, defaultValue) {
|
|
5
13
|
const value = getAttribute(element, attribute);
|
|
6
14
|
return possible.has(value) ? value : defaultValue;
|
|
@@ -10,4 +18,4 @@ function getBooleanAriaValue(element, attribute) {
|
|
|
10
18
|
return value === true || value === "true";
|
|
11
19
|
}
|
|
12
20
|
//#endregion
|
|
13
|
-
export { getAttributeValue, getBooleanAriaValue };
|
|
21
|
+
export { copyValue, getAttributeValue, getBooleanAriaValue };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AriaRole, RemovableEventListener } from "@oscarpalmer/toretto/models";
|
|
2
2
|
//#region src/js/internal/navigable.d.ts
|
|
3
|
-
declare class OuiNavigable {
|
|
3
|
+
export declare class OuiNavigable {
|
|
4
4
|
active: OuiNavigableActive;
|
|
5
5
|
element: HTMLElement;
|
|
6
6
|
listeners: RemovableEventListener[];
|
|
@@ -15,7 +15,7 @@ type OuiNavigableActive = {
|
|
|
15
15
|
index: number;
|
|
16
16
|
};
|
|
17
17
|
type OuiNavigableCallback<ReturnType> = (event: KeyboardEvent, navigable: OuiNavigable) => ReturnType;
|
|
18
|
-
type OuiNavigableOptions = {
|
|
18
|
+
export type OuiNavigableOptions = {
|
|
19
19
|
orientation?: OuiNavigableOrientation;
|
|
20
20
|
role?: AriaRole;
|
|
21
21
|
selector: string;
|
|
@@ -27,11 +27,10 @@ type OuiNavigableOptions = {
|
|
|
27
27
|
onShouldActivate?: OuiNavigableCallback<boolean>;
|
|
28
28
|
onShouldDeactivate?: OuiNavigableCallback<boolean | undefined>;
|
|
29
29
|
};
|
|
30
|
-
type OuiNavigableOrientation =
|
|
31
|
-
declare function getNavigable(element: HTMLElement, options: OuiNavigableOptions): OuiNavigable;
|
|
32
|
-
declare function getNavigableOrientation(element: HTMLElement, vertical: boolean, aria?: boolean): OuiNavigableOrientation;
|
|
33
|
-
declare function updateNavigableFocus(navigable: OuiNavigable, focus: boolean, items?: HTMLElement[]): void;
|
|
34
|
-
declare const NAVIGABLE_KEYS_HORIZONTAL: Set<string>;
|
|
35
|
-
declare const NAVIGABLE_KEYS_VERTICAL: Set<string>;
|
|
36
|
-
//#endregion
|
|
37
|
-
export { NAVIGABLE_KEYS_HORIZONTAL, NAVIGABLE_KEYS_VERTICAL, OuiNavigable, OuiNavigableOptions, OuiNavigableOrientation, getNavigable, getNavigableOrientation, updateNavigableFocus };
|
|
30
|
+
export type OuiNavigableOrientation = "horizontal" | "vertical";
|
|
31
|
+
export declare function getNavigable(element: HTMLElement, options: OuiNavigableOptions): OuiNavigable;
|
|
32
|
+
export declare function getNavigableOrientation(element: HTMLElement, vertical: boolean, aria?: boolean): OuiNavigableOrientation;
|
|
33
|
+
export declare function updateNavigableFocus(navigable: OuiNavigable, focus: boolean, items?: HTMLElement[]): void;
|
|
34
|
+
export declare const NAVIGABLE_KEYS_HORIZONTAL: Set<string>;
|
|
35
|
+
export declare const NAVIGABLE_KEYS_VERTICAL: Set<string>;
|
|
36
|
+
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { clamp } from "@oscarpalmer/atoms/number";
|
|
2
1
|
import { getAria, setAria, setRole } from "@oscarpalmer/toretto/aria";
|
|
3
|
-
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
4
2
|
import { on } from "@oscarpalmer/toretto/event";
|
|
5
|
-
import {
|
|
3
|
+
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
4
|
import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
5
|
+
import { clamp } from "@oscarpalmer/atoms/number";
|
|
6
|
+
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
7
7
|
//#region src/js/internal/navigable.ts
|
|
8
8
|
var OuiNavigable = class {
|
|
9
9
|
active = { index: 0 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as LISTBOX_TAGNAME, n as LISTBOX_MESSAGES, r as LISTBOX_SELECTORS, t as LISTBOX_ATTRIBUTES } from "../constants.listbox-
|
|
1
|
+
import { i as LISTBOX_TAGNAME, n as LISTBOX_MESSAGES, r as LISTBOX_SELECTORS, t as LISTBOX_ATTRIBUTES } from "../constants.listbox-DGnX32kv.mjs";
|
|
2
2
|
export { LISTBOX_ATTRIBUTES, LISTBOX_MESSAGES, LISTBOX_SELECTORS, LISTBOX_TAGNAME };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { c as OuiListboxPreview, l as OuiListboxState } from "../listbox.model-
|
|
1
|
+
import { c as OuiListboxPreview, l as OuiListboxState } from "../listbox.model-BHPA7GM4.mjs";
|
|
2
2
|
//#region src/js/listbox/event.listbox.d.ts
|
|
3
|
-
declare function onListboxEnter(state: OuiListboxState): void;
|
|
4
|
-
declare function onListboxFilter(preview: OuiListboxPreview, state: OuiListboxState, _: boolean, active?: HTMLElement): void;
|
|
5
|
-
declare function onListboxNavigation(preview: OuiListboxPreview, state: OuiListboxState, active?: HTMLElement): void;
|
|
6
|
-
declare function onListboxToggle(state: OuiListboxState): void;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { onListboxEnter, onListboxFilter, onListboxNavigation, onListboxToggle };
|
|
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,2 +1,2 @@
|
|
|
1
|
-
import { d as onListboxNavigation, f as onListboxToggle, l as onListboxEnter, u as onListboxFilter } from "../misc.listbox-
|
|
1
|
+
import { d as onListboxNavigation, f as onListboxToggle, l as onListboxEnter, u as onListboxFilter } from "../misc.listbox-DKB-j0UK.mjs";
|
|
2
2
|
export { onListboxEnter, onListboxFilter, onListboxNavigation, onListboxToggle };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { o as OuiListboxLocalizations } from "../listbox.model-
|
|
2
|
-
import { i as LISTBOX_TAGNAME } from "../constants.listbox-
|
|
3
|
-
import { n as setListboxLocalizations } from "../misc.listbox-
|
|
1
|
+
import { o as OuiListboxLocalizations } from "../listbox.model-BHPA7GM4.mjs";
|
|
2
|
+
import { i as LISTBOX_TAGNAME } from "../constants.listbox-DGnX32kv.mjs";
|
|
3
|
+
import { n as setListboxLocalizations } from "../misc.listbox-mZMuYOxg.mjs";
|
|
4
4
|
//#region src/js/listbox/index.d.ts
|
|
5
5
|
declare global {
|
|
6
6
|
interface HTMLElementTagNameMap {
|
|
7
7
|
[LISTBOX_TAGNAME]: OuiListboxElement;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
declare class OuiListboxElement extends HTMLElement {
|
|
10
|
+
export declare class OuiListboxElement extends HTMLElement {
|
|
11
11
|
#private;
|
|
12
12
|
static formAssociated: boolean;
|
|
13
13
|
static observedAttributes: string[];
|
|
@@ -151,4 +151,4 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
151
151
|
setLocalizations(localizations: Record<string, Partial<OuiListboxLocalizations>>): void;
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
-
export {
|
|
154
|
+
export { setListboxLocalizations };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-DQ7-x2uY.mjs";
|
|
2
2
|
import { attachListbox, detachListbox } from "../internal/listbox/listbox.state.mjs";
|
|
3
3
|
import { LISTBOX_TAGNAME } from "./constants.listbox.mjs";
|
|
4
|
-
import { c as onDetachListbox, i as createListboxState, n as setListboxLocalizations, o as listboxStates, r as updateListboxLocalizations, s as onAttachListbox } from "../misc.listbox-
|
|
4
|
+
import { c as onDetachListbox, i as createListboxState, n as setListboxLocalizations, o as listboxStates, r as updateListboxLocalizations, s as onAttachListbox } from "../misc.listbox-DKB-j0UK.mjs";
|
|
5
5
|
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
6
|
import { parse } from "@oscarpalmer/atoms/string";
|
|
7
7
|
//#region src/js/listbox/index.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-
|
|
1
|
+
import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-mZMuYOxg.mjs";
|
|
2
2
|
export { getListboxId, setListboxLocalizations, updateListboxLocalizations };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-
|
|
1
|
+
import { n as setListboxLocalizations, r as updateListboxLocalizations, t as getListboxId } from "../misc.listbox-DKB-j0UK.mjs";
|
|
2
2
|
export { getListboxId, setListboxLocalizations, updateListboxLocalizations };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { t as OuiLocalizations } from "../l10n-Bn-7RcwR.mjs";
|
|
2
|
-
import { l as OuiListboxState, o as OuiListboxLocalizations, u as OuiListboxStates } from "../listbox.model-
|
|
2
|
+
import { l as OuiListboxState, o as OuiListboxLocalizations, u as OuiListboxStates } from "../listbox.model-BHPA7GM4.mjs";
|
|
3
3
|
import { OuiListboxElement } from "./index.mjs";
|
|
4
4
|
//#region src/js/listbox/state.listbox.d.ts
|
|
5
|
-
declare function createListboxState(element: OuiListboxElement, internals: ElementInternals): OuiListboxState;
|
|
6
|
-
declare function onAttachListbox(state: OuiListboxState): void;
|
|
7
|
-
declare function onDetachListbox(state: OuiListboxState): void;
|
|
8
|
-
declare const listboxLocalizations: OuiLocalizations<OuiListboxLocalizations>;
|
|
9
|
-
declare const listboxStates: OuiListboxStates;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { createListboxState, listboxLocalizations, listboxStates, onAttachListbox, onDetachListbox };
|
|
5
|
+
export declare function createListboxState(element: OuiListboxElement, internals: ElementInternals): OuiListboxState;
|
|
6
|
+
export declare function onAttachListbox(state: OuiListboxState): void;
|
|
7
|
+
export declare function onDetachListbox(state: OuiListboxState): void;
|
|
8
|
+
export declare const listboxLocalizations: OuiLocalizations<OuiListboxLocalizations>;
|
|
9
|
+
export declare const listboxStates: OuiListboxStates;
|
|
10
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listboxLocalizations, c as onDetachListbox, i as createListboxState, o as listboxStates, s as onAttachListbox } from "../misc.listbox-
|
|
1
|
+
import { a as listboxLocalizations, c as onDetachListbox, i as createListboxState, o as listboxStates, s as onAttachListbox } from "../misc.listbox-DKB-j0UK.mjs";
|
|
2
2
|
export { createListboxState, listboxLocalizations, listboxStates, onAttachListbox, onDetachListbox };
|
|
@@ -2,11 +2,11 @@ import { getLocalization, localize } from "./l10n.mjs";
|
|
|
2
2
|
import { listboxScrollOptions } from "./internal/listbox/listbox.constants.mjs";
|
|
3
3
|
import { updateListboxForm, updateListboxValidity } from "./internal/listbox/listbox.form.mjs";
|
|
4
4
|
import { setAria } from "@oscarpalmer/toretto/aria";
|
|
5
|
-
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { dispatch } from "@oscarpalmer/toretto/event";
|
|
6
|
+
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
7
7
|
import { getString } from "@oscarpalmer/atoms/string";
|
|
8
|
-
import { getData } from "@oscarpalmer/toretto/data";
|
|
9
8
|
import { createElement, setAria as setAria$1, setAttribute as setAttribute$1 } from "@oscarpalmer/toretto";
|
|
9
|
+
import { getData as getData$1 } from "@oscarpalmer/toretto/data";
|
|
10
10
|
//#region src/js/internal/listbox/listbox.misc.ts
|
|
11
11
|
function generateListboxIds(prefix, select) {
|
|
12
12
|
const elements = [...select.children].flatMap((child) => child instanceof HTMLOptGroupElement ? [child, ...[...child.children].filter((groupChild) => groupChild instanceof HTMLOptionElement)] : child instanceof HTMLOptionElement ? [child] : []);
|
|
@@ -300,7 +300,7 @@ function applyListboxSelection(parameters) {
|
|
|
300
300
|
const option = state.options.all[index];
|
|
301
301
|
setAria(option, "selected", (state.type === "select" || !state.autocomplete.none) && (selected ?? state.options.selected).includes(option));
|
|
302
302
|
}
|
|
303
|
-
const values = parameters.values ?? (state.autocomplete.none && !state.listbox ? [state.filter.element.value] : (selected ?? state.options.selected).map((option) => getData(option, "value", false) ?? ""));
|
|
303
|
+
const values = parameters.values ?? (state.autocomplete.none && !state.listbox ? [state.filter.element.value] : (selected ?? state.options.selected).map((option) => getData$1(option, "value", false) ?? ""));
|
|
304
304
|
if (values.length === 0) values.push("");
|
|
305
305
|
if (selected != null) state.options.selected = selected;
|
|
306
306
|
if (!(values.length === state.values.current.length ? values.some((value) => !state.values.current.includes(value)) : true)) return;
|
|
@@ -331,7 +331,7 @@ function filterListboxOption(state, value, textContent) {
|
|
|
331
331
|
let match;
|
|
332
332
|
for (let index = 0; index < length; index += 1) {
|
|
333
333
|
const option = state.options.all[index];
|
|
334
|
-
if ((filterTextContent ? option.textContent : getData(option, "value", false) ?? "").toLocaleLowerCase() === filter) {
|
|
334
|
+
if ((filterTextContent ? option.textContent : getData$1(option, "value", false) ?? "").toLocaleLowerCase() === filter) {
|
|
335
335
|
match = option;
|
|
336
336
|
break;
|
|
337
337
|
}
|
|
@@ -385,7 +385,7 @@ function setListboxValues(state, value, emit) {
|
|
|
385
385
|
const selected = [];
|
|
386
386
|
for (let index = 0; index < length; index += 1) {
|
|
387
387
|
const option = state.options.all[index];
|
|
388
|
-
if (values.includes(getData(option, "value", false)?.toLocaleLowerCase() ?? "")) selected.push(option);
|
|
388
|
+
if (values.includes(getData$1(option, "value", false)?.toLocaleLowerCase() ?? "")) selected.push(option);
|
|
389
389
|
}
|
|
390
390
|
applyListboxSelection({
|
|
391
391
|
emit,
|
|
@@ -17,7 +17,7 @@ type OuiListboxAttributes = {
|
|
|
17
17
|
type OuiListboxAutoComplete = Record<OuiListboxAutoCompleteType, boolean> & {
|
|
18
18
|
value?: OuiListboxAutoCompleteType;
|
|
19
19
|
};
|
|
20
|
-
type OuiListboxAutoCompleteType =
|
|
20
|
+
type OuiListboxAutoCompleteType = "both" | "inline" | "list" | "none";
|
|
21
21
|
type OuiListboxCallbacks<State extends OuiListboxState = OuiListboxState> = {
|
|
22
22
|
data: OuiListboxCallbacksData<State>;
|
|
23
23
|
keydown: OuiListboxCallbacksKeydown<State>;
|
|
@@ -79,7 +79,7 @@ type OuiListboxOptions = {
|
|
|
79
79
|
all: HTMLElement[];
|
|
80
80
|
selected: HTMLElement[];
|
|
81
81
|
};
|
|
82
|
-
type OuiListboxPreview =
|
|
82
|
+
type OuiListboxPreview = "none" | "set" | "typed";
|
|
83
83
|
type OuiListboxState = {
|
|
84
84
|
active?: HTMLElement;
|
|
85
85
|
attributes: OuiListboxAttributes;
|
|
@@ -115,7 +115,7 @@ type OuiListboxStates<State extends OuiListboxState = OuiListboxState> = {
|
|
|
115
115
|
map: WeakMap<HTMLElement, State>;
|
|
116
116
|
set: Set<State>;
|
|
117
117
|
};
|
|
118
|
-
type OuiListboxType =
|
|
118
|
+
type OuiListboxType = "autocomplete" | "select";
|
|
119
119
|
type OuiListboxValues = {
|
|
120
120
|
current: string[];
|
|
121
121
|
initial: string[];
|
package/dist/js/menu.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { createEmbeddedFloatable, getOnBeforeToggleListener } from "./floatable/
|
|
|
2
2
|
import { attributable } from "./internal/attributable.mjs";
|
|
3
3
|
import { NAVIGABLE_KEYS_HORIZONTAL, NAVIGABLE_KEYS_VERTICAL, getNavigable, updateNavigableFocus } from "./internal/navigable.mjs";
|
|
4
4
|
import { setAria, setRole } from "@oscarpalmer/toretto/aria";
|
|
5
|
-
import { setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { on } from "@oscarpalmer/toretto/event";
|
|
6
|
+
import { setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
7
7
|
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
8
8
|
//#region src/js/menu.ts
|
|
9
9
|
var OuiMenu = class {
|
|
@@ -121,7 +121,7 @@ function onDeactivate(_, navigable) {
|
|
|
121
121
|
}
|
|
122
122
|
function onPreventNavigation(_, navigable) {
|
|
123
123
|
const instance = menubars.get(navigable.element) ?? menus.get(navigable.element);
|
|
124
|
-
return findAncestor(instance
|
|
124
|
+
return instance == null ? false : findAncestor(instance.element.parentElement, SELECTORS) != null;
|
|
125
125
|
}
|
|
126
126
|
function onShouldActivate(event, navigable) {
|
|
127
127
|
let activate = false;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { getLocalizations, updateLocalizations } from "./l10n.mjs";
|
|
2
|
-
import { b as updateListboxValueLabel, c as createListboxContent, n as filterListbox, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-C7CRa5Ya.mjs";
|
|
3
|
-
import { initializeListboxState } from "./internal/listbox/listbox.state.mjs";
|
|
4
2
|
import { getBooleanAriaValue } from "./internal/misc.mjs";
|
|
3
|
+
import { b as updateListboxValueLabel, c as createListboxContent, n as filterListbox, s as toggleListboxOption, t as applyListboxSelection, v as updateListboxMessage, x as generateListboxIds, y as updateListboxPreview } from "./listbox.data-DQ7-x2uY.mjs";
|
|
4
|
+
import { initializeListboxState } from "./internal/listbox/listbox.state.mjs";
|
|
5
5
|
import { processListboxKeydown } from "./internal/listbox/listbox.event.mjs";
|
|
6
6
|
import { LISTBOX_ATTRIBUTES, LISTBOX_MESSAGES, LISTBOX_SELECTORS, LISTBOX_TAGNAME } from "./listbox/constants.listbox.mjs";
|
|
7
|
-
import { setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
8
7
|
import { on } from "@oscarpalmer/toretto/event";
|
|
8
|
+
import { setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
9
9
|
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
10
|
-
import { getData } from "@oscarpalmer/toretto/data";
|
|
11
10
|
import { noop } from "@oscarpalmer/atoms/function";
|
|
11
|
+
import { getData } from "@oscarpalmer/toretto/data";
|
|
12
12
|
//#region src/js/listbox/event.listbox.ts
|
|
13
13
|
function onListboxClick(event) {
|
|
14
14
|
const listbox = findAncestor(event, LISTBOX_TAGNAME);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as OuiLocalizations } from "./l10n-Bn-7RcwR.mjs";
|
|
2
|
-
import { o as OuiListboxLocalizations } from "./listbox.model-
|
|
2
|
+
import { o as OuiListboxLocalizations } from "./listbox.model-BHPA7GM4.mjs";
|
|
3
3
|
//#region src/js/listbox/misc.listbox.d.ts
|
|
4
4
|
declare function getListboxId(): string;
|
|
5
5
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { g as createMovable, h as OuiMovable, m as ATTRIBUTE_MOVABLE_HANDLE, p as ATTRIBUTE_MOVABLE } from "../draggable-
|
|
1
|
+
import { g as createMovable, h as OuiMovable, m as ATTRIBUTE_MOVABLE_HANDLE, p as ATTRIBUTE_MOVABLE } from "../draggable-B5-70SZm.mjs";
|
|
2
2
|
export { ATTRIBUTE_MOVABLE, ATTRIBUTE_MOVABLE_HANDLE, OuiMovable, createMovable };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { attributable } from "../internal/attributable.mjs";
|
|
2
2
|
import { OuiDraggable, addDraggable, getDraggableStates, removeDraggable } from "../internal/draggable.mjs";
|
|
3
|
-
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
4
3
|
import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
|
|
5
|
-
import {
|
|
4
|
+
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
6
|
+
import { getStyles, setStyle, setStyles } from "@oscarpalmer/toretto/style";
|
|
7
7
|
//#region src/js/movable/movable.embedded.ts
|
|
8
8
|
var OuiMovable = class extends OuiDraggable {
|
|
9
9
|
#element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { g as createMovable, h as OuiMovable, t as CreateOuiDraggableOptions } from "../draggable-
|
|
1
|
+
import { g as createMovable, h as OuiMovable, t as CreateOuiDraggableOptions } from "../draggable-B5-70SZm.mjs";
|
|
2
2
|
export { type CreateOuiDraggableOptions as CreateOuiMovableOptions, type OuiMovable, createMovable };
|