@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,9 +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
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { r as n } from "../chunks/projection-SnR79EHI.js";
|
|
4
|
+
import { html as r } from "lit";
|
|
5
|
+
import { property as i } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/indicator.ts
|
|
6
|
-
|
|
7
|
+
n();
|
|
8
|
+
var a = class extends e {
|
|
7
9
|
constructor(...e) {
|
|
8
10
|
super(...e), this.color = "default", this.placement = "top-right", this.count = null, this.ping = !1, this.size = "md";
|
|
9
11
|
}
|
|
@@ -14,24 +16,24 @@ var i = class extends e {
|
|
|
14
16
|
this.setHostAttribute("aria-label", this.count == null ? "notification" : `${this.count} ${this.count === 1 ? "notification" : "notifications"}`);
|
|
15
17
|
}
|
|
16
18
|
render() {
|
|
17
|
-
return
|
|
19
|
+
return r`<span class="void-indicator-dot">${this.count == null ? "" : String(this.count)}</span>`;
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
|
-
t([
|
|
22
|
+
t([i({
|
|
21
23
|
type: String,
|
|
22
24
|
reflect: !0
|
|
23
|
-
})],
|
|
25
|
+
})], a.prototype, "color", void 0), t([i({
|
|
24
26
|
type: String,
|
|
25
27
|
reflect: !0
|
|
26
|
-
})],
|
|
28
|
+
})], a.prototype, "placement", void 0), t([i({
|
|
27
29
|
type: Number,
|
|
28
30
|
reflect: !0
|
|
29
|
-
})],
|
|
31
|
+
})], a.prototype, "count", void 0), t([i({
|
|
30
32
|
type: Boolean,
|
|
31
33
|
reflect: !0
|
|
32
|
-
})],
|
|
34
|
+
})], a.prototype, "ping", void 0), t([i({
|
|
33
35
|
type: String,
|
|
34
36
|
reflect: !0
|
|
35
|
-
})],
|
|
37
|
+
})], a.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", a);
|
|
36
38
|
//#endregion
|
|
37
|
-
export {
|
|
39
|
+
export { a as VoidIndicator };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PropertyDeclaration, PropertyValues } from 'lit';
|
|
1
2
|
import { VoidElement } from '../base.js';
|
|
2
3
|
declare const VoidInput_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
|
|
3
4
|
/** Single-line text entry for login forms, search fields, and structured data capture. */
|
|
@@ -9,8 +10,9 @@ export declare class VoidInput extends VoidInput_base {
|
|
|
9
10
|
/** Native input type. Every text-like type is forwarded to the native control. */
|
|
10
11
|
type: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'month' | 'time' | 'week';
|
|
11
12
|
/**
|
|
12
|
-
* The text in the field.
|
|
13
|
-
*
|
|
13
|
+
* The text in the field. Reflected to the `value` attribute as it changes, and setting the attribute
|
|
14
|
+
* sets it; the form's reset target stays the value the field started with. A `type="password"` field
|
|
15
|
+
* does not reflect: its attribute is only ever the initial value.
|
|
14
16
|
*/
|
|
15
17
|
value: string;
|
|
16
18
|
/**
|
|
@@ -65,6 +67,8 @@ export declare class VoidInput extends VoidInput_base {
|
|
|
65
67
|
* forwarded to the native control: the native enumerated attribute, not a boolean.
|
|
66
68
|
*/
|
|
67
69
|
protected spellcheckAttr: string | null;
|
|
70
|
+
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
71
|
+
protected updated(changed: PropertyValues): void;
|
|
68
72
|
render(): import('lit').TemplateResult<1>;
|
|
69
73
|
protected formWriteNativeDefault(state: unknown): void;
|
|
70
74
|
protected formReadNative(): void;
|
package/dist/components/input.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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 { n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-SnR79EHI.js";
|
|
5
|
+
import { n as i, t as a } from "../chunks/secret-value-CmTtVkMg.js";
|
|
6
|
+
import { html as o, nothing as s } from "lit";
|
|
7
|
+
import { property as c } from "lit/decorators.js";
|
|
8
|
+
import { live as l } from "lit/directives/live.js";
|
|
7
9
|
//#region src/components/input.ts
|
|
8
|
-
|
|
10
|
+
r();
|
|
11
|
+
var u = class t extends n(e) {
|
|
9
12
|
constructor(...e) {
|
|
10
13
|
super(...e), this.type = "text", this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
|
|
11
14
|
}
|
|
@@ -15,31 +18,37 @@ var s = class extends n(e) {
|
|
|
15
18
|
static {
|
|
16
19
|
this.editState = ["value"];
|
|
17
20
|
}
|
|
21
|
+
requestUpdate(e, n, r) {
|
|
22
|
+
super.requestUpdate(e, n, i(this.type === "password", e, r, () => t.getPropertyOptions("value")));
|
|
23
|
+
}
|
|
24
|
+
updated(e) {
|
|
25
|
+
super.updated(e), this.type === "password" && e.get("type") !== void 0 && a(this);
|
|
26
|
+
}
|
|
18
27
|
render() {
|
|
19
|
-
return
|
|
28
|
+
return o`
|
|
20
29
|
<input
|
|
21
30
|
type=${this.type}
|
|
22
|
-
.value=${
|
|
31
|
+
.value=${l(this.value)}
|
|
23
32
|
placeholder=${this.placeholder}
|
|
24
33
|
?disabled=${this.disabled}
|
|
25
34
|
?readonly=${this.readonly}
|
|
26
35
|
?required=${this.required}
|
|
27
36
|
name=${this.name}
|
|
28
|
-
autocomplete=${this.autocomplete ||
|
|
29
|
-
minlength=${this.minlength ??
|
|
30
|
-
maxlength=${this.maxlength ??
|
|
31
|
-
pattern=${this.pattern ||
|
|
32
|
-
inputmode=${this.inputMode ||
|
|
33
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
34
|
-
autocapitalize=${this.autocapitalize ||
|
|
35
|
-
spellcheck=${this.spellcheckAttr ??
|
|
36
|
-
form=${this.formAttr ??
|
|
37
|
+
autocomplete=${this.autocomplete || s}
|
|
38
|
+
minlength=${this.minlength ?? s}
|
|
39
|
+
maxlength=${this.maxlength ?? s}
|
|
40
|
+
pattern=${this.pattern || s}
|
|
41
|
+
inputmode=${this.inputMode || s}
|
|
42
|
+
enterkeyhint=${this.enterKeyHint || s}
|
|
43
|
+
autocapitalize=${this.autocapitalize || s}
|
|
44
|
+
spellcheck=${this.spellcheckAttr ?? s}
|
|
45
|
+
form=${this.formAttr ?? s}
|
|
37
46
|
aria-invalid=${this.error ? "true" : "false"}
|
|
38
47
|
@input=${this._onInput}
|
|
39
48
|
@change=${this._onChange}
|
|
40
49
|
@keydown=${this._onKeydown}
|
|
41
50
|
/>
|
|
42
|
-
${this.error ?
|
|
51
|
+
${this.error ? o`<span class="void-input-error">${this.error}</span>` : ""}
|
|
43
52
|
`;
|
|
44
53
|
}
|
|
45
54
|
formWriteNativeDefault(e) {
|
|
@@ -59,7 +68,7 @@ var s = class extends n(e) {
|
|
|
59
68
|
let t = e.target.form;
|
|
60
69
|
if (!t) return;
|
|
61
70
|
let n = Array.from(t.elements);
|
|
62
|
-
if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement &&
|
|
71
|
+
if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement && d.has(e.type)).length <= 1) return;
|
|
63
72
|
let r = [...n, ...Array.from(t.querySelectorAll("void-button"))].find((e) => e.tagName === "VOID-BUTTON" && e.getAttribute("type") === "submit");
|
|
64
73
|
!r || r.formDisabled || (e.preventDefault(), t.requestSubmit());
|
|
65
74
|
}
|
|
@@ -80,44 +89,47 @@ var s = class extends n(e) {
|
|
|
80
89
|
}));
|
|
81
90
|
}
|
|
82
91
|
};
|
|
83
|
-
t([
|
|
92
|
+
t([c({
|
|
93
|
+
type: String,
|
|
94
|
+
reflect: !0
|
|
95
|
+
})], u.prototype, "type", void 0), t([c({
|
|
84
96
|
type: String,
|
|
85
97
|
reflect: !0
|
|
86
|
-
})],
|
|
98
|
+
})], u.prototype, "value", void 0), t([c({
|
|
87
99
|
type: String,
|
|
88
100
|
reflect: !0
|
|
89
|
-
})],
|
|
101
|
+
})], u.prototype, "placeholder", void 0), t([c({
|
|
90
102
|
type: Boolean,
|
|
91
103
|
reflect: !0
|
|
92
|
-
})],
|
|
104
|
+
})], u.prototype, "disabled", void 0), t([c({
|
|
93
105
|
type: Boolean,
|
|
94
106
|
reflect: !0
|
|
95
|
-
})],
|
|
107
|
+
})], u.prototype, "readonly", void 0), t([c({
|
|
96
108
|
type: Boolean,
|
|
97
109
|
reflect: !0
|
|
98
|
-
})],
|
|
110
|
+
})], u.prototype, "required", void 0), t([c({
|
|
99
111
|
type: String,
|
|
100
112
|
reflect: !0
|
|
101
|
-
})],
|
|
113
|
+
})], u.prototype, "name", void 0), t([c({
|
|
102
114
|
type: String,
|
|
103
115
|
reflect: !0
|
|
104
|
-
})],
|
|
116
|
+
})], u.prototype, "size", void 0), t([c({
|
|
105
117
|
type: String,
|
|
106
118
|
reflect: !0
|
|
107
|
-
})],
|
|
119
|
+
})], u.prototype, "error", void 0), t([c({
|
|
108
120
|
type: String,
|
|
109
121
|
reflect: !0
|
|
110
|
-
})],
|
|
122
|
+
})], u.prototype, "autocomplete", void 0), t([c({ type: Number })], u.prototype, "minlength", void 0), t([c({ type: Number })], u.prototype, "maxlength", void 0), t([c({ type: String })], u.prototype, "pattern", void 0), t([c({
|
|
111
123
|
type: String,
|
|
112
124
|
attribute: "inputmode"
|
|
113
|
-
})],
|
|
125
|
+
})], u.prototype, "inputMode", void 0), t([c({
|
|
114
126
|
type: String,
|
|
115
127
|
attribute: "enterkeyhint"
|
|
116
|
-
})],
|
|
128
|
+
})], u.prototype, "enterKeyHint", void 0), t([c({ type: String })], u.prototype, "autocapitalize", void 0), t([c({
|
|
117
129
|
type: String,
|
|
118
130
|
attribute: "spellcheck"
|
|
119
|
-
})],
|
|
120
|
-
var
|
|
131
|
+
})], u.prototype, "spellcheckAttr", void 0);
|
|
132
|
+
var d = new Set([
|
|
121
133
|
"text",
|
|
122
134
|
"search",
|
|
123
135
|
"url",
|
|
@@ -131,6 +143,6 @@ var c = new Set([
|
|
|
131
143
|
"datetime-local",
|
|
132
144
|
"number"
|
|
133
145
|
]);
|
|
134
|
-
customElements.get("void-input") || customElements.define("void-input",
|
|
146
|
+
customElements.get("void-input") || customElements.define("void-input", u);
|
|
135
147
|
//#endregion
|
|
136
|
-
export {
|
|
148
|
+
export { u as VoidInput };
|
|
@@ -1,28 +1,30 @@
|
|
|
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
|
-
import { n } from "../chunks/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { r as n } from "../chunks/projection-SnR79EHI.js";
|
|
4
|
+
import { n as r } from "../chunks/scale-_ccSuoYg.js";
|
|
5
|
+
import { a as i, i as a, n as o, r as s } from "../chunks/shape-C_LW7EjG.js";
|
|
6
|
+
import { html as c, nothing as l, svg as u } from "lit";
|
|
7
|
+
import { property as d, state as f } from "lit/decorators.js";
|
|
7
8
|
//#region src/components/line-chart.ts
|
|
8
|
-
|
|
9
|
+
n();
|
|
10
|
+
function p(e) {
|
|
9
11
|
return 1 - (1 - e) ** 3;
|
|
10
12
|
}
|
|
11
|
-
function
|
|
13
|
+
function m(e) {
|
|
12
14
|
return e === 0 ? "0" : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(1);
|
|
13
15
|
}
|
|
14
|
-
function
|
|
16
|
+
function h(e) {
|
|
15
17
|
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
16
18
|
}
|
|
17
|
-
function
|
|
19
|
+
function g(e) {
|
|
18
20
|
if (e <= 0) return 1;
|
|
19
21
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
20
22
|
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
21
23
|
}
|
|
22
|
-
var
|
|
24
|
+
var _ = class extends e {
|
|
23
25
|
constructor(...e) {
|
|
24
26
|
super(...e), this.height = 220, this.showValue = !1, this.variant = "outline", this.interpolation = "linear", this.ariaLabel = "", 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._rafHandle = 0, this._reveal = 0, this._revealFrom = 0, this._hoverIndex = null, this._tick = (e) => {
|
|
25
|
-
let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r =
|
|
27
|
+
let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r = p(n);
|
|
26
28
|
this._reveal = this._revealFrom + (1 - this._revealFrom) * r;
|
|
27
29
|
for (let [e, t] of this._targets) {
|
|
28
30
|
let n = this._animFrom.get(e) ?? 0;
|
|
@@ -81,8 +83,8 @@ var g = class extends e {
|
|
|
81
83
|
}
|
|
82
84
|
render() {
|
|
83
85
|
let { series: e, labels: t = [] } = this._data;
|
|
84
|
-
if (e.length === 0) return
|
|
85
|
-
let
|
|
86
|
+
if (e.length === 0) return c`<svg viewBox="0 0 600 ${this.height}" role="img" aria-label=${this.ariaLabel || "Line chart"}></svg>`;
|
|
87
|
+
let n = this.height - 16 - 32, d = Math.max(...e.map((e) => e.values.length)), f = e.flatMap((e) => e.values).filter(Number.isFinite), p = g(Math.max(...f, 0) * 1.1) || 1, _ = new r([0, Math.max(0, d - 1)], [40, 584]), v = new r([0, p], [16 + n, 16]), y = v.ticks(5), b = 16 + n, x = getComputedStyle(this), S = (parseFloat(x.getPropertyValue("--void-radius-sm")) || 0) > 0 && this.interpolation === "linear", C = S ? i : s, w = S ? a : o, T = e.map((e, t) => {
|
|
86
88
|
let n = [];
|
|
87
89
|
for (let r = 0; r < e.values.length; r++) {
|
|
88
90
|
let e = this._display.get(this._key(t, r)) ?? 0;
|
|
@@ -95,7 +97,7 @@ var g = class extends e {
|
|
|
95
97
|
}
|
|
96
98
|
return n;
|
|
97
99
|
});
|
|
98
|
-
return
|
|
100
|
+
return c`
|
|
99
101
|
<svg
|
|
100
102
|
viewBox="0 0 ${600} ${this.height}"
|
|
101
103
|
preserveAspectRatio="none"
|
|
@@ -107,17 +109,17 @@ var g = class extends e {
|
|
|
107
109
|
<g class="void-line-chart-grid">
|
|
108
110
|
${y.map((e) => {
|
|
109
111
|
let t = v.scale(e);
|
|
110
|
-
return
|
|
112
|
+
return u`<line x1=${40} x2=${584} y1=${t} y2=${t}></line>`;
|
|
111
113
|
})}
|
|
112
114
|
</g>
|
|
113
115
|
|
|
114
116
|
<g class="void-line-chart-y-axis">
|
|
115
|
-
${y.map((e) =>
|
|
117
|
+
${y.map((e) => u`<text x=${32} y=${v.scale(e)} dy="0.32em" text-anchor="end">${m(e)}</text>`)}
|
|
116
118
|
</g>
|
|
117
119
|
|
|
118
120
|
${e.map((e, t) => {
|
|
119
121
|
let n = e.color ?? `var(--void-chart-series-${t % 6 + 1})`, r = T[t];
|
|
120
|
-
return
|
|
122
|
+
return u`
|
|
121
123
|
<g class="void-line-chart-series" style="--series-color: ${n}">
|
|
122
124
|
<path class="void-line-chart-area" d=${w(r, b)}></path>
|
|
123
125
|
<path class="void-line-chart-line" d=${C(r)}></path>
|
|
@@ -125,25 +127,25 @@ var g = class extends e {
|
|
|
125
127
|
`;
|
|
126
128
|
})}
|
|
127
129
|
|
|
128
|
-
${this.showValue ? e.map((e, t) =>
|
|
130
|
+
${this.showValue ? e.map((e, t) => u`
|
|
129
131
|
<g class="void-line-chart-values">
|
|
130
132
|
${e.values.map((e, n) => {
|
|
131
133
|
let r = this._display.get(this._key(t, n)) ?? 0;
|
|
132
|
-
return
|
|
134
|
+
return u`<text x=${_.scale(n)} y=${v.scale(r) - 8} text-anchor="middle">${h(r)}</text>`;
|
|
133
135
|
})}
|
|
134
136
|
</g>
|
|
135
|
-
`) :
|
|
137
|
+
`) : l}
|
|
136
138
|
|
|
137
139
|
<g class="void-line-chart-x-axis">
|
|
138
|
-
${t.slice(0, d).map((e, t) =>
|
|
140
|
+
${t.slice(0, d).map((e, t) => u`<text x=${_.scale(t)} y=${16 + n + 18} text-anchor="middle">${e}</text>`)}
|
|
139
141
|
</g>
|
|
140
142
|
|
|
141
|
-
${this._hoverIndex !== null && this._hoverIndex < d ? this._renderHover(e, t, _, v, this._hoverIndex, 16,
|
|
143
|
+
${this._hoverIndex !== null && this._hoverIndex < d ? this._renderHover(e, t, _, v, this._hoverIndex, 16, n, 40, 544) : l}
|
|
142
144
|
</svg>
|
|
143
145
|
`;
|
|
144
146
|
}
|
|
145
147
|
_renderHover(e, t, n, r, i, a, o, s, c) {
|
|
146
|
-
let
|
|
148
|
+
let l = n.scale(i), d = e.map((e, t) => {
|
|
147
149
|
let n = this._display.get(this._key(t, i)) ?? 0, a = e.color ?? `var(--void-chart-series-${t % 6 + 1})`;
|
|
148
150
|
return {
|
|
149
151
|
name: e.name,
|
|
@@ -151,64 +153,64 @@ var g = class extends e {
|
|
|
151
153
|
color: a,
|
|
152
154
|
y: r.scale(n)
|
|
153
155
|
};
|
|
154
|
-
}), f = 16 + d.length * 14 + 16, p =
|
|
155
|
-
return
|
|
156
|
+
}), f = 16 + d.length * 14 + 16, p = l + 12 + 140 > s + c ? l - 12 - 140 : l + 12, m = Math.max(a, Math.min(a + o - f, a + 8)), g = t[i] ?? String(i);
|
|
157
|
+
return u`
|
|
156
158
|
<g class="void-line-chart-hover">
|
|
157
159
|
<line
|
|
158
160
|
class="void-line-chart-hairline"
|
|
159
|
-
x1=${
|
|
161
|
+
x1=${l} x2=${l}
|
|
160
162
|
y1=${a} y2=${a + o}
|
|
161
163
|
></line>
|
|
162
|
-
${d.map((e) =>
|
|
164
|
+
${d.map((e) => u`
|
|
163
165
|
<rect
|
|
164
166
|
class="void-line-chart-marker"
|
|
165
|
-
x=${
|
|
167
|
+
x=${l - 5} y=${e.y - 5}
|
|
166
168
|
width="10" height="10"
|
|
167
169
|
style="--marker-color: ${e.color}"
|
|
168
170
|
></rect>
|
|
169
171
|
`)}
|
|
170
172
|
<rect
|
|
171
173
|
class="void-line-chart-tooltip-bg"
|
|
172
|
-
x=${p} y=${
|
|
174
|
+
x=${p} y=${m}
|
|
173
175
|
width=${140} height=${f}
|
|
174
176
|
rx="6" ry="6"
|
|
175
177
|
></rect>
|
|
176
178
|
<text
|
|
177
179
|
class="void-line-chart-tooltip-label"
|
|
178
180
|
x=${p + 8}
|
|
179
|
-
y=${
|
|
181
|
+
y=${m + 8 + 10}
|
|
180
182
|
>${g}</text>
|
|
181
|
-
${d.map((e, t) =>
|
|
183
|
+
${d.map((e, t) => u`
|
|
182
184
|
<circle
|
|
183
185
|
class="void-line-chart-tooltip-swatch"
|
|
184
186
|
cx=${p + 8 + 5}
|
|
185
|
-
cy=${
|
|
187
|
+
cy=${m + 16 + 8 + t * 14 + 4}
|
|
186
188
|
r="4"
|
|
187
189
|
style="--swatch-color: ${e.color}"
|
|
188
190
|
></circle>
|
|
189
191
|
<text
|
|
190
192
|
class="void-line-chart-tooltip-name"
|
|
191
193
|
x=${p + 8 + 14}
|
|
192
|
-
y=${
|
|
194
|
+
y=${m + 16 + 8 + t * 14 + 8}
|
|
193
195
|
>${e.name}</text>
|
|
194
196
|
<text
|
|
195
197
|
class="void-line-chart-tooltip-value"
|
|
196
198
|
x=${p + 140 - 8}
|
|
197
|
-
y=${
|
|
199
|
+
y=${m + 16 + 8 + t * 14 + 8}
|
|
198
200
|
text-anchor="end"
|
|
199
|
-
>${
|
|
201
|
+
>${h(e.value)}</text>
|
|
200
202
|
`)}
|
|
201
203
|
</g>
|
|
202
204
|
`;
|
|
203
205
|
}
|
|
204
206
|
};
|
|
205
|
-
t([
|
|
207
|
+
t([d({
|
|
206
208
|
type: Number,
|
|
207
209
|
reflect: !0
|
|
208
|
-
})],
|
|
210
|
+
})], _.prototype, "height", void 0), t([d({
|
|
209
211
|
type: Boolean,
|
|
210
212
|
attribute: "show-value",
|
|
211
213
|
reflect: !0
|
|
212
|
-
})],
|
|
214
|
+
})], _.prototype, "showValue", void 0), t([d({ reflect: !0 })], _.prototype, "variant", void 0), t([d({ reflect: !0 })], _.prototype, "interpolation", void 0), t([d({ attribute: "aria-label" })], _.prototype, "ariaLabel", void 0), t([f()], _.prototype, "_phase", void 0), t([f()], _.prototype, "_hoverIndex", void 0), customElements.get("void-line-chart") || customElements.define("void-line-chart", _);
|
|
213
215
|
//#endregion
|
|
214
|
-
export {
|
|
216
|
+
export { _ as VoidLineChart };
|
package/dist/components/list.js
CHANGED
package/dist/components/menu.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 { i,
|
|
4
|
+
import { n as r } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { a as i, i as a, t as o } from "../chunks/keyboard-CEhMSkws.js";
|
|
6
6
|
import { property as s } from "lit/decorators.js";
|
|
7
7
|
//#region src/components/menu.ts
|
|
8
8
|
var c = class extends e {
|
|
@@ -91,6 +91,15 @@ export declare class VoidMultiselect extends VoidMultiselect_base {
|
|
|
91
91
|
private _content;
|
|
92
92
|
private _trigger;
|
|
93
93
|
private get _options();
|
|
94
|
+
/** Values asked for while no option exists yet (an attribute parsed ahead of its options), applied when they arrive. */
|
|
95
|
+
private _wanted;
|
|
96
|
+
/** The serialised value last handed to Lit, to notice a choice made on the options (the user, a morph). */
|
|
97
|
+
private _reflected;
|
|
98
|
+
/**
|
|
99
|
+
* The values of the chosen options, as a list. The `value` attribute is the same list as a JSON array
|
|
100
|
+
* (`value='["a","b"]'`), kept in step as the choice changes; setting it chooses those options.
|
|
101
|
+
* @default []
|
|
102
|
+
*/
|
|
94
103
|
get value(): string[];
|
|
95
104
|
/** Select exactly the options whose value is listed. Does not fire void-change. */
|
|
96
105
|
set value(values: string[]);
|