@voidable/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +8 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BGrS4eIl.js +307 -0
- package/dist/chunks/data-BpiiNapL.js +95 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
- package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
- package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.js} +105 -389
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +2 -2
- package/dist/components/action-input.js +56 -54
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +11 -4
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.d.ts +8 -2
- package/dist/components/badge.js +1 -4
- package/dist/components/banner.d.ts +9 -0
- package/dist/components/banner.js +11 -4
- package/dist/components/bar-chart.d.ts +21 -7
- package/dist/components/bar-chart.js +67 -43
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +40 -2
- package/dist/components/calendar.js +170 -79
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +20 -19
- package/dist/components/charts/data.d.ts +72 -0
- package/dist/components/checkbox-group.js +13 -12
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.js +17 -16
- package/dist/components/compose-input.js +13 -11
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.d.ts +22 -6
- package/dist/components/donut-chart.js +96 -68
- package/dist/components/drawer.d.ts +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +4 -4
- package/dist/components/editable.js +13 -12
- package/dist/components/error-fallback.js +2 -2
- package/dist/components/field.js +10 -9
- package/dist/components/file-upload.d.ts +20 -5
- package/dist/components/file-upload.js +52 -20
- package/dist/components/gauge.d.ts +32 -8
- package/dist/components/gauge.js +209 -135
- package/dist/components/hamburger.d.ts +12 -1
- package/dist/components/hamburger.js +33 -20
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.js +41 -39
- package/dist/components/line-chart.d.ts +22 -7
- package/dist/components/line-chart.js +80 -56
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.js +30 -29
- package/dist/components/nav-bar.d.ts +9 -0
- package/dist/components/nav-bar.js +16 -3
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.js +17 -15
- package/dist/components/pagination.js +22 -20
- package/dist/components/panel.js +2 -2
- package/dist/components/pin-input.js +32 -30
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.js +13 -11
- package/dist/components/radio.d.ts +25 -0
- package/dist/components/radio.js +78 -29
- package/dist/components/scroll-area.js +8 -7
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.js +49 -47
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +16 -14
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.d.ts +13 -1
- package/dist/components/stat.js +29 -19
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.js +14 -12
- package/dist/components/table.d.ts +4 -0
- package/dist/components/table.js +42 -29
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.js +24 -22
- package/dist/components/textarea.js +34 -32
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +15 -13
- package/dist/custom-elements.json +320 -88
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +85 -16
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +1 -1
- package/dist/parts.d.ts +5 -0
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +84 -59
- package/dist/types/elements.d.ts +13 -13
- package/dist/types/react.d.ts +2 -2
- package/dist/types/solid.d.ts +2 -2
- package/dist/types/svelte.d.ts +2 -2
- package/dist/types/vue.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +108 -28
- package/dist/web-types.json +189 -60
- package/package.json +1 -1
|
@@ -3,12 +3,16 @@ import { KeyboardActivation } from '../keyboard-activation.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Animated open/close toggle for mobile navigation menus and collapsible sidebars.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`). Without one it is called "Menu" ("Close menu" while open).
|
|
7
|
+
*
|
|
8
|
+
* @fires {CustomEvent<{ reason: 'trigger' | 'keyboard' }>} void-open - The user opened it: `trigger` for a click, `keyboard` for Enter or Space. Does not bubble.
|
|
7
9
|
* @fires {CustomEvent<{ reason: 'trigger' }>} void-close - The user closed it. Does not bubble.
|
|
8
10
|
*/
|
|
9
11
|
export declare class VoidHamburger extends VoidElement {
|
|
10
12
|
/** Enter and Space fire a real `click`, as on a native button. */
|
|
11
13
|
protected readonly _activation: KeyboardActivation;
|
|
14
|
+
/** A key (Enter, Space) is activating it, so the click it fires reports reason `keyboard`. */
|
|
15
|
+
private _byKey;
|
|
12
16
|
/**
|
|
13
17
|
* Whether the menu it controls is open: draws the lines as a close cross and sets `aria-expanded`. It
|
|
14
18
|
* flips on every click and Enter or Space, firing `void-open` or `void-close`; set it yourself when the
|
|
@@ -24,6 +28,13 @@ export declare class VoidHamburger extends VoidElement {
|
|
|
24
28
|
disconnectedCallback(): void;
|
|
25
29
|
updated(changed: Map<string, unknown>): void;
|
|
26
30
|
private _handleClick;
|
|
31
|
+
/** The label this component wrote itself, so a name the author wrote is told apart from it. */
|
|
32
|
+
private _writtenLabel;
|
|
33
|
+
/**
|
|
34
|
+
* The name is the author's `aria-label` or `aria-labelledby` (say what it opens: "Main navigation"; it stays the
|
|
35
|
+
* same while open, `aria-expanded` says the rest). Without one it is "Menu", or "Close menu" while open.
|
|
36
|
+
*/
|
|
37
|
+
private _syncLabel;
|
|
27
38
|
render(): import('lit').TemplateResult<1>;
|
|
28
39
|
}
|
|
29
40
|
declare global {
|
|
@@ -1,40 +1,53 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
4
|
import { i as r, r as i } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { r as a } from "../chunks/projection-oPe6ipjL.js";
|
|
6
|
+
import { html as o } from "lit";
|
|
7
|
+
import { property as s } from "lit/decorators.js";
|
|
7
8
|
//#region src/components/hamburger.ts
|
|
8
|
-
|
|
9
|
+
a();
|
|
10
|
+
var c = class extends e {
|
|
9
11
|
constructor(...e) {
|
|
10
|
-
super(...e), this._activation = new n(this, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
super(...e), this._activation = new n(this, {
|
|
13
|
+
disabled: () => i(this),
|
|
14
|
+
activate: () => {
|
|
15
|
+
this._byKey = !0;
|
|
16
|
+
try {
|
|
17
|
+
this.click();
|
|
18
|
+
} finally {
|
|
19
|
+
this._byKey = !1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}), this._byKey = !1, this.open = !1, this.size = "md", this._unwatch = null, this._handleClick = () => {
|
|
23
|
+
i(this) || (this.open = !this.open, this.open ? this.dispatchEvent(new CustomEvent("void-open", {
|
|
15
24
|
bubbles: !1,
|
|
16
|
-
detail:
|
|
25
|
+
detail: { reason: this._byKey ? "keyboard" : "trigger" }
|
|
17
26
|
})) : this.dispatchEvent(new CustomEvent("void-close", {
|
|
18
27
|
bubbles: !1,
|
|
19
|
-
detail:
|
|
20
|
-
}));
|
|
21
|
-
};
|
|
28
|
+
detail: { reason: "trigger" }
|
|
29
|
+
})));
|
|
30
|
+
}, this._writtenLabel = null;
|
|
22
31
|
}
|
|
23
32
|
_syncDisabled() {
|
|
24
33
|
let e = i(this);
|
|
25
34
|
this.setHostAttribute("aria-disabled", e ? "true" : null), this.setHostAttribute("tabindex", e ? "-1" : "0");
|
|
26
35
|
}
|
|
27
36
|
connectedCallback() {
|
|
28
|
-
super.connectedCallback(), this.setHostAttribute("role", "button"), this._syncDisabled(), this._unwatch = r(this, () => this._syncDisabled()), this.setHostAttribute("aria-expanded", String(this.open)), this.
|
|
37
|
+
super.connectedCallback(), this.setHostAttribute("role", "button"), this._syncDisabled(), this._unwatch = r(this, () => this._syncDisabled()), this.setHostAttribute("aria-expanded", String(this.open)), this._syncLabel(), this.addEventListener("click", this._handleClick);
|
|
29
38
|
}
|
|
30
39
|
disconnectedCallback() {
|
|
31
40
|
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this._unwatch?.(), this._unwatch = null;
|
|
32
41
|
}
|
|
33
42
|
updated(e) {
|
|
34
|
-
e.has("open") && (this.setHostAttribute("aria-expanded", String(this.open)), this.
|
|
43
|
+
e.has("open") && (this.setHostAttribute("aria-expanded", String(this.open)), this._syncLabel());
|
|
44
|
+
}
|
|
45
|
+
_syncLabel() {
|
|
46
|
+
let e = this.getAttribute("aria-label");
|
|
47
|
+
this.hasAttribute("aria-labelledby") || e !== null && e !== this._writtenLabel || (this._writtenLabel = this.open ? "Close menu" : "Menu", this.setHostAttribute("aria-label", this._writtenLabel));
|
|
35
48
|
}
|
|
36
49
|
render() {
|
|
37
|
-
return
|
|
50
|
+
return o`
|
|
38
51
|
<span class="void-hamburger-lines">
|
|
39
52
|
<span class="void-hamburger-line"></span>
|
|
40
53
|
<span class="void-hamburger-line"></span>
|
|
@@ -43,12 +56,12 @@ var s = class extends e {
|
|
|
43
56
|
`;
|
|
44
57
|
}
|
|
45
58
|
};
|
|
46
|
-
t([
|
|
59
|
+
t([s({
|
|
47
60
|
type: Boolean,
|
|
48
61
|
reflect: !0
|
|
49
|
-
})],
|
|
62
|
+
})], c.prototype, "open", void 0), t([s({
|
|
50
63
|
type: String,
|
|
51
64
|
reflect: !0
|
|
52
|
-
})],
|
|
65
|
+
})], c.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", c);
|
|
53
66
|
//#endregion
|
|
54
|
-
export {
|
|
67
|
+
export { c as VoidHamburger };
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { i as n, n as r } from "../chunks/parts-
|
|
4
|
-
import { t as i } from "../chunks/overlay-
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-DI_3VpSy.js";
|
|
4
|
+
import { t as i } from "../chunks/overlay-CH7L4N-h.js";
|
|
5
5
|
import { property as a } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/hover-card.ts
|
|
7
7
|
var o = class extends e {
|
|
@@ -1,9 +1,11 @@
|
|
|
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 {
|
|
3
|
+
import { r as n } from "../chunks/projection-oPe6ipjL.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 };
|
package/dist/components/input.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.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";
|
|
8
9
|
//#region src/components/input.ts
|
|
9
|
-
|
|
10
|
+
r();
|
|
11
|
+
var u = class t extends n(e) {
|
|
10
12
|
constructor(...e) {
|
|
11
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;
|
|
12
14
|
}
|
|
@@ -16,37 +18,37 @@ var l = class t extends n(e) {
|
|
|
16
18
|
static {
|
|
17
19
|
this.editState = ["value"];
|
|
18
20
|
}
|
|
19
|
-
requestUpdate(e, n,
|
|
20
|
-
super.requestUpdate(e, n,
|
|
21
|
+
requestUpdate(e, n, r) {
|
|
22
|
+
super.requestUpdate(e, n, i(this.type === "password", e, r, () => t.getPropertyOptions("value")));
|
|
21
23
|
}
|
|
22
24
|
updated(e) {
|
|
23
|
-
super.updated(e), this.type === "password" && e.get("type") !== void 0 &&
|
|
25
|
+
super.updated(e), this.type === "password" && e.get("type") !== void 0 && a(this);
|
|
24
26
|
}
|
|
25
27
|
render() {
|
|
26
|
-
return
|
|
28
|
+
return o`
|
|
27
29
|
<input
|
|
28
30
|
type=${this.type}
|
|
29
|
-
.value=${
|
|
31
|
+
.value=${l(this.value)}
|
|
30
32
|
placeholder=${this.placeholder}
|
|
31
33
|
?disabled=${this.disabled}
|
|
32
34
|
?readonly=${this.readonly}
|
|
33
35
|
?required=${this.required}
|
|
34
36
|
name=${this.name}
|
|
35
|
-
autocomplete=${this.autocomplete ||
|
|
36
|
-
minlength=${this.minlength ??
|
|
37
|
-
maxlength=${this.maxlength ??
|
|
38
|
-
pattern=${this.pattern ||
|
|
39
|
-
inputmode=${this.inputMode ||
|
|
40
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
41
|
-
autocapitalize=${this.autocapitalize ||
|
|
42
|
-
spellcheck=${this.spellcheckAttr ??
|
|
43
|
-
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}
|
|
44
46
|
aria-invalid=${this.error ? "true" : "false"}
|
|
45
47
|
@input=${this._onInput}
|
|
46
48
|
@change=${this._onChange}
|
|
47
49
|
@keydown=${this._onKeydown}
|
|
48
50
|
/>
|
|
49
|
-
${this.error ?
|
|
51
|
+
${this.error ? o`<span class="void-input-error">${this.error}</span>` : ""}
|
|
50
52
|
`;
|
|
51
53
|
}
|
|
52
54
|
formWriteNativeDefault(e) {
|
|
@@ -66,7 +68,7 @@ var l = class t extends n(e) {
|
|
|
66
68
|
let t = e.target.form;
|
|
67
69
|
if (!t) return;
|
|
68
70
|
let n = Array.from(t.elements);
|
|
69
|
-
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;
|
|
70
72
|
let r = [...n, ...Array.from(t.querySelectorAll("void-button"))].find((e) => e.tagName === "VOID-BUTTON" && e.getAttribute("type") === "submit");
|
|
71
73
|
!r || r.formDisabled || (e.preventDefault(), t.requestSubmit());
|
|
72
74
|
}
|
|
@@ -87,47 +89,47 @@ var l = class t extends n(e) {
|
|
|
87
89
|
}));
|
|
88
90
|
}
|
|
89
91
|
};
|
|
90
|
-
t([
|
|
92
|
+
t([c({
|
|
91
93
|
type: String,
|
|
92
94
|
reflect: !0
|
|
93
|
-
})],
|
|
95
|
+
})], u.prototype, "type", void 0), t([c({
|
|
94
96
|
type: String,
|
|
95
97
|
reflect: !0
|
|
96
|
-
})],
|
|
98
|
+
})], u.prototype, "value", void 0), t([c({
|
|
97
99
|
type: String,
|
|
98
100
|
reflect: !0
|
|
99
|
-
})],
|
|
101
|
+
})], u.prototype, "placeholder", void 0), t([c({
|
|
100
102
|
type: Boolean,
|
|
101
103
|
reflect: !0
|
|
102
|
-
})],
|
|
104
|
+
})], u.prototype, "disabled", void 0), t([c({
|
|
103
105
|
type: Boolean,
|
|
104
106
|
reflect: !0
|
|
105
|
-
})],
|
|
107
|
+
})], u.prototype, "readonly", void 0), t([c({
|
|
106
108
|
type: Boolean,
|
|
107
109
|
reflect: !0
|
|
108
|
-
})],
|
|
110
|
+
})], u.prototype, "required", void 0), t([c({
|
|
109
111
|
type: String,
|
|
110
112
|
reflect: !0
|
|
111
|
-
})],
|
|
113
|
+
})], u.prototype, "name", void 0), t([c({
|
|
112
114
|
type: String,
|
|
113
115
|
reflect: !0
|
|
114
|
-
})],
|
|
116
|
+
})], u.prototype, "size", void 0), t([c({
|
|
115
117
|
type: String,
|
|
116
118
|
reflect: !0
|
|
117
|
-
})],
|
|
119
|
+
})], u.prototype, "error", void 0), t([c({
|
|
118
120
|
type: String,
|
|
119
121
|
reflect: !0
|
|
120
|
-
})],
|
|
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({
|
|
121
123
|
type: String,
|
|
122
124
|
attribute: "inputmode"
|
|
123
|
-
})],
|
|
125
|
+
})], u.prototype, "inputMode", void 0), t([c({
|
|
124
126
|
type: String,
|
|
125
127
|
attribute: "enterkeyhint"
|
|
126
|
-
})],
|
|
128
|
+
})], u.prototype, "enterKeyHint", void 0), t([c({ type: String })], u.prototype, "autocapitalize", void 0), t([c({
|
|
127
129
|
type: String,
|
|
128
130
|
attribute: "spellcheck"
|
|
129
|
-
})],
|
|
130
|
-
var
|
|
131
|
+
})], u.prototype, "spellcheckAttr", void 0);
|
|
132
|
+
var d = new Set([
|
|
131
133
|
"text",
|
|
132
134
|
"search",
|
|
133
135
|
"url",
|
|
@@ -141,6 +143,6 @@ var u = new Set([
|
|
|
141
143
|
"datetime-local",
|
|
142
144
|
"number"
|
|
143
145
|
]);
|
|
144
|
-
customElements.get("void-input") || customElements.define("void-input",
|
|
146
|
+
customElements.get("void-input") || customElements.define("void-input", u);
|
|
145
147
|
//#endregion
|
|
146
|
-
export {
|
|
148
|
+
export { u as VoidInput };
|
|
@@ -10,8 +10,10 @@ export interface LineChartData {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Line chart for trends over time with one or more series, linear or stepped, drawn in SVG with an animated
|
|
13
|
-
* entry. Give it `data` (`{ series: [{ name, values }], labels }`)
|
|
14
|
-
*
|
|
13
|
+
* entry. Give it `data` (`{ series: [{ name, values }], labels }`) as the `data` property or as JSON in the
|
|
14
|
+
* `data` attribute, so server-rendered markup draws it with no script; it has no children. The drawing is
|
|
15
|
+
* hidden from assistive technology and a visually hidden data table (captioned with `aria-label`) carries
|
|
16
|
+
* the values instead; add `show-table` to show the table below the chart too.
|
|
15
17
|
*/
|
|
16
18
|
export declare class VoidLineChart extends VoidElement {
|
|
17
19
|
/** Height of the chart in pixels. Defaults to 220. The width fills the container. */
|
|
@@ -29,18 +31,29 @@ export declare class VoidLineChart extends VoidElement {
|
|
|
29
31
|
*/
|
|
30
32
|
interpolation: 'linear' | 'step';
|
|
31
33
|
/**
|
|
32
|
-
* Accessible name of the chart, such as `Visitors per day
|
|
33
|
-
*
|
|
34
|
+
* Accessible name of the chart, such as `Visitors per day`; it is also the caption of the data table.
|
|
35
|
+
* Set it: the drawing itself is hidden from assistive technology.
|
|
34
36
|
*/
|
|
35
37
|
ariaLabel: string;
|
|
38
|
+
/**
|
|
39
|
+
* Show the data table (one row per point, one column per series) below the chart. The table is always
|
|
40
|
+
* there for assistive technology; this makes it visible too.
|
|
41
|
+
*/
|
|
42
|
+
showTable: boolean;
|
|
36
43
|
private _data;
|
|
44
|
+
private _source;
|
|
45
|
+
private _entered;
|
|
37
46
|
/**
|
|
38
47
|
* The chart's data: `{ series: [{ name, values, color? }], labels? }`. `values` are aligned with `labels`
|
|
39
|
-
* (the names along the horizontal axis); `color` overrides a series' colour.
|
|
40
|
-
* object to update the chart and animate to it
|
|
48
|
+
* (the names along the horizontal axis); `color` overrides a series' colour. Give it as a property
|
|
49
|
+
* (assign a new object to update the chart and animate to it) or as JSON in the `data` attribute:
|
|
50
|
+
* `<void-line-chart data='{"series":[{"name":"Visitors","values":[3,5,4]}],"labels":["Mon","Tue","Wed"]}'>`.
|
|
51
|
+
* Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the
|
|
52
|
+
* attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again.
|
|
53
|
+
* @default { series: [] }
|
|
41
54
|
*/
|
|
42
55
|
get data(): LineChartData;
|
|
43
|
-
set data(
|
|
56
|
+
set data(input: LineChartData);
|
|
44
57
|
private _phase;
|
|
45
58
|
private _display;
|
|
46
59
|
private _targets;
|
|
@@ -60,6 +73,8 @@ export declare class VoidLineChart extends VoidElement {
|
|
|
60
73
|
private _onMouseMove;
|
|
61
74
|
private _onMouseLeave;
|
|
62
75
|
render(): import('lit').TemplateResult<1>;
|
|
76
|
+
/** The data table for assistive technology (and `show-table`), from the data as given, not the animated state. */
|
|
77
|
+
private _table;
|
|
63
78
|
private _renderHover;
|
|
64
79
|
}
|
|
65
80
|
declare global {
|