@stenajs-webui/calendar 19.0.0-next.11 → 19.0.0-next.12

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 me, Column as B, Indent as ht, SeparatorLine as pe, 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, stenaArrowLeft as be, stenaArrowRight as Qt, stenaAngleLeftDouble as Xt, stenaAngleRightDouble as Zt, stenaCalendar as gt, Icon as Ft, stenaArrowWideRight as ke, stenaClock as vt, stenaAngleDown as Se } from "@stenajs-webui/elements";
4
- import { isAfter as et, eachDayOfInterval as Pt, isSameDay as z, 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 yt, 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";
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 A, 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 z, 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";
5
6
  import { enGB as zt } from "date-fns/locale";
6
7
  import { last as Ue, startCase as re, chunk as se, range as jt, debounce as We, padStart as Oe } from "lodash";
7
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 wt } from "react/jsx-runtime";
10
10
  import Nt from "@emotion/styled";
11
11
  import { TextInput as nt, TextInputBox as $e } from "@stenajs-webui/forms";
12
12
  import { useTippyInstance as Pe, Popover as pt } from "@stenajs-webui/tooltip";
@@ -149,9 +149,9 @@ const Kt = (t, e, n, r) => {
149
149
  return {
150
150
  weekNumber: ne(t, { locale: e }),
151
151
  startMonth: tt(t),
152
- startYear: yt(t),
152
+ startYear: wt(t),
153
153
  endMonth: tt(q(t, 6)),
154
- endYear: yt(q(t, 6)),
154
+ endYear: wt(q(t, 6)),
155
155
  days: qe(t, e),
156
156
  isLastWeekOfMonth: n
157
157
  };
@@ -162,7 +162,7 @@ const Kt = (t, e, n, r) => {
162
162
  name: W(t, "EEE", e ? { locale: e } : void 0),
163
163
  dateString: W(Te(t, 12), Z.fullDate),
164
164
  weekNumber: ne(t, { locale: e }),
165
- year: yt(t),
165
+ year: wt(t),
166
166
  month: tt(t),
167
167
  dayOfMonth: Ct(t),
168
168
  dayOfWeek: n,
@@ -198,14 +198,56 @@ const Kt = (t, e, n, r) => {
198
198
  borderColor: r = "transparent"
199
199
  }) => (s, c, d, o, l) => {
200
200
  let a = {};
201
- 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
+ );
202
208
  return {
203
209
  ...a,
204
210
  backgroundColor: f,
205
- borderTopLeftRadius: V(c, s, ["selectedStart", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
206
- borderBottomLeftRadius: V(c, s, ["selectedStart", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
207
- borderTopRightRadius: V(c, s, ["selectedEnd", "singleSelected"], ["var(--swui-calendar-day-border-radius)", "var(--swui-calendar-day-border-radius)"], r),
208
- 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
+ ),
209
251
  boxSizing: "border-box"
210
252
  };
211
253
  }, Ve = ({
@@ -216,7 +258,18 @@ const Kt = (t, e, n, r) => {
216
258
  }) => (s, c, d, o, l) => {
217
259
  const a = d.month !== l.monthInYear;
218
260
  return {
219
- 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
+ )
220
273
  };
221
274
  }, rt = {
222
275
  width: "var(--swui-calendar-day-width)",
@@ -258,12 +311,11 @@ const Kt = (t, e, n, r) => {
258
311
  day: c,
259
312
  ...d
260
313
  }) {
261
- const o = C(() => tn(c.date, n, r) ? s : oe(s, ["disabled"]), [c.date, s, r, n]);
262
- return /* @__PURE__ */ i(e, {
263
- day: c,
264
- ...d,
265
- dayState: o
266
- });
314
+ const o = C(
315
+ () => tn(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 });
267
319
  }, nn = ({
268
320
  onClickWeek: t,
269
321
  theme: e,
@@ -272,32 +324,44 @@ const Kt = (t, e, n, r) => {
272
324
  backgroundColor: s,
273
325
  prefix: c
274
326
  }) => {
275
- const d = /* @__PURE__ */ E(I, {
276
- width: e.width,
277
- height: e.height,
278
- justifyContent: "center",
279
- alignItems: "center",
280
- children: [r && /* @__PURE__ */ i(I, {
281
- position: "absolute",
282
- children: r
283
- }), /* @__PURE__ */ i(I, {
284
- position: "absolute",
285
- children: /* @__PURE__ */ E(it, {
286
- color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
287
- children: [c, n.weekNumber]
288
- })
289
- })]
290
- });
291
- return /* @__PURE__ */ i(I, {
292
- background: s || e.WeekNumber.backgroundColor,
293
- position: "relative",
294
- children: t ? /* @__PURE__ */ i(Wt, {
295
- borderRadius: "var(--swui-calendar-day-border-radius)",
296
- onClick: (o) => t(n, o),
297
- disableFocusHighlight: !t,
298
- children: d
299
- }) : d
300
- });
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
+ );
301
365
  };
302
366
  function rn({
303
367
  week: t,
@@ -314,51 +378,66 @@ function rn({
314
378
  extraDayContent: h,
315
379
  defaultHighlights: u
316
380
  }) {
317
- return /* @__PURE__ */ E("tr", {
318
- children: [a.WeekNumber.show && /* @__PURE__ */ i("td", {
319
- children: f ? f(t, a, o) : /* @__PURE__ */ i(nn, {
381
+ return /* @__PURE__ */ E("tr", { children: [
382
+ a.WeekNumber.show && /* @__PURE__ */ i("td", { children: f ? f(t, a, o) : /* @__PURE__ */ i(
383
+ nn,
384
+ {
320
385
  week: t,
321
386
  onClickWeek: o,
322
387
  theme: a
323
- })
324
- }), t.days.map((D) => /* @__PURE__ */ i(en, {
325
- dayComponent: n,
326
- day: D,
327
- week: t,
328
- month: e,
329
- dayState: r && r[D.dayOfMonth],
330
- userData: s && s[D.dayOfMonth],
331
- onClickDay: l,
332
- theme: a,
333
- extraDayContent: h,
334
- defaultHighlights: u,
335
- minDate: c,
336
- maxDate: d
337
- }, D.dateString))]
338
- }, t.weekNumber);
388
+ }
389
+ ) }),
390
+ t.days.map((D) => /* @__PURE__ */ i(
391
+ en,
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);
339
409
  }
340
410
  const sn = ({
341
411
  onClickWeekDay: t,
342
412
  day: e,
343
413
  theme: n
344
414
  }) => {
345
- const r = /* @__PURE__ */ i(I, {
346
- width: n.width,
347
- height: n.height,
348
- justifyContent: "center",
349
- alignItems: "center",
350
- children: /* @__PURE__ */ i(it, {
351
- size: "small",
352
- color: t ? n.WeekDay.clickableTextColor : n.WeekDay.textColor,
353
- children: e.name
354
- })
355
- });
356
- return t ? /* @__PURE__ */ i(Wt, {
357
- borderRadius: "var(--swui-calendar-day-border-radius)",
358
- onClick: (s) => t(e.dayOfWeek, s),
359
- disableFocusHighlight: !t,
360
- children: r
361
- }) : r;
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;
362
441
  }, le = function({
363
442
  day: e,
364
443
  week: n,
@@ -370,54 +449,90 @@ const sn = ({
370
449
  extraDayContent: l,
371
450
  defaultHighlights: a
372
451
  }) {
373
- const f = /* @__PURE__ */ i(I, {
374
- width: "100%",
375
- height: "100%",
376
- justifyContent: "center",
377
- alignItems: "center",
378
- children: /* @__PURE__ */ i(it, {
379
- ...o.CalendarDay.textProps && o.CalendarDay.textProps(a, s, e, n, r, c),
380
- children: e.dayOfMonth
381
- })
382
- }), h = Nt.td({
383
- ...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
+ )
384
483
  }), u = Nt.div({
385
- ...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
+ ),
386
492
  width: "100%",
387
493
  height: "100%"
388
494
  }), D = Nt.div({
389
- ...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
+ ),
390
503
  width: "100%",
391
504
  height: "100%",
392
505
  position: "relative"
393
506
  });
394
- return /* @__PURE__ */ i(h, {
395
- children: /* @__PURE__ */ i(u, {
396
- children: /* @__PURE__ */ i(D, {
397
- children: e.month === r.monthInYear && /* @__PURE__ */ E(wt, {
398
- children: [l && /* @__PURE__ */ i(l, {
399
- week: n,
400
- month: r,
401
- day: e,
402
- dayState: s,
403
- theme: o,
404
- userData: c
405
- }), d && cn(a, s) ? /* @__PURE__ */ i(Wt, {
406
- onClick: (w) => d(e, c, w),
407
- style: {
408
- width: "100%",
409
- height: "100%"
410
- },
411
- borderRadius: "var(--swui-calendar-day-border-radius)",
412
- children: f
413
- }) : /* @__PURE__ */ i(wt, {
414
- children: f
415
- })]
416
- })
417
- })
418
- })
419
- });
420
- }, cn = (t, e) => !!V(e, t, ["enabled", "disabled"], [!0, !1], !0);
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 && cn(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
+ }, cn = (t, e) => !!V(
530
+ e,
531
+ t,
532
+ ["enabled", "disabled"],
533
+ [!0, !1],
534
+ !0
535
+ );
421
536
  function on({
422
537
  month: t,
423
538
  dayComponent: e = le,
@@ -439,75 +554,69 @@ function on({
439
554
  defaultHighlights: b
440
555
  }) {
441
556
  const m = k.WeekNumber.show;
442
- return /* @__PURE__ */ i(wt, {
443
- children: /* @__PURE__ */ E(I, {
444
- alignItems: "stretch",
445
- children: [/* @__PURE__ */ E(R, {
557
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ E(I, { alignItems: "stretch", children: [
558
+ /* @__PURE__ */ E(
559
+ R,
560
+ {
446
561
  justifyContent: "space-between",
447
562
  alignItems: "center",
448
563
  height: "32px",
449
- children: [/* @__PURE__ */ i(I, {
450
- alignItems: "center",
451
- children: D
452
- }), /* @__PURE__ */ E(R, {
453
- alignItems: "center",
454
- children: [/* @__PURE__ */ i(R, {
455
- width: "104px",
456
- justifyContent: "center",
457
- children: a ? /* @__PURE__ */ i(A, {
458
- onClick: () => a(t),
459
- label: t.name
460
- }) : /* @__PURE__ */ i(it, {
461
- children: t.name
462
- })
463
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
464
- width: "64px",
465
- justifyContent: "center",
466
- children: f ? /* @__PURE__ */ i(A, {
467
- onClick: () => f(t.year),
468
- label: String(t.year)
469
- }) : /* @__PURE__ */ i(it, {
470
- children: t.year
471
- })
472
- })]
473
- }), /* @__PURE__ */ i(I, {
474
- alignItems: "center",
475
- children: w
476
- })]
477
- }), /* @__PURE__ */ i("table", {
478
- children: /* @__PURE__ */ E("tbody", {
479
- children: [/* @__PURE__ */ E("tr", {
480
- children: [m && /* @__PURE__ */ i("td", {
481
- children: /* @__PURE__ */ i(I, {
482
- width: k.width,
483
- height: k.height
484
- })
485
- }), t.weeks[0].days.map((y) => /* @__PURE__ */ i("td", {
486
- children: u ? u(y.name, k, l) : /* @__PURE__ */ i(sn, {
487
- day: y,
488
- onClickWeekDay: l,
489
- theme: k
490
- })
491
- }, y.name))]
492
- }), t.weeks.map((y) => /* @__PURE__ */ i(rn, {
493
- month: t,
494
- week: y,
495
- dayComponent: e,
496
- statePerWeekDay: n && n[y.weekNumber],
497
- userDataPerWeekDay: r && r[y.weekNumber],
498
- onClickDay: d,
499
- onClickWeek: o,
500
- theme: k,
501
- renderWeekNumber: h,
502
- extraDayContent: p,
503
- defaultHighlights: b,
504
- minDate: s,
505
- maxDate: c
506
- }, y.weekNumber))]
507
- })
508
- })]
509
- })
510
- });
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
+ A,
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
+ A,
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
+ sn,
592
+ {
593
+ day: y,
594
+ onClickWeekDay: l,
595
+ theme: k
596
+ }
597
+ ) }, y.name))
598
+ ] }),
599
+ t.weeks.map((y) => /* @__PURE__ */ i(
600
+ rn,
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
+ ] }) });
511
620
  }
512
621
  function dn({
513
622
  monthRows: t,
@@ -529,50 +638,65 @@ function dn({
529
638
  defaultHighlights: p,
530
639
  theme: b = rt
531
640
  }) {
532
- const m = 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]);
533
- return /* @__PURE__ */ i("div", {
534
- className: Ze.calendar,
535
- children: t.map((M, T) => /* @__PURE__ */ i(me, {
536
- children: /* @__PURE__ */ i(R, {
537
- children: M.map((x, N) => /* @__PURE__ */ E(ce.Fragment, {
538
- children: [N > 0 && /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(on, {
539
- month: x,
540
- dayComponent: e,
541
- userDataPerWeek: n && n[x.monthString],
542
- statePerWeek: r && r[x.monthString],
543
- onClickDay: d,
544
- onClickWeekDay: o,
545
- onClickWeek: l,
546
- onClickMonth: a,
547
- onClickYear: f,
548
- theme: b,
549
- renderWeekNumber: u,
550
- renderWeekDay: h,
551
- headerLeftContent: D,
552
- headerRightContent: w,
553
- extraDayContent: k,
554
- defaultHighlights: p,
555
- minDate: m,
556
- maxDate: y
557
- })]
558
- }, x.name))
559
- })
560
- }, T))
561
- });
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: Ze.calendar, children: t.map((M, T) => /* @__PURE__ */ i(me, { children: /* @__PURE__ */ i(R, { children: M.map((x, N) => /* @__PURE__ */ E(ce.Fragment, { children: [
649
+ N > 0 && /* @__PURE__ */ i($, {}),
650
+ /* @__PURE__ */ i(
651
+ on,
652
+ {
653
+ month: x,
654
+ dayComponent: e,
655
+ userDataPerWeek: n && n[x.monthString],
656
+ statePerWeek: r && r[x.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
+ ] }, x.name)) }) }, T)) });
562
674
  }
563
675
  function Lt(t) {
564
676
  var d;
565
- const e = ln(t.year, t.month, t.date), {
566
- year: n,
567
- month: r
568
- } = Qe(e.year, e.month), s = an(n, r, (d = t.locale) != null ? d : zt, t.numMonths, t.monthsPerRow), c = _e(t.highlightToday, t.statePerMonth);
569
- return /* @__PURE__ */ i(dn, {
570
- year: n,
571
- month: r,
572
- monthRows: s,
573
- ...t,
574
- statePerMonth: c
575
- });
677
+ const e = ln(t.year, t.month, t.date), { year: n, month: r } = Qe(
678
+ e.year,
679
+ e.month
680
+ ), s = an(
681
+ n,
682
+ r,
683
+ (d = t.locale) != null ? d : zt,
684
+ t.numMonths,
685
+ t.monthsPerRow
686
+ ), c = _e(
687
+ t.highlightToday,
688
+ t.statePerMonth
689
+ );
690
+ return /* @__PURE__ */ i(
691
+ dn,
692
+ {
693
+ year: n,
694
+ month: r,
695
+ monthRows: s,
696
+ ...t,
697
+ statePerMonth: c
698
+ }
699
+ );
576
700
  }
577
701
  const ln = (t, e, n) => {
578
702
  if (e && t)
@@ -583,12 +707,12 @@ const ln = (t, e, n) => {
583
707
  if (n)
584
708
  return {
585
709
  month: tt(n),
586
- year: yt(n)
710
+ year: wt(n)
587
711
  };
588
712
  const r = new Date();
589
713
  return {
590
714
  month: tt(r),
591
- year: yt(r)
715
+ year: wt(r)
592
716
  };
593
717
  }, an = (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), fn = ({
594
718
  value: t,
@@ -598,36 +722,40 @@ const ln = (t, e, n) => {
598
722
  }) => {
599
723
  const s = C(() => {
600
724
  const c = new Date(2e3, n, 1);
601
- return re(W(c, "MMM", {
602
- locale: r
603
- }));
725
+ return re(W(c, "MMM", { locale: r }));
604
726
  }, [r, n]);
605
- return /* @__PURE__ */ i(R, {
606
- justifyContent: "center",
607
- children: t === n ? /* @__PURE__ */ i(dt, {
727
+ return /* @__PURE__ */ i(R, { justifyContent: "center", children: t === n ? /* @__PURE__ */ i(
728
+ dt,
729
+ {
608
730
  label: s,
609
731
  onClick: () => e && e(n)
610
- }) : /* @__PURE__ */ i(A, {
732
+ }
733
+ ) : /* @__PURE__ */ i(
734
+ A,
735
+ {
611
736
  label: s,
612
737
  onClick: () => e && e(n)
613
- })
614
- });
615
- }, un = [[U.JANUARY, U.FEBRUARY, U.MARCH], [U.APRIL, U.MAY, U.JUNE], [U.JULY, U.AUGUST, U.SEPTEMBER], [U.OCTOBER, U.NOVEMBER, U.DECEMBER]], Dn = ({
738
+ }
739
+ ) });
740
+ }, un = [
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
+ ], Dn = ({
616
746
  value: t,
617
747
  onValueChange: e,
618
748
  locale: n = zt
619
- }) => /* @__PURE__ */ i(B, {
620
- gap: 1,
621
- children: un.map((r) => /* @__PURE__ */ i(R, {
622
- gap: 1,
623
- children: r.map((s) => /* @__PURE__ */ i(fn, {
624
- month: s,
625
- onValueChange: e,
626
- value: t,
627
- locale: n
628
- }, s))
629
- }, r[0]))
630
- }), hn = (t) => [
749
+ }) => /* @__PURE__ */ i(B, { gap: 1, children: un.map((r) => /* @__PURE__ */ i(R, { gap: 1, children: r.map((s) => /* @__PURE__ */ i(
750
+ fn,
751
+ {
752
+ month: s,
753
+ onValueChange: e,
754
+ value: t,
755
+ locale: n
756
+ },
757
+ s
758
+ )) }, r[0])) }), hn = (t) => [
631
759
  {
632
760
  label: "Past",
633
761
  presets: [
@@ -651,50 +779,55 @@ const ln = (t, e, n) => {
651
779
  }) => {
652
780
  var c;
653
781
  const [e, n] = S(0), r = C(() => hn(new Date()), []), s = (c = r[e]) != null ? c : r[0];
654
- return /* @__PURE__ */ E(B, {
655
- children: [/* @__PURE__ */ E(R, {
656
- justifyContent: "space-between",
657
- alignItems: "center",
658
- width: "200px",
659
- children: [/* @__PURE__ */ i(A, {
660
- size: "small",
661
- leftIcon: Ot,
662
- disabled: e === 0,
663
- onClick: () => n(e - 1)
664
- }), /* @__PURE__ */ i(it, {
665
- children: s.label
666
- }), /* @__PURE__ */ i(A, {
667
- size: "small",
668
- leftIcon: $t,
669
- disabled: e === r.length - 1,
670
- onClick: () => n(e + 1)
671
- })]
672
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(B, {
673
- alignItems: "center",
674
- children: s.presets.map((d) => /* @__PURE__ */ E(ce.Fragment, {
675
- children: [/* @__PURE__ */ i(dt, {
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
+ A,
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
+ A,
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
+ {
676
817
  label: d.label,
677
818
  onClick: () => t(d)
678
- }), /* @__PURE__ */ i($, {})]
679
- }, d.label))
680
- })]
681
- });
819
+ }
820
+ ),
821
+ /* @__PURE__ */ i($, {})
822
+ ] }, d.label)) })
823
+ ] });
682
824
  }, yn = ({
683
825
  value: t,
684
826
  onValueChange: e,
685
827
  year: n
686
828
  }) => {
687
829
  const r = String(n);
688
- return /* @__PURE__ */ i(R, {
689
- justifyContent: "center",
690
- children: t === n ? /* @__PURE__ */ i(dt, {
691
- label: r,
692
- onClick: () => e == null ? void 0 : e(n)
693
- }) : /* @__PURE__ */ i(A, {
694
- label: r,
695
- onClick: () => e == null ? void 0 : e(n)
696
- })
697
- });
830
+ return /* @__PURE__ */ i(R, { justifyContent: "center", 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) }) });
698
831
  }, wn = ({
699
832
  value: t,
700
833
  onValueChange: e,
@@ -706,31 +839,31 @@ const ln = (t, e, n) => {
706
839
  }, [r]);
707
840
  return Q(() => {
708
841
  s((d) => mn(t, d));
709
- }, [t]), /* @__PURE__ */ E(R, {
710
- children: [/* @__PURE__ */ i(B, {
711
- justifyContent: "center",
712
- children: /* @__PURE__ */ i(A, {
842
+ }, [t]), /* @__PURE__ */ E(R, { children: [
843
+ /* @__PURE__ */ i(B, { justifyContent: "center", children: /* @__PURE__ */ i(
844
+ A,
845
+ {
713
846
  leftIcon: be,
714
847
  onClick: () => s(r - 3)
715
- })
716
- }), /* @__PURE__ */ i(B, {
717
- gap: 1,
718
- children: c.map((d) => /* @__PURE__ */ i(R, {
719
- gap: 1,
720
- children: d.map((o) => /* @__PURE__ */ i(yn, {
721
- year: o,
722
- onValueChange: e,
723
- value: t
724
- }, o))
725
- }, d[0]))
726
- }), /* @__PURE__ */ i(B, {
727
- justifyContent: "center",
728
- children: /* @__PURE__ */ i(A, {
848
+ }
849
+ ) }),
850
+ /* @__PURE__ */ i(B, { gap: 1, children: c.map((d) => /* @__PURE__ */ i(R, { gap: 1, children: d.map((o) => /* @__PURE__ */ i(
851
+ yn,
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
+ A,
861
+ {
729
862
  leftIcon: Qt,
730
863
  onClick: () => s(r + 3)
731
- })
732
- })]
733
- });
864
+ }
865
+ ) })
866
+ ] });
734
867
  }, mn = (t, e) => {
735
868
  if (t == null)
736
869
  return e;
@@ -752,51 +885,63 @@ const ln = (t, e, n) => {
752
885
  setCurrentPanel: c,
753
886
  ...d
754
887
  }) {
755
- const o = g((h) => {
756
- const u = n ? new Date(n) : new Date();
757
- u.setMonth(h), r && r(u), c("calendar");
758
- }, [n, r, c]), l = g((h) => {
759
- const u = n ? new Date(n) : new Date();
760
- u.setFullYear(h), r && r(u), c("calendar");
761
- }, [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(() => {
762
901
  c("year");
763
902
  }, [c]), f = g(() => {
764
903
  c("month");
765
904
  }, [c]);
766
905
  switch (s) {
767
906
  case "calendar":
768
- return /* @__PURE__ */ i(wt, {
769
- children: /* @__PURE__ */ i(Lt, {
907
+ return /* @__PURE__ */ i(ht, { children: /* @__PURE__ */ i(
908
+ Lt,
909
+ {
770
910
  ...d,
771
911
  date: n,
772
912
  onClickYear: a,
773
913
  onClickMonth: f,
774
914
  locale: e
775
- })
776
- });
915
+ }
916
+ ) });
777
917
  case "month":
778
- return /* @__PURE__ */ i(Dn, {
779
- value: n.getMonth(),
780
- onValueChange: o,
781
- locale: e
782
- });
918
+ return /* @__PURE__ */ i(
919
+ Dn,
920
+ {
921
+ value: n.getMonth(),
922
+ onValueChange: o,
923
+ locale: e
924
+ }
925
+ );
783
926
  case "year":
784
- return /* @__PURE__ */ i(wn, {
785
- value: n.getFullYear(),
786
- onValueChange: l
787
- });
788
- case "presets":
789
- return /* @__PURE__ */ i(gn, {
790
- onClickPreset: () => {
927
+ return /* @__PURE__ */ i(
928
+ wn,
929
+ {
930
+ value: n.getFullYear(),
931
+ onValueChange: l
791
932
  }
792
- });
933
+ );
934
+ case "presets":
935
+ return /* @__PURE__ */ i(gn, { onClickPreset: () => {
936
+ } });
793
937
  default:
794
- return /* @__PURE__ */ i(I, {
795
- children: /* @__PURE__ */ i(dt, {
938
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ i(
939
+ dt,
940
+ {
796
941
  label: "Show calendar",
797
942
  onClick: () => c("calendar")
798
- })
799
- });
943
+ }
944
+ ) });
800
945
  }
801
946
  }, bn = (t, e, n, r) => {
802
947
  const s = g(() => {
@@ -826,27 +971,19 @@ const ln = (t, e, n) => {
826
971
  nextMonth: n,
827
972
  prevYear: r,
828
973
  nextYear: s
829
- }) => /* @__PURE__ */ E("div", {
830
- children: [t, /* @__PURE__ */ i(ht, {
831
- children: /* @__PURE__ */ E(R, {
832
- children: [/* @__PURE__ */ i(A, {
833
- onClick: r,
834
- leftIcon: Xt
835
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
836
- onClick: e,
837
- leftIcon: Ot
838
- }), /* @__PURE__ */ i(ht, {
839
- num: 2
840
- }), /* @__PURE__ */ i(A, {
841
- onClick: n,
842
- leftIcon: $t
843
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
844
- onClick: s,
845
- leftIcon: Zt
846
- })]
847
- })
848
- }), /* @__PURE__ */ i($, {})]
849
- }), Sn = () => {
974
+ }) => /* @__PURE__ */ E("div", { children: [
975
+ t,
976
+ /* @__PURE__ */ i(gt, { children: /* @__PURE__ */ E(R, { children: [
977
+ /* @__PURE__ */ i(A, { onClick: r, leftIcon: Xt }),
978
+ /* @__PURE__ */ i($, {}),
979
+ /* @__PURE__ */ i(A, { onClick: e, leftIcon: Ot }),
980
+ /* @__PURE__ */ i(gt, { num: 2 }),
981
+ /* @__PURE__ */ i(A, { onClick: n, leftIcon: $t }),
982
+ /* @__PURE__ */ i($, {}),
983
+ /* @__PURE__ */ i(A, { onClick: s, leftIcon: Zt })
984
+ ] }) }),
985
+ /* @__PURE__ */ i($, {})
986
+ ] }), Sn = () => {
850
987
  };
851
988
  function F({
852
989
  monthSwitcherPlacement: t,
@@ -859,29 +996,32 @@ function F({
859
996
  hideYearPagination: o = !1,
860
997
  ...l
861
998
  }) {
862
- const {
863
- nextMonth: a,
864
- prevMonth: f,
865
- nextYear: h,
866
- prevYear: u
867
- } = bn(n, r, l.monthsPerRow, l.numMonths);
868
- switch (Mn(t, l.numMonths)) {
999
+ const { nextMonth: a, prevMonth: f, nextYear: h, prevYear: u } = bn(
1000
+ n,
1001
+ r,
1002
+ l.monthsPerRow,
1003
+ l.numMonths
1004
+ );
1005
+ switch (Mn(
1006
+ t,
1007
+ l.numMonths
1008
+ )) {
869
1009
  case "below":
870
- return /* @__PURE__ */ i(kn, {
871
- theme: e,
872
- nextMonth: a,
873
- prevMonth: f,
874
- nextYear: h,
875
- prevYear: u,
876
- children: /* @__PURE__ */ i(Lt, {
877
- ...l,
1010
+ return /* @__PURE__ */ i(
1011
+ kn,
1012
+ {
878
1013
  theme: e,
879
- date: n
880
- })
881
- });
1014
+ nextMonth: a,
1015
+ prevMonth: f,
1016
+ nextYear: h,
1017
+ prevYear: u,
1018
+ children: /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n })
1019
+ }
1020
+ );
882
1021
  case "header":
883
- return /* @__PURE__ */ i(B, {
884
- children: /* @__PURE__ */ i(pn, {
1022
+ return /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(
1023
+ pn,
1024
+ {
885
1025
  ...l,
886
1026
  theme: e,
887
1027
  dateInFocus: n,
@@ -889,34 +1029,32 @@ function F({
889
1029
  currentPanel: s,
890
1030
  setCurrentPanel: c,
891
1031
  onSelectPreset: d,
892
- headerLeftContent: /* @__PURE__ */ E(R, {
893
- alignItems: "center",
894
- children: [!o && /* @__PURE__ */ i(A, {
895
- onClick: u,
896
- leftIcon: Xt
897
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
898
- onClick: f,
899
- leftIcon: Ot
900
- })]
901
- }),
902
- headerRightContent: /* @__PURE__ */ E(R, {
903
- alignItems: "center",
904
- children: [/* @__PURE__ */ i(A, {
905
- onClick: a,
906
- leftIcon: $t
907
- }), /* @__PURE__ */ i($, {}), !o && /* @__PURE__ */ i(A, {
908
- onClick: h,
909
- leftIcon: Zt
910
- })]
911
- })
912
- })
913
- });
1032
+ headerLeftContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1033
+ !o && /* @__PURE__ */ i(
1034
+ A,
1035
+ {
1036
+ onClick: u,
1037
+ leftIcon: Xt
1038
+ }
1039
+ ),
1040
+ /* @__PURE__ */ i($, {}),
1041
+ /* @__PURE__ */ i(A, { onClick: f, leftIcon: Ot })
1042
+ ] }),
1043
+ headerRightContent: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1044
+ /* @__PURE__ */ i(A, { onClick: a, leftIcon: $t }),
1045
+ /* @__PURE__ */ i($, {}),
1046
+ !o && /* @__PURE__ */ i(
1047
+ A,
1048
+ {
1049
+ onClick: h,
1050
+ leftIcon: Zt
1051
+ }
1052
+ )
1053
+ ] })
1054
+ }
1055
+ ) });
914
1056
  default:
915
- return /* @__PURE__ */ i(Lt, {
916
- ...l,
917
- theme: e,
918
- date: n
919
- });
1057
+ return /* @__PURE__ */ i(Lt, { ...l, theme: e, date: n });
920
1058
  }
