@situaction/traq-ui-ste 1.2.5 → 1.2.7

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", Re = "_inRange_1b30a_81", Xe = "_dropdown_1b30a_84", Be = "_yearList_1b30a_96", Ve = "_yearItem_1b30a_103", Qe = "_loading_1b30a_111", M = {
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: Re,
17
- dropdown: Xe,
16
+ inRange: Xe,
17
+ dropdown: Re,
18
18
  yearList: Be,
19
19
  yearItem: Ve,
20
20
  loading: Qe
21
21
  };
22
- function h(t) {
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 = h(t);
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 = h(t);
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, l, f, w;
54
- const n = A(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((l = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((w = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : w.weekStartsOn) ?? 0, r = h(t), i = r.getDay(), c = (i < a ? 7 : 0) + i - a;
55
- return r.setDate(r.getDate() - c), r.setHours(0, 0, 0, 0), r;
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 = h(t), n = e.getFullYear(), a = k(t, 0);
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 c = H(i);
66
- return e.getTime() >= r.getTime() ? n + 1 : e.getTime() >= c.getTime() ? n : n - 1;
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 = h(t);
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 = h(t), n = new Date(
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 Y(t, e) {
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 = h(t);
104
+ const e = m(t);
105
105
  return !isNaN(Number(e));
106
106
  }
107
107
  function tt(t) {
108
- const e = h(t), n = e.getMonth();
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 = h(t);
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 = h(t), n = k(t, 0);
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 = h(t), r = a.getDay(), i = (r < n ? -7 : 0) + 6 - (r - n);
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 c = t.defaultFormattingWidth || t.defaultWidth, s = n != null && n.width ? String(n.width) : c;
238
- r = t.formattingValues[s] || t.formattingValues[c];
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 c = t.defaultWidth, s = n != null && n.width ? String(n.width) : t.defaultWidth;
241
- r = t.values[s] || t.values[c];
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 c = i[0], s = a && t.parsePatterns[a] || t.parsePatterns[t.defaultParseWidth], l = Array.isArray(s) ? pt(s, (v) => v.test(c)) : (
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(c))
405
+ Pt(s, (v) => v.test(u))
406
406
  );
407
- let f;
408
- f = t.valueCallback ? t.valueCallback(l) : l, f = n.valueCallback ? (
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(f)
411
- ) : f;
412
- const w = e.slice(c.length);
413
- return { value: f, rest: w };
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 c = t.valueCallback ? t.valueCallback(i[0]) : i[0];
433
- c = n.valueCallback ? n.valueCallback(c) : c;
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: c, rest: s };
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 = h(t);
555
+ const e = m(t);
556
556
  return Ze(e, at(e)) + 1;
557
557
  }
558
558
  function $t(t) {
559
- const e = h(t), n = +H(e) - +Ue(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 = h(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, c = k(t, 0);
565
- c.setFullYear(a + 1, 0, i), c.setHours(0, 0, 0, 0);
566
- const s = N(c, e), l = k(t, 0);
567
- l.setFullYear(a, 0, i), l.setHours(0, 0, 0, 0);
568
- const f = N(l, e);
569
- return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >= f.getTime() ? a : a - 1;
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, l, f, w;
573
- const n = A(), a = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((l = (s = e == null ? void 0 : e.locale) == null ? void 0 : s.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((w = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, r = ue(t, e), i = k(t, 0);
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 = h(t), a = +N(n, e) - +Ht(n, e);
577
+ const n = m(t), a = +N(n, e) - +Ht(n, e);
578
578
  return Math.round(a / se) + 1;
579
579
  }
580
- function u(t, e) {
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 u(e === "yy" ? a % 100 : a, e.length);
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) : u(n + 1, 2);
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 u(t.getDate(), e.length);
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 u(t.getHours() % 12 || 12, e.length);
617
+ return d(t.getHours() % 12 || 12, e.length);
618
618
  },
619
619
  // Hour [0-23]
620
620
  H(t, e) {
621
- return u(t.getHours(), e.length);
621
+ return d(t.getHours(), e.length);
622
622
  },
623
623
  // Minute
624
624
  m(t, e) {
625
- return u(t.getMinutes(), e.length);
625
+ return d(t.getMinutes(), e.length);
626
626
  },
627
627
  // Second
628
628
  s(t, e) {
629
- return u(t.getSeconds(), e.length);
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 u(r, e.length);
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 c = i % 100;
676
- return u(c, 2);
675
+ const u = i % 100;
676
+ return d(u, 2);
677
677
  }
678
- return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : u(i, e.length);
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 u(n, e.length);
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 u(n, e.length);
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 u(a, 2);
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 u(a, 2);
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 u(a + 1, 2);
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" }) : u(r, e.length);
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" }) : u(a, e.length);
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" }) : u(a, e.length);
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 u(i, 2);
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 u(i, e.length);
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 u(r, e.length);
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" }) : u(a, e.length);
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" }) : u(a, e.length);
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 _(a);
1076
+ return Y(a);
1077
1077
  case "XXXXX":
1078
1078
  case "XXX":
1079
1079
  default:
1080
- return _(a, ":");
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 _(a);
1091
+ return Y(a);
1092
1092
  case "xxxxx":
1093
1093
  case "xxx":
1094
1094
  default:
1095
- return _(a, ":");
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" + _(a, ":");
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" + _(a, ":");
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 u(a, e.length);
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 u(a, e.length);
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 + u(i, 2);
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 ? "-" : "+") + u(Math.abs(t) / 60, 2) : _(t, e);
1140
+ return t % 60 === 0 ? (t > 0 ? "-" : "+") + d(Math.abs(t) / 60, 2) : Y(t, e);
1141
1141
  }
1142
- function _(t, e = "") {
1143
- const n = t > 0 ? "-" : "+", a = Math.abs(t), r = u(Math.trunc(a / 60), 2), i = u(a % 60, 2);
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
- }, Rt = /^D+$/, Xt = /^Y+$/, Bt = ["D", "DD", "YY", "YYYY"];
1194
+ }, Xt = /^D+$/, Rt = /^Y+$/, Bt = ["D", "DD", "YY", "YYYY"];
1195
1195
  function Vt(t) {
1196
- return Rt.test(t);
1196
+ return Xt.test(t);
1197
1197
  }
1198
1198
  function Qt(t) {
1199
- return Xt.test(t);
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, c = (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 = h(t);
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 l = e.match(Zt).map((y) => {
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 && (l = r.localize.preprocessor(s, l));
1237
- const f = {
1236
+ r.localize.preprocessor && (f = r.localize.preprocessor(s, f));
1237
+ const h = {
1238
1238
  firstWeekContainsDate: i,
1239
- weekStartsOn: c,
1239
+ weekStartsOn: u,
1240
1240
  locale: r
1241
1241
  };
1242
- return l.map((y) => {
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, f);
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 = h(t), a = h(e);
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 = h(t), a = h(e);
1259
+ const n = m(t), a = m(e);
1260
1260
  return +n < +a;
1261
1261
  }
1262
1262
  function nn(t, e) {
1263
- const n = h(t), a = h(e);
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, c] = O(() => t && e && "start" in e ? e.start : /* @__PURE__ */ new Date()), [s, l] = O(e || null), [f, 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 }), [R, ge] = O(null);
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
- l(e || null), t && e && "start" in e ? c(e.start) : !t && e instanceof Date && c(e);
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
- c((d) => o > 0 ? ie(d, 1) : an(d, 1));
1607
+ u((c) => o > 0 ? ie(c, 1) : an(c, 1));
1608
1608
  }, we = (o) => {
1609
+ let c;
1609
1610
  if (t)
1610
- if (R !== null && o)
1611
- s && typeof s == "object" && "start" in s && "end" in s && (R === s.start ? o < s.start ? l({ start: o, end: s.start }) : l({ start: s.start, end: o }) : R === s.end && (o > s.end ? l({ start: s.end, end: o }) : l({ start: o, end: s.end })));
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
- l({ start: o, end: o });
1614
+ c = { start: o, end: o };
1614
1615
  else {
1615
- const { start: d } = s;
1616
- o < d ? l({ start: o, end: d }) : l({ start: d, end: o });
1616
+ const { start: l } = s;
1617
+ c = o < l ? { start: o, end: l } : { start: l, end: o };
1617
1618
  }
1618
1619
  else
1619
- l(o);
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 d = $;
1631
- for (let m = 0; m < 10 && !(d < b); m++)
1632
- o.push(d), d -= 1;
1633
- o.length > 0 && (F((m) => [...m, ...o]), y(d)), j(!1);
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 (f && v && P.current) {
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
- }, [f, v]);
1642
- const ye = () => ["Lu", "Ma", "Me", "Je", "Ve", "Sa", "Di"].map((d, m) => /* @__PURE__ */ g("div", { className: M.calendarWeekdays, children: d }, m)), Me = () => {
1643
- let o = [], d = he;
1644
- for (; d <= fe; )
1645
- o.push(d), d = Ge(d, 1);
1646
- return o.map((m, De) => {
1647
- const X = s && typeof s == "object" && "start" in s && "end" in s, ke = X && Y(m, s.start), Oe = X && Y(m, s.end), We = X && ae(m, s.start) && re(m, s.end), xe = r && (re(m, r) || Y(m, r)), Te = a && (ae(m, a) || Y(m, a)), _e = r && xe || a && Te, Ye = !nn(m, V), Ce = _e || Ye;
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
- ${Y(m, le) ? M.today : ""}
1654
- ${s && Y(m, s) ? M.selected : ""}
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(m),
1660
- children: ne(m, "d")
1658
+ onClick: () => we(l),
1659
+ children: ne(l, "d")
1661
1660
  },
1662
1661
  De
1663
1662
  );
1664
1663
  });
1665
1664
  }, ve = (o) => {
1666
- const d = o.currentTarget;
1667
- d.scrollHeight === d.scrollTop + d.clientHeight && G();
1665
+ const c = o.currentTarget;
1666
+ c.scrollHeight === c.scrollTop + c.clientHeight && G();
1668
1667
  }, Pe = () => {
1669
- const o = (d) => {
1670
- P.current && !P.current.contains(d.target) && J.current && !J.current.contains(d.target) && w(!1);
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 d = ne(o, "MMM yyyy", { locale: jn });
1677
- return d.charAt(0).toUpperCase() + d.slice(1);
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: f ? /* @__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" }) })
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
- f && /* @__PURE__ */ g("div", { className: M.dropdown, children: /* @__PURE__ */ g(
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), c(new Date(o, i.getMonth())), w(!1);
1707
+ x(o), u(new Date(o, i.getMonth())), w(!1);
1709
1708
  },
1710
1709
  children: o
1711
1710
  },
@@ -1,13 +1,13 @@
1
- import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
- import { useState as b, useRef as m, useEffect as p } from "react";
3
- import { Button as W } from "../button/Button.js";
4
- import { Input as H } from "../input/Input.js";
5
- import { IconButton as I } from "../icon-button/IconButton.js";
1
+ import { jsxs as b, jsx as r } from "react/jsx-runtime";
2
+ import { useState as p, useRef as m, useEffect as v } from "react";
3
+ import { Button as B } from "../button/Button.js";
4
+ import { Input as G } from "../input/Input.js";
5
+ import { IconButton as H } from "../icon-button/IconButton.js";
6
6
  import { Icon as _ } from "../icon/Icon.js";
7
7
  import { Modal as J } from "../modal/Modal.js";
8
8
  import "../theme/ThemeContext.js";
9
9
  import '../../styles/Size.css';import '../../styles/Select.css';/* empty css */
10
- const O = "_selectContainer_133eb_54", Q = "_selected_133eb_57", X = "_children_133eb_61", Y = "_active_133eb_78", Z = "_selectList_133eb_82", ee = "_modal_133eb_91", te = "_dropdownFadeIn_133eb_1", ne = "_itemLabel_133eb_98", re = "_searchWrapper_133eb_103", oe = "_noResults_133eb_109", u = {
10
+ const O = "_selectContainer_133eb_54", Q = "_selected_133eb_57", X = "_children_133eb_61", Y = "_active_133eb_78", Z = "_selectList_133eb_82", ee = "_modal_133eb_91", te = "_dropdownFadeIn_133eb_1", ne = "_itemLabel_133eb_98", re = "_searchWrapper_133eb_103", oe = "_noResults_133eb_109", i = {
11
11
  selectContainer: O,
12
12
  selected: Q,
13
13
  children: X,
@@ -21,131 +21,131 @@ const O = "_selectContainer_133eb_54", Q = "_selected_133eb_57", X = "_children_
21
21
  }, me = ({
22
22
  selected: L,
23
23
  size: C = "m",
24
- listItem: s,
24
+ listItem: u,
25
25
  modeDisplay: x = "all",
26
- onSelect: B,
26
+ onSelect: F,
27
27
  positionOverride: y,
28
- placeholder: F = "Sélectionner",
29
- searchPlaceholder: U,
30
- autoCloseCondition: V,
31
- searchable: z = !1,
28
+ placeholder: k = "Sélectionner",
29
+ searchPlaceholder: j,
30
+ autoCloseCondition: U,
31
+ searchable: V = !1,
32
32
  fullWidth: S = !1
33
33
  }) => {
34
- const [t, f] = b(!1), A = m(null), [M, P] = b({
34
+ const [t, f] = p(!1), z = m(null), [A, P] = p({
35
35
  top: "calc(100% + 6px)",
36
36
  left: "0px"
37
- }), [c, k] = b(L ?? null), [$, q] = b("");
38
- p(() => {
39
- L ? k(L) : s.length > 0 ? k(s[0]) : k(null);
40
- }, [L, s]), p(() => {
37
+ }), [o, E] = p(L ?? null), [$, M] = p("");
38
+ v(() => {
39
+ E(L || null);
40
+ }, [L]), v(() => {
41
41
  y && P(y);
42
42
  }, [y]);
43
- const D = (e) => {
44
- k(e), f(!1), B && B(e);
45
- }, G = () => {
46
- const e = c == null ? void 0 : c.icon, o = (c == null ? void 0 : c.label) || F || "Sélectionner";
47
- return x === "icon" && e ? /* @__PURE__ */ r(I, { ref: d, mode: "tertiary", size: C, onClick: () => f(!t), children: /* @__PURE__ */ r(_, { icon: c.icon }) }) : x === "text" ? /* @__PURE__ */ r(
48
- W,
43
+ const q = (e) => {
44
+ E(e), f(!1), F && F(e);
45
+ }, D = () => {
46
+ const e = o == null ? void 0 : o.icon, s = (o == null ? void 0 : o.label) ?? k;
47
+ return x === "icon" && e ? /* @__PURE__ */ r(H, { ref: d, mode: "tertiary", size: C, onClick: () => f(!t), children: /* @__PURE__ */ r(_, { icon: o.icon }) }) : x === "text" ? /* @__PURE__ */ r(
48
+ B,
49
49
  {
50
50
  ref: d,
51
51
  mode: "tertiary",
52
- label: o,
52
+ label: o ? s : k,
53
53
  childrenRight: /* @__PURE__ */ r(_, { icon: t ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
54
54
  size: C,
55
55
  fullWidth: S,
56
56
  onClick: () => f(!t)
57
57
  }
58
58
  ) : x === "all" ? /* @__PURE__ */ r(
59
- W,
59
+ B,
60
60
  {
61
61
  ref: d,
62
62
  mode: "tertiary",
63
- label: o,
63
+ label: o ? s : k,
64
64
  size: C,
65
65
  fullWidth: S,
66
- childrenLeft: e && /* @__PURE__ */ r(_, { icon: c.icon }),
66
+ childrenLeft: e && /* @__PURE__ */ r(_, { icon: o.icon }),
67
67
  childrenRight: /* @__PURE__ */ r(_, { icon: t ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
68
68
  onClick: () => f(!t)
69
69
  }
70
70
  ) : /* @__PURE__ */ r(
71
- W,
71
+ B,
72
72
  {
73
73
  ref: d,
74
74
  mode: "tertiary",
75
75
  fullWidth: S,
76
- label: F ?? "Sélectionner",
76
+ label: k ?? "Sélectionner",
77
77
  size: C,
78
78
  onClick: () => f(!t)
79
79
  }
80
80
  );
81
- }, E = m(null), g = m({}), [R, v] = b(""), h = m(null), K = m({}), j = s.filter(
81
+ }, N = m(null), g = m({}), [R, w] = p(""), h = m(null), I = m({}), K = u.filter(
82
82
  (e) => String(e.label ?? "").toLowerCase().includes($.toLowerCase())
83
- ), N = (e) => {
83
+ ), W = (e) => {
84
84
  if (!t) return;
85
- const o = e.key.length === 1 ? e.key.toLowerCase() : "";
86
- if (!o) return;
87
- const a = R + o;
88
- v(a);
89
- const i = s.find((n) => {
90
- var l;
91
- return (l = n.label) == null ? void 0 : l.toLowerCase().startsWith(a);
85
+ const s = e.key.length === 1 ? e.key.toLowerCase() : "";
86
+ if (!s) return;
87
+ const l = R + s;
88
+ w(l);
89
+ const a = u.find((n) => {
90
+ var c;
91
+ return (c = n.label) == null ? void 0 : c.toLowerCase().startsWith(l);
92
92
  });
93
- if (i) {
94
- const n = g.current[i.value];
93
+ if (a) {
94
+ const n = g.current[a.value];
95
95
  n == null || n.scrollIntoView({ behavior: "smooth", block: "nearest" });
96
96
  }
97
97
  h.current && clearTimeout(h.current), h.current = setTimeout(() => {
98
- v("");
98
+ w("");
99
99
  }, 500);
100
100
  };
101
- p(() => (t ? window.addEventListener("keydown", N) : (window.removeEventListener("keydown", N), v("")), () => {
102
- window.removeEventListener("keydown", N);
103
- }), [t, R, s]), p(() => {
104
- const e = (o) => {
101
+ v(() => (t ? window.addEventListener("keydown", W) : (window.removeEventListener("keydown", W), w("")), () => {
102
+ window.removeEventListener("keydown", W);
103
+ }), [t, R, u]), v(() => {
104
+ const e = (s) => {
105
105
  if (!t) return;
106
- const a = o.key.length === 1 ? o.key.toLowerCase() : "";
107
- if (!a) return;
108
- const i = R + a;
109
- v(i);
110
- const n = s.find(
111
- (l) => {
106
+ const l = s.key.length === 1 ? s.key.toLowerCase() : "";
107
+ if (!l) return;
108
+ const a = R + l;
109
+ w(a);
110
+ const n = u.find(
111
+ (c) => {
112
112
  var T;
113
- return (T = l.label) == null ? void 0 : T.toLowerCase().startsWith(i);
113
+ return (T = c.label) == null ? void 0 : T.toLowerCase().startsWith(a);
114
114
  }
115
115
  );
116
- if (n && E.current && n.value in g.current && g.current[n.value]) {
117
- const l = E.current, T = g.current[n.value];
118
- l.scrollTo({
119
- top: T.offsetTop - l.offsetTop,
116
+ if (n && N.current && n.value in g.current && g.current[n.value]) {
117
+ const c = N.current, T = g.current[n.value];
118
+ c.scrollTo({
119
+ top: T.offsetTop - c.offsetTop,
120
120
  behavior: "smooth"
121
121
  });
122
122
  }
123
123
  h.current && clearTimeout(h.current), h.current = setTimeout(() => {
124
- v("");
124
+ w("");
125
125
  }, 700);
126
126
  };
127
127
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
128
- }, [t, s, R]), p(() => {
128
+ }, [t, u, R]), v(() => {
129
129
  if (!t) return;
130
- const e = (o) => {
131
- const a = o.key.toLowerCase();
132
- if (a.length === 1) {
133
- const i = s.find(
130
+ const e = (s) => {
131
+ const l = s.key.toLowerCase();
132
+ if (l.length === 1) {
133
+ const a = u.find(
134
134
  (n) => {
135
- var l;
136
- return (l = n.label) == null ? void 0 : l.toLowerCase().startsWith(a);
135
+ var c;
136
+ return (c = n.label) == null ? void 0 : c.toLowerCase().startsWith(l);
137
137
  }
138
138
  );
139
- if (i) {
140
- const n = K.current[i.value];
139
+ if (a) {
140
+ const n = I.current[a.value];
141
141
  n && n.scrollIntoView({ block: "start", behavior: "smooth" });
142
142
  }
143
143
  }
144
144
  };
145
145
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
146
- }, [t, s]);
146
+ }, [t, u]);
147
147
  const d = m(null);
148
- return p(() => {
148
+ return v(() => {
149
149
  if (t && d.current) {
150
150
  const e = d.current.getBoundingClientRect().height;
151
151
  P(y || {
@@ -153,49 +153,49 @@ const O = "_selectContainer_133eb_54", Q = "_selected_133eb_57", X = "_children_
153
153
  left: "0px"
154
154
  });
155
155
  }
156
- }, [t]), /* @__PURE__ */ w("div", { className: u.selectContainer, children: [
157
- G(),
156
+ }, [t]), /* @__PURE__ */ b("div", { className: i.selectContainer, children: [
157
+ D(),
158
158
  /* @__PURE__ */ r(
159
159
  J,
160
160
  {
161
- ref: A,
161
+ ref: z,
162
162
  anchorRef: d,
163
163
  open: t,
164
164
  onClose: () => f(!1),
165
- position: M,
165
+ position: A,
166
166
  disableOverlay: !0,
167
- className: u.modal,
168
- autoCloseCondition: V,
169
- children: /* @__PURE__ */ w("div", { children: [
170
- z && /* @__PURE__ */ w("div", { children: [
167
+ className: i.modal,
168
+ autoCloseCondition: U,
169
+ children: /* @__PURE__ */ b("div", { children: [
170
+ V && /* @__PURE__ */ b("div", { children: [
171
171
  /* @__PURE__ */ r(
172
- H,
172
+ G,
173
173
  {
174
174
  type: "text",
175
- placeholder: U,
175
+ placeholder: j,
176
176
  status: "ghost",
177
177
  sizeStyle: "s",
178
178
  value: $,
179
- onChange: (e) => q(e.target.value)
179
+ onChange: (e) => M(e.target.value)
180
180
  }
181
181
  ),
182
- /* @__PURE__ */ r("div", { className: u.searchWrapper })
182
+ /* @__PURE__ */ r("div", { className: i.searchWrapper })
183
183
  ] }),
184
- /* @__PURE__ */ w("div", { className: u.selectList, ref: E, children: [
185
- j.map((e) => /* @__PURE__ */ w(
184
+ /* @__PURE__ */ b("div", { className: i.selectList, ref: N, children: [
185
+ K.map((e) => /* @__PURE__ */ b(
186
186
  "div",
187
187
  {
188
- ref: (o) => K.current[e.value] = o,
189
- className: `${u.children} ${(c == null ? void 0 : c.value) === e.value ? u.active : ""}`,
190
- onClick: () => D(e),
188
+ ref: (s) => I.current[e.value] = s,
189
+ className: `${i.children} ${(o == null ? void 0 : o.value) === e.value ? i.active : ""}`,
190
+ onClick: () => q(e),
191
191
  children: [
192
192
  e.icon && /* @__PURE__ */ r(_, { icon: e.icon, size: 16 }),
193
- e.label && /* @__PURE__ */ r("div", { className: u.itemLabel, children: e.label })
193
+ e.label && /* @__PURE__ */ r("div", { className: i.itemLabel, children: e.label })
194
194
  ]
195
195
  },
196
196
  e.value
197
197
  )),
198
- j.length === 0 && /* @__PURE__ */ r("div", { className: `${u.noResults} textSmall`, children: "Aucun résultat" })
198
+ K.length === 0 && /* @__PURE__ */ r("div", { className: `${i.noResults} textSmall`, children: "Aucun résultat" })
199
199
  ] })
200
200
  ] })
201
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",