@situaction/traq-ui-ste 1.2.11 → 1.2.13
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/dist/components/buttonControledScroll/ButtonControlledScroll.js +43 -23
- package/dist/components/calendar/Calendar.js +101 -101
- package/dist/components/input/Input.d.ts +1 -0
- package/dist/components/input/Input.js +54 -51
- package/dist/components/tabs/Tabs.d.ts +2 -2
- package/dist/components/tabs/Tabs.js +82 -88
- package/dist/styles/ButtonControlledScroll.css +1 -1
- package/dist/styles/Calendar.css +1 -1
- package/dist/styles/Input.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as D, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as a, useState as h, useEffect as k } from "react";
|
|
3
|
-
import '../../styles/ButtonControlledScroll.css';const y = "
|
|
3
|
+
import '../../styles/ButtonControlledScroll.css';const y = "_wrapper_1fnz9_6", E = "_container_1fnz9_18", T = "_btn_1fnz9_27", U = "_grab_1fnz9_47", X = "_grabbing_1fnz9_51", j = "_btnLeft_1fnz9_57", B = "_btnRight_1fnz9_62", e = {
|
|
4
4
|
wrapper: y,
|
|
5
5
|
container: E,
|
|
6
6
|
btn: T,
|
|
@@ -8,25 +8,33 @@ import '../../styles/ButtonControlledScroll.css';const y = "_wrapper_lqv42_6", E
|
|
|
8
8
|
grabbing: X,
|
|
9
9
|
btnLeft: j,
|
|
10
10
|
btnRight: B
|
|
11
|
-
}, A = ({
|
|
12
|
-
|
|
11
|
+
}, A = ({
|
|
12
|
+
gap: L = 10,
|
|
13
|
+
items: i,
|
|
14
|
+
iconLeft: b,
|
|
15
|
+
iconRight: m,
|
|
16
|
+
scrollAmount: v = 150,
|
|
17
|
+
grabSpeed: M = 1.5,
|
|
18
|
+
grabbable: o = !0
|
|
19
|
+
}) => {
|
|
20
|
+
const f = v, r = a(null), [S, R] = h(!1), [x, $] = h(!1), s = a(!1), u = a(0), d = a(0), w = (t) => {
|
|
13
21
|
if (o) {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
s.current = !0,
|
|
22
|
+
const n = r.current;
|
|
23
|
+
if (!n) return;
|
|
24
|
+
s.current = !0, u.current = t.pageX - n.offsetLeft, d.current = n.scrollLeft, n.classList.add(e.grabbing);
|
|
17
25
|
}
|
|
18
|
-
},
|
|
26
|
+
}, z = (t) => {
|
|
19
27
|
if (o) {
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
28
|
+
const n = r.current;
|
|
29
|
+
if (!n || !s.current) return;
|
|
22
30
|
t.preventDefault();
|
|
23
|
-
const N = (t.pageX -
|
|
24
|
-
|
|
31
|
+
const N = (t.pageX - n.offsetLeft - u.current) * M;
|
|
32
|
+
n.scrollLeft = d.current + N;
|
|
25
33
|
}
|
|
26
34
|
}, g = () => {
|
|
27
35
|
if (o) {
|
|
28
36
|
const t = r.current;
|
|
29
|
-
s.current = !1, t == null || t.classList.remove(
|
|
37
|
+
s.current = !1, t == null || t.classList.remove(e.grabbing);
|
|
30
38
|
}
|
|
31
39
|
}, C = () => {
|
|
32
40
|
s.current && o && g();
|
|
@@ -34,26 +42,38 @@ import '../../styles/ButtonControlledScroll.css';const y = "_wrapper_lqv42_6", E
|
|
|
34
42
|
const t = r.current;
|
|
35
43
|
t && (R(t.scrollLeft > 0), $(t.scrollLeft + t.clientWidth < t.scrollWidth));
|
|
36
44
|
}, _ = (t) => {
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
const c = t === "left" ? -
|
|
40
|
-
|
|
45
|
+
const n = r.current;
|
|
46
|
+
if (!n) return;
|
|
47
|
+
const c = t === "left" ? -f : f;
|
|
48
|
+
n.scrollBy({ left: c, behavior: "smooth" });
|
|
41
49
|
};
|
|
42
50
|
return k(() => {
|
|
43
51
|
const t = r.current;
|
|
44
52
|
if (!t) return;
|
|
45
|
-
const
|
|
46
|
-
t.addEventListener("scroll",
|
|
53
|
+
const n = () => p();
|
|
54
|
+
t.addEventListener("scroll", n);
|
|
47
55
|
const c = setTimeout(() => {
|
|
48
56
|
p();
|
|
49
57
|
}, 0);
|
|
50
58
|
return () => {
|
|
51
|
-
clearTimeout(c), t.removeEventListener("scroll",
|
|
59
|
+
clearTimeout(c), t.removeEventListener("scroll", n);
|
|
52
60
|
};
|
|
53
|
-
}, [i]), /* @__PURE__ */ D("div", { className: `${
|
|
54
|
-
S && /* @__PURE__ */ l("button", { className: `${
|
|
55
|
-
/* @__PURE__ */ l(
|
|
56
|
-
|
|
61
|
+
}, [i]), /* @__PURE__ */ D("div", { className: `${e.wrapper}`, children: [
|
|
62
|
+
S && /* @__PURE__ */ l("button", { className: `${e.btn} ${e.btnLeft} padding-xs-5`, onClick: () => _("left"), children: b }),
|
|
63
|
+
/* @__PURE__ */ l(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
onMouseDown: w,
|
|
67
|
+
onMouseLeave: C,
|
|
68
|
+
onMouseMove: z,
|
|
69
|
+
onMouseUp: g,
|
|
70
|
+
className: `${e.container} ${o && e.grab}`,
|
|
71
|
+
style: { gap: `${L}px` },
|
|
72
|
+
ref: r,
|
|
73
|
+
children: i.map((t, n) => /* @__PURE__ */ l("div", { className: e.item, children: t }, n))
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
x && /* @__PURE__ */ l("button", { className: `${e.btn} ${e.btnRight} padding-xs-5`, onClick: () => _("right"), children: m })
|
|
57
77
|
] });
|
|
58
78
|
};
|
|
59
79
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
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 = "
|
|
5
|
+
import '../../styles/Calendar.css';const Ne = "_calendar_1i5hy_6", je = "_relative_1i5hy_15", Ee = "_dropDownCtn_1i5hy_18", Fe = "_calendarHeader_1i5hy_28", Le = "_calendarWeekdays_1i5hy_38", $e = "_calendarGrid_1i5hy_39", He = "_calendarDay_1i5hy_49", qe = "_today_1i5hy_64", Ae = "_selected_1i5hy_67", Je = "_disabled_1i5hy_74", Xe = "_inRange_1i5hy_81", Re = "_dropdown_1i5hy_84", Be = "_yearList_1i5hy_96", Ve = "_yearItem_1i5hy_103", Qe = "_loading_1i5hy_111", M = {
|
|
6
6
|
calendar: Ne,
|
|
7
7
|
relative: je,
|
|
8
|
-
dropDownCtn:
|
|
9
|
-
calendarHeader:
|
|
10
|
-
calendarWeekdays:
|
|
11
|
-
calendarGrid:
|
|
12
|
-
calendarDay:
|
|
13
|
-
today:
|
|
8
|
+
dropDownCtn: Ee,
|
|
9
|
+
calendarHeader: Fe,
|
|
10
|
+
calendarWeekdays: Le,
|
|
11
|
+
calendarGrid: $e,
|
|
12
|
+
calendarDay: He,
|
|
13
|
+
today: qe,
|
|
14
14
|
selected: Ae,
|
|
15
15
|
disabled: Je,
|
|
16
16
|
inRange: Xe,
|
|
@@ -23,19 +23,19 @@ 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
|
}
|
|
26
|
-
function
|
|
26
|
+
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
30
|
const n = m(t);
|
|
31
|
-
return isNaN(e) ?
|
|
31
|
+
return isNaN(e) ? k(t, NaN) : (n.setDate(n.getDate() + e), n);
|
|
32
32
|
}
|
|
33
33
|
function ie(t, e) {
|
|
34
34
|
const n = m(t);
|
|
35
|
-
if (isNaN(e)) return
|
|
35
|
+
if (isNaN(e)) return k(t, NaN);
|
|
36
36
|
if (!e)
|
|
37
37
|
return n;
|
|
38
|
-
const r = n.getDate(), a =
|
|
38
|
+
const r = n.getDate(), a = k(t, n.getTime());
|
|
39
39
|
a.setMonth(n.getMonth() + e + 1, 0);
|
|
40
40
|
const i = a.getDate();
|
|
41
41
|
return r >= i ? a : (n.setFullYear(
|
|
@@ -54,18 +54,18 @@ function N(t, e) {
|
|
|
54
54
|
const n = A(), r = (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, a = m(t), i = a.getDay(), u = (i < r ? 7 : 0) + i - r;
|
|
55
55
|
return a.setDate(a.getDate() - u), a.setHours(0, 0, 0, 0), a;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function H(t) {
|
|
58
58
|
return N(t, { weekStartsOn: 1 });
|
|
59
59
|
}
|
|
60
60
|
function oe(t) {
|
|
61
|
-
const e = m(t), n = e.getFullYear(), r =
|
|
61
|
+
const e = m(t), n = e.getFullYear(), r = k(t, 0);
|
|
62
62
|
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
63
|
-
const a =
|
|
63
|
+
const a = H(r), i = k(t, 0);
|
|
64
64
|
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
65
|
-
const u =
|
|
65
|
+
const u = H(i);
|
|
66
66
|
return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= u.getTime() ? n : n - 1;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function q(t) {
|
|
69
69
|
const e = m(t);
|
|
70
70
|
return e.setHours(0, 0, 0, 0), e;
|
|
71
71
|
}
|
|
@@ -84,15 +84,15 @@ function Z(t) {
|
|
|
84
84
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
85
85
|
}
|
|
86
86
|
function Ze(t, e) {
|
|
87
|
-
const n =
|
|
87
|
+
const n = q(t), r = q(e), a = +n - Z(n), i = +r - Z(r);
|
|
88
88
|
return Math.round((a - i) / Ie);
|
|
89
89
|
}
|
|
90
90
|
function Ue(t) {
|
|
91
|
-
const e = oe(t), n =
|
|
92
|
-
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0),
|
|
91
|
+
const e = oe(t), n = k(t, 0);
|
|
92
|
+
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), H(n);
|
|
93
93
|
}
|
|
94
94
|
function _(t, e) {
|
|
95
|
-
const n =
|
|
95
|
+
const n = q(t), r = q(e);
|
|
96
96
|
return +n == +r;
|
|
97
97
|
}
|
|
98
98
|
function Ke(t) {
|
|
@@ -113,7 +113,7 @@ function nt(t) {
|
|
|
113
113
|
return e.setDate(1), e.setHours(0, 0, 0, 0), e;
|
|
114
114
|
}
|
|
115
115
|
function rt(t) {
|
|
116
|
-
const e = m(t), n =
|
|
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 at(t, e) {
|
|
@@ -229,7 +229,7 @@ const ot = {
|
|
|
229
229
|
nextWeek: "eeee 'at' p",
|
|
230
230
|
other: "P"
|
|
231
231
|
}, mt = (t, e, n, r) => lt[t];
|
|
232
|
-
function
|
|
232
|
+
function p(t) {
|
|
233
233
|
return (e, n) => {
|
|
234
234
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
235
235
|
let a;
|
|
@@ -371,38 +371,38 @@ const ht = {
|
|
|
371
371
|
return n + "th";
|
|
372
372
|
}, vt = {
|
|
373
373
|
ordinalNumber: Mt,
|
|
374
|
-
era:
|
|
374
|
+
era: p({
|
|
375
375
|
values: ht,
|
|
376
376
|
defaultWidth: "wide"
|
|
377
377
|
}),
|
|
378
|
-
quarter:
|
|
378
|
+
quarter: p({
|
|
379
379
|
values: ft,
|
|
380
380
|
defaultWidth: "wide",
|
|
381
381
|
argumentCallback: (t) => t - 1
|
|
382
382
|
}),
|
|
383
|
-
month:
|
|
383
|
+
month: p({
|
|
384
384
|
values: gt,
|
|
385
385
|
defaultWidth: "wide"
|
|
386
386
|
}),
|
|
387
|
-
day:
|
|
387
|
+
day: p({
|
|
388
388
|
values: wt,
|
|
389
389
|
defaultWidth: "wide"
|
|
390
390
|
}),
|
|
391
|
-
dayPeriod:
|
|
391
|
+
dayPeriod: p({
|
|
392
392
|
values: yt,
|
|
393
393
|
defaultWidth: "wide",
|
|
394
394
|
formattingValues: bt,
|
|
395
395
|
defaultFormattingWidth: "wide"
|
|
396
396
|
})
|
|
397
397
|
};
|
|
398
|
-
function
|
|
398
|
+
function D(t) {
|
|
399
399
|
return (e, n = {}) => {
|
|
400
400
|
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
|
|
401
401
|
if (!i)
|
|
402
402
|
return null;
|
|
403
|
-
const u = i[0], s = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(s) ?
|
|
403
|
+
const u = i[0], s = r && t.parsePatterns[r] || 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
|
-
|
|
405
|
+
Pt(s, (v) => v.test(u))
|
|
406
406
|
);
|
|
407
407
|
let h;
|
|
408
408
|
h = t.valueCallback ? t.valueCallback(f) : f, h = n.valueCallback ? (
|
|
@@ -413,12 +413,12 @@ function p(t) {
|
|
|
413
413
|
return { value: h, rest: w };
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Pt(t, e) {
|
|
417
417
|
for (const n in t)
|
|
418
418
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
419
419
|
return n;
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function pt(t, e) {
|
|
422
422
|
for (let n = 0; n < t.length; n++)
|
|
423
423
|
if (e(t[n]))
|
|
424
424
|
return n;
|
|
@@ -435,7 +435,7 @@ function ce(t) {
|
|
|
435
435
|
return { value: u, rest: s };
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const Dt = /^(\d+)(th|st|nd|rd)?/i, kt = /\d+/i, Ot = {
|
|
439
439
|
narrow: /^(b|a)/i,
|
|
440
440
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
441
441
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
@@ -502,79 +502,79 @@ const pt = /^(\d+)(th|st|nd|rd)?/i, Dt = /\d+/i, Ot = {
|
|
|
502
502
|
evening: /evening/i,
|
|
503
503
|
night: /night/i
|
|
504
504
|
}
|
|
505
|
-
},
|
|
505
|
+
}, Et = {
|
|
506
506
|
ordinalNumber: ce({
|
|
507
|
-
matchPattern:
|
|
508
|
-
parsePattern:
|
|
507
|
+
matchPattern: Dt,
|
|
508
|
+
parsePattern: kt,
|
|
509
509
|
valueCallback: (t) => parseInt(t, 10)
|
|
510
510
|
}),
|
|
511
|
-
era:
|
|
511
|
+
era: D({
|
|
512
512
|
matchPatterns: Ot,
|
|
513
513
|
defaultMatchWidth: "wide",
|
|
514
514
|
parsePatterns: Wt,
|
|
515
515
|
defaultParseWidth: "any"
|
|
516
516
|
}),
|
|
517
|
-
quarter:
|
|
517
|
+
quarter: D({
|
|
518
518
|
matchPatterns: xt,
|
|
519
519
|
defaultMatchWidth: "wide",
|
|
520
520
|
parsePatterns: Tt,
|
|
521
521
|
defaultParseWidth: "any",
|
|
522
522
|
valueCallback: (t) => t + 1
|
|
523
523
|
}),
|
|
524
|
-
month:
|
|
524
|
+
month: D({
|
|
525
525
|
matchPatterns: _t,
|
|
526
526
|
defaultMatchWidth: "wide",
|
|
527
527
|
parsePatterns: Yt,
|
|
528
528
|
defaultParseWidth: "any"
|
|
529
529
|
}),
|
|
530
|
-
day:
|
|
530
|
+
day: D({
|
|
531
531
|
matchPatterns: Ct,
|
|
532
532
|
defaultMatchWidth: "wide",
|
|
533
533
|
parsePatterns: St,
|
|
534
534
|
defaultParseWidth: "any"
|
|
535
535
|
}),
|
|
536
|
-
dayPeriod:
|
|
536
|
+
dayPeriod: D({
|
|
537
537
|
matchPatterns: Nt,
|
|
538
538
|
defaultMatchWidth: "any",
|
|
539
539
|
parsePatterns: jt,
|
|
540
540
|
defaultParseWidth: "any"
|
|
541
541
|
})
|
|
542
|
-
},
|
|
542
|
+
}, Ft = {
|
|
543
543
|
code: "en-US",
|
|
544
544
|
formatDistance: st,
|
|
545
545
|
formatLong: dt,
|
|
546
546
|
formatRelative: mt,
|
|
547
547
|
localize: vt,
|
|
548
|
-
match:
|
|
548
|
+
match: Et,
|
|
549
549
|
options: {
|
|
550
550
|
weekStartsOn: 0,
|
|
551
551
|
firstWeekContainsDate: 1
|
|
552
552
|
}
|
|
553
553
|
};
|
|
554
|
-
function
|
|
554
|
+
function Lt(t) {
|
|
555
555
|
const e = m(t);
|
|
556
556
|
return Ze(e, rt(e)) + 1;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
const e = m(t), n =
|
|
558
|
+
function $t(t) {
|
|
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 = m(t), r = n.getFullYear(), a = 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) ?? a.firstWeekContainsDate ?? ((T = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, u =
|
|
564
|
+
const n = m(t), r = n.getFullYear(), a = 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) ?? a.firstWeekContainsDate ?? ((T = (x = a.locale) == null ? void 0 : x.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, u = k(t, 0);
|
|
565
565
|
u.setFullYear(r + 1, 0, i), u.setHours(0, 0, 0, 0);
|
|
566
|
-
const s = N(u, e), f =
|
|
566
|
+
const s = N(u, e), f = k(t, 0);
|
|
567
567
|
f.setFullYear(r, 0, i), f.setHours(0, 0, 0, 0);
|
|
568
568
|
const h = N(f, e);
|
|
569
569
|
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= h.getTime() ? r : r - 1;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function Ht(t, e) {
|
|
572
572
|
var s, f, h, w;
|
|
573
|
-
const n = A(), r = (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, a = ue(t, e), i =
|
|
573
|
+
const n = A(), r = (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, a = ue(t, e), i = k(t, 0);
|
|
574
574
|
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), N(i, e);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
const n = m(t), r = +N(n, e) -
|
|
576
|
+
function qt(t, e) {
|
|
577
|
+
const n = m(t), r = +N(n, e) - +Ht(n, e);
|
|
578
578
|
return Math.round(r / se) + 1;
|
|
579
579
|
}
|
|
580
580
|
function d(t, e) {
|
|
@@ -802,12 +802,12 @@ const W = {
|
|
|
802
802
|
},
|
|
803
803
|
// Local week of year
|
|
804
804
|
w: function(t, e, n, r) {
|
|
805
|
-
const a =
|
|
805
|
+
const a = qt(t, r);
|
|
806
806
|
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : d(a, e.length);
|
|
807
807
|
},
|
|
808
808
|
// ISO week of year
|
|
809
809
|
I: function(t, e, n) {
|
|
810
|
-
const r =
|
|
810
|
+
const r = $t(t);
|
|
811
811
|
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : d(r, e.length);
|
|
812
812
|
},
|
|
813
813
|
// Day of the month
|
|
@@ -816,7 +816,7 @@ const W = {
|
|
|
816
816
|
},
|
|
817
817
|
// Day of year
|
|
818
818
|
D: function(t, e, n) {
|
|
819
|
-
const r =
|
|
819
|
+
const r = Lt(t);
|
|
820
820
|
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : d(r, e.length);
|
|
821
821
|
},
|
|
822
822
|
// Day of week
|
|
@@ -1208,15 +1208,15 @@ function It(t, e, n) {
|
|
|
1208
1208
|
}
|
|
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
|
-
var w, v, x, T,
|
|
1212
|
-
const r = A(), a = (n == null ? void 0 : n.locale) ?? r.locale ??
|
|
1211
|
+
var w, v, x, T, F, L, j, $;
|
|
1212
|
+
const r = A(), a = (n == null ? void 0 : n.locale) ?? r.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) ?? r.firstWeekContainsDate ?? ((T = (x = r.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) ?? r.weekStartsOn ?? (($ = (j = r.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
1215
|
let f = e.match(Zt).map((b) => {
|
|
1216
1216
|
const y = b[0];
|
|
1217
1217
|
if (y === "p" || y === "P") {
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1218
|
+
const P = Jt[y];
|
|
1219
|
+
return P(b, a.formatLong);
|
|
1220
1220
|
}
|
|
1221
1221
|
return b;
|
|
1222
1222
|
}).join("").match(zt).map((b) => {
|
|
@@ -1243,8 +1243,8 @@ function ne(t, e, n) {
|
|
|
1243
1243
|
if (!b.isToken) return b.value;
|
|
1244
1244
|
const y = b.value;
|
|
1245
1245
|
(!(n != null && n.useAdditionalWeekYearTokens) && Qt(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Vt(y)) && Gt(y, e, String(t));
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1246
|
+
const P = U[y[0]];
|
|
1247
|
+
return P(s, y, a.localize, h);
|
|
1248
1248
|
}).join("");
|
|
1249
1249
|
}
|
|
1250
1250
|
function tn(t) {
|
|
@@ -1462,32 +1462,32 @@ const an = {
|
|
|
1462
1462
|
(r) => r.isToken && r.value === "do" ? { isToken: !0, value: "d" } : r
|
|
1463
1463
|
),
|
|
1464
1464
|
ordinalNumber: bn,
|
|
1465
|
-
era:
|
|
1465
|
+
era: p({
|
|
1466
1466
|
values: hn,
|
|
1467
1467
|
defaultWidth: "wide"
|
|
1468
1468
|
}),
|
|
1469
|
-
quarter:
|
|
1469
|
+
quarter: p({
|
|
1470
1470
|
values: fn,
|
|
1471
1471
|
defaultWidth: "wide",
|
|
1472
1472
|
argumentCallback: (t) => t - 1
|
|
1473
1473
|
}),
|
|
1474
|
-
month:
|
|
1474
|
+
month: p({
|
|
1475
1475
|
values: gn,
|
|
1476
1476
|
defaultWidth: "wide"
|
|
1477
1477
|
}),
|
|
1478
|
-
day:
|
|
1478
|
+
day: p({
|
|
1479
1479
|
values: wn,
|
|
1480
1480
|
defaultWidth: "wide"
|
|
1481
1481
|
}),
|
|
1482
|
-
dayPeriod:
|
|
1482
|
+
dayPeriod: p({
|
|
1483
1483
|
values: yn,
|
|
1484
1484
|
defaultWidth: "wide"
|
|
1485
1485
|
})
|
|
1486
|
-
},
|
|
1486
|
+
}, Pn = /^(\d+)(ième|ère|ème|er|e)?/i, pn = /\d+/i, Dn = {
|
|
1487
1487
|
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
1488
1488
|
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
1489
1489
|
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
|
|
1490
|
-
},
|
|
1490
|
+
}, kn = {
|
|
1491
1491
|
any: [/^av/i, /^ap/i]
|
|
1492
1492
|
}, On = {
|
|
1493
1493
|
narrow: /^T?[1234]/i,
|
|
@@ -1552,36 +1552,36 @@ const an = {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
}, Nn = {
|
|
1554
1554
|
ordinalNumber: ce({
|
|
1555
|
-
matchPattern:
|
|
1556
|
-
parsePattern:
|
|
1555
|
+
matchPattern: Pn,
|
|
1556
|
+
parsePattern: pn,
|
|
1557
1557
|
valueCallback: (t) => parseInt(t)
|
|
1558
1558
|
}),
|
|
1559
|
-
era:
|
|
1560
|
-
matchPatterns:
|
|
1559
|
+
era: D({
|
|
1560
|
+
matchPatterns: Dn,
|
|
1561
1561
|
defaultMatchWidth: "wide",
|
|
1562
|
-
parsePatterns:
|
|
1562
|
+
parsePatterns: kn,
|
|
1563
1563
|
defaultParseWidth: "any"
|
|
1564
1564
|
}),
|
|
1565
|
-
quarter:
|
|
1565
|
+
quarter: D({
|
|
1566
1566
|
matchPatterns: On,
|
|
1567
1567
|
defaultMatchWidth: "wide",
|
|
1568
1568
|
parsePatterns: Wn,
|
|
1569
1569
|
defaultParseWidth: "any",
|
|
1570
1570
|
valueCallback: (t) => t + 1
|
|
1571
1571
|
}),
|
|
1572
|
-
month:
|
|
1572
|
+
month: D({
|
|
1573
1573
|
matchPatterns: xn,
|
|
1574
1574
|
defaultMatchWidth: "wide",
|
|
1575
1575
|
parsePatterns: Tn,
|
|
1576
1576
|
defaultParseWidth: "any"
|
|
1577
1577
|
}),
|
|
1578
|
-
day:
|
|
1578
|
+
day: D({
|
|
1579
1579
|
matchPatterns: _n,
|
|
1580
1580
|
defaultMatchWidth: "wide",
|
|
1581
1581
|
parsePatterns: Yn,
|
|
1582
1582
|
defaultParseWidth: "any"
|
|
1583
1583
|
}),
|
|
1584
|
-
dayPeriod:
|
|
1584
|
+
dayPeriod: D({
|
|
1585
1585
|
matchPatterns: Cn,
|
|
1586
1586
|
defaultMatchWidth: "any",
|
|
1587
1587
|
parsePatterns: Sn,
|
|
@@ -1598,8 +1598,8 @@ const an = {
|
|
|
1598
1598
|
weekStartsOn: 1,
|
|
1599
1599
|
firstWeekContainsDate: 4
|
|
1600
1600
|
}
|
|
1601
|
-
},
|
|
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,
|
|
1601
|
+
}, Hn = ({ selectRange: t = !1, selectedDate: e, onDateSelect: n, maxDateSelected: r, minDateSelected: a }) => {
|
|
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), [$, b] = O((/* @__PURE__ */ new Date()).getFullYear()), y = 1900, P = I(null), J = I(null), le = /* @__PURE__ */ new Date(), V = nt(i), me = tt(i), he = N(V, { weekStartsOn: 1 }), fe = at(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]);
|
|
@@ -1624,26 +1624,26 @@ const an = {
|
|
|
1624
1624
|
G();
|
|
1625
1625
|
}, []);
|
|
1626
1626
|
const G = () => {
|
|
1627
|
-
|
|
1627
|
+
L || (j(!0), setTimeout(() => {
|
|
1628
1628
|
const o = [];
|
|
1629
|
-
let c =
|
|
1629
|
+
let c = $;
|
|
1630
1630
|
for (let l = 0; l < 10 && !(c < y); l++)
|
|
1631
1631
|
o.push(c), c -= 1;
|
|
1632
|
-
o.length > 0 && (
|
|
1632
|
+
o.length > 0 && (F((l) => [...l, ...o]), b(c)), j(!1);
|
|
1633
1633
|
}, 500));
|
|
1634
1634
|
};
|
|
1635
1635
|
B(() => {
|
|
1636
|
-
if (h && v &&
|
|
1637
|
-
const o =
|
|
1638
|
-
o &&
|
|
1636
|
+
if (h && v && P.current) {
|
|
1637
|
+
const o = P.current.querySelector(`[data-year="${v}"]`);
|
|
1638
|
+
o && P.current && (P.current.scrollTop = o.offsetTop - P.current.offsetTop);
|
|
1639
1639
|
}
|
|
1640
1640
|
}, [h, v]);
|
|
1641
1641
|
const be = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((c, l) => /* @__PURE__ */ g("div", { className: M.calendarWeekdays, children: c }, l)), Me = () => {
|
|
1642
1642
|
let o = [], c = he;
|
|
1643
1643
|
for (; c <= fe; )
|
|
1644
1644
|
o.push(c), c = Ge(c, 1);
|
|
1645
|
-
return o.map((l,
|
|
1646
|
-
const R = s && typeof s == "object" && "start" in s && "end" in s,
|
|
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 && re(l, s.start) && ae(l, s.end), xe = a && (ae(l, a) || _(l, a)), Te = r && (re(l, r) || _(l, r)), _e = a && xe || r && Te, Ye = !nn(l, V), Ce = _e || Ye;
|
|
1647
1647
|
return /* @__PURE__ */ g(
|
|
1648
1648
|
"div",
|
|
1649
1649
|
{
|
|
@@ -1651,43 +1651,43 @@ const an = {
|
|
|
1651
1651
|
${M.calendarDay}
|
|
1652
1652
|
${_(l, le) ? M.today : ""}
|
|
1653
1653
|
${s && _(l, s) ? M.selected : ""}
|
|
1654
|
-
${
|
|
1654
|
+
${ke || Oe ? M.selected : ""} // Applique 'selected' si start ou end
|
|
1655
1655
|
${We ? M.inRange : ""} // Applique 'inRange' si la date est entre start et end
|
|
1656
1656
|
${Ce ? M.disabled : ""}
|
|
1657
1657
|
`,
|
|
1658
1658
|
onClick: () => we(l),
|
|
1659
1659
|
children: ne(l, "d")
|
|
1660
1660
|
},
|
|
1661
|
-
|
|
1661
|
+
De
|
|
1662
1662
|
);
|
|
1663
1663
|
});
|
|
1664
1664
|
}, ve = (o) => {
|
|
1665
1665
|
const c = o.currentTarget;
|
|
1666
1666
|
c.scrollHeight === c.scrollTop + c.clientHeight && G();
|
|
1667
|
-
},
|
|
1667
|
+
}, Pe = () => {
|
|
1668
1668
|
const o = (c) => {
|
|
1669
|
-
|
|
1669
|
+
P.current && !P.current.contains(c.target) && J.current && !J.current.contains(c.target) && w(!1);
|
|
1670
1670
|
};
|
|
1671
1671
|
return document.addEventListener("click", o), () => {
|
|
1672
1672
|
document.removeEventListener("click", o);
|
|
1673
1673
|
};
|
|
1674
|
-
},
|
|
1674
|
+
}, pe = (o) => {
|
|
1675
1675
|
const c = ne(o, "MMM yyyy", { locale: jn });
|
|
1676
1676
|
return c.charAt(0).toUpperCase() + c.slice(1);
|
|
1677
1677
|
};
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(-1), children: /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ E("div", { className: M.calendar, onClick: Pe, children: [
|
|
1679
|
+
/* @__PURE__ */ E("div", { className: `${M.calendarHeader}`, children: [
|
|
1680
|
+
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(-1), children: /* @__PURE__ */ E("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1681
1681
|
/* @__PURE__ */ g("path", { d: "M160,48V208L80,128Z", opacity: "0.2" }),
|
|
1682
1682
|
/* @__PURE__ */ g("path", { d: "M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z" })
|
|
1683
1683
|
] }) }),
|
|
1684
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ E("div", { ref: J, className: M.dropDownCtn, children: [
|
|
1685
1685
|
/* @__PURE__ */ g(
|
|
1686
1686
|
Se,
|
|
1687
1687
|
{
|
|
1688
1688
|
size: "s",
|
|
1689
1689
|
mode: "tertiary",
|
|
1690
|
-
label:
|
|
1690
|
+
label: pe(i),
|
|
1691
1691
|
onClick: ye,
|
|
1692
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" }) })
|
|
1693
1693
|
}
|
|
@@ -1695,7 +1695,7 @@ const an = {
|
|
|
1695
1695
|
h && /* @__PURE__ */ g("div", { className: M.dropdown, children: /* @__PURE__ */ g(
|
|
1696
1696
|
"div",
|
|
1697
1697
|
{
|
|
1698
|
-
ref:
|
|
1698
|
+
ref: P,
|
|
1699
1699
|
className: M.yearList,
|
|
1700
1700
|
onScroll: (o) => ve(o),
|
|
1701
1701
|
children: T.map((o) => /* @__PURE__ */ g(
|
|
@@ -1713,7 +1713,7 @@ const an = {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
) })
|
|
1715
1715
|
] }),
|
|
1716
|
-
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(1), children: /* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ g(z, { size: "s", mode: "ghost", onClick: () => Q(1), children: /* @__PURE__ */ E("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", fill: "#000000", viewBox: "0 0 256 256", children: [
|
|
1717
1717
|
/* @__PURE__ */ g("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }),
|
|
1718
1718
|
/* @__PURE__ */ g("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" })
|
|
1719
1719
|
] }) })
|
|
@@ -1723,5 +1723,5 @@ const an = {
|
|
|
1723
1723
|
] });
|
|
1724
1724
|
};
|
|
1725
1725
|
export {
|
|
1726
|
-
|
|
1726
|
+
Hn as Calendar
|
|
1727
1727
|
};
|
|
@@ -18,6 +18,7 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
18
18
|
defaultValue?: string;
|
|
19
19
|
/** Disable the input field **/
|
|
20
20
|
disabled?: boolean;
|
|
21
|
+
fullWidth?: boolean;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* The Input component renders an input field with optional icons or labels on the left and right.
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import '../../styles/Input.css';const j = "
|
|
4
|
-
"input-style": "_input-
|
|
5
|
-
"input-style-disabled": "_input-style-
|
|
6
|
-
"input-style-focused": "_input-style-
|
|
7
|
-
"input-style-secondary": "_input-style-
|
|
8
|
-
"input-style-ghost": "_input-style-
|
|
9
|
-
"input-style-error": "_input-style-
|
|
10
|
-
"input-container": "_input-
|
|
11
|
-
"input-style-size-xl": "_input-style-size-
|
|
12
|
-
"input-style-size-l": "_input-style-size-
|
|
13
|
-
"input-style-size-m": "_input-style-size-
|
|
14
|
-
"input-style-size-s": "_input-style-size-
|
|
15
|
-
"input-style-radius": "_input-style-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsxs as p, jsx as e, Fragment as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useRef as _ } from "react";
|
|
3
|
+
import '../../styles/Input.css';const j = "_fullWidth_1pmuq_141", N = "_flexHorizontalBetween_1pmuq_145", W = "_flexHorizontal_1pmuq_145", t = {
|
|
4
|
+
"input-style": "_input-style_1pmuq_30",
|
|
5
|
+
"input-style-disabled": "_input-style-disabled_1pmuq_60",
|
|
6
|
+
"input-style-focused": "_input-style-focused_1pmuq_71",
|
|
7
|
+
"input-style-secondary": "_input-style-secondary_1pmuq_78",
|
|
8
|
+
"input-style-ghost": "_input-style-ghost_1pmuq_92",
|
|
9
|
+
"input-style-error": "_input-style-error_1pmuq_95",
|
|
10
|
+
"input-container": "_input-container_1pmuq_105",
|
|
11
|
+
"input-style-size-xl": "_input-style-size-xl_1pmuq_109",
|
|
12
|
+
"input-style-size-l": "_input-style-size-l_1pmuq_116",
|
|
13
|
+
"input-style-size-m": "_input-style-size-m_1pmuq_123",
|
|
14
|
+
"input-style-size-s": "_input-style-size-s_1pmuq_130",
|
|
15
|
+
"input-style-radius": "_input-style-radius_1pmuq_137",
|
|
16
|
+
fullWidth: j,
|
|
17
|
+
flexHorizontalBetween: N,
|
|
18
|
+
flexHorizontal: W
|
|
18
19
|
}, R = ({
|
|
19
20
|
sizeStyle: y = "m",
|
|
20
|
-
labelUnit:
|
|
21
|
+
labelUnit: l,
|
|
21
22
|
status: n = "default",
|
|
22
|
-
childrenLeft:
|
|
23
|
-
childrenRight:
|
|
23
|
+
childrenLeft: u,
|
|
24
|
+
childrenRight: i,
|
|
24
25
|
round: d,
|
|
25
|
-
disabled:
|
|
26
|
+
disabled: o,
|
|
26
27
|
defaultValue: f,
|
|
27
|
-
|
|
28
|
+
fullWidth: m = !1,
|
|
29
|
+
...h
|
|
28
30
|
}) => {
|
|
29
|
-
const [z, r] =
|
|
31
|
+
const [z, r] = c(!1), [q, x] = c(f || ""), g = _(null), s = _(null), B = () => r(!0), C = () => r(!1), H = (F) => {
|
|
30
32
|
x(F.target.value);
|
|
31
|
-
},
|
|
33
|
+
}, S = () => {
|
|
32
34
|
s.current && s.current.focus();
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
d &&
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
n === "
|
|
35
|
+
}, v = [
|
|
36
|
+
t["input-style"],
|
|
37
|
+
t[`input-style-size-${y}`],
|
|
38
|
+
d && t["input-style-radius"],
|
|
39
|
+
t.flexHorizontalBetween,
|
|
40
|
+
m && t.fullWidth
|
|
41
|
+
].filter(Boolean).join(" "), w = [
|
|
42
|
+
z && t["input-style-focused"],
|
|
43
|
+
o && t["input-style-disabled"],
|
|
44
|
+
n === "secondary" && t["input-style-secondary"],
|
|
45
|
+
n === "ghost" && t["input-style-ghost"]
|
|
43
46
|
].filter(Boolean).join(" ");
|
|
44
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ p(
|
|
45
48
|
"div",
|
|
46
49
|
{
|
|
47
|
-
ref:
|
|
48
|
-
className: `${
|
|
50
|
+
ref: g,
|
|
51
|
+
className: `${v} ${(() => {
|
|
49
52
|
switch (n) {
|
|
50
53
|
case "error":
|
|
51
|
-
return
|
|
54
|
+
return t["input-style-error"];
|
|
52
55
|
default:
|
|
53
|
-
return
|
|
56
|
+
return w;
|
|
54
57
|
}
|
|
55
58
|
})()}`,
|
|
56
|
-
onFocus:
|
|
57
|
-
onBlur:
|
|
58
|
-
onClick:
|
|
59
|
+
onFocus: B,
|
|
60
|
+
onBlur: C,
|
|
61
|
+
onClick: S,
|
|
59
62
|
children: [
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */
|
|
63
|
+
u && /* @__PURE__ */ e(a, { children: u }),
|
|
64
|
+
/* @__PURE__ */ e("div", { className: t["input-container"], children: /* @__PURE__ */ e(
|
|
62
65
|
"input",
|
|
63
66
|
{
|
|
64
67
|
autoCorrect: "off",
|
|
65
|
-
disabled:
|
|
66
|
-
value:
|
|
67
|
-
onChange:
|
|
68
|
+
disabled: o,
|
|
69
|
+
value: q,
|
|
70
|
+
onChange: H,
|
|
68
71
|
ref: s,
|
|
69
|
-
...
|
|
72
|
+
...h
|
|
70
73
|
}
|
|
71
74
|
) }),
|
|
72
|
-
/* @__PURE__ */ a
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
/* @__PURE__ */ p(a, { children: [
|
|
76
|
+
l && /* @__PURE__ */ e("div", { children: l }),
|
|
77
|
+
i && /* @__PURE__ */ e("span", { className: t.flexHorizontal, children: i })
|
|
75
78
|
] })
|
|
76
79
|
]
|
|
77
80
|
}
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TabsProps {
|
|
4
4
|
/** select the type of data text or icon that we put in tabs */
|
|
5
|
-
type:
|
|
5
|
+
type: "text" | "icon" | "button";
|
|
6
6
|
/** Array of strings or nodes representing the labels of the tabs */
|
|
7
7
|
listItems: (string | ReactNode)[];
|
|
8
8
|
/** Active tab (controlled) */
|
|
@@ -10,7 +10,7 @@ export interface TabsProps {
|
|
|
10
10
|
/** Index of the tab that should be active by default (uncontrolled) */
|
|
11
11
|
defaultActiveTab?: number;
|
|
12
12
|
/** Position Tabs */
|
|
13
|
-
position?:
|
|
13
|
+
position?: "center" | "right" | "left";
|
|
14
14
|
/** Callback on selection (label + index) */
|
|
15
15
|
onTabSelect: (selectedItem: string | ReactNode, index?: number) => void;
|
|
16
16
|
/** Full width */
|
|
@@ -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 A, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as w, useCallback as B, useEffect as u, useLayoutEffect as E } from "react";
|
|
3
|
+
import { Button as F } from "../button/Button.js";
|
|
4
|
+
import { IconButton as p } from "../icon-button/IconButton.js";
|
|
5
|
+
import '../../styles/Tabs.css';const q = "_underline_1jy9f_82", n = {
|
|
6
6
|
"tab-container": "_tab-container_1jy9f_30",
|
|
7
7
|
"tab-container-button": "_tab-container-button_1jy9f_34",
|
|
8
8
|
"tab-container-icon": "_tab-container-icon_1jy9f_39",
|
|
@@ -14,119 +14,113 @@ import '../../styles/Tabs.css';const M = "_underline_1jy9f_82", n = {
|
|
|
14
14
|
"selected-button": "_selected-button_1jy9f_63",
|
|
15
15
|
"noSelect-button": "_noSelect-button_1jy9f_70",
|
|
16
16
|
"selected-text": "_selected-text_1jy9f_74",
|
|
17
|
-
underline:
|
|
17
|
+
underline: q,
|
|
18
18
|
"flexHorizontal-center": "_flexHorizontal-center_1jy9f_90",
|
|
19
19
|
"flexHorizontal-left": "_flexHorizontal-left_1jy9f_96",
|
|
20
20
|
"flexHorizontal-right": "_flexHorizontal-right_1jy9f_102"
|
|
21
|
-
},
|
|
22
|
-
if (!Number.isFinite(
|
|
23
|
-
const
|
|
24
|
-
return Math.min(Math.max(
|
|
25
|
-
},
|
|
26
|
-
listItems:
|
|
21
|
+
}, C = (i, o) => {
|
|
22
|
+
if (!Number.isFinite(i)) return 0;
|
|
23
|
+
const b = Math.max(0, o);
|
|
24
|
+
return Math.min(Math.max(i, 0), b);
|
|
25
|
+
}, O = ({
|
|
26
|
+
listItems: i,
|
|
27
27
|
type: o,
|
|
28
|
-
onTabSelect:
|
|
29
|
-
activeTab:
|
|
30
|
-
defaultActiveTab:
|
|
31
|
-
position:
|
|
32
|
-
fullWidth:
|
|
33
|
-
disabledTabs:
|
|
28
|
+
onTabSelect: b,
|
|
29
|
+
activeTab: d,
|
|
30
|
+
defaultActiveTab: _ = 0,
|
|
31
|
+
position: j = "left",
|
|
32
|
+
fullWidth: R = !1,
|
|
33
|
+
disabledTabs: x = []
|
|
34
34
|
}) => {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
), [
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
const c = d !== void 0, [N, y] = z(_), m = C(
|
|
36
|
+
c ? d : N,
|
|
37
|
+
(i.length || 1) - 1
|
|
38
|
+
), [S, H] = z({}), a = w(null), g = w([]), h = (t) => {
|
|
39
|
+
x.includes(t) || (c || y(t), b(i[t], t));
|
|
40
|
+
}, v = (t) => {
|
|
41
|
+
if (!a.current || !t || o === "button") return;
|
|
42
|
+
const e = a.current.getBoundingClientRect();
|
|
43
|
+
if (e.width === 0) {
|
|
44
|
+
requestAnimationFrame(() => v(t));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const s = t.getBoundingClientRect();
|
|
48
|
+
H({
|
|
49
|
+
left: `${s.left - e.left}px`,
|
|
50
|
+
width: `${s.width}px`
|
|
50
51
|
});
|
|
51
|
-
},
|
|
52
|
-
const t =
|
|
52
|
+
}, r = B(() => {
|
|
53
|
+
const t = g.current[m] ?? null;
|
|
53
54
|
requestAnimationFrame(
|
|
54
|
-
() => requestAnimationFrame(() =>
|
|
55
|
+
() => requestAnimationFrame(() => v(t))
|
|
56
|
+
);
|
|
57
|
+
}, [m, o]);
|
|
58
|
+
u(() => {
|
|
59
|
+
c && r();
|
|
60
|
+
}, [c, r, d]), E(() => {
|
|
61
|
+
r();
|
|
62
|
+
}, [r, j, i.length]), u(() => {
|
|
63
|
+
c || y(
|
|
64
|
+
C(_, (i.length || 1) - 1)
|
|
55
65
|
);
|
|
56
|
-
}
|
|
57
|
-
d(() => {
|
|
58
|
-
s && f();
|
|
59
|
-
}, [m]), S(() => {
|
|
60
|
-
f();
|
|
61
|
-
}, [a, v, r.length]);
|
|
62
|
-
const u = b(null), C = b(null);
|
|
63
|
-
S(() => {
|
|
64
|
-
const t = () => {
|
|
65
|
-
u.current && cancelAnimationFrame(u.current), u.current = requestAnimationFrame(() => {
|
|
66
|
-
const e = x.current[a] ?? null;
|
|
67
|
-
R(e);
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
return window.addEventListener("resize", t, { passive: !0 }), () => {
|
|
71
|
-
window.removeEventListener("resize", t), u.current && cancelAnimationFrame(u.current);
|
|
72
|
-
};
|
|
73
|
-
}, [a, o]), d(() => {
|
|
74
|
-
s || g($(h, (r.length || 1) - 1));
|
|
75
|
-
}, [h, r.length, s]), d(() => {
|
|
66
|
+
}, [_, i.length, c]), u(() => {
|
|
76
67
|
var t, e;
|
|
77
|
-
(e = (t = document.fonts) == null ? void 0 : t.ready) == null || e.then(() =>
|
|
78
|
-
}, []),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
68
|
+
(e = (t = document.fonts) == null ? void 0 : t.ready) == null || e.then(() => r());
|
|
69
|
+
}, [r]), u(() => {
|
|
70
|
+
const t = () => r();
|
|
71
|
+
return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
|
|
72
|
+
}, [r]), u(() => {
|
|
73
|
+
if (!a.current) return;
|
|
74
|
+
const t = new ResizeObserver(() => r());
|
|
75
|
+
return t.observe(a.current), () => t.disconnect();
|
|
76
|
+
}, [r]);
|
|
77
|
+
const $ = [
|
|
78
|
+
n[`flexHorizontal-${j}`],
|
|
85
79
|
o === "button" ? n["tab-items-button"] : n["tab-items"]
|
|
86
80
|
].filter(Boolean).join(" ");
|
|
87
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ A(
|
|
88
82
|
"div",
|
|
89
83
|
{
|
|
90
|
-
className: `tab ${n["tab-container"]} ${n[`tab-container-${o}`]} ${
|
|
91
|
-
ref:
|
|
84
|
+
className: `tab ${n["tab-container"]} ${n[`tab-container-${o}`]} ${R && n["tab-full-width"]}`,
|
|
85
|
+
ref: a,
|
|
92
86
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
const
|
|
95
|
-
return /* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ l("div", { className: $, children: i.map((t, e) => {
|
|
88
|
+
const s = x.includes(e), f = e === m;
|
|
89
|
+
return /* @__PURE__ */ l(
|
|
96
90
|
"div",
|
|
97
91
|
{
|
|
98
|
-
ref: (
|
|
92
|
+
ref: (k) => g.current[e] = k,
|
|
99
93
|
className: [
|
|
100
|
-
o === "button"
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
o === "button" && f ? n["selected-button"] : n["noSelect-button"],
|
|
95
|
+
typeof t != "string" ? n["noSelect-button"] : "",
|
|
96
|
+
s ? n["tab-disabled"] : ""
|
|
103
97
|
].filter(Boolean).join(" "),
|
|
104
|
-
children: o === "icon" ? /* @__PURE__ */
|
|
105
|
-
|
|
98
|
+
children: o === "icon" ? /* @__PURE__ */ l(
|
|
99
|
+
p,
|
|
106
100
|
{
|
|
107
101
|
mode: "icon",
|
|
108
102
|
size: "s",
|
|
109
|
-
selected:
|
|
110
|
-
onClick: () =>
|
|
111
|
-
disabled:
|
|
103
|
+
selected: f,
|
|
104
|
+
onClick: () => h(e),
|
|
105
|
+
disabled: s,
|
|
112
106
|
children: t
|
|
113
107
|
}
|
|
114
|
-
) : o === "button" ? /* @__PURE__ */
|
|
108
|
+
) : o === "button" ? /* @__PURE__ */ l(
|
|
115
109
|
"div",
|
|
116
110
|
{
|
|
117
111
|
className: n["tab-type-button"],
|
|
118
|
-
onClick: () =>
|
|
112
|
+
onClick: () => h(e),
|
|
119
113
|
children: t
|
|
120
114
|
}
|
|
121
|
-
) : /* @__PURE__ */
|
|
122
|
-
|
|
115
|
+
) : /* @__PURE__ */ l("div", { className: f ? n["selected-text"] : void 0, children: /* @__PURE__ */ l(
|
|
116
|
+
F,
|
|
123
117
|
{
|
|
124
118
|
size: "s",
|
|
125
119
|
label: t,
|
|
126
120
|
mode: o === "text" ? "text" : "ghost",
|
|
127
|
-
selected:
|
|
128
|
-
onClick: () =>
|
|
129
|
-
disabled:
|
|
121
|
+
selected: f,
|
|
122
|
+
onClick: () => h(e),
|
|
123
|
+
disabled: s,
|
|
130
124
|
fullWidth: !0
|
|
131
125
|
}
|
|
132
126
|
) })
|
|
@@ -134,11 +128,11 @@ import '../../styles/Tabs.css';const M = "_underline_1jy9f_82", n = {
|
|
|
134
128
|
e
|
|
135
129
|
);
|
|
136
130
|
}) }),
|
|
137
|
-
o !== "button" && /* @__PURE__ */
|
|
131
|
+
o !== "button" && /* @__PURE__ */ l("div", { className: n.underline, style: S })
|
|
138
132
|
]
|
|
139
133
|
}
|
|
140
134
|
);
|
|
141
135
|
};
|
|
142
136
|
export {
|
|
143
|
-
|
|
137
|
+
O as Tabs
|
|
144
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wrapper_1fnz9_6{position:relative;display:flex;align-items:center;width:100%;box-sizing:border-box;-webkit-user-select:none;user-select:none;padding:var(--spacing-xs-5) 0}._wrapper_1fnz9_6 label{-webkit-user-select:none;user-select:none}._wrapper_1fnz9_6 ._container_1fnz9_18{display:flex;overflow-x:auto;width:100%;scroll-behavior:smooth}._wrapper_1fnz9_6 ._container_1fnz9_18::-webkit-scrollbar{display:none}._wrapper_1fnz9_6 ._btn_1fnz9_27{transition:.3s;display:flex;justify-content:center;align-items:center;width:30px;height:30px;padding:.375rem;border-radius:50%;border:1px solid var(--button-tertiary-default-border);background-color:var(--background-primary);position:absolute;cursor:pointer}._wrapper_1fnz9_6 ._btn_1fnz9_27 *{fill:var(--button-secondary-default-text)}._wrapper_1fnz9_6 ._btn_1fnz9_27 *{z-index:2}._wrapper_1fnz9_6 ._grab_1fnz9_47{cursor:grab;scroll-behavior:initial}._wrapper_1fnz9_6 ._grabbing_1fnz9_51{cursor:grabbing}._wrapper_1fnz9_6 ._btn_1fnz9_27:hover{background-color:var(--background-tooltip)}._wrapper_1fnz9_6 ._btnLeft_1fnz9_57{left:0;top:50%;transform:translateY(-50%)}._wrapper_1fnz9_6 ._btnRight_1fnz9_62{right:0;top:50%;transform:translateY(-50%)}
|
package/dist/styles/Calendar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._calendar_1i5hy_6{border:1px solid var(--general-border-window);background:var(--dropdown-window-background);border-radius:.375rem;box-shadow:0 4px 16px 0 var(--shadow-color-low);padding:.375rem;box-sizing:border-box;width:280px}._calendar_1i5hy_6 ._relative_1i5hy_15{position:relative}._calendar_1i5hy_6 ._dropDownCtn_1i5hy_18{position:relative;width:120px;display:flex;justify-content:center;align-items:center}._calendar_1i5hy_6 ._dropDownCtn_1i5hy_18 button{width:120px}._calendar_1i5hy_6 ._calendarHeader_1i5hy_28{display:flex;justify-content:center;align-items:center;margin-bottom:12px;gap:.25rem}._calendar_1i5hy_6 ._calendarHeader_1i5hy_28 span{font-weight:700}._calendar_1i5hy_6 ._calendarWeekdays_1i5hy_38,._calendar_1i5hy_6 ._calendarGrid_1i5hy_39{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}._calendar_1i5hy_6 ._calendarWeekdays_1i5hy_38{color:var(--calendar-cell-base-inactiv-num);font-size:.75em;font-weight:600}._calendar_1i5hy_6 ._calendarDay_1i5hy_49,._calendar_1i5hy_6 ._calendarWeekdays_1i5hy_38 div{width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600}._calendar_1i5hy_6 ._calendarDay_1i5hy_49{border-radius:.25rem;cursor:pointer;color:var(--calendar-cell-base-default-num)}._calendar_1i5hy_6 ._calendarDay_1i5hy_49._today_1i5hy_64{border:1px solid var(--calendar-cell-tooday-default-border)}._calendar_1i5hy_6 ._calendarDay_1i5hy_49._selected_1i5hy_67{background:var(--calendar-cell-active-background);color:var(--calendar-cell-active-num)}._calendar_1i5hy_6 ._calendarDay_1i5hy_49._selected_1i5hy_67:hover{background:var(--calendar-cell-active-background)}._calendar_1i5hy_6 ._calendarDay_1i5hy_49._disabled_1i5hy_74{color:var(--calendar-cell-base-inactiv-num);pointer-events:none}._calendar_1i5hy_6 ._calendarDay_1i5hy_49:hover{background:var(--calendar-cell-base-hover-background)}._calendar_1i5hy_6 ._calendarDay_1i5hy_49._inRange_1i5hy_81{background-color:var(--calendar-cell-base-hover-background)}._calendar_1i5hy_6 ._dropdown_1i5hy_84{position:absolute;top:36px;min-width:110px;border:1px solid var(--general-border-window);background:var(--dropdown-window-background);border-radius:.25rem;box-shadow:0 8px 36px 0 var(--shadow-color-medium);z-index:10;padding:.25rem;max-height:130px}._calendar_1i5hy_6 ._yearList_1i5hy_96{max-height:120px;overflow-y:auto;display:flex;flex-direction:column;gap:.125rem}._calendar_1i5hy_6 ._yearItem_1i5hy_103{padding:.25rem .375rem;cursor:pointer;border-radius:.125rem}._calendar_1i5hy_6 ._yearItem_1i5hy_103:hover{background:var(--dropdown-line-background-hover)}._calendar_1i5hy_6 ._loading_1i5hy_111{text-align:center;font-size:.75em;color:var(--calendar-cell-base-default-num)}
|
package/dist/styles/Input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._input-
|
|
1
|
+
._input-style_1pmuq_30{font-family:Urbanist,sans-serif;border:1px solid var(--input-primary-default-border);color:var(--input-primary-default-text)}._input-style_1pmuq_30 input{font:inherit;color:var(--input-primary-actived-text);background-color:transparent;border:none;width:100%}._input-style_1pmuq_30 input:focus{outline:none;box-shadow:none;border-color:transparent}._input-style_1pmuq_30 input::placeholder{font:inherit;color:var(--input-primary-default-text)}._input-style_1pmuq_30 input:-webkit-autofill{box-shadow:0 0 0 1000px transparent inset!important;-webkit-text-fill-color:inherit!important;background-color:transparent!important}._input-style_1pmuq_30 *{fill:var(--input-primary-default-icons)}._input-style-disabled_1pmuq_60{background-color:#0000000d;border-color:var(--input-primary-disabled-border);pointer-events:none}._input-style-disabled_1pmuq_60 input{color:var(--input-primary-disabled-text)}._input-style-disabled_1pmuq_60 *{fill:var(--input-primary-disabled-icons)}._input-style-focused_1pmuq_71{color:var(--input-primary-actived-text);border-color:var(--input-primary-actived-border)}._input-style-focused_1pmuq_71 *{fill:var(--icon-selector-button-default-icon)}._input-style-secondary_1pmuq_78{color:var(--input-secondary-default-text);border:1px solid var(--input-secondary-default-border);background:var(--input-secondary-default-background)}._input-style-secondary_1pmuq_78 input{color:var(--input-primary-actived-text)}._input-style-secondary_1pmuq_78 input::placeholder{color:var(--input-secondary-default-text)}._input-style-secondary_1pmuq_78 *{fill:var(--input-secondary-default-icons)}._input-style-ghost_1pmuq_92{border:none}._input-style-error_1pmuq_95{border-color:var(--input-primary-error-border);color:var(--input-primary-error-text)}._input-style-error_1pmuq_95 input::placeholder{color:var(--input-primary-error-text)}._input-style-error_1pmuq_95 *{fill:var(--input-primary-error-icons)}._input-style_1pmuq_30 ._input-container_1pmuq_105{position:relative;width:100%}._input-style-size-xl_1pmuq_109{padding:1rem;font-size:1.125em;line-height:28px;border-radius:8px;gap:.625rem}._input-style-size-l_1pmuq_116{padding:.75rem;font-size:1em;line-height:24px;border-radius:8px;gap:.5rem}._input-style-size-m_1pmuq_123{padding:.5rem;font-size:.875em;line-height:20px;border-radius:4px;gap:.375rem}._input-style-size-s_1pmuq_130{padding:.375rem;font-size:.875em;line-height:20px;border-radius:4px;gap:.25rem}._input-style-radius_1pmuq_137{border-radius:50px}._fullWidth_1pmuq_141{width:100%}._flexHorizontalBetween_1pmuq_145{display:flex;justify-content:space-between;align-items:center;flex-direction:row}._flexHorizontal_1pmuq_145{display:flex;justify-content:flex-start;align-items:center;flex-direction:row}
|