@voidable/ui 0.10.0 → 0.12.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/angular/index.d.ts +2 -2
- package/dist/angular/index.js +2 -1
- package/dist/base.d.ts +6 -0
- package/dist/base.js +2 -2
- package/dist/chunks/activation-B8aBarKd.js +4 -0
- package/dist/chunks/{base-BxmMM3B7.js → base-BGrS4eIl.js} +9 -0
- package/dist/chunks/carousel-C9u0bg5l.js +10 -0
- package/dist/chunks/choice-BTrsi7OW.js +16 -0
- package/dist/chunks/data-Baycjoo4.js +96 -0
- package/dist/chunks/fields-MEqz-olE.js +21 -0
- package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
- package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
- package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
- package/dist/chunks/menu-CxRRgkJI.js +21 -0
- package/dist/chunks/{modal-CgGp_fCs.js → modal-Cz2-Ov76.js} +24 -16
- package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
- package/dist/chunks/{overlay-hLJ7IQHx.js → overlay-BuV-4Yvt.js} +76 -69
- package/dist/chunks/overlay-K1ilWC1p.js +4 -0
- package/dist/chunks/pickers-CjlFgNke.js +36 -0
- package/dist/chunks/{projection-SnR79EHI.js → projection-oPe6ipjL.js} +1 -1
- package/dist/chunks/table-BBpqwWEi.js +4 -0
- package/dist/chunks/tabs-Buf3EBWq.js +10 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +23 -15
- package/dist/components/action-input.d.ts +2 -1
- package/dist/components/action-input.js +60 -56
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +10 -3
- package/dist/components/avatar.js +2 -2
- 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 +10 -3
- package/dist/components/bar-chart.d.ts +21 -7
- package/dist/components/bar-chart.js +68 -45
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +16 -12
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +24 -17
- package/dist/components/calendar.d.ts +85 -12
- package/dist/components/calendar.js +263 -120
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.d.ts +22 -0
- package/dist/components/carousel.js +66 -37
- package/dist/components/charts/data.d.ts +72 -0
- package/dist/components/checkbox-group.js +23 -22
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +30 -25
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.js +20 -12
- package/dist/components/color-picker.js +29 -28
- package/dist/components/combobox.d.ts +13 -1
- package/dist/components/combobox.js +55 -42
- package/dist/components/compose-input.d.ts +9 -1
- package/dist/components/compose-input.js +29 -17
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +2 -2
- package/dist/components/donut-chart.d.ts +22 -6
- package/dist/components/donut-chart.js +97 -70
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +55 -40
- package/dist/components/editable.d.ts +11 -1
- package/dist/components/editable.js +36 -23
- package/dist/components/error-fallback.d.ts +4 -2
- package/dist/components/error-fallback.js +35 -29
- package/dist/components/field.js +2 -2
- package/dist/components/file-upload.d.ts +29 -5
- package/dist/components/file-upload.js +84 -28
- package/dist/components/gauge.d.ts +32 -8
- package/dist/components/gauge.js +206 -133
- package/dist/components/hamburger.d.ts +19 -1
- package/dist/components/hamburger.js +45 -25
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.js +23 -15
- package/dist/components/indicator.js +16 -15
- package/dist/components/input.js +3 -3
- package/dist/components/line-chart.d.ts +22 -7
- package/dist/components/line-chart.js +80 -57
- package/dist/components/list.js +1 -1
- package/dist/components/menu.d.ts +25 -0
- package/dist/components/menu.js +56 -34
- package/dist/components/multiselect.d.ts +17 -1
- package/dist/components/multiselect.js +97 -75
- package/dist/components/nav-bar.d.ts +9 -0
- package/dist/components/nav-bar.js +16 -3
- package/dist/components/nav-menu.d.ts +9 -0
- package/dist/components/nav-menu.js +31 -24
- package/dist/components/number-input.d.ts +15 -1
- package/dist/components/number-input.js +72 -38
- package/dist/components/pagination.js +26 -25
- package/dist/components/panel.js +1 -1
- package/dist/components/pin-input.d.ts +11 -0
- package/dist/components/pin-input.js +47 -33
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +22 -14
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.d.ts +10 -1
- package/dist/components/radio.js +38 -33
- package/dist/components/scroll-area.js +2 -2
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.js +41 -29
- package/dist/components/select.js +2 -2
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +15 -11
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +3 -3
- package/dist/components/spinner.d.ts +5 -3
- package/dist/components/spinner.js +22 -15
- package/dist/components/stat.d.ts +13 -1
- package/dist/components/stat.js +28 -20
- package/dist/components/status-dot.d.ts +2 -2
- package/dist/components/status-dot.js +13 -15
- package/dist/components/stepper.d.ts +2 -0
- package/dist/components/stepper.js +21 -14
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +25 -17
- package/dist/components/table.d.ts +81 -1
- package/dist/components/table.js +571 -69
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +43 -34
- package/dist/components/tag.js +13 -12
- package/dist/components/tags-input.d.ts +10 -1
- package/dist/components/tags-input.js +43 -31
- package/dist/components/textarea.js +3 -3
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +36 -29
- package/dist/components/toggle-group.d.ts +8 -0
- package/dist/components/toggle-group.js +25 -18
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +24 -16
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +21 -13
- package/dist/components.json +108 -84
- package/dist/custom-elements.json +4520 -236
- package/dist/dev/rules.d.ts +0 -1
- package/dist/dev/types.d.ts +5 -1
- package/dist/dev.js +298 -122
- package/dist/index.d.ts +4 -0
- package/dist/index.js +69 -67
- package/dist/keyboard-activation.d.ts +9 -9
- package/dist/keyboard.d.ts +2 -10
- package/dist/keymaps/activation.d.ts +8 -0
- package/dist/keymaps/carousel.d.ts +9 -0
- package/dist/keymaps/choice.d.ts +21 -0
- package/dist/keymaps/fields.d.ts +31 -0
- package/dist/keymaps/index.d.ts +2 -0
- package/dist/keymaps/menu.d.ts +36 -0
- package/dist/keymaps/nav-menu.d.ts +11 -0
- package/dist/keymaps/overlay.d.ts +4 -0
- package/dist/keymaps/pickers.d.ts +36 -0
- package/dist/keymaps/table.d.ts +8 -0
- package/dist/keymaps/tabs.d.ts +7 -0
- package/dist/keymaps.js +51 -0
- package/dist/keys.d.ts +46 -0
- package/dist/keys.js +57 -0
- package/dist/llms.txt +11 -3
- package/dist/messages/ar.d.ts +1 -0
- package/dist/messages/ar.js +130 -0
- package/dist/messages/fr.d.ts +1 -0
- package/dist/messages/fr.js +109 -0
- package/dist/messages.d.ts +213 -0
- package/dist/messages.js +190 -0
- package/dist/modal.d.ts +7 -0
- package/dist/reference.md +885 -60
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing.js +79 -0
- package/dist/types/elements.d.ts +100 -84
- package/dist/types/react.d.ts +7 -3
- package/dist/types/solid.d.ts +7 -3
- package/dist/types/solid2.d.ts +4 -0
- package/dist/types/svelte.d.ts +7 -3
- package/dist/types/vue.d.ts +7 -3
- package/dist/vscode.html-custom-data.json +478 -38
- package/dist/web-types.json +1001 -111
- package/package.json +22 -2
|
@@ -1,28 +1,31 @@
|
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { msg as n } from "../messages.js";
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { n as i, t as a } from "../chunks/scale-_ccSuoYg.js";
|
|
6
|
+
import { a as o, c as s, n as c, o as l, t as u } from "../chunks/data-Baycjoo4.js";
|
|
7
|
+
import { html as d, nothing as f, svg as p } from "lit";
|
|
8
|
+
import { property as m, state as h } from "lit/decorators.js";
|
|
9
|
+
import { guard as g } from "lit/directives/guard.js";
|
|
7
10
|
//#region src/components/bar-chart.ts
|
|
8
|
-
|
|
9
|
-
function
|
|
11
|
+
r();
|
|
12
|
+
function _(e) {
|
|
10
13
|
return 1 - (1 - e) ** 3;
|
|
11
14
|
}
|
|
12
|
-
function
|
|
15
|
+
function v(e) {
|
|
13
16
|
return e === 0 ? "0" : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(1);
|
|
14
17
|
}
|
|
15
|
-
function
|
|
18
|
+
function y(e) {
|
|
16
19
|
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
17
20
|
}
|
|
18
|
-
function
|
|
21
|
+
function b(e) {
|
|
19
22
|
if (e <= 0) return 1;
|
|
20
23
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
21
24
|
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
22
25
|
}
|
|
23
|
-
var
|
|
26
|
+
var x = class extends e {
|
|
24
27
|
constructor(...e) {
|
|
25
|
-
super(...e), this.height = 220, this.showValue = !1, this.variant = "filled", this.ariaLabel = "", this.stagger = null, this._data = { series: [] }, this._phase = "pre", this._display = /* @__PURE__ */ new Map(), this._targets = /* @__PURE__ */ new Map(), this._animFrom = /* @__PURE__ */ new Map(), this._animStart = 0, this._animDuration = 0, this._staggerMs = 0, this._rafHandle = 0, this._tick = (e) => {
|
|
28
|
+
super(...e), this.height = 220, this.showValue = !1, this.variant = "filled", this.ariaLabel = "", this.showTable = !1, this.stagger = null, this._data = { series: [] }, this._source = { text: null }, this._entered = !1, this._phase = "pre", this._display = /* @__PURE__ */ new Map(), this._targets = /* @__PURE__ */ new Map(), this._animFrom = /* @__PURE__ */ new Map(), this._animStart = 0, this._animDuration = 0, this._staggerMs = 0, this._rafHandle = 0, this._tick = (e) => {
|
|
26
29
|
let t = e - this._animStart, n = !1;
|
|
27
30
|
for (let [e, r] of this._targets) {
|
|
28
31
|
let [, i] = e.split("-"), a = Number(i) * this._staggerMs, o = a + this._animDuration, s = this._animFrom.get(e) ?? 0;
|
|
@@ -30,7 +33,7 @@ var m = class extends e {
|
|
|
30
33
|
else if (t >= o) this._display.set(e, r);
|
|
31
34
|
else {
|
|
32
35
|
let i = (t - a) / this._animDuration;
|
|
33
|
-
this._display.set(e, s + (r - s) *
|
|
36
|
+
this._display.set(e, s + (r - s) * _(i)), n = !0;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
this.requestUpdate(), n ? this._rafHandle = requestAnimationFrame(this._tick) : this._phase = "idle";
|
|
@@ -40,8 +43,16 @@ var m = class extends e {
|
|
|
40
43
|
return this._data;
|
|
41
44
|
}
|
|
42
45
|
set data(e) {
|
|
43
|
-
let t =
|
|
44
|
-
|
|
46
|
+
let t = l(e, this._source, {
|
|
47
|
+
attr: "data",
|
|
48
|
+
shape: "{\"series\":[{\"name\":\"Sales\",\"values\":[3,5]}],\"labels\":[\"Mon\",\"Tue\"]}",
|
|
49
|
+
empty: () => ({ series: [] }),
|
|
50
|
+
normalize: o,
|
|
51
|
+
warn: (e, t) => this.reportDev("invalid-data", e, t)
|
|
52
|
+
});
|
|
53
|
+
if (!t) return;
|
|
54
|
+
let n = new Map(this._display);
|
|
55
|
+
this._data = t.value, this._refreshTargets(), this.requestUpdate(), this._entered && this.updateComplete.then(() => this._startAnimation(n));
|
|
45
56
|
}
|
|
46
57
|
_key(e, t) {
|
|
47
58
|
return `${e}-${t}`;
|
|
@@ -52,8 +63,8 @@ var m = class extends e {
|
|
|
52
63
|
});
|
|
53
64
|
}
|
|
54
65
|
connectedCallback() {
|
|
55
|
-
super.connectedCallback(), this.setHostAttribute("role", "
|
|
56
|
-
this._startAnimation(/* @__PURE__ */ new Map());
|
|
66
|
+
super.connectedCallback(), this.setHostAttribute("role", "figure"), this._refreshTargets(), requestAnimationFrame(() => {
|
|
67
|
+
this._entered = !0, this._startAnimation(/* @__PURE__ */ new Map());
|
|
57
68
|
});
|
|
58
69
|
}
|
|
59
70
|
disconnectedCallback() {
|
|
@@ -70,42 +81,41 @@ var m = class extends e {
|
|
|
70
81
|
}
|
|
71
82
|
render() {
|
|
72
83
|
let { series: e, labels: t = [] } = this._data;
|
|
73
|
-
if (e.length === 0) return
|
|
74
|
-
let n = this.height - 16 - 32,
|
|
75
|
-
return
|
|
84
|
+
if (e.length === 0) return d`<svg viewBox="0 0 600 ${this.height}" aria-hidden="true"></svg>`;
|
|
85
|
+
let n = this.height - 16 - 32, r = Math.max(...e.map((e) => e.values.length)), o = e.flatMap((e) => e.values).filter(Number.isFinite), s = Math.max(...o, 0), c = Math.min(...o, 0), l = c < 0 ? -b(-c * 1.1) : 0, u = new i([l, s > 0 || l === 0 ? b(s * 1.1) || 1 : 0], [16 + n, 16]), m = u.scale(0), h = new a(r, [40, 584], .2), g = u.ticks(5);
|
|
86
|
+
return d`
|
|
76
87
|
<svg
|
|
77
88
|
viewBox="0 0 600 ${this.height}"
|
|
78
89
|
preserveAspectRatio="none"
|
|
79
|
-
|
|
80
|
-
aria-label=${this.ariaLabel || "Bar chart"}
|
|
90
|
+
aria-hidden="true"
|
|
81
91
|
data-phase=${this._phase}
|
|
82
92
|
>
|
|
83
93
|
<g class="void-bar-chart-grid">
|
|
84
|
-
${
|
|
85
|
-
let t =
|
|
86
|
-
return
|
|
94
|
+
${g.map((e) => {
|
|
95
|
+
let t = u.scale(e);
|
|
96
|
+
return p`<line x1=${40} x2=${584} y1=${t} y2=${t}></line>`;
|
|
87
97
|
})}
|
|
88
98
|
</g>
|
|
89
99
|
|
|
90
|
-
${
|
|
100
|
+
${l < 0 ? p`<line class="void-bar-chart-baseline" x1=${40} x2=${584} y1=${m} y2=${m}></line>` : f}
|
|
91
101
|
|
|
92
102
|
<g class="void-bar-chart-y-axis">
|
|
93
|
-
${
|
|
103
|
+
${g.map((e) => p`<text x=${32} y=${u.scale(e)} dy="0.32em" text-anchor="end">${v(e)}</text>`)}
|
|
94
104
|
</g>
|
|
95
105
|
|
|
96
106
|
${e.map((t, n) => {
|
|
97
|
-
let r = t.color ?? `var(--void-chart-series-${n % 6 + 1})`, i =
|
|
98
|
-
return
|
|
107
|
+
let r = t.color ?? `var(--void-chart-series-${n % 6 + 1})`, i = h.bandwidth / e.length;
|
|
108
|
+
return p`
|
|
99
109
|
<g class="void-bar-chart-series" style="--series-color: ${r}">
|
|
100
110
|
${t.values.map((e, r) => {
|
|
101
|
-
let a = this._display.get(this._key(n, r)) ?? 0,
|
|
102
|
-
return
|
|
111
|
+
let a = this._display.get(this._key(n, r)) ?? 0, o = h.scale(r) + i * n, s = u.scale(a), c = Math.min(s, m), l = Math.abs(m - s), d = t.colors?.[r];
|
|
112
|
+
return p`<rect
|
|
103
113
|
class="void-bar-chart-bar"
|
|
104
|
-
x=${
|
|
105
|
-
y=${
|
|
114
|
+
x=${o}
|
|
115
|
+
y=${c}
|
|
106
116
|
width=${i - 2}
|
|
107
|
-
height=${
|
|
108
|
-
style=${
|
|
117
|
+
height=${l}
|
|
118
|
+
style=${d ? `--series-color: ${d}` : f}
|
|
109
119
|
></rect>`;
|
|
110
120
|
})}
|
|
111
121
|
</g>
|
|
@@ -113,31 +123,44 @@ var m = class extends e {
|
|
|
113
123
|
})}
|
|
114
124
|
|
|
115
125
|
${this.showValue ? e.map((t, n) => {
|
|
116
|
-
let r =
|
|
117
|
-
return
|
|
126
|
+
let r = h.bandwidth / e.length;
|
|
127
|
+
return p`
|
|
118
128
|
<g class="void-bar-chart-values">
|
|
119
129
|
${t.values.map((e, t) => {
|
|
120
|
-
let i = this._display.get(this._key(n, t)) ?? 0, a =
|
|
121
|
-
return
|
|
130
|
+
let i = this._display.get(this._key(n, t)) ?? 0, a = h.scale(t) + r * n + (r - 2) / 2, o = u.scale(i);
|
|
131
|
+
return p`<text x=${a} y=${i < 0 ? o + 14 : o - 6} text-anchor="middle">${y(i)}</text>`;
|
|
122
132
|
})}
|
|
123
133
|
</g>
|
|
124
134
|
`;
|
|
125
|
-
}) :
|
|
135
|
+
}) : f}
|
|
126
136
|
|
|
127
137
|
<g class="void-bar-chart-x-axis">
|
|
128
|
-
${t.slice(0,
|
|
138
|
+
${t.slice(0, r).map((e, t) => p`<text x=${h.scale(t) + h.bandwidth / 2} y=${16 + n + 18} text-anchor="middle">${e}</text>`)}
|
|
129
139
|
</g>
|
|
130
140
|
</svg>
|
|
141
|
+
${this._table()}
|
|
131
142
|
`;
|
|
132
143
|
}
|
|
144
|
+
_table() {
|
|
145
|
+
let e = this._data, t = this.ariaLabel || n(this, "chart.bar");
|
|
146
|
+
return g([
|
|
147
|
+
e,
|
|
148
|
+
t,
|
|
149
|
+
u(this)
|
|
150
|
+
], () => c("void-bar-chart-table", s(this, t, e.series, e.labels ?? [])));
|
|
151
|
+
}
|
|
133
152
|
};
|
|
134
|
-
t([
|
|
153
|
+
t([m({
|
|
135
154
|
type: Number,
|
|
136
155
|
reflect: !0
|
|
137
|
-
})],
|
|
156
|
+
})], x.prototype, "height", void 0), t([m({
|
|
138
157
|
type: Boolean,
|
|
139
158
|
attribute: "show-value",
|
|
140
159
|
reflect: !0
|
|
141
|
-
})],
|
|
160
|
+
})], x.prototype, "showValue", void 0), t([m({ reflect: !0 })], x.prototype, "variant", void 0), t([m({ attribute: "aria-label" })], x.prototype, "ariaLabel", void 0), t([m({
|
|
161
|
+
type: Boolean,
|
|
162
|
+
attribute: "show-table",
|
|
163
|
+
reflect: !0
|
|
164
|
+
})], x.prototype, "showTable", void 0), t([m({ type: Number })], x.prototype, "stagger", void 0), t([m({ attribute: "data" })], x.prototype, "data", null), t([h()], x.prototype, "_phase", void 0), customElements.get("void-bar-chart") || customElements.define("void-bar-chart", x);
|
|
142
165
|
//#endregion
|
|
143
|
-
export {
|
|
166
|
+
export { x as VoidBarChart };
|
|
@@ -20,6 +20,8 @@ export declare class VoidBreadcrumbs extends VoidElement {
|
|
|
20
20
|
/** Writes the list and list-item roles onto the parts: items count only inside the list part. */
|
|
21
21
|
private _wire;
|
|
22
22
|
connectedCallback(): void;
|
|
23
|
+
/** The landmark's name: the author's `aria-label`, else the message. */
|
|
24
|
+
private _name;
|
|
23
25
|
protected updated(changed: Map<string, unknown>): void;
|
|
24
26
|
}
|
|
25
27
|
declare global {
|
|
@@ -1,27 +1,31 @@
|
|
|
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 "../
|
|
4
|
-
import {
|
|
3
|
+
import { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { n as i } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { property as a } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/breadcrumbs.ts
|
|
6
|
-
var
|
|
7
|
+
var o = "void-breadcrumbs-list", s = "void-breadcrumbs-item", c = class extends e {
|
|
7
8
|
constructor(...e) {
|
|
8
|
-
super(...e), this.separator = "/", this._parts = new
|
|
9
|
-
tags: [
|
|
9
|
+
super(...e), this.separator = "/", this._parts = new i(this, {
|
|
10
|
+
tags: [o, s],
|
|
10
11
|
onChange: () => this._wire()
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
_wire() {
|
|
14
|
-
let e = this._parts.one(
|
|
15
|
+
let e = this._parts.one(o);
|
|
15
16
|
e && this._parts.set(e, "role", "list");
|
|
16
|
-
for (let t of this._parts.within(e,
|
|
17
|
+
for (let t of this._parts.within(e, s)) this._parts.set(t, "role", "listitem");
|
|
17
18
|
}
|
|
18
19
|
connectedCallback() {
|
|
19
|
-
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.
|
|
20
|
+
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this._name();
|
|
21
|
+
}
|
|
22
|
+
_name() {
|
|
23
|
+
r(this, n(this, "breadcrumbs.label"), (e, t) => this.setHostAttribute(e, t));
|
|
20
24
|
}
|
|
21
25
|
updated(e) {
|
|
22
|
-
super.updated(e), e.has("separator") && this.setHostStyle("--_void-breadcrumbs-separator", JSON.stringify(this.separator));
|
|
26
|
+
this._name(), super.updated(e), e.has("separator") && this.setHostStyle("--_void-breadcrumbs-separator", JSON.stringify(this.separator));
|
|
23
27
|
}
|
|
24
28
|
};
|
|
25
|
-
t([
|
|
29
|
+
t([a({ type: String })], c.prototype, "separator", void 0), customElements.get("void-breadcrumbs") || customElements.define("void-breadcrumbs", c);
|
|
26
30
|
//#endregion
|
|
27
|
-
export {
|
|
31
|
+
export { c as VoidBreadcrumbs };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { KeyboardActivation } from '../keyboard-activation.js';
|
|
3
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
4
|
/**
|
|
4
5
|
* Action trigger for forms, dialogs, and toolbars; supports semantic color variants.
|
|
5
6
|
*
|
|
@@ -10,6 +11,12 @@ import { KeyboardActivation } from '../keyboard-activation.js';
|
|
|
10
11
|
* disabled); on an inner `<button>` it disables that button.
|
|
11
12
|
*/
|
|
12
13
|
export declare class VoidButton extends VoidElement {
|
|
14
|
+
/** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
15
|
+
keys: KeyOverrides | null;
|
|
16
|
+
/** @internal The actions of this element and their default keys. */
|
|
17
|
+
static readonly keyMap: {
|
|
18
|
+
activate: string[];
|
|
19
|
+
};
|
|
13
20
|
/**
|
|
14
21
|
* Visual weight. `outline` (default) is a bordered button, `filled` is the
|
|
15
22
|
* primary action, and `ghost` draws no border or fill until hovered: use it
|
|
@@ -1,15 +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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { keysConverter as n } from "../keys.js";
|
|
4
|
+
import { t as r } from "../chunks/keyboard-activation-BfEyoaMT.js";
|
|
5
|
+
import { t as i } from "../chunks/activation-B8aBarKd.js";
|
|
6
|
+
import { i as a, r as o } from "../chunks/form-control-fL-Hhy91.js";
|
|
7
|
+
import { property as s } from "lit/decorators.js";
|
|
6
8
|
//#region src/components/button.ts
|
|
7
|
-
var
|
|
9
|
+
var c = class extends e {
|
|
8
10
|
constructor(...e) {
|
|
9
|
-
super(...e), this.variant = "outline", this.color = "default", this.disabled = !1, this.type = "button", this.size = "md", this._unwatch = null, this._inert = null, this._observer = null, this._syncQueued = !1, this._activation = new
|
|
11
|
+
super(...e), this.keys = null, this.variant = "outline", this.color = "default", this.disabled = !1, this.type = "button", this.size = "md", this._unwatch = null, this._inert = null, this._observer = null, this._syncQueued = !1, this._activation = new r(this, {
|
|
10
12
|
disabled: () => this.formDisabled,
|
|
11
|
-
|
|
12
|
-
space: () => !this._control
|
|
13
|
+
when: () => !this._control
|
|
13
14
|
}), this._blockDisabledControl = (e) => {
|
|
14
15
|
e.target === this || !this.formDisabled || !this._control || (e.preventDefault(), e.stopImmediatePropagation());
|
|
15
16
|
}, this._handleClick = (e) => {
|
|
@@ -23,6 +24,9 @@ var o = class extends e {
|
|
|
23
24
|
}));
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
static {
|
|
28
|
+
this.keyMap = i;
|
|
29
|
+
}
|
|
26
30
|
get _control() {
|
|
27
31
|
return this.querySelector(":scope > a[href], :scope > button");
|
|
28
32
|
}
|
|
@@ -30,7 +34,7 @@ var o = class extends e {
|
|
|
30
34
|
return this.closest("form");
|
|
31
35
|
}
|
|
32
36
|
connectedCallback() {
|
|
33
|
-
super.connectedCallback(), this.addEventListener("click", this._handleClick), this.addEventListener("click", this._blockDisabledControl, !0), this._syncDisabledState(this.formDisabled), this._unwatch =
|
|
37
|
+
super.connectedCallback(), this.addEventListener("click", this._handleClick), this.addEventListener("click", this._blockDisabledControl, !0), this._syncDisabledState(this.formDisabled), this._unwatch = a(this, () => this._syncDisabledState(this.formDisabled)), this._observer ??= new MutationObserver((e) => {
|
|
34
38
|
e.some((e) => e.type === "childList" || e.target !== this) && this._requestSync();
|
|
35
39
|
}), this._observer.observe(this, {
|
|
36
40
|
childList: !0,
|
|
@@ -51,7 +55,7 @@ var o = class extends e {
|
|
|
51
55
|
e.has("disabled") && this._syncDisabledState(this.formDisabled);
|
|
52
56
|
}
|
|
53
57
|
get formDisabled() {
|
|
54
|
-
return this.disabled ||
|
|
58
|
+
return this.disabled || o(this);
|
|
55
59
|
}
|
|
56
60
|
_requestSync() {
|
|
57
61
|
this._syncQueued || (this._syncQueued = !0, queueMicrotask(() => {
|
|
@@ -80,21 +84,24 @@ var o = class extends e {
|
|
|
80
84
|
e && (this._inert = null, e.el instanceof HTMLButtonElement ? e.disabled && (e.el.disabled = !1) : (e.aria && e.el.removeAttribute("aria-disabled"), e.tabindex && e.el.removeAttribute("tabindex")));
|
|
81
85
|
}
|
|
82
86
|
};
|
|
83
|
-
t([
|
|
87
|
+
t([s({
|
|
88
|
+
attribute: "keys",
|
|
89
|
+
converter: n
|
|
90
|
+
})], c.prototype, "keys", void 0), t([s({
|
|
84
91
|
type: String,
|
|
85
92
|
reflect: !0
|
|
86
|
-
})],
|
|
93
|
+
})], c.prototype, "variant", void 0), t([s({
|
|
87
94
|
type: String,
|
|
88
95
|
reflect: !0
|
|
89
|
-
})],
|
|
96
|
+
})], c.prototype, "color", void 0), t([s({
|
|
90
97
|
type: Boolean,
|
|
91
98
|
reflect: !0
|
|
92
|
-
})],
|
|
99
|
+
})], c.prototype, "disabled", void 0), t([s({
|
|
93
100
|
type: String,
|
|
94
101
|
reflect: !0
|
|
95
|
-
})],
|
|
102
|
+
})], c.prototype, "type", void 0), t([s({
|
|
96
103
|
type: String,
|
|
97
104
|
reflect: !0
|
|
98
|
-
})],
|
|
105
|
+
})], c.prototype, "size", void 0), customElements.get("void-button") || customElements.define("void-button", c);
|
|
99
106
|
//#endregion
|
|
100
|
-
export {
|
|
107
|
+
export { c as VoidButton };
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
+
import { FormValidityResult } from '../form-control.js';
|
|
2
3
|
import { OverlayController } from '../overlay.js';
|
|
4
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
5
|
declare const VoidCalendar_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
4
6
|
/** Date selection for booking flows, scheduling UIs, and form fields with locale-aware formatting and min/max constraints. */
|
|
5
7
|
export declare class VoidCalendar extends VoidCalendar_base {
|
|
8
|
+
/** Key bindings for this element's actions, as JSON (`{"nextWeek":["ArrowDown","j"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
9
|
+
keys: KeyOverrides | null;
|
|
10
|
+
/** @internal The actions of this element and their default keys. */
|
|
11
|
+
static readonly keyMap: {
|
|
12
|
+
previousDay: string[];
|
|
13
|
+
nextDay: string[];
|
|
14
|
+
previousWeek: string[];
|
|
15
|
+
nextWeek: string[];
|
|
16
|
+
startOfWeek: string[];
|
|
17
|
+
endOfWeek: string[];
|
|
18
|
+
previousMonth: string[];
|
|
19
|
+
nextMonth: string[];
|
|
20
|
+
previousYear: string[];
|
|
21
|
+
nextYear: string[];
|
|
22
|
+
activate: string[];
|
|
23
|
+
};
|
|
6
24
|
/**
|
|
7
25
|
* Selected date as an ISO `YYYY-MM-DD` string. Empty means no selection. It is what the form submits
|
|
8
26
|
* and the reset target; picking a day updates it and fires `void-change`.
|
|
@@ -17,12 +35,21 @@ export declare class VoidCalendar extends VoidCalendar_base {
|
|
|
17
35
|
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
18
36
|
size: 'sm' | 'md' | 'lg';
|
|
19
37
|
/**
|
|
20
|
-
* BCP 47 language tag for month and weekday names and the long date announced for each day, such
|
|
21
|
-
* `de-DE`.
|
|
38
|
+
* BCP 47 language tag for month and weekday names, the numbers and the long date announced for each day, such
|
|
39
|
+
* as `de-DE`. Without it the calendar follows the closest `lang` (the page's included), and `en-US` where there
|
|
40
|
+
* is none. Month and day names are always for the Gregorian calendar.
|
|
22
41
|
*/
|
|
23
42
|
locale: string;
|
|
24
|
-
/**
|
|
25
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Day the week starts on, as a number from 0 (Sunday) to 6 (Saturday). Use 1 for Monday. Without it the week
|
|
45
|
+
* starts on the day the locale's week information gives (`Intl.Locale`), and on Sunday where the browser
|
|
46
|
+
* does not provide it.
|
|
47
|
+
*/
|
|
48
|
+
firstDay: number | null;
|
|
49
|
+
/** The locale the calendar formats in: its `locale`, else the closest `lang`, else `en-US`. */
|
|
50
|
+
private get _locale();
|
|
51
|
+
/** The first day of the week, 0 (Sunday) to 6: `first-day`, else the locale's, else Sunday. */
|
|
52
|
+
private get _week();
|
|
26
53
|
private _viewYear;
|
|
27
54
|
private _viewMonth;
|
|
28
55
|
private _view;
|
|
@@ -30,6 +57,7 @@ export declare class VoidCalendar extends VoidCalendar_base {
|
|
|
30
57
|
private _yearsPageStart;
|
|
31
58
|
private _didInit;
|
|
32
59
|
connectedCallback(): void;
|
|
60
|
+
private _name;
|
|
33
61
|
updated(changed: Map<string, unknown>): void;
|
|
34
62
|
private _initView;
|
|
35
63
|
private _syncViewToValue;
|
|
@@ -37,7 +65,6 @@ export declare class VoidCalendar extends VoidCalendar_base {
|
|
|
37
65
|
private _renderDays;
|
|
38
66
|
private _formatFullDate;
|
|
39
67
|
private _getDayNames;
|
|
40
|
-
private _getMonthName;
|
|
41
68
|
private _buildDayCells;
|
|
42
69
|
private _isOutOfRange;
|
|
43
70
|
private _renderMonths;
|
|
@@ -72,12 +99,26 @@ declare const VoidDatePicker_base: (new (...args: any[]) => import('../form-cont
|
|
|
72
99
|
* field open it with focus on the selected (or current) day. Choosing a day, Escape, or a press outside closes
|
|
73
100
|
* it and focus returns to the input.
|
|
74
101
|
*
|
|
102
|
+
* The field also takes a typed date, in `format` or as ISO `YYYY-MM-DD`: it is read when the field loses focus
|
|
103
|
+
* and on Enter, the calendar follows, and `void-change` fires once with the ISO value. A date that is not a date,
|
|
104
|
+
* or is before `min` or after `max`, is refused: the text stays for correction, `error` explains it, the field
|
|
105
|
+
* is `aria-invalid` and described by the message, and the form is not submitted (`badInput`, `rangeUnderflow` or
|
|
106
|
+
* `rangeOverflow`). An empty field clears the value.
|
|
107
|
+
*
|
|
75
108
|
* @fires {CustomEvent<{ reason: 'trigger' | 'focus' | 'keyboard' | 'api' }>} void-open - The calendar popup
|
|
76
109
|
* opened: `trigger` from the calendar button, `focus` from a click on the field, `keyboard` from a key.
|
|
77
110
|
* @fires {CustomEvent<{ reason: 'trigger' | 'select' | 'escape' | 'outside' | 'blur' | 'parent' | 'api' }>} void-close -
|
|
78
111
|
* The calendar popup is closing. Cancelable when the user caused it.
|
|
79
112
|
*/
|
|
80
113
|
export declare class VoidDatePicker extends VoidDatePicker_base {
|
|
114
|
+
/** Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
115
|
+
keys: KeyOverrides | null;
|
|
116
|
+
/** @internal The actions of this element and their default keys. */
|
|
117
|
+
static readonly keyMap: {
|
|
118
|
+
activate: string[];
|
|
119
|
+
open: string[];
|
|
120
|
+
close: string[];
|
|
121
|
+
};
|
|
81
122
|
/** The host's `aria-label` / `aria-labelledby` name the inner control. */
|
|
82
123
|
static labelTarget: string;
|
|
83
124
|
/**
|
|
@@ -94,23 +135,43 @@ export declare class VoidDatePicker extends VoidDatePicker_base {
|
|
|
94
135
|
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
95
136
|
size: 'sm' | 'md' | 'lg';
|
|
96
137
|
/**
|
|
97
|
-
* BCP 47 language tag for the calendar's month and weekday names, such as `de-DE`.
|
|
98
|
-
* `en-US
|
|
138
|
+
* BCP 47 language tag for the calendar's month and weekday names and numbers, such as `de-DE`. Without it the
|
|
139
|
+
* calendar follows the closest `lang`, and `en-US` where there is none. It does not change `format`.
|
|
99
140
|
*/
|
|
100
141
|
locale: string;
|
|
101
|
-
/** Day the calendar week starts on, as a number from 0 (Sunday
|
|
102
|
-
firstDay: number;
|
|
142
|
+
/** Day the calendar week starts on, as a number from 0 (Sunday) to 6 (Saturday). Without it, the locale's first day of the week, else Sunday. */
|
|
143
|
+
firstDay: number | null;
|
|
103
144
|
/** Whether the calendar dropdown is showing. Clicking the field or button toggles it; Escape closes it. */
|
|
104
145
|
open: boolean;
|
|
105
|
-
/** Hint shown in the field while no date is chosen. Defaults to `Select date
|
|
146
|
+
/** Hint shown in the field while no date is chosen. Defaults to the `datePicker.placeholder` message (English: `Select date`). */
|
|
106
147
|
placeholder: string;
|
|
148
|
+
private get _hint();
|
|
107
149
|
/**
|
|
108
|
-
* How the
|
|
109
|
-
*
|
|
150
|
+
* How the date is written in the field, using `YYYY`, `MM` and `DD`. Defaults to `MM/DD/YYYY`. A date
|
|
151
|
+
* typed into the field is read the same way (and as ISO `YYYY-MM-DD` always); the value stays `YYYY-MM-DD`.
|
|
110
152
|
*/
|
|
111
153
|
format: string;
|
|
112
154
|
/** Status colour of the field: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. */
|
|
113
155
|
color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
|
|
156
|
+
/**
|
|
157
|
+
* Mark the field invalid: it gets the error styling and `aria-invalid`. Set it for a server-side message;
|
|
158
|
+
* the field also sets it itself, with the reason, when a typed date is not taken, and clears what it set
|
|
159
|
+
* once a valid date is typed or picked. A message you set is left alone.
|
|
160
|
+
*/
|
|
161
|
+
error: string;
|
|
162
|
+
/** Text typed and not committed yet; null while the field shows `value`. Survives re-renders and morphs until committed. */
|
|
163
|
+
private _draft;
|
|
164
|
+
/** Why the committed text was refused, as the browser's validity reports it; null when it was taken. */
|
|
165
|
+
private _rejected;
|
|
166
|
+
/** The message this field wrote into `error`, so one the author wrote is told apart from it. */
|
|
167
|
+
private _ownError;
|
|
168
|
+
private readonly _errorId;
|
|
169
|
+
/** The typed text is the field's own to keep: a server patch of `value` discards it, any other morph does not. */
|
|
170
|
+
static clientState: {
|
|
171
|
+
_draft: string;
|
|
172
|
+
};
|
|
173
|
+
/** While focus is inside, a morph does not apply the server's value over the date the user is typing. */
|
|
174
|
+
static editState: string[];
|
|
114
175
|
/** The calendar popup, controlled by the input (APG date picker combobox). */
|
|
115
176
|
private readonly _dropdownId;
|
|
116
177
|
protected readonly _overlay: OverlayController;
|
|
@@ -119,6 +180,18 @@ export declare class VoidDatePicker extends VoidDatePicker_base {
|
|
|
119
180
|
render(): import('lit').TemplateResult<1>;
|
|
120
181
|
private _toggle;
|
|
121
182
|
private _onInputClick;
|
|
183
|
+
/** What the field shows for the committed value. */
|
|
184
|
+
private get _display();
|
|
185
|
+
private _onInput;
|
|
186
|
+
/** Takes the typed text: a date in `format` or ISO sets the value, anything else is refused and kept for correction. */
|
|
187
|
+
private _commit;
|
|
188
|
+
/** The text was taken (or discarded): no refusal, and the error the field wrote itself goes. */
|
|
189
|
+
private _accept;
|
|
190
|
+
/** A date typed in: keeps the calendar in step through `value`, fires `void-change` once, and closes the calendar. */
|
|
191
|
+
private _setTyped;
|
|
192
|
+
protected formValidity(): FormValidityResult | null;
|
|
193
|
+
protected formRestore(state: unknown): void;
|
|
194
|
+
protected willUpdate(changed: Map<string, unknown>): void;
|
|
122
195
|
private _onCalendarChange;
|
|
123
196
|
private _onInputKeydown;
|
|
124
197
|
}
|