@stenajs-webui/calendar 17.30.2 → 17.30.4
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/CHANGELOG.md +12 -0
- package/dist/index.es.js +105 -103
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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 { FlatButton as A, stenaAngleLeft as Wt, stenaAngleRight as
|
|
3
|
-
import { Box as N, Text as it, Clickable as
|
|
4
|
-
import { isAfter as et, eachDayOfInterval as Pt, isSameDay as z, endOfMonth as Xt, startOfMonth as Zt, min as
|
|
5
|
-
import { enGB as
|
|
6
|
-
import { last as He, chunk as
|
|
7
|
-
import * as
|
|
2
|
+
import { FlatButton as A, stenaAngleLeft as Wt, stenaAngleRight as Ot, PrimaryButton as dt, stenaCalendar as ht, Icon as qt, stenaClock as Qt, stenaAngleDown as ye, stenaArrowRight as me } from "@stenajs-webui/elements";
|
|
3
|
+
import { Box as N, Text as it, Clickable as $t, Row as R, Space as $, Spacing as we, Indent as gt, Column as B, SeparatorLine as pe, parseIntElseUndefined as _t, useBoolean as Ht, useDelayedFalse as Yt } from "@stenajs-webui/core";
|
|
4
|
+
import { isAfter as et, eachDayOfInterval as Pt, isSameDay as z, endOfMonth as Xt, startOfMonth as Zt, min as be, addDays as q, max as ke, subDays as Dt, format as W, getISOWeek as Bt, getDate as Ct, startOfWeek as Ft, addWeeks as Se, getMonth as tt, getWeek as vt, getYear as yt, getISODay as Me, addHours as Ee, isBefore as Re, parse as ot, addMonths as Ae, addYears as Te, subMonths as xe, subYears as Ce, setWeek as Ie, isValid as Ne } from "date-fns";
|
|
5
|
+
import { enGB as Vt } from "date-fns/locale";
|
|
6
|
+
import { last as He, chunk as te, range as zt, debounce as Ye } from "lodash";
|
|
7
|
+
import * as ee from "react";
|
|
8
8
|
import { useMemo as C, useCallback as g, useState as S, useEffect as Q, useRef as J } from "react";
|
|
9
9
|
import { jsx as i, jsxs as E, Fragment as mt } from "react/jsx-runtime";
|
|
10
10
|
import It from "@emotion/styled";
|
|
11
|
-
import { faAngleDoubleLeft as
|
|
12
|
-
import { faAngleDoubleRight as
|
|
11
|
+
import { faAngleDoubleLeft as ne } from "@fortawesome/free-solid-svg-icons/faAngleDoubleLeft";
|
|
12
|
+
import { faAngleDoubleRight as re } from "@fortawesome/free-solid-svg-icons/faAngleDoubleRight";
|
|
13
13
|
import { faCaretLeft as Le } from "@fortawesome/free-solid-svg-icons/faCaretLeft";
|
|
14
14
|
import { faCaretRight as Ue } from "@fortawesome/free-solid-svg-icons/faCaretRight";
|
|
15
15
|
import { TextInput as nt, TextInputBox as We } from "@stenajs-webui/forms";
|
|
16
|
-
import { useTippyInstance as
|
|
17
|
-
import { cssColor as
|
|
18
|
-
import { faLongArrowAltRight as
|
|
16
|
+
import { useTippyInstance as Oe, Popover as pt } from "@stenajs-webui/tooltip";
|
|
17
|
+
import { cssColor as se } from "@stenajs-webui/theme";
|
|
18
|
+
import { faLongArrowAltRight as $e } from "@fortawesome/free-solid-svg-icons/faLongArrowAltRight";
|
|
19
19
|
const Z = {
|
|
20
20
|
yearAndMonth: "yyyy-MM",
|
|
21
21
|
fullDate: "yyyy-MM-dd",
|
|
@@ -45,8 +45,8 @@ const Z = {
|
|
|
45
45
|
Xt(r)
|
|
46
46
|
), Be = (t = {}, e, n, r, s) => e && n ? wt(
|
|
47
47
|
t,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
ke([e, Dt(r, 1)]),
|
|
49
|
+
be([n, q(s, 1)])
|
|
50
50
|
) : wt(t, e, n), gr = (t, e, n) => {
|
|
51
51
|
const r = W(e, Z.yearAndMonth), s = Bt(e), c = Ct(e);
|
|
52
52
|
return {
|
|
@@ -87,11 +87,11 @@ const Z = {
|
|
|
87
87
|
...t && t[s],
|
|
88
88
|
[c]: {
|
|
89
89
|
...t && t[s] && t[s][c],
|
|
90
|
-
[d]:
|
|
90
|
+
[d]: ce(o, n)
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
},
|
|
94
|
+
}, ce = (t, e) => {
|
|
95
95
|
var n;
|
|
96
96
|
return {
|
|
97
97
|
...t,
|
|
@@ -127,9 +127,9 @@ var U = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1]
|
|
|
127
127
|
const Jt = (t, e, n, r) => {
|
|
128
128
|
const s = [];
|
|
129
129
|
for (let c = 0; c < n; c++)
|
|
130
|
-
s.push(
|
|
130
|
+
s.push(ie(t, e + c, r));
|
|
131
131
|
return s;
|
|
132
|
-
},
|
|
132
|
+
}, ie = (t, e, n) => {
|
|
133
133
|
const r = t + Math.floor(e / 12), s = e % 12, c = new Date(r, s, 1);
|
|
134
134
|
return {
|
|
135
135
|
monthString: W(c, Z.yearAndMonth),
|
|
@@ -139,7 +139,7 @@ const Jt = (t, e, n, r) => {
|
|
|
139
139
|
weeks: Je(r, s, n)
|
|
140
140
|
};
|
|
141
141
|
}, Je = (t, e, n, r = !0) => {
|
|
142
|
-
const s = new Date(t, e, 1), c =
|
|
142
|
+
const s = new Date(t, e, 1), c = Ft(s, { locale: n }), d = [];
|
|
143
143
|
for (let o = 0; o < 6; o++) {
|
|
144
144
|
const l = jt(Se(c, o), n);
|
|
145
145
|
if (o > 0 && l.startMonth !== e && !r)
|
|
@@ -150,7 +150,7 @@ const Jt = (t, e, n, r) => {
|
|
|
150
150
|
}, jt = (t, e) => {
|
|
151
151
|
const n = tt(q(t, 7)) !== tt(t);
|
|
152
152
|
return {
|
|
153
|
-
weekNumber:
|
|
153
|
+
weekNumber: vt(t, { locale: e }),
|
|
154
154
|
startMonth: tt(t),
|
|
155
155
|
startYear: yt(t),
|
|
156
156
|
endMonth: tt(q(t, 6)),
|
|
@@ -164,7 +164,7 @@ const Jt = (t, e, n, r) => {
|
|
|
164
164
|
date: t,
|
|
165
165
|
name: W(t, "EEE", e ? { locale: e } : void 0),
|
|
166
166
|
dateString: W(Ee(t, 12), Z.fullDate),
|
|
167
|
-
weekNumber:
|
|
167
|
+
weekNumber: vt(t, { locale: e }),
|
|
168
168
|
year: yt(t),
|
|
169
169
|
month: tt(t),
|
|
170
170
|
dayOfMonth: Ct(t),
|
|
@@ -261,7 +261,7 @@ const Jt = (t, e, n, r) => {
|
|
|
261
261
|
day: c,
|
|
262
262
|
...d
|
|
263
263
|
}) {
|
|
264
|
-
const o = C(() => Ve(c.date, n, r) ? s :
|
|
264
|
+
const o = C(() => Ve(c.date, n, r) ? s : ce(s, ["disabled"]), [c.date, s, r, n]);
|
|
265
265
|
return /* @__PURE__ */ i(e, {
|
|
266
266
|
day: c,
|
|
267
267
|
...d,
|
|
@@ -294,7 +294,7 @@ const Jt = (t, e, n, r) => {
|
|
|
294
294
|
return /* @__PURE__ */ i(N, {
|
|
295
295
|
background: s || e.WeekNumber.backgroundColor,
|
|
296
296
|
position: "relative",
|
|
297
|
-
children: t ? /* @__PURE__ */ i(
|
|
297
|
+
children: t ? /* @__PURE__ */ i($t, {
|
|
298
298
|
borderRadius: "var(--swui-calendar-day-border-radius)",
|
|
299
299
|
onClick: (o) => t(n, o),
|
|
300
300
|
disableFocusHighlight: !t,
|
|
@@ -356,13 +356,13 @@ const rn = ({
|
|
|
356
356
|
children: e.name
|
|
357
357
|
})
|
|
358
358
|
});
|
|
359
|
-
return t ? /* @__PURE__ */ i(
|
|
359
|
+
return t ? /* @__PURE__ */ i($t, {
|
|
360
360
|
borderRadius: "var(--swui-calendar-day-border-radius)",
|
|
361
361
|
onClick: (s) => t(e.dayOfWeek, s),
|
|
362
362
|
disableFocusHighlight: !t,
|
|
363
363
|
children: r
|
|
364
364
|
}) : r;
|
|
365
|
-
},
|
|
365
|
+
}, oe = function({
|
|
366
366
|
day: e,
|
|
367
367
|
week: n,
|
|
368
368
|
month: r,
|
|
@@ -405,7 +405,7 @@ const rn = ({
|
|
|
405
405
|
dayState: s,
|
|
406
406
|
theme: o,
|
|
407
407
|
userData: c
|
|
408
|
-
}), d && sn(a, s) ? /* @__PURE__ */ i(
|
|
408
|
+
}), d && sn(a, s) ? /* @__PURE__ */ i($t, {
|
|
409
409
|
onClick: (m) => d(e, c, m),
|
|
410
410
|
style: {
|
|
411
411
|
width: "100%",
|
|
@@ -423,7 +423,7 @@ const rn = ({
|
|
|
423
423
|
}, sn = (t, e) => !!V(e, t, ["enabled", "disabled"], [!0, !1], !0);
|
|
424
424
|
function cn({
|
|
425
425
|
month: t,
|
|
426
|
-
dayComponent: e =
|
|
426
|
+
dayComponent: e = oe,
|
|
427
427
|
statePerWeek: n,
|
|
428
428
|
userDataPerWeek: r,
|
|
429
429
|
minDate: s,
|
|
@@ -463,7 +463,7 @@ function cn({
|
|
|
463
463
|
}) : /* @__PURE__ */ i(it, {
|
|
464
464
|
children: t.name
|
|
465
465
|
})
|
|
466
|
-
}), /* @__PURE__ */ i(
|
|
466
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
|
|
467
467
|
width: "64px",
|
|
468
468
|
justifyContent: "center",
|
|
469
469
|
children: f ? /* @__PURE__ */ i(A, {
|
|
@@ -514,7 +514,7 @@ function cn({
|
|
|
514
514
|
}
|
|
515
515
|
function on({
|
|
516
516
|
monthRows: t,
|
|
517
|
-
dayComponent: e =
|
|
517
|
+
dayComponent: e = oe,
|
|
518
518
|
userDataPerMonth: n,
|
|
519
519
|
statePerMonth: r,
|
|
520
520
|
minDate: s,
|
|
@@ -535,10 +535,10 @@ function on({
|
|
|
535
535
|
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]);
|
|
536
536
|
return /* @__PURE__ */ i("div", {
|
|
537
537
|
className: Xe.calendar,
|
|
538
|
-
children: t.map((M, T) => /* @__PURE__ */ i(
|
|
538
|
+
children: t.map((M, T) => /* @__PURE__ */ i(we, {
|
|
539
539
|
children: /* @__PURE__ */ i(R, {
|
|
540
|
-
children: M.map((x, I) => /* @__PURE__ */ E(
|
|
541
|
-
children: [I > 0 && /* @__PURE__ */ i(
|
|
540
|
+
children: M.map((x, I) => /* @__PURE__ */ E(ee.Fragment, {
|
|
541
|
+
children: [I > 0 && /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(cn, {
|
|
542
542
|
month: x,
|
|
543
543
|
dayComponent: e,
|
|
544
544
|
userDataPerWeek: n && n[x.monthString],
|
|
@@ -568,7 +568,7 @@ function Lt(t) {
|
|
|
568
568
|
const e = dn(t.year, t.month, t.date), {
|
|
569
569
|
year: n,
|
|
570
570
|
month: r
|
|
571
|
-
} = qe(e.year, e.month), s = ln(n, r, (d = t.locale) != null ? d :
|
|
571
|
+
} = qe(e.year, e.month), s = ln(n, r, (d = t.locale) != null ? d : Vt, t.numMonths, t.monthsPerRow), c = je(t.highlightToday, t.statePerMonth);
|
|
572
572
|
return /* @__PURE__ */ i(on, {
|
|
573
573
|
year: n,
|
|
574
574
|
month: r,
|
|
@@ -593,7 +593,7 @@ const dn = (t, e, n) => {
|
|
|
593
593
|
month: tt(r),
|
|
594
594
|
year: yt(r)
|
|
595
595
|
};
|
|
596
|
-
}, ln = (t, e, n, r, s) => r == null ? [[
|
|
596
|
+
}, ln = (t, e, n, r, s) => r == null ? [[ie(t, e, n)]] : s == null ? [Jt(t, e, r, n)] : te(Jt(t, e, r, n), s), an = (t, e, n, r) => {
|
|
597
597
|
const s = g(() => {
|
|
598
598
|
var a;
|
|
599
599
|
const l = Ae(t, (a = n != null ? n : r) != null ? a : 1);
|
|
@@ -626,21 +626,21 @@ const dn = (t, e, n) => {
|
|
|
626
626
|
children: /* @__PURE__ */ E(R, {
|
|
627
627
|
children: [/* @__PURE__ */ i(A, {
|
|
628
628
|
onClick: r,
|
|
629
|
-
leftIcon:
|
|
630
|
-
}), /* @__PURE__ */ i(
|
|
629
|
+
leftIcon: ne
|
|
630
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
631
631
|
onClick: e,
|
|
632
632
|
leftIcon: Wt
|
|
633
633
|
}), /* @__PURE__ */ i(gt, {
|
|
634
634
|
num: 2
|
|
635
635
|
}), /* @__PURE__ */ i(A, {
|
|
636
636
|
onClick: n,
|
|
637
|
-
leftIcon:
|
|
638
|
-
}), /* @__PURE__ */ i(
|
|
637
|
+
leftIcon: Ot
|
|
638
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
639
639
|
onClick: s,
|
|
640
|
-
leftIcon:
|
|
640
|
+
leftIcon: re
|
|
641
641
|
})]
|
|
642
642
|
})
|
|
643
|
-
}), /* @__PURE__ */ i(
|
|
643
|
+
}), /* @__PURE__ */ i($, {})]
|
|
644
644
|
}), un = ({
|
|
645
645
|
value: t,
|
|
646
646
|
onValueChange: e,
|
|
@@ -712,17 +712,17 @@ const dn = (t, e, n) => {
|
|
|
712
712
|
children: s.label
|
|
713
713
|
}), /* @__PURE__ */ i(A, {
|
|
714
714
|
size: "small",
|
|
715
|
-
leftIcon:
|
|
715
|
+
leftIcon: Ot,
|
|
716
716
|
disabled: e === r.length - 1,
|
|
717
717
|
onClick: () => n(e + 1)
|
|
718
718
|
})]
|
|
719
|
-
}), /* @__PURE__ */ i(
|
|
719
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(B, {
|
|
720
720
|
alignItems: "center",
|
|
721
|
-
children: s.presets.map((d) => /* @__PURE__ */ E(
|
|
721
|
+
children: s.presets.map((d) => /* @__PURE__ */ E(ee.Fragment, {
|
|
722
722
|
children: [/* @__PURE__ */ i(dt, {
|
|
723
723
|
label: d.label,
|
|
724
724
|
onClick: () => t(d)
|
|
725
|
-
}), /* @__PURE__ */ i(
|
|
725
|
+
}), /* @__PURE__ */ i($, {})]
|
|
726
726
|
}, d.label))
|
|
727
727
|
})]
|
|
728
728
|
});
|
|
@@ -752,7 +752,7 @@ const dn = (t, e, n) => {
|
|
|
752
752
|
}) => {
|
|
753
753
|
const [r, s] = S(() => t ? t + 4 : n != null ? n : new Date().getFullYear() + 4), c = C(() => {
|
|
754
754
|
const d = r - 11;
|
|
755
|
-
return
|
|
755
|
+
return te(zt(d, r + 1), 3);
|
|
756
756
|
}, [r]);
|
|
757
757
|
return Q(() => {
|
|
758
758
|
s((d) => pn(t, d));
|
|
@@ -891,8 +891,8 @@ function F({
|
|
|
891
891
|
children: [!o && /* @__PURE__ */ i(A, {
|
|
892
892
|
size: "small",
|
|
893
893
|
onClick: D,
|
|
894
|
-
leftIcon:
|
|
895
|
-
}), /* @__PURE__ */ i(
|
|
894
|
+
leftIcon: ne
|
|
895
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(A, {
|
|
896
896
|
size: "small",
|
|
897
897
|
onClick: f,
|
|
898
898
|
leftIcon: Wt
|
|
@@ -903,11 +903,11 @@ function F({
|
|
|
903
903
|
children: [/* @__PURE__ */ i(A, {
|
|
904
904
|
size: "small",
|
|
905
905
|
onClick: a,
|
|
906
|
-
leftIcon:
|
|
907
|
-
}), /* @__PURE__ */ i(
|
|
906
|
+
leftIcon: Ot
|
|
907
|
+
}), /* @__PURE__ */ i($, {}), !o && /* @__PURE__ */ i(A, {
|
|
908
908
|
size: "small",
|
|
909
909
|
onClick: h,
|
|
910
|
-
leftIcon:
|
|
910
|
+
leftIcon: re
|
|
911
911
|
})]
|
|
912
912
|
})
|
|
913
913
|
})
|
|
@@ -932,23 +932,23 @@ const Sn = (t, e) => t || (e || 1) > 1 ? "below" : "header", Mn = (t) => ({
|
|
|
932
932
|
startDate: t ? ot(t, "yyyy-MM-dd", n) : void 0,
|
|
933
933
|
endDate: e ? ot(e, "yyyy-MM-dd", n) : void 0
|
|
934
934
|
};
|
|
935
|
-
},
|
|
935
|
+
}, de = ({
|
|
936
936
|
startDate: t,
|
|
937
937
|
endDate: e
|
|
938
938
|
}) => Boolean(
|
|
939
939
|
t && e && !z(t, e) && et(t, e)
|
|
940
|
-
),
|
|
940
|
+
), le = (t) => de(t) ? {
|
|
941
941
|
startDate: t.endDate,
|
|
942
942
|
endDate: t.startDate
|
|
943
943
|
} : t, pr = (t) => t.startDate && t.endDate ? Mn(
|
|
944
|
-
|
|
945
|
-
) : t,
|
|
944
|
+
le(En(t))
|
|
945
|
+
) : t, ae = (t, e, n, r) => g(
|
|
946
946
|
(s) => {
|
|
947
947
|
const c = {
|
|
948
948
|
startDate: n === "startDate" ? s.date : t == null ? void 0 : t.startDate,
|
|
949
949
|
endDate: n === "endDate" ? s.date : t == null ? void 0 : t.endDate
|
|
950
950
|
};
|
|
951
|
-
|
|
951
|
+
de(c) || r(n === "startDate" ? "endDate" : "startDate"), e == null || e(le(c));
|
|
952
952
|
},
|
|
953
953
|
[
|
|
954
954
|
n,
|
|
@@ -973,7 +973,7 @@ const Sn = (t, e) => t || (e || 1) > 1 ? "below" : "header", Mn = (t) => ({
|
|
|
973
973
|
statePerMonth: s,
|
|
974
974
|
onChangePanel: c
|
|
975
975
|
}) => {
|
|
976
|
-
const { currentPanel: d, setCurrentPanel: o } = bt(c), [l, a] = S(() => new Date()), f =
|
|
976
|
+
const { currentPanel: d, setCurrentPanel: o } = bt(c), [l, a] = S(() => new Date()), f = ae(
|
|
977
977
|
e,
|
|
978
978
|
n,
|
|
979
979
|
t,
|
|
@@ -1040,7 +1040,7 @@ const kr = () => {
|
|
|
1040
1040
|
setDateInFocus: o
|
|
1041
1041
|
};
|
|
1042
1042
|
};
|
|
1043
|
-
function
|
|
1043
|
+
function fe(t) {
|
|
1044
1044
|
const e = An(t);
|
|
1045
1045
|
return /* @__PURE__ */ i(F, {
|
|
1046
1046
|
...t,
|
|
@@ -1086,7 +1086,7 @@ const xn = ({
|
|
|
1086
1086
|
value: e,
|
|
1087
1087
|
statePerMonth: n,
|
|
1088
1088
|
onChangePanel: r,
|
|
1089
|
-
locale: s =
|
|
1089
|
+
locale: s = Vt
|
|
1090
1090
|
}) => {
|
|
1091
1091
|
const [c, d] = S(() => {
|
|
1092
1092
|
const u = Nt(e, s);
|
|
@@ -1125,7 +1125,9 @@ const xn = ({
|
|
|
1125
1125
|
if (!t)
|
|
1126
1126
|
return;
|
|
1127
1127
|
const n = t.split("-"), r = parseInt(n[1], 10), s = parseInt(n[0], 10), c = new Date();
|
|
1128
|
-
|
|
1128
|
+
c.setFullYear(s);
|
|
1129
|
+
const d = Ft(Ie(c, r), { locale: e });
|
|
1130
|
+
return jt(d, e);
|
|
1129
1131
|
};
|
|
1130
1132
|
function Mr(t) {
|
|
1131
1133
|
const e = xn(t);
|
|
@@ -1157,7 +1159,7 @@ const Cn = (t, e) => t.filter((n) => !z(n, e)), In = (t, e) => !!t.find((n) => z
|
|
|
1157
1159
|
b ? e([b]) : w && e([w]);
|
|
1158
1160
|
},
|
|
1159
1161
|
[e]
|
|
1160
|
-
), u =
|
|
1162
|
+
), u = ae(
|
|
1161
1163
|
s,
|
|
1162
1164
|
D,
|
|
1163
1165
|
d,
|
|
@@ -1184,8 +1186,8 @@ function Er(t) {
|
|
|
1184
1186
|
...e
|
|
1185
1187
|
});
|
|
1186
1188
|
}
|
|
1187
|
-
const kt = "bottom",
|
|
1188
|
-
const [t, e] =
|
|
1189
|
+
const kt = "bottom", ue = () => {
|
|
1190
|
+
const [t, e] = Oe();
|
|
1189
1191
|
return {
|
|
1190
1192
|
onChangePanel: g(() => {
|
|
1191
1193
|
var r, s;
|
|
@@ -1230,7 +1232,7 @@ const kt = "bottom", fe = () => {
|
|
|
1230
1232
|
} = Yn(l, o, d), {
|
|
1231
1233
|
tippyRef: y,
|
|
1232
1234
|
onChangePanel: M
|
|
1233
|
-
} =
|
|
1235
|
+
} = ue();
|
|
1234
1236
|
return /* @__PURE__ */ i(N, {
|
|
1235
1237
|
width: h,
|
|
1236
1238
|
children: /* @__PURE__ */ i(pt, {
|
|
@@ -1243,7 +1245,7 @@ const kt = "bottom", fe = () => {
|
|
|
1243
1245
|
appendTo: a != null ? a : "parent",
|
|
1244
1246
|
tippyRef: y,
|
|
1245
1247
|
disabled: m,
|
|
1246
|
-
content: /* @__PURE__ */ i(
|
|
1248
|
+
content: /* @__PURE__ */ i(fe, {
|
|
1247
1249
|
...c,
|
|
1248
1250
|
onChange: b,
|
|
1249
1251
|
value: n,
|
|
@@ -1326,7 +1328,7 @@ function Ar({
|
|
|
1326
1328
|
endDateInputRef: T,
|
|
1327
1329
|
onClickDay: x,
|
|
1328
1330
|
startDateIsAfterEnd: I
|
|
1329
|
-
} = Ln(s, c), [
|
|
1331
|
+
} = Ln(s, c), [O, Y] = S(() => {
|
|
1330
1332
|
var _;
|
|
1331
1333
|
return (_ = y && (s == null ? void 0 : s[y])) != null ? _ : new Date();
|
|
1332
1334
|
}), j = C(() => wt(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate), [s]);
|
|
@@ -1341,7 +1343,7 @@ function Ar({
|
|
|
1341
1343
|
onClickOutside: k,
|
|
1342
1344
|
content: /* @__PURE__ */ i(F, {
|
|
1343
1345
|
...a,
|
|
1344
|
-
dateInFocus:
|
|
1346
|
+
dateInFocus: O,
|
|
1345
1347
|
setDateInFocus: Y,
|
|
1346
1348
|
statePerMonth: j,
|
|
1347
1349
|
theme: l,
|
|
@@ -1363,11 +1365,11 @@ function Ar({
|
|
|
1363
1365
|
inputRef: M,
|
|
1364
1366
|
size: 9,
|
|
1365
1367
|
variant: I ? "error" : void 0
|
|
1366
|
-
}), /* @__PURE__ */ i(
|
|
1367
|
-
icon:
|
|
1368
|
-
color:
|
|
1368
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(qt, {
|
|
1369
|
+
icon: $e,
|
|
1370
|
+
color: se("--lhds-color-ui-500"),
|
|
1369
1371
|
size: 14
|
|
1370
|
-
}), /* @__PURE__ */ i(
|
|
1372
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(nt, {
|
|
1371
1373
|
iconLeft: ht,
|
|
1372
1374
|
onFocus: p,
|
|
1373
1375
|
value: s != null && s.endDate ? W(s.endDate, t) : "",
|
|
@@ -1402,7 +1404,7 @@ const Tr = ({
|
|
|
1402
1404
|
const [p, b] = S(!1), {
|
|
1403
1405
|
tippyRef: w,
|
|
1404
1406
|
onChangePanel: y
|
|
1405
|
-
} =
|
|
1407
|
+
} = ue(), M = g(() => {
|
|
1406
1408
|
b(!p);
|
|
1407
1409
|
}, [b, p]), T = g(() => {
|
|
1408
1410
|
b(!1);
|
|
@@ -1410,7 +1412,7 @@ const Tr = ({
|
|
|
1410
1412
|
s && s(P);
|
|
1411
1413
|
}, [s]), I = g((P) => {
|
|
1412
1414
|
P && (x(W(P, n)), e && setTimeout(() => b(!p), 200));
|
|
1413
|
-
}, [x, n, e, b, p]),
|
|
1415
|
+
}, [x, n, e, b, p]), O = !!o && !/^[-/\\.0-9]+$/.test(o), Y = !!o && Ne(ot(o, n, new Date())), _ = !!o && o.length >= n.length && !Y || O;
|
|
1414
1416
|
return /* @__PURE__ */ i(N, {
|
|
1415
1417
|
width: l,
|
|
1416
1418
|
children: /* @__PURE__ */ i(pt, {
|
|
@@ -1422,7 +1424,7 @@ const Tr = ({
|
|
|
1422
1424
|
placement: kt,
|
|
1423
1425
|
onClickOutside: T,
|
|
1424
1426
|
tippyRef: w,
|
|
1425
|
-
content: /* @__PURE__ */ i(
|
|
1427
|
+
content: /* @__PURE__ */ i(fe, {
|
|
1426
1428
|
...t,
|
|
1427
1429
|
onChange: I,
|
|
1428
1430
|
onChangePanel: y,
|
|
@@ -1549,7 +1551,7 @@ const Tr = ({
|
|
|
1549
1551
|
onBlur: f,
|
|
1550
1552
|
width: s
|
|
1551
1553
|
});
|
|
1552
|
-
},
|
|
1554
|
+
}, De = ({
|
|
1553
1555
|
autoFocusLeft: t,
|
|
1554
1556
|
autoFocusRight: e,
|
|
1555
1557
|
onEsc: n,
|
|
@@ -1574,7 +1576,7 @@ const Tr = ({
|
|
|
1574
1576
|
onClickCalendar: T,
|
|
1575
1577
|
onClickArrowDown: x,
|
|
1576
1578
|
onBlurLeft: I,
|
|
1577
|
-
onBlurRight:
|
|
1579
|
+
onBlurRight: O,
|
|
1578
1580
|
onFocusLeft: Y,
|
|
1579
1581
|
onFocusRight: j,
|
|
1580
1582
|
inputRefLeft: _,
|
|
@@ -1596,9 +1598,9 @@ const Tr = ({
|
|
|
1596
1598
|
L.current++, H(L.current), j && j(G);
|
|
1597
1599
|
}, [j, L, H]), Rt = g((G) => {
|
|
1598
1600
|
L.current--, H(L.current), I && I(G);
|
|
1599
|
-
}, [I, L, H]),
|
|
1600
|
-
L.current--, H(L.current),
|
|
1601
|
-
}, [
|
|
1601
|
+
}, [I, L, H]), ge = g((G) => {
|
|
1602
|
+
L.current--, H(L.current), O && O(G);
|
|
1603
|
+
}, [O, L, H]);
|
|
1602
1604
|
return /* @__PURE__ */ i(N, {
|
|
1603
1605
|
children: /* @__PURE__ */ E(We, {
|
|
1604
1606
|
disableContentPaddingRight: !0,
|
|
@@ -1617,13 +1619,13 @@ const Tr = ({
|
|
|
1617
1619
|
}), at ? /* @__PURE__ */ E(mt, {
|
|
1618
1620
|
children: [/* @__PURE__ */ i(R, {
|
|
1619
1621
|
height: "22px",
|
|
1620
|
-
children: /* @__PURE__ */ i(
|
|
1622
|
+
children: /* @__PURE__ */ i(pe, {
|
|
1621
1623
|
vertical: !0
|
|
1622
1624
|
})
|
|
1623
1625
|
}), /* @__PURE__ */ i(gt, {
|
|
1624
1626
|
num: 0.5,
|
|
1625
1627
|
children: /* @__PURE__ */ i(A, {
|
|
1626
|
-
leftIcon:
|
|
1628
|
+
leftIcon: ye,
|
|
1627
1629
|
onClick: x,
|
|
1628
1630
|
disabled: v,
|
|
1629
1631
|
size: "small"
|
|
@@ -1659,7 +1661,7 @@ const Tr = ({
|
|
|
1659
1661
|
children: /* @__PURE__ */ i(qt, {
|
|
1660
1662
|
icon: d,
|
|
1661
1663
|
size: 12,
|
|
1662
|
-
color:
|
|
1664
|
+
color: se("--lhds-color-ui-500")
|
|
1663
1665
|
})
|
|
1664
1666
|
}), /* @__PURE__ */ i(N, {
|
|
1665
1667
|
width: ut,
|
|
@@ -1673,7 +1675,7 @@ const Tr = ({
|
|
|
1673
1675
|
value: m,
|
|
1674
1676
|
onValueChange: c,
|
|
1675
1677
|
onChange: D,
|
|
1676
|
-
onBlur:
|
|
1678
|
+
onBlur: ge,
|
|
1677
1679
|
onFocus: Et,
|
|
1678
1680
|
inputRef: P,
|
|
1679
1681
|
variant: ct,
|
|
@@ -1707,14 +1709,14 @@ const Tr = ({
|
|
|
1707
1709
|
if (r < 0 || r > 59)
|
|
1708
1710
|
throw new Error("Invalid time.");
|
|
1709
1711
|
return n * 100 + r;
|
|
1710
|
-
},
|
|
1712
|
+
}, On = (t) => {
|
|
1711
1713
|
try {
|
|
1712
1714
|
return Wn(t), !0;
|
|
1713
1715
|
} catch {
|
|
1714
1716
|
return !1;
|
|
1715
1717
|
}
|
|
1716
1718
|
}, At = (t) => {
|
|
1717
|
-
if (t &&
|
|
1719
|
+
if (t && On(t)) {
|
|
1718
1720
|
const e = t.split(":");
|
|
1719
1721
|
return {
|
|
1720
1722
|
hour: _t(e[0]),
|
|
@@ -1725,9 +1727,9 @@ const Tr = ({
|
|
|
1725
1727
|
hour: void 0,
|
|
1726
1728
|
minute: void 0
|
|
1727
1729
|
};
|
|
1728
|
-
},
|
|
1730
|
+
}, $n = (t) => `${Tt(String(t.getHours()))}:${xt(
|
|
1729
1731
|
String(t.getMinutes())
|
|
1730
|
-
)}`, Pn = "_timePicker_1w05d_1", Bn = "_timePickerColumn_1w05d_6",
|
|
1732
|
+
)}`, Pn = "_timePicker_1w05d_1", Bn = "_timePickerColumn_1w05d_6", he = {
|
|
1731
1733
|
timePicker: Pn,
|
|
1732
1734
|
timePickerColumn: Bn
|
|
1733
1735
|
}, zn = ({
|
|
@@ -1765,7 +1767,7 @@ const Tr = ({
|
|
|
1765
1767
|
}) => {
|
|
1766
1768
|
const s = J(null);
|
|
1767
1769
|
return /* @__PURE__ */ i(B, {
|
|
1768
|
-
className:
|
|
1770
|
+
className: he.timePickerColumn,
|
|
1769
1771
|
ref: s,
|
|
1770
1772
|
children: e.map((c) => /* @__PURE__ */ i(zn, {
|
|
1771
1773
|
item: c,
|
|
@@ -1795,7 +1797,7 @@ const Tr = ({
|
|
|
1795
1797
|
d(a), e == null || e(`${Tt(String(r != null ? r : 0))}:${xt(String(a != null ? a : 0))}`);
|
|
1796
1798
|
}, [r, e]);
|
|
1797
1799
|
return /* @__PURE__ */ E(R, {
|
|
1798
|
-
className:
|
|
1800
|
+
className: he.timePicker,
|
|
1799
1801
|
children: [/* @__PURE__ */ i(Gt, {
|
|
1800
1802
|
items: jn,
|
|
1801
1803
|
onClick: o,
|
|
@@ -1971,7 +1973,7 @@ const Tr = ({
|
|
|
1971
1973
|
localTime: x,
|
|
1972
1974
|
localDate: I
|
|
1973
1975
|
} = m, {
|
|
1974
|
-
showCalendar:
|
|
1976
|
+
showCalendar: O,
|
|
1975
1977
|
hideCalendar: Y,
|
|
1976
1978
|
inputLeftChangeHandler: j,
|
|
1977
1979
|
inputRightChangeHandler: _,
|
|
@@ -1984,14 +1986,14 @@ const Tr = ({
|
|
|
1984
1986
|
onClickDay: at,
|
|
1985
1987
|
onClickCalendarButton: ft,
|
|
1986
1988
|
onClickArrowButton: ut
|
|
1987
|
-
} = Qn(st, D,
|
|
1989
|
+
} = Qn(st, D, O, Y, m);
|
|
1988
1990
|
Kn(t, y, D);
|
|
1989
1991
|
const v = C(() => {
|
|
1990
1992
|
const Rt = t || I;
|
|
1991
1993
|
return Rt ? X(void 0, Rt, ["singleSelected", "selected"]) : {};
|
|
1992
1994
|
}, [I, t]), L = g(() => {
|
|
1993
1995
|
Y(), T();
|
|
1994
|
-
}, [Y, T]), H = C(() => t ?
|
|
1996
|
+
}, [Y, T]), H = C(() => t ? $n(t) : x, [t, x]), Mt = Yt(b, 300), Et = Yt(M, 300);
|
|
1995
1997
|
return /* @__PURE__ */ i(N, {
|
|
1996
1998
|
onKeyDown: lt,
|
|
1997
1999
|
children: /* @__PURE__ */ i(pt, {
|
|
@@ -2019,7 +2021,7 @@ const Tr = ({
|
|
|
2019
2021
|
value: H != null ? H : "",
|
|
2020
2022
|
onValueChange: P
|
|
2021
2023
|
})
|
|
2022
|
-
}), /* @__PURE__ */ i(
|
|
2024
|
+
}), /* @__PURE__ */ i($, {}), /* @__PURE__ */ i(R, {
|
|
2023
2025
|
justifyContent: "flex-end",
|
|
2024
2026
|
children: /* @__PURE__ */ i(dt, {
|
|
2025
2027
|
label: "Done",
|
|
@@ -2028,7 +2030,7 @@ const Tr = ({
|
|
|
2028
2030
|
})]
|
|
2029
2031
|
}) : null
|
|
2030
2032
|
}),
|
|
2031
|
-
children: /* @__PURE__ */ i(
|
|
2033
|
+
children: /* @__PURE__ */ i(De, {
|
|
2032
2034
|
autoFocusLeft: c,
|
|
2033
2035
|
onEsc: r,
|
|
2034
2036
|
onEnter: n,
|
|
@@ -2263,7 +2265,7 @@ function Ir({
|
|
|
2263
2265
|
setCurrentPanel: x
|
|
2264
2266
|
} = b, {
|
|
2265
2267
|
showCalendar: I,
|
|
2266
|
-
hideCalendar:
|
|
2268
|
+
hideCalendar: O,
|
|
2267
2269
|
inputLeftChangeHandler: Y,
|
|
2268
2270
|
inputRightChangeHandler: j
|
|
2269
2271
|
} = Zn(u, m, e, b), {
|
|
@@ -2273,7 +2275,7 @@ function Ir({
|
|
|
2273
2275
|
onClickDay: lt,
|
|
2274
2276
|
onClickCalendarButton: ct,
|
|
2275
2277
|
onClickArrowButton: K
|
|
2276
|
-
} = vn(u, m, e, k, p, I,
|
|
2278
|
+
} = vn(u, m, e, k, p, I, O, b);
|
|
2277
2279
|
Xn(u, m, y, k, p);
|
|
2278
2280
|
const at = C(() => u && m && et(u, m), [u, m]), ft = C(() => Pe(l == null ? void 0 : l.statePerMonth, u, m, w), [l == null ? void 0 : l.statePerMonth, u, m, w]), ut = Yt(M, 300);
|
|
2279
2281
|
return /* @__PURE__ */ i(N, {
|
|
@@ -2283,7 +2285,7 @@ function Ir({
|
|
|
2283
2285
|
lazy: !0,
|
|
2284
2286
|
disabled: D,
|
|
2285
2287
|
placement: kt,
|
|
2286
|
-
onClickOutside:
|
|
2288
|
+
onClickOutside: O,
|
|
2287
2289
|
visible: M,
|
|
2288
2290
|
content: ut && /* @__PURE__ */ i(F, {
|
|
2289
2291
|
onClickDay: lt,
|
|
@@ -2296,13 +2298,13 @@ function Ir({
|
|
|
2296
2298
|
...l,
|
|
2297
2299
|
statePerMonth: ft
|
|
2298
2300
|
}),
|
|
2299
|
-
children: /* @__PURE__ */ i(
|
|
2301
|
+
children: /* @__PURE__ */ i(De, {
|
|
2300
2302
|
autoFocusLeft: n,
|
|
2301
2303
|
onEsc: c,
|
|
2302
2304
|
onEnter: s,
|
|
2303
2305
|
onBlur: r,
|
|
2304
2306
|
disabled: D,
|
|
2305
|
-
separatorIcon:
|
|
2307
|
+
separatorIcon: me,
|
|
2306
2308
|
typeLeft: "date",
|
|
2307
2309
|
typeRight: "date",
|
|
2308
2310
|
placeholderLeft: "Start date",
|
|
@@ -2330,7 +2332,7 @@ function Ir({
|
|
|
2330
2332
|
}
|
|
2331
2333
|
export {
|
|
2332
2334
|
Lt as Calendar,
|
|
2333
|
-
|
|
2335
|
+
oe as CalendarDay,
|
|
2334
2336
|
Rr as DateInput,
|
|
2335
2337
|
br as DateRangeCalendar,
|
|
2336
2338
|
Ir as DateRangeDualTextInput,
|
|
@@ -2342,7 +2344,7 @@ export {
|
|
|
2342
2344
|
hn as MonthPicker,
|
|
2343
2345
|
Sr as MultiDateCalendar,
|
|
2344
2346
|
yn as PresetPicker,
|
|
2345
|
-
|
|
2347
|
+
fe as SingleDateCalendar,
|
|
2346
2348
|
Mr as SingleWeekCalendar,
|
|
2347
2349
|
xr as TimeTextInput,
|
|
2348
2350
|
_e as WeekDay,
|
|
@@ -2350,7 +2352,7 @@ export {
|
|
|
2350
2352
|
en as WeekNumberCell,
|
|
2351
2353
|
wn as YearPicker,
|
|
2352
2354
|
X as addDayStateHighlights,
|
|
2353
|
-
|
|
2355
|
+
ce as addDayStateHighlightsOnSingleDay,
|
|
2354
2356
|
ze as addWeekRangeHighlights,
|
|
2355
2357
|
mr as addWeekStateHighlights,
|
|
2356
2358
|
wt as buildDayStateForDateRange,
|
|
@@ -2366,16 +2368,16 @@ export {
|
|
|
2366
2368
|
Fe as defaultWrapperStyleProvider,
|
|
2367
2369
|
wr as extranetCalendarTheme,
|
|
2368
2370
|
Ge as getDaysForWeekForDate,
|
|
2369
|
-
|
|
2371
|
+
ie as getMonthInYear,
|
|
2370
2372
|
Jt as getMonthsInYear,
|
|
2371
2373
|
jt as getWeekForDate,
|
|
2372
2374
|
Je as getWeeksForMonth,
|
|
2373
|
-
|
|
2375
|
+
de as isDateRangeInvalid,
|
|
2374
2376
|
gr as setDayStateValue,
|
|
2375
2377
|
yr as setDayStateValueFunction,
|
|
2376
2378
|
En as stringsToDateRange,
|
|
2377
2379
|
pr as toggleDateStringsIfEndIsEarlierThanStart,
|
|
2378
|
-
|
|
2380
|
+
le as toggleDatesIfEndIsEarlierThanStart,
|
|
2379
2381
|
kr as useDateRangeCalendarState,
|
|
2380
2382
|
Nn as useDateRangeExclusionSelection,
|
|
2381
2383
|
Rn as useDateRangeSelection,
|