@voidable/ui 0.11.0 → 0.12.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/angular/index.d.ts +2 -2
- package/dist/angular/index.js +2 -1
- package/dist/chunks/activation-B8aBarKd.js +4 -0
- package/dist/chunks/carousel-C9u0bg5l.js +10 -0
- package/dist/chunks/choice-BTrsi7OW.js +16 -0
- package/dist/chunks/data-Baycjoo4.js +96 -0
- package/dist/chunks/fields-MEqz-olE.js +21 -0
- package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
- package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
- package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
- package/dist/chunks/menu-CxRRgkJI.js +21 -0
- package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
- package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
- package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
- package/dist/chunks/overlay-K1ilWC1p.js +4 -0
- package/dist/chunks/pickers-CjlFgNke.js +36 -0
- package/dist/chunks/table-BBpqwWEi.js +4 -0
- package/dist/chunks/tabs-Buf3EBWq.js +10 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +22 -14
- package/dist/components/action-input.d.ts +2 -1
- package/dist/components/action-input.js +59 -55
- package/dist/components/bar-chart.js +41 -40
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +15 -11
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +23 -16
- package/dist/components/calendar.d.ts +45 -10
- package/dist/components/calendar.js +183 -129
- package/dist/components/carousel.d.ts +22 -0
- package/dist/components/carousel.js +64 -35
- package/dist/components/charts/data.d.ts +2 -2
- package/dist/components/checkbox-group.js +22 -21
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +29 -24
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.js +19 -11
- package/dist/components/color-picker.js +28 -27
- package/dist/components/combobox.d.ts +13 -1
- package/dist/components/combobox.js +54 -41
- package/dist/components/compose-input.d.ts +9 -1
- package/dist/components/compose-input.js +28 -16
- package/dist/components/dialog.js +1 -1
- package/dist/components/donut-chart.js +57 -56
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +54 -39
- package/dist/components/editable.d.ts +11 -1
- package/dist/components/editable.js +35 -22
- package/dist/components/error-fallback.d.ts +4 -2
- package/dist/components/error-fallback.js +34 -28
- package/dist/components/file-upload.d.ts +9 -0
- package/dist/components/file-upload.js +54 -28
- package/dist/components/gauge.js +108 -107
- package/dist/components/hamburger.d.ts +7 -0
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.js +22 -14
- package/dist/components/indicator.js +15 -14
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.js +43 -42
- package/dist/components/menu.d.ts +25 -0
- package/dist/components/menu.js +55 -33
- package/dist/components/multiselect.d.ts +17 -1
- package/dist/components/multiselect.js +96 -74
- package/dist/components/nav-menu.d.ts +9 -0
- package/dist/components/nav-menu.js +30 -23
- package/dist/components/number-input.d.ts +15 -1
- package/dist/components/number-input.js +71 -37
- package/dist/components/pagination.js +25 -24
- package/dist/components/pin-input.d.ts +11 -0
- package/dist/components/pin-input.js +46 -32
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +21 -13
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.d.ts +10 -1
- package/dist/components/radio.js +37 -32
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.js +40 -28
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +14 -10
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +5 -3
- package/dist/components/spinner.js +21 -14
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.d.ts +2 -2
- package/dist/components/status-dot.js +12 -14
- package/dist/components/stepper.d.ts +2 -0
- package/dist/components/stepper.js +20 -13
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +24 -16
- package/dist/components/table.d.ts +77 -1
- package/dist/components/table.js +562 -73
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +42 -33
- package/dist/components/tag.js +12 -11
- package/dist/components/tags-input.d.ts +10 -1
- package/dist/components/tags-input.js +42 -30
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +35 -28
- package/dist/components/toggle-group.d.ts +8 -0
- package/dist/components/toggle-group.js +24 -17
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +23 -15
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +20 -12
- package/dist/components.json +96 -74
- package/dist/custom-elements.json +4213 -131
- package/dist/dev/rules.d.ts +0 -1
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +244 -113
- package/dist/index.d.ts +4 -0
- package/dist/index.js +68 -66
- package/dist/keyboard-activation.d.ts +9 -9
- package/dist/keyboard.d.ts +2 -10
- package/dist/keymaps/activation.d.ts +8 -0
- package/dist/keymaps/carousel.d.ts +9 -0
- package/dist/keymaps/choice.d.ts +21 -0
- package/dist/keymaps/fields.d.ts +31 -0
- package/dist/keymaps/index.d.ts +2 -0
- package/dist/keymaps/menu.d.ts +36 -0
- package/dist/keymaps/nav-menu.d.ts +11 -0
- package/dist/keymaps/overlay.d.ts +4 -0
- package/dist/keymaps/pickers.d.ts +36 -0
- package/dist/keymaps/table.d.ts +8 -0
- package/dist/keymaps/tabs.d.ts +7 -0
- package/dist/keymaps.js +51 -0
- package/dist/keys.d.ts +46 -0
- package/dist/keys.js +57 -0
- package/dist/llms.txt +11 -3
- package/dist/messages/ar.d.ts +1 -0
- package/dist/messages/ar.js +130 -0
- package/dist/messages/fr.d.ts +1 -0
- package/dist/messages/fr.js +109 -0
- package/dist/messages.d.ts +213 -0
- package/dist/messages.js +190 -0
- package/dist/modal.d.ts +7 -0
- package/dist/reference.md +817 -17
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing.js +79 -0
- package/dist/types/elements.d.ts +89 -73
- package/dist/types/react.d.ts +5 -1
- package/dist/types/solid.d.ts +5 -1
- package/dist/types/solid2.d.ts +4 -0
- package/dist/types/svelte.d.ts +5 -1
- package/dist/types/vue.d.ts +5 -1
- package/dist/vscode.html-custom-data.json +384 -18
- package/dist/web-types.json +830 -69
- package/package.json +22 -2
- package/dist/chunks/data-BpiiNapL.js +0 -95
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as u } from "../chunks/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { msg as i } from "../messages.js";
|
|
5
|
+
import { t as a } from "../chunks/form-control-fL-Hhy91.js";
|
|
6
|
+
import { t as o } from "../chunks/projection-oPe6ipjL.js";
|
|
7
|
+
import { n as s } from "../chunks/parts-DI_3VpSy.js";
|
|
8
|
+
import { n as c, r as l, t as u } from "../chunks/keyboard-ChtDvhB_.js";
|
|
9
|
+
import { i as d } from "../chunks/pickers-CjlFgNke.js";
|
|
10
|
+
import { t as f } from "../chunks/overlay-BuV-4Yvt.js";
|
|
11
|
+
import { n as p } from "../chunks/value-list-CH6GjYXM.js";
|
|
12
|
+
import { html as m, nothing as h } from "lit";
|
|
13
|
+
import { property as g } from "lit/decorators.js";
|
|
11
14
|
//#region src/components/multiselect.ts
|
|
12
|
-
var
|
|
15
|
+
var _ = class extends e {
|
|
13
16
|
constructor(...e) {
|
|
14
17
|
super(...e), this.value = "", this.selected = !1, this.disabled = !1, this.label = "";
|
|
15
18
|
}
|
|
@@ -22,28 +25,28 @@ var m = class extends e {
|
|
|
22
25
|
].some((t) => e.has(t) && e.get(t) !== void 0) && (this.closest("void-multiselect") ?? this.closest("void-combobox"))?.requestUpdate();
|
|
23
26
|
}
|
|
24
27
|
};
|
|
25
|
-
t([
|
|
28
|
+
t([g({
|
|
26
29
|
type: String,
|
|
27
30
|
reflect: !0
|
|
28
|
-
})],
|
|
31
|
+
})], _.prototype, "value", void 0), t([g({
|
|
29
32
|
type: Boolean,
|
|
30
33
|
reflect: !0
|
|
31
|
-
})],
|
|
34
|
+
})], _.prototype, "selected", void 0), t([g({
|
|
32
35
|
type: Boolean,
|
|
33
36
|
reflect: !0
|
|
34
|
-
})],
|
|
35
|
-
var
|
|
36
|
-
function
|
|
37
|
+
})], _.prototype, "disabled", void 0), t([g({ type: String })], _.prototype, "label", void 0), customElements.get("void-option") || customElements.define("void-option", _);
|
|
38
|
+
var v = (e) => e instanceof _ ? e.value : e.getAttribute("value") ?? "", y = (e) => e instanceof _ ? e.selected : e.hasAttribute("selected");
|
|
39
|
+
function b(e) {
|
|
37
40
|
return e.getAttribute("label") || e.textContent?.trim() || e.getAttribute("value") || "";
|
|
38
41
|
}
|
|
39
|
-
var
|
|
42
|
+
var x = class extends a(e) {
|
|
40
43
|
constructor(...e) {
|
|
41
|
-
super(...e), this.placeholder = "
|
|
44
|
+
super(...e), this.keys = null, this.placeholder = "", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this.open = !1, this._active = null, this._typeahead = new u(), this._wiring = !1, this._projection = new o(this, { placement: "start" }), this._parts = new s(this, {
|
|
42
45
|
tags: ["void-multiselect-content", "void-option"],
|
|
43
46
|
onChange: () => {
|
|
44
47
|
this._wire(), this._wiring || this.requestUpdate();
|
|
45
48
|
}
|
|
46
|
-
}), this._overlay = new
|
|
49
|
+
}), this._overlay = new f(this, {
|
|
47
50
|
kind: "listbox",
|
|
48
51
|
surface: () => this._content(),
|
|
49
52
|
isOpen: () => this.open && !this.formDisabled,
|
|
@@ -73,50 +76,66 @@ var v = class extends n(e) {
|
|
|
73
76
|
}
|
|
74
77
|
this._trigger()?.contains(t) && (e.stopPropagation(), this.open ? this._close("trigger") : this._openList("none", "trigger"));
|
|
75
78
|
}, this._onTriggerKeydown = (e) => {
|
|
76
|
-
if (this.formDisabled || e.target !== e.currentTarget
|
|
77
|
-
let t = this
|
|
79
|
+
if (this.formDisabled || e.target !== e.currentTarget) return;
|
|
80
|
+
let t = n(this, e);
|
|
81
|
+
if (!t) {
|
|
82
|
+
e.key === "Tab" && this.open && !e.defaultPrevented && this._close("blur");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
78
85
|
if (!this.open) {
|
|
79
|
-
|
|
86
|
+
if (t === "first" || t === "last") this._openList(t);
|
|
87
|
+
else if (t === "previous") this._openList("first");
|
|
88
|
+
else if (t === "next" || t === "activate") this._openList("selected");
|
|
89
|
+
else if (t === "typeahead") this._openList("selected"), this._typeaheadTo(e.key);
|
|
90
|
+
else return;
|
|
91
|
+
e.preventDefault();
|
|
80
92
|
return;
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
let r = this._options.map((e) => e.disabled);
|
|
95
|
+
switch (t) {
|
|
96
|
+
case "next":
|
|
97
|
+
this._moveActive(this._stepBy(1));
|
|
85
98
|
break;
|
|
86
|
-
case "
|
|
87
|
-
|
|
99
|
+
case "previous":
|
|
100
|
+
this._moveActive(this._stepBy(-1));
|
|
88
101
|
break;
|
|
89
|
-
case "
|
|
90
|
-
|
|
102
|
+
case "nextPage":
|
|
103
|
+
this._moveActive(this._stepBy(10));
|
|
91
104
|
break;
|
|
92
|
-
case "
|
|
93
|
-
|
|
105
|
+
case "previousPage":
|
|
106
|
+
this._moveActive(this._stepBy(-10));
|
|
94
107
|
break;
|
|
95
|
-
case "
|
|
96
|
-
|
|
108
|
+
case "first":
|
|
109
|
+
this._moveActive(c(r, 1));
|
|
97
110
|
break;
|
|
98
|
-
case "
|
|
99
|
-
|
|
111
|
+
case "last":
|
|
112
|
+
this._moveActive(c(r, -1));
|
|
100
113
|
break;
|
|
101
|
-
case "
|
|
102
|
-
|
|
103
|
-
e.preventDefault(), this._active && !this._active.disabled && this._toggleOption(this._active);
|
|
114
|
+
case "activate":
|
|
115
|
+
this._active && !this._active.disabled && this._toggleOption(this._active);
|
|
104
116
|
break;
|
|
105
|
-
case "
|
|
106
|
-
e.
|
|
117
|
+
case "close":
|
|
118
|
+
e.stopPropagation(), this._close("escape");
|
|
107
119
|
break;
|
|
108
|
-
case "
|
|
109
|
-
this.
|
|
120
|
+
case "typeahead":
|
|
121
|
+
this._typeaheadTo(e.key);
|
|
110
122
|
break;
|
|
111
|
-
default:
|
|
123
|
+
default: return;
|
|
112
124
|
}
|
|
125
|
+
e.preventDefault();
|
|
113
126
|
}, this._onFocusOut = (e) => {
|
|
114
127
|
this.open && !this.contains(e.relatedTarget) && this._close("blur");
|
|
115
128
|
};
|
|
116
129
|
}
|
|
130
|
+
static {
|
|
131
|
+
this.keyMap = d;
|
|
132
|
+
}
|
|
117
133
|
static {
|
|
118
134
|
this.labelTarget = "[role=combobox]";
|
|
119
135
|
}
|
|
136
|
+
get _hint() {
|
|
137
|
+
return this.placeholder || i(this, "multiselect.placeholder");
|
|
138
|
+
}
|
|
120
139
|
_content() {
|
|
121
140
|
return this._parts.one("void-multiselect-content");
|
|
122
141
|
}
|
|
@@ -129,15 +148,15 @@ var v = class extends n(e) {
|
|
|
129
148
|
}
|
|
130
149
|
get value() {
|
|
131
150
|
let e = this._options;
|
|
132
|
-
return this._wanted && e.length === 0 ? [...this._wanted] : e.filter(
|
|
151
|
+
return this._wanted && e.length === 0 ? [...this._wanted] : e.filter(y).map(v);
|
|
133
152
|
}
|
|
134
153
|
set value(e) {
|
|
135
154
|
let t = this._options, n = Array.isArray(e) ? e : [];
|
|
136
155
|
this._wanted = t.length === 0 ? [...n] : null;
|
|
137
156
|
let r = new Set(n);
|
|
138
157
|
for (let e of t) {
|
|
139
|
-
let t = r.has(
|
|
140
|
-
e instanceof
|
|
158
|
+
let t = r.has(v(e));
|
|
159
|
+
e instanceof _ ? e.selected = t : e.toggleAttribute("selected", t);
|
|
141
160
|
}
|
|
142
161
|
this.requestUpdate("value", void 0);
|
|
143
162
|
}
|
|
@@ -171,49 +190,49 @@ var v = class extends n(e) {
|
|
|
171
190
|
if (!e) return;
|
|
172
191
|
this._parts.set(e, "popover", "manual"), this._parts.set(e, "role", "listbox"), this._parts.set(e, "aria-multiselectable", "true"), this._parts.id(e, "void-multiselect-content");
|
|
173
192
|
let i = r ? t?.getAttribute("aria-labelledby") ?? null : null;
|
|
174
|
-
this._parts.set(e, "aria-labelledby", i), this._parts.set(e, "aria-label", r && !i && (t?.getAttribute("aria-label") || this.
|
|
193
|
+
this._parts.set(e, "aria-labelledby", i), this._parts.set(e, "aria-label", r && !i && (t?.getAttribute("aria-label") || this._hint) || null), t && this._parts.set(t, "aria-activedescendant", r && this._active ? this._parts.id(this._active, "void-option") : null);
|
|
175
194
|
}
|
|
176
195
|
_controls(e) {
|
|
177
196
|
let t = e ? this._content() : null;
|
|
178
|
-
return t ? this._parts.id(t, "void-multiselect-content") :
|
|
197
|
+
return t ? this._parts.id(t, "void-multiselect-content") : h;
|
|
179
198
|
}
|
|
180
199
|
render() {
|
|
181
200
|
let e = this._options.filter((e) => e.selected), t = this.open && !this.formDisabled, n = e.length;
|
|
182
|
-
return
|
|
201
|
+
return m`
|
|
183
202
|
<div
|
|
184
203
|
class="void-multiselect-trigger"
|
|
185
204
|
role="combobox"
|
|
186
205
|
tabindex=${this.formDisabled ? "-1" : "0"}
|
|
187
|
-
aria-label=${this.
|
|
206
|
+
aria-label=${this._hint}
|
|
188
207
|
aria-haspopup="listbox"
|
|
189
208
|
aria-expanded=${String(t)}
|
|
190
209
|
aria-controls=${this._controls(t)}
|
|
191
|
-
aria-description=${n ?
|
|
192
|
-
aria-disabled=${this.formDisabled ? "true" :
|
|
193
|
-
aria-required=${this.required ? "true" :
|
|
194
|
-
aria-invalid=${this.error ? "true" :
|
|
210
|
+
aria-description=${n ? i(this, "multiselect.selected", { count: n }) : h}
|
|
211
|
+
aria-disabled=${this.formDisabled ? "true" : h}
|
|
212
|
+
aria-required=${this.required ? "true" : h}
|
|
213
|
+
aria-invalid=${this.error ? "true" : h}
|
|
195
214
|
@keydown=${this._onTriggerKeydown}
|
|
196
215
|
>
|
|
197
|
-
${n > 0 ? e.map((e) =>
|
|
216
|
+
${n > 0 ? e.map((e) => m`
|
|
198
217
|
<span class="void-multiselect-pill">
|
|
199
|
-
<span class="void-multiselect-pill-label">${
|
|
218
|
+
<span class="void-multiselect-pill-label">${b(e)}</span>
|
|
200
219
|
<button
|
|
201
220
|
type="button"
|
|
202
221
|
class="void-multiselect-pill-remove"
|
|
203
222
|
tabindex="-1"
|
|
204
|
-
aria-label
|
|
223
|
+
aria-label=${i(this, "removeItem", { name: b(e) })}
|
|
205
224
|
data-value=${e.value}
|
|
206
225
|
>×</button>
|
|
207
226
|
</span>
|
|
208
|
-
`) :
|
|
227
|
+
`) : m`<span class="void-multiselect-placeholder">${this._hint}</span>`}
|
|
209
228
|
</div>
|
|
210
|
-
${this.error ?
|
|
229
|
+
${this.error ? m`<span class="void-multiselect-error">${this.error}</span>` : h}
|
|
211
230
|
`;
|
|
212
231
|
}
|
|
213
232
|
_openList(e, t = "keyboard") {
|
|
214
233
|
if (this._overlay.requestOpen(t), !this.open) return;
|
|
215
234
|
let n = this._options, r = n.map((e) => e.disabled), i = -1;
|
|
216
|
-
e === "first" ? i =
|
|
235
|
+
e === "first" ? i = c(r, 1) : e === "last" ? i = c(r, -1) : e === "selected" && (i = n.findIndex((e) => e.selected && !e.disabled), i < 0 && (i = c(r, 1))), this._active = i >= 0 ? n[i] : null, this.requestUpdate();
|
|
217
236
|
}
|
|
218
237
|
_close(e = "api") {
|
|
219
238
|
this.open && this._overlay.requestClose(e);
|
|
@@ -222,16 +241,16 @@ var v = class extends n(e) {
|
|
|
222
241
|
e < 0 || (this._active = this._options[e], this.requestUpdate());
|
|
223
242
|
}
|
|
224
243
|
_stepBy(e) {
|
|
225
|
-
let t = this._options, n = t.map((e) => e.disabled), r = this._active ? t.indexOf(this._active) : -1, i = e > 0 ? 1 : -1,
|
|
226
|
-
for (let t = r,
|
|
227
|
-
let e =
|
|
244
|
+
let t = this._options, n = t.map((e) => e.disabled), r = this._active ? t.indexOf(this._active) : -1, i = e > 0 ? 1 : -1, a = r;
|
|
245
|
+
for (let t = r, o = Math.abs(e); o > 0;) {
|
|
246
|
+
let e = l(n, t, i, !1);
|
|
228
247
|
if (e < 0) break;
|
|
229
|
-
|
|
248
|
+
a = t = e, o--;
|
|
230
249
|
}
|
|
231
|
-
return
|
|
250
|
+
return a >= 0 ? a : c(n, i);
|
|
232
251
|
}
|
|
233
252
|
_typeaheadTo(e) {
|
|
234
|
-
let t = this._options, n = this._active ? t.indexOf(this._active) : -1, r = this._typeahead.match(e, t.map((e) =>
|
|
253
|
+
let t = this._options, n = this._active ? t.indexOf(this._active) : -1, r = this._typeahead.match(e, t.map((e) => b(e)), t.map((e) => e.disabled), n);
|
|
235
254
|
this._moveActive(r);
|
|
236
255
|
}
|
|
237
256
|
_toggleOption(e, t = !e.selected) {
|
|
@@ -242,24 +261,27 @@ var v = class extends n(e) {
|
|
|
242
261
|
}));
|
|
243
262
|
}
|
|
244
263
|
};
|
|
245
|
-
t([
|
|
264
|
+
t([g({
|
|
265
|
+
attribute: "keys",
|
|
266
|
+
converter: r
|
|
267
|
+
})], x.prototype, "keys", void 0), t([g({ type: String })], x.prototype, "placeholder", void 0), t([g({
|
|
246
268
|
type: Boolean,
|
|
247
269
|
reflect: !0
|
|
248
|
-
})],
|
|
270
|
+
})], x.prototype, "disabled", void 0), t([g({
|
|
249
271
|
type: String,
|
|
250
272
|
reflect: !0
|
|
251
|
-
})],
|
|
273
|
+
})], x.prototype, "size", void 0), t([g({
|
|
252
274
|
type: String,
|
|
253
275
|
reflect: !0
|
|
254
|
-
})],
|
|
276
|
+
})], x.prototype, "error", void 0), t([g({
|
|
255
277
|
type: String,
|
|
256
278
|
reflect: !0
|
|
257
|
-
})],
|
|
279
|
+
})], x.prototype, "name", void 0), t([g({
|
|
258
280
|
type: Boolean,
|
|
259
281
|
reflect: !0
|
|
260
|
-
})],
|
|
261
|
-
converter:
|
|
282
|
+
})], x.prototype, "open", void 0), t([g({
|
|
283
|
+
converter: p,
|
|
262
284
|
reflect: !0
|
|
263
|
-
})],
|
|
285
|
+
})], x.prototype, "value", null), customElements.get("void-multiselect") || customElements.define("void-multiselect", x);
|
|
264
286
|
//#endregion
|
|
265
|
-
export {
|
|
287
|
+
export { x as VoidMultiselect, _ as VoidOption, b as optionLabel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
+
import { KeyOverrides } from '../keys.js';
|
|
2
3
|
import { PartsController } from '../parts.js';
|
|
3
4
|
/**
|
|
4
5
|
* Horizontal navigation bar with dropdown sub-menus for site headers, application nav bars, and mega-menu layouts.
|
|
@@ -7,6 +8,14 @@ import { PartsController } from '../parts.js';
|
|
|
7
8
|
* returns focus to its trigger.
|
|
8
9
|
*/
|
|
9
10
|
export declare class VoidNavMenu extends VoidElement {
|
|
11
|
+
/** Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. */
|
|
12
|
+
keys: KeyOverrides | null;
|
|
13
|
+
/** @internal The actions of this element and their default keys (horizontal; a vertical menu starts with ArrowDown and ArrowUp). */
|
|
14
|
+
static readonly keyMap: {
|
|
15
|
+
next: string[];
|
|
16
|
+
previous: string[];
|
|
17
|
+
close: string[];
|
|
18
|
+
};
|
|
10
19
|
/**
|
|
11
20
|
* `horizontal` (default) lays the items out in a row with Left and Right arrow keys; `vertical` stacks
|
|
12
21
|
* them.
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { i, n as a } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { n as o, t as s } from "../chunks/nav-menu-Bx284Dk6.js";
|
|
6
|
+
import { property as c } from "lit/decorators.js";
|
|
6
7
|
//#region src/components/nav-menu.ts
|
|
7
|
-
var
|
|
8
|
+
var l = class extends e {
|
|
8
9
|
constructor(...e) {
|
|
9
|
-
super(...e), this.orientation = "horizontal", this.width = "", this._handleItemOpen = (e) => {
|
|
10
|
+
super(...e), this.keys = null, this.orientation = "horizontal", this.width = "", this._handleItemOpen = (e) => {
|
|
10
11
|
let t = e.target;
|
|
11
|
-
if (!(t instanceof
|
|
12
|
+
if (!(t instanceof u)) return;
|
|
12
13
|
let n = e.detail?.reason === "hover" ? "hover" : "outside";
|
|
13
14
|
for (let e of this._getItems()) e !== t && e.open && e._closeDropdown(n);
|
|
14
15
|
}, this._handleKeydown = (e) => {
|
|
15
16
|
let t = this._getItems();
|
|
16
17
|
if (!t.length) return;
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
19
|
-
let n = t.map((e) => e._control()).filter((e) => !!e),
|
|
20
|
-
if (
|
|
21
|
-
e.preventDefault(),
|
|
18
|
+
let r = n(this, e, this.orientation === "horizontal" ? s : o);
|
|
19
|
+
if (r === "next" || r === "previous") {
|
|
20
|
+
let n = t.map((e) => e._control()).filter((e) => !!e), i = n.indexOf(document.activeElement);
|
|
21
|
+
if (i < 0) return;
|
|
22
|
+
e.preventDefault(), r === "next" ? (n[i + 1] ?? n[0])?.focus() : (n[i - 1] ?? n[n.length - 1])?.focus();
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
if (
|
|
25
|
+
if (r === "close") for (let e of t) e.open && (e._closeDropdown("escape"), e._control()?.focus());
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
static {
|
|
29
|
+
this.keyMap = s;
|
|
30
|
+
}
|
|
27
31
|
connectedCallback() {
|
|
28
32
|
super.connectedCallback(), this.setHostAttribute("role", "menubar"), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("void-open", this._handleItemOpen, !0);
|
|
29
33
|
}
|
|
@@ -37,16 +41,19 @@ var o = class extends e {
|
|
|
37
41
|
return Array.from(this.querySelectorAll("void-nav-menu-item")).filter((e) => e.closest("void-nav-menu") === this);
|
|
38
42
|
}
|
|
39
43
|
};
|
|
40
|
-
t([
|
|
44
|
+
t([c({
|
|
45
|
+
attribute: "keys",
|
|
46
|
+
converter: r
|
|
47
|
+
})], l.prototype, "keys", void 0), t([c({
|
|
41
48
|
type: String,
|
|
42
49
|
reflect: !0
|
|
43
|
-
})],
|
|
50
|
+
})], l.prototype, "orientation", void 0), t([c({
|
|
44
51
|
type: String,
|
|
45
52
|
reflect: !0
|
|
46
|
-
})],
|
|
47
|
-
var
|
|
53
|
+
})], l.prototype, "width", void 0), customElements.get("void-nav-menu") || customElements.define("void-nav-menu", l);
|
|
54
|
+
var u = class extends e {
|
|
48
55
|
constructor(...e) {
|
|
49
|
-
super(...e), this.open = !1, this.disabled = !1, this.current = !1, this._openedByHover = !1, this._parts = new
|
|
56
|
+
super(...e), this.open = !1, this.disabled = !1, this.current = !1, this._openedByHover = !1, this._parts = new a(this, {
|
|
50
57
|
tags: ["void-nav-menu-trigger", "void-nav-menu-content"],
|
|
51
58
|
onChange: () => this._wire()
|
|
52
59
|
}), this._onClick = (e) => {
|
|
@@ -70,7 +77,7 @@ var s = class extends e {
|
|
|
70
77
|
};
|
|
71
78
|
}
|
|
72
79
|
_control() {
|
|
73
|
-
return
|
|
80
|
+
return i(this._parts.one("void-nav-menu-trigger"));
|
|
74
81
|
}
|
|
75
82
|
_content() {
|
|
76
83
|
return this._parts.one("void-nav-menu-content");
|
|
@@ -107,15 +114,15 @@ var s = class extends e {
|
|
|
107
114
|
})));
|
|
108
115
|
}
|
|
109
116
|
};
|
|
110
|
-
t([
|
|
117
|
+
t([c({
|
|
111
118
|
type: Boolean,
|
|
112
119
|
reflect: !0
|
|
113
|
-
})],
|
|
120
|
+
})], u.prototype, "open", void 0), t([c({
|
|
114
121
|
type: Boolean,
|
|
115
122
|
reflect: !0
|
|
116
|
-
})],
|
|
123
|
+
})], u.prototype, "disabled", void 0), t([c({
|
|
117
124
|
type: Boolean,
|
|
118
125
|
reflect: !0
|
|
119
|
-
})],
|
|
126
|
+
})], u.prototype, "current", void 0), customElements.get("void-nav-menu-item") || customElements.define("void-nav-menu-item", u);
|
|
120
127
|
//#endregion
|
|
121
|
-
export {
|
|
128
|
+
export { l as VoidNavMenu, u as VoidNavMenuItem };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { FormSubmission } from '../form-control.js';
|
|
3
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
4
|
declare const VoidNumberInput_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
4
5
|
/**
|
|
5
6
|
* Precise numeric entry for quantity selectors, price fields, and settings with increment/decrement controls.
|
|
@@ -7,6 +8,13 @@ declare const VoidNumberInput_base: (new (...args: any[]) => import('../form-con
|
|
|
7
8
|
* name, which `<void-field>` supplies), and the stepper buttons are its own buttons.
|
|
8
9
|
*/
|
|
9
10
|
export declare class VoidNumberInput extends VoidNumberInput_base {
|
|
11
|
+
/** Key bindings for this element's actions, as JSON (`{"increment":["ArrowUp","k"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
12
|
+
keys: KeyOverrides | null;
|
|
13
|
+
/** @internal The actions of this element and their default keys. */
|
|
14
|
+
static readonly keyMap: {
|
|
15
|
+
increment: string[];
|
|
16
|
+
decrement: string[];
|
|
17
|
+
};
|
|
10
18
|
/** The host's `aria-label` / `aria-labelledby` name the inner control. */
|
|
11
19
|
static labelTarget: string;
|
|
12
20
|
/** While focus is inside, a morph does not apply the server's value over what the user is typing. */
|
|
@@ -43,7 +51,7 @@ export declare class VoidNumberInput extends VoidNumberInput_base {
|
|
|
43
51
|
*/
|
|
44
52
|
controls: 'sides' | 'right' | 'none';
|
|
45
53
|
/**
|
|
46
|
-
* Accessible name of the field when it is not inside a `void-field`. Defaults to `Number input
|
|
54
|
+
* Accessible name of the field when it is not inside a `void-field`. Defaults to the `numberInput.label` message (English: `Number input`), so
|
|
47
55
|
* set it.
|
|
48
56
|
*/
|
|
49
57
|
label: string;
|
|
@@ -77,7 +85,13 @@ export declare class VoidNumberInput extends VoidNumberInput_base {
|
|
|
77
85
|
*/
|
|
78
86
|
protected formSubmission(): FormSubmission;
|
|
79
87
|
private _clamp;
|
|
88
|
+
/** The value as the reader's language writes it (decimal separator, digits), without grouping, with `precision` decimals when set. */
|
|
80
89
|
private _format;
|
|
90
|
+
/**
|
|
91
|
+
* Reads typed text the way the language writes numbers: its digits, decimal and grouping separators and minus
|
|
92
|
+
* sign. `NaN` when it is not a number. A plain `1.5` still reads as 1.5 where the decimal separator is a comma.
|
|
93
|
+
*/
|
|
94
|
+
private _parse;
|
|
81
95
|
/** Round to `precision` decimals (`precision="0"` gives integers); untouched when precision is unset. */
|
|
82
96
|
private _round;
|
|
83
97
|
private _commit;
|