921
1059
  }
922
1060
  const Mn = (t, e) => t || (e || 1) > 1 ? "below" : "header", En = (t) => ({
@@ -957,9 +1095,12 @@ const Mn = (t, e) => t || (e || 1) > 1 ? "below" : "header", En = (t) => ({
957
1095
  t == null ? void 0 : t.startDate
958
1096
  ]
959
1097
  ), bt = (t) => {
960
- const [e, n] = S("calendar"), r = g((s) => {
961
- n(s), t == null || t(s);
962
- }, [t]);
1098
+ const [e, n] = S("calendar"), r = g(
1099
+ (s) => {
1100
+ n(s), t == null || t(s);
1101
+ },
1102
+ [t]
1103
+ );
963
1104
  return {
964
1105
  currentPanel: e,
965
1106
  setCurrentPanel: r
@@ -999,10 +1140,7 @@ const Mn = (t, e) => t || (e || 1) > 1 ? "below" : "header", En = (t) => ({
999
1140
  };
1000
1141
  function yr(t) {
1001
1142
  const e = An(t);
1002
- return /* @__PURE__ */ i(F, {
1003
- ...t,
1004
- ...e
1005
- });
1143
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1006
1144
  }
1007
1145
  const wr = () => {
1008
1146
  const [t, e] = S(), [n, r] = S(), [s, c] = S("startDate");
@@ -1044,10 +1182,7 @@ const wr = () => {
1044
1182
  };
1045
1183
  function De(t) {
1046
1184
  const e = Tn(t);
1047
- return /* @__PURE__ */ i(F, {
1048
- ...t,
1049
- ...e
1050
- });
1185
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1051
1186
  }
1052
1187
  const xn = ({
1053
1188
  onChange: t,
@@ -1078,10 +1213,7 @@ const xn = ({
1078
1213
  };
1079
1214
  function mr(t) {
1080
1215
  const e = xn(t);
1081
- return /* @__PURE__ */ i(F, {
1082
- ...t,
1083
- ...e
1084
- });
1216
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1085
1217
  }
1086
1218
  const Cn = ({
1087
1219
  onChange: t,
@@ -1133,10 +1265,7 @@ const Cn = ({
1133
1265
  };
1134
1266
  function pr(t) {
1135
1267
  const e = Cn(t);
1136
- return /* @__PURE__ */ i(F, {
1137
- ...t,
1138
- ...e
1139
- });
1268
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1140
1269
  }
1141
1270
  const Nn = (t, e) => t.filter((n) => !z(n, e)), In = (t, e) => !!t.find((n) => z(n, e)), Hn = ({
1142
1271
  value: t,
@@ -1183,10 +1312,7 @@ const Nn = (t, e) => t.filter((n) => !z(n, e)), In = (t, e) => !!t.find((n) => z
1183
1312
  }, Yn = (t, e) => e ? e.reduce((n, r) => X(n, r, ["selected"]), t) : t;
1184
1313
  function br(t) {
1185
1314
  const e = Hn(t);
1186
- return /* @__PURE__ */ i(F, {
1187
- ...t,
1188
- ...e
1189
- });
1315
+ return /* @__PURE__ */ i(F, { ...t, ...e });
1190
1316
  }
1191
1317
  const kt = "bottom", he = () => {
1192
1318
  const [t, e] = Pe();
@@ -1200,9 +1326,12 @@ const kt = "bottom", he = () => {
1200
1326
  }, Ln = (t, e, n) => {
1201
1327
  const [r, s] = S(n || !1), c = g(() => (s(!0), !0), [s]), d = g(() => {
1202
1328
  s(!1), e && e();
1203
- }, [s, e]), o = g((l) => {
1204
- t && t(l), setTimeout(d, 150);
1205
- }, [t, d]);
1329
+ }, [s, e]), o = g(
1330
+ (l) => {
1331
+ t && t(l), setTimeout(d, 150);
1332
+ },
1333
+ [t, d]
1334
+ );
1206
1335
  return {
1207
1336
  showCalendar: c,
1208
1337
  hideCalendar: d,
@@ -1226,18 +1355,10 @@ const kt = "bottom", he = () => {
1226
1355
  maxDate: D = St,
1227
1356
  disabled: w
1228
1357
  }) => {
1229
- const {
1230
- hideCalendar: k,
1231
- showingCalendar: p,
1232
- onSelectDate: b,
1233
- showCalendar: m
1234
- } = Ln(l, o, d), {
1235
- tippyRef: y,
1236
- onChangePanel: M
1237
- } = he();
1238
- return /* @__PURE__ */ i(I, {
1239
- width: h,
1240
- children: /* @__PURE__ */ i(pt, {
1358
+ const { hideCalendar: k, showingCalendar: p, onSelectDate: b, showCalendar: m } = Ln(l, o, d), { tippyRef: y, onChangePanel: M } = he();
1359
+ return /* @__PURE__ */ i(I, { width: h, children: /* @__PURE__ */ i(
1360
+ pt,
1361
+ {
1241
1362
  arrow: !1,
1242
1363
  lazy: !0,
1243
1364
  visible: p,
@@ -1247,51 +1368,63 @@ const kt = "bottom", he = () => {
1247
1368
  appendTo: a != null ? a : "parent",
1248
1369
  tippyRef: y,
1249
1370
  disabled: w,
1250
- content: /* @__PURE__ */ i(De, {
1251
- ...c,
1252
- onChange: b,
1253
- value: n,
1254
- theme: s,
1255
- onChangePanel: M,
1256
- minDate: u,
1257
- maxDate: D
1258
- }),
1259
- children: /* @__PURE__ */ i(nt, {
1260
- type: "date",
1261
- contentRight: /* @__PURE__ */ i(R, {
1262
- alignItems: "center",
1263
- children: /* @__PURE__ */ i(A, {
1264
- size: "small",
1265
- disabled: w,
1266
- leftIcon: gt,
1267
- onClick: m
1268
- })
1269
- }),
1270
- onFocus: m,
1271
- onClickRight: m,
1272
- value: n ? W(n, t) : "",
1273
- placeholder: e,
1274
- size: 9,
1275
- disabled: w,
1276
- autoFocus: d,
1277
- variant: f,
1278
- min: u,
1279
- max: D
1280
- })
1281
- })
1282
- });
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
+ contentRight: /* @__PURE__ */ i(R, { alignItems: "center", children: /* @__PURE__ */ i(
1388
+ A,
1389
+ {
1390
+ size: "small",
1391
+ disabled: w,
1392
+ leftIcon: yt,
1393
+ onClick: m
1394
+ }
1395
+ ) }),
1396
+ onFocus: m,
1397
+ onClickRight: m,
1398
+ value: n ? W(n, t) : "",
1399
+ placeholder: e,
1400
+ size: 9,
1401
+ disabled: w,
1402
+ autoFocus: d,
1403
+ variant: f,
1404
+ min: u,
1405
+ max: D
1406
+ }
1407
+ )
1408
+ }
1409
+ ) });
1283
1410
  }, Un = (t, e) => {
1284
1411
  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(() => {
1285
1412
  c(!1);
1286
- }, [c]), h = g((D) => {
1287
- d === "startDate" ? (e == null || e({
1288
- startDate: D.date,
1289
- endDate: t == null ? void 0 : t.endDate
1290
- }), t != null && t.endDate ? setTimeout(f, 150) : (o("endDate"), r.current && r.current.focus())) : d === "endDate" && (e == null || e({
1291
- startDate: t == null ? void 0 : t.startDate,
1292
- endDate: D.date
1293
- }), t != null && t.startDate ? setTimeout(f, 150) : (o("startDate"), n.current && n.current.focus()));
1294
- }, [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]);
1413
+ }, [c]), h = g(
1414
+ (D) => {
1415
+ d === "startDate" ? (e == null || e({
1416
+ startDate: D.date,
1417
+ endDate: t == null ? void 0 : t.endDate
1418
+ }), t != null && t.endDate ? setTimeout(f, 150) : (o("endDate"), r.current && r.current.focus())) : d === "endDate" && (e == null || e({
1419
+ startDate: t == null ? void 0 : t.startDate,
1420
+ endDate: D.date
1421
+ }), t != null && t.startDate ? setTimeout(f, 150) : (o("startDate"), n.current && n.current.focus()));
1422
+ },
1423
+ [d, e, o, f, t]
1424
+ ), u = C(
1425
+ () => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && et(t.startDate, t.endDate),
1426
+ [t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]
1427
+ );
1295
1428
  return {
1296
1429
  showingCalendar: s,
1297
1430
  hideCalendar: f,
@@ -1330,60 +1463,83 @@ function Sr({
1330
1463
  endDateInputRef: T,
1331
1464
  onClickDay: x,
1332
1465
  startDateIsAfterEnd: N
1333
- } = Un(s, c), [O, Y] = S(() => {
1334
- var _;
1335
- return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
1336
- }), j = C(() => mt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate), [s]);
1337
- return /* @__PURE__ */ i(pt, {
1338
- arrow: !1,
1339
- lazy: !0,
1340
- disabled: u,
1341
- visible: m,
1342
- zIndex: d,
1343
- placement: kt,
1344
- appendTo: r != null ? r : "parent",
1345
- onClickOutside: k,
1346
- content: /* @__PURE__ */ i(F, {
1347
- ...a,
1348
- dateInFocus: O,
1349
- setDateInFocus: Y,
1350
- statePerMonth: j,
1351
- theme: l,
1352
- onClickDay: x,
1353
- currentPanel: D,
1354
- setCurrentPanel: w,
1355
- minDate: f,
1356
- maxDate: h
1357
- }),
1358
- children: /* @__PURE__ */ E(R, {
1359
- alignItems: "center",
1360
- children: [/* @__PURE__ */ i(nt, {
1361
- iconLeft: gt,
1362
- onFocus: b,
1363
- value: s != null && s.startDate ? W(s.startDate, t) : "",
1364
- placeholder: e,
1365
- width: o,
1366
- disabled: u,
1367
- inputRef: M,
1368
- size: 9,
1369
- variant: N ? "error" : void 0
1370
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(Ft, {
1371
- icon: ke,
1372
- color: ie("--lhds-color-ui-500"),
1373
- size: 14
1374
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(nt, {
1375
- iconLeft: gt,
1376
- onFocus: p,
1377
- value: s != null && s.endDate ? W(s.endDate, t) : "",
1378
- placeholder: n,
1379
- width: o,
1380
- disabled: u,
1381
- inputRef: T,
1382
- size: 9,
1383
- variant: N ? "error" : void 0
1384
- })]
1385
- })
1386
- });
1466
+ } = Un(s, c), [O, Y] = S(
1467
+ () => {
1468
+ var _;
1469
+ return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
1470
+ }
1471
+ ), j = C(
1472
+ () => mt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
1473
+ [s]
1474
+ );
1475
+ return /* @__PURE__ */ i(
1476
+ pt,
1477
+ {
1478
+ arrow: !1,
1479
+ lazy: !0,
1480
+ disabled: u,
1481
+ visible: m,
1482
+ zIndex: d,
1483
+ placement: kt,
1484
+ appendTo: r != null ? r : "parent",
1485
+ onClickOutside: k,
1486
+ content: /* @__PURE__ */ i(
1487
+ F,
1488
+ {
1489
+ ...a,
1490
+ dateInFocus: O,
1491
+ setDateInFocus: Y,
1492
+ statePerMonth: j,
1493
+ theme: l,
1494
+ onClickDay: x,
1495
+ currentPanel: D,
1496
+ setCurrentPanel: w,
1497
+ minDate: f,
1498
+ maxDate: h
1499
+ }
1500
+ ),
1501
+ children: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1502
+ /* @__PURE__ */ i(
1503
+ nt,
1504
+ {
1505
+ iconLeft: yt,
1506
+ onFocus: b,
1507
+ value: s != null && s.startDate ? W(s.startDate, t) : "",
1508
+ placeholder: e,
1509
+ width: o,
1510
+ disabled: u,
1511
+ inputRef: M,
1512
+ size: 9,
1513
+ variant: N ? "error" : void 0
1514
+ }
1515
+ ),
1516
+ /* @__PURE__ */ i($, {}),
1517
+ /* @__PURE__ */ i(
1518
+ Ft,
1519
+ {
1520
+ icon: ke,
1521
+ color: ie("--lhds-color-ui-500"),
1522
+ size: 14
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ i($, {}),
1526
+ /* @__PURE__ */ i(
1527
+ nt,
1528
+ {
1529
+ iconLeft: yt,
1530
+ onFocus: p,
1531
+ value: s != null && s.endDate ? W(s.endDate, t) : "",
1532
+ placeholder: n,
1533
+ width: o,
1534
+ disabled: u,
1535
+ inputRef: T,
1536
+ size: 9,
1537
+ variant: N ? "error" : void 0
1538
+ }
1539
+ )
1540
+ ] })
1541
+ }
1542
+ );
1387
1543
  }
1388
1544
  const Mr = ({
1389
1545
  calendarProps: t,
@@ -1403,21 +1559,24 @@ const Mr = ({
1403
1559
  variant: w,
1404
1560
  ...k
1405
1561
  }) => {
1406
- const [p, b] = S(!1), {
1407
- tippyRef: m,
1408
- onChangePanel: y
1409
- } = he(), M = g(() => {
1562
+ const [p, b] = S(!1), { tippyRef: m, onChangePanel: y } = he(), M = g(() => {
1410
1563
  b(!p);
1411
1564
  }, [b, p]), T = g(() => {
1412
1565
  b(!1);
1413
- }, [b]), x = g((P) => {
1414
- s && s(P);
1415
- }, [s]), N = g((P) => {
1416
- P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
1417
- }, [x, n, e, b, p]), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && Le(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
1418
- return /* @__PURE__ */ i(I, {
1419
- width: l,
1420
- children: /* @__PURE__ */ i(pt, {
1566
+ }, [b]), x = g(
1567
+ (P) => {
1568
+ s && s(P);
1569
+ },
1570
+ [s]
1571
+ ), N = g(
1572
+ (P) => {
1573
+ P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
1574
+ },
1575
+ [x, n, e, b, p]
1576
+ ), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && Le(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
1577
+ return /* @__PURE__ */ i(I, { width: l, children: /* @__PURE__ */ i(
1578
+ pt,
1579
+ {
1421
1580
  arrow: !1,
1422
1581
  lazy: !0,
1423
1582
  visible: p,
@@ -1426,38 +1585,43 @@ const Mr = ({
1426
1585
  placement: kt,
1427
1586
  onClickOutside: T,
1428
1587
  tippyRef: m,
1429
- content: /* @__PURE__ */ i(De, {
1430
- ...t,
1431
- onChange: N,
1432
- onChangePanel: y,
1433
- value: o && Y ? ot(o, n, new Date()) : void 0,
1434
- minDate: u,
1435
- maxDate: D,
1436
- theme: f
1437
- }),
1438
- children: /* @__PURE__ */ i(nt, {
1439
- ...k,
1440
- variant: _ ? "error" : w,
1441
- disableContentPaddingRight: !0,
1442
- contentRight: h ? void 0 : /* @__PURE__ */ i(R, {
1443
- alignItems: "center",
1444
- indent: 0.5,
1445
- children: /* @__PURE__ */ i(A, {
1446
- size: "small",
1447
- disabled: k.disabled || r,
1448
- leftIcon: gt,
1449
- onClick: M
1450
- })
1451
- }),
1452
- onValueChange: x,
1453
- placeholder: c,
1454
- value: o || "",
1455
- min: u,
1456
- max: D,
1457
- size: 10
1458
- })
1459
- })
1460
- });
1588
+ content: /* @__PURE__ */ i(
1589
+ De,
1590
+ {
1591
+ ...t,
1592
+ onChange: N,
1593
+ onChangePanel: y,
1594
+ value: o && Y ? ot(o, n, new Date()) : void 0,
1595
+ minDate: u,
1596
+ maxDate: D,
1597
+ theme: f
1598
+ }
1599
+ ),
1600
+ children: /* @__PURE__ */ i(
1601
+ nt,
1602
+ {
1603
+ ...k,
1604
+ variant: _ ? "error" : w,
1605
+ disableContentPaddingRight: !0,
1606
+ contentRight: h ? void 0 : /* @__PURE__ */ i(R, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ i(
1607
+ A,
1608
+ {
1609
+ size: "small",
1610
+ disabled: k.disabled || r,
1611
+ leftIcon: yt,
1612
+ onClick: M
1613
+ }
1614
+ ) }),
1615
+ onValueChange: x,
1616
+ placeholder: c,
1617
+ value: o || "",
1618
+ min: u,
1619
+ max: D,
1620
+ size: 10
1621
+ }
1622
+ )
1623
+ }
1624
+ ) });
1461
1625
  }, Tt = (t) => {
1462
1626
  if (t === "")
1463
1627
  return "00";
@@ -1538,21 +1702,27 @@ const Mr = ({
1538
1702
  const u = Wn(r);
1539
1703
  l(u.success), u.success && t && t(u.time);
1540
1704
  }
1541
- }, [r, t, l]), h = g((u) => {
1542
- const D = u.target.value, w = Ut(D);
1543
- l(w && D.length <= a.length), t && t(D);
1544
- }, [t, l]);
1545
- return /* @__PURE__ */ i(nt, {
1546
- ...d,
1547
- type: "time",
1548
- variant: o ? c : "error",
1549
- iconLeft: n ? vt : void 0,
1550
- value: r,
1551
- placeholder: e ? a : void 0,
1552
- onChange: h,
1553
- onBlur: f,
1554
- width: s
1555
- });
1705
+ }, [r, t, l]), h = g(
1706
+ (u) => {
1707
+ const D = u.target.value, w = Ut(D);
1708
+ l(w && D.length <= a.length), t && t(D);
1709
+ },
1710
+ [t, l]
1711
+ );
1712
+ return /* @__PURE__ */ i(
1713
+ nt,
1714
+ {
1715
+ ...d,
1716
+ type: "time",
1717
+ variant: o ? c : "error",
1718
+ iconLeft: n ? vt : void 0,
1719
+ value: r,
1720
+ placeholder: e ? a : void 0,
1721
+ onChange: h,
1722
+ onBlur: f,
1723
+ width: s
1724
+ }
1725
+ );
1556
1726
  }, ge = ({
1557
1727
  autoFocusLeft: t,
1558
1728
  autoFocusRight: e,
@@ -1592,103 +1762,117 @@ const Mr = ({
1592
1762
  widthRight: ut,
1593
1763
  disabled: v
1594
1764
  }) => {
1595
- const L = J(0), H = C(() => We((G) => {
1596
- G === 0 && (K == null || K());
1597
- }, 10), [K]), Mt = g((G) => {
1598
- L.current++, H(L.current), Y && Y(G);
1599
- }, [Y, L, H]), Et = g((G) => {
1600
- L.current++, H(L.current), j && j(G);
1601
- }, [j, L, H]), Rt = g((G) => {
1602
- L.current--, H(L.current), N && N(G);
1603
- }, [N, L, H]), we = g((G) => {
1604
- L.current--, H(L.current), O && O(G);
1605
- }, [O, L, H]);
1606
- return /* @__PURE__ */ i(I, {
1607
- children: /* @__PURE__ */ E($e, {
1765
+ const L = J(0), H = C(
1766
+ () => We((G) => {
1767
+ G === 0 && (K == null || K());
1768
+ }, 10),
1769
+ [K]
1770
+ ), Mt = g(
1771
+ (G) => {
1772
+ L.current++, H(L.current), Y && Y(G);
1773
+ },
1774
+ [Y, L, H]
1775
+ ), Et = g(
1776
+ (G) => {
1777
+ L.current++, H(L.current), j && j(G);
1778
+ },
1779
+ [j, L, H]
1780
+ ), Rt = g(
1781
+ (G) => {
1782
+ L.current--, H(L.current), N && N(G);
1783
+ },
1784
+ [N, L, H]
1785
+ ), we = g(
1786
+ (G) => {
1787
+ L.current--, H(L.current), O && O(G);
1788
+ },
1789
+ [O, L, H]
1790
+ );
1791
+ return /* @__PURE__ */ i(I, { children: /* @__PURE__ */ E(
1792
+ $e,
1793
+ {
1608
1794
  disableContentPaddingRight: !0,
1609
1795
  disabled: v,
1610
1796
  variant: st,
1611
- contentRight: /* @__PURE__ */ E(R, {
1612
- alignItems: "center",
1613
- children: [/* @__PURE__ */ i(ht, {
1614
- num: 0.5,
1615
- children: /* @__PURE__ */ i(A, {
1616
- leftIcon: gt,
1797
+ contentRight: /* @__PURE__ */ E(R, { alignItems: "center", children: [
1798
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1799
+ A,
1800
+ {
1801
+ leftIcon: yt,
1617
1802
  onClick: T,
1618
1803
  disabled: v,
1619
1804
  size: "small"
1620
- })
1621
- }), at ? /* @__PURE__ */ E(wt, {
1622
- children: [/* @__PURE__ */ i(R, {
1623
- height: "22px",
1624
- children: /* @__PURE__ */ i(pe, {
1625
- vertical: !0
1626
- })
1627
- }), /* @__PURE__ */ i(ht, {
1628
- num: 0.5,
1629
- children: /* @__PURE__ */ i(A, {
1805
+ }
1806
+ ) }),
1807
+ at ? /* @__PURE__ */ E(ht, { children: [
1808
+ /* @__PURE__ */ i(R, { height: "22px", children: /* @__PURE__ */ i(pe, { vertical: !0 }) }),
1809
+ /* @__PURE__ */ i(gt, { num: 0.5, children: /* @__PURE__ */ i(
1810
+ A,
1811
+ {
1630
1812
  leftIcon: Se,
1631
1813
  onClick: x,
1632
1814
  disabled: v,
1633
1815
  size: "small"
1634
- })
1635
- })]
1636
- }) : null]
1637
- }),
1638
- children: [/* @__PURE__ */ i(I, {
1639
- width: ft,
1640
- children: /* @__PURE__ */ i(nt, {
1641
- onEsc: n,
1642
- onEnter: r,
1643
- onClick: y,
1644
- disabled: v,
1645
- hideBorder: !0,
1646
- placeholder: o,
1647
- value: D,
1648
- onValueChange: s,
1649
- onChange: h,
1650
- onBlur: Rt,
1651
- onFocus: Mt,
1652
- inputRef: _,
1653
- variant: lt,
1654
- type: a,
1655
- autoFocus: t,
1656
- min: k,
1657
- max: p
1658
- })
1659
- }), /* @__PURE__ */ i(R, {
1660
- indent: 0.5,
1661
- alignItems: "center",
1662
- justifyContent: "center",
1663
- children: /* @__PURE__ */ i(Ft, {
1664
- icon: d,
1665
- size: 12,
1666
- color: ie("--lhds-color-ui-500")
1667
- })
1668
- }), /* @__PURE__ */ i(I, {
1669
- width: ut,
1670
- children: /* @__PURE__ */ i(nt, {
1671
- onEsc: n,
1672
- onEnter: r,
1673
- onClick: M,
1674
- disabled: v,
1675
- hideBorder: !0,
1676
- placeholder: l,
1677
- value: w,
1678
- onValueChange: c,
1679
- onChange: u,
1680
- onBlur: we,
1681
- onFocus: Et,
1682
- inputRef: P,
1683
- variant: ct,
1684
- type: f,
1685
- autoFocus: e,
1686
- min: b,
1687
- max: m
1688
- })
1689
- })]
1690
- })
1691
- });
1816
+ }
1817
+ ) })
1818
+ ] }) : null
1819
+ ] }),
1820
+ children: [
1821
+ /* @__PURE__ */ i(I, { width: ft, children: /* @__PURE__ */ i(
1822
+ nt,
1823
+ {
1824
+ onEsc: n,
1825
+ onEnter: r,
1826
+ onClick: y,
1827
+ disabled: v,
1828
+ hideBorder: !0,
1829
+ placeholder: o,
1830
+ value: D,
1831
+ onValueChange: s,
1832
+ onChange: h,
1833
+ onBlur: Rt,
1834
+ onFocus: Mt,
1835
+ inputRef: _,
1836
+ variant: lt,
1837
+ type: a,
1838
+ autoFocus: t,
1839
+ min: k,
1840
+ max: p
1841
+ }
1842
+ ) }),
1843
+ /* @__PURE__ */ i(R, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ i(
1844
+ Ft,
1845
+ {
1846
+ icon: d,
1847
+ size: 12,
1848
+ color: ie("--lhds-color-ui-500")
1849
+ }
1850
+ ) }),
1851
+ /* @__PURE__ */ i(I, { width: ut, children: /* @__PURE__ */ i(
1852
+ nt,
1853
+ {
1854
+ onEsc: n,
1855
+ onEnter: r,
1856
+ onClick: M,
1857
+ disabled: v,
1858
+ hideBorder: !0,
1859
+ placeholder: l,
1860
+ value: w,
1861
+ onValueChange: c,
1862
+ onChange: u,
1863
+ onBlur: we,
1864
+ onFocus: Et,
1865
+ inputRef: P,
1866
+ variant: ct,
1867
+ type: f,
1868
+ autoFocus: e,
1869
+ min: b,
1870
+ max: m
1871
+ }
1872
+ ) })
1873
+ ]
1874
+ }
1875
+ ) });
1692
1876
  }, On = (t) => {
1693
1877
  if (t == null)
1694
1878
  throw new Error("Time is not set.");
@@ -1742,25 +1926,37 @@ const Mr = ({
1742
1926
  canScrollRef: s
1743
1927
  }) => {
1744
1928
  const c = J(null);
1745
- return Q(function() {
1746
- if (n && r.current && c.current && s.current) {
1747
- const o = c.current.scrollHeight * Math.max(e - 2, 0);
1748
- r.current.scrollTo(0, o), s.current = !1;
1929
+ return Q(
1930
+ function() {
1931
+ if (n && r.current && c.current && s.current) {
1932
+ const o = c.current.scrollHeight * Math.max(e - 2, 0);
1933
+ r.current.scrollTo(0, o), s.current = !1;
1934
+ }
1935
+ },
1936
+ [r, e, n, s]
1937
+ ), /* @__PURE__ */ i(
1938
+ R,
1939
+ {
1940
+ width: "64px",
1941
+ justifyContent: "center",
1942
+ spacing: 0.5,
1943
+ indent: 0.5,
1944
+ ref: c,
1945
+ children: n ? /* @__PURE__ */ i(
1946
+ dt,
1947
+ {
1948
+ label: Oe(String(e), 2, "0"),
1949
+ onClick: () => t && t(e)
1950
+ }
1951
+ ) : /* @__PURE__ */ i(
1952
+ A,
1953
+ {
1954
+ label: String(e).padStart(2, "0"),
1955
+ onClick: () => t && t(e)
1956
+ }
1957
+ )
1749
1958
  }
1750
- }, [r, e, n, s]), /* @__PURE__ */ i(R, {
1751
- width: "64px",
1752
- justifyContent: "center",
1753
- spacing: 0.5,
1754
- indent: 0.5,
1755
- ref: c,
1756
- children: n ? /* @__PURE__ */ i(dt, {
1757
- label: Oe(String(e), 2, "0"),
1758
- onClick: () => t && t(e)
1759
- }) : /* @__PURE__ */ i(A, {
1760
- label: String(e).padStart(2, "0"),
1761
- onClick: () => t && t(e)
1762
- })
1763
- });
1959
+ );
1764
1960
  }, qt = ({
1765
1961
  onClick: t,
1766
1962
  items: e,
@@ -1768,17 +1964,17 @@ const Mr = ({
1768
1964
  canScrollRef: r
1769
1965
  }) => {
1770
1966
  const s = J(null);
1771
- return /* @__PURE__ */ i(B, {
1772
- className: ye.timePickerColumn,
1773
- ref: s,
1774
- children: e.map((c) => /* @__PURE__ */ i(jn, {
1967
+ return /* @__PURE__ */ i(B, { className: ye.timePickerColumn, ref: s, children: e.map((c) => /* @__PURE__ */ i(
1968
+ jn,
1969
+ {
1775
1970
  item: c,
1776
1971
  onClick: t,
1777
1972
  selected: c === n,
1778
1973
  columnRef: s,
1779
1974
  canScrollRef: r
1780
- }, c))
1781
- });
1975
+ },
1976
+ c
1977
+ )) });
1782
1978
  }, _n = jt(0, 24), Jn = jt(0, 60), Kn = ({
1783
1979
  value: t,
1784
1980
  onValueChange: e
@@ -1786,32 +1982,46 @@ const Mr = ({
1786
1982
  const n = J(!0), [r, s] = S(void 0), [c, d] = S(void 0);
1787
1983
  Q(() => {
1788
1984
  if (t) {
1789
- const {
1790
- minute: a,
1791
- hour: f
1792
- } = At(t);
1985
+ const { minute: a, hour: f } = At(t);
1793
1986
  s(f), d(a);
1794
1987
  }
1795
1988
  }, [t]);
1796
- const o = g((a) => {
1797
- s(a), e == null || e(`${Tt(String(a != null ? a : 0))}:${xt(String(c != null ? c : 0))}`);
1798
- }, [c, e]), l = g((a) => {
1799
- d(a), e == null || e(`${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`);
1800
- }, [r, e]);
1801
- return /* @__PURE__ */ E(R, {
1802
- className: ye.timePicker,
1803
- children: [/* @__PURE__ */ i(qt, {
1804
- items: _n,
1805
- onClick: o,
1806
- selectedItem: r,
1807
- canScrollRef: n
1808
- }), /* @__PURE__ */ i(ht, {}), /* @__PURE__ */ i(qt, {
1809
- items: Jn,
1810
- onClick: l,
1811
- selectedItem: c,
1812
- canScrollRef: n
1813
- })]
1814
- });
1989
+ const o = g(
1990
+ (a) => {
1991
+ s(a), e == null || e(
1992
+ `${Tt(String(a != null ? a : 0))}:${xt(String(c != null ? c : 0))}`
1993
+ );
1994
+ },
1995
+ [c, e]
1996
+ ), l = g(
1997
+ (a) => {
1998
+ d(a), e == null || e(
1999
+ `${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`
2000
+ );
2001
+ },
2002
+ [r, e]
2003
+ );
2004
+ return /* @__PURE__ */ E(R, { className: ye.timePicker, children: [
2005
+ /* @__PURE__ */ i(
2006
+ qt,
2007
+ {
2008
+ items: _n,
2009
+ onClick: o,
2010
+ selectedItem: r,
2011
+ canScrollRef: n
2012
+ }
2013
+ ),
2014
+ /* @__PURE__ */ i(gt, {}),
2015
+ /* @__PURE__ */ i(
2016
+ qt,
2017
+ {
2018
+ items: Jn,
2019
+ onClick: l,
2020
+ selectedItem: c,
2021
+ canScrollRef: n
2022
+ }
2023
+ )
2024
+ ] });
1815
2025
  }, Gn = (t, e, n) => {
1816
2026
  Q(
1817
2027
  function() {
@@ -1988,25 +2198,38 @@ const Mr = ({
1988
2198
  onClickDay: at,
1989
2199
  onClickCalendarButton: ft,
1990
2200
  onClickArrowButton: ut
1991
- } = Xn(st, u, O, Y, w);
2201
+ } = Xn(
2202
+ st,
2203
+ u,
2204
+ O,
2205
+ Y,
2206
+ w
2207
+ );
1992
2208
  Gn(t, y, u);
1993
2209
  const v = C(() => {
1994
2210
  const Rt = t || N;
1995
- return Rt ? X(void 0, Rt, ["singleSelected", "selected"]) : {};
2211
+ return Rt ? X(void 0, Rt, [
2212
+ "singleSelected",
2213
+ "selected"
2214
+ ]) : {};
1996
2215
  }, [N, t]), L = g(() => {
1997
2216
  Y(), T();
1998
- }, [Y, T]), H = C(() => t ? Pn(t) : x, [t, x]), Mt = Yt(b, 300), Et = Yt(M, 300);
1999
- return /* @__PURE__ */ i(I, {
2000
- onKeyDown: lt,
2001
- children: /* @__PURE__ */ i(pt, {
2217
+ }, [Y, T]), H = C(
2218
+ () => t ? Pn(t) : x,
2219
+ [t, x]
2220
+ ), Mt = Yt(b, 300), Et = Yt(M, 300);
2221
+ return /* @__PURE__ */ i(I, { onKeyDown: lt, children: /* @__PURE__ */ i(
2222
+ pt,
2223
+ {
2002
2224
  arrow: !1,
2003
2225
  lazy: !0,
2004
2226
  disabled: h,
2005
2227
  placement: kt,
2006
2228
  visible: b || M,
2007
2229
  onClickOutside: L,
2008
- content: (Mt || Et) && /* @__PURE__ */ i(B, {
2009
- children: Mt ? /* @__PURE__ */ i(F, {
2230
+ content: (Mt || Et) && /* @__PURE__ */ i(B, { children: Mt ? /* @__PURE__ */ i(
2231
+ F,
2232
+ {
2010
2233
  statePerMonth: v,
2011
2234
  onClickDay: at,
2012
2235
  dateInFocus: m,
@@ -2015,53 +2238,51 @@ const Mr = ({
2015
2238
  setCurrentPanel: k,
2016
2239
  minDate: d,
2017
2240
  maxDate: a
2018
- }) : Et ? /* @__PURE__ */ E(B, {
2019
- children: [/* @__PURE__ */ i(B, {
2020
- overflow: "hidden",
2021
- height: "250px",
2022
- children: /* @__PURE__ */ i(Kn, {
2023
- value: H != null ? H : "",
2024
- onValueChange: P
2025
- })
2026
- }), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
2027
- justifyContent: "flex-end",
2028
- children: /* @__PURE__ */ i(dt, {
2029
- label: "Done",
2030
- onClick: T
2031
- })
2032
- })]
2033
- }) : null
2034
- }),
2035
- children: /* @__PURE__ */ i(ge, {
2036
- autoFocusLeft: c,
2037
- onEsc: r,
2038
- onEnter: n,
2039
- onBlur: s,
2040
- disabled: h,
2041
- separatorIcon: vt,
2042
- typeLeft: "date",
2043
- typeRight: "time",
2044
- placeholderLeft: "yyyy-mm-dd",
2045
- placeholderRight: "hh:mm",
2046
- onChangeLeft: j,
2047
- onChangeRight: _,
2048
- onClickArrowDown: ut,
2049
- onClickCalendar: ft,
2050
- onFocusLeft: K,
2051
- onFocusRight: ct,
2052
- onClickLeft: K,
2053
- onClickRight: ct,
2054
- inputRefLeft: u,
2055
- inputRefRight: D,
2056
- valueRight: H != null ? H : "",
2057
- widthLeft: o,
2058
- widthRight: l,
2059
- minLeft: d,
2060
- maxLeft: a,
2061
- variant: f
2062
- })
2063
- })
2064
- });
2241
+ }
2242
+ ) : Et ? /* @__PURE__ */ E(B, { children: [
2243
+ /* @__PURE__ */ i(B, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ i(
2244
+ Kn,
2245
+ {
2246
+ value: H != null ? H : "",
2247
+ onValueChange: P
2248
+ }
2249
+ ) }),
2250
+ /* @__PURE__ */ i($, {}),
2251
+ /* @__PURE__ */ i(R, { justifyContent: "flex-end", children: /* @__PURE__ */ i(dt, { label: "Done", onClick: T }) })
2252
+ ] }) : null }),
2253
+ children: /* @__PURE__ */ i(
2254
+ ge,
2255
+ {
2256
+ autoFocusLeft: c,
2257
+ onEsc: r,
2258
+ onEnter: n,
2259
+ onBlur: s,
2260
+ disabled: h,
2261
+ separatorIcon: vt,
2262
+ typeLeft: "date",
2263
+ typeRight: "time",
2264
+ placeholderLeft: "yyyy-mm-dd",
2265
+ placeholderRight: "hh:mm",
2266
+ onChangeLeft: j,
2267
+ onChangeRight: _,
2268
+ onClickArrowDown: ut,
2269
+ onClickCalendar: ft,
2270
+ onFocusLeft: K,
2271
+ onFocusRight: ct,
2272
+ onClickLeft: K,
2273
+ onClickRight: ct,
2274
+ inputRefLeft: u,
2275
+ inputRefRight: D,
2276
+ valueRight: H != null ? H : "",
2277
+ widthLeft: o,
2278
+ widthRight: l,
2279
+ minLeft: d,
2280
+ maxLeft: a,
2281
+ variant: f
2282
+ }
2283
+ )
2284
+ }
2285
+ ) });
2065
2286
  }, Zn = (t, e, n, r, s) => {
2066
2287
  Q(
2067
2288
  function() {
@@ -2256,10 +2477,7 @@ function Ar({
2256
2477
  variant: h,
2257
2478
  disabled: u
2258
2479
  }) {
2259
- const {
2260
- startDate: D,
2261
- endDate: w
2262
- } = t || {}, k = J(null), p = J(null), b = vn(D, w), {
2480
+ const { startDate: D, endDate: w } = t || {}, k = J(null), p = J(null), b = vn(D, w), {
2263
2481
  dateInFocus: m,
2264
2482
  setDateInFocus: y,
2265
2483
  isCalendarVisible: M,
@@ -2277,60 +2495,92 @@ function Ar({
2277
2495
  onClickDay: lt,
2278
2496
  onClickCalendarButton: ct,
2279
2497
  onClickArrowButton: K
2280
- } = Vn(D, w, e, k, p, N, O, b);
2281
- Zn(D, w, y, k, p);
2282
- const at = C(() => D && w && et(D, w), [D, w]), ft = C(() => Be(l == null ? void 0 : l.statePerMonth, D, w, m), [l == null ? void 0 : l.statePerMonth, D, w, m]), ut = Yt(M, 300);
2283
- return /* @__PURE__ */ i(I, {
2284
- onKeyDown: _,
2285
- children: /* @__PURE__ */ i(pt, {
2498
+ } = Vn(
2499
+ D,
2500
+ w,
2501
+ e,
2502
+ k,
2503
+ p,
2504
+ N,
2505
+ O,
2506
+ b
2507
+ );
2508
+ Zn(
2509
+ D,
2510
+ w,
2511
+ y,
2512
+ k,
2513
+ p
2514
+ );
2515
+ const at = C(
2516
+ () => D && w && et(D, w),
2517
+ [D, w]
2518
+ ), ft = C(
2519
+ () => Be(
2520
+ l == null ? void 0 : l.statePerMonth,
2521
+ D,
2522
+ w,
2523
+ m
2524
+ ),
2525
+ [l == null ? void 0 : l.statePerMonth, D, w, m]
2526
+ ), ut = Yt(M, 300);
2527
+ return /* @__PURE__ */ i(I, { onKeyDown: _, children: /* @__PURE__ */ i(
2528
+ pt,
2529
+ {
2286
2530
  arrow: !1,
2287
2531
  lazy: !0,
2288
2532
  disabled: u,
2289
2533
  placement: kt,
2290
2534
  onClickOutside: O,
2291
2535
  visible: M,
2292
- content: ut && /* @__PURE__ */ i(F, {
2293
- onClickDay: lt,
2294
- dateInFocus: m,
2295
- setDateInFocus: y,
2296
- currentPanel: T,
2297
- setCurrentPanel: x,
2298
- minDate: d,
2299
- maxDate: o,
2300
- ...l,
2301
- statePerMonth: ft
2302
- }),
2303
- children: /* @__PURE__ */ i(ge, {
2304
- autoFocusLeft: n,
2305
- onEsc: c,
2306
- onEnter: s,
2307
- onBlur: r,
2308
- disabled: u,
2309
- separatorIcon: Qt,
2310
- typeLeft: "date",
2311
- typeRight: "date",
2312
- placeholderLeft: "Start date",
2313
- placeholderRight: "End date",
2314
- onChangeLeft: Y,
2315
- onChangeRight: j,
2316
- onClickArrowDown: K,
2317
- onClickCalendar: ct,
2318
- onFocusLeft: st,
2319
- onFocusRight: P,
2320
- onClickLeft: st,
2321
- onClickRight: P,
2322
- inputRefLeft: k,
2323
- inputRefRight: p,
2324
- variant: at ? "error" : h,
2325
- widthLeft: a,
2326
- widthRight: f,
2327
- minLeft: d,
2328
- maxLeft: o,
2329
- minRight: d,
2330
- maxRight: o
2331
- })
2332
- })
2333
- });
2536
+ content: ut && /* @__PURE__ */ i(
2537
+ F,
2538
+ {
2539
+ onClickDay: lt,
2540
+ dateInFocus: m,
2541
+ setDateInFocus: y,
2542
+ currentPanel: T,
2543
+ setCurrentPanel: x,
2544
+ minDate: d,
2545
+ maxDate: o,
2546
+ ...l,
2547
+ statePerMonth: ft
2548
+ }
2549
+ ),
2550
+ children: /* @__PURE__ */ i(
2551
+ ge,
2552
+ {
2553
+ autoFocusLeft: n,
2554
+ onEsc: c,
2555
+ onEnter: s,
2556
+ onBlur: r,
2557
+ disabled: u,
2558
+ separatorIcon: Qt,
2559
+ typeLeft: "date",
2560
+ typeRight: "date",
2561
+ placeholderLeft: "Start date",
2562
+ placeholderRight: "End date",
2563
+ onChangeLeft: Y,
2564
+ onChangeRight: j,
2565
+ onClickArrowDown: K,
2566
+ onClickCalendar: ct,
2567
+ onFocusLeft: st,
2568
+ onFocusRight: P,
2569
+ onClickLeft: st,
2570
+ onClickRight: P,
2571
+ inputRefLeft: k,
2572
+ inputRefRight: p,
2573
+ variant: at ? "error" : h,
2574
+ widthLeft: a,
2575
+ widthRight: f,
2576
+ minLeft: d,
2577
+ maxLeft: o,
2578
+ minRight: d,
2579
+ maxRight: o
2580
+ }
2581
+ )
2582
+ }
2583
+ ) });
2334
2584
  }
2335
2585
  export {
2336
2586
  Lt as Calendar,