@stenajs-webui/calendar 18.12.1-next.0 → 18.12.1

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,12 +1,12 @@
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";
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 ge, Column as B, Indent as gt, SeparatorLine as ye, parseIntElseUndefined as Jt, useBoolean as Ht, useDelayedFalse as Yt } from "@stenajs-webui/core";
4
+ import { FlatButton as A, PrimaryButton as dt, stenaAngleLeft as Ot, stenaAngleRight as $t, stenaAngleLeftDouble as me, stenaAngleRightDouble as we, stenaCalendar as yt, Icon as Qt, stenaClock as Xt, stenaAngleDown as pe, stenaArrowRight as be } from "@stenajs-webui/elements";
5
+ 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 mt, 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
6
  import { enGB as zt } from "date-fns/locale";
6
7
  import { last as Ye, startCase as te, chunk as ee, range as jt, debounce as Le, padStart as Ue } from "lodash";
7
8
  import * as ne 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
11
  import { faCaretLeft as We } from "@fortawesome/free-solid-svg-icons/faCaretLeft";
12
12
  import { faCaretRight as Oe } from "@fortawesome/free-solid-svg-icons/faCaretRight";
@@ -154,9 +154,9 @@ const Kt = (t, e, n, r) => {
154
154
  return {
155
155
  weekNumber: Vt(t, { locale: e }),
156
156
  startMonth: tt(t),
157
- startYear: yt(t),
157
+ startYear: mt(t),
158
158
  endMonth: tt(q(t, 6)),
159
- endYear: yt(q(t, 6)),
159
+ endYear: mt(q(t, 6)),
160
160
  days: Ze(t, e),
161
161
  isLastWeekOfMonth: n
162
162
  };
@@ -167,7 +167,7 @@ const Kt = (t, e, n, r) => {
167
167
  name: W(t, "EEE", e ? { locale: e } : void 0),
168
168
  dateString: W(Re(t, 12), Z.fullDate),
169
169
  weekNumber: Vt(t, { locale: e }),
170
- year: yt(t),
170
+ year: mt(t),
171
171
  month: tt(t),
172
172
  dayOfMonth: Ct(t),
173
173
  dayOfWeek: n,
@@ -203,14 +203,56 @@ const Kt = (t, e, n, r) => {
203
203
  borderColor: r = "transparent"
204
204
  }) => (s, c, d, o, l) => {
205
205
  let a = {};
206
- const f = V(c, s, ["selected", "range", "today", d.month === l.monthInYear], [t, n, e, "#fff"], "transparent");
206
+ const f = V(
207
+ c,
208
+ s,
209
+ ["selected", "range", "today", d.month === l.monthInYear],
210
+ [t, n, e, "#fff"],
211
+ "transparent"
212
+ );
207
213
  return {
208
214
  ...a,
209
215
  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),
216
+ borderTopLeftRadius: V(
217
+ c,
218
+ s,
219
+ ["selectedStart", "singleSelected"],
220
+ [
221
+ "var(--swui-calendar-day-border-radius)",
222
+ "var(--swui-calendar-day-border-radius)"
223
+ ],
224
+ r
225
+ ),
226
+ borderBottomLeftRadius: V(
227
+ c,
228
+ s,
229
+ ["selectedStart", "singleSelected"],
230
+ [
231
+ "var(--swui-calendar-day-border-radius)",
232
+ "var(--swui-calendar-day-border-radius)"
233
+ ],
234
+ r
235
+ ),
236
+ borderTopRightRadius: V(
237
+ c,
238
+ s,
239
+ ["selectedEnd", "singleSelected"],
240
+ [
241
+ "var(--swui-calendar-day-border-radius)",
242
+ "var(--swui-calendar-day-border-radius)"
243
+ ],
244
+ r
245
+ ),
246
+ borderBottomRightRadius: V(
247
+ c,
248
+ s,
249
+ ["selectedEnd", "singleSelected"],
250
+ [
251
+ "var(--swui-calendar-day-border-radius)",
252
+ "var(--swui-calendar-day-border-radius)"
253
+ ],
254
+ r
255
+ ),
214
256
  boxSizing: "border-box"
215
257
  };
216
258
  }, nn = ({
@@ -221,7 +263,18 @@ const Kt = (t, e, n, r) => {
221
263
  }) => (s, c, d, o, l) => {
222
264
  const a = d.month !== l.monthInYear;
223
265
  return {
224
- color: V(c, s, [a, "selected", "range", "enabled", "disabled"], [n, t, r, void 0, e])
266
+ color: V(
267
+ c,
268
+ s,
269
+ [a, "selected", "range", "enabled", "disabled"],
270
+ [
271
+ n,
272
+ t,
273
+ r,
274
+ void 0,
275
+ e
276
+ ]
277
+ )
225
278
  };
226
279
  }, rt = {
227
280
  width: "var(--swui-calendar-day-width)",
@@ -263,12 +316,11 @@ const Kt = (t, e, n, r) => {
263
316
  day: c,
264
317
  ...d
265
318
  }) {
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
- });
319
+ const o = C(
320
+ () => rn(c.date, n, r) ? s : se(s, ["disabled"]),
321
+ [c.date, s, r, n]
322
+ );
323
+ return /* @__PURE__ */ i(e, { day: c, ...d, dayState: o });
272
324
  }, cn = ({
273
325
  onClickWeek: t,
274
326
  theme: e,
@@ -277,32 +329,44 @@ const Kt = (t, e, n, r) => {
277
329
  backgroundColor: s,
278
330
  prefix: c
279
331
  }) => {
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
- });
332
+ const d = /* @__PURE__ */ E(
333
+ I,
334
+ {
335
+ width: e.width,
336
+ height: e.height,
337
+ justifyContent: "center",
338
+ alignItems: "center",
339
+ children: [
340
+ r && /* @__PURE__ */ i(I, { position: "absolute", children: r }),
341
+ /* @__PURE__ */ i(I, { position: "absolute", children: /* @__PURE__ */ E(
342
+ it,
343
+ {
344
+ color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
345
+ children: [
346
+ c,
347
+ n.weekNumber
348
+ ]
349
+ }
350
+ ) })
351
+ ]
352
+ }
353
+ );
354
+ return /* @__PURE__ */ i(
355
+ I,
356
+ {
357
+ background: s || e.WeekNumber.backgroundColor,
358
+ position: "relative",
359
+ children: t ? /* @__PURE__ */ i(
360
+ Wt,
361
+ {
362
+ borderRadius: "var(--swui-calendar-day-border-radius)",
363
+ onClick: (o) => t(n, o),
364
+ disableFocusHighlight: !t,
365
+ children: d
366
+ }
367
+ ) : d
368
+ }
369
+ );
306
370
  };
