@cagatayfdn/flora-components 0.0.164 → 0.0.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ReactToastify.css +1 -1
- package/dist/components/Datepicker/Datepicker.js +973 -806
- package/dist/index.d.mts +163 -0
- package/dist/index.d.ts +163 -0
- package/dist/index.js +108 -95
- package/dist/utils/http/createFetchClient.js +76 -0
- package/dist/utils/http/errors.js +41 -0
- package/dist/utils/http/helpers.js +100 -0
- package/dist/utils/http/index.js +15 -0
- package/dist/utils/http/interceptorManager.js +31 -0
- package/dist/utils/http/types.js +1 -0
- package/dist/utils/index.js +41 -28
- package/package.json +50 -44
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import { getCurrentLanguage as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { c as
|
|
8
|
-
import '../../Datepicker.css';
|
|
1
|
+
import { j as ke } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
+
import Pn, { useRef as Ue, useEffect as qe } from "react";
|
|
3
|
+
import { getCurrentLanguage as Yn } from "../../utils/language.js";
|
|
4
|
+
import Q, { SERVER_DATE_FORMAT as me, SERVER_DATE_AND_TIME_FORMAT as Hn, friendlyDate as Ln, CLIENT_DATE_SHORT_FORMAT as Ge, CLIENT_DATE_AND_TIME_FORMAT as jn, CLIENT_DATE_AND_TIME_SHORT_FORMAT as Rn, CLIENT_TIME_FORMAT as Wn } from "../../utils/date.js";
|
|
5
|
+
import Kn from "../Icon/index.js";
|
|
6
|
+
import Jn from "../Input/Input.js";
|
|
7
|
+
import { c as Xe } from "../../_commonjsHelpers-CT_km90n.js";
|
|
8
|
+
import '../../Datepicker.css';var Te = [
|
|
9
9
|
"onChange",
|
|
10
10
|
"onClose",
|
|
11
11
|
"onDayCreate",
|
|
@@ -18,7 +18,7 @@ import '../../Datepicker.css';const Ee = [
|
|
|
18
18
|
"onValueUpdate",
|
|
19
19
|
"onYearChange",
|
|
20
20
|
"onPreCalendarPosition"
|
|
21
|
-
],
|
|
21
|
+
], X = {
|
|
22
22
|
_disable: [],
|
|
23
23
|
allowInput: !1,
|
|
24
24
|
allowInvalidPreload: !1,
|
|
@@ -39,12 +39,14 @@ import '../../Datepicker.css';const Ee = [
|
|
|
39
39
|
disableMobile: !1,
|
|
40
40
|
enableSeconds: !1,
|
|
41
41
|
enableTime: !1,
|
|
42
|
-
errorHandler: (a)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
42
|
+
errorHandler: function(a) {
|
|
43
|
+
return typeof console < "u" && console.warn(a);
|
|
44
|
+
},
|
|
45
|
+
getWeek: function(a) {
|
|
46
|
+
var r = new Date(a.getTime());
|
|
47
|
+
r.setHours(0, 0, 0, 0), r.setDate(r.getDate() + 3 - (r.getDay() + 6) % 7);
|
|
48
|
+
var e = new Date(r.getFullYear(), 0, 4);
|
|
49
|
+
return 1 + Math.round(((r.getTime() - e.getTime()) / 864e5 - 3 + (e.getDay() + 6) % 7) / 7);
|
|
48
50
|
},
|
|
49
51
|
hourIncrement: 1,
|
|
50
52
|
ignoredFocusElements: [],
|
|
@@ -78,7 +80,7 @@ import '../../Datepicker.css';const Ee = [
|
|
|
78
80
|
time_24hr: !1,
|
|
79
81
|
weekNumbers: !1,
|
|
80
82
|
wrap: !1
|
|
81
|
-
},
|
|
83
|
+
}, re = {
|
|
82
84
|
weekdays: {
|
|
83
85
|
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
84
86
|
longhand: [
|
|
@@ -123,11 +125,11 @@ import '../../Datepicker.css';const Ee = [
|
|
|
123
125
|
},
|
|
124
126
|
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
125
127
|
firstDayOfWeek: 0,
|
|
126
|
-
ordinal: (a)
|
|
127
|
-
|
|
128
|
-
if (
|
|
128
|
+
ordinal: function(a) {
|
|
129
|
+
var r = a % 100;
|
|
130
|
+
if (r > 3 && r < 21)
|
|
129
131
|
return "th";
|
|
130
|
-
switch (
|
|
132
|
+
switch (r % 10) {
|
|
131
133
|
case 1:
|
|
132
134
|
return "st";
|
|
133
135
|
case 2:
|
|
@@ -148,115 +150,136 @@ import '../../Datepicker.css';const Ee = [
|
|
|
148
150
|
hourAriaLabel: "Hour",
|
|
149
151
|
minuteAriaLabel: "Minute",
|
|
150
152
|
time_24hr: !1
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
}, S = function(a, r) {
|
|
154
|
+
return r === void 0 && (r = 2), ("000" + a).slice(r * -1);
|
|
155
|
+
}, Y = function(a) {
|
|
156
|
+
return a === !0 ? 1 : 0;
|
|
157
|
+
};
|
|
158
|
+
function $e(a, r) {
|
|
159
|
+
var e;
|
|
154
160
|
return function() {
|
|
155
|
-
|
|
161
|
+
var c = this, g = arguments;
|
|
162
|
+
clearTimeout(e), e = setTimeout(function() {
|
|
163
|
+
return a.apply(c, g);
|
|
164
|
+
}, r);
|
|
156
165
|
};
|
|
157
166
|
}
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
var _e = function(a) {
|
|
168
|
+
return a instanceof Array ? a : [a];
|
|
169
|
+
};
|
|
170
|
+
function _(a, r, e) {
|
|
160
171
|
if (e === !0)
|
|
161
|
-
return a.classList.add(
|
|
162
|
-
a.classList.remove(
|
|
172
|
+
return a.classList.add(r);
|
|
173
|
+
a.classList.remove(r);
|
|
163
174
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
return
|
|
175
|
+
function D(a, r, e) {
|
|
176
|
+
var c = window.document.createElement(a);
|
|
177
|
+
return r = r || "", e = e || "", c.className = r, e !== void 0 && (c.textContent = e), c;
|
|
167
178
|
}
|
|
168
|
-
function
|
|
179
|
+
function ge(a) {
|
|
169
180
|
for (; a.firstChild; )
|
|
170
181
|
a.removeChild(a.firstChild);
|
|
171
182
|
}
|
|
172
|
-
function
|
|
173
|
-
if (
|
|
183
|
+
function en(a, r) {
|
|
184
|
+
if (r(a))
|
|
174
185
|
return a;
|
|
175
186
|
if (a.parentNode)
|
|
176
|
-
return
|
|
187
|
+
return en(a.parentNode, r);
|
|
177
188
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ?
|
|
181
|
-
for (
|
|
182
|
-
|
|
183
|
-
return e.appendChild(
|
|
189
|
+
function pe(a, r) {
|
|
190
|
+
var e = D("div", "numInputWrapper"), c = D("input", "numInput " + a), g = D("span", "arrowUp"), d = D("span", "arrowDown");
|
|
191
|
+
if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ? c.type = "number" : (c.type = "text", c.pattern = "\\d*"), r !== void 0)
|
|
192
|
+
for (var b in r)
|
|
193
|
+
c.setAttribute(b, r[b]);
|
|
194
|
+
return e.appendChild(c), e.appendChild(g), e.appendChild(d), e;
|
|
184
195
|
}
|
|
185
|
-
function
|
|
196
|
+
function N(a) {
|
|
186
197
|
try {
|
|
187
|
-
|
|
198
|
+
if (typeof a.composedPath == "function") {
|
|
199
|
+
var r = a.composedPath();
|
|
200
|
+
return r[0];
|
|
201
|
+
}
|
|
202
|
+
return a.target;
|
|
188
203
|
} catch {
|
|
189
204
|
return a.target;
|
|
190
205
|
}
|
|
191
206
|
}
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
207
|
+
var Se = function() {
|
|
208
|
+
}, he = function(a, r, e) {
|
|
209
|
+
return e.months[r ? "shorthand" : "longhand"][a];
|
|
210
|
+
}, Bn = {
|
|
211
|
+
D: Se,
|
|
212
|
+
F: function(a, r, e) {
|
|
213
|
+
a.setMonth(e.months.longhand.indexOf(r));
|
|
214
|
+
},
|
|
215
|
+
G: function(a, r) {
|
|
216
|
+
a.setHours((a.getHours() >= 12 ? 12 : 0) + parseFloat(r));
|
|
217
|
+
},
|
|
218
|
+
H: function(a, r) {
|
|
219
|
+
a.setHours(parseFloat(r));
|
|
220
|
+
},
|
|
221
|
+
J: function(a, r) {
|
|
222
|
+
a.setDate(parseFloat(r));
|
|
197
223
|
},
|
|
198
|
-
|
|
199
|
-
a.setHours(
|
|
224
|
+
K: function(a, r, e) {
|
|
225
|
+
a.setHours(a.getHours() % 12 + 12 * Y(new RegExp(e.amPM[1], "i").test(r)));
|
|
200
226
|
},
|
|
201
|
-
|
|
202
|
-
a.
|
|
227
|
+
M: function(a, r, e) {
|
|
228
|
+
a.setMonth(e.months.shorthand.indexOf(r));
|
|
203
229
|
},
|
|
204
|
-
|
|
205
|
-
a.
|
|
230
|
+
S: function(a, r) {
|
|
231
|
+
a.setSeconds(parseFloat(r));
|
|
206
232
|
},
|
|
207
|
-
|
|
208
|
-
|
|
233
|
+
U: function(a, r) {
|
|
234
|
+
return new Date(parseFloat(r) * 1e3);
|
|
209
235
|
},
|
|
210
|
-
|
|
211
|
-
a.
|
|
236
|
+
W: function(a, r, e) {
|
|
237
|
+
var c = parseInt(r), g = new Date(a.getFullYear(), 0, 2 + (c - 1) * 7, 0, 0, 0, 0);
|
|
238
|
+
return g.setDate(g.getDate() - g.getDay() + e.firstDayOfWeek), g;
|
|
212
239
|
},
|
|
213
|
-
|
|
214
|
-
a.
|
|
240
|
+
Y: function(a, r) {
|
|
241
|
+
a.setFullYear(parseFloat(r));
|
|
215
242
|
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const f = parseInt(o), m = new Date(a.getFullYear(), 0, 2 + (f - 1) * 7, 0, 0, 0, 0);
|
|
219
|
-
return m.setDate(m.getDate() - m.getDay() + e.firstDayOfWeek), m;
|
|
243
|
+
Z: function(a, r) {
|
|
244
|
+
return new Date(r);
|
|
220
245
|
},
|
|
221
|
-
|
|
222
|
-
a.
|
|
246
|
+
d: function(a, r) {
|
|
247
|
+
a.setDate(parseFloat(r));
|
|
223
248
|
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
a.setDate(parseFloat(o));
|
|
249
|
+
h: function(a, r) {
|
|
250
|
+
a.setHours((a.getHours() >= 12 ? 12 : 0) + parseFloat(r));
|
|
227
251
|
},
|
|
228
|
-
|
|
229
|
-
a.
|
|
252
|
+
i: function(a, r) {
|
|
253
|
+
a.setMinutes(parseFloat(r));
|
|
230
254
|
},
|
|
231
|
-
|
|
232
|
-
a.
|
|
255
|
+
j: function(a, r) {
|
|
256
|
+
a.setDate(parseFloat(r));
|
|
233
257
|
},
|
|
234
|
-
|
|
235
|
-
|
|
258
|
+
l: Se,
|
|
259
|
+
m: function(a, r) {
|
|
260
|
+
a.setMonth(parseFloat(r) - 1);
|
|
236
261
|
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
a.setMonth(parseFloat(o) - 1);
|
|
262
|
+
n: function(a, r) {
|
|
263
|
+
a.setMonth(parseFloat(r) - 1);
|
|
240
264
|
},
|
|
241
|
-
|
|
242
|
-
a.
|
|
265
|
+
s: function(a, r) {
|
|
266
|
+
a.setSeconds(parseFloat(r));
|
|
243
267
|
},
|
|
244
|
-
|
|
245
|
-
|
|
268
|
+
u: function(a, r) {
|
|
269
|
+
return new Date(parseFloat(r));
|
|
246
270
|
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
F: "(\\w+)",
|
|
271
|
+
w: Se,
|
|
272
|
+
y: function(a, r) {
|
|
273
|
+
a.setFullYear(2e3 + parseFloat(r));
|
|
274
|
+
}
|
|
275
|
+
}, z = {
|
|
276
|
+
D: "",
|
|
277
|
+
F: "",
|
|
255
278
|
G: "(\\d\\d|\\d)",
|
|
256
279
|
H: "(\\d\\d|\\d)",
|
|
257
280
|
J: "(\\d\\d|\\d)\\w+",
|
|
258
281
|
K: "",
|
|
259
|
-
M: "
|
|
282
|
+
M: "",
|
|
260
283
|
S: "(\\d\\d|\\d)",
|
|
261
284
|
U: "(.+)",
|
|
262
285
|
W: "(\\d\\d|\\d)",
|
|
@@ -266,448 +289,531 @@ const Te = () => {
|
|
|
266
289
|
h: "(\\d\\d|\\d)",
|
|
267
290
|
i: "(\\d\\d|\\d)",
|
|
268
291
|
j: "(\\d\\d|\\d)",
|
|
269
|
-
l: "
|
|
292
|
+
l: "",
|
|
270
293
|
m: "(\\d\\d|\\d)",
|
|
271
294
|
n: "(\\d\\d|\\d)",
|
|
272
295
|
s: "(\\d\\d|\\d)",
|
|
273
296
|
u: "(.+)",
|
|
274
297
|
w: "(\\d\\d|\\d)",
|
|
275
298
|
y: "(\\d{2})"
|
|
276
|
-
},
|
|
277
|
-
Z: (a)
|
|
278
|
-
|
|
279
|
-
|
|
299
|
+
}, ie = {
|
|
300
|
+
Z: function(a) {
|
|
301
|
+
return a.toISOString();
|
|
302
|
+
},
|
|
303
|
+
D: function(a, r, e) {
|
|
304
|
+
return r.weekdays.shorthand[ie.w(a, r, e)];
|
|
305
|
+
},
|
|
306
|
+
F: function(a, r, e) {
|
|
307
|
+
return he(ie.n(a, r, e) - 1, !1, r);
|
|
308
|
+
},
|
|
309
|
+
G: function(a, r, e) {
|
|
310
|
+
return S(ie.h(a, r, e));
|
|
280
311
|
},
|
|
281
|
-
|
|
282
|
-
return
|
|
312
|
+
H: function(a) {
|
|
313
|
+
return S(a.getHours());
|
|
283
314
|
},
|
|
284
|
-
|
|
285
|
-
return
|
|
315
|
+
J: function(a, r) {
|
|
316
|
+
return r.ordinal !== void 0 ? a.getDate() + r.ordinal(a.getDate()) : a.getDate();
|
|
286
317
|
},
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return o.ordinal !== void 0 ? a.getDate() + o.ordinal(a.getDate()) : a.getDate();
|
|
318
|
+
K: function(a, r) {
|
|
319
|
+
return r.amPM[Y(a.getHours() > 11)];
|
|
290
320
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return ue(a.getMonth(), !0, o);
|
|
321
|
+
M: function(a, r) {
|
|
322
|
+
return he(a.getMonth(), !0, r);
|
|
294
323
|
},
|
|
295
|
-
S: (a)
|
|
296
|
-
|
|
297
|
-
|
|
324
|
+
S: function(a) {
|
|
325
|
+
return S(a.getSeconds());
|
|
326
|
+
},
|
|
327
|
+
U: function(a) {
|
|
328
|
+
return a.getTime() / 1e3;
|
|
329
|
+
},
|
|
330
|
+
W: function(a, r, e) {
|
|
298
331
|
return e.getWeek(a);
|
|
299
332
|
},
|
|
300
|
-
Y: (a)
|
|
301
|
-
|
|
302
|
-
h: (a) => a.getHours() % 12 ? a.getHours() % 12 : 12,
|
|
303
|
-
i: (a) => T(a.getMinutes()),
|
|
304
|
-
j: (a) => a.getDate(),
|
|
305
|
-
l: function(a, o) {
|
|
306
|
-
return o.weekdays.longhand[a.getDay()];
|
|
333
|
+
Y: function(a) {
|
|
334
|
+
return S(a.getFullYear(), 4);
|
|
307
335
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
336
|
+
d: function(a) {
|
|
337
|
+
return S(a.getDate());
|
|
338
|
+
},
|
|
339
|
+
h: function(a) {
|
|
340
|
+
return a.getHours() % 12 ? a.getHours() % 12 : 12;
|
|
341
|
+
},
|
|
342
|
+
i: function(a) {
|
|
343
|
+
return S(a.getMinutes());
|
|
344
|
+
},
|
|
345
|
+
j: function(a) {
|
|
346
|
+
return a.getDate();
|
|
347
|
+
},
|
|
348
|
+
l: function(a, r) {
|
|
349
|
+
return r.weekdays.longhand[a.getDay()];
|
|
350
|
+
},
|
|
351
|
+
m: function(a) {
|
|
352
|
+
return S(a.getMonth() + 1);
|
|
353
|
+
},
|
|
354
|
+
n: function(a) {
|
|
355
|
+
return a.getMonth() + 1;
|
|
356
|
+
},
|
|
357
|
+
s: function(a) {
|
|
358
|
+
return a.getSeconds();
|
|
359
|
+
},
|
|
360
|
+
u: function(a) {
|
|
361
|
+
return a.getTime();
|
|
362
|
+
},
|
|
363
|
+
w: function(a) {
|
|
364
|
+
return a.getDay();
|
|
365
|
+
},
|
|
366
|
+
y: function(a) {
|
|
367
|
+
return String(a.getFullYear()).substring(2);
|
|
368
|
+
}
|
|
369
|
+
}, nn = function(a) {
|
|
370
|
+
var r = a.config, e = r === void 0 ? X : r, c = a.l10n, g = c === void 0 ? re : c, d = a.isMobile, b = d === void 0 ? !1 : d;
|
|
371
|
+
return function(w, x, W) {
|
|
372
|
+
var y = W || g;
|
|
373
|
+
return e.formatDate !== void 0 && !b ? e.formatDate(w, x, y) : x.split("").map(function(I, A, O) {
|
|
374
|
+
return ie[I] && O[A - 1] !== "\\" ? ie[I](w, y, e) : I !== "\\" ? I : "";
|
|
375
|
+
}).join("");
|
|
376
|
+
};
|
|
377
|
+
}, Oe = function(a) {
|
|
378
|
+
var r = a.config, e = r === void 0 ? X : r, c = a.l10n, g = c === void 0 ? re : c;
|
|
379
|
+
return function(d, b, w, x) {
|
|
380
|
+
if (!(d !== 0 && !d)) {
|
|
381
|
+
var W = x || g, y, I = d;
|
|
382
|
+
if (d instanceof Date)
|
|
383
|
+
y = new Date(d.getTime());
|
|
384
|
+
else if (typeof d != "string" && d.toFixed !== void 0)
|
|
385
|
+
y = new Date(d);
|
|
386
|
+
else if (typeof d == "string") {
|
|
387
|
+
var A = b || (e || X).dateFormat, O = String(d).trim();
|
|
388
|
+
if (O === "today")
|
|
389
|
+
y = /* @__PURE__ */ new Date(), w = !0;
|
|
390
|
+
else if (e && e.parseDate)
|
|
391
|
+
y = e.parseDate(d, A);
|
|
392
|
+
else if (/Z$/.test(O) || /GMT$/.test(O))
|
|
393
|
+
y = new Date(d);
|
|
394
|
+
else {
|
|
395
|
+
for (var H = void 0, v = [], j = 0, V = 0, E = ""; j < A.length; j++) {
|
|
396
|
+
var K = A[j], U = K === "\\", ve = A[j - 1] === "\\" || U;
|
|
397
|
+
if (z[K] && !ve) {
|
|
398
|
+
E += z[K];
|
|
399
|
+
var J = new RegExp(E).exec(d);
|
|
400
|
+
J && (H = !0) && v[K !== "Y" ? "push" : "unshift"]({
|
|
401
|
+
fn: Bn[K],
|
|
402
|
+
val: J[++V]
|
|
403
|
+
});
|
|
404
|
+
} else
|
|
405
|
+
U || (E += ".");
|
|
406
|
+
}
|
|
407
|
+
y = !e || !e.noCalendar ? new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1, 0, 0, 0, 0) : new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), v.forEach(function(q) {
|
|
408
|
+
var G = q.fn, De = q.val;
|
|
409
|
+
return y = G(y, De, W) || y;
|
|
410
|
+
}), y = H ? y : void 0;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (!(y instanceof Date && !isNaN(y.getTime()))) {
|
|
414
|
+
e.errorHandler(new Error("Invalid date provided: " + I));
|
|
415
|
+
return;
|
|
350
416
|
}
|
|
351
|
-
|
|
417
|
+
return w === !0 && y.setHours(0, 0, 0, 0), y;
|
|
352
418
|
}
|
|
353
|
-
}
|
|
354
|
-
if (!(D instanceof Date && !isNaN(D.getTime()))) {
|
|
355
|
-
a.errorHandler(new Error(`Invalid date provided: ${L}`));
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
return m === !0 && D.setHours(0, 0, 0, 0), D;
|
|
419
|
+
};
|
|
359
420
|
};
|
|
360
|
-
function
|
|
361
|
-
return e !== !1 ? new Date(a.getTime()).setHours(0, 0, 0, 0) - new Date(
|
|
421
|
+
function P(a, r, e) {
|
|
422
|
+
return e === void 0 && (e = !0), e !== !1 ? new Date(a.getTime()).setHours(0, 0, 0, 0) - new Date(r.getTime()).setHours(0, 0, 0, 0) : a.getTime() - r.getTime();
|
|
362
423
|
}
|
|
363
|
-
|
|
424
|
+
var zn = function(a, r, e) {
|
|
425
|
+
return a > Math.min(r, e) && a < Math.max(r, e);
|
|
426
|
+
}, Ie = function(a, r, e) {
|
|
427
|
+
return a * 3600 + r * 60 + e;
|
|
428
|
+
}, Vn = function(a) {
|
|
429
|
+
var r = Math.floor(a / 3600), e = (a - r * 3600) / 60;
|
|
430
|
+
return [r, e, a - r * 3600 - e * 60];
|
|
431
|
+
}, Un = {
|
|
364
432
|
DAY: 864e5
|
|
365
433
|
};
|
|
366
|
-
function
|
|
367
|
-
|
|
434
|
+
function Ae(a) {
|
|
435
|
+
var r = a.defaultHour, e = a.defaultMinute, c = a.defaultSeconds;
|
|
368
436
|
if (a.minDate !== void 0) {
|
|
369
|
-
|
|
370
|
-
|
|
437
|
+
var g = a.minDate.getHours(), d = a.minDate.getMinutes(), b = a.minDate.getSeconds();
|
|
438
|
+
r < g && (r = g), r === g && e < d && (e = d), r === g && e === d && c < b && (c = a.minDate.getSeconds());
|
|
371
439
|
}
|
|
372
440
|
if (a.maxDate !== void 0) {
|
|
373
|
-
|
|
374
|
-
|
|
441
|
+
var w = a.maxDate.getHours(), x = a.maxDate.getMinutes();
|
|
442
|
+
r = Math.min(r, w), r === w && (e = Math.min(x, e)), r === w && e === x && (c = a.maxDate.getSeconds());
|
|
375
443
|
}
|
|
376
|
-
return { hours:
|
|
444
|
+
return { hours: r, minutes: e, seconds: c };
|
|
377
445
|
}
|
|
378
|
-
typeof Object.assign != "function" && (Object.assign = function(a
|
|
446
|
+
typeof Object.assign != "function" && (Object.assign = function(a) {
|
|
447
|
+
for (var r = [], e = 1; e < arguments.length; e++)
|
|
448
|
+
r[e - 1] = arguments[e];
|
|
379
449
|
if (!a)
|
|
380
450
|
throw TypeError("Cannot convert undefined or null to object");
|
|
381
|
-
for (
|
|
382
|
-
|
|
451
|
+
for (var c = function(w) {
|
|
452
|
+
w && Object.keys(w).forEach(function(x) {
|
|
453
|
+
return a[x] = w[x];
|
|
454
|
+
});
|
|
455
|
+
}, g = 0, d = r; g < d.length; g++) {
|
|
456
|
+
var b = d[g];
|
|
457
|
+
c(b);
|
|
458
|
+
}
|
|
383
459
|
return a;
|
|
384
460
|
});
|
|
385
|
-
|
|
386
|
-
function
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
461
|
+
var T = function() {
|
|
462
|
+
return T = Object.assign || function(a) {
|
|
463
|
+
for (var r, e = 1, c = arguments.length; e < c; e++) {
|
|
464
|
+
r = arguments[e];
|
|
465
|
+
for (var g in r)
|
|
466
|
+
Object.prototype.hasOwnProperty.call(r, g) && (a[g] = r[g]);
|
|
467
|
+
}
|
|
468
|
+
return a;
|
|
469
|
+
}, T.apply(this, arguments);
|
|
470
|
+
}, Ze = function() {
|
|
471
|
+
for (var a = 0, r = 0, e = arguments.length; r < e; r++)
|
|
472
|
+
a += arguments[r].length;
|
|
473
|
+
for (var c = Array(a), g = 0, r = 0; r < e; r++)
|
|
474
|
+
for (var d = arguments[r], b = 0, w = d.length; b < w; b++, g++)
|
|
475
|
+
c[g] = d[b];
|
|
476
|
+
return c;
|
|
477
|
+
}, qn = 300;
|
|
478
|
+
function Gn(a, r) {
|
|
479
|
+
var e = {
|
|
480
|
+
config: T(T({}, X), k.defaultConfig),
|
|
481
|
+
l10n: re
|
|
390
482
|
};
|
|
391
|
-
e.parseDate =
|
|
392
|
-
function
|
|
483
|
+
e.parseDate = Oe({ config: e.config, l10n: e.l10n }), e._handlers = [], e.pluginElements = [], e.loadedPlugins = [], e._bind = v, e._setHoursFromDate = A, e._positionCalendar = se, e.changeMonth = Me, e.changeYear = le, e.clear = un, e.close = fn, e.onMouseOver = fe, e._createElement = D, e.createDay = J, e.destroy = sn, e.isEnabled = B, e.jumpToDate = E, e.updateValue = R, e.open = mn, e.redraw = Ke, e.set = vn, e.setDate = Dn, e.toggle = yn;
|
|
484
|
+
function c() {
|
|
393
485
|
e.utils = {
|
|
394
|
-
getDaysInMonth(
|
|
395
|
-
return t ===
|
|
486
|
+
getDaysInMonth: function(n, t) {
|
|
487
|
+
return n === void 0 && (n = e.currentMonth), t === void 0 && (t = e.currentYear), n === 1 && (t % 4 === 0 && t % 100 !== 0 || t % 400 === 0) ? 29 : e.l10n.daysInMonth[n];
|
|
396
488
|
}
|
|
397
489
|
};
|
|
398
490
|
}
|
|
399
|
-
function
|
|
400
|
-
e.element = e.input = a, e.isOpen = !1,
|
|
401
|
-
|
|
402
|
-
!e.isMobile &&
|
|
491
|
+
function g() {
|
|
492
|
+
e.element = e.input = a, e.isOpen = !1, gn(), We(), bn(), Mn(), c(), e.isMobile || ve(), V(), (e.selectedDates.length || e.config.noCalendar) && (e.config.enableTime && A(e.config.noCalendar ? e.latestSelectedDateObj : void 0), R(!1)), w();
|
|
493
|
+
var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
494
|
+
!e.isMobile && n && se(), C("onReady");
|
|
495
|
+
}
|
|
496
|
+
function d() {
|
|
497
|
+
var n;
|
|
498
|
+
return ((n = e.calendarContainer) === null || n === void 0 ? void 0 : n.getRootNode()).activeElement || document.activeElement;
|
|
403
499
|
}
|
|
404
|
-
function
|
|
405
|
-
return
|
|
500
|
+
function b(n) {
|
|
501
|
+
return n.bind(e);
|
|
406
502
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
|
|
503
|
+
function w() {
|
|
504
|
+
var n = e.config;
|
|
505
|
+
n.weekNumbers === !1 && n.showMonths === 1 || n.noCalendar !== !0 && window.requestAnimationFrame(function() {
|
|
410
506
|
if (e.calendarContainer !== void 0 && (e.calendarContainer.style.visibility = "hidden", e.calendarContainer.style.display = "block"), e.daysContainer !== void 0) {
|
|
411
|
-
|
|
412
|
-
e.daysContainer.style.width =
|
|
507
|
+
var t = (e.days.offsetWidth + 1) * n.showMonths;
|
|
508
|
+
e.daysContainer.style.width = t + "px", e.calendarContainer.style.width = t + (e.weekWrapper !== void 0 ? e.weekWrapper.offsetWidth : 0) + "px", e.calendarContainer.style.removeProperty("visibility"), e.calendarContainer.style.removeProperty("display");
|
|
413
509
|
}
|
|
414
510
|
});
|
|
415
511
|
}
|
|
416
|
-
function
|
|
512
|
+
function x(n) {
|
|
417
513
|
if (e.selectedDates.length === 0) {
|
|
418
|
-
|
|
419
|
-
|
|
514
|
+
var t = e.config.minDate === void 0 || P(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i = Ae(e.config);
|
|
515
|
+
t.setHours(i.hours, i.minutes, i.seconds, t.getMilliseconds()), e.selectedDates = [t], e.latestSelectedDateObj = t;
|
|
420
516
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
517
|
+
n !== void 0 && n.type !== "blur" && xn(n);
|
|
518
|
+
var o = e._input.value;
|
|
519
|
+
I(), R(), e._input.value !== o && e._debouncedChange();
|
|
424
520
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
521
|
+
function W(n, t) {
|
|
522
|
+
return n % 12 + 12 * Y(t === e.l10n.amPM[1]);
|
|
427
523
|
}
|
|
428
|
-
function
|
|
429
|
-
switch (
|
|
524
|
+
function y(n) {
|
|
525
|
+
switch (n % 24) {
|
|
430
526
|
case 0:
|
|
431
527
|
case 12:
|
|
432
528
|
return 12;
|
|
433
529
|
default:
|
|
434
|
-
return
|
|
530
|
+
return n % 12;
|
|
435
531
|
}
|
|
436
532
|
}
|
|
437
|
-
function
|
|
438
|
-
if (e.hourElement === void 0 || e.minuteElement === void 0)
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
533
|
+
function I() {
|
|
534
|
+
if (!(e.hourElement === void 0 || e.minuteElement === void 0)) {
|
|
535
|
+
var n = (parseInt(e.hourElement.value.slice(-2), 10) || 0) % 24, t = (parseInt(e.minuteElement.value, 10) || 0) % 60, i = e.secondElement !== void 0 ? (parseInt(e.secondElement.value, 10) || 0) % 60 : 0;
|
|
536
|
+
e.amPM !== void 0 && (n = W(n, e.amPM.textContent));
|
|
537
|
+
var o = e.config.minTime !== void 0 || e.config.minDate && e.minDateHasTime && e.latestSelectedDateObj && P(e.latestSelectedDateObj, e.config.minDate, !0) === 0, l = e.config.maxTime !== void 0 || e.config.maxDate && e.maxDateHasTime && e.latestSelectedDateObj && P(e.latestSelectedDateObj, e.config.maxDate, !0) === 0;
|
|
538
|
+
if (e.config.maxTime !== void 0 && e.config.minTime !== void 0 && e.config.minTime > e.config.maxTime) {
|
|
539
|
+
var u = Ie(e.config.minTime.getHours(), e.config.minTime.getMinutes(), e.config.minTime.getSeconds()), p = Ie(e.config.maxTime.getHours(), e.config.maxTime.getMinutes(), e.config.maxTime.getSeconds()), s = Ie(n, t, i);
|
|
540
|
+
if (s > p && s < u) {
|
|
541
|
+
var h = Vn(u);
|
|
542
|
+
n = h[0], t = h[1], i = h[2];
|
|
543
|
+
}
|
|
544
|
+
} else {
|
|
545
|
+
if (l) {
|
|
546
|
+
var f = e.config.maxTime !== void 0 ? e.config.maxTime : e.config.maxDate;
|
|
547
|
+
n = Math.min(n, f.getHours()), n === f.getHours() && (t = Math.min(t, f.getMinutes())), t === f.getMinutes() && (i = Math.min(i, f.getSeconds()));
|
|
548
|
+
}
|
|
549
|
+
if (o) {
|
|
550
|
+
var m = e.config.minTime !== void 0 ? e.config.minTime : e.config.minDate;
|
|
551
|
+
n = Math.max(n, m.getHours()), n === m.getHours() && t < m.getMinutes() && (t = m.getMinutes()), t === m.getMinutes() && (i = Math.max(i, m.getSeconds()));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
O(n, t, i);
|
|
450
555
|
}
|
|
451
|
-
R(t, n, i);
|
|
452
556
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
455
|
-
|
|
557
|
+
function A(n) {
|
|
558
|
+
var t = n || e.latestSelectedDateObj;
|
|
559
|
+
t && t instanceof Date && O(t.getHours(), t.getMinutes(), t.getSeconds());
|
|
456
560
|
}
|
|
457
|
-
function
|
|
458
|
-
e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(
|
|
561
|
+
function O(n, t, i) {
|
|
562
|
+
e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(n % 24, t, i || 0, 0), !(!e.hourElement || !e.minuteElement || e.isMobile) && (e.hourElement.value = S(e.config.time_24hr ? n : (12 + n) % 12 + 12 * Y(n % 12 === 0)), e.minuteElement.value = S(t), e.amPM !== void 0 && (e.amPM.textContent = e.l10n.amPM[Y(n >= 12)]), e.secondElement !== void 0 && (e.secondElement.value = S(i)));
|
|
459
563
|
}
|
|
460
|
-
function
|
|
461
|
-
|
|
462
|
-
(i / 1e3 > 1 ||
|
|
564
|
+
function H(n) {
|
|
565
|
+
var t = N(n), i = parseInt(t.value) + (n.delta || 0);
|
|
566
|
+
(i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) && le(i);
|
|
463
567
|
}
|
|
464
|
-
function
|
|
465
|
-
if (n instanceof Array)
|
|
466
|
-
return n.forEach((l) => p(t, l, i, r));
|
|
568
|
+
function v(n, t, i, o) {
|
|
467
569
|
if (t instanceof Array)
|
|
468
|
-
return t.forEach((l)
|
|
469
|
-
|
|
470
|
-
|
|
570
|
+
return t.forEach(function(l) {
|
|
571
|
+
return v(n, l, i, o);
|
|
572
|
+
});
|
|
573
|
+
if (n instanceof Array)
|
|
574
|
+
return n.forEach(function(l) {
|
|
575
|
+
return v(l, t, i, o);
|
|
576
|
+
});
|
|
577
|
+
n.addEventListener(t, i, o), e._handlers.push({
|
|
578
|
+
remove: function() {
|
|
579
|
+
return n.removeEventListener(t, i, o);
|
|
580
|
+
}
|
|
471
581
|
});
|
|
472
582
|
}
|
|
473
583
|
function j() {
|
|
474
|
-
|
|
584
|
+
C("onChange");
|
|
475
585
|
}
|
|
476
|
-
function
|
|
477
|
-
if (e.config.wrap && ["open", "close", "toggle", "clear"].forEach((
|
|
478
|
-
Array.prototype.forEach.call(e.element.querySelectorAll(
|
|
586
|
+
function V() {
|
|
587
|
+
if (e.config.wrap && ["open", "close", "toggle", "clear"].forEach(function(i) {
|
|
588
|
+
Array.prototype.forEach.call(e.element.querySelectorAll("[data-" + i + "]"), function(o) {
|
|
589
|
+
return v(o, "click", e[i]);
|
|
590
|
+
});
|
|
479
591
|
}), e.isMobile) {
|
|
480
|
-
|
|
592
|
+
wn();
|
|
481
593
|
return;
|
|
482
594
|
}
|
|
483
|
-
|
|
484
|
-
if (e._debouncedChange =
|
|
485
|
-
e.config.mode === "range" &&
|
|
486
|
-
}),
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
595
|
+
var n = $e(dn, 50);
|
|
596
|
+
if (e._debouncedChange = $e(j, qn), e.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && v(e.daysContainer, "mouseover", function(i) {
|
|
597
|
+
e.config.mode === "range" && fe(N(i));
|
|
598
|
+
}), v(e._input, "keydown", Le), e.calendarContainer !== void 0 && v(e.calendarContainer, "keydown", Le), !e.config.inline && !e.config.static && v(window, "resize", n), window.ontouchstart !== void 0 ? v(window.document, "touchstart", be) : v(window.document, "mousedown", be), v(window.document, "focus", be, { capture: !0 }), e.config.clickOpens === !0 && (v(e._input, "focus", e.open), v(e._input, "click", e.open)), e.daysContainer !== void 0 && (v(e.monthNav, "click", En), v(e.monthNav, ["keyup", "increment"], H), v(e.daysContainer, "click", Je)), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0) {
|
|
599
|
+
var t = function(i) {
|
|
600
|
+
return N(i).select();
|
|
601
|
+
};
|
|
602
|
+
v(e.timeContainer, ["increment"], x), v(e.timeContainer, "blur", x, { capture: !0 }), v(e.timeContainer, "click", K), v([e.hourElement, e.minuteElement], ["focus", "click"], t), e.secondElement !== void 0 && v(e.secondElement, "focus", function() {
|
|
603
|
+
return e.secondElement && e.secondElement.select();
|
|
604
|
+
}), e.amPM !== void 0 && v(e.amPM, "click", function(i) {
|
|
605
|
+
x(i);
|
|
490
606
|
});
|
|
491
607
|
}
|
|
492
|
-
e.config.allowInput &&
|
|
608
|
+
e.config.allowInput && v(e._input, "blur", cn);
|
|
493
609
|
}
|
|
494
|
-
function
|
|
495
|
-
|
|
610
|
+
function E(n, t) {
|
|
611
|
+
var i = n !== void 0 ? e.parseDate(n) : e.latestSelectedDateObj || (e.config.minDate && e.config.minDate > e.now ? e.config.minDate : e.config.maxDate && e.config.maxDate < e.now ? e.config.maxDate : e.now), o = e.currentYear, l = e.currentMonth;
|
|
496
612
|
try {
|
|
497
613
|
i !== void 0 && (e.currentYear = i.getFullYear(), e.currentMonth = i.getMonth());
|
|
498
|
-
} catch (
|
|
499
|
-
|
|
614
|
+
} catch (u) {
|
|
615
|
+
u.message = "Invalid date supplied: " + i, e.config.errorHandler(u);
|
|
500
616
|
}
|
|
501
|
-
|
|
502
|
-
}
|
|
503
|
-
function
|
|
504
|
-
|
|
505
|
-
~
|
|
506
|
-
}
|
|
507
|
-
function
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
511
|
-
function
|
|
512
|
-
|
|
513
|
-
if (e.calendarContainer =
|
|
514
|
-
if (
|
|
515
|
-
|
|
516
|
-
e.innerContainer.appendChild(i), e.weekNumbers =
|
|
617
|
+
t && e.currentYear !== o && (C("onYearChange"), $()), t && (e.currentYear !== o || e.currentMonth !== l) && C("onMonthChange"), e.redraw();
|
|
618
|
+
}
|
|
619
|
+
function K(n) {
|
|
620
|
+
var t = N(n);
|
|
621
|
+
~t.className.indexOf("arrow") && U(n, t.classList.contains("arrowUp") ? 1 : -1);
|
|
622
|
+
}
|
|
623
|
+
function U(n, t, i) {
|
|
624
|
+
var o = n && N(n), l = i || o && o.parentNode && o.parentNode.firstChild, u = ye("increment");
|
|
625
|
+
u.delta = t, l && l.dispatchEvent(u);
|
|
626
|
+
}
|
|
627
|
+
function ve() {
|
|
628
|
+
var n = window.document.createDocumentFragment();
|
|
629
|
+
if (e.calendarContainer = D("div", "flatpickr-calendar"), e.calendarContainer.tabIndex = -1, !e.config.noCalendar) {
|
|
630
|
+
if (n.appendChild(rn()), e.innerContainer = D("div", "flatpickr-innerContainer"), e.config.weekNumbers) {
|
|
631
|
+
var t = ln(), i = t.weekWrapper, o = t.weekNumbers;
|
|
632
|
+
e.innerContainer.appendChild(i), e.weekNumbers = o, e.weekWrapper = i;
|
|
517
633
|
}
|
|
518
|
-
e.rContainer =
|
|
634
|
+
e.rContainer = D("div", "flatpickr-rContainer"), e.rContainer.appendChild(Ye()), e.daysContainer || (e.daysContainer = D("div", "flatpickr-days"), e.daysContainer.tabIndex = -1), oe(), e.rContainer.appendChild(e.daysContainer), e.innerContainer.appendChild(e.rContainer), n.appendChild(e.innerContainer);
|
|
519
635
|
}
|
|
520
|
-
e.config.enableTime &&
|
|
521
|
-
|
|
522
|
-
if ((e.config.inline || e.config.static) && (e.calendarContainer.classList.add(e.config.inline ? "inline" : "static"), e.config.inline && (!
|
|
523
|
-
|
|
524
|
-
e.element.parentNode && e.element.parentNode.insertBefore(
|
|
636
|
+
e.config.enableTime && n.appendChild(on()), _(e.calendarContainer, "rangeMode", e.config.mode === "range"), _(e.calendarContainer, "animate", e.config.animate === !0), _(e.calendarContainer, "multiMonth", e.config.showMonths > 1), e.calendarContainer.appendChild(n);
|
|
637
|
+
var l = e.config.appendTo !== void 0 && e.config.appendTo.nodeType !== void 0;
|
|
638
|
+
if ((e.config.inline || e.config.static) && (e.calendarContainer.classList.add(e.config.inline ? "inline" : "static"), e.config.inline && (!l && e.element.parentNode ? e.element.parentNode.insertBefore(e.calendarContainer, e._input.nextSibling) : e.config.appendTo !== void 0 && e.config.appendTo.appendChild(e.calendarContainer)), e.config.static)) {
|
|
639
|
+
var u = D("div", "flatpickr-wrapper");
|
|
640
|
+
e.element.parentNode && e.element.parentNode.insertBefore(u, e.element), u.appendChild(e.element), e.altInput && u.appendChild(e.altInput), u.appendChild(e.calendarContainer);
|
|
525
641
|
}
|
|
526
642
|
!e.config.static && !e.config.inline && (e.config.appendTo !== void 0 ? e.config.appendTo : window.document.body).appendChild(e.calendarContainer);
|
|
527
643
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
530
|
-
return
|
|
531
|
-
}
|
|
532
|
-
function
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
function
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
if (u.className.indexOf("hidden") === -1 && B(u.dateObj))
|
|
542
|
-
return u;
|
|
644
|
+
function J(n, t, i, o) {
|
|
645
|
+
var l = B(t, !0), u = D("span", n, t.getDate().toString());
|
|
646
|
+
return u.dateObj = t, u.$i = o, u.setAttribute("aria-label", e.formatDate(t, e.config.ariaDateFormat)), n.indexOf("hidden") === -1 && P(t, e.now) === 0 && (e.todayDateElem = u, u.classList.add("today"), u.setAttribute("aria-current", "date")), l ? (u.tabIndex = -1, Ce(t) && (u.classList.add("selected"), e.selectedDateElem = u, e.config.mode === "range" && (_(u, "startRange", e.selectedDates[0] && P(t, e.selectedDates[0], !0) === 0), _(u, "endRange", e.selectedDates[1] && P(t, e.selectedDates[1], !0) === 0), n === "nextMonthDay" && u.classList.add("inRange")))) : u.classList.add("flatpickr-disabled"), e.config.mode === "range" && Cn(t) && !Ce(t) && u.classList.add("inRange"), e.weekNumbers && e.config.showMonths === 1 && n !== "prevMonthDay" && o % 7 === 6 && e.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + e.config.getWeek(t) + "</span>"), C("onDayCreate", u), u;
|
|
647
|
+
}
|
|
648
|
+
function q(n) {
|
|
649
|
+
n.focus(), e.config.mode === "range" && fe(n);
|
|
650
|
+
}
|
|
651
|
+
function G(n) {
|
|
652
|
+
for (var t = n > 0 ? 0 : e.config.showMonths - 1, i = n > 0 ? e.config.showMonths : -1, o = t; o != i; o += n)
|
|
653
|
+
for (var l = e.daysContainer.children[o], u = n > 0 ? 0 : l.children.length - 1, p = n > 0 ? l.children.length : -1, s = u; s != p; s += n) {
|
|
654
|
+
var h = l.children[s];
|
|
655
|
+
if (h.className.indexOf("hidden") === -1 && B(h.dateObj))
|
|
656
|
+
return h;
|
|
543
657
|
}
|
|
544
|
-
}
|
|
545
658
|
}
|
|
546
|
-
function
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
if (M.className.indexOf("hidden") === -1 && B(M.dateObj) && Math.abs(t.$i - g) >= Math.abs(n))
|
|
553
|
-
return pe(M);
|
|
659
|
+
function De(n, t) {
|
|
660
|
+
for (var i = n.className.indexOf("Month") === -1 ? n.dateObj.getMonth() : e.currentMonth, o = t > 0 ? e.config.showMonths : -1, l = t > 0 ? 1 : -1, u = i - e.currentMonth; u != o; u += l)
|
|
661
|
+
for (var p = e.daysContainer.children[u], s = i - e.currentMonth === u ? n.$i + t : t < 0 ? p.children.length - 1 : 0, h = p.children.length, f = s; f >= 0 && f < h && f != (t > 0 ? h : -1); f += l) {
|
|
662
|
+
var m = p.children[f];
|
|
663
|
+
if (m.className.indexOf("hidden") === -1 && B(m.dateObj) && Math.abs(n.$i - f) >= Math.abs(t))
|
|
664
|
+
return q(m);
|
|
554
665
|
}
|
|
666
|
+
e.changeMonth(l), ne(G(l), 0);
|
|
667
|
+
}
|
|
668
|
+
function ne(n, t) {
|
|
669
|
+
var i = d(), o = ue(i || document.body), l = n !== void 0 ? n : o ? i : e.selectedDateElem !== void 0 && ue(e.selectedDateElem) ? e.selectedDateElem : e.todayDateElem !== void 0 && ue(e.todayDateElem) ? e.todayDateElem : G(t > 0 ? 1 : -1);
|
|
670
|
+
l === void 0 ? e._input.focus() : o ? De(l, t) : q(l);
|
|
671
|
+
}
|
|
672
|
+
function tn(n, t) {
|
|
673
|
+
for (var i = (new Date(n, t, 1).getDay() - e.l10n.firstDayOfWeek + 7) % 7, o = e.utils.getDaysInMonth((t - 1 + 12) % 12, n), l = e.utils.getDaysInMonth(t, n), u = window.document.createDocumentFragment(), p = e.config.showMonths > 1, s = p ? "prevMonthDay hidden" : "prevMonthDay", h = p ? "nextMonthDay hidden" : "nextMonthDay", f = o + 1 - i, m = 0; f <= o; f++, m++)
|
|
674
|
+
u.appendChild(J("flatpickr-day " + s, new Date(n, t - 1, f), f, m));
|
|
675
|
+
for (f = 1; f <= l; f++, m++)
|
|
676
|
+
u.appendChild(J("flatpickr-day", new Date(n, t, f), f, m));
|
|
677
|
+
for (var M = l + 1; M <= 42 - i && (e.config.showMonths === 1 || m % 7 !== 0); M++, m++)
|
|
678
|
+
u.appendChild(J("flatpickr-day " + h, new Date(n, t + 1, M % l), M, m));
|
|
679
|
+
var L = D("div", "dayContainer");
|
|
680
|
+
return L.appendChild(u), L;
|
|
681
|
+
}
|
|
682
|
+
function oe() {
|
|
683
|
+
if (e.daysContainer !== void 0) {
|
|
684
|
+
ge(e.daysContainer), e.weekNumbers && ge(e.weekNumbers);
|
|
685
|
+
for (var n = document.createDocumentFragment(), t = 0; t < e.config.showMonths; t++) {
|
|
686
|
+
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
687
|
+
i.setMonth(e.currentMonth + t), n.appendChild(tn(i.getFullYear(), i.getMonth()));
|
|
688
|
+
}
|
|
689
|
+
e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && fe();
|
|
555
690
|
}
|
|
556
|
-
e.changeMonth(l), q(te(l), 0);
|
|
557
|
-
}
|
|
558
|
-
function q(t, n) {
|
|
559
|
-
const i = ie(document.activeElement || document.body), r = t !== void 0 ? t : i ? document.activeElement : e.selectedDateElem !== void 0 && ie(e.selectedDateElem) ? e.selectedDateElem : e.todayDateElem !== void 0 && ie(e.todayDateElem) ? e.todayDateElem : te(n > 0 ? 1 : -1);
|
|
560
|
-
r === void 0 ? e._input.focus() : i ? Ze(r, n) : pe(r);
|
|
561
|
-
}
|
|
562
|
-
function Qe(t, n) {
|
|
563
|
-
const i = (new Date(t, n, 1).getDay() - e.l10n.firstDayOfWeek + 7) % 7, r = e.utils.getDaysInMonth((n - 1 + 12) % 12, t), l = e.utils.getDaysInMonth(n, t), s = window.document.createDocumentFragment(), d = e.config.showMonths > 1, c = d ? "prevMonthDay hidden" : "prevMonthDay", u = d ? "nextMonthDay hidden" : "nextMonthDay";
|
|
564
|
-
let g = r + 1 - i, M = 0;
|
|
565
|
-
for (; g <= r; g++, M++)
|
|
566
|
-
s.appendChild(ge(c, new Date(t, n - 1, g), g, M));
|
|
567
|
-
for (g = 1; g <= l; g++, M++)
|
|
568
|
-
s.appendChild(ge("", new Date(t, n, g), g, M));
|
|
569
|
-
for (let E = l + 1; E <= 42 - i && (e.config.showMonths === 1 || M % 7 !== 0); E++, M++)
|
|
570
|
-
s.appendChild(ge(u, new Date(t, n + 1, E % l), E, M));
|
|
571
|
-
const S = b("div", "dayContainer");
|
|
572
|
-
return S.appendChild(s), S;
|
|
573
|
-
}
|
|
574
|
-
function ne() {
|
|
575
|
-
if (e.daysContainer === void 0)
|
|
576
|
-
return;
|
|
577
|
-
de(e.daysContainer), e.weekNumbers && de(e.weekNumbers);
|
|
578
|
-
const t = document.createDocumentFragment();
|
|
579
|
-
for (let n = 0; n < e.config.showMonths; n++) {
|
|
580
|
-
const i = new Date(e.currentYear, e.currentMonth, 1);
|
|
581
|
-
i.setMonth(e.currentMonth + n), t.appendChild(Qe(i.getFullYear(), i.getMonth()));
|
|
582
|
-
}
|
|
583
|
-
e.daysContainer.appendChild(t), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && be();
|
|
584
691
|
}
|
|
585
|
-
function
|
|
586
|
-
if (e.config.showMonths > 1 || e.config.monthSelectorType !== "dropdown")
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
i.value = new Date(e.currentYear, n).getMonth().toString(), i.textContent = ue(n, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === n && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
|
|
692
|
+
function $() {
|
|
693
|
+
if (!(e.config.showMonths > 1 || e.config.monthSelectorType !== "dropdown")) {
|
|
694
|
+
var n = function(o) {
|
|
695
|
+
return e.config.minDate !== void 0 && e.currentYear === e.config.minDate.getFullYear() && o < e.config.minDate.getMonth() ? !1 : !(e.config.maxDate !== void 0 && e.currentYear === e.config.maxDate.getFullYear() && o > e.config.maxDate.getMonth());
|
|
696
|
+
};
|
|
697
|
+
e.monthsDropdownContainer.tabIndex = -1, e.monthsDropdownContainer.innerHTML = "";
|
|
698
|
+
for (var t = 0; t < 12; t++)
|
|
699
|
+
if (n(t)) {
|
|
700
|
+
var i = D("option", "flatpickr-monthDropdown-month");
|
|
701
|
+
i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent = he(t, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === t && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
|
|
702
|
+
}
|
|
597
703
|
}
|
|
598
704
|
}
|
|
599
|
-
function
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
const r = fe("cur-year", { tabindex: "-1" }), l = r.getElementsByTagName("input")[0];
|
|
705
|
+
function an() {
|
|
706
|
+
var n = D("div", "flatpickr-month"), t = window.document.createDocumentFragment(), i;
|
|
707
|
+
e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = D("span", "cur-month") : (e.monthsDropdownContainer = D("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), v(e.monthsDropdownContainer, "change", function(p) {
|
|
708
|
+
var s = N(p), h = parseInt(s.value, 10);
|
|
709
|
+
e.changeMonth(h - e.currentMonth), C("onMonthChange");
|
|
710
|
+
}), $(), i = e.monthsDropdownContainer);
|
|
711
|
+
var o = pe("cur-year", { tabindex: "-1" }), l = o.getElementsByTagName("input")[0];
|
|
607
712
|
l.setAttribute("aria-label", e.l10n.yearAriaLabel), e.config.minDate && l.setAttribute("min", e.config.minDate.getFullYear().toString()), e.config.maxDate && (l.setAttribute("max", e.config.maxDate.getFullYear().toString()), l.disabled = !!e.config.minDate && e.config.minDate.getFullYear() === e.config.maxDate.getFullYear());
|
|
608
|
-
|
|
609
|
-
return
|
|
610
|
-
container:
|
|
713
|
+
var u = D("div", "flatpickr-current-month");
|
|
714
|
+
return u.appendChild(i), u.appendChild(o), t.appendChild(u), n.appendChild(t), {
|
|
715
|
+
container: n,
|
|
611
716
|
yearElement: l,
|
|
612
717
|
monthElement: i
|
|
613
718
|
};
|
|
614
719
|
}
|
|
615
|
-
function
|
|
616
|
-
|
|
617
|
-
for (
|
|
618
|
-
|
|
619
|
-
e.yearElements.push(
|
|
720
|
+
function Pe() {
|
|
721
|
+
ge(e.monthNav), e.monthNav.appendChild(e.prevMonthNav), e.config.showMonths && (e.yearElements = [], e.monthElements = []);
|
|
722
|
+
for (var n = e.config.showMonths; n--; ) {
|
|
723
|
+
var t = an();
|
|
724
|
+
e.yearElements.push(t.yearElement), e.monthElements.push(t.monthElement), e.monthNav.appendChild(t.container);
|
|
620
725
|
}
|
|
621
726
|
e.monthNav.appendChild(e.nextMonthNav);
|
|
622
727
|
}
|
|
623
|
-
function
|
|
624
|
-
return e.monthNav =
|
|
625
|
-
get: ()
|
|
626
|
-
|
|
627
|
-
|
|
728
|
+
function rn() {
|
|
729
|
+
return e.monthNav = D("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = D("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = D("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow, Pe(), Object.defineProperty(e, "_hidePrevMonthArrow", {
|
|
730
|
+
get: function() {
|
|
731
|
+
return e.__hidePrevMonthArrow;
|
|
732
|
+
},
|
|
733
|
+
set: function(n) {
|
|
734
|
+
e.__hidePrevMonthArrow !== n && (_(e.prevMonthNav, "flatpickr-disabled", n), e.__hidePrevMonthArrow = n);
|
|
628
735
|
}
|
|
629
736
|
}), Object.defineProperty(e, "_hideNextMonthArrow", {
|
|
630
|
-
get: ()
|
|
631
|
-
|
|
632
|
-
|
|
737
|
+
get: function() {
|
|
738
|
+
return e.__hideNextMonthArrow;
|
|
739
|
+
},
|
|
740
|
+
set: function(n) {
|
|
741
|
+
e.__hideNextMonthArrow !== n && (_(e.nextMonthNav, "flatpickr-disabled", n), e.__hideNextMonthArrow = n);
|
|
633
742
|
}
|
|
634
|
-
}), e.currentYearElement = e.yearElements[0],
|
|
743
|
+
}), e.currentYearElement = e.yearElements[0], de(), e.monthNav;
|
|
635
744
|
}
|
|
636
|
-
function
|
|
745
|
+
function on() {
|
|
637
746
|
e.calendarContainer.classList.add("hasTime"), e.config.noCalendar && e.calendarContainer.classList.add("noCalendar");
|
|
638
|
-
|
|
639
|
-
e.timeContainer =
|
|
640
|
-
|
|
747
|
+
var n = Ae(e.config);
|
|
748
|
+
e.timeContainer = D("div", "flatpickr-time"), e.timeContainer.tabIndex = -1;
|
|
749
|
+
var t = D("span", "flatpickr-time-separator", ":"), i = pe("flatpickr-hour", {
|
|
641
750
|
"aria-label": e.l10n.hourAriaLabel
|
|
642
751
|
});
|
|
643
752
|
e.hourElement = i.getElementsByTagName("input")[0];
|
|
644
|
-
|
|
753
|
+
var o = pe("flatpickr-minute", {
|
|
645
754
|
"aria-label": e.l10n.minuteAriaLabel
|
|
646
755
|
});
|
|
647
|
-
if (e.minuteElement =
|
|
756
|
+
if (e.minuteElement = o.getElementsByTagName("input")[0], e.hourElement.tabIndex = e.minuteElement.tabIndex = -1, e.hourElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getHours() : e.config.time_24hr ? n.hours : y(n.hours)), e.minuteElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getMinutes() : n.minutes), e.hourElement.setAttribute("step", e.config.hourIncrement.toString()), e.minuteElement.setAttribute("step", e.config.minuteIncrement.toString()), e.hourElement.setAttribute("min", e.config.time_24hr ? "0" : "1"), e.hourElement.setAttribute("max", e.config.time_24hr ? "23" : "12"), e.hourElement.setAttribute("maxlength", "2"), e.minuteElement.setAttribute("min", "0"), e.minuteElement.setAttribute("max", "59"), e.minuteElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(i), e.timeContainer.appendChild(t), e.timeContainer.appendChild(o), e.config.time_24hr && e.timeContainer.classList.add("time24hr"), e.config.enableSeconds) {
|
|
648
757
|
e.timeContainer.classList.add("hasSeconds");
|
|
649
|
-
|
|
650
|
-
e.secondElement = l.getElementsByTagName("input")[0], e.secondElement.value =
|
|
758
|
+
var l = pe("flatpickr-second");
|
|
759
|
+
e.secondElement = l.getElementsByTagName("input")[0], e.secondElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getSeconds() : n.seconds), e.secondElement.setAttribute("step", e.minuteElement.getAttribute("step")), e.secondElement.setAttribute("min", "0"), e.secondElement.setAttribute("max", "59"), e.secondElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(D("span", "flatpickr-time-separator", ":")), e.timeContainer.appendChild(l);
|
|
651
760
|
}
|
|
652
|
-
return e.config.time_24hr || (e.amPM =
|
|
761
|
+
return e.config.time_24hr || (e.amPM = D("span", "flatpickr-am-pm", e.l10n.amPM[Y((e.latestSelectedDateObj ? e.hourElement.value : e.config.defaultHour) > 11)]), e.amPM.title = e.l10n.toggleTitle, e.amPM.tabIndex = -1, e.timeContainer.appendChild(e.amPM)), e.timeContainer;
|
|
653
762
|
}
|
|
654
|
-
function
|
|
655
|
-
e.weekdayContainer ?
|
|
656
|
-
for (
|
|
657
|
-
|
|
658
|
-
e.weekdayContainer.appendChild(
|
|
763
|
+
function Ye() {
|
|
764
|
+
e.weekdayContainer ? ge(e.weekdayContainer) : e.weekdayContainer = D("div", "flatpickr-weekdays");
|
|
765
|
+
for (var n = e.config.showMonths; n--; ) {
|
|
766
|
+
var t = D("div", "flatpickr-weekdaycontainer");
|
|
767
|
+
e.weekdayContainer.appendChild(t);
|
|
659
768
|
}
|
|
660
|
-
return
|
|
769
|
+
return He(), e.weekdayContainer;
|
|
661
770
|
}
|
|
662
|
-
function
|
|
663
|
-
if (
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
...n.splice(t, n.length),
|
|
669
|
-
...n.splice(0, t)
|
|
670
|
-
]);
|
|
671
|
-
for (let i = e.config.showMonths; i--; )
|
|
672
|
-
e.weekdayContainer.children[i].innerHTML = `
|
|
771
|
+
function He() {
|
|
772
|
+
if (e.weekdayContainer) {
|
|
773
|
+
var n = e.l10n.firstDayOfWeek, t = Ze(e.l10n.weekdays.shorthand);
|
|
774
|
+
n > 0 && n < t.length && (t = Ze(t.splice(n, t.length), t.splice(0, n)));
|
|
775
|
+
for (var i = e.config.showMonths; i--; )
|
|
776
|
+
e.weekdayContainer.children[i].innerHTML = `
|
|
673
777
|
<span class='flatpickr-weekday'>
|
|
674
|
-
|
|
778
|
+
` + t.join("</span><span class='flatpickr-weekday'>") + `
|
|
675
779
|
</span>
|
|
676
780
|
`;
|
|
781
|
+
}
|
|
677
782
|
}
|
|
678
|
-
function
|
|
783
|
+
function ln() {
|
|
679
784
|
e.calendarContainer.classList.add("hasWeeks");
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
return
|
|
684
|
-
weekWrapper:
|
|
685
|
-
weekNumbers:
|
|
785
|
+
var n = D("div", "flatpickr-weekwrapper");
|
|
786
|
+
n.appendChild(D("span", "flatpickr-weekday", e.l10n.weekAbbreviation));
|
|
787
|
+
var t = D("div", "flatpickr-weeks");
|
|
788
|
+
return n.appendChild(t), {
|
|
789
|
+
weekWrapper: n,
|
|
790
|
+
weekNumbers: t
|
|
686
791
|
};
|
|
687
792
|
}
|
|
688
|
-
function
|
|
689
|
-
|
|
690
|
-
|
|
793
|
+
function Me(n, t) {
|
|
794
|
+
t === void 0 && (t = !0);
|
|
795
|
+
var i = t ? n : n - e.currentMonth;
|
|
796
|
+
i < 0 && e._hidePrevMonthArrow === !0 || i > 0 && e._hideNextMonthArrow === !0 || (e.currentMonth += i, (e.currentMonth < 0 || e.currentMonth > 11) && (e.currentYear += e.currentMonth > 11 ? 1 : -1, e.currentMonth = (e.currentMonth + 12) % 12, C("onYearChange"), $()), oe(), C("onMonthChange"), de());
|
|
691
797
|
}
|
|
692
|
-
function
|
|
693
|
-
if (e.input.value = "", e.altInput !== void 0 && (e.altInput.value = ""), e.mobileInput !== void 0 && (e.mobileInput.value = ""), e.selectedDates = [], e.latestSelectedDateObj = void 0,
|
|
694
|
-
|
|
695
|
-
|
|
798
|
+
function un(n, t) {
|
|
799
|
+
if (n === void 0 && (n = !0), t === void 0 && (t = !0), e.input.value = "", e.altInput !== void 0 && (e.altInput.value = ""), e.mobileInput !== void 0 && (e.mobileInput.value = ""), e.selectedDates = [], e.latestSelectedDateObj = void 0, t === !0 && (e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth()), e.config.enableTime === !0) {
|
|
800
|
+
var i = Ae(e.config), o = i.hours, l = i.minutes, u = i.seconds;
|
|
801
|
+
O(o, l, u);
|
|
696
802
|
}
|
|
697
|
-
e.redraw(),
|
|
803
|
+
e.redraw(), n && C("onChange");
|
|
698
804
|
}
|
|
699
|
-
function
|
|
700
|
-
e.isOpen = !1, e.isMobile || (e.calendarContainer !== void 0 && e.calendarContainer.classList.remove("open"), e._input !== void 0 && e._input.classList.remove("active")),
|
|
805
|
+
function fn() {
|
|
806
|
+
e.isOpen = !1, e.isMobile || (e.calendarContainer !== void 0 && e.calendarContainer.classList.remove("open"), e._input !== void 0 && e._input.classList.remove("active")), C("onClose");
|
|
701
807
|
}
|
|
702
|
-
function
|
|
703
|
-
e.config !== void 0 &&
|
|
704
|
-
for (
|
|
705
|
-
e._handlers[
|
|
808
|
+
function sn() {
|
|
809
|
+
e.config !== void 0 && C("onDestroy");
|
|
810
|
+
for (var n = e._handlers.length; n--; )
|
|
811
|
+
e._handlers[n].remove();
|
|
706
812
|
if (e._handlers = [], e.mobileInput)
|
|
707
813
|
e.mobileInput.parentNode && e.mobileInput.parentNode.removeChild(e.mobileInput), e.mobileInput = void 0;
|
|
708
814
|
else if (e.calendarContainer && e.calendarContainer.parentNode)
|
|
709
815
|
if (e.config.static && e.calendarContainer.parentNode) {
|
|
710
|
-
|
|
816
|
+
var t = e.calendarContainer.parentNode;
|
|
711
817
|
if (t.lastChild && t.removeChild(t.lastChild), t.parentNode) {
|
|
712
818
|
for (; t.firstChild; )
|
|
713
819
|
t.parentNode.insertBefore(t.firstChild, t);
|
|
@@ -745,171 +851,178 @@ function Rt(a, o) {
|
|
|
745
851
|
"navigationCurrentMonth",
|
|
746
852
|
"selectedDateElem",
|
|
747
853
|
"config"
|
|
748
|
-
].forEach((
|
|
854
|
+
].forEach(function(i) {
|
|
749
855
|
try {
|
|
750
|
-
delete e[
|
|
856
|
+
delete e[i];
|
|
751
857
|
} catch {
|
|
752
858
|
}
|
|
753
859
|
});
|
|
754
860
|
}
|
|
755
|
-
function
|
|
756
|
-
return e.
|
|
861
|
+
function te(n) {
|
|
862
|
+
return e.calendarContainer.contains(n);
|
|
757
863
|
}
|
|
758
|
-
function
|
|
864
|
+
function be(n) {
|
|
759
865
|
if (e.isOpen && !e.config.inline) {
|
|
760
|
-
|
|
761
|
-
|
|
866
|
+
var t = N(n), i = te(t), o = t === e.input || t === e.altInput || e.element.contains(t) || n.path && n.path.indexOf && (~n.path.indexOf(e.input) || ~n.path.indexOf(e.altInput)), l = !o && !i && !te(n.relatedTarget), u = !e.config.ignoredFocusElements.some(function(p) {
|
|
867
|
+
return p.contains(t);
|
|
868
|
+
});
|
|
869
|
+
l && u && (e.config.allowInput && e.setDate(e._input.value, !1, e.config.altInput ? e.config.altFormat : e.config.dateFormat), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0 && e.input.value !== "" && e.input.value !== void 0 && x(), e.close(), e.config && e.config.mode === "range" && e.selectedDates.length === 1 && e.clear(!1));
|
|
762
870
|
}
|
|
763
871
|
}
|
|
764
|
-
function
|
|
765
|
-
if (!
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
872
|
+
function le(n) {
|
|
873
|
+
if (!(!n || e.config.minDate && n < e.config.minDate.getFullYear() || e.config.maxDate && n > e.config.maxDate.getFullYear())) {
|
|
874
|
+
var t = n, i = e.currentYear !== t;
|
|
875
|
+
e.currentYear = t || e.currentYear, e.config.maxDate && e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth = Math.min(e.config.maxDate.getMonth(), e.currentMonth) : e.config.minDate && e.currentYear === e.config.minDate.getFullYear() && (e.currentMonth = Math.max(e.config.minDate.getMonth(), e.currentMonth)), i && (e.redraw(), C("onYearChange"), $());
|
|
876
|
+
}
|
|
769
877
|
}
|
|
770
|
-
function B(
|
|
878
|
+
function B(n, t) {
|
|
771
879
|
var i;
|
|
772
|
-
|
|
773
|
-
|
|
880
|
+
t === void 0 && (t = !0);
|
|
881
|
+
var o = e.parseDate(n, void 0, t);
|
|
882
|
+
if (e.config.minDate && o && P(o, e.config.minDate, t !== void 0 ? t : !e.minDateHasTime) < 0 || e.config.maxDate && o && P(o, e.config.maxDate, t !== void 0 ? t : !e.maxDateHasTime) > 0)
|
|
774
883
|
return !1;
|
|
775
884
|
if (!e.config.enable && e.config.disable.length === 0)
|
|
776
885
|
return !0;
|
|
777
|
-
if (
|
|
886
|
+
if (o === void 0)
|
|
778
887
|
return !1;
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
if (c = s[d], typeof c == "function" && c(r))
|
|
888
|
+
for (var l = !!e.config.enable, u = (i = e.config.enable) !== null && i !== void 0 ? i : e.config.disable, p = 0, s = void 0; p < u.length; p++) {
|
|
889
|
+
if (s = u[p], typeof s == "function" && s(o))
|
|
782
890
|
return l;
|
|
783
|
-
if (
|
|
891
|
+
if (s instanceof Date && o !== void 0 && s.getTime() === o.getTime())
|
|
784
892
|
return l;
|
|
785
|
-
if (typeof
|
|
786
|
-
|
|
787
|
-
return
|
|
788
|
-
} else if (typeof
|
|
893
|
+
if (typeof s == "string") {
|
|
894
|
+
var h = e.parseDate(s, void 0, !0);
|
|
895
|
+
return h && h.getTime() === o.getTime() ? l : !l;
|
|
896
|
+
} else if (typeof s == "object" && o !== void 0 && s.from && s.to && o.getTime() >= s.from.getTime() && o.getTime() <= s.to.getTime())
|
|
789
897
|
return l;
|
|
790
898
|
}
|
|
791
899
|
return !l;
|
|
792
900
|
}
|
|
793
|
-
function
|
|
794
|
-
return e.daysContainer !== void 0 ?
|
|
901
|
+
function ue(n) {
|
|
902
|
+
return e.daysContainer !== void 0 ? n.className.indexOf("hidden") === -1 && n.className.indexOf("flatpickr-disabled") === -1 && e.daysContainer.contains(n) : !1;
|
|
795
903
|
}
|
|
796
|
-
function
|
|
797
|
-
t.target === e._input
|
|
904
|
+
function cn(n) {
|
|
905
|
+
var t = n.target === e._input, i = e._input.value.trimEnd() !== Ee();
|
|
906
|
+
t && i && !(n.relatedTarget && te(n.relatedTarget)) && e.setDate(e._input.value, !0, n.target === e.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
798
907
|
}
|
|
799
|
-
function
|
|
800
|
-
|
|
801
|
-
if (
|
|
802
|
-
if (
|
|
803
|
-
return e.setDate(e._input.value, !0,
|
|
908
|
+
function Le(n) {
|
|
909
|
+
var t = N(n), i = e.config.wrap ? a.contains(t) : t === e._input, o = e.config.allowInput, l = e.isOpen && (!o || !i), u = e.config.inline && i && !o;
|
|
910
|
+
if (n.keyCode === 13 && i) {
|
|
911
|
+
if (o)
|
|
912
|
+
return e.setDate(e._input.value, !0, t === e.altInput ? e.config.altFormat : e.config.dateFormat), e.close(), t.blur();
|
|
804
913
|
e.open();
|
|
805
|
-
} else if (
|
|
806
|
-
|
|
807
|
-
switch (
|
|
914
|
+
} else if (te(t) || l || u) {
|
|
915
|
+
var p = !!e.timeContainer && e.timeContainer.contains(t);
|
|
916
|
+
switch (n.keyCode) {
|
|
808
917
|
case 13:
|
|
809
|
-
|
|
918
|
+
p ? (n.preventDefault(), x(), we()) : Je(n);
|
|
810
919
|
break;
|
|
811
920
|
case 27:
|
|
812
|
-
|
|
921
|
+
n.preventDefault(), we();
|
|
813
922
|
break;
|
|
814
923
|
case 8:
|
|
815
924
|
case 46:
|
|
816
|
-
i && !e.config.allowInput && (
|
|
925
|
+
i && !e.config.allowInput && (n.preventDefault(), e.clear());
|
|
817
926
|
break;
|
|
818
927
|
case 37:
|
|
819
928
|
case 39:
|
|
820
|
-
if (!
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
929
|
+
if (!p && !i) {
|
|
930
|
+
n.preventDefault();
|
|
931
|
+
var s = d();
|
|
932
|
+
if (e.daysContainer !== void 0 && (o === !1 || s && ue(s))) {
|
|
933
|
+
var h = n.keyCode === 39 ? 1 : -1;
|
|
934
|
+
n.ctrlKey ? (n.stopPropagation(), Me(h), ne(G(1), 0)) : ne(void 0, h);
|
|
824
935
|
}
|
|
825
936
|
} else
|
|
826
937
|
e.hourElement && e.hourElement.focus();
|
|
827
938
|
break;
|
|
828
939
|
case 38:
|
|
829
940
|
case 40:
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
e.daysContainer &&
|
|
941
|
+
n.preventDefault();
|
|
942
|
+
var f = n.keyCode === 40 ? 1 : -1;
|
|
943
|
+
e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(), le(e.currentYear - f), ne(G(1), 0)) : p || ne(void 0, f * 7) : t === e.currentYearElement ? le(e.currentYear - f) : e.config.enableTime && (!p && e.hourElement && e.hourElement.focus(), x(n), e._debouncedChange());
|
|
833
944
|
break;
|
|
834
945
|
case 9:
|
|
835
|
-
if (
|
|
836
|
-
|
|
946
|
+
if (p) {
|
|
947
|
+
var m = [
|
|
837
948
|
e.hourElement,
|
|
838
949
|
e.minuteElement,
|
|
839
950
|
e.secondElement,
|
|
840
951
|
e.amPM
|
|
841
|
-
].concat(e.pluginElements).filter((
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
952
|
+
].concat(e.pluginElements).filter(function(F) {
|
|
953
|
+
return F;
|
|
954
|
+
}), M = m.indexOf(t);
|
|
955
|
+
if (M !== -1) {
|
|
956
|
+
var L = m[M + (n.shiftKey ? -1 : 1)];
|
|
957
|
+
n.preventDefault(), (L || e._input).focus();
|
|
845
958
|
}
|
|
846
959
|
} else
|
|
847
|
-
!e.config.noCalendar && e.daysContainer && e.daysContainer.contains(
|
|
960
|
+
!e.config.noCalendar && e.daysContainer && e.daysContainer.contains(t) && n.shiftKey && (n.preventDefault(), e._input.focus());
|
|
848
961
|
break;
|
|
849
962
|
}
|
|
850
963
|
}
|
|
851
|
-
if (e.amPM !== void 0 &&
|
|
852
|
-
switch (
|
|
964
|
+
if (e.amPM !== void 0 && t === e.amPM)
|
|
965
|
+
switch (n.key) {
|
|
853
966
|
case e.l10n.amPM[0].charAt(0):
|
|
854
967
|
case e.l10n.amPM[0].charAt(0).toLowerCase():
|
|
855
|
-
e.amPM.textContent = e.l10n.amPM[0],
|
|
968
|
+
e.amPM.textContent = e.l10n.amPM[0], I(), R();
|
|
856
969
|
break;
|
|
857
970
|
case e.l10n.amPM[1].charAt(0):
|
|
858
971
|
case e.l10n.amPM[1].charAt(0).toLowerCase():
|
|
859
|
-
e.amPM.textContent = e.l10n.amPM[1],
|
|
972
|
+
e.amPM.textContent = e.l10n.amPM[1], I(), R();
|
|
860
973
|
break;
|
|
861
974
|
}
|
|
862
|
-
(i ||
|
|
863
|
-
}
|
|
864
|
-
function
|
|
865
|
-
if (e.selectedDates.length !== 1 ||
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
const E = g.children[M], P = E.dateObj.getTime(), G = d > 0 && P < d || c > 0 && P > c;
|
|
875
|
-
if (G) {
|
|
876
|
-
E.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach((Z) => {
|
|
877
|
-
E.classList.remove(Z);
|
|
975
|
+
(i || te(t)) && C("onKeyDown", n);
|
|
976
|
+
}
|
|
977
|
+
function fe(n, t) {
|
|
978
|
+
if (t === void 0 && (t = "flatpickr-day"), !(e.selectedDates.length !== 1 || n && (!n.classList.contains(t) || n.classList.contains("flatpickr-disabled")))) {
|
|
979
|
+
for (var i = n ? n.dateObj.getTime() : e.days.firstElementChild.dateObj.getTime(), o = e.parseDate(e.selectedDates[0], void 0, !0).getTime(), l = Math.min(i, e.selectedDates[0].getTime()), u = Math.max(i, e.selectedDates[0].getTime()), p = !1, s = 0, h = 0, f = l; f < u; f += Un.DAY)
|
|
980
|
+
B(new Date(f), !0) || (p = p || f > l && f < u, f < o && (!s || f > s) ? s = f : f > o && (!h || f < h) && (h = f));
|
|
981
|
+
var m = Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+" + e.config.showMonths + ") > ." + t));
|
|
982
|
+
m.forEach(function(M) {
|
|
983
|
+
var L = M.dateObj, F = L.getTime(), ae = s > 0 && F < s || h > 0 && F > h;
|
|
984
|
+
if (ae) {
|
|
985
|
+
M.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function(Z) {
|
|
986
|
+
M.classList.remove(Z);
|
|
878
987
|
});
|
|
879
|
-
|
|
880
|
-
} else if (
|
|
881
|
-
|
|
882
|
-
["startRange", "inRange", "endRange", "notAllowed"].forEach((Z)
|
|
883
|
-
|
|
884
|
-
}),
|
|
885
|
-
}
|
|
988
|
+
return;
|
|
989
|
+
} else if (p && !ae)
|
|
990
|
+
return;
|
|
991
|
+
["startRange", "inRange", "endRange", "notAllowed"].forEach(function(Z) {
|
|
992
|
+
M.classList.remove(Z);
|
|
993
|
+
}), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i && F === o ? M.classList.add("startRange") : o > i && F === o && M.classList.add("endRange"), F >= s && (h === 0 || F <= h) && zn(F, o, i) && M.classList.add("inRange"));
|
|
994
|
+
});
|
|
886
995
|
}
|
|
887
996
|
}
|
|
888
|
-
function
|
|
889
|
-
e.isOpen && !e.config.static && !e.config.inline &&
|
|
997
|
+
function dn() {
|
|
998
|
+
e.isOpen && !e.config.static && !e.config.inline && se();
|
|
890
999
|
}
|
|
891
|
-
function
|
|
892
|
-
if (e.isMobile === !0) {
|
|
893
|
-
if (
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1000
|
+
function mn(n, t) {
|
|
1001
|
+
if (t === void 0 && (t = e._positionElement), e.isMobile === !0) {
|
|
1002
|
+
if (n) {
|
|
1003
|
+
n.preventDefault();
|
|
1004
|
+
var i = N(n);
|
|
1005
|
+
i && i.blur();
|
|
897
1006
|
}
|
|
898
|
-
e.mobileInput !== void 0 && (e.mobileInput.focus(), e.mobileInput.click()),
|
|
1007
|
+
e.mobileInput !== void 0 && (e.mobileInput.focus(), e.mobileInput.click()), C("onOpen");
|
|
899
1008
|
return;
|
|
900
1009
|
} else if (e._input.disabled || e.config.inline)
|
|
901
1010
|
return;
|
|
902
|
-
|
|
903
|
-
e.isOpen = !0,
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1011
|
+
var o = e.isOpen;
|
|
1012
|
+
e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), C("onOpen"), se(t)), e.config.enableTime === !0 && e.config.noCalendar === !0 && e.config.allowInput === !1 && (n === void 0 || !e.timeContainer.contains(n.relatedTarget)) && setTimeout(function() {
|
|
1013
|
+
return e.hourElement.select();
|
|
1014
|
+
}, 50);
|
|
1015
|
+
}
|
|
1016
|
+
function je(n) {
|
|
1017
|
+
return function(t) {
|
|
1018
|
+
var i = e.config["_" + n + "Date"] = e.parseDate(t, e.config.dateFormat), o = e.config["_" + (n === "min" ? "max" : "min") + "Date"];
|
|
1019
|
+
i !== void 0 && (e[n === "min" ? "minDateHasTime" : "maxDateHasTime"] = i.getHours() > 0 || i.getMinutes() > 0 || i.getSeconds() > 0), e.selectedDates && (e.selectedDates = e.selectedDates.filter(function(l) {
|
|
1020
|
+
return B(l);
|
|
1021
|
+
}), !e.selectedDates.length && n === "min" && A(i), R()), e.daysContainer && (Ke(), i !== void 0 ? e.currentYearElement[n] = i.getFullYear().toString() : e.currentYearElement.removeAttribute(n), e.currentYearElement.disabled = !!o && i !== void 0 && o.getFullYear() === i.getFullYear());
|
|
909
1022
|
};
|
|
910
1023
|
}
|
|
911
|
-
function
|
|
912
|
-
|
|
1024
|
+
function gn() {
|
|
1025
|
+
var n = [
|
|
913
1026
|
"wrap",
|
|
914
1027
|
"weekNumbers",
|
|
915
1028
|
"allowInput",
|
|
@@ -924,318 +1037,372 @@ function Rt(a, o) {
|
|
|
924
1037
|
"static",
|
|
925
1038
|
"enableSeconds",
|
|
926
1039
|
"disableMobile"
|
|
927
|
-
],
|
|
928
|
-
e.config.parseDate =
|
|
929
|
-
get: ()
|
|
930
|
-
|
|
931
|
-
|
|
1040
|
+
], t = T(T({}, JSON.parse(JSON.stringify(a.dataset || {}))), r), i = {};
|
|
1041
|
+
e.config.parseDate = t.parseDate, e.config.formatDate = t.formatDate, Object.defineProperty(e.config, "enable", {
|
|
1042
|
+
get: function() {
|
|
1043
|
+
return e.config._enable;
|
|
1044
|
+
},
|
|
1045
|
+
set: function(m) {
|
|
1046
|
+
e.config._enable = ze(m);
|
|
932
1047
|
}
|
|
933
1048
|
}), Object.defineProperty(e.config, "disable", {
|
|
934
|
-
get: ()
|
|
935
|
-
|
|
936
|
-
|
|
1049
|
+
get: function() {
|
|
1050
|
+
return e.config._disable;
|
|
1051
|
+
},
|
|
1052
|
+
set: function(m) {
|
|
1053
|
+
e.config._disable = ze(m);
|
|
937
1054
|
}
|
|
938
1055
|
});
|
|
939
|
-
|
|
940
|
-
if (!
|
|
941
|
-
|
|
942
|
-
i.dateFormat =
|
|
1056
|
+
var o = t.mode === "time";
|
|
1057
|
+
if (!t.dateFormat && (t.enableTime || o)) {
|
|
1058
|
+
var l = k.defaultConfig.dateFormat || X.dateFormat;
|
|
1059
|
+
i.dateFormat = t.noCalendar || o ? "H:i" + (t.enableSeconds ? ":S" : "") : l + " H:i" + (t.enableSeconds ? ":S" : "");
|
|
943
1060
|
}
|
|
944
|
-
if (
|
|
945
|
-
|
|
946
|
-
i.altFormat =
|
|
1061
|
+
if (t.altInput && (t.enableTime || o) && !t.altFormat) {
|
|
1062
|
+
var u = k.defaultConfig.altFormat || X.altFormat;
|
|
1063
|
+
i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") : u + (" h:i" + (t.enableSeconds ? ":S" : "") + " K");
|
|
947
1064
|
}
|
|
948
1065
|
Object.defineProperty(e.config, "minDate", {
|
|
949
|
-
get: ()
|
|
950
|
-
|
|
1066
|
+
get: function() {
|
|
1067
|
+
return e.config._minDate;
|
|
1068
|
+
},
|
|
1069
|
+
set: je("min")
|
|
951
1070
|
}), Object.defineProperty(e.config, "maxDate", {
|
|
952
|
-
get: ()
|
|
953
|
-
|
|
1071
|
+
get: function() {
|
|
1072
|
+
return e.config._maxDate;
|
|
1073
|
+
},
|
|
1074
|
+
set: je("max")
|
|
954
1075
|
});
|
|
955
|
-
|
|
956
|
-
|
|
1076
|
+
var p = function(m) {
|
|
1077
|
+
return function(M) {
|
|
1078
|
+
e.config[m === "min" ? "_minTime" : "_maxTime"] = e.parseDate(M, "H:i:S");
|
|
1079
|
+
};
|
|
957
1080
|
};
|
|
958
1081
|
Object.defineProperty(e.config, "minTime", {
|
|
959
|
-
get: ()
|
|
960
|
-
|
|
1082
|
+
get: function() {
|
|
1083
|
+
return e.config._minTime;
|
|
1084
|
+
},
|
|
1085
|
+
set: p("min")
|
|
961
1086
|
}), Object.defineProperty(e.config, "maxTime", {
|
|
962
|
-
get: ()
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
e.config[s] =
|
|
1087
|
+
get: function() {
|
|
1088
|
+
return e.config._maxTime;
|
|
1089
|
+
},
|
|
1090
|
+
set: p("max")
|
|
1091
|
+
}), t.mode === "time" && (e.config.noCalendar = !0, e.config.enableTime = !0), Object.assign(e.config, i, t);
|
|
1092
|
+
for (var s = 0; s < n.length; s++)
|
|
1093
|
+
e.config[n[s]] = e.config[n[s]] === !0 || e.config[n[s]] === "true";
|
|
1094
|
+
Te.filter(function(m) {
|
|
1095
|
+
return e.config[m] !== void 0;
|
|
1096
|
+
}).forEach(function(m) {
|
|
1097
|
+
e.config[m] = _e(e.config[m] || []).map(b);
|
|
969
1098
|
}), e.isMobile = !e.config.disableMobile && !e.config.inline && e.config.mode === "single" && !e.config.disable.length && !e.config.enable && !e.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
970
|
-
for (
|
|
971
|
-
|
|
972
|
-
for (
|
|
973
|
-
|
|
1099
|
+
for (var s = 0; s < e.config.plugins.length; s++) {
|
|
1100
|
+
var h = e.config.plugins[s](e) || {};
|
|
1101
|
+
for (var f in h)
|
|
1102
|
+
Te.indexOf(f) > -1 ? e.config[f] = _e(h[f]).map(b).concat(e.config[f]) : typeof t[f] > "u" && (e.config[f] = h[f]);
|
|
974
1103
|
}
|
|
975
|
-
|
|
1104
|
+
t.altInputClass || (e.config.altInputClass = Re().className + " " + e.config.altInputClass), C("onParseConfig");
|
|
976
1105
|
}
|
|
977
|
-
function
|
|
1106
|
+
function Re() {
|
|
978
1107
|
return e.config.wrap ? a.querySelector("[data-input]") : a;
|
|
979
1108
|
}
|
|
980
|
-
function
|
|
981
|
-
typeof e.config.locale != "object" && typeof
|
|
1109
|
+
function We() {
|
|
1110
|
+
typeof e.config.locale != "object" && typeof k.l10ns[e.config.locale] > "u" && e.config.errorHandler(new Error("flatpickr: invalid locale " + e.config.locale)), e.l10n = T(T({}, k.l10ns.default), typeof e.config.locale == "object" ? e.config.locale : e.config.locale !== "default" ? k.l10ns[e.config.locale] : void 0), z.D = "(" + e.l10n.weekdays.shorthand.join("|") + ")", z.l = "(" + e.l10n.weekdays.longhand.join("|") + ")", z.M = "(" + e.l10n.months.shorthand.join("|") + ")", z.F = "(" + e.l10n.months.longhand.join("|") + ")", z.K = "(" + e.l10n.amPM[0] + "|" + e.l10n.amPM[1] + "|" + e.l10n.amPM[0].toLowerCase() + "|" + e.l10n.amPM[1].toLowerCase() + ")";
|
|
1111
|
+
var n = T(T({}, r), JSON.parse(JSON.stringify(a.dataset || {})));
|
|
1112
|
+
n.time_24hr === void 0 && k.defaultConfig.time_24hr === void 0 && (e.config.time_24hr = e.l10n.time_24hr), e.formatDate = nn(e), e.parseDate = Oe({ config: e.config, l10n: e.l10n });
|
|
982
1113
|
}
|
|
983
|
-
function
|
|
1114
|
+
function se(n) {
|
|
984
1115
|
if (typeof e.config.position == "function")
|
|
985
|
-
return void e.config.position(e,
|
|
986
|
-
if (e.calendarContainer
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1116
|
+
return void e.config.position(e, n);
|
|
1117
|
+
if (e.calendarContainer !== void 0) {
|
|
1118
|
+
C("onPreCalendarPosition");
|
|
1119
|
+
var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, function(Fn, Nn) {
|
|
1120
|
+
return Fn + Nn.offsetHeight;
|
|
1121
|
+
}, 0), o = e.calendarContainer.offsetWidth, l = e.config.position.split(" "), u = l[0], p = l.length > 1 ? l[1] : null, s = t.getBoundingClientRect(), h = window.innerHeight - s.bottom, f = u === "above" || u !== "below" && h < i && s.top > i, m = window.pageYOffset + s.top + (f ? -i - 2 : t.offsetHeight + 2);
|
|
1122
|
+
if (_(e.calendarContainer, "arrowTop", !f), _(e.calendarContainer, "arrowBottom", f), !e.config.inline) {
|
|
1123
|
+
var M = window.pageXOffset + s.left, L = !1, F = !1;
|
|
1124
|
+
p === "center" ? (M -= (o - s.width) / 2, L = !0) : p === "right" && (M -= o - s.width, F = !0), _(e.calendarContainer, "arrowLeft", !L && !F), _(e.calendarContainer, "arrowCenter", L), _(e.calendarContainer, "arrowRight", F);
|
|
1125
|
+
var ae = window.document.body.offsetWidth - (window.pageXOffset + s.right), Z = M + o > window.document.body.offsetWidth, kn = ae + o > window.document.body.offsetWidth;
|
|
1126
|
+
if (_(e.calendarContainer, "rightMost", Z), !e.config.static)
|
|
1127
|
+
if (e.calendarContainer.style.top = m + "px", !Z)
|
|
1128
|
+
e.calendarContainer.style.left = M + "px", e.calendarContainer.style.right = "auto";
|
|
1129
|
+
else if (!kn)
|
|
1130
|
+
e.calendarContainer.style.left = "auto", e.calendarContainer.style.right = ae + "px";
|
|
1131
|
+
else {
|
|
1132
|
+
var xe = pn();
|
|
1133
|
+
if (xe === void 0)
|
|
1134
|
+
return;
|
|
1135
|
+
var Tn = window.document.body.offsetWidth, _n = Math.max(0, Tn / 2 - o / 2), Sn = ".flatpickr-calendar.centerMost:before", In = ".flatpickr-calendar.centerMost:after", An = xe.cssRules.length, On = "{left:" + s.left + "px;right:auto;}";
|
|
1136
|
+
_(e.calendarContainer, "rightMost", !1), _(e.calendarContainer, "centerMost", !0), xe.insertRule(Sn + "," + In + On, An), e.calendarContainer.style.left = _n + "px", e.calendarContainer.style.right = "auto";
|
|
1137
|
+
}
|
|
1006
1138
|
}
|
|
1139
|
+
}
|
|
1007
1140
|
}
|
|
1008
|
-
function
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1141
|
+
function pn() {
|
|
1142
|
+
for (var n = null, t = 0; t < document.styleSheets.length; t++) {
|
|
1143
|
+
var i = document.styleSheets[t];
|
|
1144
|
+
if (i.cssRules) {
|
|
1145
|
+
try {
|
|
1146
|
+
i.cssRules;
|
|
1147
|
+
} catch {
|
|
1148
|
+
continue;
|
|
1149
|
+
}
|
|
1150
|
+
n = i;
|
|
1151
|
+
break;
|
|
1016
1152
|
}
|
|
1017
|
-
t = i;
|
|
1018
|
-
break;
|
|
1019
1153
|
}
|
|
1020
|
-
return
|
|
1154
|
+
return n ?? hn();
|
|
1021
1155
|
}
|
|
1022
|
-
function
|
|
1023
|
-
|
|
1024
|
-
return document.head.appendChild(
|
|
1156
|
+
function hn() {
|
|
1157
|
+
var n = document.createElement("style");
|
|
1158
|
+
return document.head.appendChild(n), n.sheet;
|
|
1025
1159
|
}
|
|
1026
|
-
function
|
|
1027
|
-
e.config.noCalendar || e.isMobile || (
|
|
1160
|
+
function Ke() {
|
|
1161
|
+
e.config.noCalendar || e.isMobile || ($(), de(), oe());
|
|
1028
1162
|
}
|
|
1029
|
-
function
|
|
1163
|
+
function we() {
|
|
1030
1164
|
e._input.focus(), window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== void 0 ? setTimeout(e.close, 0) : e.close();
|
|
1031
1165
|
}
|
|
1032
|
-
function
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
e.
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1166
|
+
function Je(n) {
|
|
1167
|
+
n.preventDefault(), n.stopPropagation();
|
|
1168
|
+
var t = function(m) {
|
|
1169
|
+
return m.classList && m.classList.contains("flatpickr-day") && !m.classList.contains("flatpickr-disabled") && !m.classList.contains("notAllowed");
|
|
1170
|
+
}, i = en(N(n), t);
|
|
1171
|
+
if (i !== void 0) {
|
|
1172
|
+
var o = i, l = e.latestSelectedDateObj = new Date(o.dateObj.getTime()), u = (l.getMonth() < e.currentMonth || l.getMonth() > e.currentMonth + e.config.showMonths - 1) && e.config.mode !== "range";
|
|
1173
|
+
if (e.selectedDateElem = o, e.config.mode === "single")
|
|
1174
|
+
e.selectedDates = [l];
|
|
1175
|
+
else if (e.config.mode === "multiple") {
|
|
1176
|
+
var p = Ce(l);
|
|
1177
|
+
p ? e.selectedDates.splice(parseInt(p), 1) : e.selectedDates.push(l);
|
|
1178
|
+
} else
|
|
1179
|
+
e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = l, e.selectedDates.push(l), P(l, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(m, M) {
|
|
1180
|
+
return m.getTime() - M.getTime();
|
|
1181
|
+
}));
|
|
1182
|
+
if (I(), u) {
|
|
1183
|
+
var s = e.currentYear !== l.getFullYear();
|
|
1184
|
+
e.currentYear = l.getFullYear(), e.currentMonth = l.getMonth(), s && (C("onYearChange"), $()), C("onMonthChange");
|
|
1185
|
+
}
|
|
1186
|
+
if (de(), oe(), R(), !u && e.config.mode !== "range" && e.config.showMonths === 1 ? q(o) : e.selectedDateElem !== void 0 && e.hourElement === void 0 && e.selectedDateElem && e.selectedDateElem.focus(), e.hourElement !== void 0 && e.hourElement !== void 0 && e.hourElement.focus(), e.config.closeOnSelect) {
|
|
1187
|
+
var h = e.config.mode === "single" && !e.config.enableTime, f = e.config.mode === "range" && e.selectedDates.length === 2 && !e.config.enableTime;
|
|
1188
|
+
(h || f) && we();
|
|
1189
|
+
}
|
|
1190
|
+
j();
|
|
1052
1191
|
}
|
|
1053
|
-
j();
|
|
1054
1192
|
}
|
|
1055
|
-
|
|
1056
|
-
locale: [
|
|
1057
|
-
showMonths: [
|
|
1058
|
-
minDate: [
|
|
1059
|
-
maxDate: [
|
|
1193
|
+
var ce = {
|
|
1194
|
+
locale: [We, He],
|
|
1195
|
+
showMonths: [Pe, w, Ye],
|
|
1196
|
+
minDate: [E],
|
|
1197
|
+
maxDate: [E],
|
|
1198
|
+
positionElement: [Ve],
|
|
1060
1199
|
clickOpens: [
|
|
1061
|
-
()
|
|
1062
|
-
e.config.clickOpens === !0 ? (
|
|
1200
|
+
function() {
|
|
1201
|
+
e.config.clickOpens === !0 ? (v(e._input, "focus", e.open), v(e._input, "click", e.open)) : (e._input.removeEventListener("focus", e.open), e._input.removeEventListener("click", e.open));
|
|
1063
1202
|
}
|
|
1064
1203
|
]
|
|
1065
1204
|
};
|
|
1066
|
-
function
|
|
1067
|
-
if (
|
|
1068
|
-
Object.assign(e.config,
|
|
1069
|
-
for (
|
|
1070
|
-
|
|
1205
|
+
function vn(n, t) {
|
|
1206
|
+
if (n !== null && typeof n == "object") {
|
|
1207
|
+
Object.assign(e.config, n);
|
|
1208
|
+
for (var i in n)
|
|
1209
|
+
ce[i] !== void 0 && ce[i].forEach(function(o) {
|
|
1210
|
+
return o();
|
|
1211
|
+
});
|
|
1071
1212
|
} else
|
|
1072
|
-
e.config[
|
|
1073
|
-
|
|
1213
|
+
e.config[n] = t, ce[n] !== void 0 ? ce[n].forEach(function(o) {
|
|
1214
|
+
return o();
|
|
1215
|
+
}) : Te.indexOf(n) > -1 && (e.config[n] = _e(t));
|
|
1216
|
+
e.redraw(), R(!0);
|
|
1074
1217
|
}
|
|
1075
|
-
function
|
|
1076
|
-
|
|
1077
|
-
if (
|
|
1078
|
-
i =
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
else if (typeof
|
|
1218
|
+
function Be(n, t) {
|
|
1219
|
+
var i = [];
|
|
1220
|
+
if (n instanceof Array)
|
|
1221
|
+
i = n.map(function(o) {
|
|
1222
|
+
return e.parseDate(o, t);
|
|
1223
|
+
});
|
|
1224
|
+
else if (n instanceof Date || typeof n == "number")
|
|
1225
|
+
i = [e.parseDate(n, t)];
|
|
1226
|
+
else if (typeof n == "string")
|
|
1082
1227
|
switch (e.config.mode) {
|
|
1083
1228
|
case "single":
|
|
1084
1229
|
case "time":
|
|
1085
|
-
i = [e.parseDate(
|
|
1230
|
+
i = [e.parseDate(n, t)];
|
|
1086
1231
|
break;
|
|
1087
1232
|
case "multiple":
|
|
1088
|
-
i =
|
|
1233
|
+
i = n.split(e.config.conjunction).map(function(o) {
|
|
1234
|
+
return e.parseDate(o, t);
|
|
1235
|
+
});
|
|
1089
1236
|
break;
|
|
1090
1237
|
case "range":
|
|
1091
|
-
i =
|
|
1238
|
+
i = n.split(e.l10n.rangeSeparator).map(function(o) {
|
|
1239
|
+
return e.parseDate(o, t);
|
|
1240
|
+
});
|
|
1092
1241
|
break;
|
|
1093
1242
|
}
|
|
1094
1243
|
else
|
|
1095
|
-
e.config.errorHandler(new Error(
|
|
1096
|
-
e.selectedDates = e.config.allowInvalidPreload ? i : i.filter((
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
Re(t, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), N(void 0, n), Y(), e.selectedDates.length === 0 && e.clear(!1), $(n), n && w("onChange");
|
|
1244
|
+
e.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(n)));
|
|
1245
|
+
e.selectedDates = e.config.allowInvalidPreload ? i : i.filter(function(o) {
|
|
1246
|
+
return o instanceof Date && B(o, !1);
|
|
1247
|
+
}), e.config.mode === "range" && e.selectedDates.sort(function(o, l) {
|
|
1248
|
+
return o.getTime() - l.getTime();
|
|
1249
|
+
});
|
|
1102
1250
|
}
|
|
1103
|
-
function
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1251
|
+
function Dn(n, t, i) {
|
|
1252
|
+
if (t === void 0 && (t = !1), i === void 0 && (i = e.config.dateFormat), n !== 0 && !n || n instanceof Array && n.length === 0)
|
|
1253
|
+
return e.clear(t);
|
|
1254
|
+
Be(n, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), E(void 0, t), A(), e.selectedDates.length === 0 && e.clear(!1), R(t), t && C("onChange");
|
|
1255
|
+
}
|
|
1256
|
+
function ze(n) {
|
|
1257
|
+
return n.slice().map(function(t) {
|
|
1258
|
+
return typeof t == "string" || typeof t == "number" || t instanceof Date ? e.parseDate(t, void 0, !0) : t && typeof t == "object" && t.from && t.to ? {
|
|
1259
|
+
from: e.parseDate(t.from, void 0),
|
|
1260
|
+
to: e.parseDate(t.to, void 0)
|
|
1261
|
+
} : t;
|
|
1262
|
+
}).filter(function(t) {
|
|
1263
|
+
return t;
|
|
1264
|
+
});
|
|
1108
1265
|
}
|
|
1109
|
-
function
|
|
1266
|
+
function Mn() {
|
|
1110
1267
|
e.selectedDates = [], e.now = e.parseDate(e.config.now) || /* @__PURE__ */ new Date();
|
|
1111
|
-
|
|
1112
|
-
|
|
1268
|
+
var n = e.config.defaultDate || ((e.input.nodeName === "INPUT" || e.input.nodeName === "TEXTAREA") && e.input.placeholder && e.input.value === e.input.placeholder ? null : e.input.value);
|
|
1269
|
+
n && Be(n, e.config.dateFormat), e._initialDate = e.selectedDates.length > 0 ? e.selectedDates[0] : e.config.minDate && e.config.minDate.getTime() > e.now.getTime() ? e.config.minDate : e.config.maxDate && e.config.maxDate.getTime() < e.now.getTime() ? e.config.maxDate : e.now, e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth(), e.selectedDates.length > 0 && (e.latestSelectedDateObj = e.selectedDates[0]), e.config.minTime !== void 0 && (e.config.minTime = e.parseDate(e.config.minTime, "H:i")), e.config.maxTime !== void 0 && (e.config.maxTime = e.parseDate(e.config.maxTime, "H:i")), e.minDateHasTime = !!e.config.minDate && (e.config.minDate.getHours() > 0 || e.config.minDate.getMinutes() > 0 || e.config.minDate.getSeconds() > 0), e.maxDateHasTime = !!e.config.maxDate && (e.config.maxDate.getHours() > 0 || e.config.maxDate.getMinutes() > 0 || e.config.maxDate.getSeconds() > 0);
|
|
1113
1270
|
}
|
|
1114
|
-
function
|
|
1115
|
-
if (e.input =
|
|
1271
|
+
function bn() {
|
|
1272
|
+
if (e.input = Re(), !e.input) {
|
|
1116
1273
|
e.config.errorHandler(new Error("Invalid input element specified"));
|
|
1117
1274
|
return;
|
|
1118
1275
|
}
|
|
1119
|
-
e.input._type = e.input.type, e.input.type = "text", e.input.classList.add("flatpickr-input"), e._input = e.input, e.config.altInput && (e.altInput =
|
|
1276
|
+
e.input._type = e.input.type, e.input.type = "text", e.input.classList.add("flatpickr-input"), e._input = e.input, e.config.altInput && (e.altInput = D(e.input.nodeName, e.config.altInputClass), e._input = e.altInput, e.altInput.placeholder = e.input.placeholder, e.altInput.disabled = e.input.disabled, e.altInput.required = e.input.required, e.altInput.tabIndex = e.input.tabIndex, e.altInput.type = "text", e.input.setAttribute("type", "hidden"), !e.config.static && e.input.parentNode && e.input.parentNode.insertBefore(e.altInput, e.input.nextSibling)), e.config.allowInput || e._input.setAttribute("readonly", "readonly"), Ve();
|
|
1120
1277
|
}
|
|
1121
|
-
function
|
|
1122
|
-
|
|
1123
|
-
|
|
1278
|
+
function Ve() {
|
|
1279
|
+
e._positionElement = e.config.positionElement || e._input;
|
|
1280
|
+
}
|
|
1281
|
+
function wn() {
|
|
1282
|
+
var n = e.config.enableTime ? e.config.noCalendar ? "time" : "datetime-local" : "date";
|
|
1283
|
+
e.mobileInput = D("input", e.input.className + " flatpickr-mobile"), e.mobileInput.tabIndex = 1, e.mobileInput.type = n, e.mobileInput.disabled = e.input.disabled, e.mobileInput.required = e.input.required, e.mobileInput.placeholder = e.input.placeholder, e.mobileFormatStr = n === "datetime-local" ? "Y-m-d\\TH:i:S" : n === "date" ? "Y-m-d" : "H:i:S", e.selectedDates.length > 0 && (e.mobileInput.defaultValue = e.mobileInput.value = e.formatDate(e.selectedDates[0], e.mobileFormatStr)), e.config.minDate && (e.mobileInput.min = e.formatDate(e.config.minDate, "Y-m-d")), e.config.maxDate && (e.mobileInput.max = e.formatDate(e.config.maxDate, "Y-m-d")), e.input.getAttribute("step") && (e.mobileInput.step = String(e.input.getAttribute("step"))), e.input.type = "hidden", e.altInput !== void 0 && (e.altInput.type = "hidden");
|
|
1124
1284
|
try {
|
|
1125
1285
|
e.input.parentNode && e.input.parentNode.insertBefore(e.mobileInput, e.input.nextSibling);
|
|
1126
1286
|
} catch {
|
|
1127
1287
|
}
|
|
1128
|
-
|
|
1129
|
-
e.setDate(
|
|
1288
|
+
v(e.mobileInput, "change", function(t) {
|
|
1289
|
+
e.setDate(N(t).value, !1, e.mobileFormatStr), C("onChange"), C("onClose");
|
|
1130
1290
|
});
|
|
1131
1291
|
}
|
|
1132
|
-
function
|
|
1292
|
+
function yn(n) {
|
|
1133
1293
|
if (e.isOpen === !0)
|
|
1134
1294
|
return e.close();
|
|
1135
|
-
e.open(
|
|
1295
|
+
e.open(n);
|
|
1296
|
+
}
|
|
1297
|
+
function C(n, t) {
|
|
1298
|
+
if (e.config !== void 0) {
|
|
1299
|
+
var i = e.config[n];
|
|
1300
|
+
if (i !== void 0 && i.length > 0)
|
|
1301
|
+
for (var o = 0; i[o] && o < i.length; o++)
|
|
1302
|
+
i[o](e.selectedDates, e.input.value, e, t);
|
|
1303
|
+
n === "onChange" && (e.input.dispatchEvent(ye("change")), e.input.dispatchEvent(ye("input")));
|
|
1304
|
+
}
|
|
1136
1305
|
}
|
|
1137
|
-
function
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
const n = document.createEvent("Event");
|
|
1148
|
-
return n.initEvent(t, !0, !0), n;
|
|
1149
|
-
}
|
|
1150
|
-
function ye(t) {
|
|
1151
|
-
for (let n = 0; n < e.selectedDates.length; n++)
|
|
1152
|
-
if (I(e.selectedDates[n], t) === 0)
|
|
1153
|
-
return "" + n;
|
|
1306
|
+
function ye(n) {
|
|
1307
|
+
var t = document.createEvent("Event");
|
|
1308
|
+
return t.initEvent(n, !0, !0), t;
|
|
1309
|
+
}
|
|
1310
|
+
function Ce(n) {
|
|
1311
|
+
for (var t = 0; t < e.selectedDates.length; t++) {
|
|
1312
|
+
var i = e.selectedDates[t];
|
|
1313
|
+
if (i instanceof Date && P(i, n) === 0)
|
|
1314
|
+
return "" + t;
|
|
1315
|
+
}
|
|
1154
1316
|
return !1;
|
|
1155
1317
|
}
|
|
1156
|
-
function
|
|
1157
|
-
return e.config.mode !== "range" || e.selectedDates.length < 2 ? !1 :
|
|
1318
|
+
function Cn(n) {
|
|
1319
|
+
return e.config.mode !== "range" || e.selectedDates.length < 2 ? !1 : P(n, e.selectedDates[0]) >= 0 && P(n, e.selectedDates[1]) <= 0;
|
|
1158
1320
|
}
|
|
1159
|
-
function
|
|
1160
|
-
e.config.noCalendar || e.isMobile || !e.monthNav || (e.yearElements.forEach((
|
|
1161
|
-
|
|
1162
|
-
i.setMonth(e.currentMonth +
|
|
1321
|
+
function de() {
|
|
1322
|
+
e.config.noCalendar || e.isMobile || !e.monthNav || (e.yearElements.forEach(function(n, t) {
|
|
1323
|
+
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
1324
|
+
i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent = he(i.getMonth(), e.config.shorthandCurrentMonth, e.l10n) + " " : e.monthsDropdownContainer.value = i.getMonth().toString(), n.value = i.getFullYear().toString();
|
|
1163
1325
|
}), e._hidePrevMonthArrow = e.config.minDate !== void 0 && (e.currentYear === e.config.minDate.getFullYear() ? e.currentMonth <= e.config.minDate.getMonth() : e.currentYear < e.config.minDate.getFullYear()), e._hideNextMonthArrow = e.config.maxDate !== void 0 && (e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth + 1 > e.config.maxDate.getMonth() : e.currentYear > e.config.maxDate.getFullYear()));
|
|
1164
1326
|
}
|
|
1165
|
-
function
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1327
|
+
function Ee(n) {
|
|
1328
|
+
var t = n || (e.config.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
1329
|
+
return e.selectedDates.map(function(i) {
|
|
1330
|
+
return e.formatDate(i, t);
|
|
1331
|
+
}).filter(function(i, o, l) {
|
|
1332
|
+
return e.config.mode !== "range" || e.config.enableTime || l.indexOf(i) === o;
|
|
1333
|
+
}).join(e.config.mode !== "range" ? e.config.conjunction : e.l10n.rangeSeparator);
|
|
1334
|
+
}
|
|
1335
|
+
function R(n) {
|
|
1336
|
+
n === void 0 && (n = !0), e.mobileInput !== void 0 && e.mobileFormatStr && (e.mobileInput.value = e.latestSelectedDateObj !== void 0 ? e.formatDate(e.latestSelectedDateObj, e.mobileFormatStr) : ""), e.input.value = Ee(e.config.dateFormat), e.altInput !== void 0 && (e.altInput.value = Ee(e.config.altFormat)), n !== !1 && C("onValueUpdate");
|
|
1337
|
+
}
|
|
1338
|
+
function En(n) {
|
|
1339
|
+
var t = N(n), i = e.prevMonthNav.contains(t), o = e.nextMonthNav.contains(t);
|
|
1340
|
+
i || o ? Me(i ? -1 : 1) : e.yearElements.indexOf(t) >= 0 ? t.select() : t.classList.contains("arrowUp") ? e.changeYear(e.currentYear + 1) : t.classList.contains("arrowDown") && e.changeYear(e.currentYear - 1);
|
|
1341
|
+
}
|
|
1342
|
+
function xn(n) {
|
|
1343
|
+
n.preventDefault();
|
|
1344
|
+
var t = n.type === "keydown", i = N(n), o = i;
|
|
1345
|
+
e.amPM !== void 0 && i === e.amPM && (e.amPM.textContent = e.l10n.amPM[Y(e.amPM.textContent === e.l10n.amPM[0])]);
|
|
1346
|
+
var l = parseFloat(o.getAttribute("min")), u = parseFloat(o.getAttribute("max")), p = parseFloat(o.getAttribute("step")), s = parseInt(o.value, 10), h = n.delta || (t ? n.which === 38 ? 1 : -1 : 0), f = s + p * h;
|
|
1347
|
+
if (typeof o.value < "u" && o.value.length === 2) {
|
|
1348
|
+
var m = o === e.hourElement, M = o === e.minuteElement;
|
|
1349
|
+
f < l ? (f = u + f + Y(!m) + (Y(m) && Y(!e.amPM)), M && U(void 0, -1, e.hourElement)) : f > u && (f = o === e.hourElement ? f - u - Y(!e.amPM) : l, M && U(void 0, 1, e.hourElement)), e.amPM && m && (p === 1 ? f + s === 23 : Math.abs(f - s) > p) && (e.amPM.textContent = e.l10n.amPM[Y(e.amPM.textContent === e.l10n.amPM[0])]), o.value = S(f);
|
|
1184
1350
|
}
|
|
1185
1351
|
}
|
|
1186
|
-
return
|
|
1352
|
+
return g(), e;
|
|
1187
1353
|
}
|
|
1188
|
-
function
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1354
|
+
function ee(a, r) {
|
|
1355
|
+
for (var e = Array.prototype.slice.call(a).filter(function(b) {
|
|
1356
|
+
return b instanceof HTMLElement;
|
|
1357
|
+
}), c = [], g = 0; g < e.length; g++) {
|
|
1358
|
+
var d = e[g];
|
|
1192
1359
|
try {
|
|
1193
|
-
if (
|
|
1360
|
+
if (d.getAttribute("data-fp-omit") !== null)
|
|
1194
1361
|
continue;
|
|
1195
|
-
|
|
1196
|
-
} catch (
|
|
1197
|
-
console.error(
|
|
1362
|
+
d._flatpickr !== void 0 && (d._flatpickr.destroy(), d._flatpickr = void 0), d._flatpickr = Gn(d, r || {}), c.push(d._flatpickr);
|
|
1363
|
+
} catch (b) {
|
|
1364
|
+
console.error(b);
|
|
1198
1365
|
}
|
|
1199
1366
|
}
|
|
1200
|
-
return
|
|
1367
|
+
return c.length === 1 ? c[0] : c;
|
|
1201
1368
|
}
|
|
1202
1369
|
typeof HTMLElement < "u" && typeof HTMLCollection < "u" && typeof NodeList < "u" && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function(a) {
|
|
1203
|
-
return
|
|
1370
|
+
return ee(this, a);
|
|
1204
1371
|
}, HTMLElement.prototype.flatpickr = function(a) {
|
|
1205
|
-
return
|
|
1372
|
+
return ee([this], a);
|
|
1206
1373
|
});
|
|
1207
|
-
var
|
|
1208
|
-
return typeof a == "string" ?
|
|
1374
|
+
var k = function(a, r) {
|
|
1375
|
+
return typeof a == "string" ? ee(window.document.querySelectorAll(a), r) : a instanceof Node ? ee([a], r) : ee(a, r);
|
|
1209
1376
|
};
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
en:
|
|
1213
|
-
default:
|
|
1377
|
+
k.defaultConfig = {};
|
|
1378
|
+
k.l10ns = {
|
|
1379
|
+
en: T({}, re),
|
|
1380
|
+
default: T({}, re)
|
|
1214
1381
|
};
|
|
1215
|
-
|
|
1216
|
-
|
|
1382
|
+
k.localize = function(a) {
|
|
1383
|
+
k.l10ns.default = T(T({}, k.l10ns.default), a);
|
|
1217
1384
|
};
|
|
1218
|
-
|
|
1219
|
-
|
|
1385
|
+
k.setDefaults = function(a) {
|
|
1386
|
+
k.defaultConfig = T(T({}, k.defaultConfig), a);
|
|
1220
1387
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1388
|
+
k.parseDate = Oe({});
|
|
1389
|
+
k.formatDate = nn({});
|
|
1390
|
+
k.compareDates = P;
|
|
1224
1391
|
typeof jQuery < "u" && typeof jQuery.fn < "u" && (jQuery.fn.flatpickr = function(a) {
|
|
1225
|
-
return
|
|
1392
|
+
return ee(this, a);
|
|
1226
1393
|
});
|
|
1227
1394
|
Date.prototype.fp_incr = function(a) {
|
|
1228
1395
|
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof a == "string" ? parseInt(a, 10) : a));
|
|
1229
1396
|
};
|
|
1230
|
-
typeof window < "u" && (window.flatpickr =
|
|
1231
|
-
var
|
|
1232
|
-
(function(a,
|
|
1233
|
-
(function(e,
|
|
1234
|
-
|
|
1235
|
-
})(
|
|
1236
|
-
var
|
|
1397
|
+
typeof window < "u" && (window.flatpickr = k);
|
|
1398
|
+
var Fe = { exports: {} };
|
|
1399
|
+
(function(a, r) {
|
|
1400
|
+
(function(e, c) {
|
|
1401
|
+
c(r);
|
|
1402
|
+
})(Xe, function(e) {
|
|
1403
|
+
var c = typeof window < "u" && window.flatpickr !== void 0 ? window.flatpickr : {
|
|
1237
1404
|
l10ns: {}
|
|
1238
|
-
},
|
|
1405
|
+
}, g = {
|
|
1239
1406
|
weekdays: {
|
|
1240
1407
|
shorthand: ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"],
|
|
1241
1408
|
longhand: [
|
|
@@ -1289,17 +1456,17 @@ var Oe = { exports: {} };
|
|
|
1289
1456
|
amPM: ["ÖÖ", "ÖS"],
|
|
1290
1457
|
time_24hr: !0
|
|
1291
1458
|
};
|
|
1292
|
-
|
|
1293
|
-
var
|
|
1294
|
-
e.Turkish =
|
|
1459
|
+
c.l10ns.tr = g;
|
|
1460
|
+
var d = c.l10ns;
|
|
1461
|
+
e.Turkish = g, e.default = d, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1295
1462
|
});
|
|
1296
|
-
})(
|
|
1297
|
-
var
|
|
1298
|
-
(function(a,
|
|
1299
|
-
(function(e,
|
|
1300
|
-
|
|
1301
|
-
})(
|
|
1302
|
-
var
|
|
1463
|
+
})(Fe, Fe.exports);
|
|
1464
|
+
var $n = Fe.exports, Ne = { exports: {} };
|
|
1465
|
+
(function(a, r) {
|
|
1466
|
+
(function(e, c) {
|
|
1467
|
+
c(r);
|
|
1468
|
+
})(Xe, function(e) {
|
|
1469
|
+
var c = {
|
|
1303
1470
|
weekdays: {
|
|
1304
1471
|
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1305
1472
|
longhand: [
|
|
@@ -1344,11 +1511,11 @@ var Wt = Oe.exports, _e = { exports: {} };
|
|
|
1344
1511
|
},
|
|
1345
1512
|
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
1346
1513
|
firstDayOfWeek: 0,
|
|
1347
|
-
ordinal: function(
|
|
1348
|
-
var
|
|
1349
|
-
if (
|
|
1514
|
+
ordinal: function(g) {
|
|
1515
|
+
var d = g % 100;
|
|
1516
|
+
if (d > 3 && d < 21)
|
|
1350
1517
|
return "th";
|
|
1351
|
-
switch (
|
|
1518
|
+
switch (d % 10) {
|
|
1352
1519
|
case 1:
|
|
1353
1520
|
return "st";
|
|
1354
1521
|
case 2:
|
|
@@ -1370,24 +1537,24 @@ var Wt = Oe.exports, _e = { exports: {} };
|
|
|
1370
1537
|
minuteAriaLabel: "Minute",
|
|
1371
1538
|
time_24hr: !1
|
|
1372
1539
|
};
|
|
1373
|
-
e.default =
|
|
1540
|
+
e.default = c, e.english = c, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1374
1541
|
});
|
|
1375
|
-
})(
|
|
1376
|
-
var
|
|
1377
|
-
const
|
|
1542
|
+
})(Ne, Ne.exports);
|
|
1543
|
+
var Zn = Ne.exports;
|
|
1544
|
+
const Qe = (a, r, e) => {
|
|
1378
1545
|
if (a)
|
|
1379
1546
|
return a;
|
|
1380
|
-
switch (
|
|
1547
|
+
switch (r) {
|
|
1381
1548
|
case "time":
|
|
1382
|
-
return
|
|
1549
|
+
return Wn;
|
|
1383
1550
|
case "range":
|
|
1384
|
-
return
|
|
1551
|
+
return Ge;
|
|
1385
1552
|
case "datetime":
|
|
1386
|
-
return e ?
|
|
1553
|
+
return e ? jn : Rn;
|
|
1387
1554
|
default:
|
|
1388
|
-
return
|
|
1555
|
+
return Ge;
|
|
1389
1556
|
}
|
|
1390
|
-
},
|
|
1557
|
+
}, Qn = (a) => {
|
|
1391
1558
|
switch (a) {
|
|
1392
1559
|
case "time":
|
|
1393
1560
|
return {
|
|
@@ -1402,77 +1569,77 @@ const Ve = (a, o, e) => {
|
|
|
1402
1569
|
default:
|
|
1403
1570
|
return { mode: a, enableTime: !1 };
|
|
1404
1571
|
}
|
|
1405
|
-
},
|
|
1572
|
+
}, ot = Pn.forwardRef(
|
|
1406
1573
|
({
|
|
1407
1574
|
value: a,
|
|
1408
|
-
format:
|
|
1575
|
+
format: r,
|
|
1409
1576
|
mode: e = "single",
|
|
1410
|
-
hasShortFormat:
|
|
1411
|
-
suffix:
|
|
1412
|
-
minDate:
|
|
1413
|
-
maxDate:
|
|
1414
|
-
onChange:
|
|
1415
|
-
onClose:
|
|
1416
|
-
disable:
|
|
1417
|
-
enable:
|
|
1418
|
-
...
|
|
1419
|
-
},
|
|
1420
|
-
var
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1423
|
-
...
|
|
1424
|
-
dateFormat:
|
|
1577
|
+
hasShortFormat: c,
|
|
1578
|
+
suffix: g,
|
|
1579
|
+
minDate: d,
|
|
1580
|
+
maxDate: b,
|
|
1581
|
+
onChange: w,
|
|
1582
|
+
onClose: x,
|
|
1583
|
+
disable: W = [],
|
|
1584
|
+
enable: y = [],
|
|
1585
|
+
...I
|
|
1586
|
+
}, A) => {
|
|
1587
|
+
var V;
|
|
1588
|
+
const O = Ue(null), H = Ue(), v = Qn(e);
|
|
1589
|
+
qe(() => (H.current = k(O.current, {
|
|
1590
|
+
...v,
|
|
1591
|
+
dateFormat: Qe(r, e, c),
|
|
1425
1592
|
defaultDate: a,
|
|
1426
|
-
minDate:
|
|
1427
|
-
disable:
|
|
1428
|
-
enable:
|
|
1593
|
+
minDate: d,
|
|
1594
|
+
disable: W,
|
|
1595
|
+
enable: y,
|
|
1429
1596
|
hourIncrement: 1,
|
|
1430
1597
|
minuteIncrement: 1,
|
|
1431
|
-
maxDate:
|
|
1432
|
-
locale:
|
|
1598
|
+
maxDate: b,
|
|
1599
|
+
locale: Yn() === "tr" ? $n.Turkish : Zn.english,
|
|
1433
1600
|
time_24hr: !0,
|
|
1434
|
-
parseDate: (
|
|
1435
|
-
formatDate: (
|
|
1436
|
-
onChange: (
|
|
1437
|
-
if (
|
|
1601
|
+
parseDate: (E) => Q(E, me).toDate(),
|
|
1602
|
+
formatDate: (E) => Q(E).format(Qe(void 0, e)),
|
|
1603
|
+
onChange: (E) => {
|
|
1604
|
+
if (w)
|
|
1438
1605
|
switch (e) {
|
|
1439
1606
|
case "range":
|
|
1440
|
-
|
|
1441
|
-
starDate:
|
|
1442
|
-
endDate:
|
|
1607
|
+
w({
|
|
1608
|
+
starDate: Q(E[0]).format(me),
|
|
1609
|
+
endDate: Q(E[1]).format(me)
|
|
1443
1610
|
});
|
|
1444
1611
|
break;
|
|
1445
1612
|
case "datetime":
|
|
1446
|
-
|
|
1447
|
-
|
|
1613
|
+
w(
|
|
1614
|
+
Q(E[0]).format(Hn)
|
|
1448
1615
|
);
|
|
1449
1616
|
break;
|
|
1450
1617
|
default:
|
|
1451
|
-
|
|
1618
|
+
w(Q(E[0]).format(me));
|
|
1452
1619
|
break;
|
|
1453
1620
|
}
|
|
1454
1621
|
},
|
|
1455
|
-
onClose: (
|
|
1456
|
-
|
|
1622
|
+
onClose: (E) => {
|
|
1623
|
+
x && x(E);
|
|
1457
1624
|
}
|
|
1458
1625
|
}), () => {
|
|
1459
|
-
var
|
|
1460
|
-
(
|
|
1461
|
-
}), [
|
|
1462
|
-
|
|
1463
|
-
}, [
|
|
1464
|
-
const
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
-
|
|
1626
|
+
var E;
|
|
1627
|
+
(E = H.current) == null || E.destroy();
|
|
1628
|
+
}), [O, H, d, b, y]), qe(() => {
|
|
1629
|
+
H && H.current && H.current.set("maxDate", b);
|
|
1630
|
+
}, [b]);
|
|
1631
|
+
const j = a && ((V = JSON.stringify(a)) == null ? void 0 : V.length) > 0 ? Ln(a, e, c) : "";
|
|
1632
|
+
return /* @__PURE__ */ ke.jsx("div", { "data-testid": "datepicker", ref: A, children: /* @__PURE__ */ ke.jsx(
|
|
1633
|
+
Jn,
|
|
1467
1634
|
{
|
|
1468
|
-
...
|
|
1469
|
-
ref:
|
|
1470
|
-
value:
|
|
1471
|
-
suffix:
|
|
1635
|
+
...I,
|
|
1636
|
+
ref: O,
|
|
1637
|
+
value: j,
|
|
1638
|
+
suffix: g || /* @__PURE__ */ ke.jsx(Kn, { name: "calendar" })
|
|
1472
1639
|
}
|
|
1473
1640
|
) });
|
|
1474
1641
|
}
|
|
1475
1642
|
);
|
|
1476
1643
|
export {
|
|
1477
|
-
|
|
1644
|
+
ot as default
|
|
1478
1645
|
};
|