@voidable/ui 0.8.0 → 0.9.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 (69) hide show
  1. package/README.md +8 -0
  2. package/dist/chunks/{modal-D_YVy2vg.js → modal-hivQ4YoU.js} +1 -1
  3. package/dist/chunks/{parts-D30c8OoG.js → parts-CMQQop0D.js} +4 -1
  4. package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
  5. package/dist/chunks/value-list-CH6GjYXM.js +28 -0
  6. package/dist/components/accordion.js +1 -1
  7. package/dist/components/action-input.d.ts +6 -2
  8. package/dist/components/action-input.js +55 -45
  9. package/dist/components/alert.js +1 -1
  10. package/dist/components/banner.js +1 -1
  11. package/dist/components/breadcrumbs.js +1 -1
  12. package/dist/components/carousel.js +1 -1
  13. package/dist/components/checkbox-group.d.ts +10 -0
  14. package/dist/components/checkbox-group.js +30 -18
  15. package/dist/components/checkbox.d.ts +2 -2
  16. package/dist/components/collapsible.js +1 -1
  17. package/dist/components/color-picker.d.ts +2 -2
  18. package/dist/components/combobox.d.ts +4 -2
  19. package/dist/components/combobox.js +8 -5
  20. package/dist/components/compose-input.d.ts +1 -1
  21. package/dist/components/compose-input.js +4 -1
  22. package/dist/components/dialog.js +1 -1
  23. package/dist/components/drawer.js +1 -1
  24. package/dist/components/dropdown-menu.js +1 -1
  25. package/dist/components/editable.d.ts +1 -1
  26. package/dist/components/error-fallback.js +1 -1
  27. package/dist/components/gauge.js +4 -1
  28. package/dist/components/hover-card.js +1 -1
  29. package/dist/components/input.d.ts +6 -2
  30. package/dist/components/input.js +43 -33
  31. package/dist/components/menu.js +1 -1
  32. package/dist/components/multiselect.d.ts +9 -0
  33. package/dist/components/multiselect.js +47 -38
  34. package/dist/components/nav-menu.js +1 -1
  35. package/dist/components/number-input.d.ts +2 -2
  36. package/dist/components/panel.js +1 -1
  37. package/dist/components/pin-input.d.ts +6 -2
  38. package/dist/components/pin-input.js +27 -17
  39. package/dist/components/popover.js +1 -1
  40. package/dist/components/radio-group.d.ts +2 -2
  41. package/dist/components/radio-group.js +4 -1
  42. package/dist/components/segmented-control.d.ts +1 -1
  43. package/dist/components/select.d.ts +67 -16
  44. package/dist/components/select.js +172 -47
  45. package/dist/components/slider.d.ts +2 -2
  46. package/dist/components/slider.js +4 -1
  47. package/dist/components/switch.d.ts +1 -1
  48. package/dist/components/tabs.js +1 -1
  49. package/dist/components/tags-input.d.ts +1 -1
  50. package/dist/components/tags-input.js +22 -18
  51. package/dist/components/textarea.d.ts +2 -2
  52. package/dist/components/textarea.js +4 -1
  53. package/dist/components/toast.js +1 -1
  54. package/dist/components/toggle-group.d.ts +2 -2
  55. package/dist/components/toggle.js +4 -1
  56. package/dist/components/tooltip.js +1 -1
  57. package/dist/components.json +3 -3
  58. package/dist/custom-elements.json +85 -49
  59. package/dist/dev/types.d.ts +2 -3
  60. package/dist/dev.js +50 -48
  61. package/dist/llms.txt +125 -0
  62. package/dist/parts.d.ts +3 -1
  63. package/dist/reference.md +4575 -0
  64. package/dist/secret-value.d.ts +17 -0
  65. package/dist/types/elements.d.ts +2 -2
  66. package/dist/value-list.d.ts +14 -0
  67. package/dist/vscode.html-custom-data.json +33 -19
  68. package/dist/web-types.json +57 -37
  69. package/package.json +5 -3
@@ -1,4 +1,4 @@
1
- import { nothing } from 'lit';
1
+ import { nothing, PropertyValues } from 'lit';
2
2
  import { VoidElement } from '../base.js';
3
3
  import { PartsController } from '../parts.js';
4
4
  /**
@@ -25,43 +25,94 @@ export declare class VoidSelect extends VoidElement {
25
25
  * `void-field`, set `error` on the field instead, which shows the message.
26
26
  */