307
371
  function on({
308
372
  week: t,
@@ -319,51 +383,66 @@ function on({
319
383
  extraDayContent: h,
320
384
  defaultHighlights: u
321
385
  }) {
322
- return /* @__PURE__ */ E("tr", {
323
- children: [a.WeekNumber.show && /* @__PURE__ */ i("td", {
324
- children: f ? f(t, a, o) : /* @__PURE__ */ i(cn, {
386
+ return /* @__PURE__ */ E("tr", { children: [
387
+ a.WeekNumber.show && /* @__PURE__ */ i("td", { children: f ? f(t, a, o) : /* @__PURE__ */ i(
388
+ cn,
389
+ {
325
390
  week: t,
326
391
  onClickWeek: o,
327
392
  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);
393
+ }
394
+ ) }),
395
+ t.days.map((D) => /* @__PURE__ */ i(
396
+ sn,
397
+ {
398
+ dayComponent: n,
399
+ day: D,
400
+ week: t,
401
+ month: e,
402
+ dayState: r && r[D.dayOfMonth],
403
+ userData: s && s[D.dayOfMonth],
404
+ onClickDay: l,
405
+ theme: a,
406
+ extraDayContent: h,
407
+ defaultHighlights: u,
408
+ minDate: c,
409
+ maxDate: d
410
+ },
411
+ D.dateString
412
+ ))
413
+ ] }, t.weekNumber);
344
414
  }
345
415
  const dn = ({
346
416
  onClickWeekDay: t,
347
417
  day: e,
348
418
  theme: n
349
419
  }) => {
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;
420
+ const r = /* @__PURE__ */ i(
421
+ I,
422
+ {
423
+ width: n.width,
424
+ height: n.height,
425
+ justifyContent: "center",
426
+ alignItems: "center",
427
+ children: /* @__PURE__ */ i(
428
+ it,
429
+ {
430
+ size: "small",
431
+ color: t ? n.WeekDay.clickableTextColor : n.WeekDay.textColor,
432
+ children: e.name
433
+ }
434
+ )
435
+ }
436
+ );
437
+ return t ? /* @__PURE__ */ i(
438
+ Wt,
439
+ {
440
+ borderRadius: "var(--swui-calendar-day-border-radius)",
441
+ onClick: (s) => t(e.dayOfWeek, s),
442
+ disableFocusHighlight: !t,
443
+ children: r
444
+ }
445
+ ) : r;
367
446
  }, ie = function({
368
447
  day: e,
369
448
  week: n,
@@ -375,54 +454,90 @@ const dn = ({
375
454
  extraDayContent: l,
376
455
  defaultHighlights: a
377
456
  }) {
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)
457
+ const f = /* @__PURE__ */ i(
458
+ I,
459
+ {
460
+ width: "100%",
461
+ height: "100%",
462
+ justifyContent: "center",
463
+ alignItems: "center",
464
+ children: /* @__PURE__ */ i(
465
+ it,
466
+ {
467
+ ...o.CalendarDay.textProps && o.CalendarDay.textProps(
468
+ a,
469
+ s,
470
+ e,
471
+ n,
472
+ r,
473
+ c
474
+ ),
475
+ children: e.dayOfMonth
476
+ }
477
+ )
478
+ }
479
+ ), h = Nt.td({
480
+ ...o.CalendarDay.tdStyle && o.CalendarDay.tdStyle(
481
+ a,
482
+ s,
483
+ e,
484
+ n,
485
+ r,
486
+ c
487
+ )
389
488
  }), u = Nt.div({
390
- ...o.CalendarDay.innerWrapperStyle && o.CalendarDay.innerWrapperStyle(a, s, e, n, r, c),
489
+ ...o.CalendarDay.innerWrapperStyle && o.CalendarDay.innerWrapperStyle(
490
+ a,
491
+ s,
492
+ e,
493
+ n,
494
+ r,
495
+ c
496
+ ),
391
497
  width: "100%",
392
498
  height: "100%"
393
499
  }), D = Nt.div({
394
- ...o.CalendarDay.cellWrapperStyle && o.CalendarDay.cellWrapperStyle(a, s, e, n, r, c),
500
+ ...o.CalendarDay.cellWrapperStyle && o.CalendarDay.cellWrapperStyle(
501
+ a,
502
+ s,
503
+ e,
504
+ n,
505
+ r,
506
+ c
507
+ ),
395
508
  width: "100%",
396
509
  height: "100%",
397
510
  position: "relative"
398
511
  });
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);
512
+ return /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(D, { children: e.month === r.monthInYear && /* @__PURE__ */ E(ht, { children: [
513
+ l && /* @__PURE__ */ i(
514
+ l,
515
+ {
516
+ week: n,
517
+ month: r,
518
+ day: e,
519
+ dayState: s,
520
+ theme: o,
521
+ userData: c
522
+ }
523
+ ),
524
+ d && ln(a, s) ? /* @__PURE__ */ i(
525
+ Wt,
526
+ {
527
+ onClick: (m) => d(e, c, m),
528
+ style: { width: "100%", height: "100%" },
529
+ borderRadius: "var(--swui-calendar-day-border-radius)",
530
+ children: f
531
+ }
532
+ ) : /* @__PURE__ */ i(ht, { children: f })
533
+ ] }) }) }) });
534
+ }, ln = (t, e) => !!V(
535
+ e,
536
+ t,
537
+ ["enabled", "disabled"],
538
+ [!0, !1],
539
+ !0
540
+ );
426
541
  function an({
427
542
  month: t,
428
543
  dayComponent: e = ie,
@@ -444,75 +559,69 @@ function an({
444
559
  defaultHighlights: b
445
560
  }) {
446
561
  const w = k.WeekNumber.show;
447
- return /* @__PURE__ */ i(mt, {
448
- children: /* @__PURE__ */ E(I, {
449
- alignItems: "stretch",
450
- children: [/* @__PURE__ */ E(R, {
562
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ E(I, { alignItems: "stretch", children: [
563
+ /* @__PURE__ */ E(
564
+ R,
565
+ {
451
566
  justifyContent: "space-between",
452
567
  alignItems: "center",
453
568
  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
- });
569
+ children: [
570
+ /* @__PURE__ */ i(I, { alignItems: "center", children: D }),
571
+ /* @__PURE__ */ E(R, { alignItems: "center", children: [
572
+ /* @__PURE__ */ i(R, { width: "104px", justifyContent: "center", children: a ? /* @__PURE__ */ i(
573
+ A,
574
+ {
575
+ onClick: () => a(t),
576
+ label: t.name
577
+ }
578
+ ) : /* @__PURE__ */ i(it, { children: t.name }) }),
579
+ /* @__PURE__ */ i($, {}),
580
+ /* @__PURE__ */ i(R, { width: "64px", justifyContent: "center", children: f ? /* @__PURE__ */ i(
581
+ A,
582
+ {
583
+ onClick: () => f(t.year),
584
+ label: String(t.year)
585
+ }
586
+ ) : /* @__PURE__ */ i(it, { children: t.year }) })
587
+ ] }),
588
+ /* @__PURE__ */ i(I, { alignItems: "center", children: m })
589
+ ]
590
+ }
591
+ ),
592
+ /* @__PURE__ */ i("table", { children: /* @__PURE__ */ E("tbody", { children: [
593
+ /* @__PURE__ */ E("tr", { children: [
594
+ w && /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i(I, { width: k.width, height: k.height }) }),
595
+ t.weeks[0].days.map((y) => /* @__PURE__ */ i("td", { children: u ? u(y.name, k, l) : /* @__PURE__ */ i(
596
+ dn,
597
+ {
598
+ day: y,
599
+ onClickWeekDay: l,
600
+ theme: k
601
+ }
602
+ ) }, y.name))
603
+ ] }),
604
+ t.weeks.map((y) => /* @__PURE__ */ i(
605
+ on,
606
+ {
607
+ month: t,
608
+ week: y,
609
+ dayComponent: e,
610
+ statePerWeekDay: n && n[y.weekNumber],
611
+ userDataPerWeekDay: r && r[y.weekNumber],
612
+ onClickDay: d,
613
+ onClickWeek: o,
614
+ theme: k,
615
+ renderWeekNumber: h,
616
+ extraDayContent: p,
617
+ defaultHighlights: b,
618
+ minDate: s,
619
+ maxDate: c
620
+ },
621
+ y.weekNumber
622
+ ))
623
+ ] }) })
624
+ ] }) });
516
625
  }
517
626
  function fn({
518
627
  monthRows: t,
@@ -534,50 +643,65 @@ function fn({
534
643
  defaultHighlights: p,
535
644
  theme: b = rt
536
645
  }) {
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
- });
646
+ const w = C(
647
+ () => s ? ot(s, "yyyy-MM-dd", new Date()) : void 0,
648
+ [s]
649
+ ), y = C(
650
+ () => c ? ot(c, "yyyy-MM-dd", new Date()) : void 0,
651
+ [c]
652
+ );
653
+ return /* @__PURE__ */ i("div", { className: Ve.calendar, children: t.map((M, T) => /* @__PURE__ */ i(ge, { children: /* @__PURE__ */ i(R, { children: M.map((x, N) => /* @__PURE__ */ E(ne.Fragment, { children: [
654
+ N > 0 && /* @__PURE__ */ i($, {}),
655
+ /* @__PURE__ */ i(
656
+ an,
657
+ {
658
+ month: x,
659
+ dayComponent: e,
660
+ userDataPerWeek: n && n[x.monthString],
661
+ statePerWeek: r && r[x.monthString],
662
+ onClickDay: d,
663
+ onClickWeekDay: o,
664
+ onClickWeek: l,
665
+ onClickMonth: a,
666
+ onClickYear: f,
667
+ theme: b,
668
+ renderWeekNumber: u,
669
+ renderWeekDay: h,
670
+ headerLeftContent: D,
671
+ headerRightContent: m,
672
+ extraDayContent: k,
673
+ defaultHighlights: p,
674
+ minDate: w,
675
+ maxDate: y
676
+ }
677
+ )
678
+ ] }, x.name)) }) }, T)) });
567
679
  }
568
680
  function Lt(t) {
569
681
  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
- });
682
+ const e = un(t.year, t.month, t.date), { year: n, month: r } = Fe(
683
+ e.year,
684
+ e.month
685
+ ), s = Dn(
686
+ n,
687
+ r,
688
+ (d = t.locale) != null ? d : zt,
689
+ t.numMonths,
690
+ t.monthsPerRow
691
+ ), c = Ge(
692
+ t.highlightToday,
693
+ t.statePerMonth
694
+ );
695
+ return /* @__PURE__ */ i(
696
+ fn,
697
+ {
698
+ year: n,
699
+ month: r,
700
+ monthRows: s,
701
+ ...t,
702
+ statePerMonth: c
703
+ }
704
+ );
581
705
  }
582
706
  const un = (t, e, n) => {
583
707
  if (e && t)
@@ -588,12 +712,12 @@ const un = (t, e, n) => {
588
712
  if (n)
589
713
  return {
590
714
  month: tt(n),
591
- year: yt(n)
715
+ year: mt(n)
592
716
  };
593
717
  const r = new Date();
594
718
  return {
595
719
  month: tt(r),
596
- year: yt(r)
720
+ year: mt(r)
597
721
  };
598
722
  }, 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 = ({
599
723
  value: t,
@@ -603,37 +727,40 @@ const un = (t, e, n) => {
603
727
  }) => {
604
728
  const s = C(() => {
605
729
  const c = new Date(2e3, n, 1);
606
- return te(W(c, "MMM", {
607
- locale: r
608
- }));
730
+ return te(W(c, "MMM", { locale: r }));
609
731
  }, [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, {
732
+ return /* @__PURE__ */ i(R, { width: "64px", justifyContent: "center", spacing: 0.5, indent: 0.5, children: t === n ? /* @__PURE__ */ i(
733
+ dt,
734
+ {
616
735
  label: s,
617
736
  onClick: () => e && e(n)
618
- }) : /* @__PURE__ */ i(A, {
737
+ }
738
+ ) : /* @__PURE__ */ i(
739
+ A,
740
+ {
619
741
  label: s,
620
742
  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 = ({
743
+ }
744
+ ) });
745
+ }, gn = [
746
+ [U.JANUARY, U.FEBRUARY, U.MARCH],
747
+ [U.APRIL, U.MAY, U.JUNE],
748
+ [U.JULY, U.AUGUST, U.SEPTEMBER],
749
+ [U.OCTOBER, U.NOVEMBER, U.DECEMBER]
750
+ ], yn = ({
624
751
  value: t,
625
752
  onValueChange: e,
626
753
  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) => [
754
+ }) => /* @__PURE__ */ i(B, { children: gn.map((r) => /* @__PURE__ */ i(R, { children: r.map((s) => /* @__PURE__ */ i(
755
+ hn,
756
+ {
757
+ month: s,
758
+ onValueChange: e,
759
+ value: t,
760
+ locale: n
761
+ },
762
+ s
763
+ )) }, r[0])) }), mn = (t) => [
637
764
  {
638
765
  label: "Past",
639
766
  presets: [
@@ -657,53 +784,55 @@ const un = (t, e, n) => {
657
784
  }) => {
658
785
  var c;
659
786
  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, {
787
+ return /* @__PURE__ */ E(B, { children: [
788
+ /* @__PURE__ */ E(
789
+ R,
790
+ {
791
+ justifyContent: "space-between",
792
+ alignItems: "center",
793
+ width: "200px",
794
+ children: [
795
+ /* @__PURE__ */ i(
796
+ A,
797
+ {
798
+ size: "small",
799
+ leftIcon: Ot,
800
+ disabled: e === 0,
801
+ onClick: () => n(e - 1)
802
+ }
803
+ ),
804
+ /* @__PURE__ */ i(it, { children: s.label }),
805
+ /* @__PURE__ */ i(
806
+ A,
807
+ {
808
+ size: "small",
809
+ leftIcon: $t,
810
+ disabled: e === r.length - 1,
811
+ onClick: () => n(e + 1)
812
+ }
813
+ )
814
+ ]
815
+ }
816
+ ),
817
+ /* @__PURE__ */ i($, {}),
818
+ /* @__PURE__ */ i(B, { alignItems: "center", children: s.presets.map((d) => /* @__PURE__ */ E(ne.Fragment, { children: [
819
+ /* @__PURE__ */ i(
820
+ dt,
821
+ {
682
822
  label: d.label,
683
823
  onClick: () => t(d)
684
- }), /* @__PURE__ */ i($, {})]
685
- }, d.label))
686
- })]
687
- });
824
+ }
825
+ ),
826
+ /* @__PURE__ */ i($, {})
827
+ ] }, d.label)) })
828
+ ] });
688
829
  }, pn = ({
689
830
  value: t,
690
831
  onValueChange: e,
691
832
  year: n
692
833
  }) => {
693
834
  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
- });
835
+ return /* @__PURE__ */ i(R, { width: "64px", justifyContent: "center", spacing: 0.5, indent: 0.5, children: t === n ? /* @__PURE__ */ i(dt, { label: r, onClick: () => e == null ? void 0 : e(n) }) : /* @__PURE__ */ i(A, { label: r, onClick: () => e == null ? void 0 : e(n) }) });
707
836
  }, bn = ({
708
837
  value: t,
709
838
  onValueChange: e,
@@ -715,29 +844,31 @@ const un = (t, e, n) => {
715
844
  }, [r]);
716
845
  return Q(() => {
717
846
  s((d) => kn(t, d));
718
- }, [t]), /* @__PURE__ */ E(R, {
719
- children: [/* @__PURE__ */ i(B, {
720
- justifyContent: "center",
721
- children: /* @__PURE__ */ i(A, {
847
+ }, [t]), /* @__PURE__ */ E(R, { children: [
848
+ /* @__PURE__ */ i(B, { justifyContent: "center", children: /* @__PURE__ */ i(
849
+ A,
850
+ {
722
851
  leftIcon: We,
723
852
  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, {
853
+ }
854
+ ) }),
855
+ /* @__PURE__ */ i(B, { children: c.map((d) => /* @__PURE__ */ i(R, { children: d.map((o) => /* @__PURE__ */ i(
856
+ pn,
857
+ {
858
+ year: o,
859
+ onValueChange: e,
860
+ value: t
861
+ },
862
+ o
863
+ )) }, d[0])) }),
864
+ /* @__PURE__ */ i(B, { justifyContent: "center", children: /* @__PURE__ */ i(
865
+ A,
866
+ {
736
867
  leftIcon: Oe,
737
868
  onClick: () => s(r + 3)
738
- })
739
- })]
740
- });
869
+ }
870
+ ) })
871
+ ] });
741
872
  }, kn = (t, e) => {
742
873
  if (t == null)
743
874
  return e;
@@ -759,51 +890,63 @@ const un = (t, e, n) => {
759
890
  setCurrentPanel: c,
760
891
  ...d
761
892
  }) {
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(() => {
893
+ const o = g(
894
+ (h) => {
895
+ const u = n ? new Date(n) : new Date();
896
+ u.setMonth(h), r && r(u), c("calendar");
897
+ },
898
+ [n, r, c]
899
+ ), l = g(
900
+ (h) => {
901
+ const u = n ? new Date(n) : new Date();
902
+ u.setFullYear(h), r && r(u), c("calendar");
903
+ },
904
+ [n, r, c]
905
+ ), a = g(() => {
769
906
  c("year");
770
907
  }, [c]), f = g(() => {
771
908
  c("month");
772
909
  }, [c]);
773
910
  switch (s) {
774
911
  case "calendar":
775
- return /* @__PURE__ */ i(mt, {
776
- children: /* @__PURE__ */ i(Lt, {
912
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ i(
913
+ Lt,
914
+ {
777
915
  ...d,
778
916
  date: n,
779
917
  onClickYear: a,
780
918
  onClickMonth: f,
781
919
  locale: e
782
- })
783
- });
920
+ }
921
+ ) });
784
922
  case "month":
785
- return /* @__PURE__ */ i(yn, {
786
- value: n.getMonth(),
787
- onValueChange: o,
788
- locale: e
789
- });
923
+ return /* @__PURE__ */ i(
924
+ yn,
925
+ {
926
+ value: n.getMonth(),
927
+ onValueChange: o,
928
+ locale: e
929
+ }
930
+ );
790
931
  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: () => {
932
+ return /* @__PURE__ */ i(
933
+ bn,
934
+ {
935
+ value: n.getFullYear(),
936
+ onValueChange: l
798
937
  }
799
- });
938
+ );
939
+ case "presets":
940
+ return /* @__PURE__ */ i(wn, { onClickPreset: () => {
941
+ } });
800
942
  default:
801
- return /* @__PURE__ */ i(I, {
802
- children: /* @__PURE__ */ i(dt, {
943
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ i(
944
+ dt,
945
+ {
803
946
  label: "Show calendar",
804
947
  onClick: () => c("calendar")
805
- })
806
- });
948
+ }
949
+ ) });
807
950
  }
