@voidable/ui 0.11.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/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,16 +1,17 @@
|
|
|
1
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 { r } from "../chunks/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { msg as n } from "../messages.js";
|
|
4
|
+
import { n as r } from "../chunks/form-control-fL-Hhy91.js";
|
|
5
|
+
import { r as i } from "../chunks/projection-oPe6ipjL.js";
|
|
6
|
+
import { n as a, t as o } from "../chunks/secret-value-CmTtVkMg.js";
|
|
7
|
+
import { html as s, nothing as c } from "lit";
|
|
8
|
+
import { property as l } from "lit/decorators.js";
|
|
9
|
+
import { live as u } from "lit/directives/live.js";
|
|
9
10
|
//#region src/components/action-input.ts
|
|
10
|
-
|
|
11
|
-
var
|
|
11
|
+
i();
|
|
12
|
+
var d = class t extends r(e) {
|
|
12
13
|
constructor(...e) {
|
|
13
|
-
super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null, this.size = "md", this.color = "default", this.type = "text", this.icon = "search", this.actionLabel = "
|
|
14
|
+
super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null, this.size = "md", this.color = "default", this.type = "text", this.icon = "search", this.actionLabel = "", this.iconSide = "end", this.tooltipSide = "top";
|
|
14
15
|
}
|
|
15
16
|
static {
|
|
16
17
|
this.labelTarget = ".void-action-input-field";
|
|
@@ -18,25 +19,28 @@ var u = class t extends n(e) {
|
|
|
18
19
|
static {
|
|
19
20
|
this.editState = ["value"];
|
|
20
21
|
}
|
|
22
|
+
get _action() {
|
|
23
|
+
return this.actionLabel || n(this, "actionInput.action");
|
|
24
|
+
}
|
|
21
25
|
_renderIcon() {
|
|
22
26
|
switch (this.icon) {
|
|
23
|
-
case "copy": return
|
|
24
|
-
case "search": return
|
|
25
|
-
case "send": return
|
|
26
|
-
case "eye": return
|
|
27
|
-
case "eye-off": return
|
|
28
|
-
case "check": return
|
|
29
|
-
case "x": return
|
|
30
|
-
case "arrow-right": return
|
|
31
|
-
case "clipboard": return
|
|
32
|
-
default: return
|
|
27
|
+
case "copy": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666"/><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"/></svg>`;
|
|
28
|
+
case "search": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
|
|
29
|
+
case "send": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 14l11 -11"/><path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5"/></svg>`;
|
|
30
|
+
case "eye": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>`;
|
|
31
|
+
case "eye-off": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>`;
|
|
32
|
+
case "check": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>`;
|
|
33
|
+
case "x": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12"/><path d="M6 6l12 12"/></svg>`;
|
|
34
|
+
case "arrow-right": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0"/><path d="M13 18l6 -6"/><path d="M13 6l6 6"/></svg>`;
|
|
35
|
+
case "clipboard": return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"/><path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2"/></svg>`;
|
|
36
|
+
default: return s`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
requestUpdate(e, n, r) {
|
|
36
|
-
super.requestUpdate(e, n,
|
|
40
|
+
super.requestUpdate(e, n, a(this.type === "password", e, r, () => t.getPropertyOptions("value")));
|
|
37
41
|
}
|
|
38
42
|
updated(e) {
|
|
39
|
-
super.updated(e), this.type === "password" && e.get("type") !== void 0 &&
|
|
43
|
+
super.updated(e), this.type === "password" && e.get("type") !== void 0 && o(this);
|
|
40
44
|
}
|
|
41
45
|
formWriteNativeDefault(e) {
|
|
42
46
|
let t = this.querySelector(".void-action-input-field");
|
|
@@ -74,39 +78,39 @@ var u = class t extends n(e) {
|
|
|
74
78
|
}));
|
|
75
79
|
}
|
|
76
80
|
render() {
|
|
77
|
-
let e =
|
|
81
|
+
let e = s`
|
|
78
82
|
<void-tooltip side=${this.tooltipSide}>
|
|
79
83
|
<void-tooltip-trigger><button
|
|
80
84
|
class="void-action-input-btn"
|
|
81
85
|
type="button"
|
|
82
86
|
?disabled=${this.disabled}
|
|
83
|
-
aria-label=${this.
|
|
87
|
+
aria-label=${this._action}
|
|
84
88
|
@click=${this._onAction}
|
|
85
89
|
>${this._renderIcon()}</button></void-tooltip-trigger>
|
|
86
|
-
<void-tooltip-content>${this.
|
|
90
|
+
<void-tooltip-content>${this._action}</void-tooltip-content>
|
|
87
91
|
</void-tooltip>
|
|
88
92
|
`;
|
|
89
|
-
return
|
|
93
|
+
return s`
|
|
90
94
|
${this.iconSide === "start" ? e : ""}
|
|
91
95
|
<input
|
|
92
96
|
class="void-action-input-field"
|
|
93
97
|
type=${this.type}
|
|
94
|
-
.value=${
|
|
98
|
+
.value=${u(this.value)}
|
|
95
99
|
placeholder=${this.placeholder}
|
|
96
100
|
?disabled=${this.disabled}
|
|
97
101
|
?readonly=${this.readonly}
|
|
98
102
|
?required=${this.required}
|
|
99
103
|
name=${this.name}
|
|
100
|
-
form=${this.formAttr ??
|
|
101
|
-
autocomplete=${this.autocomplete ||
|
|
102
|
-
minlength=${this.minlength ??
|
|
103
|
-
maxlength=${this.maxlength ??
|
|
104
|
-
pattern=${this.pattern ||
|
|
105
|
-
inputmode=${this.inputMode ||
|
|
106
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
107
|
-
autocapitalize=${this.autocapitalize ||
|
|
108
|
-
spellcheck=${this.spellcheckAttr ??
|
|
109
|
-
aria-label=${this.placeholder ||
|
|
104
|
+
form=${this.formAttr ?? c}
|
|
105
|
+
autocomplete=${this.autocomplete || c}
|
|
106
|
+
minlength=${this.minlength ?? c}
|
|
107
|
+
maxlength=${this.maxlength ?? c}
|
|
108
|
+
pattern=${this.pattern || c}
|
|
109
|
+
inputmode=${this.inputMode || c}
|
|
110
|
+
enterkeyhint=${this.enterKeyHint || c}
|
|
111
|
+
autocapitalize=${this.autocapitalize || c}
|
|
112
|
+
spellcheck=${this.spellcheckAttr ?? c}
|
|
113
|
+
aria-label=${this.placeholder || c}
|
|
110
114
|
@input=${this._onInput}
|
|
111
115
|
@change=${this._onChange}
|
|
112
116
|
/>
|
|
@@ -114,59 +118,59 @@ var u = class t extends n(e) {
|
|
|
114
118
|
`;
|
|
115
119
|
}
|
|
116
120
|
};
|
|
117
|
-
t([
|
|
121
|
+
t([l({
|
|
118
122
|
type: String,
|
|
119
123
|
reflect: !0
|
|
120
|
-
})],
|
|
124
|
+
})], d.prototype, "value", void 0), t([l({
|
|
121
125
|
type: String,
|
|
122
126
|
reflect: !0
|
|
123
|
-
})],
|
|
127
|
+
})], d.prototype, "placeholder", void 0), t([l({
|
|
124
128
|
type: Boolean,
|
|
125
129
|
reflect: !0
|
|
126
|
-
})],
|
|
130
|
+
})], d.prototype, "disabled", void 0), t([l({
|
|
127
131
|
type: Boolean,
|
|
128
132
|
reflect: !0
|
|
129
|
-
})],
|
|
133
|
+
})], d.prototype, "readonly", void 0), t([l({
|
|
130
134
|
type: Boolean,
|
|
131
135
|
reflect: !0
|
|
132
|
-
})],
|
|
136
|
+
})], d.prototype, "required", void 0), t([l({
|
|
133
137
|
type: String,
|
|
134
138
|
reflect: !0
|
|
135
|
-
})],
|
|
139
|
+
})], d.prototype, "name", void 0), t([l({
|
|
136
140
|
type: String,
|
|
137
141
|
reflect: !0
|
|
138
|
-
})],
|
|
142
|
+
})], d.prototype, "autocomplete", void 0), t([l({ type: Number })], d.prototype, "minlength", void 0), t([l({ type: Number })], d.prototype, "maxlength", void 0), t([l({ type: String })], d.prototype, "pattern", void 0), t([l({
|
|
139
143
|
type: String,
|
|
140
144
|
attribute: "inputmode"
|
|
141
|
-
})],
|
|
145
|
+
})], d.prototype, "inputMode", void 0), t([l({
|
|
142
146
|
type: String,
|
|
143
147
|
attribute: "enterkeyhint"
|
|
144
|
-
})],
|
|
148
|
+
})], d.prototype, "enterKeyHint", void 0), t([l({ type: String })], d.prototype, "autocapitalize", void 0), t([l({
|
|
145
149
|
type: String,
|
|
146
150
|
attribute: "spellcheck"
|
|
147
|
-
})],
|
|
151
|
+
})], d.prototype, "spellcheckAttr", void 0), t([l({
|
|
148
152
|
type: String,
|
|
149
153
|
reflect: !0
|
|
150
|
-
})],
|
|
154
|
+
})], d.prototype, "size", void 0), t([l({
|
|
151
155
|
type: String,
|
|
152
156
|
reflect: !0
|
|
153
|
-
})],
|
|
157
|
+
})], d.prototype, "color", void 0), t([l({
|
|
154
158
|
type: String,
|
|
155
159
|
reflect: !0
|
|
156
|
-
})],
|
|
160
|
+
})], d.prototype, "type", void 0), t([l({
|
|
157
161
|
type: String,
|
|
158
162
|
reflect: !0
|
|
159
|
-
})],
|
|
163
|
+
})], d.prototype, "icon", void 0), t([l({
|
|
160
164
|
type: String,
|
|
161
165
|
attribute: "action-label"
|
|
162
|
-
})],
|
|
166
|
+
})], d.prototype, "actionLabel", void 0), t([l({
|
|
163
167
|
type: String,
|
|
164
168
|
reflect: !0,
|
|
165
169
|
attribute: "icon-side"
|
|
166
|
-
})],
|
|
170
|
+
})], d.prototype, "iconSide", void 0), t([l({
|
|
167
171
|
type: String,
|
|
168
172
|
reflect: !0,
|
|
169
173
|
attribute: "tooltip-side"
|
|
170
|
-
})],
|
|
174
|
+
})], d.prototype, "tooltipSide", void 0), customElements.get("void-action-input") || customElements.define("void-action-input", d);
|
|
171
175
|
//#endregion
|
|
172
|
-
export {
|
|
176
|
+
export { d as VoidActionInput };
|
|
@@ -1,28 +1,29 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
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";
|
|
9
10
|
//#region src/components/bar-chart.ts
|
|
10
|
-
|
|
11
|
-
function
|
|
11
|
+
r();
|
|
12
|
+
function _(e) {
|
|
12
13
|
return 1 - (1 - e) ** 3;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function v(e) {
|
|
15
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);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function y(e) {
|
|
18
19
|
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function b(e) {
|
|
21
22
|
if (e <= 0) return 1;
|
|
22
23
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
23
24
|
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 5 ? 5 : 10) * t;
|
|
24
25
|
}
|
|
25
|
-
var
|
|
26
|
+
var x = class extends e {
|
|
26
27
|
constructor(...e) {
|
|
27
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) => {
|
|
28
29
|
let t = e - this._animStart, n = !1;
|
|
@@ -32,7 +33,7 @@ var b = class extends e {
|
|
|
32
33
|
else if (t >= o) this._display.set(e, r);
|
|
33
34
|
else {
|
|
34
35
|
let i = (t - a) / this._animDuration;
|
|
35
|
-
this._display.set(e, s + (r - s) *
|
|
36
|
+
this._display.set(e, s + (r - s) * _(i)), n = !0;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
this.requestUpdate(), n ? this._rafHandle = requestAnimationFrame(this._tick) : this._phase = "idle";
|
|
@@ -42,11 +43,11 @@ var b = class extends e {
|
|
|
42
43
|
return this._data;
|
|
43
44
|
}
|
|
44
45
|
set data(e) {
|
|
45
|
-
let t =
|
|
46
|
+
let t = l(e, this._source, {
|
|
46
47
|
attr: "data",
|
|
47
48
|
shape: "{\"series\":[{\"name\":\"Sales\",\"values\":[3,5]}],\"labels\":[\"Mon\",\"Tue\"]}",
|
|
48
49
|
empty: () => ({ series: [] }),
|
|
49
|
-
normalize:
|
|
50
|
+
normalize: o,
|
|
50
51
|
warn: (e, t) => this.reportDev("invalid-data", e, t)
|
|
51
52
|
});
|
|
52
53
|
if (!t) return;
|
|
@@ -80,9 +81,9 @@ var b = class extends e {
|
|
|
80
81
|
}
|
|
81
82
|
render() {
|
|
82
83
|
let { series: e, labels: t = [] } = this._data;
|
|
83
|
-
if (e.length === 0) return
|
|
84
|
-
let n = this.height - 16 - 32,
|
|
85
|
-
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`
|
|
86
87
|
<svg
|
|
87
88
|
viewBox="0 0 600 ${this.height}"
|
|
88
89
|
preserveAspectRatio="none"
|
|
@@ -91,30 +92,30 @@ var b = class extends e {
|
|
|
91
92
|
>
|
|
92
93
|
<g class="void-bar-chart-grid">
|
|
93
94
|
${g.map((e) => {
|
|
94
|
-
let t =
|
|
95
|
-
return
|
|
95
|
+
let t = u.scale(e);
|
|
96
|
+
return p`<line x1=${40} x2=${584} y1=${t} y2=${t}></line>`;
|
|
96
97
|
})}
|
|
97
98
|
</g>
|
|
98
99
|
|
|
99
|
-
${l < 0 ?
|
|
100
|
+
${l < 0 ? p`<line class="void-bar-chart-baseline" x1=${40} x2=${584} y1=${m} y2=${m}></line>` : f}
|
|
100
101
|
|
|
101
102
|
<g class="void-bar-chart-y-axis">
|
|
102
|
-
${g.map((e) =>
|
|
103
|
+
${g.map((e) => p`<text x=${32} y=${u.scale(e)} dy="0.32em" text-anchor="end">${v(e)}</text>`)}
|
|
103
104
|
</g>
|
|
104
105
|
|
|
105
106
|
${e.map((t, n) => {
|
|
106
107
|
let r = t.color ?? `var(--void-chart-series-${n % 6 + 1})`, i = h.bandwidth / e.length;
|
|
107
|
-
return
|
|
108
|
+
return p`
|
|
108
109
|
<g class="void-bar-chart-series" style="--series-color: ${r}">
|
|
109
110
|
${t.values.map((e, r) => {
|
|
110
|
-
let a = this._display.get(this._key(n, r)) ?? 0, o = h.scale(r) + i * n, s =
|
|
111
|
-
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
|
|
112
113
|
class="void-bar-chart-bar"
|
|
113
114
|
x=${o}
|
|
114
115
|
y=${c}
|
|
115
116
|
width=${i - 2}
|
|
116
117
|
height=${l}
|
|
117
|
-
style=${
|
|
118
|
+
style=${d ? `--series-color: ${d}` : f}
|
|
118
119
|
></rect>`;
|
|
119
120
|
})}
|
|
120
121
|
</g>
|
|
@@ -123,43 +124,43 @@ var b = class extends e {
|
|
|
123
124
|
|
|
124
125
|
${this.showValue ? e.map((t, n) => {
|
|
125
126
|
let r = h.bandwidth / e.length;
|
|
126
|
-
return
|
|
127
|
+
return p`
|
|
127
128
|
<g class="void-bar-chart-values">
|
|
128
129
|
${t.values.map((e, t) => {
|
|
129
|
-
let i = this._display.get(this._key(n, t)) ?? 0, a = h.scale(t) + r * n + (r - 2) / 2, o =
|
|
130
|
-
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>`;
|
|
131
132
|
})}
|
|
132
133
|
</g>
|
|
133
134
|
`;
|
|
134
|
-
}) :
|
|
135
|
+
}) : f}
|
|
135
136
|
|
|
136
137
|
<g class="void-bar-chart-x-axis">
|
|
137
|
-
${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>`)}
|
|
138
139
|
</g>
|
|
139
140
|
</svg>
|
|
140
141
|
${this._table()}
|
|
141
142
|
`;
|
|
142
143
|
}
|
|
143
144
|
_table() {
|
|
144
|
-
let e = this._data, t = this.ariaLabel || "
|
|
145
|
-
return
|
|
145
|
+
let e = this._data, t = this.ariaLabel || n(this, "chart.bar");
|
|
146
|
+
return g([
|
|
146
147
|
e,
|
|
147
148
|
t,
|
|
148
|
-
|
|
149
|
-
], () =>
|
|
149
|
+
u(this)
|
|
150
|
+
], () => c("void-bar-chart-table", s(this, t, e.series, e.labels ?? [])));
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
|
-
t([
|
|
153
|
+
t([m({
|
|
153
154
|
type: Number,
|
|
154
155
|
reflect: !0
|
|
155
|
-
})],
|
|
156
|
+
})], x.prototype, "height", void 0), t([m({
|
|
156
157
|
type: Boolean,
|
|
157
158
|
attribute: "show-value",
|
|
158
159
|
reflect: !0
|
|
159
|
-
})],
|
|
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({
|
|
160
161
|
type: Boolean,
|
|
161
162
|
attribute: "show-table",
|
|
162
163
|
reflect: !0
|
|
163
|
-
})],
|
|
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);
|
|
164
165
|
//#endregion
|
|
165
|
-
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
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
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 };
|