27
27
  error: string;
28
- /** The value the host's `value` attribute or a property set asked for, kept until an option has it. */
29
- private _wanted;
30
- /** The server's selection at its last render (`selected` options, in order), for the morph rule. */
28
+ /** The chosen values (one for a single select), or null before anything decided them. */
29
+ private _choice;
30
+ /** The choice came from `value` and waits for an option that has it. */
31
+ private _pending;
32
+ /** The options the server's markup marks `selected` at its last render (JSON), for the morph rule. */
31
33
  private _serverSelection;
32
- private _serverValue;
33
- /** The user's selection, captured before a morph the server did not change it in, put back after. */
34
- private _keep;
35
- /** The server changed the host's `value` attribute in this morph: it wins over the options' `selected`. */
36
- private _serverValueChanged;
37
- private _form;
34
+ /** The `value` attribute the markup or the server last wrote: what a form reset returns to. */
35
+ private _initial;
38
36
  protected readonly _parts: PartsController;
39
37
  /** The native select this component enhances. */
40
38
  get select(): HTMLSelectElement | null;
41
39
  /**
42
- * `value` of the chosen option (the native select's value). As an attribute it is the initial choice, applied
43
- * once an option with that value exists; without it the options' own `selected` decide, as in plain HTML.
40
+ * `value` of the chosen option (the native select's value), reflected to the attribute as the choice
41
+ * changes. Written in markup it is the initial choice, applied once an option with that value exists (and
42
+ * what a form reset returns to); without it the options' own `selected` decide, as in plain HTML.
44
43
  * @default ''
45
44
  */
46
45
  get value(): string;
47
46
  set value(next: string);
47
+ /** Lit writes the reflected attribute during update; any other write of `value` is the markup's or the server's. */
48
+ private _reflecting;
49
+ protected update(changed: PropertyValues): void;
50
+ /** Asks Lit to reflect the choice when it moved, or when the attribute does not show it yet. */
51
+ private _changed;
52
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
48
53
  connectedCallback(): void;
49
54
  disconnectedCallback(): void;
50
- /** Writes the invalid state on the select, applies a wanted value once its option exists, follows its form. */
55
+ /** The select was added, replaced or moved (PartsController): follow it, mark it, write the choice into it. */
51
56
  private _wire;
52
- /** Pushes the wanted value into the select (once an option has it); then the select is the truth. */
57
+ /**
58
+ * Brings the choice and the native select into agreement. `patch` says what happened to the select since
59
+ * the choice was last written into it:
60
+ * - `morph`: a morph through the adapters (between the pre-morph hook and its microtask, which the
61
+ * adapters' contract makes the morph's own synchronous run): any difference is the morph's, and the
62
+ * choice goes back in;
63
+ * - `mutation`: the select's options, their text or their `selected` were changed: a select left at its
64
+ * markup's default selection (or none) is that patch, and the choice goes back in;
65
+ * - `none`: nothing.
66
+ * Any other difference is a choice a script made in the select (`select.value = …`), and the choice follows it.
67
+ */
68
+ private _reconcile;
69
+ /** Reconciles now, taking the mutations of the select not delivered yet (unless a morph's microtask will). */
70
+ private _flush;
71
+ /** Puts the choice into the native select (properties only: no attribute, so no mutation of its own). */
53
72
  private _apply;
54
73
  protected updated(changed: Map<string, unknown>): void;
55
74
  /** The select we last marked `aria-invalid` (a `void-field` with an error marks it too; that stays theirs). */
56
75
  private _invalid;
57
76
  private _markInvalid;
58
77
  render(): typeof nothing | import('lit').TemplateResult<1>;
78
+ /** The user picked in the native select. */
79
+ private _onPick;
59
80
  private _onChange;
81
+ private _observer;
82
+ private _observed;
83
+ private _observe;
84
+ /**
85
+ * Something changed in the select: a morph without the pre-morph hook, options written with innerHTML,
86
+ * LiveView patching a locked select, a framework re-rendering the options.
87
+ */
88
+ private _onMutations;
89
+ /**
90
+ * Options the server rendered afresh: when they mark other options `selected` than its last render did,
91
+ * that is the server's new selection, and it wins (unless a value set in code still waits for its option).
92
+ */
93
+ private _serverMarked;
94
+ private _form;
60
95
  private _watchForm;