808
951
  }, Mn = (t, e, n, r) => {
809
952
  const s = g(() => {
@@ -833,27 +976,19 @@ const un = (t, e, n) => {
833
976
  nextMonth: n,
834
977
  prevYear: r,
835
978
  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 = () => {
979
+ }) => /* @__PURE__ */ E("div", { children: [
980
+ t,
981
+ /* @__PURE__ */ i(gt, { children: /* @__PURE__ */ E(R, { children: [
982
+ /* @__PURE__ */ i(A, { onClick: r, leftIcon: $e }),
983
+ /* @__PURE__ */ i($, {}),
984
+ /* @__PURE__ */ i(A, { onClick: e, leftIcon: Ot }),
985
+ /* @__PURE__ */ i(gt, { num: 2 }),
986
+ /* @__PURE__ */ i(A, { onClick: n, leftIcon: $t }),
987
+ /* @__PURE__ */ i($, {}),
988
+ /* @__PURE__ */ i(A, { onClick: s, leftIcon: Pe })
989
+ ] }) }),
990
+ /* @__PURE__ */ i($, {})
991
+ ] }), Rn = () => {
857
992
  };
858
993
  function F({
859
994
  monthSwitcherPlacement: t,
@@ -866,29 +1001,32 @@ function F({
866
1001
  hideYearPagination: o = !1,
867
1002
  ...l
868
1003
  }) {
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)) {
1004
+ const { nextMonth: a, prevMonth: f, nextYear: h, prevYear: u } = Mn(
1005
+ n,
1006
+ r,
1007
+ l.monthsPerRow,
1008
+ l.numMonths
1009
+ );
1010
+ switch (An(
1011
+ t,
1012
+ l.numMonths
1013
+ )) {
876
1014
  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,
1015
+ return /* @__PURE__ */ i(
1016
+ En,
1017
+ {
885
1018
  theme: e,
886
- date: n
887
- })
888
- });
1019
+ nextMonth: a,
1020
+ prevMonth: f,
1021
+ nextYear: h,
1022
+ prevYear: u,
1023
+ children: /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n })
1024
+ }
1025
+ );
889
1026
  case "header":
