@oscarpalmer/oui 0.39.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/css/color-picker.css +80 -69
- package/dist/css/listbox.css +169 -0
- package/dist/js/color-picker/color-picker.constants.d.mts +2 -0
- package/dist/js/color-picker/{constants.color-picker.mjs → color-picker.constants.mjs} +7 -4
- package/dist/js/color-picker/{dom.color-picker.d.mts → color-picker.dom.d.mts} +2 -2
- package/dist/js/color-picker/{dom.color-picker.mjs → color-picker.dom.mjs} +33 -16
- package/dist/js/color-picker/{event.color-picker.d.mts → color-picker.event.d.mts} +3 -3
- package/dist/js/color-picker/color-picker.event.mjs +233 -0
- package/dist/js/color-picker/{form.color-picker.d.mts → color-picker.form.d.mts} +2 -2
- package/dist/js/color-picker/{form.color-picker.mjs → color-picker.form.mjs} +9 -8
- package/dist/js/color-picker/color-picker.misc.d.mts +2 -0
- package/dist/js/color-picker/color-picker.misc.mjs +104 -0
- package/dist/js/color-picker/color-picker.model.d.mts +2 -0
- package/dist/js/color-picker/{models.color-picker.mjs → color-picker.model.mjs} +1 -1
- package/dist/js/color-picker/{output.color-picker.d.mts → color-picker.output.d.mts} +2 -2
- package/dist/js/color-picker/{output.color-picker.mjs → color-picker.output.mjs} +19 -18
- package/dist/js/color-picker/color-picker.state.d.mts +8 -0
- package/dist/js/color-picker/color-picker.state.mjs +168 -0
- package/dist/js/color-picker/index.d.mts +172 -2
- package/dist/js/color-picker/index.mjs +66 -59
- package/dist/js/color-picker.constants-BZgXQr5o.d.mts +177 -0
- package/dist/js/color-picker.misc-BIS3R6jk.d.mts +31 -0
- package/dist/js/combobox/combobox.constants.d.mts +2 -0
- package/dist/js/combobox/{constants.combobox.mjs → combobox.constants.mjs} +21 -21
- package/dist/js/combobox/combobox.dom.d.mts +25 -0
- package/dist/js/combobox/{dom.combobox.mjs → combobox.dom.mjs} +51 -49
- package/dist/js/combobox/{event.combobox.d.mts → combobox.event.d.mts} +9 -9
- package/dist/js/combobox/{event.combobox.mjs → combobox.event.mjs} +1 -1
- package/dist/js/combobox/combobox.misc.d.mts +2 -0
- package/dist/js/combobox/combobox.misc.mjs +2 -0
- package/dist/js/combobox/combobox.model.d.mts +2 -0
- package/dist/js/combobox/combobox.state.d.mts +9 -0
- package/dist/js/combobox/combobox.state.mjs +2 -0
- package/dist/js/combobox/index.d.mts +152 -2
- package/dist/js/combobox/index.mjs +54 -55
- package/dist/js/combobox.constants-Hb3bqqQJ.d.mts +19 -0
- package/dist/js/combobox.misc-DRDFk6X8.d.mts +26 -0
- package/dist/js/combobox.model-gjEI2VqZ.d.mts +46 -0
- package/dist/js/{state.combobox-BWDFHwoi.mjs → combobox.state-AstCICiH.mjs} +109 -106
- package/dist/js/dialog/dialog.model.d.mts +2 -0
- package/dist/js/dialog/dialog.model.mjs +11 -0
- package/dist/js/dialog/index.d.mts +12 -0
- package/dist/js/dialog/index.mjs +123 -0
- package/dist/js/dialog.model-HVzYWoDo.d.mts +45 -0
- package/dist/js/floatable/floatable.embedded.d.mts +2 -2
- package/dist/js/floatable/floatable.embedded.mjs +64 -92
- package/dist/js/floatable/floatable.model.d.mts +2 -0
- package/dist/js/floatable/floatable.model.mjs +23 -0
- package/dist/js/floatable/floatable.standalone.d.mts +2 -1
- package/dist/js/floatable.embedded-ncshL3Sa.d.mts +17 -0
- package/dist/js/{floatable.embedded-DQYkXt8X.d.mts → floatable.model-DXsQgoU7.d.mts} +13 -20
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +2 -2
- package/dist/js/focus-trap/focus-trap.embedded.mjs +117 -138
- package/dist/js/focus-trap/focus-trap.model.d.mts +2 -0
- package/dist/js/focus-trap/focus-trap.model.mjs +15 -0
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -1
- package/dist/js/focus-trap.embedded-DpcPkP7c.d.mts +13 -0
- package/dist/js/{focus-trap.embedded-CjyFQYow.d.mts → focus-trap.model-CpltX5B5.d.mts} +16 -18
- package/dist/js/index.d.mts +26 -14
- package/dist/js/index.mjs +18 -17
- package/dist/js/internal/attributable.d.mts +1 -1
- package/dist/js/internal/attributable.mjs +3 -2
- package/dist/js/internal/draggable/draggable.model.d.mts +2 -0
- package/dist/js/internal/draggable/draggable.model.mjs +37 -0
- package/dist/js/internal/draggable/index.d.mts +13 -0
- package/dist/js/internal/draggable/index.mjs +243 -0
- package/dist/js/internal/l10n/index.d.mts +5 -0
- package/dist/js/internal/l10n/index.mjs +147 -0
- package/dist/js/internal/l10n/l10n.model.d.mts +2 -0
- package/dist/js/internal/l10n/l10n.model.mjs +12 -0
- package/dist/js/internal/misc.d.mts +3 -2
- package/dist/js/internal/misc.mjs +4 -6
- package/dist/js/internal/navigable/index.d.mts +6 -0
- package/dist/js/internal/navigable/index.mjs +125 -0
- package/dist/js/internal/navigable/navigable.model.d.mts +2 -0
- package/dist/js/internal/navigable/navigable.model.mjs +18 -0
- package/dist/js/internal/option-list/option-list.constants.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.constants.mjs +22 -0
- package/dist/js/internal/option-list/option-list.data.d.mts +21 -0
- package/dist/js/internal/option-list/option-list.data.mjs +2 -0
- package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
- package/dist/js/internal/option-list/option-list.dom.mjs +2 -0
- package/dist/js/internal/option-list/option-list.event.d.mts +6 -0
- package/dist/js/internal/option-list/option-list.event.mjs +66 -0
- package/dist/js/internal/option-list/option-list.form.d.mts +7 -0
- package/dist/js/internal/option-list/option-list.form.mjs +53 -0
- package/dist/js/internal/option-list/option-list.misc.d.mts +13 -0
- package/dist/js/internal/option-list/option-list.misc.mjs +2 -0
- package/dist/js/internal/option-list/option-list.model.d.mts +2 -0
- package/dist/js/internal/option-list/option-list.state.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.state.mjs +39 -0
- package/dist/js/l10n/index.d.mts +3 -0
- package/dist/js/l10n/index.mjs +2 -0
- package/dist/js/l10n.model-D1E1u35L.d.mts +54 -0
- package/dist/js/listbox/index.d.mts +9 -18
- package/dist/js/listbox/index.mjs +49 -52
- package/dist/js/listbox/listbox.constants.d.mts +2 -0
- package/dist/js/listbox/{constants.listbox.mjs → listbox.constants.mjs} +11 -15
- package/dist/js/listbox/listbox.dom.d.mts +5 -0
- package/dist/js/listbox/listbox.dom.mjs +2 -0
- package/dist/js/listbox/listbox.event.d.mts +9 -0
- package/dist/js/listbox/listbox.event.mjs +2 -0
- package/dist/js/listbox/listbox.misc.d.mts +2 -0
- package/dist/js/listbox/listbox.misc.mjs +2 -0
- package/dist/js/listbox/listbox.model.d.mts +2 -0
- package/dist/js/listbox/listbox.model.mjs +1 -0
- package/dist/js/listbox/listbox.state.d.mts +9 -0
- package/dist/js/listbox/listbox.state.mjs +2 -0
- package/dist/js/listbox.constants-DOBMwKup.d.mts +9 -0
- package/dist/js/listbox.misc-DwfB4Mu_.d.mts +24 -0
- package/dist/js/listbox.model-C0MYWXZe.d.mts +20 -0
- package/dist/js/listbox.state-BrN296BM.mjs +240 -0
- package/dist/js/menu/index.mjs +171 -0
- package/dist/js/menu/menu.model.d.mts +33 -0
- package/dist/js/menu/menu.model.mjs +15 -0
- package/dist/js/movable/movable.embedded.d.mts +2 -2
- package/dist/js/movable/movable.embedded.mjs +77 -86
- package/dist/js/movable/movable.model.d.mts +2 -0
- package/dist/js/movable/movable.model.mjs +12 -0
- package/dist/js/movable/movable.standalone.d.mts +2 -1
- package/dist/js/movable.embedded-C1bDTLGs.d.mts +11 -0
- package/dist/js/movable.model-D9nnPWKk.d.mts +186 -0
- package/dist/js/navigable.model-BqoR6iBv.d.mts +44 -0
- package/dist/js/option-list.data-CgMyUwPc.mjs +441 -0
- package/dist/js/option-list.model-CCPUlPeX.d.mts +169 -0
- package/dist/js/popover/index.d.mts +12 -0
- package/dist/js/{popover.mjs → popover/index.mjs} +41 -51
- package/dist/js/popover/popover.model.d.mts +2 -0
- package/dist/js/popover/popover.model.mjs +12 -0
- package/dist/js/popover.model-DiLdz0Hc.d.mts +38 -0
- package/dist/js/resizable/resizable.embedded.d.mts +2 -2
- package/dist/js/resizable/resizable.embedded.mjs +43 -58
- package/dist/js/resizable/resizable.model.d.mts +2 -0
- package/dist/js/resizable/resizable.model.mjs +21 -0
- package/dist/js/resizable/resizable.standalone.d.mts +2 -1
- package/dist/js/resizable.embedded-BemH-7Re.d.mts +11 -0
- package/dist/js/resizable.model-YEtcC9li.d.mts +46 -0
- package/dist/js/sortable/sortable.embedded.d.mts +2 -2
- package/dist/js/sortable/sortable.embedded.mjs +111 -116
- package/dist/js/sortable/sortable.model.d.mts +2 -0
- package/dist/js/sortable/sortable.model.mjs +24 -0
- package/dist/js/sortable/sortable.standalone.d.mts +2 -1
- package/dist/js/sortable.embedded-CrEGff9k.d.mts +11 -0
- package/dist/js/{splitter.d.mts → splitter/index.d.mts} +6 -4
- package/dist/js/{splitter.mjs → splitter/index.mjs} +90 -128
- package/dist/js/splitter/splitter.model.d.mts +2 -0
- package/dist/js/splitter/splitter.model.mjs +37 -0
- package/dist/js/splitter.model-C24W6eZ7.d.mts +57 -0
- package/dist/js/{tabs.d.mts → tabs/index.d.mts} +8 -8
- package/dist/js/{tabs.mjs → tabs/index.mjs} +58 -58
- package/dist/js/tabs/tabs.model.d.mts +2 -0
- package/dist/js/tabs/tabs.model.mjs +18 -0
- package/dist/js/tabs.model-BHPy7fPo.d.mts +40 -0
- package/dist/js/toolbar/index.mjs +27 -0
- package/dist/js/toolbar/toolbar.model.d.mts +11 -0
- package/dist/js/toolbar/toolbar.model.mjs +7 -0
- package/dist/js/tooltip/index.d.mts +19 -0
- package/dist/js/{tooltip.mjs → tooltip/index.mjs} +61 -86
- package/dist/js/tooltip/tooltip.model.d.mts +2 -0
- package/dist/js/tooltip/tooltip.model.mjs +15 -0
- package/dist/js/tooltip.model-BpNStw5z.d.mts +37 -0
- package/package.json +30 -24
- package/dist/js/color-picker/constants.color-picker.d.mts +0 -2
- package/dist/js/color-picker/event.color-picker.mjs +0 -2
- package/dist/js/color-picker/misc.color-picker.d.mts +0 -2
- package/dist/js/color-picker/misc.color-picker.mjs +0 -2
- package/dist/js/color-picker/models.color-picker.d.mts +0 -2
- package/dist/js/color-picker/state.color-picker.d.mts +0 -8
- package/dist/js/color-picker/state.color-picker.mjs +0 -2
- package/dist/js/combobox/constants.combobox.d.mts +0 -2
- package/dist/js/combobox/dom.combobox.d.mts +0 -26
- package/dist/js/combobox/misc.combobox.d.mts +0 -2
- package/dist/js/combobox/misc.combobox.mjs +0 -2
- package/dist/js/combobox/models.combobox.d.mts +0 -43
- package/dist/js/combobox/state.combobox.d.mts +0 -11
- package/dist/js/combobox/state.combobox.mjs +0 -2
- package/dist/js/constants.color-picker-B-gFjL8m.d.mts +0 -364
- package/dist/js/constants.combobox-8EMRmv09.d.mts +0 -18
- package/dist/js/constants.listbox-DGnX32kv.d.mts +0 -8
- package/dist/js/dialog.d.mts +0 -47
- package/dist/js/dialog.mjs +0 -131
- package/dist/js/draggable-B5-70SZm.d.mts +0 -155
- package/dist/js/event.color-picker-BEpq0Adu.mjs +0 -485
- package/dist/js/index-C5D3-oiI.d.mts +0 -177
- package/dist/js/internal/draggable.d.mts +0 -2
- package/dist/js/internal/draggable.mjs +0 -265
- package/dist/js/internal/listbox/listbox.constants.d.mts +0 -8
- package/dist/js/internal/listbox/listbox.constants.mjs +0 -22
- package/dist/js/internal/listbox/listbox.data.d.mts +0 -19
- package/dist/js/internal/listbox/listbox.data.mjs +0 -2
- package/dist/js/internal/listbox/listbox.dom.d.mts +0 -65
- package/dist/js/internal/listbox/listbox.dom.mjs +0 -2
- package/dist/js/internal/listbox/listbox.event.d.mts +0 -4
- package/dist/js/internal/listbox/listbox.event.mjs +0 -63
- package/dist/js/internal/listbox/listbox.form.d.mts +0 -5
- package/dist/js/internal/listbox/listbox.form.mjs +0 -53
- package/dist/js/internal/listbox/listbox.misc.d.mts +0 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +0 -2
- package/dist/js/internal/listbox/listbox.model.d.mts +0 -2
- package/dist/js/internal/listbox/listbox.state.d.mts +0 -6
- package/dist/js/internal/listbox/listbox.state.mjs +0 -40
- package/dist/js/internal/navigable.d.mts +0 -36
- package/dist/js/internal/navigable.mjs +0 -135
- package/dist/js/l10n-Bn-7RcwR.d.mts +0 -20
- package/dist/js/l10n.d.mts +0 -2
- package/dist/js/l10n.mjs +0 -80
- package/dist/js/listbox/constants.listbox.d.mts +0 -2
- package/dist/js/listbox/event.listbox.d.mts +0 -7
- package/dist/js/listbox/event.listbox.mjs +0 -2
- package/dist/js/listbox/misc.listbox.d.mts +0 -2
- package/dist/js/listbox/misc.listbox.mjs +0 -2
- package/dist/js/listbox/state.listbox.d.mts +0 -10
- package/dist/js/listbox/state.listbox.mjs +0 -2
- package/dist/js/listbox.data-DQ7-x2uY.mjs +0 -425
- package/dist/js/listbox.model-BHPA7GM4.d.mts +0 -125
- package/dist/js/menu.mjs +0 -172
- package/dist/js/misc.listbox-DKB-j0UK.mjs +0 -196
- package/dist/js/misc.listbox-mZMuYOxg.d.mts +0 -20
- package/dist/js/popover.d.mts +0 -38
- package/dist/js/resizable.embedded-dvhdfQgt.d.mts +0 -34
- package/dist/js/toolbar.mjs +0 -31
- package/dist/js/tooltip.d.mts +0 -45
- /package/dist/js/combobox/{models.combobox.mjs → combobox.model.mjs} +0 -0
- /package/dist/js/internal/{listbox/listbox.model.mjs → option-list/option-list.model.mjs} +0 -0
- /package/dist/js/{menu.d.mts → menu/index.d.mts} +0 -0
- /package/dist/js/{toolbar.d.mts → toolbar/index.d.mts} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { p as OuiLocalizations, u as OuiDefaultLocalizations } from "./l10n.model-D1E1u35L.mjs";
|
|
2
|
+
import { c as OuiFloatable } from "./floatable.model-DXsQgoU7.mjs";
|
|
3
|
+
import { Color, HSLAColor, HSLColor, HWBAColor, HWBColor, RGBAColor, RGBColor } from "@oscarpalmer/atoms/color";
|
|
4
|
+
import { RemovableEventListener } from "@oscarpalmer/toretto/models";
|
|
5
|
+
//#region src/js/color-picker/color-picker.model.d.ts
|
|
6
|
+
type GenericOuiColorPickerElement = {
|
|
7
|
+
[COLOR_PICKER_SYMBOL]: OuiColorPickerState;
|
|
8
|
+
get value(): string;
|
|
9
|
+
set value(value: string);
|
|
10
|
+
} & HTMLElement;
|
|
11
|
+
type OuiColorPickerAnchor = {
|
|
12
|
+
copy?: OuiColorPickerCopy;
|
|
13
|
+
toggle?: HTMLButtonElement;
|
|
14
|
+
container: HTMLDivElement;
|
|
15
|
+
input: HTMLInputElement;
|
|
16
|
+
};
|
|
17
|
+
type OuiColorPickerColor = {
|
|
18
|
+
foreground: string;
|
|
19
|
+
value: Color;
|
|
20
|
+
};
|
|
21
|
+
type OuiColorPickerContent = {
|
|
22
|
+
element: HTMLDivElement;
|
|
23
|
+
hue: OuiColorPickerContentHue;
|
|
24
|
+
opacity?: OuiColorPickerContentOpacity;
|
|
25
|
+
output?: OuiColorPickerContentOutput;
|
|
26
|
+
well: OuiColorPickerContentWell;
|
|
27
|
+
};
|
|
28
|
+
type OuiColorPickerContentHue = {
|
|
29
|
+
container: HTMLDivElement;
|
|
30
|
+
input: HTMLInputElement;
|
|
31
|
+
label: HTMLLabelElement;
|
|
32
|
+
knob: HTMLSpanElement;
|
|
33
|
+
track: HTMLDivElement;
|
|
34
|
+
};
|
|
35
|
+
type OuiColorPickerContentOpacity = {
|
|
36
|
+
container: HTMLDivElement;
|
|
37
|
+
input: HTMLInputElement;
|
|
38
|
+
label: HTMLLabelElement;
|
|
39
|
+
range: HTMLInputElement;
|
|
40
|
+
};
|
|
41
|
+
type OuiColorPickerContentOutput = {
|
|
42
|
+
container: HTMLDivElement;
|
|
43
|
+
copy?: OuiColorPickerCopy;
|
|
44
|
+
inputs: HTMLInputElement[];
|
|
45
|
+
items: HTMLDivElement[];
|
|
46
|
+
toggle?: HTMLSelectElement;
|
|
47
|
+
};
|
|
48
|
+
type OuiColorPickerContentWell = {
|
|
49
|
+
element: HTMLDivElement;
|
|
50
|
+
knob: HTMLSpanElement;
|
|
51
|
+
label: HTMLSpanElement;
|
|
52
|
+
};
|
|
53
|
+
type OuiColorPickerCopy = {
|
|
54
|
+
button: HTMLButtonElement;
|
|
55
|
+
timer?: number;
|
|
56
|
+
};
|
|
57
|
+
type OuiColorPickerCreateParameters = {
|
|
58
|
+
alpha: boolean;
|
|
59
|
+
color: Color;
|
|
60
|
+
copy: boolean;
|
|
61
|
+
id: string;
|
|
62
|
+
inline: boolean;
|
|
63
|
+
input: HTMLInputElement;
|
|
64
|
+
output: OuiColorPickerOutputType;
|
|
65
|
+
};
|
|
66
|
+
declare class OuiColorPickerEvent extends Event {
|
|
67
|
+
readonly valid: boolean;
|
|
68
|
+
readonly value: OuiColorPickerEventValue;
|
|
69
|
+
constructor(type: OuiColorPickerEventType, color: Color, valid: boolean);
|
|
70
|
+
}
|
|
71
|
+
type OuiColorPickerEventType = "oui:change" | "oui:input";
|
|
72
|
+
type OuiColorPickerEventValue = {
|
|
73
|
+
hex: string;
|
|
74
|
+
hexa: string;
|
|
75
|
+
hsl: HSLColor;
|
|
76
|
+
hsla: HSLAColor;
|
|
77
|
+
hwb: HWBColor;
|
|
78
|
+
hwba: HWBAColor;
|
|
79
|
+
rgb: RGBColor;
|
|
80
|
+
rgba: RGBAColor;
|
|
81
|
+
};
|
|
82
|
+
type OuiColorPickerLabel = {
|
|
83
|
+
element: HTMLLabelElement;
|
|
84
|
+
id: string;
|
|
85
|
+
};
|
|
86
|
+
type OuiColorPickerLocalizations = {
|
|
87
|
+
blackness: string;
|
|
88
|
+
blue: string;
|
|
89
|
+
copy: string;
|
|
90
|
+
green: string;
|
|
91
|
+
hex: string;
|
|
92
|
+
hsl: string;
|
|
93
|
+
hue: string;
|
|
94
|
+
hwb: string;
|
|
95
|
+
invalid: string;
|
|
96
|
+
lightness: string;
|
|
97
|
+
opacity: string;
|
|
98
|
+
output: string;
|
|
99
|
+
red: string;
|
|
100
|
+
rgb: string;
|
|
101
|
+
saturation: string;
|
|
102
|
+
toggle: string;
|
|
103
|
+
wellLabel: string;
|
|
104
|
+
wellValue: string | ((lightness: number, saturation: number) => string);
|
|
105
|
+
whiteness: string;
|
|
106
|
+
};
|
|
107
|
+
type OuiColorPickerMovement = {
|
|
108
|
+
parameters?: OuiColorPickerMovementParameters;
|
|
109
|
+
};
|
|
110
|
+
type OuiColorPickerMovementParameters = {
|
|
111
|
+
rectangle: DOMRect;
|
|
112
|
+
state: OuiColorPickerState;
|
|
113
|
+
value: string;
|
|
114
|
+
};
|
|
115
|
+
type OuiColorPickerOutputColor = "hsl" | "hwb" | "rgb";
|
|
116
|
+
type OuiColorPickerOutputColorProperty = "blackness" | "blue" | "green" | "hue" | "lightness" | "red" | "saturation" | "whiteness";
|
|
117
|
+
type OuiColorPickerOutputType = "all" | "none" | OuiColorPickerOutputColor;
|
|
118
|
+
type OuiColorPickerState = {
|
|
119
|
+
component: OuiColorPickerStateComponent;
|
|
120
|
+
form: OuiColorPickerStateForm;
|
|
121
|
+
};
|
|
122
|
+
type OuiColorPickerStateComponent = {
|
|
123
|
+
alpha: boolean;
|
|
124
|
+
anchor: OuiColorPickerAnchor;
|
|
125
|
+
color: OuiColorPickerColor;
|
|
126
|
+
copy: boolean;
|
|
127
|
+
content: OuiColorPickerContent;
|
|
128
|
+
disabled: boolean;
|
|
129
|
+
floatable?: OuiFloatable;
|
|
130
|
+
host: GenericOuiColorPickerElement;
|
|
131
|
+
id: string;
|
|
132
|
+
inline: boolean;
|
|
133
|
+
input: HTMLInputElement;
|
|
134
|
+
label: OuiColorPickerLabel;
|
|
135
|
+
listeners: RemovableEventListener[];
|
|
136
|
+
localizations: OuiLocalizations<OuiColorPickerLocalizations>;
|
|
137
|
+
output: OuiColorPickerOutputType;
|
|
138
|
+
readonly: boolean;
|
|
139
|
+
required: boolean;
|
|
140
|
+
style: HTMLStyleElement;
|
|
141
|
+
value: OuiColorPickerValue;
|
|
142
|
+
};
|
|
143
|
+
type OuiColorPickerStateForm = {
|
|
144
|
+
internals: ElementInternals;
|
|
145
|
+
restored?: string;
|
|
146
|
+
};
|
|
147
|
+
type OuiColorPickerValue = {
|
|
148
|
+
current: string;
|
|
149
|
+
initial: string;
|
|
150
|
+
};
|
|
151
|
+
type OuiColorPickerValueType = "hex" | "hexa" | "hsl" | "hsla" | "hwb" | "hwba" | "rgb" | "rgba";
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/js/color-picker/color-picker.constants.d.ts
|
|
154
|
+
declare const COLOR_PICKER_TAGNAME = "oui-color-picker";
|
|
155
|
+
declare const COLOR_PICKER_ATTRIBUTE_COPY: string;
|
|
156
|
+
declare const COLOR_PICKER_ATTRIBUTE_COPY_ERROR: string;
|
|
157
|
+
declare const COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS: string;
|
|
158
|
+
declare const COLOR_PICKER_ATTRIBUTE_INPUT: string;
|
|
159
|
+
declare const COLOR_PICKER_ATTRIBUTE_OPACITY: string;
|
|
160
|
+
declare const COLOR_PICKER_ATTRIBUTE_OUTPUT_INPUT: string;
|
|
161
|
+
declare const COLOR_PICKER_ATTRIBUTE_WELL: string;
|
|
162
|
+
declare const COLOR_PICKER_ATTRIBUTE_WELL_KNOB: string;
|
|
163
|
+
declare const COLOR_PICKER_EXPRESSION_HEX_PREFIX: RegExp;
|
|
164
|
+
declare const COLOR_PICKER_INPUT_TYPES: Set<string>;
|
|
165
|
+
declare const COLOR_PICKER_KEYS: Set<string>;
|
|
166
|
+
declare const COLOR_PICKER_MESSAGE_INPUT: string;
|
|
167
|
+
declare const COLOR_PICKER_MESSAGE_LABEL: string;
|
|
168
|
+
declare const COLOR_PICKER_OUTPUTS: Set<OuiColorPickerOutputType>;
|
|
169
|
+
declare const COLOR_PICKER_SELECTOR_COPY: string;
|
|
170
|
+
declare const COLOR_PICKER_SELECTOR_INPUT: string;
|
|
171
|
+
declare const COLOR_PICKER_SELECTOR_OUTPUT_INPUT: string;
|
|
172
|
+
declare const COLOR_PICKER_SELECTOR_WELL: string;
|
|
173
|
+
declare const COLOR_PICKER_SELECTOR_WELL_KNOB: string;
|
|
174
|
+
declare const COLOR_PICKER_SYMBOL: unique symbol;
|
|
175
|
+
declare const colorPickerLocalizations: OuiDefaultLocalizations<OuiColorPickerLocalizations>;
|
|
176
|
+
//#endregion
|
|
177
|
+
export { OuiColorPickerContentWell as A, OuiColorPickerState as B, GenericOuiColorPickerElement as C, OuiColorPickerContentHue as D, OuiColorPickerContent as E, OuiColorPickerMovement as F, OuiColorPickerValueType as H, OuiColorPickerMovementParameters as I, OuiColorPickerOutputColor as L, OuiColorPickerCreateParameters as M, OuiColorPickerEvent as N, OuiColorPickerContentOpacity as O, OuiColorPickerLocalizations as P, OuiColorPickerOutputColorProperty as R, colorPickerLocalizations as S, OuiColorPickerColor as T, OuiColorPickerStateComponent as V, COLOR_PICKER_SELECTOR_OUTPUT_INPUT as _, COLOR_PICKER_ATTRIBUTE_OPACITY as a, COLOR_PICKER_SYMBOL as b, COLOR_PICKER_ATTRIBUTE_WELL_KNOB as c, COLOR_PICKER_KEYS as d, COLOR_PICKER_MESSAGE_INPUT as f, COLOR_PICKER_SELECTOR_INPUT as g, COLOR_PICKER_SELECTOR_COPY as h, COLOR_PICKER_ATTRIBUTE_INPUT as i, OuiColorPickerCopy as j, OuiColorPickerContentOutput as k, COLOR_PICKER_EXPRESSION_HEX_PREFIX as l, COLOR_PICKER_OUTPUTS as m, COLOR_PICKER_ATTRIBUTE_COPY_ERROR as n, COLOR_PICKER_ATTRIBUTE_OUTPUT_INPUT as o, COLOR_PICKER_MESSAGE_LABEL as p, COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS as r, COLOR_PICKER_ATTRIBUTE_WELL as s, COLOR_PICKER_ATTRIBUTE_COPY as t, COLOR_PICKER_INPUT_TYPES as u, COLOR_PICKER_SELECTOR_WELL as v, OuiColorPickerAnchor as w, COLOR_PICKER_TAGNAME as x, COLOR_PICKER_SELECTOR_WELL_KNOB as y, OuiColorPickerOutputType as z };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { B as OuiColorPickerState, C as GenericOuiColorPickerElement, H as OuiColorPickerValueType, P as OuiColorPickerLocalizations, z as OuiColorPickerOutputType } from "./color-picker.constants-BZgXQr5o.mjs";
|
|
2
|
+
//#region src/js/color-picker/color-picker.misc.d.ts
|
|
3
|
+
declare function getColorPickerId(): string;
|
|
4
|
+
declare function getColorPickerOutput(element: GenericOuiColorPickerElement): OuiColorPickerOutputType;
|
|
5
|
+
declare function getColorPickerValueType(state: OuiColorPickerState, value: unknown): OuiColorPickerValueType | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Set localizations for a specific language
|
|
8
|
+
*
|
|
9
|
+
* @param language Language code
|
|
10
|
+
* @param localizations Localizations for language
|
|
11
|
+
*/
|
|
12
|
+
declare function setColorPickerLocalizations(language: string, localizations: Partial<OuiColorPickerLocalizations>): void;
|
|
13
|
+
/**
|
|
14
|
+
* Set default localizations
|
|
15
|
+
*
|
|
16
|
+
* @param localizations Default localizations
|
|
17
|
+
*/
|
|
18
|
+
declare function setColorPickerLocalizations(localizations: Partial<OuiColorPickerLocalizations>, defaults: true): void;
|
|
19
|
+
/**
|
|
20
|
+
* Set localizations for one or more languages
|
|
21
|
+
*
|
|
22
|
+
* @param localizations Localizations for one or more languages
|
|
23
|
+
*/
|
|
24
|
+
declare function setColorPickerLocalizations(localizations: Record<string, Partial<OuiColorPickerLocalizations>>): void;
|
|
25
|
+
declare function setColorPickerDisabled(state: OuiColorPickerState, type: "disabled" | "readonly", value: boolean): void;
|
|
26
|
+
declare function setColorPickerRequired(state: OuiColorPickerState, value: boolean): void;
|
|
27
|
+
declare function setColorPickerValue<Type extends OuiColorPickerValueType>(state: OuiColorPickerState, value: unknown, type?: Type): void;
|
|
28
|
+
declare function setColorPickerValues(state: OuiColorPickerState, focus: boolean, input?: string): void;
|
|
29
|
+
declare function updateColorPickerLabels(state: OuiColorPickerState): void;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { setColorPickerLocalizations as a, setColorPickerValues as c, setColorPickerDisabled as i, updateColorPickerLabels as l, getColorPickerOutput as n, setColorPickerRequired as o, getColorPickerValueType as r, setColorPickerValue as s, getColorPickerId as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as COMBOBOX_SYMBOL, c as comboboxMessages, d as messageSelect, f as selectorAnchor, h as selectorSelectionItem, i as COMBOBOX_AUTOCOMPLETES, l as comboboxSelectors, m as selectorOption, n as COMBOBOX_ATTRIBUTE_SELECTION, o as COMBOBOX_TAGNAME, p as selectorContent, r as COMBOBOX_ATTRIBUTE_SELECTION_ITEM, s as comboboxAttributes, t as COMBOBOX_ATTRIBUTE_ANCHOR, u as messageLabel } from "../combobox.constants-Hb3bqqQJ.mjs";
|
|
2
|
+
export { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM, COMBOBOX_AUTOCOMPLETES, COMBOBOX_SYMBOL, COMBOBOX_TAGNAME, comboboxAttributes, comboboxMessages, comboboxSelectors, messageLabel, messageSelect, selectorAnchor, selectorContent, selectorOption, selectorSelectionItem };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
//#region src/js/combobox/constants.
|
|
1
|
+
//#region src/js/combobox/combobox.constants.ts
|
|
2
2
|
const COMBOBOX_TAGNAME = "oui-combobox";
|
|
3
3
|
const COMBOBOX_ATTRIBUTE_ANCHOR = `${COMBOBOX_TAGNAME}-anchor`;
|
|
4
|
+
const COMBOBOX_ATTRIBUTE_SELECTION = `${COMBOBOX_TAGNAME}-selection`;
|
|
5
|
+
const COMBOBOX_ATTRIBUTE_SELECTION_ITEM = `${COMBOBOX_TAGNAME}-selection-item`;
|
|
6
|
+
const COMBOBOX_AUTOCOMPLETES = /* @__PURE__ */ new Set([
|
|
7
|
+
"both",
|
|
8
|
+
"inline",
|
|
9
|
+
"list",
|
|
10
|
+
"none"
|
|
11
|
+
]);
|
|
12
|
+
const COMBOBOX_SYMBOL = Symbol(COMBOBOX_TAGNAME);
|
|
4
13
|
const attributeContent = `${COMBOBOX_TAGNAME}-content`;
|
|
5
14
|
const attributeFilter = `${COMBOBOX_TAGNAME}-filter`;
|
|
6
15
|
const attributeFilterInput = `${attributeFilter}-input`;
|
|
@@ -11,23 +20,8 @@ const attributeList = `${COMBOBOX_TAGNAME}-list`;
|
|
|
11
20
|
const attributeListEmpty = `${attributeList}-empty`;
|
|
12
21
|
const attributeMessage = `${COMBOBOX_TAGNAME}-message`;
|
|
13
22
|
const attributeOption = `${COMBOBOX_TAGNAME}-option`;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const COMBOBOX_ATTRIBUTE_SELECTION_ITEM = `${COMBOBOX_TAGNAME}-selection-item`;
|
|
17
|
-
const COMBOBOX_AUTOCOMPLETES = /* @__PURE__ */ new Set([
|
|
18
|
-
"both",
|
|
19
|
-
"inline",
|
|
20
|
-
"list",
|
|
21
|
-
"none"
|
|
22
|
-
]);
|
|
23
|
-
const messageLabel = `<${COMBOBOX_TAGNAME}> must contain a <label> element for the <select> element`;
|
|
24
|
-
const messageSelect = `<${COMBOBOX_TAGNAME}> must contain a valid <select> element`;
|
|
25
|
-
const selectorAnchor = `[${COMBOBOX_ATTRIBUTE_ANCHOR}]`;
|
|
26
|
-
const selectorContent = `[${attributeContent}]`;
|
|
27
|
-
const selectorOption = `[${attributeOption}]`;
|
|
28
|
-
const selectorSelectionItem = `[${COMBOBOX_ATTRIBUTE_SELECTION_ITEM}]`;
|
|
29
|
-
const COMBOBOX_ATTRIBUTES = {
|
|
30
|
-
active: attributeOptionActive,
|
|
23
|
+
const comboboxAttributes = {
|
|
24
|
+
active: `${COMBOBOX_TAGNAME}-option-active`,
|
|
31
25
|
content: attributeContent,
|
|
32
26
|
empty: attributeListEmpty,
|
|
33
27
|
filter: attributeFilter,
|
|
@@ -39,15 +33,21 @@ const COMBOBOX_ATTRIBUTES = {
|
|
|
39
33
|
message: attributeMessage,
|
|
40
34
|
option: attributeOption
|
|
41
35
|
};
|
|
42
|
-
const
|
|
36
|
+
const messageLabel = `<${COMBOBOX_TAGNAME}> must contain a <label> element for the <select> element`;
|
|
37
|
+
const messageSelect = `<${COMBOBOX_TAGNAME}> must contain a valid <select> element`;
|
|
38
|
+
const comboboxMessages = {
|
|
43
39
|
label: messageLabel,
|
|
44
40
|
select: messageSelect
|
|
45
41
|
};
|
|
46
|
-
const
|
|
42
|
+
const selectorAnchor = `[${COMBOBOX_ATTRIBUTE_ANCHOR}]`;
|
|
43
|
+
const selectorContent = `[${attributeContent}]`;
|
|
44
|
+
const selectorOption = `[${attributeOption}]`;
|
|
45
|
+
const selectorSelectionItem = `[${COMBOBOX_ATTRIBUTE_SELECTION_ITEM}]`;
|
|
46
|
+
const comboboxSelectors = {
|
|
47
47
|
anchor: selectorAnchor,
|
|
48
48
|
content: selectorContent,
|
|
49
49
|
selectionItem: selectorSelectionItem,
|
|
50
50
|
option: selectorOption
|
|
51
51
|
};
|
|
52
52
|
//#endregion
|
|
53
|
-
export {
|
|
53
|
+
export { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM, COMBOBOX_AUTOCOMPLETES, COMBOBOX_SYMBOL, COMBOBOX_TAGNAME, comboboxAttributes, comboboxMessages, comboboxSelectors, messageLabel, messageSelect, selectorAnchor, selectorContent, selectorOption, selectorSelectionItem };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { h as OptionListPreview, n as CreateOptionListContentParameters, t as CreateOptionListContent } from "../option-list.model-CCPUlPeX.mjs";
|
|
2
|
+
import { c as OuiComboboxSelectionItem, l as OuiComboboxState, s as OuiComboboxSelection } from "../combobox.model-gjEI2VqZ.mjs";
|
|
3
|
+
//#region src/js/combobox/combobox.dom.d.ts
|
|
4
|
+
type CreateAnchor = {
|
|
5
|
+
container?: Element;
|
|
6
|
+
element: HTMLElement;
|
|
7
|
+
selection?: OuiComboboxSelection;
|
|
8
|
+
};
|
|
9
|
+
type CreateSelectionItemsParameters = {
|
|
10
|
+
container: Element;
|
|
11
|
+
items: OuiComboboxSelectionItem[];
|
|
12
|
+
options: Element[];
|
|
13
|
+
state?: OuiComboboxState;
|
|
14
|
+
};
|
|
15
|
+
export declare function createComboboxAnchor(parameters: CreateOptionListContentParameters): CreateAnchor;
|
|
16
|
+
export declare function createComboboxButton(parameters: CreateOptionListContentParameters): CreateAnchor;
|
|
17
|
+
export declare function createComboboxContent(parameters: CreateOptionListContentParameters): CreateOptionListContent;
|
|
18
|
+
export declare function createComboboxSelection(id: string, select: HTMLSelectElement): OuiComboboxSelection;
|
|
19
|
+
export declare function createComboboxSelectionItem(option: Element, state?: OuiComboboxState): OuiComboboxSelectionItem;
|
|
20
|
+
export declare function createComboboxSelectionItems(parameters: CreateSelectionItemsParameters): void;
|
|
21
|
+
export declare function updateComboboxTabindices(state: OuiComboboxState, active?: Element): void;
|
|
22
|
+
export declare function updateComboboxAutocomplete(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
|
|
23
|
+
export declare function updateComboboxSelection(state: OuiComboboxState, active: Element | undefined, added: boolean, selected?: Element[]): void;
|
|
24
|
+
export declare function updateComboboxSelectionItems(state: OuiComboboxState): void;
|
|
25
|
+
//#endregion
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM } from "./constants.combobox.mjs";
|
|
1
|
+
import { _ as createOptionListValueLabel, f as createOptionListInput, l as createOptionListFilter, m as createOptionListMessage, p as createOptionListList } from "../option-list.data-CgMyUwPc.mjs";
|
|
2
|
+
import { COMBOBOX_ATTRIBUTE_ANCHOR, COMBOBOX_ATTRIBUTE_SELECTION, COMBOBOX_ATTRIBUTE_SELECTION_ITEM } from "./combobox.constants.mjs";
|
|
4
3
|
import { setAria } from "@oscarpalmer/toretto/aria";
|
|
5
4
|
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { createElement } from "@oscarpalmer/toretto/create";
|
|
7
6
|
import { getData } from "@oscarpalmer/toretto/data";
|
|
8
|
-
//#region src/js/combobox/dom.
|
|
7
|
+
//#region src/js/combobox/combobox.dom.ts
|
|
9
8
|
function createComboboxAnchor(parameters) {
|
|
10
9
|
const { select } = parameters;
|
|
11
10
|
let container;
|
|
12
11
|
let element;
|
|
13
12
|
let selection;
|
|
14
|
-
if (parameters.type === "autocomplete") element =
|
|
13
|
+
if (parameters.type === "autocomplete") element = createOptionListInput(parameters, select.selectedOptions[0]?.textContent ?? "");
|
|
15
14
|
else ({container, element, selection} = createComboboxButton(parameters));
|
|
16
15
|
setAttribute(container ?? element, COMBOBOX_ATTRIBUTE_ANCHOR, "");
|
|
17
16
|
return {
|
|
@@ -57,10 +56,10 @@ function createComboboxContent(parameters) {
|
|
|
57
56
|
tabIndex: -1
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
|
-
const filter =
|
|
61
|
-
const list =
|
|
62
|
-
const message =
|
|
63
|
-
const value =
|
|
59
|
+
const filter = createOptionListFilter(parameters);
|
|
60
|
+
const list = createOptionListList(parameters);
|
|
61
|
+
const message = createOptionListMessage(parameters.attributes.message);
|
|
62
|
+
const value = createOptionListValueLabel(parameters.id);
|
|
64
63
|
if (filter != null) element.append(filter.container);
|
|
65
64
|
element.append(list.element, message, value);
|
|
66
65
|
return {
|
|
@@ -94,12 +93,12 @@ function createComboboxSelectionItem(option, state) {
|
|
|
94
93
|
const optionLabel = option.textContent;
|
|
95
94
|
const optionValue = getData(option, "value", false) ?? "";
|
|
96
95
|
const element = createElement("li");
|
|
97
|
-
const localization = state == null ? option.textContent :
|
|
96
|
+
const localization = state == null ? option.textContent : state.component.localizations.localize("remove", {
|
|
97
|
+
arguments: [optionLabel, optionValue],
|
|
98
|
+
element: state.component.host
|
|
99
|
+
});
|
|
98
100
|
const button = createElement("button", {
|
|
99
|
-
aria: { label:
|
|
100
|
-
label: optionLabel,
|
|
101
|
-
value: optionValue
|
|
102
|
-
}, [optionLabel, optionValue]) },
|
|
101
|
+
aria: { label: localization },
|
|
103
102
|
attribute: {
|
|
104
103
|
[COMBOBOX_ATTRIBUTE_SELECTION_ITEM]: "",
|
|
105
104
|
tabindex: -1
|
|
@@ -133,78 +132,81 @@ function createComboboxSelectionItems(parameters) {
|
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
function updateComboboxTabindices(state, active) {
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
const { selection } = state.component;
|
|
136
|
+
if (active == null || selection == null) return;
|
|
137
|
+
const next = selection.items.find((item) => getData(item.button, "option", false) === active.id);
|
|
138
138
|
if (next == null) return;
|
|
139
|
-
const { length } =
|
|
139
|
+
const { length } = selection.items;
|
|
140
140
|
for (let index = 0; index < length; index += 1) {
|
|
141
|
-
const item =
|
|
141
|
+
const item = selection.items[index];
|
|
142
142
|
item.button.tabIndex = item === next ? 0 : -1;
|
|
143
143
|
}
|
|
144
144
|
next.button.focus();
|
|
145
145
|
}
|
|
146
146
|
function updateComboboxAutocomplete(preview, state, active) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (
|
|
147
|
+
const { anchor, filter, multiple } = state.component;
|
|
148
|
+
if (multiple) return;
|
|
149
|
+
const content = active?.textContent ?? filter.element.value;
|
|
150
|
+
if (preview === "typed" && !content.toLocaleLowerCase().startsWith(filter.element.value.toLocaleLowerCase())) return;
|
|
151
|
+
if (anchor.element instanceof HTMLInputElement) {
|
|
151
152
|
const contentLength = content.length;
|
|
152
|
-
const filterLength =
|
|
153
|
+
const filterLength = filter.element.value.length;
|
|
153
154
|
if (preview === "set" || preview === "typed") {
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
anchor.element.value = content;
|
|
156
|
+
anchor.element.setSelectionRange(preview === "typed" ? filterLength : contentLength, contentLength);
|
|
156
157
|
}
|
|
157
|
-
} else
|
|
158
|
+
} else anchor.element.textContent = content;
|
|
158
159
|
}
|
|
159
160
|
function updateComboboxSelection(state, active, added, selected) {
|
|
160
|
-
|
|
161
|
+
const { anchor, selection } = state.component;
|
|
162
|
+
if (selection == null) return;
|
|
161
163
|
let options = active == null ? [] : [active];
|
|
162
164
|
if (added && selected != null) {
|
|
163
165
|
options = selected;
|
|
164
|
-
const { length } =
|
|
165
|
-
for (let index = 0; index < length; index += 1)
|
|
166
|
-
|
|
166
|
+
const { length } = selection.items;
|
|
167
|
+
for (let index = 0; index < length; index += 1) selection.items[index].element.remove();
|
|
168
|
+
selection.items.splice(0);
|
|
167
169
|
}
|
|
168
170
|
if (added) {
|
|
169
171
|
createComboboxSelectionItems({
|
|
170
172
|
options,
|
|
171
173
|
state,
|
|
172
|
-
container:
|
|
173
|
-
items:
|
|
174
|
+
container: selection.container,
|
|
175
|
+
items: selection.items
|
|
174
176
|
});
|
|
175
177
|
return;
|
|
176
178
|
}
|
|
177
|
-
let current =
|
|
179
|
+
let current = selection.items.findIndex((item) => getData(item.button, "option", false) === active?.id);
|
|
178
180
|
if (current === -1) return;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
|
|
181
|
+
selection.items[current].element.remove();
|
|
182
|
+
selection.items.splice(current, 1);
|
|
183
|
+
if (selection.items.length === 0) {
|
|
184
|
+
anchor.element.focus();
|
|
183
185
|
return;
|
|
184
186
|
}
|
|
185
|
-
const { length } =
|
|
187
|
+
const { length } = selection.items;
|
|
186
188
|
if (current < 0) current = 0;
|
|
187
189
|
else if (current >= length) current = length - 1;
|
|
188
190
|
for (let index = 0; index < length; index += 1) {
|
|
189
|
-
const { button } =
|
|
191
|
+
const { button } = selection.items[index];
|
|
190
192
|
button.tabIndex = index === current ? 0 : -1;
|
|
191
193
|
}
|
|
192
|
-
|
|
194
|
+
selection.items[current].button.focus();
|
|
193
195
|
}
|
|
194
196
|
function updateComboboxSelectionItems(state) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const { length } =
|
|
197
|
+
const { host, localizations, options, selection } = state.component;
|
|
198
|
+
if (selection == null) return;
|
|
199
|
+
const { length } = selection.items;
|
|
198
200
|
for (let index = 0; index < length; index += 1) {
|
|
199
|
-
const item =
|
|
200
|
-
const option =
|
|
201
|
+
const item = selection.items[index];
|
|
202
|
+
const option = options.selected.find((option) => option.id === getData(item.button, "option", false));
|
|
201
203
|
if (option == null) continue;
|
|
202
204
|
const optionLabel = option.textContent;
|
|
203
205
|
const optionValue = getData(option, "value", false) ?? "";
|
|
204
|
-
setAria(item.button, "label", localize(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
206
|
+
setAria(item.button, "label", localizations.localize("remove", {
|
|
207
|
+
arguments: [optionLabel, optionValue],
|
|
208
|
+
element: host
|
|
209
|
+
}));
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
//#endregion
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OuiComboboxState } from "
|
|
3
|
-
//#region src/js/combobox/event.
|
|
1
|
+
import { h as OptionListPreview } from "../option-list.model-CCPUlPeX.mjs";
|
|
2
|
+
import { l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
|
|
3
|
+
//#region src/js/combobox/combobox.event.d.ts
|
|
4
4
|
export declare function onComboboxActivation(state: OuiComboboxState): void;
|
|
5
|
-
export declare function onComboboxApply(state: OuiComboboxState, option:
|
|
5
|
+
export declare function onComboboxApply(state: OuiComboboxState, option: Element | undefined, _: string[], added: boolean, selected?: Element[]): void;
|
|
6
6
|
export declare function onComboboxClickContent(event: PointerEvent, state: OuiComboboxState): void;
|
|
7
7
|
export declare function onComboboxEnter(state: OuiComboboxState): void;
|
|
8
8
|
export declare function onComboboxEscape(state: OuiComboboxState): void;
|
|
9
|
-
export declare function onComboboxFilter(preview:
|
|
9
|
+
export declare function onComboboxFilter(preview: OptionListPreview, state: OuiComboboxState, update: boolean, active?: Element, emit?: boolean): void;
|
|
10
10
|
export declare function onComboboxFocusout(event: FocusEvent): void;
|
|
11
11
|
export declare function onComboboxInput(event: InputEvent): void;
|
|
12
12
|
export declare function onComboboxKeydown(event: KeyboardEvent): void;
|
|
13
|
-
export declare function onComboboxKeydownSelection(event: KeyboardEvent, state: OuiComboboxState, item:
|
|
14
|
-
export declare function onComboboxPreview(preview:
|
|
15
|
-
export declare function onComboboxRemoveSelection(state: OuiComboboxState, item:
|
|
16
|
-
export declare function onComboboxNavigation(preview:
|
|
13
|
+
export declare function onComboboxKeydownSelection(event: KeyboardEvent, state: OuiComboboxState, item: Element): void;
|
|
14
|
+
export declare function onComboboxPreview(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
|
|
15
|
+
export declare function onComboboxRemoveSelection(state: OuiComboboxState, item: Element): void;
|
|
16
|
+
export declare function onComboboxNavigation(preview: OptionListPreview, state: OuiComboboxState, active?: Element): void;
|
|
17
17
|
export declare function onComboboxSelection(state: OuiComboboxState, hasSelection?: boolean): void;
|
|
18
18
|
export declare function onComboboxTab(state: OuiComboboxState): void;
|
|
19
19
|
export declare function onComboboxToggle(state: OuiComboboxState): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as skipComboboxNavigation, S as preventComboboxActivation, _ as onComboboxPreview, b as onComboboxTab, c as onComboboxClickContent, d as onComboboxFilter, f as onComboboxFocusout, g as onComboboxNavigation, h as onComboboxKeydownSelection, l as onComboboxEnter, m as onComboboxKeydown, o as onComboboxActivation, p as onComboboxInput, s as onComboboxApply, u as onComboboxEscape, v as onComboboxRemoveSelection, x as onComboboxToggle, y as onComboboxSelection } from "../state
|
|
1
|
+
import { C as skipComboboxNavigation, S as preventComboboxActivation, _ as onComboboxPreview, b as onComboboxTab, c as onComboboxClickContent, d as onComboboxFilter, f as onComboboxFocusout, g as onComboboxNavigation, h as onComboboxKeydownSelection, l as onComboboxEnter, m as onComboboxKeydown, o as onComboboxActivation, p as onComboboxInput, s as onComboboxApply, u as onComboboxEscape, v as onComboboxRemoveSelection, x as onComboboxToggle, y as onComboboxSelection } from "../combobox.state-AstCICiH.mjs";
|
|
2
2
|
export { onComboboxActivation, onComboboxApply, onComboboxClickContent, onComboboxEnter, onComboboxEscape, onComboboxFilter, onComboboxFocusout, onComboboxInput, onComboboxKeydown, onComboboxKeydownSelection, onComboboxNavigation, onComboboxPreview, onComboboxRemoveSelection, onComboboxSelection, onComboboxTab, onComboboxToggle, preventComboboxActivation, skipComboboxNavigation };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as OuiComboboxLocalizations, c as OuiComboboxSelectionItem, d as OuiComboboxValues, i as OuiComboboxLabel, l as OuiComboboxState, n as OuiComboboxFilter, o as OuiComboboxOptions, r as OuiComboboxGroup, s as OuiComboboxSelection, t as OuiComboboxAnchor, u as OuiComboboxStateExtras } from "../combobox.model-gjEI2VqZ.mjs";
|
|
2
|
+
export { OuiComboboxAnchor, OuiComboboxFilter, OuiComboboxGroup, OuiComboboxLabel, OuiComboboxLocalizations, OuiComboboxOptions, OuiComboboxSelection, OuiComboboxSelectionItem, OuiComboboxState, OuiComboboxStateExtras, OuiComboboxValues };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { u as OuiDefaultLocalizations } from "../l10n.model-D1E1u35L.mjs";
|
|
2
|
+
import { a as OuiComboboxLocalizations, l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
|
|
3
|
+
//#region src/js/combobox/combobox.state.d.ts
|
|
4
|
+
export declare function initializeCombobox(element: HTMLElement, state: OuiComboboxState): void;
|
|
5
|
+
export declare function onAttachCombobox(state: OuiComboboxState): void;
|
|
6
|
+
export declare function onDetachCombobox(state: OuiComboboxState): void;
|
|
7
|
+
export declare const comboboxLocalizations: OuiDefaultLocalizations<OuiComboboxLocalizations>;
|
|
8
|
+
export declare const comboboxes: Set<OuiComboboxState>;
|
|
9
|
+
//#endregion
|