61
- /** After a reset the options' `selected` decide; an initial `value` attribute is applied again. */
96
+ /**
97
+ * The form is building its data (a submit, `new FormData(form)`, a LiveView event) from the native select.
98
+ * A patch may have reset it a moment ago, before its mutations were delivered or the morph's microtask
99
+ * ran: bring the choice up to date and into the select now, and correct the entries it already gave.
100
+ */
101
+ private _onFormData;
102
+ /** A reset in progress: the form resets the native select after its reset event, and the choice follows it. */
103
+ private _pendingReset;
62
104
  private _onReset;
105
+ /** After a reset the options' `selected` decide; a `value` attribute (the markup's or the server's) is applied again. */
106
+ private _finishReset;
107
+ /** A morph through the adapters is under way; the choice is written back in the microtask after it. */
108
+ private _morphQueued;
109
+ /**
110
+ * The decision is taken here, from the server's markup, before the morph touches anything: the options
111
+ * it marks `selected`, compared with its last render. A `value` attribute the server changed arrives
112
+ * during the morph itself (the morph writes it, which sets `value`) and so wins over them.
113
+ */
63
114
  voidBeforeMorph(incoming?: Element | null): boolean;
64
- protected morphedCallback(): void;
115
+ private _afterMorph;
65
116
  }
