@voidable/ui 0.11.0 → 0.12.1
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 +1 -1
- package/dist/angular/index.d.ts +2 -2
- package/dist/angular/index.js +2 -1
- package/dist/chunks/activation-B8aBarKd.js +4 -0
- package/dist/chunks/carousel-C9u0bg5l.js +10 -0
- package/dist/chunks/choice-BTrsi7OW.js +16 -0
- package/dist/chunks/data-Baycjoo4.js +96 -0
- package/dist/chunks/fields-MEqz-olE.js +21 -0
- package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
- package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
- package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
- package/dist/chunks/menu-CxRRgkJI.js +21 -0
- package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
- package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
- package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
- package/dist/chunks/overlay-K1ilWC1p.js +4 -0
- package/dist/chunks/pickers-CjlFgNke.js +36 -0
- package/dist/chunks/table-BBpqwWEi.js +4 -0
- package/dist/chunks/tabs-Buf3EBWq.js +10 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +22 -14
- package/dist/components/action-input.d.ts +2 -1
- package/dist/components/action-input.js +59 -55
- package/dist/components/bar-chart.js +41 -40
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +15 -11
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +23 -16
- package/dist/components/calendar.d.ts +45 -10
- package/dist/components/calendar.js +183 -129
- package/dist/components/carousel.d.ts +22 -0
- package/dist/components/carousel.js +64 -35
- package/dist/components/charts/data.d.ts +2 -2
- package/dist/components/checkbox-group.js +22 -21
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +29 -24
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.js +19 -11
- package/dist/components/color-picker.js +28 -27
- package/dist/components/combobox.d.ts +13 -1
- package/dist/components/combobox.js +54 -41
- package/dist/components/compose-input.d.ts +9 -1
- package/dist/components/compose-input.js +28 -16
- package/dist/components/dialog.js +1 -1
- package/dist/components/donut-chart.js +57 -56
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +54 -39
- package/dist/components/editable.d.ts +11 -1
- package/dist/components/editable.js +35 -22
- package/dist/components/error-fallback.d.ts +4 -2
- package/dist/components/error-fallback.js +34 -28
- package/dist/components/file-upload.d.ts +9 -0
- package/dist/components/file-upload.js +54 -28
- package/dist/components/gauge.js +108 -107
- package/dist/components/hamburger.d.ts +7 -0
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.js +22 -14
- package/dist/components/indicator.js +15 -14
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.js +43 -42
- package/dist/components/menu.d.ts +25 -0
- package/dist/components/menu.js +55 -33
- package/dist/components/multiselect.d.ts +17 -1
- package/dist/components/multiselect.js +96 -74
- package/dist/components/nav-menu.d.ts +9 -0
- package/dist/components/nav-menu.js +30 -23
- package/dist/components/number-input.d.ts +15 -1
- package/dist/components/number-input.js +71 -37
- package/dist/components/pagination.js +25 -24
- package/dist/components/pin-input.d.ts +11 -0
- package/dist/components/pin-input.js +46 -32
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +21 -13
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.d.ts +10 -1
- package/dist/components/radio.js +37 -32
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.js +40 -28
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +14 -10
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +5 -3
- package/dist/components/spinner.js +21 -14
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.d.ts +2 -2
- package/dist/components/status-dot.js +12 -14
- package/dist/components/stepper.d.ts +2 -0
- package/dist/components/stepper.js +20 -13
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +24 -16
- package/dist/components/table.d.ts +77 -1
- package/dist/components/table.js +562 -73
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +42 -33
- package/dist/components/tag.js +12 -11
- package/dist/components/tags-input.d.ts +10 -1
- package/dist/components/tags-input.js +42 -30
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +35 -28
- package/dist/components/toggle-group.d.ts +8 -0
- package/dist/components/toggle-group.js +24 -17
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +23 -15
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +20 -12
- package/dist/components.json +96 -74
- package/dist/custom-elements.json +4213 -131
- package/dist/dev/rules.d.ts +0 -1
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +244 -113
- package/dist/index.d.ts +4 -0
- package/dist/index.js +68 -66
- package/dist/keyboard-activation.d.ts +9 -9
- package/dist/keyboard.d.ts +2 -10
- package/dist/keymaps/activation.d.ts +8 -0
- package/dist/keymaps/carousel.d.ts +9 -0
- package/dist/keymaps/choice.d.ts +21 -0
- package/dist/keymaps/fields.d.ts +31 -0
- package/dist/keymaps/index.d.ts +2 -0
- package/dist/keymaps/menu.d.ts +36 -0
- package/dist/keymaps/nav-menu.d.ts +11 -0
- package/dist/keymaps/overlay.d.ts +4 -0
- package/dist/keymaps/pickers.d.ts +36 -0
- package/dist/keymaps/table.d.ts +8 -0
- package/dist/keymaps/tabs.d.ts +7 -0
- package/dist/keymaps.js +51 -0
- package/dist/keys.d.ts +46 -0
- package/dist/keys.js +57 -0
- package/dist/llms.txt +11 -3
- package/dist/messages/ar.d.ts +1 -0
- package/dist/messages/ar.js +130 -0
- package/dist/messages/fr.d.ts +1 -0
- package/dist/messages/fr.js +109 -0
- package/dist/messages.d.ts +213 -0
- package/dist/messages.js +190 -0
- package/dist/modal.d.ts +7 -0
- package/dist/reference.md +817 -17
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing.js +79 -0
- package/dist/types/elements.d.ts +89 -73
- package/dist/types/react.d.ts +5 -1
- package/dist/types/solid.d.ts +5 -1
- package/dist/types/solid2.d.ts +4 -0
- package/dist/types/svelte.d.ts +5 -1
- package/dist/types/vue.d.ts +5 -1
- package/dist/vscode.html-custom-data.json +384 -18
- package/dist/web-types.json +830 -69
- package/package.json +22 -2
- package/dist/chunks/data-BpiiNapL.js +0 -95
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { localeOf as i, msg as a } from "../messages.js";
|
|
5
|
+
import { t as o } from "../chunks/form-control-fL-Hhy91.js";
|
|
6
|
+
import { n as s } from "../chunks/projection-oPe6ipjL.js";
|
|
7
|
+
import { a as c } from "../chunks/fields-MEqz-olE.js";
|
|
8
|
+
import { html as l, nothing as u } from "lit";
|
|
9
|
+
import { property as d, query as f } from "lit/decorators.js";
|
|
10
|
+
import { live as p } from "lit/directives/live.js";
|
|
8
11
|
//#region src/components/number-input.ts
|
|
9
|
-
var
|
|
12
|
+
var m = class extends o(e) {
|
|
10
13
|
constructor(...e) {
|
|
11
|
-
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;
|
|
14
|
+
super(...e), this.keys = null, 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;
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.keyMap = c;
|
|
12
18
|
}
|
|
13
19
|
static {
|
|
14
20
|
this.labelTarget = "input[role=spinbutton]";
|
|
@@ -28,7 +34,7 @@ var l = class extends n(e) {
|
|
|
28
34
|
formSubmission() {
|
|
29
35
|
let e = this._pendingText;
|
|
30
36
|
if (e !== null) {
|
|
31
|
-
let t =
|
|
37
|
+
let t = this._parse(e);
|
|
32
38
|
if (!isNaN(t)) return String(this._clamp(t));
|
|
33
39
|
if (!e.trim()) return "";
|
|
34
40
|
}
|
|
@@ -38,7 +44,30 @@ var l = class extends n(e) {
|
|
|
38
44
|
return Math.min(Math.max(e, this.min), this.max);
|
|
39
45
|
}
|
|
40
46
|
_format(e) {
|
|
41
|
-
|
|
47
|
+
let t = i(this), n = this.precision >= 0 ? {
|
|
48
|
+
minimumFractionDigits: this.precision,
|
|
49
|
+
maximumFractionDigits: this.precision
|
|
50
|
+
} : { maximumFractionDigits: 20 };
|
|
51
|
+
try {
|
|
52
|
+
return new Intl.NumberFormat(t, {
|
|
53
|
+
useGrouping: !1,
|
|
54
|
+
...n
|
|
55
|
+
}).format(e);
|
|
56
|
+
} catch {
|
|
57
|
+
return this.precision >= 0 ? e.toFixed(this.precision) : String(e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
_parse(e) {
|
|
61
|
+
let t;
|
|
62
|
+
try {
|
|
63
|
+
t = new Intl.NumberFormat(i(this));
|
|
64
|
+
} catch {
|
|
65
|
+
return parseFloat(e);
|
|
66
|
+
}
|
|
67
|
+
let n = t.formatToParts(-12345.6), r = (e, t) => n.find((t) => t.type === e)?.value ?? t, a = r("group", ","), o = r("decimal", "."), s = /* @__PURE__ */ new Map();
|
|
68
|
+
for (let e = 0; e < 10; e++) s.set(t.format(e), String(e));
|
|
69
|
+
let c = Array.from(e.trim()).map((e) => s.get(e) ?? e).join("");
|
|
70
|
+
return c = c.split(a).join("").replace(/[\s ]/g, ""), c = o === "." ? c : c.split(o).join("."), c = c.replace(/[−]/g, (e) => e === "−" ? "-" : ""), parseFloat(c);
|
|
42
71
|
}
|
|
43
72
|
_round(e) {
|
|
44
73
|
return this.precision >= 0 ? Number(e.toFixed(this.precision)) : e;
|
|
@@ -96,17 +125,19 @@ var l = class extends n(e) {
|
|
|
96
125
|
this._pressTimer !== null && (clearTimeout(this._pressTimer), this._pressTimer = null), this._repeatTimer !== null && (clearInterval(this._repeatTimer), this._repeatTimer = null), this._repeatCount = 0;
|
|
97
126
|
}
|
|
98
127
|
_onKeydown(e) {
|
|
99
|
-
this.formDisabled || this.readonly
|
|
128
|
+
if (this.formDisabled || this.readonly) return;
|
|
129
|
+
let t = n(this, e);
|
|
130
|
+
t === "increment" ? (e.preventDefault(), this._increment()) : t === "decrement" && (e.preventDefault(), this._decrement());
|
|
100
131
|
}
|
|
101
132
|
_onBlur() {
|
|
102
|
-
if (!this._input || this.readonly ||
|
|
133
|
+
if (!this._input || this.readonly || s(this)) return;
|
|
103
134
|
this._pendingText = null;
|
|
104
|
-
let e =
|
|
135
|
+
let e = this._parse(this._input.value);
|
|
105
136
|
this._input.value.trim() ? isNaN(e) ? this._input.value = this.value === null ? "" : this._format(this.value) : this._commit(e) : this._commit(null);
|
|
106
137
|
}
|
|
107
138
|
_onFieldInput() {
|
|
108
139
|
this._pendingText = this._input?.value ?? null, this.formSync();
|
|
109
|
-
let e =
|
|
140
|
+
let e = this._parse(this._pendingText ?? ""), t = Number.isNaN(e) ? null : e;
|
|
110
141
|
this.dispatchEvent(new CustomEvent("void-input", {
|
|
111
142
|
bubbles: !0,
|
|
112
143
|
composed: !0,
|
|
@@ -117,12 +148,12 @@ var l = class extends n(e) {
|
|
|
117
148
|
this._onBlur();
|
|
118
149
|
}
|
|
119
150
|
render() {
|
|
120
|
-
let e =
|
|
151
|
+
let e = l`
|
|
121
152
|
<button
|
|
122
153
|
class="void-number-input-btn void-number-input-btn-dec"
|
|
123
154
|
type="button"
|
|
124
155
|
?disabled=${this.disabled || this.readonly || this.value !== null && this.value <= this.min}
|
|
125
|
-
aria-label
|
|
156
|
+
aria-label=${a(this, "numberInput.decrement")}
|
|
126
157
|
@pointerdown=${(e) => {
|
|
127
158
|
e.preventDefault(), this._startRepeat(-1);
|
|
128
159
|
}}
|
|
@@ -135,12 +166,12 @@ var l = class extends n(e) {
|
|
|
135
166
|
<line x1="3" y1="8" x2="13" y2="8"/>
|
|
136
167
|
</svg>
|
|
137
168
|
</button>
|
|
138
|
-
`, t =
|
|
169
|
+
`, t = l`
|
|
139
170
|
<button
|
|
140
171
|
class="void-number-input-btn void-number-input-btn-inc"
|
|
141
172
|
type="button"
|
|
142
173
|
?disabled=${this.disabled || this.readonly || this.value !== null && this.value >= this.max}
|
|
143
|
-
aria-label
|
|
174
|
+
aria-label=${a(this, "numberInput.increment")}
|
|
144
175
|
@pointerdown=${(e) => {
|
|
145
176
|
e.preventDefault(), this._startRepeat(1);
|
|
146
177
|
}}
|
|
@@ -155,59 +186,62 @@ var l = class extends n(e) {
|
|
|
155
186
|
</svg>
|
|
156
187
|
</button>
|
|
157
188
|
`;
|
|
158
|
-
return
|
|
189
|
+
return l`
|
|
159
190
|
${this.controls !== "none" && this.controls !== "right" ? e : ""}
|
|
160
|
-
${this.prefix ?
|
|
191
|
+
${this.prefix ? l`<span class="void-number-input-prefix">${this.prefix}</span>` : u}
|
|
161
192
|
<input
|
|
162
193
|
class="void-number-input-field"
|
|
163
194
|
type="text"
|
|
164
195
|
inputmode=${this.precision === 0 ? "numeric" : "decimal"}
|
|
165
|
-
.value=${
|
|
196
|
+
.value=${p(this._pendingText ?? (this.value === null ? "" : this._format(this.value)))}
|
|
166
197
|
placeholder=${this.placeholder}
|
|
167
198
|
?disabled=${this.disabled}
|
|
168
199
|
?readonly=${this.readonly}
|
|
169
200
|
role="spinbutton"
|
|
170
|
-
aria-valuenow=${this.value ??
|
|
171
|
-
aria-valuetext=${this.value === null ?
|
|
172
|
-
aria-required=${this.required ? "true" :
|
|
173
|
-
aria-valuemin=${isFinite(this.min) ? this.min :
|
|
174
|
-
aria-valuemax=${isFinite(this.max) ? this.max :
|
|
175
|
-
aria-label=${this.label ||
|
|
201
|
+
aria-valuenow=${this.value ?? u}
|
|
202
|
+
aria-valuetext=${this.value === null ? u : this._format(this.value)}
|
|
203
|
+
aria-required=${this.required ? "true" : u}
|
|
204
|
+
aria-valuemin=${isFinite(this.min) ? this.min : u}
|
|
205
|
+
aria-valuemax=${isFinite(this.max) ? this.max : u}
|
|
206
|
+
aria-label=${this.label || a(this, "numberInput.label")}
|
|
176
207
|
@keydown=${this._onKeydown}
|
|
177
208
|
@blur=${this._onBlur}
|
|
178
209
|
@input=${this._onFieldInput}
|
|
179
210
|
@change=${this._onInputChange}
|
|
180
211
|
/>
|
|
181
|
-
${this.unit ?
|
|
182
|
-
${this.controls === "right" ?
|
|
212
|
+
${this.unit ? l`<span class="void-number-input-unit">${this.unit}</span>` : u}
|
|
213
|
+
${this.controls === "right" ? l`<div class="void-number-input-btn-group">${t}${e}</div>` : ""}
|
|
183
214
|
${this.controls === "sides" ? t : ""}
|
|
184
215
|
`;
|
|
185
216
|
}
|
|
186
217
|
};
|
|
187
|
-
t([
|
|
218
|
+
t([d({
|
|
219
|
+
attribute: "keys",
|
|
220
|
+
converter: r
|
|
221
|
+
})], m.prototype, "keys", void 0), t([d({
|
|
188
222
|
reflect: !0,
|
|
189
223
|
converter: {
|
|
190
224
|
fromAttribute: (e) => e === null || e.trim() === "" ? null : Number(e),
|
|
191
225
|
toAttribute: (e) => e == null ? null : String(e)
|
|
192
226
|
}
|
|
193
|
-
})],
|
|
227
|
+
})], m.prototype, "value", void 0), t([d({ type: Number })], m.prototype, "min", void 0), t([d({ type: Number })], m.prototype, "max", void 0), t([d({ converter: {
|
|
194
228
|
fromAttribute: (e) => e === "any" ? "any" : e === null ? 1 : Number(e),
|
|
195
229
|
toAttribute: (e) => String(e)
|
|
196
|
-
} })],
|
|
230
|
+
} })], m.prototype, "step", void 0), t([d({ type: Number })], m.prototype, "precision", void 0), t([d({
|
|
197
231
|
type: Boolean,
|
|
198
232
|
reflect: !0
|
|
199
|
-
})],
|
|
233
|
+
})], m.prototype, "disabled", void 0), t([d({
|
|
200
234
|
type: Boolean,
|
|
201
235
|
reflect: !0
|
|
202
|
-
})],
|
|
236
|
+
})], m.prototype, "readonly", void 0), t([d({
|
|
203
237
|
type: String,
|
|
204
238
|
reflect: !0
|
|
205
|
-
})],
|
|
239
|
+
})], m.prototype, "size", void 0), t([d({
|
|
206
240
|
type: String,
|
|
207
241
|
reflect: !0
|
|
208
|
-
})],
|
|
242
|
+
})], m.prototype, "color", void 0), t([d({ type: String })], m.prototype, "placeholder", void 0), t([d({
|
|
209
243
|
type: String,
|
|
210
244
|
reflect: !0
|
|
211
|
-
})],
|
|
245
|
+
})], m.prototype, "controls", void 0), t([d({ type: String })], m.prototype, "label", void 0), t([d({ type: String })], m.prototype, "prefix", void 0), t([d({ type: String })], m.prototype, "unit", void 0), t([f(".void-number-input-field")], m.prototype, "_input", void 0), customElements.get("void-number-input") || customElements.define("void-number-input", m);
|
|
212
246
|
//#endregion
|
|
213
|
-
export {
|
|
247
|
+
export { m as VoidNumberInput };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { msg as n } from "../messages.js";
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.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/pagination.ts
|
|
7
|
-
|
|
8
|
-
var
|
|
8
|
+
r();
|
|
9
|
+
var s = class extends e {
|
|
9
10
|
constructor(...e) {
|
|
10
11
|
super(...e), this.total = 1, this.value = 1, this.siblings = 1, this.size = "md", this.hrefTemplate = "", this.param = "";
|
|
11
12
|
}
|
|
@@ -43,18 +44,18 @@ var o = class extends e {
|
|
|
43
44
|
}, 0);
|
|
44
45
|
}
|
|
45
46
|
_renderLinks(e) {
|
|
46
|
-
let t = 0,
|
|
47
|
+
let t = 0, r = (e, t, n, r) => r ? i`<span class="void-pagination-btn" aria-disabled="true" aria-label=${e}>${t}</span>` : i`<a class="void-pagination-btn" href=${this._href(n)} aria-label=${e}
|
|
47
48
|
@click=${(e) => this._onLinkClick(e, n)}>${t}</a>`;
|
|
48
|
-
return
|
|
49
|
-
<nav role="navigation" aria-label
|
|
50
|
-
${n(
|
|
51
|
-
${e.map((e) => e === "ellipsis" ? (t++,
|
|
49
|
+
return i`
|
|
50
|
+
<nav role="navigation" aria-label=${n(this, "pagination.label")}>
|
|
51
|
+
${r(n(this, "pagination.previous"), "«", this.value - 1, this.value <= 1)}
|
|
52
|
+
${e.map((e) => e === "ellipsis" ? (t++, i`<span class="void-pagination-ellipsis" aria-hidden="true" data-key=${t}>…</span>`) : i`<a
|
|
52
53
|
class="void-pagination-btn"
|
|
53
54
|
href=${this._href(e)}
|
|
54
|
-
aria-current=${e === this.value ? "page" :
|
|
55
|
+
aria-current=${e === this.value ? "page" : a}
|
|
55
56
|
@click=${(t) => this._onLinkClick(t, e)}
|
|
56
57
|
>${e}</a>`)}
|
|
57
|
-
${n(
|
|
58
|
+
${r(n(this, "pagination.next"), "»", this.value + 1, this.value >= this.total)}
|
|
58
59
|
</nav>
|
|
59
60
|
`;
|
|
60
61
|
}
|
|
@@ -78,21 +79,21 @@ var o = class extends e {
|
|
|
78
79
|
let e = this._pages();
|
|
79
80
|
if (this._linkMode) return this._renderLinks(e);
|
|
80
81
|
let t = 0;
|
|
81
|
-
return
|
|
82
|
-
<nav role="navigation" aria-label
|
|
82
|
+
return i`
|
|
83
|
+
<nav role="navigation" aria-label=${n(this, "pagination.label")}>
|
|
83
84
|
<button
|
|
84
85
|
type="button"
|
|
85
86
|
class="void-pagination-btn"
|
|
86
87
|
?disabled=${this.value <= 1}
|
|
87
88
|
@click=${() => this._go(this.value - 1)}
|
|
88
|
-
aria-label
|
|
89
|
+
aria-label=${n(this, "pagination.previous")}
|
|
89
90
|
>«</button>
|
|
90
|
-
${e.map((e) => e === "ellipsis" ? (t++,
|
|
91
|
+
${e.map((e) => e === "ellipsis" ? (t++, i`<span class="void-pagination-ellipsis" aria-hidden="true" data-key=${t}>…</span>`) : i`
|
|
91
92
|
<button
|
|
92
93
|
type="button"
|
|
93
94
|
class="void-pagination-btn"
|
|
94
95
|
?disabled=${e === this.value}
|
|
95
|
-
aria-current=${e === this.value ? "page" :
|
|
96
|
+
aria-current=${e === this.value ? "page" : a}
|
|
96
97
|
@click=${() => this._go(e)}
|
|
97
98
|
>${e}</button>
|
|
98
99
|
`)}
|
|
@@ -101,25 +102,25 @@ var o = class extends e {
|
|
|
101
102
|
class="void-pagination-btn"
|
|
102
103
|
?disabled=${this.value >= this.total}
|
|
103
104
|
@click=${() => this._go(this.value + 1)}
|
|
104
|
-
aria-label
|
|
105
|
+
aria-label=${n(this, "pagination.next")}
|
|
105
106
|
>»</button>
|
|
106
107
|
</nav>
|
|
107
108
|
`;
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
t([
|
|
111
|
+
t([o({ type: Number })], s.prototype, "total", void 0), t([o({
|
|
111
112
|
type: Number,
|
|
112
113
|
reflect: !0
|
|
113
|
-
})],
|
|
114
|
+
})], s.prototype, "value", void 0), t([o({ type: Number })], s.prototype, "siblings", void 0), t([o({
|
|
114
115
|
type: String,
|
|
115
116
|
reflect: !0
|
|
116
|
-
})],
|
|
117
|
+
})], s.prototype, "size", void 0), t([o({
|
|
117
118
|
type: String,
|
|
118
119
|
attribute: "href-template",
|
|
119
120
|
reflect: !0
|
|
120
|
-
})],
|
|
121
|
+
})], s.prototype, "hrefTemplate", void 0), t([o({
|
|
121
122
|
type: String,
|
|
122
123
|
reflect: !0
|
|
123
|
-
})],
|
|
124
|
+
})], s.prototype, "param", void 0), customElements.get("void-pagination") || customElements.define("void-pagination", s);
|
|
124
125
|
//#endregion
|
|
125
|
-
export {
|
|
126
|
+
export { s as VoidPagination };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropertyDeclaration, PropertyValues } from 'lit';
|
|
2
2
|
import { VoidElement } from '../base.js';
|
|
3
|
+
import { KeyOverrides } from '../keys.js';
|
|
3
4
|
declare const VoidPinInput_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
|
|
4
5
|
/**
|
|
5
6
|
* Single-character input cells for OTP verification codes, PIN entry, and multi-digit confirmation fields.
|
|
@@ -10,6 +11,15 @@ declare const VoidPinInput_base: (new (...args: any[]) => import('../form-contro
|
|
|
10
11
|
* @fires {CustomEvent<{ value: string }>} void-complete - Every cell is filled.
|
|
11
12
|
*/
|
|
12
13
|
export declare class VoidPinInput extends VoidPinInput_base {
|
|
14
|
+
/** Key bindings for this element's actions, as JSON (`{"previous":["ArrowLeft"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
15
|
+
keys: KeyOverrides | null;
|
|
16
|
+
/** @internal The actions of this element and their default keys. */
|
|
17
|
+
static readonly keyMap: {
|
|
18
|
+
previous: string[];
|
|
19
|
+
next: string[];
|
|
20
|
+
deleteBackward: string[];
|
|
21
|
+
deleteForward: string[];
|
|
22
|
+
};
|
|
13
23
|
/** While focus is inside, a morph does not apply the server's value over what the user is typing. */
|
|
14
24
|
static editState: string[];
|
|
15
25
|
/** Number of cells, so the number of characters in the code. Defaults to 6. */
|
|
@@ -44,6 +54,7 @@ export declare class VoidPinInput extends VoidPinInput_base {
|
|
|
44
54
|
/** Character shown in every empty cell, such as `-`. */
|
|
45
55
|
placeholder: string;
|
|
46
56
|
requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
|
|
57
|
+
private _name;
|
|
47
58
|
protected updated(changed: PropertyValues): void;
|
|
48
59
|
private get _effectiveLength();
|
|
49
60
|
private get _parsedGroups();
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { actionFor as n, keysConverter as r } from "../keys.js";
|
|
4
|
+
import { msg as i, nameHost as a } from "../messages.js";
|
|
5
|
+
import { t as o } from "../chunks/form-control-fL-Hhy91.js";
|
|
6
|
+
import { n as s } from "../chunks/projection-oPe6ipjL.js";
|
|
7
|
+
import { n as c, t as l } from "../chunks/secret-value-CmTtVkMg.js";
|
|
8
|
+
import { o as u } from "../chunks/fields-MEqz-olE.js";
|
|
9
|
+
import { html as d, nothing as f } from "lit";
|
|
10
|
+
import { property as p } from "lit/decorators.js";
|
|
11
|
+
import { live as m } from "lit/directives/live.js";
|
|
10
12
|
//#region src/components/pin-input.ts
|
|
11
|
-
var
|
|
13
|
+
var h = class t extends o(e) {
|
|
12
14
|
constructor(...e) {
|
|
13
|
-
super(...e), this.length = 6, this.groups = "", this.value = "", this.disabled = !1, this.mask = !1, this.type = "numeric", this.size = "md", this.color = "default", this.placeholder = "", this._focusValue = null, this._onFocusIn = () => {
|
|
15
|
+
super(...e), this.keys = null, this.length = 6, this.groups = "", this.value = "", this.disabled = !1, this.mask = !1, this.type = "numeric", this.size = "md", this.color = "default", this.placeholder = "", this._focusValue = null, this._onFocusIn = () => {
|
|
14
16
|
this._focusValue ??= this.value;
|
|
15
17
|
}, this._onFocusOut = (e) => {
|
|
16
|
-
if (e.relatedTarget instanceof Node && this.contains(e.relatedTarget) ||
|
|
18
|
+
if (e.relatedTarget instanceof Node && this.contains(e.relatedTarget) || s(this)) return;
|
|
17
19
|
let t = this._focusValue;
|
|
18
20
|
this._focusValue = null, t !== null && t !== this.value && this.dispatchEvent(new CustomEvent("void-change", {
|
|
19
21
|
bubbles: !0,
|
|
@@ -22,14 +24,20 @@ var d = class t extends n(e) {
|
|
|
22
24
|
}));
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
static {
|
|
28
|
+
this.keyMap = u;
|
|
29
|
+
}
|
|
25
30
|
static {
|
|
26
31
|
this.editState = ["value"];
|
|
27
32
|
}
|
|
28
33
|
requestUpdate(e, n, r) {
|
|
29
|
-
super.requestUpdate(e, n,
|
|
34
|
+
super.requestUpdate(e, n, c(this.mask, e, r, () => t.getPropertyOptions("value")));
|
|
35
|
+
}
|
|
36
|
+
_name() {
|
|
37
|
+
a(this, i(this, "pinInput.label"), (e, t) => this.setHostAttribute(e, t));
|
|
30
38
|
}
|
|
31
39
|
updated(e) {
|
|
32
|
-
super.updated(e), this.mask && e.get("mask") !== void 0 &&
|
|
40
|
+
super.updated(e), this._name(), this.mask && e.get("mask") !== void 0 && l(this);
|
|
33
41
|
}
|
|
34
42
|
get _effectiveLength() {
|
|
35
43
|
let e = this._parsedGroups;
|
|
@@ -46,7 +54,7 @@ var d = class t extends n(e) {
|
|
|
46
54
|
return t;
|
|
47
55
|
}
|
|
48
56
|
connectedCallback() {
|
|
49
|
-
super.connectedCallback(), this.setHostAttribute("role", "group"), this.
|
|
57
|
+
super.connectedCallback(), this.setHostAttribute("role", "group"), this._name(), this.addEventListener("focusin", this._onFocusIn), this.addEventListener("focusout", this._onFocusOut);
|
|
50
58
|
}
|
|
51
59
|
disconnectedCallback() {
|
|
52
60
|
super.disconnectedCallback(), this.removeEventListener("focusin", this._onFocusIn), this.removeEventListener("focusout", this._onFocusOut);
|
|
@@ -85,16 +93,16 @@ var d = class t extends n(e) {
|
|
|
85
93
|
this._syncValue(), r && t < this._effectiveLength - 1 && this._focusCell(t + 1);
|
|
86
94
|
}
|
|
87
95
|
_onKeydown(e, t) {
|
|
88
|
-
let
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
96
|
+
let r = e.target, i = n(this, e);
|
|
97
|
+
if (i === "deleteBackward") {
|
|
98
|
+
if (r.value) r.value = "", this._syncValue();
|
|
91
99
|
else if (t > 0) {
|
|
92
100
|
this._focusCell(t - 1);
|
|
93
101
|
let e = this._getCells()[t - 1];
|
|
94
102
|
e.value = "", this._syncValue();
|
|
95
103
|
}
|
|
96
104
|
e.preventDefault();
|
|
97
|
-
} else
|
|
105
|
+
} else i === "previous" ? (e.preventDefault(), this._focusCell(t - 1)) : i === "next" ? (e.preventDefault(), this._focusCell(t + 1)) : i === "deleteForward" && (r.value = "", this._syncValue(), e.preventDefault());
|
|
98
106
|
}
|
|
99
107
|
_onPaste(e) {
|
|
100
108
|
e.preventDefault();
|
|
@@ -113,19 +121,22 @@ var d = class t extends n(e) {
|
|
|
113
121
|
render() {
|
|
114
122
|
let e = [], t = this._separatorIndices();
|
|
115
123
|
for (let n = 0; n < this._effectiveLength; n++) {
|
|
116
|
-
t.has(n) && e.push(
|
|
124
|
+
t.has(n) && e.push(d`<span class="void-pin-separator" aria-hidden="true">–</span>`);
|
|
117
125
|
let r = this.value[n] ?? "";
|
|
118
|
-
e.push(
|
|
126
|
+
e.push(d`
|
|
119
127
|
<input
|
|
120
128
|
class="void-pin-cell"
|
|
121
129
|
type=${this.mask ? "password" : "text"}
|
|
122
130
|
inputmode=${this.type === "numeric" ? "numeric" : "text"}
|
|
123
131
|
maxlength="1"
|
|
124
|
-
.value=${
|
|
125
|
-
placeholder=${this.placeholder ||
|
|
132
|
+
.value=${m(r)}
|
|
133
|
+
placeholder=${this.placeholder || f}
|
|
126
134
|
?disabled=${this.disabled}
|
|
127
135
|
autocomplete="one-time-code"
|
|
128
|
-
aria-label=${
|
|
136
|
+
aria-label=${i(this, "pinInput.digit", {
|
|
137
|
+
index: n + 1,
|
|
138
|
+
count: this._effectiveLength
|
|
139
|
+
})}
|
|
129
140
|
@input=${(e) => this._onInput(e, n)}
|
|
130
141
|
@keydown=${(e) => this._onKeydown(e, n)}
|
|
131
142
|
@paste=${this._onPaste}
|
|
@@ -133,30 +144,33 @@ var d = class t extends n(e) {
|
|
|
133
144
|
/>
|
|
134
145
|
`);
|
|
135
146
|
}
|
|
136
|
-
return
|
|
147
|
+
return d`<div class="void-pin-input">${e}</div>`;
|
|
137
148
|
}
|
|
138
149
|
};
|
|
139
|
-
t([
|
|
150
|
+
t([p({
|
|
151
|
+
attribute: "keys",
|
|
152
|
+
converter: r
|
|
153
|
+
})], h.prototype, "keys", void 0), t([p({ type: Number })], h.prototype, "length", void 0), t([p({
|
|
140
154
|
type: String,
|
|
141
155
|
reflect: !0
|
|
142
|
-
})],
|
|
156
|
+
})], h.prototype, "groups", void 0), t([p({
|
|
143
157
|
type: String,
|
|
144
158
|
reflect: !0
|
|
145
|
-
})],
|
|
159
|
+
})], h.prototype, "value", void 0), t([p({
|
|
146
160
|
type: Boolean,
|
|
147
161
|
reflect: !0
|
|
148
|
-
})],
|
|
162
|
+
})], h.prototype, "disabled", void 0), t([p({
|
|
149
163
|
type: Boolean,
|
|
150
164
|
reflect: !0
|
|
151
|
-
})],
|
|
165
|
+
})], h.prototype, "mask", void 0), t([p({
|
|
152
166
|
type: String,
|
|
153
167
|
reflect: !0
|
|
154
|
-
})],
|
|
168
|
+
})], h.prototype, "type", void 0), t([p({
|
|
155
169
|
type: String,
|
|
156
170
|
reflect: !0
|
|
157
|
-
})],
|
|
171
|
+
})], h.prototype, "size", void 0), t([p({
|
|
158
172
|
type: String,
|
|
159
173
|
reflect: !0
|
|
160
|
-
})],
|
|
174
|
+
})], h.prototype, "color", void 0), t([p({ type: String })], h.prototype, "placeholder", void 0), customElements.get("void-pin-input") || customElements.define("void-pin-input", h);
|
|
161
175
|
//#endregion
|
|
162
|
-
export {
|
|
176
|
+
export { h as VoidPinInput };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { OverlayController } from '../overlay.js';
|
|
3
3
|
import { PartsController } from '../parts.js';
|
|
4
|
+
import { KeyOverrides } from '../keys.js';
|
|
4
5
|
/**
|
|
5
6
|
* Anchored overlay for contextual detail and mini-forms that need more room than a tooltip.
|
|
6
7
|
*
|
|
@@ -18,6 +19,12 @@ import { PartsController } from '../parts.js';
|
|
|
18
19
|
* popover is closing. Cancelable when the user caused it (every reason but `parent` and `api`).
|
|
19
20
|
*/
|
|
20
21
|
export declare class VoidPopover extends VoidElement {
|
|
22
|
+
/** Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
23
|
+
keys: KeyOverrides | null;
|
|
24
|
+
/** @internal The actions of this element and their default keys. */
|
|
25
|
+
static readonly keyMap: {
|
|
26
|
+
close: string[];
|
|
27
|
+
};
|
|
21
28
|
/** Whether the popover is open. */
|
|
22
29
|
open: boolean;
|
|
23
30
|
/** Side of the trigger it opens on; it flips to the opposite side when there is no room. */
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { keysConverter as n } from "../keys.js";
|
|
4
|
+
import { i as r, n as i } from "../chunks/parts-DI_3VpSy.js";
|
|
5
|
+
import { t as a } from "../chunks/overlay-BuV-4Yvt.js";
|
|
6
|
+
import { t as o } from "../chunks/overlay-K1ilWC1p.js";
|
|
7
|
+
import { property as s } from "lit/decorators.js";
|
|
6
8
|
//#region src/components/popover.ts
|
|
7
|
-
var
|
|
9
|
+
var c = class extends e {
|
|
8
10
|
constructor(...e) {
|
|
9
|
-
super(...e), this.open = !1, this.side = "bottom", this.align = "start", this.trigger = "click", this._parts = new
|
|
11
|
+
super(...e), this.keys = null, this.open = !1, this.side = "bottom", this.align = "start", this.trigger = "click", this._parts = new i(this, {
|
|
10
12
|
tags: ["void-popover-trigger", "void-popover-content"],
|
|
11
13
|
onChange: () => {
|
|
12
14
|
this._wire(), this.requestUpdate();
|
|
13
15
|
}
|
|
14
|
-
}), this._overlay = new
|
|
16
|
+
}), this._overlay = new a(this, {
|
|
15
17
|
kind: "dialog",
|
|
16
18
|
surface: () => this._parts.one("void-popover-content"),
|
|
17
19
|
isOpen: () => this.open,
|
|
@@ -33,8 +35,11 @@ var o = class extends e {
|
|
|
33
35
|
this.trigger !== "click" || !t || !t.contains(e.target) || this._overlay.toggle("trigger");
|
|
34
36
|
};
|
|
35
37
|
}
|
|
38
|
+
static {
|
|
39
|
+
this.keyMap = o;
|
|
40
|
+
}
|
|
36
41
|
_control() {
|
|
37
|
-
return
|
|
42
|
+
return r(this._parts.one("void-popover-trigger"));
|
|
38
43
|
}
|
|
39
44
|
_wire() {
|
|
40
45
|
let e = this._parts.one("void-popover-content"), t = this._control();
|
|
@@ -47,18 +52,21 @@ var o = class extends e {
|
|
|
47
52
|
super.disconnectedCallback(), this.removeEventListener("click", this._handleTriggerClick);
|
|
48
53
|
}
|
|
49
54
|
};
|
|
50
|
-
t([
|
|
55
|
+
t([s({
|
|
56
|
+
attribute: "keys",
|
|
57
|
+
converter: n
|
|
58
|
+
})], c.prototype, "keys", void 0), t([s({
|
|
51
59
|
type: Boolean,
|
|
52
60
|
reflect: !0
|
|
53
|
-
})],
|
|
61
|
+
})], c.prototype, "open", void 0), t([s({
|
|
54
62
|
type: String,
|
|
55
63
|
reflect: !0
|
|
56
|
-
})],
|
|
64
|
+
})], c.prototype, "side", void 0), t([s({
|
|
57
65
|
type: String,
|
|
58
66
|
reflect: !0
|
|
59
|
-
})],
|
|
67
|
+
})], c.prototype, "align", void 0), t([s({
|
|
60
68
|
type: String,
|
|
61
69
|
reflect: !0
|
|
62
|
-
})],
|
|
70
|
+
})], c.prototype, "trigger", void 0), customElements.get("void-popover") || customElements.define("void-popover", c);
|
|
63
71
|
//#endregion
|
|
64
|
-
export {
|
|
72
|
+
export { c as VoidPopover };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/form-control-
|
|
3
|
+
import { n } from "../chunks/form-control-fL-Hhy91.js";
|
|
4
4
|
import { t as r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
5
|
import { html as i, nothing as a } from "lit";
|
|
6
6
|
import { property as o } from "lit/decorators.js";
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
2
|
import { KeyboardActivation } from '../keyboard-activation.js';
|
|
3
3
|
import { ProjectionController } from '../projection.js';
|
|
4
|
+
import { KeyOverrides } from '../keys.js';
|
|
4
5
|
declare const VoidRadio_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
|
|
5
6
|
/** Single mutually exclusive option for forms and surveys; typically used inside VoidRadioGroup. */
|
|
6
7
|
export declare class VoidRadio extends VoidRadio_base {
|
|
7
|
-
/**
|
|
8
|
+
/** Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. */
|
|
9
|
+
keys: KeyOverrides | null;
|
|
10
|
+
/** @internal The actions of this element and their default keys. */
|
|
11
|
+
static readonly keyMap: {
|
|
12
|
+
activate: string[];
|
|
13
|
+
next: string[];
|
|
14
|
+
previous: string[];
|
|
15
|
+
};
|
|
16
|
+
/** Space fires a real `click`, as on a native button. */
|
|
8
17
|
protected readonly _activation: KeyboardActivation;
|
|
9
18
|
/** Whether this radio is the selected one. Checking one radio unchecks the others with the same `name`. */
|
|
10
19
|
checked: boolean;
|