@stenajs-webui/calendar 20.14.0 → 20.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/travel-calendar/components/TravelCalendar.d.ts +1 -0
- package/dist/index.es.js +1234 -1216
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._calendar_1b766_1{--swui-calendar-day-width: 48px;--swui-calendar-day-height: 48px;--swui-calendar-day-border-radius: var(--swui-max-border-radius);--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(--modern-red);--swui-calendar-wrapper-selected-background: var(--modern-red);--swui-calendar-wrapper-range-border: var(--lhds-color-red-100);--swui-calendar-wrapper-range-background: var(--lhds-color-red-100);--swui-calendar-wrapper-today-border: var(--lhds-color-ui-200);--swui-calendar-wrapper-today-background: var(--lhds-color-ui-50);--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_1b766_1 table{border-spacing:0 4px}._calendar_1b766_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_1b766_1._weekNumberVisible_1b766_41 tr td:nth-child(2),._calendar_1b766_1:not(._weekNumberVisible_1b766_41) tr td:first-child{border-top-left-radius:var(--swui-calendar-day-border-radius);border-bottom-left-radius:var(--swui-calendar-day-border-radius)}._calendar_1b766_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}._travelDateCell_1njsn_1{position:relative}._travelDateCell_1njsn_1._small_1njsn_4{width:40px;height:40px}._travelDateCell_1njsn_1._medium_1njsn_9{width:48px;height:48px}._travelDateCell_1njsn_1._large_1njsn_14{width:64px;height:64px}._travelDateCell_1njsn_1{border-radius:var(--swui-max-border-radius)}._travelDateCell_1njsn_1:focus{outline:none}._travelDateCell_1njsn_1:focus-visible ._outline_1njsn_26{outline:var(--swui-focus-outline);outline-width:var(--swui-focus-outline-width);background:transparent;position:absolute;border-radius:var(--swui-max-border-radius);top:0;bottom:0;left:0;right:0;z-index:10}._travelDateCell_1njsn_1:focus-visible ._contentWrapper_1njsn_39._contentWrapper_1njsn_39._contentWrapper_1njsn_39{border-color:transparent}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39{cursor:pointer;border-radius:var(--swui-max-border-radius);border-width:2px;border-style:solid;border-color:transparent;background:transparent;position:absolute;display:flex;align-items:center;justify-content:center;left:0;right:0;top:0;bottom:0}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._disabled_1njsn_60{cursor:not-allowed}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isToday_1njsn_63{border-color:var(--lhds-color-ui-400)}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isSelectionStart_1njsn_67,._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isSelectionEnd_1njsn_68{border-color:var(--modern-red)}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isSelectionStart_1njsn_67{background:var(--modern-red)}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isSelectionStart_1njsn_67 span{color:#fff}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._isSelectionEnd_1njsn_68:not(._isSelectionStart_1njsn_67){background:#fff}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._hover_1njsn_83{border-color:var(--modern-red)}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._hover_1njsn_83._startSelected_1njsn_86:not(._endSelected_1njsn_86):not(._isSelectionStart_1njsn_67){background:#fff}._travelDateCell_1njsn_1 ._contentWrapper_1njsn_39._hover_1njsn_83._startSelected_1njsn_86:not(._endSelected_1njsn_86):not(._isSelectionStart_1njsn_67) span{color:var(--swui-text-primary-color)}._travelDateCellBackground_1xm0q_1._small_1xm0q_2{width:20px;height:40px}._travelDateCellBackground_1xm0q_1._medium_1xm0q_7{width:24px;height:48px}._travelDateCellBackground_1xm0q_1._large_1xm0q_12{width:32px;height:64px}._travelCalendar_18pjj_1{border-spacing:0 4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}._travelCalendar_18pjj_1 td{padding:0}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2:not(._travelDateRangeInput_1j7rp_1 ._overlay_1j7rp_2._calendarVisible_1j7rp_6){opacity:0}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2{transition:opacity var(--swui-animation-time-fast) ease-in-out;opacity:1}._travelDateInput_hmfbf_1 ._overlay_hmfbf_2:not(._travelDateInput_hmfbf_1 ._overlay_hmfbf_2._calendarVisible_hmfbf_6){opacity:0}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
import { jsx as o, jsxs as
|
|
3
|
-
import { Box as A, Text as Dt, Clickable as Te, Row as
|
|
4
|
-
import { FlatButton as
|
|
5
|
-
import { isAfter as
|
|
6
|
-
import { enGB as zt, enUS as
|
|
7
|
-
import { last as
|
|
2
|
+
import { jsx as o, jsxs as _, Fragment as vt } from "react/jsx-runtime";
|
|
3
|
+
import { Box as A, Text as Dt, Clickable as Te, Row as H, Spacing as Ve, Column as C, Heading as _t, exhaustSwitchCase as le, Space as yt, Indent as Tt, SeparatorLine as tr, parseIntElseUndefined as be, useBoolean as ne, useDelayedFalse as se, useOnClickOutside as Ie } from "@stenajs-webui/core";
|
|
4
|
+
import { FlatButton as J, stenaAngleDown as de, PrimaryButton as Mt, stenaAngleLeft as er, stenaAngleRight as rr, SecondaryButton as lt, stenaAngleLeftDouble as nr, stenaArrowLeft as Ft, stenaArrowRight as Nt, stenaAngleRightDouble as sr, TextInputButton as ir, stenaCalendar as It, Icon as Re, stenaArrowWideRight as or, stenaClock as xe, stenaAngleUp as cr, CardBody as Ee } from "@stenajs-webui/elements";
|
|
5
|
+
import { isAfter as K, eachDayOfInterval as _e, isSameDay as P, endOfMonth as Ne, startOfMonth as Ae, min as ar, addDays as z, max as lr, subDays as ut, format as v, getISOWeek as ue, getDate as Ct, startOfWeek as Wt, addWeeks as dr, getMonth as ft, getWeek as Le, getYear as Rt, getISODay as ur, addHours as Pe, isBefore as st, parse as mt, addMonths as At, isSameMonth as it, addYears as fr, subMonths as fe, subYears as hr, setWeek as mr, isValid as gr } from "date-fns";
|
|
6
|
+
import { enGB as zt, enUS as pr, deAT as Dr, de as we, fr as br, es as wr, sv as yr, pl as Mr, da as kr, nl as Sr, nb as Tr } from "date-fns/locale";
|
|
7
|
+
import { last as Ir, startCase as xt, chunk as Ye, debounce as Rr, padStart as xr, range as he } from "lodash-es";
|
|
8
8
|
import * as me from "react";
|
|
9
|
-
import { useMemo as
|
|
9
|
+
import { useMemo as R, useRef as O, useEffect as Z, useCallback as b, useId as ge, useState as I, useLayoutEffect as Be } from "react";
|
|
10
10
|
import gt from "classnames";
|
|
11
11
|
import Zt from "@emotion/styled";
|
|
12
|
-
import { TextInput as pt, TextInputBox as
|
|
13
|
-
import { useTippyInstance as
|
|
12
|
+
import { TextInput as pt, TextInputBox as Er, LabelledTextInput as _r } from "@stenajs-webui/forms";
|
|
13
|
+
import { useTippyInstance as Nr, Popover as Lt } from "@stenajs-webui/tooltip";
|
|
14
14
|
import { cssColor as Kt } from "@stenajs-webui/theme";
|
|
15
|
-
import { useMaskedInput as
|
|
16
|
-
const
|
|
15
|
+
import { useMaskedInput as Ar } from "@stenajs-webui/input-mask";
|
|
16
|
+
const ot = {
|
|
17
17
|
yearAndMonth: "yyyy-MM",
|
|
18
18
|
fullDate: "yyyy-MM-dd",
|
|
19
19
|
fullMonthName: "LLLL",
|
|
@@ -27,81 +27,81 @@ const it = {
|
|
|
27
27
|
// 2 Jan
|
|
28
28
|
monthAndDate: "MMM do"
|
|
29
29
|
// Jan 2nd
|
|
30
|
-
}, Et = (t = {}, e,
|
|
31
|
-
if (e &&
|
|
32
|
-
return _e({ start: e, end:
|
|
30
|
+
}, Et = (t = {}, e, r) => {
|
|
31
|
+
if (e && r && K(r, e))
|
|
32
|
+
return _e({ start: e, end: r }).reduce(
|
|
33
33
|
(s, i) => {
|
|
34
|
-
const c = P(i, e), a = P(i,
|
|
35
|
-
return
|
|
34
|
+
const c = P(i, e), a = P(i, r);
|
|
35
|
+
return dt(s, i, c ? ["selected", "selectedStart", "range"] : a ? ["selected", "selectedEnd", "range"] : ["range"]);
|
|
36
36
|
},
|
|
37
37
|
t
|
|
38
38
|
);
|
|
39
|
-
let
|
|
40
|
-
return e && (
|
|
41
|
-
},
|
|
39
|
+
let n = t;
|
|
40
|
+
return e && (n = dt(n, e, ["selected", "singleSelected"])), r && (n = dt(n, r, ["selected", "singleSelected"])), n;
|
|
41
|
+
}, Lr = (t = {}, e, r, n) => Pr(
|
|
42
42
|
t,
|
|
43
43
|
e,
|
|
44
|
-
|
|
45
|
-
Ae(
|
|
46
|
-
Ne(
|
|
47
|
-
),
|
|
44
|
+
r,
|
|
45
|
+
Ae(n),
|
|
46
|
+
Ne(n)
|
|
47
|
+
), Pr = (t = {}, e, r, n, s) => e && r ? Et(
|
|
48
48
|
t,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
) : Et(t, e,
|
|
52
|
-
const
|
|
49
|
+
lr([e, ut(n, 1)]),
|
|
50
|
+
ar([r, z(s, 1)])
|
|
51
|
+
) : Et(t, e, r), Ws = (t, e, r) => {
|
|
52
|
+
const n = v(e, ot.yearAndMonth), s = ue(e), i = Ct(e);
|
|
53
53
|
return {
|
|
54
54
|
...t,
|
|
55
|
-
[
|
|
56
|
-
...t && t[
|
|
55
|
+
[n]: {
|
|
56
|
+
...t && t[n],
|
|
57
57
|
[s]: {
|
|
58
|
-
...t && t[
|
|
58
|
+
...t && t[n] && t[n][s],
|
|
59
59
|
[i]: {
|
|
60
|
-
...t && t[
|
|
61
|
-
...
|
|
60
|
+
...t && t[n] && t[n][s] && t[n][s][i],
|
|
61
|
+
...r
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
},
|
|
67
|
-
const
|
|
66
|
+
}, js = (t, e, r) => {
|
|
67
|
+
const n = v(e, ot.yearAndMonth), s = ue(e), i = Ct(e);
|
|
68
68
|
return {
|
|
69
69
|
...t,
|
|
70
|
-
[
|
|
71
|
-
...t && t[
|
|
70
|
+
[n]: {
|
|
71
|
+
...t && t[n],
|
|
72
72
|
[s]: {
|
|
73
|
-
...t && t[
|
|
73
|
+
...t && t[n] && t[n][s],
|
|
74
74
|
[i]: {
|
|
75
|
-
...t && t[
|
|
76
|
-
...
|
|
77
|
-
t && t[
|
|
75
|
+
...t && t[n] && t[n][s] && t[n][s][i],
|
|
76
|
+
...r(
|
|
77
|
+
t && t[n] && t[n][s] && t[n][s][i]
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
},
|
|
84
|
-
const
|
|
83
|
+
}, dt = (t, e, r) => {
|
|
84
|
+
const n = e.getMonth() + 1, s = `${e.getFullYear()}-${n < 10 ? "0" : ""}${n}`, i = ue(e), c = Ct(e), a = t && t[s] && t[s][i] && t[s][i][c];
|
|
85
85
|
return {
|
|
86
86
|
...t,
|
|
87
87
|
[s]: {
|
|
88
88
|
...t && t[s],
|
|
89
89
|
[i]: {
|
|
90
90
|
...t && t[s] && t[s][i],
|
|
91
|
-
[c]:
|
|
91
|
+
[c]: He(a, r)
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
},
|
|
95
|
+
}, He = (t, e) => ({
|
|
96
96
|
...t,
|
|
97
97
|
highlights: [...(t == null ? void 0 : t.highlights) ?? [], ...e]
|
|
98
|
-
}),
|
|
99
|
-
const
|
|
98
|
+
}), Us = (t, e, r) => {
|
|
99
|
+
const n = e.days[0].date, s = n.getMonth() + 1, i = `${n.getFullYear()}-${s < 10 ? "0" : ""}${s}`, c = e.weekNumber;
|
|
100
100
|
let a = t;
|
|
101
101
|
e.days.forEach((m) => {
|
|
102
|
-
a =
|
|
102
|
+
a = dt(a, m.date, r);
|
|
103
103
|
});
|
|
104
|
-
const l = a && a[i] ? a[i][c] : void 0, d = l && l.highlights ? [...l.highlights, ...
|
|
104
|
+
const l = a && a[i] ? a[i][c] : void 0, d = l && l.highlights ? [...l.highlights, ...r] : r, u = {
|
|
105
105
|
...l,
|
|
106
106
|
highlights: d
|
|
107
107
|
};
|
|
@@ -112,108 +112,108 @@ const it = {
|
|
|
112
112
|
[c]: u
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
},
|
|
115
|
+
}, Yr = (t, e) => {
|
|
116
116
|
var s;
|
|
117
117
|
if (!e.days.length)
|
|
118
118
|
return { ...t };
|
|
119
|
-
const
|
|
119
|
+
const r = e.days[0].date, n = (s = Ir(e.days)) == null ? void 0 : s.date;
|
|
120
120
|
return {
|
|
121
|
-
...Et(t,
|
|
121
|
+
...Et(t, r, n)
|
|
122
122
|
};
|
|
123
|
-
},
|
|
124
|
-
var
|
|
125
|
-
const ye = (t, e,
|
|
123
|
+
}, Br = (t, e) => R(() => t ? dt(e, /* @__PURE__ */ new Date(), ["today"]) : e, [t, e]);
|
|
124
|
+
var Hr = /* @__PURE__ */ ((t) => (t[t.JANUARY = 0] = "JANUARY", t[t.FEBRUARY = 1] = "FEBRUARY", t[t.MARCH = 2] = "MARCH", t[t.APRIL = 3] = "APRIL", t[t.MAY = 4] = "MAY", t[t.JUNE = 5] = "JUNE", t[t.JULY = 6] = "JULY", t[t.AUGUST = 7] = "AUGUST", t[t.SEPTEMBER = 8] = "SEPTEMBER", t[t.OCTOBER = 9] = "OCTOBER", t[t.NOVEMBER = 10] = "NOVEMBER", t[t.DECEMBER = 11] = "DECEMBER", t))(Hr || {}), $r = /* @__PURE__ */ ((t) => (t[t.SUNDAY = 0] = "SUNDAY", t[t.MONDAY = 1] = "MONDAY", t[t.TUESDAY = 2] = "TUESDAY", t[t.WEDNESDAY = 3] = "WEDNESDAY", t[t.THURSDAY = 4] = "THURSDAY", t[t.FRIDAY = 5] = "FRIDAY", t[t.SATURDAY = 6] = "SATURDAY", t))($r || {});
|
|
125
|
+
const ye = (t, e, r, n) => {
|
|
126
126
|
const s = [];
|
|
127
|
-
for (let i = 0; i <
|
|
128
|
-
s.push(Jt(t, e + i,
|
|
127
|
+
for (let i = 0; i < r; i++)
|
|
128
|
+
s.push(Jt(t, e + i, n));
|
|
129
129
|
return s;
|
|
130
|
-
}, Jt = (t, e,
|
|
130
|
+
}, Jt = (t, e, r) => {
|
|
131
131
|
if (isNaN(t) || isNaN(e))
|
|
132
132
|
throw new Error("getMonthInYear() received NaN.");
|
|
133
|
-
const
|
|
133
|
+
const n = t + Math.floor(e / 12), s = e % 12, i = new Date(n, s, 1);
|
|
134
134
|
return {
|
|
135
|
-
monthString:
|
|
135
|
+
monthString: v(i, ot.yearAndMonth),
|
|
136
136
|
name: xt(
|
|
137
|
-
|
|
137
|
+
v(i, ot.fullMonthName, { locale: r })
|
|
138
138
|
),
|
|
139
|
-
year:
|
|
139
|
+
year: n,
|
|
140
140
|
monthInYear: s,
|
|
141
|
-
weeks:
|
|
141
|
+
weeks: Or(n, s, r)
|
|
142
142
|
};
|
|
143
|
-
},
|
|
144
|
-
const s = new Date(t, e, 1), i =
|
|
143
|
+
}, Or = (t, e, r, n = !0) => {
|
|
144
|
+
const s = new Date(t, e, 1), i = Wt(s, { locale: r }), c = [];
|
|
145
145
|
for (let a = 0; a < 6; a++) {
|
|
146
|
-
const l = pe(
|
|
147
|
-
if (a > 0 && l.startMonth !== e && !
|
|
146
|
+
const l = pe(dr(i, a), r);
|
|
147
|
+
if (a > 0 && l.startMonth !== e && !n)
|
|
148
148
|
return c;
|
|
149
149
|
c.push(l);
|
|
150
150
|
}
|
|
151
151
|
return c;
|
|
152
152
|
}, pe = (t, e) => {
|
|
153
|
-
const
|
|
153
|
+
const r = ft(z(t, 7)) !== ft(t);
|
|
154
154
|
return {
|
|
155
155
|
weekNumber: Le(t, { locale: e }),
|
|
156
156
|
startMonth: ft(t),
|
|
157
157
|
startYear: Rt(t),
|
|
158
|
-
endMonth: ft(
|
|
159
|
-
endYear: Rt(
|
|
160
|
-
days:
|
|
161
|
-
isLastWeekOfMonth:
|
|
158
|
+
endMonth: ft(z(t, 6)),
|
|
159
|
+
endYear: Rt(z(t, 6)),
|
|
160
|
+
days: Wr(t, e),
|
|
161
|
+
isLastWeekOfMonth: r
|
|
162
162
|
};
|
|
163
|
-
},
|
|
164
|
-
const
|
|
163
|
+
}, vr = (t, e) => {
|
|
164
|
+
const r = ur(t);
|
|
165
165
|
return {
|
|
166
166
|
date: t,
|
|
167
|
-
name:
|
|
168
|
-
fullName:
|
|
169
|
-
dateString:
|
|
167
|
+
name: v(t, "EEE", e ? { locale: e } : void 0),
|
|
168
|
+
fullName: v(t, "EEEE", e ? { locale: e } : void 0),
|
|
169
|
+
dateString: v(Pe(t, 12), ot.fullDate),
|
|
170
170
|
weekNumber: Le(t, { locale: e }),
|
|
171
171
|
year: Rt(t),
|
|
172
172
|
month: ft(t),
|
|
173
173
|
dayOfMonth: Ct(t),
|
|
174
|
-
dayOfWeek:
|
|
175
|
-
isFirstDayOfWeek:
|
|
176
|
-
isLastDayOfWeek:
|
|
174
|
+
dayOfWeek: r,
|
|
175
|
+
isFirstDayOfWeek: r === 1,
|
|
176
|
+
isLastDayOfWeek: r === 7,
|
|
177
177
|
isFirstDayOfMonth: P(Ae(t), t),
|
|
178
178
|
isLastDayOfMonth: P(Ne(t), t)
|
|
179
179
|
};
|
|
180
|
-
},
|
|
180
|
+
}, Wr = (t, e) => _e({
|
|
181
181
|
start: t,
|
|
182
|
-
end:
|
|
183
|
-
}).map((
|
|
184
|
-
calendar:
|
|
185
|
-
weekNumberVisible:
|
|
186
|
-
},
|
|
187
|
-
if (
|
|
182
|
+
end: z(t, 6)
|
|
183
|
+
}).map((r) => vr(r, e)), jr = (t, e) => e > 11 ? { year: t + Math.floor(e / 12), month: e % 12 } : e < 0 ? { year: t + Math.floor(e / 12), month: 12 + e % 12 } : { year: t, month: e }, Ur = "_calendar_1b766_1", Fr = "_weekNumberVisible_1b766_41", Me = {
|
|
184
|
+
calendar: Ur,
|
|
185
|
+
weekNumberVisible: Fr
|
|
186
|
+
}, Cr = (t, e, r) => !!(e && e.indexOf(r) >= 0 || t && t.highlights && t.highlights.indexOf(r) >= 0), at = (t, e, r, n, s) => {
|
|
187
|
+
if (r.length !== n.length)
|
|
188
188
|
throw new Error(
|
|
189
189
|
"Select highlight failed, number of values do not equal number of highlights."
|
|
190
190
|
);
|
|
191
|
-
if (
|
|
191
|
+
if (r.length === 0)
|
|
192
192
|
return s;
|
|
193
|
-
for (let i = 0; i <
|
|
194
|
-
if (typeof
|
|
193
|
+
for (let i = 0; i < r.length; i++)
|
|
194
|
+
if (typeof r[i] == "boolean" && r[i] || typeof r[i] == "string" && Cr(
|
|
195
195
|
t,
|
|
196
196
|
e,
|
|
197
|
-
|
|
197
|
+
r[i]
|
|
198
198
|
))
|
|
199
|
-
return
|
|
199
|
+
return n[i];
|
|
200
200
|
return s;
|
|
201
|
-
},
|
|
201
|
+
}, zr = ({
|
|
202
202
|
selectedBackground: t,
|
|
203
203
|
todayBackground: e,
|
|
204
|
-
rangeBackground:
|
|
205
|
-
borderColor:
|
|
204
|
+
rangeBackground: r,
|
|
205
|
+
borderColor: n = "transparent"
|
|
206
206
|
}) => (s, i, c, a, l) => ({
|
|
207
|
-
backgroundColor:
|
|
207
|
+
backgroundColor: at(
|
|
208
208
|
i,
|
|
209
209
|
s,
|
|
210
210
|
["selected", "range", "today", c.month === l.monthInYear],
|
|
211
|
-
[t,
|
|
211
|
+
[t, r, e, "#fff"],
|
|
212
212
|
"transparent"
|
|
213
213
|
),
|
|
214
214
|
borderWidth: "1px",
|
|
215
215
|
borderStyle: "solid",
|
|
216
|
-
borderColor:
|
|
216
|
+
borderColor: at(
|
|
217
217
|
i,
|
|
218
218
|
s,
|
|
219
219
|
["selectedStart", "selectedEnd", "singleSelected", "range", "today"],
|
|
@@ -224,9 +224,9 @@ const ye = (t, e, n, r) => {
|
|
|
224
224
|
"var(--swui-calendar-wrapper-range-border)",
|
|
225
225
|
"var(--lhds-color-ui-500)"
|
|
226
226
|
],
|
|
227
|
-
|
|
227
|
+
n
|
|
228
228
|
),
|
|
229
|
-
borderTopLeftRadius:
|
|
229
|
+
borderTopLeftRadius: at(
|
|
230
230
|
i,
|
|
231
231
|
s,
|
|
232
232
|
["selectedStart", "singleSelected", "today"],
|
|
@@ -237,7 +237,7 @@ const ye = (t, e, n, r) => {
|
|
|
237
237
|
],
|
|
238
238
|
"unset"
|
|
239
239
|
),
|
|
240
|
-
borderBottomLeftRadius:
|
|
240
|
+
borderBottomLeftRadius: at(
|
|
241
241
|
i,
|
|
242
242
|
s,
|
|
243
243
|
["selectedStart", "singleSelected", "today"],
|
|
@@ -248,7 +248,7 @@ const ye = (t, e, n, r) => {
|
|
|
248
248
|
],
|
|
249
249
|
"unset"
|
|
250
250
|
),
|
|
251
|
-
borderTopRightRadius:
|
|
251
|
+
borderTopRightRadius: at(
|
|
252
252
|
i,
|
|
253
253
|
s,
|
|
254
254
|
["selectedEnd", "singleSelected", "today"],
|
|
@@ -259,7 +259,7 @@ const ye = (t, e, n, r) => {
|
|
|
259
259
|
],
|
|
260
260
|
"unset"
|
|
261
261
|
),
|
|
262
|
-
borderBottomRightRadius:
|
|
262
|
+
borderBottomRightRadius: at(
|
|
263
263
|
i,
|
|
264
264
|
s,
|
|
265
265
|
["selectedEnd", "singleSelected", "today"],
|
|
@@ -271,22 +271,22 @@ const ye = (t, e, n, r) => {
|
|
|
271
271
|
"unset"
|
|
272
272
|
),
|
|
273
273
|
boxSizing: "border-box"
|
|
274
|
-
}),
|
|
274
|
+
}), Kr = ({
|
|
275
275
|
selectedColor: t,
|
|
276
276
|
disabledColor: e,
|
|
277
|
-
inOtherMonthColor:
|
|
278
|
-
rangeTextColor:
|
|
277
|
+
inOtherMonthColor: r,
|
|
278
|
+
rangeTextColor: n
|
|
279
279
|
}) => (s, i, c, a, l) => {
|
|
280
280
|
const d = c.month !== l.monthInYear;
|
|
281
281
|
return {
|
|
282
|
-
color:
|
|
282
|
+
color: at(
|
|
283
283
|
i,
|
|
284
284
|
s,
|
|
285
285
|
[d, "selected", "range", "enabled", "disabled"],
|
|
286
286
|
[
|
|
287
|
-
n,
|
|
288
|
-
t,
|
|
289
287
|
r,
|
|
288
|
+
t,
|
|
289
|
+
n,
|
|
290
290
|
void 0,
|
|
291
291
|
e
|
|
292
292
|
]
|
|
@@ -305,12 +305,12 @@ const ye = (t, e, n, r) => {
|
|
|
305
305
|
clickableTextColor: "var(--swui-calendar-week-day-clickable-text-color)"
|
|
306
306
|
},
|
|
307
307
|
CalendarDay: {
|
|
308
|
-
tdStyle:
|
|
308
|
+
tdStyle: zr({
|
|
309
309
|
selectedBackground: "var(--swui-calendar-wrapper-selected-background)",
|
|
310
310
|
rangeBackground: "var(--swui-calendar-wrapper-range-background)",
|
|
311
311
|
todayBackground: "var(--swui-calendar-wrapper-today-background)"
|
|
312
312
|
}),
|
|
313
|
-
textProps:
|
|
313
|
+
textProps: Kr({
|
|
314
314
|
selectedColor: "var(--swui-calendar-text-selected-color)",
|
|
315
315
|
disabledColor: "var(--swui-calendar-text-disabled-color)",
|
|
316
316
|
inOtherMonthColor: "var(--swui-calendar-text-in-other-month-color)"
|
|
@@ -323,23 +323,23 @@ const ye = (t, e, n, r) => {
|
|
|
323
323
|
...bt,
|
|
324
324
|
width: "37px",
|
|
325
325
|
height: "37px"
|
|
326
|
-
},
|
|
326
|
+
}, Jr = ({
|
|
327
327
|
onClickWeekDay: t,
|
|
328
328
|
day: e,
|
|
329
|
-
theme:
|
|
329
|
+
theme: r
|
|
330
330
|
}) => {
|
|
331
|
-
const
|
|
331
|
+
const n = /* @__PURE__ */ o(
|
|
332
332
|
A,
|
|
333
333
|
{
|
|
334
|
-
width:
|
|
335
|
-
height:
|
|
334
|
+
width: r.width,
|
|
335
|
+
height: r.height,
|
|
336
336
|
justifyContent: "center",
|
|
337
337
|
alignItems: "center",
|
|
338
338
|
children: /* @__PURE__ */ o(
|
|
339
339
|
Dt,
|
|
340
340
|
{
|
|
341
341
|
size: "small",
|
|
342
|
-
color: t ?
|
|
342
|
+
color: t ? r.WeekDay.clickableTextColor : r.WeekDay.textColor,
|
|
343
343
|
children: e.name
|
|
344
344
|
}
|
|
345
345
|
)
|
|
@@ -351,13 +351,13 @@ const ye = (t, e, n, r) => {
|
|
|
351
351
|
borderRadius: "var(--swui-calendar-day-border-radius)",
|
|
352
352
|
onClick: (s) => t(e.dayOfWeek, s),
|
|
353
353
|
disableFocusHighlight: !t,
|
|
354
|
-
children:
|
|
354
|
+
children: n
|
|
355
355
|
}
|
|
356
|
-
) :
|
|
357
|
-
},
|
|
356
|
+
) : n;
|
|
357
|
+
}, $e = function({
|
|
358
358
|
day: e,
|
|
359
|
-
week:
|
|
360
|
-
month:
|
|
359
|
+
week: r,
|
|
360
|
+
month: n,
|
|
361
361
|
dayState: s,
|
|
362
362
|
userData: i,
|
|
363
363
|
onClickDay: c,
|
|
@@ -379,8 +379,8 @@ const ye = (t, e, n, r) => {
|
|
|
379
379
|
d,
|
|
380
380
|
s,
|
|
381
381
|
e,
|
|
382
|
-
n,
|
|
383
382
|
r,
|
|
383
|
+
n,
|
|
384
384
|
i
|
|
385
385
|
),
|
|
386
386
|
children: e.dayOfMonth
|
|
@@ -392,8 +392,8 @@ const ye = (t, e, n, r) => {
|
|
|
392
392
|
d,
|
|
393
393
|
s,
|
|
394
394
|
e,
|
|
395
|
-
n,
|
|
396
395
|
r,
|
|
396
|
+
n,
|
|
397
397
|
i
|
|
398
398
|
)
|
|
399
399
|
}), f = Zt.div({
|
|
@@ -401,8 +401,8 @@ const ye = (t, e, n, r) => {
|
|
|
401
401
|
d,
|
|
402
402
|
s,
|
|
403
403
|
e,
|
|
404
|
-
n,
|
|
405
404
|
r,
|
|
405
|
+
n,
|
|
406
406
|
i
|
|
407
407
|
),
|
|
408
408
|
width: "100%",
|
|
@@ -412,24 +412,24 @@ const ye = (t, e, n, r) => {
|
|
|
412
412
|
d,
|
|
413
413
|
s,
|
|
414
414
|
e,
|
|
415
|
-
n,
|
|
416
415
|
r,
|
|
416
|
+
n,
|
|
417
417
|
i
|
|
418
418
|
),
|
|
419
419
|
width: "100%",
|
|
420
420
|
height: "100%",
|
|
421
421
|
position: "relative"
|
|
422
|
-
}), g =
|
|
422
|
+
}), g = qr(d, s);
|
|
423
423
|
return /* @__PURE__ */ o(
|
|
424
424
|
m,
|
|
425
425
|
{
|
|
426
426
|
onClick: g ? void 0 : (w) => c == null ? void 0 : c(e, i, w),
|
|
427
|
-
children: /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(h, { children: e.month ===
|
|
427
|
+
children: /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(h, { children: e.month === n.monthInYear && /* @__PURE__ */ _(vt, { children: [
|
|
428
428
|
l && /* @__PURE__ */ o(
|
|
429
429
|
l,
|
|
430
430
|
{
|
|
431
|
-
week:
|
|
432
|
-
month:
|
|
431
|
+
week: r,
|
|
432
|
+
month: n,
|
|
433
433
|
day: e,
|
|
434
434
|
dayState: s,
|
|
435
435
|
theme: a,
|
|
@@ -440,21 +440,21 @@ const ye = (t, e, n, r) => {
|
|
|
440
440
|
] }) }) })
|
|
441
441
|
}
|
|
442
442
|
);
|
|
443
|
-
},
|
|
443
|
+
}, qr = (t, e) => !!at(
|
|
444
444
|
e,
|
|
445
445
|
t,
|
|
446
446
|
["disabled"],
|
|
447
447
|
[!0],
|
|
448
448
|
!1
|
|
449
|
-
),
|
|
449
|
+
), Gr = ({
|
|
450
450
|
onClickWeek: t,
|
|
451
451
|
theme: e,
|
|
452
|
-
week:
|
|
453
|
-
background:
|
|
452
|
+
week: r,
|
|
453
|
+
background: n,
|
|
454
454
|
backgroundColor: s,
|
|
455
455
|
prefix: i
|
|
456
456
|
}) => {
|
|
457
|
-
const c = /* @__PURE__ */
|
|
457
|
+
const c = /* @__PURE__ */ _(
|
|
458
458
|
A,
|
|
459
459
|
{
|
|
460
460
|
width: e.width,
|
|
@@ -462,14 +462,14 @@ const ye = (t, e, n, r) => {
|
|
|
462
462
|
justifyContent: "center",
|
|
463
463
|
alignItems: "center",
|
|
464
464
|
children: [
|
|
465
|
-
|
|
466
|
-
/* @__PURE__ */ o(A, { position: "absolute", children: /* @__PURE__ */
|
|
465
|
+
n && /* @__PURE__ */ o(A, { position: "absolute", children: n }),
|
|
466
|
+
/* @__PURE__ */ o(A, { position: "absolute", children: /* @__PURE__ */ _(
|
|
467
467
|
Dt,
|
|
468
468
|
{
|
|
469
469
|
color: t ? e.WeekNumber.clickableTextColor : e.WeekNumber.textColor,
|
|
470
470
|
children: [
|
|
471
471
|
i,
|
|
472
|
-
|
|
472
|
+
r.weekNumber
|
|
473
473
|
]
|
|
474
474
|
}
|
|
475
475
|
) })
|
|
@@ -485,32 +485,32 @@ const ye = (t, e, n, r) => {
|
|
|
485
485
|
Te,
|
|
486
486
|
{
|
|
487
487
|
borderRadius: "var(--swui-calendar-day-border-radius)",
|
|
488
|
-
onClick: (a) => t(
|
|
488
|
+
onClick: (a) => t(r, a),
|
|
489
489
|
disableFocusHighlight: !t,
|
|
490
490
|
children: c
|
|
491
491
|
}
|
|
492
492
|
) : c
|
|
493
493
|
}
|
|
494
494
|
);
|
|
495
|
-
},
|
|
495
|
+
}, Qr = (t, e, r) => e && st(t, e) ? P(t, e) : r && K(t, r) ? P(t, r) : !0, Xr = function({
|
|
496
496
|
dayComponent: e,
|
|
497
|
-
minDate:
|
|
498
|
-
maxDate:
|
|
497
|
+
minDate: r,
|
|
498
|
+
maxDate: n,
|
|
499
499
|
dayState: s,
|
|
500
500
|
day: i,
|
|
501
501
|
...c
|
|
502
502
|
}) {
|
|
503
|
-
const a =
|
|
504
|
-
() =>
|
|
505
|
-
[i.date, s,
|
|
503
|
+
const a = R(
|
|
504
|
+
() => Qr(i.date, r, n) ? s : He(s, ["disabled"]),
|
|
505
|
+
[i.date, s, n, r]
|
|
506
506
|
);
|
|
507
507
|
return /* @__PURE__ */ o(e, { day: i, ...c, dayState: a });
|
|
508
508
|
};
|
|
509
|
-
function
|
|
509
|
+
function Zr({
|
|
510
510
|
month: t,
|
|
511
|
-
dayComponent: e =
|
|
512
|
-
statePerWeek:
|
|
513
|
-
userDataPerWeek:
|
|
511
|
+
dayComponent: e = $e,
|
|
512
|
+
statePerWeek: r,
|
|
513
|
+
userDataPerWeek: n,
|
|
514
514
|
minDate: s,
|
|
515
515
|
maxDate: i,
|
|
516
516
|
onClickDay: c,
|
|
@@ -523,23 +523,23 @@ function Vn({
|
|
|
523
523
|
theme: h = bt,
|
|
524
524
|
extraDayContent: g,
|
|
525
525
|
defaultHighlights: w,
|
|
526
|
-
showWeekNumber:
|
|
526
|
+
showWeekNumber: k
|
|
527
527
|
}) {
|
|
528
|
-
return /* @__PURE__ */ o(
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
|
|
528
|
+
return /* @__PURE__ */ o(vt, { children: /* @__PURE__ */ _(A, { alignItems: "stretch", children: [
|
|
529
|
+
/* @__PURE__ */ _(
|
|
530
|
+
H,
|
|
531
531
|
{
|
|
532
532
|
justifyContent: f ? "space-between" : "center",
|
|
533
533
|
alignItems: "center",
|
|
534
534
|
children: [
|
|
535
|
-
/* @__PURE__ */ o(
|
|
536
|
-
|
|
535
|
+
/* @__PURE__ */ o(H, { justifyContent: "center", alignItems: "center", children: d ? /* @__PURE__ */ o(
|
|
536
|
+
J,
|
|
537
537
|
{
|
|
538
538
|
onClick: () => d(t),
|
|
539
539
|
label: t.name + " " + String(t.year),
|
|
540
540
|
rightIcon: de
|
|
541
541
|
}
|
|
542
|
-
) : /* @__PURE__ */
|
|
542
|
+
) : /* @__PURE__ */ _(Dt, { whiteSpace: "nowrap", children: [
|
|
543
543
|
t.name,
|
|
544
544
|
" ",
|
|
545
545
|
t.year
|
|
@@ -548,36 +548,36 @@ function Vn({
|
|
|
548
548
|
]
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
/* @__PURE__ */ o("table", { children: /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
|
|
554
|
-
t.weeks[0].days.map((
|
|
555
|
-
|
|
551
|
+
/* @__PURE__ */ o("table", { children: /* @__PURE__ */ _("tbody", { children: [
|
|
552
|
+
/* @__PURE__ */ _("tr", { children: [
|
|
553
|
+
k && /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(A, { width: h.width, height: h.height }) }),
|
|
554
|
+
t.weeks[0].days.map((p) => /* @__PURE__ */ o("td", { children: m ? m(p.name, h, l) : /* @__PURE__ */ o(
|
|
555
|
+
Jr,
|
|
556
556
|
{
|
|
557
|
-
day:
|
|
557
|
+
day: p,
|
|
558
558
|
onClickWeekDay: l,
|
|
559
559
|
theme: h
|
|
560
560
|
}
|
|
561
|
-
) },
|
|
561
|
+
) }, p.name))
|
|
562
562
|
] }),
|
|
563
|
-
t.weeks.map((
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
t.weeks.map((p) => /* @__PURE__ */ o(vt, { children: /* @__PURE__ */ _("tr", { children: [
|
|
564
|
+
k && /* @__PURE__ */ o("td", { children: u ? u(p, h, a) : /* @__PURE__ */ o(
|
|
565
|
+
Gr,
|
|
566
566
|
{
|
|
567
|
-
week:
|
|
567
|
+
week: p,
|
|
568
568
|
onClickWeek: a,
|
|
569
569
|
theme: h
|
|
570
570
|
}
|
|
571
571
|
) }),
|
|
572
|
-
|
|
573
|
-
|
|
572
|
+
p.days.map((y) => /* @__PURE__ */ o(
|
|
573
|
+
Xr,
|
|
574
574
|
{
|
|
575
575
|
dayComponent: e,
|
|
576
|
-
day:
|
|
577
|
-
week:
|
|
576
|
+
day: y,
|
|
577
|
+
week: p,
|
|
578
578
|
month: t,
|
|
579
|
-
dayState:
|
|
580
|
-
userData:
|
|
579
|
+
dayState: r && r[p.weekNumber] && r[p.weekNumber][y.dayOfMonth],
|
|
580
|
+
userData: n && n[p.weekNumber] && n[p.weekNumber][y.dayOfMonth],
|
|
581
581
|
onClickDay: c,
|
|
582
582
|
theme: h,
|
|
583
583
|
extraDayContent: g,
|
|
@@ -585,17 +585,17 @@ function Vn({
|
|
|
585
585
|
minDate: s,
|
|
586
586
|
maxDate: i
|
|
587
587
|
},
|
|
588
|
-
|
|
588
|
+
y.dateString
|
|
589
589
|
))
|
|
590
|
-
] },
|
|
590
|
+
] }, p.weekNumber) }))
|
|
591
591
|
] }) })
|
|
592
592
|
] }) });
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Vr({
|
|
595
595
|
monthRows: t,
|
|
596
|
-
dayComponent: e =
|
|
597
|
-
userDataPerMonth:
|
|
598
|
-
statePerMonth:
|
|
596
|
+
dayComponent: e = $e,
|
|
597
|
+
userDataPerMonth: r,
|
|
598
|
+
statePerMonth: n,
|
|
599
599
|
minDate: s,
|
|
600
600
|
maxDate: i,
|
|
601
601
|
onClickDay: c,
|
|
@@ -608,12 +608,12 @@ function tr({
|
|
|
608
608
|
extraDayContent: h,
|
|
609
609
|
defaultHighlights: g,
|
|
610
610
|
showWeekNumber: w,
|
|
611
|
-
theme:
|
|
611
|
+
theme: k = bt
|
|
612
612
|
}) {
|
|
613
|
-
const
|
|
613
|
+
const p = R(
|
|
614
614
|
() => s ? mt(s, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
|
|
615
615
|
[s]
|
|
616
|
-
),
|
|
616
|
+
), y = R(
|
|
617
617
|
() => i ? mt(i, "yyyy-MM-dd", /* @__PURE__ */ new Date()) : void 0,
|
|
618
618
|
[i]
|
|
619
619
|
);
|
|
@@ -624,122 +624,122 @@ function tr({
|
|
|
624
624
|
Me.calendar,
|
|
625
625
|
w && Me.weekNumberVisible
|
|
626
626
|
),
|
|
627
|
-
children: t.map((
|
|
628
|
-
|
|
627
|
+
children: t.map((D, M) => /* @__PURE__ */ o(Ve, { children: /* @__PURE__ */ o(H, { gap: 2, children: D.map((T) => /* @__PURE__ */ o(
|
|
628
|
+
Zr,
|
|
629
629
|
{
|
|
630
630
|
month: T,
|
|
631
631
|
dayComponent: e,
|
|
632
|
-
userDataPerWeek:
|
|
633
|
-
statePerWeek:
|
|
632
|
+
userDataPerWeek: r && r[T.monthString],
|
|
633
|
+
statePerWeek: n && n[T.monthString],
|
|
634
634
|
onClickDay: c,
|
|
635
635
|
onClickWeekDay: a,
|
|
636
636
|
onClickWeek: l,
|
|
637
637
|
onClickMonth: d,
|
|
638
|
-
theme:
|
|
638
|
+
theme: k,
|
|
639
639
|
renderWeekNumber: m,
|
|
640
640
|
renderWeekDay: u,
|
|
641
641
|
headerRightContent: f,
|
|
642
642
|
extraDayContent: h,
|
|
643
643
|
defaultHighlights: g,
|
|
644
|
-
minDate:
|
|
645
|
-
maxDate:
|
|
644
|
+
minDate: p,
|
|
645
|
+
maxDate: y,
|
|
646
646
|
showWeekNumber: w ?? !1
|
|
647
647
|
},
|
|
648
648
|
T.name
|
|
649
|
-
)) }) },
|
|
649
|
+
)) }) }, M))
|
|
650
650
|
}
|
|
651
651
|
);
|
|
652
652
|
}
|
|
653
653
|
function ie(t) {
|
|
654
|
-
const e =
|
|
654
|
+
const e = tn(t.year, t.month, t.date), { year: r, month: n } = jr(
|
|
655
655
|
e.year,
|
|
656
656
|
e.month
|
|
657
|
-
), s =
|
|
658
|
-
n,
|
|
657
|
+
), s = en(
|
|
659
658
|
r,
|
|
659
|
+
n,
|
|
660
660
|
t.locale ?? zt,
|
|
661
661
|
t.numMonths,
|
|
662
662
|
t.monthsPerRow
|
|
663
|
-
), i =
|
|
663
|
+
), i = Br(
|
|
664
664
|
t.highlightToday,
|
|
665
665
|
t.statePerMonth
|
|
666
666
|
);
|
|
667
667
|
return /* @__PURE__ */ o(
|
|
668
|
-
|
|
668
|
+
Vr,
|
|
669
669
|
{
|
|
670
|
-
year:
|
|
671
|
-
month:
|
|
670
|
+
year: r,
|
|
671
|
+
month: n,
|
|
672
672
|
monthRows: s,
|
|
673
673
|
...t,
|
|
674
674
|
statePerMonth: i
|
|
675
675
|
}
|
|
676
676
|
);
|
|
677
677
|
}
|
|
678
|
-
const
|
|
678
|
+
const tn = (t, e, r) => {
|
|
679
679
|
if (e && t)
|
|
680
680
|
return {
|
|
681
681
|
month: e,
|
|
682
682
|
year: t
|
|
683
683
|
};
|
|
684
|
-
if (
|
|
684
|
+
if (r)
|
|
685
685
|
return {
|
|
686
|
-
month: ft(
|
|
687
|
-
year: Rt(
|
|
686
|
+
month: ft(r),
|
|
687
|
+
year: Rt(r)
|
|
688
688
|
};
|
|
689
|
-
const
|
|
689
|
+
const n = /* @__PURE__ */ new Date();
|
|
690
690
|
return {
|
|
691
|
-
month: ft(
|
|
692
|
-
year: Rt(
|
|
691
|
+
month: ft(n),
|
|
692
|
+
year: Rt(n)
|
|
693
693
|
};
|
|
694
|
-
},
|
|
694
|
+
}, en = (t, e, r, n, s) => n == null ? [[Jt(t, e, r)]] : s == null ? [ye(t, e, n, r)] : Ye(ye(t, e, n, r), s), Oe = (t, e) => `${t.row}-${t.column}-${e}`, rn = (t, e, r, n) => {
|
|
695
695
|
let s = e;
|
|
696
|
-
for (let i = 0; i <
|
|
697
|
-
s =
|
|
698
|
-
const c = Oe(s,
|
|
696
|
+
for (let i = 0; i < n; i++) {
|
|
697
|
+
s = nn(s, t, n);
|
|
698
|
+
const c = Oe(s, r);
|
|
699
699
|
if (document.getElementById(c))
|
|
700
700
|
return c;
|
|
701
701
|
}
|
|
702
|
-
},
|
|
703
|
-
let
|
|
704
|
-
return e === "ArrowLeft" ? s-- : e === "ArrowUp" ?
|
|
702
|
+
}, nn = (t, e, r) => {
|
|
703
|
+
let n = t.row, s = t.column;
|
|
704
|
+
return e === "ArrowLeft" ? s-- : e === "ArrowUp" ? n-- : e === "ArrowRight" ? s++ : e === "ArrowDown" && n++, s < 0 && (s = r - 1, n--), s > r - 1 && (s = 0, n++), {
|
|
705
705
|
column: s,
|
|
706
|
-
row:
|
|
706
|
+
row: n
|
|
707
707
|
};
|
|
708
|
-
},
|
|
708
|
+
}, sn = ({
|
|
709
709
|
month: t,
|
|
710
710
|
onClick: e,
|
|
711
|
-
selected:
|
|
712
|
-
locale:
|
|
711
|
+
selected: r,
|
|
712
|
+
locale: n,
|
|
713
713
|
autoFocus: s,
|
|
714
714
|
monthPickerId: i,
|
|
715
715
|
position: c,
|
|
716
716
|
size: a
|
|
717
717
|
}) => {
|
|
718
|
-
const l =
|
|
719
|
-
() => xt(
|
|
720
|
-
[
|
|
721
|
-
), d =
|
|
722
|
-
() => xt(
|
|
723
|
-
[
|
|
724
|
-
), u =
|
|
718
|
+
const l = R(
|
|
719
|
+
() => xt(v(t, "MMM", { locale: n })),
|
|
720
|
+
[n, t]
|
|
721
|
+
), d = R(
|
|
722
|
+
() => xt(v(t, "MMMM", { locale: n })),
|
|
723
|
+
[n, t]
|
|
724
|
+
), u = O(null), m = Oe(c, i), f = r ? 0 : -1;
|
|
725
725
|
Z(() => {
|
|
726
726
|
var g;
|
|
727
727
|
(g = u.current) == null || g.focus();
|
|
728
728
|
}, []);
|
|
729
|
-
const h =
|
|
729
|
+
const h = b(
|
|
730
730
|
(g) => {
|
|
731
|
-
var
|
|
732
|
-
const w =
|
|
731
|
+
var k;
|
|
732
|
+
const w = rn(
|
|
733
733
|
g.key,
|
|
734
734
|
c,
|
|
735
735
|
i,
|
|
736
736
|
4
|
|
737
737
|
);
|
|
738
|
-
w && ((
|
|
738
|
+
w && ((k = document.getElementById(w)) == null || k.focus());
|
|
739
739
|
},
|
|
740
740
|
[i, c]
|
|
741
741
|
);
|
|
742
|
-
return /* @__PURE__ */ o(
|
|
742
|
+
return /* @__PURE__ */ o(H, { justifyContent: "center", onKeyDown: h, children: r ? /* @__PURE__ */ o(
|
|
743
743
|
Mt,
|
|
744
744
|
{
|
|
745
745
|
id: m,
|
|
@@ -753,7 +753,7 @@ const er = (t, e, n) => {
|
|
|
753
753
|
tabIndex: f
|
|
754
754
|
}
|
|
755
755
|
) : /* @__PURE__ */ o(
|
|
756
|
-
|
|
756
|
+
J,
|
|
757
757
|
{
|
|
758
758
|
id: m,
|
|
759
759
|
label: l,
|
|
@@ -763,8 +763,8 @@ const er = (t, e, n) => {
|
|
|
763
763
|
tabIndex: f
|
|
764
764
|
}
|
|
765
765
|
) });
|
|
766
|
-
},
|
|
767
|
-
let
|
|
766
|
+
}, on = (t, e, r) => {
|
|
767
|
+
let n = t.getFullYear(), s = 0, i = 0, c = t;
|
|
768
768
|
const a = {
|
|
769
769
|
yearOrder: [],
|
|
770
770
|
rows: [],
|
|
@@ -773,7 +773,7 @@ const er = (t, e, n) => {
|
|
|
773
773
|
lastMonthRow: -1
|
|
774
774
|
};
|
|
775
775
|
for (let l = 0; l < e; l++) {
|
|
776
|
-
if (a.years[
|
|
776
|
+
if (a.years[n] == null && (a.yearOrder.push(n), a.years[n] = { year: n, rows: [] }), a.rows[s] = a.rows[s] ?? {
|
|
777
777
|
columns: [],
|
|
778
778
|
rowIndex: s
|
|
779
779
|
}, a.rows[s].columns[i] = {
|
|
@@ -783,56 +783,56 @@ const er = (t, e, n) => {
|
|
|
783
783
|
},
|
|
784
784
|
month: c
|
|
785
785
|
}, l === e - 1) {
|
|
786
|
-
a.years[
|
|
786
|
+
a.years[n].rows.push(s);
|
|
787
787
|
break;
|
|
788
788
|
}
|
|
789
|
-
c = At(c, 1), c.getFullYear() !==
|
|
789
|
+
c = At(c, 1), c.getFullYear() !== n ? (a.years[n].rows.push(s), n++, i = 0, s++) : (i++, i > r - 1 && (a.years[n].rows.push(s), i = 0, s++));
|
|
790
790
|
}
|
|
791
791
|
return a.lastMonthColumn = i, a.lastMonthRow = s, a;
|
|
792
|
-
}, De = () =>
|
|
792
|
+
}, De = () => R(() => /* @__PURE__ */ new Date(), []), Pt = ({
|
|
793
793
|
value: t,
|
|
794
794
|
onValueChange: e,
|
|
795
|
-
locale:
|
|
796
|
-
firstMonth:
|
|
795
|
+
locale: r = zt,
|
|
796
|
+
firstMonth: n,
|
|
797
797
|
numMonths: s,
|
|
798
798
|
onCancel: i,
|
|
799
799
|
size: c = "medium"
|
|
800
800
|
}) => {
|
|
801
|
-
const a = ge(), l = De(), d = s > 0 ? s : 12, [u, m] = I(!1), f =
|
|
801
|
+
const a = ge(), l = De(), d = s > 0 ? s : 12, [u, m] = I(!1), f = on(n, d, an(c)), h = R(() => At(n, d), [d, n]);
|
|
802
802
|
Z(() => {
|
|
803
803
|
m(!0);
|
|
804
804
|
}, []);
|
|
805
|
-
const g =
|
|
805
|
+
const g = b(
|
|
806
806
|
(w) => {
|
|
807
807
|
w.key === "Escape" && (i == null || i(), w.preventDefault(), w.stopPropagation());
|
|
808
808
|
},
|
|
809
809
|
[i]
|
|
810
810
|
);
|
|
811
|
-
return /* @__PURE__ */ o(
|
|
812
|
-
const { rows:
|
|
813
|
-
return /* @__PURE__ */
|
|
814
|
-
(
|
|
815
|
-
/* @__PURE__ */ o("table", { style: { borderSpacing: "0 8px" }, children: /* @__PURE__ */ o("tbody", { children:
|
|
816
|
-
const { columns:
|
|
817
|
-
return /* @__PURE__ */ o("tr", { children:
|
|
818
|
-
|
|
811
|
+
return /* @__PURE__ */ o(C, { gap: 1, maxWidth: cn(c), onKeyDown: g, children: f.yearOrder.map((w, k) => {
|
|
812
|
+
const { rows: p } = f.years[w];
|
|
813
|
+
return /* @__PURE__ */ _(me.Fragment, { children: [
|
|
814
|
+
(k !== 0 || w !== l.getFullYear()) && /* @__PURE__ */ o(_t, { variant: "h4", children: w }),
|
|
815
|
+
/* @__PURE__ */ o("table", { style: { borderSpacing: "0 8px" }, children: /* @__PURE__ */ o("tbody", { children: p.map((y) => {
|
|
816
|
+
const { columns: D } = f.rows[y];
|
|
817
|
+
return /* @__PURE__ */ o("tr", { children: D.map(({ month: M, position: T }) => /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(
|
|
818
|
+
sn,
|
|
819
819
|
{
|
|
820
|
-
month:
|
|
821
|
-
firstAvailableMonth:
|
|
820
|
+
month: M,
|
|
821
|
+
firstAvailableMonth: n,
|
|
822
822
|
lastAvailableMonth: h,
|
|
823
|
-
locale:
|
|
824
|
-
selected: t ?
|
|
823
|
+
locale: r,
|
|
824
|
+
selected: t ? it(t, M) : !1,
|
|
825
825
|
autoFocus: u,
|
|
826
|
-
onClick: () => e == null ? void 0 : e(
|
|
826
|
+
onClick: () => e == null ? void 0 : e(M),
|
|
827
827
|
monthPickerId: a,
|
|
828
828
|
position: T,
|
|
829
829
|
size: c
|
|
830
830
|
}
|
|
831
|
-
) },
|
|
831
|
+
) }, M.getMonth())) }, y);
|
|
832
832
|
}) }) })
|
|
833
833
|
] }, w);
|
|
834
834
|
}) });
|
|
835
|
-
},
|
|
835
|
+
}, cn = (t) => {
|
|
836
836
|
switch (t) {
|
|
837
837
|
case "small":
|
|
838
838
|
return "280px";
|
|
@@ -843,7 +843,7 @@ const er = (t, e, n) => {
|
|
|
843
843
|
default:
|
|
844
844
|
return le(t, "336px");
|
|
845
845
|
}
|
|
846
|
-
},
|
|
846
|
+
}, an = (t) => {
|
|
847
847
|
switch (t) {
|
|
848
848
|
case "small":
|
|
849
849
|
return 3;
|
|
@@ -854,7 +854,7 @@ const er = (t, e, n) => {
|
|
|
854
854
|
default:
|
|
855
855
|
return le(t, 4);
|
|
856
856
|
}
|
|
857
|
-
},
|
|
857
|
+
}, ln = (t) => [
|
|
858
858
|
{
|
|
859
859
|
label: "Past",
|
|
860
860
|
presets: [
|
|
@@ -867,48 +867,48 @@ const er = (t, e, n) => {
|
|
|
867
867
|
{
|
|
868
868
|
label: "Future",
|
|
869
869
|
presets: [
|
|
870
|
-
{ label: "Next 3 days", startDate: t, endDate:
|
|
871
|
-
{ label: "Next 7 days", startDate: t, endDate:
|
|
872
|
-
{ label: "Next 30 days", startDate: t, endDate:
|
|
873
|
-
{ label: "Next 45 days", startDate: t, endDate:
|
|
870
|
+
{ label: "Next 3 days", startDate: t, endDate: z(t, 2) },
|
|
871
|
+
{ label: "Next 7 days", startDate: t, endDate: z(t, 6) },
|
|
872
|
+
{ label: "Next 30 days", startDate: t, endDate: z(t, 29) },
|
|
873
|
+
{ label: "Next 45 days", startDate: t, endDate: z(t, 44) }
|
|
874
874
|
]
|
|
875
875
|
}
|
|
876
|
-
],
|
|
876
|
+
], dn = ({
|
|
877
877
|
onClickPreset: t
|
|
878
878
|
}) => {
|
|
879
|
-
const [e,
|
|
880
|
-
return /* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
|
|
879
|
+
const [e, r] = I(0), n = R(() => ln(/* @__PURE__ */ new Date()), []), s = n[e] ?? n[0];
|
|
880
|
+
return /* @__PURE__ */ _(C, { children: [
|
|
881
|
+
/* @__PURE__ */ _(
|
|
882
|
+
H,
|
|
883
883
|
{
|
|
884
884
|
justifyContent: "space-between",
|
|
885
885
|
alignItems: "center",
|
|
886
886
|
width: "200px",
|
|
887
887
|
children: [
|
|
888
888
|
/* @__PURE__ */ o(
|
|
889
|
-
|
|
889
|
+
J,
|
|
890
890
|
{
|
|
891
891
|
size: "small",
|
|
892
|
-
leftIcon:
|
|
892
|
+
leftIcon: er,
|
|
893
893
|
disabled: e === 0,
|
|
894
|
-
onClick: () =>
|
|
894
|
+
onClick: () => r(e - 1)
|
|
895
895
|
}
|
|
896
896
|
),
|
|
897
897
|
/* @__PURE__ */ o(Dt, { children: s.label }),
|
|
898
898
|
/* @__PURE__ */ o(
|
|
899
|
-
|
|
899
|
+
J,
|
|
900
900
|
{
|
|
901
901
|
size: "small",
|
|
902
|
-
leftIcon:
|
|
903
|
-
disabled: e ===
|
|
904
|
-
onClick: () =>
|
|
902
|
+
leftIcon: rr,
|
|
903
|
+
disabled: e === n.length - 1,
|
|
904
|
+
onClick: () => r(e + 1)
|
|
905
905
|
}
|
|
906
906
|
)
|
|
907
907
|
]
|
|
908
908
|
}
|
|
909
909
|
),
|
|
910
910
|
/* @__PURE__ */ o(yt, {}),
|
|
911
|
-
/* @__PURE__ */ o(
|
|
911
|
+
/* @__PURE__ */ o(C, { alignItems: "center", children: s.presets.map((i) => /* @__PURE__ */ _(me.Fragment, { children: [
|
|
912
912
|
/* @__PURE__ */ o(
|
|
913
913
|
Mt,
|
|
914
914
|
{
|
|
@@ -919,21 +919,21 @@ const er = (t, e, n) => {
|
|
|
919
919
|
/* @__PURE__ */ o(yt, {})
|
|
920
920
|
] }, i.label)) })
|
|
921
921
|
] });
|
|
922
|
-
},
|
|
922
|
+
}, un = function({
|
|
923
923
|
locale: e,
|
|
924
|
-
dateInFocus:
|
|
925
|
-
setDateInFocus:
|
|
924
|
+
dateInFocus: r,
|
|
925
|
+
setDateInFocus: n,
|
|
926
926
|
currentPanel: s,
|
|
927
927
|
setCurrentPanel: i,
|
|
928
928
|
renderMonthPicker: c,
|
|
929
929
|
...a
|
|
930
930
|
}) {
|
|
931
|
-
const l =
|
|
931
|
+
const l = b(
|
|
932
932
|
(u) => {
|
|
933
|
-
|
|
933
|
+
n && n(u), i("calendar");
|
|
934
934
|
},
|
|
935
|
-
[
|
|
936
|
-
), d =
|
|
935
|
+
[n, i]
|
|
936
|
+
), d = b(() => {
|
|
937
937
|
i("month");
|
|
938
938
|
}, [i]);
|
|
939
939
|
switch (s) {
|
|
@@ -942,23 +942,23 @@ const er = (t, e, n) => {
|
|
|
942
942
|
ie,
|
|
943
943
|
{
|
|
944
944
|
...a,
|
|
945
|
-
date:
|
|
945
|
+
date: r,
|
|
946
946
|
onClickMonth: d,
|
|
947
947
|
locale: e
|
|
948
948
|
}
|
|
949
949
|
);
|
|
950
950
|
case "month":
|
|
951
951
|
return c ? c({
|
|
952
|
-
value:
|
|
952
|
+
value: r,
|
|
953
953
|
onValueChange: l,
|
|
954
954
|
locale: e,
|
|
955
955
|
firstMonth: /* @__PURE__ */ new Date(),
|
|
956
956
|
numMonths: 24,
|
|
957
|
-
dateInFocus:
|
|
957
|
+
dateInFocus: r
|
|
958
958
|
}) : /* @__PURE__ */ o(
|
|
959
959
|
Pt,
|
|
960
960
|
{
|
|
961
|
-
value:
|
|
961
|
+
value: r,
|
|
962
962
|
onValueChange: l,
|
|
963
963
|
locale: e,
|
|
964
964
|
firstMonth: /* @__PURE__ */ new Date(),
|
|
@@ -966,7 +966,7 @@ const er = (t, e, n) => {
|
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
968
|
case "presets":
|
|
969
|
-
return /* @__PURE__ */ o(
|
|
969
|
+
return /* @__PURE__ */ o(dn, { onClickPreset: () => {
|
|
970
970
|
} });
|
|
971
971
|
default:
|
|
972
972
|
return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(
|
|
@@ -977,18 +977,18 @@ const er = (t, e, n) => {
|
|
|
977
977
|
}
|
|
978
978
|
) });
|
|
979
979
|
}
|
|
980
|
-
},
|
|
981
|
-
const s =
|
|
982
|
-
const l = At(t,
|
|
980
|
+
}, fn = (t, e, r, n) => {
|
|
981
|
+
const s = b(() => {
|
|
982
|
+
const l = At(t, r ?? n ?? 1);
|
|
983
983
|
e == null || e(l);
|
|
984
|
-
}, [e, t,
|
|
985
|
-
const l =
|
|
984
|
+
}, [e, t, r, n]), i = b(() => {
|
|
985
|
+
const l = fr(t, 1);
|
|
986
986
|
e == null || e(l);
|
|
987
|
-
}, [e, t]), c =
|
|
988
|
-
const l = fe(t,
|
|
987
|
+
}, [e, t]), c = b(() => {
|
|
988
|
+
const l = fe(t, r ?? n ?? 1);
|
|
989
989
|
e == null || e(l);
|
|
990
|
-
}, [e, t,
|
|
991
|
-
const l =
|
|
990
|
+
}, [e, t, r, n]), a = b(() => {
|
|
991
|
+
const l = hr(t, 1);
|
|
992
992
|
e == null || e(l);
|
|
993
993
|
}, [e, t]);
|
|
994
994
|
return {
|
|
@@ -997,79 +997,79 @@ const er = (t, e, n) => {
|
|
|
997
997
|
nextYear: i,
|
|
998
998
|
prevYear: a
|
|
999
999
|
};
|
|
1000
|
-
},
|
|
1000
|
+
}, hn = ({
|
|
1001
1001
|
children: t,
|
|
1002
1002
|
prevMonth: e,
|
|
1003
|
-
nextMonth:
|
|
1004
|
-
prevYear:
|
|
1003
|
+
nextMonth: r,
|
|
1004
|
+
prevYear: n,
|
|
1005
1005
|
nextYear: s
|
|
1006
|
-
}) => /* @__PURE__ */
|
|
1006
|
+
}) => /* @__PURE__ */ _("div", { children: [
|
|
1007
1007
|
t,
|
|
1008
|
-
/* @__PURE__ */ o(Tt, { children: /* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */ o(
|
|
1010
|
-
/* @__PURE__ */ o(
|
|
1008
|
+
/* @__PURE__ */ o(Tt, { children: /* @__PURE__ */ _(H, { gap: 1, children: [
|
|
1009
|
+
/* @__PURE__ */ o(lt, { onClick: n, leftIcon: nr }),
|
|
1010
|
+
/* @__PURE__ */ o(lt, { onClick: e, leftIcon: Ft }),
|
|
1011
1011
|
/* @__PURE__ */ o(Tt, { num: 2 }),
|
|
1012
|
-
/* @__PURE__ */ o(
|
|
1013
|
-
/* @__PURE__ */ o(
|
|
1012
|
+
/* @__PURE__ */ o(lt, { onClick: r, leftIcon: Nt }),
|
|
1013
|
+
/* @__PURE__ */ o(lt, { onClick: s, leftIcon: sr })
|
|
1014
1014
|
] }) }),
|
|
1015
1015
|
/* @__PURE__ */ o(yt, {})
|
|
1016
|
-
] }),
|
|
1016
|
+
] }), mn = () => {
|
|
1017
1017
|
};
|
|
1018
1018
|
function wt({
|
|
1019
1019
|
monthSwitcherPlacement: t,
|
|
1020
1020
|
theme: e = bt,
|
|
1021
|
-
dateInFocus:
|
|
1022
|
-
setDateInFocus:
|
|
1021
|
+
dateInFocus: r,
|
|
1022
|
+
setDateInFocus: n,
|
|
1023
1023
|
currentPanel: s,
|
|
1024
1024
|
setCurrentPanel: i,
|
|
1025
|
-
onSelectPreset: c =
|
|
1025
|
+
onSelectPreset: c = mn,
|
|
1026
1026
|
renderMonthPicker: a,
|
|
1027
1027
|
...l
|
|
1028
1028
|
}) {
|
|
1029
|
-
const { nextMonth: d, prevMonth: u, nextYear: m, prevYear: f } =
|
|
1030
|
-
n,
|
|
1029
|
+
const { nextMonth: d, prevMonth: u, nextYear: m, prevYear: f } = fn(
|
|
1031
1030
|
r,
|
|
1031
|
+
n,
|
|
1032
1032
|
l.monthsPerRow,
|
|
1033
1033
|
l.numMonths
|
|
1034
1034
|
);
|
|
1035
|
-
switch (
|
|
1035
|
+
switch (gn(
|
|
1036
1036
|
t,
|
|
1037
1037
|
l.numMonths
|
|
1038
1038
|
)) {
|
|
1039
1039
|
case "below":
|
|
1040
1040
|
return /* @__PURE__ */ o(
|
|
1041
|
-
|
|
1041
|
+
hn,
|
|
1042
1042
|
{
|
|
1043
1043
|
theme: e,
|
|
1044
1044
|
nextMonth: d,
|
|
1045
1045
|
prevMonth: u,
|
|
1046
1046
|
nextYear: m,
|
|
1047
1047
|
prevYear: f,
|
|
1048
|
-
children: /* @__PURE__ */ o(ie, { ...l, theme: e, date:
|
|
1048
|
+
children: /* @__PURE__ */ o(ie, { ...l, theme: e, date: r })
|
|
1049
1049
|
}
|
|
1050
1050
|
);
|
|
1051
1051
|
case "header":
|
|
1052
|
-
return /* @__PURE__ */ o(
|
|
1053
|
-
|
|
1052
|
+
return /* @__PURE__ */ o(C, { children: /* @__PURE__ */ o(
|
|
1053
|
+
un,
|
|
1054
1054
|
{
|
|
1055
1055
|
...l,
|
|
1056
1056
|
theme: e,
|
|
1057
1057
|
renderMonthPicker: a,
|
|
1058
|
-
dateInFocus:
|
|
1059
|
-
setDateInFocus:
|
|
1058
|
+
dateInFocus: r,
|
|
1059
|
+
setDateInFocus: n,
|
|
1060
1060
|
currentPanel: s,
|
|
1061
1061
|
setCurrentPanel: i,
|
|
1062
1062
|
onSelectPreset: c,
|
|
1063
|
-
headerRightContent: /* @__PURE__ */
|
|
1063
|
+
headerRightContent: /* @__PURE__ */ _(H, { alignItems: "center", gap: 1, children: [
|
|
1064
1064
|
/* @__PURE__ */ o(
|
|
1065
|
-
|
|
1065
|
+
lt,
|
|
1066
1066
|
{
|
|
1067
1067
|
onClick: u,
|
|
1068
1068
|
leftIcon: Ft
|
|
1069
1069
|
}
|
|
1070
1070
|
),
|
|
1071
1071
|
/* @__PURE__ */ o(
|
|
1072
|
-
|
|
1072
|
+
lt,
|
|
1073
1073
|
{
|
|
1074
1074
|
onClick: d,
|
|
1075
1075
|
leftIcon: Nt
|
|
@@ -1079,72 +1079,72 @@ function wt({
|
|
|
1079
1079
|
}
|
|
1080
1080
|
) });
|
|
1081
1081
|
default:
|
|
1082
|
-
return /* @__PURE__ */ o(ie, { ...l, theme: e, date:
|
|
1082
|
+
return /* @__PURE__ */ o(ie, { ...l, theme: e, date: r });
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
|
-
const
|
|
1086
|
-
startDate: t.startDate ?
|
|
1087
|
-
endDate: t.endDate ?
|
|
1088
|
-
}),
|
|
1085
|
+
const gn = (t, e) => t || (e || 1) > 1 ? "below" : "header", pn = (t) => ({
|
|
1086
|
+
startDate: t.startDate ? v(t.startDate, "yyyy-MM-dd") : void 0,
|
|
1087
|
+
endDate: t.endDate ? v(t.endDate, "yyyy-MM-dd") : void 0
|
|
1088
|
+
}), Dn = ({
|
|
1089
1089
|
startDate: t,
|
|
1090
1090
|
endDate: e
|
|
1091
1091
|
}) => {
|
|
1092
|
-
const
|
|
1092
|
+
const r = /* @__PURE__ */ new Date();
|
|
1093
1093
|
return {
|
|
1094
|
-
startDate: t ? mt(t, "yyyy-MM-dd",
|
|
1095
|
-
endDate: e ? mt(e, "yyyy-MM-dd",
|
|
1094
|
+
startDate: t ? mt(t, "yyyy-MM-dd", r) : void 0,
|
|
1095
|
+
endDate: e ? mt(e, "yyyy-MM-dd", r) : void 0
|
|
1096
1096
|
};
|
|
1097
|
-
},
|
|
1097
|
+
}, ve = ({
|
|
1098
1098
|
startDate: t,
|
|
1099
1099
|
endDate: e
|
|
1100
|
-
}) => !!(t && e && !P(t, e) &&
|
|
1100
|
+
}) => !!(t && e && !P(t, e) && K(t, e)), We = (t) => ve(t) ? {
|
|
1101
1101
|
startDate: t.endDate,
|
|
1102
1102
|
endDate: t.startDate
|
|
1103
|
-
} : t, Cs = (t) => t.startDate && t.endDate ?
|
|
1104
|
-
|
|
1105
|
-
) : t,
|
|
1103
|
+
} : t, Cs = (t) => t.startDate && t.endDate ? pn(
|
|
1104
|
+
We(Dn(t))
|
|
1105
|
+
) : t, bn = (t, e, r, n) => b(
|
|
1106
1106
|
(s) => {
|
|
1107
1107
|
const i = {
|
|
1108
|
-
startDate:
|
|
1109
|
-
endDate:
|
|
1108
|
+
startDate: r === "startDate" ? s.date : t == null ? void 0 : t.startDate,
|
|
1109
|
+
endDate: r === "endDate" ? s.date : t == null ? void 0 : t.endDate
|
|
1110
1110
|
};
|
|
1111
|
-
|
|
1111
|
+
ve(i) || n(r === "startDate" ? "endDate" : "startDate"), e == null || e(We(i));
|
|
1112
1112
|
},
|
|
1113
1113
|
[
|
|
1114
|
-
n,
|
|
1115
|
-
e,
|
|
1116
1114
|
r,
|
|
1115
|
+
e,
|
|
1116
|
+
n,
|
|
1117
1117
|
t == null ? void 0 : t.endDate,
|
|
1118
1118
|
t == null ? void 0 : t.startDate
|
|
1119
1119
|
]
|
|
1120
1120
|
), qt = (t) => {
|
|
1121
|
-
const [e,
|
|
1121
|
+
const [e, r] = I("calendar"), n = b(
|
|
1122
1122
|
(s) => {
|
|
1123
|
-
|
|
1123
|
+
r(s), t == null || t(s);
|
|
1124
1124
|
},
|
|
1125
1125
|
[t]
|
|
1126
1126
|
);
|
|
1127
1127
|
return {
|
|
1128
1128
|
currentPanel: e,
|
|
1129
|
-
setCurrentPanel:
|
|
1129
|
+
setCurrentPanel: n
|
|
1130
1130
|
};
|
|
1131
|
-
},
|
|
1131
|
+
}, wn = ({
|
|
1132
1132
|
focusedInput: t,
|
|
1133
1133
|
value: e,
|
|
1134
|
-
onValueChange:
|
|
1135
|
-
setFocusedInput:
|
|
1134
|
+
onValueChange: r,
|
|
1135
|
+
setFocusedInput: n,
|
|
1136
1136
|
statePerMonth: s,
|
|
1137
1137
|
onChangePanel: i,
|
|
1138
1138
|
initialDateInFocus: c
|
|
1139
1139
|
}) => {
|
|
1140
1140
|
const { currentPanel: a, setCurrentPanel: l } = qt(i), [d, u] = I(
|
|
1141
1141
|
() => c ?? /* @__PURE__ */ new Date()
|
|
1142
|
-
), m =
|
|
1142
|
+
), m = bn(
|
|
1143
1143
|
e,
|
|
1144
|
-
|
|
1144
|
+
r,
|
|
1145
1145
|
t,
|
|
1146
|
-
|
|
1147
|
-
), f =
|
|
1146
|
+
n
|
|
1147
|
+
), f = R(
|
|
1148
1148
|
() => Et(
|
|
1149
1149
|
s,
|
|
1150
1150
|
e == null ? void 0 : e.startDate,
|
|
@@ -1162,36 +1162,36 @@ const gr = (t, e) => t || (e || 1) > 1 ? "below" : "header", pr = (t) => ({
|
|
|
1162
1162
|
};
|
|
1163
1163
|
};
|
|
1164
1164
|
function zs(t) {
|
|
1165
|
-
const e =
|
|
1165
|
+
const e = wn(t);
|
|
1166
1166
|
return /* @__PURE__ */ o(wt, { ...t, ...e });
|
|
1167
1167
|
}
|
|
1168
1168
|
const Ks = () => {
|
|
1169
|
-
const [t, e] = I(), [
|
|
1169
|
+
const [t, e] = I(), [r, n] = I(), [s, i] = I("startDate");
|
|
1170
1170
|
return {
|
|
1171
1171
|
startDate: t,
|
|
1172
1172
|
setStartDate: e,
|
|
1173
|
-
endDate:
|
|
1174
|
-
setEndDate:
|
|
1173
|
+
endDate: r,
|
|
1174
|
+
setEndDate: n,
|
|
1175
1175
|
focusedInput: s,
|
|
1176
1176
|
setFocusedInput: i
|
|
1177
1177
|
};
|
|
1178
|
-
},
|
|
1178
|
+
}, yn = ({
|
|
1179
1179
|
onChange: t,
|
|
1180
1180
|
value: e,
|
|
1181
|
-
statePerMonth:
|
|
1182
|
-
onChangePanel:
|
|
1181
|
+
statePerMonth: r,
|
|
1182
|
+
onChangePanel: n
|
|
1183
1183
|
}) => {
|
|
1184
|
-
const { currentPanel: s, setCurrentPanel: i } = qt(
|
|
1184
|
+
const { currentPanel: s, setCurrentPanel: i } = qt(n), [c, a] = I(() => e ?? /* @__PURE__ */ new Date()), l = b(
|
|
1185
1185
|
(u) => {
|
|
1186
1186
|
t && t(u.date);
|
|
1187
1187
|
},
|
|
1188
1188
|
[t]
|
|
1189
|
-
), d =
|
|
1190
|
-
() => e ?
|
|
1189
|
+
), d = R(
|
|
1190
|
+
() => e ? dt(r, e, [
|
|
1191
1191
|
"selected",
|
|
1192
1192
|
"singleSelected"
|
|
1193
|
-
]) :
|
|
1194
|
-
[
|
|
1193
|
+
]) : r,
|
|
1194
|
+
[r, e]
|
|
1195
1195
|
);
|
|
1196
1196
|
return {
|
|
1197
1197
|
onClickDay: l,
|
|
@@ -1203,17 +1203,17 @@ const Ks = () => {
|
|
|
1203
1203
|
setDateInFocus: a
|
|
1204
1204
|
};
|
|
1205
1205
|
};
|
|
1206
|
-
function
|
|
1207
|
-
const e =
|
|
1206
|
+
function je(t) {
|
|
1207
|
+
const e = yn(t);
|
|
1208
1208
|
return /* @__PURE__ */ o(wt, { ...t, ...e });
|
|
1209
1209
|
}
|
|
1210
|
-
const
|
|
1210
|
+
const Mn = ({
|
|
1211
1211
|
onChange: t,
|
|
1212
1212
|
value: e,
|
|
1213
|
-
statePerMonth:
|
|
1214
|
-
onChangePanel:
|
|
1213
|
+
statePerMonth: r,
|
|
1214
|
+
onChangePanel: n
|
|
1215
1215
|
}) => {
|
|
1216
|
-
const { currentPanel: s, setCurrentPanel: i } = qt(
|
|
1216
|
+
const { currentPanel: s, setCurrentPanel: i } = qt(n), [c, a] = I(() => /* @__PURE__ */ new Date()), l = b(
|
|
1217
1217
|
(u) => {
|
|
1218
1218
|
if (!t)
|
|
1219
1219
|
return;
|
|
@@ -1221,10 +1221,10 @@ const Mr = ({
|
|
|
1221
1221
|
t(e && m ? e.filter((f) => !P(f, u.date)) : [...e || [], u.date]);
|
|
1222
1222
|
},
|
|
1223
1223
|
[t, e]
|
|
1224
|
-
), d =
|
|
1225
|
-
(u, m) =>
|
|
1226
|
-
|
|
1227
|
-
) :
|
|
1224
|
+
), d = R(() => e ? e.reduce(
|
|
1225
|
+
(u, m) => dt(u, m, ["selected"]),
|
|
1226
|
+
r
|
|
1227
|
+
) : r, [r, e]);
|
|
1228
1228
|
return {
|
|
1229
1229
|
onClickDay: l,
|
|
1230
1230
|
statePerMonth: d,
|
|
@@ -1235,33 +1235,33 @@ const Mr = ({
|
|
|
1235
1235
|
};
|
|
1236
1236
|
};
|
|
1237
1237
|
function Js(t) {
|
|
1238
|
-
const e =
|
|
1238
|
+
const e = Mn(t);
|
|
1239
1239
|
return /* @__PURE__ */ o(wt, { ...t, ...e });
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1241
|
+
const kn = ({
|
|
1242
1242
|
onChange: t,
|
|
1243
1243
|
value: e,
|
|
1244
|
-
statePerMonth:
|
|
1245
|
-
onChangePanel:
|
|
1244
|
+
statePerMonth: r,
|
|
1245
|
+
onChangePanel: n,
|
|
1246
1246
|
locale: s = zt
|
|
1247
1247
|
}) => {
|
|
1248
1248
|
const [i, c] = I(() => {
|
|
1249
1249
|
const h = Vt(e, s);
|
|
1250
1250
|
return h ? h.days[0].date : /* @__PURE__ */ new Date();
|
|
1251
|
-
}), { currentPanel: a, setCurrentPanel: l } = qt(
|
|
1251
|
+
}), { currentPanel: a, setCurrentPanel: l } = qt(n), d = b(
|
|
1252
1252
|
(h) => {
|
|
1253
1253
|
t && t(ke(pe(h.date, s)));
|
|
1254
1254
|
},
|
|
1255
1255
|
[s, t]
|
|
1256
|
-
), u =
|
|
1256
|
+
), u = b(
|
|
1257
1257
|
(h) => {
|
|
1258
1258
|
t && t(ke(h));
|
|
1259
1259
|
},
|
|
1260
1260
|
[t]
|
|
1261
|
-
), m =
|
|
1261
|
+
), m = R(() => {
|
|
1262
1262
|
const h = Vt(e, s);
|
|
1263
|
-
return h ?
|
|
1264
|
-
}, [e, s,
|
|
1263
|
+
return h ? Yr(r, h) : r;
|
|
1264
|
+
}, [e, s, r]), f = R(() => {
|
|
1265
1265
|
const h = Vt(e, s);
|
|
1266
1266
|
return h ? h.days[0].date : /* @__PURE__ */ new Date();
|
|
1267
1267
|
}, [s, e]);
|
|
@@ -1281,28 +1281,28 @@ const kr = ({
|
|
|
1281
1281
|
}, Vt = (t, e) => {
|
|
1282
1282
|
if (!t)
|
|
1283
1283
|
return;
|
|
1284
|
-
const
|
|
1284
|
+
const r = t.split("-"), n = parseInt(r[1], 10), s = parseInt(r[0], 10), i = /* @__PURE__ */ new Date();
|
|
1285
1285
|
i.setFullYear(s);
|
|
1286
|
-
const c =
|
|
1286
|
+
const c = Wt(mr(i, n), { locale: e });
|
|
1287
1287
|
return pe(c, e);
|
|
1288
1288
|
};
|
|
1289
1289
|
function qs(t) {
|
|
1290
|
-
const e =
|
|
1290
|
+
const e = kn(t);
|
|
1291
1291
|
return /* @__PURE__ */ o(wt, { ...t, ...e });
|
|
1292
1292
|
}
|
|
1293
|
-
const Yt = "bottom",
|
|
1294
|
-
const [t, e] =
|
|
1293
|
+
const Yt = "bottom", Ue = () => {
|
|
1294
|
+
const [t, e] = Nr();
|
|
1295
1295
|
return {
|
|
1296
|
-
onChangePanel:
|
|
1297
|
-
var
|
|
1298
|
-
(s = (
|
|
1296
|
+
onChangePanel: b(() => {
|
|
1297
|
+
var n, s;
|
|
1298
|
+
(s = (n = e.current) == null ? void 0 : n.popperInstance) == null || s.update();
|
|
1299
1299
|
}, [e]),
|
|
1300
1300
|
tippyRef: t
|
|
1301
1301
|
};
|
|
1302
|
-
},
|
|
1303
|
-
const [
|
|
1302
|
+
}, Sn = (t, e, r) => {
|
|
1303
|
+
const [n, s] = I(r || !1), i = b(() => (s(!0), !0), [s]), c = b(() => {
|
|
1304
1304
|
s(!1), e && e();
|
|
1305
|
-
}, [s, e]), a =
|
|
1305
|
+
}, [s, e]), a = b(
|
|
1306
1306
|
(l) => {
|
|
1307
1307
|
t && t(l), setTimeout(c, 150);
|
|
1308
1308
|
},
|
|
@@ -1311,14 +1311,14 @@ const Yt = "bottom", ve = () => {
|
|
|
1311
1311
|
return {
|
|
1312
1312
|
showCalendar: i,
|
|
1313
1313
|
hideCalendar: c,
|
|
1314
|
-
showingCalendar:
|
|
1314
|
+
showingCalendar: n,
|
|
1315
1315
|
onSelectDate: a
|
|
1316
1316
|
};
|
|
1317
1317
|
}, Bt = "2999-12-31", Gs = ({
|
|
1318
|
-
displayFormat: t =
|
|
1318
|
+
displayFormat: t = ot.fullDate,
|
|
1319
1319
|
placeholder: e = "Enter date",
|
|
1320
|
-
value:
|
|
1321
|
-
zIndex:
|
|
1320
|
+
value: r,
|
|
1321
|
+
zIndex: n = 100,
|
|
1322
1322
|
calendarTheme: s = bt,
|
|
1323
1323
|
calendarProps: i,
|
|
1324
1324
|
openOnMount: c,
|
|
@@ -1331,27 +1331,27 @@ const Yt = "bottom", ve = () => {
|
|
|
1331
1331
|
maxDate: h = Bt,
|
|
1332
1332
|
disabled: g
|
|
1333
1333
|
}) => {
|
|
1334
|
-
const { hideCalendar: w, showingCalendar:
|
|
1334
|
+
const { hideCalendar: w, showingCalendar: k, onSelectDate: p, showCalendar: y } = Sn(l, a, c), { tippyRef: D, onChangePanel: M } = Ue();
|
|
1335
1335
|
return /* @__PURE__ */ o(A, { width: m, children: /* @__PURE__ */ o(
|
|
1336
1336
|
Lt,
|
|
1337
1337
|
{
|
|
1338
1338
|
arrow: !1,
|
|
1339
1339
|
lazy: !0,
|
|
1340
|
-
visible:
|
|
1340
|
+
visible: k,
|
|
1341
1341
|
onClickOutside: w,
|
|
1342
1342
|
placement: Yt,
|
|
1343
|
-
zIndex:
|
|
1343
|
+
zIndex: n,
|
|
1344
1344
|
appendTo: d ?? "parent",
|
|
1345
|
-
tippyRef:
|
|
1345
|
+
tippyRef: D,
|
|
1346
1346
|
disabled: g,
|
|
1347
1347
|
content: /* @__PURE__ */ o(
|
|
1348
|
-
|
|
1348
|
+
je,
|
|
1349
1349
|
{
|
|
1350
1350
|
...i,
|
|
1351
|
-
onChange:
|
|
1352
|
-
value:
|
|
1351
|
+
onChange: p,
|
|
1352
|
+
value: r,
|
|
1353
1353
|
theme: s,
|
|
1354
|
-
onChangePanel:
|
|
1354
|
+
onChangePanel: M,
|
|
1355
1355
|
minDate: f,
|
|
1356
1356
|
maxDate: h
|
|
1357
1357
|
}
|
|
@@ -1360,9 +1360,9 @@ const Yt = "bottom", ve = () => {
|
|
|
1360
1360
|
pt,
|
|
1361
1361
|
{
|
|
1362
1362
|
type: "date",
|
|
1363
|
-
onFocus:
|
|
1364
|
-
buttonRight: /* @__PURE__ */ o(
|
|
1365
|
-
value:
|
|
1363
|
+
onFocus: y,
|
|
1364
|
+
buttonRight: /* @__PURE__ */ o(ir, { onClick: y, icon: It }),
|
|
1365
|
+
value: r ? v(r, t) : "",
|
|
1366
1366
|
placeholder: e,
|
|
1367
1367
|
size: 9,
|
|
1368
1368
|
disabled: g,
|
|
@@ -1374,22 +1374,22 @@ const Yt = "bottom", ve = () => {
|
|
|
1374
1374
|
)
|
|
1375
1375
|
}
|
|
1376
1376
|
) });
|
|
1377
|
-
},
|
|
1378
|
-
const
|
|
1377
|
+
}, Tn = (t, e) => {
|
|
1378
|
+
const r = O(null), n = O(null), [s, i] = I(!1), [c, a] = I(void 0), l = b(() => (a("startDate"), i(!0), !0), [a, i]), d = b(() => (a("endDate"), i(!0), !0), [a, i]), u = b(() => {
|
|
1379
1379
|
i(!1);
|
|
1380
|
-
}, [i]), m =
|
|
1380
|
+
}, [i]), m = b(
|
|
1381
1381
|
(h) => {
|
|
1382
1382
|
c === "startDate" ? (e == null || e({
|
|
1383
1383
|
startDate: h.date,
|
|
1384
1384
|
endDate: t == null ? void 0 : t.endDate
|
|
1385
|
-
}), t != null && t.endDate ? setTimeout(u, 150) : (a("endDate"),
|
|
1385
|
+
}), t != null && t.endDate ? setTimeout(u, 150) : (a("endDate"), n.current && n.current.focus())) : c === "endDate" && (e == null || e({
|
|
1386
1386
|
startDate: t == null ? void 0 : t.startDate,
|
|
1387
1387
|
endDate: h.date
|
|
1388
|
-
}), t != null && t.startDate ? setTimeout(u, 150) : (a("startDate"),
|
|
1388
|
+
}), t != null && t.startDate ? setTimeout(u, 150) : (a("startDate"), r.current && r.current.focus()));
|
|
1389
1389
|
},
|
|
1390
1390
|
[c, e, a, u, t]
|
|
1391
|
-
), f =
|
|
1392
|
-
() => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) &&
|
|
1391
|
+
), f = R(
|
|
1392
|
+
() => (t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && K(t.startDate, t.endDate),
|
|
1393
1393
|
[t == null ? void 0 : t.startDate, t == null ? void 0 : t.endDate]
|
|
1394
1394
|
);
|
|
1395
1395
|
return {
|
|
@@ -1399,17 +1399,17 @@ const Yt = "bottom", ve = () => {
|
|
|
1399
1399
|
showCalendarStartDate: l,
|
|
1400
1400
|
focusedInput: c,
|
|
1401
1401
|
setFocusedInput: a,
|
|
1402
|
-
startDateInputRef:
|
|
1403
|
-
endDateInputRef:
|
|
1402
|
+
startDateInputRef: r,
|
|
1403
|
+
endDateInputRef: n,
|
|
1404
1404
|
onClickDay: m,
|
|
1405
1405
|
startDateIsAfterEnd: f
|
|
1406
1406
|
};
|
|
1407
1407
|
};
|
|
1408
1408
|
function Qs({
|
|
1409
|
-
displayFormat: t =
|
|
1409
|
+
displayFormat: t = ot.fullDate,
|
|
1410
1410
|
placeholderStartDate: e = "Start date",
|
|
1411
|
-
placeholderEndDate:
|
|
1412
|
-
portalTarget:
|
|
1411
|
+
placeholderEndDate: r = "End date",
|
|
1412
|
+
portalTarget: n,
|
|
1413
1413
|
value: s,
|
|
1414
1414
|
onValueChange: i,
|
|
1415
1415
|
zIndex: c = 100,
|
|
@@ -1422,17 +1422,17 @@ function Qs({
|
|
|
1422
1422
|
}) {
|
|
1423
1423
|
const [h, g] = I("calendar"), {
|
|
1424
1424
|
hideCalendar: w,
|
|
1425
|
-
showCalendarEndDate:
|
|
1426
|
-
showCalendarStartDate:
|
|
1427
|
-
showingCalendar:
|
|
1428
|
-
focusedInput:
|
|
1429
|
-
startDateInputRef:
|
|
1425
|
+
showCalendarEndDate: k,
|
|
1426
|
+
showCalendarStartDate: p,
|
|
1427
|
+
showingCalendar: y,
|
|
1428
|
+
focusedInput: D,
|
|
1429
|
+
startDateInputRef: M,
|
|
1430
1430
|
endDateInputRef: T,
|
|
1431
|
-
onClickDay:
|
|
1431
|
+
onClickDay: Y,
|
|
1432
1432
|
startDateIsAfterEnd: N
|
|
1433
|
-
} =
|
|
1434
|
-
() => (
|
|
1435
|
-
), S =
|
|
1433
|
+
} = Tn(s, i), [x, L] = I(
|
|
1434
|
+
() => (D && (s == null ? void 0 : s[D])) ?? /* @__PURE__ */ new Date()
|
|
1435
|
+
), S = R(
|
|
1436
1436
|
() => Et(void 0, s == null ? void 0 : s.startDate, s == null ? void 0 : s.endDate),
|
|
1437
1437
|
[s]
|
|
1438
1438
|
);
|
|
@@ -1442,37 +1442,37 @@ function Qs({
|
|
|
1442
1442
|
arrow: !1,
|
|
1443
1443
|
lazy: !0,
|
|
1444
1444
|
disabled: f,
|
|
1445
|
-
visible:
|
|
1445
|
+
visible: y,
|
|
1446
1446
|
zIndex: c,
|
|
1447
1447
|
placement: Yt,
|
|
1448
|
-
appendTo:
|
|
1448
|
+
appendTo: n ?? "parent",
|
|
1449
1449
|
onClickOutside: w,
|
|
1450
1450
|
content: /* @__PURE__ */ o(
|
|
1451
1451
|
wt,
|
|
1452
1452
|
{
|
|
1453
1453
|
...d,
|
|
1454
|
-
dateInFocus:
|
|
1455
|
-
setDateInFocus:
|
|
1454
|
+
dateInFocus: x,
|
|
1455
|
+
setDateInFocus: L,
|
|
1456
1456
|
statePerMonth: S,
|
|
1457
1457
|
theme: l,
|
|
1458
|
-
onClickDay:
|
|
1458
|
+
onClickDay: Y,
|
|
1459
1459
|
currentPanel: h,
|
|
1460
1460
|
setCurrentPanel: g,
|
|
1461
1461
|
minDate: u,
|
|
1462
1462
|
maxDate: m
|
|
1463
1463
|
}
|
|
1464
1464
|
),
|
|
1465
|
-
children: /* @__PURE__ */
|
|
1465
|
+
children: /* @__PURE__ */ _(H, { alignItems: "center", children: [
|
|
1466
1466
|
/* @__PURE__ */ o(
|
|
1467
1467
|
pt,
|
|
1468
1468
|
{
|
|
1469
1469
|
iconLeft: It,
|
|
1470
|
-
onFocus:
|
|
1471
|
-
value: s != null && s.startDate ?
|
|
1470
|
+
onFocus: p,
|
|
1471
|
+
value: s != null && s.startDate ? v(s.startDate, t) : "",
|
|
1472
1472
|
placeholder: e,
|
|
1473
1473
|
width: a,
|
|
1474
1474
|
disabled: f,
|
|
1475
|
-
inputRef:
|
|
1475
|
+
inputRef: M,
|
|
1476
1476
|
size: 9,
|
|
1477
1477
|
variant: N ? "error" : void 0
|
|
1478
1478
|
}
|
|
@@ -1481,7 +1481,7 @@ function Qs({
|
|
|
1481
1481
|
/* @__PURE__ */ o(
|
|
1482
1482
|
Re,
|
|
1483
1483
|
{
|
|
1484
|
-
icon:
|
|
1484
|
+
icon: or,
|
|
1485
1485
|
color: Kt("--lhds-color-ui-500"),
|
|
1486
1486
|
size: 14
|
|
1487
1487
|
}
|
|
@@ -1491,9 +1491,9 @@ function Qs({
|
|
|
1491
1491
|
pt,
|
|
1492
1492
|
{
|
|
1493
1493
|
iconLeft: It,
|
|
1494
|
-
onFocus:
|
|
1495
|
-
value: s != null && s.endDate ?
|
|
1496
|
-
placeholder:
|
|
1494
|
+
onFocus: k,
|
|
1495
|
+
value: s != null && s.endDate ? v(s.endDate, t) : "",
|
|
1496
|
+
placeholder: r,
|
|
1497
1497
|
width: a,
|
|
1498
1498
|
disabled: f,
|
|
1499
1499
|
inputRef: T,
|
|
@@ -1508,8 +1508,8 @@ function Qs({
|
|
|
1508
1508
|
const Xs = ({
|
|
1509
1509
|
calendarProps: t,
|
|
1510
1510
|
closeOnCalendarSelectDate: e = !0,
|
|
1511
|
-
dateFormat:
|
|
1512
|
-
disableCalender:
|
|
1511
|
+
dateFormat: r = ot.fullDate,
|
|
1512
|
+
disableCalender: n = !1,
|
|
1513
1513
|
onValueChange: s,
|
|
1514
1514
|
placeholder: i = "yyyy-mm-dd",
|
|
1515
1515
|
portalTarget: c,
|
|
@@ -1523,39 +1523,39 @@ const Xs = ({
|
|
|
1523
1523
|
variant: g,
|
|
1524
1524
|
...w
|
|
1525
1525
|
}) => {
|
|
1526
|
-
const [
|
|
1527
|
-
|
|
1528
|
-
}, [
|
|
1529
|
-
|
|
1530
|
-
}, [
|
|
1526
|
+
const [k, p] = I(!1), { tippyRef: y, onChangePanel: D } = Ue(), M = b(() => {
|
|
1527
|
+
p(!k);
|
|
1528
|
+
}, [p, k]), T = b(() => {
|
|
1529
|
+
p(!1);
|
|
1530
|
+
}, [p]), Y = b(
|
|
1531
1531
|
($) => {
|
|
1532
1532
|
s && s($);
|
|
1533
1533
|
},
|
|
1534
1534
|
[s]
|
|
1535
|
-
), N =
|
|
1535
|
+
), N = b(
|
|
1536
1536
|
($) => {
|
|
1537
|
-
$ && (
|
|
1537
|
+
$ && (Y(v($, r)), e && setTimeout(() => p(!k), 200));
|
|
1538
1538
|
},
|
|
1539
|
-
[
|
|
1540
|
-
),
|
|
1539
|
+
[Y, r, e, p, k]
|
|
1540
|
+
), x = !!a && !/^[-/\\.0-9]+$/.test(a), L = !!a && gr(mt(a, r, /* @__PURE__ */ new Date())), W = !!a && a.length >= r.length && !L || x;
|
|
1541
1541
|
return /* @__PURE__ */ o(A, { width: l, children: /* @__PURE__ */ o(
|
|
1542
1542
|
Lt,
|
|
1543
1543
|
{
|
|
1544
1544
|
arrow: !1,
|
|
1545
1545
|
lazy: !0,
|
|
1546
|
-
visible:
|
|
1546
|
+
visible: k,
|
|
1547
1547
|
zIndex: d,
|
|
1548
1548
|
appendTo: c ?? "parent",
|
|
1549
1549
|
placement: Yt,
|
|
1550
1550
|
onClickOutside: T,
|
|
1551
|
-
tippyRef:
|
|
1551
|
+
tippyRef: y,
|
|
1552
1552
|
content: /* @__PURE__ */ o(
|
|
1553
|
-
|
|
1553
|
+
je,
|
|
1554
1554
|
{
|
|
1555
1555
|
...t,
|
|
1556
1556
|
onChange: N,
|
|
1557
|
-
onChangePanel:
|
|
1558
|
-
value: a &&
|
|
1557
|
+
onChangePanel: D,
|
|
1558
|
+
value: a && L ? mt(a, r, /* @__PURE__ */ new Date()) : void 0,
|
|
1559
1559
|
minDate: f,
|
|
1560
1560
|
maxDate: h,
|
|
1561
1561
|
theme: u
|
|
@@ -1565,18 +1565,18 @@ const Xs = ({
|
|
|
1565
1565
|
pt,
|
|
1566
1566
|
{
|
|
1567
1567
|
...w,
|
|
1568
|
-
variant:
|
|
1568
|
+
variant: W ? "error" : g,
|
|
1569
1569
|
disableContentPaddingRight: !0,
|
|
1570
|
-
contentRight: m ? void 0 : /* @__PURE__ */ o(
|
|
1571
|
-
|
|
1570
|
+
contentRight: m ? void 0 : /* @__PURE__ */ o(H, { alignItems: "center", indent: 0.5, children: /* @__PURE__ */ o(
|
|
1571
|
+
J,
|
|
1572
1572
|
{
|
|
1573
1573
|
size: "small",
|
|
1574
|
-
disabled: w.disabled ||
|
|
1574
|
+
disabled: w.disabled || n,
|
|
1575
1575
|
leftIcon: It,
|
|
1576
|
-
onClick:
|
|
1576
|
+
onClick: M
|
|
1577
1577
|
}
|
|
1578
1578
|
) }),
|
|
1579
|
-
onValueChange:
|
|
1579
|
+
onValueChange: Y,
|
|
1580
1580
|
placeholder: i,
|
|
1581
1581
|
value: a || "",
|
|
1582
1582
|
min: f,
|
|
@@ -1586,7 +1586,7 @@ const Xs = ({
|
|
|
1586
1586
|
)
|
|
1587
1587
|
}
|
|
1588
1588
|
) });
|
|
1589
|
-
},
|
|
1589
|
+
}, jt = (t) => {
|
|
1590
1590
|
if (t === "")
|
|
1591
1591
|
return "00";
|
|
1592
1592
|
const e = parseInt(t, 10);
|
|
@@ -1602,7 +1602,7 @@ const Xs = ({
|
|
|
1602
1602
|
default:
|
|
1603
1603
|
throw new Error("Invalid hour string");
|
|
1604
1604
|
}
|
|
1605
|
-
},
|
|
1605
|
+
}, Ut = (t) => {
|
|
1606
1606
|
if (t === "")
|
|
1607
1607
|
return "00";
|
|
1608
1608
|
const e = parseInt(t, 10);
|
|
@@ -1618,19 +1618,19 @@ const Xs = ({
|
|
|
1618
1618
|
default:
|
|
1619
1619
|
throw new Error("Invalid minute string");
|
|
1620
1620
|
}
|
|
1621
|
-
},
|
|
1621
|
+
}, In = (t) => {
|
|
1622
1622
|
if (!oe(t))
|
|
1623
1623
|
return { time: t, success: !1 };
|
|
1624
1624
|
const e = t && t.split(/-|:|,|;|[/]|[.]| /);
|
|
1625
1625
|
if (e && e.length === 2)
|
|
1626
1626
|
try {
|
|
1627
|
-
const
|
|
1628
|
-
return { time: `${
|
|
1627
|
+
const r = jt(e[0]), n = Ut(e[1]);
|
|
1628
|
+
return { time: `${r}:${n}`, success: !0 };
|
|
1629
1629
|
} catch {
|
|
1630
1630
|
return { time: t, success: !1 };
|
|
1631
1631
|
}
|
|
1632
1632
|
else if (e && e.length === 1) {
|
|
1633
|
-
let
|
|
1633
|
+
let r = 0, n = 0;
|
|
1634
1634
|
switch (t.length) {
|
|
1635
1635
|
case 1:
|
|
1636
1636
|
return { time: `0${t}:00`, success: !0 };
|
|
@@ -1639,12 +1639,12 @@ const Xs = ({
|
|
|
1639
1639
|
return s >= 0 && s < 24 ? { time: `${t}:00`, success: !0 } : s >= 24 && s < 59 ? { time: `00:${t}`, success: !0 } : { time: t, success: !1 };
|
|
1640
1640
|
}
|
|
1641
1641
|
case 3:
|
|
1642
|
-
return
|
|
1642
|
+
return n = parseInt(t.substring(1, 3), 10), n >= 0 && n <= 59 ? {
|
|
1643
1643
|
time: `0${t.substring(0, 1)}:${t.substring(1, 3)}`,
|
|
1644
1644
|
success: !0
|
|
1645
1645
|
} : { time: t, success: !1 };
|
|
1646
1646
|
case 4:
|
|
1647
|
-
return
|
|
1647
|
+
return r = parseInt(t.substring(0, 2), 10), n = parseInt(t.substring(2, 4), 10), r < 0 || r > 23 ? { time: t, success: !1 } : n < 0 || n > 59 ? { time: t, success: !1 } : {
|
|
1648
1648
|
time: `${t.substring(0, 2)}:${t.substring(2, 4)}`,
|
|
1649
1649
|
success: !0
|
|
1650
1650
|
};
|
|
@@ -1656,18 +1656,18 @@ const Xs = ({
|
|
|
1656
1656
|
}, oe = (t) => t ? /^[-:.,/; 0-9]+$/.test(t) : !0, Zs = ({
|
|
1657
1657
|
onValueChange: t,
|
|
1658
1658
|
showPlaceholder: e = !0,
|
|
1659
|
-
useIcon:
|
|
1660
|
-
value:
|
|
1659
|
+
useIcon: r = !0,
|
|
1660
|
+
value: n,
|
|
1661
1661
|
width: s = "85px",
|
|
1662
1662
|
variant: i,
|
|
1663
1663
|
...c
|
|
1664
1664
|
}) => {
|
|
1665
|
-
const [a, l] = I(() => oe(
|
|
1666
|
-
if (
|
|
1667
|
-
const f =
|
|
1665
|
+
const [a, l] = I(() => oe(n)), d = "hh:mm", u = b(() => {
|
|
1666
|
+
if (n) {
|
|
1667
|
+
const f = In(n);
|
|
1668
1668
|
l(f.success), f.success && t && t(f.time);
|
|
1669
1669
|
}
|
|
1670
|
-
}, [
|
|
1670
|
+
}, [n, t, l]), m = b(
|
|
1671
1671
|
(f) => {
|
|
1672
1672
|
const h = f.target.value, g = oe(h);
|
|
1673
1673
|
l(g && h.length <= d.length), t && t(h);
|
|
@@ -1680,8 +1680,8 @@ const Xs = ({
|
|
|
1680
1680
|
...c,
|
|
1681
1681
|
type: "time",
|
|
1682
1682
|
variant: a ? i : "error",
|
|
1683
|
-
iconLeft:
|
|
1684
|
-
value:
|
|
1683
|
+
iconLeft: r ? xe : void 0,
|
|
1684
|
+
value: n,
|
|
1685
1685
|
placeholder: e ? d : void 0,
|
|
1686
1686
|
onChange: m,
|
|
1687
1687
|
onBlur: u,
|
|
@@ -1691,8 +1691,8 @@ const Xs = ({
|
|
|
1691
1691
|
}, Fe = ({
|
|
1692
1692
|
autoFocusLeft: t,
|
|
1693
1693
|
autoFocusRight: e,
|
|
1694
|
-
onEsc:
|
|
1695
|
-
onEnter:
|
|
1694
|
+
onEsc: r,
|
|
1695
|
+
onEnter: n,
|
|
1696
1696
|
onValueChangeLeft: s,
|
|
1697
1697
|
onValueChangeRight: i,
|
|
1698
1698
|
separatorIcon: c,
|
|
@@ -1705,107 +1705,107 @@ const Xs = ({
|
|
|
1705
1705
|
valueLeft: h,
|
|
1706
1706
|
valueRight: g,
|
|
1707
1707
|
minLeft: w,
|
|
1708
|
-
maxLeft:
|
|
1709
|
-
minRight:
|
|
1710
|
-
maxRight:
|
|
1711
|
-
onClickLeft:
|
|
1712
|
-
onClickRight:
|
|
1708
|
+
maxLeft: k,
|
|
1709
|
+
minRight: p,
|
|
1710
|
+
maxRight: y,
|
|
1711
|
+
onClickLeft: D,
|
|
1712
|
+
onClickRight: M,
|
|
1713
1713
|
onClickCalendar: T,
|
|
1714
|
-
onClickArrowDown:
|
|
1714
|
+
onClickArrowDown: Y,
|
|
1715
1715
|
onBlurLeft: N,
|
|
1716
|
-
onBlurRight:
|
|
1717
|
-
onFocusLeft:
|
|
1716
|
+
onBlurRight: x,
|
|
1717
|
+
onFocusLeft: L,
|
|
1718
1718
|
onFocusRight: S,
|
|
1719
|
-
inputRefLeft:
|
|
1719
|
+
inputRefLeft: W,
|
|
1720
1720
|
inputRefRight: $,
|
|
1721
|
-
variant:
|
|
1721
|
+
variant: j,
|
|
1722
1722
|
variantLeft: F,
|
|
1723
|
-
variantRight:
|
|
1724
|
-
onBlur:
|
|
1725
|
-
showPresets:
|
|
1726
|
-
widthLeft:
|
|
1727
|
-
widthRight:
|
|
1728
|
-
disabled:
|
|
1723
|
+
variantRight: V,
|
|
1724
|
+
onBlur: U,
|
|
1725
|
+
showPresets: rt,
|
|
1726
|
+
widthLeft: q,
|
|
1727
|
+
widthRight: G,
|
|
1728
|
+
disabled: Q
|
|
1729
1729
|
}) => {
|
|
1730
|
-
const
|
|
1731
|
-
() =>
|
|
1732
|
-
nt === 0 && (
|
|
1730
|
+
const E = O(0), B = R(
|
|
1731
|
+
() => Rr((nt) => {
|
|
1732
|
+
nt === 0 && (U == null || U());
|
|
1733
1733
|
}, 10),
|
|
1734
|
-
[
|
|
1735
|
-
),
|
|
1734
|
+
[U]
|
|
1735
|
+
), tt = b(
|
|
1736
1736
|
(nt) => {
|
|
1737
|
-
|
|
1737
|
+
E.current++, B(E.current), L && L(nt);
|
|
1738
1738
|
},
|
|
1739
|
-
[
|
|
1740
|
-
),
|
|
1739
|
+
[L, E, B]
|
|
1740
|
+
), et = b(
|
|
1741
1741
|
(nt) => {
|
|
1742
|
-
|
|
1742
|
+
E.current++, B(E.current), S && S(nt);
|
|
1743
1743
|
},
|
|
1744
|
-
[S,
|
|
1745
|
-
),
|
|
1744
|
+
[S, E, B]
|
|
1745
|
+
), Ht = b(
|
|
1746
1746
|
(nt) => {
|
|
1747
|
-
|
|
1747
|
+
E.current--, B(E.current), N && N(nt);
|
|
1748
1748
|
},
|
|
1749
|
-
[N,
|
|
1750
|
-
), Ze =
|
|
1749
|
+
[N, E, B]
|
|
1750
|
+
), Ze = b(
|
|
1751
1751
|
(nt) => {
|
|
1752
|
-
|
|
1752
|
+
E.current--, B(E.current), x && x(nt);
|
|
1753
1753
|
},
|
|
1754
|
-
[
|
|
1754
|
+
[x, E, B]
|
|
1755
1755
|
);
|
|
1756
|
-
return /* @__PURE__ */ o(A, { children: /* @__PURE__ */
|
|
1757
|
-
|
|
1756
|
+
return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ _(
|
|
1757
|
+
Er,
|
|
1758
1758
|
{
|
|
1759
1759
|
disableContentPaddingRight: !0,
|
|
1760
|
-
disabled:
|
|
1761
|
-
variant:
|
|
1762
|
-
contentRight: /* @__PURE__ */
|
|
1760
|
+
disabled: Q,
|
|
1761
|
+
variant: j,
|
|
1762
|
+
contentRight: /* @__PURE__ */ _(H, { alignItems: "center", children: [
|
|
1763
1763
|
/* @__PURE__ */ o(Tt, { num: 0.5, children: /* @__PURE__ */ o(
|
|
1764
|
-
|
|
1764
|
+
J,
|
|
1765
1765
|
{
|
|
1766
1766
|
leftIcon: It,
|
|
1767
1767
|
onClick: T,
|
|
1768
|
-
disabled:
|
|
1768
|
+
disabled: Q,
|
|
1769
1769
|
size: "small"
|
|
1770
1770
|
}
|
|
1771
1771
|
) }),
|
|
1772
|
-
|
|
1773
|
-
/* @__PURE__ */ o(
|
|
1772
|
+
rt ? /* @__PURE__ */ _(vt, { children: [
|
|
1773
|
+
/* @__PURE__ */ o(H, { height: "22px", children: /* @__PURE__ */ o(tr, { vertical: !0 }) }),
|
|
1774
1774
|
/* @__PURE__ */ o(Tt, { num: 0.5, children: /* @__PURE__ */ o(
|
|
1775
|
-
|
|
1775
|
+
J,
|
|
1776
1776
|
{
|
|
1777
1777
|
leftIcon: de,
|
|
1778
|
-
onClick:
|
|
1779
|
-
disabled:
|
|
1778
|
+
onClick: Y,
|
|
1779
|
+
disabled: Q,
|
|
1780
1780
|
size: "small"
|
|
1781
1781
|
}
|
|
1782
1782
|
) })
|
|
1783
1783
|
] }) : null
|
|
1784
1784
|
] }),
|
|
1785
1785
|
children: [
|
|
1786
|
-
/* @__PURE__ */ o(A, { width:
|
|
1786
|
+
/* @__PURE__ */ o(A, { width: q, children: /* @__PURE__ */ o(
|
|
1787
1787
|
pt,
|
|
1788
1788
|
{
|
|
1789
|
-
onEsc:
|
|
1790
|
-
onEnter:
|
|
1791
|
-
onClick:
|
|
1792
|
-
disabled:
|
|
1789
|
+
onEsc: r,
|
|
1790
|
+
onEnter: n,
|
|
1791
|
+
onClick: D,
|
|
1792
|
+
disabled: Q,
|
|
1793
1793
|
hideBorder: !0,
|
|
1794
1794
|
placeholder: a,
|
|
1795
1795
|
value: h,
|
|
1796
1796
|
onValueChange: s,
|
|
1797
1797
|
onChange: m,
|
|
1798
|
-
onBlur:
|
|
1799
|
-
onFocus:
|
|
1800
|
-
inputRef:
|
|
1798
|
+
onBlur: Ht,
|
|
1799
|
+
onFocus: tt,
|
|
1800
|
+
inputRef: W,
|
|
1801
1801
|
variant: F,
|
|
1802
1802
|
type: d,
|
|
1803
1803
|
autoFocus: t,
|
|
1804
1804
|
min: w,
|
|
1805
|
-
max:
|
|
1805
|
+
max: k
|
|
1806
1806
|
}
|
|
1807
1807
|
) }),
|
|
1808
|
-
/* @__PURE__ */ o(
|
|
1808
|
+
/* @__PURE__ */ o(H, { indent: 0.5, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ o(
|
|
1809
1809
|
Re,
|
|
1810
1810
|
{
|
|
1811
1811
|
icon: c,
|
|
@@ -1813,32 +1813,32 @@ const Xs = ({
|
|
|
1813
1813
|
color: Kt("--lhds-color-ui-500")
|
|
1814
1814
|
}
|
|
1815
1815
|
) }),
|
|
1816
|
-
/* @__PURE__ */ o(A, { width:
|
|
1816
|
+
/* @__PURE__ */ o(A, { width: G, children: /* @__PURE__ */ o(
|
|
1817
1817
|
pt,
|
|
1818
1818
|
{
|
|
1819
|
-
onEsc:
|
|
1820
|
-
onEnter:
|
|
1821
|
-
onClick:
|
|
1822
|
-
disabled:
|
|
1819
|
+
onEsc: r,
|
|
1820
|
+
onEnter: n,
|
|
1821
|
+
onClick: M,
|
|
1822
|
+
disabled: Q,
|
|
1823
1823
|
hideBorder: !0,
|
|
1824
1824
|
placeholder: l,
|
|
1825
1825
|
value: g,
|
|
1826
1826
|
onValueChange: i,
|
|
1827
1827
|
onChange: f,
|
|
1828
1828
|
onBlur: Ze,
|
|
1829
|
-
onFocus:
|
|
1829
|
+
onFocus: et,
|
|
1830
1830
|
inputRef: $,
|
|
1831
|
-
variant:
|
|
1831
|
+
variant: V,
|
|
1832
1832
|
type: u,
|
|
1833
1833
|
autoFocus: e,
|
|
1834
|
-
min:
|
|
1835
|
-
max:
|
|
1834
|
+
min: p,
|
|
1835
|
+
max: y
|
|
1836
1836
|
}
|
|
1837
1837
|
) })
|
|
1838
1838
|
]
|
|
1839
1839
|
}
|
|
1840
1840
|
) });
|
|
1841
|
-
},
|
|
1841
|
+
}, Rn = (t) => {
|
|
1842
1842
|
if (t == null)
|
|
1843
1843
|
throw new Error("Time is not set.");
|
|
1844
1844
|
if (t === "")
|
|
@@ -1850,24 +1850,24 @@ const Xs = ({
|
|
|
1850
1850
|
throw new Error("Invalid time.");
|
|
1851
1851
|
if (e[0].length < 1 || e[0].length > 2)
|
|
1852
1852
|
throw new Error("Invalid time.");
|
|
1853
|
-
const
|
|
1854
|
-
if (isNaN(n))
|
|
1855
|
-
throw new Error("Invalid time.");
|
|
1853
|
+
const r = parseInt(e[0], 10), n = parseInt(e[1], 10);
|
|
1856
1854
|
if (isNaN(r))
|
|
1857
1855
|
throw new Error("Invalid time.");
|
|
1858
|
-
if (n
|
|
1856
|
+
if (isNaN(n))
|
|
1857
|
+
throw new Error("Invalid time.");
|
|
1858
|
+
if (r < 0 || r > 23)
|
|
1859
1859
|
throw new Error("Invalid time.");
|
|
1860
|
-
if (
|
|
1860
|
+
if (n < 0 || n > 59)
|
|
1861
1861
|
throw new Error("Invalid time.");
|
|
1862
|
-
return
|
|
1863
|
-
},
|
|
1862
|
+
return r * 100 + n;
|
|
1863
|
+
}, xn = (t) => {
|
|
1864
1864
|
try {
|
|
1865
|
-
return
|
|
1865
|
+
return Rn(t), !0;
|
|
1866
1866
|
} catch {
|
|
1867
1867
|
return !1;
|
|
1868
1868
|
}
|
|
1869
1869
|
}, Ot = (t) => {
|
|
1870
|
-
if (t &&
|
|
1870
|
+
if (t && xn(t)) {
|
|
1871
1871
|
const e = t.split(":");
|
|
1872
1872
|
return {
|
|
1873
1873
|
hour: be(e[0]),
|
|
@@ -1878,43 +1878,43 @@ const Xs = ({
|
|
|
1878
1878
|
hour: void 0,
|
|
1879
1879
|
minute: void 0
|
|
1880
1880
|
};
|
|
1881
|
-
},
|
|
1881
|
+
}, En = (t) => `${jt(String(t.getHours()))}:${Ut(
|
|
1882
1882
|
String(t.getMinutes())
|
|
1883
|
-
)}`,
|
|
1884
|
-
timePicker:
|
|
1885
|
-
timePickerColumn:
|
|
1886
|
-
},
|
|
1883
|
+
)}`, _n = "_timePicker_1w05d_1", Nn = "_timePickerColumn_1w05d_6", Ce = {
|
|
1884
|
+
timePicker: _n,
|
|
1885
|
+
timePickerColumn: Nn
|
|
1886
|
+
}, An = ({
|
|
1887
1887
|
onClick: t,
|
|
1888
1888
|
item: e,
|
|
1889
|
-
selected:
|
|
1890
|
-
columnRef:
|
|
1889
|
+
selected: r,
|
|
1890
|
+
columnRef: n,
|
|
1891
1891
|
canScrollRef: s
|
|
1892
1892
|
}) => {
|
|
1893
|
-
const i =
|
|
1893
|
+
const i = O(null);
|
|
1894
1894
|
return Z(
|
|
1895
1895
|
function() {
|
|
1896
|
-
if (
|
|
1896
|
+
if (r && n.current && i.current && s.current) {
|
|
1897
1897
|
const a = i.current.scrollHeight * Math.max(e - 2, 0);
|
|
1898
|
-
|
|
1898
|
+
n.current.scrollTo(0, a), s.current = !1;
|
|
1899
1899
|
}
|
|
1900
1900
|
},
|
|
1901
|
-
[
|
|
1901
|
+
[n, e, r, s]
|
|
1902
1902
|
), /* @__PURE__ */ o(
|
|
1903
|
-
|
|
1903
|
+
H,
|
|
1904
1904
|
{
|
|
1905
1905
|
width: "64px",
|
|
1906
1906
|
justifyContent: "center",
|
|
1907
1907
|
spacing: 0.5,
|
|
1908
1908
|
indent: 0.5,
|
|
1909
1909
|
ref: i,
|
|
1910
|
-
children:
|
|
1910
|
+
children: r ? /* @__PURE__ */ o(
|
|
1911
1911
|
Mt,
|
|
1912
1912
|
{
|
|
1913
|
-
label:
|
|
1913
|
+
label: xr(String(e), 2, "0"),
|
|
1914
1914
|
onClick: () => t && t(e)
|
|
1915
1915
|
}
|
|
1916
1916
|
) : /* @__PURE__ */ o(
|
|
1917
|
-
|
|
1917
|
+
J,
|
|
1918
1918
|
{
|
|
1919
1919
|
label: String(e).padStart(2, "0"),
|
|
1920
1920
|
onClick: () => t && t(e)
|
|
@@ -1925,69 +1925,69 @@ const Xs = ({
|
|
|
1925
1925
|
}, Se = ({
|
|
1926
1926
|
onClick: t,
|
|
1927
1927
|
items: e,
|
|
1928
|
-
selectedItem:
|
|
1929
|
-
canScrollRef:
|
|
1928
|
+
selectedItem: r,
|
|
1929
|
+
canScrollRef: n
|
|
1930
1930
|
}) => {
|
|
1931
|
-
const s =
|
|
1932
|
-
return /* @__PURE__ */ o(
|
|
1933
|
-
|
|
1931
|
+
const s = O(null);
|
|
1932
|
+
return /* @__PURE__ */ o(C, { className: Ce.timePickerColumn, ref: s, children: e.map((i) => /* @__PURE__ */ o(
|
|
1933
|
+
An,
|
|
1934
1934
|
{
|
|
1935
1935
|
item: i,
|
|
1936
1936
|
onClick: t,
|
|
1937
|
-
selected: i ===
|
|
1937
|
+
selected: i === r,
|
|
1938
1938
|
columnRef: s,
|
|
1939
|
-
canScrollRef:
|
|
1939
|
+
canScrollRef: n
|
|
1940
1940
|
},
|
|
1941
1941
|
i
|
|
1942
1942
|
)) });
|
|
1943
|
-
},
|
|
1943
|
+
}, Ln = he(0, 24), Pn = he(0, 60), Yn = ({
|
|
1944
1944
|
value: t,
|
|
1945
1945
|
onValueChange: e
|
|
1946
1946
|
}) => {
|
|
1947
|
-
const
|
|
1947
|
+
const r = O(!0), [n, s] = I(void 0), [i, c] = I(void 0);
|
|
1948
1948
|
Z(() => {
|
|
1949
1949
|
if (t) {
|
|
1950
1950
|
const { minute: d, hour: u } = Ot(t);
|
|
1951
1951
|
s(u), c(d);
|
|
1952
1952
|
}
|
|
1953
1953
|
}, [t]);
|
|
1954
|
-
const a =
|
|
1954
|
+
const a = b(
|
|
1955
1955
|
(d) => {
|
|
1956
1956
|
s(d), e == null || e(
|
|
1957
|
-
`${
|
|
1957
|
+
`${jt(String(d ?? 0))}:${Ut(String(i ?? 0))}`
|
|
1958
1958
|
);
|
|
1959
1959
|
},
|
|
1960
1960
|
[i, e]
|
|
1961
|
-
), l =
|
|
1961
|
+
), l = b(
|
|
1962
1962
|
(d) => {
|
|
1963
1963
|
c(d), e == null || e(
|
|
1964
|
-
`${
|
|
1964
|
+
`${jt(String(n ?? 0))}:${Ut(String(d ?? 0))}`
|
|
1965
1965
|
);
|
|
1966
1966
|
},
|
|
1967
|
-
[
|
|
1967
|
+
[n, e]
|
|
1968
1968
|
);
|
|
1969
|
-
return /* @__PURE__ */
|
|
1969
|
+
return /* @__PURE__ */ _(H, { className: Ce.timePicker, children: [
|
|
1970
1970
|
/* @__PURE__ */ o(
|
|
1971
1971
|
Se,
|
|
1972
1972
|
{
|
|
1973
|
-
items:
|
|
1973
|
+
items: Ln,
|
|
1974
1974
|
onClick: a,
|
|
1975
|
-
selectedItem:
|
|
1976
|
-
canScrollRef:
|
|
1975
|
+
selectedItem: n,
|
|
1976
|
+
canScrollRef: r
|
|
1977
1977
|
}
|
|
1978
1978
|
),
|
|
1979
1979
|
/* @__PURE__ */ o(Tt, {}),
|
|
1980
1980
|
/* @__PURE__ */ o(
|
|
1981
1981
|
Se,
|
|
1982
1982
|
{
|
|
1983
|
-
items:
|
|
1983
|
+
items: Pn,
|
|
1984
1984
|
onClick: l,
|
|
1985
1985
|
selectedItem: i,
|
|
1986
|
-
canScrollRef:
|
|
1986
|
+
canScrollRef: r
|
|
1987
1987
|
}
|
|
1988
1988
|
)
|
|
1989
1989
|
] });
|
|
1990
|
-
},
|
|
1990
|
+
}, Bn = (t, e, r) => {
|
|
1991
1991
|
Z(
|
|
1992
1992
|
function() {
|
|
1993
1993
|
t && e(t);
|
|
@@ -1995,15 +1995,15 @@ const Xs = ({
|
|
|
1995
1995
|
[t, e]
|
|
1996
1996
|
), Z(
|
|
1997
1997
|
function() {
|
|
1998
|
-
|
|
1998
|
+
r.current && (t ? r.current.valueAsDate = new Date(
|
|
1999
1999
|
Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())
|
|
2000
|
-
) :
|
|
2000
|
+
) : r.current.valueAsDate = null);
|
|
2001
2001
|
},
|
|
2002
|
-
[t,
|
|
2002
|
+
[t, r]
|
|
2003
2003
|
);
|
|
2004
|
-
},
|
|
2005
|
-
setDateInFocus:
|
|
2006
|
-
showCalendarInternal:
|
|
2004
|
+
}, Hn = (t, e, {
|
|
2005
|
+
setDateInFocus: r,
|
|
2006
|
+
showCalendarInternal: n,
|
|
2007
2007
|
hideCalendarInternal: s,
|
|
2008
2008
|
setFirstFocusedInput: i,
|
|
2009
2009
|
setCurrentPanel: c,
|
|
@@ -2012,61 +2012,61 @@ const Xs = ({
|
|
|
2012
2012
|
localDate: d,
|
|
2013
2013
|
setLocalDate: u
|
|
2014
2014
|
}, m) => {
|
|
2015
|
-
const f =
|
|
2016
|
-
(
|
|
2017
|
-
if (!
|
|
2015
|
+
const f = b(
|
|
2016
|
+
(y) => {
|
|
2017
|
+
if (!y)
|
|
2018
2018
|
return;
|
|
2019
|
-
const
|
|
2019
|
+
const D = new Date(y);
|
|
2020
2020
|
if (t)
|
|
2021
|
-
|
|
2021
|
+
D.setHours(t.getHours()), D.setMinutes(t.getMinutes()), e == null || e(D), u(void 0);
|
|
2022
2022
|
else if (a) {
|
|
2023
|
-
const { minute:
|
|
2024
|
-
|
|
2023
|
+
const { minute: M, hour: T } = Ot(a);
|
|
2024
|
+
D.setHours(T ?? 0), D.setMinutes(M ?? 0), e == null || e(D), u(void 0);
|
|
2025
2025
|
} else
|
|
2026
|
-
u(
|
|
2027
|
-
|
|
2028
|
-
Date.UTC(
|
|
2026
|
+
u(D);
|
|
2027
|
+
r(D), m.current && (m.current.valueAsDate = new Date(
|
|
2028
|
+
Date.UTC(D.getFullYear(), D.getMonth(), D.getDate())
|
|
2029
2029
|
));
|
|
2030
2030
|
},
|
|
2031
|
-
[t, m, a, e,
|
|
2032
|
-
), h =
|
|
2033
|
-
(
|
|
2034
|
-
if (
|
|
2031
|
+
[t, m, a, e, r, u]
|
|
2032
|
+
), h = b(
|
|
2033
|
+
(y) => {
|
|
2034
|
+
if (y)
|
|
2035
2035
|
if (t) {
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2036
|
+
const D = Ot(y), M = new Date(t);
|
|
2037
|
+
M.setHours(D.hour || 0), M.setMinutes(D.minute || 0), e == null || e(M), l(void 0);
|
|
2038
2038
|
} else if (d) {
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2039
|
+
const D = Ot(y), M = new Date(d);
|
|
2040
|
+
M.setHours(D.hour || 0), M.setMinutes(D.minute || 0), e == null || e(M), l(void 0);
|
|
2041
2041
|
} else
|
|
2042
|
-
l(
|
|
2042
|
+
l(y);
|
|
2043
2043
|
},
|
|
2044
2044
|
[e, t, d, l]
|
|
2045
|
-
), g =
|
|
2046
|
-
(
|
|
2047
|
-
|
|
2045
|
+
), g = b(
|
|
2046
|
+
(y) => {
|
|
2047
|
+
y.target.value[0] !== "0" && f(y.target.valueAsDate);
|
|
2048
2048
|
},
|
|
2049
2049
|
[f]
|
|
2050
|
-
), w =
|
|
2051
|
-
(
|
|
2050
|
+
), w = b(
|
|
2051
|
+
(y) => h(y.target.value),
|
|
2052
2052
|
[h]
|
|
2053
|
-
),
|
|
2054
|
-
|
|
2055
|
-
}, [t, c,
|
|
2053
|
+
), k = b(() => {
|
|
2054
|
+
r(t || /* @__PURE__ */ new Date()), c("calendar"), n();
|
|
2055
|
+
}, [t, c, n, r]), p = b(() => {
|
|
2056
2056
|
i(void 0), s();
|
|
2057
2057
|
}, [i, s]);
|
|
2058
2058
|
return {
|
|
2059
2059
|
inputLeftChangeHandler: g,
|
|
2060
2060
|
inputRightChangeHandler: w,
|
|
2061
|
-
hideCalendar:
|
|
2062
|
-
showCalendar:
|
|
2061
|
+
hideCalendar: p,
|
|
2062
|
+
showCalendar: k,
|
|
2063
2063
|
onChangeTime: h,
|
|
2064
2064
|
onChangeDate: f
|
|
2065
2065
|
};
|
|
2066
|
-
},
|
|
2067
|
-
const [e,
|
|
2066
|
+
}, $n = (t) => {
|
|
2067
|
+
const [e, r] = I(void 0), [n, s] = I(void 0), [i, c, a] = ne(!1), [l, d, u] = ne(!1), [m, f] = I(void 0), [h, g] = I(
|
|
2068
2068
|
() => t ?? /* @__PURE__ */ new Date()
|
|
2069
|
-
), [w,
|
|
2069
|
+
), [w, k] = I("calendar");
|
|
2070
2070
|
return {
|
|
2071
2071
|
isCalendarVisible: i,
|
|
2072
2072
|
showCalendarInternal: c,
|
|
@@ -2076,46 +2076,46 @@ const Xs = ({
|
|
|
2076
2076
|
dateInFocus: h,
|
|
2077
2077
|
setDateInFocus: g,
|
|
2078
2078
|
currentPanel: w,
|
|
2079
|
-
setCurrentPanel:
|
|
2079
|
+
setCurrentPanel: k,
|
|
2080
2080
|
isTimePickerVisible: l,
|
|
2081
2081
|
showTimePicker: d,
|
|
2082
2082
|
hideTimePicker: u,
|
|
2083
2083
|
localDate: e,
|
|
2084
|
-
setLocalDate:
|
|
2085
|
-
localTime:
|
|
2084
|
+
setLocalDate: r,
|
|
2085
|
+
localTime: n,
|
|
2086
2086
|
setLocalTime: s
|
|
2087
2087
|
};
|
|
2088
|
-
},
|
|
2088
|
+
}, On = (t, e, r, n, {
|
|
2089
2089
|
isCalendarVisible: s,
|
|
2090
2090
|
setCurrentPanel: i,
|
|
2091
2091
|
showTimePicker: c,
|
|
2092
2092
|
hideTimePicker: a
|
|
2093
2093
|
}) => {
|
|
2094
|
-
const l =
|
|
2095
|
-
s ||
|
|
2096
|
-
}, [a, s, i,
|
|
2097
|
-
|
|
2098
|
-
}, [
|
|
2094
|
+
const l = b(() => {
|
|
2095
|
+
s || r(), i("calendar"), a();
|
|
2096
|
+
}, [a, s, i, r]), d = b(() => {
|
|
2097
|
+
n(), c();
|
|
2098
|
+
}, [n, c]), u = b(
|
|
2099
2099
|
(g) => {
|
|
2100
|
-
t(g.date),
|
|
2100
|
+
t(g.date), n(), c();
|
|
2101
2101
|
},
|
|
2102
|
-
[t,
|
|
2103
|
-
), m =
|
|
2104
|
-
i("presets"),
|
|
2105
|
-
}, [i,
|
|
2102
|
+
[t, n, c]
|
|
2103
|
+
), m = b(() => {
|
|
2104
|
+
i("presets"), r();
|
|
2105
|
+
}, [i, r]), f = b(() => {
|
|
2106
2106
|
var g;
|
|
2107
|
-
s ?
|
|
2107
|
+
s ? n() : ((g = e.current) == null || g.focus(), i("calendar"), r());
|
|
2108
2108
|
}, [
|
|
2109
2109
|
s,
|
|
2110
|
-
|
|
2110
|
+
n,
|
|
2111
2111
|
e,
|
|
2112
2112
|
i,
|
|
2113
|
-
|
|
2114
|
-
]), h =
|
|
2113
|
+
r
|
|
2114
|
+
]), h = b(
|
|
2115
2115
|
(g) => {
|
|
2116
|
-
g.key === "Escape" &&
|
|
2116
|
+
g.key === "Escape" && n();
|
|
2117
2117
|
},
|
|
2118
|
-
[
|
|
2118
|
+
[n]
|
|
2119
2119
|
);
|
|
2120
2120
|
return {
|
|
2121
2121
|
onFocusLeft: l,
|
|
@@ -2128,8 +2128,8 @@ const Xs = ({
|
|
|
2128
2128
|
}, Vs = ({
|
|
2129
2129
|
value: t,
|
|
2130
2130
|
onValueChange: e,
|
|
2131
|
-
onEnter:
|
|
2132
|
-
onEsc:
|
|
2131
|
+
onEnter: r,
|
|
2132
|
+
onEsc: n,
|
|
2133
2133
|
onBlur: s,
|
|
2134
2134
|
autoFocus: i,
|
|
2135
2135
|
minDate: c,
|
|
@@ -2139,50 +2139,50 @@ const Xs = ({
|
|
|
2139
2139
|
variant: u,
|
|
2140
2140
|
disabled: m
|
|
2141
2141
|
}) => {
|
|
2142
|
-
const f =
|
|
2142
|
+
const f = O(null), h = O(null), g = $n(t), {
|
|
2143
2143
|
setCurrentPanel: w,
|
|
2144
|
-
currentPanel:
|
|
2145
|
-
isCalendarVisible:
|
|
2146
|
-
dateInFocus:
|
|
2147
|
-
setDateInFocus:
|
|
2148
|
-
isTimePickerVisible:
|
|
2144
|
+
currentPanel: k,
|
|
2145
|
+
isCalendarVisible: p,
|
|
2146
|
+
dateInFocus: y,
|
|
2147
|
+
setDateInFocus: D,
|
|
2148
|
+
isTimePickerVisible: M,
|
|
2149
2149
|
hideTimePicker: T,
|
|
2150
|
-
localTime:
|
|
2150
|
+
localTime: Y,
|
|
2151
2151
|
localDate: N
|
|
2152
2152
|
} = g, {
|
|
2153
|
-
showCalendar:
|
|
2154
|
-
hideCalendar:
|
|
2153
|
+
showCalendar: x,
|
|
2154
|
+
hideCalendar: L,
|
|
2155
2155
|
inputLeftChangeHandler: S,
|
|
2156
|
-
inputRightChangeHandler:
|
|
2156
|
+
inputRightChangeHandler: W,
|
|
2157
2157
|
onChangeTime: $,
|
|
2158
|
-
onChangeDate:
|
|
2159
|
-
} =
|
|
2158
|
+
onChangeDate: j
|
|
2159
|
+
} = Hn(t, e, g, f), {
|
|
2160
2160
|
onKeyDownHandler: F,
|
|
2161
|
-
onFocusRight:
|
|
2162
|
-
onFocusLeft:
|
|
2163
|
-
onClickDay:
|
|
2164
|
-
onClickCalendarButton:
|
|
2165
|
-
onClickArrowButton:
|
|
2166
|
-
} =
|
|
2167
|
-
|
|
2161
|
+
onFocusRight: V,
|
|
2162
|
+
onFocusLeft: U,
|
|
2163
|
+
onClickDay: rt,
|
|
2164
|
+
onClickCalendarButton: q,
|
|
2165
|
+
onClickArrowButton: G
|
|
2166
|
+
} = On(
|
|
2167
|
+
j,
|
|
2168
2168
|
f,
|
|
2169
|
-
|
|
2170
|
-
|
|
2169
|
+
x,
|
|
2170
|
+
L,
|
|
2171
2171
|
g
|
|
2172
2172
|
);
|
|
2173
|
-
|
|
2174
|
-
const
|
|
2175
|
-
const
|
|
2176
|
-
return
|
|
2173
|
+
Bn(t, D, f);
|
|
2174
|
+
const Q = R(() => {
|
|
2175
|
+
const Ht = t || N;
|
|
2176
|
+
return Ht ? dt(void 0, Ht, [
|
|
2177
2177
|
"singleSelected",
|
|
2178
2178
|
"selected"
|
|
2179
2179
|
]) : {};
|
|
2180
|
-
}, [N, t]),
|
|
2181
|
-
|
|
2182
|
-
}, [
|
|
2183
|
-
() => t ?
|
|
2184
|
-
[t,
|
|
2185
|
-
),
|
|
2180
|
+
}, [N, t]), E = b(() => {
|
|
2181
|
+
L(), T();
|
|
2182
|
+
}, [L, T]), B = R(
|
|
2183
|
+
() => t ? En(t) : Y,
|
|
2184
|
+
[t, Y]
|
|
2185
|
+
), tt = se(p, 300), et = se(M, 300);
|
|
2186
2186
|
return /* @__PURE__ */ o(A, { onKeyDown: F, children: /* @__PURE__ */ o(
|
|
2187
2187
|
Lt,
|
|
2188
2188
|
{
|
|
@@ -2190,37 +2190,37 @@ const Xs = ({
|
|
|
2190
2190
|
lazy: !0,
|
|
2191
2191
|
disabled: m,
|
|
2192
2192
|
placement: Yt,
|
|
2193
|
-
visible:
|
|
2194
|
-
onClickOutside:
|
|
2195
|
-
content: (
|
|
2193
|
+
visible: p || M,
|
|
2194
|
+
onClickOutside: E,
|
|
2195
|
+
content: (tt || et) && /* @__PURE__ */ o(C, { children: tt ? /* @__PURE__ */ o(
|
|
2196
2196
|
wt,
|
|
2197
2197
|
{
|
|
2198
|
-
statePerMonth:
|
|
2199
|
-
onClickDay:
|
|
2200
|
-
dateInFocus:
|
|
2201
|
-
setDateInFocus:
|
|
2202
|
-
currentPanel:
|
|
2198
|
+
statePerMonth: Q,
|
|
2199
|
+
onClickDay: rt,
|
|
2200
|
+
dateInFocus: y,
|
|
2201
|
+
setDateInFocus: D,
|
|
2202
|
+
currentPanel: k,
|
|
2203
2203
|
setCurrentPanel: w,
|
|
2204
2204
|
minDate: c,
|
|
2205
2205
|
maxDate: d
|
|
2206
2206
|
}
|
|
2207
|
-
) :
|
|
2208
|
-
/* @__PURE__ */ o(
|
|
2209
|
-
|
|
2207
|
+
) : et ? /* @__PURE__ */ _(C, { children: [
|
|
2208
|
+
/* @__PURE__ */ o(C, { overflow: "hidden", height: "250px", children: /* @__PURE__ */ o(
|
|
2209
|
+
Yn,
|
|
2210
2210
|
{
|
|
2211
|
-
value:
|
|
2211
|
+
value: B ?? "",
|
|
2212
2212
|
onValueChange: $
|
|
2213
2213
|
}
|
|
2214
2214
|
) }),
|
|
2215
2215
|
/* @__PURE__ */ o(yt, {}),
|
|
2216
|
-
/* @__PURE__ */ o(
|
|
2216
|
+
/* @__PURE__ */ o(H, { justifyContent: "flex-end", children: /* @__PURE__ */ o(Mt, { label: "Done", onClick: T }) })
|
|
2217
2217
|
] }) : null }),
|
|
2218
2218
|
children: /* @__PURE__ */ o(
|
|
2219
2219
|
Fe,
|
|
2220
2220
|
{
|
|
2221
2221
|
autoFocusLeft: i,
|
|
2222
|
-
onEsc:
|
|
2223
|
-
onEnter:
|
|
2222
|
+
onEsc: n,
|
|
2223
|
+
onEnter: r,
|
|
2224
2224
|
onBlur: s,
|
|
2225
2225
|
disabled: m,
|
|
2226
2226
|
separatorIcon: xe,
|
|
@@ -2229,16 +2229,16 @@ const Xs = ({
|
|
|
2229
2229
|
placeholderLeft: "yyyy-mm-dd",
|
|
2230
2230
|
placeholderRight: "hh:mm",
|
|
2231
2231
|
onChangeLeft: S,
|
|
2232
|
-
onChangeRight:
|
|
2233
|
-
onClickArrowDown:
|
|
2234
|
-
onClickCalendar:
|
|
2235
|
-
onFocusLeft:
|
|
2236
|
-
onFocusRight:
|
|
2237
|
-
onClickLeft:
|
|
2238
|
-
onClickRight:
|
|
2232
|
+
onChangeRight: W,
|
|
2233
|
+
onClickArrowDown: G,
|
|
2234
|
+
onClickCalendar: q,
|
|
2235
|
+
onFocusLeft: U,
|
|
2236
|
+
onFocusRight: V,
|
|
2237
|
+
onClickLeft: U,
|
|
2238
|
+
onClickRight: V,
|
|
2239
2239
|
inputRefLeft: f,
|
|
2240
2240
|
inputRefRight: h,
|
|
2241
|
-
valueRight:
|
|
2241
|
+
valueRight: B ?? "",
|
|
2242
2242
|
widthLeft: a,
|
|
2243
2243
|
widthRight: l,
|
|
2244
2244
|
minLeft: c,
|
|
@@ -2248,34 +2248,34 @@ const Xs = ({
|
|
|
2248
2248
|
)
|
|
2249
2249
|
}
|
|
2250
2250
|
) });
|
|
2251
|
-
},
|
|
2251
|
+
}, vn = ({
|
|
2252
2252
|
value: t,
|
|
2253
2253
|
onValueChange: e,
|
|
2254
|
-
year:
|
|
2254
|
+
year: r
|
|
2255
2255
|
}) => {
|
|
2256
|
-
const
|
|
2257
|
-
return /* @__PURE__ */ o(
|
|
2256
|
+
const n = String(r);
|
|
2257
|
+
return /* @__PURE__ */ o(H, { justifyContent: "center", children: t === r ? /* @__PURE__ */ o(Mt, { label: n, onClick: () => e == null ? void 0 : e(r) }) : /* @__PURE__ */ o(J, { label: n, onClick: () => e == null ? void 0 : e(r) }) });
|
|
2258
2258
|
}, ti = ({
|
|
2259
2259
|
value: t,
|
|
2260
2260
|
onValueChange: e,
|
|
2261
|
-
initialLastYear:
|
|
2261
|
+
initialLastYear: r
|
|
2262
2262
|
}) => {
|
|
2263
|
-
const [
|
|
2264
|
-
const c =
|
|
2265
|
-
return Ye(he(c,
|
|
2266
|
-
}, [
|
|
2263
|
+
const [n, s] = I(() => t ? t + 4 : r ?? (/* @__PURE__ */ new Date()).getFullYear() + 4), i = R(() => {
|
|
2264
|
+
const c = n - 11;
|
|
2265
|
+
return Ye(he(c, n + 1), 3);
|
|
2266
|
+
}, [n]);
|
|
2267
2267
|
return Z(() => {
|
|
2268
|
-
s((c) =>
|
|
2269
|
-
}, [t]), /* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */ o(
|
|
2271
|
-
|
|
2268
|
+
s((c) => Wn(t, c));
|
|
2269
|
+
}, [t]), /* @__PURE__ */ _(H, { children: [
|
|
2270
|
+
/* @__PURE__ */ o(C, { justifyContent: "center", children: /* @__PURE__ */ o(
|
|
2271
|
+
J,
|
|
2272
2272
|
{
|
|
2273
2273
|
leftIcon: Ft,
|
|
2274
|
-
onClick: () => s(
|
|
2274
|
+
onClick: () => s(n - 3)
|
|
2275
2275
|
}
|
|
2276
2276
|
) }),
|
|
2277
|
-
/* @__PURE__ */ o(
|
|
2278
|
-
|
|
2277
|
+
/* @__PURE__ */ o(C, { gap: 1, children: i.map((c) => /* @__PURE__ */ o(H, { gap: 1, children: c.map((a) => /* @__PURE__ */ o(
|
|
2278
|
+
vn,
|
|
2279
2279
|
{
|
|
2280
2280
|
year: a,
|
|
2281
2281
|
onValueChange: e,
|
|
@@ -2283,49 +2283,49 @@ const Xs = ({
|
|
|
2283
2283
|
},
|
|
2284
2284
|
a
|
|
2285
2285
|
)) }, c[0])) }),
|
|
2286
|
-
/* @__PURE__ */ o(
|
|
2287
|
-
|
|
2286
|
+
/* @__PURE__ */ o(C, { justifyContent: "center", children: /* @__PURE__ */ o(
|
|
2287
|
+
J,
|
|
2288
2288
|
{
|
|
2289
2289
|
leftIcon: Nt,
|
|
2290
|
-
onClick: () => s(
|
|
2290
|
+
onClick: () => s(n + 3)
|
|
2291
2291
|
}
|
|
2292
2292
|
) })
|
|
2293
2293
|
] });
|
|
2294
|
-
},
|
|
2294
|
+
}, Wn = (t, e) => {
|
|
2295
2295
|
if (t == null)
|
|
2296
2296
|
return e;
|
|
2297
2297
|
if (t > e) {
|
|
2298
|
-
const
|
|
2298
|
+
const n = t - e, s = n % 3, i = n - s + 3;
|
|
2299
2299
|
return e + i;
|
|
2300
2300
|
}
|
|
2301
|
-
const
|
|
2302
|
-
if (t <
|
|
2303
|
-
const
|
|
2301
|
+
const r = e - 11;
|
|
2302
|
+
if (t < r) {
|
|
2303
|
+
const n = r - t, s = n % 3, i = n - s + 3;
|
|
2304
2304
|
return e - i;
|
|
2305
2305
|
}
|
|
2306
2306
|
return e;
|
|
2307
|
-
},
|
|
2307
|
+
}, jn = (t, e, r, n, s) => {
|
|
2308
2308
|
Z(
|
|
2309
2309
|
function() {
|
|
2310
|
-
t &&
|
|
2310
|
+
t && r(t);
|
|
2311
2311
|
},
|
|
2312
|
-
[t,
|
|
2312
|
+
[t, r]
|
|
2313
2313
|
), Z(
|
|
2314
2314
|
function() {
|
|
2315
|
-
e &&
|
|
2315
|
+
e && r(e);
|
|
2316
2316
|
},
|
|
2317
|
-
[e,
|
|
2317
|
+
[e, r]
|
|
2318
2318
|
), Z(
|
|
2319
2319
|
function() {
|
|
2320
|
-
|
|
2320
|
+
n.current && (t ? n.current.valueAsDate = new Date(
|
|
2321
2321
|
Date.UTC(
|
|
2322
2322
|
t.getFullYear(),
|
|
2323
2323
|
t.getMonth(),
|
|
2324
2324
|
t.getDate()
|
|
2325
2325
|
)
|
|
2326
|
-
) :
|
|
2326
|
+
) : n.current.valueAsDate = null);
|
|
2327
2327
|
},
|
|
2328
|
-
[t,
|
|
2328
|
+
[t, n]
|
|
2329
2329
|
), Z(
|
|
2330
2330
|
function() {
|
|
2331
2331
|
s.current && (e ? s.current.valueAsDate = new Date(
|
|
@@ -2338,53 +2338,53 @@ const Xs = ({
|
|
|
2338
2338
|
},
|
|
2339
2339
|
[e, s]
|
|
2340
2340
|
);
|
|
2341
|
-
},
|
|
2342
|
-
setDateInFocus:
|
|
2341
|
+
}, Un = (t, e, r, {
|
|
2342
|
+
setDateInFocus: n,
|
|
2343
2343
|
showCalendarInternal: s,
|
|
2344
2344
|
hideCalendarInternal: i,
|
|
2345
2345
|
setFirstFocusedInput: c,
|
|
2346
2346
|
setCurrentPanel: a
|
|
2347
2347
|
}) => {
|
|
2348
|
-
const l =
|
|
2348
|
+
const l = b(
|
|
2349
2349
|
(f) => {
|
|
2350
|
-
f.target.value[0] !== "0" && (
|
|
2350
|
+
f.target.value[0] !== "0" && (r == null || r({
|
|
2351
2351
|
startDate: f.target.valueAsDate ?? void 0,
|
|
2352
2352
|
endDate: e
|
|
2353
2353
|
}));
|
|
2354
2354
|
},
|
|
2355
|
-
[
|
|
2356
|
-
), d =
|
|
2355
|
+
[r, e]
|
|
2356
|
+
), d = b(
|
|
2357
2357
|
(f) => {
|
|
2358
|
-
f.target.value[0] !== "0" && (
|
|
2358
|
+
f.target.value[0] !== "0" && (r == null || r({
|
|
2359
2359
|
startDate: t,
|
|
2360
2360
|
endDate: f.target.valueAsDate ?? void 0
|
|
2361
2361
|
}));
|
|
2362
2362
|
},
|
|
2363
|
-
[
|
|
2364
|
-
), u =
|
|
2365
|
-
|
|
2363
|
+
[r, t]
|
|
2364
|
+
), u = b(() => {
|
|
2365
|
+
n(t || e || /* @__PURE__ */ new Date()), a("calendar"), s();
|
|
2366
2366
|
}, [
|
|
2367
2367
|
t,
|
|
2368
2368
|
e,
|
|
2369
2369
|
a,
|
|
2370
2370
|
s,
|
|
2371
|
-
|
|
2372
|
-
]), m =
|
|
2371
|
+
n
|
|
2372
|
+
]), m = b(() => {
|
|
2373
2373
|
c(void 0), i();
|
|
2374
2374
|
}, [c, i]);
|
|
2375
2375
|
return {
|
|
2376
2376
|
inputLeftChangeHandler: l,
|
|
2377
2377
|
inputRightChangeHandler: d,
|
|
2378
2378
|
hideCalendar: m,
|
|
2379
|
-
setDateInFocus:
|
|
2379
|
+
setDateInFocus: n,
|
|
2380
2380
|
setCurrentPanel: a,
|
|
2381
2381
|
showCalendar: u
|
|
2382
2382
|
};
|
|
2383
|
-
},
|
|
2384
|
-
const [
|
|
2383
|
+
}, Fn = (t, e) => {
|
|
2384
|
+
const [r, n, s] = ne(!1), [i, c] = I(void 0), [a, l] = I("startDate"), [d, u] = I(() => (a === "startDate" ? t : a === "endDate" ? e : void 0) ?? /* @__PURE__ */ new Date()), [m, f] = I("calendar");
|
|
2385
2385
|
return {
|
|
2386
|
-
isCalendarVisible:
|
|
2387
|
-
showCalendarInternal:
|
|
2386
|
+
isCalendarVisible: r,
|
|
2387
|
+
showCalendarInternal: n,
|
|
2388
2388
|
hideCalendarInternal: s,
|
|
2389
2389
|
firstFocusedInput: i,
|
|
2390
2390
|
setFirstFocusedInput: c,
|
|
@@ -2395,7 +2395,7 @@ const Xs = ({
|
|
|
2395
2395
|
currentPanel: m,
|
|
2396
2396
|
setCurrentPanel: f
|
|
2397
2397
|
};
|
|
2398
|
-
},
|
|
2398
|
+
}, Cn = (t, e, r, n, s, i, c, {
|
|
2399
2399
|
firstFocusedInput: a,
|
|
2400
2400
|
setFirstFocusedInput: l,
|
|
2401
2401
|
isCalendarVisible: d,
|
|
@@ -2403,7 +2403,7 @@ const Xs = ({
|
|
|
2403
2403
|
focusedInput: m,
|
|
2404
2404
|
setCurrentPanel: f
|
|
2405
2405
|
}) => {
|
|
2406
|
-
const h =
|
|
2406
|
+
const h = b(() => {
|
|
2407
2407
|
a == null && l("startDate"), u("startDate"), d || i();
|
|
2408
2408
|
}, [
|
|
2409
2409
|
d,
|
|
@@ -2411,7 +2411,7 @@ const Xs = ({
|
|
|
2411
2411
|
i,
|
|
2412
2412
|
l,
|
|
2413
2413
|
a
|
|
2414
|
-
]), g =
|
|
2414
|
+
]), g = b(() => {
|
|
2415
2415
|
a == null && l("endDate"), u("endDate"), d || i();
|
|
2416
2416
|
}, [
|
|
2417
2417
|
d,
|
|
@@ -2419,53 +2419,53 @@ const Xs = ({
|
|
|
2419
2419
|
i,
|
|
2420
2420
|
l,
|
|
2421
2421
|
a
|
|
2422
|
-
]), w =
|
|
2423
|
-
(
|
|
2424
|
-
var
|
|
2425
|
-
m === "startDate" ? e != null &&
|
|
2426
|
-
startDate:
|
|
2422
|
+
]), w = b(
|
|
2423
|
+
(D) => {
|
|
2424
|
+
var M, T, Y, N;
|
|
2425
|
+
m === "startDate" ? e != null && K(D.date, e) ? (r == null || r({
|
|
2426
|
+
startDate: D.date,
|
|
2427
2427
|
endDate: void 0
|
|
2428
|
-
}), u("endDate"), (
|
|
2429
|
-
startDate:
|
|
2428
|
+
}), u("endDate"), (M = s.current) == null || M.focus()) : (r == null || r({
|
|
2429
|
+
startDate: D.date,
|
|
2430
2430
|
endDate: e
|
|
2431
|
-
}), a === "startDate" ? (u("endDate"), (T = s.current) == null || T.focus()) : setTimeout(c, 50)) : m === "endDate" && (t ?
|
|
2432
|
-
startDate:
|
|
2431
|
+
}), a === "startDate" ? (u("endDate"), (T = s.current) == null || T.focus()) : setTimeout(c, 50)) : m === "endDate" && (t ? K(t, D.date) ? (r == null || r({
|
|
2432
|
+
startDate: D.date,
|
|
2433
2433
|
endDate: void 0
|
|
2434
|
-
}), u("endDate"), (N = s.current) == null || N.focus()) : (
|
|
2434
|
+
}), u("endDate"), (N = s.current) == null || N.focus()) : (r == null || r({
|
|
2435
2435
|
startDate: t,
|
|
2436
|
-
endDate:
|
|
2437
|
-
}), setTimeout(c, 50)) : (
|
|
2436
|
+
endDate: D.date
|
|
2437
|
+
}), setTimeout(c, 50)) : (r == null || r({
|
|
2438
2438
|
startDate: t,
|
|
2439
|
-
endDate:
|
|
2440
|
-
}), u("startDate"), (
|
|
2439
|
+
endDate: D.date
|
|
2440
|
+
}), u("startDate"), (Y = n.current) == null || Y.focus()));
|
|
2441
2441
|
},
|
|
2442
2442
|
[
|
|
2443
2443
|
m,
|
|
2444
|
-
|
|
2444
|
+
r,
|
|
2445
2445
|
e,
|
|
2446
2446
|
a,
|
|
2447
2447
|
u,
|
|
2448
2448
|
s,
|
|
2449
2449
|
c,
|
|
2450
2450
|
t,
|
|
2451
|
-
|
|
2451
|
+
n
|
|
2452
2452
|
]
|
|
2453
|
-
),
|
|
2453
|
+
), k = b(() => {
|
|
2454
2454
|
f("presets"), i();
|
|
2455
|
-
}, [f, i]),
|
|
2456
|
-
var
|
|
2457
|
-
d ? c() : (u("startDate"), l("startDate"), (
|
|
2455
|
+
}, [f, i]), p = b(() => {
|
|
2456
|
+
var D;
|
|
2457
|
+
d ? c() : (u("startDate"), l("startDate"), (D = n.current) == null || D.focus(), f("calendar"), i());
|
|
2458
2458
|
}, [
|
|
2459
2459
|
d,
|
|
2460
2460
|
c,
|
|
2461
2461
|
u,
|
|
2462
2462
|
l,
|
|
2463
|
-
|
|
2463
|
+
n,
|
|
2464
2464
|
f,
|
|
2465
2465
|
i
|
|
2466
|
-
]),
|
|
2467
|
-
(
|
|
2468
|
-
|
|
2466
|
+
]), y = b(
|
|
2467
|
+
(D) => {
|
|
2468
|
+
D.key === "Escape" && c();
|
|
2469
2469
|
},
|
|
2470
2470
|
[c]
|
|
2471
2471
|
);
|
|
@@ -2473,16 +2473,16 @@ const Xs = ({
|
|
|
2473
2473
|
onFocusLeft: h,
|
|
2474
2474
|
onFocusRight: g,
|
|
2475
2475
|
onClickDay: w,
|
|
2476
|
-
onClickArrowButton:
|
|
2477
|
-
onClickCalendarButton:
|
|
2478
|
-
onKeyDownHandler:
|
|
2476
|
+
onClickArrowButton: k,
|
|
2477
|
+
onClickCalendarButton: p,
|
|
2478
|
+
onKeyDownHandler: y
|
|
2479
2479
|
};
|
|
2480
2480
|
};
|
|
2481
2481
|
function ei({
|
|
2482
2482
|
value: t,
|
|
2483
2483
|
onValueChange: e,
|
|
2484
|
-
autoFocus:
|
|
2485
|
-
onBlur:
|
|
2484
|
+
autoFocus: r,
|
|
2485
|
+
onBlur: n,
|
|
2486
2486
|
onEnter: s,
|
|
2487
2487
|
onEsc: i,
|
|
2488
2488
|
minDate: c,
|
|
@@ -2493,100 +2493,100 @@ function ei({
|
|
|
2493
2493
|
variant: m,
|
|
2494
2494
|
disabled: f
|
|
2495
2495
|
}) {
|
|
2496
|
-
const { startDate: h, endDate: g } = t || {}, w =
|
|
2497
|
-
dateInFocus:
|
|
2498
|
-
setDateInFocus:
|
|
2499
|
-
isCalendarVisible:
|
|
2496
|
+
const { startDate: h, endDate: g } = t || {}, w = O(null), k = O(null), p = Fn(h, g), {
|
|
2497
|
+
dateInFocus: y,
|
|
2498
|
+
setDateInFocus: D,
|
|
2499
|
+
isCalendarVisible: M,
|
|
2500
2500
|
currentPanel: T,
|
|
2501
|
-
setCurrentPanel:
|
|
2502
|
-
} =
|
|
2501
|
+
setCurrentPanel: Y
|
|
2502
|
+
} = p, {
|
|
2503
2503
|
showCalendar: N,
|
|
2504
|
-
hideCalendar:
|
|
2505
|
-
inputLeftChangeHandler:
|
|
2504
|
+
hideCalendar: x,
|
|
2505
|
+
inputLeftChangeHandler: L,
|
|
2506
2506
|
inputRightChangeHandler: S
|
|
2507
|
-
} =
|
|
2508
|
-
onKeyDownHandler:
|
|
2507
|
+
} = Un(h, g, e, p), {
|
|
2508
|
+
onKeyDownHandler: W,
|
|
2509
2509
|
onFocusRight: $,
|
|
2510
|
-
onFocusLeft:
|
|
2510
|
+
onFocusLeft: j,
|
|
2511
2511
|
onClickDay: F,
|
|
2512
|
-
onClickCalendarButton:
|
|
2513
|
-
onClickArrowButton:
|
|
2514
|
-
} =
|
|
2512
|
+
onClickCalendarButton: V,
|
|
2513
|
+
onClickArrowButton: U
|
|
2514
|
+
} = Cn(
|
|
2515
2515
|
h,
|
|
2516
2516
|
g,
|
|
2517
2517
|
e,
|
|
2518
2518
|
w,
|
|
2519
|
-
|
|
2519
|
+
k,
|
|
2520
2520
|
N,
|
|
2521
|
-
|
|
2522
|
-
|
|
2521
|
+
x,
|
|
2522
|
+
p
|
|
2523
2523
|
);
|
|
2524
|
-
|
|
2524
|
+
jn(
|
|
2525
2525
|
h,
|
|
2526
2526
|
g,
|
|
2527
|
-
|
|
2527
|
+
D,
|
|
2528
2528
|
w,
|
|
2529
|
-
|
|
2529
|
+
k
|
|
2530
2530
|
);
|
|
2531
|
-
const
|
|
2532
|
-
() => h && g &&
|
|
2531
|
+
const rt = R(
|
|
2532
|
+
() => h && g && K(h, g),
|
|
2533
2533
|
[h, g]
|
|
2534
|
-
),
|
|
2535
|
-
() =>
|
|
2534
|
+
), q = R(
|
|
2535
|
+
() => Lr(
|
|
2536
2536
|
l == null ? void 0 : l.statePerMonth,
|
|
2537
2537
|
h,
|
|
2538
2538
|
g,
|
|
2539
|
-
|
|
2539
|
+
y
|
|
2540
2540
|
),
|
|
2541
|
-
[l == null ? void 0 : l.statePerMonth, h, g,
|
|
2542
|
-
),
|
|
2543
|
-
return /* @__PURE__ */ o(A, { onKeyDown:
|
|
2541
|
+
[l == null ? void 0 : l.statePerMonth, h, g, y]
|
|
2542
|
+
), G = se(M, 300);
|
|
2543
|
+
return /* @__PURE__ */ o(A, { onKeyDown: W, children: /* @__PURE__ */ o(
|
|
2544
2544
|
Lt,
|
|
2545
2545
|
{
|
|
2546
2546
|
arrow: !1,
|
|
2547
2547
|
lazy: !0,
|
|
2548
2548
|
disabled: f,
|
|
2549
2549
|
placement: Yt,
|
|
2550
|
-
onClickOutside:
|
|
2551
|
-
visible:
|
|
2552
|
-
content:
|
|
2550
|
+
onClickOutside: x,
|
|
2551
|
+
visible: M,
|
|
2552
|
+
content: G && /* @__PURE__ */ o(
|
|
2553
2553
|
wt,
|
|
2554
2554
|
{
|
|
2555
2555
|
onClickDay: F,
|
|
2556
|
-
dateInFocus:
|
|
2557
|
-
setDateInFocus:
|
|
2556
|
+
dateInFocus: y,
|
|
2557
|
+
setDateInFocus: D,
|
|
2558
2558
|
currentPanel: T,
|
|
2559
|
-
setCurrentPanel:
|
|
2559
|
+
setCurrentPanel: Y,
|
|
2560
2560
|
minDate: c,
|
|
2561
2561
|
maxDate: a,
|
|
2562
2562
|
...l,
|
|
2563
|
-
statePerMonth:
|
|
2563
|
+
statePerMonth: q
|
|
2564
2564
|
}
|
|
2565
2565
|
),
|
|
2566
2566
|
children: /* @__PURE__ */ o(
|
|
2567
2567
|
Fe,
|
|
2568
2568
|
{
|
|
2569
|
-
autoFocusLeft:
|
|
2569
|
+
autoFocusLeft: r,
|
|
2570
2570
|
onEsc: i,
|
|
2571
2571
|
onEnter: s,
|
|
2572
|
-
onBlur:
|
|
2572
|
+
onBlur: n,
|
|
2573
2573
|
disabled: f,
|
|
2574
2574
|
separatorIcon: Nt,
|
|
2575
2575
|
typeLeft: "date",
|
|
2576
2576
|
typeRight: "date",
|
|
2577
2577
|
placeholderLeft: "Start date",
|
|
2578
2578
|
placeholderRight: "End date",
|
|
2579
|
-
onChangeLeft:
|
|
2579
|
+
onChangeLeft: L,
|
|
2580
2580
|
onChangeRight: S,
|
|
2581
|
-
onClickArrowDown:
|
|
2582
|
-
onClickCalendar:
|
|
2583
|
-
onFocusLeft:
|
|
2581
|
+
onClickArrowDown: U,
|
|
2582
|
+
onClickCalendar: V,
|
|
2583
|
+
onFocusLeft: j,
|
|
2584
2584
|
onFocusRight: $,
|
|
2585
|
-
onClickLeft:
|
|
2585
|
+
onClickLeft: j,
|
|
2586
2586
|
onClickRight: $,
|
|
2587
2587
|
inputRefLeft: w,
|
|
2588
|
-
inputRefRight:
|
|
2589
|
-
variant:
|
|
2588
|
+
inputRefRight: k,
|
|
2589
|
+
variant: rt ? "error" : m,
|
|
2590
2590
|
widthLeft: d,
|
|
2591
2591
|
widthRight: u,
|
|
2592
2592
|
minLeft: c,
|
|
@@ -2601,8 +2601,8 @@ function ei({
|
|
|
2601
2601
|
const ce = ({
|
|
2602
2602
|
onChange: t,
|
|
2603
2603
|
onValueChange: e,
|
|
2604
|
-
mask:
|
|
2605
|
-
pipe:
|
|
2604
|
+
mask: r,
|
|
2605
|
+
pipe: n,
|
|
2606
2606
|
value: s,
|
|
2607
2607
|
guide: i,
|
|
2608
2608
|
keepCharPositions: c,
|
|
@@ -2611,12 +2611,12 @@ const ce = ({
|
|
|
2611
2611
|
calendarSize: d,
|
|
2612
2612
|
...u
|
|
2613
2613
|
}) => {
|
|
2614
|
-
const m =
|
|
2614
|
+
const m = O(null), { onChange: f } = Ar(
|
|
2615
2615
|
m,
|
|
2616
2616
|
t,
|
|
2617
2617
|
e,
|
|
2618
|
-
n,
|
|
2619
2618
|
r,
|
|
2619
|
+
n,
|
|
2620
2620
|
s,
|
|
2621
2621
|
i,
|
|
2622
2622
|
c,
|
|
@@ -2624,16 +2624,16 @@ const ce = ({
|
|
|
2624
2624
|
l
|
|
2625
2625
|
);
|
|
2626
2626
|
return /* @__PURE__ */ o(
|
|
2627
|
-
|
|
2627
|
+
_r,
|
|
2628
2628
|
{
|
|
2629
2629
|
...u,
|
|
2630
2630
|
ref: m,
|
|
2631
2631
|
onChange: f,
|
|
2632
|
-
width:
|
|
2632
|
+
width: zn(d),
|
|
2633
2633
|
size: d === "large" ? "large" : "medium"
|
|
2634
2634
|
}
|
|
2635
2635
|
);
|
|
2636
|
-
},
|
|
2636
|
+
}, zn = (t) => {
|
|
2637
2637
|
switch (t) {
|
|
2638
2638
|
case "small":
|
|
2639
2639
|
return "140px";
|
|
@@ -2644,84 +2644,84 @@ const ce = ({
|
|
|
2644
2644
|
default:
|
|
2645
2645
|
return le(t, "168px");
|
|
2646
2646
|
}
|
|
2647
|
-
},
|
|
2647
|
+
}, Kn = [/[1-2]/, /\d/, /\d/, /\d/], Jn = [/[0-1]/, /\d/], qn = [/[0-3]/, /\d/], ze = (t) => Qn(t).flatMap(Gn), Gn = (t) => {
|
|
2648
2648
|
switch (t) {
|
|
2649
2649
|
case "yyyy":
|
|
2650
|
-
return
|
|
2650
|
+
return Kn;
|
|
2651
2651
|
case "mm":
|
|
2652
2652
|
case "MM":
|
|
2653
|
-
return
|
|
2653
|
+
return Jn;
|
|
2654
2654
|
case "dd":
|
|
2655
2655
|
case "DD":
|
|
2656
|
-
return
|
|
2656
|
+
return qn;
|
|
2657
2657
|
default:
|
|
2658
2658
|
return [t];
|
|
2659
2659
|
}
|
|
2660
|
-
},
|
|
2660
|
+
}, Qn = (t) => {
|
|
2661
2661
|
if (t.length === 0)
|
|
2662
2662
|
return [];
|
|
2663
2663
|
const e = [];
|
|
2664
|
-
let
|
|
2665
|
-
for (let
|
|
2666
|
-
t[
|
|
2667
|
-
return e.push(
|
|
2664
|
+
let r = t[0];
|
|
2665
|
+
for (let n = 1; n < t.length; n++)
|
|
2666
|
+
t[n] !== t[n - 1] ? (e.push(r), r = t[n]) : r += t[n];
|
|
2667
|
+
return e.push(r), e;
|
|
2668
2668
|
}, kt = (t) => {
|
|
2669
|
-
const
|
|
2669
|
+
const r = new Intl.DateTimeFormat(t, { dateStyle: "short" }).formatToParts(/* @__PURE__ */ new Date()), n = {
|
|
2670
2670
|
year: "yyyy",
|
|
2671
2671
|
month: "MM",
|
|
2672
2672
|
day: "dd"
|
|
2673
2673
|
};
|
|
2674
|
-
return
|
|
2674
|
+
return r.map((s) => n[s.type] || s.value).join("");
|
|
2675
2675
|
}, Ke = {
|
|
2676
|
-
"en-US":
|
|
2676
|
+
"en-US": pr,
|
|
2677
2677
|
"en-GB": zt,
|
|
2678
|
-
"de-AT":
|
|
2678
|
+
"de-AT": Dr,
|
|
2679
2679
|
"de-DE": we,
|
|
2680
|
-
fr:
|
|
2680
|
+
fr: br,
|
|
2681
2681
|
de: we,
|
|
2682
|
-
es:
|
|
2683
|
-
sv:
|
|
2684
|
-
pl:
|
|
2685
|
-
da:
|
|
2686
|
-
nl:
|
|
2687
|
-
nb:
|
|
2688
|
-
}, Gt = (t) => Ke[t], Je = () => Ke.sv, ht = (t, e,
|
|
2689
|
-
const
|
|
2690
|
-
if (
|
|
2682
|
+
es: wr,
|
|
2683
|
+
sv: yr,
|
|
2684
|
+
pl: Mr,
|
|
2685
|
+
da: kr,
|
|
2686
|
+
nl: Sr,
|
|
2687
|
+
nb: Tr
|
|
2688
|
+
}, Gt = (t) => Ke[t], Je = () => Ke.sv, ht = (t, e, r) => {
|
|
2689
|
+
const n = Gt(e);
|
|
2690
|
+
if (n == null)
|
|
2691
2691
|
return;
|
|
2692
2692
|
const s = mt(
|
|
2693
2693
|
t,
|
|
2694
2694
|
kt(e),
|
|
2695
|
-
|
|
2695
|
+
r ?? /* @__PURE__ */ new Date(),
|
|
2696
2696
|
{
|
|
2697
|
-
locale:
|
|
2697
|
+
locale: n
|
|
2698
2698
|
}
|
|
2699
2699
|
);
|
|
2700
2700
|
if (!isNaN(s.getTime()))
|
|
2701
2701
|
return s;
|
|
2702
|
-
}, St = (t, e) =>
|
|
2702
|
+
}, St = (t, e) => v(t, kt(e), {
|
|
2703
2703
|
locale: Gt(e)
|
|
2704
2704
|
}), ae = (t, e) => {
|
|
2705
|
-
const
|
|
2706
|
-
if (
|
|
2707
|
-
return St(
|
|
2705
|
+
const r = ht(t, e);
|
|
2706
|
+
if (r != null)
|
|
2707
|
+
return St(r, e);
|
|
2708
2708
|
}, qe = ({
|
|
2709
2709
|
value: t,
|
|
2710
2710
|
onValueChange: e,
|
|
2711
|
-
localeCode:
|
|
2712
|
-
startDateLabel:
|
|
2711
|
+
localeCode: r,
|
|
2712
|
+
startDateLabel: n = "From",
|
|
2713
2713
|
endDateLabel: s = "To",
|
|
2714
2714
|
onFocus: i,
|
|
2715
2715
|
calendarSize: c
|
|
2716
2716
|
}) => {
|
|
2717
|
-
const { mask: a, placeholder: l } =
|
|
2718
|
-
const d = kt(
|
|
2717
|
+
const { mask: a, placeholder: l } = R(() => {
|
|
2718
|
+
const d = kt(r);
|
|
2719
2719
|
return {
|
|
2720
2720
|
mask: ze(d),
|
|
2721
2721
|
placeholder: d.toLowerCase()
|
|
2722
2722
|
};
|
|
2723
|
-
}, [
|
|
2724
|
-
return /* @__PURE__ */
|
|
2723
|
+
}, [r]);
|
|
2724
|
+
return /* @__PURE__ */ _(H, { children: [
|
|
2725
2725
|
/* @__PURE__ */ o(
|
|
2726
2726
|
ce,
|
|
2727
2727
|
{
|
|
@@ -2733,12 +2733,12 @@ const ce = ({
|
|
|
2733
2733
|
onBlur: (d) => {
|
|
2734
2734
|
const u = ae(
|
|
2735
2735
|
d.target.value,
|
|
2736
|
-
|
|
2736
|
+
r
|
|
2737
2737
|
);
|
|
2738
2738
|
u && u !== (t == null ? void 0 : t.startDate) && (e == null || e({ startDate: u }));
|
|
2739
2739
|
},
|
|
2740
2740
|
onFocus: i,
|
|
2741
|
-
label:
|
|
2741
|
+
label: n,
|
|
2742
2742
|
borderRadiusVariant: "onlyLeft",
|
|
2743
2743
|
placeholder: l,
|
|
2744
2744
|
calendarSize: c
|
|
@@ -2753,7 +2753,7 @@ const ce = ({
|
|
|
2753
2753
|
onBlur: (d) => {
|
|
2754
2754
|
const u = ae(
|
|
2755
2755
|
d.target.value,
|
|
2756
|
-
|
|
2756
|
+
r
|
|
2757
2757
|
);
|
|
2758
2758
|
u && u !== (t == null ? void 0 : t.endDate) && (e == null || e({ endDate: u }));
|
|
2759
2759
|
},
|
|
@@ -2765,89 +2765,89 @@ const ce = ({
|
|
|
2765
2765
|
}
|
|
2766
2766
|
)
|
|
2767
2767
|
] });
|
|
2768
|
-
}, Ge = (t, e,
|
|
2769
|
-
const s = Gt(
|
|
2770
|
-
() => kt(
|
|
2771
|
-
[
|
|
2772
|
-
), d =
|
|
2768
|
+
}, Ge = (t, e, r, n) => {
|
|
2769
|
+
const s = Gt(r) ?? Je(), i = ge(), c = De(), a = O(null), l = R(
|
|
2770
|
+
() => kt(r),
|
|
2771
|
+
[r]
|
|
2772
|
+
), d = R(
|
|
2773
2773
|
() => {
|
|
2774
2774
|
var S;
|
|
2775
|
-
return ((S = t == null ? void 0 : t.startDate) == null ? void 0 : S.length) === l.length ? ht(t.startDate,
|
|
2775
|
+
return ((S = t == null ? void 0 : t.startDate) == null ? void 0 : S.length) === l.length ? ht(t.startDate, r) : void 0;
|
|
2776
2776
|
},
|
|
2777
|
-
[l.length,
|
|
2778
|
-
), u =
|
|
2777
|
+
[l.length, r, t == null ? void 0 : t.startDate]
|
|
2778
|
+
), u = R(
|
|
2779
2779
|
() => {
|
|
2780
2780
|
var S;
|
|
2781
|
-
return ((S = t == null ? void 0 : t.endDate) == null ? void 0 : S.length) === l.length ? ht(t.endDate,
|
|
2781
|
+
return ((S = t == null ? void 0 : t.endDate) == null ? void 0 : S.length) === l.length ? ht(t.endDate, r) : void 0;
|
|
2782
2782
|
},
|
|
2783
|
-
[l.length,
|
|
2783
|
+
[l.length, r, t == null ? void 0 : t.endDate]
|
|
2784
2784
|
), [m, f] = I(
|
|
2785
|
-
|
|
2786
|
-
), h =
|
|
2785
|
+
n ?? d ?? /* @__PURE__ */ new Date()
|
|
2786
|
+
), h = b(
|
|
2787
2787
|
(S) => {
|
|
2788
|
-
|
|
2788
|
+
it(S, c) || K(S, c) ? f(S) : f(c);
|
|
2789
2789
|
},
|
|
2790
2790
|
[c]
|
|
2791
|
-
), g =
|
|
2791
|
+
), g = R(
|
|
2792
2792
|
() => Jt(
|
|
2793
2793
|
m.getFullYear(),
|
|
2794
2794
|
m.getMonth(),
|
|
2795
2795
|
s
|
|
2796
2796
|
),
|
|
2797
2797
|
[s, m]
|
|
2798
|
-
), w =
|
|
2798
|
+
), w = R(() => xt(v(m, "MMMM yyyy", { locale: s })), [s, m]), k = R(() => it(c, m), [c, m]), [p, y] = I(), [D, M] = I("calendar"), T = b(
|
|
2799
2799
|
(S) => {
|
|
2800
|
-
var
|
|
2801
|
-
const
|
|
2802
|
-
|
|
2800
|
+
var j, F;
|
|
2801
|
+
const W = ((j = S == null ? void 0 : S.startDate) == null ? void 0 : j.length) === l.length ? ht(S.startDate, r) : void 0, $ = ((F = S == null ? void 0 : S.endDate) == null ? void 0 : F.length) === l.length ? ht(S.endDate, r) : void 0;
|
|
2802
|
+
W ? h(W) : $ && h($), e == null || e({
|
|
2803
2803
|
...t,
|
|
2804
2804
|
...S
|
|
2805
2805
|
});
|
|
2806
2806
|
},
|
|
2807
2807
|
[
|
|
2808
2808
|
l.length,
|
|
2809
|
-
|
|
2809
|
+
r,
|
|
2810
2810
|
e,
|
|
2811
2811
|
h,
|
|
2812
2812
|
t
|
|
2813
2813
|
]
|
|
2814
|
-
),
|
|
2815
|
-
() =>
|
|
2814
|
+
), Y = R(
|
|
2815
|
+
() => it(c, m) || st(m, c),
|
|
2816
2816
|
[c, m]
|
|
2817
|
-
), N =
|
|
2818
|
-
() => (d && u && (P(d, u) ||
|
|
2817
|
+
), N = R(
|
|
2818
|
+
() => (d && u && (P(d, u) || st(d, u))) ?? !1,
|
|
2819
2819
|
[u, d]
|
|
2820
2820
|
);
|
|
2821
2821
|
return {
|
|
2822
|
-
isDateDisabled:
|
|
2823
|
-
(S) => !P(S, c) &&
|
|
2822
|
+
isDateDisabled: b(
|
|
2823
|
+
(S) => !P(S, c) && st(S, c),
|
|
2824
2824
|
[c]
|
|
2825
2825
|
),
|
|
2826
2826
|
onClickDate: (S) => {
|
|
2827
|
-
S.getFullYear() === m.getFullYear() && S.getMonth() === m.getMonth() && (d && u == null ?
|
|
2828
|
-
startDate: St(S,
|
|
2827
|
+
S.getFullYear() === m.getFullYear() && S.getMonth() === m.getMonth() && (d && u == null ? st(S, d) ? e == null || e({
|
|
2828
|
+
startDate: St(S, r),
|
|
2829
2829
|
endDate: void 0
|
|
2830
2830
|
}) : e == null || e({
|
|
2831
2831
|
startDate: t == null ? void 0 : t.startDate,
|
|
2832
|
-
endDate: St(S,
|
|
2832
|
+
endDate: St(S, r)
|
|
2833
2833
|
}) : e == null || e({
|
|
2834
|
-
startDate: St(S,
|
|
2834
|
+
startDate: St(S, r),
|
|
2835
2835
|
endDate: void 0
|
|
2836
2836
|
}));
|
|
2837
2837
|
},
|
|
2838
2838
|
onValueChangeByInputs: T,
|
|
2839
2839
|
isValidDateRange: N,
|
|
2840
|
-
prevMonthDisabled:
|
|
2840
|
+
prevMonthDisabled: Y,
|
|
2841
2841
|
monthPickerButtonRef: a,
|
|
2842
2842
|
calendarId: i,
|
|
2843
2843
|
monthPickerButtonLabel: w,
|
|
2844
|
-
visiblePanel:
|
|
2845
|
-
setVisiblePanel:
|
|
2844
|
+
visiblePanel: D,
|
|
2845
|
+
setVisiblePanel: M,
|
|
2846
2846
|
setVisibleMonth: f,
|
|
2847
2847
|
visibleMonthData: g,
|
|
2848
|
-
todayIsInVisibleMonth:
|
|
2849
|
-
hoverDate:
|
|
2850
|
-
setHoverDate:
|
|
2848
|
+
todayIsInVisibleMonth: k,
|
|
2849
|
+
hoverDate: p,
|
|
2850
|
+
setHoverDate: y,
|
|
2851
2851
|
selectedStartDate: d,
|
|
2852
2852
|
selectedEndDate: u,
|
|
2853
2853
|
today: c,
|
|
@@ -2856,31 +2856,31 @@ const ce = ({
|
|
|
2856
2856
|
}, Qt = ({
|
|
2857
2857
|
previousMonthButtonAriaLabel: t,
|
|
2858
2858
|
nextMonthButtonAriaLabel: e,
|
|
2859
|
-
monthPickerButtonLabel:
|
|
2860
|
-
visiblePanel:
|
|
2859
|
+
monthPickerButtonLabel: r,
|
|
2860
|
+
visiblePanel: n,
|
|
2861
2861
|
setVisiblePanel: s,
|
|
2862
2862
|
monthPickerButtonRef: i,
|
|
2863
2863
|
setVisibleMonth: c,
|
|
2864
2864
|
visibleMonth: a,
|
|
2865
2865
|
prevMonthDisabled: l,
|
|
2866
2866
|
calendarSize: d
|
|
2867
|
-
}) => /* @__PURE__ */
|
|
2867
|
+
}) => /* @__PURE__ */ _(H, { alignSelf: "center", justifyContent: "space-between", width: "100%", children: [
|
|
2868
2868
|
/* @__PURE__ */ o(
|
|
2869
|
-
|
|
2869
|
+
J,
|
|
2870
2870
|
{
|
|
2871
2871
|
"aria-live": "polite",
|
|
2872
|
-
label:
|
|
2873
|
-
rightIcon:
|
|
2872
|
+
label: r,
|
|
2873
|
+
rightIcon: n === "calendar" ? de : cr,
|
|
2874
2874
|
onClick: () => s(
|
|
2875
|
-
|
|
2875
|
+
n === "calendar" ? "month-picker" : "calendar"
|
|
2876
2876
|
),
|
|
2877
2877
|
ref: i,
|
|
2878
2878
|
size: d === "large" ? "large" : "medium"
|
|
2879
2879
|
}
|
|
2880
2880
|
),
|
|
2881
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ _(H, { alignItems: "center", gap: 2, children: [
|
|
2882
2882
|
/* @__PURE__ */ o(
|
|
2883
|
-
|
|
2883
|
+
lt,
|
|
2884
2884
|
{
|
|
2885
2885
|
leftIcon: Ft,
|
|
2886
2886
|
onClick: () => c(fe(a, 1)),
|
|
@@ -2890,7 +2890,7 @@ const ce = ({
|
|
|
2890
2890
|
}
|
|
2891
2891
|
),
|
|
2892
2892
|
/* @__PURE__ */ o(
|
|
2893
|
-
|
|
2893
|
+
lt,
|
|
2894
2894
|
{
|
|
2895
2895
|
leftIcon: Nt,
|
|
2896
2896
|
onClick: () => c(At(a, 1)),
|
|
@@ -2899,68 +2899,68 @@ const ce = ({
|
|
|
2899
2899
|
}
|
|
2900
2900
|
)
|
|
2901
2901
|
] })
|
|
2902
|
-
] }),
|
|
2903
|
-
travelDateCell:
|
|
2904
|
-
small:
|
|
2905
|
-
medium:
|
|
2902
|
+
] }), Xn = "_travelDateCell_1njsn_1", Zn = "_small_1njsn_4", Vn = "_medium_1njsn_9", ts = "_large_1njsn_14", es = "_outline_1njsn_26", rs = "_contentWrapper_1njsn_39", ns = "_disabled_1njsn_60", ss = "_isToday_1njsn_63", is = "_isSelectionStart_1njsn_67", os = "_isSelectionEnd_1njsn_68", cs = "_hover_1njsn_83", as = "_startSelected_1njsn_86", ls = "_endSelected_1njsn_86", X = {
|
|
2903
|
+
travelDateCell: Xn,
|
|
2904
|
+
small: Zn,
|
|
2905
|
+
medium: Vn,
|
|
2906
2906
|
large: ts,
|
|
2907
2907
|
outline: es,
|
|
2908
|
-
contentWrapper:
|
|
2909
|
-
disabled:
|
|
2908
|
+
contentWrapper: rs,
|
|
2909
|
+
disabled: ns,
|
|
2910
2910
|
isToday: ss,
|
|
2911
2911
|
isSelectionStart: is,
|
|
2912
2912
|
isSelectionEnd: os,
|
|
2913
2913
|
hover: cs,
|
|
2914
2914
|
startSelected: as,
|
|
2915
2915
|
endSelected: ls
|
|
2916
|
-
},
|
|
2916
|
+
}, ct = Kt("--lhds-color-red-100"), ds = (t, e, r, n, s, i) => {
|
|
2917
2917
|
if (!s)
|
|
2918
2918
|
return {
|
|
2919
2919
|
left: "transparent",
|
|
2920
2920
|
right: "transparent"
|
|
2921
2921
|
};
|
|
2922
|
-
if (e &&
|
|
2922
|
+
if (e && r && P(e, r))
|
|
2923
2923
|
return {
|
|
2924
2924
|
left: "transparent",
|
|
2925
2925
|
right: "transparent"
|
|
2926
2926
|
};
|
|
2927
|
-
if (e &&
|
|
2927
|
+
if (e && r && !i)
|
|
2928
2928
|
return {
|
|
2929
2929
|
left: "transparent",
|
|
2930
2930
|
right: "transparent"
|
|
2931
2931
|
};
|
|
2932
|
-
const c = e &&
|
|
2932
|
+
const c = e && r ? K(t, e) && st(t, r) && !P(t, e) && !P(t, r) : !1, a = e && n ? K(t, e) && st(t, n) && !P(t, e) && !P(t, n) : !1;
|
|
2933
2933
|
if (c)
|
|
2934
2934
|
return {
|
|
2935
|
-
left:
|
|
2936
|
-
right:
|
|
2935
|
+
left: ct,
|
|
2936
|
+
right: ct
|
|
2937
2937
|
};
|
|
2938
|
-
if (e &&
|
|
2938
|
+
if (e && r)
|
|
2939
2939
|
return P(t, e) ? {
|
|
2940
2940
|
left: "transparent",
|
|
2941
|
-
right:
|
|
2942
|
-
} : P(t,
|
|
2943
|
-
left:
|
|
2941
|
+
right: ct
|
|
2942
|
+
} : P(t, r) ? {
|
|
2943
|
+
left: ct,
|
|
2944
2944
|
right: "transparent"
|
|
2945
2945
|
} : {
|
|
2946
2946
|
left: "transparent",
|
|
2947
2947
|
right: "transparent"
|
|
2948
2948
|
};
|
|
2949
|
-
if (e &&
|
|
2949
|
+
if (e && n && K(n, e)) {
|
|
2950
2950
|
if (P(t, e))
|
|
2951
2951
|
return {
|
|
2952
2952
|
left: "transparent",
|
|
2953
|
-
right:
|
|
2953
|
+
right: ct
|
|
2954
2954
|
};
|
|
2955
|
-
if (P(t,
|
|
2955
|
+
if (P(t, n))
|
|
2956
2956
|
return {
|
|
2957
|
-
left:
|
|
2957
|
+
left: ct,
|
|
2958
2958
|
right: "transparent"
|
|
2959
2959
|
};
|
|
2960
2960
|
}
|
|
2961
2961
|
return a ? {
|
|
2962
|
-
left:
|
|
2963
|
-
right:
|
|
2962
|
+
left: ct,
|
|
2963
|
+
right: ct
|
|
2964
2964
|
} : {
|
|
2965
2965
|
left: "transparent",
|
|
2966
2966
|
right: "transparent"
|
|
@@ -2972,45 +2972,45 @@ const ce = ({
|
|
|
2972
2972
|
case "PageDown":
|
|
2973
2973
|
return At(t, 1);
|
|
2974
2974
|
case "Home":
|
|
2975
|
-
return
|
|
2975
|
+
return Wt(t);
|
|
2976
2976
|
case "End":
|
|
2977
|
-
return
|
|
2977
|
+
return z(Wt(t), 6);
|
|
2978
2978
|
case "ArrowLeft":
|
|
2979
2979
|
return ut(t, 1);
|
|
2980
2980
|
case "ArrowUp":
|
|
2981
2981
|
return ut(t, 7);
|
|
2982
2982
|
case "ArrowRight":
|
|
2983
|
-
return
|
|
2983
|
+
return z(t, 1);
|
|
2984
2984
|
case "ArrowDown":
|
|
2985
|
-
return
|
|
2985
|
+
return z(t, 7);
|
|
2986
2986
|
default:
|
|
2987
2987
|
return;
|
|
2988
2988
|
}
|
|
2989
|
-
}, te = (t, e) =>
|
|
2989
|
+
}, te = (t, e) => v(Pe(t, 12), ot.fullDate) + e, fs = "_travelDateCellBackground_1xm0q_1", hs = "_small_1xm0q_2", ms = "_medium_1xm0q_7", gs = "_large_1xm0q_12", $t = {
|
|
2990
2990
|
travelDateCellBackground: fs,
|
|
2991
2991
|
small: hs,
|
|
2992
2992
|
medium: ms,
|
|
2993
2993
|
large: gs
|
|
2994
|
-
}, ps = ({ calendarSize: t, bgColorLeft: e, bgColorRight:
|
|
2994
|
+
}, ps = ({ calendarSize: t, bgColorLeft: e, bgColorRight: r }) => /* @__PURE__ */ _(H, { children: [
|
|
2995
2995
|
/* @__PURE__ */ o(
|
|
2996
2996
|
A,
|
|
2997
2997
|
{
|
|
2998
|
-
className: gt(
|
|
2998
|
+
className: gt($t.travelDateCellBackground, $t[t]),
|
|
2999
2999
|
background: e
|
|
3000
3000
|
}
|
|
3001
3001
|
),
|
|
3002
3002
|
/* @__PURE__ */ o(
|
|
3003
3003
|
A,
|
|
3004
3004
|
{
|
|
3005
|
-
className: gt(
|
|
3006
|
-
background:
|
|
3005
|
+
className: gt($t.travelDateCellBackground, $t[t]),
|
|
3006
|
+
background: r
|
|
3007
3007
|
}
|
|
3008
3008
|
)
|
|
3009
3009
|
] }), Ds = ({
|
|
3010
3010
|
onClick: t,
|
|
3011
3011
|
visibleMonth: e,
|
|
3012
|
-
onChangeVisibleMonth:
|
|
3013
|
-
day:
|
|
3012
|
+
onChangeVisibleMonth: r,
|
|
3013
|
+
day: n,
|
|
3014
3014
|
isValidDateRange: s,
|
|
3015
3015
|
selectedStartDate: i,
|
|
3016
3016
|
selectedEndDate: c,
|
|
@@ -3023,48 +3023,48 @@ const ce = ({
|
|
|
3023
3023
|
isDateDisabled: h,
|
|
3024
3024
|
size: g
|
|
3025
3025
|
}) => {
|
|
3026
|
-
const w =
|
|
3027
|
-
async (
|
|
3028
|
-
var
|
|
3029
|
-
const N = us(
|
|
3030
|
-
N && !h(N) && (a(N),
|
|
3031
|
-
var
|
|
3032
|
-
(
|
|
3033
|
-
}, 10))), (
|
|
3026
|
+
const w = b(
|
|
3027
|
+
async (Y) => {
|
|
3028
|
+
var x;
|
|
3029
|
+
const N = us(n.date, Y.key);
|
|
3030
|
+
N && !h(N) && (a(N), it(n.date, N) ? (x = document.getElementById(te(N, f))) == null || x.focus() : (r(N), setTimeout(() => {
|
|
3031
|
+
var L;
|
|
3032
|
+
(L = document.getElementById(te(N, f))) == null || L.focus();
|
|
3033
|
+
}, 10))), (Y.key === "Enter" || Y.code === "Space") && t(n.date);
|
|
3034
3034
|
},
|
|
3035
3035
|
[
|
|
3036
3036
|
f,
|
|
3037
|
-
|
|
3037
|
+
n.date,
|
|
3038
3038
|
h,
|
|
3039
|
-
|
|
3039
|
+
r,
|
|
3040
3040
|
t,
|
|
3041
3041
|
a
|
|
3042
3042
|
]
|
|
3043
|
-
),
|
|
3044
|
-
|
|
3043
|
+
), k = n.month === e.getMonth(), p = h(n.date), y = i ? P(i, n.date) : !1, D = c ? P(c, n.date) : !1, M = P(n.date, u), T = ds(
|
|
3044
|
+
n.date,
|
|
3045
3045
|
i,
|
|
3046
3046
|
c,
|
|
3047
3047
|
d,
|
|
3048
|
-
|
|
3048
|
+
k,
|
|
3049
3049
|
s
|
|
3050
3050
|
);
|
|
3051
|
-
return /* @__PURE__ */
|
|
3051
|
+
return /* @__PURE__ */ _(
|
|
3052
3052
|
"td",
|
|
3053
3053
|
{
|
|
3054
3054
|
className: gt(X.travelDateCell, X[g]),
|
|
3055
|
-
onClick:
|
|
3056
|
-
onMouseOver:
|
|
3057
|
-
onMouseOut:
|
|
3058
|
-
tabIndex:
|
|
3059
|
-
|
|
3055
|
+
onClick: p ? void 0 : () => t(n.date),
|
|
3056
|
+
onMouseOver: p ? void 0 : () => k && a(n.date),
|
|
3057
|
+
onMouseOut: p ? void 0 : () => k && l(n.date),
|
|
3058
|
+
tabIndex: p ? void 0 : bs(
|
|
3059
|
+
n,
|
|
3060
3060
|
i,
|
|
3061
|
-
|
|
3061
|
+
M,
|
|
3062
3062
|
e,
|
|
3063
3063
|
m
|
|
3064
3064
|
),
|
|
3065
|
-
id:
|
|
3066
|
-
onKeyDown:
|
|
3067
|
-
"aria-selected":
|
|
3065
|
+
id: p ? void 0 : te(n.date, f),
|
|
3066
|
+
onKeyDown: p ? void 0 : w,
|
|
3067
|
+
...p ? void 0 : { "aria-selected": y || D },
|
|
3068
3068
|
children: [
|
|
3069
3069
|
/* @__PURE__ */ o("div", { className: X.outline }),
|
|
3070
3070
|
/* @__PURE__ */ o(
|
|
@@ -3075,25 +3075,25 @@ const ce = ({
|
|
|
3075
3075
|
bgColorRight: T.right
|
|
3076
3076
|
}
|
|
3077
3077
|
),
|
|
3078
|
-
|
|
3078
|
+
k && /* @__PURE__ */ o(
|
|
3079
3079
|
"div",
|
|
3080
3080
|
{
|
|
3081
3081
|
className: gt(
|
|
3082
3082
|
X.contentWrapper,
|
|
3083
|
-
|
|
3083
|
+
M ? X.isToday : void 0,
|
|
3084
3084
|
i ? X.startSelected : void 0,
|
|
3085
3085
|
c ? X.endSelected : void 0,
|
|
3086
|
-
d && P(d,
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3086
|
+
d && P(d, n.date) ? X.hover : void 0,
|
|
3087
|
+
y && X.isSelectionStart,
|
|
3088
|
+
D && X.isSelectionEnd,
|
|
3089
|
+
p && X.disabled
|
|
3090
3090
|
),
|
|
3091
3091
|
children: /* @__PURE__ */ o(
|
|
3092
3092
|
Dt,
|
|
3093
3093
|
{
|
|
3094
3094
|
variant: "bold",
|
|
3095
|
-
color:
|
|
3096
|
-
children:
|
|
3095
|
+
color: p ? Kt("--lhds-color-ui-500") : void 0,
|
|
3096
|
+
children: n.dayOfMonth
|
|
3097
3097
|
}
|
|
3098
3098
|
)
|
|
3099
3099
|
}
|
|
@@ -3101,16 +3101,16 @@ const ce = ({
|
|
|
3101
3101
|
]
|
|
3102
3102
|
}
|
|
3103
3103
|
);
|
|
3104
|
-
}, bs = (t, e,
|
|
3105
|
-
const i = e ?
|
|
3106
|
-
return (e && i ? P(t.date, e) :
|
|
3104
|
+
}, bs = (t, e, r, n, s) => {
|
|
3105
|
+
const i = e ? it(e, n) : !1;
|
|
3106
|
+
return (e && i ? P(t.date, e) : r) || !i && !s && t.date.getDate() === 1 ? 0 : -1;
|
|
3107
3107
|
}, ws = "_travelCalendar_18pjj_1", ys = {
|
|
3108
3108
|
travelCalendar: ws
|
|
3109
3109
|
}, Xt = ({
|
|
3110
3110
|
visibleMonthData: t,
|
|
3111
3111
|
onClickDate: e,
|
|
3112
|
-
setHoverDate:
|
|
3113
|
-
setVisibleMonth:
|
|
3112
|
+
setHoverDate: r,
|
|
3113
|
+
setVisibleMonth: n,
|
|
3114
3114
|
visibleMonth: s,
|
|
3115
3115
|
isValidDateRange: i,
|
|
3116
3116
|
selectedStartDate: c,
|
|
@@ -3120,39 +3120,48 @@ const ce = ({
|
|
|
3120
3120
|
calendarId: u,
|
|
3121
3121
|
isDateDisabled: m,
|
|
3122
3122
|
todayIsInVisibleMonth: f,
|
|
3123
|
-
size: h = "medium"
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3123
|
+
size: h = "medium",
|
|
3124
|
+
multiSelectable: g
|
|
3125
|
+
}) => /* @__PURE__ */ o(
|
|
3126
|
+
"table",
|
|
3127
|
+
{
|
|
3128
|
+
className: ys.travelCalendar,
|
|
3129
|
+
role: "grid",
|
|
3130
|
+
...g ? { "aria-multiselectable": !0 } : void 0,
|
|
3131
|
+
children: /* @__PURE__ */ _("tbody", { children: [
|
|
3132
|
+
/* @__PURE__ */ o("tr", { children: t.weeks[0].days.map((w) => /* @__PURE__ */ o("th", { abbr: w.fullName, children: /* @__PURE__ */ o(Dt, { children: w.name }) }, w.name)) }),
|
|
3133
|
+
t.weeks.map((w) => /* @__PURE__ */ o(me.Fragment, { children: /* @__PURE__ */ o("tr", { children: w.days.map((k) => /* @__PURE__ */ o(
|
|
3134
|
+
Ds,
|
|
3135
|
+
{
|
|
3136
|
+
size: h,
|
|
3137
|
+
onClick: (p) => e(p),
|
|
3138
|
+
visibleMonth: s,
|
|
3139
|
+
onChangeVisibleMonth: n,
|
|
3140
|
+
isValidDateRange: i,
|
|
3141
|
+
day: k,
|
|
3142
|
+
onStartHover: (p) => r(p),
|
|
3143
|
+
onEndHover: (p) => r((y) => y && P(y, p) ? void 0 : y),
|
|
3144
|
+
selectedStartDate: c,
|
|
3145
|
+
selectedEndDate: a,
|
|
3146
|
+
hoverDate: l,
|
|
3147
|
+
today: d,
|
|
3148
|
+
todayIsInVisibleMonth: f,
|
|
3149
|
+
calendarId: u,
|
|
3150
|
+
isDateDisabled: m
|
|
3151
|
+
},
|
|
3152
|
+
k.dateString
|
|
3153
|
+
)) }, w.weekNumber) }, w.weekNumber))
|
|
3154
|
+
] })
|
|
3155
|
+
}
|
|
3156
|
+
), Ms = "_travelDateRangeInput_1j7rp_1", ks = "_overlay_1j7rp_2", Ss = "_calendarVisible_1j7rp_6", ee = {
|
|
3148
3157
|
travelDateRangeInput: Ms,
|
|
3149
3158
|
overlay: ks,
|
|
3150
3159
|
calendarVisible: Ss
|
|
3151
|
-
},
|
|
3160
|
+
}, ri = ({
|
|
3152
3161
|
value: t,
|
|
3153
3162
|
onValueChange: e,
|
|
3154
|
-
startDateLabel:
|
|
3155
|
-
endDateLabel:
|
|
3163
|
+
startDateLabel: r,
|
|
3164
|
+
endDateLabel: n,
|
|
3156
3165
|
localeCode: s = "sv",
|
|
3157
3166
|
initialMonthInFocus: i,
|
|
3158
3167
|
previousMonthButtonAriaLabel: c = "Previous month",
|
|
@@ -3165,51 +3174,51 @@ const ce = ({
|
|
|
3165
3174
|
zIndexWhenClosed: h,
|
|
3166
3175
|
onHideCalendar: g,
|
|
3167
3176
|
renderBelowCalendar: w,
|
|
3168
|
-
size:
|
|
3177
|
+
size: k = "medium"
|
|
3169
3178
|
}) => {
|
|
3170
|
-
const [
|
|
3179
|
+
const [p, y] = I(!1), [D, M] = I(!1), [T, Y] = I({
|
|
3171
3180
|
// Sane defaults, this will be updated with actual data from DOM.
|
|
3172
3181
|
width: 336,
|
|
3173
3182
|
height: 66
|
|
3174
|
-
}), N =
|
|
3175
|
-
|
|
3176
|
-
|
|
3183
|
+
}), N = k === "large" ? "8.8rem" : "6.6rem", x = O(!1), L = b(() => {
|
|
3184
|
+
x.current = !0, M(!0), setTimeout(() => {
|
|
3185
|
+
y(!0);
|
|
3177
3186
|
}, 10);
|
|
3178
|
-
}, []), S =
|
|
3179
|
-
|
|
3180
|
-
|
|
3187
|
+
}, []), S = b(() => {
|
|
3188
|
+
D && (y(!1), x.current = !1, g == null || g(), setTimeout(() => {
|
|
3189
|
+
x.current || M(!1);
|
|
3181
3190
|
}, 120));
|
|
3182
|
-
}, [
|
|
3183
|
-
Ie(
|
|
3184
|
-
var
|
|
3185
|
-
const
|
|
3186
|
-
|
|
3191
|
+
}, [D, g]), W = O(null), $ = O(null);
|
|
3192
|
+
Ie(W, S), Be(() => {
|
|
3193
|
+
var tt, et;
|
|
3194
|
+
const E = (tt = $.current) == null ? void 0 : tt.offsetWidth, B = (et = $.current) == null ? void 0 : et.offsetHeight;
|
|
3195
|
+
E != null && B != null && (T.height !== B || T.width !== E) && Y({ width: E, height: B });
|
|
3187
3196
|
}, [T.height, T.width]);
|
|
3188
|
-
const
|
|
3197
|
+
const j = Ge(
|
|
3189
3198
|
t,
|
|
3190
3199
|
e,
|
|
3191
3200
|
s,
|
|
3192
3201
|
i
|
|
3193
3202
|
), {
|
|
3194
3203
|
visiblePanel: F,
|
|
3195
|
-
visibleMonth:
|
|
3196
|
-
onValueChangeByInputs:
|
|
3197
|
-
setVisibleMonth:
|
|
3198
|
-
setVisiblePanel:
|
|
3199
|
-
monthPickerButtonRef:
|
|
3200
|
-
} =
|
|
3201
|
-
(
|
|
3202
|
-
|
|
3204
|
+
visibleMonth: V,
|
|
3205
|
+
onValueChangeByInputs: U,
|
|
3206
|
+
setVisibleMonth: rt,
|
|
3207
|
+
setVisiblePanel: q,
|
|
3208
|
+
monthPickerButtonRef: G
|
|
3209
|
+
} = j, Q = b(
|
|
3210
|
+
(E) => {
|
|
3211
|
+
E.key === "Escape" && S();
|
|
3203
3212
|
},
|
|
3204
3213
|
[S]
|
|
3205
3214
|
);
|
|
3206
|
-
return /* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ _(
|
|
3207
3216
|
A,
|
|
3208
3217
|
{
|
|
3209
3218
|
position: "relative",
|
|
3210
3219
|
className: ee.travelDateRangeInput,
|
|
3211
|
-
ref:
|
|
3212
|
-
onKeyDown:
|
|
3220
|
+
ref: W,
|
|
3221
|
+
onKeyDown: Q,
|
|
3213
3222
|
height: T.height,
|
|
3214
3223
|
width: T.width,
|
|
3215
3224
|
children: [
|
|
@@ -3218,62 +3227,69 @@ const ce = ({
|
|
|
3218
3227
|
{
|
|
3219
3228
|
position: "absolute",
|
|
3220
3229
|
ref: $,
|
|
3221
|
-
zIndex:
|
|
3230
|
+
zIndex: D ? f : h,
|
|
3222
3231
|
children: /* @__PURE__ */ o(
|
|
3223
3232
|
qe,
|
|
3224
3233
|
{
|
|
3225
3234
|
value: t,
|
|
3226
|
-
onValueChange:
|
|
3235
|
+
onValueChange: U,
|
|
3227
3236
|
localeCode: s,
|
|
3228
|
-
startDateLabel:
|
|
3229
|
-
endDateLabel:
|
|
3230
|
-
onFocus:
|
|
3231
|
-
calendarSize:
|
|
3237
|
+
startDateLabel: r,
|
|
3238
|
+
endDateLabel: n,
|
|
3239
|
+
onFocus: L,
|
|
3240
|
+
calendarSize: k
|
|
3232
3241
|
}
|
|
3233
3242
|
)
|
|
3234
3243
|
}
|
|
3235
3244
|
),
|
|
3236
|
-
|
|
3245
|
+
D && /* @__PURE__ */ o(
|
|
3237
3246
|
A,
|
|
3238
3247
|
{
|
|
3239
3248
|
position: "absolute",
|
|
3240
3249
|
zIndex: f - 1,
|
|
3241
3250
|
left: "-2.4rem",
|
|
3242
3251
|
top: l ? "-8.0rem" : "-2.4rem",
|
|
3243
|
-
className: gt(ee.overlay,
|
|
3252
|
+
className: gt(ee.overlay, p && ee.calendarVisible),
|
|
3244
3253
|
children: /* @__PURE__ */ o(
|
|
3245
3254
|
A,
|
|
3246
3255
|
{
|
|
3247
3256
|
background: "white",
|
|
3248
3257
|
shadow: "popover",
|
|
3249
3258
|
borderRadius: "var(--swui-border-radius-large)",
|
|
3250
|
-
children: /* @__PURE__ */
|
|
3259
|
+
children: /* @__PURE__ */ _(Ee, { gap: 3, children: [
|
|
3251
3260
|
l && /* @__PURE__ */ o(_t, { variant: "h2", as: d, children: l }),
|
|
3252
3261
|
/* @__PURE__ */ o(A, { height: N }),
|
|
3253
3262
|
/* @__PURE__ */ o(
|
|
3254
3263
|
Qt,
|
|
3255
3264
|
{
|
|
3256
|
-
...
|
|
3265
|
+
...j,
|
|
3257
3266
|
previousMonthButtonAriaLabel: c,
|
|
3258
3267
|
nextMonthButtonAriaLabel: a,
|
|
3259
|
-
calendarSize:
|
|
3268
|
+
calendarSize: k
|
|
3269
|
+
}
|
|
3270
|
+
),
|
|
3271
|
+
F === "calendar" && /* @__PURE__ */ o(
|
|
3272
|
+
Xt,
|
|
3273
|
+
{
|
|
3274
|
+
...j,
|
|
3275
|
+
size: k,
|
|
3276
|
+
multiSelectable: !0
|
|
3260
3277
|
}
|
|
3261
3278
|
),
|
|
3262
|
-
F === "calendar" && /* @__PURE__ */ o(Xt, { ...v, size: y }),
|
|
3263
3279
|
F === "month-picker" && /* @__PURE__ */ o(
|
|
3264
3280
|
Pt,
|
|
3265
3281
|
{
|
|
3266
3282
|
firstMonth: m,
|
|
3267
3283
|
numMonths: u,
|
|
3268
|
-
value:
|
|
3269
|
-
size:
|
|
3270
|
-
onValueChange: (
|
|
3271
|
-
var
|
|
3272
|
-
|
|
3284
|
+
value: V,
|
|
3285
|
+
size: k,
|
|
3286
|
+
onValueChange: (E) => {
|
|
3287
|
+
var B;
|
|
3288
|
+
rt(E), q("calendar"), (B = G.current) == null || B.focus();
|
|
3273
3289
|
},
|
|
3274
3290
|
onCancel: () => {
|
|
3275
|
-
var
|
|
3276
|
-
|
|
3291
|
+
var E;
|
|
3292
|
+
q("calendar"), (E = G.current) == null || E.focus();
|
|
3277
3293
|
}
|
|
3278
3294
|
}
|
|
3279
3295
|
),
|
|
@@ -3286,101 +3302,101 @@ const ce = ({
|
|
|
3286
3302
|
]
|
|
3287
3303
|
}
|
|
3288
3304
|
);
|
|
3289
|
-
}, Ts = "_travelDateInput_hmfbf_1", Is = "_overlay_hmfbf_2", Rs = "_calendarVisible_hmfbf_6",
|
|
3305
|
+
}, Ts = "_travelDateInput_hmfbf_1", Is = "_overlay_hmfbf_2", Rs = "_calendarVisible_hmfbf_6", re = {
|
|
3290
3306
|
travelDateInput: Ts,
|
|
3291
3307
|
overlay: Is,
|
|
3292
3308
|
calendarVisible: Rs
|
|
3293
3309
|
}, Qe = ({
|
|
3294
3310
|
value: t,
|
|
3295
3311
|
onValueChange: e,
|
|
3296
|
-
label:
|
|
3297
|
-
localeCode:
|
|
3312
|
+
label: r = "Date",
|
|
3313
|
+
localeCode: n,
|
|
3298
3314
|
onFocus: s,
|
|
3299
3315
|
calendarSize: i
|
|
3300
3316
|
}) => {
|
|
3301
|
-
const { mask: c, placeholder: a } =
|
|
3302
|
-
const l = kt(
|
|
3317
|
+
const { mask: c, placeholder: a } = R(() => {
|
|
3318
|
+
const l = kt(n);
|
|
3303
3319
|
return {
|
|
3304
3320
|
mask: ze(l),
|
|
3305
3321
|
placeholder: l.toLowerCase()
|
|
3306
3322
|
};
|
|
3307
|
-
}, [
|
|
3308
|
-
return /* @__PURE__ */ o(
|
|
3323
|
+
}, [n]);
|
|
3324
|
+
return /* @__PURE__ */ o(H, { children: /* @__PURE__ */ o(
|
|
3309
3325
|
ce,
|
|
3310
3326
|
{
|
|
3311
3327
|
mask: c,
|
|
3312
3328
|
value: t,
|
|
3313
3329
|
onValueChange: e,
|
|
3314
3330
|
onBlur: (l) => {
|
|
3315
|
-
const d = ae(l.target.value,
|
|
3331
|
+
const d = ae(l.target.value, n);
|
|
3316
3332
|
d && d !== t && (e == null || e(d));
|
|
3317
3333
|
},
|
|
3318
3334
|
onFocus: s,
|
|
3319
|
-
label:
|
|
3335
|
+
label: r,
|
|
3320
3336
|
placeholder: a,
|
|
3321
3337
|
calendarSize: i
|
|
3322
3338
|
}
|
|
3323
3339
|
) });
|
|
3324
|
-
}, Xe = (t, e,
|
|
3325
|
-
const s = Gt(
|
|
3326
|
-
() => kt(
|
|
3327
|
-
[
|
|
3328
|
-
), d =
|
|
3329
|
-
() => (t == null ? void 0 : t.length) === l.length ? ht(t,
|
|
3330
|
-
[l.length,
|
|
3340
|
+
}, Xe = (t, e, r, n) => {
|
|
3341
|
+
const s = Gt(r) ?? Je(), i = ge(), c = De(), a = O(null), l = R(
|
|
3342
|
+
() => kt(r),
|
|
3343
|
+
[r]
|
|
3344
|
+
), d = R(
|
|
3345
|
+
() => (t == null ? void 0 : t.length) === l.length ? ht(t, r) : void 0,
|
|
3346
|
+
[l.length, r, t]
|
|
3331
3347
|
), [u, m] = I(
|
|
3332
|
-
|
|
3333
|
-
), f =
|
|
3334
|
-
(
|
|
3335
|
-
|
|
3348
|
+
n ?? d ?? /* @__PURE__ */ new Date()
|
|
3349
|
+
), f = b(
|
|
3350
|
+
(x) => {
|
|
3351
|
+
it(x, c) || K(x, c) ? m(x) : m(c);
|
|
3336
3352
|
},
|
|
3337
3353
|
[c]
|
|
3338
|
-
), h =
|
|
3354
|
+
), h = R(
|
|
3339
3355
|
() => Jt(
|
|
3340
3356
|
u.getFullYear(),
|
|
3341
3357
|
u.getMonth(),
|
|
3342
3358
|
s
|
|
3343
3359
|
),
|
|
3344
3360
|
[s, u]
|
|
3345
|
-
), g =
|
|
3346
|
-
(
|
|
3347
|
-
const
|
|
3348
|
-
|
|
3361
|
+
), g = R(() => xt(v(u, "MMMM yyyy", { locale: s })), [s, u]), w = R(() => it(c, u), [c, u]), [k, p] = I(), [y, D] = I("calendar"), M = b(
|
|
3362
|
+
(x) => {
|
|
3363
|
+
const L = (x == null ? void 0 : x.length) === l.length ? ht(x, r) : void 0;
|
|
3364
|
+
L && f(L), e == null || e(x);
|
|
3349
3365
|
},
|
|
3350
|
-
[l.length,
|
|
3351
|
-
), T =
|
|
3352
|
-
() =>
|
|
3366
|
+
[l.length, r, e, f]
|
|
3367
|
+
), T = R(
|
|
3368
|
+
() => it(c, u) || st(u, c),
|
|
3353
3369
|
[c, u]
|
|
3354
3370
|
);
|
|
3355
3371
|
return {
|
|
3356
|
-
isDateDisabled:
|
|
3357
|
-
(
|
|
3372
|
+
isDateDisabled: b(
|
|
3373
|
+
(x) => !P(x, c) && st(x, c),
|
|
3358
3374
|
[c]
|
|
3359
3375
|
),
|
|
3360
|
-
onClickDate: (
|
|
3361
|
-
e == null || e(St(
|
|
3376
|
+
onClickDate: (x) => {
|
|
3377
|
+
e == null || e(St(x, r));
|
|
3362
3378
|
},
|
|
3363
|
-
onValueChangeByInputs:
|
|
3379
|
+
onValueChangeByInputs: M,
|
|
3364
3380
|
prevMonthDisabled: T,
|
|
3365
3381
|
monthPickerButtonRef: a,
|
|
3366
3382
|
calendarId: i,
|
|
3367
3383
|
monthPickerButtonLabel: g,
|
|
3368
|
-
visiblePanel:
|
|
3369
|
-
setVisiblePanel:
|
|
3384
|
+
visiblePanel: y,
|
|
3385
|
+
setVisiblePanel: D,
|
|
3370
3386
|
setVisibleMonth: m,
|
|
3371
3387
|
visibleMonthData: h,
|
|
3372
3388
|
todayIsInVisibleMonth: w,
|
|
3373
|
-
hoverDate:
|
|
3374
|
-
setHoverDate:
|
|
3389
|
+
hoverDate: k,
|
|
3390
|
+
setHoverDate: p,
|
|
3375
3391
|
selectedDate: d,
|
|
3376
3392
|
today: c,
|
|
3377
3393
|
visibleMonth: u
|
|
3378
3394
|
};
|
|
3379
|
-
},
|
|
3395
|
+
}, ni = ({
|
|
3380
3396
|
value: t,
|
|
3381
3397
|
onValueChange: e,
|
|
3382
|
-
label:
|
|
3383
|
-
localeCode:
|
|
3398
|
+
label: r,
|
|
3399
|
+
localeCode: n = "sv",
|
|
3384
3400
|
initialMonthInFocus: s,
|
|
3385
3401
|
previousMonthButtonAriaLabel: i = "Previous month",
|
|
3386
3402
|
nextMonthButtonAriaLabel: c = "Next month",
|
|
@@ -3394,126 +3410,127 @@ const ce = ({
|
|
|
3394
3410
|
renderBelowCalendar: g,
|
|
3395
3411
|
size: w = "medium"
|
|
3396
3412
|
}) => {
|
|
3397
|
-
const [
|
|
3413
|
+
const [k, p] = I(!1), [y, D] = I(!1), [M, T] = I({
|
|
3398
3414
|
// Sane defaults, this will be updated with actual data from DOM.
|
|
3399
3415
|
width: 336,
|
|
3400
3416
|
height: 66
|
|
3401
|
-
}),
|
|
3402
|
-
|
|
3403
|
-
|
|
3417
|
+
}), Y = w === "large" ? "8.8rem" : "6.6rem", N = O(!1), x = b(() => {
|
|
3418
|
+
N.current = !0, D(!0), setTimeout(() => {
|
|
3419
|
+
p(!0);
|
|
3404
3420
|
}, 10);
|
|
3405
|
-
}, []),
|
|
3406
|
-
|
|
3407
|
-
|
|
3421
|
+
}, []), L = b(() => {
|
|
3422
|
+
y && (p(!1), N.current = !1, h == null || h(), setTimeout(() => {
|
|
3423
|
+
N.current || D(!1);
|
|
3408
3424
|
}, 120));
|
|
3409
|
-
}, [
|
|
3410
|
-
Ie(
|
|
3411
|
-
var
|
|
3412
|
-
const
|
|
3413
|
-
|
|
3414
|
-
}, [
|
|
3415
|
-
const
|
|
3425
|
+
}, [y, h]), S = O(null), W = O(null);
|
|
3426
|
+
Ie(S, L), Be(() => {
|
|
3427
|
+
var tt, et;
|
|
3428
|
+
const E = (tt = W.current) == null ? void 0 : tt.offsetWidth, B = (et = W.current) == null ? void 0 : et.offsetHeight;
|
|
3429
|
+
E != null && B != null && (M.height !== B || M.width !== E) && T({ width: E, height: B });
|
|
3430
|
+
}, [M.height, M.width]);
|
|
3431
|
+
const $ = Xe(
|
|
3416
3432
|
t,
|
|
3417
3433
|
e,
|
|
3418
|
-
|
|
3434
|
+
n,
|
|
3419
3435
|
s
|
|
3420
3436
|
), {
|
|
3421
|
-
visiblePanel:
|
|
3422
|
-
visibleMonth:
|
|
3423
|
-
onValueChangeByInputs:
|
|
3424
|
-
selectedDate:
|
|
3425
|
-
setVisibleMonth:
|
|
3426
|
-
setVisiblePanel:
|
|
3427
|
-
monthPickerButtonRef:
|
|
3428
|
-
} =
|
|
3429
|
-
(
|
|
3430
|
-
|
|
3437
|
+
visiblePanel: j,
|
|
3438
|
+
visibleMonth: F,
|
|
3439
|
+
onValueChangeByInputs: V,
|
|
3440
|
+
selectedDate: U,
|
|
3441
|
+
setVisibleMonth: rt,
|
|
3442
|
+
setVisiblePanel: q,
|
|
3443
|
+
monthPickerButtonRef: G
|
|
3444
|
+
} = $, Q = b(
|
|
3445
|
+
(E) => {
|
|
3446
|
+
E.key === "Escape" && L();
|
|
3431
3447
|
},
|
|
3432
|
-
[
|
|
3448
|
+
[L]
|
|
3433
3449
|
);
|
|
3434
|
-
return /* @__PURE__ */
|
|
3450
|
+
return /* @__PURE__ */ _(
|
|
3435
3451
|
A,
|
|
3436
3452
|
{
|
|
3437
3453
|
position: "relative",
|
|
3438
|
-
className:
|
|
3439
|
-
ref:
|
|
3440
|
-
onKeyDown:
|
|
3441
|
-
height:
|
|
3442
|
-
width:
|
|
3454
|
+
className: re.travelDateInput,
|
|
3455
|
+
ref: S,
|
|
3456
|
+
onKeyDown: Q,
|
|
3457
|
+
height: M.height,
|
|
3458
|
+
width: M.width,
|
|
3443
3459
|
children: [
|
|
3444
3460
|
/* @__PURE__ */ o(
|
|
3445
3461
|
A,
|
|
3446
3462
|
{
|
|
3447
3463
|
position: "absolute",
|
|
3448
|
-
ref:
|
|
3449
|
-
zIndex:
|
|
3464
|
+
ref: W,
|
|
3465
|
+
zIndex: y ? m : f,
|
|
3450
3466
|
children: /* @__PURE__ */ o(
|
|
3451
3467
|
Qe,
|
|
3452
3468
|
{
|
|
3453
3469
|
value: t,
|
|
3454
|
-
onValueChange:
|
|
3455
|
-
localeCode:
|
|
3456
|
-
label:
|
|
3457
|
-
onFocus:
|
|
3470
|
+
onValueChange: V,
|
|
3471
|
+
localeCode: n,
|
|
3472
|
+
label: r,
|
|
3473
|
+
onFocus: x,
|
|
3458
3474
|
calendarSize: w
|
|
3459
3475
|
}
|
|
3460
3476
|
)
|
|
3461
3477
|
}
|
|
3462
3478
|
),
|
|
3463
|
-
|
|
3479
|
+
y && /* @__PURE__ */ o(
|
|
3464
3480
|
A,
|
|
3465
3481
|
{
|
|
3466
3482
|
position: "absolute",
|
|
3467
3483
|
zIndex: m - 1,
|
|
3468
3484
|
left: "-2.4rem",
|
|
3469
3485
|
top: a ? "-8.0rem" : "-2.4rem",
|
|
3470
|
-
className: gt(
|
|
3486
|
+
className: gt(re.overlay, k && re.calendarVisible),
|
|
3471
3487
|
children: /* @__PURE__ */ o(
|
|
3472
3488
|
A,
|
|
3473
3489
|
{
|
|
3474
3490
|
background: "white",
|
|
3475
3491
|
shadow: "popover",
|
|
3476
3492
|
borderRadius: "var(--swui-border-radius-large)",
|
|
3477
|
-
children: /* @__PURE__ */
|
|
3493
|
+
children: /* @__PURE__ */ _(Ee, { gap: 3, children: [
|
|
3478
3494
|
a && /* @__PURE__ */ o(_t, { variant: "h2", as: l, children: a }),
|
|
3479
|
-
/* @__PURE__ */ o(A, { height:
|
|
3495
|
+
/* @__PURE__ */ o(A, { height: Y }),
|
|
3480
3496
|
/* @__PURE__ */ o(
|
|
3481
3497
|
Qt,
|
|
3482
3498
|
{
|
|
3483
|
-
|
|
3499
|
+
...$,
|
|
3484
3500
|
previousMonthButtonAriaLabel: i,
|
|
3485
3501
|
nextMonthButtonAriaLabel: c,
|
|
3486
3502
|
calendarSize: w
|
|
3487
3503
|
}
|
|
3488
3504
|
),
|
|
3489
|
-
|
|
3505
|
+
j === "calendar" && /* @__PURE__ */ o(
|
|
3490
3506
|
Xt,
|
|
3491
3507
|
{
|
|
3492
|
-
|
|
3508
|
+
...$,
|
|
3493
3509
|
size: w,
|
|
3494
|
-
isValidDateRange: !!
|
|
3495
|
-
selectedStartDate:
|
|
3496
|
-
selectedEndDate:
|
|
3510
|
+
isValidDateRange: !!U,
|
|
3511
|
+
selectedStartDate: U,
|
|
3512
|
+
selectedEndDate: U,
|
|
3513
|
+
multiSelectable: !1
|
|
3497
3514
|
}
|
|
3498
3515
|
),
|
|
3499
|
-
|
|
3516
|
+
j === "month-picker" && /* @__PURE__ */ o(
|
|
3500
3517
|
Pt,
|
|
3501
3518
|
{
|
|
3502
3519
|
firstMonth: u,
|
|
3503
3520
|
numMonths: d,
|
|
3504
|
-
value:
|
|
3521
|
+
value: F,
|
|
3505
3522
|
size: w,
|
|
3506
|
-
onValueChange: (
|
|
3507
|
-
var
|
|
3508
|
-
|
|
3523
|
+
onValueChange: (E) => {
|
|
3524
|
+
var B;
|
|
3525
|
+
rt(E), q("calendar"), (B = G.current) == null || B.focus();
|
|
3509
3526
|
},
|
|
3510
3527
|
onCancel: () => {
|
|
3511
|
-
var
|
|
3512
|
-
|
|
3528
|
+
var E;
|
|
3529
|
+
q("calendar"), (E = G.current) == null || E.focus();
|
|
3513
3530
|
}
|
|
3514
3531
|
}
|
|
3515
3532
|
),
|
|
3516
|
-
g == null ? void 0 : g({ hideCalendar:
|
|
3533
|
+
g == null ? void 0 : g({ hideCalendar: L })
|
|
3517
3534
|
] })
|
|
3518
3535
|
}
|
|
3519
3536
|
)
|
|
@@ -3525,8 +3542,8 @@ const ce = ({
|
|
|
3525
3542
|
}, si = ({
|
|
3526
3543
|
value: t,
|
|
3527
3544
|
onValueChange: e,
|
|
3528
|
-
label:
|
|
3529
|
-
localeCode:
|
|
3545
|
+
label: r,
|
|
3546
|
+
localeCode: n = "sv",
|
|
3530
3547
|
initialMonthInFocus: s,
|
|
3531
3548
|
previousMonthButtonAriaLabel: i = "Previous month",
|
|
3532
3549
|
nextMonthButtonAriaLabel: c = "Next month",
|
|
@@ -3539,26 +3556,26 @@ const ce = ({
|
|
|
3539
3556
|
const f = Xe(
|
|
3540
3557
|
t,
|
|
3541
3558
|
e,
|
|
3542
|
-
|
|
3559
|
+
n,
|
|
3543
3560
|
s
|
|
3544
3561
|
), {
|
|
3545
3562
|
visiblePanel: h,
|
|
3546
3563
|
visibleMonth: g,
|
|
3547
3564
|
onValueChangeByInputs: w,
|
|
3548
|
-
setVisibleMonth:
|
|
3549
|
-
setVisiblePanel:
|
|
3550
|
-
monthPickerButtonRef:
|
|
3551
|
-
selectedDate:
|
|
3565
|
+
setVisibleMonth: k,
|
|
3566
|
+
setVisiblePanel: p,
|
|
3567
|
+
monthPickerButtonRef: y,
|
|
3568
|
+
selectedDate: D
|
|
3552
3569
|
} = f;
|
|
3553
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ _(C, { gap: 3, children: [
|
|
3554
3571
|
a && /* @__PURE__ */ o(_t, { variant: "h2", as: l, children: a }),
|
|
3555
3572
|
/* @__PURE__ */ o(
|
|
3556
3573
|
Qe,
|
|
3557
3574
|
{
|
|
3558
3575
|
value: t,
|
|
3559
3576
|
onValueChange: w,
|
|
3560
|
-
localeCode:
|
|
3561
|
-
label:
|
|
3577
|
+
localeCode: n,
|
|
3578
|
+
label: r,
|
|
3562
3579
|
calendarSize: m
|
|
3563
3580
|
}
|
|
3564
3581
|
),
|
|
@@ -3576,9 +3593,10 @@ const ce = ({
|
|
|
3576
3593
|
{
|
|
3577
3594
|
...f,
|
|
3578
3595
|
size: m,
|
|
3579
|
-
selectedStartDate:
|
|
3580
|
-
selectedEndDate:
|
|
3581
|
-
isValidDateRange: !!
|
|
3596
|
+
selectedStartDate: D,
|
|
3597
|
+
selectedEndDate: D,
|
|
3598
|
+
isValidDateRange: !!D,
|
|
3599
|
+
multiSelectable: !1
|
|
3582
3600
|
}
|
|
3583
3601
|
),
|
|
3584
3602
|
h === "month-picker" && /* @__PURE__ */ o(
|
|
@@ -3588,13 +3606,13 @@ const ce = ({
|
|
|
3588
3606
|
numMonths: d,
|
|
3589
3607
|
value: g,
|
|
3590
3608
|
size: m,
|
|
3591
|
-
onValueChange: (
|
|
3609
|
+
onValueChange: (M) => {
|
|
3592
3610
|
var T;
|
|
3593
|
-
|
|
3611
|
+
k(M), p("calendar"), (T = y.current) == null || T.focus();
|
|
3594
3612
|
},
|
|
3595
3613
|
onCancel: () => {
|
|
3596
|
-
var
|
|
3597
|
-
|
|
3614
|
+
var M;
|
|
3615
|
+
p("calendar"), (M = y.current) == null || M.focus();
|
|
3598
3616
|
}
|
|
3599
3617
|
}
|
|
3600
3618
|
)
|
|
@@ -3602,8 +3620,8 @@ const ce = ({
|
|
|
3602
3620
|
}, ii = ({
|
|
3603
3621
|
value: t,
|
|
3604
3622
|
onValueChange: e,
|
|
3605
|
-
startDateLabel:
|
|
3606
|
-
endDateLabel:
|
|
3623
|
+
startDateLabel: r,
|
|
3624
|
+
endDateLabel: n,
|
|
3607
3625
|
localeCode: s = "sv",
|
|
3608
3626
|
initialMonthInFocus: i,
|
|
3609
3627
|
previousMonthButtonAriaLabel: c = "Previous month",
|
|
@@ -3622,21 +3640,21 @@ const ce = ({
|
|
|
3622
3640
|
), {
|
|
3623
3641
|
visiblePanel: g,
|
|
3624
3642
|
visibleMonth: w,
|
|
3625
|
-
onValueChangeByInputs:
|
|
3626
|
-
setVisibleMonth:
|
|
3627
|
-
setVisiblePanel:
|
|
3628
|
-
monthPickerButtonRef:
|
|
3643
|
+
onValueChangeByInputs: k,
|
|
3644
|
+
setVisibleMonth: p,
|
|
3645
|
+
setVisiblePanel: y,
|
|
3646
|
+
monthPickerButtonRef: D
|
|
3629
3647
|
} = h;
|
|
3630
|
-
return /* @__PURE__ */
|
|
3648
|
+
return /* @__PURE__ */ _(C, { gap: 3, children: [
|
|
3631
3649
|
l && /* @__PURE__ */ o(_t, { variant: "h2", as: d, children: l }),
|
|
3632
3650
|
/* @__PURE__ */ o(
|
|
3633
3651
|
qe,
|
|
3634
3652
|
{
|
|
3635
3653
|
value: t,
|
|
3636
|
-
onValueChange:
|
|
3654
|
+
onValueChange: k,
|
|
3637
3655
|
localeCode: s,
|
|
3638
|
-
startDateLabel:
|
|
3639
|
-
endDateLabel:
|
|
3656
|
+
startDateLabel: r,
|
|
3657
|
+
endDateLabel: n,
|
|
3640
3658
|
calendarSize: f
|
|
3641
3659
|
}
|
|
3642
3660
|
),
|
|
@@ -3649,7 +3667,7 @@ const ce = ({
|
|
|
3649
3667
|
calendarSize: f
|
|
3650
3668
|
}
|
|
3651
3669
|
),
|
|
3652
|
-
g === "calendar" && /* @__PURE__ */ o(Xt, { ...h, size: f }),
|
|
3670
|
+
g === "calendar" && /* @__PURE__ */ o(Xt, { ...h, size: f, multiSelectable: !0 }),
|
|
3653
3671
|
g === "month-picker" && /* @__PURE__ */ o(
|
|
3654
3672
|
Pt,
|
|
3655
3673
|
{
|
|
@@ -3657,13 +3675,13 @@ const ce = ({
|
|
|
3657
3675
|
numMonths: u,
|
|
3658
3676
|
value: w,
|
|
3659
3677
|
size: f,
|
|
3660
|
-
onValueChange: (
|
|
3678
|
+
onValueChange: (M) => {
|
|
3661
3679
|
var T;
|
|
3662
|
-
|
|
3680
|
+
p(M), y("calendar"), (T = D.current) == null || T.focus();
|
|
3663
3681
|
},
|
|
3664
3682
|
onCancel: () => {
|
|
3665
|
-
var
|
|
3666
|
-
|
|
3683
|
+
var M;
|
|
3684
|
+
y("calendar"), (M = D.current) == null || M.focus();
|
|
3667
3685
|
}
|
|
3668
3686
|
}
|
|
3669
3687
|
)
|
|
@@ -3671,65 +3689,65 @@ const ce = ({
|
|
|
3671
3689
|
};
|
|
3672
3690
|
export {
|
|
3673
3691
|
ie as Calendar,
|
|
3674
|
-
|
|
3692
|
+
$e as CalendarDay,
|
|
3675
3693
|
Gs as DateInput,
|
|
3676
3694
|
zs as DateRangeCalendar,
|
|
3677
3695
|
ei as DateRangeDualTextInput,
|
|
3678
3696
|
Qs as DateRangeInput,
|
|
3679
3697
|
Xs as DateTextInput,
|
|
3680
3698
|
Vs as DateTimeInput,
|
|
3681
|
-
|
|
3699
|
+
Hr as Month,
|
|
3682
3700
|
Pt as MonthPicker,
|
|
3683
3701
|
Js as MultiDateCalendar,
|
|
3684
|
-
|
|
3685
|
-
|
|
3702
|
+
dn as PresetPicker,
|
|
3703
|
+
je as SingleDateCalendar,
|
|
3686
3704
|
qs as SingleWeekCalendar,
|
|
3687
3705
|
Zs as TimeTextInput,
|
|
3688
3706
|
si as TravelDateCalendar,
|
|
3689
|
-
|
|
3707
|
+
ni as TravelDateInput,
|
|
3690
3708
|
ii as TravelDateRangeCalendar,
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3709
|
+
ri as TravelDateRangeInput,
|
|
3710
|
+
$r as WeekDay,
|
|
3711
|
+
Jr as WeekDayCell,
|
|
3712
|
+
Gr as WeekNumberCell,
|
|
3695
3713
|
ti as YearPicker,
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3714
|
+
dt as addDayStateHighlights,
|
|
3715
|
+
He as addDayStateHighlightsOnSingleDay,
|
|
3716
|
+
Yr as addWeekRangeHighlights,
|
|
3717
|
+
Us as addWeekStateHighlights,
|
|
3700
3718
|
Et as buildDayStateForDateRange,
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3719
|
+
Pr as buildDayStateForRange,
|
|
3720
|
+
Lr as buildDayStateForSingleMonth,
|
|
3721
|
+
jr as calculateOverflowingMonth,
|
|
3722
|
+
vr as createDay,
|
|
3723
|
+
pn as dateRangeToStrings,
|
|
3724
|
+
Cr as dayHasHighlight,
|
|
3725
|
+
at as dayHighlightSelect,
|
|
3708
3726
|
bt as defaultCalendarTheme,
|
|
3709
|
-
|
|
3710
|
-
|
|
3727
|
+
Kr as defaultTextPropsProvider,
|
|
3728
|
+
zr as defaultWrapperStyleProvider,
|
|
3711
3729
|
Fs as extranetCalendarTheme,
|
|
3712
3730
|
St as formatLocalizedDate,
|
|
3713
3731
|
kt as getDateFormatForLocaleCode,
|
|
3714
|
-
|
|
3732
|
+
Wr as getDaysForWeekForDate,
|
|
3715
3733
|
Je as getDefaultLocaleForFormatting,
|
|
3716
3734
|
Gt as getLocaleForLocaleCode,
|
|
3717
3735
|
Jt as getMonthInYear,
|
|
3718
3736
|
ye as getMonthsInYear,
|
|
3719
3737
|
pe as getWeekForDate,
|
|
3720
|
-
|
|
3721
|
-
|
|
3738
|
+
Or as getWeeksForMonth,
|
|
3739
|
+
ve as isDateRangeInvalid,
|
|
3722
3740
|
ht as parseLocalizedDateString,
|
|
3723
3741
|
ae as reformatLocalizedDateString,
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3742
|
+
Ws as setDayStateValue,
|
|
3743
|
+
js as setDayStateValueFunction,
|
|
3744
|
+
Dn as stringsToDateRange,
|
|
3727
3745
|
Cs as toggleDateStringsIfEndIsEarlierThanStart,
|
|
3728
|
-
|
|
3746
|
+
We as toggleDatesIfEndIsEarlierThanStart,
|
|
3729
3747
|
Ks as useDateRangeCalendarState,
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3748
|
+
wn as useDateRangeSelection,
|
|
3749
|
+
Mn as useMultiDateSelection,
|
|
3750
|
+
yn as useSingleDateSelection,
|
|
3751
|
+
kn as useSingleWeekSelection
|
|
3734
3752
|
};
|
|
3735
3753
|
//# sourceMappingURL=index.es.js.map
|