@stenajs-webui/calendar 19.0.0-next.5 → 19.0.0-next.50

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/index.es.js CHANGED
@@ -1,21 +1,16 @@
1
1
  (function(){"use strict";try{var r=document.createElement("style");r.appendChild(document.createTextNode("._calendar_1w0de_1{--swui-calendar-day-width: 40px;--swui-calendar-day-height: 38px;--swui-calendar-day-border-radius: 4px;--swui-calendar-week-number-bg-color: transparent;--swui-calendar-week-number-text-color: var(--lhds-color-ui-500);--swui-calendar-week-number-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-text-color: var(--lhds-color-ui-500);--swui-calendar-week-day-clickable-text-color: var(--lhds-color-ui-500);--swui-calendar-wrapper-selected-border: var(--swui-primary-action-color);--swui-calendar-wrapper-selected-background: var(--swui-primary-action-color);--swui-calendar-wrapper-range-border: var(--lhds-color-blue-100);--swui-calendar-wrapper-range-background: var(--lhds-color-blue-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-200);--swui-calendar-text-selected-color: #fff;--swui-calendar-text-disabled-color: var(--swui-text-disabled-color);--swui-calendar-text-in-other-month-color: var(--swui-text-disabled-color)}._calendar_1w0de_1 table{border-spacing:0 4px}._calendar_1w0de_1 span{line-height:100%}._calendar_1w0de_1 tr td:last-child{border-top-right-radius:var(--swui-calendar-day-border-radius);border-bottom-right-radius:var(--swui-calendar-day-border-radius)}._calendar_1w0de_1 tr td:nth-child(2){border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1w0de_1 td{padding:0;width:var(--swui-calendar-day-width);height:var(--swui-calendar-day-height)}._timePicker_1w05d_1{overflow:hidden;width:180px}._timePickerColumn_1w05d_6{overflow-y:hidden;flex:1}._timePickerColumn_1w05d_6:hover{overflow-y:scroll}")),document.head.appendChild(r)}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { Box as I, Text as it, Clickable as Wt, Row as R, Space as $, Spacing as ge, Column as B, Indent as ht, SeparatorLine as ye, parseIntElseUndefined as Jt, useBoolean as Ht, useDelayedFalse as Yt } from "@stenajs-webui/core";
3
- import { FlatButton as A, PrimaryButton as dt, stenaAngleLeft as Ot, stenaAngleRight as $t, stenaAngleLeftDouble as me, stenaAngleRightDouble as we, stenaCalendar as gt, Icon as Qt, stenaClock as Xt, stenaAngleDown as pe, stenaArrowRight as be } from "@stenajs-webui/elements";
4
- import { isAfter as et, eachDayOfInterval as Pt, isSameDay as z, endOfMonth as Zt, startOfMonth as Ft, min as ke, addDays as q, max as Se, subDays as Dt, format as W, getISOWeek as Bt, getDate as Ct, startOfWeek as vt, addWeeks as Me, getMonth as tt, getWeek as Vt, getYear as yt, getISODay as Ee, addHours as Re, isBefore as Ae, parse as ot, addMonths as Te, addYears as xe, subMonths as Ce, subYears as Ne, setWeek as Ie, isValid as He } from "date-fns";
5
- import { enGB as zt } from "date-fns/locale";
6
- import { last as Ye, startCase as te, chunk as ee, range as jt, debounce as Le, padStart as Ue } from "lodash";
7
- import * as ne from "react";
2
+ import { jsx as i, jsxs as E, Fragment as ht } from "react/jsx-runtime";
3
+ import { Box as I, Text as it, Clickable as Wt, Row as R, Space as $, Spacing as me, Column as B, Indent as gt, SeparatorLine as pe, parseIntElseUndefined as Jt, useBoolean as Ht, useDelayedFalse as Yt } from "@stenajs-webui/core";
4
+ import { FlatButton as x, PrimaryButton as dt, stenaAngleLeft as Ot, stenaAngleRight as $t, stenaArrowLeft as be, stenaArrowRight as Qt, stenaAngleLeftDouble as Xt, stenaAngleRightDouble as Zt, stenaCalendar as yt, Icon as Ft, stenaArrowWideRight as ke, stenaClock as vt, stenaAngleDown as Se } from "@stenajs-webui/elements";
5
+ import { isAfter as et, eachDayOfInterval as Pt, isSameDay as j, endOfMonth as Vt, startOfMonth as te, min as Me, addDays as q, max as Ee, subDays as Dt, format as W, getISOWeek as Bt, getDate as Ct, startOfWeek as ee, addWeeks as Re, getMonth as tt, getWeek as ne, getYear as wt, getISODay as Ae, addHours as Te, isBefore as xe, parse as ot, addMonths as Ce, addYears as Ne, subMonths as Ie, subYears as He, setWeek as Ye, isValid as Le } from "date-fns";
6
+ import { enGB as jt } from "date-fns/locale";
7
+ import { last as Ue, startCase as re, chunk as se, range as zt, debounce as We, padStart as Oe } from "lodash";
8
+ import * as ce from "react";
8
9
  import { useMemo as C, useState as S, useEffect as Q, useCallback as g, useRef as J } from "react";
9
- import { jsx as i, jsxs as E, Fragment as mt } from "react/jsx-runtime";
10
10
  import Nt from "@emotion/styled";
11
- import { faCaretLeft as We } from "@fortawesome/free-solid-svg-icons/faCaretLeft";
12
- import { faCaretRight as Oe } from "@fortawesome/free-solid-svg-icons/faCaretRight";
13
- import { faAngleDoubleLeft as $e } from "@fortawesome/free-solid-svg-icons/faAngleDoubleLeft";
14
- import { faAngleDoubleRight as Pe } from "@fortawesome/free-solid-svg-icons/faAngleDoubleRight";
15
- import { TextInput as nt, TextInputBox as Be } from "@stenajs-webui/forms";
16
- import { useTippyInstance as ze, Popover as pt } from "@stenajs-webui/tooltip";
17
- import { cssColor as re } from "@stenajs-webui/theme";
18
- import { faLongArrowAltRight as je } from "@fortawesome/free-solid-svg-icons/faLongArrowAltRight";
11
+ import { TextInput as nt, TextInputButton as $e, TextInputBox as Pe } from "@stenajs-webui/forms";
12
+ import { useTippyInstance as Be, Popover as pt } from "@stenajs-webui/tooltip";
13
+ import { cssColor as ie } from "@stenajs-webui/theme";
19
14
  const Z = {
20
15
  yearAndMonth: "yyyy-MM",
21
16
  fullDate: "yyyy-MM-dd",
@@ -26,28 +21,28 @@ const Z = {
26
21
  weekDayNameShort: "EEE",
27
22
  dateAndMonth: "d MMM",
28
23
  monthAndDate: "MMM do"
29
- }, wt = (t = {}, e, n) => {
24
+ }, mt = (t = {}, e, n) => {
30
25
  if (e && n && et(n, e))
31
26
  return Pt({ start: e, end: n }).reduce(
32
27
  (s, c) => {
33
- const d = z(c, e), o = z(c, n);
28
+ const d = j(c, e), o = j(c, n);
34
29
  return X(s, c, d ? ["selected", "selectedStart", "range"] : o ? ["selected", "selectedEnd", "range"] : ["range"]);
35
30
  },
36
31
  t
37
32
  );
38
33
  let r = t;
39
34
  return e && (r = X(r, e, ["selected", "singleSelected"])), n && (r = X(r, n, ["selected", "singleSelected"])), r;
40
- }, _e = (t = {}, e, n, r) => Je(
35
+ }, je = (t = {}, e, n, r) => ze(
41
36
  t,
42
37
  e,
43
38
  n,
44
- Ft(r),
45
- Zt(r)
46
- ), Je = (t = {}, e, n, r, s) => e && n ? wt(
39
+ te(r),
40
+ Vt(r)
41
+ ), ze = (t = {}, e, n, r, s) => e && n ? mt(
47
42
  t,
48
- Se([e, Dt(r, 1)]),
49
- ke([n, q(s, 1)])
50
- ) : wt(t, e, n), pr = (t, e, n) => {
43
+ Ee([e, Dt(r, 1)]),
44
+ Me([n, q(s, 1)])
45
+ ) : mt(t, e, n), ur = (t, e, n) => {
51
46
  const r = W(e, Z.yearAndMonth), s = Bt(e), c = Ct(e);
52
47
  return {
53
48
  ...t,
@@ -62,7 +57,7 @@ const Z = {
62
57
  }
63
58
  }
64
59
  };
65
- }, br = (t, e, n) => {
60
+ }, Dr = (t, e, n) => {
66
61
  const r = W(e, Z.yearAndMonth), s = Bt(e), c = Ct(e);
67
62
  return {
68
63
  ...t,
@@ -87,17 +82,17 @@ const Z = {
87
82
  ...t && t[s],
88
83
  [c]: {
89
84
  ...t && t[s] && t[s][c],
90
- [d]: se(o, n)
85
+ [d]: oe(o, n)
91
86
  }
92
87
  }
93
88
  };
94
- }, se = (t, e) => {
89
+ }, oe = (t, e) => {
95
90
  var n;
96
91
  return {
97
92
  ...t,
98
93
  highlights: [...(n = t == null ? void 0 : t.highlights) != null ? n : [], ...e]
99
94
  };
100
- }, kr = (t, e, n) => {
95
+ }, hr = (t, e, n) => {
101
96
  const r = e.days[0].date, s = r.getMonth() + 1, c = `${r.getFullYear()}-${s < 10 ? "0" : ""}${s}`, d = e.weekNumber;
102
97
  let o = t;
103
98
  e.days.forEach((h) => {
@@ -114,36 +109,36 @@ const Z = {
114
109
  [d]: f
115
110
  }
116
111
  };
117
- }, Ke = (t, e) => {
112
+ }, _e = (t, e) => {
118
113
  var s;
119
114
  if (!e.days.length)
120
115
  return { ...t };
121
- const n = e.days[0].date, r = (s = Ye(e.days)) == null ? void 0 : s.date;
116
+ const n = e.days[0].date, r = (s = Ue(e.days)) == null ? void 0 : s.date;
122
117
  return {
123
- ...wt(t, n, r)
118
+ ...mt(t, n, r)
124
119
  };
125
- }, Ge = (t, e) => C(() => t ? X(e, new Date(), ["today"]) : e, [t, e]);
126
- var U = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1] = "FEBRUARY", t[t.MARCH = 2] = "MARCH", t[t.APRIL = 3] = "APRIL", t[t.MAY = 4] = "MAY", t[t.JUNE = 5] = "JUNE", t[t.JULY = 6] = "JULY", t[t.AUGUST = 7] = "AUGUST", t[t.SEPTEMBER = 8] = "SEPTEMBER", t[t.OCTOBER = 9] = "OCTOBER", t[t.NOVEMBER = 10] = "NOVEMBER", t[t.DECEMBER = 11] = "DECEMBER", t))(U || {}), qe = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))(qe || {});
120
+ }, Je = (t, e) => C(() => t ? X(e, new Date(), ["today"]) : e, [t, e]);
121
+ var U = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1] = "FEBRUARY", t[t.MARCH = 2] = "MARCH", t[t.APRIL = 3] = "APRIL", t[t.MAY = 4] = "MAY", t[t.JUNE = 5] = "JUNE", t[t.JULY = 6] = "JULY", t[t.AUGUST = 7] = "AUGUST", t[t.SEPTEMBER = 8] = "SEPTEMBER", t[t.OCTOBER = 9] = "OCTOBER", t[t.NOVEMBER = 10] = "NOVEMBER", t[t.DECEMBER = 11] = "DECEMBER", t))(U || {}), Ke = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))(Ke || {});
127
122
  const Kt = (t, e, n, r) => {
128
123
  const s = [];
129
124
  for (let c = 0; c < n; c++)
130
- s.push(ce(t, e + c, r));
125
+ s.push(de(t, e + c, r));
131
126
  return s;
132
- }, ce = (t, e, n) => {
127
+ }, de = (t, e, n) => {
133
128
  const r = t + Math.floor(e / 12), s = e % 12, c = new Date(r, s, 1);
134
129
  return {
135
130
  monthString: W(c, Z.yearAndMonth),
136
- name: te(
131
+ name: re(
137
132
  W(c, Z.fullMonthName, { locale: n })
138
133
  ),
139
134
  year: r,
140
135
  monthInYear: s,
141
- weeks: Qe(r, s, n)
136
+ weeks: Ge(r, s, n)
142
137
  };
143
- }, Qe = (t, e, n, r = !0) => {
144
- const s = new Date(t, e, 1), c = vt(s, { locale: n }), d = [];
138
+ }, Ge = (t, e, n, r = !0) => {
139
+ const s = new Date(t, e, 1), c = ee(s, { locale: n }), d = [];
145
140
  for (let o = 0; o < 6; o++) {
146
- const l = _t(Me(c, o), n);
141
+ const l = _t(Re(c, o), n);
147
142
  if (o > 0 && l.startMonth !== e && !r)
148
143
  return d;
149
144
  d.push(l);
@@ -152,36 +147,36 @@ const Kt = (t, e, n, r) => {
152
147
  }, _t = (t, e) => {
153
148
  const n = tt(q(t, 7)) !== tt(t);
154
149
  return {
155
- weekNumber: Vt(t, { locale: e }),
150
+ weekNumber: ne(t, { locale: e }),
156
151
  startMonth: tt(t),
157
- startYear: yt(t),
152
+ startYear: wt(t),
158
153
  endMonth: tt(q(t, 6)),
159
- endYear: yt(q(t, 6)),
160
- days: Ze(t, e),
154
+ endYear: wt(q(t, 6)),
155
+ days: Qe(t, e),
161
156
  isLastWeekOfMonth: n
162
157
  };
163
- }, Xe = (t, e) => {
164
- const n = Ee(t);
158
+ }, qe = (t, e) => {
159
+ const n = Ae(t);
165
160
  return {
166
161
  date: t,
167
162
  name: W(t, "EEE", e ? { locale: e } : void 0),
168
- dateString: W(Re(t, 12), Z.fullDate),
169
- weekNumber: Vt(t, { locale: e }),
170
- year: yt(t),
163
+ dateString: W(Te(t, 12), Z.fullDate),
164
+ weekNumber: ne(t, { locale: e }),
165
+ year: wt(t),
171
166
  month: tt(t),
172
167
  dayOfMonth: Ct(t),
173
168
  dayOfWeek: n,
174
169
  isFirstDayOfWeek: n === 1,
175
170
  isLastDayOfWeek: n === 7,
176
- isFirstDayOfMonth: z(Ft(t), t),
177
- isLastDayOfMonth: z(Zt(t), t)
171
+ isFirstDayOfMonth: j(te(t), t),
172
+ isLastDayOfMonth: j(Vt(t), t)
178
173
  };
179
- }, Ze = (t, e) => Pt({
174
+ }, Qe = (t, e) => Pt({
180
175
  start: t,
181
176
  end: q(t, 6)
182
- }).map((n) => Xe(n, e)), Fe = (t, e) => e > 11 ? { year: t + Math.floor(e / 12), month: e % 12 } : e < 0 ? { year: t + Math.floor(e / 12), month: 12 + e % 12 } : { year: t, month: e }, ve = "_calendar_1w0de_1", Ve = {
183
- calendar: ve
184
- }, tn = (t, e, n) => !!(e && e.indexOf(n) >= 0 || t && t.highlights && t.highlights.indexOf(n) >= 0), V = (t, e, n, r, s) => {
177
+ }).map((n) => qe(n, e)), Xe = (t, e) => e > 11 ? { year: t + Math.floor(e / 12), month: e % 12 } : e < 0 ? { year: t + Math.floor(e / 12), month: 12 + e % 12 } : { year: t, month: e }, Ze = "_calendar_1w0de_1", Fe = {
178
+ calendar: Ze
179
+ }, ve = (t, e, n) => !!(e && e.indexOf(n) >= 0 || t && t.highlights && t.highlights.indexOf(n) >= 0), V = (t, e, n, r, s) => {
185
180
  if (n.length !== r.length)
186
181
  throw new Error(
187
182
  "Select highlight failed, number of values do not equal number of highlights."
@@ -189,31 +184,73 @@ const Kt = (t, e, n, r) => {
189
184
  if (n.length === 0)
190
185
  return s;
191
186
  for (let c = 0; c < n.length; c++)
192
- if (typeof n[c] == "boolean" && n[c] || typeof n[c] == "string" && tn(
187
+ if (typeof n[c] == "boolean" && n[c] || typeof n[c] == "string" && ve(
193
188
  t,
194
189
  e,
195
190
  n[c]
196
191
  ))
197
192
  return r[c];
198
193
  return s;
199
- }, en = ({
194
+ }, Ve = ({
200
195
  selectedBackground: t,
201
196
  todayBackground: e,
202
197
  rangeBackground: n,
203
198
  borderColor: r = "transparent"
204
199
  }) => (s, c, d, o, l) => {
205
200
  let a = {};
206
- const f = V(c, s, ["selected", "range", "today", d.month === l.monthInYear], [t, n, e, "#fff"], "transparent");
201
+ const f = V(
202
+ c,
203
+ s,
204
+ ["selected", "range", "today", d.month === l.monthInYear],
205
+ [t, n, e, "#fff"],
206
+ "transparent"
207
+ );
207
208
  return {
208
209
  ...a,
209
210
  backgroundColor: f,
210
- borderTopLeftRadius: V(c, s, ["selectedStart", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
211
- borderBottomLeftRadius: V(c, s, ["selectedStart", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
212
- borderTopRightRadius: V(c, s, ["selectedEnd", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
213
- borderBottomRightRadius: V(c, s, ["selectedEnd", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
211
+ borderTopLeftRadius: V(
212
+ c,
213
+ s,
214
+ ["selectedStart", "singleSelected"],
215
+ [
216
+ "var(--swui-calendar-day-border-radius)",
217
+ "var(--swui-calendar-day-border-radius)"
218
+ ],
219
+ r
220
+ ),
221
+ borderBottomLeftRadius: V(
222
+ c,
223
+ s,
224
+ ["selectedStart", "singleSelected"],
225
+ [
226
+ "var(--swui-calendar-day-border-radius)",
227
+ "var(--swui-calendar-day-border-radius)"
228
+ ],
229
+ r
230
+ ),
231
+ borderTopRightRadius: V(
232
+ c,
233
+ s,
234
+ ["selectedEnd", "singleSelected"],
235
+ [
236
+ "var(--swui-calendar-day-border-radius)",
237
+ "var(--swui-calendar-day-border-radius)"
238
+ ],
239
+ r
240
+ ),
241
+ borderBottomRightRadius: V(
242
+ c,
243
+ s,
244
+ ["selectedEnd", "singleSelected"],
245
+ [
246
+ "var(--swui-calendar-day-border-radius)",
247
+ "var(--swui-calendar-day-border-radius)"
248
+ ],
249
+ r
250
+ ),
214
251
  boxSizing: "border-box"
215
252
  };
216
- }, nn = ({
253
+ }, tn = ({
217
254
  selectedColor: t,
218
255
  disabledColor: e,
219
256
  inOtherMonthColor: n,
@@ -221,7 +258,18 @@ const Kt = (t, e, n, r) => {
221
258
  }) => (s, c, d, o, l) => {
222
259
  const a = d.month !== l.monthInYear;
223
260
  return {
224
- color: V(c, s, [a, "selected", "range", "enabled", "disabled"], [n, t, r, void 0, e])
261
+ color: V(
262
+ c,
263
+ s,
264
+ [a, "selected", "range", "enabled", "disabled"],
265
+ [
266
+ n,
267
+ t,
268
+ r,
269
+ void 0,
270
+ e
271
+ ]
272
+ )
225
273
  };
226
274
  }, rt = {
227
275
  width: "var(--swui-calendar-day-width)",
@@ -237,12 +285,12 @@ const Kt = (t, e, n, r) => {
237
285
  clickableTextColor: "var(--swui-calendar-week-day-clickable-text-color)"
238
286
  },
239
287
  CalendarDay: {
240
- tdStyle: en({
288
+ tdStyle: Ve({
241
289
  selectedBackground: "var(--swui-calendar-wrapper-selected-background)",
242
290
  rangeBackground: "var(--swui-calendar-wrapper-range-background)",
243
291
  todayBackground: "var(--swui-calendar-wrapper-today-background)"
244
292
  }),
245
- textProps: nn({
293
+ textProps: tn({
246
294
  selectedColor: "var(--swui-calendar-text-selected-color)",
247
295
  disabledColor: "var(--swui-calendar-text-disabled-color)",
248
296
  inOtherMonthColor: "var(--swui-calendar-text-in-other-month-color)"
@@ -251,11 +299,11 @@ const Kt = (t, e, n, r) => {
251
299
  CalendarMonth: {
252
300
  headerTextColor: "var(--swui-calendar-week-day-text-color)"
253
301
  }
254
- }, Sr = {
302
+ }, gr = {
255
303
  ...rt,
256
304
  width: "37px",
257
305
  height: "37px"
258
- }, rn = (t, e, n) => e && Ae(t, e) ? z(t, e) : n && et(t, n) ? z(t, n) : !0, sn = function({
306
+ }, en = (t, e, n) => e && xe(t, e) ? j(t, e) : n && et(t, n) ? j(t, n) : !0, nn = function({
259
307
  dayComponent: e,
260
308
  minDate: n,
261
309
  maxDate: r,
@@ -263,13 +311,12 @@ const Kt = (t, e, n, r) => {
263
311
  day: c,
264
312
  ...d
265
313
  }) {
266
- const o = C(() => rn(c.date, n, r) ? s : se(s, ["disabled"]), [c.date, s, r, n]);
267
- return /* @__PURE__ */ i(e, {
268
- day: c,
269
- ...d,
270
- dayState: o
271
- });
272
- }, cn = ({
314
+ const o = C(
315
+ () => en(c.date, n, r) ? s : oe(s, ["disabled"]),
316
+ [c.date, s, r, n]
317
+ );
318
+ return /* @__PURE__ */ i(e, { day: c, ...d, dayState: o });
319
+ }, rn = ({
273
320
  onClickWeek: t,
274
321
  theme: e,
275
322
  week: n,
@@ -277,34 +324,46 @@ const Kt = (t, e, n, r) => {
277
324
  backgroundColor: s,
278
325
  prefix: c
279
326
  }) => {
280
- const d = /* @__PURE__ */ E(I, {
281
- width: e.width,
282
- height: e.height,
283
- justifyContent: "center",
284
- alignItems: "center",
285
- children: [r && /* @__PURE__ */ i(I, {
286
- position: "absolute",
287
- children: r
288
- }), /* @__PURE__ */ i(I, {
289
- position: "absolute",
290
- children: /* @__PURE__ */ E(it, {
291
- color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
292
- children: [c, n.weekNumber]
293
- })
294
- })]
295
- });
296
- return /* @__PURE__ */ i(I, {
297
- background: s || e.WeekNumber.backgroundColor,
298
- position: "relative",
299
- children: t ? /* @__PURE__ */ i(Wt, {
300
- borderRadius: "var(--swui-calendar-day-border-radius)",
301
- onClick: (o) => t(n, o),
302
- disableFocusHighlight: !t,
303
- children: d
304
- }) : d
305
- });
327
+ const d = /* @__PURE__ */ E(
328
+ I,
329
+ {
330
+ width: e.width,
331
+ height: e.height,
332
+ justifyContent: "center",
333
+ alignItems: "center",
334
+ children: [
335
+ r && /* @__PURE__ */ i(I, { position: "absolute", children: r }),
336
+ /* @__PURE__ */ i(I, { position: "absolute", children: /* @__PURE__ */ E(
337
+ it,
338
+ {
339
+ color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
340
+ children: [
341
+ c,
342
+ n.weekNumber
343
+ ]
344
+ }
345
+ ) })
346
+ ]
347
+ }
348
+ );
349
+ return /* @__PURE__ */ i(
350
+ I,
351
+ {
352
+ background: s || e.WeekNumber.backgroundColor,
353
+ position: "relative",
354
+ children: t ? /* @__PURE__ */ i(
355
+ Wt,
356
+ {
357
+ borderRadius: "var(--swui-calendar-day-border-radius)",
358
+ onClick: (o) => t(n, o),
359
+ disableFocusHighlight: !t,
360
+ children: d
361
+ }
362
+ ) : d
363
+ }
364
+ );
306
365
  };
307
- function on({
366
+ function sn({
308
367
  week: t,
309
368
  month: e,
310
369
  dayComponent: n,
@@ -319,52 +378,67 @@ function on({
319
378
  extraDayContent: h,
320
379
  defaultHighlights: u
321
380
  }) {
322
- return /* @__PURE__ */ E("tr", {
323
- children: [a.WeekNumber.show && /* @__PURE__ */ i("td", {
324
- children: f ? f(t, a, o) : /* @__PURE__ */ i(cn, {
381
+ return /* @__PURE__ */ E("tr", { children: [
382
+ a.WeekNumber.show && /* @__PURE__ */ i("td", { children: f ? f(t, a, o) : /* @__PURE__ */ i(
383
+ rn,
384
+ {
325
385
  week: t,
326
386
  onClickWeek: o,
327
387
  theme: a
328
- })
329
- }), t.days.map((D) => /* @__PURE__ */ i(sn, {
330
- dayComponent: n,
331
- day: D,
332
- week: t,
333
- month: e,
334
- dayState: r && r[D.dayOfMonth],
335
- userData: s && s[D.dayOfMonth],
336
- onClickDay: l,
337
- theme: a,
338
- extraDayContent: h,
339
- defaultHighlights: u,
340
- minDate: c,
341
- maxDate: d
342
- }, D.dateString))]
343
- }, t.weekNumber);
388
+ }
389
+ ) }),
390
+ t.days.map((D) => /* @__PURE__ */ i(
391
+ nn,
392
+ {
393
+ dayComponent: n,
394
+ day: D,
395
+ week: t,
396
+ month: e,
397
+ dayState: r && r[D.dayOfMonth],
398
+ userData: s && s[D.dayOfMonth],
399
+ onClickDay: l,
400
+ theme: a,
401
+ extraDayContent: h,
402
+ defaultHighlights: u,
403
+ minDate: c,
404
+ maxDate: d
405
+ },
406
+ D.dateString
407
+ ))
408
+ ] }, t.weekNumber);
344
409
  }
345
- const dn = ({
410
+ const cn = ({
346
411
  onClickWeekDay: t,
347
412
  day: e,
348
413
  theme: n
349
414
  }) => {
350
- const r = /* @__PURE__ */ i(I, {
351
- width: n.width,
352
- height: n.height,
353
- justifyContent: "center",
354
- alignItems: "center",
355
- children: /* @__PURE__ */ i(it, {
356
- size: "small",
357
- color: t ? n.WeekDay.clickableTextColor : n.WeekDay.textColor,
358
- children: e.name
359
- })
360
- });
361
- return t ? /* @__PURE__ */ i(Wt, {
362
- borderRadius: "var(--swui-calendar-day-border-radius)",
363
- onClick: (s) => t(e.dayOfWeek, s),
364
- disableFocusHighlight: !t,
365
- children: r
366
- }) : r;
367
- }, ie = function({
415
+ const r = /* @__PURE__ */ i(
416
+ I,
417
+ {
418
+ width: n.width,
419
+ height: n.height,
420
+ justifyContent: "center",
421
+ alignItems: "center",
422
+ children: /* @__PURE__ */ i(
423
+ it,
424
+ {
425
+ size: "small",
426
+ color: t ? n.WeekDay.clickableTextColor : n.WeekDay.textColor,
427
+ children: e.name
428
+ }
429
+ )
430
+ }
431
+ );
432
+ return t ? /* @__PURE__ */ i(
433
+ Wt,
434
+ {
435
+ borderRadius: "var(--swui-calendar-day-border-radius)",
436
+ onClick: (s) => t(e.dayOfWeek, s),
437
+ disableFocusHighlight: !t,
438
+ children: r
439
+ }
440
+ ) : r;
441
+ }, le = function({
368
442
  day: e,
369
443
  week: n,
370
444
  month: r,
@@ -375,57 +449,93 @@ const dn = ({
375
449
  extraDayContent: l,
376
450
  defaultHighlights: a
377
451
  }) {
378
- const f = /* @__PURE__ */ i(I, {
379
- width: "100%",
380
- height: "100%",
381
- justifyContent: "center",
382
- alignItems: "center",
383
- children: /* @__PURE__ */ i(it, {
384
- ...o.CalendarDay.textProps && o.CalendarDay.textProps(a, s, e, n, r, c),
385
- children: e.dayOfMonth
386
- })
387
- }), h = Nt.td({
388
- ...o.CalendarDay.tdStyle && o.CalendarDay.tdStyle(a, s, e, n, r, c)
452
+ const f = /* @__PURE__ */ i(
453
+ I,
454
+ {
455
+ width: "100%",
456
+ height: "100%",
457
+ justifyContent: "center",
458
+ alignItems: "center",
459
+ children: /* @__PURE__ */ i(
460
+ it,
461
+ {
462
+ ...o.CalendarDay.textProps && o.CalendarDay.textProps(
463
+ a,
464
+ s,
465
+ e,
466
+ n,
467
+ r,
468
+ c
469
+ ),
470
+ children: e.dayOfMonth
471
+ }
472
+ )
473
+ }
474
+ ), h = Nt.td({
475
+ ...o.CalendarDay.tdStyle && o.CalendarDay.tdStyle(
476
+ a,
477
+ s,
478
+ e,
479
+ n,
480
+ r,
481
+ c
482
+ )
389
483
  }), u = Nt.div({
390
- ...o.CalendarDay.innerWrapperStyle && o.CalendarDay.innerWrapperStyle(a, s, e, n, r, c),
484
+ ...o.CalendarDay.innerWrapperStyle && o.CalendarDay.innerWrapperStyle(
485
+ a,
486
+ s,
487
+ e,
488
+ n,
489
+ r,
490
+ c
491
+ ),
391
492
  width: "100%",
392
493
  height: "100%"
393
494
  }), D = Nt.div({
394
- ...o.CalendarDay.cellWrapperStyle && o.CalendarDay.cellWrapperStyle(a, s, e, n, r, c),
495
+ ...o.CalendarDay.cellWrapperStyle && o.CalendarDay.cellWrapperStyle(
496
+ a,
497
+ s,
498
+ e,
499
+ n,
500
+ r,
501
+ c
502
+ ),
395
503
  width: "100%",
396
504
  height: "100%",
397
505
  position: "relative"
398
506
  });
399
- return /* @__PURE__ */ i(h, {
400
- children: /* @__PURE__ */ i(u, {
401
- children: /* @__PURE__ */ i(D, {
402
- children: e.month === r.monthInYear && /* @__PURE__ */ E(mt, {
403
- children: [l && /* @__PURE__ */ i(l, {
404
- week: n,
405
- month: r,
406
- day: e,
407
- dayState: s,
408
- theme: o,
409
- userData: c
410
- }), d && ln(a, s) ? /* @__PURE__ */ i(Wt, {
411
- onClick: (m) => d(e, c, m),
412
- style: {
413
- width: "100%",
414
- height: "100%"
415
- },
416
- borderRadius: "var(--swui-calendar-day-border-radius)",
417
- children: f
418
- }) : /* @__PURE__ */ i(mt, {
419
- children: f
420
- })]
421
- })
422
- })
423
- })
424
- });
425
- }, ln = (t, e) => !!V(e, t, ["enabled", "disabled"], [!0, !1], !0);
426
- function an({
507
+ return /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(D, { children: e.month === r.monthInYear && /* @__PURE__ */ E(ht, { children: [
508
+ l && /* @__PURE__ */ i(
509
+ l,
510
+ {
511
+ week: n,
512
+ month: r,
513
+ day: e,
514
+ dayState: s,
515
+ theme: o,
516
+ userData: c
517
+ }
518
+ ),
519
+ d && on(a, s) ? /* @__PURE__ */ i(
520
+ Wt,
521
+ {
522
+ onClick: (w) => d(e, c, w),
523
+ style: { width: "100%", height: "100%" },
524
+ borderRadius: "var(--swui-calendar-day-border-radius)",
525
+ children: f
526
+ }
527
+ ) : /* @__PURE__ */ i(ht, { children: f })
528
+ ] }) }) }) });
529
+ }, on = (t, e) => !!V(
530
+ e,
531
+ t,
532
+ ["enabled", "disabled"],
533
+ [!0, !1],
534
+ !0
535
+ );
536
+ function dn({
427
537
  month: t,
428
- dayComponent: e = ie,
538
+ dayComponent: e = le,
429
539
  statePerWeek: n,
430
540
  userDataPerWeek: r,
431
541
  minDate: s,
@@ -438,85 +548,79 @@ function an({
438
548
  renderWeekNumber: h,
439
549
  renderWeekDay: u,
440
550
  headerLeftContent: D,
441
- headerRightContent: m,
551
+ headerRightContent: w,
442
552
  theme: k = rt,
443
553
  extraDayContent: p,
444
554
  defaultHighlights: b
445
555
  }) {
446
- const w = k.WeekNumber.show;
447
- return /* @__PURE__ */ i(mt, {
448
- children: /* @__PURE__ */ E(I, {
449
- alignItems: "stretch",
450
- children: [/* @__PURE__ */ E(R, {
556
+ const m = k.WeekNumber.show;
557
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ E(I, { alignItems: "stretch", children: [
558
+ /* @__PURE__ */ E(
559
+ R,
560
+ {
451
561
  justifyContent: "space-between",
452
562
  alignItems: "center",
453
563
  height: "32px",
454
- children: [/* @__PURE__ */ i(I, {
455
- alignItems: "center",
456
- children: D
457
- }), /* @__PURE__ */ E(R, {
458
- alignItems: "center",
459
- children: [/* @__PURE__ */ i(R, {
460
- width: "104px",
461
- justifyContent: "center",
462
- children: a ? /* @__PURE__ */ i(A, {
463
- onClick: () => a(t),
464
- label: t.name
465
- }) : /* @__PURE__ */ i(it, {
466
- children: t.name
467
- })
468
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
469
- width: "64px",
470
- justifyContent: "center",
471
- children: f ? /* @__PURE__ */ i(A, {
472
- onClick: () => f(t.year),
473
- label: String(t.year)
474
- }) : /* @__PURE__ */ i(it, {
475
- children: t.year
476
- })
477
- })]
478
- }), /* @__PURE__ */ i(I, {
479
- alignItems: "center",
480
- children: m
481
- })]
482
- }), /* @__PURE__ */ i("table", {
483
- children: /* @__PURE__ */ E("tbody", {
484
- children: [/* @__PURE__ */ E("tr", {
485
- children: [w && /* @__PURE__ */ i("td", {
486
- children: /* @__PURE__ */ i(I, {
487
- width: k.width,
488
- height: k.height
489
- })
490
- }), t.weeks[0].days.map((y) => /* @__PURE__ */ i("td", {
491
- children: u ? u(y.name, k, l) : /* @__PURE__ */ i(dn, {
492
- day: y,
493
- onClickWeekDay: l,
494
- theme: k
495
- })
496
- }, y.name))]
497
- }), t.weeks.map((y) => /* @__PURE__ */ i(on, {
498
- month: t,
499
- week: y,
500
- dayComponent: e,
501
- statePerWeekDay: n && n[y.weekNumber],
502
- userDataPerWeekDay: r && r[y.weekNumber],
503
- onClickDay: d,
504
- onClickWeek: o,
505
- theme: k,
506
- renderWeekNumber: h,
507
- extraDayContent: p,
508
- defaultHighlights: b,
509
- minDate: s,
510
- maxDate: c
511
- }, y.weekNumber))]
512
- })
513
- })]
514
- })
515
- });
564
+ children: [
565
+ /* @__PURE__ */ i(I, { alignItems: "center", children: D }),
566
+ /* @__PURE__ */ E(R, { alignItems: "center", children: [
567
+ /* @__PURE__ */ i(R, { width: "104px", justifyContent: "center", children: a ? /* @__PURE__ */ i(
568
+ x,
569
+ {
570
+ onClick: () => a(t),
571
+ label: t.name
572
+ }
573
+ ) : /* @__PURE__ */ i(it, { children: t.name }) }),
574
+ /* @__PURE__ */ i($, {}),
575
+ /* @__PURE__ */ i(R, { width: "64px", justifyContent: "center", children: f ? /* @__PURE__ */ i(
576
+ x,
577
+ {
578
+ onClick: () => f(t.year),
579
+ label: String(t.year)
580
+ }
581
+ ) : /* @__PURE__ */ i(it, { children: t.year }) })
582
+ ] }),
583
+ /* @__PURE__ */ i(I, { alignItems: "center", children: w })
584
+ ]
585
+ }
586
+ ),
587
+ /* @__PURE__ */ i("table", { children: /* @__PURE__ */ E("tbody", { children: [
588
+ /* @__PURE__ */ E("tr", { children: [
589
+ m && /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i(I, { width: k.width, height: k.height }) }),
590
+ t.weeks[0].days.map((y) => /* @__PURE__ */ i("td", { children: u ? u(y.name, k, l) : /* @__PURE__ */ i(
591
+ cn,
592
+ {
593
+ day: y,
594
+ onClickWeekDay: l,
595
+ theme: k
596
+ }
597
+ ) }, y.name))
598
+ ] }),
599
+ t.weeks.map((y) => /* @__PURE__ */ i(
600
+ sn,
601
+ {
602
+ month: t,
603
+ week: y,
604
+ dayComponent: e,
605
+ statePerWeekDay: n && n[y.weekNumber],
606
+ userDataPerWeekDay: r && r[y.weekNumber],
607
+ onClickDay: d,
608
+ onClickWeek: o,
609
+ theme: k,
610
+ renderWeekNumber: h,
611
+ extraDayContent: p,
612
+ defaultHighlights: b,
613
+ minDate: s,
614
+ maxDate: c
615
+ },
616
+ y.weekNumber
617
+ ))
618
+ ] }) })
619
+ ] }) });
516
620
  }
517
- function fn({
621
+ function ln({
518
622
  monthRows: t,
519
- dayComponent: e = ie,
623
+ dayComponent: e = le,
520
624
  userDataPerMonth: n,
521
625
  statePerMonth: r,
522
626
  minDate: s,
@@ -529,57 +633,72 @@ function fn({
529
633
  renderWeekDay: h,
530
634
  renderWeekNumber: u,
531
635
  headerLeftContent: D,
532
- headerRightContent: m,
636
+ headerRightContent: w,
533
637
  extraDayContent: k,
534
638
  defaultHighlights: p,
535
639
  theme: b = rt
536
640
  }) {
537
- const w = C(() => s ? ot(s, "yyyy-MM-dd", new Date()) : void 0, [s]), y = C(() => c ? ot(c, "yyyy-MM-dd", new Date()) : void 0, [c]);
538
- return /* @__PURE__ */ i("div", {
539
- className: Ve.calendar,
540
- children: t.map((M, T) => /* @__PURE__ */ i(ge, {
541
- children: /* @__PURE__ */ i(R, {
542
- children: M.map((x, N) => /* @__PURE__ */ E(ne.Fragment, {
543
- children: [N > 0 && /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(an, {
544
- month: x,
545
- dayComponent: e,
546
- userDataPerWeek: n && n[x.monthString],
547
- statePerWeek: r && r[x.monthString],
548
- onClickDay: d,
549
- onClickWeekDay: o,
550
- onClickWeek: l,
551
- onClickMonth: a,
552
- onClickYear: f,
553
- theme: b,
554
- renderWeekNumber: u,
555
- renderWeekDay: h,
556
- headerLeftContent: D,
557
- headerRightContent: m,
558
- extraDayContent: k,
559
- defaultHighlights: p,
560
- minDate: w,
561
- maxDate: y
562
- })]
563
- }, x.name))
564
- })
565
- }, T))
566
- });
641
+ const m = C(
642
+ () => s ? ot(s, "yyyy-MM-dd", new Date()) : void 0,
643
+ [s]
644
+ ), y = C(
645
+ () => c ? ot(c, "yyyy-MM-dd", new Date()) : void 0,
646
+ [c]
647
+ );
648
+ return /* @__PURE__ */ i("div", { className: Fe.calendar, children: t.map((M, A) => /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(R, { children: M.map((T, N) => /* @__PURE__ */ E(ce.Fragment, { children: [
649
+ N > 0 && /* @__PURE__ */ i($, {}),
650
+ /* @__PURE__ */ i(
651
+ dn,
652
+ {
653
+ month: T,
654
+ dayComponent: e,
655
+ userDataPerWeek: n && n[T.monthString],
656
+ statePerWeek: r && r[T.monthString],
657
+ onClickDay: d,
658
+ onClickWeekDay: o,
659
+ onClickWeek: l,
660
+ onClickMonth: a,
661
+ onClickYear: f,
662
+ theme: b,
663
+ renderWeekNumber: u,
664
+ renderWeekDay: h,
665
+ headerLeftContent: D,
666
+ headerRightContent: w,
667
+ extraDayContent: k,
668
+ defaultHighlights: p,
669
+ minDate: m,
670
+ maxDate: y
671
+ }
672
+ )
673
+ ] }, T.name)) }) }, A)) });
567
674
  }
568
675
  function Lt(t) {
569
676
  var d;
570
- const e = un(t.year, t.month, t.date), {
571
- year: n,
572
- month: r
573
- } = Fe(e.year, e.month), s = Dn(n, r, (d = t.locale) != null ? d : zt, t.numMonths, t.monthsPerRow), c = Ge(t.highlightToday, t.statePerMonth);
574
- return /* @__PURE__ */ i(fn, {
575
- year: n,
576
- month: r,
577
- monthRows: s,
578
- ...t,
579
- statePerMonth: c
580
- });
677
+ const e = an(t.year, t.month, t.date), { year: n, month: r } = Xe(
678
+ e.year,
679
+ e.month
680
+ ), s = fn(
681
+ n,
682
+ r,
683
+ (d = t.locale) != null ? d : jt,
684
+ t.numMonths,
685
+ t.monthsPerRow
686
+ ), c = Je(
687
+ t.highlightToday,
688
+ t.statePerMonth
689
+ );
690
+ return /* @__PURE__ */ i(
691
+ ln,
692
+ {
693
+ year: n,
694
+ month: r,
695
+ monthRows: s,
696
+ ...t,
697
+ statePerMonth: c
698
+ }
699
+ );
581
700
  }
582
- const un = (t, e, n) => {
701
+ const an = (t, e, n) => {
583
702
  if (e && t)
584
703
  return {
585
704
  month: e,
@@ -588,14 +707,14 @@ const un = (t, e, n) => {
588
707
  if (n)
589
708
  return {
590
709
  month: tt(n),
591
- year: yt(n)
710
+ year: wt(n)
592
711
  };
593
712
  const r = new Date();
594
713
  return {
595
714
  month: tt(r),
596
- year: yt(r)
715
+ year: wt(r)
597
716
  };
598
- }, Dn = (t, e, n, r, s) => r == null ? [[ce(t, e, n)]] : s == null ? [Kt(t, e, r, n)] : ee(Kt(t, e, r, n), s), hn = ({
717
+ }, fn = (t, e, n, r, s) => r == null ? [[de(t, e, n)]] : s == null ? [Kt(t, e, r, n)] : se(Kt(t, e, r, n), s), un = ({
599
718
  value: t,
600
719
  onValueChange: e,
601
720
  month: n,
@@ -603,37 +722,40 @@ const un = (t, e, n) => {
603
722
  }) => {
604
723
  const s = C(() => {
605
724
  const c = new Date(2e3, n, 1);
606
- return te(W(c, "MMM", {
607
- locale: r
608
- }));
725
+ return re(W(c, "MMM", { locale: r }));
609
726
  }, [r, n]);
610
- return /* @__PURE__ */ i(R, {
611
- width: "64px",
612
- justifyContent: "center",
613
- spacing: 0.5,
614
- indent: 0.5,
615
- children: t === n ? /* @__PURE__ */ i(dt, {
727
+ return /* @__PURE__ */ i(R, { justifyContent: "center", children: t === n ? /* @__PURE__ */ i(
728
+ dt,
729
+ {
616
730
  label: s,
617
731
  onClick: () => e && e(n)
618
- }) : /* @__PURE__ */ i(A, {
732
+ }
733
+ ) : /* @__PURE__ */ i(
734
+ x,
735
+ {
619
736
  label: s,
620
737
  onClick: () => e && e(n)
621
- })
622
- });
623
- }, gn = [[U.JANUARY, U.FEBRUARY, U.MARCH], [U.APRIL, U.MAY, U.JUNE], [U.JULY, U.AUGUST, U.SEPTEMBER], [U.OCTOBER, U.NOVEMBER, U.DECEMBER]], yn = ({
738
+ }
739
+ ) });
740
+ }, Dn = [
741
+ [U.JANUARY, U.FEBRUARY, U.MARCH],
742
+ [U.APRIL, U.MAY, U.JUNE],
743
+ [U.JULY, U.AUGUST, U.SEPTEMBER],
744
+ [U.OCTOBER, U.NOVEMBER, U.DECEMBER]
745
+ ], hn = ({
624
746
  value: t,
625
747
  onValueChange: e,
626
- locale: n = zt
627
- }) => /* @__PURE__ */ i(B, {
628
- children: gn.map((r) => /* @__PURE__ */ i(R, {
629
- children: r.map((s) => /* @__PURE__ */ i(hn, {
630
- month: s,
631
- onValueChange: e,
632
- value: t,
633
- locale: n
634
- }, s))
635
- }, r[0]))
636
- }), mn = (t) => [
748
+ locale: n = jt
749
+ }) => /* @__PURE__ */ i(B, { gap: 1, children: Dn.map((r) => /* @__PURE__ */ i(R, { gap: 1, children: r.map((s) => /* @__PURE__ */ i(
750
+ un,
751
+ {
752
+ month: s,
753
+ onValueChange: e,
754
+ value: t,
755
+ locale: n
756
+ },
757
+ s
758
+ )) }, r[0])) }), gn = (t) => [
637
759
  {
638
760
  label: "Past",
639
761
  presets: [
@@ -652,93 +774,97 @@ const un = (t, e, n) => {
652
774
  { label: "Next 45 days", startDate: t, endDate: q(t, 44) }
653
775
  ]
654
776
  }
655
- ], wn = ({
777
+ ], yn = ({
656
778
  onClickPreset: t
657
779
  }) => {
658
780
  var c;
659
- const [e, n] = S(0), r = C(() => mn(new Date()), []), s = (c = r[e]) != null ? c : r[0];
660
- return /* @__PURE__ */ E(B, {
661
- children: [/* @__PURE__ */ E(R, {
662
- justifyContent: "space-between",
663
- alignItems: "center",
664
- width: "200px",
665
- children: [/* @__PURE__ */ i(A, {
666
- size: "small",
667
- leftIcon: Ot,
668
- disabled: e === 0,
669
- onClick: () => n(e - 1)
670
- }), /* @__PURE__ */ i(it, {
671
- children: s.label
672
- }), /* @__PURE__ */ i(A, {
673
- size: "small",
674
- leftIcon: $t,
675
- disabled: e === r.length - 1,
676
- onClick: () => n(e + 1)
677
- })]
678
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(B, {
679
- alignItems: "center",
680
- children: s.presets.map((d) => /* @__PURE__ */ E(ne.Fragment, {
681
- children: [/* @__PURE__ */ i(dt, {
781
+ const [e, n] = S(0), r = C(() => gn(new Date()), []), s = (c = r[e]) != null ? c : r[0];
782
+ return /* @__PURE__ */ E(B, { children: [
783
+ /* @__PURE__ */ E(
784
+ R,
785
+ {
786
+ justifyContent: "space-between",
787
+ alignItems: "center",
788
+ width: "200px",
789
+ children: [
790
+ /* @__PURE__ */ i(
791
+ x,
792
+ {
793
+ size: "small",
794
+ leftIcon: Ot,
795
+ disabled: e === 0,
796
+ onClick: () => n(e - 1)
797
+ }
798
+ ),
799
+ /* @__PURE__ */ i(it, { children: s.label }),
800
+ /* @__PURE__ */ i(
801
+ x,
802
+ {
803
+ size: "small",
804
+ leftIcon: $t,
805
+ disabled: e === r.length - 1,
806
+ onClick: () => n(e + 1)
807
+ }
808
+ )
809
+ ]
810
+ }
811
+ ),
812
+ /* @__PURE__ */ i($, {}),
813
+ /* @__PURE__ */ i(B, { alignItems: "center", children: s.presets.map((d) => /* @__PURE__ */ E(ce.Fragment, { children: [
814
+ /* @__PURE__ */ i(
815
+ dt,
816
+ {
682
817
  label: d.label,
683
818
  onClick: () => t(d)
684
- }), /* @__PURE__ */ i($, {})]
685
- }, d.label))
686
- })]
687
- });
688
- }, pn = ({
819
+ }
820
+ ),
821
+ /* @__PURE__ */ i($, {})
822
+ ] }, d.label)) })
823
+ ] });
824
+ }, wn = ({
689
825
  value: t,
690
826
  onValueChange: e,
691
827
  year: n
692
828
  }) => {
693
829
  const r = String(n);
694
- return /* @__PURE__ */ i(R, {
695
- width: "64px",
696
- justifyContent: "center",
697
- spacing: 0.5,
698
- indent: 0.5,
699
- children: t === n ? /* @__PURE__ */ i(dt, {
700
- label: r,
701
- onClick: () => e == null ? void 0 : e(n)
702
- }) : /* @__PURE__ */ i(A, {
703
- label: r,
704
- onClick: () => e == null ? void 0 : e(n)
705
- })
706
- });
707
- }, bn = ({
830
+ return /* @__PURE__ */ i(R, { justifyContent: "center", children: t === n ? /* @__PURE__ */ i(dt, { label: r, onClick: () => e == null ? void 0 : e(n) }) : /* @__PURE__ */ i(x, { label: r, onClick: () => e == null ? void 0 : e(n) }) });
831
+ }, mn = ({
708
832
  value: t,
709
833
  onValueChange: e,
710
834
  initialLastYear: n
711
835
  }) => {
712
836
  const [r, s] = S(() => t ? t + 4 : n != null ? n : new Date().getFullYear() + 4), c = C(() => {
713
837
  const d = r - 11;
714
- return ee(jt(d, r + 1), 3);
838
+ return se(zt(d, r + 1), 3);
715
839
  }, [r]);
716
840
  return Q(() => {
717
- s((d) => kn(t, d));
718
- }, [t]), /* @__PURE__ */ E(R, {
719
- children: [/* @__PURE__ */ i(B, {
720
- justifyContent: "center",
721
- children: /* @__PURE__ */ i(A, {
722
- leftIcon: We,
841
+ s((d) => pn(t, d));
842
+ }, [t]), /* @__PURE__ */ E(R, { children: [
843
+ /* @__PURE__ */ i(B, { justifyContent: "center", children: /* @__PURE__ */ i(
844
+ x,
845
+ {
846
+ leftIcon: be,
723
847
  onClick: () => s(r - 3)
724
- })
725
- }), /* @__PURE__ */ i(B, {
726
- children: c.map((d) => /* @__PURE__ */ i(R, {
727
- children: d.map((o) => /* @__PURE__ */ i(pn, {
728
- year: o,
729
- onValueChange: e,
730
- value: t
731
- }, o))
732
- }, d[0]))
733
- }), /* @__PURE__ */ i(B, {
734
- justifyContent: "center",
735
- children: /* @__PURE__ */ i(A, {
736
- leftIcon: Oe,
848
+ }
849
+ ) }),
850
+ /* @__PURE__ */ i(B, { gap: 1, children: c.map((d) => /* @__PURE__ */ i(R, { gap: 1, children: d.map((o) => /* @__PURE__ */ i(
851
+ wn,
852
+ {
853
+ year: o,
854
+ onValueChange: e,
855
+ value: t
856
+ },
857
+ o
858
+ )) }, d[0])) }),
859
+ /* @__PURE__ */ i(B, { justifyContent: "center", children: /* @__PURE__ */ i(
860
+ x,
861
+ {
862
+ leftIcon: Qt,
737
863
  onClick: () => s(r + 3)
738
- })
739
- })]
740
- });
741
- }, kn = (t, e) => {
864
+ }
865
+ ) })
866
+ ] });
867
+ }, pn = (t, e) => {
742
868
  if (t == null)
743
869
  return e;
744
870
  if (t > e) {
@@ -751,7 +877,7 @@ const un = (t, e, n) => {
751
877
  return e - c;
752
878
  }
753
879
  return e;
754
- }, Sn = function({
880
+ }, bn = function({
755
881
  locale: e,
756
882
  dateInFocus: n,
757
883
  setDateInFocus: r,
@@ -759,66 +885,78 @@ const un = (t, e, n) => {
759
885
  setCurrentPanel: c,
760
886
  ...d
761
887
  }) {
762
- const o = g((h) => {
763
- const u = n ? new Date(n) : new Date();
764
- u.setMonth(h), r && r(u), c("calendar");
765
- }, [n, r, c]), l = g((h) => {
766
- const u = n ? new Date(n) : new Date();
767
- u.setFullYear(h), r && r(u), c("calendar");
768
- }, [n, r, c]), a = g(() => {
888
+ const o = g(
889
+ (h) => {
890
+ const u = n ? new Date(n) : new Date();
891
+ u.setMonth(h), r && r(u), c("calendar");
892
+ },
893
+ [n, r, c]
894
+ ), l = g(
895
+ (h) => {
896
+ const u = n ? new Date(n) : new Date();
897
+ u.setFullYear(h), r && r(u), c("calendar");
898
+ },
899
+ [n, r, c]
900
+ ), a = g(() => {
769
901
  c("year");
770
902
  }, [c]), f = g(() => {
771
903
  c("month");
772
904
  }, [c]);
773
905
  switch (s) {
774
906
  case "calendar":
775
- return /* @__PURE__ */ i(mt, {
776
- children: /* @__PURE__ */ i(Lt, {
907
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ i(
908
+ Lt,
909
+ {
777
910
  ...d,
778
911
  date: n,
779
912
  onClickYear: a,
780
913
  onClickMonth: f,
781
914
  locale: e
782
- })
783
- });
915
+ }
916
+ ) });
784
917
  case "month":
785
- return /* @__PURE__ */ i(yn, {
786
- value: n.getMonth(),
787
- onValueChange: o,
788
- locale: e
789
- });
918
+ return /* @__PURE__ */ i(
919
+ hn,
920
+ {
921
+ value: n.getMonth(),
922
+ onValueChange: o,
923
+ locale: e
924
+ }
925
+ );
790
926
  case "year":
791
- return /* @__PURE__ */ i(bn, {
792
- value: n.getFullYear(),
793
- onValueChange: l
794
- });
795
- case "presets":
796
- return /* @__PURE__ */ i(wn, {
797
- onClickPreset: () => {
927
+ return /* @__PURE__ */ i(
928
+ mn,
929
+ {
930
+ value: n.getFullYear(),
931
+ onValueChange: l
798
932
  }
799
- });
933
+ );
934
+ case "presets":
935
+ return /* @__PURE__ */ i(yn, { onClickPreset: () => {
936
+ } });
800
937
  default:
801
- return /* @__PURE__ */ i(I, {
802
- children: /* @__PURE__ */ i(dt, {
938
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ i(
939
+ dt,
940
+ {
803
941
  label: "Show calendar",
804
942
  onClick: () => c("calendar")
805
- })
806
- });
943
+ }
944
+ ) });
807
945
  }
808
- }, Mn = (t, e, n, r) => {
946
+ }, kn = (t, e, n, r) => {
809
947
  const s = g(() => {
810
948
  var a;
811
- const l = Te(t, (a = n != null ? n : r) != null ? a : 1);
949
+ const l = Ce(t, (a = n != null ? n : r) != null ? a : 1);
812
950
  e == null || e(l);
813
951
  }, [e, t, n, r]), c = g(() => {
814
- const l = xe(t, 1);
952
+ const l = Ne(t, 1);
815
953
  e == null || e(l);
816
954
  }, [e, t]), d = g(() => {
817
955
  var a;
818
- const l = Ce(t, (a = n != null ? n : r) != null ? a : 1);
956
+ const l = Ie(t, (a = n != null ? n : r) != null ? a : 1);
819
957
  e == null || e(l);
820
958
  }, [e, t, n, r]), o = g(() => {
821
- const l = Ne(t, 1);
959
+ const l = He(t, 1);
822
960
  e == null || e(l);
823
961
  }, [e, t]);
824
962
  return {
@@ -827,33 +965,25 @@ const un = (t, e, n) => {
827
965
  nextYear: c,
828
966
  prevYear: o
829
967
  };
830
- }, En = ({
968
+ }, Sn = ({
831
969
  children: t,
832
970
  prevMonth: e,
833
971
  nextMonth: n,
834
972
  prevYear: r,
835
973
  nextYear: s
836
- }) => /* @__PURE__ */ E("div", {
837
- children: [t, /* @__PURE__ */ i(ht, {
838
- children: /* @__PURE__ */ E(R, {
839
- children: [/* @__PURE__ */ i(A, {
840
- onClick: r,
841
- leftIcon: $e
842
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
843
- onClick: e,
844
- leftIcon: Ot
845
- }), /* @__PURE__ */ i(ht, {
846
- num: 2
847
- }), /* @__PURE__ */ i(A, {
848
- onClick: n,
849
- leftIcon: $t
850
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
851
- onClick: s,
852
- leftIcon: Pe
853
- })]
854
- })
855
- }), /* @__PURE__ */ i($, {})]
856
- }), Rn = () => {
974
+ }) => /* @__PURE__ */ E("div", { children: [
975
+ t,
976
+ /* @__PURE__ */ i(gt, { children: /* @__PURE__ */ E(R, { children: [
977
+ /* @__PURE__ */ i(x, { onClick: r, leftIcon: Xt }),
978
+ /* @__PURE__ */ i($, {}),
979
+ /* @__PURE__ */ i(x, { onClick: e, leftIcon: Ot }),
980
+ /* @__PURE__ */ i(gt, { num: 2 }),
981
+ /* @__PURE__ */ i(x, { onClick: n, leftIcon: $t }),
982
+ /* @__PURE__ */ i($, {}),
983
+ /* @__PURE__ */ i(x, { onClick: s, leftIcon: Zt })
984
+ ] }) }),
985
+ /* @__PURE__ */ i($, {})
986
+ ] }), Mn = () => {
857
987
  };
858
988
  function F({
859
989
  monthSwitcherPlacement: t,
@@ -862,33 +992,36 @@ function F({
862
992
  setDateInFocus: r,
863
993
  currentPanel: s,
864
994
  setCurrentPanel: c,
865
- onSelectPreset: d = Rn,
995
+ onSelectPreset: d = Mn,
866
996
  hideYearPagination: o = !1,
867
997
  ...l
868
998
  }) {
869
- const {
870
- nextMonth: a,
871
- prevMonth: f,
872
- nextYear: h,
873
- prevYear: u
874
- } = Mn(n, r, l.monthsPerRow, l.numMonths);
875
- switch (An(t, l.numMonths)) {
999
+ const { nextMonth: a, prevMonth: f, nextYear: h, prevYear: u } = kn(
1000
+ n,
1001
+ r,
1002
+ l.monthsPerRow,
1003
+ l.numMonths
1004
+ );
1005
+ switch (En(
1006
+ t,
1007
+ l.numMonths
1008
+ )) {
876
1009
  case "below":
877
- return /* @__PURE__ */ i(En, {
878
- theme: e,
879
- nextMonth: a,
880
- prevMonth: f,
881
- nextYear: h,
882
- prevYear: u,
883
- children: /* @__PURE__ */ i(Lt, {
884
- ...l,
1010
+ return /* @__PURE__ */ i(
1011
+ Sn,
1012
+ {
885
1013
  theme: e,
886
- date: n
887
- })
888
- });
1014
+ nextMonth: a,
1015
+ prevMonth: f,
1016
+ nextYear: h,
1017
+ prevYear: u,
1018
+ children: /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n })
1019
+ }
1020
+ );
889
1021
  case "header":
890
- return /* @__PURE__ */ i(B, {
891
- children: /* @__PURE__ */ i(Sn, {
1022
+ return /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(
1023
+ bn,
1024
+ {
892
1025
  ...l,
893
1026
  theme: e,
894
1027
  dateInFocus: n,
@@ -896,44 +1029,38 @@ function F({
896
1029
  currentPanel: s,
897
1030
  setCurrentPanel: c,
898
1031
  onSelectPreset: d,
899
- headerLeftContent: /* @__PURE__ */ E(R, {
900
- alignItems: "center",
901
- children: [!o && /* @__PURE__ */ i(A, {
902
- size: "small",
903
- onClick: u,
904
- leftIcon: me
905
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
906
- size: "small",
907
- onClick: f,
908
- leftIcon: Ot
909
- })]
910
- }),
911
- headerRightContent: /* @__PURE__ */ E(R, {
912
- alignItems: "center",
913
- children: [/* @__PURE__ */ i(A, {
914
- size: "small",
915
- onClick: a,
916
- leftIcon: $t
917
- }), /* @__PURE__ */ i($, {}), !o && /* @__PURE__ */ i(A, {
918
- size: "small",
919
- onClick: h,
920
- leftIcon: we
921
- })]
922
- })
923
- })
924
- });
1032
+ headerLeftContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1033
+ !o && /* @__PURE__ */ i(
1034
+ x,
1035
+ {
1036
+ onClick: u,
1037
+ leftIcon: Xt
1038
+ }
1039
+ ),
1040
+ /* @__PURE__ */ i($, {}),
1041
+ /* @__PURE__ */ i(x, { onClick: f, leftIcon: Ot })
1042
+ ] }),
1043
+ headerRightContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1044
+ /* @__PURE__ */ i(x, { onClick: a, leftIcon: $t }),
1045
+ /* @__PURE__ */ i($, {}),
1046
+ !o && /* @__PURE__ */ i(
1047
+ x,
1048
+ {
1049
+ onClick: h,
1050
+ leftIcon: Zt
1051
+ }
1052
+ )
1053
+ ] })
1054
+ }
1055
+ ) });
925
1056
  default:
926
- return /* @__PURE__ */ i(Lt, {
927
- ...l,
928
- theme: e,
929
- date: n
930
- });
1057
+ return /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n });
931
1058
  }
932
1059
  }
933
- const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
1060
+ const En = (t, e) => t || (e || 1) > 1 ? "below" : "header", Rn = (t) => ({
934
1061
  startDate: t.startDate ? W(t.startDate, "yyyy-MM-dd") : void 0,
935
1062
  endDate: t.endDate ? W(t.endDate, "yyyy-MM-dd") : void 0
936
- }), xn = ({
1063
+ }), An = ({
937
1064
  startDate: t,
938
1065
  endDate: e
939
1066
  }) => {
@@ -942,23 +1069,23 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
942
1069
  startDate: t ? ot(t, "yyyy-MM-dd", n) : void 0,
943
1070
  endDate: e ? ot(e, "yyyy-MM-dd", n) : void 0
944
1071
  };
945
- }, oe = ({
1072
+ }, ae = ({
946
1073
  startDate: t,
947
1074
  endDate: e
948
1075
  }) => Boolean(
949
- t && e && !z(t, e) && et(t, e)
950
- ), de = (t) => oe(t) ? {
1076
+ t && e && !j(t, e) && et(t, e)
1077
+ ), fe = (t) => ae(t) ? {
951
1078
  startDate: t.endDate,
952
1079
  endDate: t.startDate
953
- } : t, Mr = (t) => t.startDate && t.endDate ? Tn(
954
- de(xn(t))
955
- ) : t, le = (t, e, n, r) => g(
1080
+ } : t, yr = (t) => t.startDate && t.endDate ? Rn(
1081
+ fe(An(t))
1082
+ ) : t, ue = (t, e, n, r) => g(
956
1083
  (s) => {
957
1084
  const c = {
958
1085
  startDate: n === "startDate" ? s.date : t == null ? void 0 : t.startDate,
959
1086
  endDate: n === "endDate" ? s.date : t == null ? void 0 : t.endDate
960
1087
  };
961
- oe(c) || r(n === "startDate" ? "endDate" : "startDate"), e == null || e(de(c));
1088
+ ae(c) || r(n === "startDate" ? "endDate" : "startDate"), e == null || e(fe(c));
962
1089
  },
963
1090
  [
964
1091
  n,
@@ -968,14 +1095,17 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
968
1095
  t == null ? void 0 : t.startDate
969
1096
  ]
970
1097
  ), bt = (t) => {
971
- const [e, n] = S("calendar"), r = g((s) => {
972
- n(s), t == null || t(s);
973
- }, [t]);
1098
+ const [e, n] = S("calendar"), r = g(
1099
+ (s) => {
1100
+ n(s), t == null || t(s);
1101
+ },
1102
+ [t]
1103
+ );
974
1104
  return {
975
1105
  currentPanel: e,
976
1106
  setCurrentPanel: r
977
1107
  };
978
- }, Cn = ({
1108
+ }, Tn = ({
979
1109
  focusedInput: t,
980
1110
  value: e,
981
1111
  onValueChange: n,
@@ -986,13 +1116,13 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
986
1116
  }) => {
987
1117
  const { currentPanel: o, setCurrentPanel: l } = bt(c), [a, f] = S(
988
1118
  () => d != null ? d : new Date()
989
- ), h = le(
1119
+ ), h = ue(
990
1120
  e,
991
1121
  n,
992
1122
  t,
993
1123
  r
994
1124
  ), u = C(
995
- () => wt(
1125
+ () => mt(
996
1126
  s,
997
1127
  e == null ? void 0 : e.startDate,
998
1128
  e == null ? void 0 : e.endDate
@@ -1008,14 +1138,11 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
1008
1138
  dateInFocus: a
1009
1139
  };
1010
1140
  };
1011
- function Er(t) {
1012
- const e = Cn(t);
1013
- return /* @__PURE__ */ i(F, {
1014
- ...t,
1015
- ...e
1016
- });
1141
+ function wr(t) {
1142
+ const e = Tn(t);
1143
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1017
1144
  }
1018
- const Rr = () => {
1145
+ const mr = () => {
1019
1146
  const [t, e] = S(), [n, r] = S(), [s, c] = S("startDate");
1020
1147
  return {
1021
1148
  startDate: t,
@@ -1025,7 +1152,7 @@ const Rr = () => {
1025
1152
  focusedInput: s,
1026
1153
  setFocusedInput: c
1027
1154
  };
1028
- }, Nn = ({
1155
+ }, xn = ({
1029
1156
  onChange: t,
1030
1157
  value: e,
1031
1158
  statePerMonth: n,
@@ -1053,14 +1180,11 @@ const Rr = () => {
1053
1180
  setDateInFocus: o
1054
1181
  };
1055
1182
  };
1056
- function ae(t) {
1057
- const e = Nn(t);
1058
- return /* @__PURE__ */ i(F, {
1059
- ...t,
1060
- ...e
1061
- });
1183
+ function De(t) {
1184
+ const e = xn(t);
1185
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1062
1186
  }
1063
- const In = ({
1187
+ const Cn = ({
1064
1188
  onChange: t,
1065
1189
  value: e,
1066
1190
  statePerMonth: n,
@@ -1070,8 +1194,8 @@ const In = ({
1070
1194
  (f) => {
1071
1195
  if (!t)
1072
1196
  return;
1073
- const h = e && e.find((u) => z(u, f.date));
1074
- t(e && h ? e.filter((u) => !z(u, f.date)) : [...e || [], f.date]);
1197
+ const h = e && e.find((u) => j(u, f.date));
1198
+ t(e && h ? e.filter((u) => !j(u, f.date)) : [...e || [], f.date]);
1075
1199
  },
1076
1200
  [t, e]
1077
1201
  ), a = C(() => e ? e.reduce(
@@ -1087,19 +1211,16 @@ const In = ({
1087
1211
  setDateInFocus: o
1088
1212
  };
1089
1213
  };
1090
- function Ar(t) {
1091
- const e = In(t);
1092
- return /* @__PURE__ */ i(F, {
1093
- ...t,
1094
- ...e
1095
- });
1214
+ function pr(t) {
1215
+ const e = Cn(t);
1216
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1096
1217
  }
1097
- const Hn = ({
1218
+ const Nn = ({
1098
1219
  onChange: t,
1099
1220
  value: e,
1100
1221
  statePerMonth: n,
1101
1222
  onChangePanel: r,
1102
- locale: s = zt
1223
+ locale: s = jt
1103
1224
  }) => {
1104
1225
  const [c, d] = S(() => {
1105
1226
  const D = It(e, s);
@@ -1116,7 +1237,7 @@ const Hn = ({
1116
1237
  [t]
1117
1238
  ), h = C(() => {
1118
1239
  const D = It(e, s);
1119
- return D ? Ke(n, D) : n;
1240
+ return D ? _e(n, D) : n;
1120
1241
  }, [e, s, n]), u = C(() => {
1121
1242
  const D = It(e, s);
1122
1243
  return D ? D.days[0].date : new Date();
@@ -1139,17 +1260,14 @@ const Hn = ({
1139
1260
  return;
1140
1261
  const n = t.split("-"), r = parseInt(n[1], 10), s = parseInt(n[0], 10), c = new Date();
1141
1262
  c.setFullYear(s);
1142
- const d = vt(Ie(c, r), { locale: e });
1263
+ const d = ee(Ye(c, r), { locale: e });
1143
1264
  return _t(d, e);
1144
1265
  };
1145
- function Tr(t) {
1146
- const e = Hn(t);
1147
- return /* @__PURE__ */ i(F, {
1148
- ...t,
1149
- ...e
1150
- });
1266
+ function br(t) {
1267
+ const e = Nn(t);
1268
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1151
1269
  }
1152
- const Yn = (t, e) => t.filter((n) => !z(n, e)), Ln = (t, e) => !!t.find((n) => z(n, e)), Un = ({
1270
+ const In = (t, e) => t.filter((n) => !j(n, e)), Hn = (t, e) => !!t.find((n) => j(n, e)), Yn = ({
1153
1271
  value: t,
1154
1272
  onValueChange: e,
1155
1273
  statePerMonth: n,
@@ -1163,44 +1281,41 @@ const Yn = (t, e) => t.filter((n) => !z(n, e)), Ln = (t, e) => !!t.find((n) => z
1163
1281
  ), u = g(
1164
1282
  (p) => {
1165
1283
  c(p);
1166
- const { startDate: b, endDate: w } = p;
1284
+ const { startDate: b, endDate: m } = p;
1167
1285
  if (e)
1168
- if (b && w) {
1169
- const y = Pt({ start: b, end: w });
1286
+ if (b && m) {
1287
+ const y = Pt({ start: b, end: m });
1170
1288
  e(y);
1171
1289
  } else
1172
- b ? e([b]) : w && e([w]);
1290
+ b ? e([b]) : m && e([m]);
1173
1291
  },
1174
1292
  [e]
1175
- ), D = le(
1293
+ ), D = ue(
1176
1294
  s,
1177
1295
  u,
1178
1296
  d,
1179
1297
  o
1180
- ), m = g(
1181
- (p, b, w) => {
1182
- e && (w.ctrlKey || w.metaKey ? t ? Ln(t, p.date) ? e(Yn(t, p.date)) : e([...t, p.date]) : e([p.date]) : D(p, b, w));
1298
+ ), w = g(
1299
+ (p, b, m) => {
1300
+ e && (m.ctrlKey || m.metaKey ? t ? Hn(t, p.date) ? e(In(t, p.date)) : e([...t, p.date]) : e([p.date]) : D(p, b, m));
1183
1301
  },
1184
1302
  [e, D, t]
1185
- ), k = C(() => Wn(n, t), [n, t]);
1303
+ ), k = C(() => Ln(n, t), [n, t]);
1186
1304
  return {
1187
- onClickDay: m,
1305
+ onClickDay: w,
1188
1306
  statePerMonth: k,
1189
1307
  currentPanel: l,
1190
1308
  setCurrentPanel: a,
1191
1309
  dateInFocus: f,
1192
1310
  setDateInFocus: h
1193
1311
  };
1194
- }, Wn = (t, e) => e ? e.reduce((n, r) => X(n, r, ["selected"]), t) : t;
1195
- function xr(t) {
1196
- const e = Un(t);
1197
- return /* @__PURE__ */ i(F, {
1198
- ...t,
1199
- ...e
1200
- });
1312
+ }, Ln = (t, e) => e ? e.reduce((n, r) => X(n, r, ["selected"]), t) : t;
1313
+ function kr(t) {
1314
+ const e = Yn(t);
1315
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1201
1316
  }
1202
- const kt = "bottom", fe = () => {
1203
- const [t, e] = ze();
1317
+ const kt = "bottom", he = () => {
1318
+ const [t, e] = Be();
1204
1319
  return {
1205
1320
  onChangePanel: g(() => {
1206
1321
  var r, s;
@@ -1208,19 +1323,22 @@ const kt = "bottom", fe = () => {
1208
1323
  }, [e]),
1209
1324
  tippyRef: t
1210
1325
  };
1211
- }, On = (t, e, n) => {
1326
+ }, Un = (t, e, n) => {
1212
1327
  const [r, s] = S(n || !1), c = g(() => (s(!0), !0), [s]), d = g(() => {
1213
1328
  s(!1), e && e();
1214
- }, [s, e]), o = g((l) => {
1215
- t && t(l), setTimeout(d, 150);
1216
- }, [t, d]);
1329
+ }, [s, e]), o = g(
1330
+ (l) => {
1331
+ t && t(l), setTimeout(d, 150);
1332
+ },
1333
+ [t, d]
1334
+ );
1217
1335
  return {
1218
1336
  showCalendar: c,
1219
1337
  hideCalendar: d,
1220
1338
  showingCalendar: r,
1221
1339
  onSelectDate: o
1222
1340
  };
1223
- }, St = "2999-12-31", Cr = ({
1341
+ }, St = "2999-12-31", Sr = ({
1224
1342
  displayFormat: t = Z.fullDate,
1225
1343
  placeholder: e = "Enter date",
1226
1344
  value: n,
@@ -1235,20 +1353,12 @@ const kt = "bottom", fe = () => {
1235
1353
  width: h,
1236
1354
  minDate: u,
1237
1355
  maxDate: D = St,
1238
- disabled: m
1356
+ disabled: w
1239
1357
  }) => {
1240
- const {
1241
- hideCalendar: k,
1242
- showingCalendar: p,
1243
- onSelectDate: b,
1244
- showCalendar: w
1245
- } = On(l, o, d), {
1246
- tippyRef: y,
1247
- onChangePanel: M
1248
- } = fe();
1249
- return /* @__PURE__ */ i(I, {
1250
- width: h,
1251
- children: /* @__PURE__ */ i(pt, {
1358
+ const { hideCalendar: k, showingCalendar: p, onSelectDate: b, showCalendar: m } = Un(l, o, d), { tippyRef: y, onChangePanel: M } = he();
1359
+ return /* @__PURE__ */ i(I, { width: h, children: /* @__PURE__ */ i(
1360
+ pt,
1361
+ {
1252
1362
  arrow: !1,
1253
1363
  lazy: !0,
1254
1364
  visible: p,
@@ -1257,52 +1367,55 @@ const kt = "bottom", fe = () => {
1257
1367
  zIndex: r,
1258
1368
  appendTo: a != null ? a : "parent",
1259
1369
  tippyRef: y,
1260
- disabled: m,
1261
- content: /* @__PURE__ */ i(ae, {
1262
- ...c,
1263
- onChange: b,
1264
- value: n,
1265
- theme: s,
1266
- onChangePanel: M,
1267
- minDate: u,
1268
- maxDate: D
1269
- }),
1270
- children: /* @__PURE__ */ i(nt, {
1271
- type: "date",
1272
- contentRight: /* @__PURE__ */ i(R, {
1273
- alignItems: "center",
1274
- children: /* @__PURE__ */ i(A, {
1275
- size: "small",
1276
- disabled: m,
1277
- leftIcon: gt,
1278
- onClick: w
1279
- })
1280
- }),
1281
- onFocus: w,
1282
- onClickRight: w,
1283
- value: n ? W(n, t) : "",
1284
- placeholder: e,
1285
- size: 9,
1286
- disabled: m,
1287
- autoFocus: d,
1288
- variant: f,
1289
- min: u,
1290
- max: D
1291
- })
1292
- })
1293
- });
1294
- }, $n = (t, e) => {
1370
+ disabled: w,
1371
+ content: /* @__PURE__ */ i(
1372
+ De,
1373
+ {
1374
+ ...c,
1375
+ onChange: b,
1376
+ value: n,
1377
+ theme: s,
1378
+ onChangePanel: M,
1379
+ minDate: u,
1380
+ maxDate: D
1381
+ }
1382
+ ),
1383
+ children: /* @__PURE__ */ i(
1384
+ nt,
1385
+ {
1386
+ type: "date",
1387
+ onFocus: m,
1388
+ buttonRight: /* @__PURE__ */ i($e, { onClick: m, icon: yt }),
1389
+ value: n ? W(n, t) : "",
1390
+ placeholder: e,
1391
+ size: 9,
1392
+ disabled: w,
1393
+ autoFocus: d,
1394
+ variant: f,
1395
+ min: u,
1396
+ max: D
1397
+ }
1398
+ )
1399
+ }
1400
+ ) });
1401
+ }, Wn = (t, e) => {
1295
1402
  const n = J(null), r = J(null), [s, c] = S(!1), [d, o] = S(void 0), l = g(() => (o("startDate"), c(!0), !0), [o, c]), a = g(() => (o("endDate"), c(!0), !0), [o, c]), f = g(() => {
1296
1403
  c(!1);
1297
- }, [c]), h = g((D) => {
1298
- d === "startDate" ? (e == null || e({
1299
- startDate: D.date,
1300
- endDate: t == null ? void 0 : t.endDate
1301
- }), t != null && t.endDate ? setTimeout(f, 150) : (o("endDate"), r.current && r.current.focus())) : d === "endDate" && (e == null || e({
1302
- startDate: t == null ? void 0 : t.startDate,
1303
- endDate: D.date
1304
- }), t != null && t.startDate ? setTimeout(f, 150) : (o("startDate"), n.current && n.current.focus()));
1305
- }, [d, e, o, f, t]), u = C(() => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && et(t.startDate, t.endDate), [t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]);
1404
+ }, [c]), h = g(
1405
+ (D) => {
1406
+ d === "startDate" ? (e == null || e({
1407
+ startDate: D.date,
1408
+ endDate: t == null ? void 0 : t.endDate
1409
+ }), t != null && t.endDate ? setTimeout(f, 150) : (o("endDate"), r.current && r.current.focus())) : d === "endDate" && (e == null || e({
1410
+ startDate: t == null ? void 0 : t.startDate,
1411
+ endDate: D.date
1412
+ }), t != null && t.startDate ? setTimeout(f, 150) : (o("startDate"), n.current && n.current.focus()));
1413
+ },
1414
+ [d, e, o, f, t]
1415
+ ), u = C(
1416
+ () => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && et(t.startDate, t.endDate),
1417
+ [t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]
1418
+ );
1306
1419
  return {
1307
1420
  showingCalendar: s,
1308
1421
  hideCalendar: f,
@@ -1316,7 +1429,7 @@ const kt = "bottom", fe = () => {
1316
1429
  startDateIsAfterEnd: u
1317
1430
  };
1318
1431
  };
1319
- function Nr({
1432
+ function Mr({
1320
1433
  displayFormat: t = Z.fullDate,
1321
1434
  placeholderStartDate: e = "Start date",
1322
1435
  placeholderEndDate: n = "End date",
@@ -1331,72 +1444,95 @@ function Nr({
1331
1444
  maxDate: h = St,
1332
1445
  disabled: u
1333
1446
  }) {
1334
- const [D, m] = S("calendar"), {
1447
+ const [D, w] = S("calendar"), {
1335
1448
  hideCalendar: k,
1336
1449
  showCalendarEndDate: p,
1337
1450
  showCalendarStartDate: b,
1338
- showingCalendar: w,
1451
+ showingCalendar: m,
1339
1452
  focusedInput: y,
1340
1453
  startDateInputRef: M,
1341
- endDateInputRef: T,
1342
- onClickDay: x,
1454
+ endDateInputRef: A,
1455
+ onClickDay: T,
1343
1456
  startDateIsAfterEnd: N
1344
- } = $n(s, c), [O, Y] = S(() => {
1345
- var _;
1346
- return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
1347
- }), j = C(() => wt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate), [s]);
1348
- return /* @__PURE__ */ i(pt, {
1349
- arrow: !1,
1350
- lazy: !0,
1351
- disabled: u,
1352
- visible: w,
1353
- zIndex: d,
1354
- placement: kt,
1355
- appendTo: r != null ? r : "parent",
1356
- onClickOutside: k,
1357
- content: /* @__PURE__ */ i(F, {
1358
- ...a,
1359
- dateInFocus: O,
1360
- setDateInFocus: Y,
1361
- statePerMonth: j,
1362
- theme: l,
1363
- onClickDay: x,
1364
- currentPanel: D,
1365
- setCurrentPanel: m,
1366
- minDate: f,
1367
- maxDate: h
1368
- }),
1369
- children: /* @__PURE__ */ E(R, {
1370
- alignItems: "center",
1371
- children: [/* @__PURE__ */ i(nt, {
1372
- iconLeft: gt,
1373
- onFocus: b,
1374
- value: s != null && s.startDate ? W(s.startDate, t) : "",
1375
- placeholder: e,
1376
- width: o,
1377
- disabled: u,
1378
- inputRef: M,
1379
- size: 9,
1380
- variant: N ? "error" : void 0
1381
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(Qt, {
1382
- icon: je,
1383
- color: re("--lhds-color-ui-500"),
1384
- size: 14
1385
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(nt, {
1386
- iconLeft: gt,
1387
- onFocus: p,
1388
- value: s != null && s.endDate ? W(s.endDate, t) : "",
1389
- placeholder: n,
1390
- width: o,
1391
- disabled: u,
1392
- inputRef: T,
1393
- size: 9,
1394
- variant: N ? "error" : void 0
1395
- })]
1396
- })
1397
- });
1457
+ } = Wn(s, c), [O, Y] = S(
1458
+ () => {
1459
+ var _;
1460
+ return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
1461
+ }
1462
+ ), z = C(
1463
+ () => mt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
1464
+ [s]
1465
+ );
1466
+ return /* @__PURE__ */ i(
1467
+ pt,
1468
+ {
1469
+ arrow: !1,
1470
+ lazy: !0,
1471
+ disabled: u,
1472
+ visible: m,
1473
+ zIndex: d,
1474
+ placement: kt,
1475
+ appendTo: r != null ? r : "parent",
1476
+ onClickOutside: k,
1477
+ content: /* @__PURE__ */ i(
1478
+ F,
1479
+ {
1480
+ ...a,
1481
+ dateInFocus: O,
1482
+ setDateInFocus: Y,
1483
+ statePerMonth: z,
1484
+ theme: l,
1485
+ onClickDay: T,
1486
+ currentPanel: D,
1487
+ setCurrentPanel: w,
1488
+ minDate: f,
1489
+ maxDate: h
1490
+ }
1491
+ ),
1492
+ children: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1493
+ /* @__PURE__ */ i(
1494
+ nt,
1495
+ {
1496
+ iconLeft: yt,
1497
+ onFocus: b,
1498
+ value: s != null && s.startDate ? W(s.startDate, t) : "",
1499
+ placeholder: e,
1500
+ width: o,
1501
+ disabled: u,
1502
+ inputRef: M,
1503
+ size: 9,
1504
+ variant: N ? "error" : void 0
1505
+ }
1506
+ ),
1507
+ /* @__PURE__ */ i($, {}),
1508
+ /* @__PURE__ */ i(
1509
+ Ft,
1510
+ {
1511
+ icon: ke,
1512
+ color: ie("--lhds-color-ui-500"),
1513
+ size: 14
1514
+ }
1515
+ ),
1516
+ /* @__PURE__ */ i($, {}),
1517
+ /* @__PURE__ */ i(
1518
+ nt,
1519
+ {
1520
+ iconLeft: yt,
1521
+ onFocus: p,
1522
+ value: s != null && s.endDate ? W(s.endDate, t) : "",
1523
+ placeholder: n,
1524
+ width: o,
1525
+ disabled: u,
1526
+ inputRef: A,
1527
+ size: 9,
1528
+ variant: N ? "error" : void 0
1529
+ }
1530
+ )
1531
+ ] })
1532
+ }
1533
+ );
1398
1534
  }
1399
- const Ir = ({
1535
+ const Er = ({
1400
1536
  calendarProps: t,
1401
1537
  closeOnCalendarSelectDate: e = !0,
1402
1538
  dateFormat: n = Z.fullDate,
@@ -1411,64 +1547,72 @@ const Ir = ({
1411
1547
  hideCalenderIcon: h = !1,
1412
1548
  minDate: u,
1413
1549
  maxDate: D = St,
1414
- variant: m,
1550
+ variant: w,
1415
1551
  ...k
1416
1552
  }) => {
1417
- const [p, b] = S(!1), {
1418
- tippyRef: w,
1419
- onChangePanel: y
1420
- } = fe(), M = g(() => {
1553
+ const [p, b] = S(!1), { tippyRef: m, onChangePanel: y } = he(), M = g(() => {
1421
1554
  b(!p);
1422
- }, [b, p]), T = g(() => {
1555
+ }, [b, p]), A = g(() => {
1423
1556
  b(!1);
1424
- }, [b]), x = g((P) => {
1425
- s && s(P);
1426
- }, [s]), N = g((P) => {
1427
- P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
1428
- }, [x, n, e, b, p]), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && He(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
1429
- return /* @__PURE__ */ i(I, {
1430
- width: l,
1431
- children: /* @__PURE__ */ i(pt, {
1557
+ }, [b]), T = g(
1558
+ (P) => {
1559
+ s && s(P);
1560
+ },
1561
+ [s]
1562
+ ), N = g(
1563
+ (P) => {
1564
+ P && (T(W(P, n)), e && setTimeout(() => b(!p), 200));
1565
+ },
1566
+ [T, n, e, b, p]
1567
+ ), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && Le(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
1568
+ return /* @__PURE__ */ i(I, { width: l, children: /* @__PURE__ */ i(
1569
+ pt,
1570
+ {
1432
1571
  arrow: !1,
1433
1572
  lazy: !0,
1434
1573
  visible: p,
1435
1574
  zIndex: a,
1436
1575
  appendTo: d != null ? d : "parent",
1437
1576
  placement: kt,
1438
- onClickOutside: T,
1439
- tippyRef: w,
1440
- content: /* @__PURE__ */ i(ae, {
1441
- ...t,
1442
- onChange: N,
1443
- onChangePanel: y,
1444
- value: o && Y ? ot(o, n, new Date()) : void 0,
1445
- minDate: u,
1446
- maxDate: D,
1447
- theme: f
1448
- }),
1449
- children: /* @__PURE__ */ i(nt, {
1450
- ...k,
1451
- variant: _ ? "error" : m,
1452
- disableContentPaddingRight: !0,
1453
- contentRight: h ? void 0 : /* @__PURE__ */ i(R, {
1454
- alignItems: "center",
1455
- indent: 0.5,
1456
- children: /* @__PURE__ */ i(A, {
1457
- size: "small",
1458
- disabled: k.disabled || r,
1459
- leftIcon: gt,
1460
- onClick: M
1461
- })
1462
- }),
1463
- onValueChange: x,
1464
- placeholder: c,
1465
- value: o || "",
1466
- min: u,
1467
- max: D,
1468
- size: 10
1469
- })
1470
- })
1471
- });
1577
+ onClickOutside: A,
1578
+ tippyRef: m,
1579
+ content: /* @__PURE__ */ i(
1580
+ De,
1581
+ {
1582
+ ...t,
1583
+ onChange: N,
1584
+ onChangePanel: y,
1585
+ value: o && Y ? ot(o, n, new Date()) : void 0,
1586
+ minDate: u,
1587
+ maxDate: D,
1588
+ theme: f
1589
+ }
1590
+ ),
1591
+ children: /* @__PURE__ */ i(
1592
+ nt,
1593
+ {
1594
+ ...k,
1595
+ variant: _ ? "error" : w,
1596
+ disableContentPaddingRight: !0,
1597
+ contentRight: h ? void 0 : /* @__PURE__ */ i(R, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ i(
1598
+ x,
1599
+ {
1600
+ size: "small",
1601
+ disabled: k.disabled || r,
1602
+ leftIcon: yt,
1603
+ onClick: M
1604
+ }
1605
+ ) }),
1606
+ onValueChange: T,
1607
+ placeholder: c,
1608
+ value: o || "",
1609
+ min: u,
1610
+ max: D,
1611
+ size: 10
1612
+ }
1613
+ )
1614
+ }
1615
+ ) });
1472
1616
  }, Tt = (t) => {
1473
1617
  if (t === "")
1474
1618
  return "00";
@@ -1501,7 +1645,7 @@ const Ir = ({
1501
1645
  default:
1502
1646
  throw new Error("Invalid minute string");
1503
1647
  }
1504
- }, Pn = (t) => {
1648
+ }, On = (t) => {
1505
1649
  if (!Ut(t))
1506
1650
  return { time: t, success: !1 };
1507
1651
  const e = t && t.split(/-|:|,|;|[/]|[.]| /);
@@ -1535,7 +1679,7 @@ const Ir = ({
1535
1679
  }
1536
1680
  }
1537
1681
  return { time: t, success: !1 };
1538
- }, Ut = (t) => t ? /^[-:.,/; 0-9]+$/.test(t) : !0, Hr = ({
1682
+ }, Ut = (t) => t ? /^[-:.,/; 0-9]+$/.test(t) : !0, Rr = ({
1539
1683
  onValueChange: t,
1540
1684
  showPlaceholder: e = !0,
1541
1685
  useIcon: n = !0,
@@ -1546,25 +1690,31 @@ const Ir = ({
1546
1690
  }) => {
1547
1691
  const [o, l] = S(() => Ut(r)), a = "hh:mm", f = g(() => {
1548
1692
  if (r) {
1549
- const u = Pn(r);
1693
+ const u = On(r);
1550
1694
  l(u.success), u.success && t && t(u.time);
1551
1695
  }
1552
- }, [r, t, l]), h = g((u) => {
1553
- const D = u.target.value, m = Ut(D);
1554
- l(m && D.length <= a.length), t && t(D);
1555
- }, [t, l]);
1556
- return /* @__PURE__ */ i(nt, {
1557
- ...d,
1558
- type: "time",
1559
- variant: o ? c : "error",
1560
- iconLeft: n ? Xt : void 0,
1561
- value: r,
1562
- placeholder: e ? a : void 0,
1563
- onChange: h,
1564
- onBlur: f,
1565
- width: s
1566
- });
1567
- }, ue = ({
1696
+ }, [r, t, l]), h = g(
1697
+ (u) => {
1698
+ const D = u.target.value, w = Ut(D);
1699
+ l(w && D.length <= a.length), t && t(D);
1700
+ },
1701
+ [t, l]
1702
+ );
1703
+ return /* @__PURE__ */ i(
1704
+ nt,
1705
+ {
1706
+ ...d,
1707
+ type: "time",
1708
+ variant: o ? c : "error",
1709
+ iconLeft: n ? vt : void 0,
1710
+ value: r,
1711
+ placeholder: e ? a : void 0,
1712
+ onChange: h,
1713
+ onBlur: f,
1714
+ width: s
1715
+ }
1716
+ );
1717
+ }, ge = ({
1568
1718
  autoFocusLeft: t,
1569
1719
  autoFocusRight: e,
1570
1720
  onEsc: n,
@@ -1579,19 +1729,19 @@ const Ir = ({
1579
1729
  onChangeLeft: h,
1580
1730
  onChangeRight: u,
1581
1731
  valueLeft: D,
1582
- valueRight: m,
1732
+ valueRight: w,
1583
1733
  minLeft: k,
1584
1734
  maxLeft: p,
1585
1735
  minRight: b,
1586
- maxRight: w,
1736
+ maxRight: m,
1587
1737
  onClickLeft: y,
1588
1738
  onClickRight: M,
1589
- onClickCalendar: T,
1590
- onClickArrowDown: x,
1739
+ onClickCalendar: A,
1740
+ onClickArrowDown: T,
1591
1741
  onBlurLeft: N,
1592
1742
  onBlurRight: O,
1593
1743
  onFocusLeft: Y,
1594
- onFocusRight: j,
1744
+ onFocusRight: z,
1595
1745
  inputRefLeft: _,
1596
1746
  inputRefRight: P,
1597
1747
  variant: st,
@@ -1603,104 +1753,118 @@ const Ir = ({
1603
1753
  widthRight: ut,
1604
1754
  disabled: v
1605
1755
  }) => {
1606
- const L = J(0), H = C(() => Le((G) => {
1607
- G === 0 && (K == null || K());
1608
- }, 10), [K]), Mt = g((G) => {
1609
- L.current++, H(L.current), Y && Y(G);
1610
- }, [Y, L, H]), Et = g((G) => {
1611
- L.current++, H(L.current), j && j(G);
1612
- }, [j, L, H]), Rt = g((G) => {
1613
- L.current--, H(L.current), N && N(G);
1614
- }, [N, L, H]), he = g((G) => {
1615
- L.current--, H(L.current), O && O(G);
1616
- }, [O, L, H]);
1617
- return /* @__PURE__ */ i(I, {
1618
- children: /* @__PURE__ */ E(Be, {
1756
+ const L = J(0), H = C(
1757
+ () => We((G) => {
1758
+ G === 0 && (K == null || K());
1759
+ }, 10),
1760
+ [K]
1761
+ ), Mt = g(
1762
+ (G) => {
1763
+ L.current++, H(L.current), Y && Y(G);
1764
+ },
1765
+ [Y, L, H]
1766
+ ), Et = g(
1767
+ (G) => {
1768
+ L.current++, H(L.current), z && z(G);
1769
+ },
1770
+ [z, L, H]
1771
+ ), Rt = g(
1772
+ (G) => {
1773
+ L.current--, H(L.current), N && N(G);
1774
+ },
1775
+ [N, L, H]
1776
+ ), we = g(
1777
+ (G) => {
1778
+ L.current--, H(L.current), O && O(G);
1779
+ },
1780
+ [O, L, H]
1781
+ );
1782
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ E(
1783
+ Pe,
1784
+ {
1619
1785
  disableContentPaddingRight: !0,
1620
1786
  disabled: v,
1621
1787
  variant: st,
1622
- contentRight: /* @__PURE__ */ E(R, {
1623
- alignItems: "center",
1624
- children: [/* @__PURE__ */ i(ht, {
1625
- num: 0.5,
1626
- children: /* @__PURE__ */ i(A, {
1627
- leftIcon: gt,
1628
- onClick: T,
1788
+ contentRight: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1789
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1790
+ x,
1791
+ {
1792
+ leftIcon: yt,
1793
+ onClick: A,
1629
1794
  disabled: v,
1630
1795
  size: "small"
1631
- })
1632
- }), at ? /* @__PURE__ */ E(mt, {
1633
- children: [/* @__PURE__ */ i(R, {
1634
- height: "22px",
1635
- children: /* @__PURE__ */ i(ye, {
1636
- vertical: !0
1637
- })
1638
- }), /* @__PURE__ */ i(ht, {
1639
- num: 0.5,
1640
- children: /* @__PURE__ */ i(A, {
1641
- leftIcon: pe,
1642
- onClick: x,
1796
+ }
1797
+ ) }),
1798
+ at ? /* @__PURE__ */ E(ht, { children: [
1799
+ /* @__PURE__ */ i(R, { height: "22px", children: /* @__PURE__ */ i(pe, { vertical: !0 }) }),
1800
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1801
+ x,
1802
+ {
1803
+ leftIcon: Se,
1804
+ onClick: T,
1643
1805
  disabled: v,
1644
1806
  size: "small"
1645
- })
1646
- })]
1647
- }) : null]
1648
- }),
1649
- children: [/* @__PURE__ */ i(I, {
1650
- width: ft,
1651
- children: /* @__PURE__ */ i(nt, {
1652
- onEsc: n,
1653
- onEnter: r,
1654
- onClick: y,
1655
- disabled: v,
1656
- hideBorder: !0,
1657
- placeholder: o,
1658
- value: D,
1659
- onValueChange: s,
1660
- onChange: h,
1661
- onBlur: Rt,
1662
- onFocus: Mt,
1663
- inputRef: _,
1664
- variant: lt,
1665
- type: a,
1666
- autoFocus: t,
1667
- min: k,
1668
- max: p
1669
- })
1670
- }), /* @__PURE__ */ i(R, {
1671
- indent: 0.5,
1672
- alignItems: "center",
1673
- justifyContent: "center",
1674
- children: /* @__PURE__ */ i(Qt, {
1675
- icon: d,
1676
- size: 12,
1677
- color: re("--lhds-color-ui-500")
1678
- })
1679
- }), /* @__PURE__ */ i(I, {
1680
- width: ut,
1681
- children: /* @__PURE__ */ i(nt, {
1682
- onEsc: n,
1683
- onEnter: r,
1684
- onClick: M,
1685
- disabled: v,
1686
- hideBorder: !0,
1687
- placeholder: l,
1688
- value: m,
1689
- onValueChange: c,
1690
- onChange: u,
1691
- onBlur: he,
1692
- onFocus: Et,
1693
- inputRef: P,
1694
- variant: ct,
1695
- type: f,
1696
- autoFocus: e,
1697
- min: b,
1698
- max: w
1699
- })
1700
- })]
1701
- })
1702
- });
1703
- }, Bn = (t) => {
1807
+ }
1808
+ ) })
1809
+ ] }) : null
1810
+ ] }),
1811
+ children: [
1812
+ /* @__PURE__ */ i(I, { width: ft, children: /* @__PURE__ */ i(
1813
+ nt,
1814
+ {
1815
+ onEsc: n,
1816
+ onEnter: r,
1817
+ onClick: y,
1818
+ disabled: v,
1819
+ hideBorder: !0,
1820
+ placeholder: o,
1821
+ value: D,
1822
+ onValueChange: s,
1823
+ onChange: h,
1824
+ onBlur: Rt,
1825
+ onFocus: Mt,
1826
+ inputRef: _,
1827
+ variant: lt,
1828
+ type: a,
1829
+ autoFocus: t,
1830
+ min: k,
1831
+ max: p
1832
+ }
1833
+ ) }),
1834
+ /* @__PURE__ */ i(R, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ i(
1835
+ Ft,
1836
+ {
1837
+ icon: d,
1838
+ size: 12,
1839
+ color: ie("--lhds-color-ui-500")
1840
+ }
1841
+ ) }),
1842
+ /* @__PURE__ */ i(I, { width: ut, children: /* @__PURE__ */ i(
1843
+ nt,
1844
+ {
1845
+ onEsc: n,
1846
+ onEnter: r,
1847
+ onClick: M,
1848
+ disabled: v,
1849
+ hideBorder: !0,
1850
+ placeholder: l,
1851
+ value: w,
1852
+ onValueChange: c,
1853
+ onChange: u,
1854
+ onBlur: we,
1855
+ onFocus: Et,
1856
+ inputRef: P,
1857
+ variant: ct,
1858
+ type: f,
1859
+ autoFocus: e,
1860
+ min: b,
1861
+ max: m
1862
+ }
1863
+ ) })
1864
+ ]
1865
+ }
1866
+ ) });
1867
+ }, $n = (t) => {
1704
1868
  if (t == null)
1705
1869
  throw new Error("Time is not set.");
1706
1870
  if (t === "")
@@ -1722,14 +1886,14 @@ const Ir = ({
1722
1886
  if (r < 0 || r > 59)
1723
1887
  throw new Error("Invalid time.");
1724
1888
  return n * 100 + r;
1725
- }, zn = (t) => {
1889
+ }, Pn = (t) => {
1726
1890
  try {
1727
- return Bn(t), !0;
1891
+ return $n(t), !0;
1728
1892
  } catch {
1729
1893
  return !1;
1730
1894
  }
1731
1895
  }, At = (t) => {
1732
- if (t && zn(t)) {
1896
+ if (t && Pn(t)) {
1733
1897
  const e = t.split(":");
1734
1898
  return {
1735
1899
  hour: Jt(e[0]),
@@ -1740,12 +1904,12 @@ const Ir = ({
1740
1904
  hour: void 0,
1741
1905
  minute: void 0
1742
1906
  };
1743
- }, jn = (t) => `${Tt(String(t.getHours()))}:${xt(
1907
+ }, Bn = (t) => `${Tt(String(t.getHours()))}:${xt(
1744
1908
  String(t.getMinutes())
1745
- )}`, _n = "_timePicker_1w05d_1", Jn = "_timePickerColumn_1w05d_6", De = {
1746
- timePicker: _n,
1747
- timePickerColumn: Jn
1748
- }, Kn = ({
1909
+ )}`, jn = "_timePicker_1w05d_1", zn = "_timePickerColumn_1w05d_6", ye = {
1910
+ timePicker: jn,
1911
+ timePickerColumn: zn
1912
+ }, _n = ({
1749
1913
  onClick: t,
1750
1914
  item: e,
1751
1915
  selected: n,
@@ -1753,25 +1917,37 @@ const Ir = ({
1753
1917
  canScrollRef: s
1754
1918
  }) => {
1755
1919
  const c = J(null);
1756
- return Q(function() {
1757
- if (n && r.current && c.current && s.current) {
1758
- const o = c.current.scrollHeight * Math.max(e - 2, 0);
1759
- r.current.scrollTo(0, o), s.current = !1;
1920
+ return Q(
1921
+ function() {
1922
+ if (n && r.current && c.current && s.current) {
1923
+ const o = c.current.scrollHeight * Math.max(e - 2, 0);
1924
+ r.current.scrollTo(0, o), s.current = !1;
1925
+ }
1926
+ },
1927
+ [r, e, n, s]
1928
+ ), /* @__PURE__ */ i(
1929
+ R,
1930
+ {
1931
+ width: "64px",
1932
+ justifyContent: "center",
1933
+ spacing: 0.5,
1934
+ indent: 0.5,
1935
+ ref: c,
1936
+ children: n ? /* @__PURE__ */ i(
1937
+ dt,
1938
+ {
1939
+ label: Oe(String(e), 2, "0"),
1940
+ onClick: () => t && t(e)
1941
+ }
1942
+ ) : /* @__PURE__ */ i(
1943
+ x,
1944
+ {
1945
+ label: String(e).padStart(2, "0"),
1946
+ onClick: () => t && t(e)
1947
+ }
1948
+ )
1760
1949
  }
1761
- }, [r, e, n, s]), /* @__PURE__ */ i(R, {
1762
- width: "64px",
1763
- justifyContent: "center",
1764
- spacing: 0.5,
1765
- indent: 0.5,
1766
- ref: c,
1767
- children: n ? /* @__PURE__ */ i(dt, {
1768
- label: Ue(String(e), 2, "0"),
1769
- onClick: () => t && t(e)
1770
- }) : /* @__PURE__ */ i(A, {
1771
- label: String(e).padStart(2, "0"),
1772
- onClick: () => t && t(e)
1773
- })
1774
- });
1950
+ );
1775
1951
  }, qt = ({
1776
1952
  onClick: t,
1777
1953
  items: e,
@@ -1779,51 +1955,65 @@ const Ir = ({
1779
1955
  canScrollRef: r
1780
1956
  }) => {
1781
1957
  const s = J(null);
1782
- return /* @__PURE__ */ i(B, {
1783
- className: De.timePickerColumn,
1784
- ref: s,
1785
- children: e.map((c) => /* @__PURE__ */ i(Kn, {
1958
+ return /* @__PURE__ */ i(B, { className: ye.timePickerColumn, ref: s, children: e.map((c) => /* @__PURE__ */ i(
1959
+ _n,
1960
+ {
1786
1961
  item: c,
1787
1962
  onClick: t,
1788
1963
  selected: c === n,
1789
1964
  columnRef: s,
1790
1965
  canScrollRef: r
1791
- }, c))
1792
- });
1793
- }, Gn = jt(0, 24), qn = jt(0, 60), Qn = ({
1966
+ },
1967
+ c
1968
+ )) });
1969
+ }, Jn = zt(0, 24), Kn = zt(0, 60), Gn = ({
1794
1970
  value: t,
1795
1971
  onValueChange: e
1796
1972
  }) => {
1797
1973
  const n = J(!0), [r, s] = S(void 0), [c, d] = S(void 0);
1798
1974
  Q(() => {
1799
1975
  if (t) {
1800
- const {
1801
- minute: a,
1802
- hour: f
1803
- } = At(t);
1976
+ const { minute: a, hour: f } = At(t);
1804
1977
  s(f), d(a);
1805
1978
  }
1806
1979
  }, [t]);
1807
- const o = g((a) => {
1808
- s(a), e == null || e(`${Tt(String(a != null ? a : 0))}:${xt(String(c != null ? c : 0))}`);
1809
- }, [c, e]), l = g((a) => {
1810
- d(a), e == null || e(`${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`);
1811
- }, [r, e]);
1812
- return /* @__PURE__ */ E(R, {
1813
- className: De.timePicker,
1814
- children: [/* @__PURE__ */ i(qt, {
1815
- items: Gn,
1816
- onClick: o,
1817
- selectedItem: r,
1818
- canScrollRef: n
1819
- }), /* @__PURE__ */ i(ht, {}), /* @__PURE__ */ i(qt, {
1820
- items: qn,
1821
- onClick: l,
1822
- selectedItem: c,
1823
- canScrollRef: n
1824
- })]
1825
- });
1826
- }, Xn = (t, e, n) => {
1980
+ const o = g(
1981
+ (a) => {
1982
+ s(a), e == null || e(
1983
+ `${Tt(String(a != null ? a : 0))}:${xt(String(c != null ? c : 0))}`
1984
+ );
1985
+ },
1986
+ [c, e]
1987
+ ), l = g(
1988
+ (a) => {
1989
+ d(a), e == null || e(
1990
+ `${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`
1991
+ );
1992
+ },
1993
+ [r, e]
1994
+ );
1995
+ return /* @__PURE__ */ E(R, { className: ye.timePicker, children: [
1996
+ /* @__PURE__ */ i(
1997
+ qt,
1998
+ {
1999
+ items: Jn,
2000
+ onClick: o,
2001
+ selectedItem: r,
2002
+ canScrollRef: n
2003
+ }
2004
+ ),
2005
+ /* @__PURE__ */ i(gt, {}),
2006
+ /* @__PURE__ */ i(
2007
+ qt,
2008
+ {
2009
+ items: Kn,
2010
+ onClick: l,
2011
+ selectedItem: c,
2012
+ canScrollRef: n
2013
+ }
2014
+ )
2015
+ ] });
2016
+ }, qn = (t, e, n) => {
1827
2017
  Q(
1828
2018
  function() {
1829
2019
  t && e(t);
@@ -1837,7 +2027,7 @@ const Ir = ({
1837
2027
  },
1838
2028
  [t, n]
1839
2029
  );
1840
- }, Zn = (t, e, {
2030
+ }, Qn = (t, e, {
1841
2031
  setDateInFocus: n,
1842
2032
  showCalendarInternal: r,
1843
2033
  hideCalendarInternal: s,
@@ -1849,15 +2039,15 @@ const Ir = ({
1849
2039
  setLocalDate: f
1850
2040
  }, h) => {
1851
2041
  const u = g(
1852
- (w) => {
1853
- if (!w)
2042
+ (m) => {
2043
+ if (!m)
1854
2044
  return;
1855
- const y = new Date(w);
2045
+ const y = new Date(m);
1856
2046
  if (t)
1857
2047
  y.setHours(t.getHours()), y.setMinutes(t.getMinutes()), e == null || e(y), f(void 0);
1858
2048
  else if (o) {
1859
- const { minute: M, hour: T } = At(o);
1860
- y.setHours(T != null ? T : 0), y.setMinutes(M != null ? M : 0), e == null || e(y), f(void 0);
2049
+ const { minute: M, hour: A } = At(o);
2050
+ y.setHours(A != null ? A : 0), y.setMinutes(M != null ? M : 0), e == null || e(y), f(void 0);
1861
2051
  } else
1862
2052
  f(y);
1863
2053
  n(y), h.current && (h.current.valueAsDate = new Date(
@@ -1866,25 +2056,25 @@ const Ir = ({
1866
2056
  },
1867
2057
  [t, h, o, e, n, f]
1868
2058
  ), D = g(
1869
- (w) => {
1870
- if (!!w)
2059
+ (m) => {
2060
+ if (!!m)
1871
2061
  if (t) {
1872
- const y = At(w), M = new Date(t);
2062
+ const y = At(m), M = new Date(t);
1873
2063
  M.setHours(y.hour || 0), M.setMinutes(y.minute || 0), e == null || e(M), l(void 0);
1874
2064
  } else if (a) {
1875
- const y = At(w), M = new Date(a);
2065
+ const y = At(m), M = new Date(a);
1876
2066
  M.setHours(y.hour || 0), M.setMinutes(y.minute || 0), e == null || e(M), l(void 0);
1877
2067
  } else
1878
- l(w);
2068
+ l(m);
1879
2069
  },
1880
2070
  [e, t, a, l]
1881
- ), m = g(
1882
- (w) => {
1883
- w.target.value[0] !== "0" && u(w.target.valueAsDate);
2071
+ ), w = g(
2072
+ (m) => {
2073
+ m.target.value[0] !== "0" && u(m.target.valueAsDate);
1884
2074
  },
1885
2075
  [u]
1886
2076
  ), k = g(
1887
- (w) => D(w.target.value),
2077
+ (m) => D(m.target.value),
1888
2078
  [D]
1889
2079
  ), p = g(() => {
1890
2080
  n(t || new Date()), d("calendar"), r();
@@ -1892,15 +2082,15 @@ const Ir = ({
1892
2082
  c(void 0), s();
1893
2083
  }, [c, s]);
1894
2084
  return {
1895
- inputLeftChangeHandler: m,
2085
+ inputLeftChangeHandler: w,
1896
2086
  inputRightChangeHandler: k,
1897
2087
  hideCalendar: b,
1898
2088
  showCalendar: p,
1899
2089
  onChangeTime: D,
1900
2090
  onChangeDate: u
1901
2091
  };
1902
- }, Fn = (t) => {
1903
- const [e, n] = S(void 0), [r, s] = S(void 0), [c, d, o] = Ht(!1), [l, a, f] = Ht(!1), [h, u] = S(void 0), [D, m] = S(
2092
+ }, Xn = (t) => {
2093
+ const [e, n] = S(void 0), [r, s] = S(void 0), [c, d, o] = Ht(!1), [l, a, f] = Ht(!1), [h, u] = S(void 0), [D, w] = S(
1904
2094
  () => t != null ? t : new Date()
1905
2095
  ), [k, p] = S("calendar");
1906
2096
  return {
@@ -1910,7 +2100,7 @@ const Ir = ({
1910
2100
  firstFocusedInput: h,
1911
2101
  setFirstFocusedInput: u,
1912
2102
  dateInFocus: D,
1913
- setDateInFocus: m,
2103
+ setDateInFocus: w,
1914
2104
  currentPanel: k,
1915
2105
  setCurrentPanel: p,
1916
2106
  isTimePickerVisible: l,
@@ -1921,7 +2111,7 @@ const Ir = ({
1921
2111
  localTime: r,
1922
2112
  setLocalTime: s
1923
2113
  };
1924
- }, vn = (t, e, n, r, {
2114
+ }, Zn = (t, e, n, r, {
1925
2115
  isCalendarVisible: s,
1926
2116
  setCurrentPanel: c,
1927
2117
  showTimePicker: d,
@@ -1932,15 +2122,15 @@ const Ir = ({
1932
2122
  }, [o, s, c, n]), a = g(() => {
1933
2123
  r(), d();
1934
2124
  }, [r, d]), f = g(
1935
- (m) => {
1936
- t(m.date), r(), d();
2125
+ (w) => {
2126
+ t(w.date), r(), d();
1937
2127
  },
1938
2128
  [t, r, d]
1939
2129
  ), h = g(() => {
1940
2130
  c("presets"), n();
1941
2131
  }, [c, n]), u = g(() => {
1942
- var m;
1943
- s ? r() : ((m = e.current) == null || m.focus(), c("calendar"), n());
2132
+ var w;
2133
+ s ? r() : ((w = e.current) == null || w.focus(), c("calendar"), n());
1944
2134
  }, [
1945
2135
  s,
1946
2136
  r,
@@ -1948,8 +2138,8 @@ const Ir = ({
1948
2138
  c,
1949
2139
  n
1950
2140
  ]), D = g(
1951
- (m) => {
1952
- m.key === "Escape" && r();
2141
+ (w) => {
2142
+ w.key === "Escape" && r();
1953
2143
  },
1954
2144
  [r]
1955
2145
  );
@@ -1961,7 +2151,7 @@ const Ir = ({
1961
2151
  onClickCalendarButton: u,
1962
2152
  onKeyDownHandler: D
1963
2153
  };
1964
- }, Yr = ({
2154
+ }, Ar = ({
1965
2155
  value: t,
1966
2156
  onValueChange: e,
1967
2157
  onEnter: n,
@@ -1975,105 +2165,116 @@ const Ir = ({
1975
2165
  variant: f,
1976
2166
  disabled: h
1977
2167
  }) => {
1978
- const u = J(null), D = J(null), m = Fn(t), {
2168
+ const u = J(null), D = J(null), w = Xn(t), {
1979
2169
  setCurrentPanel: k,
1980
2170
  currentPanel: p,
1981
2171
  isCalendarVisible: b,
1982
- dateInFocus: w,
2172
+ dateInFocus: m,
1983
2173
  setDateInFocus: y,
1984
2174
  isTimePickerVisible: M,
1985
- hideTimePicker: T,
1986
- localTime: x,
2175
+ hideTimePicker: A,
2176
+ localTime: T,
1987
2177
  localDate: N
1988
- } = m, {
2178
+ } = w, {
1989
2179
  showCalendar: O,
1990
2180
  hideCalendar: Y,
1991
- inputLeftChangeHandler: j,
2181
+ inputLeftChangeHandler: z,
1992
2182
  inputRightChangeHandler: _,
1993
2183
  onChangeTime: P,
1994
2184
  onChangeDate: st
1995
- } = Zn(t, e, m, u), {
2185
+ } = Qn(t, e, w, u), {
1996
2186
  onKeyDownHandler: lt,
1997
2187
  onFocusRight: ct,
1998
2188
  onFocusLeft: K,
1999
2189
  onClickDay: at,
2000
2190
  onClickCalendarButton: ft,
2001
2191
  onClickArrowButton: ut
2002
- } = vn(st, u, O, Y, m);
2003
- Xn(t, y, u);
2192
+ } = Zn(
2193
+ st,
2194
+ u,
2195
+ O,
2196
+ Y,
2197
+ w
2198
+ );
2199
+ qn(t, y, u);
2004
2200
  const v = C(() => {
2005
2201
  const Rt = t || N;
2006
- return Rt ? X(void 0, Rt, ["singleSelected", "selected"]) : {};
2202
+ return Rt ? X(void 0, Rt, [
2203
+ "singleSelected",
2204
+ "selected"
2205
+ ]) : {};
2007
2206
  }, [N, t]), L = g(() => {
2008
- Y(), T();
2009
- }, [Y, T]), H = C(() => t ? jn(t) : x, [t, x]), Mt = Yt(b, 300), Et = Yt(M, 300);
2010
- return /* @__PURE__ */ i(I, {
2011
- onKeyDown: lt,
2012
- children: /* @__PURE__ */ i(pt, {
2207
+ Y(), A();
2208
+ }, [Y, A]), H = C(
2209
+ () => t ? Bn(t) : T,
2210
+ [t, T]
2211
+ ), Mt = Yt(b, 300), Et = Yt(M, 300);
2212
+ return /* @__PURE__ */ i(I, { onKeyDown: lt, children: /* @__PURE__ */ i(
2213
+ pt,
2214
+ {
2013
2215
  arrow: !1,
2014
2216
  lazy: !0,
2015
2217
  disabled: h,
2016
2218
  placement: kt,
2017
2219
  visible: b || M,
2018
2220
  onClickOutside: L,
2019
- content: (Mt || Et) && /* @__PURE__ */ i(B, {
2020
- children: Mt ? /* @__PURE__ */ i(F, {
2221
+ content: (Mt || Et) && /* @__PURE__ */ i(B, { children: Mt ? /* @__PURE__ */ i(
2222
+ F,
2223
+ {
2021
2224
  statePerMonth: v,
2022
2225
  onClickDay: at,
2023
- dateInFocus: w,
2226
+ dateInFocus: m,
2024
2227
  setDateInFocus: y,
2025
2228
  currentPanel: p,
2026
2229
  setCurrentPanel: k,
2027
2230
  minDate: d,
2028
2231
  maxDate: a
2029
- }) : Et ? /* @__PURE__ */ E(B, {
2030
- children: [/* @__PURE__ */ i(B, {
2031
- overflow: "hidden",
2032
- height: "250px",
2033
- children: /* @__PURE__ */ i(Qn, {
2034
- value: H != null ? H : "",
2035
- onValueChange: P
2036
- })
2037
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
2038
- justifyContent: "flex-end",
2039
- children: /* @__PURE__ */ i(dt, {
2040
- label: "Done",
2041
- onClick: T
2042
- })
2043
- })]
2044
- }) : null
2045
- }),
2046
- children: /* @__PURE__ */ i(ue, {
2047
- autoFocusLeft: c,
2048
- onEsc: r,
2049
- onEnter: n,
2050
- onBlur: s,
2051
- disabled: h,
2052
- separatorIcon: Xt,
2053
- typeLeft: "date",
2054
- typeRight: "time",
2055
- placeholderLeft: "yyyy-mm-dd",
2056
- placeholderRight: "hh:mm",
2057
- onChangeLeft: j,
2058
- onChangeRight: _,
2059
- onClickArrowDown: ut,
2060
- onClickCalendar: ft,
2061
- onFocusLeft: K,
2062
- onFocusRight: ct,
2063
- onClickLeft: K,
2064
- onClickRight: ct,
2065
- inputRefLeft: u,
2066
- inputRefRight: D,
2067
- valueRight: H != null ? H : "",
2068
- widthLeft: o,
2069
- widthRight: l,
2070
- minLeft: d,
2071
- maxLeft: a,
2072
- variant: f
2073
- })
2074
- })
2075
- });
2076
- }, Vn = (t, e, n, r, s) => {
2232
+ }
2233
+ ) : Et ? /* @__PURE__ */ E(B, { children: [
2234
+ /* @__PURE__ */ i(B, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ i(
2235
+ Gn,
2236
+ {
2237
+ value: H != null ? H : "",
2238
+ onValueChange: P
2239
+ }
2240
+ ) }),
2241
+ /* @__PURE__ */ i($, {}),
2242
+ /* @__PURE__ */ i(R, { justifyContent: "flex-end", children: /* @__PURE__ */ i(dt, { label: "Done", onClick: A }) })
2243
+ ] }) : null }),
2244
+ children: /* @__PURE__ */ i(
2245
+ ge,
2246
+ {
2247
+ autoFocusLeft: c,
2248
+ onEsc: r,
2249
+ onEnter: n,
2250
+ onBlur: s,
2251
+ disabled: h,
2252
+ separatorIcon: vt,
2253
+ typeLeft: "date",
2254
+ typeRight: "time",
2255
+ placeholderLeft: "yyyy-mm-dd",
2256
+ placeholderRight: "hh:mm",
2257
+ onChangeLeft: z,
2258
+ onChangeRight: _,
2259
+ onClickArrowDown: ut,
2260
+ onClickCalendar: ft,
2261
+ onFocusLeft: K,
2262
+ onFocusRight: ct,
2263
+ onClickLeft: K,
2264
+ onClickRight: ct,
2265
+ inputRefLeft: u,
2266
+ inputRefRight: D,
2267
+ valueRight: H != null ? H : "",
2268
+ widthLeft: o,
2269
+ widthRight: l,
2270
+ minLeft: d,
2271
+ maxLeft: a,
2272
+ variant: f
2273
+ }
2274
+ )
2275
+ }
2276
+ ) });
2277
+ }, Fn = (t, e, n, r, s) => {
2077
2278
  Q(
2078
2279
  function() {
2079
2280
  t && n(t);
@@ -2107,7 +2308,7 @@ const Ir = ({
2107
2308
  },
2108
2309
  [e, s]
2109
2310
  );
2110
- }, tr = (t, e, n, {
2311
+ }, vn = (t, e, n, {
2111
2312
  setDateInFocus: r,
2112
2313
  showCalendarInternal: s,
2113
2314
  hideCalendarInternal: c,
@@ -2151,7 +2352,7 @@ const Ir = ({
2151
2352
  setCurrentPanel: o,
2152
2353
  showCalendar: f
2153
2354
  };
2154
- }, er = (t, e) => {
2355
+ }, Vn = (t, e) => {
2155
2356
  const [n, r, s] = Ht(!1), [c, d] = S(void 0), [o, l] = S("startDate"), [a, f] = S(() => {
2156
2357
  const D = o === "startDate" ? t : o === "endDate" ? e : void 0;
2157
2358
  return D != null ? D : new Date();
@@ -2169,7 +2370,7 @@ const Ir = ({
2169
2370
  currentPanel: h,
2170
2371
  setCurrentPanel: u
2171
2372
  };
2172
- }, nr = (t, e, n, r, s, c, d, {
2373
+ }, tr = (t, e, n, r, s, c, d, {
2173
2374
  firstFocusedInput: o,
2174
2375
  setFirstFocusedInput: l,
2175
2376
  isCalendarVisible: a,
@@ -2185,7 +2386,7 @@ const Ir = ({
2185
2386
  c,
2186
2387
  l,
2187
2388
  o
2188
- ]), m = g(() => {
2389
+ ]), w = g(() => {
2189
2390
  o == null && l("endDate"), f("endDate"), a || c();
2190
2391
  }, [
2191
2392
  a,
@@ -2195,14 +2396,14 @@ const Ir = ({
2195
2396
  o
2196
2397
  ]), k = g(
2197
2398
  (y) => {
2198
- var M, T, x, N;
2399
+ var M, A, T, N;
2199
2400
  h === "startDate" ? e != null && et(y.date, e) ? (n == null || n({
2200
2401
  startDate: y.date,
2201
2402
  endDate: void 0
2202
2403
  }), f("endDate"), (M = s.current) == null || M.focus()) : (n == null || n({
2203
2404
  startDate: y.date,
2204
2405
  endDate: e
2205
- }), o === "startDate" ? (f("endDate"), (T = s.current) == null || T.focus()) : setTimeout(d, 50)) : h === "endDate" && (t ? et(t, y.date) ? (n == null || n({
2406
+ }), o === "startDate" ? (f("endDate"), (A = s.current) == null || A.focus()) : setTimeout(d, 50)) : h === "endDate" && (t ? et(t, y.date) ? (n == null || n({
2206
2407
  startDate: y.date,
2207
2408
  endDate: void 0
2208
2409
  }), f("endDate"), (N = s.current) == null || N.focus()) : (n == null || n({
@@ -2211,7 +2412,7 @@ const Ir = ({
2211
2412
  }), setTimeout(d, 50)) : (n == null || n({
2212
2413
  startDate: t,
2213
2414
  endDate: y.date
2214
- }), f("startDate"), (x = r.current) == null || x.focus()));
2415
+ }), f("startDate"), (T = r.current) == null || T.focus()));
2215
2416
  },
2216
2417
  [
2217
2418
  h,
@@ -2237,7 +2438,7 @@ const Ir = ({
2237
2438
  r,
2238
2439
  u,
2239
2440
  c
2240
- ]), w = g(
2441
+ ]), m = g(
2241
2442
  (y) => {
2242
2443
  y.key === "Escape" && d();
2243
2444
  },
@@ -2245,14 +2446,14 @@ const Ir = ({
2245
2446
  );
2246
2447
  return {
2247
2448
  onFocusLeft: D,
2248
- onFocusRight: m,
2449
+ onFocusRight: w,
2249
2450
  onClickDay: k,
2250
2451
  onClickArrowButton: p,
2251
2452
  onClickCalendarButton: b,
2252
- onKeyDownHandler: w
2453
+ onKeyDownHandler: m
2253
2454
  };
2254
2455
  };
2255
- function Lr({
2456
+ function Tr({
2256
2457
  value: t,
2257
2458
  onValueChange: e,
2258
2459
  autoFocus: n,
@@ -2267,135 +2468,164 @@ function Lr({
2267
2468
  variant: h,
2268
2469
  disabled: u
2269
2470
  }) {
2270
- const {
2271
- startDate: D,
2272
- endDate: m
2273
- } = t || {}, k = J(null), p = J(null), b = er(D, m), {
2274
- dateInFocus: w,
2471
+ const { startDate: D, endDate: w } = t || {}, k = J(null), p = J(null), b = Vn(D, w), {
2472
+ dateInFocus: m,
2275
2473
  setDateInFocus: y,
2276
2474
  isCalendarVisible: M,
2277
- currentPanel: T,
2278
- setCurrentPanel: x
2475
+ currentPanel: A,
2476
+ setCurrentPanel: T
2279
2477
  } = b, {
2280
2478
  showCalendar: N,
2281
2479
  hideCalendar: O,
2282
2480
  inputLeftChangeHandler: Y,
2283
- inputRightChangeHandler: j
2284
- } = tr(D, m, e, b), {
2481
+ inputRightChangeHandler: z
2482
+ } = vn(D, w, e, b), {
2285
2483
  onKeyDownHandler: _,
2286
2484
  onFocusRight: P,
2287
2485
  onFocusLeft: st,
2288
2486
  onClickDay: lt,
2289
2487
  onClickCalendarButton: ct,
2290
2488
  onClickArrowButton: K
2291
- } = nr(D, m, e, k, p, N, O, b);
2292
- Vn(D, m, y, k, p);
2293
- const at = C(() => D && m && et(D, m), [D, m]), ft = C(() => _e(l == null ? void 0 : l.statePerMonth, D, m, w), [l == null ? void 0 : l.statePerMonth, D, m, w]), ut = Yt(M, 300);
2294
- return /* @__PURE__ */ i(I, {
2295
- onKeyDown: _,
2296
- children: /* @__PURE__ */ i(pt, {
2489
+ } = tr(
2490
+ D,
2491
+ w,
2492
+ e,
2493
+ k,
2494
+ p,
2495
+ N,
2496
+ O,
2497
+ b
2498
+ );
2499
+ Fn(
2500
+ D,
2501
+ w,
2502
+ y,
2503
+ k,
2504
+ p
2505
+ );
2506
+ const at = C(
2507
+ () => D && w && et(D, w),
2508
+ [D, w]
2509
+ ), ft = C(
2510
+ () => je(
2511
+ l == null ? void 0 : l.statePerMonth,
2512
+ D,
2513
+ w,
2514
+ m
2515
+ ),
2516
+ [l == null ? void 0 : l.statePerMonth, D, w, m]
2517
+ ), ut = Yt(M, 300);
2518
+ return /* @__PURE__ */ i(I, { onKeyDown: _, children: /* @__PURE__ */ i(
2519
+ pt,
2520
+ {
2297
2521
  arrow: !1,
2298
2522
  lazy: !0,
2299
2523
  disabled: u,
2300
2524
  placement: kt,
2301
2525
  onClickOutside: O,
2302
2526
  visible: M,
2303
- content: ut && /* @__PURE__ */ i(F, {
2304
- onClickDay: lt,
2305
- dateInFocus: w,
2306
- setDateInFocus: y,
2307
- currentPanel: T,
2308
- setCurrentPanel: x,
2309
- minDate: d,
2310
- maxDate: o,
2311
- ...l,
2312
- statePerMonth: ft
2313
- }),
2314
- children: /* @__PURE__ */ i(ue, {
2315
- autoFocusLeft: n,
2316
- onEsc: c,
2317
- onEnter: s,
2318
- onBlur: r,
2319
- disabled: u,
2320
- separatorIcon: be,
2321
- typeLeft: "date",
2322
- typeRight: "date",
2323
- placeholderLeft: "Start date",
2324
- placeholderRight: "End date",
2325
- onChangeLeft: Y,
2326
- onChangeRight: j,
2327
- onClickArrowDown: K,
2328
- onClickCalendar: ct,
2329
- onFocusLeft: st,
2330
- onFocusRight: P,
2331
- onClickLeft: st,
2332
- onClickRight: P,
2333
- inputRefLeft: k,
2334
- inputRefRight: p,
2335
- variant: at ? "error" : h,
2336
- widthLeft: a,
2337
- widthRight: f,
2338
- minLeft: d,
2339
- maxLeft: o,
2340
- minRight: d,
2341
- maxRight: o
2342
- })
2343
- })
2344
- });
2527
+ content: ut && /* @__PURE__ */ i(
2528
+ F,
2529
+ {
2530
+ onClickDay: lt,
2531
+ dateInFocus: m,
2532
+ setDateInFocus: y,
2533
+ currentPanel: A,
2534
+ setCurrentPanel: T,
2535
+ minDate: d,
2536
+ maxDate: o,
2537
+ ...l,
2538
+ statePerMonth: ft
2539
+ }
2540
+ ),
2541
+ children: /* @__PURE__ */ i(
2542
+ ge,
2543
+ {
2544
+ autoFocusLeft: n,
2545
+ onEsc: c,
2546
+ onEnter: s,
2547
+ onBlur: r,
2548
+ disabled: u,
2549
+ separatorIcon: Qt,
2550
+ typeLeft: "date",
2551
+ typeRight: "date",
2552
+ placeholderLeft: "Start date",
2553
+ placeholderRight: "End date",
2554
+ onChangeLeft: Y,
2555
+ onChangeRight: z,
2556
+ onClickArrowDown: K,
2557
+ onClickCalendar: ct,
2558
+ onFocusLeft: st,
2559
+ onFocusRight: P,
2560
+ onClickLeft: st,
2561
+ onClickRight: P,
2562
+ inputRefLeft: k,
2563
+ inputRefRight: p,
2564
+ variant: at ? "error" : h,
2565
+ widthLeft: a,
2566
+ widthRight: f,
2567
+ minLeft: d,
2568
+ maxLeft: o,
2569
+ minRight: d,
2570
+ maxRight: o
2571
+ }
2572
+ )
2573
+ }
2574
+ ) });
2345
2575
  }
2346
2576
  export {
2347
2577
  Lt as Calendar,
2348
- ie as CalendarDay,
2349
- Cr as DateInput,
2350
- Er as DateRangeCalendar,
2351
- Lr as DateRangeDualTextInput,
2352
- xr as DateRangeExclusionCalendar,
2353
- Nr as DateRangeInput,
2354
- Ir as DateTextInput,
2355
- Yr as DateTimeInput,
2578
+ le as CalendarDay,
2579
+ Sr as DateInput,
2580
+ wr as DateRangeCalendar,
2581
+ Tr as DateRangeDualTextInput,
2582
+ kr as DateRangeExclusionCalendar,
2583
+ Mr as DateRangeInput,
2584
+ Er as DateTextInput,
2585
+ Ar as DateTimeInput,
2356
2586
  U as Month,
2357
- yn as MonthPicker,
2358
- Ar as MultiDateCalendar,
2359
- wn as PresetPicker,
2360
- ae as SingleDateCalendar,
2361
- Tr as SingleWeekCalendar,
2362
- Hr as TimeTextInput,
2363
- qe as WeekDay,
2364
- dn as WeekDayCell,
2365
- cn as WeekNumberCell,
2366
- bn as YearPicker,
2587
+ hn as MonthPicker,
2588
+ pr as MultiDateCalendar,
2589
+ yn as PresetPicker,
2590
+ De as SingleDateCalendar,
2591
+ br as SingleWeekCalendar,
2592
+ Rr as TimeTextInput,
2593
+ Ke as WeekDay,
2594
+ cn as WeekDayCell,
2595
+ rn as WeekNumberCell,
2596
+ mn as YearPicker,
2367
2597
  X as addDayStateHighlights,
2368
- se as addDayStateHighlightsOnSingleDay,
2369
- Ke as addWeekRangeHighlights,
2370
- kr as addWeekStateHighlights,
2371
- wt as buildDayStateForDateRange,
2372
- Je as buildDayStateForRange,
2373
- _e as buildDayStateForSingleMonth,
2374
- Fe as calculateOverflowingMonth,
2375
- Xe as createDay,
2376
- Tn as dateRangeToStrings,
2377
- tn as dayHasHighlight,
2598
+ oe as addDayStateHighlightsOnSingleDay,
2599
+ _e as addWeekRangeHighlights,
2600
+ hr as addWeekStateHighlights,
2601
+ mt as buildDayStateForDateRange,
2602
+ ze as buildDayStateForRange,
2603
+ je as buildDayStateForSingleMonth,
2604
+ Xe as calculateOverflowingMonth,
2605
+ qe as createDay,
2606
+ Rn as dateRangeToStrings,
2607
+ ve as dayHasHighlight,
2378
2608
  V as dayHighlightSelect,
2379
2609
  rt as defaultCalendarTheme,
2380
- nn as defaultTextPropsProvider,
2381
- en as defaultWrapperStyleProvider,
2382
- Sr as extranetCalendarTheme,
2383
- Ze as getDaysForWeekForDate,
2384
- ce as getMonthInYear,
2610
+ tn as defaultTextPropsProvider,
2611
+ Ve as defaultWrapperStyleProvider,
2612
+ gr as extranetCalendarTheme,
2613
+ Qe as getDaysForWeekForDate,
2614
+ de as getMonthInYear,
2385
2615
  Kt as getMonthsInYear,
2386
2616
  _t as getWeekForDate,
2387
- Qe as getWeeksForMonth,
2388
- oe as isDateRangeInvalid,
2389
- pr as setDayStateValue,
2390
- br as setDayStateValueFunction,
2391
- xn as stringsToDateRange,
2392
- Mr as toggleDateStringsIfEndIsEarlierThanStart,
2393
- de as toggleDatesIfEndIsEarlierThanStart,
2394
- Rr as useDateRangeCalendarState,
2395
- Un as useDateRangeExclusionSelection,
2396
- Cn as useDateRangeSelection,
2397
- In as useMultiDateSelection,
2398
- Nn as useSingleDateSelection,
2399
- Hn as useSingleWeekSelection
2617
+ Ge as getWeeksForMonth,
2618
+ ae as isDateRangeInvalid,
2619
+ ur as setDayStateValue,
2620
+ Dr as setDayStateValueFunction,
2621
+ An as stringsToDateRange,
2622
+ yr as toggleDateStringsIfEndIsEarlierThanStart,
2623
+ fe as toggleDatesIfEndIsEarlierThanStart,
2624
+ mr as useDateRangeCalendarState,
2625
+ Yn as useDateRangeExclusionSelection,
2626
+ Tn as useDateRangeSelection,
2627
+ Cn as useMultiDateSelection,
2628
+ xn as useSingleDateSelection,
2629
+ Nn as useSingleWeekSelection
2400
2630
  };
2401
2631
  //# sourceMappingURL=index.es.js.map