@voidable/ui 0.6.1 → 0.8.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 +168 -9
- package/dist/angular/index.d.ts +20 -0
- package/dist/angular/index.js +78 -0
- package/dist/autoloader-core.d.ts +45 -0
- package/dist/autoloader-table.generated.d.ts +5 -0
- package/dist/autoloader.d.ts +13 -0
- package/dist/autoloader.js +229 -0
- package/dist/base.d.ts +173 -2
- package/dist/base.js +2 -9
- package/dist/chunks/base-CMruMbxC.js +824 -0
- package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
- package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
- package/dist/chunks/form-control-C0vH6gii.js +300 -0
- package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
- package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
- package/dist/chunks/modal-D_YVy2vg.js +71 -0
- package/dist/chunks/overlay-BywGMcDW.js +467 -0
- package/dist/chunks/parts-D30c8OoG.js +229 -0
- package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
- package/dist/components/accordion.d.ts +38 -10
- package/dist/components/accordion.js +51 -53
- package/dist/components/action-input.d.ts +64 -6
- package/dist/components/action-input.js +84 -41
- package/dist/components/alert.d.ts +24 -10
- package/dist/components/alert.js +26 -27
- package/dist/components/avatar.d.ts +8 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +8 -3
- package/dist/components/badge.js +2 -2
- package/dist/components/banner.d.ts +21 -10
- package/dist/components/banner.js +27 -27
- package/dist/components/bar-chart.d.ts +30 -6
- package/dist/components/bar-chart.js +29 -39
- package/dist/components/breadcrumbs.d.ts +19 -6
- package/dist/components/breadcrumbs.js +16 -22
- package/dist/components/button.d.ts +64 -10
- package/dist/components/button.js +70 -26
- package/dist/components/calendar.d.ts +65 -10
- package/dist/components/calendar.js +157 -106
- package/dist/components/card.d.ts +14 -9
- package/dist/components/card.js +8 -22
- package/dist/components/carousel.d.ts +65 -14
- package/dist/components/carousel.js +84 -93
- package/dist/components/charts/scale.d.ts +0 -1
- package/dist/components/charts/shape.d.ts +0 -1
- package/dist/components/checkbox-group.d.ts +38 -5
- package/dist/components/checkbox-group.js +61 -20
- package/dist/components/checkbox.d.ts +53 -7
- package/dist/components/checkbox.js +66 -29
- package/dist/components/collapsible.d.ts +29 -9
- package/dist/components/collapsible.js +42 -44
- package/dist/components/color-picker.d.ts +20 -4
- package/dist/components/color-picker.js +35 -29
- package/dist/components/combobox.d.ts +84 -10
- package/dist/components/combobox.js +142 -45
- package/dist/components/compose-input.d.ts +8 -1
- package/dist/components/compose-input.js +9 -3
- package/dist/components/dialog.d.ts +24 -20
- package/dist/components/dialog.js +8 -57
- package/dist/components/divider.d.ts +8 -1
- package/dist/components/divider.js +3 -3
- package/dist/components/donut-chart.d.ts +28 -5
- package/dist/components/donut-chart.js +55 -54
- package/dist/components/drawer.d.ts +19 -18
- package/dist/components/drawer.js +9 -53
- package/dist/components/dropdown-menu.d.ts +62 -7
- package/dist/components/dropdown-menu.js +124 -33
- package/dist/components/editable.d.ts +37 -3
- package/dist/components/editable.js +45 -24
- package/dist/components/error-fallback.d.ts +36 -5
- package/dist/components/error-fallback.js +73 -23
- package/dist/components/field.d.ts +38 -4
- package/dist/components/field.js +63 -21
- package/dist/components/file-upload.d.ts +23 -2
- package/dist/components/file-upload.js +47 -24
- package/dist/components/gauge.d.ts +48 -9
- package/dist/components/gauge.js +57 -55
- package/dist/components/hamburger.d.ts +19 -4
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +40 -14
- package/dist/components/hover-card.js +76 -59
- package/dist/components/indicator.d.ts +18 -7
- package/dist/components/indicator.js +16 -18
- package/dist/components/input.d.ts +70 -5
- package/dist/components/input.js +83 -20
- package/dist/components/line-chart.d.ts +27 -5
- package/dist/components/line-chart.js +19 -21
- package/dist/components/list.d.ts +10 -1
- package/dist/components/list.js +3 -3
- package/dist/components/menu.d.ts +67 -21
- package/dist/components/menu.js +116 -115
- package/dist/components/multiselect.d.ts +108 -13
- package/dist/components/multiselect.js +207 -70
- package/dist/components/nav-bar.d.ts +12 -7
- package/dist/components/nav-bar.js +11 -21
- package/dist/components/nav-menu.d.ts +52 -12
- package/dist/components/nav-menu.js +68 -70
- package/dist/components/number-input.d.ts +76 -8
- package/dist/components/number-input.js +117 -51
- package/dist/components/pagination.d.ts +19 -1
- package/dist/components/pagination.js +68 -7
- package/dist/components/panel.d.ts +16 -8
- package/dist/components/panel.js +20 -20
- package/dist/components/pin-input.d.ts +41 -4
- package/dist/components/pin-input.js +45 -27
- package/dist/components/popover.d.ts +29 -11
- package/dist/components/popover.js +47 -35
- package/dist/components/progress.d.ts +7 -3
- package/dist/components/progress.js +3 -3
- package/dist/components/radio-group.d.ts +30 -5
- package/dist/components/radio-group.js +56 -19
- package/dist/components/radio.d.ts +47 -7
- package/dist/components/radio.js +68 -29
- package/dist/components/scroll-area.d.ts +8 -5
- package/dist/components/scroll-area.js +19 -20
- package/dist/components/segmented-control.d.ts +52 -8
- package/dist/components/segmented-control.js +66 -36
- package/dist/components/select.d.ts +59 -12
- package/dist/components/select.js +96 -46
- package/dist/components/sidebar.d.ts +22 -3
- package/dist/components/sidebar.js +20 -10
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +4 -4
- package/dist/components/slider.d.ts +27 -5
- package/dist/components/slider.js +29 -17
- package/dist/components/spinner.d.ts +6 -2
- package/dist/components/spinner.js +3 -3
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +7 -3
- package/dist/components/status-dot.d.ts +4 -1
- package/dist/components/status-dot.js +3 -3
- package/dist/components/stepper.d.ts +5 -1
- package/dist/components/stepper.js +2 -2
- package/dist/components/switch.d.ts +24 -5
- package/dist/components/switch.js +37 -19
- package/dist/components/table.d.ts +51 -2
- package/dist/components/table.js +157 -8
- package/dist/components/tabs.d.ts +49 -17
- package/dist/components/tabs.js +85 -54
- package/dist/components/tag.d.ts +17 -7
- package/dist/components/tag.js +19 -21
- package/dist/components/tags-input.d.ts +33 -4
- package/dist/components/tags-input.js +40 -30
- package/dist/components/textarea.d.ts +61 -5
- package/dist/components/textarea.js +58 -21
- package/dist/components/toast.d.ts +89 -15
- package/dist/components/toast.js +105 -30
- package/dist/components/toggle-group.d.ts +30 -3
- package/dist/components/toggle-group.js +43 -16
- package/dist/components/toggle.d.ts +25 -4
- package/dist/components/toggle.js +28 -18
- package/dist/components/tooltip.d.ts +31 -12
- package/dist/components/tooltip.js +62 -28
- package/dist/components.json +1518 -0
- package/dist/custom-elements.json +31817 -0
- package/dist/dev/index.d.ts +40 -0
- package/dist/dev/rules.d.ts +46 -0
- package/dist/dev/table.generated.d.ts +8 -0
- package/dist/dev/types.d.ts +113 -0
- package/dist/dev.js +3364 -0
- package/dist/disclosure.d.ts +30 -0
- package/dist/dismiss.d.ts +20 -0
- package/dist/form-control.d.ts +92 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -24
- package/dist/keyboard-activation.d.ts +31 -0
- package/dist/keyboard.d.ts +32 -0
- package/dist/modal.d.ts +44 -0
- package/dist/overlay.d.ts +249 -0
- package/dist/parts.d.ts +171 -0
- package/dist/projection.d.ts +370 -0
- package/dist/types/elements.d.ts +648 -0
- package/dist/types/react.d.ts +163 -0
- package/dist/types/solid.d.ts +164 -0
- package/dist/types/solid2.d.ts +161 -0
- package/dist/types/svelte.d.ts +154 -0
- package/dist/types/vue.d.ts +156 -0
- package/dist/vscode.html-custom-data.json +6004 -0
- package/dist/web-types.json +8365 -0
- package/package.json +113 -21
- package/dist/base.d.ts.map +0 -1
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/action-input.d.ts.map +0 -1
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/bar-chart.d.ts.map +0 -1
- package/dist/components/breadcrumbs.d.ts.map +0 -1
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/charts/scale.d.ts.map +0 -1
- package/dist/components/charts/shape.d.ts.map +0 -1
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/color-picker.d.ts.map +0 -1
- package/dist/components/combobox.d.ts.map +0 -1
- package/dist/components/compose-input.d.ts.map +0 -1
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/donut-chart.d.ts.map +0 -1
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/editable.d.ts.map +0 -1
- package/dist/components/error-fallback.d.ts.map +0 -1
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/file-upload.d.ts.map +0 -1
- package/dist/components/gauge.d.ts.map +0 -1
- package/dist/components/hamburger.d.ts.map +0 -1
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/indicator.d.ts.map +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/line-chart.d.ts.map +0 -1
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/menu.d.ts.map +0 -1
- package/dist/components/multiselect.d.ts.map +0 -1
- package/dist/components/nav-bar.d.ts.map +0 -1
- package/dist/components/nav-menu.d.ts.map +0 -1
- package/dist/components/number-input.d.ts.map +0 -1
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/pin-input.d.ts.map +0 -1
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/segmented-control.d.ts.map +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/stat.d.ts.map +0 -1
- package/dist/components/status-dot.d.ts.map +0 -1
- package/dist/components/stepper.d.ts.map +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tag.d.ts.map +0 -1
- package/dist/components/tags-input.d.ts.map +0 -1
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -1,20 +1,45 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
+
import { n as r } from "../chunks/parts-D30c8OoG.js";
|
|
5
|
+
import { property as i } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/carousel.ts
|
|
6
|
-
var
|
|
7
|
+
var a = class extends e {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this._activation = new n(this, { disabled: () => this.getAttribute("aria-disabled") === "true" });
|
|
10
|
+
}
|
|
7
11
|
connectedCallback() {
|
|
8
|
-
super.connectedCallback(), this.
|
|
12
|
+
super.connectedCallback(), this.setHostAttribute("role", "button"), this.setHostAttribute("tabindex", "0");
|
|
9
13
|
}
|
|
10
14
|
};
|
|
11
|
-
customElements.get("void-carousel-
|
|
12
|
-
var
|
|
15
|
+
customElements.get("void-carousel-previous") || customElements.define("void-carousel-previous", a);
|
|
16
|
+
var o = class extends e {
|
|
13
17
|
constructor(...e) {
|
|
14
|
-
super(...e), this.
|
|
15
|
-
|
|
18
|
+
super(...e), this._activation = new n(this, { disabled: () => this.getAttribute("aria-disabled") === "true" });
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback(), this.setHostAttribute("role", "button"), this.setHostAttribute("tabindex", "0");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
customElements.get("void-carousel-next") || customElements.define("void-carousel-next", o);
|
|
25
|
+
var s = class extends e {
|
|
26
|
+
constructor(...e) {
|
|
27
|
+
super(...e), this.index = 0, this.loop = !1, this.autoplay = !1, this.interval = 5e3, this.size = "md", this.orientation = "horizontal", this._autoplayTimer = null, this._labels = /* @__PURE__ */ new WeakMap(), this._dots = null, this._parts = new r(this, {
|
|
28
|
+
tags: [
|
|
29
|
+
"void-carousel-content",
|
|
30
|
+
"void-carousel-item",
|
|
31
|
+
"void-carousel-previous",
|
|
32
|
+
"void-carousel-next",
|
|
33
|
+
"void-carousel-indicators"
|
|
34
|
+
],
|
|
35
|
+
onChange: () => this._wire()
|
|
36
|
+
}), this._prev = () => {
|
|
37
|
+
this._goTo(this.index - 1);
|
|
16
38
|
}, this._next = () => {
|
|
17
|
-
this._goTo(this.
|
|
39
|
+
this._goTo(this.index + 1);
|
|
40
|
+
}, this._onClick = (e) => {
|
|
41
|
+
let t = e.target.closest("void-carousel-previous, void-carousel-next, void-carousel-indicators > button");
|
|
42
|
+
!t || !this._parts.owns(t) || t.getAttribute("aria-disabled") !== "true" && (t.localName === "void-carousel-previous" ? this._prev() : t.localName === "void-carousel-next" ? this._next() : this._goTo(Array.from(t.parentElement.children).indexOf(t)));
|
|
18
43
|
}, this._onMouseEnter = () => {
|
|
19
44
|
this.autoplay && this._stopAutoplay();
|
|
20
45
|
}, this._onMouseLeave = () => {
|
|
@@ -24,45 +49,64 @@ var a = class extends e {
|
|
|
24
49
|
e.key === n ? (e.preventDefault(), this._prev()) : e.key === r && (e.preventDefault(), this._next());
|
|
25
50
|
};
|
|
26
51
|
}
|
|
52
|
+
get _slides() {
|
|
53
|
+
return this._parts.all("void-carousel-item");
|
|
54
|
+
}
|
|
55
|
+
_wire() {
|
|
56
|
+
let e = this._slides, t = e.length, n = this._parts.one("void-carousel-content");
|
|
57
|
+
n && this._parts.provide(n, "aria-live", "polite"), e.forEach((e, n) => {
|
|
58
|
+
this._parts.provide(e, "role", "group"), this._parts.provide(e, "aria-roledescription", "slide");
|
|
59
|
+
let r = `Slide ${n + 1} of ${t}`, i = e.getAttribute("aria-label");
|
|
60
|
+
(i === null || i === this._labels.get(e)) && (this._parts.set(e, "aria-label", r), this._labels.set(e, r)), this._parts.set(e, "active", n === this.index);
|
|
61
|
+
});
|
|
62
|
+
let r = !this.loop && this.index === 0, i = !this.loop && this.index === t - 1, a = this._parts.one("void-carousel-previous"), o = this._parts.one("void-carousel-next");
|
|
63
|
+
a && this._parts.set(a, "aria-disabled", r ? "true" : null), o && this._parts.set(o, "aria-disabled", i ? "true" : null), this._syncDots(t), this.setHostStyle("--void-carousel-offset", String(this.index));
|
|
64
|
+
}
|
|
65
|
+
_syncDots(e) {
|
|
66
|
+
let t = this._parts.one("void-carousel-indicators");
|
|
67
|
+
if (!t) return;
|
|
68
|
+
this._parts.provide(t, "role", "tablist"), this._parts.provide(t, "aria-label", "Slide indicators");
|
|
69
|
+
let n = Array.from(t.children).filter((e) => e.localName === "button");
|
|
70
|
+
for (; n.length > e;) n.pop().remove();
|
|
71
|
+
for (; n.length < e;) {
|
|
72
|
+
let e = document.createElement("button");
|
|
73
|
+
e.type = "button", e.setAttribute("role", "tab"), t.appendChild(e), n.push(e);
|
|
74
|
+
}
|
|
75
|
+
n.forEach((e, t) => {
|
|
76
|
+
let n = t === this.index;
|
|
77
|
+
e.getAttribute("aria-selected") !== String(n) && e.setAttribute("aria-selected", String(n)), e.hasAttribute("active") !== n && e.toggleAttribute("active", n);
|
|
78
|
+
let r = `Go to slide ${t + 1}`;
|
|
79
|
+
e.getAttribute("aria-label") !== r && e.setAttribute("aria-label", r);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
27
82
|
connectedCallback() {
|
|
28
|
-
super.connectedCallback(), this.
|
|
83
|
+
super.connectedCallback(), this.setHostAttribute("role", "region"), this.setHostAttribute("aria-roledescription", "carousel"), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("keydown", this._onKeydown), this.addEventListener("click", this._onClick), this._dots ??= new MutationObserver((e) => {
|
|
84
|
+
e.some((e) => e.target.localName === "void-carousel-indicators") && this._parts.requestSync();
|
|
85
|
+
}), this._dots.observe(this, {
|
|
86
|
+
childList: !0,
|
|
87
|
+
subtree: !0
|
|
88
|
+
});
|
|
29
89
|
}
|
|
30
90
|
disconnectedCallback() {
|
|
31
|
-
super.disconnectedCallback(), this._stopAutoplay(), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("keydown", this._onKeydown);
|
|
91
|
+
super.disconnectedCallback(), this._stopAutoplay(), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("keydown", this._onKeydown), this.removeEventListener("click", this._onClick), this._dots?.disconnect();
|
|
32
92
|
}
|
|
33
93
|
updated(e) {
|
|
34
|
-
super.updated(e);
|
|
35
|
-
let t = !1;
|
|
36
|
-
if (!this._didSetup) {
|
|
37
|
-
this._didSetup = !0;
|
|
38
|
-
let e = this.querySelector(".void-carousel-track");
|
|
39
|
-
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
40
|
-
t = !0;
|
|
41
|
-
}
|
|
42
|
-
this._slides = Array.from(this.querySelectorAll("void-carousel-slide")), this._syncSlides(), (e.has("autoplay") || e.has("interval")) && (this._stopAutoplay(), this.autoplay && this._startAutoplay()), this.style.setProperty("--void-carousel-offset", String(this.active)), t && this.requestUpdate();
|
|
43
|
-
}
|
|
44
|
-
_syncSlides() {
|
|
45
|
-
for (let e = 0; e < this._slides.length; e++) {
|
|
46
|
-
let t = this._slides[e];
|
|
47
|
-
t.setAttribute("aria-label", `Slide ${e + 1} of ${this._slides.length}`), e === this.active ? t.setAttribute("active", "") : t.removeAttribute("active");
|
|
48
|
-
}
|
|
94
|
+
super.updated(e), this._parts.sync(), (e.has("autoplay") || e.has("interval")) && (this._stopAutoplay(), this.autoplay && this._startAutoplay());
|
|
49
95
|
}
|
|
50
96
|
_goTo(e) {
|
|
51
97
|
let t = this._slides.length;
|
|
52
98
|
if (t === 0) return;
|
|
53
|
-
let n = this.
|
|
54
|
-
e = this.loop ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1)), e !== n && (this.
|
|
99
|
+
let n = this.index;
|
|
100
|
+
e = this.loop ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1)), e !== n && (this.index = e, this._parts.sync(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
55
101
|
bubbles: !0,
|
|
56
102
|
composed: !0,
|
|
57
103
|
detail: {
|
|
58
|
-
|
|
104
|
+
value: this.index,
|
|
105
|
+
index: this.index,
|
|
59
106
|
previous: n
|
|
60
107
|
}
|
|
61
108
|
})));
|
|
62
109
|
}
|
|
63
|
-
_goToSlide(e) {
|
|
64
|
-
this._goTo(e);
|
|
65
|
-
}
|
|
66
110
|
_startAutoplay() {
|
|
67
111
|
this._autoplayTimer ||= setInterval(() => {
|
|
68
112
|
this._next();
|
|
@@ -71,75 +115,22 @@ var a = class extends e {
|
|
|
71
115
|
_stopAutoplay() {
|
|
72
116
|
this._autoplayTimer &&= (clearInterval(this._autoplayTimer), null);
|
|
73
117
|
}
|
|
74
|
-
render() {
|
|
75
|
-
let e = this._slides.length, t = !this.loop && this.active === 0, r = !this.loop && this.active === e - 1;
|
|
76
|
-
return n`
|
|
77
|
-
<div class="void-carousel-viewport">
|
|
78
|
-
<div class="void-carousel-track" aria-live="polite"></div>
|
|
79
|
-
</div>
|
|
80
|
-
${this.controls ? n`
|
|
81
|
-
<button
|
|
82
|
-
type="button"
|
|
83
|
-
class="void-carousel-prev"
|
|
84
|
-
aria-label="Previous slide"
|
|
85
|
-
?disabled=${t}
|
|
86
|
-
@click=${this._prev}
|
|
87
|
-
>
|
|
88
|
-
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
89
|
-
<path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
90
|
-
</svg>
|
|
91
|
-
</button>
|
|
92
|
-
<button
|
|
93
|
-
type="button"
|
|
94
|
-
class="void-carousel-next"
|
|
95
|
-
aria-label="Next slide"
|
|
96
|
-
?disabled=${r}
|
|
97
|
-
@click=${this._next}
|
|
98
|
-
>
|
|
99
|
-
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
100
|
-
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
101
|
-
</svg>
|
|
102
|
-
</button>
|
|
103
|
-
` : ""}
|
|
104
|
-
${this.indicators ? n`
|
|
105
|
-
<div class="void-carousel-indicators" role="tablist" aria-label="Slide indicators">
|
|
106
|
-
${this._slides.map((e, t) => n`
|
|
107
|
-
<button
|
|
108
|
-
type="button"
|
|
109
|
-
class="void-carousel-dot"
|
|
110
|
-
role="tab"
|
|
111
|
-
aria-selected=${t === this.active ? "true" : "false"}
|
|
112
|
-
aria-label="Go to slide ${t + 1}"
|
|
113
|
-
?active=${t === this.active}
|
|
114
|
-
@click=${() => this._goToSlide(t)}
|
|
115
|
-
></button>
|
|
116
|
-
`)}
|
|
117
|
-
</div>
|
|
118
|
-
` : ""}
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
118
|
};
|
|
122
|
-
t([
|
|
119
|
+
t([i({
|
|
123
120
|
type: Number,
|
|
124
121
|
reflect: !0
|
|
125
|
-
})],
|
|
122
|
+
})], s.prototype, "index", void 0), t([i({
|
|
126
123
|
type: Boolean,
|
|
127
124
|
reflect: !0
|
|
128
|
-
})],
|
|
125
|
+
})], s.prototype, "loop", void 0), t([i({
|
|
129
126
|
type: Boolean,
|
|
130
127
|
reflect: !0
|
|
131
|
-
})],
|
|
128
|
+
})], s.prototype, "autoplay", void 0), t([i({ type: Number })], s.prototype, "interval", void 0), t([i({
|
|
132
129
|
type: String,
|
|
133
130
|
reflect: !0
|
|
134
|
-
})],
|
|
135
|
-
type: Boolean,
|
|
136
|
-
reflect: !0
|
|
137
|
-
})], a.prototype, "controls", void 0), t([r({
|
|
138
|
-
type: Boolean,
|
|
139
|
-
reflect: !0
|
|
140
|
-
})], a.prototype, "indicators", void 0), t([r({
|
|
131
|
+
})], s.prototype, "size", void 0), t([i({
|
|
141
132
|
type: String,
|
|
142
133
|
reflect: !0
|
|
143
|
-
})],
|
|
134
|
+
})], s.prototype, "orientation", void 0), customElements.get("void-carousel") || customElements.define("void-carousel", s);
|
|
144
135
|
//#endregion
|
|
145
|
-
export {
|
|
136
|
+
export { s as VoidCarousel, o as VoidCarouselNext, a as VoidCarouselPrevious };
|
|
@@ -10,4 +10,3 @@ export declare function smoothLinePath(points: Array<[number, number]>): string;
|
|
|
10
10
|
export declare function smoothAreaPath(points: Array<[number, number]>, baseline: number): string;
|
|
11
11
|
/** SVG path for a circular arc segment (donut/pie wedge). */
|
|
12
12
|
export declare function arcPath(cx: number, cy: number, outerR: number, startAngle: number, endAngle: number, innerR?: number): string;
|
|
13
|
-
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { ProjectionController } from '../projection.js';
|
|
3
|
+
declare const VoidCheckboxGroup_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
|
|
4
|
+
/**
|
|
5
|
+
* Grouped multi-option selection for preference forms, filter panels, and permission editors.
|
|
6
|
+
*
|
|
7
|
+
* Form strategy: pass-through. `name` is forwarded to the child void-checkbox
|
|
8
|
+
* elements, whose native checkboxes submit one entry per checked box; the
|
|
9
|
+
* group itself submits nothing and each checkbox resets itself. `required`
|
|
10
|
+
* means "at least one checked", enforced with setCustomValidity on the first
|
|
11
|
+
* enabled checkbox's native input. `disabled` and `form` are forwarded.
|
|
12
|
+
*/
|
|
13
|
+
export declare class VoidCheckboxGroup extends VoidCheckboxGroup_base {
|
|
14
|
+
/** Name of the group, shown above the boxes and used as its accessible name. */
|
|
4
15
|
label: string;
|
|
16
|
+
/** Lay the checkboxes out in a `vertical` column (default) or a `horizontal` row. */
|
|
5
17
|
orientation: 'vertical' | 'horizontal';
|
|
6
|
-
|
|
7
|
-
|
|
18
|
+
/** Field name forwarded to every child checkbox. */
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The control must have a value before its form can be submitted. An empty control is invalid
|
|
22
|
+
* (`valueMissing`) and the browser reports it, as for a native field.
|
|
23
|
+
*/
|
|
24
|
+
required: boolean;
|
|
25
|
+
/** Disables every checkbox in the group (like a fieldset). */
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
protected readonly _projection: ProjectionController;
|
|
8
28
|
get value(): string[];
|
|
29
|
+
/** Check exactly the child checkboxes whose value is listed. Does not fire void-change. */
|
|
30
|
+
set value(values: string[]);
|
|
31
|
+
/** The checkboxes reset themselves; the group has no state of its own. */
|
|
32
|
+
protected formSnapshot(): unknown;
|
|
33
|
+
/** "At least one" validity, carried by the first enabled native checkbox. */
|
|
34
|
+
protected formSyncNative(): void;
|
|
9
35
|
connectedCallback(): void;
|
|
10
36
|
disconnectedCallback(): void;
|
|
11
37
|
protected updated(changed: Map<string, unknown>): void;
|
|
38
|
+
/** A morph may have replaced or added checkboxes that do not carry the group's name, form or validity yet. */
|
|
39
|
+
protected morphedCallback(): void;
|
|
40
|
+
private _boxes;
|
|
41
|
+
/** Recompute "at least one" validity once the checkboxes have rendered their native inputs. */
|
|
42
|
+
private _syncRequiredValidity;
|
|
43
|
+
private _syncFormAttr;
|
|
44
|
+
private _syncNames;
|
|
12
45
|
render(): import('lit').TemplateResult<1>;
|
|
13
46
|
private _handleChildChange;
|
|
14
47
|
}
|
|
@@ -17,4 +50,4 @@ declare global {
|
|
|
17
50
|
'void-checkbox-group': VoidCheckboxGroup;
|
|
18
51
|
}
|
|
19
52
|
}
|
|
20
|
-
|
|
53
|
+
export {};
|
|
@@ -1,48 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as e, t } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t as n } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { n as r } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
+
import { html as i, nothing as a } from "lit";
|
|
5
|
+
import { property as o } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/checkbox-group.ts
|
|
6
|
-
var
|
|
7
|
-
constructor(...
|
|
8
|
-
super(...
|
|
7
|
+
var s = class extends r(t) {
|
|
8
|
+
constructor(...t) {
|
|
9
|
+
super(...t), this.label = "", this.orientation = "vertical", this.name = "", this.required = !1, this.disabled = !1, this._projection = new e(this, {
|
|
10
|
+
regions: [{
|
|
11
|
+
name: "items",
|
|
12
|
+
target: () => this.querySelector(":scope > .void-checkbox-group-items")
|
|
13
|
+
}],
|
|
14
|
+
onChange: () => {
|
|
15
|
+
this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
|
|
16
|
+
}
|
|
17
|
+
}), this._handleChildChange = (e) => {
|
|
9
18
|
let t = e.target;
|
|
10
19
|
!t.closest("void-checkbox") || t.closest("void-checkbox")?.closest("void-checkbox-group") !== this || (e.stopImmediatePropagation(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
11
20
|
bubbles: !0,
|
|
12
21
|
composed: !0,
|
|
13
|
-
detail: {
|
|
22
|
+
detail: { value: this.value }
|
|
14
23
|
})));
|
|
15
24
|
};
|
|
16
25
|
}
|
|
17
26
|
get value() {
|
|
18
27
|
return Array.from(this.querySelectorAll("void-checkbox")).filter((e) => e.checked).map((e) => e.value);
|
|
19
28
|
}
|
|
29
|
+
set value(e) {
|
|
30
|
+
let t = new Set(e ?? []);
|
|
31
|
+
for (let e of Array.from(this.querySelectorAll("void-checkbox"))) e.checked = t.has(e.value);
|
|
32
|
+
this.formSync();
|
|
33
|
+
}
|
|
34
|
+
formSnapshot() {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
formSyncNative() {
|
|
38
|
+
let e = Array.from(this.querySelectorAll("void-checkbox")), t = this.required && this.value.length === 0 ? e.find((e) => !e.formDisabled) : void 0;
|
|
39
|
+
for (let n of e) n.querySelector("input[type=\"checkbox\"]")?.setCustomValidity(n === t ? "Please check at least one box." : "");
|
|
40
|
+
}
|
|
20
41
|
connectedCallback() {
|
|
21
|
-
super.connectedCallback(), this.
|
|
42
|
+
super.connectedCallback(), this.setHostAttribute("role", "group"), this.label && this.setHostAttribute("aria-label", this.label), this.addEventListener("void-change", this._handleChildChange);
|
|
22
43
|
}
|
|
23
44
|
disconnectedCallback() {
|
|
24
45
|
super.disconnectedCallback(), this.removeEventListener("void-change", this._handleChildChange);
|
|
25
46
|
}
|
|
26
47
|
updated(e) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
super.updated(e), e.has("label") && (this.label ? this.setHostAttribute("aria-label", this.label) : e.get("label") && this.setHostAttribute("aria-label", null)), e.has("name") && this._syncNames(), e.has("formAttr") && this._syncFormAttr(), (e.has("disabled") || e.has("ancestorDisabled")) && this.setHostAttribute("aria-disabled", this.formDisabled ? "true" : null), e.has("required") && this._syncRequiredValidity();
|
|
49
|
+
}
|
|
50
|
+
morphedCallback() {
|
|
51
|
+
this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
|
|
52
|
+
}
|
|
53
|
+
_boxes() {
|
|
54
|
+
return Array.from(this.querySelectorAll("void-checkbox"));
|
|
55
|
+
}
|
|
56
|
+
_syncRequiredValidity() {
|
|
57
|
+
Promise.all(this._boxes().map((e) => e.updateComplete)).then(() => this.formSyncNative());
|
|
58
|
+
}
|
|
59
|
+
_syncFormAttr() {
|
|
60
|
+
for (let e of this._boxes()) this.formAttr === null ? e.removeAttribute("form") : e.setAttribute("form", this.formAttr);
|
|
61
|
+
}
|
|
62
|
+
_syncNames() {
|
|
63
|
+
if (this.name) for (let e of this._boxes()) e.name = this.name;
|
|
32
64
|
}
|
|
33
65
|
render() {
|
|
34
|
-
return
|
|
35
|
-
${this.label ?
|
|
66
|
+
return i`
|
|
67
|
+
${this.label ? i`<span class="void-checkbox-group-label">${this.label}</span>` : a}
|
|
36
68
|
<div class="void-checkbox-group-items"></div>
|
|
37
69
|
`;
|
|
38
70
|
}
|
|
39
71
|
};
|
|
40
|
-
|
|
72
|
+
n([o({
|
|
73
|
+
type: String,
|
|
74
|
+
reflect: !0
|
|
75
|
+
})], s.prototype, "label", void 0), n([o({
|
|
41
76
|
type: String,
|
|
42
77
|
reflect: !0
|
|
43
|
-
})],
|
|
78
|
+
})], s.prototype, "orientation", void 0), n([o({
|
|
44
79
|
type: String,
|
|
45
80
|
reflect: !0
|
|
46
|
-
})],
|
|
81
|
+
})], s.prototype, "name", void 0), n([o({
|
|
82
|
+
type: Boolean,
|
|
83
|
+
reflect: !0
|
|
84
|
+
})], s.prototype, "required", void 0), n([o({
|
|
85
|
+
type: Boolean,
|
|
86
|
+
reflect: !0
|
|
87
|
+
})], s.prototype, "disabled", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", s);
|
|
47
88
|
//#endregion
|
|
48
|
-
export {
|
|
89
|
+
export { s as VoidCheckboxGroup };
|
|
@@ -1,25 +1,71 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
+
import { KeyboardActivation } from '../keyboard-activation.js';
|
|
3
|
+
import { ProjectionController } from '../projection.js';
|
|
4
|
+
declare const VoidCheckbox_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
|
|
2
5
|
/** Binary or indeterminate selection for form fields, data table row selection, and toggle-able settings. */
|
|
3
|
-
export declare class VoidCheckbox extends
|
|
6
|
+
export declare class VoidCheckbox extends VoidCheckbox_base {
|
|
7
|
+
/** Enter and Space fire a real `click`, as on a native button. */
|
|
8
|
+
protected readonly _activation: KeyboardActivation;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the box is checked. Updated when the user toggles it; the attribute is the initial state and
|
|
11
|
+
* the form's reset target.
|
|
12
|
+
*/
|
|
4
13
|
checked: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Stop the box reacting and exclude it from the form submission. Also disabled by a `<fieldset
|
|
16
|
+
* disabled>` or a disabled `void-checkbox-group` around it.
|
|
17
|
+
*/
|
|
5
18
|
disabled: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Show the mixed state (a dash) for a parent box whose children are partly checked. It is purely
|
|
21
|
+
* visual and cleared when the user toggles the box.
|
|
22
|
+
*/
|
|
6
23
|
indeterminate: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Key the value is submitted under while the box is checked. Within a `void-checkbox-group` the
|
|
26
|
+
* group's `name` is used.
|
|
27
|
+
*/
|
|
7
28
|
name: string;
|
|
29
|
+
/** Submitted under `name` while checked; defaults to "on" like a native checkbox. */
|
|
8
30
|
value: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Must be checked. Forwarded to the native checkbox, which the browser
|
|
33
|
+
* validates; when it focuses that (aria-hidden) input, focus moves to the host.
|
|
34
|
+
*/
|
|
35
|
+
required: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Status colour of the checked box: `default`, `error`, `warning`, `caution`, `success`, `info`,
|
|
38
|
+
* `notice` or `highlight`.
|
|
39
|
+
*/
|
|
40
|
+
color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
|
|
41
|
+
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
42
|
+
size: 'sm' | 'md' | 'lg';
|
|
43
|
+
protected readonly _projection: ProjectionController;
|
|
13
44
|
connectedCallback(): void;
|
|
14
45
|
disconnectedCallback(): void;
|
|
15
46
|
protected updated(changed: Map<string, unknown>): void;
|
|
16
47
|
render(): import('lit').TemplateResult<1>;
|
|
48
|
+
/** Form reset target is the checked state; the native checkbox submits. */
|
|
49
|
+
protected formSnapshot(): unknown;
|
|
50
|
+
/** A disabled void-checkbox-group disables its checkboxes like a fieldset. */
|
|
51
|
+
protected formAncestorDisabled(): boolean;
|
|
52
|
+
protected formWriteNativeDefault(state: unknown): void;
|
|
53
|
+
protected formReadNative(): void;
|
|
54
|
+
/** The browser focuses the native input to report validity; hand focus to the host. */
|
|
55
|
+
private _onNativeFocus;
|
|
56
|
+
/**
|
|
57
|
+
* The native input is `inert`, so assistive technology and axe see one widget (the host)
|
|
58
|
+
* rather than a focusable input nested in it. An inert input cannot be focused, which
|
|
59
|
+
* would silently block submission of a required control, so it is made focusable for the
|
|
60
|
+
* moment the browser reports validity.
|
|
61
|
+
*/
|
|
62
|
+
private _onNativeInvalid;
|
|
63
|
+
protected formSyncNative(): void;
|
|
17
64
|
private _handleClick;
|
|
18
|
-
private _handleKeydown;
|
|
19
65
|
}
|
|
20
66
|
declare global {
|
|
21
67
|
interface HTMLElementTagNameMap {
|
|
22
68
|
'void-checkbox': VoidCheckbox;
|
|
23
69
|
}
|
|
24
70
|
}
|
|
25
|
-
|
|
71
|
+
export {};
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as e, t } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t as n } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as r } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
+
import { n as i } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
+
import { html as a, nothing as o } from "lit";
|
|
6
|
+
import { property as s } from "lit/decorators.js";
|
|
5
7
|
//#region src/components/checkbox.ts
|
|
6
|
-
var
|
|
7
|
-
constructor(...
|
|
8
|
-
super(...
|
|
9
|
-
|
|
8
|
+
var c = class extends i(t) {
|
|
9
|
+
constructor(...t) {
|
|
10
|
+
super(...t), this._activation = new r(this, {
|
|
11
|
+
enter: !1,
|
|
12
|
+
disabled: () => this.formDisabled
|
|
13
|
+
}), this.checked = !1, this.disabled = !1, this.indeterminate = !1, this.name = "", this.value = "on", this.required = !1, this.color = "default", this.size = "md", this._projection = new e(this, { regions: [{
|
|
14
|
+
name: "label",
|
|
15
|
+
target: "after"
|
|
16
|
+
}] }), this._onNativeFocus = () => {
|
|
17
|
+
this.focus();
|
|
18
|
+
}, this._onNativeInvalid = (e) => {
|
|
19
|
+
let t = e.target;
|
|
20
|
+
t.inert = !1, setTimeout(() => {
|
|
21
|
+
t.inert = !0;
|
|
22
|
+
});
|
|
23
|
+
}, this._handleClick = (e) => {
|
|
24
|
+
if (this.formDisabled) {
|
|
10
25
|
e.stopImmediatePropagation();
|
|
11
26
|
return;
|
|
12
27
|
}
|
|
@@ -15,55 +30,77 @@ var i = class extends e {
|
|
|
15
30
|
t && (t.checked = this.checked), this.dispatchEvent(new CustomEvent("void-change", {
|
|
16
31
|
bubbles: !0,
|
|
17
32
|
composed: !0,
|
|
18
|
-
detail: {
|
|
33
|
+
detail: {
|
|
34
|
+
value: this.value,
|
|
35
|
+
checked: this.checked
|
|
36
|
+
}
|
|
19
37
|
}));
|
|
20
|
-
}, this._handleKeydown = (e) => {
|
|
21
|
-
e.key === " " && !this.disabled && (e.preventDefault(), this._handleClick(e));
|
|
22
38
|
};
|
|
23
39
|
}
|
|
24
40
|
connectedCallback() {
|
|
25
|
-
super.connectedCallback(), this.
|
|
41
|
+
super.connectedCallback(), this.setHostAttribute("role", "checkbox"), this.setHostAttribute("tabindex", "0"), this.setHostAttribute("aria-checked", String(this.checked)), this.addEventListener("click", this._handleClick);
|
|
26
42
|
}
|
|
27
43
|
disconnectedCallback() {
|
|
28
|
-
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick)
|
|
44
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
|
|
29
45
|
}
|
|
30
46
|
updated(e) {
|
|
31
|
-
if (super.updated(e), (e.has("checked") || e.has("indeterminate")) && (this.indeterminate ? this.
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
if (super.updated(e), (e.has("checked") || e.has("indeterminate")) && (this.indeterminate ? this.setHostAttribute("aria-checked", "mixed") : this.setHostAttribute("aria-checked", String(this.checked))), e.has("disabled") || e.has("ancestorDisabled")) {
|
|
48
|
+
let e = this.formDisabled;
|
|
49
|
+
this.setHostAttribute("aria-disabled", e ? "true" : null), this.setHostAttribute("tabindex", e ? "-1" : "0");
|
|
34
50
|
}
|
|
35
51
|
}
|
|
36
52
|
render() {
|
|
37
|
-
return
|
|
38
|
-
<input type="checkbox" .checked=${this.checked} .indeterminate=${this.indeterminate} ?disabled=${this.
|
|
53
|
+
return a`
|
|
54
|
+
<input type="checkbox" .checked=${this.checked} .indeterminate=${this.indeterminate} ?disabled=${this.formDisabled} ?required=${this.required} name=${this.name} value=${this.value} form=${this.formAttr ?? o} tabindex="-1" aria-hidden="true" inert @invalid=${this._onNativeInvalid} @focus=${this._onNativeFocus} />
|
|
39
55
|
<span class="void-checkbox-box">
|
|
40
|
-
${this.checked ?
|
|
41
|
-
${this.indeterminate && !this.checked ?
|
|
56
|
+
${this.checked ? a`<svg viewBox="0 0 12 12" fill="none"><path d="M2.5 6l2.5 2.5 4.5-5" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/></svg>` : ""}
|
|
57
|
+
${this.indeterminate && !this.checked ? a`<svg viewBox="0 0 12 12" fill="none"><path d="M3 6h6" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round"/></svg>` : ""}
|
|
42
58
|
</span>
|
|
43
59
|
`;
|
|
44
60
|
}
|
|
61
|
+
formSnapshot() {
|
|
62
|
+
return this.checked;
|
|
63
|
+
}
|
|
64
|
+
formAncestorDisabled() {
|
|
65
|
+
return super.formAncestorDisabled() || !!this.closest("void-checkbox-group")?.hasAttribute("disabled");
|
|
66
|
+
}
|
|
67
|
+
formWriteNativeDefault(e) {
|
|
68
|
+
let t = this.querySelector("input[type=\"checkbox\"]");
|
|
69
|
+
t && (t.defaultChecked = !!e);
|
|
70
|
+
}
|
|
71
|
+
formReadNative() {
|
|
72
|
+
let e = this.querySelector("input[type=\"checkbox\"]");
|
|
73
|
+
e && (this.checked = e.checked);
|
|
74
|
+
}
|
|
75
|
+
formSyncNative() {
|
|
76
|
+
let e = this.querySelector("input[type=\"checkbox\"]");
|
|
77
|
+
e && e.checked !== this.checked && (e.checked = this.checked), this.closest("void-checkbox-group")?.requestUpdate();
|
|
78
|
+
}
|
|
45
79
|
};
|
|
46
|
-
|
|
80
|
+
n([s({
|
|
47
81
|
type: Boolean,
|
|
48
82
|
reflect: !0
|
|
49
|
-
})],
|
|
83
|
+
})], c.prototype, "checked", void 0), n([s({
|
|
50
84
|
type: Boolean,
|
|
51
85
|
reflect: !0
|
|
52
|
-
})],
|
|
86
|
+
})], c.prototype, "disabled", void 0), n([s({
|
|
53
87
|
type: Boolean,
|
|
54
88
|
reflect: !0
|
|
55
|
-
})],
|
|
89
|
+
})], c.prototype, "indeterminate", void 0), n([s({
|
|
56
90
|
type: String,
|
|
57
91
|
reflect: !0
|
|
58
|
-
})],
|
|
92
|
+
})], c.prototype, "name", void 0), n([s({
|
|
59
93
|
type: String,
|
|
60
94
|
reflect: !0
|
|
61
|
-
})],
|
|
95
|
+
})], c.prototype, "value", void 0), n([s({
|
|
96
|
+
type: Boolean,
|
|
97
|
+
reflect: !0
|
|
98
|
+
})], c.prototype, "required", void 0), n([s({
|
|
62
99
|
type: String,
|
|
63
100
|
reflect: !0
|
|
64
|
-
})],
|
|
101
|
+
})], c.prototype, "color", void 0), n([s({
|
|
65
102
|
type: String,
|
|
66
103
|
reflect: !0
|
|
67
|
-
})],
|
|
104
|
+
})], c.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", c);
|
|
68
105
|
//#endregion
|
|
69
|
-
export {
|
|
106
|
+
export { c as VoidCheckbox };
|