stimulus_plumbers 0.4.8 → 0.4.9
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 +16 -0
- data/README.md +7 -9
- data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +331 -20
- data/app/assets/javascripts/stimulus-plumbers/index.es.js +493 -226
- 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/app/assets/stylesheets/stimulus_plumbers/tokens.css +58 -53
- data/docs/architecture.md +0 -2
- data/docs/component/avatar.md +1 -0
- data/docs/component/button.md +1 -0
- data/docs/component/calendar.md +7 -16
- data/docs/component/checklist.md +153 -0
- data/docs/component/icon.md +7 -5
- data/docs/component/indicator.md +55 -0
- data/docs/component/list.md +2 -3
- data/docs/component/ordered_list.md +118 -0
- data/docs/component/plumber.md +21 -0
- data/docs/component/popover.md +1 -2
- data/docs/component/progress.md +65 -0
- data/docs/component/timeline.md +47 -12
- data/docs/guide.md +12 -0
- data/lib/generators/stimulus_plumbers/install/install_generator.rb +16 -12
- data/lib/stimulus_plumbers/components/button.rb +1 -0
- data/lib/stimulus_plumbers/components/checklist/item/slots.rb +13 -0
- data/lib/stimulus_plumbers/components/checklist/item.rb +64 -0
- data/lib/stimulus_plumbers/components/checklist.rb +50 -0
- data/lib/stimulus_plumbers/components/combobox/typeahead.rb +1 -0
- data/lib/stimulus_plumbers/components/icon.rb +2 -2
- data/lib/stimulus_plumbers/components/indicator.rb +30 -0
- data/lib/stimulus_plumbers/components/link.rb +1 -0
- data/lib/stimulus_plumbers/components/ordered_list/item/slots.rb +13 -0
- data/lib/stimulus_plumbers/components/ordered_list/item.rb +129 -0
- data/lib/stimulus_plumbers/components/ordered_list.rb +24 -0
- data/lib/stimulus_plumbers/components/progress_bar.rb +48 -0
- data/lib/stimulus_plumbers/components/progress_meter.rb +37 -0
- data/lib/stimulus_plumbers/components/progress_ring.rb +40 -0
- data/lib/stimulus_plumbers/components/timeline/event.rb +2 -1
- data/lib/stimulus_plumbers/components/timeline/group.rb +5 -3
- data/lib/stimulus_plumbers/form/fields/inputs/password.rb +1 -0
- data/lib/stimulus_plumbers/form/fields/inputs/search.rb +1 -0
- data/lib/stimulus_plumbers/generators/css_entrypoint.rb +15 -9
- data/lib/stimulus_plumbers/generators/tokens_directive.rb +6 -2
- data/lib/stimulus_plumbers/helpers/avatar_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/button_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/calendar_helper.rb +2 -9
- data/lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb +3 -6
- data/lib/stimulus_plumbers/helpers/checklist_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/indicator_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/ordered_list_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/popover_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/progress_helper.rb +21 -0
- data/lib/stimulus_plumbers/helpers.rb +8 -0
- data/lib/stimulus_plumbers/themes/base.rb +4 -0
- data/lib/stimulus_plumbers/themes/schema/icon.rb +21 -4
- data/lib/stimulus_plumbers/themes/schema/indicator/ranges.rb +14 -0
- data/lib/stimulus_plumbers/themes/schema.rb +39 -3
- data/lib/stimulus_plumbers/version.rb +1 -1
- data/lib/stimulus_plumbers.rb +10 -0
- data/vendor/ARIA.md +22 -2
- data/vendor/component/manifest.json +212 -0
- data/vendor/controller/docs/calendar.md +4 -7
- data/vendor/controller/docs/checklist.md +45 -0
- data/vendor/controller/docs/combobox.md +1 -31
- data/vendor/controller/docs/input-clearable.md +1 -4
- data/vendor/controller/docs/input-formatter.md +1 -2
- data/vendor/controller/docs/modal.md +1 -4
- data/vendor/controller/docs/popover.md +1 -3
- data/vendor/controller/docs/progress.md +82 -0
- data/vendor/controller/docs/reorderable.md +82 -0
- data/vendor/controller/docs/visibility.md +31 -0
- data/vendor/controller/manifest.json +331 -20
- metadata +25 -1
|
@@ -66,9 +66,14 @@ function c(e) {
|
|
|
66
66
|
function l(e) {
|
|
67
67
|
e.preventDefault(), e.stopPropagation();
|
|
68
68
|
}
|
|
69
|
-
var u =
|
|
69
|
+
var u = {
|
|
70
|
+
Alt: "altKey",
|
|
71
|
+
Control: "ctrlKey",
|
|
72
|
+
Shift: "shiftKey",
|
|
73
|
+
Meta: "metaKey"
|
|
74
|
+
}, d = class {
|
|
70
75
|
constructor(e, t = {}) {
|
|
71
|
-
this.items = Array.from(e), this.currentIndex = t.initialIndex ?? 0, this.orientation = t.orientation ?? "both", this.wrap = t.wrap ?? !0, this._handleKeyDown = this._handleKeyDown.bind(this), this._handleClick = this._handleClick.bind(this);
|
|
76
|
+
this.items = Array.from(e), this.currentIndex = t.initialIndex ?? 0, this.orientation = t.orientation ?? "both", this.wrap = t.wrap ?? !0, this.ignoreModifierKeys = t.ignoreModifierKeys ?? Object.keys(u), this._handleKeyDown = this._handleKeyDown.bind(this), this._handleClick = this._handleClick.bind(this);
|
|
72
77
|
}
|
|
73
78
|
activate() {
|
|
74
79
|
return this.updateTabIndex(), this.items.forEach((e) => {
|
|
@@ -96,6 +101,7 @@ var u = class {
|
|
|
96
101
|
t !== -1 && (this.currentIndex = t, this.updateTabIndex());
|
|
97
102
|
}
|
|
98
103
|
_handleKeyDown(e) {
|
|
104
|
+
if (this.ignoreModifierKeys.some((t) => e[u[t]])) return;
|
|
99
105
|
let t = this.items.indexOf(e.currentTarget);
|
|
100
106
|
t !== -1 && t !== this.currentIndex && (this.currentIndex = t, this.updateTabIndex());
|
|
101
107
|
let n = this.orientation === "horizontal" ? [] : ["ArrowUp", "ArrowDown"], r = this.orientation === "vertical" ? [] : ["ArrowLeft", "ArrowRight"];
|
|
@@ -125,7 +131,7 @@ var u = class {
|
|
|
125
131
|
}
|
|
126
132
|
this.setCurrentIndex(a);
|
|
127
133
|
}
|
|
128
|
-
},
|
|
134
|
+
}, f = class {
|
|
129
135
|
constructor(e, t = {}) {
|
|
130
136
|
this.listbox = e, this.itemSelector = t.itemSelector ?? "[role=\"option\"]:not([aria-disabled=\"true\"]):not([hidden])", this.wrap = t.wrap ?? !1, this.orientation = t.orientation ?? "vertical";
|
|
131
137
|
}
|
|
@@ -177,61 +183,61 @@ var u = class {
|
|
|
177
183
|
break;
|
|
178
184
|
}
|
|
179
185
|
}
|
|
180
|
-
},
|
|
186
|
+
}, p = (e, t, n) => {
|
|
181
187
|
let r = document.querySelector(`[data-live-region="${e}"]`);
|
|
182
188
|
return r || (r = document.createElement("div"), r.className = "sr-only", r.dataset.liveRegion = e, r.setAttribute("aria-live", e), r.setAttribute("aria-atomic", t.toString()), r.setAttribute("aria-relevant", n), document.body.appendChild(r)), r;
|
|
183
189
|
};
|
|
184
|
-
function
|
|
185
|
-
let { politeness: n = "polite", atomic: r = !0, relevant: i = "additions text" } = t, a =
|
|
190
|
+
function m(e, t = {}) {
|
|
191
|
+
let { politeness: n = "polite", atomic: r = !0, relevant: i = "additions text" } = t, a = p(n, r, i);
|
|
186
192
|
a.textContent = "", setTimeout(() => {
|
|
187
193
|
a.textContent = e;
|
|
188
194
|
}, 100);
|
|
189
195
|
}
|
|
190
|
-
var
|
|
196
|
+
var h = (e = "a11y") => `${e}-${Math.random().toString(36).substr(2, 9)}`, ee = (e, t = "element") => e.id ||= h(t), g = (e, t, n) => {
|
|
191
197
|
e.setAttribute(t, n.toString());
|
|
192
|
-
},
|
|
193
|
-
function
|
|
194
|
-
|
|
198
|
+
}, _ = (e, t) => g(e, "aria-expanded", t), v = (e) => e.getAttribute("aria-expanded") === "true", te = (e, t) => g(e, "aria-pressed", t), ne = (e, t) => g(e, "aria-checked", t), y = (e, t) => g(e, "aria-selected", t), b = (e, t) => t ? e.setAttribute("aria-current", t) : e.removeAttribute("aria-current"), x = (e, t) => t ? e.setAttribute("hidden", "") : e.removeAttribute("hidden"), S = (e, t) => g(e, "aria-hidden", t), C = (e, t) => g(e, "aria-disabled", t), re = (e) => e.getAttribute("aria-disabled") === "true";
|
|
199
|
+
function ie(e, t) {
|
|
200
|
+
g(e, "aria-disabled", t), t ? e.setAttribute("tabindex", "-1") : e.removeAttribute("tabindex");
|
|
195
201
|
}
|
|
196
|
-
var
|
|
202
|
+
var ae = (e, t) => g(e, "aria-valuemin", t), w = (e, t) => g(e, "aria-valuemax", t), T = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), E = {
|
|
197
203
|
menu: "menu",
|
|
198
204
|
listbox: "listbox",
|
|
199
205
|
tree: "tree",
|
|
200
206
|
grid: "grid",
|
|
201
207
|
dialog: "dialog"
|
|
202
|
-
},
|
|
208
|
+
}, oe = (e, t, n) => {
|
|
203
209
|
Object.entries(t).forEach(([t, r]) => {
|
|
204
210
|
e.setAttribute(t, r), n[t] = r;
|
|
205
211
|
});
|
|
206
|
-
},
|
|
207
|
-
function
|
|
212
|
+
}, D = (e, t, n) => n || !e.hasAttribute(t);
|
|
213
|
+
function se({ trigger: e, target: t, role: n = null, override: r = !1 }) {
|
|
208
214
|
let i = {
|
|
209
215
|
trigger: {},
|
|
210
216
|
target: {}
|
|
211
217
|
};
|
|
212
218
|
if (!e || !t) return i;
|
|
213
219
|
let a = {}, o = {};
|
|
214
|
-
if (n &&
|
|
215
|
-
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 = E[n] || "true";
|
|
216
222
|
e && (a["aria-haspopup"] = e);
|
|
217
223
|
}
|
|
218
|
-
return
|
|
224
|
+
return oe(t, o, i.target), oe(e, a, i.trigger), i;
|
|
219
225
|
}
|
|
220
|
-
var
|
|
226
|
+
var O = (e, t) => {
|
|
221
227
|
t.forEach((t) => {
|
|
222
228
|
e.hasAttribute(t) && e.removeAttribute(t);
|
|
223
229
|
});
|
|
224
230
|
};
|
|
225
|
-
function
|
|
226
|
-
!e || !t || (
|
|
231
|
+
function ce({ trigger: e, target: t, attributes: n = null }) {
|
|
232
|
+
!e || !t || (O(e, n || [
|
|
227
233
|
"aria-controls",
|
|
228
234
|
"aria-haspopup",
|
|
229
235
|
"aria-describedby"
|
|
230
|
-
]), (!n || n.includes("role")) &&
|
|
236
|
+
]), (!n || n.includes("role")) && O(t, ["role"]));
|
|
231
237
|
}
|
|
232
238
|
//#endregion
|
|
233
239
|
//#region src/requestor.js
|
|
234
|
-
var
|
|
240
|
+
var k = class {
|
|
235
241
|
constructor() {
|
|
236
242
|
this._abortController = null, this._timer = null;
|
|
237
243
|
}
|
|
@@ -253,33 +259,33 @@ var w = class {
|
|
|
253
259
|
};
|
|
254
260
|
//#endregion
|
|
255
261
|
//#region src/researcher.js
|
|
256
|
-
function
|
|
262
|
+
function A(e, t) {
|
|
257
263
|
let n = 0;
|
|
258
264
|
for (let r = 0; r < t.length && n < e.length; r++) t[r] === e[n] && n++;
|
|
259
265
|
return n === e.length;
|
|
260
266
|
}
|
|
261
|
-
function
|
|
267
|
+
function le(e, t) {
|
|
262
268
|
return t.includes(e);
|
|
263
269
|
}
|
|
264
|
-
function
|
|
270
|
+
function ue(e, t) {
|
|
265
271
|
return t.startsWith(e);
|
|
266
272
|
}
|
|
267
|
-
function
|
|
268
|
-
return e === "contains" ?
|
|
273
|
+
function de(e) {
|
|
274
|
+
return e === "contains" ? le : e === "prefix" ? ue : A;
|
|
269
275
|
}
|
|
270
|
-
function
|
|
276
|
+
function fe(e, t) {
|
|
271
277
|
return t === "textContent" ? e.textContent?.trim().toLowerCase() ?? "" : (e.getAttribute(t) ?? "").toLowerCase();
|
|
272
278
|
}
|
|
273
|
-
function
|
|
274
|
-
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i :
|
|
279
|
+
function j(e, t, n = {}) {
|
|
280
|
+
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : de(r), s = t.toLowerCase(), c = 0;
|
|
275
281
|
return e.querySelectorAll("[role=\"option\"]").forEach((e) => {
|
|
276
|
-
let t = a.some((t) => o(s,
|
|
282
|
+
let t = a.some((t) => o(s, fe(e, t)));
|
|
277
283
|
e.hidden = !t, t && c++;
|
|
278
284
|
}), c;
|
|
279
285
|
}
|
|
280
286
|
//#endregion
|
|
281
287
|
//#region src/plumbers/plumber/geometry.js
|
|
282
|
-
var
|
|
288
|
+
var pe = {
|
|
283
289
|
get top() {
|
|
284
290
|
return "bottom";
|
|
285
291
|
},
|
|
@@ -293,7 +299,7 @@ var ce = {
|
|
|
293
299
|
return "left";
|
|
294
300
|
}
|
|
295
301
|
};
|
|
296
|
-
function
|
|
302
|
+
function M({ x: e, y: t, width: n, height: r }) {
|
|
297
303
|
return {
|
|
298
304
|
x: e,
|
|
299
305
|
y: t,
|
|
@@ -305,46 +311,49 @@ function D({ x: e, y: t, width: n, height: r }) {
|
|
|
305
311
|
bottom: t + r
|
|
306
312
|
};
|
|
307
313
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
314
|
+
function me(e, t = "vertical") {
|
|
315
|
+
return t === "horizontal" ? e.left + e.width / 2 : e.top + e.height / 2;
|
|
316
|
+
}
|
|
317
|
+
function N() {
|
|
318
|
+
return M({
|
|
310
319
|
x: 0,
|
|
311
320
|
y: 0,
|
|
312
321
|
width: window.innerWidth || document.documentElement.clientWidth,
|
|
313
322
|
height: window.innerHeight || document.documentElement.clientHeight
|
|
314
323
|
});
|
|
315
324
|
}
|
|
316
|
-
function
|
|
325
|
+
function he(e) {
|
|
317
326
|
if (!(e instanceof HTMLElement)) return !1;
|
|
318
|
-
let t =
|
|
327
|
+
let t = N(), n = e.getBoundingClientRect(), r = n.top <= t.height && n.top + n.height > 0, i = n.left <= t.width && n.left + n.width > 0;
|
|
319
328
|
return r && i;
|
|
320
329
|
}
|
|
321
330
|
//#endregion
|
|
322
331
|
//#region src/plumbers/plumber/config.js
|
|
323
|
-
var
|
|
332
|
+
var P = {
|
|
324
333
|
get visibleOnly() {
|
|
325
334
|
return !0;
|
|
326
335
|
},
|
|
327
336
|
hiddenClass: null
|
|
328
|
-
},
|
|
337
|
+
}, ge = {
|
|
329
338
|
element: null,
|
|
330
339
|
visible: null,
|
|
331
340
|
dispatch: !0,
|
|
332
341
|
prefix: ""
|
|
333
|
-
},
|
|
342
|
+
}, F = class {
|
|
334
343
|
constructor(e, t = {}) {
|
|
335
344
|
this.controller = e;
|
|
336
|
-
let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({},
|
|
337
|
-
this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r :
|
|
345
|
+
let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, ge, t);
|
|
346
|
+
this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r : P.visibleOnly, this.visibleCallback = typeof r == "string" ? r : null, this.notify = !!i, this.prefix = typeof a == "string" && a ? a : e.identifier;
|
|
338
347
|
}
|
|
339
348
|
get visible() {
|
|
340
|
-
return this.element instanceof HTMLElement ? this.visibleOnly
|
|
349
|
+
return this.element instanceof HTMLElement ? !this.visibleOnly || he(this.element) && this.isVisible(this.element) : !1;
|
|
341
350
|
}
|
|
342
351
|
isVisible(e) {
|
|
343
352
|
if (this.visibleCallback) {
|
|
344
353
|
let t = this.findCallback(this.visibleCallback);
|
|
345
354
|
if (typeof t == "function") return t(e);
|
|
346
355
|
}
|
|
347
|
-
return e instanceof HTMLElement
|
|
356
|
+
return e instanceof HTMLElement && !e.hasAttribute("hidden");
|
|
348
357
|
}
|
|
349
358
|
dispatch(e, { target: t = null, prefix: n = null, detail: r = null } = {}) {
|
|
350
359
|
if (this.notify) return this.controller.dispatch(e, {
|
|
@@ -366,7 +375,7 @@ var k = {
|
|
|
366
375
|
return n instanceof Promise ? await n : n;
|
|
367
376
|
}
|
|
368
377
|
}
|
|
369
|
-
},
|
|
378
|
+
}, _e = {
|
|
370
379
|
normalize(e) {
|
|
371
380
|
return typeof e == "string" ? e : "";
|
|
372
381
|
},
|
|
@@ -376,7 +385,7 @@ var k = {
|
|
|
376
385
|
};
|
|
377
386
|
//#endregion
|
|
378
387
|
//#region src/plumbers/formatters/credit_card.js
|
|
379
|
-
function
|
|
388
|
+
function ve(e) {
|
|
380
389
|
let t = 0, n = !1;
|
|
381
390
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
382
391
|
let i = parseInt(e[r], 10);
|
|
@@ -384,32 +393,32 @@ function fe(e) {
|
|
|
384
393
|
}
|
|
385
394
|
return t % 10 == 0;
|
|
386
395
|
}
|
|
387
|
-
var
|
|
396
|
+
var ye = /\D/g, be = /^\d{13,19}$/, xe = /(.{4})(?=.)/g, Se = {
|
|
388
397
|
normalize(e) {
|
|
389
|
-
return typeof e == "string" ? e.replace(
|
|
398
|
+
return typeof e == "string" ? e.replace(ye, "") : "";
|
|
390
399
|
},
|
|
391
400
|
validate(e) {
|
|
392
|
-
return typeof e != "string" || !
|
|
401
|
+
return typeof e != "string" || !be.test(e) ? !1 : ve(e);
|
|
393
402
|
},
|
|
394
403
|
format(e) {
|
|
395
|
-
return typeof e == "string" ? e.replace(
|
|
404
|
+
return typeof e == "string" ? e.replace(xe, "$1 ") : "";
|
|
396
405
|
}
|
|
397
|
-
},
|
|
406
|
+
}, Ce = { 1: 10 }, I = /\D/g, we = /^\+\d{7,15}$/, Te = {
|
|
398
407
|
normalize(e) {
|
|
399
408
|
if (typeof e != "string") return "";
|
|
400
|
-
let t = e.trimStart().startsWith("+"), n = e.replace(
|
|
409
|
+
let t = e.trimStart().startsWith("+"), n = e.replace(I, "");
|
|
401
410
|
return t ? `+${n}` : n;
|
|
402
411
|
},
|
|
403
412
|
validate(e) {
|
|
404
413
|
if (typeof e != "string") return !1;
|
|
405
|
-
if (
|
|
406
|
-
let t = e.replace(
|
|
407
|
-
return Object.values(
|
|
414
|
+
if (we.test(e)) return !0;
|
|
415
|
+
let t = e.replace(I, "");
|
|
416
|
+
return Object.values(Ce).includes(t.length);
|
|
408
417
|
},
|
|
409
418
|
format(e) {
|
|
410
419
|
if (typeof e != "string") return "";
|
|
411
|
-
let t = e.replace(
|
|
412
|
-
for (let [e, n] of Object.entries(
|
|
420
|
+
let t = e.replace(I, "");
|
|
421
|
+
for (let [e, n] of Object.entries(Ce)) {
|
|
413
422
|
if (t.length === n) return `(${t.slice(0, 3)}) ${t.slice(3, 6)}-${t.slice(6)}`;
|
|
414
423
|
let r = n + e.length;
|
|
415
424
|
if (t.length === r && t.startsWith(e)) {
|
|
@@ -419,16 +428,16 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
419
428
|
}
|
|
420
429
|
return e;
|
|
421
430
|
}
|
|
422
|
-
},
|
|
431
|
+
}, Ee = /[^\d.,-]/g, De = /^-?\d+(\.\d+)?$/, Oe = {
|
|
423
432
|
normalize(e) {
|
|
424
433
|
if (typeof e != "string") return "";
|
|
425
|
-
let t = e.replace(
|
|
434
|
+
let t = e.replace(Ee, "");
|
|
426
435
|
if (!t) return "";
|
|
427
436
|
let n = t.lastIndexOf(","), r = t.lastIndexOf(".");
|
|
428
437
|
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;
|
|
429
438
|
},
|
|
430
439
|
validate(e) {
|
|
431
|
-
return typeof e == "string"
|
|
440
|
+
return typeof e == "string" && De.test(e);
|
|
432
441
|
},
|
|
433
442
|
format(e, t = {}) {
|
|
434
443
|
if (typeof e != "string") return "";
|
|
@@ -448,18 +457,18 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
448
457
|
return e;
|
|
449
458
|
}
|
|
450
459
|
}
|
|
451
|
-
},
|
|
460
|
+
}, L = /^\d{4}-\d{2}-\d{2}$/, ke = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Ae = /\D/g, R = {
|
|
452
461
|
normalize(e) {
|
|
453
462
|
if (typeof e != "string") return "";
|
|
454
463
|
let t = e.trim();
|
|
455
|
-
if (
|
|
456
|
-
let n = t.match(
|
|
464
|
+
if (L.test(t)) return t;
|
|
465
|
+
let n = t.match(ke);
|
|
457
466
|
if (n) {
|
|
458
467
|
let [, e, t, r] = n;
|
|
459
468
|
if (e.length === 4) return `${e}-${t.padStart(2, "0")}-${r.padStart(2, "0")}`;
|
|
460
469
|
if (r.length === 4) return `${r}-${e.padStart(2, "0")}-${t.padStart(2, "0")}`;
|
|
461
470
|
}
|
|
462
|
-
let r = t.replace(
|
|
471
|
+
let r = t.replace(Ae, "");
|
|
463
472
|
if (r.length === 8) {
|
|
464
473
|
let e = parseInt(r.slice(0, 4), 10);
|
|
465
474
|
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)}`;
|
|
@@ -468,8 +477,8 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
468
477
|
},
|
|
469
478
|
validate(e) {
|
|
470
479
|
if (typeof e != "string") return !1;
|
|
471
|
-
let t =
|
|
472
|
-
if (!
|
|
480
|
+
let t = R.normalize(e);
|
|
481
|
+
if (!L.test(t)) return !1;
|
|
473
482
|
let n = /* @__PURE__ */ new Date(`${t}T00:00:00Z`);
|
|
474
483
|
return !isNaN(n.getTime()) && n.toISOString().startsWith(t);
|
|
475
484
|
},
|
|
@@ -489,11 +498,11 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
489
498
|
return e;
|
|
490
499
|
}
|
|
491
500
|
}
|
|
492
|
-
},
|
|
501
|
+
}, je = /^([01]?\d|2[0-3]):([0-5]\d)$/, z = {
|
|
493
502
|
normalize(e) {
|
|
494
503
|
if (typeof e != "string") return "";
|
|
495
504
|
let t = e.trim();
|
|
496
|
-
if (
|
|
505
|
+
if (je.test(t)) {
|
|
497
506
|
let [e, n] = t.split(":");
|
|
498
507
|
return `${String(parseInt(e, 10)).padStart(2, "0")}:${n}`;
|
|
499
508
|
}
|
|
@@ -505,7 +514,7 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
505
514
|
return "";
|
|
506
515
|
},
|
|
507
516
|
validate(e) {
|
|
508
|
-
return
|
|
517
|
+
return z.normalize(e) !== "";
|
|
509
518
|
},
|
|
510
519
|
format(e, t = {}) {
|
|
511
520
|
if (typeof e != "string") return "";
|
|
@@ -516,32 +525,32 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
516
525
|
let a = r < 12 ? "AM" : "PM";
|
|
517
526
|
return `${r % 12 || 12}:${i} ${a}`;
|
|
518
527
|
}
|
|
519
|
-
},
|
|
528
|
+
}, B = {
|
|
520
529
|
PLAIN: "plain",
|
|
521
530
|
CREDIT_CARD: "creditCard",
|
|
522
531
|
PHONE: "phone",
|
|
523
532
|
CURRENCY: "currency",
|
|
524
533
|
DATE: "date",
|
|
525
534
|
TIME: "time"
|
|
526
|
-
},
|
|
527
|
-
[
|
|
528
|
-
[
|
|
529
|
-
[
|
|
530
|
-
[
|
|
531
|
-
[
|
|
532
|
-
[
|
|
533
|
-
]),
|
|
534
|
-
type:
|
|
535
|
+
}, V = /* @__PURE__ */ new Map([
|
|
536
|
+
[B.PLAIN, _e],
|
|
537
|
+
[B.CREDIT_CARD, Se],
|
|
538
|
+
[B.PHONE, Te],
|
|
539
|
+
[B.CURRENCY, Oe],
|
|
540
|
+
[B.DATE, R],
|
|
541
|
+
[B.TIME, z]
|
|
542
|
+
]), H = {
|
|
543
|
+
type: B.PLAIN,
|
|
535
544
|
options: {}
|
|
536
|
-
},
|
|
545
|
+
}, U = class extends F {
|
|
537
546
|
static register(e, t) {
|
|
538
|
-
|
|
547
|
+
V.set(e, t);
|
|
539
548
|
}
|
|
540
549
|
constructor(e, t = {}) {
|
|
541
|
-
super(e, t), this.type = t.type ??
|
|
550
|
+
super(e, t), this.type = t.type ?? H.type, this.options = t.options ?? H.options, this.enhance();
|
|
542
551
|
}
|
|
543
552
|
enhance() {
|
|
544
|
-
let e = this, t =
|
|
553
|
+
let e = this, t = V.get(e.type) ?? V.get(B.PLAIN), n = {
|
|
545
554
|
normalize: (n) => t.normalize?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
546
555
|
validate: (n) => t.validate?.(n, e.options) ?? !0,
|
|
547
556
|
format: (n) => t.format?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
@@ -555,30 +564,30 @@ var pe = /\D/g, me = /^\d{13,19}$/, he = /(.{4})(?=.)/g, ge = {
|
|
|
555
564
|
configurable: !0
|
|
556
565
|
});
|
|
557
566
|
}
|
|
558
|
-
},
|
|
559
|
-
function
|
|
567
|
+
}, W = (e, t) => new U(e, t), Me = /^\d{4}-\d{2}-\d{2}$/;
|
|
568
|
+
function G(e) {
|
|
560
569
|
return e instanceof Date && !isNaN(e);
|
|
561
570
|
}
|
|
562
|
-
function
|
|
571
|
+
function K(...e) {
|
|
563
572
|
if (e.length === 0) throw "Missing values to parse as date";
|
|
564
573
|
if (e.length === 1) {
|
|
565
574
|
let t = e[0];
|
|
566
575
|
if (!t) return;
|
|
567
|
-
if (typeof t == "string" &&
|
|
576
|
+
if (typeof t == "string" && Me.test(t)) {
|
|
568
577
|
let [e, n, r] = t.split("-").map(Number), i = new Date(e, n - 1, r);
|
|
569
|
-
if (
|
|
578
|
+
if (G(i)) return i;
|
|
570
579
|
} else {
|
|
571
580
|
let e = new Date(t);
|
|
572
|
-
if (
|
|
581
|
+
if (G(e)) return e;
|
|
573
582
|
}
|
|
574
583
|
} else {
|
|
575
584
|
let t = new Date(...e);
|
|
576
|
-
if (
|
|
585
|
+
if (G(t)) return t;
|
|
577
586
|
}
|
|
578
587
|
}
|
|
579
588
|
//#endregion
|
|
580
589
|
//#region src/plumbers/calendar.js
|
|
581
|
-
var
|
|
590
|
+
var Ne = 7, Pe = 12, q = 10, Fe = {
|
|
582
591
|
locales: ["default"],
|
|
583
592
|
today: "",
|
|
584
593
|
day: null,
|
|
@@ -593,15 +602,15 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
593
602
|
disabledYears: [],
|
|
594
603
|
firstDayOfWeek: 0,
|
|
595
604
|
onNavigated: "navigated"
|
|
596
|
-
},
|
|
605
|
+
}, Ie = class extends F {
|
|
597
606
|
constructor(e, t = {}) {
|
|
598
607
|
super(e, t);
|
|
599
|
-
let n = Object.assign({},
|
|
600
|
-
this.onNavigated = r, this.since =
|
|
608
|
+
let n = Object.assign({}, Fe, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
|
|
609
|
+
this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Fe.firstDayOfWeek;
|
|
601
610
|
let { disabledDates: s, disabledWeekdays: c, disabledDays: l, disabledMonths: u, disabledYears: d } = n;
|
|
602
611
|
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 : [];
|
|
603
|
-
let { today:
|
|
604
|
-
this.now =
|
|
612
|
+
let { today: f, day: p, month: m, year: h } = n;
|
|
613
|
+
this.now = K(f) || /* @__PURE__ */ new Date(), typeof h == "number" && typeof m == "number" && typeof p == "number" ? this.current = K(h, m, p) : this.current = this.now, this.build(), this.enhance();
|
|
605
614
|
}
|
|
606
615
|
build() {
|
|
607
616
|
this.daysOfWeek = this.buildDaysOfWeek(), this.daysOfMonth = this.buildDaysOfMonth(), this.monthsOfYear = this.buildMonthsOfYear(), this.yearsOfDecade = this.buildYearsOfDecade();
|
|
@@ -637,7 +646,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
637
646
|
let a = new Date(t, e, i);
|
|
638
647
|
n.push(r(a));
|
|
639
648
|
}
|
|
640
|
-
let s = n.length %
|
|
649
|
+
let s = n.length % Ne, c = s === 0 ? 0 : Ne - s;
|
|
641
650
|
for (let i = 1; i <= c; i++) {
|
|
642
651
|
let a = new Date(t, e + 1, i);
|
|
643
652
|
n.push(r(a));
|
|
@@ -646,7 +655,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
646
655
|
}
|
|
647
656
|
buildMonthsOfYear() {
|
|
648
657
|
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 = [];
|
|
649
|
-
for (let i = 0; i <
|
|
658
|
+
for (let i = 0; i < Pe; i++) {
|
|
650
659
|
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);
|
|
651
660
|
r.push({
|
|
652
661
|
date: a,
|
|
@@ -660,9 +669,9 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
660
669
|
return r;
|
|
661
670
|
}
|
|
662
671
|
buildYearsOfDecade() {
|
|
663
|
-
let e = Math.floor(this.year /
|
|
664
|
-
for (let n = e - 1; n <= e +
|
|
665
|
-
let r = n < e || n > e +
|
|
672
|
+
let e = Math.floor(this.year / q) * q, t = [];
|
|
673
|
+
for (let n = e - 1; n <= e + q; n++) {
|
|
674
|
+
let r = n < e || n > e + q - 1, i = this.since && n < this.since.getFullYear() || this.till && n > this.till.getFullYear(), a = this.disabledYears.some((e) => n == e);
|
|
666
675
|
t.push({
|
|
667
676
|
value: n,
|
|
668
677
|
current: n === this.year,
|
|
@@ -675,18 +684,18 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
675
684
|
return this.now;
|
|
676
685
|
}
|
|
677
686
|
set today(e) {
|
|
678
|
-
if (!
|
|
687
|
+
if (!G(e)) return;
|
|
679
688
|
let t = this.month ?? e.getMonth(), n = this.year ?? e.getFullYear(), r = t == e.getMonth() && n == e.getFullYear() ? e.getDate() : 1;
|
|
680
689
|
this.now = new Date(n, t, r);
|
|
681
690
|
}
|
|
682
691
|
get current() {
|
|
683
|
-
return typeof this.year == "number" && typeof this.month == "number" && typeof this.day == "number" ?
|
|
692
|
+
return typeof this.year == "number" && typeof this.month == "number" && typeof this.day == "number" ? K(this.year, this.month, this.day) : null;
|
|
684
693
|
}
|
|
685
694
|
set current(e) {
|
|
686
|
-
|
|
695
|
+
G(e) && (this.day = e.getDate(), this.month = e.getMonth(), this.year = e.getFullYear());
|
|
687
696
|
}
|
|
688
697
|
navigate = async (e) => {
|
|
689
|
-
if (!
|
|
698
|
+
if (!G(e)) return;
|
|
690
699
|
let t = this.current, n = e.toISOString(), r = t.toISOString();
|
|
691
700
|
this.dispatch("navigate", { detail: {
|
|
692
701
|
from: r,
|
|
@@ -717,7 +726,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
717
726
|
await this.navigate(n);
|
|
718
727
|
};
|
|
719
728
|
isDisabled = (e) => {
|
|
720
|
-
if (!
|
|
729
|
+
if (!G(e)) return !1;
|
|
721
730
|
if (this.disabledDates.length) {
|
|
722
731
|
let t = e.getTime();
|
|
723
732
|
for (let e of this.disabledDates) if (t === new Date(e).getTime()) return !0;
|
|
@@ -747,7 +756,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
747
756
|
return !1;
|
|
748
757
|
};
|
|
749
758
|
isWithinRange = (e) => {
|
|
750
|
-
if (!
|
|
759
|
+
if (!G(e)) return !1;
|
|
751
760
|
let t = !0;
|
|
752
761
|
return this.since && (t &&= e >= this.since), this.till && (t &&= e <= this.till), t;
|
|
753
762
|
};
|
|
@@ -813,7 +822,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
813
822
|
};
|
|
814
823
|
} });
|
|
815
824
|
}
|
|
816
|
-
},
|
|
825
|
+
}, J = (e, t) => new Ie(e, t), Le = class extends F {
|
|
817
826
|
constructor(e, t = {}) {
|
|
818
827
|
super(e, t), this.handle = this.handle.bind(this), this.onSelect = t.onSelect || null;
|
|
819
828
|
}
|
|
@@ -830,7 +839,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
830
839
|
if (t.disabled || t.getAttribute("aria-disabled") === "true") return;
|
|
831
840
|
let n = e.target instanceof HTMLTimeElement ? e.target : e.target.querySelector("time");
|
|
832
841
|
if (!n) return;
|
|
833
|
-
let r =
|
|
842
|
+
let r = K(n.dateTime);
|
|
834
843
|
if (!r) return;
|
|
835
844
|
this.dispatch("selecting", { target: t });
|
|
836
845
|
let i = r.toISOString();
|
|
@@ -839,7 +848,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
839
848
|
iso: i
|
|
840
849
|
} });
|
|
841
850
|
}
|
|
842
|
-
},
|
|
851
|
+
}, Re = class extends F {
|
|
843
852
|
constructor(e, t = {}) {
|
|
844
853
|
super(e, t), this.handle = this.handle.bind(this);
|
|
845
854
|
}
|
|
@@ -856,7 +865,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
856
865
|
let n = parseInt(t.dataset.month, 10);
|
|
857
866
|
isNaN(n) || this.dispatch("selected", { detail: { month: n } });
|
|
858
867
|
}
|
|
859
|
-
},
|
|
868
|
+
}, ze = class extends F {
|
|
860
869
|
constructor(e, t = {}) {
|
|
861
870
|
super(e, t), this.handle = this.handle.bind(this);
|
|
862
871
|
}
|
|
@@ -873,27 +882,27 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
873
882
|
let n = parseInt(t.dataset.year, 10);
|
|
874
883
|
isNaN(n) || this.dispatch("selected", { detail: { year: n } });
|
|
875
884
|
}
|
|
876
|
-
},
|
|
885
|
+
}, Be = (e, t) => new Le(e, t), Ve = (e, t) => new Re(e, t), He = (e, t) => new ze(e, t), Y = {
|
|
877
886
|
content: null,
|
|
878
887
|
url: "",
|
|
879
888
|
reload: "never",
|
|
880
889
|
stale: 3600,
|
|
881
890
|
onLoad: "canLoad",
|
|
882
891
|
onLoaded: "contentLoaded"
|
|
883
|
-
},
|
|
892
|
+
}, Ue = class extends F {
|
|
884
893
|
constructor(e, t = {}) {
|
|
885
894
|
super(e, t);
|
|
886
|
-
let n = Object.assign({},
|
|
887
|
-
this.content = r, this.url = i, this.reload = typeof a == "string" ? a :
|
|
895
|
+
let n = Object.assign({}, Y, t), { content: r, url: i, reload: a, stale: o } = n;
|
|
896
|
+
this.content = r, this.url = i, this.reload = typeof a == "string" ? a : Y.reload, this.stale = typeof o == "number" ? o : Y.stale;
|
|
888
897
|
let { onLoad: s, onLoaded: c } = n;
|
|
889
|
-
this.onLoad = s, this.onLoaded = c, this._requestor = new
|
|
898
|
+
this.onLoad = s, this.onLoaded = c, this._requestor = new k(), this.enhance();
|
|
890
899
|
}
|
|
891
900
|
get reloadable() {
|
|
892
901
|
switch (this.reload) {
|
|
893
902
|
case "never": return !1;
|
|
894
903
|
case "always": return !0;
|
|
895
904
|
default: {
|
|
896
|
-
let e =
|
|
905
|
+
let e = K(this.loadedAt);
|
|
897
906
|
return e && /* @__PURE__ */ new Date() - e > this.stale * 1e3;
|
|
898
907
|
}
|
|
899
908
|
}
|
|
@@ -919,7 +928,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
919
928
|
let e = this;
|
|
920
929
|
Object.assign(this.controller, { load: e.load.bind(e) });
|
|
921
930
|
}
|
|
922
|
-
},
|
|
931
|
+
}, We = (e, t) => new Ue(e, t), X = class extends F {
|
|
923
932
|
observe(e) {
|
|
924
933
|
this._handler = e, this.events.forEach((t) => window.addEventListener(t, e, !0));
|
|
925
934
|
}
|
|
@@ -932,21 +941,21 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
932
941
|
e.unobserve(), t();
|
|
933
942
|
};
|
|
934
943
|
}
|
|
935
|
-
},
|
|
944
|
+
}, Ge = {
|
|
936
945
|
trigger: null,
|
|
937
946
|
events: ["click"],
|
|
938
947
|
onDismissed: "dismissed"
|
|
939
|
-
},
|
|
948
|
+
}, Ke = class extends X {
|
|
940
949
|
constructor(e, t = {}) {
|
|
941
950
|
super(e, t);
|
|
942
|
-
let { trigger: n, events: r, onDismissed: i } = Object.assign({},
|
|
951
|
+
let { trigger: n, events: r, onDismissed: i } = Object.assign({}, Ge, t);
|
|
943
952
|
this.onDismissed = i, this.trigger = n || this.element, this.events = r, this.enhance(), this.observe(this.dismiss);
|
|
944
953
|
}
|
|
945
954
|
dismiss = async (e) => {
|
|
946
955
|
let { target: t } = e;
|
|
947
956
|
t instanceof HTMLElement && (this.element.contains(t) || this.visible && (this.dispatch("dismiss"), await this.awaitCallback(this.onDismissed, { target: this.trigger }), this.dispatch("dismissed")));
|
|
948
957
|
};
|
|
949
|
-
},
|
|
958
|
+
}, Z = (e, t) => new Ke(e, t), qe = {
|
|
950
959
|
anchor: null,
|
|
951
960
|
events: ["click"],
|
|
952
961
|
placement: "bottom",
|
|
@@ -954,11 +963,11 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
954
963
|
onFlipped: "flipped",
|
|
955
964
|
ariaRole: null,
|
|
956
965
|
respectMotion: !0
|
|
957
|
-
},
|
|
966
|
+
}, Je = class extends X {
|
|
958
967
|
constructor(e, t = {}) {
|
|
959
968
|
super(e, t);
|
|
960
|
-
let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({},
|
|
961
|
-
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 &&
|
|
969
|
+
let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, qe, t);
|
|
970
|
+
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({
|
|
962
971
|
trigger: this.anchor,
|
|
963
972
|
target: this.element,
|
|
964
973
|
role: this.ariaRole
|
|
@@ -976,7 +985,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
976
985
|
}), this.dispatch("flipped", { detail: { placement: e } });
|
|
977
986
|
};
|
|
978
987
|
flippedRect(e, t) {
|
|
979
|
-
let n = this.quadrumRect(e,
|
|
988
|
+
let n = this.quadrumRect(e, N()), r = [this.placement, pe[this.placement]], i = {};
|
|
980
989
|
for (; !Object.keys(i).length && r.length > 0;) {
|
|
981
990
|
let a = r.shift();
|
|
982
991
|
if (!this.biggerRectThan(n[a], t)) continue;
|
|
@@ -987,25 +996,25 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
987
996
|
}
|
|
988
997
|
quadrumRect(e, t) {
|
|
989
998
|
return {
|
|
990
|
-
left:
|
|
999
|
+
left: M({
|
|
991
1000
|
x: t.x,
|
|
992
1001
|
y: t.y,
|
|
993
1002
|
width: e.x - t.x,
|
|
994
1003
|
height: t.height
|
|
995
1004
|
}),
|
|
996
|
-
right:
|
|
1005
|
+
right: M({
|
|
997
1006
|
x: e.x + e.width,
|
|
998
1007
|
y: t.y,
|
|
999
1008
|
width: t.width - (e.x + e.width),
|
|
1000
1009
|
height: t.height
|
|
1001
1010
|
}),
|
|
1002
|
-
top:
|
|
1011
|
+
top: M({
|
|
1003
1012
|
x: t.x,
|
|
1004
1013
|
y: t.y,
|
|
1005
1014
|
width: t.width,
|
|
1006
1015
|
height: e.y - t.y
|
|
1007
1016
|
}),
|
|
1008
|
-
bottom:
|
|
1017
|
+
bottom: M({
|
|
1009
1018
|
x: t.x,
|
|
1010
1019
|
y: e.y + e.height,
|
|
1011
1020
|
width: t.width,
|
|
@@ -1015,25 +1024,25 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1015
1024
|
}
|
|
1016
1025
|
quadrumPlacement(e, t, n) {
|
|
1017
1026
|
switch (t) {
|
|
1018
|
-
case "top": return
|
|
1027
|
+
case "top": return M({
|
|
1019
1028
|
x: n.x,
|
|
1020
1029
|
y: e.y - n.height,
|
|
1021
1030
|
width: n.width,
|
|
1022
1031
|
height: n.height
|
|
1023
1032
|
});
|
|
1024
|
-
case "bottom": return
|
|
1033
|
+
case "bottom": return M({
|
|
1025
1034
|
x: n.x,
|
|
1026
1035
|
y: e.y + e.height,
|
|
1027
1036
|
width: n.width,
|
|
1028
1037
|
height: n.height
|
|
1029
1038
|
});
|
|
1030
|
-
case "left": return
|
|
1039
|
+
case "left": return M({
|
|
1031
1040
|
x: e.x - n.width,
|
|
1032
1041
|
y: n.y,
|
|
1033
1042
|
width: n.width,
|
|
1034
1043
|
height: n.height
|
|
1035
1044
|
});
|
|
1036
|
-
case "right": return
|
|
1045
|
+
case "right": return M({
|
|
1037
1046
|
x: e.x + e.width,
|
|
1038
1047
|
y: n.y,
|
|
1039
1048
|
width: n.width,
|
|
@@ -1047,7 +1056,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1047
1056
|
case "top":
|
|
1048
1057
|
case "bottom": {
|
|
1049
1058
|
let t = e.x;
|
|
1050
|
-
return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width),
|
|
1059
|
+
return this.alignment === "center" ? t = e.x + e.width / 2 - n.width / 2 : this.alignment === "end" && (t = e.x + e.width - n.width), M({
|
|
1051
1060
|
x: t,
|
|
1052
1061
|
y: n.y,
|
|
1053
1062
|
width: n.width,
|
|
@@ -1057,7 +1066,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1057
1066
|
case "left":
|
|
1058
1067
|
case "right": {
|
|
1059
1068
|
let t = e.y;
|
|
1060
|
-
return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height),
|
|
1069
|
+
return this.alignment === "center" ? t = e.y + e.height / 2 - n.height / 2 : this.alignment === "end" && (t = e.y + e.height - n.height), M({
|
|
1061
1070
|
x: n.x,
|
|
1062
1071
|
y: t,
|
|
1063
1072
|
width: n.width,
|
|
@@ -1073,7 +1082,83 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1073
1082
|
enhance() {
|
|
1074
1083
|
super.enhance(), this.controller.flip = this.flip;
|
|
1075
1084
|
}
|
|
1076
|
-
},
|
|
1085
|
+
}, Ye = (e, t) => new Je(e, t), Xe = {
|
|
1086
|
+
moveKey: "Alt",
|
|
1087
|
+
onMoved: null,
|
|
1088
|
+
orientation: "vertical"
|
|
1089
|
+
}, Ze = {
|
|
1090
|
+
vertical: {
|
|
1091
|
+
back: "ArrowUp",
|
|
1092
|
+
forward: "ArrowDown"
|
|
1093
|
+
},
|
|
1094
|
+
horizontal: {
|
|
1095
|
+
back: "ArrowLeft",
|
|
1096
|
+
forward: "ArrowRight"
|
|
1097
|
+
}
|
|
1098
|
+
}, Qe = class extends F {
|
|
1099
|
+
constructor(e, t = {}) {
|
|
1100
|
+
super(e, t);
|
|
1101
|
+
let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, Xe, t);
|
|
1102
|
+
this.moveKey = u[n] ? n : Xe.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
|
|
1103
|
+
}
|
|
1104
|
+
get items() {
|
|
1105
|
+
return this.controller.itemTargets;
|
|
1106
|
+
}
|
|
1107
|
+
attachItem(e) {
|
|
1108
|
+
e.addEventListener("keydown", this.onKeydown);
|
|
1109
|
+
}
|
|
1110
|
+
detachItem(e) {
|
|
1111
|
+
e.removeEventListener("keydown", this.onKeydown);
|
|
1112
|
+
}
|
|
1113
|
+
attachItems(e) {
|
|
1114
|
+
e.forEach((e) => this.attachItem(e));
|
|
1115
|
+
}
|
|
1116
|
+
detachItems(e) {
|
|
1117
|
+
e.forEach((e) => this.detachItem(e));
|
|
1118
|
+
}
|
|
1119
|
+
resolveMoveKeys(e) {
|
|
1120
|
+
let { back: t, forward: n } = Ze[this.orientation];
|
|
1121
|
+
return this.orientation === "horizontal" && getComputedStyle(e).direction === "rtl" ? {
|
|
1122
|
+
back: n,
|
|
1123
|
+
forward: t
|
|
1124
|
+
} : {
|
|
1125
|
+
back: t,
|
|
1126
|
+
forward: n
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
onKeydown(e) {
|
|
1130
|
+
if (!this.controller.editingValue || e.repeat) return;
|
|
1131
|
+
let t = e.currentTarget, { back: n, forward: r } = this.resolveMoveKeys(t);
|
|
1132
|
+
if (e.key !== n && e.key !== r || !e[u[this.moveKey]]) return;
|
|
1133
|
+
let i = this.items, a = i.indexOf(t), o = e.key === n ? a - 1 : a + 1;
|
|
1134
|
+
o < 0 || o >= i.length || (e.preventDefault(), e.key === n ? i[o].before(t) : i[o].after(t), this.dispatch("reordered", { detail: { itemIds: this.orderedIds() } }), this.awaitCallback(this.onMoved, t), m(`Moved to position ${this.items.indexOf(t) + 1} of ${this.items.length}`));
|
|
1135
|
+
}
|
|
1136
|
+
orderedIds() {
|
|
1137
|
+
return this.items.filter((e) => e.id).map((e) => e.id);
|
|
1138
|
+
}
|
|
1139
|
+
startDrag(e, t, n) {
|
|
1140
|
+
this.draggingItem = e, t.setPointerCapture(n);
|
|
1141
|
+
}
|
|
1142
|
+
drag(e) {
|
|
1143
|
+
if (!this.draggingItem) return;
|
|
1144
|
+
let t = this.orientation === "horizontal" ? e.clientX : e.clientY, n = this.items, r = n.indexOf(this.draggingItem), i = n[r - 1];
|
|
1145
|
+
if (i && t < this.midpointOf(i)) {
|
|
1146
|
+
i.before(this.draggingItem);
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
let a = n[r + 1];
|
|
1150
|
+
a && t > this.midpointOf(a) && a.after(this.draggingItem);
|
|
1151
|
+
}
|
|
1152
|
+
endDrag(e, t) {
|
|
1153
|
+
if (!this.draggingItem) return null;
|
|
1154
|
+
e.releasePointerCapture(t);
|
|
1155
|
+
let n = this.draggingItem;
|
|
1156
|
+
return this.draggingItem = null, this.dispatch("reordered", { detail: { itemIds: this.orderedIds() } }), n;
|
|
1157
|
+
}
|
|
1158
|
+
midpointOf(e) {
|
|
1159
|
+
return me(e.getBoundingClientRect(), this.orientation);
|
|
1160
|
+
}
|
|
1161
|
+
}, $e = (e, t) => new Qe(e, t), et = {
|
|
1077
1162
|
events: ["resize"],
|
|
1078
1163
|
boundaries: [
|
|
1079
1164
|
"top",
|
|
@@ -1082,10 +1167,10 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1082
1167
|
],
|
|
1083
1168
|
onShifted: "shifted",
|
|
1084
1169
|
respectMotion: !0
|
|
1085
|
-
},
|
|
1170
|
+
}, tt = class extends X {
|
|
1086
1171
|
constructor(e, t = {}) {
|
|
1087
1172
|
super(e, t);
|
|
1088
|
-
let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({},
|
|
1173
|
+
let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, et, t);
|
|
1089
1174
|
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);
|
|
1090
1175
|
}
|
|
1091
1176
|
shift = async () => {
|
|
@@ -1095,14 +1180,14 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1095
1180
|
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 });
|
|
1096
1181
|
};
|
|
1097
1182
|
overflowRect(e, t) {
|
|
1098
|
-
let n = {}, r =
|
|
1183
|
+
let n = {}, r = N(), i = M({
|
|
1099
1184
|
x: e.x - t.x,
|
|
1100
1185
|
y: e.y - t.y,
|
|
1101
1186
|
width: e.width,
|
|
1102
1187
|
height: e.height
|
|
1103
1188
|
});
|
|
1104
1189
|
for (let e of this.boundaries) {
|
|
1105
|
-
let t = this.directionDistance(i, e, r), a =
|
|
1190
|
+
let t = this.directionDistance(i, e, r), a = pe[e];
|
|
1106
1191
|
t < 0 ? i[a] + t >= r[a] && !n[a] && (n[e] = t) : n[e] = "";
|
|
1107
1192
|
}
|
|
1108
1193
|
return n;
|
|
@@ -1134,27 +1219,27 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1134
1219
|
enhance() {
|
|
1135
1220
|
super.enhance(), this.controller.shift = this.shift;
|
|
1136
1221
|
}
|
|
1137
|
-
},
|
|
1222
|
+
}, nt = (e, t) => new tt(e, t), rt = {
|
|
1138
1223
|
visibility: "visibility",
|
|
1139
1224
|
onShown: "shown",
|
|
1140
1225
|
onHidden: "hidden"
|
|
1141
|
-
},
|
|
1226
|
+
}, it = class extends F {
|
|
1142
1227
|
constructor(e, t = {}) {
|
|
1143
|
-
let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({},
|
|
1228
|
+
let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, rt, t), o = typeof n == "string" ? n : rt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
|
|
1144
1229
|
(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));
|
|
1145
1230
|
}
|
|
1146
1231
|
isVisible(e) {
|
|
1147
1232
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1148
|
-
let t =
|
|
1233
|
+
let t = P.hiddenClass;
|
|
1149
1234
|
return t ? !e.classList.contains(t) : !e.hasAttribute("hidden");
|
|
1150
1235
|
}
|
|
1151
1236
|
toggle(e, t) {
|
|
1152
1237
|
if (!(e instanceof HTMLElement)) return;
|
|
1153
|
-
let n =
|
|
1154
|
-
n ? t ? e.classList.remove(n) : e.classList.add(n) :
|
|
1238
|
+
let n = P.hiddenClass;
|
|
1239
|
+
n ? t ? e.classList.remove(n) : e.classList.add(n) : x(e, !t);
|
|
1155
1240
|
}
|
|
1156
1241
|
activate(e) {
|
|
1157
|
-
this.activator &&
|
|
1242
|
+
this.activator && _(this.activator, e);
|
|
1158
1243
|
}
|
|
1159
1244
|
async show() {
|
|
1160
1245
|
!(this.element instanceof HTMLElement) || this.isVisible(this.element) || (this.dispatch("show"), this.toggle(this.element, !0), this.activate(!0), await this.awaitCallback(this.onShown, { target: this.element }), this.dispatch("shown"));
|
|
@@ -1173,7 +1258,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1173
1258
|
return t;
|
|
1174
1259
|
} });
|
|
1175
1260
|
}
|
|
1176
|
-
},
|
|
1261
|
+
}, Q = (e, t) => new it(e, t), at = 4, ot = class extends e {
|
|
1177
1262
|
static targets = ["grid"];
|
|
1178
1263
|
static values = {
|
|
1179
1264
|
current: Number,
|
|
@@ -1195,7 +1280,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1195
1280
|
}
|
|
1196
1281
|
};
|
|
1197
1282
|
initialize() {
|
|
1198
|
-
this.selector =
|
|
1283
|
+
this.selector = He(this), J(this, {
|
|
1199
1284
|
today: this.todayValue,
|
|
1200
1285
|
year: this.currentValue || void 0,
|
|
1201
1286
|
since: this.sinceValue || null,
|
|
@@ -1213,10 +1298,9 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1213
1298
|
}
|
|
1214
1299
|
selectedValueChanged() {
|
|
1215
1300
|
if (!this.hasGridTarget) return;
|
|
1216
|
-
let e =
|
|
1301
|
+
let e = K(this.selectedValue), t = e ? e.getFullYear() : null;
|
|
1217
1302
|
this.gridTarget.querySelectorAll("button[data-year]").forEach((e) => {
|
|
1218
|
-
|
|
1219
|
-
e.setAttribute("aria-selected", n === t ? "true" : "false");
|
|
1303
|
+
y(e, parseInt(e.dataset.year, 10) === t);
|
|
1220
1304
|
});
|
|
1221
1305
|
}
|
|
1222
1306
|
navigate(e) {
|
|
@@ -1233,24 +1317,24 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1233
1317
|
}
|
|
1234
1318
|
drawGrid() {
|
|
1235
1319
|
if (!this.hasGridTarget) return;
|
|
1236
|
-
let { yearsOfDecade: e } = this.calendar, t = this.calendar.today.getFullYear(), n =
|
|
1320
|
+
let { yearsOfDecade: e } = this.calendar, t = this.calendar.today.getFullYear(), n = K(this.selectedValue), r = n ? n.getFullYear() : null, i = [];
|
|
1237
1321
|
for (let n of e) {
|
|
1238
1322
|
let e = document.createElement("button");
|
|
1239
|
-
e.type = "button", e.textContent = n.value, e.dataset.year = n.value, e.setAttribute("role", "gridcell"), e
|
|
1323
|
+
e.type = "button", e.textContent = n.value, e.dataset.year = n.value, e.setAttribute("role", "gridcell"), y(e, n.value === r), n.value === t && b(e, "year"), n.disabled && C(e, !0), i.push(e);
|
|
1240
1324
|
}
|
|
1241
1325
|
let a = document.createElement("div");
|
|
1242
1326
|
a.setAttribute("role", "rowgroup");
|
|
1243
|
-
for (let e = 0; e < i.length; e +=
|
|
1327
|
+
for (let e = 0; e < i.length; e += at) {
|
|
1244
1328
|
let t = document.createElement("div");
|
|
1245
1329
|
t.setAttribute("role", "row");
|
|
1246
|
-
for (let n of i.slice(e, e +
|
|
1330
|
+
for (let n of i.slice(e, e + at)) t.appendChild(n);
|
|
1247
1331
|
a.appendChild(t);
|
|
1248
1332
|
}
|
|
1249
1333
|
this.gridTarget.replaceChildren(a);
|
|
1250
1334
|
}
|
|
1251
|
-
},
|
|
1335
|
+
}, st = class extends e {
|
|
1252
1336
|
initialize() {
|
|
1253
|
-
this.selector =
|
|
1337
|
+
this.selector = He(this);
|
|
1254
1338
|
}
|
|
1255
1339
|
connect() {
|
|
1256
1340
|
this.selector.attach();
|
|
@@ -1258,7 +1342,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1258
1342
|
disconnect() {
|
|
1259
1343
|
this.selector.detach();
|
|
1260
1344
|
}
|
|
1261
|
-
},
|
|
1345
|
+
}, ct = class extends e {
|
|
1262
1346
|
static targets = ["daysOfWeek", "daysOfMonth"];
|
|
1263
1347
|
static classes = [
|
|
1264
1348
|
"dayOfWeek",
|
|
@@ -1303,7 +1387,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1303
1387
|
}
|
|
1304
1388
|
};
|
|
1305
1389
|
initialize() {
|
|
1306
|
-
this.selector =
|
|
1390
|
+
this.selector = Be(this, { onSelect: "select" }), J(this, {
|
|
1307
1391
|
today: this.todayValue,
|
|
1308
1392
|
since: this.sinceValue || null,
|
|
1309
1393
|
till: this.tillValue || null
|
|
@@ -1328,12 +1412,15 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1328
1412
|
}
|
|
1329
1413
|
selectedValueChanged() {
|
|
1330
1414
|
if (!this.hasDaysOfMonthTarget || (this.daysOfMonthTarget.querySelectorAll("[aria-selected]").forEach((e) => {
|
|
1331
|
-
e
|
|
1415
|
+
y(e, !1);
|
|
1332
1416
|
}), !this.selectedValue)) return;
|
|
1333
|
-
let e =
|
|
1417
|
+
let e = K(this.selectedValue);
|
|
1334
1418
|
if (!e) return;
|
|
1335
1419
|
let t = this.daysOfMonthTarget.querySelector(`time[datetime="${e.toISOString()}"]`);
|
|
1336
|
-
|
|
1420
|
+
if (t) {
|
|
1421
|
+
let e = t.closest("[aria-selected]");
|
|
1422
|
+
e && y(e, !0);
|
|
1423
|
+
}
|
|
1337
1424
|
}
|
|
1338
1425
|
navigate(e) {
|
|
1339
1426
|
this.yearValue = e.getFullYear(), this.monthValue = e.getMonth();
|
|
@@ -1342,7 +1429,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1342
1429
|
return this.calendar.step(e, t);
|
|
1343
1430
|
}
|
|
1344
1431
|
select(e) {
|
|
1345
|
-
let t =
|
|
1432
|
+
let t = K(e);
|
|
1346
1433
|
t && (this.selectedValue = e, (t.getMonth() !== this.calendar.month || t.getFullYear() !== this.calendar.year) && this.calendar.navigate(t), this.dispatch("selected", { detail: {
|
|
1347
1434
|
epoch: t.getTime(),
|
|
1348
1435
|
iso: e
|
|
@@ -1356,7 +1443,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1356
1443
|
}
|
|
1357
1444
|
createDayElement(e, { selectable: t = !1, disabled: n = !1 } = {}) {
|
|
1358
1445
|
let r = document.createElement(t ? "button" : "div");
|
|
1359
|
-
return r.tabIndex = -1, e ? r.textContent = e : r
|
|
1446
|
+
return r.tabIndex = -1, e ? r.textContent = e : S(r, !0), n && (r instanceof HTMLButtonElement ? r.disabled = !0 : C(r, !0)), r;
|
|
1360
1447
|
}
|
|
1361
1448
|
drawDaysOfWeek() {
|
|
1362
1449
|
if (!this.hasDaysOfWeekTarget) return;
|
|
@@ -1376,7 +1463,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1376
1463
|
selectable: e.current || i,
|
|
1377
1464
|
disabled: e.current ? r : !i
|
|
1378
1465
|
});
|
|
1379
|
-
t === e.date.getTime() && o
|
|
1466
|
+
t === e.date.getTime() && b(o, "date"), (e.current || this.daysOfOtherMonthValue) && o.setAttribute("aria-selected", ""), !e.current && this.daysOfOtherMonthValue && this.hasDayOfOtherMonthClass ? o.classList.add(...this.dayOfOtherMonthClasses) : this.hasDayOfMonthClass && o.classList.add(...this.dayOfMonthClasses);
|
|
1380
1467
|
let s = document.createElement("time");
|
|
1381
1468
|
s.dateTime = e.iso, o.appendChild(s), n.push(o);
|
|
1382
1469
|
}
|
|
@@ -1389,9 +1476,9 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1389
1476
|
}
|
|
1390
1477
|
this.daysOfMonthTarget.replaceChildren(...r);
|
|
1391
1478
|
}
|
|
1392
|
-
},
|
|
1479
|
+
}, lt = class extends e {
|
|
1393
1480
|
initialize() {
|
|
1394
|
-
this.selector =
|
|
1481
|
+
this.selector = Be(this);
|
|
1395
1482
|
}
|
|
1396
1483
|
connect() {
|
|
1397
1484
|
this.selector.attach();
|
|
@@ -1399,7 +1486,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1399
1486
|
disconnect() {
|
|
1400
1487
|
this.selector.detach();
|
|
1401
1488
|
}
|
|
1402
|
-
},
|
|
1489
|
+
}, ut = 4, dt = class extends e {
|
|
1403
1490
|
static targets = ["grid"];
|
|
1404
1491
|
static values = {
|
|
1405
1492
|
current: Number,
|
|
@@ -1429,7 +1516,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1429
1516
|
}
|
|
1430
1517
|
};
|
|
1431
1518
|
initialize() {
|
|
1432
|
-
this.selector =
|
|
1519
|
+
this.selector = Ve(this), J(this, {
|
|
1433
1520
|
today: this.todayValue,
|
|
1434
1521
|
year: this.currentValue || void 0,
|
|
1435
1522
|
since: this.sinceValue || null,
|
|
@@ -1447,10 +1534,10 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1447
1534
|
}
|
|
1448
1535
|
selectedValueChanged() {
|
|
1449
1536
|
if (!this.hasGridTarget) return;
|
|
1450
|
-
let e =
|
|
1537
|
+
let e = K(this.selectedValue);
|
|
1451
1538
|
this.gridTarget.querySelectorAll("button[data-month]").forEach((t) => {
|
|
1452
1539
|
let n = parseInt(t.dataset.month, 10) - 1;
|
|
1453
|
-
t
|
|
1540
|
+
y(t, !!e && e.getMonth() === n);
|
|
1454
1541
|
});
|
|
1455
1542
|
}
|
|
1456
1543
|
navigate(e) {
|
|
@@ -1467,26 +1554,24 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1467
1554
|
}
|
|
1468
1555
|
drawGrid() {
|
|
1469
1556
|
if (!this.hasGridTarget) return;
|
|
1470
|
-
let { year: e, monthsOfYear: t } = this.calendar, n = this.calendar.today, r =
|
|
1557
|
+
let { year: e, monthsOfYear: t } = this.calendar, n = this.calendar.today, r = K(this.selectedValue), i = [], a = new Intl.DateTimeFormat(this.localesValue, { month: this.monthFormatValue });
|
|
1471
1558
|
for (let o of t) {
|
|
1472
1559
|
let t = document.createElement("button");
|
|
1473
|
-
t.type = "button", t.textContent = a.format(o.date), t.dataset.month = o.value + 1, t.setAttribute("role", "gridcell");
|
|
1474
|
-
let s = r && r.getMonth() === o.value;
|
|
1475
|
-
t.setAttribute("aria-selected", s ? "true" : "false"), o.value === n.getMonth() && e === n.getFullYear() && t.setAttribute("aria-current", "month"), o.disabled && t.setAttribute("aria-disabled", "true"), i.push(t);
|
|
1560
|
+
t.type = "button", t.textContent = a.format(o.date), t.dataset.month = o.value + 1, t.setAttribute("role", "gridcell"), y(t, !!r && r.getMonth() === o.value), o.value === n.getMonth() && e === n.getFullYear() && b(t, "month"), o.disabled && C(t, !0), i.push(t);
|
|
1476
1561
|
}
|
|
1477
1562
|
let o = document.createElement("div");
|
|
1478
1563
|
o.setAttribute("role", "rowgroup");
|
|
1479
|
-
for (let e = 0; e < i.length; e +=
|
|
1564
|
+
for (let e = 0; e < i.length; e += ut) {
|
|
1480
1565
|
let t = document.createElement("div");
|
|
1481
1566
|
t.setAttribute("role", "row");
|
|
1482
|
-
for (let n of i.slice(e, e +
|
|
1567
|
+
for (let n of i.slice(e, e + ut)) t.appendChild(n);
|
|
1483
1568
|
o.appendChild(t);
|
|
1484
1569
|
}
|
|
1485
1570
|
this.gridTarget.replaceChildren(o);
|
|
1486
1571
|
}
|
|
1487
|
-
},
|
|
1572
|
+
}, ft = class extends e {
|
|
1488
1573
|
initialize() {
|
|
1489
|
-
this.selector =
|
|
1574
|
+
this.selector = Ve(this);
|
|
1490
1575
|
}
|
|
1491
1576
|
connect() {
|
|
1492
1577
|
this.selector.attach();
|
|
@@ -1494,7 +1579,27 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1494
1579
|
disconnect() {
|
|
1495
1580
|
this.selector.detach();
|
|
1496
1581
|
}
|
|
1497
|
-
},
|
|
1582
|
+
}, pt = class extends e {
|
|
1583
|
+
static targets = ["master", "item"];
|
|
1584
|
+
connect() {
|
|
1585
|
+
this.recompute();
|
|
1586
|
+
}
|
|
1587
|
+
onChange(e) {
|
|
1588
|
+
e.target === this.masterTarget && this.toggleAll(this.masterTarget.checked), this.recompute();
|
|
1589
|
+
}
|
|
1590
|
+
toggleAll(e) {
|
|
1591
|
+
this.enabledItems().forEach((t) => {
|
|
1592
|
+
t.checked = e;
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
recompute() {
|
|
1596
|
+
let e = this.enabledItems(), t = e.filter((e) => e.checked).length;
|
|
1597
|
+
this.masterTarget.checked = e.length > 0 && t === e.length, this.masterTarget.indeterminate = t > 0 && t < e.length;
|
|
1598
|
+
}
|
|
1599
|
+
enabledItems() {
|
|
1600
|
+
return this.itemTargets.filter((e) => !e.disabled);
|
|
1601
|
+
}
|
|
1602
|
+
}, mt = class extends e {
|
|
1498
1603
|
static targets = ["source"];
|
|
1499
1604
|
static values = { contentType: {
|
|
1500
1605
|
type: String,
|
|
@@ -1528,7 +1633,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1528
1633
|
"month",
|
|
1529
1634
|
"year",
|
|
1530
1635
|
"decade"
|
|
1531
|
-
],
|
|
1636
|
+
], ht = class extends e {
|
|
1532
1637
|
static targets = [
|
|
1533
1638
|
"previous",
|
|
1534
1639
|
"next",
|
|
@@ -1570,7 +1675,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1570
1675
|
}
|
|
1571
1676
|
async calendarMonthOutletConnected() {
|
|
1572
1677
|
if (this.dateValue) {
|
|
1573
|
-
let e =
|
|
1678
|
+
let e = K(this.dateValue);
|
|
1574
1679
|
e && await this.calendarMonthOutlet.calendar.navigate(e);
|
|
1575
1680
|
}
|
|
1576
1681
|
this.draw();
|
|
@@ -1665,7 +1770,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1665
1770
|
}
|
|
1666
1771
|
this.hasCalendarYearOutlet && (this.calendarYearOutletElement.hidden = !t), this.hasCalendarDecadeOutlet && (this.calendarDecadeOutletElement.hidden = !n);
|
|
1667
1772
|
}
|
|
1668
|
-
},
|
|
1773
|
+
}, gt = class extends e {
|
|
1669
1774
|
static targets = [
|
|
1670
1775
|
"listbox",
|
|
1671
1776
|
"loading",
|
|
@@ -1686,23 +1791,23 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1686
1791
|
}
|
|
1687
1792
|
};
|
|
1688
1793
|
initialize() {
|
|
1689
|
-
this._requestor = new
|
|
1794
|
+
this._requestor = new k();
|
|
1690
1795
|
}
|
|
1691
1796
|
connect() {
|
|
1692
|
-
this.hasListboxTarget && (this.listboxNav = new
|
|
1797
|
+
this.hasListboxTarget && (this.listboxNav = new f(this.listboxTarget));
|
|
1693
1798
|
}
|
|
1694
1799
|
disconnect() {
|
|
1695
1800
|
this._requestor.cancel();
|
|
1696
1801
|
}
|
|
1697
1802
|
onSelect(e) {
|
|
1698
1803
|
let t = e.target.closest("[role=\"option\"]");
|
|
1699
|
-
!t || t
|
|
1804
|
+
!t || re(t) || this.select(t.dataset.value ?? "");
|
|
1700
1805
|
}
|
|
1701
1806
|
select(e) {
|
|
1702
1807
|
let t = this.listboxTarget.querySelectorAll("[role=\"option\"]");
|
|
1703
|
-
t.forEach((e) => e
|
|
1808
|
+
t.forEach((e) => y(e, !1));
|
|
1704
1809
|
let n = [...t].find((t) => t.dataset.value === e);
|
|
1705
|
-
n && n
|
|
1810
|
+
n && y(n, !0), this.dispatch("selected", {
|
|
1706
1811
|
detail: { value: e },
|
|
1707
1812
|
bubbles: !0
|
|
1708
1813
|
});
|
|
@@ -1719,7 +1824,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1719
1824
|
e.name !== "AbortError" && console.error("[combobox-dropdown] fetch failed", e);
|
|
1720
1825
|
}).finally(() => this.setLoading(!1)), this.delayValue);
|
|
1721
1826
|
} else {
|
|
1722
|
-
let t =
|
|
1827
|
+
let t = j(this.listboxTarget, e);
|
|
1723
1828
|
this.setEmpty(t === 0);
|
|
1724
1829
|
}
|
|
1725
1830
|
}
|
|
@@ -1732,7 +1837,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1732
1837
|
setEmpty(e) {
|
|
1733
1838
|
this.hasEmptyTarget && (this.emptyTarget.hidden = !e);
|
|
1734
1839
|
}
|
|
1735
|
-
},
|
|
1840
|
+
}, _t = class extends e {
|
|
1736
1841
|
static targets = [
|
|
1737
1842
|
"hour",
|
|
1738
1843
|
"minute",
|
|
@@ -1743,7 +1848,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1743
1848
|
}
|
|
1744
1849
|
onSelect(e) {
|
|
1745
1850
|
let t = e.target.closest("[role=\"option\"]");
|
|
1746
|
-
t && (t.closest("[role=\"listbox\"]").querySelectorAll("[role=\"option\"]").forEach((e) => e
|
|
1851
|
+
t && (t.closest("[role=\"listbox\"]").querySelectorAll("[role=\"option\"]").forEach((e) => y(e, !1)), y(t, !0), this.select(this.toH24()));
|
|
1747
1852
|
}
|
|
1748
1853
|
select(e) {
|
|
1749
1854
|
e && this.dispatch("selected", {
|
|
@@ -1756,7 +1861,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1756
1861
|
}
|
|
1757
1862
|
step(e, t) {
|
|
1758
1863
|
let n = [...e.querySelectorAll("[role=\"option\"]")], r = e.querySelector("[aria-selected=\"true\"]"), i = n.indexOf(r), a = t > 0 ? n[Math.min(i + 1, n.length - 1)] : n[Math.max(i - 1, 0)];
|
|
1759
|
-
!a || a === r || (n.forEach((e) => e
|
|
1864
|
+
!a || a === r || (n.forEach((e) => y(e, !1)), y(a, !0), a.scrollIntoView({ block: "nearest" }), this.select(this.toH24()));
|
|
1760
1865
|
}
|
|
1761
1866
|
toH24() {
|
|
1762
1867
|
let e = this.selectedValue(this.hourTarget), t = this.selectedValue(this.minuteTarget);
|
|
@@ -1768,12 +1873,12 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1768
1873
|
selectedValue(e) {
|
|
1769
1874
|
return e?.querySelector("[aria-selected=\"true\"]")?.dataset.value ?? null;
|
|
1770
1875
|
}
|
|
1771
|
-
},
|
|
1876
|
+
}, vt = class extends e {
|
|
1772
1877
|
static targets = ["trigger"];
|
|
1773
1878
|
connect() {
|
|
1774
|
-
|
|
1879
|
+
Z(this, { trigger: this.hasTriggerTarget ? this.triggerTarget : null });
|
|
1775
1880
|
}
|
|
1776
|
-
},
|
|
1881
|
+
}, yt = class extends e {
|
|
1777
1882
|
static targets = ["anchor", "reference"];
|
|
1778
1883
|
static values = {
|
|
1779
1884
|
placement: {
|
|
@@ -1798,7 +1903,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1798
1903
|
console.error("FlipperController requires an anchor target. Add data-flipper-target=\"anchor\" to your element.");
|
|
1799
1904
|
return;
|
|
1800
1905
|
}
|
|
1801
|
-
|
|
1906
|
+
Ye(this, {
|
|
1802
1907
|
element: this.referenceTarget,
|
|
1803
1908
|
anchor: this.anchorTarget,
|
|
1804
1909
|
placement: this.placementValue,
|
|
@@ -1806,7 +1911,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1806
1911
|
ariaRole: this.roleValue
|
|
1807
1912
|
});
|
|
1808
1913
|
}
|
|
1809
|
-
},
|
|
1914
|
+
}, bt = class extends e {
|
|
1810
1915
|
static targets = ["trigger", "input"];
|
|
1811
1916
|
static values = {
|
|
1812
1917
|
value: String,
|
|
@@ -1831,7 +1936,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1831
1936
|
valueValueChanged(e) {
|
|
1832
1937
|
this.hasInputTarget && (this.inputTarget.value = e), this.dispatch("changed", { detail: { value: e } });
|
|
1833
1938
|
}
|
|
1834
|
-
},
|
|
1939
|
+
}, xt = class extends e {
|
|
1835
1940
|
static targets = ["input", "toggle"];
|
|
1836
1941
|
static values = {
|
|
1837
1942
|
format: {
|
|
@@ -1848,19 +1953,19 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1848
1953
|
}
|
|
1849
1954
|
};
|
|
1850
1955
|
connect() {
|
|
1851
|
-
|
|
1956
|
+
W(this, {
|
|
1852
1957
|
type: this.formatValue,
|
|
1853
1958
|
options: this.optionsValue
|
|
1854
1959
|
}), this.format(this.readValue()), this.drawToggle();
|
|
1855
1960
|
}
|
|
1856
1961
|
formatValueChanged() {
|
|
1857
|
-
this.formatter && (
|
|
1962
|
+
this.formatter && (W(this, {
|
|
1858
1963
|
type: this.formatValue,
|
|
1859
1964
|
options: this.optionsValue
|
|
1860
1965
|
}), this.format(this.readValue()), this.drawToggle());
|
|
1861
1966
|
}
|
|
1862
1967
|
optionsValueChanged() {
|
|
1863
|
-
this.formatter && (
|
|
1968
|
+
this.formatter && (W(this, {
|
|
1864
1969
|
type: this.formatValue,
|
|
1865
1970
|
options: this.optionsValue
|
|
1866
1971
|
}), this.format(this.readValue()));
|
|
@@ -1886,7 +1991,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1886
1991
|
drawToggle() {
|
|
1887
1992
|
if (!this.hasToggleTarget) return;
|
|
1888
1993
|
let e = this.formatter?.maskable() || this.formatValue === "password";
|
|
1889
|
-
this.toggleTarget.hidden = !e, e &&
|
|
1994
|
+
this.toggleTarget.hidden = !e, e && te(this.toggleTarget, this.revealedValue);
|
|
1890
1995
|
}
|
|
1891
1996
|
readValue() {
|
|
1892
1997
|
return this.hasInputTarget ? this.inputTarget instanceof HTMLInputElement ? this.inputTarget.value : this.inputTarget.textContent : "";
|
|
@@ -1900,7 +2005,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1900
2005
|
let t = this.formatter.normalize(e), n = this.revealedValue || !this.formatter.maskable() ? this.formatter.format(t) : this.formatter.mask(t);
|
|
1901
2006
|
this.hasInputTarget && (this.inputTarget instanceof HTMLInputElement ? this.inputTarget.value = n : this.inputTarget.textContent = n), this.dispatch("formatted", { detail: { value: n } });
|
|
1902
2007
|
}
|
|
1903
|
-
},
|
|
2008
|
+
}, St = class extends e {
|
|
1904
2009
|
static targets = ["input", "clear"];
|
|
1905
2010
|
initialize() {
|
|
1906
2011
|
this.onInput = this.draw.bind(this), this.onEscape = this.handleEscape.bind(this);
|
|
@@ -1923,7 +2028,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1923
2028
|
handleEscape(e) {
|
|
1924
2029
|
e.key === "Escape" && this.inputTarget.value !== "" && (e.preventDefault(), this.clear());
|
|
1925
2030
|
}
|
|
1926
|
-
},
|
|
2031
|
+
}, Ct = class extends e {
|
|
1927
2032
|
static targets = ["modal", "overlay"];
|
|
1928
2033
|
initialize() {
|
|
1929
2034
|
this.onCancel = this.close.bind(this);
|
|
@@ -1935,7 +2040,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1935
2040
|
this.isNativeDialog = e instanceof HTMLDialogElement, this.isNativeDialog ? (e.addEventListener("cancel", this.onCancel), e.addEventListener("click", this.onBackdropClick)) : (this.focusTrap = new a(e, {
|
|
1936
2041
|
escapeDeactivates: !0,
|
|
1937
2042
|
onDeactivate: () => this.close()
|
|
1938
|
-
}),
|
|
2043
|
+
}), Z(this, { element: e }));
|
|
1939
2044
|
}
|
|
1940
2045
|
modalTargetDisconnected(e) {
|
|
1941
2046
|
this.isNativeDialog && (e.removeEventListener("cancel", this.onCancel), e.removeEventListener("click", this.onBackdropClick));
|
|
@@ -1950,7 +2055,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1950
2055
|
let e = this.hasOverlayTarget ? this.overlayTarget : this.modalTarget;
|
|
1951
2056
|
e.hidden = !1, document.body.style.overflow = "hidden", this.focusTrap && this.focusTrap.activate();
|
|
1952
2057
|
}
|
|
1953
|
-
|
|
2058
|
+
m("Modal opened");
|
|
1954
2059
|
}
|
|
1955
2060
|
}
|
|
1956
2061
|
close(e) {
|
|
@@ -1962,26 +2067,25 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
1962
2067
|
let e = this.hasOverlayTarget ? this.overlayTarget : this.modalTarget;
|
|
1963
2068
|
e.hidden = !0, document.body.style.overflow = "", this.focusTrap && this.focusTrap.deactivate();
|
|
1964
2069
|
}
|
|
1965
|
-
|
|
2070
|
+
m("Modal closed");
|
|
1966
2071
|
}
|
|
1967
2072
|
}
|
|
1968
2073
|
onBackdropClick = (e) => {
|
|
1969
2074
|
let t = this.modalTarget.getBoundingClientRect();
|
|
1970
2075
|
(e.clientY < t.top || e.clientY > t.bottom || e.clientX < t.left || e.clientX > t.right) && this.close();
|
|
1971
2076
|
};
|
|
1972
|
-
},
|
|
2077
|
+
}, wt = class extends e {
|
|
1973
2078
|
static targets = ["content"];
|
|
1974
2079
|
connect() {
|
|
1975
|
-
|
|
2080
|
+
nt(this, { element: this.hasContentTarget ? this.contentTarget : null });
|
|
1976
2081
|
}
|
|
1977
|
-
},
|
|
2082
|
+
}, Tt = class extends e {
|
|
1978
2083
|
static targets = [
|
|
1979
2084
|
"trigger",
|
|
1980
2085
|
"panel",
|
|
1981
2086
|
"template",
|
|
1982
2087
|
"loader"
|
|
1983
2088
|
];
|
|
1984
|
-
static classes = ["hidden"];
|
|
1985
2089
|
static values = {
|
|
1986
2090
|
url: String,
|
|
1987
2091
|
loadedAt: String,
|
|
@@ -2007,13 +2111,13 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2007
2111
|
}
|
|
2008
2112
|
};
|
|
2009
2113
|
connect() {
|
|
2010
|
-
|
|
2114
|
+
We(this, {
|
|
2011
2115
|
element: this.hasPanelTarget ? this.panelTarget : null,
|
|
2012
2116
|
url: this.hasUrlValue ? this.urlValue : null
|
|
2013
|
-
}), this.hasPanelTarget && (
|
|
2117
|
+
}), this.hasPanelTarget && (Q(this, {
|
|
2014
2118
|
element: this.panelTarget,
|
|
2015
2119
|
activator: this.hasTriggerTarget ? this.triggerTarget : null
|
|
2016
|
-
}),
|
|
2120
|
+
}), Z(this)), this.hasLoaderTarget && Q(this, {
|
|
2017
2121
|
element: this.loaderTarget,
|
|
2018
2122
|
visibility: "contentLoaderVisibility"
|
|
2019
2123
|
});
|
|
@@ -2034,10 +2138,10 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2034
2138
|
this.closeOnSelectValue && await this.close();
|
|
2035
2139
|
}
|
|
2036
2140
|
async shown() {
|
|
2037
|
-
await this.load(), this.hasPanelTarget && i(this.panelTarget),
|
|
2141
|
+
await this.load(), this.hasPanelTarget && i(this.panelTarget), m(this.announceOpenValue);
|
|
2038
2142
|
}
|
|
2039
2143
|
async hidden() {
|
|
2040
|
-
this.hasTriggerTarget && this.triggerTarget.focus(),
|
|
2144
|
+
this.hasTriggerTarget && this.triggerTarget.focus(), m(this.announceCloseValue);
|
|
2041
2145
|
}
|
|
2042
2146
|
canLoad() {
|
|
2043
2147
|
return this.hasPanelTarget && this.panelTarget.tagName.toLowerCase() === "turbo-frame" ? (this.hasUrlValue && this.panelTarget.setAttribute("src", this.urlValue), !1) : !0;
|
|
@@ -2058,7 +2162,156 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2058
2162
|
contentLoader() {
|
|
2059
2163
|
if (this.hasTemplateTarget) return this.templateTarget instanceof HTMLTemplateElement ? this.templateTarget.content : this.templateTarget.innerHTML;
|
|
2060
2164
|
}
|
|
2061
|
-
},
|
|
2165
|
+
}, Et = class extends e {
|
|
2166
|
+
static targets = ["fill", "meter"];
|
|
2167
|
+
static values = {
|
|
2168
|
+
variant: {
|
|
2169
|
+
type: String,
|
|
2170
|
+
default: "bar"
|
|
2171
|
+
},
|
|
2172
|
+
current: {
|
|
2173
|
+
type: Number,
|
|
2174
|
+
default: 0
|
|
2175
|
+
},
|
|
2176
|
+
min: {
|
|
2177
|
+
type: Number,
|
|
2178
|
+
default: 0
|
|
2179
|
+
},
|
|
2180
|
+
max: {
|
|
2181
|
+
type: Number,
|
|
2182
|
+
default: 100
|
|
2183
|
+
},
|
|
2184
|
+
optimum: Number,
|
|
2185
|
+
low: Number,
|
|
2186
|
+
high: Number,
|
|
2187
|
+
indeterminate: {
|
|
2188
|
+
type: Boolean,
|
|
2189
|
+
default: !1
|
|
2190
|
+
},
|
|
2191
|
+
indeterminateFraction: {
|
|
2192
|
+
type: Number,
|
|
2193
|
+
default: .25
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
connect() {
|
|
2197
|
+
this.variantValue === "ring" && this.hasFillTarget && this.setCircumference(this.fillTarget), this.render();
|
|
2198
|
+
}
|
|
2199
|
+
setValue(e) {
|
|
2200
|
+
this.currentValue = this.clamp(e), this.render(), this.dispatch("changed", { detail: {
|
|
2201
|
+
value: this.currentValue,
|
|
2202
|
+
min: this.minValue,
|
|
2203
|
+
max: this.maxValue
|
|
2204
|
+
} });
|
|
2205
|
+
}
|
|
2206
|
+
currentValueChanged() {
|
|
2207
|
+
this.render();
|
|
2208
|
+
}
|
|
2209
|
+
clamp(e) {
|
|
2210
|
+
return Math.min(this.maxValue, Math.max(this.minValue, e));
|
|
2211
|
+
}
|
|
2212
|
+
render() {
|
|
2213
|
+
switch (this.variantValue) {
|
|
2214
|
+
case "meter": return this.renderMeter();
|
|
2215
|
+
case "ring":
|
|
2216
|
+
case "bar": return ae(this.element, this.minValue), w(this.element, this.maxValue), T(this.element, this.indeterminateValue ? null : this.currentValue), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.variantValue === "ring" ? this.renderRing() : this.renderBar();
|
|
2217
|
+
default: return;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
percent() {
|
|
2221
|
+
let e = this.maxValue - this.minValue;
|
|
2222
|
+
return e <= 0 ? 0 : (this.currentValue - this.minValue) / e * 100;
|
|
2223
|
+
}
|
|
2224
|
+
renderBar() {
|
|
2225
|
+
if (this.hasFillTarget) {
|
|
2226
|
+
if (this.indeterminateValue) {
|
|
2227
|
+
this.fillTarget.style.width = `${this.indeterminateFractionValue * 100}%`;
|
|
2228
|
+
return;
|
|
2229
|
+
}
|
|
2230
|
+
this.fillTarget.style.width = `${this.percent()}%`;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
renderRing() {
|
|
2234
|
+
if (this.hasFillTarget) {
|
|
2235
|
+
if (this.circumference ?? this.setCircumference(this.fillTarget), this.indeterminateValue) {
|
|
2236
|
+
let e = this.circumference * this.indeterminateFractionValue;
|
|
2237
|
+
this.fillTarget.style.strokeDasharray = `${e} ${this.circumference - e}`;
|
|
2238
|
+
return;
|
|
2239
|
+
}
|
|
2240
|
+
this.fillTarget.style.strokeDasharray = `${this.circumference}`, this.fillTarget.style.strokeDashoffset = `${this.circumference * (1 - this.percent() / 100)}`;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
setCircumference(e) {
|
|
2244
|
+
let t = parseFloat(e.getAttribute("r"));
|
|
2245
|
+
this.circumference = 2 * Math.PI * t;
|
|
2246
|
+
}
|
|
2247
|
+
renderMeter() {
|
|
2248
|
+
if (!this.hasMeterTarget || !(this.meterTarget instanceof HTMLMeterElement)) return;
|
|
2249
|
+
let e = this.meterTarget;
|
|
2250
|
+
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);
|
|
2251
|
+
}
|
|
2252
|
+
}, Dt = class extends e {
|
|
2253
|
+
static targets = [
|
|
2254
|
+
"item",
|
|
2255
|
+
"handle",
|
|
2256
|
+
"trigger"
|
|
2257
|
+
];
|
|
2258
|
+
static values = {
|
|
2259
|
+
moveKey: {
|
|
2260
|
+
type: String,
|
|
2261
|
+
default: "Alt"
|
|
2262
|
+
},
|
|
2263
|
+
editing: {
|
|
2264
|
+
type: Boolean,
|
|
2265
|
+
default: !1
|
|
2266
|
+
},
|
|
2267
|
+
orientation: {
|
|
2268
|
+
type: String,
|
|
2269
|
+
default: "vertical"
|
|
2270
|
+
}
|
|
2271
|
+
};
|
|
2272
|
+
connect() {
|
|
2273
|
+
this.reorderable = $e(this, {
|
|
2274
|
+
moveKey: this.moveKeyValue,
|
|
2275
|
+
orientation: this.orientationValue,
|
|
2276
|
+
onMoved: "moved"
|
|
2277
|
+
}), this.reorderable.attachItems(this.itemTargets), this.rovingTabIndex = new d(this.itemTargets, { orientation: this.orientationValue }), this.rovingTabIndex.activate();
|
|
2278
|
+
}
|
|
2279
|
+
disconnect() {
|
|
2280
|
+
this.reorderable.detachItems(this.itemTargets), this.rovingTabIndex?.deactivate(), this.rovingTabIndex = null;
|
|
2281
|
+
}
|
|
2282
|
+
itemTargetConnected(e) {
|
|
2283
|
+
this.reorderable?.attachItem(e), this.rovingTabIndex?.updateItems(this.itemTargets);
|
|
2284
|
+
}
|
|
2285
|
+
itemTargetDisconnected(e) {
|
|
2286
|
+
this.reorderable?.detachItem(e), this.rovingTabIndex?.updateItems(this.itemTargets);
|
|
2287
|
+
}
|
|
2288
|
+
editingValueChanged(e) {
|
|
2289
|
+
this.triggerTargets.forEach((t) => ie(t, e));
|
|
2290
|
+
}
|
|
2291
|
+
toggleEditing() {
|
|
2292
|
+
this.editingValue = !this.editingValue;
|
|
2293
|
+
}
|
|
2294
|
+
enterEditing() {
|
|
2295
|
+
this.editingValue = !0;
|
|
2296
|
+
}
|
|
2297
|
+
exitEditing() {
|
|
2298
|
+
this.editingValue = !1;
|
|
2299
|
+
}
|
|
2300
|
+
onPointerDown(e) {
|
|
2301
|
+
if (!this.editingValue) return;
|
|
2302
|
+
let t = e.currentTarget.closest("[data-reorderable-target~=\"item\"]");
|
|
2303
|
+
t && this.reorderable.startDrag(t, e.currentTarget, e.pointerId);
|
|
2304
|
+
}
|
|
2305
|
+
onPointerMove(e) {
|
|
2306
|
+
this.editingValue && this.reorderable.drag(e);
|
|
2307
|
+
}
|
|
2308
|
+
onPointerUp(e) {
|
|
2309
|
+
this.editingValue && (this.reorderable.endDrag(e.currentTarget, e.pointerId), this.rovingTabIndex?.updateItems(this.itemTargets));
|
|
2310
|
+
}
|
|
2311
|
+
moved(e) {
|
|
2312
|
+
this.rovingTabIndex?.updateItems(this.itemTargets), this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e));
|
|
2313
|
+
}
|
|
2314
|
+
}, Ot = class extends e {
|
|
2062
2315
|
static targets = [
|
|
2063
2316
|
"trigger",
|
|
2064
2317
|
"detail",
|
|
@@ -2069,14 +2322,14 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2069
2322
|
default: {}
|
|
2070
2323
|
} };
|
|
2071
2324
|
connect() {
|
|
2072
|
-
this.rovingTabIndex = new
|
|
2325
|
+
this.rovingTabIndex = new d(this.triggerTargets, { orientation: "vertical" }), this.rovingTabIndex.activate();
|
|
2073
2326
|
}
|
|
2074
2327
|
disconnect() {
|
|
2075
2328
|
this.rovingTabIndex?.deactivate(), this.rovingTabIndex = null;
|
|
2076
2329
|
}
|
|
2077
2330
|
toggle(e) {
|
|
2078
2331
|
let t = e.currentTarget;
|
|
2079
|
-
t
|
|
2332
|
+
v(t) ? this.collapseItem(t) : this.expandItem(t);
|
|
2080
2333
|
}
|
|
2081
2334
|
expand(e) {
|
|
2082
2335
|
this.expandItem(e.currentTarget);
|
|
@@ -2089,7 +2342,7 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2089
2342
|
this.dispatch("expand", { detail: {
|
|
2090
2343
|
trigger: e,
|
|
2091
2344
|
detail: t
|
|
2092
|
-
} }),
|
|
2345
|
+
} }), _(e, !0), t && (x(t, !1), m(`${e.textContent.trim()} expanded`)), this.dispatch("expanded", { detail: {
|
|
2093
2346
|
trigger: e,
|
|
2094
2347
|
detail: t
|
|
2095
2348
|
} });
|
|
@@ -2099,24 +2352,38 @@ var U = 7, Ee = 12, W = 10, G = {
|
|
|
2099
2352
|
this.dispatch("collapse", { detail: {
|
|
2100
2353
|
trigger: e,
|
|
2101
2354
|
detail: t
|
|
2102
|
-
} }),
|
|
2355
|
+
} }), _(e, !1), t && (x(t, !0), m(`${e.textContent.trim()} collapsed`)), this.dispatch("collapsed", { detail: {
|
|
2103
2356
|
trigger: e,
|
|
2104
2357
|
detail: t
|
|
2105
2358
|
} });
|
|
2106
2359
|
}
|
|
2107
2360
|
triggerTargetConnected(e) {
|
|
2108
|
-
e.hasAttribute("aria-expanded") || e
|
|
2361
|
+
e.hasAttribute("aria-expanded") || _(e, !1), this.rovingTabIndex?.updateItems(this.triggerTargets);
|
|
2109
2362
|
}
|
|
2110
2363
|
triggerTargetDisconnected() {
|
|
2111
2364
|
this.rovingTabIndex?.updateItems(this.triggerTargets);
|
|
2112
2365
|
}
|
|
2113
2366
|
timeTargetConnected(e) {
|
|
2114
2367
|
if (!Object.keys(this.dateFormatValue).length || e.textContent.trim()) return;
|
|
2115
|
-
let t =
|
|
2368
|
+
let t = R.format(e.getAttribute("datetime"), this.dateFormatValue);
|
|
2116
2369
|
t && (e.textContent = t);
|
|
2117
2370
|
}
|
|
2371
|
+
}, kt = class extends e {
|
|
2372
|
+
static targets = ["content"];
|
|
2373
|
+
connect() {
|
|
2374
|
+
Z(this);
|
|
2375
|
+
}
|
|
2376
|
+
contentTargetConnected(e) {
|
|
2377
|
+
nt(this, { element: e }), Q(this, { element: e });
|
|
2378
|
+
}
|
|
2379
|
+
async dismissed() {
|
|
2380
|
+
this.hasContentTarget && await this.visibility.hide();
|
|
2381
|
+
}
|
|
2382
|
+
async toggle() {
|
|
2383
|
+
this.hasContentTarget && (this.visibility.visible ? await this.visibility.hide() : (await this.visibility.show(), this.shift(this.contentTarget)));
|
|
2384
|
+
}
|
|
2118
2385
|
};
|
|
2119
2386
|
//#endregion
|
|
2120
|
-
export {
|
|
2387
|
+
export { E as ARIA_HASPOPUP_VALUES, ot as CalendarDecadeController, st as CalendarDecadeSelectorController, ct as CalendarMonthController, lt as CalendarMonthSelectorController, dt as CalendarYearController, ft as CalendarYearSelectorController, pt as ChecklistController, mt as ClipboardController, ht as ComboboxDateController, gt as ComboboxDropdownController, _t as ComboboxTimeController, vt as DismisserController, t as FOCUSABLE_SELECTOR, B as FORMATTER_TYPES, yt as FlipperController, a as FocusTrap, U as Formatter, St as InputClearableController, bt as InputComboboxController, xt as InputFormatterController, f as ListboxNavigation, u as MODIFIER_KEYS, Ct as ModalController, wt as PannerController, Tt as PopoverController, Et as ProgressController, Dt as ReorderableController, k as Requestor, d as RovingTabIndex, Ot as TimelineController, kt as VisibilityController, m as announce, se as connectTriggerToTarget, ce as disconnectTriggerFromTarget, ee as ensureId, j as filterOptions, i as focusFirst, A as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, re as isAriaDisabled, c as isArrowKey, v as isExpanded, o as isKey, r as isVisible, l as preventDefault, C as setAriaDisabled, S as setAriaHidden, g as setAriaState, ne as setChecked, b as setCurrent, ie as setDisabled, _ as setExpanded, x as setHidden, te as setPressed, y as setSelected, w as setValueMax, ae as setValueMin, T as setValueNow };
|
|
2121
2388
|
|
|
2122
2389
|
//# sourceMappingURL=index.es.js.map
|