@voidable/ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/angular/index.d.ts +2 -2
- package/dist/angular/index.js +2 -1
- package/dist/chunks/activation-B8aBarKd.js +4 -0
- package/dist/chunks/carousel-C9u0bg5l.js +10 -0
- package/dist/chunks/choice-BTrsi7OW.js +16 -0
- package/dist/chunks/data-Baycjoo4.js +96 -0
- package/dist/chunks/fields-MEqz-olE.js +21 -0
- package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
- package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
- package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
- package/dist/chunks/menu-CxRRgkJI.js +21 -0
- package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
- package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
- package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
- package/dist/chunks/overlay-K1ilWC1p.js +4 -0
- package/dist/chunks/pickers-CjlFgNke.js +36 -0
- package/dist/chunks/table-BBpqwWEi.js +4 -0
- package/dist/chunks/tabs-Buf3EBWq.js +10 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +22 -14
- package/dist/components/action-input.d.ts +2 -1
- package/dist/components/action-input.js +59 -55
- package/dist/components/bar-chart.js +41 -40
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +15 -11
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +23 -16
- package/dist/components/calendar.d.ts +45 -10
- package/dist/components/calendar.js +183 -129
- package/dist/components/carousel.d.ts +22 -0
- package/dist/components/carousel.js +64 -35
- package/dist/components/charts/data.d.ts +2 -2
- package/dist/components/checkbox-group.js +22 -21
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +29 -24
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.js +19 -11
- package/dist/components/color-picker.js +28 -27
- package/dist/components/combobox.d.ts +13 -1
- package/dist/components/combobox.js +54 -41
- package/dist/components/compose-input.d.ts +9 -1
- package/dist/components/compose-input.js +28 -16
- package/dist/components/dialog.js +1 -1
- package/dist/components/donut-chart.js +57 -56
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +54 -39
- package/dist/components/editable.d.ts +11 -1
- package/dist/components/editable.js +35 -22
- package/dist/components/error-fallback.d.ts +4 -2
- package/dist/components/error-fallback.js +34 -28
- package/dist/components/file-upload.d.ts +9 -0
- package/dist/components/file-upload.js +54 -28
- package/dist/components/gauge.js +108 -107
- package/dist/components/hamburger.d.ts +7 -0
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.js +22 -14
- package/dist/components/indicator.js +15 -14
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.js +43 -42
- package/dist/components/menu.d.ts +25 -0
- package/dist/components/menu.js +55 -33
- package/dist/components/multiselect.d.ts +17 -1
- package/dist/components/multiselect.js +96 -74
- package/dist/components/nav-menu.d.ts +9 -0
- package/dist/components/nav-menu.js +30 -23
- package/dist/components/number-input.d.ts +15 -1
- package/dist/components/number-input.js +71 -37
- package/dist/components/pagination.js +25 -24
- package/dist/components/pin-input.d.ts +11 -0
- package/dist/components/pin-input.js +46 -32
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +21 -13
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.d.ts +10 -1
- package/dist/components/radio.js +37 -32
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.js +40 -28
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +14 -10
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +5 -3
- package/dist/components/spinner.js +21 -14
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.d.ts +2 -2
- package/dist/components/status-dot.js +12 -14
- package/dist/components/stepper.d.ts +2 -0
- package/dist/components/stepper.js +20 -13
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +24 -16
- package/dist/components/table.d.ts +77 -1
- package/dist/components/table.js +562 -73
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +42 -33
- package/dist/components/tag.js +12 -11
- package/dist/components/tags-input.d.ts +10 -1
- package/dist/components/tags-input.js +42 -30
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +35 -28
- package/dist/components/toggle-group.d.ts +8 -0
- package/dist/components/toggle-group.js +24 -17
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +23 -15
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +20 -12
- package/dist/components.json +96 -74
- package/dist/custom-elements.json +4213 -131
- package/dist/dev/rules.d.ts +0 -1
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +244 -113
- package/dist/index.d.ts +4 -0
- package/dist/index.js +68 -66
- package/dist/keyboard-activation.d.ts +9 -9
- package/dist/keyboard.d.ts +2 -10
- package/dist/keymaps/activation.d.ts +8 -0
- package/dist/keymaps/carousel.d.ts +9 -0
- package/dist/keymaps/choice.d.ts +21 -0
- package/dist/keymaps/fields.d.ts +31 -0
- package/dist/keymaps/index.d.ts +2 -0
- package/dist/keymaps/menu.d.ts +36 -0
- package/dist/keymaps/nav-menu.d.ts +11 -0
- package/dist/keymaps/overlay.d.ts +4 -0
- package/dist/keymaps/pickers.d.ts +36 -0
- package/dist/keymaps/table.d.ts +8 -0
- package/dist/keymaps/tabs.d.ts +7 -0
- package/dist/keymaps.js +51 -0
- package/dist/keys.d.ts +46 -0
- package/dist/keys.js +57 -0
- package/dist/llms.txt +11 -3
- package/dist/messages/ar.d.ts +1 -0
- package/dist/messages/ar.js +130 -0
- package/dist/messages/fr.d.ts +1 -0
- package/dist/messages/fr.js +109 -0
- package/dist/messages.d.ts +213 -0
- package/dist/messages.js +190 -0
- package/dist/modal.d.ts +7 -0
- package/dist/reference.md +817 -17
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing.js +79 -0
- package/dist/types/elements.d.ts +89 -73
- package/dist/types/react.d.ts +5 -1
- package/dist/types/solid.d.ts +5 -1
- package/dist/types/solid2.d.ts +4 -0
- package/dist/types/svelte.d.ts +5 -1
- package/dist/types/vue.d.ts +5 -1
- package/dist/vscode.html-custom-data.json +384 -18
- package/dist/web-types.json +830 -69
- package/package.json +22 -2
- package/dist/chunks/data-BpiiNapL.js +0 -95
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { keysConverter as n } from "../keys.js";
|
|
4
|
+
import { i as r, n as i } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { t as a } from "../chunks/overlay-BuV-4Yvt.js";
|
|
6
|
+
import { t as o } from "../chunks/overlay-K1ilWC1p.js";
|
|
7
|
+
import { property as s } from "lit/decorators.js";
|
|
6
8
|
//#region src/components/hover-card.ts
|
|
7
|
-
var
|
|
9
|
+
var c = class extends e {
|
|
8
10
|
constructor(...e) {
|
|
9
|
-
super(...e), this.open = !1, this.side = "bottom", this.align = "center", this.openDelay = 300, this.closeDelay = 300, this._parts = new
|
|
11
|
+
super(...e), this.keys = null, this.open = !1, this.side = "bottom", this.align = "center", this.openDelay = 300, this.closeDelay = 300, this._parts = new i(this, {
|
|
10
12
|
tags: ["void-hover-card-trigger", "void-hover-card-content"],
|
|
11
13
|
onChange: () => {
|
|
12
14
|
this._wire(), this.requestUpdate();
|
|
13
15
|
}
|
|
14
|
-
}), this._overlay = new
|
|
16
|
+
}), this._overlay = new a(this, {
|
|
15
17
|
kind: "hover",
|
|
16
18
|
surface: () => this._parts.one("void-hover-card-content"),
|
|
17
19
|
isOpen: () => this.open,
|
|
18
20
|
setOpen: (e) => {
|
|
19
21
|
this.open = e;
|
|
20
22
|
},
|
|
21
|
-
trigger: () =>
|
|
23
|
+
trigger: () => r(this._parts.one("void-hover-card-trigger")),
|
|
22
24
|
anchor: () => this,
|
|
23
25
|
hostStyle: (e, t) => this.setHostStyle(e, t),
|
|
24
26
|
placement: () => ({
|
|
@@ -57,6 +59,9 @@ var o = class extends e {
|
|
|
57
59
|
t && this.contains(t) || (this._dismissed = !1, this._scheduleClose("blur"));
|
|
58
60
|
};
|
|
59
61
|
}
|
|
62
|
+
static {
|
|
63
|
+
this.keyMap = o;
|
|
64
|
+
}
|
|
60
65
|
_wire() {
|
|
61
66
|
let e = this._parts.one("void-hover-card-content");
|
|
62
67
|
e && (this._parts.set(e, "popover", "manual"), this._parts.id(e, "void-hover-card-content"));
|
|
@@ -77,21 +82,24 @@ var o = class extends e {
|
|
|
77
82
|
}, this.closeDelay);
|
|
78
83
|
}
|
|
79
84
|
};
|
|
80
|
-
t([
|
|
85
|
+
t([s({
|
|
86
|
+
attribute: "keys",
|
|
87
|
+
converter: n
|
|
88
|
+
})], c.prototype, "keys", void 0), t([s({
|
|
81
89
|
type: Boolean,
|
|
82
90
|
reflect: !0
|
|
83
|
-
})],
|
|
91
|
+
})], c.prototype, "open", void 0), t([s({
|
|
84
92
|
type: String,
|
|
85
93
|
reflect: !0
|
|
86
|
-
})],
|
|
94
|
+
})], c.prototype, "side", void 0), t([s({
|
|
87
95
|
type: String,
|
|
88
96
|
reflect: !0
|
|
89
|
-
})],
|
|
97
|
+
})], c.prototype, "align", void 0), t([s({
|
|
90
98
|
type: Number,
|
|
91
99
|
attribute: "open-delay"
|
|
92
|
-
})],
|
|
100
|
+
})], c.prototype, "openDelay", void 0), t([s({
|
|
93
101
|
type: Number,
|
|
94
102
|
attribute: "close-delay"
|
|
95
|
-
})],
|
|
103
|
+
})], c.prototype, "closeDelay", void 0), customElements.get("void-hover-card") || customElements.define("void-hover-card", c);
|
|
96
104
|
//#endregion
|
|
97
|
-
export {
|
|
105
|
+
export { c as VoidHoverCard };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { msg as n, nameHost as r } from "../messages.js";
|
|
4
|
+
import { r as i } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { html as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators.js";
|
|
6
7
|
//#region src/components/indicator.ts
|
|
7
|
-
|
|
8
|
-
var
|
|
8
|
+
i();
|
|
9
|
+
var s = class extends e {
|
|
9
10
|
constructor(...e) {
|
|
10
11
|
super(...e), this.color = "default", this.placement = "top-right", this.count = null, this.ping = !1, this.size = "md";
|
|
11
12
|
}
|
|
@@ -13,27 +14,27 @@ var a = class extends e {
|
|
|
13
14
|
super.connectedCallback(), this.setHostAttribute("role", "status");
|
|
14
15
|
}
|
|
15
16
|
updated() {
|
|
16
|
-
this
|
|
17
|
+
r(this, this.count == null ? n(this, "indicator.label") : n(this, "indicator.count", { count: this.count }), (e, t) => this.setHostAttribute(e, t));
|
|
17
18
|
}
|
|
18
19
|
render() {
|
|
19
|
-
return
|
|
20
|
+
return a`<span class="void-indicator-dot">${this.count == null ? "" : String(this.count)}</span>`;
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
|
-
t([
|
|
23
|
+
t([o({
|
|
23
24
|
type: String,
|
|
24
25
|
reflect: !0
|
|
25
|
-
})],
|
|
26
|
+
})], s.prototype, "color", void 0), t([o({
|
|
26
27
|
type: String,
|
|
27
28
|
reflect: !0
|
|
28
|
-
})],
|
|
29
|
+
})], s.prototype, "placement", void 0), t([o({
|
|
29
30
|
type: Number,
|
|
30
31
|
reflect: !0
|
|
31
|
-
})],
|
|
32
|
+
})], s.prototype, "count", void 0), t([o({
|
|
32
33
|
type: Boolean,
|
|
33
34
|
reflect: !0
|
|
34
|
-
})],
|
|
35
|
+
})], s.prototype, "ping", void 0), t([o({
|
|
35
36
|
type: String,
|
|
36
37
|
reflect: !0
|
|
37
|
-
})],
|
|
38
|
+
})], s.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", s);
|
|
38
39
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
+
export { s as VoidIndicator };
|
package/dist/components/input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/form-control-
|
|
3
|
+
import { n } from "../chunks/form-control-fL-Hhy91.js";
|
|
4
4
|
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
5
|
import { n as i, t as a } from "../chunks/secret-value-CmTtVkMg.js";
|
|
6
6
|
import { html as o, nothing as s } from "lit";
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { msg as n } from "../messages.js";
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { n as i } from "../chunks/scale-_ccSuoYg.js";
|
|
6
|
+
import { a, c as o, n as s, o as c, t as l } from "../chunks/data-Baycjoo4.js";
|
|
7
|
+
import { a as u, i as d, n as f, r as p } from "../chunks/shape-C_LW7EjG.js";
|
|
8
|
+
import { html as m, nothing as h, svg as g } from "lit";
|
|
9
|
+
import { property as _, state as v } from "lit/decorators.js";
|
|
10
|
+
import { guard as y } from "lit/directives/guard.js";
|
|
10
11
|
//#region src/components/line-chart.ts
|
|
11
|
-
|
|
12
|
-
function
|
|
12
|
+
r();
|
|
13
|
+
function b(e) {
|
|
13
14
|
return 1 - (1 - e) ** 3;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function x(e) {
|
|
16
17
|
return e === 0 ? "0" : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(1);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function S(e) {
|
|
19
20
|
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function C(e) {
|
|
22
23
|
if (e <= 0) return 1;
|
|
23
24
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
24
25
|
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
+
var w = class extends e {
|
|
27
28
|
constructor(...e) {
|
|
28
29
|
super(...e), this.height = 220, this.showValue = !1, this.variant = "outline", this.interpolation = "linear", this.ariaLabel = "", this.showTable = !1, 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._rafHandle = 0, this._reveal = 0, this._revealFrom = 0, this._hoverIndex = null, this._tick = (e) => {
|
|
29
|
-
let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r =
|
|
30
|
+
let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r = b(n);
|
|
30
31
|
this._reveal = this._revealFrom + (1 - this._revealFrom) * r;
|
|
31
32
|
for (let [e, t] of this._targets) {
|
|
32
33
|
let n = this._animFrom.get(e) ?? 0;
|
|
@@ -55,11 +56,11 @@ var C = class extends e {
|
|
|
55
56
|
return this._data;
|
|
56
57
|
}
|
|
57
58
|
set data(e) {
|
|
58
|
-
let t =
|
|
59
|
+
let t = c(e, this._source, {
|
|
59
60
|
attr: "data",
|
|
60
61
|
shape: "{\"series\":[{\"name\":\"Visitors\",\"values\":[3,5,4]}],\"labels\":[\"Mon\",\"Tue\",\"Wed\"]}",
|
|
61
62
|
empty: () => ({ series: [] }),
|
|
62
|
-
normalize:
|
|
63
|
+
normalize: a,
|
|
63
64
|
warn: (e, t) => this.reportDev("invalid-data", e, t)
|
|
64
65
|
});
|
|
65
66
|
if (!t) return;
|
|
@@ -93,8 +94,8 @@ var C = class extends e {
|
|
|
93
94
|
}
|
|
94
95
|
render() {
|
|
95
96
|
let { series: e, labels: t = [] } = this._data;
|
|
96
|
-
if (e.length === 0) return
|
|
97
|
-
let n = this.height - 16 - 32,
|
|
97
|
+
if (e.length === 0) return m`<svg viewBox="0 0 600 ${this.height}" aria-hidden="true"></svg>`;
|
|
98
|
+
let n = this.height - 16 - 32, r = Math.max(...e.map((e) => e.values.length)), a = e.flatMap((e) => e.values).filter(Number.isFinite), o = C(Math.max(...a, 0) * 1.1) || 1, s = new i([0, Math.max(0, r - 1)], [40, 584]), c = new i([0, o], [16 + n, 16]), l = c.ticks(5), _ = 16 + n, v = getComputedStyle(this), y = (parseFloat(v.getPropertyValue("--void-radius-sm")) || 0) > 0 && this.interpolation === "linear", b = y ? u : p, w = y ? d : f, T = e.map((e, t) => {
|
|
98
99
|
let n = [];
|
|
99
100
|
for (let r = 0; r < e.values.length; r++) {
|
|
100
101
|
let e = this._display.get(this._key(t, r)) ?? 0;
|
|
@@ -107,7 +108,7 @@ var C = class extends e {
|
|
|
107
108
|
}
|
|
108
109
|
return n;
|
|
109
110
|
});
|
|
110
|
-
return
|
|
111
|
+
return m`
|
|
111
112
|
<svg
|
|
112
113
|
viewBox="0 0 ${600} ${this.height}"
|
|
113
114
|
preserveAspectRatio="none"
|
|
@@ -116,51 +117,51 @@ var C = class extends e {
|
|
|
116
117
|
style="--reveal: ${this._reveal}"
|
|
117
118
|
>
|
|
118
119
|
<g class="void-line-chart-grid">
|
|
119
|
-
${
|
|
120
|
+
${l.map((e) => {
|
|
120
121
|
let t = c.scale(e);
|
|
121
|
-
return
|
|
122
|
+
return g`<line x1=${40} x2=${584} y1=${t} y2=${t}></line>`;
|
|
122
123
|
})}
|
|
123
124
|
</g>
|
|
124
125
|
|
|
125
126
|
<g class="void-line-chart-y-axis">
|
|
126
|
-
${
|
|
127
|
+
${l.map((e) => g`<text x=${32} y=${c.scale(e)} dy="0.32em" text-anchor="end">${x(e)}</text>`)}
|
|
127
128
|
</g>
|
|
128
129
|
|
|
129
130
|
${e.map((e, t) => {
|
|
130
131
|
let n = e.color ?? `var(--void-chart-series-${t % 6 + 1})`, r = T[t];
|
|
131
|
-
return
|
|
132
|
+
return g`
|
|
132
133
|
<g class="void-line-chart-series" style="--series-color: ${n}">
|
|
133
134
|
<path class="void-line-chart-area" d=${w(r, _)}></path>
|
|
134
|
-
<path class="void-line-chart-line" d=${
|
|
135
|
+
<path class="void-line-chart-line" d=${b(r)}></path>
|
|
135
136
|
</g>
|
|
136
137
|
`;
|
|
137
138
|
})}
|
|
138
139
|
|
|
139
|
-
${this.showValue ? e.map((e, t) =>
|
|
140
|
+
${this.showValue ? e.map((e, t) => g`
|
|
140
141
|
<g class="void-line-chart-values">
|
|
141
142
|
${e.values.map((e, n) => {
|
|
142
143
|
let r = this._display.get(this._key(t, n)) ?? 0;
|
|
143
|
-
return
|
|
144
|
+
return g`<text x=${s.scale(n)} y=${c.scale(r) - 8} text-anchor="middle">${S(r)}</text>`;
|
|
144
145
|
})}
|
|
145
146
|
</g>
|
|
146
|
-
`) :
|
|
147
|
+
`) : h}
|
|
147
148
|
|
|
148
149
|
<g class="void-line-chart-x-axis">
|
|
149
|
-
${t.slice(0,
|
|
150
|
+
${t.slice(0, r).map((e, t) => g`<text x=${s.scale(t)} y=${16 + n + 18} text-anchor="middle">${e}</text>`)}
|
|
150
151
|
</g>
|
|
151
152
|
|
|
152
|
-
${this._hoverIndex !== null && this._hoverIndex <
|
|
153
|
+
${this._hoverIndex !== null && this._hoverIndex < r ? this._renderHover(e, t, s, c, this._hoverIndex, 16, n, 40, 544) : h}
|
|
153
154
|
</svg>
|
|
154
155
|
${this._table()}
|
|
155
156
|
`;
|
|
156
157
|
}
|
|
157
158
|
_table() {
|
|
158
|
-
let e = this._data, t = this.ariaLabel || "
|
|
159
|
-
return
|
|
159
|
+
let e = this._data, t = this.ariaLabel || n(this, "chart.line");
|
|
160
|
+
return y([
|
|
160
161
|
e,
|
|
161
162
|
t,
|
|
162
|
-
|
|
163
|
-
], () =>
|
|
163
|
+
l(this)
|
|
164
|
+
], () => s("void-line-chart-table", o(this, t, e.series, e.labels ?? [])));
|
|
164
165
|
}
|
|
165
166
|
_renderHover(e, t, n, r, i, a, o, s, c) {
|
|
166
167
|
let l = n.scale(i), u = e.map((e, t) => {
|
|
@@ -172,14 +173,14 @@ var C = class extends e {
|
|
|
172
173
|
y: r.scale(n)
|
|
173
174
|
};
|
|
174
175
|
}), d = 16 + u.length * 14 + 16, f = l + 12 + 140 > s + c ? l - 12 - 140 : l + 12, p = Math.max(a, Math.min(a + o - d, a + 8)), m = t[i] ?? String(i);
|
|
175
|
-
return
|
|
176
|
+
return g`
|
|
176
177
|
<g class="void-line-chart-hover">
|
|
177
178
|
<line
|
|
178
179
|
class="void-line-chart-hairline"
|
|
179
180
|
x1=${l} x2=${l}
|
|
180
181
|
y1=${a} y2=${a + o}
|
|
181
182
|
></line>
|
|
182
|
-
${u.map((e) =>
|
|
183
|
+
${u.map((e) => g`
|
|
183
184
|
<rect
|
|
184
185
|
class="void-line-chart-marker"
|
|
185
186
|
x=${l - 5} y=${e.y - 5}
|
|
@@ -198,7 +199,7 @@ var C = class extends e {
|
|
|
198
199
|
x=${f + 8}
|
|
199
200
|
y=${p + 8 + 10}
|
|
200
201
|
>${m}</text>
|
|
201
|
-
${u.map((e, t) =>
|
|
202
|
+
${u.map((e, t) => g`
|
|
202
203
|
<circle
|
|
203
204
|
class="void-line-chart-tooltip-swatch"
|
|
204
205
|
cx=${f + 8 + 5}
|
|
@@ -216,23 +217,23 @@ var C = class extends e {
|
|
|
216
217
|
x=${f + 140 - 8}
|
|
217
218
|
y=${p + 16 + 8 + t * 14 + 8}
|
|
218
219
|
text-anchor="end"
|
|
219
|
-
>${
|
|
220
|
+
>${S(e.value)}</text>
|
|
220
221
|
`)}
|
|
221
222
|
</g>
|
|
222
223
|
`;
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
|
-
t([
|
|
226
|
+
t([_({
|
|
226
227
|
type: Number,
|
|
227
228
|
reflect: !0
|
|
228
|
-
})],
|
|
229
|
+
})], w.prototype, "height", void 0), t([_({
|
|
229
230
|
type: Boolean,
|
|
230
231
|
attribute: "show-value",
|
|
231
232
|
reflect: !0
|
|
232
|
-
})],
|
|
233
|
+
})], w.prototype, "showValue", void 0), t([_({ reflect: !0 })], w.prototype, "variant", void 0), t([_({ reflect: !0 })], w.prototype, "interpolation", void 0), t([_({ attribute: "aria-label" })], w.prototype, "ariaLabel", void 0), t([_({
|
|
233
234
|
type: Boolean,
|
|
234
235
|
attribute: "show-table",
|
|
235
236
|
reflect: !0
|
|
236
|
-
})],
|
|
237
|
+
})], w.prototype, "showTable", void 0), t([_({ attribute: "data" })], w.prototype, "data", null), t([v()], w.prototype, "_phase", void 0), t([v()], w.prototype, "_hoverIndex", void 0), customElements.get("void-line-chart") || customElements.define("void-line-chart", w);
|
|
237
238
|
//#endregion
|
|
238
|
-
export {
|
|
239
|
+
export { w as VoidLineChart };
|
|
@@ -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
|
import { PartsController } from '../parts.js';
|
|
4
5
|
/**
|
|
5
6
|
* Always-visible menu panel for command palettes, side panels, and searchable action lists.
|
|
@@ -18,6 +19,17 @@ import { PartsController } from '../parts.js';
|
|
|
18
19
|
* field), Enter or Space activate the item (`void-select`), Escape closes the menu.
|
|
19
20
|
*/
|
|
20
21
|
export declare class VoidMenu extends VoidElement {
|
|
22
|
+
/** Key bindings for this element's actions, as JSON (`{"close":[]}`); `[]` switches an action off. See the keyboard guide. */
|
|
23
|
+
keys: KeyOverrides | null;
|
|
24
|
+
/** @internal The actions of this element and their default keys. */
|
|
25
|
+
static readonly keyMap: {
|
|
26
|
+
next: string[];
|
|
27
|
+
previous: string[];
|
|
28
|
+
first: string[];
|
|
29
|
+
last: string[];
|
|
30
|
+
typeahead: string[];
|
|
31
|
+
close: string[];
|
|
32
|
+
};
|
|
21
33
|
/**
|
|
22
34
|
* Whether the menu is shown. It starts hidden: add `open` to show it (the menu has no trigger of its own).
|
|
23
35
|
* Escape sets it back to false.
|
|
@@ -34,6 +46,13 @@ export declare class VoidMenu extends VoidElement {
|
|
|
34
46
|
private _items;
|
|
35
47
|
/** Items that can take focus: enabled and not filtered out, in document order. */
|
|
36
48
|
private get _focusableItems();
|
|
49
|
+
/** The name the component last wrote on the content part. */
|
|
50
|
+
private _named;
|
|
51
|
+
/**
|
|
52
|
+
* Names the content (the author's own `aria-label` on the menu or on the part wins) and writes the empty-state
|
|
53
|
+
* text the theme draws, both in the language of the element.
|
|
54
|
+
*/
|
|
55
|
+
private _text;
|
|
37
56
|
/** Names the content, links the search field to it and applies the current search. Idempotent. */
|
|
38
57
|
private _wire;
|
|
39
58
|
connectedCallback(): void;
|
|
@@ -61,6 +80,12 @@ export declare class VoidMenu extends VoidElement {
|
|
|
61
80
|
* @fires {CustomEvent<{ item: VoidMenuItem; value: string }>} void-select - The item was chosen.
|
|
62
81
|
*/
|
|
63
82
|
export declare class VoidMenuItem extends VoidElement {
|
|
83
|
+
/** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
84
|
+
keys: KeyOverrides | null;
|
|
85
|
+
/** @internal The actions of this element and their default keys. */
|
|
86
|
+
static readonly keyMap: {
|
|
87
|
+
activate: string[];
|
|
88
|
+
};
|
|
64
89
|
/** Enter and Space fire a real `click`, as on a native button. */
|
|
65
90
|
protected readonly _activation: KeyboardActivation;
|
|
66
91
|
/**
|
package/dist/components/menu.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { t as i } from "../chunks/keyboard-activation-BfEyoaMT.js";
|
|
5
|
+
import { t as a } from "../chunks/activation-B8aBarKd.js";
|
|
6
|
+
import { msg as o } from "../messages.js";
|
|
7
|
+
import { n as s } from "../chunks/parts-DI_3VpSy.js";
|
|
8
|
+
import { r as c, t as l } from "../chunks/keyboard-ChtDvhB_.js";
|
|
9
|
+
import { i as u } from "../chunks/menu-CxRRgkJI.js";
|
|
10
|
+
import { property as d } from "lit/decorators.js";
|
|
7
11
|
//#region src/components/menu.ts
|
|
8
|
-
var
|
|
12
|
+
var f = class extends e {
|
|
9
13
|
constructor(...e) {
|
|
10
|
-
super(...e), this.open = !1, this.size = "md", this._query = "", this._parts = new
|
|
14
|
+
super(...e), this.keys = null, this.open = !1, this.size = "md", this._query = "", this._parts = new s(this, {
|
|
11
15
|
tags: [
|
|
12
16
|
"void-menu-search",
|
|
13
17
|
"void-menu-content",
|
|
@@ -16,33 +20,35 @@ var c = class extends e {
|
|
|
16
20
|
"void-menu-item"
|
|
17
21
|
],
|
|
18
22
|
onChange: () => this._wire()
|
|
19
|
-
}), this._typeahead = new
|
|
23
|
+
}), this._typeahead = new l(), this._observer = null, this._named = null, this._handleFocusIn = (e) => {
|
|
20
24
|
let t = e.target.closest("void-menu-item");
|
|
21
25
|
t && this._parts.owns(t) && this._syncTabStop(t);
|
|
22
26
|
}, this._handleKeydown = (e) => {
|
|
23
27
|
if (!this.open) return;
|
|
24
|
-
let t = e.target;
|
|
25
|
-
if (
|
|
28
|
+
let t = e.target, r = n(this, e);
|
|
29
|
+
if (r === "close") {
|
|
26
30
|
e.preventDefault(), e.stopPropagation(), this.open = !1, this._clearSearch();
|
|
27
31
|
return;
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
else if (
|
|
33
|
-
else if (
|
|
34
|
-
else if (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
t >= 0 && (e.preventDefault(), n[t].focus());
|
|
33
|
+
let i = this._focusableItems, a = this._inSearch(t), o = i.indexOf(t.closest("void-menu-item")), s = i.map(() => !1), l = this._searchInput(), u;
|
|
34
|
+
if (r === "next") u = a || o < 0 ? i[0] : i[c(s, o, 1)];
|
|
35
|
+
else if (r === "previous") u = l && o === 0 ? l : a || o < 0 ? i[i.length - 1] : i[c(s, o, -1)];
|
|
36
|
+
else if (r === "first" && !a) u = i[0];
|
|
37
|
+
else if (r === "last" && !a) u = i[i.length - 1];
|
|
38
|
+
else if (r === "typeahead" && !a && o >= 0 && e.key !== " ") {
|
|
39
|
+
let t = this._typeahead.match(e.key, i.map((e) => e.textContent ?? ""), s, o);
|
|
40
|
+
t >= 0 && (e.preventDefault(), i[t].focus());
|
|
38
41
|
return;
|
|
39
42
|
} else return;
|
|
40
|
-
e.preventDefault(),
|
|
43
|
+
e.preventDefault(), u?.focus();
|
|
41
44
|
}, this._onInput = (e) => {
|
|
42
45
|
let t = e.target;
|
|
43
46
|
this._inSearch(t) && (this._query = t.value, this._parts.sync());
|
|
44
47
|
};
|
|
45
48
|
}
|
|
49
|
+
static {
|
|
50
|
+
this.keyMap = u;
|
|
51
|
+
}
|
|
46
52
|
_searchInput() {
|
|
47
53
|
return this._parts.one("void-menu-search")?.querySelector("input") ?? null;
|
|
48
54
|
}
|
|
@@ -52,10 +58,17 @@ var c = class extends e {
|
|
|
52
58
|
get _focusableItems() {
|
|
53
59
|
return this._items().filter((e) => !e.disabled && !e.closest("[hidden]"));
|
|
54
60
|
}
|
|
61
|
+
_text(e = this._parts.one("void-menu-content")) {
|
|
62
|
+
if (e) {
|
|
63
|
+
let t = this.getAttribute("aria-label") || o(this, "menu.label"), n = e.getAttribute("aria-label");
|
|
64
|
+
(n === null || n === this._named) && (this._parts.set(e, "aria-label", t), this._named = t);
|
|
65
|
+
}
|
|
66
|
+
this.setHostStyle("--_void-menu-empty", JSON.stringify(o(this, "menu.empty")));
|
|
67
|
+
}
|
|
55
68
|
_wire() {
|
|
56
69
|
let e = this._parts.one("void-menu-content");
|
|
57
70
|
if (e) {
|
|
58
|
-
this._parts.provide(e, "role", "menu"), this.
|
|
71
|
+
this._parts.provide(e, "role", "menu"), this._text(e);
|
|
59
72
|
let t = this._searchInput();
|
|
60
73
|
t && this._parts.set(t, "aria-controls", this._parts.id(e, "void-menu-content"));
|
|
61
74
|
}
|
|
@@ -73,7 +86,7 @@ var c = class extends e {
|
|
|
73
86
|
super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown), this.removeEventListener("focusin", this._handleFocusIn), this.removeEventListener("input", this._onInput), this._observer?.disconnect(), this._typeahead.reset();
|
|
74
87
|
}
|
|
75
88
|
updated(e) {
|
|
76
|
-
super.updated(e), this._syncTabStop(), e.has("open") && this.open && requestAnimationFrame(() => this._searchInput()?.focus());
|
|
89
|
+
super.updated(e), this._text(), this._syncTabStop(), e.has("open") && this.open && requestAnimationFrame(() => this._searchInput()?.focus());
|
|
77
90
|
}
|
|
78
91
|
_syncTabStop(e) {
|
|
79
92
|
let t = this._focusableItems, n = e && t.includes(e) ? e : t.find((e) => e.getAttribute("tabindex") === "0") ?? t[0];
|
|
@@ -99,16 +112,19 @@ var c = class extends e {
|
|
|
99
112
|
e && (e.value = ""), this._parts.sync();
|
|
100
113
|
}
|
|
101
114
|
};
|
|
102
|
-
t([
|
|
115
|
+
t([d({
|
|
116
|
+
attribute: "keys",
|
|
117
|
+
converter: r
|
|
118
|
+
})], f.prototype, "keys", void 0), t([d({
|
|
103
119
|
type: Boolean,
|
|
104
120
|
reflect: !0
|
|
105
|
-
})],
|
|
121
|
+
})], f.prototype, "open", void 0), t([d({
|
|
106
122
|
type: String,
|
|
107
123
|
reflect: !0
|
|
108
|
-
})],
|
|
109
|
-
var
|
|
124
|
+
})], f.prototype, "size", void 0), customElements.get("void-menu") || customElements.define("void-menu", f);
|
|
125
|
+
var p = class extends e {
|
|
110
126
|
constructor(...e) {
|
|
111
|
-
super(...e), this._activation = new
|
|
127
|
+
super(...e), this.keys = null, this._activation = new i(this, { disabled: () => this.disabled }), this.value = "", this.disabled = !1, this._handleClick = (e) => {
|
|
112
128
|
if (this.disabled) {
|
|
113
129
|
e.stopImmediatePropagation();
|
|
114
130
|
return;
|
|
@@ -123,6 +139,9 @@ var l = class extends e {
|
|
|
123
139
|
}));
|
|
124
140
|
};
|
|
125
141
|
}
|
|
142
|
+
static {
|
|
143
|
+
this.keyMap = a;
|
|
144
|
+
}
|
|
126
145
|
connectedCallback() {
|
|
127
146
|
super.connectedCallback(), this.setHostAttribute("role", "menuitem"), this.setHostAttribute("tabindex", "-1"), this.addEventListener("click", this._handleClick);
|
|
128
147
|
}
|
|
@@ -136,16 +155,19 @@ var l = class extends e {
|
|
|
136
155
|
this.setHostAttribute("tabindex", e && !this.disabled ? "0" : "-1");
|
|
137
156
|
}
|
|
138
157
|
};
|
|
139
|
-
t([
|
|
158
|
+
t([d({
|
|
159
|
+
attribute: "keys",
|
|
160
|
+
converter: r
|
|
161
|
+
})], p.prototype, "keys", void 0), t([d({
|
|
140
162
|
type: String,
|
|
141
163
|
reflect: !0
|
|
142
|
-
})],
|
|
164
|
+
})], p.prototype, "value", void 0), t([d({
|
|
143
165
|
type: Boolean,
|
|
144
166
|
reflect: !0
|
|
145
|
-
})],
|
|
146
|
-
var
|
|
167
|
+
})], p.prototype, "disabled", void 0), customElements.get("void-menu-item") || customElements.define("void-menu-item", p);
|
|
168
|
+
var m = class extends e {
|
|
147
169
|
constructor(...e) {
|
|
148
|
-
super(...e), this._parts = new
|
|
170
|
+
super(...e), this._parts = new s(this, {
|
|
149
171
|
tags: ["void-menu-group-label"],
|
|
150
172
|
onChange: () => this._wire()
|
|
151
173
|
});
|
|
@@ -158,6 +180,6 @@ var u = class extends e {
|
|
|
158
180
|
super.connectedCallback(), this.setHostAttribute("role", "group");
|
|
159
181
|
}
|
|
160
182
|
};
|
|
161
|
-
customElements.get("void-menu-group") || customElements.define("void-menu-group",
|
|
183
|
+
customElements.get("void-menu-group") || customElements.define("void-menu-group", m);
|
|
162
184
|
//#endregion
|
|
163
|
-
export {
|
|
185
|
+
export { f as VoidMenu, m as VoidMenuGroup, p as VoidMenuItem };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { FormSubmission } from '../form-control.js';
|
|
3
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
4
|
import { OverlayController } from '../overlay.js';
|
|
4
5
|
import { PartsController } from '../parts.js';
|
|
5
6
|
import { ProjectionController } from '../projection.js';
|
|
@@ -60,13 +61,28 @@ declare const VoidMultiselect_base: (new (...args: any[]) => import('../form-con
|
|
|
60
61
|
* @fires {CustomEvent<{ reason: 'trigger' | 'escape' | 'outside' | 'blur' | 'parent' | 'api' }>} void-close - The option list is closing.
|
|
61
62
|
*/
|
|
62
63
|
export declare class VoidMultiselect extends VoidMultiselect_base {
|
|
64
|
+
/** Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
65
|
+
keys: KeyOverrides | null;
|
|
66
|
+
/** @internal The actions of this element and their default keys. */
|
|
67
|
+
static readonly keyMap: {
|
|
68
|
+
next: string[];
|
|
69
|
+
previous: string[];
|
|
70
|
+
first: string[];
|
|
71
|
+
last: string[];
|
|
72
|
+
nextPage: string[];
|
|
73
|
+
previousPage: string[];
|
|
74
|
+
activate: string[];
|
|
75
|
+
typeahead: string[];
|
|
76
|
+
close: string[];
|
|
77
|
+
};
|
|
63
78
|
/** The host's `aria-label` / `aria-labelledby` name the inner control. */
|
|
64
79
|
static labelTarget: string;
|
|
65
80
|
/**
|
|
66
|
-
* Text shown in the trigger while nothing is selected. Defaults to `Select
|
|
81
|
+
* Text shown in the trigger while nothing is selected. Defaults to the `multiselect.placeholder` message (English: `Select...`). It is also the
|
|
67
82
|
* trigger's accessible name when no `void-field` label names it.
|
|
68
83
|
*/
|
|
69
84
|
placeholder: string;
|
|
85
|
+
private get _hint();
|
|
70
86
|
/** Stop the trigger opening and exclude the values from the form submission. */
|
|
71
87
|
disabled: boolean;
|
|
72
88
|
/** Size step: `sm`, `md` (default) or `lg`. */
|