courthive-components 6.10.3 → 6.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/components/interactive-scoring/index.d.ts +1 -1
- package/dist/components/ladderChart/index.d.ts +1 -1
- package/dist/components/policy-catalog/editors/privacy/domain/privacyProjections.d.ts +16 -3
- package/dist/components/policy-catalog/editors/privacy/index.d.ts +1 -1
- package/dist/components/policy-catalog/editors/scoring/index.d.ts +2 -2
- package/dist/components/policy-catalog/index.d.ts +3 -3
- package/dist/components/ratingDistributionChart/index.d.ts +1 -1
- package/dist/components/topology-builder/domain/edgeTraversal.d.ts +15 -0
- package/dist/components/topology-builder/ui/edgeEditMode.d.ts +15 -0
- package/dist/courthive-components.es.js +1510 -1441
- package/dist/courthive-components.umd.js +46 -46
- package/dist/{dist-D160D4O-.mjs → dist-DPnSc4eG.mjs} +492 -393
- package/dist/{range-CbB5sPGX.mjs → range-C-KhEV-d.mjs} +263 -84
- package/package.json +4 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region node_modules/.pnpm/timepicker-ui@4.
|
|
1
|
+
//#region node_modules/.pnpm/timepicker-ui@4.6.0/node_modules/timepicker-ui/dist/index.js
|
|
2
2
|
var e = () => typeof window > "u", t = () => typeof document < "u", n = () => new Intl.DateTimeFormat(void 0, { hour: "numeric" }).resolvedOptions().hour12 ? "12h" : "24h", r = [
|
|
3
3
|
[
|
|
4
4
|
"ui",
|
|
@@ -273,6 +273,7 @@ var u = {
|
|
|
273
273
|
enabled: !1,
|
|
274
274
|
minDuration: void 0,
|
|
275
275
|
maxDuration: void 0,
|
|
276
|
+
linked: !0,
|
|
276
277
|
fromLabel: "From",
|
|
277
278
|
toLabel: "To"
|
|
278
279
|
},
|
|
@@ -338,6 +339,7 @@ var p = class {
|
|
|
338
339
|
_isMobileView = !1;
|
|
339
340
|
_isTouchMouseMove = !1;
|
|
340
341
|
_disabledTime = null;
|
|
342
|
+
_timePredicate = null;
|
|
341
343
|
_cloned = null;
|
|
342
344
|
_isModalRemove = !0;
|
|
343
345
|
_isOpen = !1;
|
|
@@ -372,6 +374,9 @@ var p = class {
|
|
|
372
374
|
get disabledTime() {
|
|
373
375
|
return this._disabledTime;
|
|
374
376
|
}
|
|
377
|
+
get timePredicate() {
|
|
378
|
+
return this._timePredicate;
|
|
379
|
+
}
|
|
375
380
|
get cloned() {
|
|
376
381
|
return this._cloned;
|
|
377
382
|
}
|
|
@@ -411,6 +416,9 @@ var p = class {
|
|
|
411
416
|
setDisabledTime(e) {
|
|
412
417
|
this._disabledTime = e;
|
|
413
418
|
}
|
|
419
|
+
setTimePredicate(e) {
|
|
420
|
+
this._timePredicate = e;
|
|
421
|
+
}
|
|
414
422
|
setCloned(e) {
|
|
415
423
|
this._cloned = e;
|
|
416
424
|
}
|
|
@@ -433,7 +441,7 @@ var p = class {
|
|
|
433
441
|
this._options = d(this._options, e);
|
|
434
442
|
}
|
|
435
443
|
reset() {
|
|
436
|
-
this._degreesHours = null, this._degreesMinutes = null, this._degreesSeconds = null, this._isTouchMouseMove = !1, this._disabledTime = null, this._cloned = null, this._isModalRemove = !0, this._isOpen = !1, this._isInitialized = !1, this._isDestroyed = !0, this._eventHandlersRegistered = !1, this._modalElement = null;
|
|
444
|
+
this._degreesHours = null, this._degreesMinutes = null, this._degreesSeconds = null, this._isTouchMouseMove = !1, this._disabledTime = null, this._timePredicate = null, this._cloned = null, this._isModalRemove = !0, this._isOpen = !1, this._isInitialized = !1, this._isDestroyed = !0, this._eventHandlersRegistered = !1, this._modalElement = null;
|
|
437
445
|
}
|
|
438
446
|
q(e) {
|
|
439
447
|
return this.getModalElement()?.querySelector(e) ?? null;
|
|
@@ -574,31 +582,31 @@ var p = class {
|
|
|
574
582
|
g(e, "active", t), v(e, t);
|
|
575
583
|
}, b = (e, t, n) => {
|
|
576
584
|
y(e, n === "AM"), y(t, n === "PM");
|
|
577
|
-
},
|
|
585
|
+
}, x = [
|
|
578
586
|
"aria-label",
|
|
579
587
|
"aria-valuemin",
|
|
580
588
|
"aria-valuemax",
|
|
581
589
|
"aria-valuenow",
|
|
582
590
|
"aria-valuetext"
|
|
583
|
-
],
|
|
591
|
+
], S = (e) => {
|
|
584
592
|
if (!e) return;
|
|
585
593
|
let t = e.querySelector(".tp-ui-clock-face");
|
|
586
594
|
if (!t) return;
|
|
587
595
|
let n = e.querySelector("input.active") ?? e.querySelector(".tp-ui-hour");
|
|
588
|
-
|
|
589
|
-
},
|
|
596
|
+
x.forEach((e) => _(t, e, n?.getAttribute(e)));
|
|
597
|
+
}, C = (e, t) => {
|
|
590
598
|
if (!e) return;
|
|
591
599
|
e.value = t;
|
|
592
600
|
let n = parseInt(t, 10), r = !Number.isNaN(n);
|
|
593
|
-
_(e, "aria-valuenow", r && String(n)), _(e, "aria-valuetext", r && t),
|
|
594
|
-
},
|
|
601
|
+
_(e, "aria-valuenow", r && String(n)), _(e, "aria-valuetext", r && t), S(e.closest(".tp-ui-modal"));
|
|
602
|
+
}, ee = (e) => e.getAttribute("aria-disabled") === "true" || e.classList.contains("disabled"), te = (e, t) => {
|
|
595
603
|
e && (g(e, "disabled", t), _(e, "aria-disabled", String(t)));
|
|
596
604
|
}, ne = "[role=\"button\"], [tabindex], input, select, textarea", re = "button, a[href], summary, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], input[type=\"image\"]", ie = (e) => e.matches(ne) && !e.matches(re), ae = (e) => e === "Enter" || e === " ", w = (e, t) => {
|
|
597
605
|
if (!e) return () => {};
|
|
598
606
|
let n = (n) => {
|
|
599
|
-
|
|
607
|
+
ee(e) || t(n);
|
|
600
608
|
}, r = (n) => {
|
|
601
|
-
ae(n.key) && ie(e) && (n.key !== "Enter" && n.preventDefault(), !
|
|
609
|
+
ae(n.key) && ie(e) && (n.key !== "Enter" && n.preventDefault(), !ee(e) && t(n));
|
|
602
610
|
};
|
|
603
611
|
return e.addEventListener("click", n), e.addEventListener("keydown", r), () => {
|
|
604
612
|
e.removeEventListener("click", n), e.removeEventListener("keydown", r);
|
|
@@ -669,13 +677,39 @@ var p = class {
|
|
|
669
677
|
getClearHandler(e) {
|
|
670
678
|
return this.plugins.get(e)?.clearHandler;
|
|
671
679
|
}
|
|
672
|
-
}()
|
|
680
|
+
}();
|
|
681
|
+
function D(e) {
|
|
682
|
+
return e.clock.type === "24h" ? "24h" : "12h";
|
|
683
|
+
}
|
|
684
|
+
function O(e) {
|
|
685
|
+
return {
|
|
686
|
+
clockType: D(e),
|
|
687
|
+
showSeconds: !!e.clock.showSeconds
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
function k(e) {
|
|
691
|
+
let t = e.ui.mode;
|
|
692
|
+
return t === "wheel" || t === "compact-wheel";
|
|
693
|
+
}
|
|
694
|
+
function fe(e) {
|
|
695
|
+
return e.ui.mode === "compact-wheel";
|
|
696
|
+
}
|
|
697
|
+
function A(e) {
|
|
698
|
+
return fe(e) && !!e.wheel?.placement;
|
|
699
|
+
}
|
|
700
|
+
function j(e) {
|
|
701
|
+
return !!e.ui.inline?.enabled;
|
|
702
|
+
}
|
|
703
|
+
function M(e) {
|
|
704
|
+
return !!e.ui.inline?.enabled && !!e.ui.inline.embedded;
|
|
705
|
+
}
|
|
706
|
+
var pe = {
|
|
673
707
|
"&": "&",
|
|
674
708
|
"<": "<",
|
|
675
709
|
">": ">",
|
|
676
710
|
"\"": """,
|
|
677
711
|
"'": "'"
|
|
678
|
-
},
|
|
712
|
+
}, N = (e) => String(e ?? "").replace(/[&<>"']/g, (e) => pe[e]), me = [
|
|
679
713
|
"00",
|
|
680
714
|
"13",
|
|
681
715
|
"14",
|
|
@@ -688,7 +722,7 @@ var p = class {
|
|
|
688
722
|
"21",
|
|
689
723
|
"22",
|
|
690
724
|
"23"
|
|
691
|
-
],
|
|
725
|
+
], he = [
|
|
692
726
|
"12",
|
|
693
727
|
"1",
|
|
694
728
|
"2",
|
|
@@ -701,7 +735,7 @@ var p = class {
|
|
|
701
735
|
"9",
|
|
702
736
|
"10",
|
|
703
737
|
"11"
|
|
704
|
-
],
|
|
738
|
+
], ge = [
|
|
705
739
|
"00",
|
|
706
740
|
"05",
|
|
707
741
|
"10",
|
|
@@ -714,10 +748,10 @@ var p = class {
|
|
|
714
748
|
"45",
|
|
715
749
|
"50",
|
|
716
750
|
"55"
|
|
717
|
-
],
|
|
751
|
+
], _e = (e, t, n) => {
|
|
718
752
|
let { timezone: { enabled: r, label: i } } = e;
|
|
719
753
|
if (!r || !E.has("timezone")) return "";
|
|
720
|
-
let a =
|
|
754
|
+
let a = N(i ?? u.timezone.label), o = N(n);
|
|
721
755
|
return `<div class="tp-ui-timezone ${t}">
|
|
722
756
|
<span class="tp-ui-timezone-label" id="tp-tz-label-${o}">${a}</span>
|
|
723
757
|
<div class="tp-ui-timezone-dropdown" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-labelledby="tp-tz-label-${o}" tabindex="0" data-tz-id="${o}">
|
|
@@ -726,31 +760,31 @@ var p = class {
|
|
|
726
760
|
<div class="tp-ui-timezone-menu" role="listbox" aria-labelledby="tp-tz-label-${o}"></div>
|
|
727
761
|
</div>
|
|
728
762
|
</div>`;
|
|
729
|
-
},
|
|
763
|
+
}, ve = (e) => {
|
|
730
764
|
let { range: { enabled: t, fromLabel: n, toLabel: r }, labels: { rangeSelectionLabel: i } } = e;
|
|
731
|
-
return !t || !E.has("range") ? "" : `<div class="tp-ui-range-header" role="tablist" aria-label="${
|
|
732
|
-
},
|
|
765
|
+
return !t || !E.has("range") ? "" : `<div class="tp-ui-range-header" role="tablist" aria-label="${N(i)}"><button type="button" class="tp-ui-range-tab tp-ui-range-from active" data-md3-ripple role="tab" tabindex="0" aria-selected="true"><span class="tp-ui-range-tab-label">${N(n)}</span><span class="tp-ui-range-tab-value tp-ui-range-from-time" aria-hidden="true">--:--</span></button><button type="button" class="tp-ui-range-tab tp-ui-range-to" data-md3-ripple role="tab" tabindex="-1" aria-selected="false"><span class="tp-ui-range-tab-label">${N(r)}</span><span class="tp-ui-range-tab-value tp-ui-range-to-time" aria-hidden="true">--:--</span></button></div>`;
|
|
766
|
+
}, ye = (e, t) => {
|
|
733
767
|
let { ui: { clearButton: n }, labels: { clear: r } } = e;
|
|
734
768
|
if (!n) return "";
|
|
735
|
-
let i =
|
|
769
|
+
let i = N(r);
|
|
736
770
|
return `<div class="tp-ui-clear-btn ${t} disabled" data-md3-ripple tabindex="0" role="button" aria-label="${i}" aria-disabled="true">${i}</div>`;
|
|
737
|
-
},
|
|
771
|
+
}, be = (e, t, n) => {
|
|
738
772
|
if (e.isWheelMode) {
|
|
739
773
|
let t = E.getTemplateProvider("wheel");
|
|
740
774
|
return t ? `<div class="tp-ui-mobile-clock-wrapper ${e.mobileClass}">${t(n, e.instanceId)}</div>` : `<div class="tp-ui-mobile-clock-wrapper ${e.mobileClass}"></div>`;
|
|
741
775
|
}
|
|
742
776
|
let { clockLabel: r } = n.labels;
|
|
743
|
-
return `<div class="tp-ui-mobile-clock-wrapper ${e.mobileClass}"><div class="tp-ui-body ${e.mobileClass}" role="group" aria-label="${
|
|
744
|
-
},
|
|
777
|
+
return `<div class="tp-ui-mobile-clock-wrapper ${e.mobileClass}"><div class="tp-ui-body ${e.mobileClass}" role="group" aria-label="${N(r)}"><div class="tp-ui-clock-face ${e.mobileClass}" role="slider" tabindex="0"><div class="tp-ui-dot ${e.mobileClass}" aria-hidden="true"></div><div class="tp-ui-clock-hand ${e.mobileClass}" aria-hidden="true"><div class="tp-ui-circle-hand ${e.mobileClass}"></div></div><div class="tp-ui-tips-wrapper ${e.mobileClass}" aria-hidden="true"></div>${e.clockType === "24h" ? `<div class="tp-ui-tips-wrapper-24h ${e.mobileClass}" aria-hidden="true"></div>` : ""}</div></div></div>`;
|
|
778
|
+
}, xe = {
|
|
745
779
|
min: "0",
|
|
746
780
|
max: "59",
|
|
747
781
|
valueNow: "0",
|
|
748
782
|
valueText: "00"
|
|
749
|
-
},
|
|
750
|
-
let r =
|
|
783
|
+
}, Se = (e) => `<div class="tp-ui-dots ${e}" aria-hidden="true"><span></span><span></span></div>`, Ce = (e, t, n) => {
|
|
784
|
+
let r = N(e.mobileLabel), i = t ? r : N(e.label);
|
|
751
785
|
return `<div class="tp-ui-input-wrapper ${t}"><div class="tp-ui-input-ripple-wrapper ${t}" data-md3-ripple><input name="${e.name}" ${n ? "readonly" : ""} class="${e.inputClass} ${t}" tabindex="0" type="number" min="${e.min}" max="${e.max}" aria-label="${i}" role="spinbutton" aria-valuemin="${e.min}" aria-valuemax="${e.max}" aria-valuenow="${e.valueNow}" aria-valuetext="${e.valueText}"></div><div class="${e.textClass} ${t}">${r}</div></div>`;
|
|
752
|
-
},
|
|
753
|
-
let { labels: n, ui: { editable: r }, clock: { showSeconds: i } } = e, { mobileClass: a, clockType: o, instanceId: s } = t, c =
|
|
786
|
+
}, we = (e, t) => {
|
|
787
|
+
let { labels: n, ui: { editable: r }, clock: { showSeconds: i } } = e, { mobileClass: a, clockType: o, instanceId: s } = t, c = N(a ? n.mobileTime : n.time), l = N(n.timeLabel), u = N(n.am), d = N(n.pm), f = N(n.periodLabel), p = o === "12h", m = p ? "12" : "0", h = [{
|
|
754
788
|
name: "hour",
|
|
755
789
|
inputClass: "tp-ui-hour",
|
|
756
790
|
textClass: "tp-ui-hour-text",
|
|
@@ -764,7 +798,7 @@ var p = class {
|
|
|
764
798
|
name: "minutes",
|
|
765
799
|
inputClass: "tp-ui-minutes",
|
|
766
800
|
textClass: "tp-ui-minute-text",
|
|
767
|
-
...
|
|
801
|
+
...xe,
|
|
768
802
|
label: n.minuteLabel,
|
|
769
803
|
mobileLabel: n.mobileMinute
|
|
770
804
|
}];
|
|
@@ -772,16 +806,16 @@ var p = class {
|
|
|
772
806
|
name: "seconds",
|
|
773
807
|
inputClass: "tp-ui-seconds",
|
|
774
808
|
textClass: "tp-ui-second-text",
|
|
775
|
-
...
|
|
809
|
+
...xe,
|
|
776
810
|
label: n.second,
|
|
777
811
|
mobileLabel: n.second
|
|
778
812
|
});
|
|
779
|
-
let g = !r && !a, _ = h.map((e) =>
|
|
780
|
-
return `<div class="tp-ui-select-time ${a}" id="tp-ui-label-${
|
|
781
|
-
},
|
|
782
|
-
let { ui: { enableSwitchIcon: n, iconTemplate: r, iconTemplateMobile: i }, labels: a } = e, o =
|
|
813
|
+
let g = !r && !a, _ = h.map((e) => Ce(e, a, g)).join(Se(a)), v = o === "24h" ? "" : `<div class="tp-ui-wrapper-type-time ${a}" role="group" aria-label="${f}"><div class="tp-ui-type-mode tp-ui-am ${a}" data-md3-ripple tabindex="0" role="button" aria-label="${u}" aria-pressed="false" data-type="AM">${u}</div><div class="tp-ui-type-mode tp-ui-pm ${a}" data-md3-ripple tabindex="0" role="button" aria-label="${d}" aria-pressed="false" data-type="PM">${d}</div></div>`;
|
|
814
|
+
return `<div class="tp-ui-select-time ${a}" id="tp-ui-label-${N(s)}">${c}</div><div class="tp-ui-header ${a}"><div class="tp-ui-wrapper-time ${a} ${o === "24h" ? "tp-ui-wrapper-time-24h" : ""}" role="group" aria-label="${l}">${_}</div>${v}</div>`;
|
|
815
|
+
}, Te = (e, t) => `<button aria-label="${N(e)}" type="button" class="tp-ui-keyboard-icon">${t}</button>`, Ee = (e, t) => {
|
|
816
|
+
let { ui: { enableSwitchIcon: n, iconTemplate: r, iconTemplateMobile: i }, labels: a } = e, o = N(a.cancel), s = N(a.ok), c = t ? Te(a.switchToClockLabel, i || de) : Te(a.switchToKeyboardLabel, r || ue), l = n ? `<div class="tp-ui-keyboard-icon-wrapper ${t}" data-md3-ripple data-view="desktop">${c}</div>` : "", u = ye(e, t);
|
|
783
817
|
return `<div class="tp-ui-footer ${t}" ${t ? "data-view=\"mobile\"" : ""}>${l}<div class="tp-ui-wrapper-btn ${t}">${u}<div class="tp-ui-cancel-btn ${t}" data-md3-ripple tabindex="0" role="button" aria-label="${o}">${o}</div><div class="tp-ui-ok-btn ${t}" data-md3-ripple tabindex="0" role="button" aria-label="${s}">${s}</div></div></div>`;
|
|
784
|
-
},
|
|
818
|
+
}, De = (e, t) => {
|
|
785
819
|
let { ui: { mode: n, animation: r, theme: i, mobile: a }, clock: { incrementMinutes: o, showSeconds: s } } = e, c = a ? "mobile" : "", l = n === "compact-wheel" && E.has("wheel"), u = (n === "wheel" || l) && E.has("wheel"), d = !!e.range?.enabled && E.has("range"), f = !!e.timezone?.enabled && E.has("timezone"), p = {
|
|
786
820
|
mobileClass: c,
|
|
787
821
|
clockType: e.clock.type || "12h",
|
|
@@ -789,40 +823,17 @@ var p = class {
|
|
|
789
823
|
isWheelMode: u,
|
|
790
824
|
isCompactWheel: l,
|
|
791
825
|
isRangeMode: d
|
|
792
|
-
}, m =
|
|
826
|
+
}, m = ve(e), h = _e(e, c, t), g = l ? "" : we(e, p), _ = be(p, o ?? 1, e), v = l && e.wheel?.hideFooter === !0 ? "" : Ee(e, c), y;
|
|
793
827
|
y = l ? " tp-ui-compact-wheel-mode" : u ? " tp-ui-wheel-mode" : "";
|
|
794
|
-
let b =
|
|
795
|
-
return `<div class="tp-ui-modal normalize ${c}${d ? " tp-ui-range-mode" : ""}${f ? " tp-ui-tz-mode" : ""}${y}${s ? " tp-ui-has-seconds" : ""}" data-theme="${
|
|
796
|
-
};
|
|
797
|
-
function O(e) {
|
|
798
|
-
return e.clock.type === "24h" ? "24h" : "12h";
|
|
799
|
-
}
|
|
800
|
-
function k(e) {
|
|
801
|
-
return {
|
|
802
|
-
clockType: O(e),
|
|
803
|
-
showSeconds: !!e.clock.showSeconds
|
|
804
|
-
};
|
|
805
|
-
}
|
|
806
|
-
function De(e) {
|
|
807
|
-
let t = e.ui.mode;
|
|
808
|
-
return t === "wheel" || t === "compact-wheel";
|
|
809
|
-
}
|
|
810
|
-
function Oe(e) {
|
|
811
|
-
return e.ui.mode === "compact-wheel";
|
|
812
|
-
}
|
|
813
|
-
function A(e) {
|
|
814
|
-
return Oe(e) && !!e.wheel?.placement;
|
|
815
|
-
}
|
|
816
|
-
function j(e) {
|
|
817
|
-
return !!e.ui.inline?.enabled;
|
|
818
|
-
}
|
|
819
|
-
var ke = (e) => !e || !t() ? null : typeof e == "string" ? document.querySelector(e) : e, Ae = (e) => e ? e.container ? ke(e.container) : !e.containerId || !t() ? null : document.getElementById(e.containerId) : null, je = "--tp-scrollbar-gap", Me = ["auto", "scroll"], Ne = /^tp-ui-[\w-]+$/, M = 0, Pe = [], N = "";
|
|
828
|
+
let b = N(t), x = l ? `aria-label="${N(e.labels.time)}"` : `aria-labelledby="tp-ui-label-${b}"`, S = M(e) ? `role="group" ${x}` : `role="dialog" aria-modal="true" aria-labelledby="tp-ui-label-${b}"`;
|
|
829
|
+
return `<div class="tp-ui-modal normalize ${c}${d ? " tp-ui-range-mode" : ""}${f ? " tp-ui-tz-mode" : ""}${y}${s ? " tp-ui-has-seconds" : ""}" data-theme="${N(i)}" ${S} data-owner-id="${b}"${r ? "" : " style=\"transition:none\""}><div class="tp-ui-wrapper ${c}" tabindex="0">${m}${g}${h}${_}${v}</div><div class="timepicker-announcer sr-only" role="status" aria-live="polite" aria-atomic="true"></div></div>`;
|
|
830
|
+
}, Oe = (e) => !e || !t() ? null : typeof e == "string" ? document.querySelector(e) : e, ke = (e) => e ? e.container ? Oe(e.container) : !e.containerId || !t() ? null : document.getElementById(e.containerId) : null, Ae = "--tp-scrollbar-gap", je = ["auto", "scroll"], Me = /^tp-ui-[\w-]+$/, P = 0, Ne = [], Pe = "";
|
|
820
831
|
function Fe(e) {
|
|
821
|
-
return
|
|
832
|
+
return je.includes(window.getComputedStyle(e).overflowY);
|
|
822
833
|
}
|
|
823
834
|
function Ie(e) {
|
|
824
835
|
let { style: t } = e, n = e.clientWidth, r = parseFloat(window.getComputedStyle(e).paddingRight) || 0;
|
|
825
|
-
|
|
836
|
+
Ne.push({
|
|
826
837
|
element: e,
|
|
827
838
|
overflowY: t.overflowY,
|
|
828
839
|
paddingRight: t.paddingRight
|
|
@@ -831,19 +842,19 @@ function Ie(e) {
|
|
|
831
842
|
return i > 0 && (t.paddingRight = `${r + i}px`), i;
|
|
832
843
|
}
|
|
833
844
|
function Le() {
|
|
834
|
-
if (
|
|
845
|
+
if (P === 0) {
|
|
835
846
|
let { body: e, documentElement: t } = document, n = Fe(e) ? Ie(e) : 0, r = Ie(t);
|
|
836
|
-
|
|
847
|
+
Pe = t.style.getPropertyValue(Ae), t.style.setProperty(Ae, `${Math.max(n, r)}px`);
|
|
837
848
|
}
|
|
838
|
-
|
|
849
|
+
P += 1;
|
|
839
850
|
}
|
|
840
851
|
function Re() {
|
|
841
|
-
if (
|
|
842
|
-
|
|
852
|
+
if (P !== 0 && (--P, P === 0)) {
|
|
853
|
+
Ne.forEach(({ element: e, overflowY: t, paddingRight: n }) => {
|
|
843
854
|
e.style.overflowY = t, e.style.paddingRight = n;
|
|
844
855
|
});
|
|
845
856
|
let e = document.documentElement;
|
|
846
|
-
|
|
857
|
+
Pe ? e.style.setProperty(Ae, Pe) : e.style.removeProperty(Ae), Ne = [], Pe = "";
|
|
847
858
|
}
|
|
848
859
|
}
|
|
849
860
|
var ze = class {
|
|
@@ -860,14 +871,14 @@ var ze = class {
|
|
|
860
871
|
setModalTemplate() {
|
|
861
872
|
if (t() === !1) return;
|
|
862
873
|
this.clearExistingModal();
|
|
863
|
-
let e =
|
|
874
|
+
let e = De(this.core.options, this.core.instanceId);
|
|
864
875
|
if (this.core.options.ui.inline?.enabled) {
|
|
865
|
-
let t =
|
|
876
|
+
let t = ke(this.core.options.ui.inline);
|
|
866
877
|
if (!t) return;
|
|
867
878
|
t.innerHTML = "", t.insertAdjacentHTML("beforeend", e);
|
|
868
879
|
let n = t.querySelector(".tp-ui-modal");
|
|
869
880
|
if (n) {
|
|
870
|
-
n.classList.add("tp-ui--inline");
|
|
881
|
+
n.classList.add("tp-ui--inline"), M(this.core.options) && n.classList.add("tp-ui--embedded");
|
|
871
882
|
let { showButtons: e } = this.core.options.ui.inline;
|
|
872
883
|
(e === !1 || e === void 0) && (n.querySelectorAll(".tp-ui-wrapper-btn, .tp-ui-wrapper-btn.mobile").forEach((e) => e.style.display = "none"), n.querySelectorAll(".tp-ui-footer").forEach((e) => {
|
|
873
884
|
e.querySelector(".tp-ui-keyboard-icon-wrapper") || (e.style.display = "none");
|
|
@@ -876,7 +887,7 @@ var ze = class {
|
|
|
876
887
|
return;
|
|
877
888
|
}
|
|
878
889
|
let { appendTo: n } = this.core.options.ui;
|
|
879
|
-
(n ?
|
|
890
|
+
(n ? Oe(n) : document.body)?.insertAdjacentHTML("beforeend", e);
|
|
880
891
|
}
|
|
881
892
|
lockScroll() {
|
|
882
893
|
t() !== !1 && (this.core.options.ui.inline?.enabled || A(this.core.options) || this.core.options.ui.enableScrollbar || this.scrollLocked || (this.scrollLocked = !0, Le()));
|
|
@@ -898,7 +909,7 @@ var ze = class {
|
|
|
898
909
|
}
|
|
899
910
|
setInitialFocus() {
|
|
900
911
|
let { options: e } = this.core;
|
|
901
|
-
!e.behavior.focusTrap || typeof requestAnimationFrame > "u" || !e.ui.backdrop && !e.ui.inline?.enabled && !A(e) || requestAnimationFrame(() => this.focusWrapperUnlessInside());
|
|
912
|
+
!e.behavior.focusTrap || typeof requestAnimationFrame > "u" || M(e) || !e.ui.backdrop && !e.ui.inline?.enabled && !A(e) || requestAnimationFrame(() => this.focusWrapperUnlessInside());
|
|
902
913
|
}
|
|
903
914
|
focusWrapperUnlessInside() {
|
|
904
915
|
let e = this.core.getWrapper();
|
|
@@ -906,7 +917,7 @@ var ze = class {
|
|
|
906
917
|
}
|
|
907
918
|
getFocusedControlSelector() {
|
|
908
919
|
let e = this.core.getModalElement(), t = e?.ownerDocument.activeElement;
|
|
909
|
-
return !e || !t || !e.contains(t) ? null : Array.from(t.classList).filter((e) =>
|
|
920
|
+
return !e || !t || !e.contains(t) ? null : Array.from(t.classList).filter((e) => Me.test(e)).map((e) => `.${e}`).join("");
|
|
910
921
|
}
|
|
911
922
|
restoreFocus(e) {
|
|
912
923
|
e && this.core.getWrapper()?.querySelector(e)?.focus(), this.focusWrapperUnlessInside();
|
|
@@ -918,21 +929,21 @@ var ze = class {
|
|
|
918
929
|
destroy() {
|
|
919
930
|
this.unlockScroll(), this.clearExistingModal();
|
|
920
931
|
}
|
|
921
|
-
}, Be = /^(0?[1-9]|1[0-2]):([0-5]?\d)(?::([0-5]?\d))?\s*(AM|PM)$/i, Ve = /^([01]?\d|2[0-3]):([0-5]?\d)(?::([0-5]?\d))?$/, He = /^\s*\d{1,2}:\d{1,2}:\d{1,2}/,
|
|
922
|
-
function
|
|
932
|
+
}, Be = /^(0?[1-9]|1[0-2]):([0-5]?\d)(?::([0-5]?\d))?\s*(AM|PM)$/i, Ve = /^([01]?\d|2[0-3]):([0-5]?\d)(?::([0-5]?\d))?$/, He = /^\s*\d{1,2}:\d{1,2}:\d{1,2}/, F = (e) => String(e).padStart(2, "0");
|
|
933
|
+
function I(e, t) {
|
|
923
934
|
let n = e.trim().match(t.clockType === "12h" ? Be : Ve);
|
|
924
935
|
if (!n) return null;
|
|
925
936
|
let r = {
|
|
926
|
-
hour:
|
|
927
|
-
minutes:
|
|
937
|
+
hour: F(n[1]),
|
|
938
|
+
minutes: F(n[2])
|
|
928
939
|
};
|
|
929
|
-
return t.showSeconds && (r.seconds =
|
|
940
|
+
return t.showSeconds && (r.seconds = F(n[3] ?? "0")), t.clockType === "12h" && (r.type = n[4].toUpperCase()), r;
|
|
930
941
|
}
|
|
931
942
|
function Ue(e) {
|
|
932
943
|
return He.test(e);
|
|
933
944
|
}
|
|
934
|
-
function
|
|
935
|
-
let n = `${
|
|
945
|
+
function L(e, t) {
|
|
946
|
+
let n = `${F(e.hour)}:${F(e.minutes)}`, r = t.showSeconds ? `${n}:${F(e.seconds ?? "0")}` : n;
|
|
936
947
|
return t.clockType === "12h" && e.type ? `${r} ${e.type}` : r;
|
|
937
948
|
}
|
|
938
949
|
var We = (e, t, n) => {
|
|
@@ -942,17 +953,17 @@ var We = (e, t, n) => {
|
|
|
942
953
|
};
|
|
943
954
|
function Ge(e, t, n) {
|
|
944
955
|
return n === "24h" ? {
|
|
945
|
-
hour:
|
|
956
|
+
hour: F(e),
|
|
946
957
|
...t,
|
|
947
958
|
type: void 0
|
|
948
959
|
} : {
|
|
949
|
-
hour:
|
|
960
|
+
hour: F(e % 12 || 12),
|
|
950
961
|
...t,
|
|
951
962
|
type: e >= 12 ? "PM" : "AM"
|
|
952
963
|
};
|
|
953
964
|
}
|
|
954
965
|
function Ke(e, t, n) {
|
|
955
|
-
let r = We(parseInt(e.hour, 10), e.type, t), i = n.showSeconds ?
|
|
966
|
+
let r = We(parseInt(e.hour, 10), e.type, t), i = n.showSeconds ? F(e.seconds ?? "0") : void 0;
|
|
956
967
|
return Ge(r, {
|
|
957
968
|
minutes: e.minutes,
|
|
958
969
|
seconds: i
|
|
@@ -962,17 +973,17 @@ function qe(e, t) {
|
|
|
962
973
|
let n = parseInt(e.hour, 10);
|
|
963
974
|
return Number.isNaN(n) ? 0 : We(n, e.type, t) * 3600;
|
|
964
975
|
}
|
|
965
|
-
function
|
|
976
|
+
function Je(e, t) {
|
|
966
977
|
let n = parseInt(e.hour, 10), r = parseInt(e.minutes, 10), i = parseInt(e.seconds ?? "0", 10);
|
|
967
978
|
return Number.isNaN(n) || Number.isNaN(r) || Number.isNaN(i) ? 0 : We(n, e.type, t) * 3600 + r * 60 + i;
|
|
968
979
|
}
|
|
969
|
-
function
|
|
980
|
+
function Ye(e) {
|
|
970
981
|
return {
|
|
971
982
|
degreesHours: Number(e.hour) * 30,
|
|
972
983
|
degreesMinutes: Number(e.minutes) * 6
|
|
973
984
|
};
|
|
974
985
|
}
|
|
975
|
-
var
|
|
986
|
+
var Xe = 8, Ze = 11, Qe = ({ hour: e, minutes: t, seconds: n, type: r }) => n === void 0 ? {
|
|
976
987
|
hour: e,
|
|
977
988
|
minutes: t,
|
|
978
989
|
type: r
|
|
@@ -981,14 +992,14 @@ var Ye = 8, Xe = 11, Ze = ({ hour: e, minutes: t, seconds: n, type: r }) => n ==
|
|
|
981
992
|
minutes: t,
|
|
982
993
|
seconds: n,
|
|
983
994
|
type: r
|
|
984
|
-
},
|
|
985
|
-
let r =
|
|
986
|
-
return
|
|
995
|
+
}, $e = (e, t, n) => {
|
|
996
|
+
let r = F(e.getMinutes()), i = n ? F(e.getSeconds()) : void 0;
|
|
997
|
+
return Qe(Ge(e.getHours(), {
|
|
987
998
|
minutes: r,
|
|
988
999
|
seconds: i
|
|
989
1000
|
}, t === "24h" ? "24h" : "12h"));
|
|
990
1001
|
}, R = (e, t, r, i, a = !1) => {
|
|
991
|
-
let o =
|
|
1002
|
+
let o = Qe({
|
|
992
1003
|
hour: "12",
|
|
993
1004
|
minutes: "00",
|
|
994
1005
|
seconds: a ? "00" : void 0,
|
|
@@ -997,16 +1008,16 @@ var Ye = 8, Xe = 11, Ze = ({ hour: e, minutes: t, seconds: n, type: r }) => n ==
|
|
|
997
1008
|
if (!e) return o;
|
|
998
1009
|
let s = e.value.trim();
|
|
999
1010
|
if (!r && !s) return o;
|
|
1000
|
-
if (typeof r == "boolean" && r) return
|
|
1011
|
+
if (typeof r == "boolean" && r) return $e(/* @__PURE__ */ new Date(), t, a);
|
|
1001
1012
|
if (typeof r == "object") {
|
|
1002
1013
|
let { time: e, preventClockType: o } = r, s = new Date(e ?? /* @__PURE__ */ new Date());
|
|
1003
|
-
return o && i ?
|
|
1014
|
+
return o && i ? $e(s, n(), a) : $e(s, t, a);
|
|
1004
1015
|
}
|
|
1005
|
-
let c =
|
|
1016
|
+
let c = I(s, {
|
|
1006
1017
|
clockType: t === "24h" ? "24h" : "12h",
|
|
1007
1018
|
showSeconds: a
|
|
1008
1019
|
});
|
|
1009
|
-
if (c) return
|
|
1020
|
+
if (c) return Qe(c);
|
|
1010
1021
|
let [l, u] = s.split(" "), [d = "", f = "", p = ""] = l.split(":"), m = d.replace(/\D/g, ""), h = f.replace(/\D/g, ""), g = a ? p.replace(/\D/g, "") : "", _ = {
|
|
1011
1022
|
hour: m.padStart(2, "0"),
|
|
1012
1023
|
minutes: h.padStart(2, "0"),
|
|
@@ -1024,7 +1035,7 @@ var Ye = 8, Xe = 11, Ze = ({ hour: e, minutes: t, seconds: n, type: r }) => n ==
|
|
|
1024
1035
|
error: "Input contains invalid letters."
|
|
1025
1036
|
};
|
|
1026
1037
|
if (s.includes(" ")) {
|
|
1027
|
-
let e = a ?
|
|
1038
|
+
let e = a ? Ze : Xe;
|
|
1028
1039
|
if (!u || s.length > e || u !== "AM" && u !== "PM") return {
|
|
1029
1040
|
..._,
|
|
1030
1041
|
error: "Invalid AM/PM format or length.",
|
|
@@ -1032,25 +1043,25 @@ var Ye = 8, Xe = 11, Ze = ({ hour: e, minutes: t, seconds: n, type: r }) => n ==
|
|
|
1032
1043
|
currentType: u
|
|
1033
1044
|
};
|
|
1034
1045
|
}
|
|
1035
|
-
let v = Number(m), y = Number(h), b = Number(g),
|
|
1046
|
+
let v = Number(m), y = Number(h), b = Number(g), x = y >= 0 && y <= 59 && b >= 0 && b <= 59, S = a ? { currentSec: b } : {};
|
|
1036
1047
|
if (t === "12h") {
|
|
1037
|
-
if (v < 1 || v > 12 || !
|
|
1048
|
+
if (v < 1 || v > 12 || !x || u !== "AM" && u !== "PM") return {
|
|
1038
1049
|
..._,
|
|
1039
1050
|
error: "Invalid 12h time.",
|
|
1040
1051
|
currentHour: v,
|
|
1041
1052
|
currentMin: y,
|
|
1042
|
-
...
|
|
1053
|
+
...S,
|
|
1043
1054
|
currentType: u
|
|
1044
1055
|
};
|
|
1045
|
-
} else if (v < 0 || v > 23 || !
|
|
1056
|
+
} else if (v < 0 || v > 23 || !x) return {
|
|
1046
1057
|
..._,
|
|
1047
1058
|
error: "Invalid 24h time.",
|
|
1048
1059
|
currentHour: v,
|
|
1049
1060
|
currentMin: y,
|
|
1050
|
-
...
|
|
1061
|
+
...S
|
|
1051
1062
|
};
|
|
1052
1063
|
return _;
|
|
1053
|
-
},
|
|
1064
|
+
}, et = (e, t, n) => {
|
|
1054
1065
|
let r = Number(e);
|
|
1055
1066
|
if (Number.isNaN(r)) return !1;
|
|
1056
1067
|
switch (t) {
|
|
@@ -1058,87 +1069,87 @@ var Ye = 8, Xe = 11, Ze = ({ hour: e, minutes: t, seconds: n, type: r }) => n ==
|
|
|
1058
1069
|
case "minutes": return r >= 0 && r <= 59;
|
|
1059
1070
|
default: return;
|
|
1060
1071
|
}
|
|
1061
|
-
},
|
|
1062
|
-
function
|
|
1063
|
-
let n = `${t}|${e}`, r =
|
|
1072
|
+
}, tt = 256, nt = /* @__PURE__ */ new Map(), rt = (e, t) => (nt.size >= tt && nt.clear(), nt.set(e, t), t);
|
|
1073
|
+
function it(e, t) {
|
|
1074
|
+
let n = `${t}|${e}`, r = nt.get(n);
|
|
1064
1075
|
if (r !== void 0) return r;
|
|
1065
1076
|
let i = e.split("-").map((e) => e.trim()), a = null;
|
|
1066
1077
|
if (i.length === 2) {
|
|
1067
|
-
let n =
|
|
1078
|
+
let n = I(i[0], {
|
|
1068
1079
|
clockType: t,
|
|
1069
1080
|
showSeconds: !0
|
|
1070
|
-
}), r =
|
|
1081
|
+
}), r = I(i[1], {
|
|
1071
1082
|
clockType: t,
|
|
1072
1083
|
showSeconds: !0
|
|
1073
1084
|
});
|
|
1074
1085
|
if (n && r) {
|
|
1075
1086
|
let o = Ue(i[1]) ? 0 : 59;
|
|
1076
1087
|
a = {
|
|
1077
|
-
start:
|
|
1078
|
-
end:
|
|
1088
|
+
start: Je(n, t),
|
|
1089
|
+
end: Je(r, t) + o,
|
|
1079
1090
|
source: e
|
|
1080
1091
|
};
|
|
1081
1092
|
}
|
|
1082
1093
|
}
|
|
1083
|
-
return
|
|
1094
|
+
return rt(n, a);
|
|
1084
1095
|
}
|
|
1085
|
-
var
|
|
1096
|
+
var at = [], ot = /* @__PURE__ */ new WeakMap(), st = (e, t, n) => {
|
|
1086
1097
|
if (e.clockType !== n || e.sources.length !== t.length) return !1;
|
|
1087
1098
|
for (let n = 0; n < t.length; n++) if (e.sources[n] !== t[n]) return !1;
|
|
1088
1099
|
return !0;
|
|
1089
|
-
},
|
|
1090
|
-
if (!e?.length) return
|
|
1091
|
-
let n =
|
|
1092
|
-
if (n &&
|
|
1093
|
-
let r = e.map((e) =>
|
|
1094
|
-
return
|
|
1100
|
+
}, z = (e, t) => {
|
|
1101
|
+
if (!e?.length) return at;
|
|
1102
|
+
let n = ot.get(e);
|
|
1103
|
+
if (n && st(n, e, t)) return n.ranges;
|
|
1104
|
+
let r = e.map((e) => it(e, t)).filter((e) => e !== null);
|
|
1105
|
+
return ot.set(e, {
|
|
1095
1106
|
clockType: t,
|
|
1096
1107
|
sources: [...e],
|
|
1097
1108
|
ranges: r
|
|
1098
1109
|
}), r;
|
|
1099
|
-
},
|
|
1110
|
+
}, ct = (e, t) => {
|
|
1100
1111
|
for (let n = 0; n < e.length; n++) if (t >= e[n].start && t <= e[n].end) return !0;
|
|
1101
1112
|
return !1;
|
|
1102
1113
|
};
|
|
1103
|
-
function
|
|
1104
|
-
let n =
|
|
1114
|
+
function lt(e, t) {
|
|
1115
|
+
let n = z(e, t);
|
|
1105
1116
|
for (let e = 0; e < n.length; e++) for (let t = e + 1; t < n.length; t++) if (n[e].start <= n[t].end && n[t].start <= n[e].end) return [n[e].source, n[t].source];
|
|
1106
1117
|
return null;
|
|
1107
1118
|
}
|
|
1108
|
-
var
|
|
1119
|
+
var B = (e, t) => {
|
|
1109
1120
|
if (!e || t === void 0) return !1;
|
|
1110
1121
|
let n = Number(t);
|
|
1111
1122
|
for (let t = 0; t < e.length; t++) if (Number(e[t]) === n) return !0;
|
|
1112
1123
|
return !1;
|
|
1113
|
-
}, ct = (e, t, n, r) => {
|
|
1114
|
-
if (!r) return
|
|
1115
|
-
for (let r = 0; r < 60; r++) if (!
|
|
1124
|
+
}, ut = (e, t, n) => ct(t, n) || e.predicate !== void 0 && e.predicate(n), dt = (e, t, n, r) => {
|
|
1125
|
+
if (!r) return ut(e, t, n);
|
|
1126
|
+
for (let r = 0; r < 60; r++) if (!B(e.seconds, r) && !ut(e, t, n + r)) return !1;
|
|
1116
1127
|
return !0;
|
|
1117
1128
|
};
|
|
1118
|
-
function
|
|
1119
|
-
return e ?
|
|
1129
|
+
function ft(e, t) {
|
|
1130
|
+
return e ? B(e.hours, t.hour) || B(e.minutes, t.minutes) || B(e.seconds, t.seconds) ? !0 : !e.intervals?.length && !e.predicate ? !1 : ut(e, z(e.intervals, e.clockType), Je(t, e.clockType)) : !1;
|
|
1120
1131
|
}
|
|
1121
|
-
function
|
|
1132
|
+
function pt(e, t, n) {
|
|
1122
1133
|
if (!e) return !1;
|
|
1123
|
-
if (
|
|
1124
|
-
let r =
|
|
1125
|
-
return
|
|
1134
|
+
if (B(e.hours, t.hour) || B(e.minutes, t.minutes)) return !0;
|
|
1135
|
+
let r = Je(t, e.clockType), i = r - r % 60;
|
|
1136
|
+
return dt(e, z(e.intervals, e.clockType), i, n);
|
|
1126
1137
|
}
|
|
1127
|
-
function
|
|
1138
|
+
function mt(e, t, n) {
|
|
1128
1139
|
if (!e) return !1;
|
|
1129
|
-
if (
|
|
1130
|
-
if (!e.intervals?.length) return !1;
|
|
1131
|
-
let r =
|
|
1140
|
+
if (B(e.hours, t.hour)) return !0;
|
|
1141
|
+
if (!e.intervals?.length && !e.predicate) return !1;
|
|
1142
|
+
let r = z(e.intervals, e.clockType), i = qe(t, e.clockType);
|
|
1132
1143
|
for (let t = 0; t < 60; t++) {
|
|
1133
1144
|
let a = i + t * 60;
|
|
1134
|
-
if (!
|
|
1145
|
+
if (!B(e.minutes, t) && !dt(e, r, a, n)) return !1;
|
|
1135
1146
|
}
|
|
1136
1147
|
return !0;
|
|
1137
1148
|
}
|
|
1138
|
-
function
|
|
1139
|
-
return t === "hour" ?
|
|
1149
|
+
function ht(e, t, n, r) {
|
|
1150
|
+
return t === "hour" ? mt(e, n, r) : t === "minutes" ? pt(e, n, r) : ft(e, n);
|
|
1140
1151
|
}
|
|
1141
|
-
function
|
|
1152
|
+
function gt(e, t, n, r) {
|
|
1142
1153
|
let i = n - t + 1;
|
|
1143
1154
|
for (let n = 0; n <= i / 2; n++) for (let a of [e + n, e - n]) {
|
|
1144
1155
|
let e = t + ((a - t) % i + i) % i;
|
|
@@ -1146,7 +1157,7 @@ function pt(e, t, n, r) {
|
|
|
1146
1157
|
}
|
|
1147
1158
|
return e;
|
|
1148
1159
|
}
|
|
1149
|
-
var
|
|
1160
|
+
var _t = (e, t) => e % 12 % t == 0, V = {
|
|
1150
1161
|
hour: {
|
|
1151
1162
|
input: "getHour",
|
|
1152
1163
|
event: "select:hour",
|
|
@@ -1162,21 +1173,21 @@ var mt = (e, t) => e % 12 % t == 0, H = {
|
|
|
1162
1173
|
event: "select:second",
|
|
1163
1174
|
announce: "second"
|
|
1164
1175
|
}
|
|
1165
|
-
},
|
|
1176
|
+
}, H = [
|
|
1166
1177
|
"hour",
|
|
1167
1178
|
"minutes",
|
|
1168
1179
|
"seconds"
|
|
1169
|
-
],
|
|
1170
|
-
e.emit(
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
},
|
|
1174
|
-
let n =
|
|
1180
|
+
], U = (e, t) => e[V[t].input](), vt = (e, t, n) => {
|
|
1181
|
+
e.emit(V[t].event, { [t]: n });
|
|
1182
|
+
}, yt = (e) => H.find((t) => U(e, t)?.classList.contains("active")) ?? "hour", bt = (e, t) => {
|
|
1183
|
+
H.forEach((n) => g(U(e, n), "active", n === t)), S(e.getModalElement());
|
|
1184
|
+
}, xt = (e, t) => {
|
|
1185
|
+
let n = U(e, t);
|
|
1175
1186
|
if (!n) return;
|
|
1176
|
-
let r = e.options.labels[
|
|
1187
|
+
let r = e.options.labels[V[t].announce];
|
|
1177
1188
|
h(e.getModalElement(), `${r}: ${n.value}`);
|
|
1178
1189
|
};
|
|
1179
|
-
function
|
|
1190
|
+
function W(e) {
|
|
1180
1191
|
let t = {
|
|
1181
1192
|
hour: e.getHour()?.value,
|
|
1182
1193
|
minutes: e.getMinutes()?.value,
|
|
@@ -1184,22 +1195,22 @@ function K(e) {
|
|
|
1184
1195
|
};
|
|
1185
1196
|
return e.options.clock.showSeconds && (t.seconds = e.getSeconds()?.value ?? "00"), t;
|
|
1186
1197
|
}
|
|
1187
|
-
var
|
|
1198
|
+
var St = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0, 23] : [0, 59], Ct = (e, t, n) => {
|
|
1188
1199
|
let r = e.disabledTime?.value;
|
|
1189
|
-
return
|
|
1200
|
+
return ht(r ? {
|
|
1190
1201
|
...r,
|
|
1191
|
-
clockType:
|
|
1202
|
+
clockType: D(e.options)
|
|
1192
1203
|
} : null, t, n, !!e.options.clock.showSeconds);
|
|
1193
|
-
},
|
|
1194
|
-
let n =
|
|
1195
|
-
return (r) =>
|
|
1204
|
+
}, wt = (e, t) => {
|
|
1205
|
+
let n = W(e);
|
|
1206
|
+
return (r) => Ct(e, t, {
|
|
1196
1207
|
...n,
|
|
1197
|
-
[t]:
|
|
1208
|
+
[t]: F(r)
|
|
1198
1209
|
});
|
|
1199
|
-
},
|
|
1200
|
-
let t =
|
|
1201
|
-
return !!t.hour && !!t.minutes &&
|
|
1202
|
-
},
|
|
1210
|
+
}, Tt = (e) => {
|
|
1211
|
+
let t = W(e), n = e.options.clock.showSeconds ? "seconds" : "minutes";
|
|
1212
|
+
return !!t.hour && !!t.minutes && Ct(e, n, t);
|
|
1213
|
+
}, Et = " - ", Dt = 2, Ot = (e) => e !== null, kt = class {
|
|
1203
1214
|
core;
|
|
1204
1215
|
emitter;
|
|
1205
1216
|
constructor(e, t) {
|
|
@@ -1220,28 +1231,28 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1220
1231
|
if (!this.isCurrentTimeEnabled("updateInput")) return;
|
|
1221
1232
|
let e = this.core.getInput();
|
|
1222
1233
|
if (!e) return;
|
|
1223
|
-
let { clock: t } = this.core.options, n =
|
|
1224
|
-
e.value =
|
|
1234
|
+
let { clock: t } = this.core.options, n = O(this.core.options);
|
|
1235
|
+
e.value = L(R(e, t.type, t.currentTime, void 0, n.showSeconds), n);
|
|
1225
1236
|
}
|
|
1226
1237
|
syncInputFormat(e) {
|
|
1227
|
-
let t =
|
|
1238
|
+
let t = O(e), n = O(this.core.options);
|
|
1228
1239
|
if (t.clockType === n.clockType && t.showSeconds === n.showSeconds) return;
|
|
1229
1240
|
let r = this.core.getInput();
|
|
1230
1241
|
if (!r) return;
|
|
1231
|
-
let i = r.value.split(
|
|
1232
|
-
i.length >
|
|
1242
|
+
let i = r.value.split(Et).map((e) => I(e, t));
|
|
1243
|
+
i.length > Dt || !i.every(Ot) || (r.value = i.map((e) => L(Ke(e, t.clockType, n), n)).join(Et));
|
|
1233
1244
|
}
|
|
1234
1245
|
getInputValueOnOpenAndSet(e = !0) {
|
|
1235
1246
|
let t = this.core.getInput();
|
|
1236
1247
|
if (!t) return;
|
|
1237
|
-
let { clock: n } = this.core.options, r =
|
|
1238
|
-
|
|
1248
|
+
let { clock: n } = this.core.options, r = O(this.core.options), i = t.value.trim() ? void 0 : n.currentTime, a = R(t, n.type, i, void 0, r.showSeconds);
|
|
1249
|
+
H.forEach((e) => {
|
|
1239
1250
|
let t = a[e];
|
|
1240
|
-
t !== void 0 &&
|
|
1251
|
+
t !== void 0 && C(U(this.core, e), t);
|
|
1241
1252
|
}), r.clockType === "12h" && this.activatePeriod(a.type ?? "AM"), e && this.emitter.emit("open", {
|
|
1242
1253
|
...a,
|
|
1243
1254
|
type: this.core.getActiveType(),
|
|
1244
|
-
...
|
|
1255
|
+
...Ye(a)
|
|
1245
1256
|
});
|
|
1246
1257
|
}
|
|
1247
1258
|
activatePeriod(e) {
|
|
@@ -1250,7 +1261,7 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1250
1261
|
b(n("AM"), n("PM"), e);
|
|
1251
1262
|
}
|
|
1252
1263
|
destroy() {}
|
|
1253
|
-
},
|
|
1264
|
+
}, At = "(orientation: landscape) and (max-height: 480px)", jt = "tp-ui-view-switching", Mt = [
|
|
1254
1265
|
"select-time",
|
|
1255
1266
|
"keyboard-icon-wrapper",
|
|
1256
1267
|
"hour",
|
|
@@ -1265,7 +1276,7 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1265
1276
|
"pm",
|
|
1266
1277
|
"input-wrapper",
|
|
1267
1278
|
"input-ripple-wrapper"
|
|
1268
|
-
].map((e) => `.tp-ui-${e}`).join(","),
|
|
1279
|
+
].map((e) => `.tp-ui-${e}`).join(","), Nt = [
|
|
1269
1280
|
[
|
|
1270
1281
|
".tp-ui-hour",
|
|
1271
1282
|
"hourLabel",
|
|
@@ -1281,15 +1292,15 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1281
1292
|
"second",
|
|
1282
1293
|
"second"
|
|
1283
1294
|
]
|
|
1284
|
-
],
|
|
1295
|
+
], Pt = (e) => {
|
|
1285
1296
|
if (typeof requestAnimationFrame > "u") {
|
|
1286
1297
|
e();
|
|
1287
1298
|
return;
|
|
1288
1299
|
}
|
|
1289
1300
|
requestAnimationFrame(() => e());
|
|
1290
|
-
},
|
|
1301
|
+
}, G = (e) => {
|
|
1291
1302
|
e?.classList.remove("mobile"), e?.classList.add("expanded");
|
|
1292
|
-
},
|
|
1303
|
+
}, Ft = class {
|
|
1293
1304
|
core;
|
|
1294
1305
|
emitter;
|
|
1295
1306
|
animatingModal = null;
|
|
@@ -1321,20 +1332,20 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1321
1332
|
};
|
|
1322
1333
|
this.animatingModal = e;
|
|
1323
1334
|
let r = t.classList.contains("expanded");
|
|
1324
|
-
this.isLandscape() ? this.switchLandscape(n, r) : r ?
|
|
1335
|
+
this.isLandscape() ? this.switchLandscape(n, r) : r ? Pt(() => this.collapsePortrait(n)) : this.expandPortrait(n);
|
|
1325
1336
|
}
|
|
1326
1337
|
switchLandscape(e, t) {
|
|
1327
1338
|
let { modal: n, wrapper: r, clockWrapper: i, clockFace: a } = e, o = this.core.options.ui.animation && !T();
|
|
1328
|
-
if (o && n.classList.add(
|
|
1339
|
+
if (o && n.classList.add(jt), t ? (a?.classList.remove("scale-in"), i?.classList.add("mobile"), this.finishCollapse(e)) : (this.showClockView(e), G(r), G(i), a?.classList.add("scale-in")), !o) {
|
|
1329
1340
|
this.release(e);
|
|
1330
1341
|
return;
|
|
1331
1342
|
}
|
|
1332
1343
|
setTimeout(() => {
|
|
1333
|
-
n.classList.remove(
|
|
1344
|
+
n.classList.remove(jt), this.release(e);
|
|
1334
1345
|
}, m.WRAPPER_TRANSITION);
|
|
1335
1346
|
}
|
|
1336
1347
|
collapsePortrait(e) {
|
|
1337
|
-
e.clockFace?.classList.toggle("scale-in", !e.isOriginallyMobile), e.clockWrapper?.classList.remove("expanded"), e.isOriginallyMobile && e.clockWrapper?.classList.add("mobile"),
|
|
1348
|
+
e.clockFace?.classList.toggle("scale-in", !e.isOriginallyMobile), e.clockWrapper?.classList.remove("expanded"), e.isOriginallyMobile && e.clockWrapper?.classList.add("mobile"), Pt(() => {
|
|
1338
1349
|
this.finishCollapse(e), setTimeout(() => this.release(e), m.MOBILE_TOGGLE);
|
|
1339
1350
|
});
|
|
1340
1351
|
}
|
|
@@ -1347,29 +1358,29 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1347
1358
|
showClockView(e) {
|
|
1348
1359
|
let { wrapper: t, clockWrapper: n } = e;
|
|
1349
1360
|
this.selectActiveField(), e.allElements.forEach((e) => {
|
|
1350
|
-
e !== t && e !== n &&
|
|
1361
|
+
e !== t && e !== n && G(e);
|
|
1351
1362
|
}), this.switchView(e, !1);
|
|
1352
1363
|
}
|
|
1353
1364
|
expandPortrait(e) {
|
|
1354
1365
|
let { wrapper: t, clockWrapper: n, clockFace: r } = e;
|
|
1355
|
-
this.showClockView(e),
|
|
1356
|
-
|
|
1357
|
-
|
|
1366
|
+
this.showClockView(e), Pt(() => {
|
|
1367
|
+
G(t), Pt(() => {
|
|
1368
|
+
G(n), r?.classList.remove("scale-in"), setTimeout(() => r?.classList.add("scale-in"), m.CLOCK_SCALE_DELAY), setTimeout(() => this.release(e), m.MOBILE_TOGGLE);
|
|
1358
1369
|
});
|
|
1359
1370
|
});
|
|
1360
1371
|
}
|
|
1361
1372
|
selectActiveField() {
|
|
1362
|
-
let e =
|
|
1363
|
-
t &&
|
|
1373
|
+
let e = yt(this.core), t = U(this.core, e);
|
|
1374
|
+
t && vt(this.emitter, e, t.value);
|
|
1364
1375
|
}
|
|
1365
1376
|
switchView(e, t) {
|
|
1366
1377
|
let { modal: n, heading: r } = e, { labels: i, ui: a } = this.core.options, o = !t && !a.editable;
|
|
1367
|
-
n.querySelectorAll(
|
|
1378
|
+
n.querySelectorAll(Mt).forEach((e) => e.classList.toggle("mobile", t)), Nt.forEach(([e, r, a]) => {
|
|
1368
1379
|
let s = n.querySelector(e);
|
|
1369
1380
|
s && (s.toggleAttribute("readonly", o), _(s, "aria-label", i[t ? a : r]));
|
|
1370
|
-
}),
|
|
1381
|
+
}), S(n);
|
|
1371
1382
|
let s = t ? i.mobileTime : i.time;
|
|
1372
|
-
r && s && (r.textContent = s), this.setClockFaceHidden(e.clockFace, t), this.renderSwitchButton(e.switchButton, t);
|
|
1383
|
+
r && s && (r.textContent = s), !r && s && M(this.core.options) && n.setAttribute("aria-label", s), this.setClockFaceHidden(e.clockFace, t), this.renderSwitchButton(e.switchButton, t);
|
|
1373
1384
|
}
|
|
1374
1385
|
renderSwitchButton(e, t) {
|
|
1375
1386
|
if (!e) return;
|
|
@@ -1383,7 +1394,7 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1383
1394
|
e && (e.tabIndex = t ? -1 : 0, _(e, "aria-hidden", t && "true"));
|
|
1384
1395
|
}
|
|
1385
1396
|
isLandscape() {
|
|
1386
|
-
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(
|
|
1397
|
+
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(At).matches;
|
|
1387
1398
|
}
|
|
1388
1399
|
release(e) {
|
|
1389
1400
|
this.animatingModal === e.modal && (this.animatingModal = null);
|
|
@@ -1391,19 +1402,19 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1391
1402
|
destroy() {
|
|
1392
1403
|
this.animatingModal = null;
|
|
1393
1404
|
}
|
|
1394
|
-
},
|
|
1405
|
+
}, It = (e, t) => e ? e.classList.contains(t) : !1, Lt = (e, t) => {
|
|
1395
1406
|
e.forEach((e) => {
|
|
1396
|
-
if (!
|
|
1407
|
+
if (!it(e, t)) throw Error(`Invalid ${t} format: "${e}"`);
|
|
1397
1408
|
});
|
|
1398
|
-
let n =
|
|
1409
|
+
let n = lt(e, t);
|
|
1399
1410
|
if (n) throw Error(`Overlapping intervals: "${n[0]}" and "${n[1]}"`);
|
|
1400
1411
|
return !1;
|
|
1401
|
-
},
|
|
1412
|
+
}, Rt = () => typeof window < "u" && window.crypto && typeof window.crypto.randomUUID == "function" ? window.crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
1402
1413
|
let t = Math.random() * 16 | 0;
|
|
1403
1414
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
1404
|
-
}),
|
|
1415
|
+
}), zt = (e, t) => (e?.forEach((e) => {
|
|
1405
1416
|
if (Number(e) > 59) throw Error(`The disabled ${t} value has to be less than 60`);
|
|
1406
|
-
}), e?.map((e) =>
|
|
1417
|
+
}), e?.map((e) => F(Number(e)))), Bt = (e) => {
|
|
1407
1418
|
if (!e) return;
|
|
1408
1419
|
let { disabledTime: t, type: n } = e.clock;
|
|
1409
1420
|
if (!t || !Object.keys(t).length) return;
|
|
@@ -1411,7 +1422,7 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1411
1422
|
if (o) {
|
|
1412
1423
|
let t = Array.isArray(o) ? o : [o];
|
|
1413
1424
|
if (!n) throw Error("clockType required for interval");
|
|
1414
|
-
return
|
|
1425
|
+
return Lt(t, D(e)), { value: {
|
|
1415
1426
|
isInterval: !0,
|
|
1416
1427
|
clockType: n,
|
|
1417
1428
|
intervals: t
|
|
@@ -1421,36 +1432,76 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1421
1432
|
if (n === "12h" && Number(e) > 12) throw Error("The disabled hours value has to be less than 13");
|
|
1422
1433
|
if (n === "24h" && Number(e) > 23) throw Error("The disabled hours value has to be less than 24");
|
|
1423
1434
|
});
|
|
1424
|
-
let s =
|
|
1435
|
+
let s = zt(i, "minutes"), c = zt(a, "seconds");
|
|
1425
1436
|
return { value: {
|
|
1426
1437
|
hours: r?.map((e) => e === "00" || Number(e) === 0 ? `0${Number(e)}` : `${Number(e)}`),
|
|
1427
1438
|
minutes: s,
|
|
1428
1439
|
seconds: c
|
|
1429
1440
|
} };
|
|
1430
|
-
},
|
|
1441
|
+
}, Vt = (e, t, n, r) => {
|
|
1431
1442
|
if (e) {
|
|
1432
|
-
if (Array.isArray(e)) return !e.map((e) =>
|
|
1443
|
+
if (Array.isArray(e)) return !e.map((e) => et(e, t, n)).some((e) => e === !1);
|
|
1433
1444
|
if (typeof e == "string" || typeof e == "number") {
|
|
1434
|
-
let i =
|
|
1445
|
+
let i = et(e, t, n), a = r?.map(Number).includes(Number(e));
|
|
1435
1446
|
return !(!i || a);
|
|
1436
1447
|
}
|
|
1437
1448
|
}
|
|
1438
|
-
}
|
|
1449
|
+
};
|
|
1450
|
+
function Ht(e) {
|
|
1451
|
+
queueMicrotask(() => {
|
|
1452
|
+
throw e;
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
var Ut = 3600, Wt = 24, Gt = (e) => ({
|
|
1456
|
+
hour: Math.floor(e / Ut) % Wt,
|
|
1457
|
+
minutes: Math.floor(e / 60) % 60,
|
|
1458
|
+
seconds: e % 60
|
|
1459
|
+
}), Kt = (e, t) => {
|
|
1460
|
+
try {
|
|
1461
|
+
return !!e(Gt(t));
|
|
1462
|
+
} catch (e) {
|
|
1463
|
+
return Ht(e), !1;
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
function qt(e) {
|
|
1467
|
+
let t = /* @__PURE__ */ new Map();
|
|
1468
|
+
return Object.assign((n) => {
|
|
1469
|
+
let r = t.get(n);
|
|
1470
|
+
if (r !== void 0) return r;
|
|
1471
|
+
let i = Kt(e, n);
|
|
1472
|
+
return t.set(n, i), i;
|
|
1473
|
+
}, { clear: () => t.clear() });
|
|
1474
|
+
}
|
|
1475
|
+
var Jt = class {
|
|
1439
1476
|
core;
|
|
1440
1477
|
constructor(e) {
|
|
1441
1478
|
this.core = e;
|
|
1442
1479
|
}
|
|
1443
1480
|
getDisableTime() {
|
|
1444
|
-
let e =
|
|
1445
|
-
this.core.
|
|
1481
|
+
let e = Bt(this.core.options) || null, t = this.buildPredicate();
|
|
1482
|
+
if (this.core.setTimePredicate(t), !t) {
|
|
1483
|
+
this.core.setDisabledTime(e);
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
this.core.setDisabledTime({ value: {
|
|
1487
|
+
...e?.value,
|
|
1488
|
+
predicate: t
|
|
1489
|
+
} });
|
|
1490
|
+
}
|
|
1491
|
+
clearPredicateCache() {
|
|
1492
|
+
this.core.timePredicate?.clear();
|
|
1493
|
+
}
|
|
1494
|
+
buildPredicate() {
|
|
1495
|
+
let { isTimeDisabled: e } = this.core.options.clock;
|
|
1496
|
+
return typeof e == "function" ? qt(e) : null;
|
|
1446
1497
|
}
|
|
1447
1498
|
destroy() {}
|
|
1448
|
-
},
|
|
1499
|
+
}, Yt = class {
|
|
1449
1500
|
inputValueHandler;
|
|
1450
1501
|
mobileViewHandler;
|
|
1451
1502
|
disabledTimeHandler;
|
|
1452
1503
|
constructor(e, t) {
|
|
1453
|
-
this.inputValueHandler = new
|
|
1504
|
+
this.inputValueHandler = new kt(e, t), this.mobileViewHandler = new Ft(e, t), this.disabledTimeHandler = new Jt(e);
|
|
1454
1505
|
}
|
|
1455
1506
|
preventClockTypeByCurrentTime() {
|
|
1456
1507
|
this.inputValueHandler.preventClockTypeByCurrentTime();
|
|
@@ -1473,17 +1524,20 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1473
1524
|
getDisableTime() {
|
|
1474
1525
|
this.disabledTimeHandler.getDisableTime();
|
|
1475
1526
|
}
|
|
1527
|
+
clearPredicateCache() {
|
|
1528
|
+
this.disabledTimeHandler.clearPredicateCache();
|
|
1529
|
+
}
|
|
1476
1530
|
destroy() {
|
|
1477
1531
|
this.inputValueHandler.destroy(), this.mobileViewHandler.destroy(), this.disabledTimeHandler.destroy();
|
|
1478
1532
|
}
|
|
1479
|
-
},
|
|
1533
|
+
}, Xt = "tp-ui", Zt = "active", Qt = class {
|
|
1480
1534
|
core;
|
|
1481
1535
|
constructor(e, t) {
|
|
1482
1536
|
this.core = e;
|
|
1483
1537
|
}
|
|
1484
1538
|
setInputClassToInputElement() {
|
|
1485
1539
|
let e = this.core.getInput();
|
|
1486
|
-
e && (
|
|
1540
|
+
e && (It(e, "tp-ui-input") || e.classList.add("tp-ui-input"));
|
|
1487
1541
|
}
|
|
1488
1542
|
setDataOpenToInputIfDoesntExistInWrapper() {
|
|
1489
1543
|
let e = this.core.getOpenElementData(), t = this.core.getInput();
|
|
@@ -1496,20 +1550,19 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1496
1550
|
setTimepickerClassToElement() {
|
|
1497
1551
|
let e = this.core.element;
|
|
1498
1552
|
if (!e) return;
|
|
1499
|
-
e.classList.add(
|
|
1553
|
+
e.classList.add(Xt);
|
|
1500
1554
|
let t = this.core.options.ui.cssClass;
|
|
1501
|
-
t && t !==
|
|
1555
|
+
t && t !== Xt && e.classList.add(t);
|
|
1502
1556
|
}
|
|
1503
1557
|
destroy() {
|
|
1504
1558
|
let e = this.core.getModalElement();
|
|
1505
1559
|
e && e.removeAttribute("data-theme");
|
|
1506
1560
|
}
|
|
1507
|
-
},
|
|
1561
|
+
}, K = class e extends Error {
|
|
1508
1562
|
constructor(t, n) {
|
|
1509
1563
|
super(`[TimepickerUI] ${t}`), this.code = n, this.name = "TimepickerError", Object.setPrototypeOf(this, e.prototype);
|
|
1510
1564
|
}
|
|
1511
|
-
|
|
1512
|
-
}, Wt = { INVALID_PARAMETER: "INVALID_PARAMETER" }, Gt = class {
|
|
1565
|
+
}, q = { INVALID_PARAMETER: "INVALID_PARAMETER" }, $t = class {
|
|
1513
1566
|
core;
|
|
1514
1567
|
emitter;
|
|
1515
1568
|
constructor(e, t) {
|
|
@@ -1570,45 +1623,48 @@ var vt = (e, t) => t === "hour" ? e.options.clock.type === "12h" ? [1, 12] : [0,
|
|
|
1570
1623
|
}
|
|
1571
1624
|
}
|
|
1572
1625
|
checkDisabledValuesOnStart() {
|
|
1626
|
+
let { isTimeDisabled: e } = this.core.options.clock;
|
|
1627
|
+
if (e && typeof e != "function") throw new K("clock.isTimeDisabled must be a function", q.INVALID_PARAMETER);
|
|
1573
1628
|
if (!this.core.options.clock.disabledTime) return;
|
|
1574
|
-
let { disabledTime:
|
|
1575
|
-
if (
|
|
1576
|
-
if (!
|
|
1577
|
-
let
|
|
1629
|
+
let { disabledTime: t, type: n } = this.core.options.clock, r = D(this.core.options);
|
|
1630
|
+
if (t.interval) {
|
|
1631
|
+
if (!n) throw new K("clockType is required when using disabledTime.interval", q.INVALID_PARAMETER);
|
|
1632
|
+
let e = Array.isArray(t.interval) ? t.interval : [t.interval];
|
|
1578
1633
|
try {
|
|
1579
|
-
|
|
1634
|
+
Lt(e, r);
|
|
1580
1635
|
} catch (e) {
|
|
1581
|
-
throw new
|
|
1636
|
+
throw new K(`Invalid disabledTime.interval: ${e.message}`, q.INVALID_PARAMETER);
|
|
1582
1637
|
}
|
|
1583
1638
|
return;
|
|
1584
1639
|
}
|
|
1585
|
-
let { hours:
|
|
1586
|
-
if (!
|
|
1587
|
-
if (!
|
|
1640
|
+
let { hours: i, minutes: a, seconds: o } = t, s = !i || Vt(i, "hour", r), c = !a || Vt(a, "minutes", r), l = !o || Vt(o, "minutes", r);
|
|
1641
|
+
if (!s || !c) throw new K("Invalid hours or minutes in disabledTime option", q.INVALID_PARAMETER);
|
|
1642
|
+
if (!l) throw new K("Invalid seconds in disabledTime option", q.INVALID_PARAMETER);
|
|
1588
1643
|
}
|
|
1589
1644
|
destroy() {
|
|
1590
1645
|
this.removeErrorHandler();
|
|
1591
1646
|
}
|
|
1592
1647
|
};
|
|
1593
|
-
function
|
|
1648
|
+
function en(e, t, n, r) {
|
|
1594
1649
|
e.on(n, r), t.push(() => e.off(n, r));
|
|
1595
1650
|
}
|
|
1596
1651
|
function J(e) {
|
|
1597
1652
|
e.splice(0).forEach((e) => e());
|
|
1598
1653
|
}
|
|
1599
|
-
function
|
|
1654
|
+
function tn(e) {
|
|
1600
1655
|
try {
|
|
1601
1656
|
e.emit("show", {});
|
|
1602
1657
|
} finally {
|
|
1603
1658
|
e.emit("open:request", {});
|
|
1604
1659
|
}
|
|
1605
1660
|
}
|
|
1606
|
-
var
|
|
1661
|
+
var nn = class {
|
|
1607
1662
|
core;
|
|
1608
1663
|
emitter;
|
|
1609
1664
|
cleanupHandlers = [];
|
|
1610
1665
|
persistentCleanups = [];
|
|
1611
1666
|
okBlocked = !1;
|
|
1667
|
+
syncOk = null;
|
|
1612
1668
|
constructor(e, t) {
|
|
1613
1669
|
this.core = e, this.emitter = t;
|
|
1614
1670
|
}
|
|
@@ -1616,7 +1672,7 @@ var Jt = class {
|
|
|
1616
1672
|
let e = this.core.getOpenElement();
|
|
1617
1673
|
if (!e) return;
|
|
1618
1674
|
let t = () => {
|
|
1619
|
-
this.core.isDestroyed ||
|
|
1675
|
+
this.core.isDestroyed || tn(this.emitter);
|
|
1620
1676
|
};
|
|
1621
1677
|
e.forEach((e) => {
|
|
1622
1678
|
this.persistentCleanups.push(w(e, t));
|
|
@@ -1633,7 +1689,7 @@ var Jt = class {
|
|
|
1633
1689
|
e && (this.cleanupHandlers.push(w(e, () => {
|
|
1634
1690
|
if (this.core.isDestroyed || e.getAttribute("aria-disabled") === "true") return;
|
|
1635
1691
|
if (this.core.getHour() && this.core.getMinutes()) {
|
|
1636
|
-
this.emitter.emit("confirm",
|
|
1692
|
+
this.emitter.emit("confirm", W(this.core));
|
|
1637
1693
|
return;
|
|
1638
1694
|
}
|
|
1639
1695
|
let t = this.core.getModalElement();
|
|
@@ -1643,10 +1699,10 @@ var Jt = class {
|
|
|
1643
1699
|
blockOkOnDisabledTime(e) {
|
|
1644
1700
|
if (this.core.options.range?.enabled) return;
|
|
1645
1701
|
let t = () => {
|
|
1646
|
-
let t =
|
|
1647
|
-
!t && !this.okBlocked || (this.okBlocked = t,
|
|
1702
|
+
let t = Tt(this.core);
|
|
1703
|
+
!t && !this.okBlocked || (this.okBlocked = t, te(e, t));
|
|
1648
1704
|
};
|
|
1649
|
-
t(),
|
|
1705
|
+
this.syncOk = t, t(), en(this.emitter, this.cleanupHandlers, "update", ({ hour: e }) => {
|
|
1650
1706
|
e && t();
|
|
1651
1707
|
});
|
|
1652
1708
|
}
|
|
@@ -1662,7 +1718,7 @@ var Jt = class {
|
|
|
1662
1718
|
let e = this.core.getAM();
|
|
1663
1719
|
e && this.cleanupHandlers.push(w(e, () => {
|
|
1664
1720
|
this.core.isDestroyed || (b(e, this.core.getPM(), "AM"), h(this.core.getModalElement(), this.core.options.labels.announceAmSelected), this.emitter.emit("select:am", {}), this.emitter.emit("update", {
|
|
1665
|
-
...
|
|
1721
|
+
...W(this.core),
|
|
1666
1722
|
type: "AM"
|
|
1667
1723
|
}));
|
|
1668
1724
|
}));
|
|
@@ -1671,7 +1727,7 @@ var Jt = class {
|
|
|
1671
1727
|
let e = this.core.getPM();
|
|
1672
1728
|
e && this.cleanupHandlers.push(w(e, () => {
|
|
1673
1729
|
this.core.isDestroyed || (b(this.core.getAM(), e, "PM"), h(this.core.getModalElement(), this.core.options.labels.announcePmSelected), this.emitter.emit("select:pm", {}), this.emitter.emit("update", {
|
|
1674
|
-
...
|
|
1730
|
+
...W(this.core),
|
|
1675
1731
|
type: "PM"
|
|
1676
1732
|
}));
|
|
1677
1733
|
}));
|
|
@@ -1682,25 +1738,28 @@ var Jt = class {
|
|
|
1682
1738
|
this.core.isDestroyed || this.emitter.emit("switch:view", {});
|
|
1683
1739
|
}));
|
|
1684
1740
|
}
|
|
1741
|
+
syncOkButton() {
|
|
1742
|
+
this.syncOk?.();
|
|
1743
|
+
}
|
|
1685
1744
|
detach() {
|
|
1686
|
-
J(this.cleanupHandlers);
|
|
1745
|
+
J(this.cleanupHandlers), this.syncOk = null;
|
|
1687
1746
|
}
|
|
1688
1747
|
destroy() {
|
|
1689
1748
|
this.detach(), J(this.persistentCleanups);
|
|
1690
1749
|
}
|
|
1691
|
-
},
|
|
1750
|
+
}, rn = (e, t, n) => Math.max(t, Math.min(n, e)), an = (e, t) => {
|
|
1692
1751
|
if (e === "") return "";
|
|
1693
1752
|
let n = parseInt(e, 10);
|
|
1694
|
-
return Number.isNaN(n) ? "" :
|
|
1695
|
-
},
|
|
1753
|
+
return Number.isNaN(n) ? "" : rn(n, +!!t, t ? 12 : 23).toString().padStart(2, "0");
|
|
1754
|
+
}, on = (e) => {
|
|
1696
1755
|
if (e === "") return "";
|
|
1697
1756
|
let t = parseInt(e, 10);
|
|
1698
|
-
return Number.isNaN(t) ? "" :
|
|
1699
|
-
},
|
|
1700
|
-
hour:
|
|
1701
|
-
minutes:
|
|
1702
|
-
seconds:
|
|
1703
|
-
},
|
|
1757
|
+
return Number.isNaN(t) ? "" : rn(t, 0, 59).toString().padStart(2, "0");
|
|
1758
|
+
}, sn = {
|
|
1759
|
+
hour: an,
|
|
1760
|
+
minutes: on,
|
|
1761
|
+
seconds: on
|
|
1762
|
+
}, cn = class {
|
|
1704
1763
|
core;
|
|
1705
1764
|
emitter;
|
|
1706
1765
|
cleanupHandlers = [];
|
|
@@ -1717,22 +1776,22 @@ var Jt = class {
|
|
|
1717
1776
|
this.bindTimeField("seconds");
|
|
1718
1777
|
}
|
|
1719
1778
|
bindTimeField(e) {
|
|
1720
|
-
let t =
|
|
1779
|
+
let t = U(this.core, e);
|
|
1721
1780
|
if (!t) return;
|
|
1722
1781
|
let n = () => {
|
|
1723
|
-
this.core.isDestroyed || (
|
|
1782
|
+
this.core.isDestroyed || (bt(this.core, e), vt(this.emitter, e, t.value), this.emitter.emit("update", W(this.core)));
|
|
1724
1783
|
};
|
|
1725
1784
|
t.addEventListener("click", n), this.cleanupHandlers.push(() => t.removeEventListener("click", n));
|
|
1726
1785
|
let r = t.value, i = () => {
|
|
1727
1786
|
if (this.core.isDestroyed || t.hasAttribute("readonly")) return;
|
|
1728
|
-
let n =
|
|
1729
|
-
|
|
1787
|
+
let n = sn[e](t.value, this.core.options.clock.type === "12h");
|
|
1788
|
+
C(t, n && this.nearestEnabled(e, Number(n))), t.value !== r && (r = t.value, this.emitter.emit("animation:clock", {}), vt(this.emitter, e, t.value), this.emitter.emit("update", W(this.core)));
|
|
1730
1789
|
};
|
|
1731
1790
|
t.addEventListener("blur", i), this.cleanupHandlers.push(() => t.removeEventListener("blur", i));
|
|
1732
1791
|
}
|
|
1733
1792
|
nearestEnabled(e, t) {
|
|
1734
|
-
let [n, r] =
|
|
1735
|
-
return
|
|
1793
|
+
let [n, r] = St(this.core, e);
|
|
1794
|
+
return F(gt(t, n, r, wt(this.core, e)));
|
|
1736
1795
|
}
|
|
1737
1796
|
detach() {
|
|
1738
1797
|
J(this.cleanupHandlers);
|
|
@@ -1740,17 +1799,17 @@ var Jt = class {
|
|
|
1740
1799
|
destroy() {
|
|
1741
1800
|
this.detach();
|
|
1742
1801
|
}
|
|
1743
|
-
},
|
|
1802
|
+
}, ln = [
|
|
1744
1803
|
1,
|
|
1745
1804
|
!0,
|
|
1746
1805
|
(e, { step: t }) => Math.floor(e / t) * t + t
|
|
1747
|
-
],
|
|
1806
|
+
], un = [
|
|
1748
1807
|
-1,
|
|
1749
1808
|
!0,
|
|
1750
1809
|
(e, { step: t }) => Math.ceil(e / t) * t - t
|
|
1751
|
-
],
|
|
1752
|
-
ArrowUp:
|
|
1753
|
-
ArrowDown:
|
|
1810
|
+
], dn = {
|
|
1811
|
+
ArrowUp: ln,
|
|
1812
|
+
ArrowDown: un,
|
|
1754
1813
|
Home: [
|
|
1755
1814
|
1,
|
|
1756
1815
|
!1,
|
|
@@ -1771,11 +1830,11 @@ var Jt = class {
|
|
|
1771
1830
|
!1,
|
|
1772
1831
|
(e, { min: t, step: n, pageSteps: r }) => Math.max(t, Math.ceil(e / n) * n - n * r)
|
|
1773
1832
|
]
|
|
1774
|
-
},
|
|
1775
|
-
...
|
|
1776
|
-
ArrowRight:
|
|
1777
|
-
ArrowLeft:
|
|
1778
|
-
},
|
|
1833
|
+
}, fn = {
|
|
1834
|
+
...dn,
|
|
1835
|
+
ArrowRight: ln,
|
|
1836
|
+
ArrowLeft: un
|
|
1837
|
+
}, pn = ([e, t, n], r, i, a) => {
|
|
1779
1838
|
let { min: o, last: s, step: c } = i, l = n(r, i);
|
|
1780
1839
|
for (let n = (s - o) / c; n >= 0; n--) {
|
|
1781
1840
|
if (l < o || l > s) {
|
|
@@ -1786,7 +1845,7 @@ var Jt = class {
|
|
|
1786
1845
|
l += e * c;
|
|
1787
1846
|
}
|
|
1788
1847
|
return null;
|
|
1789
|
-
},
|
|
1848
|
+
}, mn = class {
|
|
1790
1849
|
core;
|
|
1791
1850
|
emitter;
|
|
1792
1851
|
cleanupHandlers = [];
|
|
@@ -1796,7 +1855,7 @@ var Jt = class {
|
|
|
1796
1855
|
}
|
|
1797
1856
|
handleOpenOnEnterFocus() {
|
|
1798
1857
|
this.onKeydown(this.core.getInput(), (e) => {
|
|
1799
|
-
e.key === "Enter" && !this.core.isOpen && this.core.isModalRemove &&
|
|
1858
|
+
e.key === "Enter" && !this.core.isOpen && this.core.isModalRemove && tn(this.emitter);
|
|
1800
1859
|
}, this.persistentCleanups);
|
|
1801
1860
|
}
|
|
1802
1861
|
handleEscClick() {
|
|
@@ -1805,14 +1864,14 @@ var Jt = class {
|
|
|
1805
1864
|
});
|
|
1806
1865
|
}
|
|
1807
1866
|
handleKeyboardInput() {
|
|
1808
|
-
|
|
1809
|
-
let t =
|
|
1810
|
-
ae(e.key) ? (e.preventDefault(), this.advanceFace(t)) : this.stepField(t,
|
|
1811
|
-
}),
|
|
1867
|
+
H.forEach((e) => this.onKeydown(U(this.core, e), (t) => this.stepField(e, dn[t.key], t, !0))), this.onKeydown(this.core.getClockFace(), (e) => {
|
|
1868
|
+
let t = yt(this.core);
|
|
1869
|
+
ae(e.key) ? (e.preventDefault(), this.advanceFace(t)) : this.stepField(t, fn[e.key], e, !1);
|
|
1870
|
+
}), S(this.core.getModalElement());
|
|
1812
1871
|
}
|
|
1813
1872
|
advanceFace(e) {
|
|
1814
|
-
let t =
|
|
1815
|
-
!t || this.core.options.clock[n] === !1 || (
|
|
1873
|
+
let t = H[H.indexOf(e) + 1], n = t === "minutes" ? "autoSwitchToMinutes" : "autoSwitchToSeconds";
|
|
1874
|
+
!t || this.core.options.clock[n] === !1 || (U(this.core, t)?.click(), xt(this.core, t));
|
|
1816
1875
|
}
|
|
1817
1876
|
onKeydown(e, t, n = this.cleanupHandlers) {
|
|
1818
1877
|
if (!e) return;
|
|
@@ -1822,7 +1881,7 @@ var Jt = class {
|
|
|
1822
1881
|
e.addEventListener("keydown", r), n.push(() => e.removeEventListener("keydown", r));
|
|
1823
1882
|
}
|
|
1824
1883
|
spinRange(e) {
|
|
1825
|
-
let [t, n] =
|
|
1884
|
+
let [t, n] = St(this.core, e), { incrementHours: r, incrementMinutes: i, incrementSeconds: a } = this.core.options.clock, o = {
|
|
1826
1885
|
hour: r,
|
|
1827
1886
|
minutes: i,
|
|
1828
1887
|
seconds: a
|
|
@@ -1835,13 +1894,13 @@ var Jt = class {
|
|
|
1835
1894
|
};
|
|
1836
1895
|
}
|
|
1837
1896
|
stepField(e, t, n, r) {
|
|
1838
|
-
let i =
|
|
1897
|
+
let i = U(this.core, e);
|
|
1839
1898
|
if (!t || !i) return;
|
|
1840
1899
|
n.preventDefault();
|
|
1841
|
-
let a =
|
|
1900
|
+
let a = pn(t, parseInt(i.value) || 0, this.spinRange(e), wt(this.core, e));
|
|
1842
1901
|
if (a === null) return;
|
|
1843
|
-
let o =
|
|
1844
|
-
|
|
1902
|
+
let o = F(a);
|
|
1903
|
+
bt(this.core, e), C(i, o), r && xt(this.core, e), vt(this.emitter, e, o), this.emitter.emit("update", W(this.core));
|
|
1845
1904
|
}
|
|
1846
1905
|
focusTrapHandler() {
|
|
1847
1906
|
let e = this.core.getWrapper();
|
|
@@ -1861,7 +1920,7 @@ var Jt = class {
|
|
|
1861
1920
|
destroy() {
|
|
1862
1921
|
this.detach(), J(this.persistentCleanups);
|
|
1863
1922
|
}
|
|
1864
|
-
},
|
|
1923
|
+
}, hn = class {
|
|
1865
1924
|
core;
|
|
1866
1925
|
emitter;
|
|
1867
1926
|
cleanupHandlers = [];
|
|
@@ -1892,13 +1951,13 @@ var Jt = class {
|
|
|
1892
1951
|
destroy() {
|
|
1893
1952
|
this.detach();
|
|
1894
1953
|
}
|
|
1895
|
-
},
|
|
1954
|
+
}, gn = class {
|
|
1896
1955
|
buttonHandlers;
|
|
1897
1956
|
inputHandlers;
|
|
1898
1957
|
keyboardHandlers;
|
|
1899
1958
|
modalHandlers;
|
|
1900
1959
|
constructor(e, t) {
|
|
1901
|
-
this.buttonHandlers = new
|
|
1960
|
+
this.buttonHandlers = new nn(e, t), this.inputHandlers = new cn(e, t), this.keyboardHandlers = new mn(e, t), this.modalHandlers = new hn(e, t);
|
|
1902
1961
|
}
|
|
1903
1962
|
handleOpenOnClick() {
|
|
1904
1963
|
this.buttonHandlers.handleOpenOnClick();
|
|
@@ -1912,6 +1971,9 @@ var Jt = class {
|
|
|
1912
1971
|
handleOkButton() {
|
|
1913
1972
|
this.buttonHandlers.handleOkButton();
|
|
1914
1973
|
}
|
|
1974
|
+
syncOkButton() {
|
|
1975
|
+
this.buttonHandlers.syncOkButton();
|
|
1976
|
+
}
|
|
1915
1977
|
handleBackdropClick() {
|
|
1916
1978
|
this.modalHandlers.handleBackdropClick();
|
|
1917
1979
|
}
|
|
@@ -1951,10 +2013,10 @@ var Jt = class {
|
|
|
1951
2013
|
destroy() {
|
|
1952
2014
|
this.buttonHandlers.destroy(), this.inputHandlers.destroy(), this.keyboardHandlers.destroy(), this.modalHandlers.destroy();
|
|
1953
2015
|
}
|
|
1954
|
-
},
|
|
2016
|
+
}, _n = (e = []) => {
|
|
1955
2017
|
let t = e[e.length - 1];
|
|
1956
2018
|
return t === void 0 ? void 0 : parseInt(t, 10) + 1;
|
|
1957
|
-
},
|
|
2019
|
+
}, vn = class {
|
|
1958
2020
|
emitter;
|
|
1959
2021
|
getClockSystem;
|
|
1960
2022
|
setHoursToClock;
|
|
@@ -1999,30 +2061,31 @@ var Jt = class {
|
|
|
1999
2061
|
...n,
|
|
2000
2062
|
rangeFromType: e.fromType,
|
|
2001
2063
|
rangeFromHour: e.fromHour,
|
|
2002
|
-
rangeFromMinute: e.fromMinute ??
|
|
2003
|
-
rangeFromSecond:
|
|
2064
|
+
rangeFromMinute: e.fromMinute ?? _n(e.minutes),
|
|
2065
|
+
rangeFromSecond: _n(e.seconds)
|
|
2004
2066
|
});
|
|
2005
2067
|
}
|
|
2006
|
-
},
|
|
2007
|
-
let n = e.clockType ?? t, r =
|
|
2008
|
-
if (r && r.clockType === n) return r;
|
|
2068
|
+
}, yn = /* @__PURE__ */ new WeakMap(), bn = (e, t) => {
|
|
2069
|
+
let n = e.clockType ?? t, r = yn.get(e);
|
|
2070
|
+
if (r && r.clockType === n && r.predicate === e.predicate) return r;
|
|
2009
2071
|
let i = {
|
|
2010
2072
|
hours: e.hours,
|
|
2011
2073
|
minutes: e.minutes,
|
|
2012
2074
|
seconds: e.seconds,
|
|
2013
2075
|
intervals: e.isInterval ? e.intervals : void 0,
|
|
2014
|
-
clockType: n
|
|
2076
|
+
clockType: n,
|
|
2077
|
+
predicate: e.predicate
|
|
2015
2078
|
};
|
|
2016
|
-
return
|
|
2017
|
-
},
|
|
2018
|
-
let a =
|
|
2079
|
+
return yn.set(e, i), i;
|
|
2080
|
+
}, xn = 12, Sn = 59, Cn = 59, wn = (e, t, n) => n === "24h" ? e : t === "AM" ? e % xn : t === "PM" ? e % xn + xn : null, Tn = (e, t, n, r, i) => {
|
|
2081
|
+
let a = wn(e, r, i);
|
|
2019
2082
|
return a === null ? null : (a * 60 + t) * 60 + n;
|
|
2020
|
-
},
|
|
2083
|
+
}, En = (e, t, n, r, i, a) => {
|
|
2021
2084
|
let { rangeFromHour: o, rangeFromMinute: s = 0, rangeFromSecond: c = 0, rangeFromType: l } = i;
|
|
2022
2085
|
if (o === void 0) return !1;
|
|
2023
|
-
let u =
|
|
2086
|
+
let u = Tn(o, s, c, l, a), d = Tn(e, t, n, r, a);
|
|
2024
2087
|
return u !== null && d !== null && d < u;
|
|
2025
|
-
},
|
|
2088
|
+
}, Dn = (e, t, n, r) => En(parseInt(e, 10), Sn, Cn, t, n, r), On = (e, t, n, r, i) => En(parseInt(t, 10), parseInt(e, 10), Cn, n, r, i), kn = (e, t, n, r, i, a) => En(parseInt(n, 10), parseInt(t, 10), parseInt(e, 10), r, i, a), Y = class {
|
|
2026
2089
|
static angleToIndex(e, t, n) {
|
|
2027
2090
|
let r = Math.round(e / 30) % 12;
|
|
2028
2091
|
if (t === "24h") {
|
|
@@ -2043,7 +2106,7 @@ var Jt = class {
|
|
|
2043
2106
|
return t === "24h" ? e >= 12 ? (e - 12) % 12 * 30 : e % 12 * 30 : (e === 0 ? 12 : e) % 12 * 30;
|
|
2044
2107
|
}
|
|
2045
2108
|
static isDisabled(e, t, n, r, i = !1) {
|
|
2046
|
-
return n ?
|
|
2109
|
+
return n ? Dn(e, t, n, r) || mt(bn(n, r), {
|
|
2047
2110
|
hour: e,
|
|
2048
2111
|
type: t || void 0
|
|
2049
2112
|
}, i) : !1;
|
|
@@ -2056,7 +2119,7 @@ var Jt = class {
|
|
|
2056
2119
|
let s = e;
|
|
2057
2120
|
s < 0 && (s += o + 1), s > o && (s %= o + 1);
|
|
2058
2121
|
let c = this.indexToValue(s, t);
|
|
2059
|
-
if (
|
|
2122
|
+
if (_t(s, a) && !this.isDisabled(c, n, r, t, i)) return s;
|
|
2060
2123
|
}
|
|
2061
2124
|
}
|
|
2062
2125
|
return e;
|
|
@@ -2072,7 +2135,7 @@ var Jt = class {
|
|
|
2072
2135
|
return e % 60 * 6;
|
|
2073
2136
|
}
|
|
2074
2137
|
static isDisabled(e, t, n, r, i, a = !1) {
|
|
2075
|
-
return r ?
|
|
2138
|
+
return r ? On(e, t, n, r, i) || pt(bn(r, i), {
|
|
2076
2139
|
hour: t,
|
|
2077
2140
|
minutes: e,
|
|
2078
2141
|
type: n || void 0
|
|
@@ -2080,7 +2143,7 @@ var Jt = class {
|
|
|
2080
2143
|
}
|
|
2081
2144
|
static isUnitDisabled(e, t, n) {
|
|
2082
2145
|
let { hour: r, minute: i, amPm: a, disabledTime: o, clockType: s, showSeconds: c } = n;
|
|
2083
|
-
return e === "minutes" ? this.isDisabled(t, r, a, o, s, c) : o ?
|
|
2146
|
+
return e === "minutes" ? this.isDisabled(t, r, a, o, s, c) : o ? kn(t, i, r, a, o, s) || ft(bn(o, s), {
|
|
2084
2147
|
hour: r,
|
|
2085
2148
|
minutes: i,
|
|
2086
2149
|
seconds: t,
|
|
@@ -2121,7 +2184,7 @@ var Jt = class {
|
|
|
2121
2184
|
let n = this.normalizeAngle(e), r = this.normalizeAngle(t) - n, i = r >= 0 ? r : r + 360, a = r <= 0 ? r : r - 360;
|
|
2122
2185
|
return e + (Math.abs(i) < Math.abs(a) ? i : a);
|
|
2123
2186
|
}
|
|
2124
|
-
},
|
|
2187
|
+
}, An = class {
|
|
2125
2188
|
config;
|
|
2126
2189
|
currentAngle = 0;
|
|
2127
2190
|
tipsCache = /* @__PURE__ */ new Map();
|
|
@@ -2275,7 +2338,7 @@ var Jt = class {
|
|
|
2275
2338
|
let r = parseInt(e, 10);
|
|
2276
2339
|
return t === "hours" ? Y.indexToAngle(r, n) : X.indexToAngle(r);
|
|
2277
2340
|
}
|
|
2278
|
-
},
|
|
2341
|
+
}, jn = class {
|
|
2279
2342
|
state;
|
|
2280
2343
|
renderer;
|
|
2281
2344
|
clockType;
|
|
@@ -2395,7 +2458,7 @@ var Jt = class {
|
|
|
2395
2458
|
let n = parseInt(t, 10);
|
|
2396
2459
|
return n === 0 || n >= 13;
|
|
2397
2460
|
}
|
|
2398
|
-
},
|
|
2461
|
+
}, Mn = class {
|
|
2399
2462
|
controller;
|
|
2400
2463
|
clockFace;
|
|
2401
2464
|
isActive = !1;
|
|
@@ -2486,7 +2549,7 @@ var Jt = class {
|
|
|
2486
2549
|
removeGlobalListeners() {
|
|
2487
2550
|
t() !== !1 && (document.removeEventListener("mousemove", this.handlePointerMove), document.removeEventListener("touchmove", this.handlePointerMove), document.removeEventListener("mouseup", this.handlePointerUp), document.removeEventListener("touchend", this.handlePointerUp));
|
|
2488
2551
|
}
|
|
2489
|
-
},
|
|
2552
|
+
}, Nn = class {
|
|
2490
2553
|
renderer;
|
|
2491
2554
|
controller;
|
|
2492
2555
|
dragHandlers;
|
|
@@ -2505,7 +2568,7 @@ var Jt = class {
|
|
|
2505
2568
|
theme: e.theme,
|
|
2506
2569
|
showSeconds: e.showSeconds
|
|
2507
2570
|
};
|
|
2508
|
-
this.renderer = new
|
|
2571
|
+
this.renderer = new An(t);
|
|
2509
2572
|
let n = e.initialSecond || "00", r = {
|
|
2510
2573
|
hour: e.initialHour,
|
|
2511
2574
|
minute: e.initialMinute,
|
|
@@ -2520,7 +2583,7 @@ var Jt = class {
|
|
|
2520
2583
|
onMinuteChange: e.onMinuteChange,
|
|
2521
2584
|
onSecondChange: e.onSecondChange
|
|
2522
2585
|
};
|
|
2523
|
-
this.controller = new
|
|
2586
|
+
this.controller = new jn(this.renderer, r, e.clockType, e.disabledTime, e.incrementHours || 1, e.incrementMinutes || 1, e.smoothHourSnap ?? !0, i, e.incrementSeconds || 1, e.showSeconds ?? !1), this.dragHandlers = new Mn(this.controller, e.clockFace, e.dragConfig || {});
|
|
2524
2587
|
}
|
|
2525
2588
|
initialize() {
|
|
2526
2589
|
this.dragHandlers.attach(), this.switchToHours();
|
|
@@ -2570,20 +2633,25 @@ var Jt = class {
|
|
|
2570
2633
|
return this.controller.getAmPm();
|
|
2571
2634
|
}
|
|
2572
2635
|
updateDisabledTime(e) {
|
|
2573
|
-
this.disabledTime = e, this.controller.updateDisabledTime(e);
|
|
2574
|
-
|
|
2575
|
-
|
|
2636
|
+
this.disabledTime = e, this.controller.updateDisabledTime(e), this.renderCurrentTips();
|
|
2637
|
+
}
|
|
2638
|
+
refreshDisabledTime() {
|
|
2639
|
+
this.controller.followHand(this.renderCurrentTips());
|
|
2640
|
+
}
|
|
2641
|
+
renderCurrentTips() {
|
|
2642
|
+
let { mode: e } = this.controller.getState();
|
|
2643
|
+
return e === "hours" ? this.renderHourTips() : this.renderSixtyTips(e), e;
|
|
2576
2644
|
}
|
|
2577
2645
|
switchToSixty(e) {
|
|
2578
2646
|
this.controller.switchMode(e), this.tipsWrapperFor24h && this.tipsWrapperFor24h.classList.add("none"), this.renderSixtyTips(e), this.controller.followHand(e);
|
|
2579
2647
|
}
|
|
2580
2648
|
renderHourTips() {
|
|
2581
2649
|
let e = this.controller.getState().amPm;
|
|
2582
|
-
this.clockType === "24h" ? (this.renderer.renderTips(
|
|
2650
|
+
this.clockType === "24h" ? (this.renderer.renderTips(he, "tp-ui-hour-time-12", "hours", this.disabledTime, this.clockType, !0, this.tipsWrapper, e), this.tipsWrapperFor24h && this.renderer.renderTips(me, "tp-ui-hour-time-24", "hours", this.disabledTime, this.clockType, !0, this.tipsWrapperFor24h, e)) : this.renderer.renderTips(he, "tp-ui-hour-time-12", "hours", this.disabledTime, this.clockType, !0, void 0, e);
|
|
2583
2651
|
}
|
|
2584
2652
|
renderSixtyTips(e) {
|
|
2585
2653
|
let { amPm: t, hour: n, minute: r } = this.controller.getState();
|
|
2586
|
-
this.renderer.renderTips(
|
|
2654
|
+
this.renderer.renderTips(ge, "tp-ui-minutes-time", e, this.disabledTime, this.clockType, !0, void 0, t, n, r);
|
|
2587
2655
|
}
|
|
2588
2656
|
destroy() {
|
|
2589
2657
|
this.dragHandlers.detach(), this.controller.destroy();
|
|
@@ -2594,7 +2662,7 @@ var Jt = class {
|
|
|
2594
2662
|
unblockInteractions() {
|
|
2595
2663
|
this.dragHandlers.unblock();
|
|
2596
2664
|
}
|
|
2597
|
-
},
|
|
2665
|
+
}, Pn = class {
|
|
2598
2666
|
core;
|
|
2599
2667
|
emitter;
|
|
2600
2668
|
clockSystem = null;
|
|
@@ -2638,7 +2706,7 @@ var Jt = class {
|
|
|
2638
2706
|
minutesElement: c,
|
|
2639
2707
|
secondsElement: l,
|
|
2640
2708
|
onMinuteCommit: () => {
|
|
2641
|
-
let e =
|
|
2709
|
+
let e = W(this.core);
|
|
2642
2710
|
this.emitter.emit("range:minute:commit", {
|
|
2643
2711
|
...e,
|
|
2644
2712
|
hour: e.hour ?? "12",
|
|
@@ -2650,7 +2718,7 @@ var Jt = class {
|
|
|
2650
2718
|
onMinuteChange: (e) => this.reflectClockValue("minutes", e),
|
|
2651
2719
|
onSecondChange: (e) => this.reflectClockValue("seconds", e)
|
|
2652
2720
|
};
|
|
2653
|
-
this.clockSystem = new
|
|
2721
|
+
this.clockSystem = new Nn(u), this.clockSystem.initialize();
|
|
2654
2722
|
}
|
|
2655
2723
|
convertDisabledTime() {
|
|
2656
2724
|
let e = this.core.disabledTime?.value;
|
|
@@ -2662,7 +2730,8 @@ var Jt = class {
|
|
|
2662
2730
|
seconds: e.seconds,
|
|
2663
2731
|
isInterval: e.isInterval,
|
|
2664
2732
|
intervals: t,
|
|
2665
|
-
clockType: e.clockType
|
|
2733
|
+
clockType: e.clockType,
|
|
2734
|
+
predicate: e.predicate
|
|
2666
2735
|
};
|
|
2667
2736
|
}
|
|
2668
2737
|
getAmPmValue() {
|
|
@@ -2673,12 +2742,12 @@ var Jt = class {
|
|
|
2673
2742
|
return this.core.options.range?.enabled === !0 ? t?.classList.contains("active") ? "AM" : "" : t?.classList.contains("active") ? "AM" : "PM";
|
|
2674
2743
|
}
|
|
2675
2744
|
reflectClockValue(e, t) {
|
|
2676
|
-
|
|
2745
|
+
C(U(this.core, e), t), xt(this.core, e), this.emitter.emit("update", W(this.core));
|
|
2677
2746
|
}
|
|
2678
2747
|
destroy() {
|
|
2679
2748
|
this.clockSystem &&= (this.clockSystem.destroy(), null);
|
|
2680
2749
|
}
|
|
2681
|
-
},
|
|
2750
|
+
}, Fn = class {
|
|
2682
2751
|
core;
|
|
2683
2752
|
constructor(e) {
|
|
2684
2753
|
this.core = e;
|
|
@@ -2691,9 +2760,9 @@ var Jt = class {
|
|
|
2691
2760
|
(t > 12 || t === 0) && (this.core.getCircle()?.classList.add("tp-ui-circle-hand-24h"), this.core.getClockHand()?.classList.add("tp-ui-clock-hand-24h"));
|
|
2692
2761
|
}
|
|
2693
2762
|
setClassActiveToHourOnOpen() {
|
|
2694
|
-
this.core.options.ui.mobile || this.core.isMobileView || this.core.getHour()?.classList.add(
|
|
2763
|
+
this.core.options.ui.mobile || this.core.isMobileView || this.core.getHour()?.classList.add(Zt);
|
|
2695
2764
|
}
|
|
2696
|
-
},
|
|
2765
|
+
}, In = {
|
|
2697
2766
|
minutes: {
|
|
2698
2767
|
set: "setMinute",
|
|
2699
2768
|
show: "switchToMinutes"
|
|
@@ -2702,7 +2771,7 @@ var Jt = class {
|
|
|
2702
2771
|
set: "setSecond",
|
|
2703
2772
|
show: "switchToSeconds"
|
|
2704
2773
|
}
|
|
2705
|
-
},
|
|
2774
|
+
}, Ln = class {
|
|
2706
2775
|
getClockSystem;
|
|
2707
2776
|
getAmPmValue;
|
|
2708
2777
|
getClockType;
|
|
@@ -2728,16 +2797,16 @@ var Jt = class {
|
|
|
2728
2797
|
setSixtyToClock(e, t) {
|
|
2729
2798
|
let n = this.getClockSystem();
|
|
2730
2799
|
if (!n) return;
|
|
2731
|
-
let r =
|
|
2800
|
+
let r = In[e];
|
|
2732
2801
|
t && n[r.set](t), n[r.show]();
|
|
2733
2802
|
}
|
|
2734
|
-
},
|
|
2803
|
+
}, Rn = class {
|
|
2735
2804
|
systemInitializer;
|
|
2736
2805
|
styleHandler;
|
|
2737
2806
|
timeHandler;
|
|
2738
2807
|
eventHandler;
|
|
2739
2808
|
constructor(e, t) {
|
|
2740
|
-
this.systemInitializer = new
|
|
2809
|
+
this.systemInitializer = new Pn(e, t), this.styleHandler = new Fn(e), this.timeHandler = new Ln(() => this.systemInitializer.getClockSystem(), () => this.systemInitializer.getAmPmValue(), () => e.options.clock.type || "12h"), this.eventHandler = new vn(t, () => this.systemInitializer.getClockSystem(), (e) => this.timeHandler.setHoursToClock(e), (e) => this.timeHandler.setMinutesToClock(e), () => this.timeHandler.updateAmPm(), () => this.systemInitializer.convertDisabledTime(), (e) => this.timeHandler.setSecondsToClock(e)), this.eventHandler.setup();
|
|
2741
2810
|
}
|
|
2742
2811
|
initializeClockSystem() {
|
|
2743
2812
|
this.systemInitializer.initialize();
|
|
@@ -2762,14 +2831,17 @@ var Jt = class {
|
|
|
2762
2831
|
amPm: a
|
|
2763
2832
|
}), !0;
|
|
2764
2833
|
}
|
|
2834
|
+
refreshDisabledTime() {
|
|
2835
|
+
this.systemInitializer.getClockSystem()?.refreshDisabledTime();
|
|
2836
|
+
}
|
|
2765
2837
|
destroy() {
|
|
2766
2838
|
this.destroyClockSystem();
|
|
2767
2839
|
}
|
|
2768
|
-
},
|
|
2840
|
+
}, zn = {
|
|
2769
2841
|
hour: "12",
|
|
2770
2842
|
minutes: "00",
|
|
2771
2843
|
seconds: "00"
|
|
2772
|
-
},
|
|
2844
|
+
}, Bn = class {
|
|
2773
2845
|
core;
|
|
2774
2846
|
emitter;
|
|
2775
2847
|
cleanupHandlers = [];
|
|
@@ -2786,15 +2858,15 @@ var Jt = class {
|
|
|
2786
2858
|
}
|
|
2787
2859
|
setupInternalEventListeners() {
|
|
2788
2860
|
let e = () => this.updateClearButtonState();
|
|
2789
|
-
|
|
2790
|
-
|
|
2861
|
+
en(this.emitter, this.cleanupHandlers, "update", e), en(this.emitter, this.cleanupHandlers, "open", e), H.forEach((t) => {
|
|
2862
|
+
en(this.emitter, this.cleanupHandlers, V[t].event, () => {
|
|
2791
2863
|
e(), this.reenableConfirmIfCleared();
|
|
2792
2864
|
});
|
|
2793
2865
|
});
|
|
2794
2866
|
}
|
|
2795
2867
|
handleClearClick() {
|
|
2796
2868
|
let e = this.core.getInput()?.value || null;
|
|
2797
|
-
this.clearTimeValue(), this.resetClockToNeutral(),
|
|
2869
|
+
this.clearTimeValue(), this.resetClockToNeutral(), te(this.core.getOkButton(), !0), this.wasCleared = !0, h(this.core.getModalElement(), this.core.options.labels.announceCleared), this.emitter.emit("clear", { previousValue: e }), this.emitter.emit("update", {
|
|
2798
2870
|
hour: void 0,
|
|
2799
2871
|
minutes: void 0,
|
|
2800
2872
|
type: void 0
|
|
@@ -2806,8 +2878,8 @@ var Jt = class {
|
|
|
2806
2878
|
}
|
|
2807
2879
|
resetClockToNeutral() {
|
|
2808
2880
|
let e = this.core.options.clock.type === "12h" ? "PM" : void 0;
|
|
2809
|
-
|
|
2810
|
-
|
|
2881
|
+
H.forEach((e) => {
|
|
2882
|
+
C(U(this.core, e), zn[e]);
|
|
2811
2883
|
});
|
|
2812
2884
|
let t = this.core.getClockHand();
|
|
2813
2885
|
if (t) {
|
|
@@ -2824,13 +2896,13 @@ var Jt = class {
|
|
|
2824
2896
|
updateClearButtonState() {
|
|
2825
2897
|
let e = this.getClearButton();
|
|
2826
2898
|
if (!e) return;
|
|
2827
|
-
let t = !!this.core.getInput()?.value.trim(), n = this.core.options.clock.type, r = this.core.getHour()?.value || "", i = this.core.getMinutes()?.value || "", a = this.core.getSeconds()?.value || "", o = this.core.getActiveType() ?? "", s = r !== "" || i !== "" || a !== "", c = r ===
|
|
2828
|
-
|
|
2899
|
+
let t = !!this.core.getInput()?.value.trim(), n = this.core.options.clock.type, r = this.core.getHour()?.value || "", i = this.core.getMinutes()?.value || "", a = this.core.getSeconds()?.value || "", o = this.core.getActiveType() ?? "", s = r !== "" || i !== "" || a !== "", c = r === zn.hour && i === zn.minutes && (a === "" || a === zn.seconds) && (n !== "12h" || o === "PM");
|
|
2900
|
+
te(e, !(t || s && !c));
|
|
2829
2901
|
}
|
|
2830
2902
|
reenableConfirmIfCleared() {
|
|
2831
2903
|
if (!this.wasCleared) return;
|
|
2832
2904
|
let e = this.core.getOkButton();
|
|
2833
|
-
e && (
|
|
2905
|
+
e && (te(e, !1), this.wasCleared = !1);
|
|
2834
2906
|
}
|
|
2835
2907
|
getClearButton() {
|
|
2836
2908
|
return this.core.getModalElement()?.querySelector(".tp-ui-clear-btn") || null;
|
|
@@ -2841,7 +2913,7 @@ var Jt = class {
|
|
|
2841
2913
|
destroy() {
|
|
2842
2914
|
this.detach();
|
|
2843
2915
|
}
|
|
2844
|
-
},
|
|
2916
|
+
}, Vn = class {
|
|
2845
2917
|
animation;
|
|
2846
2918
|
modal;
|
|
2847
2919
|
config;
|
|
@@ -2852,7 +2924,7 @@ var Jt = class {
|
|
|
2852
2924
|
clearButton;
|
|
2853
2925
|
plugins = /* @__PURE__ */ new Map();
|
|
2854
2926
|
constructor(e, t) {
|
|
2855
|
-
this.animation = new le(e, t), this.modal = new ze(e, t), this.config = new
|
|
2927
|
+
this.animation = new le(e, t), this.modal = new ze(e, t), this.config = new Yt(e, t), this.theme = new Qt(e, t), this.validation = new $t(e, t), this.events = new gn(e, t), this.clock = new Rn(e, t), this.clearButton = new Bn(e, t), E.getAll().forEach((n) => {
|
|
2856
2928
|
let r = n.factory(e, t);
|
|
2857
2929
|
this.plugins.set(n.name, r);
|
|
2858
2930
|
});
|
|
@@ -2863,29 +2935,29 @@ var Jt = class {
|
|
|
2863
2935
|
destroy() {
|
|
2864
2936
|
this.animation.destroy(), this.modal.destroy(), this.config.destroy(), this.theme.destroy(), this.validation.destroy(), this.events.destroy(), this.clock.destroy(), this.clearButton.destroy(), this.plugins.forEach((e) => e.destroy()), this.plugins.clear();
|
|
2865
2937
|
}
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2868
|
-
},
|
|
2938
|
+
}, Hn = "is-pressed", Un = "is-rippling", Wn = /* @__PURE__ */ new WeakSet(), Gn = (e) => e instanceof Element ? e.closest("[data-md3-ripple]") : null, Kn = (e) => {
|
|
2939
|
+
Gn(e.target)?.classList.remove(Hn);
|
|
2940
|
+
}, qn = [
|
|
2869
2941
|
["pointerdown", (e) => {
|
|
2870
|
-
let { pointerType: t, button: n, clientX: r, clientY: i } = e, a =
|
|
2871
|
-
if (!a ||
|
|
2872
|
-
a.classList.remove(
|
|
2942
|
+
let { pointerType: t, button: n, clientX: r, clientY: i } = e, a = Gn(e.target);
|
|
2943
|
+
if (!a || ee(a) || t === "mouse" && n !== 0) return;
|
|
2944
|
+
a.classList.remove(Un);
|
|
2873
2945
|
let { left: o, top: s, width: c, height: l } = a.getBoundingClientRect();
|
|
2874
|
-
a.style.setProperty("--ripple-x", `${r - o}px`), a.style.setProperty("--ripple-y", `${i - s}px`), a.style.setProperty("--ripple-size", `${Math.max(c, l) * 2}px`), a.classList.add(
|
|
2946
|
+
a.style.setProperty("--ripple-x", `${r - o}px`), a.style.setProperty("--ripple-y", `${i - s}px`), a.style.setProperty("--ripple-size", `${Math.max(c, l) * 2}px`), a.classList.add(Hn), a.addEventListener("pointerleave", Kn, { once: !0 }), T() || requestAnimationFrame(() => a.classList.add(Un));
|
|
2875
2947
|
}],
|
|
2876
|
-
["pointerup",
|
|
2877
|
-
["pointercancel",
|
|
2948
|
+
["pointerup", Kn],
|
|
2949
|
+
["pointercancel", Kn],
|
|
2878
2950
|
["animationend", (e) => {
|
|
2879
|
-
e.animationName === "tp-ripple-fade" &&
|
|
2951
|
+
e.animationName === "tp-ripple-fade" && Gn(e.target)?.classList.remove(Un);
|
|
2880
2952
|
}]
|
|
2881
|
-
],
|
|
2882
|
-
if (
|
|
2883
|
-
|
|
2953
|
+
], Jn = (e) => {
|
|
2954
|
+
if (Wn.has(e)) return () => {};
|
|
2955
|
+
Wn.add(e), qn.forEach(([t, n]) => e.addEventListener(t, n));
|
|
2884
2956
|
let t = !0;
|
|
2885
2957
|
return () => {
|
|
2886
|
-
t && (t = !1,
|
|
2958
|
+
t && (t = !1, Wn.delete(e), qn.forEach(([t, n]) => e.removeEventListener(t, n)));
|
|
2887
2959
|
};
|
|
2888
|
-
},
|
|
2960
|
+
}, Yn = [
|
|
2889
2961
|
["onOpen", "open"],
|
|
2890
2962
|
["onShow", "show"],
|
|
2891
2963
|
["onCancel", "cancel"],
|
|
@@ -2907,9 +2979,9 @@ var Jt = class {
|
|
|
2907
2979
|
["onWheelScrollStart", "wheel:scroll:start"],
|
|
2908
2980
|
["onWheelScrollEnd", "wheel:scroll:end"],
|
|
2909
2981
|
["onClear", "clear"]
|
|
2910
|
-
],
|
|
2982
|
+
], Xn = [
|
|
2911
2983
|
{
|
|
2912
|
-
needed:
|
|
2984
|
+
needed: k,
|
|
2913
2985
|
name: "wheel",
|
|
2914
2986
|
plugin: "WheelPlugin"
|
|
2915
2987
|
},
|
|
@@ -2924,16 +2996,19 @@ var Jt = class {
|
|
|
2924
2996
|
plugin: "TimezonePlugin"
|
|
2925
2997
|
}
|
|
2926
2998
|
];
|
|
2927
|
-
function
|
|
2928
|
-
for (let [n, r] of
|
|
2999
|
+
function Zn(e, t) {
|
|
3000
|
+
for (let [n, r] of Yn) t.on(r, (t) => {
|
|
2929
3001
|
let r = e.options.callbacks[n];
|
|
2930
3002
|
typeof r == "function" && r(t);
|
|
2931
3003
|
});
|
|
2932
3004
|
}
|
|
2933
|
-
function
|
|
2934
|
-
|
|
3005
|
+
function Qn(e) {
|
|
3006
|
+
return { error: `${e} is not registered. Import and register it: PluginRegistry.register(${e})` };
|
|
2935
3007
|
}
|
|
2936
|
-
|
|
3008
|
+
function $n(e, t) {
|
|
3009
|
+
for (let n of Xn) n.needed(e.options) && !E.has(n.name) && t.emit("error", Qn(n.plugin));
|
|
3010
|
+
}
|
|
3011
|
+
var er = class {
|
|
2937
3012
|
core;
|
|
2938
3013
|
managers;
|
|
2939
3014
|
emitter;
|
|
@@ -2947,7 +3022,7 @@ var Gn = class {
|
|
|
2947
3022
|
}
|
|
2948
3023
|
init() {
|
|
2949
3024
|
if (!this.core.isDestroyed && !this.core.isInitialized) {
|
|
2950
|
-
|
|
3025
|
+
Zn(this.core, this.emitter);
|
|
2951
3026
|
try {
|
|
2952
3027
|
this.managers.config.updateInputValueWithCurrentTimeOnStart(), this.managers.validation.checkDisabledValuesOnStart();
|
|
2953
3028
|
} catch (e) {
|
|
@@ -2967,6 +3042,9 @@ var Gn = class {
|
|
|
2967
3042
|
}
|
|
2968
3043
|
return this.managers.config.checkMobileOption(), this.managers.config.syncInputFormat(t), !0;
|
|
2969
3044
|
}
|
|
3045
|
+
refreshDisabledTime() {
|
|
3046
|
+
this.managers.config.clearPredicateCache(), this.core.isOpen && (k(this.core.options) && E.has("wheel") ? this.managers.getPlugin("wheel")?.updateDisabledItems?.() : this.managers.clock.refreshDisabledTime(), this.managers.events.syncOkButton());
|
|
3047
|
+
}
|
|
2970
3048
|
reportError(e) {
|
|
2971
3049
|
this.emitter.emit("error", { error: e instanceof Error ? e.message : String(e) });
|
|
2972
3050
|
}
|
|
@@ -3026,8 +3104,8 @@ var Gn = class {
|
|
|
3026
3104
|
eventsBundle(e = !1) {
|
|
3027
3105
|
if (this.core.isDestroyed || !this.core.isModalRemove) return;
|
|
3028
3106
|
this.isRendering = !0, this.clearUnmountTimeouts(), this.detachOpenHandlers(), this.core.setIsOpen(!0), this.core.setIsModalRemove(!1), this.disableOpenElements(), this.setupModal(), this.setupValidation(), this.applyExpandedState(), this.managers.modal.setFlexEndToFooterIfNoKeyboardIcon(), this.applyWrapperCssClass(), e && this.managers.animation.setAnimationToOpen(!0), this.managers.config.getInputValueOnOpenAndSet(!e);
|
|
3029
|
-
let t =
|
|
3030
|
-
|
|
3107
|
+
let t = k(this.core.options) && E.has("wheel");
|
|
3108
|
+
$n(this.core, this.emitter), this.revealClockFace(t, e), this.initClockOrWheel(t), this.initOptionalPlugins(t), this.bindEventHandlers(t), this.initRipple(), A(this.core.options) && this.managers.getPlugin("wheel")?.attachPopover?.(), e || (this.managers.animation.setAnimationToOpen(), this.managers.modal.setInitialFocus()), this.isRendering = !1, this.runPendingRerender(e);
|
|
3031
3109
|
}
|
|
3032
3110
|
runPendingRerender(e) {
|
|
3033
3111
|
let t = this.isRerenderPending;
|
|
@@ -3071,11 +3149,11 @@ var Gn = class {
|
|
|
3071
3149
|
n && !e && n.init();
|
|
3072
3150
|
}
|
|
3073
3151
|
bindEventHandlers(e) {
|
|
3074
|
-
this.managers.events.handleCancelButton(), this.managers.events.handleOkButton(), this.managers.clearButton.init(), e || (this.managers.events.handleHourEvents(), this.managers.events.handleMinutesEvents(), this.core.options.clock.showSeconds && this.managers.events.handleSecondsEvents()), this.managers.events.handleKeyboardInput(), this.managers.events.handlePointerModality(), this.core.options.ui.enableSwitchIcon && !e && this.managers.events.handleSwitchViewButton(), this.core.options.clock.type !== "24h" && !
|
|
3152
|
+
this.managers.events.handleCancelButton(), this.managers.events.handleOkButton(), this.managers.clearButton.init(), e || (this.managers.events.handleHourEvents(), this.managers.events.handleMinutesEvents(), this.core.options.clock.showSeconds && this.managers.events.handleSecondsEvents()), this.managers.events.handleKeyboardInput(), this.managers.events.handlePointerModality(), this.core.options.ui.enableSwitchIcon && !e && this.managers.events.handleSwitchViewButton(), this.core.options.clock.type !== "24h" && !fe(this.core.options) && (this.managers.events.handleAmClick(), this.managers.events.handlePmClick()), this.core.options.behavior.focusTrap && !M(this.core.options) && this.managers.events.focusTrapHandler(), j(this.core.options) || (this.managers.events.handleEscClick(), A(this.core.options) || e && this.core.options.wheel?.ignoreOutsideClick || this.managers.events.handleBackdropClick());
|
|
3075
3153
|
}
|
|
3076
3154
|
initRipple() {
|
|
3077
3155
|
let e = this.core.getModalElement();
|
|
3078
|
-
e && (this.rippleCleanup(), this.rippleCleanup =
|
|
3156
|
+
e && (this.rippleCleanup(), this.rippleCleanup = Jn(e));
|
|
3079
3157
|
}
|
|
3080
3158
|
revealClockFace(e, t) {
|
|
3081
3159
|
let n = e ? null : this.core.getClockFace();
|
|
@@ -3091,16 +3169,20 @@ var Gn = class {
|
|
|
3091
3169
|
clearUnmountTimeouts() {
|
|
3092
3170
|
this.unmountTimeouts.forEach(clearTimeout), this.unmountTimeouts = [];
|
|
3093
3171
|
}
|
|
3094
|
-
},
|
|
3172
|
+
}, tr = class {
|
|
3095
3173
|
events = /* @__PURE__ */ new Map();
|
|
3096
3174
|
on(e, t) {
|
|
3097
|
-
this.events.has(e) || this.events.set(e, /* @__PURE__ */ new Set())
|
|
3175
|
+
this.events.has(e) || this.events.set(e, /* @__PURE__ */ new Set());
|
|
3176
|
+
let n = t;
|
|
3177
|
+
return this.events.get(e).add(n), () => {
|
|
3178
|
+
this.events.get(e)?.delete(n);
|
|
3179
|
+
};
|
|
3098
3180
|
}
|
|
3099
3181
|
once(e, t) {
|
|
3100
3182
|
let n = ((r) => {
|
|
3101
3183
|
t(r), this.events.get(e)?.delete(n);
|
|
3102
3184
|
});
|
|
3103
|
-
n.__originalHandler = t, this.on(e, n);
|
|
3185
|
+
return n.__originalHandler = t, this.on(e, n);
|
|
3104
3186
|
}
|
|
3105
3187
|
off(e, t) {
|
|
3106
3188
|
if (!t) {
|
|
@@ -3124,60 +3206,60 @@ var Gn = class {
|
|
|
3124
3206
|
hasListeners(e) {
|
|
3125
3207
|
return (this.events.get(e)?.size ?? 0) > 0;
|
|
3126
3208
|
}
|
|
3127
|
-
},
|
|
3209
|
+
}, nr = (e) => e.replace(/[^0-9:APMapm\s]/g, ""), rr = {
|
|
3128
3210
|
"12h": "Invalid 12h format. Expected HH:MM AM/PM",
|
|
3129
3211
|
"24h": "Invalid 24h format. Expected HH:MM"
|
|
3130
|
-
},
|
|
3212
|
+
}, ir = {
|
|
3131
3213
|
"12h": "24h",
|
|
3132
3214
|
"24h": "12h"
|
|
3133
|
-
},
|
|
3215
|
+
}, ar = (e) => ({
|
|
3134
3216
|
...e,
|
|
3135
3217
|
type: e.type ?? "AM"
|
|
3136
3218
|
});
|
|
3137
|
-
function
|
|
3138
|
-
let n =
|
|
3219
|
+
function or(e, t) {
|
|
3220
|
+
let n = O(e.options), r = I(t, n);
|
|
3139
3221
|
if (r) {
|
|
3140
|
-
let e = n.showSeconds || Ue(t) ?
|
|
3222
|
+
let e = n.showSeconds || Ue(t) ? L(r, n) : t;
|
|
3141
3223
|
return {
|
|
3142
|
-
parsed:
|
|
3224
|
+
parsed: ar(r),
|
|
3143
3225
|
inputText: e
|
|
3144
3226
|
};
|
|
3145
3227
|
}
|
|
3146
|
-
let i =
|
|
3228
|
+
let i = ir[n.clockType], a = I(t, {
|
|
3147
3229
|
...n,
|
|
3148
3230
|
clockType: i
|
|
3149
3231
|
});
|
|
3150
3232
|
if (!a) return null;
|
|
3151
3233
|
let o = Ke(a, i, n);
|
|
3152
3234
|
return {
|
|
3153
|
-
parsed:
|
|
3154
|
-
inputText:
|
|
3235
|
+
parsed: ar(o),
|
|
3236
|
+
inputText: L(o, n)
|
|
3155
3237
|
};
|
|
3156
3238
|
}
|
|
3157
|
-
function
|
|
3158
|
-
return { error:
|
|
3239
|
+
function sr(e) {
|
|
3240
|
+
return { error: rr[D(e.options)] };
|
|
3159
3241
|
}
|
|
3160
|
-
var
|
|
3161
|
-
function
|
|
3162
|
-
|
|
3242
|
+
var cr = (e, t) => !e || t === void 0 ? !1 : (C(e, t), !0);
|
|
3243
|
+
function lr(e, t) {
|
|
3244
|
+
cr(e.getHour(), t.hour) && e.setDegreesHours(Number(t.hour) * 30), cr(e.getMinutes(), t.minutes) && e.setDegreesMinutes(Number(t.minutes) * 6), cr(e.getSeconds(), t.seconds) && e.setDegreesSeconds(Number(t.seconds) * 6);
|
|
3163
3245
|
}
|
|
3164
|
-
function
|
|
3246
|
+
function ur(e, t) {
|
|
3165
3247
|
e.setDegreesHours(Number(t.hour) * 30), e.setDegreesMinutes(Number(t.minutes) * 6), t.seconds !== void 0 && e.setDegreesSeconds(Number(t.seconds) * 6);
|
|
3166
3248
|
}
|
|
3167
|
-
function
|
|
3249
|
+
function dr(e, t) {
|
|
3168
3250
|
e.options.clock.type !== "24h" && b(e.getAM(), e.getPM(), t === "AM" ? "AM" : "PM");
|
|
3169
3251
|
}
|
|
3170
|
-
function
|
|
3171
|
-
if (
|
|
3252
|
+
function fr(e, t, n) {
|
|
3253
|
+
if (k(e.options)) {
|
|
3172
3254
|
t.getPlugin("wheel")?.scrollToValue?.(n.hour, n.minutes, n.type, n.seconds);
|
|
3173
3255
|
return;
|
|
3174
3256
|
}
|
|
3175
|
-
let r =
|
|
3257
|
+
let r = D(e.options) === "24h" ? void 0 : n.type;
|
|
3176
3258
|
if (t.clock.syncClockValue(n.hour, n.minutes, r, n.seconds)) return;
|
|
3177
3259
|
let i = e.getClockHand();
|
|
3178
3260
|
i && (i.style.transform = `rotateZ(${e.degreesHours || 0}deg)`);
|
|
3179
3261
|
}
|
|
3180
|
-
var $ = /* @__PURE__ */ new Map(),
|
|
3262
|
+
var $ = /* @__PURE__ */ new Map(), pr = class {
|
|
3181
3263
|
core;
|
|
3182
3264
|
managers;
|
|
3183
3265
|
lifecycle;
|
|
@@ -3186,19 +3268,19 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3186
3268
|
if (e()) throw Error("TimepickerUI requires browser environment");
|
|
3187
3269
|
let r = this.resolveRootElement(t);
|
|
3188
3270
|
if (!r) throw Error("Input element not found");
|
|
3189
|
-
let i = n?.behavior?.id, a = i || `tp-ui-${
|
|
3190
|
-
if (o.ui.inline?.enabled && typeof n?.behavior?.focusTrap > "u" && (o.behavior.focusTrap = !1), o.ui.inline?.enabled) {
|
|
3271
|
+
let i = n?.behavior?.id, a = i || `tp-ui-${Rt()}`, o = f(n || {});
|
|
3272
|
+
if ((M(o) || o.ui.inline?.enabled && typeof n?.behavior?.focusTrap > "u") && (o.behavior.focusTrap = !1), o.ui.inline?.enabled) {
|
|
3191
3273
|
let { container: e, containerId: t } = o.ui.inline;
|
|
3192
3274
|
if (!e && !t) throw Error("inline.container is required when inline mode is enabled");
|
|
3193
|
-
if (!
|
|
3275
|
+
if (!ke(o.ui.inline)) throw Error("Inline container not found");
|
|
3194
3276
|
}
|
|
3195
|
-
this.emitter = new
|
|
3277
|
+
this.emitter = new tr(), this.core = new p(r, o, a, i);
|
|
3196
3278
|
let s = this.core.getInput();
|
|
3197
3279
|
if (s) {
|
|
3198
3280
|
let { type: e, showSeconds: t } = o.clock;
|
|
3199
|
-
|
|
3281
|
+
ur(this.core, R(s, e, void 0, void 0, !!t));
|
|
3200
3282
|
}
|
|
3201
|
-
this.managers = new
|
|
3283
|
+
this.managers = new Vn(this.core, this.emitter), this.lifecycle = new er(this.core, this.managers, this.emitter), this.managers.config.checkMobileOption(), this.managers.config.preventClockTypeByCurrentTime(), this.setupInternalEventListeners(), $.set(this.core.instanceId, this);
|
|
3202
3284
|
}
|
|
3203
3285
|
setupInternalEventListeners() {
|
|
3204
3286
|
this.emitter.on("open:request", () => {
|
|
@@ -3221,7 +3303,7 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3221
3303
|
}), this.emitter.on("select:am", () => this.emitter.emit("select:period", { type: "AM" })), this.emitter.on("select:pm", () => this.emitter.emit("select:period", { type: "PM" }));
|
|
3222
3304
|
}
|
|
3223
3305
|
writeInputValue(e) {
|
|
3224
|
-
!e.hour || !e.minutes || this.setInputText(
|
|
3306
|
+
!e.hour || !e.minutes || this.setInputText(L(e, O(this.core.options)));
|
|
3225
3307
|
}
|
|
3226
3308
|
setInputText(e) {
|
|
3227
3309
|
let t = this.core.getInput();
|
|
@@ -3258,21 +3340,21 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3258
3340
|
degreesHours: null,
|
|
3259
3341
|
degreesMinutes: null
|
|
3260
3342
|
};
|
|
3261
|
-
let e =
|
|
3343
|
+
let e = O(this.core.options), t = {
|
|
3262
3344
|
hour: "12",
|
|
3263
3345
|
minutes: "00",
|
|
3264
3346
|
seconds: e.showSeconds ? "00" : void 0,
|
|
3265
3347
|
type: e.clockType === "24h" ? void 0 : "AM"
|
|
3266
3348
|
}, n = this.core.getModalElement(), r = this.core.getInput(), i = t;
|
|
3267
3349
|
n && this.core.isOpen ? i = this.readOpenValue(e.clockType, t) : r && (i = R(r, this.core.options.clock.type, void 0, void 0, e.showSeconds));
|
|
3268
|
-
let { degreesHours: a, degreesMinutes: o } = n || r ?
|
|
3350
|
+
let { degreesHours: a, degreesMinutes: o } = n || r ? Ye(i) : {
|
|
3269
3351
|
degreesHours: null,
|
|
3270
3352
|
degreesMinutes: null
|
|
3271
3353
|
}, s = {
|
|
3272
3354
|
hour: i.hour,
|
|
3273
3355
|
minutes: i.minutes,
|
|
3274
3356
|
type: i.type,
|
|
3275
|
-
time:
|
|
3357
|
+
time: L(i, e),
|
|
3276
3358
|
degreesHours: a,
|
|
3277
3359
|
degreesMinutes: o
|
|
3278
3360
|
};
|
|
@@ -3282,7 +3364,7 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3282
3364
|
let n = (t) => {
|
|
3283
3365
|
if (e !== "24h") return t ?? "AM";
|
|
3284
3366
|
};
|
|
3285
|
-
if (
|
|
3367
|
+
if (fe(this.core.options)) {
|
|
3286
3368
|
let e = this.managers.getPlugin("wheel")?.getSelection?.();
|
|
3287
3369
|
return e ? {
|
|
3288
3370
|
hour: e.hour,
|
|
@@ -3300,13 +3382,30 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3300
3382
|
}
|
|
3301
3383
|
setValue(e, t = !0) {
|
|
3302
3384
|
if (this.core.isDestroyed || typeof e != "string" || !e.trim() || !this.core.isInitialized && (this.create(), this.core.isDestroyed)) return;
|
|
3303
|
-
let n =
|
|
3385
|
+
let n = or(this.core, nr(e.trim()));
|
|
3304
3386
|
if (!n) {
|
|
3305
|
-
this.emitter.emit("error",
|
|
3387
|
+
this.emitter.emit("error", sr(this.core));
|
|
3306
3388
|
return;
|
|
3307
3389
|
}
|
|
3308
3390
|
let { parsed: r, inputText: i } = n;
|
|
3309
|
-
|
|
3391
|
+
lr(this.core, r), dr(this.core, r.type), t && this.setInputText(i), fr(this.core, this.managers, r);
|
|
3392
|
+
}
|
|
3393
|
+
resolveRangeApi() {
|
|
3394
|
+
return E.has("range") ? this.core.options.range?.enabled ? this.managers.getPlugin("range") || (this.emitter.emit("error", Qn("RangePlugin")), null) : (this.emitter.emit("error", { error: "range.enabled is false: enable range mode to use the range API" }), null) : (this.emitter.emit("error", Qn("RangePlugin")), null);
|
|
3395
|
+
}
|
|
3396
|
+
setRange(e, t = !0) {
|
|
3397
|
+
if (this.core.isDestroyed) return;
|
|
3398
|
+
let n = this.resolveRangeApi();
|
|
3399
|
+
n && (!this.core.isInitialized && (this.create(), this.core.isDestroyed) || n.setRange(e?.from, e?.to, t) || this.emitter.emit("error", { error: `Invalid range time. Expected "from" and "to" in the setValue format, got "${e?.from}" and "${e?.to}"` }));
|
|
3400
|
+
}
|
|
3401
|
+
getRange() {
|
|
3402
|
+
return this.core.isDestroyed ? null : this.resolveRangeApi()?.getRange() ?? null;
|
|
3403
|
+
}
|
|
3404
|
+
setActivePart(e) {
|
|
3405
|
+
return this.core.isDestroyed ? !1 : this.resolveRangeApi()?.setActivePart(e, { focus: !1 }) ?? !1;
|
|
3406
|
+
}
|
|
3407
|
+
refreshDisabledTime() {
|
|
3408
|
+
this.core.isDestroyed || this.lifecycle.refreshDisabledTime();
|
|
3310
3409
|
}
|
|
3311
3410
|
getElement() {
|
|
3312
3411
|
return this.core.element;
|
|
@@ -3339,10 +3438,10 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3339
3438
|
return this.core.getClockHand();
|
|
3340
3439
|
}
|
|
3341
3440
|
on(e, t) {
|
|
3342
|
-
this.core.isDestroyed
|
|
3441
|
+
return this.core.isDestroyed ? () => {} : this.emitter.on(e, t);
|
|
3343
3442
|
}
|
|
3344
3443
|
once(e, t) {
|
|
3345
|
-
this.core.isDestroyed
|
|
3444
|
+
return this.core.isDestroyed ? () => {} : this.emitter.once(e, t);
|
|
3346
3445
|
}
|
|
3347
3446
|
off(e, t) {
|
|
3348
3447
|
this.core.isDestroyed || this.emitter.off(e, t);
|
|
@@ -3371,4 +3470,4 @@ var $ = /* @__PURE__ */ new Map(), ir = class {
|
|
|
3371
3470
|
}
|
|
3372
3471
|
};
|
|
3373
3472
|
//#endregion
|
|
3374
|
-
export { E as PluginRegistry,
|
|
3473
|
+
export { E as PluginRegistry, pr as TimepickerUI };
|