@voidable/ui 0.6.0 → 0.8.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 +168 -9
- package/dist/angular/index.d.ts +20 -0
- package/dist/angular/index.js +78 -0
- package/dist/autoloader-core.d.ts +45 -0
- package/dist/autoloader-table.generated.d.ts +5 -0
- package/dist/autoloader.d.ts +13 -0
- package/dist/autoloader.js +229 -0
- package/dist/base.d.ts +173 -2
- package/dist/base.js +2 -9
- package/dist/chunks/base-CMruMbxC.js +824 -0
- package/dist/chunks/{decorate-DKuCkHK4.js → decorate-CaYbmmmm.js} +1 -1
- package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
- package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
- package/dist/chunks/form-control-C0vH6gii.js +300 -0
- package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
- package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
- package/dist/chunks/modal-D_YVy2vg.js +71 -0
- package/dist/chunks/overlay-BywGMcDW.js +467 -0
- package/dist/chunks/parts-D30c8OoG.js +229 -0
- package/dist/chunks/{shape-DmgCwYvY.js → shape-C_LW7EjG.js} +12 -4
- package/dist/components/accordion.d.ts +38 -10
- package/dist/components/accordion.js +52 -54
- package/dist/components/action-input.d.ts +64 -6
- package/dist/components/action-input.js +85 -42
- package/dist/components/alert.d.ts +24 -10
- package/dist/components/alert.js +27 -28
- package/dist/components/avatar.d.ts +8 -2
- package/dist/components/avatar.js +4 -4
- package/dist/components/badge.d.ts +8 -3
- package/dist/components/badge.js +3 -3
- package/dist/components/banner.d.ts +21 -10
- package/dist/components/banner.js +28 -28
- package/dist/components/bar-chart.d.ts +30 -6
- package/dist/components/bar-chart.js +29 -39
- package/dist/components/breadcrumbs.d.ts +19 -6
- package/dist/components/breadcrumbs.js +17 -23
- package/dist/components/button.d.ts +64 -10
- package/dist/components/button.js +71 -27
- package/dist/components/calendar.d.ts +65 -10
- package/dist/components/calendar.js +158 -107
- package/dist/components/card.d.ts +14 -9
- package/dist/components/card.js +9 -23
- package/dist/components/carousel.d.ts +65 -14
- package/dist/components/carousel.js +85 -94
- package/dist/components/charts/scale.d.ts +0 -1
- package/dist/components/charts/shape.d.ts +0 -1
- package/dist/components/checkbox-group.d.ts +38 -5
- package/dist/components/checkbox-group.js +61 -20
- package/dist/components/checkbox.d.ts +53 -7
- package/dist/components/checkbox.js +66 -29
- package/dist/components/collapsible.d.ts +29 -9
- package/dist/components/collapsible.js +43 -45
- package/dist/components/color-picker.d.ts +20 -4
- package/dist/components/color-picker.js +36 -30
- package/dist/components/combobox.d.ts +84 -10
- package/dist/components/combobox.js +142 -45
- package/dist/components/compose-input.d.ts +8 -1
- package/dist/components/compose-input.js +10 -4
- package/dist/components/dialog.d.ts +24 -20
- package/dist/components/dialog.js +8 -57
- package/dist/components/divider.d.ts +8 -1
- package/dist/components/divider.js +4 -4
- package/dist/components/donut-chart.d.ts +28 -5
- package/dist/components/donut-chart.js +55 -54
- package/dist/components/drawer.d.ts +19 -18
- package/dist/components/drawer.js +9 -53
- package/dist/components/dropdown-menu.d.ts +62 -7
- package/dist/components/dropdown-menu.js +125 -34
- package/dist/components/editable.d.ts +37 -3
- package/dist/components/editable.js +45 -24
- package/dist/components/error-fallback.d.ts +36 -5
- package/dist/components/error-fallback.js +74 -24
- package/dist/components/field.d.ts +38 -4
- package/dist/components/field.js +63 -21
- package/dist/components/file-upload.d.ts +23 -2
- package/dist/components/file-upload.js +48 -25
- package/dist/components/gauge.d.ts +48 -9
- package/dist/components/gauge.js +57 -55
- package/dist/components/hamburger.d.ts +19 -4
- package/dist/components/hamburger.js +29 -20
- package/dist/components/hover-card.d.ts +40 -14
- package/dist/components/hover-card.js +77 -60
- package/dist/components/indicator.d.ts +18 -7
- package/dist/components/indicator.js +17 -19
- package/dist/components/input.d.ts +70 -5
- package/dist/components/input.js +84 -21
- package/dist/components/line-chart.d.ts +27 -5
- package/dist/components/line-chart.js +19 -21
- package/dist/components/list.d.ts +10 -1
- package/dist/components/list.js +4 -4
- package/dist/components/menu.d.ts +67 -21
- package/dist/components/menu.js +117 -116
- package/dist/components/multiselect.d.ts +108 -13
- package/dist/components/multiselect.js +207 -70
- package/dist/components/nav-bar.d.ts +12 -7
- package/dist/components/nav-bar.js +12 -22
- package/dist/components/nav-menu.d.ts +52 -12
- package/dist/components/nav-menu.js +69 -71
- package/dist/components/number-input.d.ts +76 -8
- package/dist/components/number-input.js +117 -51
- package/dist/components/pagination.d.ts +19 -1
- package/dist/components/pagination.js +69 -8
- package/dist/components/panel.d.ts +16 -8
- package/dist/components/panel.js +21 -21
- package/dist/components/pin-input.d.ts +41 -4
- package/dist/components/pin-input.js +45 -27
- package/dist/components/popover.d.ts +29 -11
- package/dist/components/popover.js +48 -36
- package/dist/components/progress.d.ts +7 -3
- package/dist/components/progress.js +4 -4
- package/dist/components/radio-group.d.ts +30 -5
- package/dist/components/radio-group.js +56 -19
- package/dist/components/radio.d.ts +47 -7
- package/dist/components/radio.js +68 -29
- package/dist/components/scroll-area.d.ts +8 -5
- package/dist/components/scroll-area.js +19 -20
- package/dist/components/segmented-control.d.ts +52 -8
- package/dist/components/segmented-control.js +67 -37
- package/dist/components/select.d.ts +59 -12
- package/dist/components/select.js +97 -47
- package/dist/components/sidebar.d.ts +22 -3
- package/dist/components/sidebar.js +21 -11
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +5 -5
- package/dist/components/slider.d.ts +27 -5
- package/dist/components/slider.js +30 -18
- package/dist/components/spinner.d.ts +6 -2
- package/dist/components/spinner.js +4 -4
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +8 -4
- package/dist/components/status-dot.d.ts +4 -1
- package/dist/components/status-dot.js +4 -4
- package/dist/components/stepper.d.ts +5 -1
- package/dist/components/stepper.js +3 -3
- package/dist/components/switch.d.ts +24 -5
- package/dist/components/switch.js +38 -20
- package/dist/components/table.d.ts +51 -2
- package/dist/components/table.js +158 -9
- package/dist/components/tabs.d.ts +49 -17
- package/dist/components/tabs.js +86 -55
- package/dist/components/tag.d.ts +17 -7
- package/dist/components/tag.js +19 -21
- package/dist/components/tags-input.d.ts +33 -4
- package/dist/components/tags-input.js +41 -31
- package/dist/components/textarea.d.ts +61 -5
- package/dist/components/textarea.js +59 -22
- package/dist/components/toast.d.ts +89 -15
- package/dist/components/toast.js +106 -31
- package/dist/components/toggle-group.d.ts +30 -3
- package/dist/components/toggle-group.js +44 -17
- package/dist/components/toggle.d.ts +25 -4
- package/dist/components/toggle.js +29 -19
- package/dist/components/tooltip.d.ts +31 -12
- package/dist/components/tooltip.js +63 -29
- package/dist/components.json +1518 -0
- package/dist/custom-elements.json +31817 -0
- package/dist/dev/index.d.ts +40 -0
- package/dist/dev/rules.d.ts +46 -0
- package/dist/dev/table.generated.d.ts +8 -0
- package/dist/dev/types.d.ts +113 -0
- package/dist/dev.js +3364 -0
- package/dist/disclosure.d.ts +30 -0
- package/dist/dismiss.d.ts +20 -0
- package/dist/form-control.d.ts +92 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -24
- package/dist/keyboard-activation.d.ts +31 -0
- package/dist/keyboard.d.ts +32 -0
- package/dist/modal.d.ts +44 -0
- package/dist/overlay.d.ts +249 -0
- package/dist/parts.d.ts +171 -0
- package/dist/projection.d.ts +370 -0
- package/dist/types/elements.d.ts +648 -0
- package/dist/types/react.d.ts +163 -0
- package/dist/types/solid.d.ts +164 -0
- package/dist/types/solid2.d.ts +161 -0
- package/dist/types/svelte.d.ts +154 -0
- package/dist/types/vue.d.ts +156 -0
- package/dist/vscode.html-custom-data.json +6004 -0
- package/dist/web-types.json +8365 -0
- package/package.json +113 -25
- package/dist/base.d.ts.map +0 -1
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/action-input.d.ts.map +0 -1
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/bar-chart.d.ts.map +0 -1
- package/dist/components/breadcrumbs.d.ts.map +0 -1
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/charts/scale.d.ts.map +0 -1
- package/dist/components/charts/shape.d.ts.map +0 -1
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/color-picker.d.ts.map +0 -1
- package/dist/components/combobox.d.ts.map +0 -1
- package/dist/components/compose-input.d.ts.map +0 -1
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/donut-chart.d.ts.map +0 -1
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/editable.d.ts.map +0 -1
- package/dist/components/error-fallback.d.ts.map +0 -1
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/file-upload.d.ts.map +0 -1
- package/dist/components/gauge.d.ts.map +0 -1
- package/dist/components/hamburger.d.ts.map +0 -1
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/indicator.d.ts.map +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/line-chart.d.ts.map +0 -1
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/menu.d.ts.map +0 -1
- package/dist/components/multiselect.d.ts.map +0 -1
- package/dist/components/nav-bar.d.ts.map +0 -1
- package/dist/components/nav-menu.d.ts.map +0 -1
- package/dist/components/number-input.d.ts.map +0 -1
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/pin-input.d.ts.map +0 -1
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/segmented-control.d.ts.map +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/stat.d.ts.map +0 -1
- package/dist/components/status-dot.d.ts.map +0 -1
- package/dist/components/stepper.d.ts.map +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tag.d.ts.map +0 -1
- package/dist/components/tags-input.d.ts.map +0 -1
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- /package/dist/chunks/{scale-BFZNL3Ss.js → scale-_ccSuoYg.js} +0 -0
|
@@ -1,122 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
3
|
-
import {
|
|
1
|
+
import { t as e } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-D30c8OoG.js";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
4
5
|
//#region src/components/nav-menu.ts
|
|
5
|
-
var
|
|
6
|
+
var a = class extends e {
|
|
6
7
|
constructor(...e) {
|
|
7
8
|
super(...e), this.orientation = "horizontal", this.width = "", this._handleItemOpen = (e) => {
|
|
8
|
-
let t = e.target
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})));
|
|
9
|
+
let t = e.target;
|
|
10
|
+
if (!(t instanceof o)) return;
|
|
11
|
+
let n = e.detail?.reason === "hover" ? "hover" : "outside";
|
|
12
|
+
for (let e of this._getItems()) e !== t && e.open && e._closeDropdown(n);
|
|
13
13
|
}, this._handleKeydown = (e) => {
|
|
14
14
|
let t = this._getItems();
|
|
15
15
|
if (!t.length) return;
|
|
16
16
|
let n = this.orientation === "horizontal", r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp";
|
|
17
17
|
if (e.key === r || e.key === i) {
|
|
18
|
-
e.
|
|
19
|
-
|
|
20
|
-
e.key === r ? (n[i + 1] ?? n[0])?.focus() : (n[i - 1] ?? n[n.length - 1])?.focus();
|
|
18
|
+
let n = t.map((e) => e._control()).filter((e) => !!e), i = n.indexOf(document.activeElement);
|
|
19
|
+
if (i < 0) return;
|
|
20
|
+
e.preventDefault(), e.key === r ? (n[i + 1] ?? n[0])?.focus() : (n[i - 1] ?? n[n.length - 1])?.focus();
|
|
21
|
+
return;
|
|
21
22
|
}
|
|
22
|
-
if (e.key === "
|
|
23
|
-
let t = document.activeElement?.closest?.("void-nav-menu-item");
|
|
24
|
-
t && this.contains(t) && !t.href && (e.preventDefault(), t.open = !t.open, t.open ? t.dispatchEvent(new CustomEvent("void-open", {
|
|
25
|
-
bubbles: !0,
|
|
26
|
-
composed: !0
|
|
27
|
-
})) : t.dispatchEvent(new CustomEvent("void-close", {
|
|
28
|
-
bubbles: !0,
|
|
29
|
-
composed: !0
|
|
30
|
-
})));
|
|
31
|
-
}
|
|
32
|
-
if (e.key === "Escape") for (let e of t) e.open && (e.open = !1, e.dispatchEvent(new CustomEvent("void-close", {
|
|
33
|
-
bubbles: !0,
|
|
34
|
-
composed: !0
|
|
35
|
-
})), e.querySelector(".void-nav-menu-trigger")?.focus());
|
|
23
|
+
if (e.key === "Escape") for (let e of t) e.open && (e._closeDropdown("escape"), e._control()?.focus());
|
|
36
24
|
};
|
|
37
25
|
}
|
|
38
26
|
connectedCallback() {
|
|
39
|
-
super.connectedCallback(), this.
|
|
27
|
+
super.connectedCallback(), this.setHostAttribute("role", "menubar"), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("void-open", this._handleItemOpen, !0);
|
|
40
28
|
}
|
|
41
29
|
disconnectedCallback() {
|
|
42
|
-
super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown), this.removeEventListener("void-open", this._handleItemOpen);
|
|
30
|
+
super.disconnectedCallback(), this.removeEventListener("keydown", this._handleKeydown), this.removeEventListener("void-open", this._handleItemOpen, !0);
|
|
43
31
|
}
|
|
44
32
|
updated(e) {
|
|
45
|
-
super.updated(e), e.has("width") && (this.width ? this.
|
|
33
|
+
super.updated(e), e.has("width") && (this.width ? this.setHostStyle("--void-nav-menu-width", this.width) : this.setHostStyle("--void-nav-menu-width", null));
|
|
46
34
|
}
|
|
47
35
|
_getItems() {
|
|
48
|
-
return Array.from(this.querySelectorAll("
|
|
36
|
+
return Array.from(this.querySelectorAll("void-nav-menu-item")).filter((e) => e.closest("void-nav-menu") === this);
|
|
49
37
|
}
|
|
50
38
|
};
|
|
51
|
-
t([
|
|
39
|
+
t([i({
|
|
52
40
|
type: String,
|
|
53
41
|
reflect: !0
|
|
54
|
-
})],
|
|
42
|
+
})], a.prototype, "orientation", void 0), t([i({
|
|
55
43
|
type: String,
|
|
56
44
|
reflect: !0
|
|
57
|
-
})],
|
|
58
|
-
var
|
|
45
|
+
})], a.prototype, "width", void 0), customElements.get("void-nav-menu") || customElements.define("void-nav-menu", a);
|
|
46
|
+
var o = class extends e {
|
|
59
47
|
constructor(...e) {
|
|
60
|
-
super(...e), this.open = !1, this.disabled = !1, this.
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
super(...e), this.open = !1, this.disabled = !1, this.current = !1, this._openedByHover = !1, this._parts = new r(this, {
|
|
49
|
+
tags: ["void-nav-menu-trigger", "void-nav-menu-content"],
|
|
50
|
+
onChange: () => this._wire()
|
|
51
|
+
}), this._onClick = (e) => {
|
|
52
|
+
let t = this._parts.one("void-nav-menu-trigger");
|
|
53
|
+
if (!t || !t.contains(e.target)) return;
|
|
54
|
+
let n = this._control();
|
|
55
|
+
this.disabled || !this._hasContent || this._isLink(n) || (clearTimeout(this._openTimerId), this.open ? this._openedByHover ? this._openedByHover = !1 : this._closeDropdown("trigger") : (this._openedByHover = !1, this._openDropdown("trigger")));
|
|
56
|
+
}, this._onMouseEnter = () => {
|
|
57
|
+
this.disabled || !this._hasContent || (clearTimeout(this._closeTimerId), this._openTimerId = setTimeout(() => {
|
|
58
|
+
this.open || (this._openedByHover = !0), this._openDropdown("hover");
|
|
63
59
|
}, 150));
|
|
64
60
|
}, this._onMouseLeave = () => {
|
|
65
|
-
this.
|
|
66
|
-
this._closeDropdown();
|
|
61
|
+
this._hasContent && (clearTimeout(this._openTimerId), this._closeTimerId = setTimeout(() => {
|
|
62
|
+
this._closeDropdown("hover");
|
|
67
63
|
}, 300));
|
|
68
|
-
}, this.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this._closeTimerId = setTimeout(() => {
|
|
72
|
-
this._closeDropdown();
|
|
73
|
-
}, 300);
|
|
64
|
+
}, this._onFocusOut = (e) => {
|
|
65
|
+
let t = e.relatedTarget;
|
|
66
|
+
this.open && t && !this.contains(t) && this._closeDropdown("blur");
|
|
74
67
|
}, this._onOutsideClick = (e) => {
|
|
75
|
-
this.open && !this.contains(e.target) && this._closeDropdown();
|
|
68
|
+
this.open && !this.contains(e.target) && this._closeDropdown("outside");
|
|
76
69
|
};
|
|
77
70
|
}
|
|
71
|
+
_control() {
|
|
72
|
+
return n(this._parts.one("void-nav-menu-trigger"));
|
|
73
|
+
}
|
|
74
|
+
_content() {
|
|
75
|
+
return this._parts.one("void-nav-menu-content");
|
|
76
|
+
}
|
|
77
|
+
get _hasContent() {
|
|
78
|
+
return !!this._content();
|
|
79
|
+
}
|
|
80
|
+
_isLink(e) {
|
|
81
|
+
return !!e?.matches("a[href]");
|
|
82
|
+
}
|
|
83
|
+
_wire() {
|
|
84
|
+
let e = this._control(), t = this._content();
|
|
85
|
+
e && (this._parts.provide(e, "role", "menuitem"), t && (this._parts.set(e, "aria-haspopup", "true"), this._parts.set(e, "aria-expanded", String(this.open)), this._parts.set(e, "aria-controls", this._parts.id(t, "void-nav-menu-content"))), this.current && this._isLink(e) && this._parts.set(e, "aria-current", "page"), this.disabled && (this._parts.set(e, "aria-disabled", "true"), e.matches("button, void-button, input") ? this._parts.set(e, "disabled", !0) : this._parts.set(e, "tabindex", "-1"))), t && this._parts.provide(t, "role", "menu");
|
|
86
|
+
}
|
|
78
87
|
connectedCallback() {
|
|
79
|
-
super.connectedCallback(), this.
|
|
88
|
+
super.connectedCallback(), this.setHostAttribute("role", "none"), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("click", this._onClick), this.addEventListener("focusout", this._onFocusOut), document.addEventListener("mousedown", this._onOutsideClick);
|
|
80
89
|
}
|
|
81
90
|
disconnectedCallback() {
|
|
82
|
-
super.disconnectedCallback(), clearTimeout(this._openTimerId), clearTimeout(this._closeTimerId), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), document.removeEventListener("mousedown", this._onOutsideClick);
|
|
91
|
+
super.disconnectedCallback(), clearTimeout(this._openTimerId), clearTimeout(this._closeTimerId), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("click", this._onClick), this.removeEventListener("focusout", this._onFocusOut), document.removeEventListener("mousedown", this._onOutsideClick);
|
|
83
92
|
}
|
|
84
93
|
updated(e) {
|
|
85
|
-
|
|
86
|
-
this._didSetup = !0, this.href ? (this._triggerEl = document.createElement("a"), this._triggerEl.href = this.href) : (this._triggerEl = document.createElement("button"), this._triggerEl.type = "button"), this._triggerEl.className = "void-nav-menu-trigger", this._triggerEl.setAttribute("role", "menuitem"), this._triggerEl.setAttribute("tabindex", this.disabled ? "-1" : "0");
|
|
87
|
-
let e = [], t = [];
|
|
88
|
-
for (let n of this._contentNodes) n.nodeType === Node.TEXT_NODE && n.textContent?.trim() ? e.push(n) : n.nodeType === Node.ELEMENT_NODE && t.push(n);
|
|
89
|
-
for (let t of e) this._triggerEl.appendChild(t);
|
|
90
|
-
if (this.appendChild(this._triggerEl), t.length > 0) {
|
|
91
|
-
this._triggerEl.setAttribute("aria-haspopup", "true"), this._triggerEl.setAttribute("aria-expanded", String(this.open)), this._contentEl = document.createElement("div"), this._contentEl.className = "void-nav-menu-content", this._contentEl.setAttribute("role", "menu");
|
|
92
|
-
for (let e of t) this._contentEl.appendChild(e);
|
|
93
|
-
this._contentEl.addEventListener("mouseenter", this._onContentEnter), this._contentEl.addEventListener("mouseleave", this._onContentLeave), this.appendChild(this._contentEl);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
e.has("open") && this._triggerEl && this._triggerEl.setAttribute("aria-expanded", String(this.open)), e.has("disabled") && this._triggerEl && (this._triggerEl.setAttribute("tabindex", this.disabled ? "-1" : "0"), this._triggerEl.setAttribute("aria-disabled", String(this.disabled)), this._triggerEl instanceof HTMLButtonElement && (this._triggerEl.disabled = this.disabled)), e.has("href") && this._triggerEl instanceof HTMLAnchorElement && (this._triggerEl.href = this.href);
|
|
94
|
+
super.updated(e), (e.has("open") || e.has("disabled") || e.has("current")) && this._parts.sync();
|
|
97
95
|
}
|
|
98
|
-
_openDropdown() {
|
|
96
|
+
_openDropdown(e) {
|
|
99
97
|
this.open || (this.open = !0, this.dispatchEvent(new CustomEvent("void-open", {
|
|
100
|
-
bubbles: !
|
|
101
|
-
|
|
98
|
+
bubbles: !1,
|
|
99
|
+
detail: { reason: e }
|
|
102
100
|
})));
|
|
103
101
|
}
|
|
104
|
-
_closeDropdown() {
|
|
102
|
+
_closeDropdown(e) {
|
|
105
103
|
this.open && (this.open = !1, this.dispatchEvent(new CustomEvent("void-close", {
|
|
106
|
-
bubbles: !
|
|
107
|
-
|
|
104
|
+
bubbles: !1,
|
|
105
|
+
detail: { reason: e }
|
|
108
106
|
})));
|
|
109
107
|
}
|
|
110
108
|
};
|
|
111
|
-
t([
|
|
109
|
+
t([i({
|
|
112
110
|
type: Boolean,
|
|
113
111
|
reflect: !0
|
|
114
|
-
})],
|
|
112
|
+
})], o.prototype, "open", void 0), t([i({
|
|
115
113
|
type: Boolean,
|
|
116
114
|
reflect: !0
|
|
117
|
-
})],
|
|
115
|
+
})], o.prototype, "disabled", void 0), t([i({
|
|
118
116
|
type: Boolean,
|
|
119
117
|
reflect: !0
|
|
120
|
-
})],
|
|
118
|
+
})], o.prototype, "current", void 0), customElements.get("void-nav-menu-item") || customElements.define("void-nav-menu-item", o);
|
|
121
119
|
//#endregion
|
|
122
|
-
export {
|
|
120
|
+
export { a as VoidNavMenu, o as VoidNavMenuItem };
|
|
@@ -1,37 +1,105 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { FormSubmission } from '../form-control.js';
|
|
3
|
+
declare const VoidNumberInput_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
4
|
+
/**
|
|
5
|
+
* Precise numeric entry for quantity selectors, price fields, and settings with increment/decrement controls.
|
|
6
|
+
* The host has no role: the native text input is the spinbutton (it carries the value, bounds and the accessible
|
|
7
|
+
* name, which `<void-field>` supplies), and the stepper buttons are its own buttons.
|
|
8
|
+
*/
|
|
9
|
+
export declare class VoidNumberInput extends VoidNumberInput_base {
|
|
10
|
+
/** The host's `aria-label` / `aria-labelledby` name the inner control. */
|
|
11
|
+
static labelTarget: string;
|
|
12
|
+
/** While focus is inside, a morph does not apply the server's value over what the user is typing. */
|
|
13
|
+
static editState: string[];
|
|
14
|
+
/**
|
|
15
|
+
* The number, or `null` while the field is empty (the default, and after the user clears it). As an
|
|
16
|
+
* attribute it is the initial value; an absent or empty attribute is an empty field. It is kept within
|
|
17
|
+
* `min` and `max` once the user commits an edit. An empty field submits an empty string, and with
|
|
18
|
+
* `required` it is invalid (`valueMissing`), as a native number field.
|
|
19
|
+
*/
|
|
20
|
+
value: number | null;
|
|
21
|
+
/** Lowest allowed value. Unbounded by default. */
|
|
5
22
|
min: number;
|
|
23
|
+
/** Highest allowed value. Unbounded by default. */
|
|
6
24
|
max: number;
|
|
7
|
-
|
|
25
|
+
/** Increment applied by the stepper buttons and arrow keys. `any` matches the native
|
|
26
|
+
input: no step constraint on typed values, and the buttons step by 1. */
|
|
27
|
+
step: number | 'any';
|
|
28
|
+
/** Number of decimals to round to; `0` gives integers. Unset (the default) leaves the value as entered. */
|
|
8
29
|
precision: number;
|
|
30
|
+
/** Stop the field and its stepper buttons reacting and exclude the value from the form submission. */
|
|
9
31
|
disabled: boolean;
|
|
32
|
+
/** Show the value but do not let the user change it; the field is still focusable and submitted. */
|
|
10
33
|
readonly: boolean;
|
|
34
|
+
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
11
35
|
size: 'sm' | 'md' | 'lg';
|
|
12
|
-
|
|
36
|
+
/** Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. */
|
|
37
|
+
color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
|
|
38
|
+
/** Hint text shown while the field is empty. */
|
|
13
39
|
placeholder: string;
|
|
40
|
+
/**
|
|
41
|
+
* Where the increment and decrement buttons go: `sides` (default, one each side), `right` (stacked at
|
|
42
|
+
* the right) or `none` (arrow keys only).
|
|
43
|
+
*/
|
|
14
44
|
controls: 'sides' | 'right' | 'none';
|
|
45
|
+
/**
|
|
46
|
+
* Accessible name of the field when it is not inside a `void-field`. Defaults to `Number input`, so
|
|
47
|
+
* set it.
|
|
48
|
+
*/
|
|
15
49
|
label: string;
|
|
50
|
+
/**
|
|
51
|
+
* Text drawn before the number inside the field, such as a currency symbol `$`. Display only; it is
|
|
52
|
+
* not part of the value.
|
|
53
|
+
*/
|
|
16
54
|
prefix: string;
|
|
55
|
+
/**
|
|
56
|
+
* Text drawn after the number inside the field, such as `kg`. Display only; it is not part of the
|
|
57
|
+
* value.
|
|
58
|
+
*/
|
|
17
59
|
unit: string;
|
|
18
60
|
private _pressTimer;
|
|
19
61
|
private _repeatTimer;
|
|
20
62
|
private _repeatInterval;
|
|
21
63
|
private _repeatCount;
|
|
64
|
+
/** Text the user typed since the last commit; null when the field shows `value`. */
|
|
65
|
+
private _pendingText;
|
|
66
|
+
/** Typed text survives re-renders and morphs until committed, unless the server changes `value`. */
|
|
67
|
+
static clientState: {
|
|
68
|
+
_pendingText: string;
|
|
69
|
+
};
|
|
22
70
|
private _input;
|
|
23
|
-
connectedCallback(): void;
|
|
24
|
-
updated(changed: Map<string, unknown>): void;
|
|
25
71
|
disconnectedCallback(): void;
|
|
72
|
+
protected formRestore(state: unknown): void;
|
|
73
|
+
/**
|
|
74
|
+
* Submits the committed value, or the typed text if it parses (clamped):
|
|
75
|
+
* a submit triggered while the field still has focus (requestSubmit from a
|
|
76
|
+
* shortcut or autosave) must not drop what the user typed.
|
|
77
|
+
*/
|
|
78
|
+
protected formSubmission(): FormSubmission;
|
|
26
79
|
private _clamp;
|
|
27
80
|
private _format;
|
|
81
|
+
/** Round to `precision` decimals (`precision="0"` gives integers); untouched when precision is unset. */
|
|
82
|
+
private _round;
|
|
28
83
|
private _commit;
|
|
84
|
+
/** Numeric step for the stepper buttons; `step="any"` steps by 1. */
|
|
85
|
+
private _stepSize;
|
|
86
|
+
/**
|
|
87
|
+
* Stepping from an empty field starts where a native number field does: up
|
|
88
|
+
* to `min` (or one step above zero without a minimum), down to `max` (or one
|
|
89
|
+
* step below zero).
|
|
90
|
+
*/
|
|
29
91
|
private _increment;
|
|
30
92
|
private _decrement;
|
|
93
|
+
private _canStep;
|
|
31
94
|
private _startRepeat;
|
|
95
|
+
/** Keyboard / assistive-tech activation: a native button click with detail 0 (pointer clicks are handled by pointerdown). */
|
|
96
|
+
private _onStepperClick;
|
|
32
97
|
private _stopRepeat;
|
|
33
98
|
private _onKeydown;
|
|
34
99
|
private _onBlur;
|
|
100
|
+
/** Keep the form value in step with the typed text. */
|
|
101
|
+
private _onFieldInput;
|
|
102
|
+
/** Commit on change: browsers fire it before Enter's implicit submission. */
|
|
35
103
|
private _onInputChange;
|
|
36
104
|
render(): import('lit').TemplateResult<1>;
|
|
37
105
|
}
|
|
@@ -40,4 +108,4 @@ declare global {
|
|
|
40
108
|
'void-number-input': VoidNumberInput;
|
|
41
109
|
}
|
|
42
110
|
}
|
|
43
|
-
|
|
111
|
+
export {};
|
|
@@ -1,32 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { r as e, t } from "../chunks/base-CMruMbxC.js";
|
|
2
|
+
import { t as n } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as r } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
+
import { html as i, nothing as a } from "lit";
|
|
5
|
+
import { property as o, query as s } from "lit/decorators.js";
|
|
6
|
+
import { live as c } from "lit/directives/live.js";
|
|
5
7
|
//#region src/components/number-input.ts
|
|
6
|
-
var
|
|
8
|
+
var l = class extends r(t) {
|
|
7
9
|
constructor(...e) {
|
|
8
|
-
super(...e), this.value =
|
|
10
|
+
super(...e), this.value = null, this.min = -Infinity, this.max = Infinity, this.step = 1, this.precision = -1, this.disabled = !1, this.readonly = !1, this.size = "md", this.color = "default", this.placeholder = "", this.controls = "sides", this.label = "", this.prefix = "", this.unit = "", this._pressTimer = null, this._repeatTimer = null, this._repeatInterval = 300, this._repeatCount = 0, this._pendingText = null;
|
|
9
11
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
static {
|
|
13
|
+
this.labelTarget = "input[role=spinbutton]";
|
|
12
14
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
static {
|
|
16
|
+
this.editState = ["value"];
|
|
17
|
+
}
|
|
18
|
+
static {
|
|
19
|
+
this.clientState = { _pendingText: "value" };
|
|
15
20
|
}
|
|
16
21
|
disconnectedCallback() {
|
|
17
22
|
super.disconnectedCallback(), this._stopRepeat();
|
|
18
23
|
}
|
|
24
|
+
formRestore(e) {
|
|
25
|
+
this._pendingText = null, this.value = e == null || e === "" ? null : Number(e);
|
|
26
|
+
}
|
|
27
|
+
formSubmission() {
|
|
28
|
+
let e = this._pendingText;
|
|
29
|
+
if (e !== null) {
|
|
30
|
+
let t = parseFloat(e);
|
|
31
|
+
if (!isNaN(t)) return String(this._clamp(t));
|
|
32
|
+
if (!e.trim()) return "";
|
|
33
|
+
}
|
|
34
|
+
return this.value === null ? "" : String(this.value);
|
|
35
|
+
}
|
|
19
36
|
_clamp(e) {
|
|
20
37
|
return Math.min(Math.max(e, this.min), this.max);
|
|
21
38
|
}
|
|
22
39
|
_format(e) {
|
|
23
40
|
return this.precision >= 0 ? e.toFixed(this.precision) : String(e);
|
|
24
41
|
}
|
|
42
|
+
_round(e) {
|
|
43
|
+
return this.precision >= 0 ? Number(e.toFixed(this.precision)) : e;
|
|
44
|
+
}
|
|
25
45
|
_commit(e) {
|
|
26
|
-
let t = this._clamp(e);
|
|
46
|
+
let t = e === null ? null : this._clamp(this._round(e));
|
|
27
47
|
if (t === this.value) return;
|
|
48
|
+
this._pendingText = null;
|
|
28
49
|
let n = this.value;
|
|
29
|
-
this.value = t, this._input && (this._input.value = this._format(t)), this.dispatchEvent(new CustomEvent("void-change", {
|
|
50
|
+
this.value = t, this._input && (this._input.value = t === null ? "" : this._format(t)), this.dispatchEvent(new CustomEvent("void-change", {
|
|
30
51
|
bubbles: !0,
|
|
31
52
|
composed: !0,
|
|
32
53
|
detail: {
|
|
@@ -35,64 +56,97 @@ var o = class extends e {
|
|
|
35
56
|
}
|
|
36
57
|
}));
|
|
37
58
|
}
|
|
59
|
+
_stepSize() {
|
|
60
|
+
return typeof this.step == "number" && Number.isFinite(this.step) && this.step > 0 ? this.step : 1;
|
|
61
|
+
}
|
|
38
62
|
_increment() {
|
|
39
|
-
this.
|
|
63
|
+
if (this.formDisabled || this.readonly) return;
|
|
64
|
+
let e = this._stepSize();
|
|
65
|
+
this._commit((this.value ?? (Number.isFinite(this.min) ? this.min - e : 0)) + e);
|
|
40
66
|
}
|
|
41
67
|
_decrement() {
|
|
42
|
-
this.
|
|
68
|
+
if (this.formDisabled || this.readonly) return;
|
|
69
|
+
let e = this._stepSize();
|
|
70
|
+
this._commit((this.value ?? (Number.isFinite(this.max) ? this.max + e : 0)) - e);
|
|
71
|
+
}
|
|
72
|
+
_canStep(e) {
|
|
73
|
+
return this.formDisabled || this.readonly ? !1 : this.value === null ? !0 : e > 0 ? this.value < this.max : this.value > this.min;
|
|
43
74
|
}
|
|
44
75
|
_startRepeat(e) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
if (this._stopRepeat(), !this._canStep(e)) return;
|
|
77
|
+
let t = () => this._canStep(e) ? (e > 0 ? this._increment() : this._decrement(), this._canStep(e) || this._stopRepeat(), !0) : (this._stopRepeat(), !1);
|
|
78
|
+
t(), this._canStep(e) && (this._pressTimer = setTimeout(() => {
|
|
79
|
+
this._pressTimer = null, this._repeatInterval = 300, this._repeatCount = 0;
|
|
80
|
+
let e = () => {
|
|
81
|
+
this._repeatTimer = setInterval(() => {
|
|
82
|
+
if (t() && (this._repeatCount++, this._repeatCount % 5 == 0 && this._repeatInterval > 50 && this._repeatTimer !== null)) {
|
|
83
|
+
let t = Math.max(50, Math.floor(this._repeatInterval / 2));
|
|
84
|
+
t !== this._repeatInterval && (this._repeatInterval = t, clearInterval(this._repeatTimer), e());
|
|
85
|
+
}
|
|
86
|
+
}, this._repeatInterval);
|
|
87
|
+
};
|
|
88
|
+
e();
|
|
89
|
+
}, 400));
|
|
90
|
+
}
|
|
91
|
+
_onStepperClick(e, t) {
|
|
92
|
+
e.detail === 0 && (t > 0 ? this._increment() : this._decrement());
|
|
55
93
|
}
|
|
56
94
|
_stopRepeat() {
|
|
57
95
|
this._pressTimer !== null && (clearTimeout(this._pressTimer), this._pressTimer = null), this._repeatTimer !== null && (clearInterval(this._repeatTimer), this._repeatTimer = null), this._repeatCount = 0;
|
|
58
96
|
}
|
|
59
97
|
_onKeydown(e) {
|
|
60
|
-
this.
|
|
98
|
+
this.formDisabled || this.readonly || (e.key === "ArrowUp" ? (e.preventDefault(), this._increment()) : e.key === "ArrowDown" && (e.preventDefault(), this._decrement()));
|
|
61
99
|
}
|
|
62
100
|
_onBlur() {
|
|
63
|
-
if (!this._input || this.readonly) return;
|
|
64
|
-
|
|
65
|
-
|
|
101
|
+
if (!this._input || this.readonly || e(this)) return;
|
|
102
|
+
this._pendingText = null;
|
|
103
|
+
let t = parseFloat(this._input.value);
|
|
104
|
+
this._input.value.trim() ? isNaN(t) ? this._input.value = this.value === null ? "" : this._format(this.value) : this._commit(t) : this._commit(null);
|
|
105
|
+
}
|
|
106
|
+
_onFieldInput() {
|
|
107
|
+
this._pendingText = this._input?.value ?? null, this.formSync();
|
|
108
|
+
let e = parseFloat(this._pendingText ?? ""), t = Number.isNaN(e) ? null : e;
|
|
109
|
+
this.dispatchEvent(new CustomEvent("void-input", {
|
|
110
|
+
bubbles: !0,
|
|
111
|
+
composed: !0,
|
|
112
|
+
detail: { value: t }
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
_onInputChange() {
|
|
116
|
+
this._onBlur();
|
|
66
117
|
}
|
|
67
|
-
_onInputChange() {}
|
|
68
118
|
render() {
|
|
69
|
-
let e =
|
|
119
|
+
let e = i`
|
|
70
120
|
<button
|
|
71
121
|
class="void-number-input-btn void-number-input-btn-dec"
|
|
72
122
|
type="button"
|
|
73
|
-
?disabled=${this.disabled || this.readonly || this.value <= this.min}
|
|
123
|
+
?disabled=${this.disabled || this.readonly || this.value !== null && this.value <= this.min}
|
|
74
124
|
aria-label="Decrement"
|
|
75
125
|
@pointerdown=${(e) => {
|
|
76
|
-
e.preventDefault(), this._startRepeat(
|
|
126
|
+
e.preventDefault(), this._startRepeat(-1);
|
|
77
127
|
}}
|
|
78
128
|
@pointerup=${() => this._stopRepeat()}
|
|
129
|
+
@pointercancel=${() => this._stopRepeat()}
|
|
79
130
|
@pointerleave=${() => this._stopRepeat()}
|
|
131
|
+
@click=${(e) => this._onStepperClick(e, -1)}
|
|
80
132
|
>
|
|
81
133
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
|
|
82
134
|
<line x1="3" y1="8" x2="13" y2="8"/>
|
|
83
135
|
</svg>
|
|
84
136
|
</button>
|
|
85
|
-
`, t =
|
|
137
|
+
`, t = i`
|
|
86
138
|
<button
|
|
87
139
|
class="void-number-input-btn void-number-input-btn-inc"
|
|
88
140
|
type="button"
|
|
89
|
-
?disabled=${this.disabled || this.readonly || this.value >= this.max}
|
|
141
|
+
?disabled=${this.disabled || this.readonly || this.value !== null && this.value >= this.max}
|
|
90
142
|
aria-label="Increment"
|
|
91
143
|
@pointerdown=${(e) => {
|
|
92
|
-
e.preventDefault(), this._startRepeat(
|
|
144
|
+
e.preventDefault(), this._startRepeat(1);
|
|
93
145
|
}}
|
|
94
146
|
@pointerup=${() => this._stopRepeat()}
|
|
147
|
+
@pointercancel=${() => this._stopRepeat()}
|
|
95
148
|
@pointerleave=${() => this._stopRepeat()}
|
|
149
|
+
@click=${(e) => this._onStepperClick(e, 1)}
|
|
96
150
|
>
|
|
97
151
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em">
|
|
98
152
|
<line x1="8" y1="3" x2="8" y2="13"/>
|
|
@@ -100,46 +154,58 @@ var o = class extends e {
|
|
|
100
154
|
</svg>
|
|
101
155
|
</button>
|
|
102
156
|
`;
|
|
103
|
-
return
|
|
157
|
+
return i`
|
|
104
158
|
${this.controls !== "none" && this.controls !== "right" ? e : ""}
|
|
105
|
-
${this.prefix ?
|
|
159
|
+
${this.prefix ? i`<span class="void-number-input-prefix">${this.prefix}</span>` : a}
|
|
106
160
|
<input
|
|
107
161
|
class="void-number-input-field"
|
|
108
162
|
type="text"
|
|
109
|
-
inputmode
|
|
110
|
-
.value=${this._format(this.value)}
|
|
163
|
+
inputmode=${this.precision === 0 ? "numeric" : "decimal"}
|
|
164
|
+
.value=${c(this._pendingText ?? (this.value === null ? "" : this._format(this.value)))}
|
|
111
165
|
placeholder=${this.placeholder}
|
|
112
166
|
?disabled=${this.disabled}
|
|
113
167
|
?readonly=${this.readonly}
|
|
168
|
+
role="spinbutton"
|
|
169
|
+
aria-valuenow=${this.value ?? a}
|
|
170
|
+
aria-required=${this.required ? "true" : a}
|
|
171
|
+
aria-valuemin=${isFinite(this.min) ? this.min : a}
|
|
172
|
+
aria-valuemax=${isFinite(this.max) ? this.max : a}
|
|
114
173
|
aria-label=${this.label || "Number input"}
|
|
115
174
|
@keydown=${this._onKeydown}
|
|
116
175
|
@blur=${this._onBlur}
|
|
176
|
+
@input=${this._onFieldInput}
|
|
117
177
|
@change=${this._onInputChange}
|
|
118
178
|
/>
|
|
119
|
-
${this.unit ?
|
|
120
|
-
${this.controls === "right" ?
|
|
179
|
+
${this.unit ? i`<span class="void-number-input-unit">${this.unit}</span>` : a}
|
|
180
|
+
${this.controls === "right" ? i`<div class="void-number-input-btn-group">${t}${e}</div>` : ""}
|
|
121
181
|
${this.controls === "sides" ? t : ""}
|
|
122
182
|
`;
|
|
123
183
|
}
|
|
124
184
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
185
|
+
n([o({
|
|
186
|
+
reflect: !0,
|
|
187
|
+
converter: {
|
|
188
|
+
fromAttribute: (e) => e === null || e.trim() === "" ? null : Number(e),
|
|
189
|
+
toAttribute: (e) => e == null ? null : String(e)
|
|
190
|
+
}
|
|
191
|
+
})], l.prototype, "value", void 0), n([o({ type: Number })], l.prototype, "min", void 0), n([o({ type: Number })], l.prototype, "max", void 0), n([o({ converter: {
|
|
192
|
+
fromAttribute: (e) => e === "any" ? "any" : e === null ? 1 : Number(e),
|
|
193
|
+
toAttribute: (e) => String(e)
|
|
194
|
+
} })], l.prototype, "step", void 0), n([o({ type: Number })], l.prototype, "precision", void 0), n([o({
|
|
129
195
|
type: Boolean,
|
|
130
196
|
reflect: !0
|
|
131
|
-
})],
|
|
197
|
+
})], l.prototype, "disabled", void 0), n([o({
|
|
132
198
|
type: Boolean,
|
|
133
199
|
reflect: !0
|
|
134
|
-
})],
|
|
200
|
+
})], l.prototype, "readonly", void 0), n([o({
|
|
135
201
|
type: String,
|
|
136
202
|
reflect: !0
|
|
137
|
-
})],
|
|
203
|
+
})], l.prototype, "size", void 0), n([o({
|
|
138
204
|
type: String,
|
|
139
205
|
reflect: !0
|
|
140
|
-
})],
|
|
206
|
+
})], l.prototype, "color", void 0), n([o({ type: String })], l.prototype, "placeholder", void 0), n([o({
|
|
141
207
|
type: String,
|
|
142
208
|
reflect: !0
|
|
143
|
-
})],
|
|
209
|
+
})], l.prototype, "controls", void 0), n([o({ type: String })], l.prototype, "label", void 0), n([o({ type: String })], l.prototype, "prefix", void 0), n([o({ type: String })], l.prototype, "unit", void 0), n([s(".void-number-input-field")], l.prototype, "_input", void 0), customElements.get("void-number-input") || customElements.define("void-number-input", l);
|
|
144
210
|
//#endregion
|
|
145
|
-
export {
|
|
211
|
+
export { l as VoidNumberInput };
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
/** Page navigation for data tables, search result lists, and content archives. */
|
|
3
3
|
export declare class VoidPagination extends VoidElement {
|
|
4
|
+
/** Number of pages. Defaults to 1. */
|
|
4
5
|
total: number;
|
|
6
|
+
/**
|
|
7
|
+
* Current page, 1-based. Choosing a page fires a cancelable `void-change` and then updates `value`;
|
|
8
|
+
* cancel the event to keep the page unchanged.
|
|
9
|
+
*/
|
|
5
10
|
value: number;
|
|
11
|
+
/**
|
|
12
|
+
* Page buttons shown on each side of the current page before the list collapses to ellipses. Defaults
|
|
13
|
+
* to 1.
|
|
14
|
+
*/
|
|
6
15
|
siblings: number;
|
|
16
|
+
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
7
17
|
size: 'sm' | 'md' | 'lg';
|
|
18
|
+
/** Opt-in link mode: URL with a `{page}` placeholder, e.g. `/posts?page={page}`. */
|
|
19
|
+
hrefTemplate: string;
|
|
20
|
+
/** Opt-in link mode: query parameter rewritten on the current location, e.g. `page`. Ignored when `href-template` is set. */
|
|
21
|
+
param: string;
|
|
22
|
+
private get _linkMode();
|
|
23
|
+
private _href;
|
|
24
|
+
private _onLinkClick;
|
|
25
|
+
private _renderLinks;
|
|
8
26
|
private _pages;
|
|
27
|
+
/** Returns false when a cancelable void-change was cancelled. */
|
|
9
28
|
private _go;
|
|
10
29
|
render(): import('lit').TemplateResult<1>;
|
|
11
30
|
}
|
|
@@ -14,4 +33,3 @@ declare global {
|
|
|
14
33
|
'void-pagination': VoidPagination;
|
|
15
34
|
}
|
|
16
35
|
}
|
|
17
|
-
//# sourceMappingURL=pagination.d.ts.map
|