@voidable/ui 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +2 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BxmMM3B7.js +298 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-D_YVy2vg.js → modal-CgGp_fCs.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-hLJ7IQHx.js} +2 -2
- package/dist/chunks/{parts-D30c8OoG.js → parts-DI_3VpSy.js} +25 -18
- package/dist/chunks/{base-CMruMbxC.js → projection-SnR79EHI.js} +105 -389
- package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
- package/dist/chunks/value-list-CH6GjYXM.js +28 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +8 -4
- package/dist/components/action-input.js +61 -49
- package/dist/components/alert.js +2 -2
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +2 -2
- package/dist/components/bar-chart.js +31 -29
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +78 -76
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +18 -17
- package/dist/components/checkbox-group.d.ts +10 -0
- package/dist/components/checkbox-group.js +36 -23
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.d.ts +4 -2
- package/dist/components/combobox.js +22 -18
- package/dist/components/compose-input.d.ts +1 -1
- package/dist/components/compose-input.js +15 -10
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.js +51 -49
- 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.d.ts +1 -1
- 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.js +19 -17
- package/dist/components/gauge.js +90 -85
- package/dist/components/hamburger.js +11 -9
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.d.ts +6 -2
- package/dist/components/input.js +46 -34
- package/dist/components/line-chart.js +41 -39
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.d.ts +9 -0
- package/dist/components/multiselect.js +64 -54
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.d.ts +2 -2
- 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.d.ts +6 -2
- package/dist/components/pin-input.js +39 -27
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +15 -10
- 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.d.ts +1 -1
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.d.ts +67 -16
- package/dist/components/select.js +183 -56
- 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.d.ts +2 -2
- package/dist/components/slider.js +18 -13
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.js +19 -17
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +14 -12
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.d.ts +1 -1
- package/dist/components/tags-input.js +25 -19
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +36 -31
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +5 -2
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +3 -3
- package/dist/custom-elements.json +133 -67
- package/dist/dev/types.d.ts +2 -3
- package/dist/dev.js +81 -55
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +125 -0
- package/dist/parts.d.ts +8 -1
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +4575 -0
- package/dist/secret-value.d.ts +17 -0
- package/dist/types/elements.d.ts +2 -2
- package/dist/value-list.d.ts +14 -0
- package/dist/vscode.html-custom-data.json +46 -26
- package/dist/web-types.json +73 -53
- package/package.json +5 -3
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-SnR79EHI.js";
|
|
5
|
+
import { o as i, r as a } from "../chunks/keyboard-CEhMSkws.js";
|
|
6
|
+
import { t as o } from "../chunks/overlay-hLJ7IQHx.js";
|
|
7
|
+
import { html as s, nothing as c } from "lit";
|
|
8
|
+
import { property as l } from "lit/decorators.js";
|
|
9
|
+
import { live as u } from "lit/directives/live.js";
|
|
9
10
|
//#region src/components/calendar.ts
|
|
10
|
-
|
|
11
|
+
r();
|
|
12
|
+
function d(e) {
|
|
11
13
|
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
12
14
|
return t ? [
|
|
13
15
|
Number(t[1]),
|
|
@@ -15,26 +17,26 @@ function l(e) {
|
|
|
15
17
|
Number(t[3])
|
|
16
18
|
] : null;
|
|
17
19
|
}
|
|
18
|
-
function
|
|
20
|
+
function f(e, t, n) {
|
|
19
21
|
return `${String(e).padStart(4, "0")}-${String(t + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function p() {
|
|
22
24
|
let e = /* @__PURE__ */ new Date();
|
|
23
|
-
return
|
|
25
|
+
return f(e.getFullYear(), e.getMonth(), e.getDate());
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function m(e, t) {
|
|
26
28
|
return new Date(e, t + 1, 0).getDate();
|
|
27
29
|
}
|
|
28
|
-
function
|
|
30
|
+
function h(e, t, n) {
|
|
29
31
|
return t && e < t ? t : n && e > n ? n : e;
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
let n =
|
|
33
|
+
function g(e, t) {
|
|
34
|
+
let n = d(e);
|
|
33
35
|
if (!n) return e;
|
|
34
36
|
let [r, i, a] = n;
|
|
35
37
|
return t.replace("YYYY", String(r).padStart(4, "0")).replace("MM", String(i + 1).padStart(2, "0")).replace("DD", String(a).padStart(2, "0"));
|
|
36
38
|
}
|
|
37
|
-
var
|
|
39
|
+
var _ = class extends n(e) {
|
|
38
40
|
constructor(...e) {
|
|
39
41
|
super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this._viewYear = 0, this._viewMonth = 0, this._view = "days", this._focusDate = "", this._yearsPageStart = 0, this._didInit = !1, this._prevMonth = () => {
|
|
40
42
|
this._viewMonth === 0 ? (this._viewMonth = 11, this._viewYear--) : this._viewMonth--, this._syncFocusToView(), this.requestUpdate();
|
|
@@ -56,47 +58,47 @@ var h = class extends n(e) {
|
|
|
56
58
|
if (this.disabled) return;
|
|
57
59
|
let t = e.target.getAttribute("data-date");
|
|
58
60
|
if (!t) return;
|
|
59
|
-
let n =
|
|
61
|
+
let n = d(t);
|
|
60
62
|
if (!n) return;
|
|
61
|
-
let [r, i] = n,
|
|
63
|
+
let [r, i] = n, o = n[2], s = !0, c = null;
|
|
62
64
|
switch (e.key) {
|
|
63
|
-
case
|
|
64
|
-
|
|
65
|
+
case a(this).prev:
|
|
66
|
+
o--;
|
|
65
67
|
break;
|
|
66
|
-
case
|
|
67
|
-
|
|
68
|
+
case a(this).next:
|
|
69
|
+
o++;
|
|
68
70
|
break;
|
|
69
71
|
case "ArrowUp":
|
|
70
|
-
|
|
72
|
+
o -= 7;
|
|
71
73
|
break;
|
|
72
74
|
case "ArrowDown":
|
|
73
|
-
|
|
75
|
+
o += 7;
|
|
74
76
|
break;
|
|
75
77
|
case "Home":
|
|
76
|
-
|
|
78
|
+
o -= (new Date(r, i, o).getDay() - this.firstDay + 7) % 7;
|
|
77
79
|
break;
|
|
78
80
|
case "End":
|
|
79
|
-
|
|
81
|
+
o += 6 - (new Date(r, i, o).getDay() - this.firstDay + 7) % 7;
|
|
80
82
|
break;
|
|
81
83
|
case "PageUp":
|
|
82
84
|
case "PageDown": {
|
|
83
85
|
let t = e.key === "PageUp" ? -1 : 1, n = e.shiftKey ? new Date(r + t, i, 1) : new Date(r, i + t, 1);
|
|
84
|
-
|
|
86
|
+
o = Math.min(o, m(n.getFullYear(), n.getMonth())), c = n;
|
|
85
87
|
break;
|
|
86
88
|
}
|
|
87
89
|
case "Enter":
|
|
88
90
|
case " ":
|
|
89
91
|
this._selectDate(t), e.preventDefault();
|
|
90
92
|
return;
|
|
91
|
-
default:
|
|
93
|
+
default: s = !1;
|
|
92
94
|
}
|
|
93
|
-
if (!
|
|
95
|
+
if (!s) return;
|
|
94
96
|
e.preventDefault();
|
|
95
|
-
let
|
|
96
|
-
this._focusDate =
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
this.querySelector(`[data-date="${
|
|
97
|
+
let l = c ? new Date(c.getFullYear(), c.getMonth(), o) : new Date(r, i, o), u = h(f(l.getFullYear(), l.getMonth(), l.getDate()), this.min || void 0, this.max || void 0);
|
|
98
|
+
this._focusDate = u;
|
|
99
|
+
let p = d(u);
|
|
100
|
+
p && (this._viewYear = p[0], this._viewMonth = p[1]), this.requestUpdate(), this.updateComplete.then(() => {
|
|
101
|
+
this.querySelector(`[data-date="${u}"]`)?.focus();
|
|
100
102
|
});
|
|
101
103
|
};
|
|
102
104
|
}
|
|
@@ -107,16 +109,16 @@ var h = class extends n(e) {
|
|
|
107
109
|
super.updated(e), e.has("value") && this._syncViewToValue();
|
|
108
110
|
}
|
|
109
111
|
_initView() {
|
|
110
|
-
let e =
|
|
112
|
+
let e = d(this.value);
|
|
111
113
|
if (e) this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value;
|
|
112
114
|
else {
|
|
113
115
|
let e = /* @__PURE__ */ new Date();
|
|
114
|
-
this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth(), this._focusDate =
|
|
116
|
+
this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth(), this._focusDate = p();
|
|
115
117
|
}
|
|
116
118
|
this._yearsPageStart = this._viewYear - this._viewYear % 12;
|
|
117
119
|
}
|
|
118
120
|
_syncViewToValue() {
|
|
119
|
-
let e =
|
|
121
|
+
let e = d(this.value);
|
|
120
122
|
e && (this._viewYear = e[0], this._viewMonth = e[1], this._focusDate = this.value, this._yearsPageStart = this._viewYear - this._viewYear % 12, this.requestUpdate());
|
|
121
123
|
}
|
|
122
124
|
render() {
|
|
@@ -124,7 +126,7 @@ var h = class extends n(e) {
|
|
|
124
126
|
}
|
|
125
127
|
_renderDays() {
|
|
126
128
|
let e = this._getDayNames(), t = this._buildDayCells(), n = Array.from({ length: t.length / 7 }, (e, n) => t.slice(n * 7, n * 7 + 7)), r = this._getMonthName(this._viewMonth);
|
|
127
|
-
return
|
|
129
|
+
return s`
|
|
128
130
|
<div class="void-calendar-header">
|
|
129
131
|
<button
|
|
130
132
|
type="button"
|
|
@@ -154,21 +156,21 @@ var h = class extends n(e) {
|
|
|
154
156
|
</div>
|
|
155
157
|
<div class="void-calendar-grid" role="grid" aria-label="${r} ${this._viewYear}" @keydown=${this._onDayKeydown}>
|
|
156
158
|
<div class="void-calendar-weekdays" role="row">
|
|
157
|
-
${e.map((e) =>
|
|
159
|
+
${e.map((e) => s`<div class="void-calendar-weekday" role="columnheader" aria-label=${e.long}>${e.short}</div>`)}
|
|
158
160
|
</div>
|
|
159
161
|
<div class="void-calendar-days" role="rowgroup">
|
|
160
|
-
${n.map((e) =>
|
|
162
|
+
${n.map((e) => s`
|
|
161
163
|
<div class="void-calendar-week" role="row">
|
|
162
164
|
${e.map((e) => {
|
|
163
|
-
let t = e.iso === this.value, n = e.iso ===
|
|
164
|
-
return
|
|
165
|
+
let t = e.iso === this.value, n = e.iso === p(), r = this.disabled || e.disabled;
|
|
166
|
+
return s`
|
|
165
167
|
<div class="void-calendar-cell" role="gridcell" aria-selected=${t ? "true" : "false"}>
|
|
166
168
|
<button
|
|
167
169
|
type="button"
|
|
168
170
|
class="void-calendar-day${t ? " selected" : ""}${n ? " today" : ""}${e.outside ? " outside" : ""}"
|
|
169
171
|
?disabled=${r}
|
|
170
172
|
aria-label=${this._formatFullDate(e.iso)}
|
|
171
|
-
aria-current=${n ? "date" :
|
|
173
|
+
aria-current=${n ? "date" : c}
|
|
172
174
|
tabindex=${e.iso === this._focusDate ? "0" : "-1"}
|
|
173
175
|
data-date=${e.iso}
|
|
174
176
|
@click=${() => this._selectDate(e.iso)}
|
|
@@ -183,7 +185,7 @@ var h = class extends n(e) {
|
|
|
183
185
|
`;
|
|
184
186
|
}
|
|
185
187
|
_formatFullDate(e) {
|
|
186
|
-
let t =
|
|
188
|
+
let t = d(e);
|
|
187
189
|
if (!t) return e;
|
|
188
190
|
try {
|
|
189
191
|
return new Intl.DateTimeFormat(this.locale, { dateStyle: "full" }).format(new Date(t[0], t[1], t[2]));
|
|
@@ -206,9 +208,9 @@ var h = class extends n(e) {
|
|
|
206
208
|
return new Intl.DateTimeFormat(this.locale, { month: "long" }).format(new Date(2024, e, 1));
|
|
207
209
|
}
|
|
208
210
|
_buildDayCells() {
|
|
209
|
-
let e = this._viewYear, t = this._viewMonth, n =
|
|
211
|
+
let e = this._viewYear, t = this._viewMonth, n = m(e, t), r = (new Date(e, t, 1).getDay() - this.firstDay + 7) % 7, i = [], a = t === 0 ? 11 : t - 1, o = t === 0 ? e - 1 : e, s = m(o, a);
|
|
210
212
|
for (let e = r - 1; e >= 0; e--) {
|
|
211
|
-
let t = s - e, n =
|
|
213
|
+
let t = s - e, n = f(o, a, t);
|
|
212
214
|
i.push({
|
|
213
215
|
day: t,
|
|
214
216
|
iso: n,
|
|
@@ -217,7 +219,7 @@ var h = class extends n(e) {
|
|
|
217
219
|
});
|
|
218
220
|
}
|
|
219
221
|
for (let r = 1; r <= n; r++) {
|
|
220
|
-
let n =
|
|
222
|
+
let n = f(e, t, r);
|
|
221
223
|
i.push({
|
|
222
224
|
day: r,
|
|
223
225
|
iso: n,
|
|
@@ -225,9 +227,9 @@ var h = class extends n(e) {
|
|
|
225
227
|
disabled: this._isOutOfRange(n)
|
|
226
228
|
});
|
|
227
229
|
}
|
|
228
|
-
let c = t === 11 ? 0 : t + 1, l = t === 11 ? e + 1 : e,
|
|
229
|
-
for (let e = 1; e <=
|
|
230
|
-
let t =
|
|
230
|
+
let c = t === 11 ? 0 : t + 1, l = t === 11 ? e + 1 : e, u = 42 - i.length;
|
|
231
|
+
for (let e = 1; e <= u; e++) {
|
|
232
|
+
let t = f(l, c, e);
|
|
231
233
|
i.push({
|
|
232
234
|
day: e,
|
|
233
235
|
iso: t,
|
|
@@ -245,7 +247,7 @@ var h = class extends n(e) {
|
|
|
245
247
|
index: n,
|
|
246
248
|
name: e.format(new Date(2024, n, 1))
|
|
247
249
|
}));
|
|
248
|
-
return
|
|
250
|
+
return s`
|
|
249
251
|
<div class="void-calendar-header">
|
|
250
252
|
<button
|
|
251
253
|
type="button"
|
|
@@ -274,7 +276,7 @@ var h = class extends n(e) {
|
|
|
274
276
|
</button>
|
|
275
277
|
</div>
|
|
276
278
|
<div class="void-calendar-months">
|
|
277
|
-
${t.map((e) =>
|
|
279
|
+
${t.map((e) => s`
|
|
278
280
|
<button
|
|
279
281
|
type="button"
|
|
280
282
|
class="void-calendar-month${e.index === this._viewMonth && this._viewYear === (/* @__PURE__ */ new Date()).getFullYear() ? " current" : ""}"
|
|
@@ -287,7 +289,7 @@ var h = class extends n(e) {
|
|
|
287
289
|
}
|
|
288
290
|
_renderYears() {
|
|
289
291
|
let e = this._yearsPageStart, t = Array.from({ length: 12 }, (t, n) => e + n), n = (/* @__PURE__ */ new Date()).getFullYear();
|
|
290
|
-
return
|
|
292
|
+
return s`
|
|
291
293
|
<div class="void-calendar-header">
|
|
292
294
|
<button
|
|
293
295
|
type="button"
|
|
@@ -310,7 +312,7 @@ var h = class extends n(e) {
|
|
|
310
312
|
</button>
|
|
311
313
|
</div>
|
|
312
314
|
<div class="void-calendar-years">
|
|
313
|
-
${t.map((e) =>
|
|
315
|
+
${t.map((e) => s`
|
|
314
316
|
<button
|
|
315
317
|
type="button"
|
|
316
318
|
class="void-calendar-year${e === n ? " current" : ""}"
|
|
@@ -325,12 +327,12 @@ var h = class extends n(e) {
|
|
|
325
327
|
this._viewMonth = e, this._view = "days", this._syncFocusToView(), this.requestUpdate();
|
|
326
328
|
}
|
|
327
329
|
_syncFocusToView() {
|
|
328
|
-
let e =
|
|
330
|
+
let e = d(this._focusDate) ?? [
|
|
329
331
|
this._viewYear,
|
|
330
332
|
this._viewMonth,
|
|
331
333
|
1
|
|
332
|
-
], t = Math.min(e[2],
|
|
333
|
-
this._focusDate =
|
|
334
|
+
], t = Math.min(e[2], m(this._viewYear, this._viewMonth));
|
|
335
|
+
this._focusDate = h(f(this._viewYear, this._viewMonth, t), this.min || void 0, this.max || void 0);
|
|
334
336
|
}
|
|
335
337
|
_pickYear(e) {
|
|
336
338
|
this._viewYear = e, this._yearsPageStart = e - e % 12, this._view = "months", this.requestUpdate();
|
|
@@ -338,7 +340,7 @@ var h = class extends n(e) {
|
|
|
338
340
|
_selectDate(e) {
|
|
339
341
|
if (this.disabled || this._isOutOfRange(e)) return;
|
|
340
342
|
this.value = e, this._focusDate = e;
|
|
341
|
-
let t =
|
|
343
|
+
let t = d(e);
|
|
342
344
|
this._viewYear = t[0], this._viewMonth = t[1], this._view = "days", this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
343
345
|
bubbles: !0,
|
|
344
346
|
composed: !0,
|
|
@@ -349,22 +351,22 @@ var h = class extends n(e) {
|
|
|
349
351
|
}));
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
|
-
t([
|
|
354
|
+
t([l({
|
|
353
355
|
type: String,
|
|
354
356
|
reflect: !0
|
|
355
|
-
})],
|
|
357
|
+
})], _.prototype, "value", void 0), t([l({ type: String })], _.prototype, "min", void 0), t([l({ type: String })], _.prototype, "max", void 0), t([l({
|
|
356
358
|
type: Boolean,
|
|
357
359
|
reflect: !0
|
|
358
|
-
})],
|
|
360
|
+
})], _.prototype, "disabled", void 0), t([l({
|
|
359
361
|
type: String,
|
|
360
362
|
reflect: !0
|
|
361
|
-
})],
|
|
363
|
+
})], _.prototype, "size", void 0), t([l({ type: String })], _.prototype, "locale", void 0), t([l({
|
|
362
364
|
attribute: "first-day",
|
|
363
365
|
type: Number
|
|
364
|
-
})],
|
|
365
|
-
var
|
|
366
|
+
})], _.prototype, "firstDay", void 0), customElements.get("void-calendar") || customElements.define("void-calendar", _);
|
|
367
|
+
var v = class extends n(e) {
|
|
366
368
|
constructor(...e) {
|
|
367
|
-
super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this.open = !1, this.placeholder = "Select date", this.format = "MM/DD/YYYY", this.color = "default", this._dropdownId =
|
|
369
|
+
super(...e), this.value = "", this.min = "", this.max = "", this.disabled = !1, this.size = "md", this.locale = "en-US", this.firstDay = 0, this.open = !1, this.placeholder = "Select date", this.format = "MM/DD/YYYY", this.color = "default", this._dropdownId = i("void-date-picker-dialog"), this._overlay = new o(this, {
|
|
368
370
|
kind: "dialog",
|
|
369
371
|
surface: () => this.querySelector(":scope > .void-date-picker-dropdown"),
|
|
370
372
|
isOpen: () => this.open,
|
|
@@ -396,11 +398,11 @@ var g = class extends n(e) {
|
|
|
396
398
|
e && (await e.updateComplete, this.open && e.querySelector("[tabindex=\"0\"]")?.focus({ preventScroll: !0 }));
|
|
397
399
|
}
|
|
398
400
|
render() {
|
|
399
|
-
return
|
|
401
|
+
return s`
|
|
400
402
|
<div class="void-date-picker-anchor">
|
|
401
403
|
<input
|
|
402
404
|
class="void-date-picker-input"
|
|
403
|
-
.value=${
|
|
405
|
+
.value=${u(this.value ? g(this.value, this.format) : "")}
|
|
404
406
|
placeholder=${this.placeholder}
|
|
405
407
|
?disabled=${this.disabled}
|
|
406
408
|
readonly
|
|
@@ -428,7 +430,7 @@ var g = class extends n(e) {
|
|
|
428
430
|
</svg>
|
|
429
431
|
</button>
|
|
430
432
|
</div>
|
|
431
|
-
${this.open ?
|
|
433
|
+
${this.open ? s`
|
|
432
434
|
<div class="void-date-picker-dropdown" id=${this._dropdownId} role="dialog" aria-label="Choose date" popover="manual">
|
|
433
435
|
<void-calendar
|
|
434
436
|
value=${this.value}
|
|
@@ -441,28 +443,28 @@ var g = class extends n(e) {
|
|
|
441
443
|
@void-change=${this._onCalendarChange}
|
|
442
444
|
></void-calendar>
|
|
443
445
|
</div>
|
|
444
|
-
` :
|
|
446
|
+
` : c}
|
|
445
447
|
`;
|
|
446
448
|
}
|
|
447
449
|
};
|
|
448
|
-
t([
|
|
450
|
+
t([l({
|
|
449
451
|
type: String,
|
|
450
452
|
reflect: !0
|
|
451
|
-
})],
|
|
453
|
+
})], v.prototype, "value", void 0), t([l({ type: String })], v.prototype, "min", void 0), t([l({ type: String })], v.prototype, "max", void 0), t([l({
|
|
452
454
|
type: Boolean,
|
|
453
455
|
reflect: !0
|
|
454
|
-
})],
|
|
456
|
+
})], v.prototype, "disabled", void 0), t([l({
|
|
455
457
|
type: String,
|
|
456
458
|
reflect: !0
|
|
457
|
-
})],
|
|
459
|
+
})], v.prototype, "size", void 0), t([l({ type: String })], v.prototype, "locale", void 0), t([l({
|
|
458
460
|
attribute: "first-day",
|
|
459
461
|
type: Number
|
|
460
|
-
})],
|
|
462
|
+
})], v.prototype, "firstDay", void 0), t([l({
|
|
461
463
|
type: Boolean,
|
|
462
464
|
reflect: !0
|
|
463
|
-
})],
|
|
465
|
+
})], v.prototype, "open", void 0), t([l({ type: String })], v.prototype, "placeholder", void 0), t([l({ type: String })], v.prototype, "format", void 0), t([l({
|
|
464
466
|
type: String,
|
|
465
467
|
reflect: !0
|
|
466
|
-
})],
|
|
468
|
+
})], v.prototype, "color", void 0), customElements.get("void-date-picker") || customElements.define("void-date-picker", v);
|
|
467
469
|
//#endregion
|
|
468
|
-
export {
|
|
470
|
+
export { _ as VoidCalendar, v as VoidDatePicker };
|
package/dist/components/card.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
-
import { n as r } from "../chunks/parts-
|
|
5
|
-
import {
|
|
4
|
+
import { n as r } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { r as i } from "../chunks/keyboard-CEhMSkws.js";
|
|
6
|
+
import { property as a } from "lit/decorators.js";
|
|
6
7
|
//#region src/components/carousel.ts
|
|
7
|
-
var
|
|
8
|
+
var o = class extends e {
|
|
8
9
|
constructor(...e) {
|
|
9
10
|
super(...e), this._activation = new n(this, { disabled: () => this.getAttribute("aria-disabled") === "true" });
|
|
10
11
|
}
|
|
@@ -12,8 +13,8 @@ var a = class extends e {
|
|
|
12
13
|
super.connectedCallback(), this.setHostAttribute("role", "button"), this.setHostAttribute("tabindex", "0");
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
|
-
customElements.get("void-carousel-previous") || customElements.define("void-carousel-previous",
|
|
16
|
-
var
|
|
16
|
+
customElements.get("void-carousel-previous") || customElements.define("void-carousel-previous", o);
|
|
17
|
+
var s = class extends e {
|
|
17
18
|
constructor(...e) {
|
|
18
19
|
super(...e), this._activation = new n(this, { disabled: () => this.getAttribute("aria-disabled") === "true" });
|
|
19
20
|
}
|
|
@@ -21,8 +22,8 @@ var o = class extends e {
|
|
|
21
22
|
super.connectedCallback(), this.setHostAttribute("role", "button"), this.setHostAttribute("tabindex", "0");
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
customElements.get("void-carousel-next") || customElements.define("void-carousel-next",
|
|
25
|
-
var
|
|
25
|
+
customElements.get("void-carousel-next") || customElements.define("void-carousel-next", s);
|
|
26
|
+
var c = class extends e {
|
|
26
27
|
constructor(...e) {
|
|
27
28
|
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
29
|
tags: [
|
|
@@ -45,8 +46,8 @@ var s = class extends e {
|
|
|
45
46
|
}, this._onMouseLeave = () => {
|
|
46
47
|
this.autoplay && this._startAutoplay();
|
|
47
48
|
}, this._onKeydown = (e) => {
|
|
48
|
-
let t = this.orientation === "horizontal", n = t ?
|
|
49
|
-
e.key ===
|
|
49
|
+
let t = this.orientation === "horizontal", n = i(this), r = t ? n.prev : "ArrowUp", a = t ? n.next : "ArrowDown";
|
|
50
|
+
e.key === r ? (e.preventDefault(), this._prev()) : e.key === a && (e.preventDefault(), this._next());
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
get _slides() {
|
|
@@ -116,21 +117,21 @@ var s = class extends e {
|
|
|
116
117
|
this._autoplayTimer &&= (clearInterval(this._autoplayTimer), null);
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
|
-
t([
|
|
120
|
+
t([a({
|
|
120
121
|
type: Number,
|
|
121
122
|
reflect: !0
|
|
122
|
-
})],
|
|
123
|
+
})], c.prototype, "index", void 0), t([a({
|
|
123
124
|
type: Boolean,
|
|
124
125
|
reflect: !0
|
|
125
|
-
})],
|
|
126
|
+
})], c.prototype, "loop", void 0), t([a({
|
|
126
127
|
type: Boolean,
|
|
127
128
|
reflect: !0
|
|
128
|
-
})],
|
|
129
|
+
})], c.prototype, "autoplay", void 0), t([a({ type: Number })], c.prototype, "interval", void 0), t([a({
|
|
129
130
|
type: String,
|
|
130
131
|
reflect: !0
|
|
131
|
-
})],
|
|
132
|
+
})], c.prototype, "size", void 0), t([a({
|
|
132
133
|
type: String,
|
|
133
134
|
reflect: !0
|
|
134
|
-
})],
|
|
135
|
+
})], c.prototype, "orientation", void 0), customElements.get("void-carousel") || customElements.define("void-carousel", c);
|
|
135
136
|
//#endregion
|
|
136
|
-
export {
|
|
137
|
+
export { c as VoidCarousel, s as VoidCarouselNext, o as VoidCarouselPrevious };
|
|
@@ -25,9 +25,19 @@ export declare class VoidCheckboxGroup extends VoidCheckboxGroup_base {
|
|
|
25
25
|
/** Disables every checkbox in the group (like a fieldset). */
|
|
26
26
|
disabled: boolean;
|
|
27
27
|
protected readonly _projection: ProjectionController;
|
|
28
|
+
/** Values asked for while no checkbox exists yet (an attribute parsed ahead of its children), applied when they arrive. */
|
|
29
|
+
private _wanted;
|
|
30
|
+
/** The serialised value last handed to Lit, to notice a choice made on the checkboxes (the user, a morph). */
|
|
31
|
+
private _reflected;
|
|
32
|
+
/**
|
|
33
|
+
* The values of the checked checkboxes, as a list. The `value` attribute is the same list as a JSON array
|
|
34
|
+
* (`value='["a","b"]'`), kept in step as the boxes change; setting it checks those boxes.
|
|
35
|
+
* @default []
|
|
36
|
+
*/
|
|
28
37
|
get value(): string[];
|
|
29
38
|
/** Check exactly the child checkboxes whose value is listed. Does not fire void-change. */
|
|
30
39
|
set value(values: string[]);
|
|
40
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
31
41
|
/** The checkboxes reset themselves; the group has no state of its own. */
|
|
32
42
|
protected formSnapshot(): unknown;
|
|
33
43
|
/** "At least one" validity, carried by the first enabled native checkbox. */
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import { n
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
+
import { t as r } from "../chunks/projection-SnR79EHI.js";
|
|
5
|
+
import { n 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";
|
|
6
8
|
//#region src/components/checkbox-group.ts
|
|
7
|
-
var
|
|
8
|
-
constructor(...
|
|
9
|
-
super(...
|
|
9
|
+
var c = (e) => e.value ?? e.getAttribute("value") ?? "on", l = class extends n(e) {
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this.label = "", this.orientation = "vertical", this.name = "", this.required = !1, this.disabled = !1, this._projection = new r(this, {
|
|
10
12
|
regions: [{
|
|
11
13
|
name: "items",
|
|
12
14
|
target: () => this.querySelector(":scope > .void-checkbox-group-items")
|
|
13
15
|
}],
|
|
14
16
|
onChange: () => {
|
|
15
|
-
this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
|
|
17
|
+
this._wanted && this._boxes().length > 0 && (this.value = this._wanted), this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
|
|
16
18
|
}
|
|
17
|
-
}), this._handleChildChange = (e) => {
|
|
19
|
+
}), this._wanted = null, this._reflected = null, this._handleChildChange = (e) => {
|
|
18
20
|
let t = e.target;
|
|
19
21
|
!t.closest("void-checkbox") || t.closest("void-checkbox")?.closest("void-checkbox-group") !== this || (e.stopImmediatePropagation(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
20
22
|
bubbles: !0,
|
|
@@ -24,12 +26,20 @@ var s = class extends r(t) {
|
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
get value() {
|
|
27
|
-
|
|
29
|
+
let e = this._boxes();
|
|
30
|
+
return this._wanted && e.length === 0 ? [...this._wanted] : e.filter((e) => e.checked).map(c);
|
|
28
31
|
}
|
|
29
32
|
set value(e) {
|
|
30
|
-
let t =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
let t = this._boxes(), n = Array.isArray(e) ? e : [];
|
|
34
|
+
this._wanted = t.length === 0 ? [...n] : null;
|
|
35
|
+
let r = new Set(n);
|
|
36
|
+
for (let e of t) e.checked = r.has(c(e));
|
|
37
|
+
this.requestUpdate("value", void 0), this.formSync();
|
|
38
|
+
}
|
|
39
|
+
willUpdate(e) {
|
|
40
|
+
super.willUpdate(e);
|
|
41
|
+
let t = JSON.stringify(this.value);
|
|
42
|
+
t !== this._reflected && (this._reflected = t, e.has("value") || this.requestUpdate("value", void 0));
|
|
33
43
|
}
|
|
34
44
|
formSnapshot() {
|
|
35
45
|
return null;
|
|
@@ -63,27 +73,30 @@ var s = class extends r(t) {
|
|
|
63
73
|
if (this.name) for (let e of this._boxes()) e.name = this.name;
|
|
64
74
|
}
|
|
65
75
|
render() {
|
|
66
|
-
return
|
|
67
|
-
${this.label ?
|
|
76
|
+
return a`
|
|
77
|
+
${this.label ? a`<span class="void-checkbox-group-label">${this.label}</span>` : o}
|
|
68
78
|
<div class="void-checkbox-group-items"></div>
|
|
69
79
|
`;
|
|
70
80
|
}
|
|
71
81
|
};
|
|
72
|
-
|
|
82
|
+
t([s({
|
|
73
83
|
type: String,
|
|
74
84
|
reflect: !0
|
|
75
|
-
})],
|
|
85
|
+
})], l.prototype, "label", void 0), t([s({
|
|
76
86
|
type: String,
|
|
77
87
|
reflect: !0
|
|
78
|
-
})],
|
|
88
|
+
})], l.prototype, "orientation", void 0), t([s({
|
|
79
89
|
type: String,
|
|
80
90
|
reflect: !0
|
|
81
|
-
})],
|
|
91
|
+
})], l.prototype, "name", void 0), t([s({
|
|
82
92
|
type: Boolean,
|
|
83
93
|
reflect: !0
|
|
84
|
-
})],
|
|
94
|
+
})], l.prototype, "required", void 0), t([s({
|
|
85
95
|
type: Boolean,
|
|
86
96
|
reflect: !0
|
|
87
|
-
})],
|
|
97
|
+
})], l.prototype, "disabled", void 0), t([s({
|
|
98
|
+
converter: i,
|
|
99
|
+
reflect: !0
|
|
100
|
+
})], l.prototype, "value", null), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", l);
|
|
88
101
|
//#endregion
|
|
89
|
-
export {
|
|
102
|
+
export { l as VoidCheckboxGroup };
|
|
@@ -7,8 +7,8 @@ export declare class VoidCheckbox extends VoidCheckbox_base {
|
|
|
7
7
|
/** Enter and Space fire a real `click`, as on a native button. */
|
|
8
8
|
protected readonly _activation: KeyboardActivation;
|
|
9
9
|
/**
|
|
10
|
-
* Whether the box is checked.
|
|
11
|
-
* the form's reset target.
|
|
10
|
+
* Whether the box is checked. Reflected to the attribute as the user toggles it or a script sets it;
|
|
11
|
+
* the form's reset target stays the state it started with.
|
|
12
12
|
*/
|
|
13
13
|
checked: boolean;
|
|
14
14
|
/**
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
|
+
import { n as r } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
+
import { t as i } from "../chunks/projection-SnR79EHI.js";
|
|
5
6
|
import { html as a, nothing as o } from "lit";
|
|
6
7
|
import { property as s } from "lit/decorators.js";
|
|
7
8
|
//#region src/components/checkbox.ts
|
|
8
|
-
var c = class extends
|
|
9
|
-
constructor(...
|
|
10
|
-
super(...
|
|
9
|
+
var c = class extends r(e) {
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this._activation = new n(this, {
|
|
11
12
|
enter: !1,
|
|
12
13
|
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
|
|
14
|
+
}), 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 i(this, { regions: [{
|
|
14
15
|
name: "label",
|
|
15
16
|
target: "after"
|
|
16
17
|
}] }), this._onNativeFocus = () => {
|
|
@@ -77,28 +78,28 @@ var c = class extends i(t) {
|
|
|
77
78
|
e && e.checked !== this.checked && (e.checked = this.checked), this.closest("void-checkbox-group")?.requestUpdate();
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
|
-
|
|
81
|
+
t([s({
|
|
81
82
|
type: Boolean,
|
|
82
83
|
reflect: !0
|
|
83
|
-
})], c.prototype, "checked", void 0),
|
|
84
|
+
})], c.prototype, "checked", void 0), t([s({
|
|
84
85
|
type: Boolean,
|
|
85
86
|
reflect: !0
|
|
86
|
-
})], c.prototype, "disabled", void 0),
|
|
87
|
+
})], c.prototype, "disabled", void 0), t([s({
|
|
87
88
|
type: Boolean,
|
|
88
89
|
reflect: !0
|
|
89
|
-
})], c.prototype, "indeterminate", void 0),
|
|
90
|
+
})], c.prototype, "indeterminate", void 0), t([s({
|
|
90
91
|
type: String,
|
|
91
92
|
reflect: !0
|
|
92
|
-
})], c.prototype, "name", void 0),
|
|
93
|
+
})], c.prototype, "name", void 0), t([s({
|
|
93
94
|
type: String,
|
|
94
95
|
reflect: !0
|
|
95
|
-
})], c.prototype, "value", void 0),
|
|
96
|
+
})], c.prototype, "value", void 0), t([s({
|
|
96
97
|
type: Boolean,
|
|
97
98
|
reflect: !0
|
|
98
|
-
})], c.prototype, "required", void 0),
|
|
99
|
+
})], c.prototype, "required", void 0), t([s({
|
|
99
100
|
type: String,
|
|
100
101
|
reflect: !0
|
|
101
|
-
})], c.prototype, "color", void 0),
|
|
102
|
+
})], c.prototype, "color", void 0), t([s({
|
|
102
103
|
type: String,
|
|
103
104
|
reflect: !0
|
|
104
105
|
})], c.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", c);
|