@voidable/ui 0.6.1 → 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.
Files changed (250) hide show
  1. package/README.md +168 -9
  2. package/dist/angular/index.d.ts +20 -0
  3. package/dist/angular/index.js +78 -0
  4. package/dist/autoloader-core.d.ts +45 -0
  5. package/dist/autoloader-table.generated.d.ts +5 -0
  6. package/dist/autoloader.d.ts +13 -0
  7. package/dist/autoloader.js +229 -0
  8. package/dist/base.d.ts +173 -2
  9. package/dist/base.js +2 -9
  10. package/dist/chunks/base-CMruMbxC.js +824 -0
  11. package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
  12. package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
  13. package/dist/chunks/form-control-C0vH6gii.js +300 -0
  14. package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
  15. package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
  16. package/dist/chunks/modal-D_YVy2vg.js +71 -0
  17. package/dist/chunks/overlay-BywGMcDW.js +467 -0
  18. package/dist/chunks/parts-D30c8OoG.js +229 -0
  19. package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
  20. package/dist/components/accordion.d.ts +38 -10
  21. package/dist/components/accordion.js +51 -53
  22. package/dist/components/action-input.d.ts +64 -6
  23. package/dist/components/action-input.js +84 -41
  24. package/dist/components/alert.d.ts +24 -10
  25. package/dist/components/alert.js +26 -27
  26. package/dist/components/avatar.d.ts +8 -2
  27. package/dist/components/avatar.js +3 -3
  28. package/dist/components/badge.d.ts +8 -3
  29. package/dist/components/badge.js +2 -2
  30. package/dist/components/banner.d.ts +21 -10
  31. package/dist/components/banner.js +27 -27
  32. package/dist/components/bar-chart.d.ts +30 -6
  33. package/dist/components/bar-chart.js +29 -39
  34. package/dist/components/breadcrumbs.d.ts +19 -6
  35. package/dist/components/breadcrumbs.js +16 -22
  36. package/dist/components/button.d.ts +64 -10
  37. package/dist/components/button.js +70 -26
  38. package/dist/components/calendar.d.ts +65 -10
  39. package/dist/components/calendar.js +157 -106
  40. package/dist/components/card.d.ts +14 -9
  41. package/dist/components/card.js +8 -22
  42. package/dist/components/carousel.d.ts +65 -14
  43. package/dist/components/carousel.js +84 -93
  44. package/dist/components/charts/scale.d.ts +0 -1
  45. package/dist/components/charts/shape.d.ts +0 -1
  46. package/dist/components/checkbox-group.d.ts +38 -5
  47. package/dist/components/checkbox-group.js +61 -20
  48. package/dist/components/checkbox.d.ts +53 -7
  49. package/dist/components/checkbox.js +66 -29
  50. package/dist/components/collapsible.d.ts +29 -9
  51. package/dist/components/collapsible.js +42 -44
  52. package/dist/components/color-picker.d.ts +20 -4
  53. package/dist/components/color-picker.js +35 -29
  54. package/dist/components/combobox.d.ts +84 -10
  55. package/dist/components/combobox.js +142 -45
  56. package/dist/components/compose-input.d.ts +8 -1
  57. package/dist/components/compose-input.js +9 -3
  58. package/dist/components/dialog.d.ts +24 -20
  59. package/dist/components/dialog.js +8 -57
  60. package/dist/components/divider.d.ts +8 -1
  61. package/dist/components/divider.js +3 -3
  62. package/dist/components/donut-chart.d.ts +28 -5
  63. package/dist/components/donut-chart.js +55 -54
  64. package/dist/components/drawer.d.ts +19 -18
  65. package/dist/components/drawer.js +9 -53
  66. package/dist/components/dropdown-menu.d.ts +62 -7
  67. package/dist/components/dropdown-menu.js +124 -33
  68. package/dist/components/editable.d.ts +37 -3
  69. package/dist/components/editable.js +45 -24
  70. package/dist/components/error-fallback.d.ts +36 -5
  71. package/dist/components/error-fallback.js +73 -23
  72. package/dist/components/field.d.ts +38 -4
  73. package/dist/components/field.js +63 -21
  74. package/dist/components/file-upload.d.ts +23 -2
  75. package/dist/components/file-upload.js +47 -24
  76. package/dist/components/gauge.d.ts +48 -9
  77. package/dist/components/gauge.js +57 -55
  78. package/dist/components/hamburger.d.ts +19 -4
  79. package/dist/components/hamburger.js +28 -19
  80. package/dist/components/hover-card.d.ts +40 -14
  81. package/dist/components/hover-card.js +76 -59
  82. package/dist/components/indicator.d.ts +18 -7
  83. package/dist/components/indicator.js +16 -18
  84. package/dist/components/input.d.ts +70 -5
  85. package/dist/components/input.js +83 -20
  86. package/dist/components/line-chart.d.ts +27 -5
  87. package/dist/components/line-chart.js +19 -21
  88. package/dist/components/list.d.ts +10 -1
  89. package/dist/components/list.js +3 -3
  90. package/dist/components/menu.d.ts +67 -21
  91. package/dist/components/menu.js +116 -115
  92. package/dist/components/multiselect.d.ts +108 -13
  93. package/dist/components/multiselect.js +207 -70
  94. package/dist/components/nav-bar.d.ts +12 -7
  95. package/dist/components/nav-bar.js +11 -21
  96. package/dist/components/nav-menu.d.ts +52 -12
  97. package/dist/components/nav-menu.js +68 -70
  98. package/dist/components/number-input.d.ts +76 -8
  99. package/dist/components/number-input.js +117 -51
  100. package/dist/components/pagination.d.ts +19 -1
  101. package/dist/components/pagination.js +68 -7
  102. package/dist/components/panel.d.ts +16 -8
  103. package/dist/components/panel.js +20 -20
  104. package/dist/components/pin-input.d.ts +41 -4
  105. package/dist/components/pin-input.js +45 -27
  106. package/dist/components/popover.d.ts +29 -11
  107. package/dist/components/popover.js +47 -35
  108. package/dist/components/progress.d.ts +7 -3
  109. package/dist/components/progress.js +3 -3
  110. package/dist/components/radio-group.d.ts +30 -5
  111. package/dist/components/radio-group.js +56 -19
  112. package/dist/components/radio.d.ts +47 -7
  113. package/dist/components/radio.js +68 -29
  114. package/dist/components/scroll-area.d.ts +8 -5
  115. package/dist/components/scroll-area.js +19 -20
  116. package/dist/components/segmented-control.d.ts +52 -8
  117. package/dist/components/segmented-control.js +66 -36
  118. package/dist/components/select.d.ts +59 -12
  119. package/dist/components/select.js +96 -46
  120. package/dist/components/sidebar.d.ts +22 -3
  121. package/dist/components/sidebar.js +20 -10
  122. package/dist/components/skeleton.d.ts +5 -2
  123. package/dist/components/skeleton.js +4 -4
  124. package/dist/components/slider.d.ts +27 -5
  125. package/dist/components/slider.js +29 -17
  126. package/dist/components/spinner.d.ts +6 -2
  127. package/dist/components/spinner.js +3 -3
  128. package/dist/components/stat.d.ts +21 -4
  129. package/dist/components/stat.js +7 -3
  130. package/dist/components/status-dot.d.ts +4 -1
  131. package/dist/components/status-dot.js +3 -3
  132. package/dist/components/stepper.d.ts +5 -1
  133. package/dist/components/stepper.js +2 -2
  134. package/dist/components/switch.d.ts +24 -5
  135. package/dist/components/switch.js +37 -19
  136. package/dist/components/table.d.ts +51 -2
  137. package/dist/components/table.js +157 -8
  138. package/dist/components/tabs.d.ts +49 -17
  139. package/dist/components/tabs.js +85 -54
  140. package/dist/components/tag.d.ts +17 -7
  141. package/dist/components/tag.js +19 -21
  142. package/dist/components/tags-input.d.ts +33 -4
  143. package/dist/components/tags-input.js +40 -30
  144. package/dist/components/textarea.d.ts +61 -5
  145. package/dist/components/textarea.js +58 -21
  146. package/dist/components/toast.d.ts +89 -15
  147. package/dist/components/toast.js +105 -30
  148. package/dist/components/toggle-group.d.ts +30 -3
  149. package/dist/components/toggle-group.js +43 -16
  150. package/dist/components/toggle.d.ts +25 -4
  151. package/dist/components/toggle.js +28 -18
  152. package/dist/components/tooltip.d.ts +31 -12
  153. package/dist/components/tooltip.js +62 -28
  154. package/dist/components.json +1518 -0
  155. package/dist/custom-elements.json +31817 -0
  156. package/dist/dev/index.d.ts +40 -0
  157. package/dist/dev/rules.d.ts +46 -0
  158. package/dist/dev/table.generated.d.ts +8 -0
  159. package/dist/dev/types.d.ts +113 -0
  160. package/dist/dev.js +3364 -0
  161. package/dist/disclosure.d.ts +30 -0
  162. package/dist/dismiss.d.ts +20 -0
  163. package/dist/form-control.d.ts +92 -0
  164. package/dist/index.d.ts +5 -4
  165. package/dist/index.js +24 -24
  166. package/dist/keyboard-activation.d.ts +31 -0
  167. package/dist/keyboard.d.ts +32 -0
  168. package/dist/modal.d.ts +44 -0
  169. package/dist/overlay.d.ts +249 -0
  170. package/dist/parts.d.ts +171 -0
  171. package/dist/projection.d.ts +370 -0
  172. package/dist/types/elements.d.ts +648 -0
  173. package/dist/types/react.d.ts +163 -0
  174. package/dist/types/solid.d.ts +164 -0
  175. package/dist/types/solid2.d.ts +161 -0
  176. package/dist/types/svelte.d.ts +154 -0
  177. package/dist/types/vue.d.ts +156 -0
  178. package/dist/vscode.html-custom-data.json +6004 -0
  179. package/dist/web-types.json +8365 -0
  180. package/package.json +113 -21
  181. package/dist/base.d.ts.map +0 -1
  182. package/dist/components/accordion.d.ts.map +0 -1
  183. package/dist/components/action-input.d.ts.map +0 -1
  184. package/dist/components/alert.d.ts.map +0 -1
  185. package/dist/components/avatar.d.ts.map +0 -1
  186. package/dist/components/badge.d.ts.map +0 -1
  187. package/dist/components/banner.d.ts.map +0 -1
  188. package/dist/components/bar-chart.d.ts.map +0 -1
  189. package/dist/components/breadcrumbs.d.ts.map +0 -1
  190. package/dist/components/button.d.ts.map +0 -1
  191. package/dist/components/calendar.d.ts.map +0 -1
  192. package/dist/components/card.d.ts.map +0 -1
  193. package/dist/components/carousel.d.ts.map +0 -1
  194. package/dist/components/charts/scale.d.ts.map +0 -1
  195. package/dist/components/charts/shape.d.ts.map +0 -1
  196. package/dist/components/checkbox-group.d.ts.map +0 -1
  197. package/dist/components/checkbox.d.ts.map +0 -1
  198. package/dist/components/collapsible.d.ts.map +0 -1
  199. package/dist/components/color-picker.d.ts.map +0 -1
  200. package/dist/components/combobox.d.ts.map +0 -1
  201. package/dist/components/compose-input.d.ts.map +0 -1
  202. package/dist/components/dialog.d.ts.map +0 -1
  203. package/dist/components/divider.d.ts.map +0 -1
  204. package/dist/components/donut-chart.d.ts.map +0 -1
  205. package/dist/components/drawer.d.ts.map +0 -1
  206. package/dist/components/dropdown-menu.d.ts.map +0 -1
  207. package/dist/components/editable.d.ts.map +0 -1
  208. package/dist/components/error-fallback.d.ts.map +0 -1
  209. package/dist/components/field.d.ts.map +0 -1
  210. package/dist/components/file-upload.d.ts.map +0 -1
  211. package/dist/components/gauge.d.ts.map +0 -1
  212. package/dist/components/hamburger.d.ts.map +0 -1
  213. package/dist/components/hover-card.d.ts.map +0 -1
  214. package/dist/components/indicator.d.ts.map +0 -1
  215. package/dist/components/input.d.ts.map +0 -1
  216. package/dist/components/line-chart.d.ts.map +0 -1
  217. package/dist/components/list.d.ts.map +0 -1
  218. package/dist/components/menu.d.ts.map +0 -1
  219. package/dist/components/multiselect.d.ts.map +0 -1
  220. package/dist/components/nav-bar.d.ts.map +0 -1
  221. package/dist/components/nav-menu.d.ts.map +0 -1
  222. package/dist/components/number-input.d.ts.map +0 -1
  223. package/dist/components/pagination.d.ts.map +0 -1
  224. package/dist/components/panel.d.ts.map +0 -1
  225. package/dist/components/pin-input.d.ts.map +0 -1
  226. package/dist/components/popover.d.ts.map +0 -1
  227. package/dist/components/progress.d.ts.map +0 -1
  228. package/dist/components/radio-group.d.ts.map +0 -1
  229. package/dist/components/radio.d.ts.map +0 -1
  230. package/dist/components/scroll-area.d.ts.map +0 -1
  231. package/dist/components/segmented-control.d.ts.map +0 -1
  232. package/dist/components/select.d.ts.map +0 -1
  233. package/dist/components/sidebar.d.ts.map +0 -1
  234. package/dist/components/skeleton.d.ts.map +0 -1
  235. package/dist/components/slider.d.ts.map +0 -1
  236. package/dist/components/spinner.d.ts.map +0 -1
  237. package/dist/components/stat.d.ts.map +0 -1
  238. package/dist/components/status-dot.d.ts.map +0 -1
  239. package/dist/components/stepper.d.ts.map +0 -1
  240. package/dist/components/switch.d.ts.map +0 -1
  241. package/dist/components/table.d.ts.map +0 -1
  242. package/dist/components/tabs.d.ts.map +0 -1
  243. package/dist/components/tag.d.ts.map +0 -1
  244. package/dist/components/tags-input.d.ts.map +0 -1
  245. package/dist/components/textarea.d.ts.map +0 -1
  246. package/dist/components/toast.d.ts.map +0 -1
  247. package/dist/components/toggle-group.d.ts.map +0 -1
  248. package/dist/components/toggle.d.ts.map +0 -1
  249. package/dist/components/tooltip.d.ts.map +0 -1
  250. package/dist/index.d.ts.map +0 -1
