@voidable/ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/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
package/dist/components/radio.js
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
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 {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { t as i } from "../chunks/keyboard-activation-BfEyoaMT.js";
|
|
5
|
+
import { n as a } from "../chunks/form-control-fL-Hhy91.js";
|
|
6
|
+
import { t as o } from "../chunks/projection-oPe6ipjL.js";
|
|
7
|
+
import { r as s } from "../chunks/keyboard-ChtDvhB_.js";
|
|
8
|
+
import { n as c } from "../chunks/choice-BTrsi7OW.js";
|
|
9
|
+
import { html as l, nothing as u } from "lit";
|
|
10
|
+
import { property as d } from "lit/decorators.js";
|
|
9
11
|
//#region src/components/radio.ts
|
|
10
|
-
var
|
|
12
|
+
var f = !1;
|
|
11
13
|
typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
12
|
-
|
|
14
|
+
f = e.key === "Tab" && e.shiftKey;
|
|
13
15
|
}, !0), document.addEventListener("pointerdown", () => {
|
|
14
|
-
|
|
16
|
+
f = !1;
|
|
15
17
|
}, !0));
|
|
16
|
-
var
|
|
18
|
+
var p = class t extends a(e) {
|
|
17
19
|
constructor(...e) {
|
|
18
|
-
super(...e), this._activation = new
|
|
19
|
-
enter: !1,
|
|
20
|
-
disabled: () => this.formDisabled
|
|
21
|
-
}), this.checked = !1, this.disabled = !1, this.name = "", this.value = "on", this.required = !1, this.color = "default", this.size = "md", this._projection = new i(this, { regions: [{
|
|
20
|
+
super(...e), this.keys = null, this._activation = new i(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.name = "", this.value = "on", this.required = !1, this.color = "default", this.size = "md", this._projection = new o(this, { regions: [{
|
|
22
21
|
name: "label",
|
|
23
22
|
target: "after"
|
|
24
23
|
}] }), this._anchor = null, this._hasFocus = !1, this._handleKeydown = (e) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
let t = n(this, e);
|
|
25
|
+
if (t !== "next" && t !== "previous" || e.target !== this) return;
|
|
26
|
+
let r = t === "next";
|
|
28
27
|
e.preventDefault();
|
|
29
|
-
let
|
|
30
|
-
|
|
28
|
+
let i = this._peers(), a = i[s(i.map((e) => e.formDisabled), i.indexOf(this), r ? 1 : -1)];
|
|
29
|
+
a && (a.focus(), a.click());
|
|
31
30
|
}, this._handleFocus = (e) => {
|
|
32
31
|
let t = this._peers(), n = e.relatedTarget;
|
|
33
|
-
if (
|
|
32
|
+
if (f && n && !t.some((e) => e.contains(n)) && !t.some((e) => !e.formDisabled && e._isOn()) && this.compareDocumentPosition(n) & Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
34
33
|
let e = t.filter((e) => !e.formDisabled).pop();
|
|
35
34
|
if (e && e !== this) {
|
|
36
35
|
e.focus();
|
|
@@ -67,6 +66,9 @@ var d = class t extends r(e) {
|
|
|
67
66
|
}));
|
|
68
67
|
};
|
|
69
68
|
}
|
|
69
|
+
static {
|
|
70
|
+
this.keyMap = c;
|
|
71
|
+
}
|
|
70
72
|
connectedCallback() {
|
|
71
73
|
super.connectedCallback(), this.setHostAttribute("role", "radio"), this.setHostAttribute("aria-checked", String(this._isOn())), this._anchor = this.closest("void-radio-group") ?? this.form ?? this.getRootNode(), this.setHostAttribute("tabindex", "-1"), this._syncTabStops(), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur);
|
|
72
74
|
}
|
|
@@ -100,10 +102,10 @@ var d = class t extends r(e) {
|
|
|
100
102
|
for (let t of e) t.setHostAttribute("tabindex", t === n ? "0" : "-1");
|
|
101
103
|
}
|
|
102
104
|
render() {
|
|
103
|
-
return
|
|
104
|
-
<input type="radio" .checked=${this.checked} ?disabled=${this.formDisabled} ?required=${this.required} name=${this.name} value=${this.value} form=${this.formAttr ??
|
|
105
|
+
return l`
|
|
106
|
+
<input type="radio" .checked=${this.checked} ?disabled=${this.formDisabled} ?required=${this.required} name=${this.name} value=${this.value} form=${this.formAttr ?? u} tabindex="-1" aria-hidden="true" inert @invalid=${this._onNativeInvalid} @focus=${this._onNativeFocus} />
|
|
105
107
|
<span class="void-radio-circle">
|
|
106
|
-
${this.checked ?
|
|
108
|
+
${this.checked ? l`<span class="void-radio-dot"></span>` : ""}
|
|
107
109
|
</span>
|
|
108
110
|
`;
|
|
109
111
|
}
|
|
@@ -130,27 +132,30 @@ var d = class t extends r(e) {
|
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
};
|
|
133
|
-
t([
|
|
135
|
+
t([d({
|
|
136
|
+
attribute: "keys",
|
|
137
|
+
converter: r
|
|
138
|
+
})], p.prototype, "keys", void 0), t([d({
|
|
134
139
|
type: Boolean,
|
|
135
140
|
reflect: !0
|
|
136
|
-
})],
|
|
141
|
+
})], p.prototype, "checked", void 0), t([d({
|
|
137
142
|
type: Boolean,
|
|
138
143
|
reflect: !0
|
|
139
|
-
})],
|
|
144
|
+
})], p.prototype, "disabled", void 0), t([d({
|
|
140
145
|
type: String,
|
|
141
146
|
reflect: !0
|
|
142
|
-
})],
|
|
147
|
+
})], p.prototype, "name", void 0), t([d({
|
|
143
148
|
type: String,
|
|
144
149
|
reflect: !0
|
|
145
|
-
})],
|
|
150
|
+
})], p.prototype, "value", void 0), t([d({
|
|
146
151
|
type: Boolean,
|
|
147
152
|
reflect: !0
|
|
148
|
-
})],
|
|
153
|
+
})], p.prototype, "required", void 0), t([d({
|
|
149
154
|
type: String,
|
|
150
155
|
reflect: !0
|
|
151
|
-
})],
|
|
156
|
+
})], p.prototype, "color", void 0), t([d({
|
|
152
157
|
type: String,
|
|
153
158
|
reflect: !0
|
|
154
|
-
})],
|
|
159
|
+
})], p.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", p);
|
|
155
160
|
//#endregion
|
|
156
|
-
export {
|
|
161
|
+
export { p as VoidRadio };
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { KeyboardActivation } from '../keyboard-activation.js';
|
|
3
3
|
import { FormSubmission } from '../form-control.js';
|
|
4
|
+
import { KeyOverrides } from '../keys.js';
|
|
4
5
|
/** Individual option within a VoidSegmentedControl button group. */
|
|
5
6
|
export declare class VoidSegmentedControlItem extends VoidElement {
|
|
7
|
+
/** Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
8
|
+
keys: KeyOverrides | null;
|
|
9
|
+
/** @internal The actions of this element and their default keys. */
|
|
10
|
+
static readonly keyMap: {
|
|
11
|
+
activate: string[];
|
|
12
|
+
};
|
|
6
13
|
/** Space fires a real `click`, which the control turns into a selection. */
|
|
7
14
|
protected readonly _activation: KeyboardActivation;
|
|
8
15
|
/**
|
|
@@ -32,6 +39,13 @@ declare const VoidSegmentedControl_base: (new (...args: any[]) => import('../for
|
|
|
32
39
|
* items; with nothing selected, the first or the last); Space selects the focused item.
|
|
33
40
|
*/
|
|
34
41
|
export declare class VoidSegmentedControl extends VoidSegmentedControl_base {
|
|
42
|
+
/** Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
43
|
+
keys: KeyOverrides | null;
|
|
44
|
+
/** @internal The actions of this element and their default keys. */
|
|
45
|
+
static readonly keyMap: {
|
|
46
|
+
next: string[];
|
|
47
|
+
previous: string[];
|
|
48
|
+
};
|
|
35
49
|
/**
|
|
36
50
|
* `value` of the selected item. Selection follows focus, so each arrow key changes it and fires
|
|
37
51
|
* `void-change`. Reflected to the attribute as it changes; the form's reset target stays the value it started with.
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { t as i } from "../chunks/keyboard-activation-BfEyoaMT.js";
|
|
5
|
+
import { n as a } from "../chunks/activation-B8aBarKd.js";
|
|
6
|
+
import { t as o } from "../chunks/form-control-fL-Hhy91.js";
|
|
7
|
+
import { n as s, r as c } from "../chunks/keyboard-ChtDvhB_.js";
|
|
8
|
+
import { t as l } from "../chunks/choice-BTrsi7OW.js";
|
|
9
|
+
import { property as u } from "lit/decorators.js";
|
|
7
10
|
//#region src/components/segmented-control.ts
|
|
8
|
-
var
|
|
11
|
+
var d = class extends e {
|
|
9
12
|
constructor(...e) {
|
|
10
|
-
super(...e), this._activation = new
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
super(...e), this.keys = null, this._activation = new i(this, { disabled: () => this.disabled }), this.value = "", this.disabled = !1;
|
|
14
|
+
}
|
|
15
|
+
static {
|
|
16
|
+
this.keyMap = a;
|
|
14
17
|
}
|
|
15
18
|
connectedCallback() {
|
|
16
19
|
super.connectedCallback(), this.setHostAttribute("role", "radio");
|
|
@@ -27,29 +30,35 @@ var c = class extends e {
|
|
|
27
30
|
this.setHostAttribute("aria-checked", String(e)), this.setHostAttribute("tabindex", t && !n ? "0" : "-1"), this.setHostAttribute("aria-disabled", n ? "true" : null);
|
|
28
31
|
}
|
|
29
32
|
};
|
|
30
|
-
t([
|
|
33
|
+
t([u({
|
|
34
|
+
attribute: "keys",
|
|
35
|
+
converter: r
|
|
36
|
+
})], d.prototype, "keys", void 0), t([u({
|
|
31
37
|
type: String,
|
|
32
38
|
reflect: !0
|
|
33
|
-
})],
|
|
39
|
+
})], d.prototype, "value", void 0), t([u({
|
|
34
40
|
type: Boolean,
|
|
35
41
|
reflect: !0
|
|
36
|
-
})],
|
|
37
|
-
var
|
|
42
|
+
})], d.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", d);
|
|
43
|
+
var f = class extends o(e) {
|
|
38
44
|
constructor(...e) {
|
|
39
|
-
super(...e), this.value = "", this.disabled = !1, this.size = "md", this.color = "default", this._observer = null, this._itemsSynced = !1, this._handleClick = (e) => {
|
|
45
|
+
super(...e), this.keys = null, this.value = "", this.disabled = !1, this.size = "md", this.color = "default", this._observer = null, this._itemsSynced = !1, this._handleClick = (e) => {
|
|
40
46
|
let t = e.target.closest("void-segmented-control-item");
|
|
41
47
|
t && this._select(t);
|
|
42
48
|
}, this._handleKeydown = (e) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
let t = n(this, e);
|
|
50
|
+
if (t !== "next" && t !== "previous" || this.formDisabled) return;
|
|
51
|
+
let r = this._items, i = e.target?.closest?.("void-segmented-control-item"), a = t === "next";
|
|
46
52
|
e.preventDefault();
|
|
47
|
-
let
|
|
48
|
-
u = l < 0 ?
|
|
49
|
-
let d =
|
|
53
|
+
let o = r.map((e) => e.disabled), l = i ? r.indexOf(i) : r.findIndex((e) => e.value === this.value), u;
|
|
54
|
+
u = l < 0 ? s(o, a ? 1 : -1) : c(o, l, a ? 1 : -1);
|
|
55
|
+
let d = r[u];
|
|
50
56
|
d && (d.focus(), this._select(d));
|
|
51
57
|
};
|
|
52
58
|
}
|
|
59
|
+
static {
|
|
60
|
+
this.keyMap = l;
|
|
61
|
+
}
|
|
53
62
|
connectedCallback() {
|
|
54
63
|
super.connectedCallback(), this.setHostAttribute("role", "radiogroup"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this._observer ??= new MutationObserver(() => this._syncItems()), this._observer.observe(this, {
|
|
55
64
|
childList: !0,
|
|
@@ -69,11 +78,11 @@ var l = class extends r(e) {
|
|
|
69
78
|
return this.value || null;
|
|
70
79
|
}
|
|
71
80
|
get _items() {
|
|
72
|
-
return Array.from(this.querySelectorAll("void-segmented-control-item")).filter((e) => e instanceof
|
|
81
|
+
return Array.from(this.querySelectorAll("void-segmented-control-item")).filter((e) => e instanceof d);
|
|
73
82
|
}
|
|
74
83
|
_syncItems() {
|
|
75
84
|
let e = this._items, t = this.formDisabled, n = e.findIndex((e) => e.value === this.value), r = n >= 0 && !e[n].disabled ? n : -1;
|
|
76
|
-
r < 0 && (r =
|
|
85
|
+
r < 0 && (r = s(e.map((e) => e.disabled), 1)), e.forEach((e, i) => e._apply(i === n, i === r, t || e.disabled));
|
|
77
86
|
}
|
|
78
87
|
_select(e) {
|
|
79
88
|
e.disabled || this.formDisabled || e.value === this.value || (this.value = e.value, this._syncItems(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
@@ -83,18 +92,21 @@ var l = class extends r(e) {
|
|
|
83
92
|
})));
|
|
84
93
|
}
|
|
85
94
|
};
|
|
86
|
-
t([
|
|
95
|
+
t([u({
|
|
96
|
+
attribute: "keys",
|
|
97
|
+
converter: r
|
|
98
|
+
})], f.prototype, "keys", void 0), t([u({
|
|
87
99
|
type: String,
|
|
88
100
|
reflect: !0
|
|
89
|
-
})],
|
|
101
|
+
})], f.prototype, "value", void 0), t([u({
|
|
90
102
|
type: Boolean,
|
|
91
103
|
reflect: !0
|
|
92
|
-
})],
|
|
104
|
+
})], f.prototype, "disabled", void 0), t([u({
|
|
93
105
|
type: String,
|
|
94
106
|
reflect: !0
|
|
95
|
-
})],
|
|
107
|
+
})], f.prototype, "size", void 0), t([u({
|
|
96
108
|
type: String,
|
|
97
109
|
reflect: !0
|
|
98
|
-
})],
|
|
110
|
+
})], f.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", f);
|
|
99
111
|
//#endregion
|
|
100
|
-
export {
|
|
112
|
+
export { f as VoidSegmentedControl, d as VoidSegmentedControlItem };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
3
|
+
import { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
4
5
|
//#region src/components/sidebar.ts
|
|
5
|
-
var
|
|
6
|
+
var a = class extends e {
|
|
6
7
|
constructor(...e) {
|
|
7
8
|
super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.side = "start";
|
|
8
9
|
}
|
|
@@ -20,31 +21,34 @@ var r = class extends e {
|
|
|
20
21
|
}));
|
|
21
22
|
}
|
|
22
23
|
connectedCallback() {
|
|
23
|
-
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.
|
|
24
|
+
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this._name(), this._updateWidth();
|
|
24
25
|
}
|
|
25
26
|
disconnectedCallback() {
|
|
26
27
|
super.disconnectedCallback();
|
|
27
28
|
}
|
|
29
|
+
_name() {
|
|
30
|
+
r(this, n(this, "sidebar.label"), (e, t) => this.setHostAttribute(e, t));
|
|
31
|
+
}
|
|
28
32
|
updated(e) {
|
|
29
|
-
(e.has("collapsed") || e.has("width") || e.has("collapsedWidth")) && this._updateWidth();
|
|
33
|
+
this._name(), (e.has("collapsed") || e.has("width") || e.has("collapsedWidth")) && this._updateWidth();
|
|
30
34
|
}
|
|
31
35
|
_updateWidth() {
|
|
32
36
|
this.setHostStyle("--void-sidebar-width", this.collapsed ? this.collapsedWidth : this.width);
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
|
-
t([
|
|
39
|
+
t([i({
|
|
36
40
|
type: Boolean,
|
|
37
41
|
reflect: !0
|
|
38
|
-
})],
|
|
42
|
+
})], a.prototype, "collapsed", void 0), t([i({
|
|
39
43
|
type: String,
|
|
40
44
|
reflect: !0
|
|
41
|
-
})],
|
|
45
|
+
})], a.prototype, "width", void 0), t([i({
|
|
42
46
|
type: String,
|
|
43
47
|
attribute: "collapsed-width",
|
|
44
48
|
reflect: !0
|
|
45
|
-
})],
|
|
49
|
+
})], a.prototype, "collapsedWidth", void 0), t([i({
|
|
46
50
|
type: String,
|
|
47
51
|
reflect: !0
|
|
48
|
-
})],
|
|
52
|
+
})], a.prototype, "side", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", a);
|
|
49
53
|
//#endregion
|
|
50
|
-
export {
|
|
54
|
+
export { a as VoidSidebar };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/form-control-
|
|
3
|
+
import { n } from "../chunks/form-control-fL-Hhy91.js";
|
|
4
4
|
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
5
|
import { html as i, nothing as a } from "lit";
|
|
6
6
|
import { property as o } from "lit/decorators.js";
|
|
@@ -4,12 +4,14 @@ export declare class VoidSpinner extends VoidElement {
|
|
|
4
4
|
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
5
5
|
size: 'sm' | 'md' | 'lg';
|
|
6
6
|
/**
|
|
7
|
-
* Text announced to screen readers while loading, and the spinner's accessible name. Defaults to
|
|
8
|
-
* `Loading
|
|
7
|
+
* Text announced to screen readers while loading, and the spinner's accessible name. Defaults to the `spinner.label` message (English:
|
|
8
|
+
* `Loading`); say what is loading (`Loading orders`).
|
|
9
9
|
*/
|
|
10
10
|
label: string;
|
|
11
11
|
connectedCallback(): void;
|
|
12
|
-
|
|
12
|
+
private _text;
|
|
13
|
+
private _name;
|
|
14
|
+
updated(): void;
|
|
13
15
|
render(): import('lit').TemplateResult<1>;
|
|
14
16
|
}
|
|
15
17
|
declare global {
|
|
@@ -1,30 +1,37 @@
|
|
|
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 { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { r as i } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { html as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators.js";
|
|
6
7
|
//#region src/components/spinner.ts
|
|
7
|
-
|
|
8
|
-
var
|
|
8
|
+
i();
|
|
9
|
+
var s = class extends e {
|
|
9
10
|
constructor(...e) {
|
|
10
|
-
super(...e), this.size = "md", this.label = "
|
|
11
|
+
super(...e), this.size = "md", this.label = "";
|
|
11
12
|
}
|
|
12
13
|
connectedCallback() {
|
|
13
|
-
super.connectedCallback(), this.setHostAttribute("role", "status"), this.
|
|
14
|
+
super.connectedCallback(), this.setHostAttribute("role", "status"), this._name();
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
_text() {
|
|
17
|
+
return this.label || n(this, "spinner.label");
|
|
18
|
+
}
|
|
19
|
+
_name() {
|
|
20
|
+
r(this, this._text(), (e, t) => this.setHostAttribute(e, t));
|
|
21
|
+
}
|
|
22
|
+
updated() {
|
|
23
|
+
this._name();
|
|
17
24
|
}
|
|
18
25
|
render() {
|
|
19
|
-
return
|
|
26
|
+
return a`<span data-void-sr>${this._text()}</span>`;
|
|
20
27
|
}
|
|
21
28
|
};
|
|
22
|
-
t([
|
|
29
|
+
t([o({
|
|
23
30
|
type: String,
|
|
24
31
|
reflect: !0
|
|
25
|
-
})],
|
|
32
|
+
})], s.prototype, "size", void 0), t([o({
|
|
26
33
|
type: String,
|
|
27
34
|
reflect: !0
|
|
28
|
-
})],
|
|
35
|
+
})], s.prototype, "label", void 0), customElements.get("void-spinner") || customElements.define("void-spinner", s);
|
|
29
36
|
//#endregion
|
|
30
|
-
export {
|
|
37
|
+
export { s as VoidSpinner };
|
package/dist/components/stat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { r as n } from "../chunks/projection-oPe6ipjL.js";
|
|
4
|
-
import {
|
|
4
|
+
import { i as r } from "../chunks/keyboard-ChtDvhB_.js";
|
|
5
5
|
import { html as i } from "lit";
|
|
6
6
|
import { property as a } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/stat.ts
|
|
@@ -7,8 +7,8 @@ export declare class VoidStatusDot extends VoidElement {
|
|
|
7
7
|
*/
|
|
8
8
|
status: 'online' | 'away' | 'offline';
|
|
9
9
|
connectedCallback(): void;
|
|
10
|
-
updated(
|
|
11
|
-
private
|
|
10
|
+
updated(): void;
|
|
11
|
+
private _name;
|
|
12
12
|
}
|
|
13
13
|
declare global {
|
|
14
14
|
interface HTMLElementTagNameMap {
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
3
|
+
import { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
4
5
|
//#region src/components/status-dot.ts
|
|
5
|
-
var
|
|
6
|
+
var a = class extends e {
|
|
6
7
|
constructor(...e) {
|
|
7
8
|
super(...e), this.status = "offline";
|
|
8
9
|
}
|
|
9
10
|
connectedCallback() {
|
|
10
|
-
super.connectedCallback(), this.setHostAttribute("role", "status"), this.
|
|
11
|
+
super.connectedCallback(), this.setHostAttribute("role", "status"), this._name();
|
|
11
12
|
}
|
|
12
|
-
updated(
|
|
13
|
-
|
|
13
|
+
updated() {
|
|
14
|
+
this._name();
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
case "away": return "Away";
|
|
19
|
-
default: return "Offline";
|
|
20
|
-
}
|
|
16
|
+
_name() {
|
|
17
|
+
let e = n(this, this.status === "online" ? "statusDot.online" : this.status === "away" ? "statusDot.away" : "statusDot.offline");
|
|
18
|
+
r(this, e, (e, t) => this.setHostAttribute(e, t));
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
|
-
t([
|
|
21
|
+
t([i({
|
|
24
22
|
type: String,
|
|
25
23
|
reflect: !0
|
|
26
|
-
})],
|
|
24
|
+
})], a.prototype, "status", void 0), customElements.get("void-status-dot") || customElements.define("void-status-dot", a);
|
|
27
25
|
//#endregion
|
|
28
|
-
export {
|
|
26
|
+
export { a as VoidStatusDot };
|
|
@@ -1,27 +1,34 @@
|
|
|
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 { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { r as i } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { html as a, nothing as o } from "lit";
|
|
6
|
+
import { property as s } from "lit/decorators.js";
|
|
6
7
|
//#region src/components/stepper.ts
|
|
7
|
-
|
|
8
|
-
var
|
|
8
|
+
i();
|
|
9
|
+
var c = class extends e {
|
|
9
10
|
constructor(...e) {
|
|
10
11
|
super(...e), this.value = 0, this.steps = "";
|
|
11
12
|
}
|
|
12
13
|
connectedCallback() {
|
|
13
|
-
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.
|
|
14
|
+
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this._name();
|
|
15
|
+
}
|
|
16
|
+
_name() {
|
|
17
|
+
r(this, n(this, "stepper.label"), (e, t) => this.setHostAttribute(e, t));
|
|
18
|
+
}
|
|
19
|
+
updated(e) {
|
|
20
|
+
super.updated(e), this._name();
|
|
14
21
|
}
|
|
15
22
|
render() {
|
|
16
|
-
return
|
|
23
|
+
return a`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
|
|
17
24
|
let n = t < this.value ? "completed" : t === this.value ? "active" : "upcoming";
|
|
18
|
-
return
|
|
25
|
+
return a`${t > 0 ? a`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
|
|
19
26
|
class="void-stepper-step"
|
|
20
27
|
data-state=${n}
|
|
21
|
-
aria-current=${t === this.value ? "step" :
|
|
28
|
+
aria-current=${t === this.value ? "step" : o}
|
|
22
29
|
>
|
|
23
30
|
<span class="void-stepper-circle"
|
|
24
|
-
>${n === "completed" ?
|
|
31
|
+
>${n === "completed" ? a`<svg
|
|
25
32
|
viewBox="0 0 12 12"
|
|
26
33
|
width="1em"
|
|
27
34
|
height="1em"
|
|
@@ -39,9 +46,9 @@ var o = class extends e {
|
|
|
39
46
|
})}`;
|
|
40
47
|
}
|
|
41
48
|
};
|
|
42
|
-
t([
|
|
49
|
+
t([s({
|
|
43
50
|
type: Number,
|
|
44
51
|
reflect: !0
|
|
45
|
-
})],
|
|
52
|
+
})], c.prototype, "value", void 0), t([s({ reflect: !0 })], c.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", c);
|
|
46
53
|
//#endregion
|
|
47
|
-
export {
|
|
54
|
+
export { c as VoidStepper };
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { KeyboardActivation } from '../keyboard-activation.js';
|
|
3
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
4
|
import { FormSubmission } from '../form-control.js';
|
|
4
5
|
declare const VoidSwitch_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
5
6
|
/** On/off toggle for feature flags, notification preferences, and settings that take immediate effect. */
|
|
6
7
|
export declare class VoidSwitch extends VoidSwitch_base {
|
|
8
|
+
/** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
9
|
+
keys: KeyOverrides | null;
|
|
10
|
+
/** @internal The actions of this element and their default keys. */
|
|
11
|
+
static readonly keyMap: {
|
|
12
|
+
activate: string[];
|
|
13
|
+
};
|
|
7
14
|
/** Enter and Space fire a real `click`, as on a native button. */
|
|
8
15
|
protected readonly _activation: KeyboardActivation;
|
|
9
16
|
/** Whether the switch is on. Reflected to the attribute as it changes; the form's reset target stays the state it started with. */
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as r } from "../chunks/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { keysConverter as n } from "../keys.js";
|
|
4
|
+
import { t as r } from "../chunks/keyboard-activation-BfEyoaMT.js";
|
|
5
|
+
import { t as i } from "../chunks/activation-B8aBarKd.js";
|
|
6
|
+
import { t as a } from "../chunks/form-control-fL-Hhy91.js";
|
|
7
|
+
import { r as o } from "../chunks/projection-oPe6ipjL.js";
|
|
8
|
+
import { html as s } from "lit";
|
|
9
|
+
import { property as c } from "lit/decorators.js";
|
|
8
10
|
//#region src/components/switch.ts
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
+
o();
|
|
12
|
+
var l = class extends a(e) {
|
|
11
13
|
constructor(...e) {
|
|
12
|
-
super(...e), this._activation = new
|
|
14
|
+
super(...e), this.keys = null, this._activation = new r(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.value = "on", this.color = "default", this.size = "md", this._handleClick = () => {
|
|
13
15
|
this.formDisabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("void-change", {
|
|
14
16
|
bubbles: !0,
|
|
15
17
|
composed: !0,
|
|
@@ -20,6 +22,9 @@ var s = class extends r(e) {
|
|
|
20
22
|
})));
|
|
21
23
|
};
|
|
22
24
|
}
|
|
25
|
+
static {
|
|
26
|
+
this.keyMap = i;
|
|
27
|
+
}
|
|
23
28
|
connectedCallback() {
|
|
24
29
|
super.connectedCallback(), this.setHostAttribute("role", "switch"), this.setHostAttribute("tabindex", this.disabled ? "-1" : "0"), this.setHostAttribute("aria-checked", String(this.checked)), this.addEventListener("click", this._handleClick);
|
|
25
30
|
}
|
|
@@ -42,24 +47,27 @@ var s = class extends r(e) {
|
|
|
42
47
|
this.checked = !!e;
|
|
43
48
|
}
|
|
44
49
|
render() {
|
|
45
|
-
return
|
|
50
|
+
return s`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
|
|
46
51
|
}
|
|
47
52
|
};
|
|
48
|
-
t([
|
|
53
|
+
t([c({
|
|
54
|
+
attribute: "keys",
|
|
55
|
+
converter: n
|
|
56
|
+
})], l.prototype, "keys", void 0), t([c({
|
|
49
57
|
type: Boolean,
|
|
50
58
|
reflect: !0
|
|
51
|
-
})],
|
|
59
|
+
})], l.prototype, "checked", void 0), t([c({
|
|
52
60
|
type: Boolean,
|
|
53
61
|
reflect: !0
|
|
54
|
-
})],
|
|
62
|
+
})], l.prototype, "disabled", void 0), t([c({
|
|
55
63
|
type: String,
|
|
56
64
|
reflect: !0
|
|
57
|
-
})],
|
|
65
|
+
})], l.prototype, "value", void 0), t([c({
|
|
58
66
|
type: String,
|
|
59
67
|
reflect: !0
|
|
60
|
-
})],
|
|
68
|
+
})], l.prototype, "color", void 0), t([c({
|
|
61
69
|
type: String,
|
|
62
70
|
reflect: !0
|
|
63
|
-
})],
|
|
71
|
+
})], l.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", l);
|
|
64
72
|
//#endregion
|
|
65
|
-
export {
|
|
73
|
+
export { l as VoidSwitch };
|