890
- return /* @__PURE__ */ i(B, {
891
- children: /* @__PURE__ */ i(Sn, {
1027
+ return /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(
1028
+ Sn,
1029
+ {
892
1030
  ...l,
893
1031
  theme: e,
894
1032
  dateInFocus: n,
@@ -896,38 +1034,48 @@ function F({
896
1034
  currentPanel: s,
897
1035
  setCurrentPanel: c,
898
1036
  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
- });
1037
+ headerLeftContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1038
+ !o && /* @__PURE__ */ i(
1039
+ A,
1040
+ {
1041
+ size: "small",
1042
+ onClick: u,
1043
+ leftIcon: me
1044
+ }
1045
+ ),
1046
+ /* @__PURE__ */ i($, {}),
1047
+ /* @__PURE__ */ i(
1048
+ A,
1049
+ {
1050
+ size: "small",
1051
+ onClick: f,
1052
+ leftIcon: Ot
1053
+ }
1054
+ )
1055
+ ] }),
1056
+ headerRightContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1057
+ /* @__PURE__ */ i(
1058
+ A,
1059
+ {
1060
+ size: "small",
1061
+ onClick: a,
1062
+ leftIcon: $t
1063
+ }
1064
+ ),
1065
+ /* @__PURE__ */ i($, {}),
1066
+ !o && /* @__PURE__ */ i(
1067
+ A,
1068
+ {
1069
+ size: "small",
1070
+ onClick: h,
1071
+ leftIcon: we
1072
+ }
1073
+ )
1074
+ ] })
1075
+ }
1076
+ ) });
925
1077
  default:
