@oscarpalmer/oui 0.37.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/a11y.css +1 -0
- package/dist/css/badge.css +12 -8
- package/dist/css/button.css +111 -14
- package/dist/css/color-picker.css +859 -0
- package/dist/css/color.css +86 -87
- package/dist/css/combobox.css +105 -4
- package/dist/css/content.css +8 -6
- package/dist/css/floatable.css +3 -3
- package/dist/css/form.css +106 -6
- package/dist/css/icon.css +99 -0
- package/dist/css/listbox.css +5 -0
- package/dist/css/message.css +6 -3
- package/dist/css/mixins/badge.mixins.css +2 -0
- package/dist/css/mixins/button.mixins.css +3 -0
- package/dist/css/mixins/message.mixins.css +1 -0
- package/dist/css/mixins/misc.mixins.css +2 -0
- package/dist/css/mixins/shadow.mixins.css +1 -0
- package/dist/css/reset.css +3 -3
- package/dist/css/splitter.css +1 -1
- package/dist/css/tabs.css +115 -23
- 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 +12 -5
- 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 +56 -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 +11 -8
- 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.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-EfkUSals.d.mts → index-C5D3-oiI.d.mts} +41 -3
- package/dist/js/index.d.mts +8 -7
- package/dist/js/index.mjs +6 -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 +1 -1
- 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.form.mjs +16 -15
- 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 +3 -3
- 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 +1 -0
- 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 +43 -5
- package/dist/js/listbox/index.mjs +56 -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-BWd0PCy7.mjs → listbox.data-DQ7-x2uY.mjs} +8 -7
- package/dist/js/{listbox.model-CRReGOmu.d.mts → listbox.model-BHPA7GM4.d.mts} +3 -3
- package/dist/js/menu.mjs +1 -1
- package/dist/js/{misc.listbox-BI-XsTOf.mjs → misc.listbox-DKB-j0UK.mjs} +4 -5
- 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.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 +1 -1
- 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.standalone.d.mts +1 -1
- package/dist/js/splitter.d.mts +2 -3
- package/dist/js/splitter.mjs +2 -2
- package/dist/js/{state.combobox-4xq0FPCF.mjs → state.combobox-BWDFHwoi.mjs} +9 -9
- package/dist/js/tabs.d.mts +4 -5
- package/dist/js/tabs.mjs +4 -7
- package/dist/js/tooltip.d.mts +1 -1
- package/package.json +24 -22
- 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.scss +0 -115
- package/src/css/combobox.scss +0 -252
- package/src/css/content.scss +0 -180
- package/src/css/flex.scss +0 -107
- package/src/css/floatable.scss +0 -152
- package/src/css/form.scss +0 -573
- package/src/css/listbox.scss +0 -120
- package/src/css/message.scss +0 -73
- package/src/css/mixins.scss +0 -419
- 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 -85
- package/src/js/combobox/constants.combobox.ts +0 -83
- package/src/js/combobox/dom.combobox.ts +0 -407
- package/src/js/combobox/event.combobox.ts +0 -365
- package/src/js/combobox/index.ts +0 -320
- 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 -332
- 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 -15
- 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 -445
- package/src/js/internal/listbox/listbox.event.ts +0 -129
- package/src/js/internal/listbox/listbox.form.ts +0 -115
- 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 -315
- 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 -302
- package/src/js/listbox/misc.listbox.ts +0 -70
- package/src/js/listbox/state.listbox.ts +0 -196
- 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 -447
- package/src/js/toolbar.ts +0 -63
- package/src/js/tooltip.ts +0 -367
- /package/dist/css/{mixins.css → mixins/input.mixins.css} +0 -0
package/dist/js/index.mjs
CHANGED
|
@@ -5,12 +5,15 @@ import { createResizable } from "./resizable/resizable.embedded.mjs";
|
|
|
5
5
|
import { getDialog } from "./dialog.mjs";
|
|
6
6
|
import "./menu.mjs";
|
|
7
7
|
import "./toolbar.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { OuiColorPickerEvent } from "./color-picker/models.color-picker.mjs";
|
|
9
|
+
import { d as setColorPickerLocalizations } from "./event.color-picker-BEpq0Adu.mjs";
|
|
10
|
+
import { OuiColorPickerElement } from "./color-picker/index.mjs";
|
|
11
|
+
import { D as setComboboxLocalizations } from "./state.combobox-BWDFHwoi.mjs";
|
|
9
12
|
import { OuiComboboxElement } from "./combobox/index.mjs";
|
|
10
13
|
import "./floatable/floatable.standalone.mjs";
|
|
11
14
|
import { createFocusTrap } from "./focus-trap/focus-trap.embedded.mjs";
|
|
12
15
|
import "./focus-trap/focus-trap.standalone.mjs";
|
|
13
|
-
import { n as setListboxLocalizations } from "./misc.listbox-
|
|
16
|
+
import { n as setListboxLocalizations } from "./misc.listbox-DKB-j0UK.mjs";
|
|
14
17
|
import { OuiListboxElement } from "./listbox/index.mjs";
|
|
15
18
|
import { getPopover } from "./popover.mjs";
|
|
16
19
|
import "./resizable/resizable.standalone.mjs";
|
|
@@ -19,4 +22,4 @@ import "./sortable/sortable.standalone.mjs";
|
|
|
19
22
|
import { OuiSplitterElement } from "./splitter.mjs";
|
|
20
23
|
import { OuiTabsElement, OuiTabsEvent } from "./tabs.mjs";
|
|
21
24
|
import { getTooltip, setTooltipDelay } from "./tooltip.mjs";
|
|
22
|
-
export { OuiComboboxElement, OuiListboxElement, OuiSplitterElement, OuiTabsElement, OuiTabsEvent, createFloatable, createFocusTrap, createMovable, createResizable as createOuiResizable, createSortable, getDialog, getPopover, getTooltip, setComboboxLocalizations, setListboxLocalizations, setTooltipDelay };
|
|
25
|
+
export { OuiColorPickerElement, OuiColorPickerEvent, OuiComboboxElement, OuiListboxElement, OuiSplitterElement, OuiTabsElement, OuiTabsEvent, createFloatable, createFocusTrap, createMovable, createResizable as createOuiResizable, createSortable, getDialog, getPopover, getTooltip, setColorPickerLocalizations, setComboboxLocalizations, setListboxLocalizations, setTooltipDelay };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
//#region src/js/internal/attributable.d.ts
|
|
2
|
-
declare function attributable(attribute: string, add: (element: HTMLElement) => void, remove: (element: HTMLElement) => void): void;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { attributable };
|
|
2
|
+
export declare function attributable(attribute: string, add: (element: HTMLElement) => void, remove: (element: HTMLElement) => void): void;
|
|
3
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiDraggableGlobals, c as addDraggable, i as OuiDraggableBound, l as getDraggableStates, n as OuiDragMovePosition, o as OuiDraggableItem, r as OuiDraggable, s as OuiDraggableState, t as CreateOuiDraggableOptions, u as removeDraggable } from "../draggable-
|
|
1
|
+
import { a as OuiDraggableGlobals, c as addDraggable, i as OuiDraggableBound, l as getDraggableStates, n as OuiDragMovePosition, o as OuiDraggableItem, r as OuiDraggable, s as OuiDraggableState, t as CreateOuiDraggableOptions, u as removeDraggable } from "../draggable-B5-70SZm.mjs";
|
|
2
2
|
export { CreateOuiDraggableOptions, OuiDragMovePosition, OuiDraggable, OuiDraggableBound, OuiDraggableGlobals, OuiDraggableItem, OuiDraggableState, addDraggable, getDraggableStates, removeDraggable };
|
|
@@ -4,7 +4,7 @@ import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
|
4
4
|
import { setStyle, setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
|
|
5
5
|
import { clamp } from "@oscarpalmer/atoms/number";
|
|
6
6
|
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
7
|
-
import supportsTouch from "@oscarpalmer/toretto/touch";
|
|
7
|
+
import { supportsTouch } from "@oscarpalmer/toretto/touch";
|
|
8
8
|
//#region src/js/internal/draggable.ts
|
|
9
9
|
var OuiDraggable = class {
|
|
10
10
|
#destroyed = false;
|
|
@@ -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
|
|
@@ -15,11 +15,12 @@ function updateListboxForm(state, values, emit) {
|
|
|
15
15
|
if (emit ?? true) dispatch(state.host, "oui:change");
|
|
16
16
|
}
|
|
17
17
|
function updateListboxValidity(state) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const { autocomplete, filter, host, internals, listbox, localizations, max, min, multiple, options, required } = state;
|
|
19
|
+
if (autocomplete.none && !listbox) {
|
|
20
|
+
const valueMissing = required && filter.element.value.length === 0;
|
|
21
|
+
const localization = getLocalization(localizations.global, host, "invalid", localizations.component);
|
|
22
|
+
internals.setValidity({ valueMissing }, localize(localization, {}, []));
|
|
23
|
+
internals.checkValidity();
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
let data = {};
|
|
@@ -27,26 +28,26 @@ function updateListboxValidity(state) {
|
|
|
27
28
|
let key;
|
|
28
29
|
let parameters = [];
|
|
29
30
|
switch (true) {
|
|
30
|
-
case
|
|
31
|
+
case required && options.selected.length === 0:
|
|
31
32
|
error = "badInput";
|
|
32
33
|
key = "input";
|
|
33
34
|
break;
|
|
34
|
-
case
|
|
35
|
-
data = { amount:
|
|
35
|
+
case multiple && typeof max === "number" && options.selected.length > max:
|
|
36
|
+
data = { amount: max };
|
|
36
37
|
error = "rangeOverflow";
|
|
37
38
|
key = "max";
|
|
38
|
-
parameters = [
|
|
39
|
+
parameters = [max];
|
|
39
40
|
break;
|
|
40
|
-
case
|
|
41
|
-
data = { amount:
|
|
41
|
+
case multiple && typeof min === "number" && options.selected.length < min:
|
|
42
|
+
data = { amount: min };
|
|
42
43
|
error = "rangeUnderflow";
|
|
43
44
|
key = "min";
|
|
44
|
-
parameters = [
|
|
45
|
+
parameters = [min];
|
|
45
46
|
}
|
|
46
|
-
const localization = key == null ? void 0 : getLocalization(
|
|
47
|
+
const localization = key == null ? void 0 : getLocalization(localizations.global, host, key, localizations.component);
|
|
47
48
|
const message = localization == null ? void 0 : localize(localization, data, parameters);
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
internals.setValidity(error == null ? {} : { [error]: true }, message);
|
|
50
|
+
internals.checkValidity();
|
|
50
51
|
}
|
|
51
52
|
//#endregion
|
|
52
53
|
export { updateListboxForm, updateListboxValidity };
|
|
@@ -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,11 +1,11 @@
|
|
|
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) {
|
|
6
|
-
const { filter, host, label } = state;
|
|
6
|
+
const { filter, host, id, label } = state;
|
|
7
7
|
label.element.htmlFor = filter.element.id;
|
|
8
|
-
label.element.id = `${
|
|
8
|
+
label.element.id = `${id}_label`;
|
|
9
9
|
onAttach(state);
|
|
10
10
|
states.map.set(host, state);
|
|
11
11
|
states.set.add(state);
|
|
@@ -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
|
|
@@ -97,6 +97,7 @@ function onKeydown(navigable, event) {
|
|
|
97
97
|
const items = getItems(navigable.element, navigable.options.selector);
|
|
98
98
|
const { length } = items;
|
|
99
99
|
if (length === 0) return;
|
|
100
|
+
event.preventDefault();
|
|
100
101
|
let index;
|
|
101
102
|
if (KEYS_ABSOLUTE.has(event.key)) index = event.key === "Home" ? 0 : items.length - 1;
|
|
102
103
|
else {
|
|
@@ -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[];
|
|
@@ -27,6 +27,14 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
27
27
|
* Set the filter value
|
|
28
28
|
*/
|
|
29
29
|
set filter(value: string);
|
|
30
|
+
/**
|
|
31
|
+
* Form element associated with the listbox
|
|
32
|
+
*/
|
|
33
|
+
get form(): HTMLFormElement | null;
|
|
34
|
+
/**
|
|
35
|
+
* Label elements associated with the listbox
|
|
36
|
+
*/
|
|
37
|
+
get labels(): NodeList;
|
|
30
38
|
/**
|
|
31
39
|
* Maximum number of selected options
|
|
32
40
|
*/
|
|
@@ -71,6 +79,14 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
71
79
|
* Selected options
|
|
72
80
|
*/
|
|
73
81
|
get selected(): HTMLElement[];
|
|
82
|
+
/**
|
|
83
|
+
* Validation message for the listbox
|
|
84
|
+
*/
|
|
85
|
+
get validationMessage(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Validity state for the listbox
|
|
88
|
+
*/
|
|
89
|
+
get validity(): ValidityState;
|
|
74
90
|
/**
|
|
75
91
|
* Current value
|
|
76
92
|
*/
|
|
@@ -87,8 +103,18 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
87
103
|
* Set the values
|
|
88
104
|
*/
|
|
89
105
|
set values(values: unknown[]);
|
|
106
|
+
/**
|
|
107
|
+
* Can the listbox be validated?
|
|
108
|
+
*/
|
|
109
|
+
get willValidate(): boolean;
|
|
90
110
|
constructor();
|
|
91
111
|
attributeChangedCallback(name: string, _: string | null, value: string | null): void;
|
|
112
|
+
/**
|
|
113
|
+
* Check if the listbox is valid
|
|
114
|
+
*
|
|
115
|
+
* @returns `true` if the listbox is valid, otherwise `false`
|
|
116
|
+
*/
|
|
117
|
+
checkValidity(): boolean;
|
|
92
118
|
/**
|
|
93
119
|
* Clear all selected options
|
|
94
120
|
*/
|
|
@@ -98,6 +124,18 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
98
124
|
formDisabledCallback(disabled: boolean): void;
|
|
99
125
|
formResetCallback(): void;
|
|
100
126
|
formStateRestoreCallback(state: string | File | FormData, reason: unknown): void;
|
|
127
|
+
/**
|
|
128
|
+
* Check if the listbox is valid and report any validation errors
|
|
129
|
+
*
|
|
130
|
+
* @returns `true` if the listbox is valid, otherwise `false`
|
|
131
|
+
*/
|
|
132
|
+
reportValidity(): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Set a custom validation message for the listbox
|
|
135
|
+
*
|
|
136
|
+
* @param message Validation message
|
|
137
|
+
*/
|
|
138
|
+
setCustomValidity(message: string): void;
|
|
101
139
|
/**
|
|
102
140
|
* Set listbox localizations for a specific language
|
|
103
141
|
*
|
|
@@ -113,4 +151,4 @@ declare class OuiListboxElement extends HTMLElement {
|
|
|
113
151
|
setLocalizations(localizations: Record<string, Partial<OuiListboxLocalizations>>): void;
|
|
114
152
|
}
|
|
115
153
|
//#endregion
|
|
116
|
-
export {
|
|
154
|
+
export { setListboxLocalizations };
|