@@ -1,122 +1,120 @@
1
- import { VoidElement as e } from "../base.js";
1
+ import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { property as n } from "lit/decorators.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 r = class extends e {
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, n = this._getItems();
9
- for (let e of n) e !== t && e.open && (e.open = !1, e.dispatchEvent(new CustomEvent("void-close", {
10
- bubbles: !0,
11
- composed: !0
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.preventDefault();
19
- let n = t.map((e) => e.querySelector(".void-nav-menu-trigger")).filter(Boolean), i = n.indexOf(document.activeElement);
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 === "Enter" || 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.setAttribute("role", "menubar"), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("void-open", this._handleItemOpen);
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.style.setProperty("--void-nav-menu-width", this.width) : this.style.removeProperty("--void-nav-menu-width"));
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(":scope > void-nav-menu-item"));
36
+ return Array.from(this.querySelectorAll("void-nav-menu-item")).filter((e) => e.closest("void-nav-menu") === this);
49
37
  }
50
38
  };
51
- t([n({
39
+ t([i({
52
40
  type: String,
53
41
  reflect: !0
54
- })], r.prototype, "orientation", void 0), t([n({
42
+ })], a.prototype, "orientation", void 0), t([i({
55
43
  type: String,
56
44
  reflect: !0
57
- })], r.prototype, "width", void 0), customElements.get("void-nav-menu") || customElements.define("void-nav-menu", r);
58
- var i = class extends e {
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.href = "", this.active = !1, this._triggerEl = null, this._contentEl = null, this._contentNodes = [], this._didSetup = !1, this._onMouseEnter = () => {
61
- this.disabled || !this._contentEl || (clearTimeout(this._closeTimerId), this._openTimerId = setTimeout(() => {
62
- this._openDropdown();
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._contentEl && (clearTimeout(this._openTimerId), this._closeTimerId = setTimeout(() => {
66
- this._closeDropdown();
61
+ this._hasContent && (clearTimeout(this._openTimerId), this._closeTimerId = setTimeout(() => {
62
+ this._closeDropdown("hover");
67
63
  }, 300));
68
- }, this._onContentEnter = () => {
69
- clearTimeout(this._closeTimerId);
70
- }, this._onContentLeave = () => {
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.setAttribute("role", "none"), this._didSetup || (this._contentNodes = Array.from(this.childNodes)), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), document.addEventListener("mousedown", this._onOutsideClick);
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
- if (super.updated(e), !this._didSetup) {
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: !0,
101
- composed: !0
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: !0,
107
- composed: !0
104
+ bubbles: !1,
105
+ detail: { reason: e }
108
106
  })));
109
107
  }
110
108
  };
111
- t([n({
109
+ t([i({
112
110
  type: Boolean,
113
111
  reflect: !0
114
- })], i.prototype, "open", void 0), t([n({
112
+ })], o.prototype, "open", void 0), t([i({
115
113
  type: Boolean,
116
114
  reflect: !0
117
- })], i.prototype, "disabled", void 0), t([n({ type: String })], i.prototype, "href", void 0), t([n({
115
+ })], o.prototype, "disabled", void 0), t([i({
118
116
  type: Boolean,
119
117
  reflect: !0
120
- })], i.prototype, "active", void 0), customElements.get("void-nav-menu-item") || customElements.define("void-nav-menu-item", i);
118
+ })], o.prototype, "current", void 0), customElements.get("void-nav-menu-item") || customElements.define("void-nav-menu-item", o);
121
119
  //#endregion
122
- export { r as VoidNavMenu, i as VoidNavMenuItem };
120
+ export { a as VoidNavMenu, o as VoidNavMenuItem };
@@ -1,37 +1,105 @@
1
1
  import { VoidElement } from '../base.js';
2
- /** Precise numeric entry for quantity selectors, price fields, and settings with increment/decrement controls. */
3
- export declare class VoidNumberInput extends VoidElement {
4
- value: number;
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
- step: number;
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
- color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice';
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
- //# sourceMappingURL=number-input.d.ts.map
111
+ export {};
@@ -1,32 +1,53 @@
1
- import { VoidElement as e } from "../base.js";
2
- import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { html as n, nothing as r } from "lit";
4
- import { property as i, query as a } from "lit/decorators.js";
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 o = class extends e {
8
+ var l = class extends r(t) {
7
9
  constructor(...e) {
8
- super(...e), this.value = 0, 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;
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
- connectedCallback() {
11
- super.connectedCallback(), this.setAttribute("role", "spinbutton"), this.label && this.setAttribute("aria-label", this.label), isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), this.setAttribute("aria-valuenow", String(this.value));
12
+ static {
13
+ this.labelTarget = "input[role=spinbutton]";
12
14
  }
13
- updated(e) {
14
- e.has("value") && this.setAttribute("aria-valuenow", String(this.value)), e.has("min") && isFinite(this.min) && this.setAttribute("aria-valuemin", String(this.min)), e.has("max") && isFinite(this.max) && this.setAttribute("aria-valuemax", String(this.max)), e.has("label") && this.setAttribute("aria-label", this.label);
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.disabled || this.readonly || this._commit(this.value + this.step);
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.disabled || this.readonly || this._commit(this.value - this.step);
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
- e(), this._pressTimer = setTimeout(() => {
46
- this._repeatInterval = 300, this._repeatCount = 0, this._repeatTimer = setInterval(() => {
47
- if (e(), this._repeatCount++, this._repeatCount % 5 == 0 && this._repeatInterval > 50) {
48
- let t = Math.max(50, Math.floor(this._repeatInterval / 2));
49
- t !== this._repeatInterval && (this._repeatInterval = t, clearInterval(this._repeatTimer), this._repeatTimer = setInterval(() => {
50
- e(), this._repeatCount++;
51
- }, this._repeatInterval));
52
- }
53
- }, this._repeatInterval);
54
- }, 400);
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.disabled || this.readonly || (e.key === "ArrowUp" ? (e.preventDefault(), this._increment()) : e.key === "ArrowDown" && (e.preventDefault(), this._decrement()));
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
- let e = parseFloat(this._input.value);
65
- isNaN(e) ? this._input.value = this._format(this.value) : this._commit(e);
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 = n`
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(() => this._decrement());
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 = n`
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(() => this._increment());
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 n`
157
+ return i`
104
158
  ${this.controls !== "none" && this.controls !== "right" ? e : ""}
105
- ${this.prefix ? n`<span class="void-number-input-prefix">${this.prefix}</span>` : r}
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="numeric"
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 ? n`<span class="void-number-input-unit">${this.unit}</span>` : r}
120
- ${this.controls === "right" ? n`<div class="void-number-input-btn-group">${t}${e}</div>` : ""}
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
- t([i({
126
- type: Number,
127
- reflect: !0
128
- })], o.prototype, "value", void 0), t([i({ type: Number })], o.prototype, "min", void 0), t([i({ type: Number })], o.prototype, "max", void 0), t([i({ type: Number })], o.prototype, "step", void 0), t([i({ type: Number })], o.prototype, "precision", void 0), t([i({
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
- })], o.prototype, "disabled", void 0), t([i({
197
+ })], l.prototype, "disabled", void 0), n([o({
132
198
  type: Boolean,
133
199
  reflect: !0
134
- })], o.prototype, "readonly", void 0), t([i({
200
+ })], l.prototype, "readonly", void 0), n([o({
135
201
  type: String,
136
202
  reflect: !0
137
- })], o.prototype, "size", void 0), t([i({
203
+ })], l.prototype, "size", void 0), n([o({
138
204
  type: String,
139
205
  reflect: !0
140
- })], o.prototype, "color", void 0), t([i({ type: String })], o.prototype, "placeholder", void 0), t([i({
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
- })], o.prototype, "controls", void 0), t([i({ type: String })], o.prototype, "label", void 0), t([i({ type: String })], o.prototype, "prefix", void 0), t([i({ type: String })], o.prototype, "unit", void 0), t([a(".void-number-input-field")], o.prototype, "_input", void 0), customElements.get("void-number-input") || customElements.define("void-number-input", o);
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 { o as VoidNumberInput };
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