926
- return /* @__PURE__ */ i(Lt, {
927
- ...l,
928
- theme: e,
929
- date: n
930
- });
1078
+ return /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n });
931
1079
  }
932
1080
  }
933
1081
  const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
@@ -968,9 +1116,12 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
968
1116
  t == null ? void 0 : t.startDate
969
1117
  ]
970
1118
  ), bt = (t) => {
971
- const [e, n] = S("calendar"), r = g((s) => {
972
- n(s), t == null || t(s);
973
- }, [t]);
1119
+ const [e, n] = S("calendar"), r = g(
1120
+ (s) => {
1121
+ n(s), t == null || t(s);
1122
+ },
1123
+ [t]
1124
+ );
974
1125
  return {
975
1126
  currentPanel: e,
976
1127
  setCurrentPanel: r
@@ -1010,10 +1161,7 @@ const An = (t, e) => t || (e || 1) > 1 ? "below" : "header", Tn = (t) => ({
1010
1161
  };
1011
1162
  function Er(t) {
1012
1163
  const e = Cn(t);
1013
- return /* @__PURE__ */ i(F, {
1014
- ...t,
1015
- ...e
1016
- });
1164
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1017
1165
  }
1018
1166
  const Rr = () => {
1019
1167
  const [t, e] = S(), [n, r] = S(), [s, c] = S("startDate");
@@ -1055,10 +1203,7 @@ const Rr = () => {
1055
1203
  };
1056
1204
  function ae(t) {
1057
1205
  const e = Nn(t);
1058
- return /* @__PURE__ */ i(F, {
1059
- ...t,
1060
- ...e
1061
- });
1206
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1062
1207
  }
1063
1208
  const In = ({
1064
1209
  onChange: t,
@@ -1089,10 +1234,7 @@ const In = ({
1089
1234
  };
1090
1235
  function Ar(t) {
1091
1236
  const e = In(t);
1092
- return /* @__PURE__ */ i(F, {
1093
- ...t,
1094
- ...e
1095
- });
1237
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1096
1238
  }
1097
1239
  const Hn = ({
1098
1240
  onChange: t,
@@ -1144,10 +1286,7 @@ const Hn = ({
1144
1286
  };
1145
1287
  function Tr(t) {
1146
1288
  const e = Hn(t);
1147
- return /* @__PURE__ */ i(F, {
1148
- ...t,
1149
- ...e
1150
- });
1289
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1151
1290
  }
1152
1291
  const Yn = (t, e) => t.filter((n) => !z(n, e)), Ln = (t, e) => !!t.find((n) => z(n, e)), Un = ({
1153
1292
  value: t,
@@ -1194,10 +1333,7 @@ const Yn = (t, e) => t.filter((n) => !z(n, e)), Ln = (t, e) => !!t.find((n) => z
1194
1333
  }, Wn = (t, e) => e ? e.reduce((n, r) => X(n, r, ["selected"]), t) : t;
1195
1334
  function xr(t) {
1196
1335
  const e = Un(t);
1197
- return /* @__PURE__ */ i(F, {
1198
- ...t,
1199
- ...e
1200
- });
1336
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1201
1337
  }
1202
1338
  const kt = "bottom", fe = () => {
1203
1339
  const [t, e] = ze();
@@ -1211,9 +1347,12 @@ const kt = "bottom", fe = () => {
1211
1347
  }, On = (t, e, n) => {
1212
1348
  const [r, s] = S(n || !1), c = g(() => (s(!0), !0), [s]), d = g(() => {
1213
1349
  s(!1), e && e();
1214
- }, [s, e]), o = g((l) => {
1215
- t && t(l), setTimeout(d, 150);
1216
- }, [t, d]);
1350
+ }, [s, e]), o = g(
1351
+ (l) => {
1352
+ t && t(l), setTimeout(d, 150);
1353
+ },
1354
+ [t, d]
1355
+ );
1217
1356
  return {
1218
1357
  showCalendar: c,
1219
1358
  hideCalendar: d,
@@ -1237,18 +1376,10 @@ const kt = "bottom", fe = () => {
1237
1376
  maxDate: D = St,
1238
1377
  disabled: m
1239
1378
  }) => {
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, {
1379
+ const { hideCalendar: k, showingCalendar: p, onSelectDate: b, showCalendar: w } = On(l, o, d), { tippyRef: y, onChangePanel: M } = fe();
1380
+ return /* @__PURE__ */ i(I, { width: h, children: /* @__PURE__ */ i(
1381
+ pt,
1382
+ {
1252
1383
  arrow: !1,
1253
1384
  lazy: !0,
1254
1385
  visible: p,
@@ -1258,51 +1389,63 @@ const kt = "bottom", fe = () => {
1258
1389
  appendTo: a != null ? a : "parent",
1259
1390
  tippyRef: y,
1260
1391
  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
- });
1392
+ content: /* @__PURE__ */ i(
1393
+ ae,
1394
+ {
1395
+ ...c,
1396
+ onChange: b,
1397
+ value: n,
1398
+ theme: s,
1399
+ onChangePanel: M,
1400
+ minDate: u,
1401
+ maxDate: D
1402
+ }
1403
+ ),
1404
+ children: /* @__PURE__ */ i(
1405
+ nt,
1406
+ {
1407
+ type: "date",
1408
+ contentRight: /* @__PURE__ */ i(R, { alignItems: "center", children: /* @__PURE__ */ i(
1409
+ A,
1410
+ {
1411
+ size: "small",
1412
+ disabled: m,
1413
+ leftIcon: yt,
1414
+ onClick: w
1415
+ }
1416
+ ) }),
1417
+ onFocus: w,
1418
+ onClickRight: w,
1419
+ value: n ? W(n, t) : "",
1420
+ placeholder: e,
1421
+ size: 9,
1422
+ disabled: m,
1423
+ autoFocus: d,
1424
+ variant: f,
1425
+ min: u,
1426
+ max: D
1427
+ }
1428
+ )
1429
+ }
1430
+ ) });
1294
1431
  }, $n = (t, e) => {
1295
1432
  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
1433
  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]);
1434
+ }, [c]), h = g(
1435
+ (D) => {
1436
+ d === "startDate" ? (e == null || e({
1437
+ startDate: D.date,
1438
+ endDate: t == null ? void 0 : t.endDate
1439
+ }), t != null && t.endDate ? setTimeout(f, 150) : (o("endDate"), r.current && r.current.focus())) : d === "endDate" && (e == null || e({
1440
+ startDate: t == null ? void 0 : t.startDate,
1441
+ endDate: D.date
1442
+ }), t != null && t.startDate ? setTimeout(f, 150) : (o("startDate"), n.current && n.current.focus()));
1443
+ },
1444
+ [d, e, o, f, t]
1445
+ ), u = C(
1446
+ () => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && et(t.startDate, t.endDate),
1447
+ [t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]
1448
+ );
1306
1449
  return {
1307
1450
  showingCalendar: s,
1308
1451
  hideCalendar: f,
@@ -1341,60 +1484,83 @@ function Nr({
1341
1484
  endDateInputRef: T,
1342
1485
  onClickDay: x,
1343
1486
  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
- });
1487
+ } = $n(s, c), [O, Y] = S(
1488
+ () => {
1489
+ var _;
1490
+ return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
1491
+ }
1492
+ ), j = C(
1493
+ () => wt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
1494
+ [s]
1495
+ );
1496
+ return /* @__PURE__ */ i(
1497
+ pt,
1498
+ {
1499
+ arrow: !1,
1500
+ lazy: !0,
1501
+ disabled: u,
1502
+ visible: w,
1503
+ zIndex: d,
1504
+ placement: kt,
1505
+ appendTo: r != null ? r : "parent",
1506
+ onClickOutside: k,
1507
+ content: /* @__PURE__ */ i(
1508
+ F,
1509
+ {
1510
+ ...a,
1511
+ dateInFocus: O,
1512
+ setDateInFocus: Y,
1513
+ statePerMonth: j,
1514
+ theme: l,
1515
+ onClickDay: x,
1516
+ currentPanel: D,
1517
+ setCurrentPanel: m,
1518
+ minDate: f,
1519
+ maxDate: h
1520
+ }
1521
+ ),
1522
+ children: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1523
+ /* @__PURE__ */ i(
1524
+ nt,
1525
+ {
1526
+ iconLeft: yt,
1527
+ onFocus: b,
1528
+ value: s != null && s.startDate ? W(s.startDate, t) : "",
1529
+ placeholder: e,
1530
+ width: o,
1531
+ disabled: u,
1532
+ inputRef: M,
1533
+ size: 9,
1534
+ variant: N ? "error" : void 0
1535
+ }
1536
+ ),
1537
+ /* @__PURE__ */ i($, {}),
1538
+ /* @__PURE__ */ i(
1539
+ Qt,
1540
+ {
1541
+ icon: je,
1542
+ color: re("--lhds-color-ui-500"),
1543
+ size: 14
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ i($, {}),
1547
+ /* @__PURE__ */ i(
1548
+ nt,
1549
+ {
1550
+ iconLeft: yt,
1551
+ onFocus: p,
1552
+ value: s != null && s.endDate ? W(s.endDate, t) : "",
1553
+ placeholder: n,
1554
+ width: o,
1555
+ disabled: u,
1556
+ inputRef: T,
1557
+ size: 9,
1558
+ variant: N ? "error" : void 0
1559
+ }
1560
+ )
1561
+ ] })
1562
+ }
1563
+ );
1398
1564
  }
1399
1565
  const Ir = ({
1400
1566
  calendarProps: t,
@@ -1414,21 +1580,24 @@ const Ir = ({
1414
1580
  variant: m,
1415
1581
  ...k
1416
1582
  }) => {
1417
- const [p, b] = S(!1), {
1418
- tippyRef: w,
1419
- onChangePanel: y
1420
- } = fe(), M = g(() => {
1583
+ const [p, b] = S(!1), { tippyRef: w, onChangePanel: y } = fe(), M = g(() => {
1421
1584
  b(!p);
1422
1585
  }, [b, p]), T = g(() => {
1423
1586
  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, {
1587
+ }, [b]), x = g(
1588
+ (P) => {
1589
+ s && s(P);
1590
+ },
1591
+ [s]
1592
+ ), N = g(
1593
+ (P) => {
1594
+ P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
1595
+ },
1596
+ [x, n, e, b, p]
1597
+ ), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && He(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
1598
+ return /* @__PURE__ */ i(I, { width: l, children: /* @__PURE__ */ i(
1599
+ pt,
1600
+ {
1432
1601
  arrow: !1,
1433
1602
  lazy: !0,
1434
1603
  visible: p,
@@ -1437,38 +1606,43 @@ const Ir = ({
1437
1606
  placement: kt,
1438
1607
  onClickOutside: T,
1439
1608
  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
- });
1609
+ content: /* @__PURE__ */ i(
1610
+ ae,
1611
+ {
1612
+ ...t,
1613
+ onChange: N,
1614
+ onChangePanel: y,
1615
+ value: o && Y ? ot(o, n, new Date()) : void 0,
1616
+ minDate: u,
1617
+ maxDate: D,
1618
+ theme: f
1619
+ }
1620
+ ),
1621
+ children: /* @__PURE__ */ i(
1622
+ nt,
1623
+ {
1624
+ ...k,
1625
+ variant: _ ? "error" : m,
1626
+ disableContentPaddingRight: !0,
1627
+ contentRight: h ? void 0 : /* @__PURE__ */ i(R, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ i(
1628
+ A,
1629
+ {
1630
+ size: "small",
1631
+ disabled: k.disabled || r,
1632
+ leftIcon: yt,
1633
+ onClick: M
1634
+ }
1635
+ ) }),
1636
+ onValueChange: x,
1637
+ placeholder: c,
1638
+ value: o || "",
1639
+ min: u,
1640
+ max: D,
1641
+ size: 10
1642
+ }
1643
+ )
1644
+ }
1645
+ ) });
1472
1646
  }, Tt = (t) => {
1473
1647
  if (t === "")
1474
1648
  return "00";
@@ -1549,21 +1723,27 @@ const Ir = ({
1549
1723
  const u = Pn(r);
1550
1724
  l(u.success), u.success && t && t(u.time);
1551
1725
  }
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
- });
1726
+ }, [r, t, l]), h = g(
1727
+ (u) => {
1728
+ const D = u.target.value, m = Ut(D);
1729
+ l(m && D.length <= a.length), t && t(D);
1730
+ },
1731
+ [t, l]
1732
+ );
1733
+ return /* @__PURE__ */ i(
1734
+ nt,
1735
+ {
1736
+ ...d,
1737
+ type: "time",
1738
+ variant: o ? c : "error",
1739
+ iconLeft: n ? Xt : void 0,
1740
+ value: r,
1741
+ placeholder: e ? a : void 0,
1742
+ onChange: h,
1743
+ onBlur: f,
1744
+ width: s
1745
+ }
1746
+ );
1567
1747
  }, ue = ({
1568
1748
  autoFocusLeft: t,
1569
1749
  autoFocusRight: e,
@@ -1603,103 +1783,117 @@ const Ir = ({
1603
1783
  widthRight: ut,
1604
1784
  disabled: v
1605
1785
  }) => {
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, {
1786
+ const L = J(0), H = C(
1787
+ () => Le((G) => {
1788
+ G === 0 && (K == null || K());
1789
+ }, 10),
1790
+ [K]
1791
+ ), Mt = g(
1792
+ (G) => {
1793
+ L.current++, H(L.current), Y && Y(G);
1794
+ },
1795
+ [Y, L, H]
1796
+ ), Et = g(
1797
+ (G) => {
1798
+ L.current++, H(L.current), j && j(G);
1799
+ },
1800
+ [j, L, H]
1801
+ ), Rt = g(
1802
+ (G) => {
1803
+ L.current--, H(L.current), N && N(G);
1804
+ },
1805
+ [N, L, H]
1806
+ ), he = g(
1807
+ (G) => {
1808
+ L.current--, H(L.current), O && O(G);
1809
+ },
1810
+ [O, L, H]
1811
+ );
1812
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ E(
1813
+ Be,
1814
+ {
1619
1815
  disableContentPaddingRight: !0,
1620
1816
  disabled: v,
1621
1817
  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,
1818
+ contentRight: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1819
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1820
+ A,
1821
+ {
1822
+ leftIcon: yt,
1628
1823
  onClick: T,
1629
1824
  disabled: v,
1630
1825
  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, {
1826
+ }
1827
+ ) }),
1828
+ at ? /* @__PURE__ */ E(ht, { children: [
1829
+ /* @__PURE__ */ i(R, { height: "22px", children: /* @__PURE__ */ i(ye, { vertical: !0 }) }),
1830
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1831
+ A,
1832
+ {
1641
1833
  leftIcon: pe,
1642
1834
  onClick: x,
1643
1835
  disabled: v,
1644
1836
  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
- });
1837
+ }
1838
+ ) })
1839
+ ] }) : null
1840
+ ] }),
1841
+ children: [
1842
+ /* @__PURE__ */ i(I, { width: ft, children: /* @__PURE__ */ i(
1843
+ nt,
1844
+ {
1845
+ onEsc: n,
1846
+ onEnter: r,
1847
+ onClick: y,
1848
+ disabled: v,
1849
+ hideBorder: !0,
1850
+ placeholder: o,
1851
+ value: D,
1852
+ onValueChange: s,
1853
+ onChange: h,
1854
+ onBlur: Rt,
1855
+ onFocus: Mt,
1856
+ inputRef: _,
1857
+ variant: lt,
1858
+ type: a,
1859
+ autoFocus: t,
1860
+ min: k,
1861
+ max: p
1862
+ }
1863
+ ) }),
1864
+ /* @__PURE__ */ i(R, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ i(
1865
+ Qt,
1866
+ {
1867
+ icon: d,
1868
+ size: 12,
1869
+ color: re("--lhds-color-ui-500")
1870
+ }
1871
+ ) }),
1872
+ /* @__PURE__ */ i(I, { width: ut, children: /* @__PURE__ */ i(
1873
+ nt,
1874
+ {
1875
+ onEsc: n,
1876
+ onEnter: r,
1877
+ onClick: M,
1878
+ disabled: v,
1879
+ hideBorder: !0,
1880
+ placeholder: l,
1881
+ value: m,
1882
+ onValueChange: c,
1883
+ onChange: u,
1884
+ onBlur: he,
1885
+ onFocus: Et,
1886
+ inputRef: P,
1887
+ variant: ct,
1888
+ type: f,
1889
+ autoFocus: e,
1890
+ min: b,
1891
+ max: w
1892
+ }
1893
+ ) })
1894
+ ]
1895
+ }
1896
+ ) });
1703
1897
  }, Bn = (t) => {
1704
1898
  if (t == null)
1705
1899
  throw new Error("Time is not set.");
@@ -1753,25 +1947,37 @@ const Ir = ({
1753
1947
  canScrollRef: s
1754
1948
  }) => {
1755
1949
  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;
1950
+ return Q(
1951
+ function() {
1952
+ if (n && r.current && c.current && s.current) {
1953
+ const o = c.current.scrollHeight * Math.max(e - 2, 0);
1954
+ r.current.scrollTo(0, o), s.current = !1;
1955
+ }
1956
+ },
1957
+ [r, e, n, s]
1958
+ ), /* @__PURE__ */ i(
1959
+ R,
1960
+ {
1961
+ width: "64px",
1962
+ justifyContent: "center",
1963
+ spacing: 0.5,
1964
+ indent: 0.5,
1965
+ ref: c,
1966
+ children: n ? /* @__PURE__ */ i(
1967
+ dt,
1968
+ {
1969
+ label: Ue(String(e), 2, "0"),
1970
+ onClick: () => t && t(e)
1971
+ }
1972
+ ) : /* @__PURE__ */ i(
1973
+ A,
1974
+ {
1975
+ label: String(e).padStart(2, "0"),
1976
+ onClick: () => t && t(e)
1977
+ }
1978
+ )
1760
1979
  }
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
- });
1980
+ );
1775
1981
  }, qt = ({
1776
1982
  onClick: t,
1777
1983
  items: e,
@@ -1779,17 +1985,17 @@ const Ir = ({
1779
1985
  canScrollRef: r
1780
1986
  }) => {
1781
1987
  const s = J(null);
1782
- return /* @__PURE__ */ i(B, {
1783
- className: De.timePickerColumn,
1784
- ref: s,
1785
- children: e.map((c) => /* @__PURE__ */ i(Kn, {
1988
+ return /* @__PURE__ */ i(B, { className: De.timePickerColumn, ref: s, children: e.map((c) => /* @__PURE__ */ i(
1989
+ Kn,
1990
+ {
1786
1991
  item: c,
1787
1992
  onClick: t,
1788
1993
  selected: c === n,
1789
1994
  columnRef: s,
1790
1995
  canScrollRef: r
1791
- }, c))
1792
- });
1996
+ },
1997
+ c
1998
+ )) });
1793
1999
  }, Gn = jt(0, 24), qn = jt(0, 60), Qn = ({
1794
2000
  value: t,
1795
2001
  onValueChange: e
@@ -1797,32 +2003,46 @@ const Ir = ({
1797
2003
  const n = J(!0), [r, s] = S(void 0), [c, d] = S(void 0);
1798
2004
  Q(() => {
1799
2005
  if (t) {
1800
- const {
1801
- minute: a,
1802
- hour: f
1803
- } = At(t);
2006
+ const { minute: a, hour: f } = At(t);
1804
2007
  s(f), d(a);
1805
2008
  }
1806
2009
  }, [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
- });
2010
+ const o = g(
2011
+ (a) => {
2012
+ s(a), e == null || e(
2013
+ `${Tt(String(a != null ? a : 0))}:${xt(String(c != null ? c : 0))}`
2014
+ );
2015
+ },
2016
+ [c, e]
2017
+ ), l = g(
2018
+ (a) => {
2019
+ d(a), e == null || e(
2020
+ `${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`
2021
+ );
2022
+ },
2023
+ [r, e]
2024
+ );
2025
+ return /* @__PURE__ */ E(R, { className: De.timePicker, children: [
2026
+ /* @__PURE__ */ i(
2027
+ qt,
2028
+ {
2029
+ items: Gn,
2030
+ onClick: o,
2031
+ selectedItem: r,
2032
+ canScrollRef: n
2033
+ }
2034
+ ),
2035
+ /* @__PURE__ */ i(gt, {}),
2036
+ /* @__PURE__ */ i(
2037
+ qt,
2038
+ {
2039
+ items: qn,
2040
+ onClick: l,
2041
+ selectedItem: c,
2042
+ canScrollRef: n
2043
+ }
2044
+ )
2045
+ ] });
1826
2046
  }, Xn = (t, e, n) => {
1827
2047
  Q(
1828
2048
  function() {
@@ -1999,25 +2219,38 @@ const Ir = ({
1999
2219
  onClickDay: at,
2000
2220
  onClickCalendarButton: ft,
2001
2221
  onClickArrowButton: ut
2002
- } = vn(st, u, O, Y, m);
2222
+ } = vn(
2223
+ st,
2224
+ u,
2225
+ O,
2226
+ Y,
2227
+ m
2228
+ );
2003
2229
  Xn(t, y, u);
2004
2230
  const v = C(() => {
2005
2231
  const Rt = t || N;
2006
- return Rt ? X(void 0, Rt, ["singleSelected", "selected"]) : {};
2232
+ return Rt ? X(void 0, Rt, [
2233
+ "singleSelected",
2234
+ "selected"
2235
+ ]) : {};
2007
2236
  }, [N, t]), L = g(() => {
2008
2237
  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, {
2238
+ }, [Y, T]), H = C(
2239
+ () => t ? jn(t) : x,
2240
+ [t, x]
2241
+ ), Mt = Yt(b, 300), Et = Yt(M, 300);
2242
+ return /* @__PURE__ */ i(I, { onKeyDown: lt, children: /* @__PURE__ */ i(
2243
+ pt,
2244
+ {
2013
2245
  arrow: !1,
2014
2246
  lazy: !0,
2015
2247
  disabled: h,
2016
2248
  placement: kt,
2017
2249
  visible: b || M,
2018
2250
  onClickOutside: L,
2019
- content: (Mt || Et) && /* @__PURE__ */ i(B, {
2020
- children: Mt ? /* @__PURE__ */ i(F, {
2251
+ content: (Mt || Et) && /* @__PURE__ */ i(B, { children: Mt ? /* @__PURE__ */ i(
2252
+ F,
2253
+ {
2021
2254
  statePerMonth: v,
2022
2255
  onClickDay: at,
2023
2256
  dateInFocus: w,
@@ -2026,53 +2259,51 @@ const Ir = ({
2026
2259
  setCurrentPanel: k,
2027
2260
  minDate: d,
2028
2261
  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
- });
2262
+ }
2263
+ ) : Et ? /* @__PURE__ */ E(B, { children: [
2264
+ /* @__PURE__ */ i(B, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ i(
2265
+ Qn,
2266
+ {
2267
+ value: H != null ? H : "",
2268
+ onValueChange: P
2269
+ }
2270
+ ) }),
2271
+ /* @__PURE__ */ i($, {}),
2272
+ /* @__PURE__ */ i(R, { justifyContent: "flex-end", children: /* @__PURE__ */ i(dt, { label: "Done", onClick: T }) })
2273
+ ] }) : null }),
2274
+ children: /* @__PURE__ */ i(
2275
+ ue,
2276
+ {
2277
+ autoFocusLeft: c,
2278
+ onEsc: r,
2279
+ onEnter: n,
2280
+ onBlur: s,
2281
+ disabled: h,
2282
+ separatorIcon: Xt,
2283
+ typeLeft: "date",
2284
+ typeRight: "time",
2285
+ placeholderLeft: "yyyy-mm-dd",
2286
+ placeholderRight: "hh:mm",
2287
+ onChangeLeft: j,
2288
+ onChangeRight: _,
2289
+ onClickArrowDown: ut,
2290
+ onClickCalendar: ft,
2291
+ onFocusLeft: K,
2292
+ onFocusRight: ct,
2293
+ onClickLeft: K,
2294
+ onClickRight: ct,
2295
+ inputRefLeft: u,
2296
+ inputRefRight: D,
2297
+ valueRight: H != null ? H : "",
2298
+ widthLeft: o,
2299
+ widthRight: l,
2300
+ minLeft: d,
2301
+ maxLeft: a,
2302
+ variant: f
2303
+ }
2304
+ )
2305
+ }
2306
+ ) });
2076
2307
  }, Vn = (t, e, n, r, s) => {
2077
2308
  Q(
2078
2309
  function() {
@@ -2267,10 +2498,7 @@ function Lr({
2267
2498
  variant: h,
2268
2499
  disabled: u
2269
2500
  }) {
2270
- const {
2271
- startDate: D,
2272
- endDate: m
2273
- } = t || {}, k = J(null), p = J(null), b = er(D, m), {
2501
+ const { startDate: D, endDate: m } = t || {}, k = J(null), p = J(null), b = er(D, m), {
2274
2502
  dateInFocus: w,
2275
2503
  setDateInFocus: y,
2276
2504
  isCalendarVisible: M,
@@ -2288,60 +2516,92 @@ function Lr({
2288
2516
  onClickDay: lt,
2289
2517
  onClickCalendarButton: ct,
2290
2518
  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, {
2519
+ } = nr(
2520
+ D,
2521
+ m,
2522
+ e,
2523
+ k,
2524
+ p,
2525
+ N,
2526
+ O,
2527
+ b
2528
+ );
2529
+ Vn(
2530
+ D,
2531
+ m,
2532
+ y,
2533
+ k,
2534
+ p
2535
+ );
2536
+ const at = C(
2537
+ () => D && m && et(D, m),
2538
+ [D, m]
2539
+ ), ft = C(
2540
+ () => _e(
2541
+ l == null ? void 0 : l.statePerMonth,
2542
+ D,
2543
+ m,
2544
+ w
2545
+ ),
2546
+ [l == null ? void 0 : l.statePerMonth, D, m, w]
2547
+ ), ut = Yt(M, 300);
2548
+ return /* @__PURE__ */ i(I, { onKeyDown: _, children: /* @__PURE__ */ i(
2549
+ pt,
2550
+ {
2297
2551
  arrow: !1,
2298
2552
  lazy: !0,
2299
2553
  disabled: u,
2300
2554
  placement: kt,
2301
2555
  onClickOutside: O,
2302
2556
  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
- });
2557
+ content: ut && /* @__PURE__ */ i(
2558
+ F,
2559
+ {
2560
+ onClickDay: lt,
2561
+ dateInFocus: w,
2562
+ setDateInFocus: y,
2563
+ currentPanel: T,
2564
+ setCurrentPanel: x,
2565
+ minDate: d,
2566
+ maxDate: o,
2567
+ ...l,
2568
+ statePerMonth: ft
2569
+ }
2570
+ ),
2571
+ children: /* @__PURE__ */ i(
2572
+ ue,
2573
+ {
2574
+ autoFocusLeft: n,
2575
+ onEsc: c,
2576
+ onEnter: s,
2577
+ onBlur: r,
2578
+ disabled: u,
2579
+ separatorIcon: be,
2580
+ typeLeft: "date",
2581
+ typeRight: "date",
2582
+ placeholderLeft: "Start date",
2583
+ placeholderRight: "End date",
2584
+ onChangeLeft: Y,
2585
+ onChangeRight: j,
2586
+ onClickArrowDown: K,
2587
+ onClickCalendar: ct,
2588
+ onFocusLeft: st,
2589
+ onFocusRight: P,
2590
+ onClickLeft: st,
2591
+ onClickRight: P,
2592
+ inputRefLeft: k,
2593
+ inputRefRight: p,
2594
+ variant: at ? "error" : h,
2595
+ widthLeft: a,
2596
+ widthRight: f,
2597
+ minLeft: d,
2598
+ maxLeft: o,
2599
+ minRight: d,
2600
+ maxRight: o
2601
+ }
2602
+ )
2603
+ }
2604
+ ) });
2345
2605
  }
2346
2606
  export {
2347
2607
  Lt as Calendar,