@situaction/traq-ui-ste 1.2.6 → 1.2.8
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.
|
@@ -2,7 +2,7 @@ import { jsxs as E, jsx as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as O, useRef as I, useEffect as B } from "react";
|
|
3
3
|
import { IconButton as z } from "../icon-button/IconButton.js";
|
|
4
4
|
import { Button as Se } from "../button/Button.js";
|
|
5
|
-
import '../../styles/Calendar.css';const Ne = "_calendar_1b30a_6", je = "_relative_1b30a_15", Ee = "_dropDownCtn_1b30a_18", Fe = "_calendarHeader_1b30a_28", Le = "_calendarWeekdays_1b30a_38", $e = "_calendarGrid_1b30a_39", He = "_calendarDay_1b30a_49", qe = "_today_1b30a_64", Ae = "_selected_1b30a_67", Je = "_disabled_1b30a_74",
|
|
5
|
+
import '../../styles/Calendar.css';const Ne = "_calendar_1b30a_6", je = "_relative_1b30a_15", Ee = "_dropDownCtn_1b30a_18", Fe = "_calendarHeader_1b30a_28", Le = "_calendarWeekdays_1b30a_38", $e = "_calendarGrid_1b30a_39", He = "_calendarDay_1b30a_49", qe = "_today_1b30a_64", Ae = "_selected_1b30a_67", Je = "_disabled_1b30a_74", Xe = "_inRange_1b30a_81", Re = "_dropdown_1b30a_84", Be = "_yearList_1b30a_96", Ve = "_yearItem_1b30a_103", Qe = "_loading_1b30a_111", M = {
|
|
6
6
|
calendar: Ne,
|
|
7
7
|
relative: je,
|
|
8
8
|
dropDownCtn: Ee,
|
|
@@ -13,13 +13,13 @@ import '../../styles/Calendar.css';const Ne = "_calendar_1b30a_6", je = "_relati
|
|
|
13
13
|
today: qe,
|
|
14
14
|
selected: Ae,
|
|
15
15
|
disabled: Je,
|
|
16
|
-
inRange:
|
|
17
|
-
dropdown:
|
|
16
|
+
inRange: Xe,
|
|
17
|
+
dropdown: Re,
|
|
18
18
|
yearList: Be,
|
|
19
19
|
yearItem: Ve,
|
|
20
20
|
loading: Qe
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function m(t) {
|
|
23
23
|
const e = Object.prototype.toString.call(t);
|
|
24
24
|
return t instanceof Date || typeof t == "object" && e === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || e === "[object Number]" || typeof t == "string" || e === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
|
|
25
25
|
}
|
|
@@ -27,11 +27,11 @@ function k(t, e) {
|
|
|
27
27
|
return t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
28
28
|
}
|
|
29
29
|
function Ge(t, e) {
|
|
30
|
-
const n =
|
|
30
|
+
const n = m(t);
|
|
31
31
|
return isNaN(e) ? k(t, NaN) : (n.setDate(n.getDate() + e), n);
|
|
32
32
|
}
|
|
33
33
|
function ie(t, e) {
|
|
34
|
-
const n =
|
|
34
|
+
const n = m(t);
|
|
35
35
|
if (isNaN(e)) return k(t, NaN);
|
|
36
36
|
if (!e)
|
|
37
37
|
return n;
|
|
@@ -50,27 +50,27 @@ function A() {
|
|
|
50
50
|
return ze;
|
|
51
51
|
}
|
|
52
52
|
function N(t, e) {
|
|
53
|
-
var s,
|
|
54
|
-
const n = A(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((
|
|
55
|
-
return r.setDate(r.getDate() -
|
|
53
|
+
var s, f, h, w;
|
|
54
|
+
const n = A(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((f = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : f.weekStartsOn) ?? n.weekStartsOn ?? ((w = (h = n.locale) == null ? void 0 : h.options) == null ? void 0 : w.weekStartsOn) ?? 0, r = m(t), i = r.getDay(), u = (i < a ? 7 : 0) + i - a;
|
|
55
|
+
return r.setDate(r.getDate() - u), r.setHours(0, 0, 0, 0), r;
|
|
56
56
|
}
|
|
57
57
|
function H(t) {
|
|
58
58
|
return N(t, { weekStartsOn: 1 });
|
|
59
59
|
}
|
|
60
60
|
function oe(t) {
|
|
61
|
-
const e =
|
|
61
|
+
const e = m(t), n = e.getFullYear(), a = k(t, 0);
|
|
62
62
|
a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
63
63
|
const r = H(a), i = k(t, 0);
|
|
64
64
|
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
65
|
-
const
|
|
66
|
-
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >=
|
|
65
|
+
const u = H(i);
|
|
66
|
+
return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= u.getTime() ? n : n - 1;
|
|
67
67
|
}
|
|
68
68
|
function q(t) {
|
|
69
|
-
const e =
|
|
69
|
+
const e = m(t);
|
|
70
70
|
return e.setHours(0, 0, 0, 0), e;
|
|
71
71
|
}
|
|
72
72
|
function Z(t) {
|
|
73
|
-
const e =
|
|
73
|
+
const e = m(t), n = new Date(
|
|
74
74
|
Date.UTC(
|
|
75
75
|
e.getFullYear(),
|
|
76
76
|
e.getMonth(),
|
|
@@ -91,7 +91,7 @@ function Ue(t) {
|
|
|
91
91
|
const e = oe(t), n = k(t, 0);
|
|
92
92
|
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), H(n);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function _(t, e) {
|
|
95
95
|
const n = q(t), a = q(e);
|
|
96
96
|
return +n == +a;
|
|
97
97
|
}
|
|
@@ -101,23 +101,23 @@ function Ke(t) {
|
|
|
101
101
|
function et(t) {
|
|
102
102
|
if (!Ke(t) && typeof t != "number")
|
|
103
103
|
return !1;
|
|
104
|
-
const e =
|
|
104
|
+
const e = m(t);
|
|
105
105
|
return !isNaN(Number(e));
|
|
106
106
|
}
|
|
107
107
|
function tt(t) {
|
|
108
|
-
const e =
|
|
108
|
+
const e = m(t), n = e.getMonth();
|
|
109
109
|
return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
110
110
|
}
|
|
111
111
|
function nt(t) {
|
|
112
|
-
const e =
|
|
112
|
+
const e = m(t);
|
|
113
113
|
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
114
114
|
}
|
|
115
115
|
function at(t) {
|
|
116
|
-
const e =
|
|
116
|
+
const e = m(t), n = k(t, 0);
|
|
117
117
|
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
118
118
|
}
|
|
119
119
|
function rt(t, e) {
|
|
120
|
-
const n = e == null ? void 0 : e.weekStartsOn, a =
|
|
120
|
+
const n = e == null ? void 0 : e.weekStartsOn, a = m(t), r = a.getDay(), i = (r < n ? -7 : 0) + 6 - (r - n);
|
|
121
121
|
return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
|
|
122
122
|
}
|
|
123
123
|
const it = {
|
|
@@ -234,11 +234,11 @@ function p(t) {
|
|
|
234
234
|
const a = n != null && n.context ? String(n.context) : "standalone";
|
|
235
235
|
let r;
|
|
236
236
|
if (a === "formatting" && t.formattingValues) {
|
|
237
|
-
const
|
|
238
|
-
r = t.formattingValues[s] || t.formattingValues[
|
|
237
|
+
const u = t.defaultFormattingWidth || t.defaultWidth, s = n != null && n.width ? String(n.width) : u;
|
|
238
|
+
r = t.formattingValues[s] || t.formattingValues[u];
|
|
239
239
|
} else {
|
|
240
|
-
const
|
|
241
|
-
r = t.values[s] || t.values[
|
|
240
|
+
const u = t.defaultWidth, s = n != null && n.width ? String(n.width) : t.defaultWidth;
|
|
241
|
+
r = t.values[s] || t.values[u];
|
|
242
242
|
}
|
|
243
243
|
const i = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
244
244
|
return r[i];
|
|
@@ -400,17 +400,17 @@ function D(t) {
|
|
|
400
400
|
const a = n.width, r = a && t.matchPatterns[a] || t.matchPatterns[t.defaultMatchWidth], i = e.match(r);
|
|
401
401
|
if (!i)
|
|
402
402
|
return null;
|
|
403
|
-
const
|
|
403
|
+
const u = i[0], s = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(s) ? pt(s, (v) => v.test(u)) : (
|
|
404
404
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
405
|
-
Pt(s, (v) => v.test(
|
|
405
|
+
Pt(s, (v) => v.test(u))
|
|
406
406
|
);
|
|
407
|
-
let
|
|
408
|
-
|
|
407
|
+
let h;
|
|
408
|
+
h = t.valueCallback ? t.valueCallback(f) : f, h = n.valueCallback ? (
|
|
409
409
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
410
|
-
n.valueCallback(
|
|
411
|
-
) :
|
|
412
|
-
const w = e.slice(
|
|
413
|
-
return { value:
|
|
410
|
+
n.valueCallback(h)
|
|
411
|
+
) : h;
|
|
412
|
+
const w = e.slice(u.length);
|
|
413
|
+
return { value: h, rest: w };
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
416
|
function Pt(t, e) {
|
|
@@ -429,10 +429,10 @@ function ce(t) {
|
|
|
429
429
|
if (!a) return null;
|
|
430
430
|
const r = a[0], i = e.match(t.parsePattern);
|
|
431
431
|
if (!i) return null;
|
|
432
|
-
let
|
|
433
|
-
|
|
432
|
+
let u = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
433
|
+
u = n.valueCallback ? n.valueCallback(u) : u;
|
|
434
434
|
const s = e.slice(r.length);
|
|
435
|
-
return { value:
|
|
435
|
+
return { value: u, rest: s };
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
const Dt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Ot = {
|
|
@@ -552,32 +552,32 @@ const Dt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Ot = {
|
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
554
|
function Lt(t) {
|
|
555
|
-
const e =
|
|
555
|
+
const e = m(t);
|
|
556
556
|
return Ze(e, at(e)) + 1;
|
|
557
557
|
}
|
|
558
558
|
function $t(t) {
|
|
559
|
-
const e =
|
|
559
|
+
const e = m(t), n = +H(e) - +Ue(e);
|
|
560
560
|
return Math.round(n / se) + 1;
|
|
561
561
|
}
|
|
562
562
|
function ue(t, e) {
|
|
563
563
|
var w, v, x, T;
|
|
564
|
-
const n =
|
|
565
|
-
|
|
566
|
-
const s = N(
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >=
|
|
564
|
+
const n = m(t), a = n.getFullYear(), r = A(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((v = (w = e == null ? void 0 : e.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((T = (x = r.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, u = k(t, 0);
|
|
565
|
+
u.setFullYear(a + 1, 0, i), u.setHours(0, 0, 0, 0);
|
|
566
|
+
const s = N(u, e), f = k(t, 0);
|
|
567
|
+
f.setFullYear(a, 0, i), f.setHours(0, 0, 0, 0);
|
|
568
|
+
const h = N(f, e);
|
|
569
|
+
return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >= h.getTime() ? a : a - 1;
|
|
570
570
|
}
|
|
571
571
|
function Ht(t, e) {
|
|
572
|
-
var s,
|
|
573
|
-
const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((
|
|
572
|
+
var s, f, h, w;
|
|
573
|
+
const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((f = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : f.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((w = (h = n.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, r = ue(t, e), i = k(t, 0);
|
|
574
574
|
return i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0), N(i, e);
|
|
575
575
|
}
|
|
576
576
|
function qt(t, e) {
|
|
577
|
-
const n =
|
|
577
|
+
const n = m(t), a = +N(n, e) - +Ht(n, e);
|
|
578
578
|
return Math.round(a / se) + 1;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function d(t, e) {
|
|
581
581
|
const n = t < 0 ? "-" : "", a = Math.abs(t).toString().padStart(e, "0");
|
|
582
582
|
return n + a;
|
|
583
583
|
}
|
|
@@ -585,16 +585,16 @@ const W = {
|
|
|
585
585
|
// Year
|
|
586
586
|
y(t, e) {
|
|
587
587
|
const n = t.getFullYear(), a = n > 0 ? n : 1 - n;
|
|
588
|
-
return
|
|
588
|
+
return d(e === "yy" ? a % 100 : a, e.length);
|
|
589
589
|
},
|
|
590
590
|
// Month
|
|
591
591
|
M(t, e) {
|
|
592
592
|
const n = t.getMonth();
|
|
593
|
-
return e === "M" ? String(n + 1) :
|
|
593
|
+
return e === "M" ? String(n + 1) : d(n + 1, 2);
|
|
594
594
|
},
|
|
595
595
|
// Day of the month
|
|
596
596
|
d(t, e) {
|
|
597
|
-
return
|
|
597
|
+
return d(t.getDate(), e.length);
|
|
598
598
|
},
|
|
599
599
|
// AM or PM
|
|
600
600
|
a(t, e) {
|
|
@@ -614,26 +614,26 @@ const W = {
|
|
|
614
614
|
},
|
|
615
615
|
// Hour [1-12]
|
|
616
616
|
h(t, e) {
|
|
617
|
-
return
|
|
617
|
+
return d(t.getHours() % 12 || 12, e.length);
|
|
618
618
|
},
|
|
619
619
|
// Hour [0-23]
|
|
620
620
|
H(t, e) {
|
|
621
|
-
return
|
|
621
|
+
return d(t.getHours(), e.length);
|
|
622
622
|
},
|
|
623
623
|
// Minute
|
|
624
624
|
m(t, e) {
|
|
625
|
-
return
|
|
625
|
+
return d(t.getMinutes(), e.length);
|
|
626
626
|
},
|
|
627
627
|
// Second
|
|
628
628
|
s(t, e) {
|
|
629
|
-
return
|
|
629
|
+
return d(t.getSeconds(), e.length);
|
|
630
630
|
},
|
|
631
631
|
// Fraction of second
|
|
632
632
|
S(t, e) {
|
|
633
633
|
const n = e.length, a = t.getMilliseconds(), r = Math.trunc(
|
|
634
634
|
a * Math.pow(10, n - 3)
|
|
635
635
|
);
|
|
636
|
-
return
|
|
636
|
+
return d(r, e.length);
|
|
637
637
|
}
|
|
638
638
|
}, C = {
|
|
639
639
|
am: "am",
|
|
@@ -672,15 +672,15 @@ const W = {
|
|
|
672
672
|
Y: function(t, e, n, a) {
|
|
673
673
|
const r = ue(t, a), i = r > 0 ? r : 1 - r;
|
|
674
674
|
if (e === "YY") {
|
|
675
|
-
const
|
|
676
|
-
return u
|
|
675
|
+
const u = i % 100;
|
|
676
|
+
return d(u, 2);
|
|
677
677
|
}
|
|
678
|
-
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) :
|
|
678
|
+
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : d(i, e.length);
|
|
679
679
|
},
|
|
680
680
|
// ISO week-numbering year
|
|
681
681
|
R: function(t, e) {
|
|
682
682
|
const n = oe(t);
|
|
683
|
-
return
|
|
683
|
+
return d(n, e.length);
|
|
684
684
|
},
|
|
685
685
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
686
686
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -693,7 +693,7 @@ const W = {
|
|
|
693
693
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
694
694
|
u: function(t, e) {
|
|
695
695
|
const n = t.getFullYear();
|
|
696
|
-
return
|
|
696
|
+
return d(n, e.length);
|
|
697
697
|
},
|
|
698
698
|
// Quarter
|
|
699
699
|
Q: function(t, e, n) {
|
|
@@ -702,7 +702,7 @@ const W = {
|
|
|
702
702
|
case "Q":
|
|
703
703
|
return String(a);
|
|
704
704
|
case "QQ":
|
|
705
|
-
return
|
|
705
|
+
return d(a, 2);
|
|
706
706
|
case "Qo":
|
|
707
707
|
return n.ordinalNumber(a, { unit: "quarter" });
|
|
708
708
|
case "QQQ":
|
|
@@ -730,7 +730,7 @@ const W = {
|
|
|
730
730
|
case "q":
|
|
731
731
|
return String(a);
|
|
732
732
|
case "qq":
|
|
733
|
-
return
|
|
733
|
+
return d(a, 2);
|
|
734
734
|
case "qo":
|
|
735
735
|
return n.ordinalNumber(a, { unit: "quarter" });
|
|
736
736
|
case "qqq":
|
|
@@ -782,7 +782,7 @@ const W = {
|
|
|
782
782
|
case "L":
|
|
783
783
|
return String(a + 1);
|
|
784
784
|
case "LL":
|
|
785
|
-
return
|
|
785
|
+
return d(a + 1, 2);
|
|
786
786
|
case "Lo":
|
|
787
787
|
return n.ordinalNumber(a + 1, { unit: "month" });
|
|
788
788
|
case "LLL":
|
|
@@ -803,12 +803,12 @@ const W = {
|
|
|
803
803
|
// Local week of year
|
|
804
804
|
w: function(t, e, n, a) {
|
|
805
805
|
const r = qt(t, a);
|
|
806
|
-
return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
806
|
+
return e === "wo" ? n.ordinalNumber(r, { unit: "week" }) : d(r, e.length);
|
|
807
807
|
},
|
|
808
808
|
// ISO week of year
|
|
809
809
|
I: function(t, e, n) {
|
|
810
810
|
const a = $t(t);
|
|
811
|
-
return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) :
|
|
811
|
+
return e === "Io" ? n.ordinalNumber(a, { unit: "week" }) : d(a, e.length);
|
|
812
812
|
},
|
|
813
813
|
// Day of the month
|
|
814
814
|
d: function(t, e, n) {
|
|
@@ -817,7 +817,7 @@ const W = {
|
|
|
817
817
|
// Day of year
|
|
818
818
|
D: function(t, e, n) {
|
|
819
819
|
const a = Lt(t);
|
|
820
|
-
return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) :
|
|
820
|
+
return e === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : d(a, e.length);
|
|
821
821
|
},
|
|
822
822
|
// Day of week
|
|
823
823
|
E: function(t, e, n) {
|
|
@@ -855,7 +855,7 @@ const W = {
|
|
|
855
855
|
case "e":
|
|
856
856
|
return String(i);
|
|
857
857
|
case "ee":
|
|
858
|
-
return
|
|
858
|
+
return d(i, 2);
|
|
859
859
|
case "eo":
|
|
860
860
|
return n.ordinalNumber(i, { unit: "day" });
|
|
861
861
|
case "eee":
|
|
@@ -888,7 +888,7 @@ const W = {
|
|
|
888
888
|
case "c":
|
|
889
889
|
return String(i);
|
|
890
890
|
case "cc":
|
|
891
|
-
return
|
|
891
|
+
return d(i, e.length);
|
|
892
892
|
case "co":
|
|
893
893
|
return n.ordinalNumber(i, { unit: "day" });
|
|
894
894
|
case "ccc":
|
|
@@ -921,7 +921,7 @@ const W = {
|
|
|
921
921
|
case "i":
|
|
922
922
|
return String(r);
|
|
923
923
|
case "ii":
|
|
924
|
-
return
|
|
924
|
+
return d(r, e.length);
|
|
925
925
|
case "io":
|
|
926
926
|
return n.ordinalNumber(r, { unit: "day" });
|
|
927
927
|
case "iii":
|
|
@@ -1044,12 +1044,12 @@ const W = {
|
|
|
1044
1044
|
// Hour [0-11]
|
|
1045
1045
|
K: function(t, e, n) {
|
|
1046
1046
|
const a = t.getHours() % 12;
|
|
1047
|
-
return e === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) :
|
|
1047
|
+
return e === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : d(a, e.length);
|
|
1048
1048
|
},
|
|
1049
1049
|
// Hour [1-24]
|
|
1050
1050
|
k: function(t, e, n) {
|
|
1051
1051
|
let a = t.getHours();
|
|
1052
|
-
return a === 0 && (a = 24), e === "ko" ? n.ordinalNumber(a, { unit: "hour" }) :
|
|
1052
|
+
return a === 0 && (a = 24), e === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : d(a, e.length);
|
|
1053
1053
|
},
|
|
1054
1054
|
// Minute
|
|
1055
1055
|
m: function(t, e, n) {
|
|
@@ -1073,11 +1073,11 @@ const W = {
|
|
|
1073
1073
|
return ee(a);
|
|
1074
1074
|
case "XXXX":
|
|
1075
1075
|
case "XX":
|
|
1076
|
-
return
|
|
1076
|
+
return Y(a);
|
|
1077
1077
|
case "XXXXX":
|
|
1078
1078
|
case "XXX":
|
|
1079
1079
|
default:
|
|
1080
|
-
return
|
|
1080
|
+
return Y(a, ":");
|
|
1081
1081
|
}
|
|
1082
1082
|
},
|
|
1083
1083
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1088,11 +1088,11 @@ const W = {
|
|
|
1088
1088
|
return ee(a);
|
|
1089
1089
|
case "xxxx":
|
|
1090
1090
|
case "xx":
|
|
1091
|
-
return
|
|
1091
|
+
return Y(a);
|
|
1092
1092
|
case "xxxxx":
|
|
1093
1093
|
case "xxx":
|
|
1094
1094
|
default:
|
|
1095
|
-
return
|
|
1095
|
+
return Y(a, ":");
|
|
1096
1096
|
}
|
|
1097
1097
|
},
|
|
1098
1098
|
// Timezone (GMT)
|
|
@@ -1105,7 +1105,7 @@ const W = {
|
|
|
1105
1105
|
return "GMT" + K(a, ":");
|
|
1106
1106
|
case "OOOO":
|
|
1107
1107
|
default:
|
|
1108
|
-
return "GMT" +
|
|
1108
|
+
return "GMT" + Y(a, ":");
|
|
1109
1109
|
}
|
|
1110
1110
|
},
|
|
1111
1111
|
// Timezone (specific non-location)
|
|
@@ -1118,29 +1118,29 @@ const W = {
|
|
|
1118
1118
|
return "GMT" + K(a, ":");
|
|
1119
1119
|
case "zzzz":
|
|
1120
1120
|
default:
|
|
1121
|
-
return "GMT" +
|
|
1121
|
+
return "GMT" + Y(a, ":");
|
|
1122
1122
|
}
|
|
1123
1123
|
},
|
|
1124
1124
|
// Seconds timestamp
|
|
1125
1125
|
t: function(t, e, n) {
|
|
1126
1126
|
const a = Math.trunc(t.getTime() / 1e3);
|
|
1127
|
-
return
|
|
1127
|
+
return d(a, e.length);
|
|
1128
1128
|
},
|
|
1129
1129
|
// Milliseconds timestamp
|
|
1130
1130
|
T: function(t, e, n) {
|
|
1131
1131
|
const a = t.getTime();
|
|
1132
|
-
return
|
|
1132
|
+
return d(a, e.length);
|
|
1133
1133
|
}
|
|
1134
1134
|
};
|
|
1135
1135
|
function K(t, e = "") {
|
|
1136
1136
|
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = Math.trunc(a / 60), i = a % 60;
|
|
1137
|
-
return i === 0 ? n + String(r) : n + String(r) + e +
|
|
1137
|
+
return i === 0 ? n + String(r) : n + String(r) + e + d(i, 2);
|
|
1138
1138
|
}
|
|
1139
1139
|
function ee(t, e) {
|
|
1140
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1140
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + d(Math.abs(t) / 60, 2) : Y(t, e);
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const n = t > 0 ? "-" : "+", a = Math.abs(t), r =
|
|
1142
|
+
function Y(t, e = "") {
|
|
1143
|
+
const n = t > 0 ? "-" : "+", a = Math.abs(t), r = d(Math.trunc(a / 60), 2), i = d(a % 60, 2);
|
|
1144
1144
|
return n + r + e + i;
|
|
1145
1145
|
}
|
|
1146
1146
|
const te = (t, e) => {
|
|
@@ -1191,12 +1191,12 @@ const te = (t, e) => {
|
|
|
1191
1191
|
}, Jt = {
|
|
1192
1192
|
p: de,
|
|
1193
1193
|
P: At
|
|
1194
|
-
},
|
|
1194
|
+
}, Xt = /^D+$/, Rt = /^Y+$/, Bt = ["D", "DD", "YY", "YYYY"];
|
|
1195
1195
|
function Vt(t) {
|
|
1196
|
-
return
|
|
1196
|
+
return Xt.test(t);
|
|
1197
1197
|
}
|
|
1198
1198
|
function Qt(t) {
|
|
1199
|
-
return
|
|
1199
|
+
return Rt.test(t);
|
|
1200
1200
|
}
|
|
1201
1201
|
function Gt(t, e, n) {
|
|
1202
1202
|
const a = It(t, e, n);
|
|
@@ -1209,10 +1209,10 @@ function It(t, e, n) {
|
|
|
1209
1209
|
const zt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Zt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ut = /^'([^]*?)'?$/, Kt = /''/g, en = /[a-zA-Z]/;
|
|
1210
1210
|
function ne(t, e, n) {
|
|
1211
1211
|
var w, v, x, T, F, L, j, $;
|
|
1212
|
-
const a = A(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? Ft, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((v = (w = n == null ? void 0 : n.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((T = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1,
|
|
1212
|
+
const a = A(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? Ft, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((v = (w = n == null ? void 0 : n.locale) == null ? void 0 : w.options) == null ? void 0 : v.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((T = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, u = (n == null ? void 0 : n.weekStartsOn) ?? ((L = (F = n == null ? void 0 : n.locale) == null ? void 0 : F.options) == null ? void 0 : L.weekStartsOn) ?? a.weekStartsOn ?? (($ = (j = a.locale) == null ? void 0 : j.options) == null ? void 0 : $.weekStartsOn) ?? 0, s = m(t);
|
|
1213
1213
|
if (!et(s))
|
|
1214
1214
|
throw new RangeError("Invalid time value");
|
|
1215
|
-
let
|
|
1215
|
+
let f = e.match(Zt).map((y) => {
|
|
1216
1216
|
const b = y[0];
|
|
1217
1217
|
if (b === "p" || b === "P") {
|
|
1218
1218
|
const P = Jt[b];
|
|
@@ -1233,18 +1233,18 @@ function ne(t, e, n) {
|
|
|
1233
1233
|
);
|
|
1234
1234
|
return { isToken: !1, value: y };
|
|
1235
1235
|
});
|
|
1236
|
-
r.localize.preprocessor && (
|
|
1237
|
-
const
|
|
1236
|
+
r.localize.preprocessor && (f = r.localize.preprocessor(s, f));
|
|
1237
|
+
const h = {
|
|
1238
1238
|
firstWeekContainsDate: i,
|
|
1239
|
-
weekStartsOn:
|
|
1239
|
+
weekStartsOn: u,
|
|
1240
1240
|
locale: r
|
|
1241
1241
|
};
|
|
1242
|
-
return
|
|
1242
|
+
return f.map((y) => {
|
|
1243
1243
|
if (!y.isToken) return y.value;
|
|
1244
1244
|
const b = y.value;
|
|
1245
1245
|
(!(n != null && n.useAdditionalWeekYearTokens) && Qt(b) || !(n != null && n.useAdditionalDayOfYearTokens) && Vt(b)) && Gt(b, e, String(t));
|
|
1246
1246
|
const P = U[b[0]];
|
|
1247
|
-
return P(s, b, r.localize,
|
|
1247
|
+
return P(s, b, r.localize, h);
|
|
1248
1248
|
}).join("");
|
|
1249
1249
|
}
|
|
1250
1250
|
function tn(t) {
|
|
@@ -1252,15 +1252,15 @@ function tn(t) {
|
|
|
1252
1252
|
return e ? e[1].replace(Kt, "'") : t;
|
|
1253
1253
|
}
|
|
1254
1254
|
function ae(t, e) {
|
|
1255
|
-
const n =
|
|
1255
|
+
const n = m(t), a = m(e);
|
|
1256
1256
|
return n.getTime() > a.getTime();
|
|
1257
1257
|
}
|
|
1258
1258
|
function re(t, e) {
|
|
1259
|
-
const n =
|
|
1259
|
+
const n = m(t), a = m(e);
|
|
1260
1260
|
return +n < +a;
|
|
1261
1261
|
}
|
|
1262
1262
|
function nn(t, e) {
|
|
1263
|
-
const n =
|
|
1263
|
+
const n = m(t), a = m(e);
|
|
1264
1264
|
return n.getFullYear() === a.getFullYear() && n.getMonth() === a.getMonth();
|
|
1265
1265
|
}
|
|
1266
1266
|
function an(t, e) {
|
|
@@ -1599,27 +1599,26 @@ const rn = {
|
|
|
1599
1599
|
firstWeekContainsDate: 4
|
|
1600
1600
|
}
|
|
1601
1601
|
}, Hn = ({ selectRange: t = !1, selectedDate: e, onDateSelect: n, maxDateSelected: a, minDateSelected: r }) => {
|
|
1602
|
-
const [i,
|
|
1602
|
+
const [i, u] = O(() => t && e && "start" in e ? e.start : /* @__PURE__ */ new Date()), [s, f] = O(e || null), [h, w] = O(!1), [v, x] = O(null), [T, F] = O([]), [L, j] = O(!1), [$, y] = O((/* @__PURE__ */ new Date()).getFullYear()), b = 1900, P = I(null), J = I(null), le = /* @__PURE__ */ new Date(), V = nt(i), me = tt(i), he = N(V, { weekStartsOn: 1 }), fe = rt(me, { weekStartsOn: 1 }), [X, ge] = O(null);
|
|
1603
1603
|
B(() => {
|
|
1604
|
-
|
|
1604
|
+
e && (t && JSON.stringify(e) !== JSON.stringify(s) || !t && e instanceof Date && !_(e, s)) && (f(e ?? null), t && "start" in e ? u(e.start) : !t && e instanceof Date && u(e));
|
|
1605
1605
|
}, [e, t]);
|
|
1606
1606
|
const Q = (o) => {
|
|
1607
|
-
|
|
1607
|
+
u((c) => o > 0 ? ie(c, 1) : an(c, 1));
|
|
1608
1608
|
}, we = (o) => {
|
|
1609
|
+
let c;
|
|
1609
1610
|
if (t)
|
|
1610
|
-
if (
|
|
1611
|
-
s && typeof s == "object" && "start" in s && "end" in s
|
|
1611
|
+
if (X !== null && o)
|
|
1612
|
+
s && typeof s == "object" && "start" in s && "end" in s ? X === s.start ? c = o < s.start ? { start: o, end: s.start } : { start: s.start, end: o } : X === s.end ? c = o > s.end ? { start: s.end, end: o } : { start: o, end: s.end } : c = { start: o, end: o } : c = { start: o, end: o };
|
|
1612
1613
|
else if (!s || !(typeof s == "object" && "start" in s))
|
|
1613
|
-
|
|
1614
|
+
c = { start: o, end: o };
|
|
1614
1615
|
else {
|
|
1615
|
-
const { start:
|
|
1616
|
-
o <
|
|
1616
|
+
const { start: l } = s;
|
|
1617
|
+
c = o < l ? { start: o, end: l } : { start: l, end: o };
|
|
1617
1618
|
}
|
|
1618
1619
|
else
|
|
1619
|
-
|
|
1620
|
-
ge(o), n(
|
|
1621
|
-
t ? s : o
|
|
1622
|
-
);
|
|
1620
|
+
c = o;
|
|
1621
|
+
f(c), ge(o), n(c);
|
|
1623
1622
|
}, be = () => w((o) => !o);
|
|
1624
1623
|
B(() => {
|
|
1625
1624
|
G();
|
|
@@ -1627,54 +1626,54 @@ const rn = {
|
|
|
1627
1626
|
const G = () => {
|
|
1628
1627
|
L || (j(!0), setTimeout(() => {
|
|
1629
1628
|
const o = [];
|
|
1630
|
-
let
|
|
1631
|
-
for (let
|
|
1632
|
-
o.push(
|
|
1633
|
-
o.length > 0 && (F((
|
|
1629
|
+
let c = $;
|
|
1630
|
+
for (let l = 0; l < 10 && !(c < b); l++)
|
|
1631
|
+
o.push(c), c -= 1;
|
|
1632
|
+
o.length > 0 && (F((l) => [...l, ...o]), y(c)), j(!1);
|
|
1634
1633
|
}, 500));
|
|
1635
1634
|
};
|
|
1636
1635
|
B(() => {
|
|
1637
|
-
if (
|
|
1636
|
+
if (h && v && P.current) {
|
|
1638
1637
|
const o = P.current.querySelector(`[data-year="${v}"]`);
|
|
1639
1638
|
o && P.current && (P.current.scrollTop = o.offsetTop - P.current.offsetTop);
|
|
1640
1639
|
}
|
|
1641
|
-
}, [
|
|
1642
|
-
const ye = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((
|
|
1643
|
-
let o = [],
|
|
1644
|
-
for (;
|
|
1645
|
-
o.push(
|
|
1646
|
-
return o.map((
|
|
1647
|
-
const
|
|
1640
|
+
}, [h, v]);
|
|
1641
|
+
const ye = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((c, l) => /* @__PURE__ */ g("div", { className: M.calendarWeekdays, children: c }, l)), Me = () => {
|
|
1642
|
+
let o = [], c = he;
|
|
1643
|
+
for (; c <= fe; )
|
|
1644
|
+
o.push(c), c = Ge(c, 1);
|
|
1645
|
+
return o.map((l, De) => {
|
|
1646
|
+
const R = s && typeof s == "object" && "start" in s && "end" in s, ke = R && _(l, s.start), Oe = R && _(l, s.end), We = R && ae(l, s.start) && re(l, s.end), xe = r && (re(l, r) || _(l, r)), Te = a && (ae(l, a) || _(l, a)), _e = r && xe || a && Te, Ye = !nn(l, V), Ce = _e || Ye;
|
|
1648
1647
|
return /* @__PURE__ */ g(
|
|
1649
1648
|
"div",
|
|
1650
1649
|
{
|
|
1651
1650
|
className: `
|
|
1652
1651
|
${M.calendarDay}
|
|
1653
|
-
${
|
|
1654
|
-
${s &&
|
|
1652
|
+
${_(l, le) ? M.today : ""}
|
|
1653
|
+
${s && _(l, s) ? M.selected : ""}
|
|
1655
1654
|
${ke || Oe ? M.selected : ""} // Applique 'selected' si start ou end
|
|
1656
1655
|
${We ? M.inRange : ""} // Applique 'inRange' si la date est entre start et end
|
|
1657
1656
|
${Ce ? M.disabled : ""}
|
|
1658
1657
|
`,
|
|
1659
|
-
onClick: () => we(
|
|
1660
|
-
children: ne(
|
|
1658
|
+
onClick: () => we(l),
|
|
1659
|
+
children: ne(l, "d")
|
|
1661
1660
|
},
|
|
1662
1661
|
De
|
|
1663
1662
|
);
|
|
1664
1663
|
});
|
|
1665
1664
|
}, ve = (o) => {
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1665
|
+
const c = o.currentTarget;
|
|
1666
|
+
c.scrollHeight === c.scrollTop + c.clientHeight && G();
|
|
1668
1667
|
}, Pe = () => {
|
|
1669
|
-
const o = (
|
|
1670
|
-
P.current && !P.current.contains(
|
|
1668
|
+
const o = (c) => {
|
|
1669
|
+
P.current && !P.current.contains(c.target) && J.current && !J.current.contains(c.target) && w(!1);
|
|
1671
1670
|
};
|
|
1672
1671
|
return document.addEventListener("click", o), () => {
|
|
1673
1672
|
document.removeEventListener("click", o);
|
|
1674
1673
|
};
|
|
1675
1674
|
}, pe = (o) => {
|
|
1676
|
-
const
|
|
1677
|
-
return
|
|
1675
|
+
const c = ne(o, "MMM yyyy", { locale: jn });
|
|
1676
|
+
return c.charAt(0).toUpperCase() + c.slice(1);
|
|
1678
1677
|
};
|
|
1679
1678
|
return /* @__PURE__ */ E("div", { className: M.calendar, onClick: Pe, children: [
|
|
1680
1679
|
/* @__PURE__ */ E("div", { className: `${M.calendarHeader}`, children: [
|
|
@@ -1690,10 +1689,10 @@ const rn = {
|
|
|
1690
1689
|
mode: "tertiary",
|
|
1691
1690
|
label: pe(i),
|
|
1692
1691
|
onClick: be,
|
|
1693
|
-
childrenRight:
|
|
1692
|
+
childrenRight: h ? /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ g("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }) }) : /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: /* @__PURE__ */ g("path", { d: "M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z" }) })
|
|
1694
1693
|
}
|
|
1695
1694
|
),
|
|
1696
|
-
|
|
1695
|
+
h && /* @__PURE__ */ g("div", { className: M.dropdown, children: /* @__PURE__ */ g(
|
|
1697
1696
|
"div",
|
|
1698
1697
|
{
|
|
1699
1698
|
ref: P,
|
|
@@ -1705,7 +1704,7 @@ const rn = {
|
|
|
1705
1704
|
"data-year": o,
|
|
1706
1705
|
className: M.yearItem,
|
|
1707
1706
|
onClick: () => {
|
|
1708
|
-
x(o),
|
|
1707
|
+
x(o), u(new Date(o, i.getMonth())), w(!1);
|
|
1709
1708
|
},
|
|
1710
1709
|
children: o
|
|
1711
1710
|
},
|
|
@@ -3,21 +3,22 @@ import { FC, ReactNode } from 'react';
|
|
|
3
3
|
export interface TabsProps {
|
|
4
4
|
/** select the type of data text or icon that we put in tabs */
|
|
5
5
|
type: 'text' | 'icon' | 'button';
|
|
6
|
-
/** Array of strings representing the labels of the tabs */
|
|
6
|
+
/** Array of strings or nodes representing the labels of the tabs */
|
|
7
7
|
listItems: (string | ReactNode)[];
|
|
8
|
-
/**
|
|
8
|
+
/** Active tab (controlled) */
|
|
9
|
+
activeTab?: number;
|
|
10
|
+
/** Index of the tab that should be active by default (uncontrolled) */
|
|
9
11
|
defaultActiveTab?: number;
|
|
10
12
|
/** Position Tabs */
|
|
11
13
|
position?: 'center' | 'right' | 'left';
|
|
12
|
-
/** Callback
|
|
13
|
-
onTabSelect: (selectedItem: string | ReactNode) => void;
|
|
14
|
-
/** Full width*/
|
|
14
|
+
/** Callback on selection (label + index) */
|
|
15
|
+
onTabSelect: (selectedItem: string | ReactNode, index?: number) => void;
|
|
16
|
+
/** Full width */
|
|
15
17
|
fullWidth?: boolean;
|
|
16
|
-
/** tabs
|
|
18
|
+
/** Disabled tabs indices */
|
|
17
19
|
disabledTabs?: number[];
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
|
-
* Tabs
|
|
21
|
-
* It includes a dynamic underline to show the active tab.
|
|
22
|
+
* Tabs with dynamic underline. Works controlled (activeTab) or uncontrolled (defaultActiveTab).
|
|
22
23
|
*/
|
|
23
24
|
export declare const Tabs: FC<TabsProps>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import '../../styles/Tabs.css';const
|
|
1
|
+
import { jsxs as j, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as $, useEffect as u, useLayoutEffect as k } from "react";
|
|
3
|
+
import { Button as q } from "../button/Button.js";
|
|
4
|
+
import { IconButton as B } from "../icon-button/IconButton.js";
|
|
5
|
+
import '../../styles/Tabs.css';const L = "_underline_6o3gh_70", n = {
|
|
6
6
|
"tab-container": "_tab-container_6o3gh_30",
|
|
7
7
|
"tab-container-button": "_tab-container-button_6o3gh_34",
|
|
8
8
|
"tab-container-icon": "_tab-container-icon_6o3gh_39",
|
|
@@ -12,85 +12,114 @@ import '../../styles/Tabs.css';const j = "_underline_6o3gh_70", e = {
|
|
|
12
12
|
"tab-full-width": "_tab-full-width_6o3gh_51",
|
|
13
13
|
"selected-button": "_selected-button_6o3gh_57",
|
|
14
14
|
"selected-text": "_selected-text_6o3gh_63",
|
|
15
|
-
underline:
|
|
15
|
+
underline: L,
|
|
16
16
|
"flexHorizontal-center": "_flexHorizontal-center_6o3gh_78",
|
|
17
17
|
"flexHorizontal-left": "_flexHorizontal-left_6o3gh_84",
|
|
18
18
|
"flexHorizontal-right": "_flexHorizontal-right_6o3gh_90"
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
}, C = (o, r) => {
|
|
20
|
+
if (!Number.isFinite(o)) return 0;
|
|
21
|
+
const b = Math.max(0, r);
|
|
22
|
+
return Math.min(Math.max(o, 0), b);
|
|
23
|
+
}, D = ({
|
|
24
|
+
listItems: o,
|
|
25
|
+
type: r,
|
|
26
|
+
onTabSelect: b,
|
|
27
|
+
activeTab: _,
|
|
28
|
+
defaultActiveTab: f = 0,
|
|
24
29
|
position: m = "left",
|
|
25
|
-
fullWidth:
|
|
26
|
-
disabledTabs:
|
|
27
|
-
// ✅ par défaut vide
|
|
30
|
+
fullWidth: H = !1,
|
|
31
|
+
disabledTabs: g = []
|
|
28
32
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const c = _ !== void 0, [N, x] = R(f), h = C(
|
|
34
|
+
c ? _ : N,
|
|
35
|
+
(o.length || 1) - 1
|
|
36
|
+
), [A, E] = R({}), l = $(null), z = $([]), v = (t) => {
|
|
37
|
+
g.includes(t) || (c || x(t), b(o[t], t));
|
|
38
|
+
}, w = (t) => {
|
|
39
|
+
if (!l.current || !t || r === "button") return;
|
|
40
|
+
const e = l.current.getBoundingClientRect();
|
|
41
|
+
if (e.width === 0) {
|
|
42
|
+
requestAnimationFrame(() => w(t));
|
|
43
|
+
return;
|
|
38
44
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return B(() => {
|
|
44
|
-
const t = _.current[s];
|
|
45
|
-
t && requestAnimationFrame(() => {
|
|
46
|
-
H(t);
|
|
45
|
+
const i = t.getBoundingClientRect();
|
|
46
|
+
E({
|
|
47
|
+
left: `${i.left - e.left}px`,
|
|
48
|
+
width: `${i.width}px`
|
|
47
49
|
});
|
|
48
|
-
},
|
|
50
|
+
}, a = () => {
|
|
51
|
+
const t = z.current[h] ?? null;
|
|
52
|
+
requestAnimationFrame(
|
|
53
|
+
() => requestAnimationFrame(() => w(t))
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
u(() => {
|
|
57
|
+
c && a();
|
|
58
|
+
}, [_]), k(() => {
|
|
59
|
+
a();
|
|
60
|
+
}, [h, m, o.length]), u(() => {
|
|
61
|
+
c || x(C(f, (o.length || 1) - 1));
|
|
62
|
+
}, [f, o.length, c]), u(() => {
|
|
63
|
+
var t, e;
|
|
64
|
+
(e = (t = document.fonts) == null ? void 0 : t.ready) == null || e.then(() => a());
|
|
65
|
+
}, []), u(() => {
|
|
66
|
+
const t = () => a();
|
|
67
|
+
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
68
|
+
}, []), u(() => {
|
|
69
|
+
if (!l.current) return;
|
|
70
|
+
const t = new ResizeObserver(() => a());
|
|
71
|
+
return t.observe(l.current), () => t.disconnect();
|
|
72
|
+
}, []);
|
|
73
|
+
const F = [
|
|
74
|
+
n[`flexHorizontal-${m}`],
|
|
75
|
+
r === "button" ? n["tab-items-button"] : n["tab-items"]
|
|
76
|
+
].filter(Boolean).join(" ");
|
|
77
|
+
return /* @__PURE__ */ j(
|
|
49
78
|
"div",
|
|
50
79
|
{
|
|
51
|
-
className: `tab ${
|
|
52
|
-
ref:
|
|
80
|
+
className: `tab ${n["tab-container"]} ${n[`tab-container-${r}`]} ${H && n["tab-full-width"]}`,
|
|
81
|
+
ref: l,
|
|
53
82
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
const i =
|
|
56
|
-
return /* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ s("div", { className: F, children: o.map((t, e) => {
|
|
84
|
+
const i = g.includes(e), d = e === h;
|
|
85
|
+
return /* @__PURE__ */ s(
|
|
57
86
|
"div",
|
|
58
87
|
{
|
|
59
|
-
ref: (
|
|
88
|
+
ref: (S) => z.current[e] = S,
|
|
60
89
|
className: `
|
|
61
|
-
${
|
|
62
|
-
${i ?
|
|
90
|
+
${r === "button" && d ? n["selected-button"] : ""}
|
|
91
|
+
${i ? n["tab-disabled"] : ""}
|
|
63
92
|
`,
|
|
64
|
-
children:
|
|
65
|
-
|
|
93
|
+
children: r === "icon" ? /* @__PURE__ */ s(
|
|
94
|
+
B,
|
|
66
95
|
{
|
|
67
96
|
mode: "icon",
|
|
68
97
|
size: "s",
|
|
69
|
-
selected:
|
|
70
|
-
onClick: () =>
|
|
98
|
+
selected: d,
|
|
99
|
+
onClick: () => v(e),
|
|
71
100
|
disabled: i,
|
|
72
101
|
children: t
|
|
73
102
|
}
|
|
74
|
-
) : /* @__PURE__ */
|
|
75
|
-
|
|
103
|
+
) : /* @__PURE__ */ s("div", { className: d ? n["selected-text"] : void 0, children: /* @__PURE__ */ s(
|
|
104
|
+
q,
|
|
76
105
|
{
|
|
77
106
|
size: "s",
|
|
78
107
|
label: t,
|
|
79
|
-
mode:
|
|
80
|
-
selected:
|
|
81
|
-
onClick: () =>
|
|
108
|
+
mode: r === "text" ? "text" : "ghost",
|
|
109
|
+
selected: d,
|
|
110
|
+
onClick: () => v(e),
|
|
82
111
|
disabled: i
|
|
83
112
|
}
|
|
84
113
|
) })
|
|
85
114
|
},
|
|
86
|
-
|
|
115
|
+
e
|
|
87
116
|
);
|
|
88
117
|
}) }),
|
|
89
|
-
|
|
118
|
+
r !== "button" && /* @__PURE__ */ s("div", { className: n.underline, style: A })
|
|
90
119
|
]
|
|
91
120
|
}
|
|
92
121
|
);
|
|
93
122
|
};
|
|
94
123
|
export {
|
|
95
|
-
|
|
124
|
+
D as Tabs
|
|
96
125
|
};
|