@voidable/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +8 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BGrS4eIl.js +307 -0
- package/dist/chunks/data-BpiiNapL.js +95 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
- package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
- package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.js} +105 -389
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +2 -2
- package/dist/components/action-input.js +56 -54
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +11 -4
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.d.ts +8 -2
- package/dist/components/badge.js +1 -4
- package/dist/components/banner.d.ts +9 -0
- package/dist/components/banner.js +11 -4
- package/dist/components/bar-chart.d.ts +21 -7
- package/dist/components/bar-chart.js +67 -43
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +40 -2
- package/dist/components/calendar.js +170 -79
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +20 -19
- package/dist/components/charts/data.d.ts +72 -0
- package/dist/components/checkbox-group.js +13 -12
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.js +17 -16
- package/dist/components/compose-input.js +13 -11
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.d.ts +22 -6
- package/dist/components/donut-chart.js +96 -68
- package/dist/components/drawer.d.ts +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +4 -4
- package/dist/components/editable.js +13 -12
- package/dist/components/error-fallback.js +2 -2
- package/dist/components/field.js +10 -9
- package/dist/components/file-upload.d.ts +20 -5
- package/dist/components/file-upload.js +52 -20
- package/dist/components/gauge.d.ts +32 -8
- package/dist/components/gauge.js +209 -135
- package/dist/components/hamburger.d.ts +12 -1
- package/dist/components/hamburger.js +33 -20
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.js +41 -39
- package/dist/components/line-chart.d.ts +22 -7
- package/dist/components/line-chart.js +80 -56
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.js +30 -29
- package/dist/components/nav-bar.d.ts +9 -0
- package/dist/components/nav-bar.js +16 -3
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.js +17 -15
- package/dist/components/pagination.js +22 -20
- package/dist/components/panel.js +2 -2
- package/dist/components/pin-input.js +32 -30
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.js +13 -11
- package/dist/components/radio.d.ts +25 -0
- package/dist/components/radio.js +78 -29
- package/dist/components/scroll-area.js +8 -7
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.js +49 -47
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +16 -14
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.d.ts +13 -1
- package/dist/components/stat.js +29 -19
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.js +14 -12
- package/dist/components/table.d.ts +4 -0
- package/dist/components/table.js +42 -29
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.js +24 -22
- package/dist/components/textarea.js +34 -32
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +15 -13
- package/dist/custom-elements.json +320 -88
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +85 -16
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +1 -1
- package/dist/parts.d.ts +5 -0
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +84 -59
- package/dist/types/elements.d.ts +13 -13
- package/dist/types/react.d.ts +2 -2
- package/dist/types/solid.d.ts +2 -2
- package/dist/types/svelte.d.ts +2 -2
- package/dist/types/vue.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +108 -28
- package/dist/web-types.json +189 -60
- package/package.json +1 -1
package/dist/components/table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { property as n } from "lit/decorators.js";
|
|
4
4
|
//#region src/components/table.ts
|
|
@@ -19,7 +19,7 @@ function s(e) {
|
|
|
19
19
|
}
|
|
20
20
|
var c = class extends e {
|
|
21
21
|
constructor(...e) {
|
|
22
|
-
super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1, this.inset = !1, this.stack = null, this.scrollable = !1, this.stickyHeader = !1, this.stickyColumn = !1, this.maxHeight = null, this.label = null, this.#e = null, this.#t = null, this.#n = !1, this.#r = /* @__PURE__ */ new WeakMap(), this.#i = /* @__PURE__ */ new WeakMap(), this.#a = /* @__PURE__ */ new WeakMap(), this.#
|
|
22
|
+
super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1, this.inset = !1, this.stack = null, this.scrollable = !1, this.stickyHeader = !1, this.stickyColumn = !1, this.maxHeight = null, this.label = null, this.#e = null, this.#t = null, this.#n = !1, this.#r = /* @__PURE__ */ new WeakMap(), this.#i = /* @__PURE__ */ new WeakMap(), this.#a = null, this.#o = /* @__PURE__ */ new WeakMap(), this.#s = /* @__PURE__ */ new WeakMap(), this.#c = null, this.#l = !1, this.#u = !1, this.#d = () => this.#x();
|
|
23
23
|
}
|
|
24
24
|
#e;
|
|
25
25
|
#t;
|
|
@@ -30,8 +30,10 @@ var c = class extends e {
|
|
|
30
30
|
#o;
|
|
31
31
|
#s;
|
|
32
32
|
#c;
|
|
33
|
+
#l;
|
|
34
|
+
#u;
|
|
33
35
|
connectedCallback() {
|
|
34
|
-
super.connectedCallback(), this.#e ??= new MutationObserver(() => this.#
|
|
36
|
+
super.connectedCallback(), this.#e ??= new MutationObserver(() => this.#f()), this.#e.observe(this, {
|
|
35
37
|
childList: !0,
|
|
36
38
|
subtree: !0,
|
|
37
39
|
characterData: !0,
|
|
@@ -43,28 +45,31 @@ var c = class extends e {
|
|
|
43
45
|
"role",
|
|
44
46
|
"colspan"
|
|
45
47
|
]
|
|
46
|
-
}),
|
|
48
|
+
}), this.#a ??= new MutationObserver(() => this.#f()), this.#a.observe(this, {
|
|
49
|
+
attributes: !0,
|
|
50
|
+
attributeFilter: ["aria-label"]
|
|
51
|
+
}), typeof ResizeObserver < "u" && (this.#t ??= new ResizeObserver(() => this.#f()), this.#t.observe(this)), this.addEventListener("scroll", this.#d, { passive: !0 }), this.#f();
|
|
47
52
|
}
|
|
48
53
|
disconnectedCallback() {
|
|
49
|
-
super.disconnectedCallback(), this.#e?.disconnect(), this.#t?.disconnect(), this.removeEventListener("scroll", this.#
|
|
54
|
+
super.disconnectedCallback(), this.#e?.disconnect(), this.#a?.disconnect(), this.#t?.disconnect(), this.removeEventListener("scroll", this.#d);
|
|
50
55
|
}
|
|
51
56
|
updated(e) {
|
|
52
57
|
super.updated(e), this.setHostStyle("--void-table-max-height", this.maxHeight || "");
|
|
53
58
|
let t = (this.stack ?? "").trim();
|
|
54
|
-
/^\d*\.?\d+(px|rem|em)$/.test(t) ? (this.setHostStyle("--void-table-stack-at", t), this.#
|
|
59
|
+
/^\d*\.?\d+(px|rem|em)$/.test(t) ? (this.setHostStyle("--void-table-stack-at", t), this.#u = !0) : this.#u &&= (this.setHostStyle("--void-table-stack-at", null), !1), this.#f();
|
|
55
60
|
}
|
|
56
|
-
#
|
|
57
|
-
#
|
|
61
|
+
#d;
|
|
62
|
+
#f() {
|
|
58
63
|
this.#n || (this.#n = !0, queueMicrotask(() => {
|
|
59
|
-
this.#n = !1, this.isConnected && (this.#
|
|
64
|
+
this.#n = !1, this.isConnected && (this.#p(this.stack !== null), this.#y(), this.#e?.takeRecords());
|
|
60
65
|
}));
|
|
61
66
|
}
|
|
62
|
-
#
|
|
67
|
+
#p(e) {
|
|
63
68
|
let t = !1, n = !1, a = 0;
|
|
64
69
|
for (let i of this.querySelectorAll("table")) {
|
|
65
70
|
if (i.closest("void-table") !== this) continue;
|
|
66
|
-
e && this.#
|
|
67
|
-
let c = this.#
|
|
71
|
+
this.#m(i), e && this.#_(i);
|
|
72
|
+
let c = this.#h(i), l = [];
|
|
68
73
|
if (c) for (let e of o(c)) {
|
|
69
74
|
let i = {
|
|
70
75
|
label: e.hasAttribute("data-label") ? e.getAttribute("data-label") ?? "" : (e.textContent ?? "").replace(/\s+/g, " ").trim(),
|
|
@@ -80,15 +85,15 @@ var c = class extends e {
|
|
|
80
85
|
let e = c.querySelector("[data-controls]") !== null;
|
|
81
86
|
e !== c.hasAttribute("data-controls") && c.toggleAttribute("data-controls", e);
|
|
82
87
|
}
|
|
83
|
-
if (e) for (let e of i.querySelectorAll(":scope > caption, :scope > thead, :scope > tbody, :scope > tfoot")) this.#
|
|
88
|
+
if (e) for (let e of i.querySelectorAll(":scope > caption, :scope > thead, :scope > tbody, :scope > tfoot")) this.#_(e);
|
|
84
89
|
for (let t of Array.from(i.querySelectorAll("tr"))) {
|
|
85
90
|
if (t.closest("table") !== i) continue;
|
|
86
|
-
a++, e && this.#
|
|
91
|
+
a++, e && this.#_(t);
|
|
87
92
|
let n = t.parentElement?.tagName === "THEAD" || t === c, r = 0;
|
|
88
93
|
for (let i of o(t)) {
|
|
89
|
-
if (e && (i.tagName === "TH" ? this.#
|
|
94
|
+
if (e && (i.tagName === "TH" ? this.#_(i, n || i.getAttribute("scope") === "col" ? "columnheader" : "rowheader") : this.#_(i)), !n) {
|
|
90
95
|
let t = l[r];
|
|
91
|
-
t && (e && this.#
|
|
96
|
+
t && (e && this.#g(i, "data-label", t.label, this.#r, !0), this.#g(i, "data-stack", t.stack, this.#o), this.#g(i, "data-align", t.align, this.#s));
|
|
92
97
|
}
|
|
93
98
|
r += s(i);
|
|
94
99
|
}
|
|
@@ -96,38 +101,46 @@ var c = class extends e {
|
|
|
96
101
|
}
|
|
97
102
|
this.setHostAttribute("data-stack-title", t ? "" : null), this.setHostAttribute("data-stack-select", n ? "" : null), this.setHostAttribute("data-long", a > i ? "" : null);
|
|
98
103
|
}
|
|
99
|
-
#
|
|
104
|
+
#m(e) {
|
|
105
|
+
let t = this.getAttribute("aria-label"), n = (t !== null && t !== this.#c && t.trim() !== "" ? t : null) ?? (this.label?.trim() ? this.label : null), r = e.getAttribute("aria-label"), i = this.#i.get(e), a = r !== null && r !== i || e.hasAttribute("aria-labelledby") || e.querySelector(":scope > caption") !== null;
|
|
106
|
+
if (n === null || a) {
|
|
107
|
+
i !== void 0 && r === i && e.removeAttribute("aria-label"), this.#i.delete(e);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
r !== n && e.setAttribute("aria-label", n), this.#i.set(e, n);
|
|
111
|
+
}
|
|
112
|
+
#h(e) {
|
|
100
113
|
let t = e.querySelectorAll(":scope > thead > tr");
|
|
101
114
|
if (t.length) return t[t.length - 1];
|
|
102
115
|
let n = e.querySelector(":scope > tbody > tr, :scope > tr");
|
|
103
116
|
return n && o(n).every((e) => e.tagName === "TH") ? n : null;
|
|
104
117
|
}
|
|
105
|
-
#
|
|
118
|
+
#g(e, t, n, r, i = !1) {
|
|
106
119
|
let a = e.getAttribute(t), o = r.get(e);
|
|
107
120
|
if (a !== null && a !== o) return;
|
|
108
121
|
let s = n === null || !i && n === "" ? null : n;
|
|
109
122
|
s === null ? (a !== null && e.removeAttribute(t), r.delete(e)) : (a !== s && e.setAttribute(t, s), r.set(e, s));
|
|
110
123
|
}
|
|
111
|
-
#
|
|
124
|
+
#_(e, t = a[e.tagName]) {
|
|
112
125
|
t && (e.hasAttribute("role") || e.setAttribute("role", t));
|
|
113
126
|
}
|
|
114
|
-
get #
|
|
127
|
+
get #v() {
|
|
115
128
|
return this.scrollable && this.scrollWidth > this.clientWidth + 1;
|
|
116
129
|
}
|
|
117
|
-
#
|
|
118
|
-
let e = this.#
|
|
130
|
+
#y() {
|
|
131
|
+
let e = this.#v;
|
|
119
132
|
if (this.setHostAttribute("data-overflowing", e ? "" : null), !e) {
|
|
120
|
-
this.#
|
|
133
|
+
this.#b(), this.setHostAttribute("data-overflow-start", null), this.setHostAttribute("data-overflow-end", null);
|
|
121
134
|
return;
|
|
122
135
|
}
|
|
123
|
-
let t = this.getAttribute("aria-label"), n = t !== null && t !== this.#
|
|
124
|
-
!r && !n && !this.hasAttribute("aria-labelledby") && !this.#
|
|
136
|
+
let t = this.getAttribute("aria-label"), n = t !== null && t !== this.#c, r = this.label || (n || this.hasAttribute("aria-labelledby") ? "" : (this.querySelector("caption")?.textContent ?? "").replace(/\s+/g, " ").trim());
|
|
137
|
+
!r && !n && !this.hasAttribute("aria-labelledby") && !this.#l && (this.#l = !0, console.warn("<void-table scrollable>: the scroll region has no accessible name. Set label, aria-label or add a <caption>.", this)), this.setHostAttribute("tabindex", "0"), (!this.hasAttribute("role") || this.getAttribute("role") === "region") && this.setHostAttribute("role", "region"), r && !n && (this.setHostAttribute("aria-label", r), this.#c = r), this.#x();
|
|
125
138
|
}
|
|
126
|
-
#
|
|
127
|
-
this.setHostAttribute("tabindex", null), this.getAttribute("role") === "region" && this.setHostAttribute("role", null), this.#
|
|
139
|
+
#b() {
|
|
140
|
+
this.setHostAttribute("tabindex", null), this.getAttribute("role") === "region" && this.setHostAttribute("role", null), this.#c !== null && (this.getAttribute("aria-label") === this.#c && this.setHostAttribute("aria-label", null), this.#c = null);
|
|
128
141
|
}
|
|
129
|
-
#
|
|
130
|
-
if (!this.#
|
|
142
|
+
#x() {
|
|
143
|
+
if (!this.#v) return;
|
|
131
144
|
let e = this.scrollWidth - this.clientWidth, t = Math.abs(this.scrollLeft);
|
|
132
145
|
this.setHostAttribute("data-overflow-start", t > 1 ? "" : null), this.setHostAttribute("data-overflow-end", t < e - 1 ? "" : null);
|
|
133
146
|
}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/parts-
|
|
4
|
-
import {
|
|
5
|
-
import { property as
|
|
3
|
+
import { n } from "../chunks/parts-DI_3VpSy.js";
|
|
4
|
+
import { a as r, n as i, r as a } from "../chunks/keyboard-CEhMSkws.js";
|
|
5
|
+
import { property as o } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/tabs.ts
|
|
7
|
-
var
|
|
7
|
+
var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u = class extends e {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.value = "", this.size = "md", this.activation = "manual", this._parts = new n(this, {
|
|
10
10
|
tags: [
|
|
11
|
-
o,
|
|
12
11
|
s,
|
|
13
|
-
c
|
|
12
|
+
c,
|
|
13
|
+
l
|
|
14
14
|
],
|
|
15
15
|
onChange: () => this._wire()
|
|
16
16
|
}), this._matchedValue = null, this._onClick = (e) => {
|
|
@@ -24,13 +24,13 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
24
24
|
e.preventDefault(), this._select(t);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
let n = this._triggers(),
|
|
28
|
-
if (e.key ===
|
|
29
|
-
else if (e.key ===
|
|
30
|
-
else if (e.key === "Home")
|
|
31
|
-
else if (e.key === "End")
|
|
27
|
+
let n = this._triggers(), o = n.indexOf(t), s = n.map((e) => this._disabled(e)), c = -1, l = a(this);
|
|
28
|
+
if (e.key === l.next) c = r(s, o, 1);
|
|
29
|
+
else if (e.key === l.prev) c = r(s, o, -1);
|
|
30
|
+
else if (e.key === "Home") c = i(s, 1);
|
|
31
|
+
else if (e.key === "End") c = i(s, -1);
|
|
32
32
|
else return;
|
|
33
|
-
e.preventDefault(), !(
|
|
33
|
+
e.preventDefault(), !(c < 0) && (n[c].focus(), this.activation === "auto" && this._select(n[c]));
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
connectedCallback() {
|
|
@@ -43,7 +43,7 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
43
43
|
super.updated(e), e.has("value") && this._wire();
|
|
44
44
|
}
|
|
45
45
|
_triggers() {
|
|
46
|
-
return this._parts.within(this._parts.one(
|
|
46
|
+
return this._parts.within(this._parts.one(s), c);
|
|
47
47
|
}
|
|
48
48
|
_disabled(e) {
|
|
49
49
|
return e.hasAttribute("disabled");
|
|
@@ -61,22 +61,22 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
61
61
|
this._matchedValue = null, t && (this.value = this._valueOf(t), this._matchedValue = this.value);
|
|
62
62
|
}
|
|
63
63
|
_wire() {
|
|
64
|
-
let e = this._parts.one(
|
|
64
|
+
let e = this._parts.one(s), t = this._triggers(), n = this._parts.all(l);
|
|
65
65
|
this._reconcileRemovedSelection(t), e && this._parts.set(e, "role", "tablist");
|
|
66
66
|
let r = t.map((e) => this._disabled(e)), a = t.findIndex((e, t) => this._valueOf(e) === this.value && !r[t]);
|
|
67
67
|
a < 0 && (a = i(r, 1));
|
|
68
|
-
let
|
|
69
|
-
for (let e of n)
|
|
70
|
-
let
|
|
68
|
+
let o = /* @__PURE__ */ new Map();
|
|
69
|
+
for (let e of n) o.has(this._valueOf(e)) || o.set(this._valueOf(e), e);
|
|
70
|
+
let c = /* @__PURE__ */ new Map();
|
|
71
71
|
t.forEach((e, t) => {
|
|
72
|
-
let n = this._valueOf(e), i = n === this.value,
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", i ? "true" : "false"), this._parts.set(e, "active", i), this._parts.set(e, "tabindex", t === a ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls",
|
|
72
|
+
let n = this._valueOf(e), i = n === this.value, s = this._parts.id(e, "void-tabs-trigger");
|
|
73
|
+
c.has(n) || c.set(n, s);
|
|
74
|
+
let l = o.get(n);
|
|
75
|
+
this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", i ? "true" : "false"), this._parts.set(e, "active", i), this._parts.set(e, "tabindex", t === a ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls", l ? this._parts.id(l, "void-tabs-content") : null);
|
|
76
76
|
});
|
|
77
77
|
for (let e of n) {
|
|
78
78
|
let t = this._valueOf(e), n = t === this.value;
|
|
79
|
-
this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby",
|
|
79
|
+
this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby", c.get(t) ?? null);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
_select(e) {
|
|
@@ -89,19 +89,19 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
91
|
_triggerOf(e) {
|
|
92
|
-
let t = e instanceof Element ? e.closest(
|
|
92
|
+
let t = e instanceof Element ? e.closest(c) : null;
|
|
93
93
|
return t && this._parts.owns(t) ? t : null;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
t([
|
|
96
|
+
t([o({
|
|
97
97
|
type: String,
|
|
98
98
|
reflect: !0
|
|
99
|
-
})],
|
|
99
|
+
})], u.prototype, "value", void 0), t([o({
|
|
100
100
|
type: String,
|
|
101
101
|
reflect: !0
|
|
102
|
-
})],
|
|
102
|
+
})], u.prototype, "size", void 0), t([o({
|
|
103
103
|
type: String,
|
|
104
104
|
reflect: !0
|
|
105
|
-
})],
|
|
105
|
+
})], u.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", u);
|
|
106
106
|
//#endregion
|
|
107
|
-
export {
|
|
107
|
+
export { u as VoidTabs };
|
package/dist/components/tag.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as n } from "../chunks/projection-oPe6ipjL.js";
|
|
3
4
|
import { html as r, nothing as i } from "lit";
|
|
4
5
|
import { property as a } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/tag.ts
|
|
6
|
-
var o = class extends
|
|
7
|
-
constructor(...
|
|
8
|
-
super(...
|
|
7
|
+
var o = class extends e {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.color = "default", this.removable = !1, this.size = "md", this._projection = new n(this, { regions: [{
|
|
9
10
|
name: "label",
|
|
10
11
|
target: "before"
|
|
11
12
|
}] });
|
|
@@ -25,13 +26,13 @@ var o = class extends t {
|
|
|
25
26
|
})), this.remove();
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
t([a({
|
|
29
30
|
type: String,
|
|
30
31
|
reflect: !0
|
|
31
|
-
})], o.prototype, "color", void 0),
|
|
32
|
+
})], o.prototype, "color", void 0), t([a({
|
|
32
33
|
type: Boolean,
|
|
33
34
|
reflect: !0
|
|
34
|
-
})], o.prototype, "removable", void 0),
|
|
35
|
+
})], o.prototype, "removable", void 0), t([a({
|
|
35
36
|
type: String,
|
|
36
37
|
reflect: !0
|
|
37
38
|
})], o.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", o);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { t as i } from "../chunks/value-list-CH6GjYXM.js";
|
|
6
|
+
import { html as a, nothing as o } from "lit";
|
|
7
|
+
import { property as s } from "lit/decorators.js";
|
|
7
8
|
//#region src/components/tags-input.ts
|
|
8
|
-
|
|
9
|
+
r();
|
|
10
|
+
var c = class extends n(e) {
|
|
9
11
|
constructor(...e) {
|
|
10
12
|
super(...e), this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "Add tag...", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
|
|
11
13
|
}
|
|
@@ -27,25 +29,25 @@ var s = class extends n(e) {
|
|
|
27
29
|
}
|
|
28
30
|
render() {
|
|
29
31
|
let e = this.value.length >= this.max;
|
|
30
|
-
return
|
|
32
|
+
return a`
|
|
31
33
|
<div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
|
|
32
34
|
${this.value.map((e, t) => {
|
|
33
35
|
let n = this._tagText(e);
|
|
34
|
-
return
|
|
35
|
-
<span class="void-tags-input-tag" data-color=${this._tagColor(e) ||
|
|
36
|
+
return a`
|
|
37
|
+
<span class="void-tags-input-tag" data-color=${this._tagColor(e) || o}>
|
|
36
38
|
<span class="void-tags-input-tag-text">${n}</span>
|
|
37
|
-
${!this.disabled && !this.readonly ?
|
|
39
|
+
${!this.disabled && !this.readonly ? a`<button
|
|
38
40
|
type="button"
|
|
39
41
|
class="void-tags-input-tag-remove"
|
|
40
42
|
aria-label="Remove ${n}"
|
|
41
43
|
@click=${(e) => {
|
|
42
44
|
e.stopPropagation(), this._removeTag(t);
|
|
43
45
|
}}
|
|
44
|
-
>×</button>` :
|
|
46
|
+
>×</button>` : o}
|
|
45
47
|
</span>
|
|
46
48
|
`;
|
|
47
49
|
})}
|
|
48
|
-
${!e && !this.readonly ?
|
|
50
|
+
${!e && !this.readonly ? a`<input
|
|
49
51
|
class="void-tags-input-field"
|
|
50
52
|
type="text"
|
|
51
53
|
placeholder=${this.value.length === 0 ? this.placeholder : ""}
|
|
@@ -53,7 +55,7 @@ var s = class extends n(e) {
|
|
|
53
55
|
@keydown=${this._onKeydown}
|
|
54
56
|
@input=${this._onFieldInput}
|
|
55
57
|
@paste=${this._onPaste}
|
|
56
|
-
/>` :
|
|
58
|
+
/>` : o}
|
|
57
59
|
</div>
|
|
58
60
|
`;
|
|
59
61
|
}
|
|
@@ -97,27 +99,27 @@ var s = class extends n(e) {
|
|
|
97
99
|
}));
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
t([
|
|
101
|
-
converter:
|
|
102
|
+
t([s({
|
|
103
|
+
converter: i,
|
|
102
104
|
reflect: !0
|
|
103
|
-
})],
|
|
105
|
+
})], c.prototype, "value", void 0), t([s({
|
|
104
106
|
type: Boolean,
|
|
105
107
|
reflect: !0
|
|
106
|
-
})],
|
|
108
|
+
})], c.prototype, "disabled", void 0), t([s({
|
|
107
109
|
type: Boolean,
|
|
108
110
|
reflect: !0
|
|
109
|
-
})],
|
|
111
|
+
})], c.prototype, "readonly", void 0), t([s({ type: Number })], c.prototype, "max", void 0), t([s({ type: String })], c.prototype, "placeholder", void 0), t([s({
|
|
110
112
|
type: String,
|
|
111
113
|
reflect: !0
|
|
112
|
-
})],
|
|
114
|
+
})], c.prototype, "size", void 0), t([s({
|
|
113
115
|
type: String,
|
|
114
116
|
reflect: !0
|
|
115
|
-
})],
|
|
117
|
+
})], c.prototype, "color", void 0), t([s({
|
|
116
118
|
type: String,
|
|
117
119
|
reflect: !0
|
|
118
|
-
})],
|
|
120
|
+
})], c.prototype, "variant", void 0), t([s({
|
|
119
121
|
type: Boolean,
|
|
120
122
|
attribute: "allow-duplicates"
|
|
121
|
-
})],
|
|
123
|
+
})], c.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", c);
|
|
122
124
|
//#endregion
|
|
123
|
-
export {
|
|
125
|
+
export { c as VoidTagsInput };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.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 { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { html as i, nothing as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators.js";
|
|
7
|
+
import { live as s } from "lit/directives/live.js";
|
|
7
8
|
//#region src/components/textarea.ts
|
|
8
|
-
|
|
9
|
+
r();
|
|
10
|
+
var c = class extends n(e) {
|
|
9
11
|
constructor(...e) {
|
|
10
12
|
super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.rows = 3, this.resize = "vertical", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
|
|
11
13
|
}
|
|
@@ -16,29 +18,29 @@ var s = class extends n(e) {
|
|
|
16
18
|
this.editState = ["value"];
|
|
17
19
|
}
|
|
18
20
|
render() {
|
|
19
|
-
return
|
|
21
|
+
return i`
|
|
20
22
|
<textarea
|
|
21
|
-
.value=${
|
|
23
|
+
.value=${s(this.value)}
|
|
22
24
|
placeholder=${this.placeholder}
|
|
23
25
|
?disabled=${this.disabled}
|
|
24
26
|
?readonly=${this.readonly}
|
|
25
27
|
?required=${this.required}
|
|
26
28
|
name=${this.name}
|
|
27
|
-
autocomplete=${this.autocomplete ||
|
|
28
|
-
minlength=${this.minlength ??
|
|
29
|
-
maxlength=${this.maxlength ??
|
|
30
|
-
inputmode=${this.inputMode ||
|
|
31
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
32
|
-
autocapitalize=${this.autocapitalize ||
|
|
33
|
-
spellcheck=${this.spellcheckAttr ??
|
|
34
|
-
form=${this.formAttr ??
|
|
29
|
+
autocomplete=${this.autocomplete || a}
|
|
30
|
+
minlength=${this.minlength ?? a}
|
|
31
|
+
maxlength=${this.maxlength ?? a}
|
|
32
|
+
inputmode=${this.inputMode || a}
|
|
33
|
+
enterkeyhint=${this.enterKeyHint || a}
|
|
34
|
+
autocapitalize=${this.autocapitalize || a}
|
|
35
|
+
spellcheck=${this.spellcheckAttr ?? a}
|
|
36
|
+
form=${this.formAttr ?? a}
|
|
35
37
|
rows=${this.rows}
|
|
36
38
|
style="--void-textarea-resize: ${this.resize}"
|
|
37
39
|
aria-invalid=${this.error ? "true" : "false"}
|
|
38
40
|
@input=${this._onInput}
|
|
39
41
|
@change=${this._onChange}
|
|
40
42
|
></textarea>
|
|
41
|
-
${this.error ?
|
|
43
|
+
${this.error ? i`<span class="void-textarea-error">${this.error}</span>` : ""}
|
|
42
44
|
`;
|
|
43
45
|
}
|
|
44
46
|
formWriteNativeDefault(e) {
|
|
@@ -70,48 +72,48 @@ var s = class extends n(e) {
|
|
|
70
72
|
}));
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
|
-
t([
|
|
75
|
+
t([o({
|
|
74
76
|
type: String,
|
|
75
77
|
reflect: !0
|
|
76
|
-
})],
|
|
78
|
+
})], c.prototype, "value", void 0), t([o({
|
|
77
79
|
type: String,
|
|
78
80
|
reflect: !0
|
|
79
|
-
})],
|
|
81
|
+
})], c.prototype, "placeholder", void 0), t([o({
|
|
80
82
|
type: Boolean,
|
|
81
83
|
reflect: !0
|
|
82
|
-
})],
|
|
84
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
83
85
|
type: Boolean,
|
|
84
86
|
reflect: !0
|
|
85
|
-
})],
|
|
87
|
+
})], c.prototype, "readonly", void 0), t([o({
|
|
86
88
|
type: Boolean,
|
|
87
89
|
reflect: !0
|
|
88
|
-
})],
|
|
90
|
+
})], c.prototype, "required", void 0), t([o({
|
|
89
91
|
type: String,
|
|
90
92
|
reflect: !0
|
|
91
|
-
})],
|
|
93
|
+
})], c.prototype, "name", void 0), t([o({
|
|
92
94
|
type: Number,
|
|
93
95
|
reflect: !0
|
|
94
|
-
})],
|
|
96
|
+
})], c.prototype, "rows", void 0), t([o({
|
|
95
97
|
type: String,
|
|
96
98
|
reflect: !0
|
|
97
|
-
})],
|
|
99
|
+
})], c.prototype, "resize", void 0), t([o({
|
|
98
100
|
type: String,
|
|
99
101
|
reflect: !0
|
|
100
|
-
})],
|
|
102
|
+
})], c.prototype, "size", void 0), t([o({
|
|
101
103
|
type: String,
|
|
102
104
|
reflect: !0
|
|
103
|
-
})],
|
|
105
|
+
})], c.prototype, "error", void 0), t([o({
|
|
104
106
|
type: String,
|
|
105
107
|
reflect: !0
|
|
106
|
-
})],
|
|
108
|
+
})], c.prototype, "autocomplete", void 0), t([o({ type: Number })], c.prototype, "minlength", void 0), t([o({ type: Number })], c.prototype, "maxlength", void 0), t([o({
|
|
107
109
|
type: String,
|
|
108
110
|
attribute: "inputmode"
|
|
109
|
-
})],
|
|
111
|
+
})], c.prototype, "inputMode", void 0), t([o({
|
|
110
112
|
type: String,
|
|
111
113
|
attribute: "enterkeyhint"
|
|
112
|
-
})],
|
|
114
|
+
})], c.prototype, "enterKeyHint", void 0), t([o({ type: String })], c.prototype, "autocapitalize", void 0), t([o({
|
|
113
115
|
type: String,
|
|
114
116
|
attribute: "spellcheck"
|
|
115
|
-
})],
|
|
117
|
+
})], c.prototype, "spellcheckAttr", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", c);
|
|
116
118
|
//#endregion
|
|
117
|
-
export {
|
|
119
|
+
export { c as VoidTextarea };
|
|
@@ -31,9 +31,16 @@ export declare class VoidToast extends VoidElement {
|
|
|
31
31
|
private _focused;
|
|
32
32
|
connectedCallback(): void;
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The toast is a plain group, reachable by a screen reader but not a live region itself: a live region inserted
|
|
36
|
+
* together with its text is commonly not announced. The container announces it instead, through its own
|
|
37
|
+
* announcer elements, which exist before any toast does.
|
|
38
|
+
*/
|
|
36
39
|
private _syncRole;
|
|
40
|
+
/** The `aria-labelledby` this toast wrote itself, so an author's own name is never replaced. */
|
|
41
|
+
private _labelledBy;
|
|
42
|
+
/** What a screen reader should say for this toast: its title, then its message (or, without parts, its text). */
|
|
43
|
+
announcement(): string;
|
|
37
44
|
private _startTimer;
|
|
38
45
|
private _pause;
|
|
39
46
|
private _resume;
|
|
@@ -63,8 +70,18 @@ export declare class VoidToastContainer extends VoidElement {
|
|
|
63
70
|
/** Where the container sits. The corner and centre values overlay the page at a fixed position; `inline` keeps the container in normal flow so toasts push content instead of covering it. */
|
|
64
71
|
placement: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'inline';
|
|
65
72
|
private _observer;
|
|
73
|
+
private _announceTimers;
|
|
66
74
|
connectedCallback(): void;
|
|
67
75
|
disconnectedCallback(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Two persistent, visually hidden live regions that exist from the container's connection: a polite one
|
|
78
|
+
* (`role="status"`) and an assertive one (`role="alert"`). A screen reader announces text that changes inside a
|
|
79
|
+
* region it already knows, so a toast's words are written here after the toast is in, never together with it.
|
|
80
|
+
*/
|
|
81
|
+
private _ensureAnnouncers;
|
|
82
|
+
private _region;
|
|
83
|
+
/** Writes a toast's text into the matching announcer on a later task, after clearing it so a repeat is spoken again. */
|
|
84
|
+
private _announce;
|
|
68
85
|
/** Shown while it holds a toast; raised to the top of the top layer when one is added. */
|
|
69
86
|
private _syncShown;
|
|
70
87
|
/**
|