stimulus_plumbers 0.4.13 → 0.4.15
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +3 -1
- data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +52 -0
- data/app/assets/javascripts/stimulus-plumbers/index.es.js +295 -181
- data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
- data/config/locales/en.yml +12 -0
- data/docs/component/combobox.md +3 -2
- data/docs/component/form.md +36 -4
- data/docs/component/plumber.md +40 -1
- data/docs/component/progress.md +29 -9
- data/lib/stimulus_plumbers/components/card/slots.rb +0 -2
- data/lib/stimulus_plumbers/components/combobox/{builder.rb → config.rb} +7 -11
- data/lib/stimulus_plumbers/components/combobox.rb +12 -12
- data/lib/stimulus_plumbers/components/password_strength.rb +103 -0
- data/lib/stimulus_plumbers/components/progress/shared.rb +31 -0
- data/lib/stimulus_plumbers/components/progress_bar.rb +44 -20
- data/lib/stimulus_plumbers/components/progress_meter.rb +16 -14
- data/lib/stimulus_plumbers/components/progress_ring.rb +7 -22
- data/lib/stimulus_plumbers/components/timeline/event/slots.rb +0 -1
- data/lib/stimulus_plumbers/form/builder.rb +15 -4
- data/lib/stimulus_plumbers/form/fields/inputs/password/revealable.rb +72 -0
- data/lib/stimulus_plumbers/form/fields/inputs/password/strength.rb +31 -0
- data/lib/stimulus_plumbers/form/fields/inputs/password.rb +34 -65
- data/lib/stimulus_plumbers/helpers/progress_helper.rb +10 -2
- data/lib/stimulus_plumbers/password/requirements.rb +182 -0
- data/lib/stimulus_plumbers/password_strength_validator.rb +29 -0
- data/lib/stimulus_plumbers/plumber/config.rb +37 -0
- data/lib/stimulus_plumbers/plumber/dispatcher/callable_inspector.rb +4 -0
- data/lib/stimulus_plumbers/plumber/slots.rb +2 -2
- data/lib/stimulus_plumbers/themes/icons/external.rb +1 -1
- data/lib/stimulus_plumbers/themes/schema/icon.rb +15 -4
- data/lib/stimulus_plumbers/themes/schema.rb +12 -4
- data/lib/stimulus_plumbers/version.rb +1 -1
- data/lib/stimulus_plumbers.rb +7 -1
- data/vendor/component/manifest.json +9 -0
- data/vendor/controller/docs/password-strength.md +38 -0
- data/vendor/controller/docs/progress.md +33 -16
- data/vendor/controller/manifest.json +52 -0
- metadata +10 -2
|
@@ -199,45 +199,45 @@ var h = (e = "a11y") => `${e}-${Math.random().toString(36).substr(2, 9)}`, ee =
|
|
|
199
199
|
function w(e, t) {
|
|
200
200
|
g(e, "aria-disabled", t), t ? e.setAttribute("tabindex", "-1") : e.removeAttribute("tabindex");
|
|
201
201
|
}
|
|
202
|
-
var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t),
|
|
202
|
+
var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t), ie = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), ae = {
|
|
203
203
|
menu: "menu",
|
|
204
204
|
listbox: "listbox",
|
|
205
205
|
tree: "tree",
|
|
206
206
|
grid: "grid",
|
|
207
207
|
dialog: "dialog"
|
|
208
|
-
},
|
|
208
|
+
}, oe = (e, t, n) => {
|
|
209
209
|
Object.entries(t).forEach(([t, r]) => {
|
|
210
210
|
e.setAttribute(t, r), n[t] = r;
|
|
211
211
|
});
|
|
212
|
-
},
|
|
213
|
-
function
|
|
212
|
+
}, D = (e, t, n) => n || !e.hasAttribute(t);
|
|
213
|
+
function se({ trigger: e, target: t, role: n = null, override: r = !1 }) {
|
|
214
214
|
let i = {
|
|
215
215
|
trigger: {},
|
|
216
216
|
target: {}
|
|
217
217
|
};
|
|
218
218
|
if (!e || !t) return i;
|
|
219
219
|
let a = {}, o = {};
|
|
220
|
-
if (n &&
|
|
221
|
-
let e =
|
|
220
|
+
if (n && D(t, "role", r) && (o.role = n), t.id && (D(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && D(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && D(e, "aria-haspopup", r)) {
|
|
221
|
+
let e = ae[n] || "true";
|
|
222
222
|
e && (a["aria-haspopup"] = e);
|
|
223
223
|
}
|
|
224
|
-
return
|
|
224
|
+
return oe(t, o, i.target), oe(e, a, i.trigger), i;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var ce = (e, t) => {
|
|
227
227
|
t.forEach((t) => {
|
|
228
228
|
e.hasAttribute(t) && e.removeAttribute(t);
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
-
function
|
|
232
|
-
!e || !t || (
|
|
231
|
+
function le({ trigger: e, target: t, attributes: n = null }) {
|
|
232
|
+
!e || !t || (ce(e, n || [
|
|
233
233
|
"aria-controls",
|
|
234
234
|
"aria-haspopup",
|
|
235
235
|
"aria-describedby"
|
|
236
|
-
]), (!n || n.includes("role")) &&
|
|
236
|
+
]), (!n || n.includes("role")) && ce(t, ["role"]));
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/requestor.js
|
|
240
|
-
var
|
|
240
|
+
var O = class {
|
|
241
241
|
constructor() {
|
|
242
242
|
this._abortController = null, this._timer = null;
|
|
243
243
|
}
|
|
@@ -259,33 +259,33 @@ var k = class {
|
|
|
259
259
|
};
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/researcher.js
|
|
262
|
-
function
|
|
262
|
+
function ue(e, t) {
|
|
263
263
|
let n = 0;
|
|
264
264
|
for (let r = 0; r < t.length && n < e.length; r++) t[r] === e[n] && n++;
|
|
265
265
|
return n === e.length;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function de(e, t) {
|
|
268
268
|
return t.includes(e);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function fe(e, t) {
|
|
271
271
|
return t.startsWith(e);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return e === "contains" ?
|
|
273
|
+
function pe(e) {
|
|
274
|
+
return e === "contains" ? de : e === "prefix" ? fe : ue;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function me(e, t) {
|
|
277
277
|
return t === "textContent" ? e.textContent?.trim().toLowerCase() ?? "" : (e.getAttribute(t) ?? "").toLowerCase();
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i :
|
|
279
|
+
function he(e, t, n = {}) {
|
|
280
|
+
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : pe(r), s = t.toLowerCase(), c = 0;
|
|
281
281
|
return e.querySelectorAll("[role=\"option\"]").forEach((e) => {
|
|
282
|
-
let t = a.some((t) => o(s,
|
|
282
|
+
let t = a.some((t) => o(s, me(e, t)));
|
|
283
283
|
b(e, !t), t && c++;
|
|
284
284
|
}), c;
|
|
285
285
|
}
|
|
286
286
|
//#endregion
|
|
287
287
|
//#region src/plumbers/plumber/geometry.js
|
|
288
|
-
var
|
|
288
|
+
var ge = {
|
|
289
289
|
get top() {
|
|
290
290
|
return "bottom";
|
|
291
291
|
},
|
|
@@ -299,7 +299,7 @@ var A = {
|
|
|
299
299
|
return "left";
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
-
function
|
|
302
|
+
function k({ x: e, y: t, width: n, height: r }) {
|
|
303
303
|
return {
|
|
304
304
|
x: e,
|
|
305
305
|
y: t,
|
|
@@ -311,42 +311,42 @@ function j({ x: e, y: t, width: n, height: r }) {
|
|
|
311
311
|
bottom: t + r
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function _e(e, t = "vertical") {
|
|
315
315
|
return t === "horizontal" ? e.left + e.width / 2 : e.top + e.height / 2;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function A() {
|
|
318
|
+
return k({
|
|
319
319
|
x: 0,
|
|
320
320
|
y: 0,
|
|
321
321
|
width: window.innerWidth || document.documentElement.clientWidth,
|
|
322
322
|
height: window.innerHeight || document.documentElement.clientHeight
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function ve(e) {
|
|
326
326
|
if (!(e instanceof HTMLElement)) return !1;
|
|
327
|
-
let t =
|
|
327
|
+
let t = A(), n = e.getBoundingClientRect(), r = n.top <= t.height && n.top + n.height > 0, i = n.left <= t.width && n.left + n.width > 0;
|
|
328
328
|
return r && i;
|
|
329
329
|
}
|
|
330
330
|
//#endregion
|
|
331
331
|
//#region src/plumbers/plumber/config.js
|
|
332
|
-
var
|
|
332
|
+
var j = {
|
|
333
333
|
get visibleOnly() {
|
|
334
334
|
return !0;
|
|
335
335
|
},
|
|
336
336
|
hiddenClass: null
|
|
337
|
-
},
|
|
337
|
+
}, ye = {
|
|
338
338
|
element: null,
|
|
339
339
|
visible: null,
|
|
340
340
|
dispatch: !0,
|
|
341
341
|
prefix: ""
|
|
342
|
-
},
|
|
342
|
+
}, M = class {
|
|
343
343
|
constructor(e, t = {}) {
|
|
344
344
|
this.controller = e;
|
|
345
|
-
let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({},
|
|
346
|
-
this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r :
|
|
345
|
+
let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, ye, t);
|
|
346
|
+
this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r : j.visibleOnly, this.visibleCallback = typeof r == "string" ? r : null, this.notify = !!i, this.prefix = typeof a == "string" && a ? a : e.identifier;
|
|
347
347
|
}
|
|
348
348
|
get visible() {
|
|
349
|
-
return this.element instanceof HTMLElement ? !this.visibleOnly ||
|
|
349
|
+
return this.element instanceof HTMLElement ? !this.visibleOnly || ve(this.element) && this.isVisible(this.element) : !1;
|
|
350
350
|
}
|
|
351
351
|
isVisible(e) {
|
|
352
352
|
if (this.visibleCallback) {
|
|
@@ -375,7 +375,7 @@ var N = {
|
|
|
375
375
|
return n instanceof Promise ? await n : n;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
},
|
|
378
|
+
}, be = {
|
|
379
379
|
normalize(e) {
|
|
380
380
|
return typeof e == "string" ? e : "";
|
|
381
381
|
},
|
|
@@ -385,7 +385,7 @@ var N = {
|
|
|
385
385
|
};
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/plumbers/formatters/credit_card.js
|
|
388
|
-
function
|
|
388
|
+
function xe(e) {
|
|
389
389
|
let t = 0, n = !1;
|
|
390
390
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
391
391
|
let i = parseInt(e[r], 10);
|
|
@@ -393,15 +393,15 @@ function ye(e) {
|
|
|
393
393
|
}
|
|
394
394
|
return t % 10 == 0;
|
|
395
395
|
}
|
|
396
|
-
var
|
|
396
|
+
var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
|
|
397
397
|
normalize(e) {
|
|
398
|
-
return typeof e == "string" ? e.replace(
|
|
398
|
+
return typeof e == "string" ? e.replace(Se, "") : "";
|
|
399
399
|
},
|
|
400
400
|
validate(e) {
|
|
401
|
-
return typeof e != "string" || !
|
|
401
|
+
return typeof e != "string" || !Ce.test(e) ? !1 : xe(e);
|
|
402
402
|
},
|
|
403
403
|
format(e) {
|
|
404
|
-
return typeof e == "string" ? e.replace(
|
|
404
|
+
return typeof e == "string" ? e.replace(we, "$1 ") : "";
|
|
405
405
|
},
|
|
406
406
|
cells() {
|
|
407
407
|
return {
|
|
@@ -414,22 +414,22 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
414
414
|
length: 0
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
},
|
|
417
|
+
}, N = { 1: 10 }, P = /\D/g, Ee = /^\+\d{7,15}$/, De = {
|
|
418
418
|
normalize(e) {
|
|
419
419
|
if (typeof e != "string") return "";
|
|
420
|
-
let t = e.trimStart().startsWith("+"), n = e.replace(
|
|
420
|
+
let t = e.trimStart().startsWith("+"), n = e.replace(P, "");
|
|
421
421
|
return t ? `+${n}` : n;
|
|
422
422
|
},
|
|
423
423
|
validate(e) {
|
|
424
424
|
if (typeof e != "string") return !1;
|
|
425
|
-
if (
|
|
426
|
-
let t = e.replace(
|
|
427
|
-
return Object.values(
|
|
425
|
+
if (Ee.test(e)) return !0;
|
|
426
|
+
let t = e.replace(P, "");
|
|
427
|
+
return Object.values(N).includes(t.length);
|
|
428
428
|
},
|
|
429
429
|
format(e) {
|
|
430
430
|
if (typeof e != "string") return "";
|
|
431
|
-
let t = e.replace(
|
|
432
|
-
for (let [e, n] of Object.entries(
|
|
431
|
+
let t = e.replace(P, "");
|
|
432
|
+
for (let [e, n] of Object.entries(N)) {
|
|
433
433
|
if (t.length === n) return `(${t.slice(0, 3)}) ${t.slice(3, 6)}-${t.slice(6)}`;
|
|
434
434
|
let r = n + e.length;
|
|
435
435
|
if (t.length === r && t.startsWith(e)) {
|
|
@@ -439,16 +439,16 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
439
439
|
}
|
|
440
440
|
return e;
|
|
441
441
|
}
|
|
442
|
-
},
|
|
442
|
+
}, Oe = /[^\d.,-]/g, ke = /^-?\d+(\.\d+)?$/, Ae = {
|
|
443
443
|
normalize(e) {
|
|
444
444
|
if (typeof e != "string") return "";
|
|
445
|
-
let t = e.replace(
|
|
445
|
+
let t = e.replace(Oe, "");
|
|
446
446
|
if (!t) return "";
|
|
447
447
|
let n = t.lastIndexOf(","), r = t.lastIndexOf(".");
|
|
448
448
|
return n > -1 && r > -1 ? n > r ? t.replace(/\./g, "").replace(",", ".") : t.replace(/,/g, "") : n > -1 ? t.slice(n + 1).length <= 2 ? t.replace(",", ".") : t.replace(/,/g, "") : t;
|
|
449
449
|
},
|
|
450
450
|
validate(e) {
|
|
451
|
-
return typeof e == "string" &&
|
|
451
|
+
return typeof e == "string" && ke.test(e);
|
|
452
452
|
},
|
|
453
453
|
format(e, t = {}) {
|
|
454
454
|
if (typeof e != "string") return "";
|
|
@@ -468,18 +468,18 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
468
468
|
return e;
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, F = /^\d{4}-\d{2}-\d{2}$/, je = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Me = /\D/g, I = {
|
|
472
472
|
normalize(e) {
|
|
473
473
|
if (typeof e != "string") return "";
|
|
474
474
|
let t = e.trim();
|
|
475
|
-
if (
|
|
476
|
-
let n = t.match(
|
|
475
|
+
if (F.test(t)) return t;
|
|
476
|
+
let n = t.match(je);
|
|
477
477
|
if (n) {
|
|
478
478
|
let [, e, t, r] = n;
|
|
479
479
|
if (e.length === 4) return `${e}-${t.padStart(2, "0")}-${r.padStart(2, "0")}`;
|
|
480
480
|
if (r.length === 4) return `${r}-${e.padStart(2, "0")}-${t.padStart(2, "0")}`;
|
|
481
481
|
}
|
|
482
|
-
let r = t.replace(
|
|
482
|
+
let r = t.replace(Me, "");
|
|
483
483
|
if (r.length === 8) {
|
|
484
484
|
let e = parseInt(r.slice(0, 4), 10);
|
|
485
485
|
return e >= 1e3 && e <= 9999 ? `${r.slice(0, 4)}-${r.slice(4, 6)}-${r.slice(6, 8)}` : `${r.slice(4, 8)}-${r.slice(0, 2)}-${r.slice(2, 4)}`;
|
|
@@ -488,8 +488,8 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
488
488
|
},
|
|
489
489
|
validate(e) {
|
|
490
490
|
if (typeof e != "string") return !1;
|
|
491
|
-
let t =
|
|
492
|
-
if (!
|
|
491
|
+
let t = I.normalize(e);
|
|
492
|
+
if (!F.test(t)) return !1;
|
|
493
493
|
let n = /* @__PURE__ */ new Date(`${t}T00:00:00Z`);
|
|
494
494
|
return !isNaN(n.getTime()) && n.toISOString().startsWith(t);
|
|
495
495
|
},
|
|
@@ -509,11 +509,11 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
509
509
|
return e;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
},
|
|
512
|
+
}, Ne = /^([01]?\d|2[0-3]):([0-5]\d)$/, L = {
|
|
513
513
|
normalize(e) {
|
|
514
514
|
if (typeof e != "string") return "";
|
|
515
515
|
let t = e.trim();
|
|
516
|
-
if (
|
|
516
|
+
if (Ne.test(t)) {
|
|
517
517
|
let [e, n] = t.split(":");
|
|
518
518
|
return `${String(parseInt(e, 10)).padStart(2, "0")}:${n}`;
|
|
519
519
|
}
|
|
@@ -525,7 +525,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
525
525
|
return "";
|
|
526
526
|
},
|
|
527
527
|
validate(e) {
|
|
528
|
-
return
|
|
528
|
+
return L.normalize(e) !== "";
|
|
529
529
|
},
|
|
530
530
|
format(e, t = {}) {
|
|
531
531
|
if (typeof e != "string") return "";
|
|
@@ -536,14 +536,14 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
536
536
|
let a = r < 12 ? "AM" : "PM";
|
|
537
537
|
return `${r % 12 || 12}:${i} ${a}`;
|
|
538
538
|
}
|
|
539
|
-
},
|
|
539
|
+
}, Pe = {
|
|
540
540
|
digits: /[^0-9]/g,
|
|
541
541
|
letters: /[^a-zA-Z]/g,
|
|
542
542
|
alphanumeric: /[^0-9a-zA-Z]/g
|
|
543
|
-
},
|
|
543
|
+
}, Fe = {
|
|
544
544
|
normalize(e, t = {}) {
|
|
545
545
|
if (typeof e != "string") return "";
|
|
546
|
-
let n =
|
|
546
|
+
let n = Pe[t.charset] ?? Pe.alphanumeric, r = e.replace(n, "").toUpperCase(), i = t.length ?? 0;
|
|
547
547
|
return i > 0 ? r.slice(0, i) : r;
|
|
548
548
|
},
|
|
549
549
|
validate(e, t = {}) {
|
|
@@ -560,7 +560,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
560
560
|
length: e.length ?? 0
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
|
-
},
|
|
563
|
+
}, R = {
|
|
564
564
|
PLAIN: "plain",
|
|
565
565
|
CREDIT_CARD: "creditCard",
|
|
566
566
|
PHONE: "phone",
|
|
@@ -568,26 +568,26 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
568
568
|
DATE: "date",
|
|
569
569
|
TIME: "time",
|
|
570
570
|
CODE: "code"
|
|
571
|
-
},
|
|
572
|
-
[
|
|
573
|
-
[
|
|
574
|
-
[
|
|
575
|
-
[
|
|
576
|
-
[
|
|
577
|
-
[
|
|
578
|
-
[
|
|
579
|
-
]),
|
|
580
|
-
type:
|
|
571
|
+
}, z = /* @__PURE__ */ new Map([
|
|
572
|
+
[R.PLAIN, be],
|
|
573
|
+
[R.CREDIT_CARD, Te],
|
|
574
|
+
[R.PHONE, De],
|
|
575
|
+
[R.CURRENCY, Ae],
|
|
576
|
+
[R.DATE, I],
|
|
577
|
+
[R.TIME, L],
|
|
578
|
+
[R.CODE, Fe]
|
|
579
|
+
]), Ie = {
|
|
580
|
+
type: R.PLAIN,
|
|
581
581
|
options: {}
|
|
582
|
-
},
|
|
582
|
+
}, Le = class extends M {
|
|
583
583
|
static register(e, t) {
|
|
584
|
-
|
|
584
|
+
z.set(e, t);
|
|
585
585
|
}
|
|
586
586
|
constructor(e, t = {}) {
|
|
587
|
-
super(e, t), this.type = t.type ??
|
|
587
|
+
super(e, t), this.type = t.type ?? Ie.type, this.options = t.options ?? Ie.options, this.enhance();
|
|
588
588
|
}
|
|
589
589
|
enhance() {
|
|
590
|
-
let e = this, t =
|
|
590
|
+
let e = this, t = z.get(e.type) ?? z.get(R.PLAIN), n = {
|
|
591
591
|
normalize: (n) => t.normalize?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
592
592
|
validate: (n) => t.validate?.(n, e.options) ?? !0,
|
|
593
593
|
format: (n) => t.format?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
@@ -600,16 +600,16 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
600
600
|
configurable: !0
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
-
},
|
|
603
|
+
}, B = (e, t) => new Le(e, t), Re = {
|
|
604
604
|
groups: [],
|
|
605
605
|
length: 0
|
|
606
|
-
},
|
|
606
|
+
}, ze = (e) => {
|
|
607
607
|
let t = [], n = 0;
|
|
608
608
|
for (let r of e) n += r, t.push(n);
|
|
609
609
|
return t;
|
|
610
|
-
},
|
|
610
|
+
}, Be = class extends M {
|
|
611
611
|
constructor(e, t = {}) {
|
|
612
|
-
super(e, t), this.groups = Array.isArray(t.groups) ? t.groups :
|
|
612
|
+
super(e, t), this.groups = Array.isArray(t.groups) ? t.groups : Re.groups, this.length = t.length ?? Re.length, this.adopt(), this.enhance();
|
|
613
613
|
}
|
|
614
614
|
get cells() {
|
|
615
615
|
return this.controller.cellTargets ?? [];
|
|
@@ -628,7 +628,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
628
628
|
adopt() {
|
|
629
629
|
let e = this.expected();
|
|
630
630
|
this.cells.length < e && console.warn(`[CharacterCells] expected ${e} cells, found ${this.cells.length}`);
|
|
631
|
-
let t =
|
|
631
|
+
let t = ze(this.groups);
|
|
632
632
|
if (this.grouped) {
|
|
633
633
|
this.cells.forEach((n, r) => {
|
|
634
634
|
x(n, !0);
|
|
@@ -661,7 +661,7 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
661
661
|
draw(e = "", { focused: t = !1 } = {}) {
|
|
662
662
|
let n = typeof e == "string" ? e : "";
|
|
663
663
|
if (this.grouped) {
|
|
664
|
-
let e =
|
|
664
|
+
let e = ze(this.groups);
|
|
665
665
|
this.cells.forEach((r, i) => {
|
|
666
666
|
let a = i === 0 ? 0 : e[i - 1], o = e[i];
|
|
667
667
|
if (a >= this.expected()) {
|
|
@@ -682,7 +682,40 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
682
682
|
e.textContent = r[n] ?? "", e.toggleAttribute("data-filled", r[n] != null), e.toggleAttribute("data-caret", t && n === r.length);
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
-
},
|
|
685
|
+
}, Ve = (e, t) => new Be(e, t), V = { RULES: "rules" }, H = {
|
|
686
|
+
WEAK: "weak",
|
|
687
|
+
FINE: "fine",
|
|
688
|
+
STRONG: "strong"
|
|
689
|
+
}, He = { low: 34 }, Ue = (e, t) => {
|
|
690
|
+
let n = t.match(new RegExp(e, "g"));
|
|
691
|
+
return n ? n.length : 0;
|
|
692
|
+
}, We = (e, t) => {
|
|
693
|
+
let n = e.pattern == null ? t.length : Ue(e.pattern, t), r = e.min ?? 0, i = e.max ?? Infinity;
|
|
694
|
+
return n >= r && n <= i;
|
|
695
|
+
}, Ge = (e, t, n) => t > 0 && e === t ? H.STRONG : (t === 0 ? 0 : Math.round(e / t * 100)) < (n.low ?? He.low) ? H.WEAK : H.FINE, U = /* @__PURE__ */ new Map([[V.RULES, { score(e, t = [], n = {}) {
|
|
696
|
+
let r = typeof e == "string" ? e : "", i = t.reduce((e, t) => (e[t.key] = We(t, r), e), {}), a = t.filter((e) => i[e.key]).length;
|
|
697
|
+
return {
|
|
698
|
+
value: t.length === 0 ? 0 : Math.round(a / t.length * 100),
|
|
699
|
+
level: Ge(a, t.length, n),
|
|
700
|
+
rules: i
|
|
701
|
+
};
|
|
702
|
+
} }]]), W = class extends M {
|
|
703
|
+
static register(e, t) {
|
|
704
|
+
U.set(e, t);
|
|
705
|
+
}
|
|
706
|
+
constructor(e, t = {}) {
|
|
707
|
+
super(e, t), this.type = t.type ?? V.RULES, this.enhance();
|
|
708
|
+
}
|
|
709
|
+
enhance() {
|
|
710
|
+
let e = U.get(this.type) ?? U.get(V.RULES), t = { score: (t, n, r) => e.score(t, n ?? [], r ?? {}) };
|
|
711
|
+
Object.defineProperty(this.controller, "strength", {
|
|
712
|
+
get() {
|
|
713
|
+
return t;
|
|
714
|
+
},
|
|
715
|
+
configurable: !0
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}, Ke = (e, t) => new W(e, t), qe = /^\d{4}-\d{2}-\d{2}$/;
|
|
686
719
|
function G(e) {
|
|
687
720
|
return e instanceof Date && !isNaN(e);
|
|
688
721
|
}
|
|
@@ -691,7 +724,7 @@ function K(...e) {
|
|
|
691
724
|
if (e.length === 1) {
|
|
692
725
|
let t = e[0];
|
|
693
726
|
if (!t) return;
|
|
694
|
-
if (typeof t == "string" &&
|
|
727
|
+
if (typeof t == "string" && qe.test(t)) {
|
|
695
728
|
let [e, n, r] = t.split("-").map(Number), i = new Date(e, n - 1, r);
|
|
696
729
|
if (G(i)) return i;
|
|
697
730
|
} else {
|
|
@@ -705,7 +738,7 @@ function K(...e) {
|
|
|
705
738
|
}
|
|
706
739
|
//#endregion
|
|
707
740
|
//#region src/plumbers/calendar.js
|
|
708
|
-
var
|
|
741
|
+
var Je = 7, Ye = 12, q = 10, Xe = {
|
|
709
742
|
locales: ["default"],
|
|
710
743
|
today: "",
|
|
711
744
|
day: null,
|
|
@@ -720,11 +753,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
720
753
|
disabledYears: [],
|
|
721
754
|
firstDayOfWeek: 0,
|
|
722
755
|
onNavigated: "navigated"
|
|
723
|
-
},
|
|
756
|
+
}, Ze = class extends M {
|
|
724
757
|
constructor(e, t = {}) {
|
|
725
758
|
super(e, t);
|
|
726
|
-
let n = Object.assign({},
|
|
727
|
-
this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o :
|
|
759
|
+
let n = Object.assign({}, Xe, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
|
|
760
|
+
this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Xe.firstDayOfWeek;
|
|
728
761
|
let { disabledDates: s, disabledWeekdays: c, disabledDays: l, disabledMonths: u, disabledYears: d } = n;
|
|
729
762
|
this.disabledDates = Array.isArray(s) ? s : [], this.disabledWeekdays = Array.isArray(c) ? c : [], this.disabledDays = Array.isArray(l) ? l : [], this.disabledMonths = Array.isArray(u) ? u : [], this.disabledYears = Array.isArray(d) ? d : [];
|
|
730
763
|
let { today: f, day: p, month: m, year: h } = n;
|
|
@@ -764,7 +797,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
764
797
|
let a = new Date(t, e, i);
|
|
765
798
|
n.push(r(a));
|
|
766
799
|
}
|
|
767
|
-
let s = n.length %
|
|
800
|
+
let s = n.length % Je, c = s === 0 ? 0 : Je - s;
|
|
768
801
|
for (let i = 1; i <= c; i++) {
|
|
769
802
|
let a = new Date(t, e + 1, i);
|
|
770
803
|
n.push(r(a));
|
|
@@ -773,7 +806,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
773
806
|
}
|
|
774
807
|
buildMonthsOfYear() {
|
|
775
808
|
let e = new Intl.DateTimeFormat(this.localesValue, { month: "long" }), t = new Intl.DateTimeFormat(this.localesValue, { month: "short" }), n = new Intl.DateTimeFormat(this.localesValue, { month: "numeric" }), r = [];
|
|
776
|
-
for (let i = 0; i <
|
|
809
|
+
for (let i = 0; i < Ye; i++) {
|
|
777
810
|
let a = new Date(this.year, i), o = new Date(this.year, i, 1), s = new Date(this.year, i + 1, 0), c = t.format(a), l = e.format(a), u = this.since && s < this.since || this.till && o > this.till, d = this.disabledMonths.some((e) => i == e || c === e || l === e);
|
|
778
811
|
r.push({
|
|
779
812
|
date: a,
|
|
@@ -940,7 +973,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
940
973
|
};
|
|
941
974
|
} });
|
|
942
975
|
}
|
|
943
|
-
}, J = (e, t) => new
|
|
976
|
+
}, J = (e, t) => new Ze(e, t), Qe = class extends M {
|
|
944
977
|
constructor(e, t = {}) {
|
|
945
978
|
super(e, t), this.handle = this.handle.bind(this), this.onSelect = t.onSelect || null;
|
|
946
979
|
}
|
|
@@ -966,7 +999,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
966
999
|
iso: i
|
|
967
1000
|
} });
|
|
968
1001
|
}
|
|
969
|
-
},
|
|
1002
|
+
}, $e = class extends M {
|
|
970
1003
|
constructor(e, t = {}) {
|
|
971
1004
|
super(e, t), this.handle = this.handle.bind(this);
|
|
972
1005
|
}
|
|
@@ -983,7 +1016,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
983
1016
|
let n = parseInt(t.dataset.month, 10);
|
|
984
1017
|
isNaN(n) || this.dispatch("selected", { detail: { month: n } });
|
|
985
1018
|
}
|
|
986
|
-
},
|
|
1019
|
+
}, et = class extends M {
|
|
987
1020
|
constructor(e, t = {}) {
|
|
988
1021
|
super(e, t), this.handle = this.handle.bind(this);
|
|
989
1022
|
}
|
|
@@ -1000,20 +1033,20 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1000
1033
|
let n = parseInt(t.dataset.year, 10);
|
|
1001
1034
|
isNaN(n) || this.dispatch("selected", { detail: { year: n } });
|
|
1002
1035
|
}
|
|
1003
|
-
},
|
|
1036
|
+
}, tt = (e, t) => new Qe(e, t), nt = (e, t) => new $e(e, t), rt = (e, t) => new et(e, t), Y = {
|
|
1004
1037
|
content: null,
|
|
1005
1038
|
url: "",
|
|
1006
1039
|
reload: "never",
|
|
1007
1040
|
stale: 3600,
|
|
1008
1041
|
onLoad: "canLoad",
|
|
1009
1042
|
onLoaded: "contentLoaded"
|
|
1010
|
-
},
|
|
1043
|
+
}, it = class extends M {
|
|
1011
1044
|
constructor(e, t = {}) {
|
|
1012
1045
|
super(e, t);
|
|
1013
1046
|
let n = Object.assign({}, Y, t), { content: r, url: i, reload: a, stale: o } = n;
|
|
1014
1047
|
this.content = r, this.url = i, this.reload = typeof a == "string" ? a : Y.reload, this.stale = typeof o == "number" ? o : Y.stale;
|
|
1015
1048
|
let { onLoad: s, onLoaded: c } = n;
|
|
1016
|
-
this.onLoad = s, this.onLoaded = c, this._requestor = new
|
|
1049
|
+
this.onLoad = s, this.onLoaded = c, this._requestor = new O(), this.enhance();
|
|
1017
1050
|
}
|
|
1018
1051
|
get reloadable() {
|
|
1019
1052
|
switch (this.reload) {
|
|
@@ -1046,7 +1079,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1046
1079
|
let e = this;
|
|
1047
1080
|
Object.assign(this.controller, { load: e.load.bind(e) });
|
|
1048
1081
|
}
|
|
1049
|
-
},
|
|
1082
|
+
}, at = (e, t) => new it(e, t), X = class extends M {
|
|
1050
1083
|
observe(e) {
|
|
1051
1084
|
this._handler = e, this.events.forEach((t) => window.addEventListener(t, e, !0));
|
|
1052
1085
|
}
|
|
@@ -1059,21 +1092,21 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1059
1092
|
e.unobserve(), t();
|
|
1060
1093
|
};
|
|
1061
1094
|
}
|
|
1062
|
-
},
|
|
1095
|
+
}, ot = {
|
|
1063
1096
|
trigger: null,
|
|
1064
1097
|
events: ["click"],
|
|
1065
1098
|
onDismissed: "dismissed"
|
|
1066
|
-
},
|
|
1099
|
+
}, st = class extends X {
|
|
1067
1100
|
constructor(e, t = {}) {
|
|
1068
1101
|
super(e, t);
|
|
1069
|
-
let { trigger: n, events: r, onDismissed: i } = Object.assign({},
|
|
1102
|
+
let { trigger: n, events: r, onDismissed: i } = Object.assign({}, ot, t);
|
|
1070
1103
|
this.onDismissed = i, this.trigger = n || this.element, this.events = r, this.enhance(), this.observe(this.dismiss);
|
|
1071
1104
|
}
|
|
1072
1105
|
dismiss = async (e) => {
|
|
1073
1106
|
let { target: t } = e;
|
|
1074
1107
|
t instanceof HTMLElement && (this.element.contains(t) || this.visible && (this.dispatch("dismiss"), await this.awaitCallback(this.onDismissed, { target: this.trigger }), this.dispatch("dismissed")));
|
|
1075
1108
|
};
|
|
1076
|
-
}, Z = (e, t) => new
|
|
1109
|
+
}, Z = (e, t) => new st(e, t), ct = {
|
|
1077
1110
|
anchor: null,
|
|
1078
1111
|
events: ["click"],
|
|
1079
1112
|
placement: "bottom",
|
|
@@ -1081,11 +1114,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1081
1114
|
onFlipped: "flipped",
|
|
1082
1115
|
ariaRole: null,
|
|
1083
1116
|
respectMotion: !0
|
|
1084
|
-
},
|
|
1117
|
+
}, lt = class extends X {
|
|
1085
1118
|
constructor(e, t = {}) {
|
|
1086
1119
|
super(e, t);
|
|
1087
|
-
let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({},
|
|
1088
|
-
this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element &&
|
|
1120
|
+
let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, ct, t);
|
|
1121
|
+
this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && se({
|
|
1089
1122
|
trigger: this.anchor,
|
|
1090
1123
|
target: this.element,
|
|
1091
1124
|
role: this.ariaRole
|
|
@@ -1103,7 +1136,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1103
1136
|
}), this.dispatch("flipped", { detail: { placement: e } });
|
|
1104
1137
|
};
|
|
1105
1138
|
flippedRect(e, t) {
|
|
1106
|
-
let n = this.quadrumRect(e,
|
|
1139
|
+
let n = this.quadrumRect(e, A()), r = [this.placement, ge[this.placement]], i = {};
|
|
1107
1140
|
for (; !Object.keys(i).length && r.length > 0;) {
|
|
1108
1141
|
let a = r.shift();
|
|
1109
1142
|
if (!this.biggerRectThan(n[a], t)) continue;
|
|
@@ -1114,25 +1147,25 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1114
1147
|
}
|
|
1115
1148
|
quadrumRect(e, t) {
|
|
1116
1149
|
return {
|
|
1117
|
-
left:
|
|
1150
|
+
left: k({
|
|
1118
1151
|
x: t.x,
|
|
1119
1152
|
y: t.y,
|
|
1120
1153
|
width: e.x - t.x,
|
|
1121
1154
|
height: t.height
|
|
1122
1155
|
}),
|
|
1123
|
-
right:
|
|
1156
|
+
right: k({
|
|
1124
1157
|
x: e.x + e.width,
|
|
1125
1158
|
y: t.y,
|
|
1126
1159
|
width: t.width - (e.x + e.width),
|
|
1127
1160
|
height: t.height
|
|
1128
1161
|
}),
|
|
1129
|
-
top:
|
|
1162
|
+
top: k({
|
|
1130
1163
|
x: t.x,
|
|
1131
1164
|
y: t.y,
|
|
1132
1165
|
width: t.width,
|
|
1133
1166
|
height: e.y - t.y
|
|
1134
1167
|
}),
|
|
1135
|
-
bottom:
|
|
1168
|
+
bottom: k({
|
|
1136
1169
|
x: t.x,
|
|
1137
1170
|
y: e.y + e.height,
|
|
1138
1171
|
width: t.width,
|
|
@@ -1142,25 +1175,25 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1142
1175
|
}
|
|
1143
1176
|
quadrumPlacement(e, t, n) {
|
|
1144
1177
|
switch (t) {
|
|
1145
|
-
case "top": return
|
|
1178
|
+
case "top": return k({
|
|
1146
1179
|
x: n.x,
|
|
1147
1180
|
y: e.y - n.height,
|
|
1148
1181
|
width: n.width,
|
|
1149
1182
|
height: n.height
|
|
1150
1183
|
});
|
|
1151
|
-
case "bottom": return
|
|
1184
|
+
case "bottom": return k({
|
|
1152
1185
|
x: n.x,
|
|
1153
1186
|
y: e.y + e.height,
|
|
1154
1187
|
width: n.width,
|
|
1155
1188
|
height: n.height
|
|
1156
1189
|
});
|
|
1157
|
-
case "left": return
|
|
1190
|
+
case "left": return k({
|
|
1158
1191
|
x: e.x - n.width,
|
|
1159
1192
|
y: n.y,
|
|
1160
1193
|
width: n.width,
|
|
1161
1194
|
height: n.height
|
|
1162
1195
|
});
|
|
1163
|
-
case "right": return
|
|
1196
|
+
case "right": return k({
|
|
1164
1197
|
x: e.x + e.width,
|
|
1165
1198
|
y: n.y,
|
|
1166
1199
|
width: n.width,
|
|
@@ -1174,7 +1207,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1174
1207
|
case "top":
|
|
1175
1208
|
case "bottom": {
|
|
1176
1209
|
let t = e.x;
|
|
1177
|
-
return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width),
|
|
1210
|
+
return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width), k({
|
|
1178
1211
|
x: t,
|
|
1179
1212
|
y: n.y,
|
|
1180
1213
|
width: n.width,
|
|
@@ -1184,7 +1217,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1184
1217
|
case "left":
|
|
1185
1218
|
case "right": {
|
|
1186
1219
|
let t = e.y;
|
|
1187
|
-
return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height),
|
|
1220
|
+
return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height), k({
|
|
1188
1221
|
x: n.x,
|
|
1189
1222
|
y: t,
|
|
1190
1223
|
width: n.width,
|
|
@@ -1200,11 +1233,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1200
1233
|
enhance() {
|
|
1201
1234
|
super.enhance(), this.controller.flip = this.flip;
|
|
1202
1235
|
}
|
|
1203
|
-
},
|
|
1236
|
+
}, ut = (e, t) => new lt(e, t), dt = {
|
|
1204
1237
|
moveKey: "Alt",
|
|
1205
1238
|
onMoved: null,
|
|
1206
1239
|
orientation: "vertical"
|
|
1207
|
-
},
|
|
1240
|
+
}, ft = {
|
|
1208
1241
|
vertical: {
|
|
1209
1242
|
back: "ArrowUp",
|
|
1210
1243
|
forward: "ArrowDown"
|
|
@@ -1213,11 +1246,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1213
1246
|
back: "ArrowLeft",
|
|
1214
1247
|
forward: "ArrowRight"
|
|
1215
1248
|
}
|
|
1216
|
-
},
|
|
1249
|
+
}, pt = class extends M {
|
|
1217
1250
|
constructor(e, t = {}) {
|
|
1218
1251
|
super(e, t);
|
|
1219
|
-
let { moveKey: n, onMoved: r, orientation: i } = Object.assign({},
|
|
1220
|
-
this.moveKey = u[n] ? n :
|
|
1252
|
+
let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, dt, t);
|
|
1253
|
+
this.moveKey = u[n] ? n : dt.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
|
|
1221
1254
|
}
|
|
1222
1255
|
get items() {
|
|
1223
1256
|
return this.controller.itemTargets;
|
|
@@ -1235,7 +1268,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1235
1268
|
e.forEach((e) => this.detachItem(e));
|
|
1236
1269
|
}
|
|
1237
1270
|
resolveMoveKeys(e) {
|
|
1238
|
-
let { back: t, forward: n } =
|
|
1271
|
+
let { back: t, forward: n } = ft[this.orientation];
|
|
1239
1272
|
return this.orientation === "horizontal" && getComputedStyle(e).direction === "rtl" ? {
|
|
1240
1273
|
back: n,
|
|
1241
1274
|
forward: t
|
|
@@ -1274,9 +1307,9 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1274
1307
|
return this.draggingItem = null, this.dispatch("reordered", { detail: { itemIds: this.orderedIds() } }), n;
|
|
1275
1308
|
}
|
|
1276
1309
|
midpointOf(e) {
|
|
1277
|
-
return
|
|
1310
|
+
return _e(e.getBoundingClientRect(), this.orientation);
|
|
1278
1311
|
}
|
|
1279
|
-
},
|
|
1312
|
+
}, mt = (e, t) => new pt(e, t), ht = {
|
|
1280
1313
|
events: ["resize"],
|
|
1281
1314
|
boundaries: [
|
|
1282
1315
|
"top",
|
|
@@ -1285,10 +1318,10 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1285
1318
|
],
|
|
1286
1319
|
onShifted: "shifted",
|
|
1287
1320
|
respectMotion: !0
|
|
1288
|
-
},
|
|
1321
|
+
}, gt = class extends X {
|
|
1289
1322
|
constructor(e, t = {}) {
|
|
1290
1323
|
super(e, t);
|
|
1291
|
-
let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({},
|
|
1324
|
+
let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, ht, t);
|
|
1292
1325
|
this.onShifted = n, this.events = r, this.boundaries = i, this.respectMotion = a, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.enhance(), this.observe(this.shift);
|
|
1293
1326
|
}
|
|
1294
1327
|
shift = async () => {
|
|
@@ -1298,14 +1331,14 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1298
1331
|
this.element.style.transition = this.respectMotion && this.prefersReducedMotion ? "none" : "", this.element.style.transform = `translate(${t}px, ${n}px)`, await this.awaitCallback(this.onShifted, e), this.dispatch("shifted", { detail: e });
|
|
1299
1332
|
};
|
|
1300
1333
|
overflowRect(e, t) {
|
|
1301
|
-
let n = {}, r =
|
|
1334
|
+
let n = {}, r = A(), i = k({
|
|
1302
1335
|
x: e.x - t.x,
|
|
1303
1336
|
y: e.y - t.y,
|
|
1304
1337
|
width: e.width,
|
|
1305
1338
|
height: e.height
|
|
1306
1339
|
});
|
|
1307
1340
|
for (let e of this.boundaries) {
|
|
1308
|
-
let t = this.directionDistance(i, e, r), a =
|
|
1341
|
+
let t = this.directionDistance(i, e, r), a = ge[e];
|
|
1309
1342
|
t < 0 ? i[a] + t >= r[a] && !n[a] && (n[e] = t) : n[e] = "";
|
|
1310
1343
|
}
|
|
1311
1344
|
return n;
|
|
@@ -1337,23 +1370,23 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1337
1370
|
enhance() {
|
|
1338
1371
|
super.enhance(), this.controller.shift = this.shift;
|
|
1339
1372
|
}
|
|
1340
|
-
},
|
|
1373
|
+
}, _t = (e, t) => new gt(e, t), vt = {
|
|
1341
1374
|
visibility: "visibility",
|
|
1342
1375
|
onShown: "shown",
|
|
1343
1376
|
onHidden: "hidden"
|
|
1344
|
-
},
|
|
1377
|
+
}, yt = class extends M {
|
|
1345
1378
|
constructor(e, t = {}) {
|
|
1346
|
-
let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({},
|
|
1379
|
+
let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, vt, t), o = typeof n == "string" ? n : vt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
|
|
1347
1380
|
(typeof t.visible != "boolean" || t.visible) && (t.visible = `${o}.${s}`), super(e, t), this.visibility = o, this.visibilityResolver = s, this.onShown = r, this.onHidden = i, this.activator = a instanceof HTMLElement ? a : null, this.enhance(), this.element instanceof HTMLElement && this.activate(this.isVisible(this.element));
|
|
1348
1381
|
}
|
|
1349
1382
|
isVisible(e) {
|
|
1350
1383
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1351
|
-
let t =
|
|
1384
|
+
let t = j.hiddenClass;
|
|
1352
1385
|
return t ? !e.classList.contains(t) : !e.hasAttribute("hidden");
|
|
1353
1386
|
}
|
|
1354
1387
|
toggle(e, t) {
|
|
1355
1388
|
if (!(e instanceof HTMLElement)) return;
|
|
1356
|
-
let n =
|
|
1389
|
+
let n = j.hiddenClass;
|
|
1357
1390
|
n ? t ? e.classList.remove(n) : e.classList.add(n) : b(e, !t);
|
|
1358
1391
|
}
|
|
1359
1392
|
activate(e) {
|
|
@@ -1376,7 +1409,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1376
1409
|
return t;
|
|
1377
1410
|
} });
|
|
1378
1411
|
}
|
|
1379
|
-
}, Q = (e, t) => new
|
|
1412
|
+
}, Q = (e, t) => new yt(e, t), bt = 4, xt = class extends e {
|
|
1380
1413
|
static targets = ["grid"];
|
|
1381
1414
|
static values = {
|
|
1382
1415
|
current: Number,
|
|
@@ -1398,7 +1431,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1398
1431
|
}
|
|
1399
1432
|
};
|
|
1400
1433
|
initialize() {
|
|
1401
|
-
this.selector =
|
|
1434
|
+
this.selector = rt(this), J(this, {
|
|
1402
1435
|
today: this.todayValue,
|
|
1403
1436
|
year: this.currentValue || void 0,
|
|
1404
1437
|
since: this.sinceValue || null,
|
|
@@ -1442,17 +1475,17 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1442
1475
|
}
|
|
1443
1476
|
let a = document.createElement("div");
|
|
1444
1477
|
a.setAttribute("role", "rowgroup");
|
|
1445
|
-
for (let e = 0; e < i.length; e +=
|
|
1478
|
+
for (let e = 0; e < i.length; e += bt) {
|
|
1446
1479
|
let t = document.createElement("div");
|
|
1447
1480
|
t.setAttribute("role", "row");
|
|
1448
|
-
for (let n of i.slice(e, e +
|
|
1481
|
+
for (let n of i.slice(e, e + bt)) t.appendChild(n);
|
|
1449
1482
|
a.appendChild(t);
|
|
1450
1483
|
}
|
|
1451
1484
|
this.gridTarget.replaceChildren(a);
|
|
1452
1485
|
}
|
|
1453
|
-
},
|
|
1486
|
+
}, St = class extends e {
|
|
1454
1487
|
initialize() {
|
|
1455
|
-
this.selector =
|
|
1488
|
+
this.selector = rt(this);
|
|
1456
1489
|
}
|
|
1457
1490
|
connect() {
|
|
1458
1491
|
this.selector.attach();
|
|
@@ -1460,7 +1493,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1460
1493
|
disconnect() {
|
|
1461
1494
|
this.selector.detach();
|
|
1462
1495
|
}
|
|
1463
|
-
},
|
|
1496
|
+
}, Ct = class extends e {
|
|
1464
1497
|
static targets = ["daysOfWeek", "daysOfMonth"];
|
|
1465
1498
|
static classes = [
|
|
1466
1499
|
"dayOfWeek",
|
|
@@ -1505,7 +1538,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1505
1538
|
}
|
|
1506
1539
|
};
|
|
1507
1540
|
initialize() {
|
|
1508
|
-
this.selector =
|
|
1541
|
+
this.selector = tt(this, { onSelect: "select" }), J(this, {
|
|
1509
1542
|
today: this.todayValue,
|
|
1510
1543
|
since: this.sinceValue || null,
|
|
1511
1544
|
till: this.tillValue || null
|
|
@@ -1594,9 +1627,9 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1594
1627
|
}
|
|
1595
1628
|
this.daysOfMonthTarget.replaceChildren(...r);
|
|
1596
1629
|
}
|
|
1597
|
-
},
|
|
1630
|
+
}, wt = class extends e {
|
|
1598
1631
|
initialize() {
|
|
1599
|
-
this.selector =
|
|
1632
|
+
this.selector = tt(this);
|
|
1600
1633
|
}
|
|
1601
1634
|
connect() {
|
|
1602
1635
|
this.selector.attach();
|
|
@@ -1604,7 +1637,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1604
1637
|
disconnect() {
|
|
1605
1638
|
this.selector.detach();
|
|
1606
1639
|
}
|
|
1607
|
-
},
|
|
1640
|
+
}, Tt = 4, Et = class extends e {
|
|
1608
1641
|
static targets = ["grid"];
|
|
1609
1642
|
static values = {
|
|
1610
1643
|
current: Number,
|
|
@@ -1634,7 +1667,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1634
1667
|
}
|
|
1635
1668
|
};
|
|
1636
1669
|
initialize() {
|
|
1637
|
-
this.selector =
|
|
1670
|
+
this.selector = nt(this), J(this, {
|
|
1638
1671
|
today: this.todayValue,
|
|
1639
1672
|
year: this.currentValue || void 0,
|
|
1640
1673
|
since: this.sinceValue || null,
|
|
@@ -1679,17 +1712,17 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1679
1712
|
}
|
|
1680
1713
|
let o = document.createElement("div");
|
|
1681
1714
|
o.setAttribute("role", "rowgroup");
|
|
1682
|
-
for (let e = 0; e < i.length; e +=
|
|
1715
|
+
for (let e = 0; e < i.length; e += Tt) {
|
|
1683
1716
|
let t = document.createElement("div");
|
|
1684
1717
|
t.setAttribute("role", "row");
|
|
1685
|
-
for (let n of i.slice(e, e +
|
|
1718
|
+
for (let n of i.slice(e, e + Tt)) t.appendChild(n);
|
|
1686
1719
|
o.appendChild(t);
|
|
1687
1720
|
}
|
|
1688
1721
|
this.gridTarget.replaceChildren(o);
|
|
1689
1722
|
}
|
|
1690
|
-
},
|
|
1723
|
+
}, Dt = class extends e {
|
|
1691
1724
|
initialize() {
|
|
1692
|
-
this.selector =
|
|
1725
|
+
this.selector = nt(this);
|
|
1693
1726
|
}
|
|
1694
1727
|
connect() {
|
|
1695
1728
|
this.selector.attach();
|
|
@@ -1697,7 +1730,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1697
1730
|
disconnect() {
|
|
1698
1731
|
this.selector.detach();
|
|
1699
1732
|
}
|
|
1700
|
-
},
|
|
1733
|
+
}, Ot = class extends e {
|
|
1701
1734
|
static targets = ["master", "item"];
|
|
1702
1735
|
connect() {
|
|
1703
1736
|
this.recompute();
|
|
@@ -1717,7 +1750,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1717
1750
|
enabledItems() {
|
|
1718
1751
|
return this.itemTargets.filter((e) => !e.disabled);
|
|
1719
1752
|
}
|
|
1720
|
-
},
|
|
1753
|
+
}, kt = class extends e {
|
|
1721
1754
|
static targets = ["source"];
|
|
1722
1755
|
static values = { contentType: {
|
|
1723
1756
|
type: String,
|
|
@@ -1751,7 +1784,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1751
1784
|
"month",
|
|
1752
1785
|
"year",
|
|
1753
1786
|
"decade"
|
|
1754
|
-
],
|
|
1787
|
+
], At = class extends e {
|
|
1755
1788
|
static targets = [
|
|
1756
1789
|
"previous",
|
|
1757
1790
|
"next",
|
|
@@ -1888,7 +1921,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1888
1921
|
}
|
|
1889
1922
|
this.hasCalendarYearOutlet && b(this.calendarYearOutletElement, !t), this.hasCalendarDecadeOutlet && b(this.calendarDecadeOutletElement, !n);
|
|
1890
1923
|
}
|
|
1891
|
-
},
|
|
1924
|
+
}, jt = class extends e {
|
|
1892
1925
|
static targets = [
|
|
1893
1926
|
"listbox",
|
|
1894
1927
|
"loading",
|
|
@@ -1909,7 +1942,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1909
1942
|
}
|
|
1910
1943
|
};
|
|
1911
1944
|
initialize() {
|
|
1912
|
-
this._requestor = new
|
|
1945
|
+
this._requestor = new O();
|
|
1913
1946
|
}
|
|
1914
1947
|
connect() {
|
|
1915
1948
|
this.hasListboxTarget && (this.listboxNav = new f(this.listboxTarget));
|
|
@@ -1942,7 +1975,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1942
1975
|
e.name !== "AbortError" && console.error("[combobox-dropdown] fetch failed", e);
|
|
1943
1976
|
}).finally(() => this.setLoading(!1)), this.delayValue);
|
|
1944
1977
|
} else {
|
|
1945
|
-
let t =
|
|
1978
|
+
let t = he(this.listboxTarget, e);
|
|
1946
1979
|
this.setEmpty(t === 0);
|
|
1947
1980
|
}
|
|
1948
1981
|
}
|
|
@@ -1955,7 +1988,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1955
1988
|
setEmpty(e) {
|
|
1956
1989
|
this.hasEmptyTarget && b(this.emptyTarget, !e);
|
|
1957
1990
|
}
|
|
1958
|
-
},
|
|
1991
|
+
}, Mt = class extends e {
|
|
1959
1992
|
static targets = [
|
|
1960
1993
|
"hour",
|
|
1961
1994
|
"minute",
|
|
@@ -1991,12 +2024,12 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1991
2024
|
selectedValue(e) {
|
|
1992
2025
|
return e?.querySelector("[aria-selected=\"true\"]")?.dataset.value ?? null;
|
|
1993
2026
|
}
|
|
1994
|
-
},
|
|
2027
|
+
}, Nt = class extends e {
|
|
1995
2028
|
static targets = ["trigger"];
|
|
1996
2029
|
connect() {
|
|
1997
2030
|
Z(this, { trigger: this.hasTriggerTarget ? this.triggerTarget : null });
|
|
1998
2031
|
}
|
|
1999
|
-
},
|
|
2032
|
+
}, Pt = class extends e {
|
|
2000
2033
|
static targets = ["anchor", "reference"];
|
|
2001
2034
|
static values = {
|
|
2002
2035
|
placement: {
|
|
@@ -2021,7 +2054,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2021
2054
|
console.error("FlipperController requires an anchor target. Add data-flipper-target=\"anchor\" to your element.");
|
|
2022
2055
|
return;
|
|
2023
2056
|
}
|
|
2024
|
-
|
|
2057
|
+
ut(this, {
|
|
2025
2058
|
element: this.referenceTarget,
|
|
2026
2059
|
anchor: this.anchorTarget,
|
|
2027
2060
|
placement: this.placementValue,
|
|
@@ -2029,7 +2062,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2029
2062
|
ariaRole: this.roleValue
|
|
2030
2063
|
});
|
|
2031
2064
|
}
|
|
2032
|
-
},
|
|
2065
|
+
}, Ft = class extends e {
|
|
2033
2066
|
static targets = ["trigger", "input"];
|
|
2034
2067
|
static values = {
|
|
2035
2068
|
value: String,
|
|
@@ -2054,7 +2087,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2054
2087
|
valueValueChanged(e) {
|
|
2055
2088
|
this.hasInputTarget && (this.inputTarget.value = e), this.dispatch("changed", { detail: { value: e } });
|
|
2056
2089
|
}
|
|
2057
|
-
},
|
|
2090
|
+
}, It = class extends e {
|
|
2058
2091
|
static targets = ["input", "cell"];
|
|
2059
2092
|
static values = {
|
|
2060
2093
|
format: {
|
|
@@ -2071,19 +2104,19 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2071
2104
|
}
|
|
2072
2105
|
};
|
|
2073
2106
|
connect() {
|
|
2074
|
-
|
|
2107
|
+
B(this, {
|
|
2075
2108
|
type: this.formatValue,
|
|
2076
2109
|
options: this.optionsValue
|
|
2077
2110
|
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue());
|
|
2078
2111
|
}
|
|
2079
2112
|
formatValueChanged() {
|
|
2080
|
-
this.formatter && (
|
|
2113
|
+
this.formatter && (B(this, {
|
|
2081
2114
|
type: this.formatValue,
|
|
2082
2115
|
options: this.optionsValue
|
|
2083
2116
|
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
|
|
2084
2117
|
}
|
|
2085
2118
|
optionsValueChanged() {
|
|
2086
|
-
this.formatter && (
|
|
2119
|
+
this.formatter && (B(this, {
|
|
2087
2120
|
type: this.formatValue,
|
|
2088
2121
|
options: this.optionsValue
|
|
2089
2122
|
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
|
|
@@ -2114,7 +2147,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2114
2147
|
return;
|
|
2115
2148
|
}
|
|
2116
2149
|
let t = this.groupsValue.length > 0;
|
|
2117
|
-
|
|
2150
|
+
Ve(this, {
|
|
2118
2151
|
groups: t ? this.groupsValue : e.groups ?? [],
|
|
2119
2152
|
length: t ? 0 : e.length ?? 0
|
|
2120
2153
|
});
|
|
@@ -2155,7 +2188,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2155
2188
|
primeFilledState() {
|
|
2156
2189
|
this.wasFull = this.isFull(this.formatter.normalize(this.readValue()));
|
|
2157
2190
|
}
|
|
2158
|
-
},
|
|
2191
|
+
}, Lt = class extends e {
|
|
2159
2192
|
static targets = ["input", "clear"];
|
|
2160
2193
|
initialize() {
|
|
2161
2194
|
this.onInput = this.draw.bind(this), this.onEscape = this.handleEscape.bind(this);
|
|
@@ -2178,7 +2211,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2178
2211
|
handleEscape(e) {
|
|
2179
2212
|
e.key === "Escape" && this.inputTarget.value !== "" && (e.preventDefault(), this.clear());
|
|
2180
2213
|
}
|
|
2181
|
-
},
|
|
2214
|
+
}, Rt = class extends e {
|
|
2182
2215
|
static targets = [
|
|
2183
2216
|
"input",
|
|
2184
2217
|
"toggle",
|
|
@@ -2211,7 +2244,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2211
2244
|
let e = this.revealedValue ? this.concealLabelValue : this.revealLabelValue;
|
|
2212
2245
|
e && this.toggleTarget.setAttribute("aria-label", e);
|
|
2213
2246
|
}
|
|
2214
|
-
},
|
|
2247
|
+
}, zt = class extends e {
|
|
2215
2248
|
static targets = ["modal", "overlay"];
|
|
2216
2249
|
initialize() {
|
|
2217
2250
|
this.onCancel = this.close.bind(this);
|
|
@@ -2243,12 +2276,73 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2243
2276
|
let t = this.modalTarget.getBoundingClientRect();
|
|
2244
2277
|
(e.clientY < t.top || e.clientY > t.bottom || e.clientX < t.left || e.clientX > t.right) && this.close();
|
|
2245
2278
|
};
|
|
2246
|
-
},
|
|
2279
|
+
}, Bt = class extends e {
|
|
2247
2280
|
static targets = ["content"];
|
|
2248
2281
|
connect() {
|
|
2249
|
-
|
|
2282
|
+
_t(this, { element: this.hasContentTarget ? this.contentTarget : null });
|
|
2250
2283
|
}
|
|
2251
|
-
},
|
|
2284
|
+
}, Vt = class extends e {
|
|
2285
|
+
static targets = [
|
|
2286
|
+
"input",
|
|
2287
|
+
"rule",
|
|
2288
|
+
"level",
|
|
2289
|
+
"checkIcon",
|
|
2290
|
+
"closeIcon"
|
|
2291
|
+
];
|
|
2292
|
+
static outlets = ["progress"];
|
|
2293
|
+
static values = {
|
|
2294
|
+
scorer: {
|
|
2295
|
+
type: String,
|
|
2296
|
+
default: "rules"
|
|
2297
|
+
},
|
|
2298
|
+
rules: {
|
|
2299
|
+
type: Array,
|
|
2300
|
+
default: []
|
|
2301
|
+
},
|
|
2302
|
+
options: {
|
|
2303
|
+
type: Object,
|
|
2304
|
+
default: {}
|
|
2305
|
+
},
|
|
2306
|
+
labels: {
|
|
2307
|
+
type: Object,
|
|
2308
|
+
default: {}
|
|
2309
|
+
},
|
|
2310
|
+
announceDelay: {
|
|
2311
|
+
type: Number,
|
|
2312
|
+
default: 700
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
connect() {
|
|
2316
|
+
this._requestor = new O(), this._level = null, Ke(this, { type: this.scorerValue }), this.score();
|
|
2317
|
+
}
|
|
2318
|
+
disconnect() {
|
|
2319
|
+
this._requestor?.cancel();
|
|
2320
|
+
}
|
|
2321
|
+
score() {
|
|
2322
|
+
let { value: e, level: t, rules: n } = this.strength.score(this.readValue(), this.rulesValue, this.optionsValue);
|
|
2323
|
+
this.hasProgressOutlet && this.progressOutlet.setValue(e), this.drawRules(n), this.announce(t);
|
|
2324
|
+
}
|
|
2325
|
+
readValue() {
|
|
2326
|
+
return this.hasInputTarget ? this.inputTarget.value : "";
|
|
2327
|
+
}
|
|
2328
|
+
drawRules(e) {
|
|
2329
|
+
this.ruleTargets.forEach((t) => {
|
|
2330
|
+
let n = !!e[t.dataset.rule];
|
|
2331
|
+
t.dataset.satisfied = String(n), this.drawIcons(t, n);
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
drawIcons(e, t) {
|
|
2335
|
+
let n = e.querySelector("[data-password-strength-target=\"checkIcon\"]"), r = e.querySelector("[data-password-strength-target=\"closeIcon\"]");
|
|
2336
|
+
!n || !r || (b(n, !t), b(r, t));
|
|
2337
|
+
}
|
|
2338
|
+
announce(e) {
|
|
2339
|
+
if (e === this._level || (this._level = e, !this.hasLevelTarget)) return;
|
|
2340
|
+
let t = this.labelsValue[e] ?? e;
|
|
2341
|
+
this._requestor.schedule(() => {
|
|
2342
|
+
this.levelTarget.textContent = t;
|
|
2343
|
+
}, this.announceDelayValue);
|
|
2344
|
+
}
|
|
2345
|
+
}, Ht = class extends e {
|
|
2252
2346
|
static targets = [
|
|
2253
2347
|
"trigger",
|
|
2254
2348
|
"panel",
|
|
@@ -2280,7 +2374,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2280
2374
|
}
|
|
2281
2375
|
};
|
|
2282
2376
|
connect() {
|
|
2283
|
-
|
|
2377
|
+
at(this, {
|
|
2284
2378
|
element: this.hasPanelTarget ? this.panelTarget : null,
|
|
2285
2379
|
url: this.hasUrlValue ? this.urlValue : null
|
|
2286
2380
|
}), this.hasPanelTarget && (Q(this, {
|
|
@@ -2331,7 +2425,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2331
2425
|
contentLoader() {
|
|
2332
2426
|
if (this.hasTemplateTarget) return this.templateTarget instanceof HTMLTemplateElement ? this.templateTarget.content : this.templateTarget.innerHTML;
|
|
2333
2427
|
}
|
|
2334
|
-
},
|
|
2428
|
+
}, Ut = class extends e {
|
|
2335
2429
|
static targets = ["fill", "meter"];
|
|
2336
2430
|
static values = {
|
|
2337
2431
|
variant: {
|
|
@@ -2360,6 +2454,10 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2360
2454
|
indeterminateFraction: {
|
|
2361
2455
|
type: Number,
|
|
2362
2456
|
default: .25
|
|
2457
|
+
},
|
|
2458
|
+
segmentMode: {
|
|
2459
|
+
type: String,
|
|
2460
|
+
default: "discrete"
|
|
2363
2461
|
}
|
|
2364
2462
|
};
|
|
2365
2463
|
connect() {
|
|
@@ -2382,7 +2480,8 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2382
2480
|
switch (this.variantValue) {
|
|
2383
2481
|
case "meter": return this.renderMeter();
|
|
2384
2482
|
case "ring":
|
|
2385
|
-
case "bar":
|
|
2483
|
+
case "bar":
|
|
2484
|
+
case "segmented": return T(this.element, this.minValue), E(this.element, this.maxValue), ie(this.element, this.indeterminateValue ? null : this.currentValue), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.variantValue === "ring" ? this.renderRing() : this.variantValue === "segmented" ? this.renderSegmented() : this.renderBar();
|
|
2386
2485
|
default: return;
|
|
2387
2486
|
}
|
|
2388
2487
|
}
|
|
@@ -2399,6 +2498,21 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2399
2498
|
this.fillTarget.style.width = `${this.percent()}%`;
|
|
2400
2499
|
}
|
|
2401
2500
|
}
|
|
2501
|
+
renderSegmented() {
|
|
2502
|
+
let e = this.fillTargets, t = e.length;
|
|
2503
|
+
if (t === 0) return;
|
|
2504
|
+
if (this.indeterminateValue) {
|
|
2505
|
+
e.forEach((e, n) => {
|
|
2506
|
+
e.style.setProperty("--sp-progress-index", n), e.style.setProperty("--sp-progress-count", t), e.style.width = `${this.indeterminateFractionValue * 100}%`;
|
|
2507
|
+
});
|
|
2508
|
+
return;
|
|
2509
|
+
}
|
|
2510
|
+
let n = this.percent() / 100 * t;
|
|
2511
|
+
e.forEach((e, t) => {
|
|
2512
|
+
let r = Math.min(1, Math.max(0, n - t));
|
|
2513
|
+
this.segmentModeValue === "discrete" && (r = +(r > 0)), e.style.width = `${r * 100}%`;
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2402
2516
|
renderRing() {
|
|
2403
2517
|
if (this.hasFillTarget) {
|
|
2404
2518
|
if (this.circumference ?? this.setCircumference(this.fillTarget), this.indeterminateValue) {
|
|
@@ -2418,7 +2532,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2418
2532
|
let e = this.meterTarget;
|
|
2419
2533
|
e.value = this.currentValue, e.min = this.minValue, e.max = this.maxValue, this.hasLowValue && (e.low = this.lowValue), this.hasHighValue && (e.high = this.highValue), this.hasOptimumValue && (e.optimum = this.optimumValue);
|
|
2420
2534
|
}
|
|
2421
|
-
},
|
|
2535
|
+
}, Wt = class extends e {
|
|
2422
2536
|
static targets = [
|
|
2423
2537
|
"item",
|
|
2424
2538
|
"handle",
|
|
@@ -2439,7 +2553,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2439
2553
|
}
|
|
2440
2554
|
};
|
|
2441
2555
|
connect() {
|
|
2442
|
-
this.reorderable =
|
|
2556
|
+
this.reorderable = mt(this, {
|
|
2443
2557
|
moveKey: this.moveKeyValue,
|
|
2444
2558
|
orientation: this.orientationValue,
|
|
2445
2559
|
onMoved: "moved"
|
|
@@ -2480,7 +2594,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2480
2594
|
moved(e) {
|
|
2481
2595
|
this.rovingTabIndex?.updateItems(this.itemTargets), this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e));
|
|
2482
2596
|
}
|
|
2483
|
-
},
|
|
2597
|
+
}, Gt = class extends e {
|
|
2484
2598
|
static targets = [
|
|
2485
2599
|
"trigger",
|
|
2486
2600
|
"detail",
|
|
@@ -2534,16 +2648,16 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2534
2648
|
}
|
|
2535
2649
|
timeTargetConnected(e) {
|
|
2536
2650
|
if (!Object.keys(this.dateFormatValue).length || e.textContent.trim()) return;
|
|
2537
|
-
let t =
|
|
2651
|
+
let t = I.format(e.getAttribute("datetime"), this.dateFormatValue);
|
|
2538
2652
|
t && (e.textContent = t);
|
|
2539
2653
|
}
|
|
2540
|
-
},
|
|
2654
|
+
}, Kt = class extends e {
|
|
2541
2655
|
static targets = ["content"];
|
|
2542
2656
|
connect() {
|
|
2543
2657
|
Z(this);
|
|
2544
2658
|
}
|
|
2545
2659
|
contentTargetConnected(e) {
|
|
2546
|
-
|
|
2660
|
+
_t(this, { element: e }), Q(this, { element: e });
|
|
2547
2661
|
}
|
|
2548
2662
|
async dismissed() {
|
|
2549
2663
|
this.hasContentTarget && await this.visibility.hide();
|
|
@@ -2553,6 +2667,6 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2553
2667
|
}
|
|
2554
2668
|
};
|
|
2555
2669
|
//#endregion
|
|
2556
|
-
export {
|
|
2670
|
+
export { ae as ARIA_HASPOPUP_VALUES, xt as CalendarDecadeController, St as CalendarDecadeSelectorController, Ct as CalendarMonthController, wt as CalendarMonthSelectorController, Et as CalendarYearController, Dt as CalendarYearSelectorController, Be as CharacterCells, Ot as ChecklistController, kt as ClipboardController, At as ComboboxDateController, jt as ComboboxDropdownController, Mt as ComboboxTimeController, Nt as DismisserController, t as FOCUSABLE_SELECTOR, R as FORMATTER_TYPES, Pt as FlipperController, a as FocusTrap, Le as Formatter, Lt as InputClearableController, Ft as InputComboboxController, It as InputFormatterController, Rt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, zt as ModalController, Bt as PannerController, W as PasswordStrength, Vt as PasswordStrengthController, Ht as PopoverController, Ut as ProgressController, Wt as ReorderableController, O as Requestor, d as RovingTabIndex, V as STRENGTH_TYPES, Gt as TimelineController, Kt as VisibilityController, m as announce, Ve as attachCharacterCells, Ke as attachPasswordStrength, se as connectTriggerToTarget, le as disconnectTriggerFromTarget, ee as ensureId, he as filterOptions, i as focusFirst, ue as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, C as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, w as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, E as setValueMax, T as setValueMin, ie as setValueNow };
|
|
2557
2671
|
|
|
2558
2672
|
//# sourceMappingURL=index.es.js.map
|