66
117
  declare global {
67
118
  interface HTMLElementTagNameMap {
@@ -1,29 +1,54 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { html as r, nothing as i } from "lit";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/select.ts
7
- var o = class extends e {
7
+ var o = class t extends e {
8
8
  constructor(...e) {
9
- super(...e), this.size = "md", this.error = "", this._wanted = null, this._serverSelection = null, this._serverValue = null, this._keep = null, this._serverValueChanged = !1, this._form = null, this._parts = new n(this, {
9
+ super(...e), this.size = "md", this.error = "", this._choice = null, this._pending = !1, this._serverSelection = null, this._initial = null, this._parts = new n(this, {
10
10
  tags: [
11
11
  "select",
12
12
  "option",
13
13
  "optgroup"
14
14
  ],
15
15
  onChange: () => this._wire()
16
- }), this._invalid = null, this._onChange = (e) => {
17
- e.target === this.select && (this._wanted = null, this.dispatchEvent(new CustomEvent("void-change", {
16
+ }), this._reflecting = !1, this._invalid = null, this._onPick = (e) => {
17
+ let t = this.select;
18
+ if (!t || e.target !== t) return;
19
+ this._pendingReset = null;
20
+ let n = this.value;
21
+ this._choice = g(t), this._pending = !1, this._changed(n);
22
+ }, this._onChange = (e) => {
23
+ e.target === this.select && (this._onPick(e), this.dispatchEvent(new CustomEvent("void-change", {
18
24
  bubbles: !0,
19
25
  composed: !0,
20
26
  detail: { value: this.value }
21
27
  })));
22
- }, this._onReset = () => {
23
- setTimeout(() => {
24
- let e = this.getAttribute("value");
25
- e !== null && this.isConnected && (this.value = e);
28
+ }, this._observer = null, this._observed = null, this._onMutations = (e) => {
29
+ this._morphQueued || !this.isConnected || this._reconcile(u(e) ? "mutation" : "none", e);
30
+ }, this._form = null, this._onFormData = (e) => {
31
+ let t = this.select;
32
+ if (!t || t.form !== e.target) return;
33
+ let n = _(t);
34
+ if (this._flush(), this._apply(), !t.name) return;
35
+ let r = _(t);
36
+ if (c(n, r)) return;
37
+ let i = e.formData.getAll(t.name);
38
+ for (let e of n) {
39
+ let t = i.indexOf(e);
40
+ t >= 0 && i.splice(t, 1);
41
+ }
42
+ e.formData.delete(t.name);
43
+ for (let n of [...i, ...r]) e.formData.append(t.name, n);
44
+ }, this._pendingReset = null, this._onReset = (e) => {
45
+ this._pendingReset = e, setTimeout(() => {
46
+ this._finishReset(), this._apply();
26
47
  });
48
+ }, this._morphQueued = !1, this._afterMorph = () => {
49
+ this._morphQueued = !1, this._observer?.takeRecords();
50
+ let e = this.select;
51
+ !this.isConnected || !e || (this._observe(e), this._watchForm(e.form), this._markInvalid(e), this._reconcile("morph"));
27
52
  };
28
53
  }
29
54
  static {
@@ -33,32 +58,78 @@ var o = class extends e {
33
58
  return this._parts.one("select");
34
59
  }
35
60
  get value() {
36
- let e = this.select;
37
- return this._wanted !== null && !(e && s(e, this._wanted)) ? this._wanted : e?.value ?? this._wanted ?? "";
61
+ return this._choice ? this._choice[0] ?? "" : this.select?.value ?? "";
38
62
  }
39
63
  set value(e) {
40
64
  let t = this.value;
41
- this._wanted = e == null ? null : String(e), this._apply(), this.requestUpdate("value", t);
65
+ if (e == null) {
66
+ let e = this.select;
67
+ this._choice = e ? m(e) : null, this._pending = !1;
68
+ } else this._choice = [String(e)], this._pending = !0;
69
+ this._apply(), this.requestUpdate("value", t);
70
+ }
71
+ update(e) {
72
+ this._reflecting = !0;
73
+ try {
74
+ super.update(e);
75
+ } finally {
76
+ this._reflecting = !1;
77
+ }
78
+ }
79
+ _changed(e) {
80
+ let t = this.value;
81
+ t === e ? this.getAttribute("value") !== t && this.requestUpdate("value", null) : this.requestUpdate("value", e);
82
+ }
83
+ attributeChangedCallback(e, t, n) {
84
+ e === "value" && !this._reflecting && (this._initial = n), super.attributeChangedCallback(e, t, n);
42
85
  }
43
86
  connectedCallback() {
44
- super.connectedCallback(), this.addEventListener("change", this._onChange, !0);
87
+ super.connectedCallback(), this.addEventListener("input", this._onPick, !0), this.addEventListener("change", this._onChange, !0);
45
88
  }
46
89
  disconnectedCallback() {
47
- super.disconnectedCallback(), this.removeEventListener("change", this._onChange, !0), this._watchForm(null);
90
+ super.disconnectedCallback(), this.removeEventListener("input", this._onPick, !0), this.removeEventListener("change", this._onChange, !0), this._observe(null), this._watchForm(null);
48
91
  }
49
92
  _wire() {
50
- let e = this.select;
51
- e && (this._markInvalid(e), this._serverSelection === null && (this._serverSelection = c(e)), this._serverValue === null && (this._serverValue = this.getAttribute("value") ?? ""), this._apply(), this._watchForm(e.form));
93
+ let e = this.select, t = !!e && !!this._observed && e !== this._observed, n = this._observer?.takeRecords() ?? [];
94
+ this._observe(e), e && (this._markInvalid(e), this._watchForm(e.form), !this._morphQueued && (this._serverSelection === null ? this._serverSelection = f(e) : t && this._serverMarked(e), this._reconcile(t || u(n) ? "mutation" : "none", n)));
95
+ }
96
+ _reconcile(e, t = []) {
97
+ let n = this.select;
98
+ if (!n) return;
99
+ this._finishReset(), e === "mutation" && d(t) && this._serverMarked(n);
100
+ let r = this.value, i = this._choice;
101
+ if (i === null || !this._pending && !n.multiple && i.length === 0) n.options.length && (this._choice = g(n));
102
+ else if (e !== "morph" && !this._pending && i.every((e) => s(n, e))) {
103
+ let t = g(n), r = e === "mutation" && c(t, m(n));
104
+ t.length && !r && !c(t, i) && (this._choice = t);
105
+ }
106
+ this._apply(), this._changed(r);
107
+ }
108
+ _flush() {
109
+ if (this._morphQueued || !this.select) return;
110
+ let e = this._observer?.takeRecords() ?? [];
111
+ this._reconcile(u(e) ? "mutation" : "none", e);
52
112
  }
53
113
  _apply() {
54
- let e = this.select;
55
- !e || this._wanted === null || !s(e, this._wanted) || (e.value !== this._wanted && (e.value = this._wanted), this._wanted = null);
114
+ let e = this.select, t = this._choice;
115
+ if (!e || !t) return;
116
+ if (!t.every((t) => s(e, t))) {
117
+ if (this._pending) return;
118
+ let t = this.value;
119
+ this._choice = g(e), this._changed(t);
120
+ return;
121
+ }
122
+ if (this._pending = !1, !e.multiple) {
123
+ t.length && e.value !== t[0] && (e.value = t[0]);
124
+ return;
125
+ }
126
+ let n = new Set(t);
127
+ for (let t of Array.from(e.options)) t.selected !== n.has(t.value) && (t.selected = n.has(t.value));
56
128
  }
57
129
  updated(e) {
58
- if (super.updated(e), e.has("error")) {
59
- let e = this.select;
60
- e && this._markInvalid(e);
61
- }
130
+ super.updated(e);
131
+ let t = this.select;
132
+ e.has("error") && t && this._markInvalid(t), this._flush();
62
133
  }
63
134
  _markInvalid(e) {
64
135
  this.error ? (e.getAttribute("aria-invalid") !== "true" && e.setAttribute("aria-invalid", "true"), this._invalid = e) : this._invalid &&= (this._invalid.getAttribute("aria-invalid") === "true" && !this._invalid.hasAttribute("data-void-field-invalid") && this._invalid.removeAttribute("aria-invalid"), null);
@@ -66,33 +137,50 @@ var o = class extends e {
66
137
  render() {
67
138
  return this.error ? r`<span class="void-select-error">${this.error}</span>` : i;
68
139
  }
140
+ _observe(e) {
141
+ e !== this._observed && (this._observer?.disconnect(), this._observed = e, e && (this._observer ??= new MutationObserver(this._onMutations), this._observer.observe(e, {
142
+ childList: !0,
143
+ subtree: !0,
144
+ attributes: !0,
145
+ characterData: !0
146
+ })));
147
+ }
148
+ _serverMarked(e) {
149
+ let t = f(e);
150
+ if (t === this._serverSelection || (this._serverSelection = t, this._pending)) return;
151
+ let n = JSON.parse(t);
152
+ if (!n.length) return;
153
+ let r = this.value;
154
+ this._choice = e.multiple ? n : [n[n.length - 1]], this._changed(r);
155
+ }
69
156
  _watchForm(e) {
70
- e !== this._form && (this._form?.removeEventListener("reset", this._onReset), this._form = e, e?.addEventListener("reset", this._onReset));
157
+ e !== this._form && (this._form?.removeEventListener("reset", this._onReset), this._form?.removeEventListener("formdata", this._onFormData), this._form = e, e?.addEventListener("reset", this._onReset), e?.addEventListener("formdata", this._onFormData));
71
158
  }
72
- voidBeforeMorph(e) {
159
+ _finishReset() {
160
+ let e = this._pendingReset;
161
+ if (!e) return;
162
+ this._pendingReset = null;
73
163
  let t = this.select;
74
- if (e && e !== this && t) {
75
- let n = e.querySelector("select"), r = n ? c(n) : "", i = e.getAttribute("value") ?? "";
76
- this._serverValueChanged = i !== this._serverValue;
77
- let a = r !== this._serverSelection || this._serverValueChanged;
78
- this._serverSelection = r, this._serverValue = i, this._keep = a ? null : Array.from(t.selectedOptions, (e) => e.value);
79
- }
80
- return super.voidBeforeMorph(e);
164
+ if (e.defaultPrevented || !t || !this.isConnected) return;
165
+ let n = this.value;
166
+ this._initial === null ? (this._choice = m(t), this._pending = !1) : (this._choice = [this._initial], this._pending = !0), this._apply(), this._changed(n);
81
167
  }
82
- morphedCallback() {
83
- let e = this._keep, t = this._serverValueChanged;
84
- this._keep = null, this._serverValueChanged = !1;
85
- let n = this.select;
86
- if (!n) return;
87
- this.error && this._markInvalid(n);
88
- let r = this.getAttribute("value");
89
- if (t && r !== null) {
90
- this.value = r;
91
- return;
168
+ voidBeforeMorph(e) {
169
+ if (e && e !== this) {
170
+ this._flush();
171
+ let n = e instanceof t ? e._serverSelection : null, r = n ?? p(e), i = n === null && e instanceof t && !!this.select && r === f(this.select);
172
+ if (r !== null && !i) {
173
+ let e = this._serverSelection !== null && r !== this._serverSelection;
174
+ this._serverSelection = r;
175
+ let t = JSON.parse(r);
176
+ if (e && t.length && !this._pending) {
177
+ let e = this.value;
178
+ this._choice = this.select?.multiple ? t : [t[t.length - 1]], this._changed(e);
179
+ }
180
+ }
181
+ this._morphQueued || (this._morphQueued = !0, queueMicrotask(this._afterMorph));
92
182
  }
93
- if (!e) return;
94
- let i = new Set(e);
95
- for (let e of Array.from(n.options)) e.selected !== i.has(e.value) && (e.selected = i.has(e.value));
183
+ return super.voidBeforeMorph(e);
96
184
  }
97
185
  };
98
186
  t([a({
@@ -101,13 +189,50 @@ t([a({
101
189
  })], o.prototype, "size", void 0), t([a({
102
190
  type: String,
103
191
  reflect: !0
104
- })], o.prototype, "error", void 0), t([a({ type: String })], o.prototype, "value", null);
192
+ })], o.prototype, "error", void 0), t([a({
193
+ type: String,
194
+ reflect: !0
195
+ })], o.prototype, "value", null);
105
196
  function s(e, t) {
106
197
  for (let n of Array.from(e.options)) if (n.value === t) return !0;
107
198
  return !1;
108
199
  }
109
- function c(e) {
110
- return Array.from(e.querySelectorAll("option[selected]"), (e) => e.value).join("\0");
200
+ function c(e, t) {
201
+ return e.length === t.length && e.every((e, n) => e === t[n]);
202
+ }
203
+ function l(e) {
204
+ return e.nodeName === "OPTION" || e.nodeName === "OPTGROUP";
205
+ }
206
+ function u(e) {
207
+ return e.some((e) => e.type === "attributes" ? e.attributeName === "selected" || e.attributeName === "multiple" : !0);
208
+ }
209
+ function d(e) {
210
+ let t = !1, n = !1;
211
+ for (let r of e) r.type === "childList" && (t ||= Array.from(r.removedNodes).some(l), n ||= Array.from(r.addedNodes).some(l));
212
+ return t && n;
213
+ }
214
+ function f(e) {
215
+ return JSON.stringify(Array.from(e.querySelectorAll("option[selected]"), (e) => e.value));
216
+ }
217
+ function p(e) {
218
+ let t = e.querySelector("select");
219
+ return t ? f(t) : null;
220
+ }
221
+ function m(e) {
222
+ let t = JSON.parse(f(e));
223
+ if (e.multiple) return t;
224
+ if (t.length) return [t[t.length - 1]];
225
+ let n = Array.from(e.options).find((e) => !e.disabled);
226
+ return n ? [n.value] : [];
227
+ }
228
+ function h(e) {
229
+ return Array.from(e.options).filter((e) => e.selected);
230
+ }
231
+ function g(e) {
232
+ return h(e).map((e) => e.value);
233
+ }
234
+ function _(e) {
235
+ return !e.name || e.matches(":disabled") ? [] : h(e).filter((e) => !e.matches(":disabled")).map((e) => e.value);
111
236
  }
112
237
  customElements.get("void-select") || customElements.define("void-select", o);
113
238
  //#endregion
@@ -9,8 +9,8 @@ export declare class VoidSlider extends VoidSlider_base {
9
9
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
10
10
  static labelTarget: string;
11
11
  /**
12
- * Current position, between `min` and `max`. Defaults to 50. As an attribute it is the initial value;
13
- * read the `value` property for the current one.
12
+ * Current position, between `min` and `max`. Defaults to 50. Reflected to the `value` attribute as it
13
+ * moves; the form's reset target stays the value the slider started with.
14
14
  */
15
15
  value: number;
16
16
  /** Lowest value. Defaults to 0. */
@@ -62,7 +62,10 @@ var o = class extends n(e) {
62
62
  `;
63
63
  }
64
64
  };
65
- t([a({ type: Number })], o.prototype, "value", void 0), t([a({ type: Number })], o.prototype, "min", void 0), t([a({ type: Number })], o.prototype, "max", void 0), t([a({ type: Number })], o.prototype, "step", void 0), t([a({
65
+ t([a({
66
+ type: Number,
67
+ reflect: !0
68
+ })], o.prototype, "value", void 0), t([a({ type: Number })], o.prototype, "min", void 0), t([a({ type: Number })], o.prototype, "max", void 0), t([a({ type: Number })], o.prototype, "step", void 0), t([a({
66
69
  type: Boolean,
67
70
  reflect: !0
68
71
  })], o.prototype, "disabled", void 0), t([a({
@@ -6,7 +6,7 @@ declare const VoidSwitch_base: (new (...args: any[]) => import('../form-control.
6
6
  export declare class VoidSwitch extends VoidSwitch_base {
7
7
  /** Enter and Space fire a real `click`, as on a native button. */
8
8
  protected readonly _activation: KeyboardActivation;
9
- /** Whether the switch is on. The attribute is the initial state and the form's reset target. */
9
+ /** Whether the switch is on. Reflected to the attribute as it changes; the form's reset target stays the state it started with. */
10
10
  checked: boolean;
11
11
  /**
12
12
  * Stop the switch reacting and exclude it from the form submission. Also disabled by an enclosing
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { i as r, n as i } from "../chunks/keyboard-MQpfTX5I.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/tabs.ts
@@ -12,7 +12,7 @@ export declare class VoidTagsInput extends VoidTagsInput_base {
12
12
  static labelTarget: string;
13
13
  /**
14
14
  * The tags, as an array of strings or `{ text, color }` objects. Set it as a property from script, or
15
- * as a JSON array in the attribute.
15
+ * as a JSON array in the attribute, which follows the tags as they change.
16
16
  */
17
17
  value: TagValue[];
18
18
  /** Stop the field accepting input and removing tags, and exclude the values from the form submission. */
@@ -1,10 +1,11 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { t as n } from "../chunks/form-control-C0vH6gii.js";
4
- import { html as r, nothing as i } from "lit";
5
- import { property as a } from "lit/decorators.js";
4
+ import { t as r } from "../chunks/value-list-CH6GjYXM.js";
5
+ import { html as i, nothing as a } from "lit";
6
+ import { property as o } from "lit/decorators.js";
6
7
  //#region src/components/tags-input.ts
7
- var o = class extends n(e) {
8
+ var s = class extends n(e) {
8
9
  constructor(...e) {
9
10
  super(...e), this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "Add tag...", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
10
11
  }
@@ -26,25 +27,25 @@ var o = class extends n(e) {
26
27
  }
27
28
  render() {
28
29
  let e = this.value.length >= this.max;
29
- return r`
30
+ return i`
30
31
  <div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
31
32
  ${this.value.map((e, t) => {
32
33
  let n = this._tagText(e);
33
- return r`
34
- <span class="void-tags-input-tag" data-color=${this._tagColor(e) || i}>
34
+ return i`
35
+ <span class="void-tags-input-tag" data-color=${this._tagColor(e) || a}>
35
36
  <span class="void-tags-input-tag-text">${n}</span>
36
- ${!this.disabled && !this.readonly ? r`<button
37
+ ${!this.disabled && !this.readonly ? i`<button
37
38
  type="button"
38
39
  class="void-tags-input-tag-remove"
39
40
  aria-label="Remove ${n}"
40
41
  @click=${(e) => {
41
42
  e.stopPropagation(), this._removeTag(t);
42
43
  }}
43
- >×</button>` : i}
44
+ >×</button>` : a}
44
45
  </span>
45
46
  `;
46
47
  })}
47
- ${!e && !this.readonly ? r`<input
48
+ ${!e && !this.readonly ? i`<input
48
49
  class="void-tags-input-field"
49
50
  type="text"
50
51
  placeholder=${this.value.length === 0 ? this.placeholder : ""}
@@ -52,7 +53,7 @@ var o = class extends n(e) {
52
53
  @keydown=${this._onKeydown}
53
54
  @input=${this._onFieldInput}
54
55
  @paste=${this._onPaste}
55
- />` : i}
56
+ />` : a}
56
57
  </div>
57
58
  `;
58
59
  }
@@ -96,24 +97,27 @@ var o = class extends n(e) {
96
97
  }));
97
98
  }
98
99
  };
99
- t([a({ type: Array })], o.prototype, "value", void 0), t([a({
100
+ t([o({
101
+ converter: r,
102
+ reflect: !0
103
+ })], s.prototype, "value", void 0), t([o({
100
104
  type: Boolean,
101
105
  reflect: !0
102
- })], o.prototype, "disabled", void 0), t([a({
106
+ })], s.prototype, "disabled", void 0), t([o({
103
107
  type: Boolean,
104
108
  reflect: !0
105
- })], o.prototype, "readonly", void 0), t([a({ type: Number })], o.prototype, "max", void 0), t([a({ type: String })], o.prototype, "placeholder", void 0), t([a({
109
+ })], s.prototype, "readonly", void 0), t([o({ type: Number })], s.prototype, "max", void 0), t([o({ type: String })], s.prototype, "placeholder", void 0), t([o({
106
110
  type: String,
107
111
  reflect: !0
108
- })], o.prototype, "size", void 0), t([a({
112
+ })], s.prototype, "size", void 0), t([o({
109
113
  type: String,
110
114
  reflect: !0
111
- })], o.prototype, "color", void 0), t([a({
115
+ })], s.prototype, "color", void 0), t([o({
112
116
  type: String,
113
117
  reflect: !0
114
- })], o.prototype, "variant", void 0), t([a({
118
+ })], s.prototype, "variant", void 0), t([o({
115
119
  type: Boolean,
116
120
  attribute: "allow-duplicates"
117
- })], o.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", o);
121
+ })], s.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", s);
118
122
  //#endregion
119
- export { o as VoidTagsInput };
123
+ export { s as VoidTagsInput };
@@ -11,8 +11,8 @@ export declare class VoidTextarea extends VoidTextarea_base {
11
11
  /** While focus is inside, a morph does not apply the server's value over what the user is typing. */
12
12
  static editState: string[];
13
13
  /**
14
- * The text in the box. As an attribute it is the initial value (and the form's reset target); read or
15
- * set the `value` property for the current text.
14
+ * The text in the box. Reflected to the `value` attribute as it changes, and setting the attribute
15
+ * sets it; the form's reset target stays the value the box started with.
16
16
  */
17
17
  value: string;
18
18
  /**
@@ -70,7 +70,10 @@ var s = class extends n(e) {
70
70
  }));
71
71
  }
72
72
  };
73
- t([a({ type: String })], s.prototype, "value", void 0), t([a({
73
+ t([a({
74
+ type: String,
75
+ reflect: !0
76
+ })], s.prototype, "value", void 0), t([a({
74
77
  type: String,
75
78
  reflect: !0
76
79
  })], s.prototype, "placeholder", void 0), t([a({
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { n as r, t as i } from "../chunks/dismiss-Drsy_dE5.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/toast.ts
@@ -5,8 +5,8 @@ declare const VoidToggleGroup_base: (new (...args: any[]) => import('../form-con
5
5
  /** Multi-button toggle set for text editor toolbars and filter chips where one or many options can be active. */
6
6
  export declare class VoidToggleGroup extends VoidToggleGroup_base {
7
7
  /**
8
- * Comma-separated `value`s of the pressed toggles (`bold,italic`), or the single pressed value. As an
9
- * attribute it is the initial state and the form's reset target. Without it (or with an empty one) the
8
+ * Comma-separated `value`s of the pressed toggles (`bold,italic`), or the single pressed value. Reflected to the
9
+ * attribute as the pressed toggles change; the form's reset target stays the state it started with. Without it (or with an empty one) the
10
10
  * toggles that carry `pressed` in the markup set the initial value (the first of them unless
11
11
  * `multiple`); a non-empty `value` wins over their `pressed`.
12
12
  */
@@ -37,7 +37,10 @@ var o = class extends e {
37
37
  t([a({
38
38
  type: Boolean,
39
39
  reflect: !0
40
- })], o.prototype, "pressed", void 0), t([a({ type: String })], o.prototype, "value", void 0), t([a({
40
+ })], o.prototype, "pressed", void 0), t([a({
41
+ type: String,
42
+ reflect: !0
43
+ })], o.prototype, "value", void 0), t([a({
41
44
  type: Boolean,
42
45
  reflect: !0
43
46
  })], o.prototype, "disabled", void 0), t([a({
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { i as n, n as r } from "../chunks/parts-D30c8OoG.js";
3
+ import { i as n, n as r } from "../chunks/parts-CMQQop0D.js";
4
4
  import { t as i } from "../chunks/overlay-BywGMcDW.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/tooltip.ts
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated from custom-elements.json by packages/ui/cem/generate.js. Do not edit.",
3
3
  "package": "@voidable/ui",
4
- "version": "0.8.0",
4
+ "version": "0.9.0",
5
5
  "componentCount": 66,
6
6
  "tagCount": 78,
7
7
  "eventNames": [
@@ -912,7 +912,7 @@
912
912
  "tag": "void-checkbox-group",
913
913
  "className": "VoidCheckboxGroup",
914
914
  "module": "dist/components/checkbox-group.js",
915
- "attributes": 6,
915
+ "attributes": 7,
916
916
  "properties": 6,
917
917
  "events": [
918
918
  "void-change"
@@ -1185,7 +1185,7 @@
1185
1185
  "tag": "void-multiselect",
1186
1186
  "className": "VoidMultiselect",
1187
1187
  "module": "dist/components/multiselect.js",
1188
- "attributes": 7,
1188
+ "attributes": 8,
1189
1189
  "properties": 8,
1190
1190
  "events": [
1191
1191
  "void-change",