@voidable/ui 0.8.1 → 0.9.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 +8 -0
- package/dist/chunks/{modal-D_YVy2vg.js → modal-hivQ4YoU.js} +1 -1
- package/dist/chunks/{parts-D30c8OoG.js → parts-CMQQop0D.js} +4 -1
- package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
- package/dist/chunks/value-list-CH6GjYXM.js +28 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/action-input.d.ts +6 -2
- package/dist/components/action-input.js +55 -45
- package/dist/components/alert.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/checkbox-group.d.ts +10 -0
- package/dist/components/checkbox-group.js +30 -18
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/collapsible.js +1 -1
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/combobox.d.ts +4 -2
- package/dist/components/combobox.js +8 -5
- package/dist/components/compose-input.d.ts +1 -1
- package/dist/components/compose-input.js +4 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/editable.d.ts +1 -1
- package/dist/components/error-fallback.js +1 -1
- package/dist/components/gauge.js +4 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/input.d.ts +6 -2
- package/dist/components/input.js +43 -33
- package/dist/components/menu.js +1 -1
- package/dist/components/multiselect.d.ts +9 -0
- package/dist/components/multiselect.js +47 -38
- package/dist/components/nav-menu.js +1 -1
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/panel.js +1 -1
- package/dist/components/pin-input.d.ts +6 -2
- package/dist/components/pin-input.js +27 -17
- package/dist/components/popover.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +4 -1
- package/dist/components/segmented-control.d.ts +1 -1
- package/dist/components/select.d.ts +67 -16
- package/dist/components/select.js +172 -47
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tags-input.d.ts +1 -1
- package/dist/components/tags-input.js +22 -18
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +4 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle.js +4 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components.json +3 -3
- package/dist/custom-elements.json +85 -49
- package/dist/dev/types.d.ts +2 -3
- package/dist/dev.js +50 -48
- package/dist/llms.txt +125 -0
- package/dist/parts.d.ts +3 -1
- package/dist/reference.md +4575 -0
- package/dist/secret-value.d.ts +17 -0
- package/dist/types/elements.d.ts +2 -2
- package/dist/value-list.d.ts +14 -0
- package/dist/vscode.html-custom-data.json +33 -19
- package/dist/web-types.json +57 -37
- package/package.json +5 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n, t as r } from "../chunks/parts-
|
|
3
|
+
import { n, t as r } from "../chunks/parts-CMQQop0D.js";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/error-fallback.ts
|
|
6
6
|
var a = [
|
package/dist/components/gauge.js
CHANGED
|
@@ -360,7 +360,10 @@ var m = class extends e {
|
|
|
360
360
|
`;
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
t([a()], m.prototype, "unit", void 0), t([a({
|
|
363
|
+
t([a()], m.prototype, "unit", void 0), t([a({
|
|
364
|
+
type: Number,
|
|
365
|
+
reflect: !0
|
|
366
|
+
})], m.prototype, "value", void 0), t([a({ type: Number })], m.prototype, "min", void 0), t([a({ type: Number })], m.prototype, "max", void 0), t([a({
|
|
364
367
|
type: Number,
|
|
365
368
|
reflect: !0
|
|
366
369
|
})], m.prototype, "size", void 0), t([a({ type: Number })], m.prototype, "thickness", void 0), t([a({ reflect: !0 })], m.prototype, "circular", void 0), t([a({ reflect: !0 })], m.prototype, "variant", void 0), t([a({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { i as n, n as r } from "../chunks/parts-
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-CMQQop0D.js";
|
|
4
4
|
import { t as i } from "../chunks/overlay-BywGMcDW.js";
|
|
5
5
|
import { property as a } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/hover-card.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyDeclaration, PropertyValues } from 'lit';
|
|
1
2
|
import { VoidElement } from '../base.js';
|
|
2
3
|
declare const VoidInput_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
|
|
3
4
|
/** Single-line text entry for login forms, search fields, and structured data capture. */
|
|
@@ -9,8 +10,9 @@ export declare class VoidInput extends VoidInput_base {
|
|
|
9
10
|
/** Native input type. Every text-like type is forwarded to the native control. */
|
|
10
11
|
type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'month' | 'time' | 'week';
|
|
11
12
|
/**
|
|
12
|
-
* The text in the field.
|
|
13
|
-
*
|
|
13
|
+
* The text in the field. Reflected to the `value` attribute as it changes, and setting the attribute
|
|
14
|
+
* sets it; the form's reset target stays the value the field started with. A `type="password"` field
|
|
15
|
+
* does not reflect: its attribute is only ever the initial value.
|
|
14
16
|
*/
|
|
15
17
|
value: string;
|
|
16
18
|
/**
|
|
@@ -65,6 +67,8 @@ export declare class VoidInput extends VoidInput_base {
|
|
|
65
67
|
* forwarded to the native control: the native enumerated attribute, not a boolean.
|
|
66
68
|
*/
|
|
67
69
|
protected spellcheckAttr: string | null;
|
|
70
|
+
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
71
|
+
protected updated(changed: PropertyValues): void;
|
|
68
72
|
render(): import('lit').TemplateResult<1>;
|
|
69
73
|
protected formWriteNativeDefault(state: unknown): void;
|
|
70
74
|
protected formReadNative(): void;
|
package/dist/components/input.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { n as r, t as i } from "../chunks/secret-value-CmTtVkMg.js";
|
|
5
|
+
import { html as a, nothing as o } from "lit";
|
|
6
|
+
import { property as s } from "lit/decorators.js";
|
|
7
|
+
import { live as c } from "lit/directives/live.js";
|
|
7
8
|
//#region src/components/input.ts
|
|
8
|
-
var
|
|
9
|
+
var l = class t extends n(e) {
|
|
9
10
|
constructor(...e) {
|
|
10
11
|
super(...e), this.type = "text", this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
|
|
11
12
|
}
|
|
@@ -15,31 +16,37 @@ var s = class extends n(e) {
|
|
|
15
16
|
static {
|
|
16
17
|
this.editState = ["value"];
|
|
17
18
|
}
|
|
19
|
+
requestUpdate(e, n, i) {
|
|
20
|
+
super.requestUpdate(e, n, r(this.type === "password", e, i, () => t.getPropertyOptions("value")));
|
|
21
|
+
}
|
|
22
|
+
updated(e) {
|
|
23
|
+
super.updated(e), this.type === "password" && e.get("type") !== void 0 && i(this);
|
|
24
|
+
}
|
|
18
25
|
render() {
|
|
19
|
-
return
|
|
26
|
+
return a`
|
|
20
27
|
<input
|
|
21
28
|
type=${this.type}
|
|
22
|
-
.value=${
|
|
29
|
+
.value=${c(this.value)}
|
|
23
30
|
placeholder=${this.placeholder}
|
|
24
31
|
?disabled=${this.disabled}
|
|
25
32
|
?readonly=${this.readonly}
|
|
26
33
|
?required=${this.required}
|
|
27
34
|
name=${this.name}
|
|
28
|
-
autocomplete=${this.autocomplete ||
|
|
29
|
-
minlength=${this.minlength ??
|
|
30
|
-
maxlength=${this.maxlength ??
|
|
31
|
-
pattern=${this.pattern ||
|
|
32
|
-
inputmode=${this.inputMode ||
|
|
33
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
34
|
-
autocapitalize=${this.autocapitalize ||
|
|
35
|
-
spellcheck=${this.spellcheckAttr ??
|
|
36
|
-
form=${this.formAttr ??
|
|
35
|
+
autocomplete=${this.autocomplete || o}
|
|
36
|
+
minlength=${this.minlength ?? o}
|
|
37
|
+
maxlength=${this.maxlength ?? o}
|
|
38
|
+
pattern=${this.pattern || o}
|
|
39
|
+
inputmode=${this.inputMode || o}
|
|
40
|
+
enterkeyhint=${this.enterKeyHint || o}
|
|
41
|
+
autocapitalize=${this.autocapitalize || o}
|
|
42
|
+
spellcheck=${this.spellcheckAttr ?? o}
|
|
43
|
+
form=${this.formAttr ?? o}
|
|
37
44
|
aria-invalid=${this.error ? "true" : "false"}
|
|
38
45
|
@input=${this._onInput}
|
|
39
46
|
@change=${this._onChange}
|
|
40
47
|
@keydown=${this._onKeydown}
|
|
41
48
|
/>
|
|
42
|
-
${this.error ?
|
|
49
|
+
${this.error ? a`<span class="void-input-error">${this.error}</span>` : ""}
|
|
43
50
|
`;
|
|
44
51
|
}
|
|
45
52
|
formWriteNativeDefault(e) {
|
|
@@ -59,7 +66,7 @@ var s = class extends n(e) {
|
|
|
59
66
|
let t = e.target.form;
|
|
60
67
|
if (!t) return;
|
|
61
68
|
let n = Array.from(t.elements);
|
|
62
|
-
if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement &&
|
|
69
|
+
if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement && u.has(e.type)).length <= 1) return;
|
|
63
70
|
let r = [...n, ...Array.from(t.querySelectorAll("void-button"))].find((e) => e.tagName === "VOID-BUTTON" && e.getAttribute("type") === "submit");
|
|
64
71
|
!r || r.formDisabled || (e.preventDefault(), t.requestSubmit());
|
|
65
72
|
}
|
|
@@ -80,44 +87,47 @@ var s = class extends n(e) {
|
|
|
80
87
|
}));
|
|
81
88
|
}
|
|
82
89
|
};
|
|
83
|
-
t([
|
|
90
|
+
t([s({
|
|
91
|
+
type: String,
|
|
92
|
+
reflect: !0
|
|
93
|
+
})], l.prototype, "type", void 0), t([s({
|
|
84
94
|
type: String,
|
|
85
95
|
reflect: !0
|
|
86
|
-
})],
|
|
96
|
+
})], l.prototype, "value", void 0), t([s({
|
|
87
97
|
type: String,
|
|
88
98
|
reflect: !0
|
|
89
|
-
})],
|
|
99
|
+
})], l.prototype, "placeholder", void 0), t([s({
|
|
90
100
|
type: Boolean,
|
|
91
101
|
reflect: !0
|
|
92
|
-
})],
|
|
102
|
+
})], l.prototype, "disabled", void 0), t([s({
|
|
93
103
|
type: Boolean,
|
|
94
104
|
reflect: !0
|
|
95
|
-
})],
|
|
105
|
+
})], l.prototype, "readonly", void 0), t([s({
|
|
96
106
|
type: Boolean,
|
|
97
107
|
reflect: !0
|
|
98
|
-
})],
|
|
108
|
+
})], l.prototype, "required", void 0), t([s({
|
|
99
109
|
type: String,
|
|
100
110
|
reflect: !0
|
|
101
|
-
})],
|
|
111
|
+
})], l.prototype, "name", void 0), t([s({
|
|
102
112
|
type: String,
|
|
103
113
|
reflect: !0
|
|
104
|
-
})],
|
|
114
|
+
})], l.prototype, "size", void 0), t([s({
|
|
105
115
|
type: String,
|
|
106
116
|
reflect: !0
|
|
107
|
-
})],
|
|
117
|
+
})], l.prototype, "error", void 0), t([s({
|
|
108
118
|
type: String,
|
|
109
119
|
reflect: !0
|
|
110
|
-
})],
|
|
120
|
+
})], l.prototype, "autocomplete", void 0), t([s({ type: Number })], l.prototype, "minlength", void 0), t([s({ type: Number })], l.prototype, "maxlength", void 0), t([s({ type: String })], l.prototype, "pattern", void 0), t([s({
|
|
111
121
|
type: String,
|
|
112
122
|
attribute: "inputmode"
|
|
113
|
-
})],
|
|
123
|
+
})], l.prototype, "inputMode", void 0), t([s({
|
|
114
124
|
type: String,
|
|
115
125
|
attribute: "enterkeyhint"
|
|
116
|
-
})],
|
|
126
|
+
})], l.prototype, "enterKeyHint", void 0), t([s({ type: String })], l.prototype, "autocapitalize", void 0), t([s({
|
|
117
127
|
type: String,
|
|
118
128
|
attribute: "spellcheck"
|
|
119
|
-
})],
|
|
120
|
-
var
|
|
129
|
+
})], l.prototype, "spellcheckAttr", void 0);
|
|
130
|
+
var u = new Set([
|
|
121
131
|
"text",
|
|
122
132
|
"search",
|
|
123
133
|
"url",
|
|
@@ -131,6 +141,6 @@ var c = new Set([
|
|
|
131
141
|
"datetime-local",
|
|
132
142
|
"number"
|
|
133
143
|
]);
|
|
134
|
-
customElements.get("void-input") || customElements.define("void-input",
|
|
144
|
+
customElements.get("void-input") || customElements.define("void-input", l);
|
|
135
145
|
//#endregion
|
|
136
|
-
export {
|
|
146
|
+
export { l as VoidInput };
|
package/dist/components/menu.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
-
import { n as r } from "../chunks/parts-
|
|
4
|
+
import { n as r } from "../chunks/parts-CMQQop0D.js";
|
|
5
5
|
import { i, r as a, t as o } from "../chunks/keyboard-MQpfTX5I.js";
|
|
6
6
|
import { property as s } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/menu.ts
|
|
@@ -91,6 +91,15 @@ export declare class VoidMultiselect extends VoidMultiselect_base {
|
|
|
91
91
|
private _content;
|
|
92
92
|
private _trigger;
|
|
93
93
|
private get _options();
|
|
94
|
+
/** Values asked for while no option exists yet (an attribute parsed ahead of its options), applied when they arrive. */
|
|
95
|
+
private _wanted;
|
|
96
|
+
/** The serialised value last handed to Lit, to notice a choice made on the options (the user, a morph). */
|
|
97
|
+
private _reflected;
|
|
98
|
+
/**
|
|
99
|
+
* The values of the chosen options, as a list. The `value` attribute is the same list as a JSON array
|
|
100
|
+
* (`value='["a","b"]'`), kept in step as the choice changes; setting it chooses those options.
|
|
101
|
+
* @default []
|
|
102
|
+
*/
|
|
94
103
|
get value(): string[];
|
|
95
104
|
/** Select exactly the options whose value is listed. Does not fire void-change. */
|
|
96
105
|
set value(values: string[]);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { n as e, t } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t as n } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as r } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import { n as i } from "../chunks/parts-
|
|
4
|
+
import { n as i } from "../chunks/parts-CMQQop0D.js";
|
|
5
5
|
import { i as a, n as o, r as s, t as c } from "../chunks/keyboard-MQpfTX5I.js";
|
|
6
6
|
import { t as l } from "../chunks/overlay-BywGMcDW.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { n as u } from "../chunks/value-list-CH6GjYXM.js";
|
|
8
|
+
import { html as d, nothing as f } from "lit";
|
|
9
|
+
import { property as p } from "lit/decorators.js";
|
|
9
10
|
//#region src/components/multiselect.ts
|
|
10
|
-
var
|
|
11
|
+
var m = class extends t {
|
|
11
12
|
constructor(...e) {
|
|
12
13
|
super(...e), this.value = "", this.selected = !1, this.disabled = !1, this.label = "";
|
|
13
14
|
}
|
|
@@ -20,21 +21,21 @@ var p = class extends t {
|
|
|
20
21
|
].some((t) => e.has(t) && e.get(t) !== void 0) && (this.closest("void-multiselect") ?? this.closest("void-combobox"))?.requestUpdate();
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
n([
|
|
24
|
+
n([p({
|
|
24
25
|
type: String,
|
|
25
26
|
reflect: !0
|
|
26
|
-
})],
|
|
27
|
+
})], m.prototype, "value", void 0), n([p({
|
|
27
28
|
type: Boolean,
|
|
28
29
|
reflect: !0
|
|
29
|
-
})],
|
|
30
|
+
})], m.prototype, "selected", void 0), n([p({
|
|
30
31
|
type: Boolean,
|
|
31
32
|
reflect: !0
|
|
32
|
-
})],
|
|
33
|
-
var
|
|
34
|
-
function
|
|
33
|
+
})], m.prototype, "disabled", void 0), n([p({ type: String })], m.prototype, "label", void 0), customElements.get("void-option") || customElements.define("void-option", m);
|
|
34
|
+
var h = (e) => e instanceof m ? e.value : e.getAttribute("value") ?? "", g = (e) => e instanceof m ? e.selected : e.hasAttribute("selected");
|
|
35
|
+
function _(e) {
|
|
35
36
|
return e.getAttribute("label") || e.textContent?.trim() || e.getAttribute("value") || "";
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
+
var v = class extends r(t) {
|
|
38
39
|
constructor(...t) {
|
|
39
40
|
super(...t), this.placeholder = "Select...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this.open = !1, this._active = null, this._typeahead = new c(), this._wiring = !1, this._projection = new e(this, { placement: "start" }), this._parts = new i(this, {
|
|
40
41
|
tags: ["void-multiselect-content", "void-option"],
|
|
@@ -52,7 +53,7 @@ var _ = class extends r(t) {
|
|
|
52
53
|
attr: (e, t, n) => this._parts.set(e, t, n),
|
|
53
54
|
style: (e, t, n) => this._parts.style(e, t, n),
|
|
54
55
|
initialFocus: () => !1
|
|
55
|
-
}), this._onPointerDown = (e) => {
|
|
56
|
+
}), this._wanted = null, this._reflected = null, this._onPointerDown = (e) => {
|
|
56
57
|
let t = e.target;
|
|
57
58
|
(this._content()?.contains(t) || t.closest?.(".void-multiselect-pill-remove")) && e.preventDefault();
|
|
58
59
|
}, this._onClick = (e) => {
|
|
@@ -126,15 +127,18 @@ var _ = class extends r(t) {
|
|
|
126
127
|
return e ? this._parts.within(e, "void-option") : [];
|
|
127
128
|
}
|
|
128
129
|
get value() {
|
|
129
|
-
|
|
130
|
+
let e = this._options;
|
|
131
|
+
return this._wanted && e.length === 0 ? [...this._wanted] : e.filter(g).map(h);
|
|
130
132
|
}
|
|
131
133
|
set value(e) {
|
|
132
|
-
let t =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
let t = this._options, n = Array.isArray(e) ? e : [];
|
|
135
|
+
this._wanted = t.length === 0 ? [...n] : null;
|
|
136
|
+
let r = new Set(n);
|
|
137
|
+
for (let e of t) {
|
|
138
|
+
let t = r.has(h(e));
|
|
139
|
+
e instanceof m ? e.selected = t : e.toggleAttribute("selected", t);
|
|
136
140
|
}
|
|
137
|
-
this.requestUpdate();
|
|
141
|
+
this.requestUpdate("value", void 0);
|
|
138
142
|
}
|
|
139
143
|
formSubmission() {
|
|
140
144
|
return this.value;
|
|
@@ -147,6 +151,8 @@ var _ = class extends r(t) {
|
|
|
147
151
|
}
|
|
148
152
|
willUpdate(e) {
|
|
149
153
|
super.willUpdate(e), e.has("open") && !this.open && (this._active = null, this._typeahead.reset());
|
|
154
|
+
let t = JSON.stringify(this.value);
|
|
155
|
+
t !== this._reflected && (this._reflected = t, e.has("value") || this.requestUpdate("value", void 0));
|
|
150
156
|
}
|
|
151
157
|
updated(e) {
|
|
152
158
|
super.updated(e), this._wiring = !0;
|
|
@@ -159,7 +165,7 @@ var _ = class extends r(t) {
|
|
|
159
165
|
}
|
|
160
166
|
_wire() {
|
|
161
167
|
let e = this._content(), t = this._trigger(), n = this._options, r = this.open && !this.formDisabled;
|
|
162
|
-
this._active && (!n.includes(this._active) || this._active.disabled) && (this._active = null);
|
|
168
|
+
this._wanted && n.length > 0 && (this.value = this._wanted), this._active && (!n.includes(this._active) || this._active.disabled) && (this._active = null);
|
|
163
169
|
for (let e of n) this._parts.set(e, "role", "option"), this._parts.id(e, "void-option"), this._parts.set(e, "aria-selected", e.selected ? "true" : null), this._parts.set(e, "aria-disabled", e.disabled ? "true" : null), this._parts.set(e, "active", e === this._active);
|
|
164
170
|
if (!e) return;
|
|
165
171
|
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");
|
|
@@ -168,11 +174,11 @@ var _ = class extends r(t) {
|
|
|
168
174
|
}
|
|
169
175
|
_controls(e) {
|
|
170
176
|
let t = e ? this._content() : null;
|
|
171
|
-
return t ? this._parts.id(t, "void-multiselect-content") :
|
|
177
|
+
return t ? this._parts.id(t, "void-multiselect-content") : f;
|
|
172
178
|
}
|
|
173
179
|
render() {
|
|
174
180
|
let e = this._options.filter((e) => e.selected), t = this.open && !this.formDisabled, n = e.length;
|
|
175
|
-
return
|
|
181
|
+
return d`
|
|
176
182
|
<div
|
|
177
183
|
class="void-multiselect-trigger"
|
|
178
184
|
role="combobox"
|
|
@@ -181,26 +187,26 @@ var _ = class extends r(t) {
|
|
|
181
187
|
aria-haspopup="listbox"
|
|
182
188
|
aria-expanded=${String(t)}
|
|
183
189
|
aria-controls=${this._controls(t)}
|
|
184
|
-
aria-description=${n ? `${n} selected` :
|
|
185
|
-
aria-disabled=${this.formDisabled ? "true" :
|
|
186
|
-
aria-required=${this.required ? "true" :
|
|
187
|
-
aria-invalid=${this.error ? "true" :
|
|
190
|
+
aria-description=${n ? `${n} selected` : f}
|
|
191
|
+
aria-disabled=${this.formDisabled ? "true" : f}
|
|
192
|
+
aria-required=${this.required ? "true" : f}
|
|
193
|
+
aria-invalid=${this.error ? "true" : f}
|
|
188
194
|
@keydown=${this._onTriggerKeydown}
|
|
189
195
|
>
|
|
190
|
-
${n > 0 ? e.map((e) =>
|
|
196
|
+
${n > 0 ? e.map((e) => d`
|
|
191
197
|
<span class="void-multiselect-pill">
|
|
192
|
-
<span class="void-multiselect-pill-label">${
|
|
198
|
+
<span class="void-multiselect-pill-label">${_(e)}</span>
|
|
193
199
|
<button
|
|
194
200
|
type="button"
|
|
195
201
|
class="void-multiselect-pill-remove"
|
|
196
202
|
tabindex="-1"
|
|
197
|
-
aria-label="Remove ${
|
|
203
|
+
aria-label="Remove ${_(e)}"
|
|
198
204
|
data-value=${e.value}
|
|
199
205
|
>×</button>
|
|
200
206
|
</span>
|
|
201
|
-
`) :
|
|
207
|
+
`) : d`<span class="void-multiselect-placeholder">${this.placeholder}</span>`}
|
|
202
208
|
</div>
|
|
203
|
-
${this.error ?
|
|
209
|
+
${this.error ? d`<span class="void-multiselect-error">${this.error}</span>` : f}
|
|
204
210
|
`;
|
|
205
211
|
}
|
|
206
212
|
_openList(e, t = "keyboard") {
|
|
@@ -224,7 +230,7 @@ var _ = class extends r(t) {
|
|
|
224
230
|
return s >= 0 ? s : o(n, i);
|
|
225
231
|
}
|
|
226
232
|
_typeaheadTo(e) {
|
|
227
|
-
let t = this._options, n = this._active ? t.indexOf(this._active) : -1, r = this._typeahead.match(e, t.map((e) =>
|
|
233
|
+
let t = this._options, n = this._active ? t.indexOf(this._active) : -1, r = this._typeahead.match(e, t.map((e) => _(e)), t.map((e) => e.disabled), n);
|
|
228
234
|
this._moveActive(r);
|
|
229
235
|
}
|
|
230
236
|
_toggleOption(e, t = !e.selected) {
|
|
@@ -235,21 +241,24 @@ var _ = class extends r(t) {
|
|
|
235
241
|
}));
|
|
236
242
|
}
|
|
237
243
|
};
|
|
238
|
-
n([
|
|
244
|
+
n([p({ type: String })], v.prototype, "placeholder", void 0), n([p({
|
|
239
245
|
type: Boolean,
|
|
240
246
|
reflect: !0
|
|
241
|
-
})],
|
|
247
|
+
})], v.prototype, "disabled", void 0), n([p({
|
|
242
248
|
type: String,
|
|
243
249
|
reflect: !0
|
|
244
|
-
})],
|
|
250
|
+
})], v.prototype, "size", void 0), n([p({
|
|
245
251
|
type: String,
|
|
246
252
|
reflect: !0
|
|
247
|
-
})],
|
|
253
|
+
})], v.prototype, "error", void 0), n([p({
|
|
248
254
|
type: String,
|
|
249
255
|
reflect: !0
|
|
250
|
-
})],
|
|
256
|
+
})], v.prototype, "name", void 0), n([p({
|
|
251
257
|
type: Boolean,
|
|
252
258
|
reflect: !0
|
|
253
|
-
})],
|
|
259
|
+
})], v.prototype, "open", void 0), n([p({
|
|
260
|
+
converter: u,
|
|
261
|
+
reflect: !0
|
|
262
|
+
})], v.prototype, "value", null), customElements.get("void-multiselect") || customElements.define("void-multiselect", v);
|
|
254
263
|
//#endregion
|
|
255
|
-
export {
|
|
264
|
+
export { v as VoidMultiselect, m as VoidOption, _ as optionLabel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { i as n, n as r } from "../chunks/parts-
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-CMQQop0D.js";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/nav-menu.ts
|
|
6
6
|
var a = class extends e {
|
|
@@ -12,8 +12,8 @@ export declare class VoidNumberInput extends VoidNumberInput_base {
|
|
|
12
12
|
/** While focus is inside, a morph does not apply the server's value over what the user is typing. */
|
|
13
13
|
static editState: string[];
|
|
14
14
|
/**
|
|
15
|
-
* The number, or `null` while the field is empty (the default, and after the user clears it).
|
|
16
|
-
* attribute it
|
|
15
|
+
* The number, or `null` while the field is empty (the default, and after the user clears it). Reflected to
|
|
16
|
+
* the attribute as it changes (absent while empty); an absent or empty attribute is an empty field. It is kept within
|
|
17
17
|
* `min` and `max` once the user commits an edit. An empty field submits an empty string, and with
|
|
18
18
|
* `required` it is invalid (`valueMissing`), as a native number field.
|
|
19
19
|
*/
|
package/dist/components/panel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/parts-
|
|
3
|
+
import { n } from "../chunks/parts-CMQQop0D.js";
|
|
4
4
|
import { property as r } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/panel.ts
|
|
6
6
|
var i = class extends e {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyDeclaration, PropertyValues } from 'lit';
|
|
1
2
|
import { VoidElement } from '../base.js';
|
|
2
3
|
declare const VoidPinInput_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
3
4
|
/**
|
|
@@ -19,8 +20,9 @@ export declare class VoidPinInput extends VoidPinInput_base {
|
|
|
19
20
|
*/
|
|
20
21
|
groups: string;
|
|
21
22
|
/**
|
|
22
|
-
* The characters entered so far, without separators
|
|
23
|
-
* form's reset target
|
|
23
|
+
* The characters entered so far, without separators, reflected to the `value` attribute as they
|
|
24
|
+
* change; the form's reset target stays the value the cells started with. A `mask`ed input does not
|
|
25
|
+
* reflect: its attribute is only ever the initial value.
|
|
24
26
|
*/
|
|
25
27
|
value: string;
|
|
26
28
|
/** Stop the cells accepting input and exclude the value from the form submission. */
|
|
@@ -41,6 +43,8 @@ export declare class VoidPinInput extends VoidPinInput_base {
|
|
|
41
43
|
color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
|
|
42
44
|
/** Character shown in every empty cell, such as `-`. */
|
|
43
45
|
placeholder: string;
|
|
46
|
+
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
47
|
+
protected updated(changed: PropertyValues): void;
|
|
44
48
|
private get _effectiveLength();
|
|
45
49
|
private get _parsedGroups();
|
|
46
50
|
private _separatorIndices;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { r as e, t } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t as n } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as r } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { n as i, t as a } from "../chunks/secret-value-CmTtVkMg.js";
|
|
5
|
+
import { html as o, nothing as s } from "lit";
|
|
6
|
+
import { property as c } from "lit/decorators.js";
|
|
7
|
+
import { live as l } from "lit/directives/live.js";
|
|
7
8
|
//#region src/components/pin-input.ts
|
|
8
|
-
var
|
|
9
|
+
var u = class n extends r(t) {
|
|
9
10
|
constructor(...t) {
|
|
10
11
|
super(...t), this.length = 6, this.groups = "", this.value = "", this.disabled = !1, this.mask = !1, this.type = "numeric", this.size = "md", this.color = "default", this.placeholder = "", this._focusValue = null, this._onFocusIn = () => {
|
|
11
12
|
this._focusValue ??= this.value;
|
|
@@ -22,6 +23,12 @@ var c = class extends r(t) {
|
|
|
22
23
|
static {
|
|
23
24
|
this.editState = ["value"];
|
|
24
25
|
}
|
|
26
|
+
requestUpdate(e, t, r) {
|
|
27
|
+
super.requestUpdate(e, t, i(this.mask, e, r, () => n.getPropertyOptions("value")));
|
|
28
|
+
}
|
|
29
|
+
updated(e) {
|
|
30
|
+
super.updated(e), this.mask && e.get("mask") !== void 0 && a(this);
|
|
31
|
+
}
|
|
25
32
|
get _effectiveLength() {
|
|
26
33
|
let e = this._parsedGroups;
|
|
27
34
|
return e.length > 0 ? e.reduce((e, t) => e + t, 0) : this.length;
|
|
@@ -104,16 +111,16 @@ var c = class extends r(t) {
|
|
|
104
111
|
render() {
|
|
105
112
|
let e = [], t = this._separatorIndices();
|
|
106
113
|
for (let n = 0; n < this._effectiveLength; n++) {
|
|
107
|
-
t.has(n) && e.push(
|
|
114
|
+
t.has(n) && e.push(o`<span class="void-pin-separator" aria-hidden="true">–</span>`);
|
|
108
115
|
let r = this.value[n] ?? "";
|
|
109
|
-
e.push(
|
|
116
|
+
e.push(o`
|
|
110
117
|
<input
|
|
111
118
|
class="void-pin-cell"
|
|
112
119
|
type=${this.mask ? "password" : "text"}
|
|
113
120
|
inputmode=${this.type === "numeric" ? "numeric" : "text"}
|
|
114
121
|
maxlength="1"
|
|
115
|
-
.value=${
|
|
116
|
-
placeholder=${this.placeholder ||
|
|
122
|
+
.value=${l(r)}
|
|
123
|
+
placeholder=${this.placeholder || s}
|
|
117
124
|
?disabled=${this.disabled}
|
|
118
125
|
autocomplete="one-time-code"
|
|
119
126
|
aria-label=${`Digit ${n + 1} of ${this._effectiveLength}`}
|
|
@@ -124,27 +131,30 @@ var c = class extends r(t) {
|
|
|
124
131
|
/>
|
|
125
132
|
`);
|
|
126
133
|
}
|
|
127
|
-
return
|
|
134
|
+
return o`<div class="void-pin-input">${e}</div>`;
|
|
128
135
|
}
|
|
129
136
|
};
|
|
130
|
-
n([
|
|
137
|
+
n([c({ type: Number })], u.prototype, "length", void 0), n([c({
|
|
138
|
+
type: String,
|
|
139
|
+
reflect: !0
|
|
140
|
+
})], u.prototype, "groups", void 0), n([c({
|
|
131
141
|
type: String,
|
|
132
142
|
reflect: !0
|
|
133
|
-
})],
|
|
143
|
+
})], u.prototype, "value", void 0), n([c({
|
|
134
144
|
type: Boolean,
|
|
135
145
|
reflect: !0
|
|
136
|
-
})],
|
|
146
|
+
})], u.prototype, "disabled", void 0), n([c({
|
|
137
147
|
type: Boolean,
|
|
138
148
|
reflect: !0
|
|
139
|
-
})],
|
|
149
|
+
})], u.prototype, "mask", void 0), n([c({
|
|
140
150
|
type: String,
|
|
141
151
|
reflect: !0
|
|
142
|
-
})],
|
|
152
|
+
})], u.prototype, "type", void 0), n([c({
|
|
143
153
|
type: String,
|
|
144
154
|
reflect: !0
|
|
145
|
-
})],
|
|
155
|
+
})], u.prototype, "size", void 0), n([c({
|
|
146
156
|
type: String,
|
|
147
157
|
reflect: !0
|
|
148
|
-
})],
|
|
158
|
+
})], u.prototype, "color", void 0), n([c({ type: String })], u.prototype, "placeholder", void 0), customElements.get("void-pin-input") || customElements.define("void-pin-input", u);
|
|
149
159
|
//#endregion
|
|
150
|
-
export {
|
|
160
|
+
export { u as VoidPinInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { i as n, n as r } from "../chunks/parts-
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-CMQQop0D.js";
|
|
4
4
|
import { t as i } from "../chunks/overlay-BywGMcDW.js";
|
|
5
5
|
import { property as a } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/popover.ts
|
|
@@ -11,8 +11,8 @@ export declare class VoidRadioGroup extends VoidRadioGroup_base {
|
|
|
11
11
|
/** Name of the group, shown above the radios and used as its accessible name. */
|
|
12
12
|
label: string;
|
|
13
13
|
/**
|
|
14
|
-
* `value` of the selected radio. Set it to choose one; it
|
|
15
|
-
* reset target.
|
|
14
|
+
* `value` of the selected radio. Set it to choose one; it follows the user's choice and is reflected
|
|
15
|
+
* to the attribute. The form's reset target stays the initial selection.
|
|
16
16
|
*/
|
|
17
17
|
value: string;
|
|
18
18
|
name: string;
|
|
@@ -76,7 +76,10 @@ var s = class extends r(t) {
|
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
n([o({ type: String })], s.prototype, "label", void 0), n([o({
|
|
79
|
+
n([o({ type: String })], s.prototype, "label", void 0), n([o({
|
|
80
|
+
type: String,
|
|
81
|
+
reflect: !0
|
|
82
|
+
})], s.prototype, "value", void 0), n([o({
|
|
80
83
|
type: String,
|
|
81
84
|
reflect: !0
|
|
82
85
|
})], s.prototype, "name", void 0), n([o({
|
|
@@ -34,7 +34,7 @@ declare const VoidSegmentedControl_base: (new (...args: any[]) => import('../for
|
|
|
34
34
|
export declare class VoidSegmentedControl extends VoidSegmentedControl_base {
|
|
35
35
|
/**
|
|
36
36
|
* `value` of the selected item. Selection follows focus, so each arrow key changes it and fires
|
|
37
|
-
* `void-change`.
|
|
37
|
+
* `void-change`. Reflected to the attribute as it changes; the form's reset target stays the value it started with.
|
|
38
38
|
*/
|
|
39
39
|
value: string;
|
|
40
40
|
/** Stop the whole control reacting and exclude the value from the form submission. */
|