@lanrenbang/basecoat-ultra 0.1.6 → 0.2.0
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/{LICENSE → LICENSE.md} +2 -2
- package/README.md +77 -144
- package/dist/css/basecoat.cdn.css +134 -1726
- package/dist/css/basecoat.cdn.min.css +1 -1
- package/dist/css/basecoat.css +34 -24
- package/dist/css/datepicker.css +277 -1080
- package/dist/css/datepicker.min.css +2 -1
- package/dist/css/resizable.css +39 -60
- package/dist/css/resizable.min.css +1 -1
- package/dist/js/all.js +1 -0
- package/dist/js/all.min.js +1 -0
- package/dist/js/basecoat.js +6 -4
- package/dist/js/basecoat.min.js +12 -12
- package/dist/js/carousel.js +8 -0
- package/dist/js/carousel.min.js +24 -17
- package/dist/js/catppuccin-theme-switcher.js +41 -6
- package/dist/js/catppuccin-theme-switcher.min.js +62 -47
- package/dist/js/datepicker.js +211 -46
- package/dist/js/datepicker.min.js +566 -423
- package/dist/js/input-otp.js +69 -79
- package/dist/js/input-otp.min.js +30 -35
- package/dist/js/pagination.js +107 -0
- package/dist/js/pagination.min.js +43 -0
- package/dist/js/resizable.js +35 -46
- package/dist/js/resizable.min.js +180 -182
- package/dist/js/sheet.js +28 -26
- package/dist/js/sheet.min.js +34 -34
- package/dist/js/toast.js +17 -35
- package/dist/js/toast.min.js +35 -56
- package/dist/js/toggle.js +5 -0
- package/dist/js/toggle.min.js +15 -10
- package/package.json +28 -13
- package/CHANGELOG-cn.md +0 -54
- package/CHANGELOG.md +0 -54
- package/README-cn.md +0 -199
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ke = [
|
|
2
2
|
"onChange",
|
|
3
3
|
"onClose",
|
|
4
4
|
"onDayCreate",
|
|
@@ -11,7 +11,7 @@ var xe = [
|
|
|
11
11
|
"onValueUpdate",
|
|
12
12
|
"onYearChange",
|
|
13
13
|
"onPreCalendarPosition"
|
|
14
|
-
],
|
|
14
|
+
], G = {
|
|
15
15
|
_disable: [],
|
|
16
16
|
allowInput: !1,
|
|
17
17
|
allowInvalidPreload: !1,
|
|
@@ -73,7 +73,7 @@ var xe = [
|
|
|
73
73
|
time_24hr: !1,
|
|
74
74
|
weekNumbers: !1,
|
|
75
75
|
wrap: !1
|
|
76
|
-
},
|
|
76
|
+
}, ie = {
|
|
77
77
|
weekdays: {
|
|
78
78
|
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
79
79
|
longhand: [
|
|
@@ -143,21 +143,21 @@ var xe = [
|
|
|
143
143
|
hourAriaLabel: "Hour",
|
|
144
144
|
minuteAriaLabel: "Minute",
|
|
145
145
|
time_24hr: !1
|
|
146
|
-
},
|
|
146
|
+
}, S = function(a, r) {
|
|
147
147
|
return r === void 0 && (r = 2), ("000" + a).slice(r * -1);
|
|
148
148
|
}, O = function(a) {
|
|
149
149
|
return a === !0 ? 1 : 0;
|
|
150
150
|
};
|
|
151
|
-
function
|
|
151
|
+
function Be(a, r) {
|
|
152
152
|
var e;
|
|
153
153
|
return function() {
|
|
154
|
-
var
|
|
154
|
+
var s = this, m = arguments;
|
|
155
155
|
clearTimeout(e), e = setTimeout(function() {
|
|
156
|
-
return a.apply(
|
|
156
|
+
return a.apply(s, m);
|
|
157
157
|
}, r);
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var Te = function(a) {
|
|
161
161
|
return a instanceof Array ? a : [a];
|
|
162
162
|
};
|
|
163
163
|
function T(a, r, e) {
|
|
@@ -166,25 +166,25 @@ function T(a, r, e) {
|
|
|
166
166
|
a.classList.remove(r);
|
|
167
167
|
}
|
|
168
168
|
function v(a, r, e) {
|
|
169
|
-
var
|
|
170
|
-
return r = r || "", e = e || "",
|
|
169
|
+
var s = window.document.createElement(a);
|
|
170
|
+
return r = r || "", e = e || "", s.className = r, e !== void 0 && (s.textContent = e), s;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ge(a) {
|
|
173
173
|
for (; a.firstChild; )
|
|
174
174
|
a.removeChild(a.firstChild);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Ve(a, r) {
|
|
177
177
|
if (r(a))
|
|
178
178
|
return a;
|
|
179
179
|
if (a.parentNode)
|
|
180
|
-
return
|
|
180
|
+
return Ve(a.parentNode, r);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
var e = v("div", "numInputWrapper"),
|
|
184
|
-
if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ?
|
|
185
|
-
for (var
|
|
186
|
-
|
|
187
|
-
return e.appendChild(
|
|
182
|
+
function me(a, r) {
|
|
183
|
+
var e = v("div", "numInputWrapper"), s = v("input", "numInput " + a), m = v("span", "arrowUp"), g = v("span", "arrowDown");
|
|
184
|
+
if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ? s.type = "number" : (s.type = "text", s.pattern = "\\d*"), r !== void 0)
|
|
185
|
+
for (var w in r)
|
|
186
|
+
s.setAttribute(w, r[w]);
|
|
187
|
+
return e.appendChild(s), e.appendChild(m), e.appendChild(g), e;
|
|
188
188
|
}
|
|
189
189
|
function _(a) {
|
|
190
190
|
try {
|
|
@@ -197,11 +197,11 @@ function _(a) {
|
|
|
197
197
|
return a.target;
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
var
|
|
201
|
-
},
|
|
200
|
+
var Se = function() {
|
|
201
|
+
}, pe = function(a, r, e) {
|
|
202
202
|
return e.months[r ? "shorthand" : "longhand"][a];
|
|
203
|
-
},
|
|
204
|
-
D:
|
|
203
|
+
}, _n = {
|
|
204
|
+
D: Se,
|
|
205
205
|
F: function(a, r, e) {
|
|
206
206
|
a.setMonth(e.months.longhand.indexOf(r));
|
|
207
207
|
},
|
|
@@ -227,8 +227,8 @@ var ke = function() {
|
|
|
227
227
|
return new Date(parseFloat(r) * 1e3);
|
|
228
228
|
},
|
|
229
229
|
W: function(a, r, e) {
|
|
230
|
-
var
|
|
231
|
-
return
|
|
230
|
+
var s = parseInt(r), m = new Date(a.getFullYear(), 0, 2 + (s - 1) * 7, 0, 0, 0, 0);
|
|
231
|
+
return m.setDate(m.getDate() - m.getDay() + e.firstDayOfWeek), m;
|
|
232
232
|
},
|
|
233
233
|
Y: function(a, r) {
|
|
234
234
|
a.setFullYear(parseFloat(r));
|
|
@@ -248,7 +248,7 @@ var ke = function() {
|
|
|
248
248
|
j: function(a, r) {
|
|
249
249
|
a.setDate(parseFloat(r));
|
|
250
250
|
},
|
|
251
|
-
l:
|
|
251
|
+
l: Se,
|
|
252
252
|
m: function(a, r) {
|
|
253
253
|
a.setMonth(parseFloat(r) - 1);
|
|
254
254
|
},
|
|
@@ -261,11 +261,11 @@ var ke = function() {
|
|
|
261
261
|
u: function(a, r) {
|
|
262
262
|
return new Date(parseFloat(r));
|
|
263
263
|
},
|
|
264
|
-
w:
|
|
264
|
+
w: Se,
|
|
265
265
|
y: function(a, r) {
|
|
266
266
|
a.setFullYear(2e3 + parseFloat(r));
|
|
267
267
|
}
|
|
268
|
-
},
|
|
268
|
+
}, B = {
|
|
269
269
|
D: "",
|
|
270
270
|
F: "",
|
|
271
271
|
G: "(\\d\\d|\\d)",
|
|
@@ -289,21 +289,21 @@ var ke = function() {
|
|
|
289
289
|
u: "(.+)",
|
|
290
290
|
w: "(\\d\\d|\\d)",
|
|
291
291
|
y: "(\\d{2})"
|
|
292
|
-
},
|
|
292
|
+
}, ae = {
|
|
293
293
|
Z: function(a) {
|
|
294
294
|
return a.toISOString();
|
|
295
295
|
},
|
|
296
296
|
D: function(a, r, e) {
|
|
297
|
-
return r.weekdays.shorthand[
|
|
297
|
+
return r.weekdays.shorthand[ae.w(a, r, e)];
|
|
298
298
|
},
|
|
299
299
|
F: function(a, r, e) {
|
|
300
|
-
return
|
|
300
|
+
return pe(ae.n(a, r, e) - 1, !1, r);
|
|
301
301
|
},
|
|
302
302
|
G: function(a, r, e) {
|
|
303
|
-
return
|
|
303
|
+
return S(ae.h(a, r, e));
|
|
304
304
|
},
|
|
305
305
|
H: function(a) {
|
|
306
|
-
return
|
|
306
|
+
return S(a.getHours());
|
|
307
307
|
},
|
|
308
308
|
J: function(a, r) {
|
|
309
309
|
return r.ordinal !== void 0 ? a.getDate() + r.ordinal(a.getDate()) : a.getDate();
|
|
@@ -312,10 +312,10 @@ var ke = function() {
|
|
|
312
312
|
return r.amPM[O(a.getHours() > 11)];
|
|
313
313
|
},
|
|
314
314
|
M: function(a, r) {
|
|
315
|
-
return
|
|
315
|
+
return pe(a.getMonth(), !0, r);
|
|
316
316
|
},
|
|
317
317
|
S: function(a) {
|
|
318
|
-
return
|
|
318
|
+
return S(a.getSeconds());
|
|
319
319
|
},
|
|
320
320
|
U: function(a) {
|
|
321
321
|
return a.getTime() / 1e3;
|
|
@@ -324,16 +324,16 @@ var ke = function() {
|
|
|
324
324
|
return e.getWeek(a);
|
|
325
325
|
},
|
|
326
326
|
Y: function(a) {
|
|
327
|
-
return
|
|
327
|
+
return S(a.getFullYear(), 4);
|
|
328
328
|
},
|
|
329
329
|
d: function(a) {
|
|
330
|
-
return
|
|
330
|
+
return S(a.getDate());
|
|
331
331
|
},
|
|
332
332
|
h: function(a) {
|
|
333
333
|
return a.getHours() % 12 ? a.getHours() % 12 : 12;
|
|
334
334
|
},
|
|
335
335
|
i: function(a) {
|
|
336
|
-
return
|
|
336
|
+
return S(a.getMinutes());
|
|
337
337
|
},
|
|
338
338
|
j: function(a) {
|
|
339
339
|
return a.getDate();
|
|
@@ -342,7 +342,7 @@ var ke = function() {
|
|
|
342
342
|
return r.weekdays.longhand[a.getDay()];
|
|
343
343
|
},
|
|
344
344
|
m: function(a) {
|
|
345
|
-
return
|
|
345
|
+
return S(a.getMonth() + 1);
|
|
346
346
|
},
|
|
347
347
|
n: function(a) {
|
|
348
348
|
return a.getMonth() + 1;
|
|
@@ -359,138 +359,138 @@ var ke = function() {
|
|
|
359
359
|
y: function(a) {
|
|
360
360
|
return String(a.getFullYear()).substring(2);
|
|
361
361
|
}
|
|
362
|
-
},
|
|
363
|
-
var r = a.config, e = r === void 0 ?
|
|
364
|
-
return function(
|
|
365
|
-
var
|
|
366
|
-
return e.formatDate !== void 0 && !
|
|
367
|
-
return
|
|
362
|
+
}, Ze = function(a) {
|
|
363
|
+
var r = a.config, e = r === void 0 ? G : r, s = a.l10n, m = s === void 0 ? ie : s, g = a.isMobile, w = g === void 0 ? !1 : g;
|
|
364
|
+
return function(y, x, L) {
|
|
365
|
+
var C = L || m;
|
|
366
|
+
return e.formatDate !== void 0 && !w ? e.formatDate(y, x, C) : x.split("").map(function(A, N, Y) {
|
|
367
|
+
return ae[A] && Y[N - 1] !== "\\" ? ae[A](y, C, e) : A !== "\\" ? A : "";
|
|
368
368
|
}).join("");
|
|
369
369
|
};
|
|
370
|
-
},
|
|
371
|
-
var r = a.config, e = r === void 0 ?
|
|
372
|
-
return function(g,
|
|
370
|
+
}, Fe = function(a) {
|
|
371
|
+
var r = a.config, e = r === void 0 ? G : r, s = a.l10n, m = s === void 0 ? ie : s;
|
|
372
|
+
return function(g, w, y, x) {
|
|
373
373
|
if (!(g !== 0 && !g)) {
|
|
374
|
-
var
|
|
374
|
+
var L = x || m, C, A = g;
|
|
375
375
|
if (g instanceof Date)
|
|
376
|
-
|
|
376
|
+
C = new Date(g.getTime());
|
|
377
377
|
else if (typeof g != "string" && g.toFixed !== void 0)
|
|
378
|
-
|
|
378
|
+
C = new Date(g);
|
|
379
379
|
else if (typeof g == "string") {
|
|
380
|
-
var N =
|
|
380
|
+
var N = w || (e || G).dateFormat, Y = String(g).trim();
|
|
381
381
|
if (Y === "today")
|
|
382
|
-
|
|
382
|
+
C = /* @__PURE__ */ new Date(), y = !0;
|
|
383
383
|
else if (e && e.parseDate)
|
|
384
|
-
|
|
384
|
+
C = e.parseDate(g, N);
|
|
385
385
|
else if (/Z$/.test(Y) || /GMT$/.test(Y))
|
|
386
|
-
|
|
386
|
+
C = new Date(g);
|
|
387
387
|
else {
|
|
388
|
-
for (var
|
|
389
|
-
var
|
|
390
|
-
if (
|
|
391
|
-
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
fn:
|
|
395
|
-
val:
|
|
388
|
+
for (var re = void 0, D = [], R = 0, he = 0, j = ""; R < N.length; R++) {
|
|
389
|
+
var W = N[R], K = W === "\\", ve = N[R - 1] === "\\" || K;
|
|
390
|
+
if (B[W] && !ve) {
|
|
391
|
+
j += B[W];
|
|
392
|
+
var J = new RegExp(j).exec(g);
|
|
393
|
+
J && (re = !0) && D[W !== "Y" ? "push" : "unshift"]({
|
|
394
|
+
fn: _n[W],
|
|
395
|
+
val: J[++he]
|
|
396
396
|
});
|
|
397
|
-
} else
|
|
397
|
+
} else K || (j += ".");
|
|
398
398
|
}
|
|
399
|
-
|
|
400
|
-
var
|
|
401
|
-
return
|
|
402
|
-
}),
|
|
399
|
+
C = !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)), D.forEach(function(q) {
|
|
400
|
+
var U = q.fn, De = q.val;
|
|
401
|
+
return C = U(C, De, L) || C;
|
|
402
|
+
}), C = re ? C : void 0;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
if (!(
|
|
405
|
+
if (!(C instanceof Date && !isNaN(C.getTime()))) {
|
|
406
406
|
e.errorHandler(new Error("Invalid date provided: " + A));
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
return
|
|
409
|
+
return y === !0 && C.setHours(0, 0, 0, 0), C;
|
|
410
410
|
}
|
|
411
411
|
};
|
|
412
412
|
};
|
|
413
413
|
function F(a, r, e) {
|
|
414
414
|
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();
|
|
415
415
|
}
|
|
416
|
-
var
|
|
416
|
+
var Fn = function(a, r, e) {
|
|
417
417
|
return a > Math.min(r, e) && a < Math.max(r, e);
|
|
418
|
-
},
|
|
418
|
+
}, Ie = function(a, r, e) {
|
|
419
419
|
return a * 3600 + r * 60 + e;
|
|
420
|
-
},
|
|
420
|
+
}, On = function(a) {
|
|
421
421
|
var r = Math.floor(a / 3600), e = (a - r * 3600) / 60;
|
|
422
422
|
return [r, e, a - r * 3600 - e * 60];
|
|
423
|
-
},
|
|
423
|
+
}, An = {
|
|
424
424
|
DAY: 864e5
|
|
425
425
|
};
|
|
426
|
-
function
|
|
427
|
-
var r = a.defaultHour, e = a.defaultMinute,
|
|
426
|
+
function _e(a) {
|
|
427
|
+
var r = a.defaultHour, e = a.defaultMinute, s = a.defaultSeconds;
|
|
428
428
|
if (a.minDate !== void 0) {
|
|
429
|
-
var
|
|
430
|
-
r <
|
|
429
|
+
var m = a.minDate.getHours(), g = a.minDate.getMinutes(), w = a.minDate.getSeconds();
|
|
430
|
+
r < m && (r = m), r === m && e < g && (e = g), r === m && e === g && s < w && (s = a.minDate.getSeconds());
|
|
431
431
|
}
|
|
432
432
|
if (a.maxDate !== void 0) {
|
|
433
|
-
var
|
|
434
|
-
r = Math.min(r,
|
|
433
|
+
var y = a.maxDate.getHours(), x = a.maxDate.getMinutes();
|
|
434
|
+
r = Math.min(r, y), r === y && (e = Math.min(x, e)), r === y && e === x && (s = a.maxDate.getSeconds());
|
|
435
435
|
}
|
|
436
|
-
return { hours: r, minutes: e, seconds:
|
|
436
|
+
return { hours: r, minutes: e, seconds: s };
|
|
437
437
|
}
|
|
438
438
|
typeof Object.assign != "function" && (Object.assign = function(a) {
|
|
439
439
|
for (var r = [], e = 1; e < arguments.length; e++)
|
|
440
440
|
r[e - 1] = arguments[e];
|
|
441
441
|
if (!a)
|
|
442
442
|
throw TypeError("Cannot convert undefined or null to object");
|
|
443
|
-
for (var
|
|
444
|
-
|
|
445
|
-
return a[
|
|
443
|
+
for (var s = function(y) {
|
|
444
|
+
y && Object.keys(y).forEach(function(x) {
|
|
445
|
+
return a[x] = y[x];
|
|
446
446
|
});
|
|
447
|
-
},
|
|
448
|
-
var
|
|
449
|
-
|
|
447
|
+
}, m = 0, g = r; m < g.length; m++) {
|
|
448
|
+
var w = g[m];
|
|
449
|
+
s(w);
|
|
450
450
|
}
|
|
451
451
|
return a;
|
|
452
452
|
});
|
|
453
453
|
var k = function() {
|
|
454
454
|
return k = Object.assign || function(a) {
|
|
455
|
-
for (var r, e = 1,
|
|
455
|
+
for (var r, e = 1, s = arguments.length; e < s; e++) {
|
|
456
456
|
r = arguments[e];
|
|
457
|
-
for (var
|
|
457
|
+
for (var m in r) Object.prototype.hasOwnProperty.call(r, m) && (a[m] = r[m]);
|
|
458
458
|
}
|
|
459
459
|
return a;
|
|
460
460
|
}, k.apply(this, arguments);
|
|
461
|
-
},
|
|
461
|
+
}, Ke = function() {
|
|
462
462
|
for (var a = 0, r = 0, e = arguments.length; r < e; r++) a += arguments[r].length;
|
|
463
|
-
for (var
|
|
464
|
-
for (var g = arguments[r],
|
|
465
|
-
|
|
466
|
-
return
|
|
467
|
-
},
|
|
468
|
-
function
|
|
463
|
+
for (var s = Array(a), m = 0, r = 0; r < e; r++)
|
|
464
|
+
for (var g = arguments[r], w = 0, y = g.length; w < y; w++, m++)
|
|
465
|
+
s[m] = g[w];
|
|
466
|
+
return s;
|
|
467
|
+
}, Nn = 300;
|
|
468
|
+
function Pn(a, r) {
|
|
469
469
|
var e = {
|
|
470
|
-
config: k(k({},
|
|
471
|
-
l10n:
|
|
470
|
+
config: k(k({}, G), E.defaultConfig),
|
|
471
|
+
l10n: ie
|
|
472
472
|
};
|
|
473
|
-
e.parseDate =
|
|
474
|
-
function
|
|
473
|
+
e.parseDate = Fe({ config: e.config, l10n: e.l10n }), e._handlers = [], e.pluginElements = [], e.loadedPlugins = [], e._bind = D, e._setHoursFromDate = N, e._positionCalendar = de, e.changeMonth = be, e.changeYear = le, e.clear = tn, e.close = an, e.onMouseOver = fe, e._createElement = v, e.createDay = J, e.destroy = rn, e.isEnabled = z, e.jumpToDate = j, e.updateValue = H, e.open = un, e.redraw = Le, e.set = cn, e.setDate = gn, e.toggle = vn;
|
|
474
|
+
function s() {
|
|
475
475
|
e.utils = {
|
|
476
476
|
getDaysInMonth: function(n, t) {
|
|
477
477
|
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];
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
e.element = e.input = a, e.isOpen = !1,
|
|
481
|
+
function m() {
|
|
482
|
+
e.element = e.input = a, e.isOpen = !1, fn(), je(), pn(), mn(), s(), e.isMobile || ve(), he(), (e.selectedDates.length || e.config.noCalendar) && (e.config.enableTime && N(e.config.noCalendar ? e.latestSelectedDateObj : void 0), H(!1)), y();
|
|
483
483
|
var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
484
|
-
!e.isMobile && n &&
|
|
484
|
+
!e.isMobile && n && de(), M("onReady");
|
|
485
485
|
}
|
|
486
486
|
function g() {
|
|
487
487
|
var n;
|
|
488
488
|
return ((n = e.calendarContainer) === null || n === void 0 ? void 0 : n.getRootNode()).activeElement || document.activeElement;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function w(n) {
|
|
491
491
|
return n.bind(e);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function y() {
|
|
494
494
|
var n = e.config;
|
|
495
495
|
n.weekNumbers === !1 && n.showMonths === 1 || n.noCalendar !== !0 && window.requestAnimationFrame(function() {
|
|
496
496
|
if (e.calendarContainer !== void 0 && (e.calendarContainer.style.visibility = "hidden", e.calendarContainer.style.display = "block"), e.daysContainer !== void 0) {
|
|
@@ -499,19 +499,19 @@ function Fn(a, r) {
|
|
|
499
499
|
}
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function x(n) {
|
|
503
503
|
if (e.selectedDates.length === 0) {
|
|
504
|
-
var t = e.config.minDate === void 0 || F(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i =
|
|
504
|
+
var t = e.config.minDate === void 0 || F(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i = _e(e.config);
|
|
505
505
|
t.setHours(i.hours, i.minutes, i.seconds, t.getMilliseconds()), e.selectedDates = [t], e.latestSelectedDateObj = t;
|
|
506
506
|
}
|
|
507
|
-
n !== void 0 && n.type !== "blur" &&
|
|
507
|
+
n !== void 0 && n.type !== "blur" && wn(n);
|
|
508
508
|
var o = e._input.value;
|
|
509
509
|
A(), H(), e._input.value !== o && e._debouncedChange();
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function L(n, t) {
|
|
512
512
|
return n % 12 + 12 * O(t === e.l10n.amPM[1]);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function C(n) {
|
|
515
515
|
switch (n % 24) {
|
|
516
516
|
case 0:
|
|
517
517
|
case 12:
|
|
@@ -523,18 +523,18 @@ function Fn(a, r) {
|
|
|
523
523
|
function A() {
|
|
524
524
|
if (!(e.hourElement === void 0 || e.minuteElement === void 0)) {
|
|
525
525
|
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;
|
|
526
|
-
e.amPM !== void 0 && (n =
|
|
526
|
+
e.amPM !== void 0 && (n = L(n, e.amPM.textContent));
|
|
527
527
|
var o = e.config.minTime !== void 0 || e.config.minDate && e.minDateHasTime && e.latestSelectedDateObj && F(e.latestSelectedDateObj, e.config.minDate, !0) === 0, l = e.config.maxTime !== void 0 || e.config.maxDate && e.maxDateHasTime && e.latestSelectedDateObj && F(e.latestSelectedDateObj, e.config.maxDate, !0) === 0;
|
|
528
528
|
if (e.config.maxTime !== void 0 && e.config.minTime !== void 0 && e.config.minTime > e.config.maxTime) {
|
|
529
|
-
var
|
|
530
|
-
if (
|
|
531
|
-
var
|
|
532
|
-
n =
|
|
529
|
+
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()), d = Ie(n, t, i);
|
|
530
|
+
if (d > p && d < u) {
|
|
531
|
+
var h = On(u);
|
|
532
|
+
n = h[0], t = h[1], i = h[2];
|
|
533
533
|
}
|
|
534
534
|
} else {
|
|
535
535
|
if (l) {
|
|
536
|
-
var
|
|
537
|
-
n = Math.min(n,
|
|
536
|
+
var f = e.config.maxTime !== void 0 ? e.config.maxTime : e.config.maxDate;
|
|
537
|
+
n = Math.min(n, f.getHours()), n === f.getHours() && (t = Math.min(t, f.getMinutes())), t === f.getMinutes() && (i = Math.min(i, f.getSeconds()));
|
|
538
538
|
}
|
|
539
539
|
if (o) {
|
|
540
540
|
var c = e.config.minTime !== void 0 ? e.config.minTime : e.config.minDate;
|
|
@@ -549,11 +549,11 @@ function Fn(a, r) {
|
|
|
549
549
|
t && t instanceof Date && Y(t.getHours(), t.getMinutes(), t.getSeconds());
|
|
550
550
|
}
|
|
551
551
|
function Y(n, t, i) {
|
|
552
|
-
e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(n % 24, t, i || 0, 0), !(!e.hourElement || !e.minuteElement || e.isMobile) && (e.hourElement.value =
|
|
552
|
+
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 * O(n % 12 === 0)), e.minuteElement.value = S(t), e.amPM !== void 0 && (e.amPM.textContent = e.l10n.amPM[O(n >= 12)]), e.secondElement !== void 0 && (e.secondElement.value = S(i)));
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function re(n) {
|
|
555
555
|
var t = _(n), i = parseInt(t.value) + (n.delta || 0);
|
|
556
|
-
(i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) &&
|
|
556
|
+
(i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) && le(i);
|
|
557
557
|
}
|
|
558
558
|
function D(n, t, i, o) {
|
|
559
559
|
if (t instanceof Array)
|
|
@@ -570,113 +570,113 @@ function Fn(a, r) {
|
|
|
570
570
|
}
|
|
571
571
|
});
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function R() {
|
|
574
574
|
M("onChange");
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function he() {
|
|
577
577
|
if (e.config.wrap && ["open", "close", "toggle", "clear"].forEach(function(i) {
|
|
578
578
|
Array.prototype.forEach.call(e.element.querySelectorAll("[data-" + i + "]"), function(o) {
|
|
579
579
|
return D(o, "click", e[i]);
|
|
580
580
|
});
|
|
581
581
|
}), e.isMobile) {
|
|
582
|
-
|
|
582
|
+
hn();
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
|
-
var n =
|
|
586
|
-
if (e._debouncedChange =
|
|
587
|
-
e.config.mode === "range" &&
|
|
588
|
-
}), D(e._input, "keydown",
|
|
585
|
+
var n = Be(ln, 50);
|
|
586
|
+
if (e._debouncedChange = Be(R, Nn), e.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && D(e.daysContainer, "mouseover", function(i) {
|
|
587
|
+
e.config.mode === "range" && fe(_(i));
|
|
588
|
+
}), D(e._input, "keydown", Pe), e.calendarContainer !== void 0 && D(e.calendarContainer, "keydown", Pe), !e.config.inline && !e.config.static && D(window, "resize", n), window.ontouchstart !== void 0 ? D(window.document, "touchstart", we) : D(window.document, "mousedown", we), D(window.document, "focus", we, { capture: !0 }), e.config.clickOpens === !0 && (D(e._input, "focus", e.open), D(e._input, "click", e.open)), e.daysContainer !== void 0 && (D(e.monthNav, "click", bn), D(e.monthNav, ["keyup", "increment"], re), D(e.daysContainer, "click", Re)), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0) {
|
|
589
589
|
var t = function(i) {
|
|
590
590
|
return _(i).select();
|
|
591
591
|
};
|
|
592
|
-
D(e.timeContainer, ["increment"],
|
|
592
|
+
D(e.timeContainer, ["increment"], x), D(e.timeContainer, "blur", x, { capture: !0 }), D(e.timeContainer, "click", W), D([e.hourElement, e.minuteElement], ["focus", "click"], t), e.secondElement !== void 0 && D(e.secondElement, "focus", function() {
|
|
593
593
|
return e.secondElement && e.secondElement.select();
|
|
594
594
|
}), e.amPM !== void 0 && D(e.amPM, "click", function(i) {
|
|
595
|
-
|
|
595
|
+
x(i);
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
|
-
e.config.allowInput && D(e._input, "blur",
|
|
598
|
+
e.config.allowInput && D(e._input, "blur", on);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function j(n, t) {
|
|
601
601
|
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;
|
|
602
602
|
try {
|
|
603
603
|
i !== void 0 && (e.currentYear = i.getFullYear(), e.currentMonth = i.getMonth());
|
|
604
|
-
} catch (
|
|
605
|
-
|
|
604
|
+
} catch (u) {
|
|
605
|
+
u.message = "Invalid date supplied: " + i, e.config.errorHandler(u);
|
|
606
606
|
}
|
|
607
607
|
t && e.currentYear !== o && (M("onYearChange"), V()), t && (e.currentYear !== o || e.currentMonth !== l) && M("onMonthChange"), e.redraw();
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function W(n) {
|
|
610
610
|
var t = _(n);
|
|
611
|
-
~t.className.indexOf("arrow") &&
|
|
611
|
+
~t.className.indexOf("arrow") && K(n, t.classList.contains("arrowUp") ? 1 : -1);
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
var o = n && _(n), l = i || o && o.parentNode && o.parentNode.firstChild,
|
|
615
|
-
|
|
613
|
+
function K(n, t, i) {
|
|
614
|
+
var o = n && _(n), l = i || o && o.parentNode && o.parentNode.firstChild, u = ye("increment");
|
|
615
|
+
u.delta = t, l && l.dispatchEvent(u);
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function ve() {
|
|
618
618
|
var n = window.document.createDocumentFragment();
|
|
619
619
|
if (e.calendarContainer = v("div", "flatpickr-calendar"), e.calendarContainer.tabIndex = -1, !e.config.noCalendar) {
|
|
620
|
-
if (n.appendChild(
|
|
621
|
-
var t =
|
|
620
|
+
if (n.appendChild(Xe()), e.innerContainer = v("div", "flatpickr-innerContainer"), e.config.weekNumbers) {
|
|
621
|
+
var t = nn(), i = t.weekWrapper, o = t.weekNumbers;
|
|
622
622
|
e.innerContainer.appendChild(i), e.weekNumbers = o, e.weekWrapper = i;
|
|
623
623
|
}
|
|
624
|
-
e.rContainer = v("div", "flatpickr-rContainer"), e.rContainer.appendChild(
|
|
624
|
+
e.rContainer = v("div", "flatpickr-rContainer"), e.rContainer.appendChild(Ae()), e.daysContainer || (e.daysContainer = v("div", "flatpickr-days"), e.daysContainer.tabIndex = -1), oe(), e.rContainer.appendChild(e.daysContainer), e.innerContainer.appendChild(e.rContainer), n.appendChild(e.innerContainer);
|
|
625
625
|
}
|
|
626
|
-
e.config.enableTime && n.appendChild(
|
|
626
|
+
e.config.enableTime && n.appendChild(en()), T(e.calendarContainer, "rangeMode", e.config.mode === "range"), T(e.calendarContainer, "animate", e.config.animate === !0), T(e.calendarContainer, "multiMonth", e.config.showMonths > 1), e.calendarContainer.appendChild(n);
|
|
627
627
|
var l = e.config.appendTo !== void 0 && e.config.appendTo.nodeType !== void 0;
|
|
628
628
|
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)) {
|
|
629
|
-
var
|
|
630
|
-
e.element.parentNode && e.element.parentNode.insertBefore(
|
|
629
|
+
var u = v("div", "flatpickr-wrapper");
|
|
630
|
+
e.element.parentNode && e.element.parentNode.insertBefore(u, e.element), u.appendChild(e.element), e.altInput && u.appendChild(e.altInput), u.appendChild(e.calendarContainer);
|
|
631
631
|
}
|
|
632
632
|
!e.config.static && !e.config.inline && (e.config.appendTo !== void 0 ? e.config.appendTo : window.document.body).appendChild(e.calendarContainer);
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
var l =
|
|
636
|
-
return
|
|
637
|
-
}
|
|
638
|
-
function U(n) {
|
|
639
|
-
n.focus(), e.config.mode === "range" && le(n);
|
|
634
|
+
function J(n, t, i, o) {
|
|
635
|
+
var l = z(t, !0), u = v("span", n, t.getDate().toString());
|
|
636
|
+
return u.dateObj = t, u.$i = o, u.setAttribute("aria-label", e.formatDate(t, e.config.ariaDateFormat)), n.indexOf("hidden") === -1 && F(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" && (T(u, "startRange", e.selectedDates[0] && F(t, e.selectedDates[0], !0) === 0), T(u, "endRange", e.selectedDates[1] && F(t, e.selectedDates[1], !0) === 0), n === "nextMonthDay" && u.classList.add("inRange")))) : u.classList.add("flatpickr-disabled"), e.config.mode === "range" && Dn(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>"), M("onDayCreate", u), u;
|
|
640
637
|
}
|
|
641
638
|
function q(n) {
|
|
639
|
+
n.focus(), e.config.mode === "range" && fe(n);
|
|
640
|
+
}
|
|
641
|
+
function U(n) {
|
|
642
642
|
for (var t = n > 0 ? 0 : e.config.showMonths - 1, i = n > 0 ? e.config.showMonths : -1, o = t; o != i; o += n)
|
|
643
|
-
for (var l = e.daysContainer.children[o],
|
|
644
|
-
var
|
|
645
|
-
if (
|
|
646
|
-
return
|
|
643
|
+
for (var l = e.daysContainer.children[o], u = n > 0 ? 0 : l.children.length - 1, p = n > 0 ? l.children.length : -1, d = u; d != p; d += n) {
|
|
644
|
+
var h = l.children[d];
|
|
645
|
+
if (h.className.indexOf("hidden") === -1 && z(h.dateObj))
|
|
646
|
+
return h;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
function
|
|
650
|
-
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,
|
|
651
|
-
for (var
|
|
652
|
-
var c =
|
|
653
|
-
if (c.className.indexOf("hidden") === -1 &&
|
|
654
|
-
return
|
|
649
|
+
function De(n, t) {
|
|
650
|
+
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)
|
|
651
|
+
for (var p = e.daysContainer.children[u], d = i - e.currentMonth === u ? n.$i + t : t < 0 ? p.children.length - 1 : 0, h = p.children.length, f = d; f >= 0 && f < h && f != (t > 0 ? h : -1); f += l) {
|
|
652
|
+
var c = p.children[f];
|
|
653
|
+
if (c.className.indexOf("hidden") === -1 && z(c.dateObj) && Math.abs(n.$i - f) >= Math.abs(t))
|
|
654
|
+
return q(c);
|
|
655
655
|
}
|
|
656
|
-
e.changeMonth(l), Q(
|
|
656
|
+
e.changeMonth(l), Q(U(l), 0);
|
|
657
657
|
}
|
|
658
658
|
function Q(n, t) {
|
|
659
|
-
var i = g(), o =
|
|
660
|
-
l === void 0 ? e._input.focus() : o ?
|
|
661
|
-
}
|
|
662
|
-
function
|
|
663
|
-
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),
|
|
664
|
-
|
|
665
|
-
for (
|
|
666
|
-
|
|
667
|
-
for (var
|
|
668
|
-
|
|
659
|
+
var i = g(), 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 : U(t > 0 ? 1 : -1);
|
|
660
|
+
l === void 0 ? e._input.focus() : o ? De(l, t) : q(l);
|
|
661
|
+
}
|
|
662
|
+
function $e(n, t) {
|
|
663
|
+
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, d = p ? "prevMonthDay hidden" : "prevMonthDay", h = p ? "nextMonthDay hidden" : "nextMonthDay", f = o + 1 - i, c = 0; f <= o; f++, c++)
|
|
664
|
+
u.appendChild(J("flatpickr-day " + d, new Date(n, t - 1, f), f, c));
|
|
665
|
+
for (f = 1; f <= l; f++, c++)
|
|
666
|
+
u.appendChild(J("flatpickr-day", new Date(n, t, f), f, c));
|
|
667
|
+
for (var b = l + 1; b <= 42 - i && (e.config.showMonths === 1 || c % 7 !== 0); b++, c++)
|
|
668
|
+
u.appendChild(J("flatpickr-day " + h, new Date(n, t + 1, b % l), b, c));
|
|
669
669
|
var P = v("div", "dayContainer");
|
|
670
|
-
return P.appendChild(
|
|
670
|
+
return P.appendChild(u), P;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function oe() {
|
|
673
673
|
if (e.daysContainer !== void 0) {
|
|
674
|
-
|
|
674
|
+
ge(e.daysContainer), e.weekNumbers && ge(e.weekNumbers);
|
|
675
675
|
for (var n = document.createDocumentFragment(), t = 0; t < e.config.showMonths; t++) {
|
|
676
676
|
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
677
|
-
i.setMonth(e.currentMonth + t), n.appendChild(
|
|
677
|
+
i.setMonth(e.currentMonth + t), n.appendChild($e(i.getFullYear(), i.getMonth()));
|
|
678
678
|
}
|
|
679
|
-
e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 &&
|
|
679
|
+
e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && fe();
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
function V() {
|
|
@@ -688,35 +688,35 @@ function Fn(a, r) {
|
|
|
688
688
|
for (var t = 0; t < 12; t++)
|
|
689
689
|
if (n(t)) {
|
|
690
690
|
var i = v("option", "flatpickr-monthDropdown-month");
|
|
691
|
-
i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent =
|
|
691
|
+
i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent = pe(t, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === t && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Qe() {
|
|
696
696
|
var n = v("div", "flatpickr-month"), t = window.document.createDocumentFragment(), i;
|
|
697
|
-
e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = v("span", "cur-month") : (e.monthsDropdownContainer = v("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), D(e.monthsDropdownContainer, "change", function(
|
|
698
|
-
var
|
|
699
|
-
e.changeMonth(
|
|
697
|
+
e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = v("span", "cur-month") : (e.monthsDropdownContainer = v("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), D(e.monthsDropdownContainer, "change", function(p) {
|
|
698
|
+
var d = _(p), h = parseInt(d.value, 10);
|
|
699
|
+
e.changeMonth(h - e.currentMonth), M("onMonthChange");
|
|
700
700
|
}), V(), i = e.monthsDropdownContainer);
|
|
701
|
-
var o =
|
|
701
|
+
var o = me("cur-year", { tabindex: "-1" }), l = o.getElementsByTagName("input")[0];
|
|
702
702
|
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());
|
|
703
|
-
var
|
|
704
|
-
return
|
|
703
|
+
var u = v("div", "flatpickr-current-month");
|
|
704
|
+
return u.appendChild(i), u.appendChild(o), t.appendChild(u), n.appendChild(t), {
|
|
705
705
|
container: n,
|
|
706
706
|
yearElement: l,
|
|
707
707
|
monthElement: i
|
|
708
708
|
};
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
|
|
710
|
+
function Oe() {
|
|
711
|
+
ge(e.monthNav), e.monthNav.appendChild(e.prevMonthNav), e.config.showMonths && (e.yearElements = [], e.monthElements = []);
|
|
712
712
|
for (var n = e.config.showMonths; n--; ) {
|
|
713
|
-
var t =
|
|
713
|
+
var t = Qe();
|
|
714
714
|
e.yearElements.push(t.yearElement), e.monthElements.push(t.monthElement), e.monthNav.appendChild(t.container);
|
|
715
715
|
}
|
|
716
716
|
e.monthNav.appendChild(e.nextMonthNav);
|
|
717
717
|
}
|
|
718
|
-
function
|
|
719
|
-
return e.monthNav = v("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = v("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = v("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow,
|
|
718
|
+
function Xe() {
|
|
719
|
+
return e.monthNav = v("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = v("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = v("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow, Oe(), Object.defineProperty(e, "_hidePrevMonthArrow", {
|
|
720
720
|
get: function() {
|
|
721
721
|
return e.__hidePrevMonthArrow;
|
|
722
722
|
},
|
|
@@ -730,38 +730,38 @@ function Fn(a, r) {
|
|
|
730
730
|
set: function(n) {
|
|
731
731
|
e.__hideNextMonthArrow !== n && (T(e.nextMonthNav, "flatpickr-disabled", n), e.__hideNextMonthArrow = n);
|
|
732
732
|
}
|
|
733
|
-
}), e.currentYearElement = e.yearElements[0],
|
|
733
|
+
}), e.currentYearElement = e.yearElements[0], ce(), e.monthNav;
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function en() {
|
|
736
736
|
e.calendarContainer.classList.add("hasTime"), e.config.noCalendar && e.calendarContainer.classList.add("noCalendar");
|
|
737
|
-
var n =
|
|
737
|
+
var n = _e(e.config);
|
|
738
738
|
e.timeContainer = v("div", "flatpickr-time"), e.timeContainer.tabIndex = -1;
|
|
739
|
-
var t = v("span", "flatpickr-time-separator", ":"), i =
|
|
739
|
+
var t = v("span", "flatpickr-time-separator", ":"), i = me("flatpickr-hour", {
|
|
740
740
|
"aria-label": e.l10n.hourAriaLabel
|
|
741
741
|
});
|
|
742
742
|
e.hourElement = i.getElementsByTagName("input")[0];
|
|
743
|
-
var o =
|
|
743
|
+
var o = me("flatpickr-minute", {
|
|
744
744
|
"aria-label": e.l10n.minuteAriaLabel
|
|
745
745
|
});
|
|
746
|
-
if (e.minuteElement = o.getElementsByTagName("input")[0], e.hourElement.tabIndex = e.minuteElement.tabIndex = -1, e.hourElement.value =
|
|
746
|
+
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 : C(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) {
|
|
747
747
|
e.timeContainer.classList.add("hasSeconds");
|
|
748
|
-
var l =
|
|
749
|
-
e.secondElement = l.getElementsByTagName("input")[0], e.secondElement.value =
|
|
748
|
+
var l = me("flatpickr-second");
|
|
749
|
+
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(v("span", "flatpickr-time-separator", ":")), e.timeContainer.appendChild(l);
|
|
750
750
|
}
|
|
751
751
|
return e.config.time_24hr || (e.amPM = v("span", "flatpickr-am-pm", e.l10n.amPM[O((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;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
754
|
-
e.weekdayContainer ?
|
|
753
|
+
function Ae() {
|
|
754
|
+
e.weekdayContainer ? ge(e.weekdayContainer) : e.weekdayContainer = v("div", "flatpickr-weekdays");
|
|
755
755
|
for (var n = e.config.showMonths; n--; ) {
|
|
756
756
|
var t = v("div", "flatpickr-weekdaycontainer");
|
|
757
757
|
e.weekdayContainer.appendChild(t);
|
|
758
758
|
}
|
|
759
|
-
return
|
|
759
|
+
return Ne(), e.weekdayContainer;
|
|
760
760
|
}
|
|
761
|
-
function
|
|
761
|
+
function Ne() {
|
|
762
762
|
if (e.weekdayContainer) {
|
|
763
|
-
var n = e.l10n.firstDayOfWeek, t =
|
|
764
|
-
n > 0 && n < t.length && (t =
|
|
763
|
+
var n = e.l10n.firstDayOfWeek, t = Ke(e.l10n.weekdays.shorthand);
|
|
764
|
+
n > 0 && n < t.length && (t = Ke(t.splice(n, t.length), t.splice(0, n)));
|
|
765
765
|
for (var i = e.config.showMonths; i--; )
|
|
766
766
|
e.weekdayContainer.children[i].innerHTML = `
|
|
767
767
|
<span class='flatpickr-weekday'>
|
|
@@ -770,7 +770,7 @@ function Fn(a, r) {
|
|
|
770
770
|
`;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function nn() {
|
|
774
774
|
e.calendarContainer.classList.add("hasWeeks");
|
|
775
775
|
var n = v("div", "flatpickr-weekwrapper");
|
|
776
776
|
n.appendChild(v("span", "flatpickr-weekday", e.l10n.weekAbbreviation));
|
|
@@ -780,22 +780,22 @@ function Fn(a, r) {
|
|
|
780
780
|
weekNumbers: t
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function be(n, t) {
|
|
784
784
|
t === void 0 && (t = !0);
|
|
785
785
|
var i = t ? n : n - e.currentMonth;
|
|
786
|
-
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, M("onYearChange"), V()),
|
|
786
|
+
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, M("onYearChange"), V()), oe(), M("onMonthChange"), ce());
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function tn(n, t) {
|
|
789
789
|
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) {
|
|
790
|
-
var i =
|
|
791
|
-
Y(o, l,
|
|
790
|
+
var i = _e(e.config), o = i.hours, l = i.minutes, u = i.seconds;
|
|
791
|
+
Y(o, l, u);
|
|
792
792
|
}
|
|
793
793
|
e.redraw(), n && M("onChange");
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function an() {
|
|
796
796
|
e.isOpen = !1, e.isMobile || (e.calendarContainer !== void 0 && e.calendarContainer.classList.remove("open"), e._input !== void 0 && e._input.classList.remove("active")), M("onClose");
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function rn() {
|
|
799
799
|
e.config !== void 0 && M("onDestroy");
|
|
800
800
|
for (var n = e._handlers.length; n--; )
|
|
801
801
|
e._handlers[n].remove();
|
|
@@ -851,21 +851,21 @@ function Fn(a, r) {
|
|
|
851
851
|
function X(n) {
|
|
852
852
|
return e.calendarContainer.contains(n);
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function we(n) {
|
|
855
855
|
if (e.isOpen && !e.config.inline) {
|
|
856
|
-
var t = _(n), i = X(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 && !X(n.relatedTarget),
|
|
857
|
-
return
|
|
856
|
+
var t = _(n), i = X(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 && !X(n.relatedTarget), u = !e.config.ignoredFocusElements.some(function(p) {
|
|
857
|
+
return p.contains(t);
|
|
858
858
|
});
|
|
859
|
-
l &&
|
|
859
|
+
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));
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
|
-
function
|
|
862
|
+
function le(n) {
|
|
863
863
|
if (!(!n || e.config.minDate && n < e.config.minDate.getFullYear() || e.config.maxDate && n > e.config.maxDate.getFullYear())) {
|
|
864
864
|
var t = n, i = e.currentYear !== t;
|
|
865
865
|
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(), M("onYearChange"), V());
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function z(n, t) {
|
|
869
869
|
var i;
|
|
870
870
|
t === void 0 && (t = !0);
|
|
871
871
|
var o = e.parseDate(n, void 0, t);
|
|
@@ -875,40 +875,40 @@ function Fn(a, r) {
|
|
|
875
875
|
return !0;
|
|
876
876
|
if (o === void 0)
|
|
877
877
|
return !1;
|
|
878
|
-
for (var l = !!e.config.enable,
|
|
879
|
-
if (
|
|
878
|
+
for (var l = !!e.config.enable, u = (i = e.config.enable) !== null && i !== void 0 ? i : e.config.disable, p = 0, d = void 0; p < u.length; p++) {
|
|
879
|
+
if (d = u[p], typeof d == "function" && d(o))
|
|
880
880
|
return l;
|
|
881
|
-
if (
|
|
881
|
+
if (d instanceof Date && o !== void 0 && d.getTime() === o.getTime())
|
|
882
882
|
return l;
|
|
883
|
-
if (typeof
|
|
884
|
-
var
|
|
885
|
-
return
|
|
886
|
-
} else if (typeof
|
|
883
|
+
if (typeof d == "string") {
|
|
884
|
+
var h = e.parseDate(d, void 0, !0);
|
|
885
|
+
return h && h.getTime() === o.getTime() ? l : !l;
|
|
886
|
+
} else if (typeof d == "object" && o !== void 0 && d.from && d.to && o.getTime() >= d.from.getTime() && o.getTime() <= d.to.getTime())
|
|
887
887
|
return l;
|
|
888
888
|
}
|
|
889
889
|
return !l;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function ue(n) {
|
|
892
892
|
return e.daysContainer !== void 0 ? n.className.indexOf("hidden") === -1 && n.className.indexOf("flatpickr-disabled") === -1 && e.daysContainer.contains(n) : !1;
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
var t = n.target === e._input, i = e._input.value.trimEnd() !==
|
|
894
|
+
function on(n) {
|
|
895
|
+
var t = n.target === e._input, i = e._input.value.trimEnd() !== Ee();
|
|
896
896
|
t && i && !(n.relatedTarget && X(n.relatedTarget)) && e.setDate(e._input.value, !0, n.target === e.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
var t = _(n), i = e.config.wrap ? a.contains(t) : t === e._input, o = e.config.allowInput, l = e.isOpen && (!o || !i),
|
|
898
|
+
function Pe(n) {
|
|
899
|
+
var t = _(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;
|
|
900
900
|
if (n.keyCode === 13 && i) {
|
|
901
901
|
if (o)
|
|
902
902
|
return e.setDate(e._input.value, !0, t === e.altInput ? e.config.altFormat : e.config.dateFormat), e.close(), t.blur();
|
|
903
903
|
e.open();
|
|
904
|
-
} else if (X(t) || l ||
|
|
905
|
-
var
|
|
904
|
+
} else if (X(t) || l || u) {
|
|
905
|
+
var p = !!e.timeContainer && e.timeContainer.contains(t);
|
|
906
906
|
switch (n.keyCode) {
|
|
907
907
|
case 13:
|
|
908
|
-
|
|
908
|
+
p ? (n.preventDefault(), x(), Me()) : Re(n);
|
|
909
909
|
break;
|
|
910
910
|
case 27:
|
|
911
|
-
n.preventDefault(),
|
|
911
|
+
n.preventDefault(), Me();
|
|
912
912
|
break;
|
|
913
913
|
case 8:
|
|
914
914
|
case 46:
|
|
@@ -916,33 +916,33 @@ function Fn(a, r) {
|
|
|
916
916
|
break;
|
|
917
917
|
case 37:
|
|
918
918
|
case 39:
|
|
919
|
-
if (!
|
|
919
|
+
if (!p && !i) {
|
|
920
920
|
n.preventDefault();
|
|
921
|
-
var
|
|
922
|
-
if (e.daysContainer !== void 0 && (o === !1 ||
|
|
923
|
-
var
|
|
924
|
-
n.ctrlKey ? (n.stopPropagation(),
|
|
921
|
+
var d = g();
|
|
922
|
+
if (e.daysContainer !== void 0 && (o === !1 || d && ue(d))) {
|
|
923
|
+
var h = n.keyCode === 39 ? 1 : -1;
|
|
924
|
+
n.ctrlKey ? (n.stopPropagation(), be(h), Q(U(1), 0)) : Q(void 0, h);
|
|
925
925
|
}
|
|
926
926
|
} else e.hourElement && e.hourElement.focus();
|
|
927
927
|
break;
|
|
928
928
|
case 38:
|
|
929
929
|
case 40:
|
|
930
930
|
n.preventDefault();
|
|
931
|
-
var
|
|
932
|
-
e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(),
|
|
931
|
+
var f = n.keyCode === 40 ? 1 : -1;
|
|
932
|
+
e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(), le(e.currentYear - f), Q(U(1), 0)) : p || Q(void 0, f * 7) : t === e.currentYearElement ? le(e.currentYear - f) : e.config.enableTime && (!p && e.hourElement && e.hourElement.focus(), x(n), e._debouncedChange());
|
|
933
933
|
break;
|
|
934
934
|
case 9:
|
|
935
|
-
if (
|
|
935
|
+
if (p) {
|
|
936
936
|
var c = [
|
|
937
937
|
e.hourElement,
|
|
938
938
|
e.minuteElement,
|
|
939
939
|
e.secondElement,
|
|
940
940
|
e.amPM
|
|
941
|
-
].concat(e.pluginElements).filter(function(
|
|
942
|
-
return
|
|
943
|
-
}),
|
|
944
|
-
if (
|
|
945
|
-
var P = c[
|
|
941
|
+
].concat(e.pluginElements).filter(function(I) {
|
|
942
|
+
return I;
|
|
943
|
+
}), b = c.indexOf(t);
|
|
944
|
+
if (b !== -1) {
|
|
945
|
+
var P = c[b + (n.shiftKey ? -1 : 1)];
|
|
946
946
|
n.preventDefault(), (P || e._input).focus();
|
|
947
947
|
}
|
|
948
948
|
} else !e.config.noCalendar && e.daysContainer && e.daysContainer.contains(t) && n.shiftKey && (n.preventDefault(), e._input.focus());
|
|
@@ -962,30 +962,30 @@ function Fn(a, r) {
|
|
|
962
962
|
}
|
|
963
963
|
(i || X(t)) && M("onKeyDown", n);
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function fe(n, t) {
|
|
966
966
|
if (t === void 0 && (t = "flatpickr-day"), !(e.selectedDates.length !== 1 || n && (!n.classList.contains(t) || n.classList.contains("flatpickr-disabled")))) {
|
|
967
|
-
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()),
|
|
968
|
-
|
|
967
|
+
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, d = 0, h = 0, f = l; f < u; f += An.DAY)
|
|
968
|
+
z(new Date(f), !0) || (p = p || f > l && f < u, f < o && (!d || f > d) ? d = f : f > o && (!h || f < h) && (h = f));
|
|
969
969
|
var c = Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+" + e.config.showMonths + ") > ." + t));
|
|
970
|
-
c.forEach(function(
|
|
971
|
-
var P =
|
|
970
|
+
c.forEach(function(b) {
|
|
971
|
+
var P = b.dateObj, I = P.getTime(), ee = d > 0 && I < d || h > 0 && I > h;
|
|
972
972
|
if (ee) {
|
|
973
|
-
|
|
974
|
-
|
|
973
|
+
b.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function(Z) {
|
|
974
|
+
b.classList.remove(Z);
|
|
975
975
|
});
|
|
976
976
|
return;
|
|
977
|
-
} else if (
|
|
977
|
+
} else if (p && !ee)
|
|
978
978
|
return;
|
|
979
|
-
["startRange", "inRange", "endRange", "notAllowed"].forEach(function(
|
|
980
|
-
|
|
981
|
-
}), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i &&
|
|
979
|
+
["startRange", "inRange", "endRange", "notAllowed"].forEach(function(Z) {
|
|
980
|
+
b.classList.remove(Z);
|
|
981
|
+
}), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i && I === o ? b.classList.add("startRange") : o > i && I === o && b.classList.add("endRange"), I >= d && (h === 0 || I <= h) && Fn(I, o, i) && b.classList.add("inRange"));
|
|
982
982
|
});
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
function
|
|
986
|
-
e.isOpen && !e.config.static && !e.config.inline &&
|
|
985
|
+
function ln() {
|
|
986
|
+
e.isOpen && !e.config.static && !e.config.inline && de();
|
|
987
987
|
}
|
|
988
|
-
function
|
|
988
|
+
function un(n, t) {
|
|
989
989
|
if (t === void 0 && (t = e._positionElement), e.isMobile === !0) {
|
|
990
990
|
if (n) {
|
|
991
991
|
n.preventDefault();
|
|
@@ -997,19 +997,19 @@ function Fn(a, r) {
|
|
|
997
997
|
} else if (e._input.disabled || e.config.inline)
|
|
998
998
|
return;
|
|
999
999
|
var o = e.isOpen;
|
|
1000
|
-
e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), M("onOpen"),
|
|
1000
|
+
e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), M("onOpen"), de(t)), e.config.enableTime === !0 && e.config.noCalendar === !0 && e.config.allowInput === !1 && (n === void 0 || !e.timeContainer.contains(n.relatedTarget)) && setTimeout(function() {
|
|
1001
1001
|
return e.hourElement.select();
|
|
1002
1002
|
}, 50);
|
|
1003
1003
|
}
|
|
1004
|
-
function
|
|
1004
|
+
function Ye(n) {
|
|
1005
1005
|
return function(t) {
|
|
1006
1006
|
var i = e.config["_" + n + "Date"] = e.parseDate(t, e.config.dateFormat), o = e.config["_" + (n === "min" ? "max" : "min") + "Date"];
|
|
1007
1007
|
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) {
|
|
1008
|
-
return
|
|
1008
|
+
return z(l);
|
|
1009
1009
|
}), !e.selectedDates.length && n === "min" && N(i), H()), e.daysContainer && (Le(), i !== void 0 ? e.currentYearElement[n] = i.getFullYear().toString() : e.currentYearElement.removeAttribute(n), e.currentYearElement.disabled = !!o && i !== void 0 && o.getFullYear() === i.getFullYear());
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function fn() {
|
|
1013
1013
|
var n = [
|
|
1014
1014
|
"wrap",
|
|
1015
1015
|
"weekNumbers",
|
|
@@ -1031,102 +1031,102 @@ function Fn(a, r) {
|
|
|
1031
1031
|
return e.config._enable;
|
|
1032
1032
|
},
|
|
1033
1033
|
set: function(c) {
|
|
1034
|
-
e.config._enable =
|
|
1034
|
+
e.config._enable = Je(c);
|
|
1035
1035
|
}
|
|
1036
1036
|
}), Object.defineProperty(e.config, "disable", {
|
|
1037
1037
|
get: function() {
|
|
1038
1038
|
return e.config._disable;
|
|
1039
1039
|
},
|
|
1040
1040
|
set: function(c) {
|
|
1041
|
-
e.config._disable =
|
|
1041
|
+
e.config._disable = Je(c);
|
|
1042
1042
|
}
|
|
1043
1043
|
});
|
|
1044
1044
|
var o = t.mode === "time";
|
|
1045
1045
|
if (!t.dateFormat && (t.enableTime || o)) {
|
|
1046
|
-
var l =
|
|
1046
|
+
var l = E.defaultConfig.dateFormat || G.dateFormat;
|
|
1047
1047
|
i.dateFormat = t.noCalendar || o ? "H:i" + (t.enableSeconds ? ":S" : "") : l + " H:i" + (t.enableSeconds ? ":S" : "");
|
|
1048
1048
|
}
|
|
1049
1049
|
if (t.altInput && (t.enableTime || o) && !t.altFormat) {
|
|
1050
|
-
var
|
|
1051
|
-
i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") :
|
|
1050
|
+
var u = E.defaultConfig.altFormat || G.altFormat;
|
|
1051
|
+
i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") : u + (" h:i" + (t.enableSeconds ? ":S" : "") + " K");
|
|
1052
1052
|
}
|
|
1053
1053
|
Object.defineProperty(e.config, "minDate", {
|
|
1054
1054
|
get: function() {
|
|
1055
1055
|
return e.config._minDate;
|
|
1056
1056
|
},
|
|
1057
|
-
set:
|
|
1057
|
+
set: Ye("min")
|
|
1058
1058
|
}), Object.defineProperty(e.config, "maxDate", {
|
|
1059
1059
|
get: function() {
|
|
1060
1060
|
return e.config._maxDate;
|
|
1061
1061
|
},
|
|
1062
|
-
set:
|
|
1062
|
+
set: Ye("max")
|
|
1063
1063
|
});
|
|
1064
|
-
var
|
|
1065
|
-
return function(
|
|
1066
|
-
e.config[c === "min" ? "_minTime" : "_maxTime"] = e.parseDate(
|
|
1064
|
+
var p = function(c) {
|
|
1065
|
+
return function(b) {
|
|
1066
|
+
e.config[c === "min" ? "_minTime" : "_maxTime"] = e.parseDate(b, "H:i:S");
|
|
1067
1067
|
};
|
|
1068
1068
|
};
|
|
1069
1069
|
Object.defineProperty(e.config, "minTime", {
|
|
1070
1070
|
get: function() {
|
|
1071
1071
|
return e.config._minTime;
|
|
1072
1072
|
},
|
|
1073
|
-
set:
|
|
1073
|
+
set: p("min")
|
|
1074
1074
|
}), Object.defineProperty(e.config, "maxTime", {
|
|
1075
1075
|
get: function() {
|
|
1076
1076
|
return e.config._maxTime;
|
|
1077
1077
|
},
|
|
1078
|
-
set:
|
|
1078
|
+
set: p("max")
|
|
1079
1079
|
}), t.mode === "time" && (e.config.noCalendar = !0, e.config.enableTime = !0), Object.assign(e.config, i, t);
|
|
1080
|
-
for (var
|
|
1081
|
-
e.config[n[
|
|
1082
|
-
|
|
1080
|
+
for (var d = 0; d < n.length; d++)
|
|
1081
|
+
e.config[n[d]] = e.config[n[d]] === !0 || e.config[n[d]] === "true";
|
|
1082
|
+
ke.filter(function(c) {
|
|
1083
1083
|
return e.config[c] !== void 0;
|
|
1084
1084
|
}).forEach(function(c) {
|
|
1085
|
-
e.config[c] =
|
|
1085
|
+
e.config[c] = Te(e.config[c] || []).map(w);
|
|
1086
1086
|
}), 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);
|
|
1087
|
-
for (var
|
|
1088
|
-
var
|
|
1089
|
-
for (var
|
|
1090
|
-
|
|
1087
|
+
for (var d = 0; d < e.config.plugins.length; d++) {
|
|
1088
|
+
var h = e.config.plugins[d](e) || {};
|
|
1089
|
+
for (var f in h)
|
|
1090
|
+
ke.indexOf(f) > -1 ? e.config[f] = Te(h[f]).map(w).concat(e.config[f]) : typeof t[f] > "u" && (e.config[f] = h[f]);
|
|
1091
1091
|
}
|
|
1092
|
-
t.altInputClass || (e.config.altInputClass =
|
|
1092
|
+
t.altInputClass || (e.config.altInputClass = He().className + " " + e.config.altInputClass), M("onParseConfig");
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function He() {
|
|
1095
1095
|
return e.config.wrap ? a.querySelector("[data-input]") : a;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1098
|
-
typeof e.config.locale != "object" && typeof
|
|
1097
|
+
function je() {
|
|
1098
|
+
typeof e.config.locale != "object" && typeof E.l10ns[e.config.locale] > "u" && e.config.errorHandler(new Error("flatpickr: invalid locale " + e.config.locale)), e.l10n = k(k({}, E.l10ns.default), typeof e.config.locale == "object" ? e.config.locale : e.config.locale !== "default" ? E.l10ns[e.config.locale] : void 0), B.D = "(" + e.l10n.weekdays.shorthand.join("|") + ")", B.l = "(" + e.l10n.weekdays.longhand.join("|") + ")", B.M = "(" + e.l10n.months.shorthand.join("|") + ")", B.F = "(" + e.l10n.months.longhand.join("|") + ")", B.K = "(" + e.l10n.amPM[0] + "|" + e.l10n.amPM[1] + "|" + e.l10n.amPM[0].toLowerCase() + "|" + e.l10n.amPM[1].toLowerCase() + ")";
|
|
1099
1099
|
var n = k(k({}, r), JSON.parse(JSON.stringify(a.dataset || {})));
|
|
1100
|
-
n.time_24hr === void 0 &&
|
|
1100
|
+
n.time_24hr === void 0 && E.defaultConfig.time_24hr === void 0 && (e.config.time_24hr = e.l10n.time_24hr), e.formatDate = Ze(e), e.parseDate = Fe({ config: e.config, l10n: e.l10n });
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function de(n) {
|
|
1103
1103
|
if (typeof e.config.position == "function")
|
|
1104
1104
|
return void e.config.position(e, n);
|
|
1105
1105
|
if (e.calendarContainer !== void 0) {
|
|
1106
1106
|
M("onPreCalendarPosition");
|
|
1107
|
-
var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, (function(
|
|
1108
|
-
return
|
|
1109
|
-
}), 0), o = e.calendarContainer.offsetWidth, l = e.config.position.split(" "),
|
|
1110
|
-
if (T(e.calendarContainer, "arrowTop", !
|
|
1111
|
-
var
|
|
1112
|
-
|
|
1113
|
-
var ee = window.document.body.offsetWidth - (window.pageXOffset +
|
|
1114
|
-
if (T(e.calendarContainer, "rightMost",
|
|
1115
|
-
if (e.calendarContainer.style.top = c + "px", !
|
|
1116
|
-
e.calendarContainer.style.left =
|
|
1117
|
-
else if (!
|
|
1107
|
+
var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, (function(Sn, In) {
|
|
1108
|
+
return Sn + In.offsetHeight;
|
|
1109
|
+
}), 0), o = e.calendarContainer.offsetWidth, l = e.config.position.split(" "), u = l[0], p = l.length > 1 ? l[1] : null, d = t.getBoundingClientRect(), h = window.innerHeight - d.bottom, f = u === "above" || u !== "below" && h < i && d.top > i, c = window.pageYOffset + d.top + (f ? -i - 2 : t.offsetHeight + 2);
|
|
1110
|
+
if (T(e.calendarContainer, "arrowTop", !f), T(e.calendarContainer, "arrowBottom", f), !e.config.inline) {
|
|
1111
|
+
var b = window.pageXOffset + d.left, P = !1, I = !1;
|
|
1112
|
+
p === "center" ? (b -= (o - d.width) / 2, P = !0) : p === "right" && (b -= o - d.width, I = !0), T(e.calendarContainer, "arrowLeft", !P && !I), T(e.calendarContainer, "arrowCenter", P), T(e.calendarContainer, "arrowRight", I);
|
|
1113
|
+
var ee = window.document.body.offsetWidth - (window.pageXOffset + d.right), Z = b + o > window.document.body.offsetWidth, Mn = ee + o > window.document.body.offsetWidth;
|
|
1114
|
+
if (T(e.calendarContainer, "rightMost", Z), !e.config.static)
|
|
1115
|
+
if (e.calendarContainer.style.top = c + "px", !Z)
|
|
1116
|
+
e.calendarContainer.style.left = b + "px", e.calendarContainer.style.right = "auto";
|
|
1117
|
+
else if (!Mn)
|
|
1118
1118
|
e.calendarContainer.style.left = "auto", e.calendarContainer.style.right = ee + "px";
|
|
1119
1119
|
else {
|
|
1120
|
-
var
|
|
1121
|
-
if (
|
|
1120
|
+
var xe = dn();
|
|
1121
|
+
if (xe === void 0)
|
|
1122
1122
|
return;
|
|
1123
|
-
var
|
|
1124
|
-
T(e.calendarContainer, "rightMost", !1), T(e.calendarContainer, "centerMost", !0),
|
|
1123
|
+
var yn = window.document.body.offsetWidth, Cn = Math.max(0, yn / 2 - o / 2), En = ".flatpickr-calendar.centerMost:before", xn = ".flatpickr-calendar.centerMost:after", kn = xe.cssRules.length, Tn = "{left:" + d.left + "px;right:auto;}";
|
|
1124
|
+
T(e.calendarContainer, "rightMost", !1), T(e.calendarContainer, "centerMost", !0), xe.insertRule(En + "," + xn + Tn, kn), e.calendarContainer.style.left = Cn + "px", e.calendarContainer.style.right = "auto";
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function dn() {
|
|
1130
1130
|
for (var n = null, t = 0; t < document.styleSheets.length; t++) {
|
|
1131
1131
|
var i = document.styleSheets[t];
|
|
1132
1132
|
if (i.cssRules) {
|
|
@@ -1139,70 +1139,70 @@ function Fn(a, r) {
|
|
|
1139
1139
|
break;
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
return n ??
|
|
1142
|
+
return n ?? sn();
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function sn() {
|
|
1145
1145
|
var n = document.createElement("style");
|
|
1146
1146
|
return document.head.appendChild(n), n.sheet;
|
|
1147
1147
|
}
|
|
1148
1148
|
function Le() {
|
|
1149
|
-
e.config.noCalendar || e.isMobile || (V(),
|
|
1149
|
+
e.config.noCalendar || e.isMobile || (V(), ce(), oe());
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function Me() {
|
|
1152
1152
|
e._input.focus(), window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== void 0 ? setTimeout(e.close, 0) : e.close();
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Re(n) {
|
|
1155
1155
|
n.preventDefault(), n.stopPropagation();
|
|
1156
1156
|
var t = function(c) {
|
|
1157
1157
|
return c.classList && c.classList.contains("flatpickr-day") && !c.classList.contains("flatpickr-disabled") && !c.classList.contains("notAllowed");
|
|
1158
|
-
}, i =
|
|
1158
|
+
}, i = Ve(_(n), t);
|
|
1159
1159
|
if (i !== void 0) {
|
|
1160
|
-
var o = i, l = e.latestSelectedDateObj = new Date(o.dateObj.getTime()),
|
|
1160
|
+
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";
|
|
1161
1161
|
if (e.selectedDateElem = o, e.config.mode === "single")
|
|
1162
1162
|
e.selectedDates = [l];
|
|
1163
1163
|
else if (e.config.mode === "multiple") {
|
|
1164
|
-
var
|
|
1165
|
-
|
|
1166
|
-
} else e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = l, e.selectedDates.push(l), F(l, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(c,
|
|
1167
|
-
return c.getTime() -
|
|
1164
|
+
var p = Ce(l);
|
|
1165
|
+
p ? e.selectedDates.splice(parseInt(p), 1) : e.selectedDates.push(l);
|
|
1166
|
+
} else e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = l, e.selectedDates.push(l), F(l, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(c, b) {
|
|
1167
|
+
return c.getTime() - b.getTime();
|
|
1168
1168
|
}));
|
|
1169
|
-
if (A(),
|
|
1170
|
-
var
|
|
1171
|
-
e.currentYear = l.getFullYear(), e.currentMonth = l.getMonth(),
|
|
1169
|
+
if (A(), u) {
|
|
1170
|
+
var d = e.currentYear !== l.getFullYear();
|
|
1171
|
+
e.currentYear = l.getFullYear(), e.currentMonth = l.getMonth(), d && (M("onYearChange"), V()), M("onMonthChange");
|
|
1172
1172
|
}
|
|
1173
|
-
if (
|
|
1174
|
-
var
|
|
1175
|
-
(
|
|
1173
|
+
if (ce(), oe(), H(), !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) {
|
|
1174
|
+
var h = e.config.mode === "single" && !e.config.enableTime, f = e.config.mode === "range" && e.selectedDates.length === 2 && !e.config.enableTime;
|
|
1175
|
+
(h || f) && Me();
|
|
1176
1176
|
}
|
|
1177
|
-
|
|
1177
|
+
R();
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
var
|
|
1181
|
-
locale: [
|
|
1182
|
-
showMonths: [
|
|
1183
|
-
minDate: [
|
|
1184
|
-
maxDate: [
|
|
1185
|
-
positionElement: [
|
|
1180
|
+
var se = {
|
|
1181
|
+
locale: [je, Ne],
|
|
1182
|
+
showMonths: [Oe, y, Ae],
|
|
1183
|
+
minDate: [j],
|
|
1184
|
+
maxDate: [j],
|
|
1185
|
+
positionElement: [ze],
|
|
1186
1186
|
clickOpens: [
|
|
1187
1187
|
function() {
|
|
1188
1188
|
e.config.clickOpens === !0 ? (D(e._input, "focus", e.open), D(e._input, "click", e.open)) : (e._input.removeEventListener("focus", e.open), e._input.removeEventListener("click", e.open));
|
|
1189
1189
|
}
|
|
1190
1190
|
]
|
|
1191
1191
|
};
|
|
1192
|
-
function
|
|
1192
|
+
function cn(n, t) {
|
|
1193
1193
|
if (n !== null && typeof n == "object") {
|
|
1194
1194
|
Object.assign(e.config, n);
|
|
1195
1195
|
for (var i in n)
|
|
1196
|
-
|
|
1196
|
+
se[i] !== void 0 && se[i].forEach(function(o) {
|
|
1197
1197
|
return o();
|
|
1198
1198
|
});
|
|
1199
1199
|
} else
|
|
1200
|
-
e.config[n] = t,
|
|
1200
|
+
e.config[n] = t, se[n] !== void 0 ? se[n].forEach(function(o) {
|
|
1201
1201
|
return o();
|
|
1202
|
-
}) :
|
|
1202
|
+
}) : ke.indexOf(n) > -1 && (e.config[n] = Te(t));
|
|
1203
1203
|
e.redraw(), H(!0);
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function We(n, t) {
|
|
1206
1206
|
var i = [];
|
|
1207
1207
|
if (n instanceof Array)
|
|
1208
1208
|
i = n.map(function(o) {
|
|
@@ -1230,17 +1230,17 @@ function Fn(a, r) {
|
|
|
1230
1230
|
else
|
|
1231
1231
|
e.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(n)));
|
|
1232
1232
|
e.selectedDates = e.config.allowInvalidPreload ? i : i.filter(function(o) {
|
|
1233
|
-
return o instanceof Date &&
|
|
1233
|
+
return o instanceof Date && z(o, !1);
|
|
1234
1234
|
}), e.config.mode === "range" && e.selectedDates.sort(function(o, l) {
|
|
1235
1235
|
return o.getTime() - l.getTime();
|
|
1236
1236
|
});
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function gn(n, t, i) {
|
|
1239
1239
|
if (t === void 0 && (t = !1), i === void 0 && (i = e.config.dateFormat), n !== 0 && !n || n instanceof Array && n.length === 0)
|
|
1240
1240
|
return e.clear(t);
|
|
1241
|
-
|
|
1241
|
+
We(n, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), j(void 0, t), N(), e.selectedDates.length === 0 && e.clear(!1), H(t), t && M("onChange");
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function Je(n) {
|
|
1244
1244
|
return n.slice().map(function(t) {
|
|
1245
1245
|
return typeof t == "string" || typeof t == "number" || t instanceof Date ? e.parseDate(t, void 0, !0) : t && typeof t == "object" && t.from && t.to ? {
|
|
1246
1246
|
from: e.parseDate(t.from, void 0),
|
|
@@ -1250,22 +1250,22 @@ function Fn(a, r) {
|
|
|
1250
1250
|
return t;
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function mn() {
|
|
1254
1254
|
e.selectedDates = [], e.now = e.parseDate(e.config.now) || /* @__PURE__ */ new Date();
|
|
1255
1255
|
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);
|
|
1256
|
-
n &&
|
|
1256
|
+
n && We(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);
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
if (e.input =
|
|
1258
|
+
function pn() {
|
|
1259
|
+
if (e.input = He(), !e.input) {
|
|
1260
1260
|
e.config.errorHandler(new Error("Invalid input element specified"));
|
|
1261
1261
|
return;
|
|
1262
1262
|
}
|
|
1263
|
-
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 = v(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"),
|
|
1263
|
+
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 = v(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"), ze();
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function ze() {
|
|
1266
1266
|
e._positionElement = e.config.positionElement || e._input;
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function hn() {
|
|
1269
1269
|
var n = e.config.enableTime ? e.config.noCalendar ? "time" : "datetime-local" : "date";
|
|
1270
1270
|
e.mobileInput = v("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");
|
|
1271
1271
|
try {
|
|
@@ -1276,7 +1276,7 @@ function Fn(a, r) {
|
|
|
1276
1276
|
e.setDate(_(t).value, !1, e.mobileFormatStr), M("onChange"), M("onClose");
|
|
1277
1277
|
});
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function vn(n) {
|
|
1280
1280
|
if (e.isOpen === !0)
|
|
1281
1281
|
return e.close();
|
|
1282
1282
|
e.open(n);
|
|
@@ -1287,14 +1287,14 @@ function Fn(a, r) {
|
|
|
1287
1287
|
if (i !== void 0 && i.length > 0)
|
|
1288
1288
|
for (var o = 0; i[o] && o < i.length; o++)
|
|
1289
1289
|
i[o](e.selectedDates, e.input.value, e, t);
|
|
1290
|
-
n === "onChange" && (e.input.dispatchEvent(
|
|
1290
|
+
n === "onChange" && (e.input.dispatchEvent(ye("change")), e.input.dispatchEvent(ye("input")));
|
|
1291
1291
|
}
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function ye(n) {
|
|
1294
1294
|
var t = document.createEvent("Event");
|
|
1295
1295
|
return t.initEvent(n, !0, !0), t;
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Ce(n) {
|
|
1298
1298
|
for (var t = 0; t < e.selectedDates.length; t++) {
|
|
1299
1299
|
var i = e.selectedDates[t];
|
|
1300
1300
|
if (i instanceof Date && F(i, n) === 0)
|
|
@@ -1302,16 +1302,16 @@ function Fn(a, r) {
|
|
|
1302
1302
|
}
|
|
1303
1303
|
return !1;
|
|
1304
1304
|
}
|
|
1305
|
-
function
|
|
1305
|
+
function Dn(n) {
|
|
1306
1306
|
return e.config.mode !== "range" || e.selectedDates.length < 2 ? !1 : F(n, e.selectedDates[0]) >= 0 && F(n, e.selectedDates[1]) <= 0;
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function ce() {
|
|
1309
1309
|
e.config.noCalendar || e.isMobile || !e.monthNav || (e.yearElements.forEach(function(n, t) {
|
|
1310
1310
|
var i = new Date(e.currentYear, e.currentMonth, 1);
|
|
1311
|
-
i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent =
|
|
1311
|
+
i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent = pe(i.getMonth(), e.config.shorthandCurrentMonth, e.l10n) + " " : e.monthsDropdownContainer.value = i.getMonth().toString(), n.value = i.getFullYear().toString();
|
|
1312
1312
|
}), 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()));
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function Ee(n) {
|
|
1315
1315
|
var t = n || (e.config.altInput ? e.config.altFormat : e.config.dateFormat);
|
|
1316
1316
|
return e.selectedDates.map(function(i) {
|
|
1317
1317
|
return e.formatDate(i, t);
|
|
@@ -1320,103 +1320,246 @@ function Fn(a, r) {
|
|
|
1320
1320
|
}).join(e.config.mode !== "range" ? e.config.conjunction : e.l10n.rangeSeparator);
|
|
1321
1321
|
}
|
|
1322
1322
|
function H(n) {
|
|
1323
|
-
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 =
|
|
1323
|
+
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 && M("onValueUpdate");
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function bn(n) {
|
|
1326
1326
|
var t = _(n), i = e.prevMonthNav.contains(t), o = e.nextMonthNav.contains(t);
|
|
1327
|
-
i || o ?
|
|
1327
|
+
i || o ? be(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);
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1329
|
+
function wn(n) {
|
|
1330
1330
|
n.preventDefault();
|
|
1331
1331
|
var t = n.type === "keydown", i = _(n), o = i;
|
|
1332
1332
|
e.amPM !== void 0 && i === e.amPM && (e.amPM.textContent = e.l10n.amPM[O(e.amPM.textContent === e.l10n.amPM[0])]);
|
|
1333
|
-
var l = parseFloat(o.getAttribute("min")),
|
|
1333
|
+
var l = parseFloat(o.getAttribute("min")), u = parseFloat(o.getAttribute("max")), p = parseFloat(o.getAttribute("step")), d = parseInt(o.value, 10), h = n.delta || (t ? n.which === 38 ? 1 : -1 : 0), f = d + p * h;
|
|
1334
1334
|
if (typeof o.value < "u" && o.value.length === 2) {
|
|
1335
|
-
var c = o === e.hourElement,
|
|
1336
|
-
|
|
1335
|
+
var c = o === e.hourElement, b = o === e.minuteElement;
|
|
1336
|
+
f < l ? (f = u + f + O(!c) + (O(c) && O(!e.amPM)), b && K(void 0, -1, e.hourElement)) : f > u && (f = o === e.hourElement ? f - u - O(!e.amPM) : l, b && K(void 0, 1, e.hourElement)), e.amPM && c && (p === 1 ? f + d === 23 : Math.abs(f - d) > p) && (e.amPM.textContent = e.l10n.amPM[O(e.amPM.textContent === e.l10n.amPM[0])]), o.value = S(f);
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return m(), e;
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1342
|
-
for (var e = Array.prototype.slice.call(a).filter(function(
|
|
1343
|
-
return
|
|
1344
|
-
}),
|
|
1345
|
-
var g = e[
|
|
1341
|
+
function $(a, r) {
|
|
1342
|
+
for (var e = Array.prototype.slice.call(a).filter(function(w) {
|
|
1343
|
+
return w instanceof HTMLElement;
|
|
1344
|
+
}), s = [], m = 0; m < e.length; m++) {
|
|
1345
|
+
var g = e[m];
|
|
1346
1346
|
try {
|
|
1347
1347
|
if (g.getAttribute("data-fp-omit") !== null)
|
|
1348
1348
|
continue;
|
|
1349
|
-
g._flatpickr !== void 0 && (g._flatpickr.destroy(), g._flatpickr = void 0), g._flatpickr =
|
|
1350
|
-
} catch (
|
|
1351
|
-
console.error(
|
|
1349
|
+
g._flatpickr !== void 0 && (g._flatpickr.destroy(), g._flatpickr = void 0), g._flatpickr = Pn(g, r || {}), s.push(g._flatpickr);
|
|
1350
|
+
} catch (w) {
|
|
1351
|
+
console.error(w);
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
return
|
|
1354
|
+
return s.length === 1 ? s[0] : s;
|
|
1355
1355
|
}
|
|
1356
1356
|
typeof HTMLElement < "u" && typeof HTMLCollection < "u" && typeof NodeList < "u" && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function(a) {
|
|
1357
|
-
return
|
|
1357
|
+
return $(this, a);
|
|
1358
1358
|
}, HTMLElement.prototype.flatpickr = function(a) {
|
|
1359
|
-
return
|
|
1359
|
+
return $([this], a);
|
|
1360
1360
|
});
|
|
1361
|
-
var
|
|
1362
|
-
return typeof a == "string" ?
|
|
1361
|
+
var E = function(a, r) {
|
|
1362
|
+
return typeof a == "string" ? $(window.document.querySelectorAll(a), r) : a instanceof Node ? $([a], r) : $(a, r);
|
|
1363
1363
|
};
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
en: k({},
|
|
1367
|
-
default: k({},
|
|
1364
|
+
E.defaultConfig = {};
|
|
1365
|
+
E.l10ns = {
|
|
1366
|
+
en: k({}, ie),
|
|
1367
|
+
default: k({}, ie)
|
|
1368
1368
|
};
|
|
1369
|
-
|
|
1370
|
-
|
|
1369
|
+
E.localize = function(a) {
|
|
1370
|
+
E.l10ns.default = k(k({}, E.l10ns.default), a);
|
|
1371
1371
|
};
|
|
1372
|
-
|
|
1373
|
-
|
|
1372
|
+
E.setDefaults = function(a) {
|
|
1373
|
+
E.defaultConfig = k(k({}, E.defaultConfig), a);
|
|
1374
1374
|
};
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1375
|
+
E.parseDate = Fe({});
|
|
1376
|
+
E.formatDate = Ze({});
|
|
1377
|
+
E.compareDates = F;
|
|
1378
1378
|
typeof jQuery < "u" && typeof jQuery.fn < "u" && (jQuery.fn.flatpickr = function(a) {
|
|
1379
|
-
return
|
|
1379
|
+
return $(this, a);
|
|
1380
1380
|
});
|
|
1381
1381
|
Date.prototype.fp_incr = function(a) {
|
|
1382
1382
|
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof a == "string" ? parseInt(a, 10) : a));
|
|
1383
1383
|
};
|
|
1384
|
-
typeof window < "u" && (window.flatpickr =
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1384
|
+
typeof window < "u" && (window.flatpickr = E);
|
|
1385
|
+
var ne = { exports: {} }, Yn = ne.exports, qe;
|
|
1386
|
+
function Hn() {
|
|
1387
|
+
return qe || (qe = 1, (function(a, r) {
|
|
1388
|
+
(function(e, s) {
|
|
1389
|
+
s(r);
|
|
1390
|
+
})(Yn, (function(e) {
|
|
1391
|
+
var s = typeof window < "u" && window.flatpickr !== void 0 ? window.flatpickr : {
|
|
1392
|
+
l10ns: {}
|
|
1393
|
+
}, m = {
|
|
1394
|
+
weekdays: {
|
|
1395
|
+
shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
1396
|
+
longhand: [
|
|
1397
|
+
"星期日",
|
|
1398
|
+
"星期一",
|
|
1399
|
+
"星期二",
|
|
1400
|
+
"星期三",
|
|
1401
|
+
"星期四",
|
|
1402
|
+
"星期五",
|
|
1403
|
+
"星期六"
|
|
1404
|
+
]
|
|
1405
|
+
},
|
|
1406
|
+
months: {
|
|
1407
|
+
shorthand: [
|
|
1408
|
+
"一月",
|
|
1409
|
+
"二月",
|
|
1410
|
+
"三月",
|
|
1411
|
+
"四月",
|
|
1412
|
+
"五月",
|
|
1413
|
+
"六月",
|
|
1414
|
+
"七月",
|
|
1415
|
+
"八月",
|
|
1416
|
+
"九月",
|
|
1417
|
+
"十月",
|
|
1418
|
+
"十一月",
|
|
1419
|
+
"十二月"
|
|
1420
|
+
],
|
|
1421
|
+
longhand: [
|
|
1422
|
+
"一月",
|
|
1423
|
+
"二月",
|
|
1424
|
+
"三月",
|
|
1425
|
+
"四月",
|
|
1426
|
+
"五月",
|
|
1427
|
+
"六月",
|
|
1428
|
+
"七月",
|
|
1429
|
+
"八月",
|
|
1430
|
+
"九月",
|
|
1431
|
+
"十月",
|
|
1432
|
+
"十一月",
|
|
1433
|
+
"十二月"
|
|
1434
|
+
]
|
|
1435
|
+
},
|
|
1436
|
+
rangeSeparator: " 至 ",
|
|
1437
|
+
weekAbbreviation: "周",
|
|
1438
|
+
scrollTitle: "滚动切换",
|
|
1439
|
+
toggleTitle: "点击切换 12/24 小时时制"
|
|
1440
|
+
};
|
|
1441
|
+
s.l10ns.zh = m;
|
|
1442
|
+
var g = s.l10ns;
|
|
1443
|
+
e.Mandarin = m, e.default = g, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1444
|
+
}));
|
|
1445
|
+
})(ne, ne.exports)), ne.exports;
|
|
1446
|
+
}
|
|
1447
|
+
var jn = Hn(), te = { exports: {} }, Ln = te.exports, Ue;
|
|
1448
|
+
function Rn() {
|
|
1449
|
+
return Ue || (Ue = 1, (function(a, r) {
|
|
1450
|
+
(function(e, s) {
|
|
1451
|
+
s(r);
|
|
1452
|
+
})(Ln, (function(e) {
|
|
1453
|
+
var s = typeof window < "u" && window.flatpickr !== void 0 ? window.flatpickr : {
|
|
1454
|
+
l10ns: {}
|
|
1455
|
+
}, m = {
|
|
1456
|
+
weekdays: {
|
|
1457
|
+
shorthand: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
|
|
1458
|
+
longhand: [
|
|
1459
|
+
"星期日",
|
|
1460
|
+
"星期一",
|
|
1461
|
+
"星期二",
|
|
1462
|
+
"星期三",
|
|
1463
|
+
"星期四",
|
|
1464
|
+
"星期五",
|
|
1465
|
+
"星期六"
|
|
1466
|
+
]
|
|
1467
|
+
},
|
|
1468
|
+
months: {
|
|
1469
|
+
shorthand: [
|
|
1470
|
+
"一月",
|
|
1471
|
+
"二月",
|
|
1472
|
+
"三月",
|
|
1473
|
+
"四月",
|
|
1474
|
+
"五月",
|
|
1475
|
+
"六月",
|
|
1476
|
+
"七月",
|
|
1477
|
+
"八月",
|
|
1478
|
+
"九月",
|
|
1479
|
+
"十月",
|
|
1480
|
+
"十一月",
|
|
1481
|
+
"十二月"
|
|
1482
|
+
],
|
|
1483
|
+
longhand: [
|
|
1484
|
+
"一月",
|
|
1485
|
+
"二月",
|
|
1486
|
+
"三月",
|
|
1487
|
+
"四月",
|
|
1488
|
+
"五月",
|
|
1489
|
+
"六月",
|
|
1490
|
+
"七月",
|
|
1491
|
+
"八月",
|
|
1492
|
+
"九月",
|
|
1493
|
+
"十月",
|
|
1494
|
+
"十一月",
|
|
1495
|
+
"十二月"
|
|
1496
|
+
]
|
|
1497
|
+
},
|
|
1498
|
+
rangeSeparator: " 至 ",
|
|
1499
|
+
weekAbbreviation: "週",
|
|
1500
|
+
scrollTitle: "滾動切換",
|
|
1501
|
+
toggleTitle: "點擊切換 12/24 小時時制"
|
|
1502
|
+
};
|
|
1503
|
+
s.l10ns.zh_tw = m;
|
|
1504
|
+
var g = s.l10ns;
|
|
1505
|
+
e.MandarinTraditional = m, e.default = g, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1506
|
+
}));
|
|
1507
|
+
})(te, te.exports)), te.exports;
|
|
1508
|
+
}
|
|
1509
|
+
var Wn = Rn();
|
|
1510
|
+
const Jn = {
|
|
1511
|
+
weekdays: {
|
|
1512
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1513
|
+
longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
1514
|
+
},
|
|
1515
|
+
months: {
|
|
1516
|
+
shorthand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1517
|
+
longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
|
1518
|
+
}
|
|
1519
|
+
}, Ge = {
|
|
1520
|
+
weekdays: {
|
|
1521
|
+
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1522
|
+
longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
1523
|
+
},
|
|
1524
|
+
months: {
|
|
1525
|
+
shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
1526
|
+
longhand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
1527
|
+
}
|
|
1528
|
+
}, zn = {
|
|
1529
|
+
zh: jn.Mandarin,
|
|
1530
|
+
"zh-tw": Wn.MandarinTraditional,
|
|
1531
|
+
"en-full": Jn,
|
|
1532
|
+
"en-short": Ge
|
|
1533
|
+
}, Bn = (a) => {
|
|
1534
|
+
if (a._flatpickr || a.dataset.datepickerInitialized) return;
|
|
1535
|
+
const r = a.dataset.mode || "single", e = a.dataset.enableTime === "true", s = a.dataset.noCalendar === "true", m = a.dataset.inline === "true", g = a.dataset.dateFormat || (e && s ? "H:i" : "Y-m-d"), w = a.dataset.locale || "en-short", y = zn[w] || Ge;
|
|
1536
|
+
E(a, {
|
|
1537
|
+
mode: r,
|
|
1538
|
+
enableTime: e,
|
|
1539
|
+
noCalendar: s,
|
|
1540
|
+
inline: m,
|
|
1541
|
+
dateFormat: g,
|
|
1542
|
+
allowInput: !0,
|
|
1543
|
+
shorthandCurrentMonth: w === "en-short",
|
|
1544
|
+
static: !m,
|
|
1545
|
+
locale: y,
|
|
1546
|
+
onOpen: () => {
|
|
1547
|
+
document.dispatchEvent(new CustomEvent("basecoat:popover", { detail: { source: a } }));
|
|
1548
|
+
},
|
|
1549
|
+
onChange: (x, L) => {
|
|
1550
|
+
a.dispatchEvent(new CustomEvent("change", {
|
|
1551
|
+
bubbles: !0,
|
|
1552
|
+
detail: { value: L, dates: x }
|
|
1553
|
+
}));
|
|
1554
|
+
}
|
|
1555
|
+
}), a.dataset.datepickerInitialized = "true", a.dispatchEvent(new CustomEvent("basecoat:initialized"));
|
|
1407
1556
|
};
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
d.nodeType === 1 && (d.classList?.contains("datepicker") ? Se(d.parentNode) : d.querySelector?.(".datepicker") && Se(d));
|
|
1413
|
-
});
|
|
1414
|
-
});
|
|
1557
|
+
window.basecoat && (window.basecoat.register("datepicker", ".datepicker:not([data-datepicker-initialized])", Bn), (document.readyState === "complete" || document.readyState === "interactive") && window.basecoat.init("datepicker"));
|
|
1558
|
+
document.addEventListener("basecoat:popover", (a) => {
|
|
1559
|
+
document.querySelectorAll(".datepicker").forEach((r) => {
|
|
1560
|
+
r._flatpickr && r._flatpickr.isOpen && a.detail?.source !== r && r._flatpickr.close();
|
|
1415
1561
|
});
|
|
1416
|
-
|
|
1417
|
-
Se(), a.observe(document.body, { childList: !0, subtree: !0 });
|
|
1418
|
-
});
|
|
1419
|
-
}
|
|
1562
|
+
});
|
|
1420
1563
|
export {
|
|
1421
|
-
|
|
1564
|
+
Bn as initDatepicker
|
|
1422
1565
|
};
|