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