@oscarpalmer/oui 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/color-picker.css +80 -69
- package/dist/css/listbox.css +169 -0
- package/dist/js/color-picker/color-picker.constants.d.mts +2 -2
- package/dist/js/color-picker/color-picker.constants.mjs +5 -3
- package/dist/js/color-picker/color-picker.dom.d.mts +1 -1
- package/dist/js/color-picker/color-picker.dom.mjs +31 -14
- package/dist/js/color-picker/color-picker.event.d.mts +2 -2
- package/dist/js/color-picker/color-picker.event.mjs +232 -1
- package/dist/js/color-picker/color-picker.form.d.mts +1 -1
- package/dist/js/color-picker/color-picker.form.mjs +1 -3
- package/dist/js/color-picker/color-picker.misc.d.mts +2 -2
- package/dist/js/color-picker/color-picker.misc.mjs +104 -2
- package/dist/js/color-picker/color-picker.model.d.mts +2 -2
- package/dist/js/color-picker/color-picker.output.d.mts +1 -1
- package/dist/js/color-picker/color-picker.output.mjs +7 -8
- package/dist/js/color-picker/color-picker.state.d.mts +1 -1
- package/dist/js/color-picker/color-picker.state.mjs +167 -1
- package/dist/js/color-picker/index.d.mts +7 -15
- package/dist/js/color-picker/index.mjs +11 -6
- package/dist/js/{color-picker.constants-D1mxw_Le.d.mts → color-picker.constants-BZgXQr5o.d.mts} +6 -8
- package/dist/js/{color-picker.misc-CtsXGrOe.d.mts → color-picker.misc-BIS3R6jk.d.mts} +8 -4
- package/dist/js/combobox/combobox.constants.d.mts +1 -1
- package/dist/js/combobox/combobox.dom.d.mts +12 -13
- package/dist/js/combobox/combobox.dom.mjs +15 -17
- package/dist/js/combobox/combobox.event.d.mts +8 -8
- package/dist/js/combobox/combobox.event.mjs +1 -1
- package/dist/js/combobox/combobox.misc.d.mts +2 -2
- package/dist/js/combobox/combobox.misc.mjs +2 -2
- package/dist/js/combobox/combobox.model.d.mts +2 -2
- package/dist/js/combobox/combobox.state.d.mts +3 -4
- package/dist/js/combobox/combobox.state.mjs +1 -1
- package/dist/js/combobox/index.d.mts +8 -19
- package/dist/js/combobox/index.mjs +21 -23
- package/dist/js/{combobox.constants-DZVkMP5g.d.mts → combobox.constants-Hb3bqqQJ.d.mts} +3 -3
- package/dist/js/combobox.misc-DRDFk6X8.d.mts +26 -0
- package/dist/js/combobox.model-gjEI2VqZ.d.mts +46 -0
- package/dist/js/{combobox.state-BfJ3Hxg8.mjs → combobox.state-AstCICiH.mjs} +30 -41
- package/dist/js/dialog/dialog.model.d.mts +1 -1
- package/dist/js/dialog/index.d.mts +1 -1
- package/dist/js/{dialog.model-DX2mndMh.d.mts → dialog.model-HVzYWoDo.d.mts} +3 -3
- package/dist/js/floatable/floatable.embedded.d.mts +1 -1
- package/dist/js/floatable/floatable.embedded.mjs +2 -2
- package/dist/js/floatable/floatable.standalone.d.mts +1 -1
- package/dist/js/{floatable.embedded-MeTyXjFn.d.mts → floatable.embedded-ncshL3Sa.d.mts} +3 -3
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.mjs +10 -9
- package/dist/js/focus-trap/focus-trap.model.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -2
- package/dist/js/{focus-trap.embedded-DIU05m1z.d.mts → focus-trap.embedded-DpcPkP7c.d.mts} +3 -3
- package/dist/js/{focus-trap.model-BeX6UYlw.d.mts → focus-trap.model-CpltX5B5.d.mts} +1 -1
- package/dist/js/index.d.mts +16 -16
- package/dist/js/index.mjs +3 -3
- package/dist/js/internal/attributable.d.mts +1 -1
- package/dist/js/internal/draggable/draggable.model.d.mts +1 -1
- package/dist/js/internal/draggable/index.d.mts +8 -8
- package/dist/js/internal/draggable/index.mjs +27 -18
- package/dist/js/internal/l10n/index.d.mts +5 -0
- package/dist/js/internal/l10n/index.mjs +147 -0
- package/dist/js/internal/l10n/l10n.model.d.mts +2 -0
- package/dist/js/{l10n → internal/l10n}/l10n.model.mjs +5 -2
- package/dist/js/internal/misc.d.mts +2 -2
- package/dist/js/internal/navigable/index.d.mts +3 -3
- package/dist/js/internal/navigable/index.mjs +1 -1
- package/dist/js/internal/navigable/navigable.model.d.mts +1 -1
- package/dist/js/internal/option-list/option-list.constants.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.constants.mjs +22 -0
- package/dist/js/internal/option-list/option-list.data.d.mts +21 -0
- package/dist/js/internal/option-list/option-list.data.mjs +2 -0
- package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
- package/dist/js/internal/option-list/option-list.dom.mjs +2 -0
- package/dist/js/internal/option-list/option-list.event.d.mts +6 -0
- package/dist/js/internal/{listbox/listbox.event.mjs → option-list/option-list.event.mjs} +7 -7
- package/dist/js/internal/option-list/option-list.form.d.mts +7 -0
- package/dist/js/internal/{listbox/listbox.form.mjs → option-list/option-list.form.mjs} +10 -13
- package/dist/js/internal/option-list/option-list.misc.d.mts +13 -0
- package/dist/js/internal/option-list/option-list.misc.mjs +2 -0
- package/dist/js/internal/option-list/option-list.model.d.mts +2 -0
- package/dist/js/internal/option-list/option-list.state.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.state.mjs +39 -0
- package/dist/js/l10n/index.d.mts +3 -9
- package/dist/js/l10n/index.mjs +2 -107
- package/dist/js/l10n.model-D1E1u35L.d.mts +54 -0
- package/dist/js/listbox/index.d.mts +6 -17
- package/dist/js/listbox/index.mjs +22 -23
- package/dist/js/listbox/{constants.listbox.d.mts → listbox.constants.d.mts} +1 -1
- package/dist/js/listbox/{constants.listbox.mjs → listbox.constants.mjs} +1 -1
- package/dist/js/listbox/listbox.dom.d.mts +5 -0
- package/dist/js/listbox/listbox.dom.mjs +2 -0
- package/dist/js/listbox/listbox.event.d.mts +9 -0
- package/dist/js/listbox/listbox.event.mjs +2 -0
- package/dist/js/listbox/listbox.misc.d.mts +2 -0
- package/dist/js/listbox/listbox.misc.mjs +2 -0
- package/dist/js/listbox/listbox.model.d.mts +2 -0
- package/dist/js/listbox/listbox.model.mjs +1 -0
- package/dist/js/listbox/listbox.state.d.mts +9 -0
- package/dist/js/listbox/listbox.state.mjs +2 -0
- package/dist/js/{constants.listbox-C5Ap6Ag_.d.mts → listbox.constants-DOBMwKup.d.mts} +3 -3
- package/dist/js/listbox.misc-DwfB4Mu_.d.mts +24 -0
- package/dist/js/listbox.model-C0MYWXZe.d.mts +20 -0
- package/dist/js/listbox.state-BrN296BM.mjs +240 -0
- package/dist/js/menu/index.mjs +7 -3
- package/dist/js/menu/menu.model.d.mts +7 -7
- package/dist/js/movable/movable.embedded.d.mts +1 -1
- package/dist/js/movable/movable.embedded.mjs +21 -18
- package/dist/js/movable/movable.model.d.mts +1 -1
- package/dist/js/movable/movable.standalone.d.mts +2 -2
- package/dist/js/{movable.embedded-DoyXLegc.d.mts → movable.embedded-C1bDTLGs.d.mts} +2 -2
- package/dist/js/{movable.model-BHaK_mKw.d.mts → movable.model-D9nnPWKk.d.mts} +41 -41
- package/dist/js/{navigable.model-BPOM8DZk.d.mts → navigable.model-BqoR6iBv.d.mts} +1 -1
- package/dist/js/{listbox.data-BQyZGKgr.mjs → option-list.data-CgMyUwPc.mjs} +70 -71
- package/dist/js/option-list.model-CCPUlPeX.d.mts +169 -0
- package/dist/js/popover/index.d.mts +2 -2
- package/dist/js/popover/index.mjs +1 -1
- package/dist/js/popover/popover.model.d.mts +1 -1
- package/dist/js/{popover.model-ubKNG612.d.mts → popover.model-DiLdz0Hc.d.mts} +4 -4
- package/dist/js/resizable/resizable.embedded.d.mts +1 -1
- package/dist/js/resizable/resizable.model.d.mts +1 -1
- package/dist/js/resizable/resizable.standalone.d.mts +2 -2
- package/dist/js/{resizable.embedded-Bf1qBUdt.d.mts → resizable.embedded-BemH-7Re.d.mts} +2 -2
- package/dist/js/{resizable.model-BwzJcTVJ.d.mts → resizable.model-YEtcC9li.d.mts} +3 -3
- package/dist/js/sortable/sortable.embedded.d.mts +1 -1
- package/dist/js/sortable/sortable.embedded.mjs +46 -38
- package/dist/js/sortable/sortable.model.d.mts +1 -1
- package/dist/js/sortable/sortable.standalone.d.mts +2 -2
- package/dist/js/{sortable.embedded-DzBKAwSG.d.mts → sortable.embedded-CrEGff9k.d.mts} +2 -2
- package/dist/js/splitter/index.d.mts +1 -1
- package/dist/js/splitter/splitter.model.d.mts +1 -1
- package/dist/js/{splitter.model-DOLNjLVS.d.mts → splitter.model-C24W6eZ7.d.mts} +2 -2
- package/dist/js/tabs/index.d.mts +2 -2
- package/dist/js/tabs/index.mjs +1 -1
- package/dist/js/tabs/tabs.model.d.mts +1 -1
- package/dist/js/{tabs.model-DRBX_JtI.d.mts → tabs.model-BHPy7fPo.d.mts} +1 -1
- package/dist/js/toolbar/toolbar.model.d.mts +2 -2
- package/dist/js/tooltip/index.d.mts +2 -2
- package/dist/js/tooltip/tooltip.model.d.mts +1 -1
- package/dist/js/{tooltip.model-DRkY_BsL.d.mts → tooltip.model-BpNStw5z.d.mts} +3 -3
- package/package.json +1 -1
- package/dist/js/color-picker.event-Cksj5TvS.mjs +0 -500
- package/dist/js/combobox.misc-C1tPZZDi.d.mts +0 -22
- package/dist/js/combobox.model-oDV06XCN.d.mts +0 -44
- package/dist/js/internal/listbox/listbox.constants.d.mts +0 -8
- package/dist/js/internal/listbox/listbox.constants.mjs +0 -22
- package/dist/js/internal/listbox/listbox.data.d.mts +0 -19
- package/dist/js/internal/listbox/listbox.data.mjs +0 -2
- package/dist/js/internal/listbox/listbox.dom.d.mts +0 -65
- package/dist/js/internal/listbox/listbox.dom.mjs +0 -2
- package/dist/js/internal/listbox/listbox.event.d.mts +0 -4
- package/dist/js/internal/listbox/listbox.form.d.mts +0 -5
- package/dist/js/internal/listbox/listbox.misc.d.mts +0 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +0 -2
- package/dist/js/internal/listbox/listbox.model.d.mts +0 -2
- package/dist/js/internal/listbox/listbox.state.d.mts +0 -6
- package/dist/js/internal/listbox/listbox.state.mjs +0 -39
- package/dist/js/l10n/l10n.model.d.mts +0 -2
- package/dist/js/l10n.model-D6a9frgl.d.mts +0 -26
- package/dist/js/listbox/event.listbox.d.mts +0 -7
- package/dist/js/listbox/event.listbox.mjs +0 -48
- package/dist/js/listbox/misc.listbox.d.mts +0 -2
- package/dist/js/listbox/misc.listbox.mjs +0 -2
- package/dist/js/listbox/state.listbox.d.mts +0 -9
- package/dist/js/listbox/state.listbox.mjs +0 -2
- package/dist/js/listbox.model-CuBOj4qe.d.mts +0 -129
- package/dist/js/misc.listbox-CjfBUbHD.mjs +0 -154
- package/dist/js/misc.listbox-CtoGvXQo.d.mts +0 -20
- /package/dist/js/internal/{listbox/listbox.model.mjs → option-list/option-list.model.mjs} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { updateListboxForm, updateListboxValidity } from "./internal/listbox/listbox.form.mjs";
|
|
1
|
+
import { optionListScrollOptions } from "./internal/option-list/option-list.constants.mjs";
|
|
2
|
+
import { updateOptionListForm, updateOptionListValidity } from "./internal/option-list/option-list.form.mjs";
|
|
4
3
|
import { setAria } from "@oscarpalmer/toretto/aria";
|
|
5
4
|
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { dispatch } from "@oscarpalmer/toretto/event";
|
|
@@ -8,8 +7,8 @@ import { filter } from "@oscarpalmer/atoms/array/filter";
|
|
|
8
7
|
import { createElement } from "@oscarpalmer/toretto/create";
|
|
9
8
|
import { getString } from "@oscarpalmer/atoms/string";
|
|
10
9
|
import { getData } from "@oscarpalmer/toretto/data";
|
|
11
|
-
//#region src/js/internal/
|
|
12
|
-
function
|
|
10
|
+
//#region src/js/internal/option-list/option-list.misc.ts
|
|
11
|
+
function generateOptionListIds(prefix, select) {
|
|
13
12
|
const elements = [...select.children].flatMap((child) => child instanceof HTMLOptGroupElement ? [child, ...filter([...child.children], (groupChild) => groupChild instanceof HTMLOptionElement)] : child instanceof HTMLOptionElement ? [child] : []);
|
|
14
13
|
const { length } = elements;
|
|
15
14
|
for (let index = 0; index < length; index += 1) {
|
|
@@ -17,31 +16,31 @@ function generateListboxIds(prefix, select) {
|
|
|
17
16
|
if (element.id === "") element.id = `${prefix}${element instanceof HTMLOptGroupElement ? "_group_" : "_option_"}${index}`;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function getOptionListVisibleOptions(state) {
|
|
21
20
|
return state.component.options.all.filter((option) => !option.hidden);
|
|
22
21
|
}
|
|
23
|
-
function
|
|
22
|
+
function setOptionListDisabled(state, value) {
|
|
24
23
|
state.component.filter.element.readOnly = state.component.readonly || value;
|
|
25
24
|
setProperties("disabled", state, value);
|
|
26
25
|
}
|
|
27
|
-
function
|
|
26
|
+
function setOptionListFilter(state, value) {
|
|
28
27
|
if (typeof value !== "string") return;
|
|
29
28
|
const { filter } = state.component;
|
|
30
29
|
const type = value.length < filter.element.value.length ? "deleteContentBackward" : "insertText";
|
|
31
30
|
filter.element.value = value;
|
|
32
|
-
|
|
31
|
+
filterOptionList(type, state);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function setOptionListLimit(type, state, value) {
|
|
35
34
|
const { component } = state;
|
|
36
35
|
let actual = value;
|
|
37
36
|
if (typeof actual === "string") actual = Number.parseInt(actual, 10);
|
|
38
37
|
if (typeof actual === "number" && !Number.isNaN(actual) && actual >= 0 ? actual !== component[type] : actual == null) {
|
|
39
38
|
component[type] = actual;
|
|
40
39
|
setAttribute(component.host, type, actual);
|
|
41
|
-
|
|
40
|
+
updateOptionListValidity(state);
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function setOptionListMultiple(element, value) {
|
|
45
44
|
if (value) element.setAttribute("multiple", "");
|
|
46
45
|
else element.removeAttribute("multiple");
|
|
47
46
|
}
|
|
@@ -56,23 +55,23 @@ function setProperties(key, state, value) {
|
|
|
56
55
|
setAria(element, key, key !== "readonly" || !(element instanceof HTMLButtonElement) ? value : void 0);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
|
-
function
|
|
58
|
+
function setOptionListReadonly(state, value) {
|
|
60
59
|
const { disabled, filter } = state.component;
|
|
61
60
|
filter.element.readOnly = disabled || value;
|
|
62
61
|
setProperties("readonly", state, value);
|
|
63
62
|
}
|
|
64
|
-
function
|
|
63
|
+
function setOptionListRequired(state, value) {
|
|
65
64
|
setProperties("required", state, value);
|
|
66
|
-
|
|
65
|
+
updateOptionListValidity(state);
|
|
67
66
|
}
|
|
68
67
|
//#endregion
|
|
69
|
-
//#region src/js/internal/
|
|
70
|
-
function
|
|
68
|
+
//#region src/js/internal/option-list/option-list.dom.ts
|
|
69
|
+
function createOptionListContent(parameters) {
|
|
71
70
|
const element = createElement("div", { attribute: { [parameters.attributes.content]: "" } });
|
|
72
|
-
const filter =
|
|
73
|
-
const list =
|
|
74
|
-
const message =
|
|
75
|
-
const value =
|
|
71
|
+
const filter = createOptionListFilter(parameters);
|
|
72
|
+
const list = createOptionListList(parameters);
|
|
73
|
+
const message = createOptionListMessage(parameters.attributes.message);
|
|
74
|
+
const value = createOptionListValueLabel(parameters.id);
|
|
76
75
|
if (filter != null) element.append(filter.container);
|
|
77
76
|
element.append(list.element, message, value);
|
|
78
77
|
return {
|
|
@@ -83,10 +82,10 @@ function createListboxContent(parameters) {
|
|
|
83
82
|
value
|
|
84
83
|
};
|
|
85
84
|
}
|
|
86
|
-
function
|
|
85
|
+
function createOptionListFilter(parameters) {
|
|
87
86
|
if (parameters.type === "autocomplete") return;
|
|
88
87
|
const container = createElement("div", { attribute: { [parameters.attributes.filter]: "" } });
|
|
89
|
-
const element =
|
|
88
|
+
const element = createOptionListInput(parameters, "");
|
|
90
89
|
setAttribute(element, parameters.attributes.input, "");
|
|
91
90
|
container.append(element);
|
|
92
91
|
return {
|
|
@@ -94,19 +93,19 @@ function createListboxFilter(parameters) {
|
|
|
94
93
|
element
|
|
95
94
|
};
|
|
96
95
|
}
|
|
97
|
-
function
|
|
96
|
+
function createOptionListGroup(parameters) {
|
|
98
97
|
const { group, groupOptions, selected, type } = parameters;
|
|
99
98
|
const element = createElement("li", {
|
|
100
99
|
aria: { label: group.label },
|
|
101
100
|
property: { role: "group" }
|
|
102
101
|
});
|
|
103
102
|
const list = createElement("ul", { property: { role: "none" } });
|
|
104
|
-
const header =
|
|
103
|
+
const header = createOptionListHeader(parameters, group);
|
|
105
104
|
element.append(header, list);
|
|
106
105
|
return {
|
|
107
106
|
element,
|
|
108
107
|
header,
|
|
109
|
-
options:
|
|
108
|
+
options: createOptionListOptions({
|
|
110
109
|
list,
|
|
111
110
|
selected,
|
|
112
111
|
type,
|
|
@@ -116,7 +115,7 @@ function createListboxGroup(parameters) {
|
|
|
116
115
|
})
|
|
117
116
|
};
|
|
118
117
|
}
|
|
119
|
-
function
|
|
118
|
+
function createOptionListHeader(parameters, group) {
|
|
120
119
|
return createElement("div", {
|
|
121
120
|
aria: { hidden: true },
|
|
122
121
|
attribute: { [parameters.original.attributes.header]: "" },
|
|
@@ -126,7 +125,7 @@ function createListboxHeader(parameters, group) {
|
|
|
126
125
|
}
|
|
127
126
|
});
|
|
128
127
|
}
|
|
129
|
-
function
|
|
128
|
+
function createOptionListInput(parameters, value) {
|
|
130
129
|
const { autocomplete, id, label, listbox, type } = parameters;
|
|
131
130
|
const isAutocomplete = type === "autocomplete";
|
|
132
131
|
const input = createElement("input", {
|
|
@@ -153,7 +152,7 @@ function createListboxInput(parameters, value) {
|
|
|
153
152
|
if (isAutocomplete || listbox) setAria(input, "expanded", listbox);
|
|
154
153
|
return input;
|
|
155
154
|
}
|
|
156
|
-
function
|
|
155
|
+
function createOptionListList(parameters) {
|
|
157
156
|
const { attributes, id, label, multiple, select, type } = parameters;
|
|
158
157
|
const element = createElement("ul", {
|
|
159
158
|
aria: {
|
|
@@ -177,7 +176,7 @@ function createListboxList(parameters) {
|
|
|
177
176
|
for (let childIndex = 0; childIndex < childrenLength; childIndex += 1) {
|
|
178
177
|
const child = children[childIndex];
|
|
179
178
|
if (child instanceof HTMLOptionElement) {
|
|
180
|
-
const option =
|
|
179
|
+
const option = createOptionListOption({
|
|
181
180
|
type,
|
|
182
181
|
option: child,
|
|
183
182
|
original: parameters,
|
|
@@ -189,7 +188,7 @@ function createListboxList(parameters) {
|
|
|
189
188
|
continue;
|
|
190
189
|
}
|
|
191
190
|
if (!(child instanceof HTMLOptGroupElement)) continue;
|
|
192
|
-
const group =
|
|
191
|
+
const group = createOptionListGroup({
|
|
193
192
|
selected,
|
|
194
193
|
type,
|
|
195
194
|
group: child,
|
|
@@ -210,7 +209,7 @@ function createListboxList(parameters) {
|
|
|
210
209
|
}
|
|
211
210
|
};
|
|
212
211
|
}
|
|
213
|
-
function
|
|
212
|
+
function createOptionListMessage(attribute) {
|
|
214
213
|
return createElement("div", {
|
|
215
214
|
aria: { live: "polite" },
|
|
216
215
|
attribute: { [attribute]: "" },
|
|
@@ -220,7 +219,7 @@ function createListboxMessage(attribute) {
|
|
|
220
219
|
}
|
|
221
220
|
});
|
|
222
221
|
}
|
|
223
|
-
function
|
|
222
|
+
function createOptionListOption(parameters) {
|
|
224
223
|
const { group, option, original } = parameters;
|
|
225
224
|
return createElement("li", {
|
|
226
225
|
aria: { selected: (parameters.type === "select" || !original.autocomplete.none) && option.selected },
|
|
@@ -236,12 +235,12 @@ function createListboxOption(parameters) {
|
|
|
236
235
|
}
|
|
237
236
|
});
|
|
238
237
|
}
|
|
239
|
-
function
|
|
238
|
+
function createOptionListOptions(parameters) {
|
|
240
239
|
const { group, list, options, original, selected, type } = parameters;
|
|
241
240
|
const items = [];
|
|
242
241
|
for (let index = 0; index < options.length; index += 1) {
|
|
243
242
|
const option = options[index];
|
|
244
|
-
const item =
|
|
243
|
+
const item = createOptionListOption({
|
|
245
244
|
group,
|
|
246
245
|
index,
|
|
247
246
|
option,
|
|
@@ -254,30 +253,30 @@ function createListboxOptions(parameters) {
|
|
|
254
253
|
}
|
|
255
254
|
return items;
|
|
256
255
|
}
|
|
257
|
-
function
|
|
256
|
+
function createOptionListValueLabel(id) {
|
|
258
257
|
return createElement("span", { property: {
|
|
259
258
|
hidden: true,
|
|
260
259
|
id: `${id}_value`
|
|
261
260
|
} });
|
|
262
261
|
}
|
|
263
|
-
function
|
|
262
|
+
function updateOptionListMessage(state) {
|
|
264
263
|
const { attributes, host, localizations, message } = state.component;
|
|
265
|
-
const visible =
|
|
264
|
+
const visible = getOptionListVisibleOptions(state).length;
|
|
266
265
|
setAttribute(message, attributes.hidden, visible > 0 ? "" : void 0);
|
|
267
|
-
let data = {};
|
|
268
266
|
let parameters = [];
|
|
269
267
|
let key;
|
|
270
268
|
if (visible === 0) key = "empty";
|
|
271
269
|
else {
|
|
272
|
-
data = { amount: visible };
|
|
273
270
|
key = "results";
|
|
274
271
|
parameters = [visible];
|
|
275
272
|
}
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
message.textContent = localizations.localize(key, {
|
|
274
|
+
arguments: parameters,
|
|
275
|
+
element: host
|
|
276
|
+
});
|
|
278
277
|
message.hidden = false;
|
|
279
278
|
}
|
|
280
|
-
function
|
|
279
|
+
function updateOptionListPreview(preview, state, active, scroll) {
|
|
281
280
|
const { attributes, callbacks, content, filter, options } = state.component;
|
|
282
281
|
const { length } = options.all;
|
|
283
282
|
for (let index = 0; index < length; index += 1) {
|
|
@@ -286,22 +285,22 @@ function updateListboxPreview(preview, state, active, scroll) {
|
|
|
286
285
|
}
|
|
287
286
|
state.component.active = active;
|
|
288
287
|
setAria(filter.element, "activedescendant", content.checkVisibility() ? active?.id : void 0);
|
|
289
|
-
if (scroll ?? true) active?.scrollIntoView(
|
|
288
|
+
if (scroll ?? true) active?.scrollIntoView(optionListScrollOptions);
|
|
290
289
|
if (preview !== "none") callbacks.data.onPreview(preview, state, active);
|
|
291
290
|
}
|
|
292
|
-
function
|
|
291
|
+
function updateOptionListValueLabel(state) {
|
|
293
292
|
const { autocomplete, filter, listbox, localizations, host, options, multiple, values } = state.component;
|
|
294
293
|
let label;
|
|
295
|
-
if (multiple) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
294
|
+
if (multiple) label = localizations.localize("selected", {
|
|
295
|
+
arguments: [options.selected.length],
|
|
296
|
+
element: host
|
|
297
|
+
});
|
|
298
|
+
else label = autocomplete.none && !listbox ? filter.element.value : options.selected[0]?.textContent ?? "";
|
|
300
299
|
values.label.textContent = label;
|
|
301
300
|
}
|
|
302
301
|
//#endregion
|
|
303
|
-
//#region src/js/internal/
|
|
304
|
-
function
|
|
302
|
+
//#region src/js/internal/option-list/option-list.data.ts
|
|
303
|
+
function applyOptionListSelection(parameters) {
|
|
305
304
|
const { added, emit, option, scroll, selected, state } = parameters;
|
|
306
305
|
const { component } = state;
|
|
307
306
|
const { autocomplete, callbacks, filter, listbox, options, type } = component;
|
|
@@ -314,17 +313,17 @@ function applyListboxSelection(parameters) {
|
|
|
314
313
|
if (values.length === 0) values.push("");
|
|
315
314
|
if (selected != null) options.selected = selected;
|
|
316
315
|
if (!(values.length === component.values.current.length ? values.some((value) => !component.values.current.includes(value)) : true)) return;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
updateOptionListForm(state, values, emit);
|
|
317
|
+
updateOptionListMessage(state);
|
|
318
|
+
updateOptionListPreview("set", state, option, scroll);
|
|
319
|
+
updateOptionListValueLabel(state);
|
|
321
320
|
callbacks.data.onApply(state, option, values, added, selected, emit);
|
|
322
321
|
}
|
|
323
|
-
function
|
|
322
|
+
function filterOptionList(type, state) {
|
|
324
323
|
const { callbacks, disabled, filter, host, readonly } = state.component;
|
|
325
324
|
if (disabled || readonly) return;
|
|
326
325
|
const update = filter.element.value !== filter.value;
|
|
327
|
-
const option =
|
|
326
|
+
const option = filterOptionListOptions(state);
|
|
328
327
|
let preview;
|
|
329
328
|
if (type.includes("delete")) preview = "none";
|
|
330
329
|
else if (type.includes("insert")) preview = "typed";
|
|
@@ -334,11 +333,11 @@ function filterListbox(type, state) {
|
|
|
334
333
|
dispatch(host, "input");
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
|
-
function
|
|
336
|
+
function filterOptionListOption(state, value, textContent) {
|
|
338
337
|
const { options } = state.component;
|
|
339
338
|
const filterTextContent = textContent ?? false;
|
|
340
339
|
const filter = getString(value).toLocaleLowerCase();
|
|
341
|
-
|
|
340
|
+
filterOptionListOptions(state);
|
|
342
341
|
const { length } = options.all;
|
|
343
342
|
let match;
|
|
344
343
|
for (let index = 0; index < length; index += 1) {
|
|
@@ -350,7 +349,7 @@ function filterListboxOption(state, value, textContent) {
|
|
|
350
349
|
}
|
|
351
350
|
return match;
|
|
352
351
|
}
|
|
353
|
-
function
|
|
352
|
+
function filterOptionListOptions(state) {
|
|
354
353
|
function filterOptions(options) {
|
|
355
354
|
const { length } = options;
|
|
356
355
|
let count = 0;
|
|
@@ -376,24 +375,24 @@ function filterListboxOptions(state) {
|
|
|
376
375
|
}
|
|
377
376
|
}
|
|
378
377
|
setAttribute(list, attributes.empty, visible.length === 0 ? "" : void 0);
|
|
379
|
-
|
|
378
|
+
updateOptionListMessage(state);
|
|
380
379
|
return active != null && visible.includes(active) ? active : visible[0];
|
|
381
380
|
}
|
|
382
|
-
function
|
|
381
|
+
function setOptionListValue(state, value, emit) {
|
|
383
382
|
const { autocomplete, listbox } = state.component;
|
|
384
383
|
if (autocomplete.none && !listbox) {
|
|
385
|
-
|
|
384
|
+
setOptionListFilter(state, getString(value));
|
|
386
385
|
return;
|
|
387
386
|
}
|
|
388
|
-
if (
|
|
387
|
+
if (filterOptionListOption(state, value) != null) setOptionListValues(state, [value], emit);
|
|
389
388
|
}
|
|
390
|
-
function
|
|
389
|
+
function setOptionListValues(state, value, emit) {
|
|
391
390
|
if (!Array.isArray(value)) return;
|
|
392
391
|
const { autocomplete, listbox, multiple, options } = state.component;
|
|
393
392
|
const values = (multiple ? value : value.slice(0, 1)).map((value) => getString(value).toLocaleLowerCase());
|
|
394
393
|
if (values.length === 0) values.push("");
|
|
395
394
|
if (autocomplete.none && !listbox) {
|
|
396
|
-
|
|
395
|
+
setOptionListValue(state, values[0], emit);
|
|
397
396
|
return;
|
|
398
397
|
}
|
|
399
398
|
const { length } = options.all;
|
|
@@ -402,7 +401,7 @@ function setListboxValues(state, value, emit) {
|
|
|
402
401
|
const option = options.all[index];
|
|
403
402
|
if (values.includes(getData(option, "value", false)?.toLocaleLowerCase() ?? "")) selected.push(option);
|
|
404
403
|
}
|
|
405
|
-
|
|
404
|
+
applyOptionListSelection({
|
|
406
405
|
emit,
|
|
407
406
|
selected,
|
|
408
407
|
state,
|
|
@@ -411,7 +410,7 @@ function setListboxValues(state, value, emit) {
|
|
|
411
410
|
values: autocomplete.none && !listbox ? values : void 0
|
|
412
411
|
});
|
|
413
412
|
}
|
|
414
|
-
function
|
|
413
|
+
function toggleOptionListOption(state, option) {
|
|
415
414
|
const { autocomplete, callbacks, listbox, multiple, options } = state.component;
|
|
416
415
|
if (option == null || !multiple && options.selected.includes(option)) {
|
|
417
416
|
callbacks.data.onToggle(state);
|
|
@@ -428,7 +427,7 @@ function toggleListboxOption(state, option) {
|
|
|
428
427
|
}
|
|
429
428
|
} else selected.splice(0, selected.length, option);
|
|
430
429
|
const values = autocomplete.none && !listbox && option != null ? [option.textContent] : void 0;
|
|
431
|
-
|
|
430
|
+
applyOptionListSelection({
|
|
432
431
|
added,
|
|
433
432
|
option,
|
|
434
433
|
selected,
|
|
@@ -439,4 +438,4 @@ function toggleListboxOption(state, option) {
|
|
|
439
438
|
callbacks.data.onToggle(state);
|
|
440
439
|
}
|
|
441
440
|
//#endregion
|
|
442
|
-
export {
|
|
441
|
+
export { setOptionListDisabled as C, setOptionListReadonly as D, setOptionListMultiple as E, setOptionListRequired as O, getOptionListVisibleOptions as S, setOptionListLimit as T, createOptionListValueLabel as _, setOptionListValue as a, updateOptionListValueLabel as b, createOptionListContent as c, createOptionListHeader as d, createOptionListInput as f, createOptionListOptions as g, createOptionListOption as h, filterOptionListOptions as i, createOptionListFilter as l, createOptionListMessage as m, filterOptionList as n, setOptionListValues as o, createOptionListList as p, filterOptionListOption as r, toggleOptionListOption as s, applyOptionListSelection as t, createOptionListGroup as u, updateOptionListMessage as v, setOptionListFilter as w, generateOptionListIds as x, updateOptionListPreview as y };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { _ as OuiLocalizationsValues, p as OuiLocalizations } from "./l10n.model-D1E1u35L.mjs";
|
|
2
|
+
import { PlainObject } from "@oscarpalmer/atoms/models";
|
|
3
|
+
import { RemovableEventListener } from "@oscarpalmer/toretto/models";
|
|
4
|
+
//#region src/js/internal/option-list/option-list.model.d.ts
|
|
5
|
+
type CreateOptionListContent = {
|
|
6
|
+
element: HTMLDivElement;
|
|
7
|
+
filter?: CreateOptionListFilter;
|
|
8
|
+
list: CreateOptionListList;
|
|
9
|
+
message: HTMLDivElement;
|
|
10
|
+
value: HTMLSpanElement;
|
|
11
|
+
};
|
|
12
|
+
type CreateOptionListContentParameters = {
|
|
13
|
+
attributes: OptionListAttributes;
|
|
14
|
+
autocomplete: OptionListAutoComplete;
|
|
15
|
+
element: Element;
|
|
16
|
+
id: string;
|
|
17
|
+
label: HTMLLabelElement;
|
|
18
|
+
listbox: boolean;
|
|
19
|
+
multiple: boolean;
|
|
20
|
+
select: HTMLSelectElement;
|
|
21
|
+
type: OptionListType;
|
|
22
|
+
};
|
|
23
|
+
type CreateOptionListFilter = {
|
|
24
|
+
container: Element;
|
|
25
|
+
element: HTMLInputElement;
|
|
26
|
+
};
|
|
27
|
+
type CreateOptionListGroupParameters = {
|
|
28
|
+
group: HTMLOptGroupElement;
|
|
29
|
+
groupOptions: HTMLOptionElement[];
|
|
30
|
+
original: CreateOptionListContentParameters;
|
|
31
|
+
selected: Element[];
|
|
32
|
+
type: OptionListType;
|
|
33
|
+
};
|
|
34
|
+
type CreateOptionListList = {
|
|
35
|
+
element: HTMLUListElement;
|
|
36
|
+
groups?: OptionListGroup[];
|
|
37
|
+
options: OptionListOptions;
|
|
38
|
+
};
|
|
39
|
+
type CreateOptionListOptionParameters = {
|
|
40
|
+
group?: string;
|
|
41
|
+
index: number;
|
|
42
|
+
option: HTMLOptionElement;
|
|
43
|
+
original: CreateOptionListContentParameters;
|
|
44
|
+
type: OptionListType;
|
|
45
|
+
};
|
|
46
|
+
type CreateOptionListOptionsParameters = {
|
|
47
|
+
group?: string;
|
|
48
|
+
list: Element;
|
|
49
|
+
options: HTMLOptionElement[];
|
|
50
|
+
original: CreateOptionListContentParameters;
|
|
51
|
+
selected: Element[];
|
|
52
|
+
type: OptionListType;
|
|
53
|
+
};
|
|
54
|
+
type OptionListAttributes = {
|
|
55
|
+
active: string;
|
|
56
|
+
content: string;
|
|
57
|
+
empty: string;
|
|
58
|
+
filter: string;
|
|
59
|
+
group: string;
|
|
60
|
+
header: string;
|
|
61
|
+
hidden: string;
|
|
62
|
+
input: string;
|
|
63
|
+
list: string;
|
|
64
|
+
message: string;
|
|
65
|
+
option: string;
|
|
66
|
+
};
|
|
67
|
+
type OptionListAutoComplete = Record<OptionListAutoCompleteType, boolean> & {
|
|
68
|
+
value?: OptionListAutoCompleteType;
|
|
69
|
+
};
|
|
70
|
+
type OptionListAutoCompleteType = "both" | "inline" | "list" | "none";
|
|
71
|
+
type OptionListCallbacks<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
|
|
72
|
+
data: OptionListCallbacksData<State, Localizations>;
|
|
73
|
+
keydown: OptionListCallbacksKeydown<State, Localizations>;
|
|
74
|
+
};
|
|
75
|
+
type OptionListCallbacksData<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
|
|
76
|
+
onApply: OptionListCallbacksDataOnApply<State, Localizations>;
|
|
77
|
+
onFilter: OptionListCallbacksDataOnFilter<State, Localizations>;
|
|
78
|
+
onForm: (state: OptionListState<State, Localizations>) => void;
|
|
79
|
+
onPreview: OptionListCallbacksDataOnPreview<State, Localizations>;
|
|
80
|
+
onToggle: (state: OptionListState<State, Localizations>) => void;
|
|
81
|
+
};
|
|
82
|
+
type OptionListCallbacksDataOnApply<State extends PlainObject, Localizations extends OuiLocalizationsValues> = (state: OptionListState<State, Localizations>, option: Element | undefined, values: string[], added: boolean, selected?: Element[], emit?: boolean) => void;
|
|
83
|
+
type OptionListCallbacksDataOnFilter<State extends PlainObject, Localizations extends OuiLocalizationsValues> = (preview: OptionListPreview, state: OptionListState<State, Localizations>, update: boolean, active?: Element, emit?: boolean) => void;
|
|
84
|
+
type OptionListCallbacksDataOnPreview<State extends PlainObject, Localizations extends OuiLocalizationsValues> = (preview: OptionListPreview, state: OptionListState<State, Localizations>, active?: Element) => void;
|
|
85
|
+
type OptionListCallbacksKeydown<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
|
|
86
|
+
onActivation?: (state: OptionListState<State, Localizations>) => void;
|
|
87
|
+
onEnter?: (state: OptionListState<State, Localizations>) => void;
|
|
88
|
+
onEscape?: (state: OptionListState<State, Localizations>) => void;
|
|
89
|
+
onNavigation: OptionListCallbacksDataOnNavigation<State, Localizations>;
|
|
90
|
+
onSelection?: (state: OptionListState<State, Localizations>) => void;
|
|
91
|
+
onTab?: (state: OptionListState<State, Localizations>) => void;
|
|
92
|
+
onToggle?: (state: OptionListState<State, Localizations>) => void;
|
|
93
|
+
preventActivation?: (state: OptionListState<State, Localizations>) => boolean;
|
|
94
|
+
skipNavigation?: (state: OptionListState<State, Localizations>) => boolean;
|
|
95
|
+
};
|
|
96
|
+
type OptionListCallbacksDataOnNavigation<State extends PlainObject, Localizations extends OuiLocalizationsValues> = (preview: OptionListPreview, state: OptionListState<State, Localizations>, active?: HTMLElement) => void;
|
|
97
|
+
type OptionListFilter = {
|
|
98
|
+
element: HTMLInputElement;
|
|
99
|
+
value: string;
|
|
100
|
+
};
|
|
101
|
+
type OptionListGroup = {
|
|
102
|
+
element: HTMLElement;
|
|
103
|
+
header: HTMLElement;
|
|
104
|
+
options: HTMLElement[];
|
|
105
|
+
};
|
|
106
|
+
type OptionListLabel = {
|
|
107
|
+
element: HTMLLabelElement;
|
|
108
|
+
id: string;
|
|
109
|
+
};
|
|
110
|
+
type OptionListLocalizationValues = {
|
|
111
|
+
empty: string | (() => string);
|
|
112
|
+
input: string | (() => string);
|
|
113
|
+
invalid: string | (() => string);
|
|
114
|
+
max: string | ((max: number) => string);
|
|
115
|
+
min: string | ((min: number) => string);
|
|
116
|
+
remove: string | ((label: string, value: string) => string);
|
|
117
|
+
results: string | ((amount: number) => string);
|
|
118
|
+
selected: string | ((amount: number) => string);
|
|
119
|
+
};
|
|
120
|
+
type OptionListOptions = {
|
|
121
|
+
all: HTMLElement[];
|
|
122
|
+
selected: HTMLElement[];
|
|
123
|
+
};
|
|
124
|
+
type OptionListPreview = "none" | "set" | "typed";
|
|
125
|
+
type OptionListState<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
|
|
126
|
+
component: OptionListStateComponent<State, Localizations>;
|
|
127
|
+
form: OptionListStateForm;
|
|
128
|
+
};
|
|
129
|
+
type OptionListStateComponent<State extends PlainObject, Localizations extends OuiLocalizationsValues> = {
|
|
130
|
+
active?: HTMLElement;
|
|
131
|
+
attributes: OptionListAttributes;
|
|
132
|
+
autocomplete: OptionListAutoComplete;
|
|
133
|
+
callbacks: OptionListCallbacks<State, Localizations>;
|
|
134
|
+
content: HTMLDivElement;
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
elements: Array<Element | undefined>;
|
|
137
|
+
filter: OptionListFilter;
|
|
138
|
+
groups?: OptionListGroup[];
|
|
139
|
+
host: Element;
|
|
140
|
+
id: string;
|
|
141
|
+
label: OptionListLabel;
|
|
142
|
+
list: HTMLUListElement;
|
|
143
|
+
listbox: boolean;
|
|
144
|
+
listeners: RemovableEventListener[];
|
|
145
|
+
localizations: OuiLocalizations<OptionListLocalizationValues & Localizations>;
|
|
146
|
+
max?: number;
|
|
147
|
+
min?: number;
|
|
148
|
+
message: HTMLElement;
|
|
149
|
+
multiple: boolean;
|
|
150
|
+
name: string;
|
|
151
|
+
options: OptionListOptions;
|
|
152
|
+
readonly: boolean;
|
|
153
|
+
required: boolean;
|
|
154
|
+
select: HTMLSelectElement;
|
|
155
|
+
type: OptionListType;
|
|
156
|
+
values: OptionListValues;
|
|
157
|
+
} & State;
|
|
158
|
+
type OptionListStateForm = {
|
|
159
|
+
internals: ElementInternals;
|
|
160
|
+
restored?: unknown[];
|
|
161
|
+
};
|
|
162
|
+
type OptionListType = "autocomplete" | "select";
|
|
163
|
+
type OptionListValues = {
|
|
164
|
+
current: string[];
|
|
165
|
+
initial: string[];
|
|
166
|
+
label: Element;
|
|
167
|
+
};
|
|
168
|
+
//#endregion
|
|
169
|
+
export { OptionListType as _, CreateOptionListList as a, OptionListAttributes as c, OptionListCallbacks as d, OptionListGroup as f, OptionListState as g, OptionListPreview as h, CreateOptionListGroupParameters as i, OptionListAutoComplete as l, OptionListOptions as m, CreateOptionListContentParameters as n, CreateOptionListOptionParameters as o, OptionListLocalizationValues as p, CreateOptionListFilter as r, CreateOptionListOptionsParameters as s, CreateOptionListContent as t, OptionListAutoCompleteType as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as OuiPopoverState, t as OuiPopover } from "../popover.model-
|
|
1
|
+
import { n as OuiPopoverState, t as OuiPopover } from "../popover.model-DiLdz0Hc.mjs";
|
|
2
2
|
//#region src/js/popover/index.d.ts
|
|
3
3
|
declare function OuiPopover(this: OuiPopover, state: OuiPopoverState): void;
|
|
4
4
|
/**
|
|
@@ -7,6 +7,6 @@ declare function OuiPopover(this: OuiPopover, state: OuiPopoverState): void;
|
|
|
7
7
|
* @param element Element to get _OuiPopover_ for
|
|
8
8
|
* @returns _OuiPopover_ instance
|
|
9
9
|
*/
|
|
10
|
-
export declare function getPopover(element:
|
|
10
|
+
export declare function getPopover(element: Element): OuiPopover | undefined;
|
|
11
11
|
//#endregion
|
|
12
12
|
export type { OuiPopover };
|
|
@@ -23,7 +23,7 @@ Object.defineProperties(OuiPopover.prototype, { open: {
|
|
|
23
23
|
function addPopover(element) {
|
|
24
24
|
if (popovers.has(element) || element.hasAttribute("oui-floatable")) return;
|
|
25
25
|
const anchor = element.ownerDocument.querySelector(`[popovertarget="${element.id}"]`);
|
|
26
|
-
if (isHTMLOrSVGElement(anchor)) popovers.set(element, getState(anchor, element));
|
|
26
|
+
if (isHTMLOrSVGElement(anchor) && isHTMLOrSVGElement(element)) popovers.set(element, getState(anchor, element));
|
|
27
27
|
}
|
|
28
28
|
function destroyPopover(state) {
|
|
29
29
|
state.floatable.destroy();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as POPOVER_SYMBOL, i as POPOVER_ATTRIBUTE_OPEN, n as OuiPopoverState, o as popoverFloatableOptions, r as POPOVER_ATTRIBUTE, s as popovers, t as OuiPopover } from "../popover.model-
|
|
1
|
+
import { a as POPOVER_SYMBOL, i as POPOVER_ATTRIBUTE_OPEN, n as OuiPopoverState, o as popoverFloatableOptions, r as POPOVER_ATTRIBUTE, s as popovers, t as OuiPopover } from "../popover.model-DiLdz0Hc.mjs";
|
|
2
2
|
export { OuiPopover, OuiPopoverState, POPOVER_ATTRIBUTE, POPOVER_ATTRIBUTE_OPEN, POPOVER_SYMBOL, popoverFloatableOptions, popovers };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as OuiFloatable, l as OuiFloatableOptions } from "./floatable.model-DXsQgoU7.mjs";
|
|
2
|
-
import { c as OuiFocusTrap } from "./focus-trap.model-
|
|
2
|
+
import { c as OuiFocusTrap } from "./focus-trap.model-CpltX5B5.mjs";
|
|
3
3
|
import { RemovableEventListener } from "@oscarpalmer/toretto/models";
|
|
4
4
|
//#region src/js/popover/popover.model.d.ts
|
|
5
5
|
type OuiPopover = {
|
|
@@ -22,8 +22,8 @@ type OuiPopover = {
|
|
|
22
22
|
show(): void;
|
|
23
23
|
};
|
|
24
24
|
type OuiPopoverState = {
|
|
25
|
-
anchor:
|
|
26
|
-
content:
|
|
25
|
+
anchor: Element;
|
|
26
|
+
content: Element;
|
|
27
27
|
floatable: OuiFloatable;
|
|
28
28
|
focusTrap?: OuiFocusTrap;
|
|
29
29
|
listeners: RemovableEventListener[];
|
|
@@ -33,6 +33,6 @@ declare const POPOVER_ATTRIBUTE = "oui-popover";
|
|
|
33
33
|
declare const POPOVER_ATTRIBUTE_OPEN: string;
|
|
34
34
|
declare const POPOVER_SYMBOL: unique symbol;
|
|
35
35
|
declare const popoverFloatableOptions: OuiFloatableOptions;
|
|
36
|
-
declare const popovers: WeakMap<
|
|
36
|
+
declare const popovers: WeakMap<Element, OuiPopoverState>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { POPOVER_SYMBOL as a, POPOVER_ATTRIBUTE_OPEN as i, OuiPopoverState as n, popoverFloatableOptions as o, POPOVER_ATTRIBUTE as r, popovers as s, OuiPopover as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createResizable } from "../resizable.embedded-
|
|
1
|
+
import { t as createResizable } from "../resizable.embedded-BemH-7Re.mjs";
|
|
2
2
|
export { createResizable };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as resizableItems, a as RESIZABLE_ATTRIBUTE, c as RESIZABLE_ATTRIBUTE_MINIMUM, d as RESIZABLE_MESSAGE_HEIGHT, f as RESIZABLE_MESSAGE_WIDTH, g as RESIZABLE_SYMBOL, h as RESIZABLE_SELECTOR_HANDLE_SCOPED, i as OuiResizableState, l as RESIZABLE_MESSAGE_ELEMENT, m as RESIZABLE_SELECTOR_HANDLE, n as OuiResizable, o as RESIZABLE_ATTRIBUTE_HANDLE, p as RESIZABLE_SELECTOR, r as OuiResizableItem, s as RESIZABLE_ATTRIBUTE_MAXIMUM, t as CreateOuiResizableOptions, u as RESIZABLE_MESSAGE_HANDLE, v as resizableStyles } from "../resizable.model-
|
|
1
|
+
import { _ as resizableItems, a as RESIZABLE_ATTRIBUTE, c as RESIZABLE_ATTRIBUTE_MINIMUM, d as RESIZABLE_MESSAGE_HEIGHT, f as RESIZABLE_MESSAGE_WIDTH, g as RESIZABLE_SYMBOL, h as RESIZABLE_SELECTOR_HANDLE_SCOPED, i as OuiResizableState, l as RESIZABLE_MESSAGE_ELEMENT, m as RESIZABLE_SELECTOR_HANDLE, n as OuiResizable, o as RESIZABLE_ATTRIBUTE_HANDLE, p as RESIZABLE_SELECTOR, r as OuiResizableItem, s as RESIZABLE_ATTRIBUTE_MAXIMUM, t as CreateOuiResizableOptions, u as RESIZABLE_MESSAGE_HANDLE, v as resizableStyles } from "../resizable.model-YEtcC9li.mjs";
|
|
2
2
|
export { CreateOuiResizableOptions, OuiResizable, OuiResizableItem, OuiResizableState, RESIZABLE_ATTRIBUTE, RESIZABLE_ATTRIBUTE_HANDLE, RESIZABLE_ATTRIBUTE_MAXIMUM, RESIZABLE_ATTRIBUTE_MINIMUM, RESIZABLE_MESSAGE_ELEMENT, RESIZABLE_MESSAGE_HANDLE, RESIZABLE_MESSAGE_HEIGHT, RESIZABLE_MESSAGE_WIDTH, RESIZABLE_SELECTOR, RESIZABLE_SELECTOR_HANDLE, RESIZABLE_SELECTOR_HANDLE_SCOPED, RESIZABLE_SYMBOL, resizableItems, resizableStyles };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as OuiResizable, t as CreateOuiResizableOptions } from "../resizable.model-
|
|
2
|
-
import { t as createResizable } from "../resizable.embedded-
|
|
1
|
+
import { n as OuiResizable, t as CreateOuiResizableOptions } from "../resizable.model-YEtcC9li.mjs";
|
|
2
|
+
import { t as createResizable } from "../resizable.embedded-BemH-7Re.mjs";
|
|
3
3
|
export { type CreateOuiResizableOptions, type OuiResizable, createResizable as createOuiResizable };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as OuiResizable, t as CreateOuiResizableOptions } from "./resizable.model-
|
|
1
|
+
import { n as OuiResizable, t as CreateOuiResizableOptions } from "./resizable.model-YEtcC9li.mjs";
|
|
2
2
|
//#region src/js/resizable/resizable.embedded.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates _(or retrieves)_ a _OuiResizable_ instance for an element
|
|
@@ -6,6 +6,6 @@ import { n as OuiResizable, t as CreateOuiResizableOptions } from "./resizable.m
|
|
|
6
6
|
* @param element Element to make resizable
|
|
7
7
|
* @returns _OuiResizable_ instance
|
|
8
8
|
*/
|
|
9
|
-
declare function createResizable(element:
|
|
9
|
+
declare function createResizable(element: Element, options?: CreateOuiResizableOptions): OuiResizable;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { createResizable as t };
|
|
@@ -17,8 +17,8 @@ type OuiResizableItem = {
|
|
|
17
17
|
state: OuiResizableState;
|
|
18
18
|
};
|
|
19
19
|
type OuiResizableState = {
|
|
20
|
-
element:
|
|
21
|
-
handle:
|
|
20
|
+
element: Element;
|
|
21
|
+
handle: Element;
|
|
22
22
|
height: number;
|
|
23
23
|
options: Required<CreateOuiResizableOptions>;
|
|
24
24
|
styles: StyleToggler;
|
|
@@ -36,7 +36,7 @@ declare const RESIZABLE_SELECTOR: string;
|
|
|
36
36
|
declare const RESIZABLE_SELECTOR_HANDLE: string;
|
|
37
37
|
declare const RESIZABLE_SELECTOR_HANDLE_SCOPED: string;
|
|
38
38
|
declare const RESIZABLE_SYMBOL: unique symbol;
|
|
39
|
-
declare const resizableItems: WeakMap<
|
|
39
|
+
declare const resizableItems: WeakMap<Element, OuiResizableItem>;
|
|
40
40
|
declare const resizableStyles: {
|
|
41
41
|
touchAction: string;
|
|
42
42
|
userSelect: string;
|