@keenmate/web-daterangepicker 1.2.0 → 1.4.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/README.md +111 -63
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +918 -902
- package/dist/web-daterangepicker.umd.js +9 -9
- package/package.json +1 -1
- package/src/scss/_badges.scss +6 -6
- package/src/scss/_base.scss +234 -2
- package/src/scss/_calendar-grid.scss +20 -20
- package/src/scss/_header-navigation.scss +30 -30
- package/src/scss/_summary-actions.scss +15 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Kt = Object.defineProperty;
|
|
2
2
|
var Gt = (e, a, t) => a in e ? Kt(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
-
var
|
|
3
|
+
var b = (e, a, t) => Gt(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
function Xt(e) {
|
|
5
5
|
if (e !== "auto")
|
|
6
6
|
return e;
|
|
@@ -31,7 +31,7 @@ function Xt(e) {
|
|
|
31
31
|
// South Korea
|
|
32
32
|
].some((n) => a.startsWith(n)) ? 0 : 1;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function he(e) {
|
|
35
35
|
if (!e) return null;
|
|
36
36
|
let a;
|
|
37
37
|
return typeof e == "string" ? a = /* @__PURE__ */ new Date(e + "T00:00:00") : a = new Date(e), a.setHours(0, 0, 0, 0), isNaN(a.getTime()) ? null : a;
|
|
@@ -41,15 +41,15 @@ function me(e) {
|
|
|
41
41
|
return `${a}-${t}-${n}`;
|
|
42
42
|
}
|
|
43
43
|
function Jt(e, a, t, n, i) {
|
|
44
|
-
const
|
|
45
|
-
return !!(a && e < a || t && e > t || i && i.includes(o) || n.has(
|
|
44
|
+
const r = me(e), o = e.getDay();
|
|
45
|
+
return !!(a && e < a || t && e > t || i && i.includes(o) || n.has(r));
|
|
46
46
|
}
|
|
47
47
|
function ct(e, a) {
|
|
48
48
|
for (let t = 0; t < 12; t++) {
|
|
49
49
|
const n = new Date(a, t + 1, 0).getDate();
|
|
50
50
|
for (let i = 1; i <= n; i++) {
|
|
51
|
-
const
|
|
52
|
-
if (!e.isDateDisabledInternal(
|
|
51
|
+
const r = new Date(a, t, i);
|
|
52
|
+
if (!e.isDateDisabledInternal(r))
|
|
53
53
|
return !0;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -58,72 +58,72 @@ function ct(e, a) {
|
|
|
58
58
|
function Qt(e, a, t) {
|
|
59
59
|
const n = new Date(e), i = new Date(a);
|
|
60
60
|
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
61
|
-
const
|
|
62
|
-
for (;
|
|
63
|
-
if (t(
|
|
61
|
+
const r = new Date(n);
|
|
62
|
+
for (; r <= i; ) {
|
|
63
|
+
if (t(r))
|
|
64
64
|
return !0;
|
|
65
|
-
|
|
65
|
+
r.setDate(r.getDate() + 1);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
function Zt(e, a, t) {
|
|
70
|
-
const n = [], i = new Date(e),
|
|
71
|
-
i.setHours(0, 0, 0, 0),
|
|
70
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
71
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
72
72
|
const o = new Date(i);
|
|
73
|
-
for (; o <=
|
|
73
|
+
for (; o <= r; )
|
|
74
74
|
t(o) || n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
77
|
function ea(e, a, t) {
|
|
78
|
-
const n = [], i = new Date(e),
|
|
79
|
-
i.setHours(0, 0, 0, 0),
|
|
78
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
79
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
80
80
|
const o = new Date(i);
|
|
81
|
-
for (; o <=
|
|
81
|
+
for (; o <= r; )
|
|
82
82
|
t(o) && n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
85
|
function ta(e, a, t) {
|
|
86
86
|
const n = new Date(e), i = new Date(a);
|
|
87
87
|
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
88
|
-
let
|
|
88
|
+
let r = new Date(n);
|
|
89
89
|
const o = new Date(n);
|
|
90
90
|
for (o.setDate(o.getDate() + 1); o <= i; ) {
|
|
91
91
|
if (t(o))
|
|
92
|
-
return
|
|
93
|
-
|
|
92
|
+
return r;
|
|
93
|
+
r = new Date(o), o.setDate(o.getDate() + 1);
|
|
94
94
|
}
|
|
95
95
|
return i;
|
|
96
96
|
}
|
|
97
97
|
function aa(e, a, t) {
|
|
98
|
-
const n = [], i = new Date(e),
|
|
99
|
-
i.setHours(0, 0, 0, 0),
|
|
98
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
99
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
100
100
|
let o = null;
|
|
101
|
-
const
|
|
102
|
-
for (;
|
|
103
|
-
if (!t(
|
|
104
|
-
o || (o = new Date(
|
|
101
|
+
const s = new Date(i);
|
|
102
|
+
for (; s <= r; ) {
|
|
103
|
+
if (!t(s))
|
|
104
|
+
o || (o = new Date(s));
|
|
105
105
|
else if (o) {
|
|
106
|
-
const d = new Date(
|
|
106
|
+
const d = new Date(s);
|
|
107
107
|
d.setDate(d.getDate() - 1), n.push({ start: o, end: d }), o = null;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
s.setDate(s.getDate() + 1);
|
|
110
110
|
}
|
|
111
|
-
return o && n.push({ start: o, end: new Date(
|
|
111
|
+
return o && n.push({ start: o, end: new Date(r) }), n;
|
|
112
112
|
}
|
|
113
113
|
function ut(e) {
|
|
114
|
-
return
|
|
114
|
+
return pt(e, /* @__PURE__ */ new Date());
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function pt(e, a) {
|
|
117
117
|
return !e || !a ? !1 : e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate();
|
|
118
118
|
}
|
|
119
119
|
function na(e, a, t) {
|
|
120
120
|
return !a || !t ? !1 : e > a && e < t;
|
|
121
121
|
}
|
|
122
122
|
var ia = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
123
|
-
function
|
|
123
|
+
function ra(e) {
|
|
124
124
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
126
|
+
var gt = { exports: {} };
|
|
127
127
|
(function(e) {
|
|
128
128
|
(function(a, t) {
|
|
129
129
|
e.exports ? e.exports = t() : a.log = t();
|
|
@@ -135,16 +135,16 @@ var ht = { exports: {} };
|
|
|
135
135
|
"info",
|
|
136
136
|
"warn",
|
|
137
137
|
"error"
|
|
138
|
-
],
|
|
139
|
-
function
|
|
140
|
-
var
|
|
141
|
-
if (typeof
|
|
142
|
-
return
|
|
138
|
+
], r = {}, o = null;
|
|
139
|
+
function s(f, y) {
|
|
140
|
+
var h = f[y];
|
|
141
|
+
if (typeof h.bind == "function")
|
|
142
|
+
return h.bind(f);
|
|
143
143
|
try {
|
|
144
|
-
return Function.prototype.bind.call(
|
|
144
|
+
return Function.prototype.bind.call(h, f);
|
|
145
145
|
} catch {
|
|
146
146
|
return function() {
|
|
147
|
-
return Function.prototype.apply.apply(
|
|
147
|
+
return Function.prototype.apply.apply(h, [f, arguments]);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
}
|
|
@@ -152,26 +152,26 @@ var ht = { exports: {} };
|
|
|
152
152
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
153
153
|
}
|
|
154
154
|
function l(f) {
|
|
155
|
-
return f === "debug" && (f = "log"), typeof console === t ? !1 : f === "trace" && n ? d : console[f] !== void 0 ?
|
|
155
|
+
return f === "debug" && (f = "log"), typeof console === t ? !1 : f === "trace" && n ? d : console[f] !== void 0 ? s(console, f) : console.log !== void 0 ? s(console, "log") : a;
|
|
156
156
|
}
|
|
157
157
|
function c() {
|
|
158
|
-
for (var f = this.getLevel(),
|
|
159
|
-
var
|
|
160
|
-
this[
|
|
158
|
+
for (var f = this.getLevel(), y = 0; y < i.length; y++) {
|
|
159
|
+
var h = i[y];
|
|
160
|
+
this[h] = y < f ? a : this.methodFactory(h, f, this.name);
|
|
161
161
|
}
|
|
162
162
|
if (this.log = this.debug, typeof console === t && f < this.levels.SILENT)
|
|
163
163
|
return "No console available for logging";
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function p(f) {
|
|
166
166
|
return function() {
|
|
167
167
|
typeof console !== t && (c.call(this), this[f].apply(this, arguments));
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function u(f,
|
|
171
|
-
return l(f) ||
|
|
170
|
+
function u(f, y, h) {
|
|
171
|
+
return l(f) || p.apply(this, arguments);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
173
|
+
function g(f, y) {
|
|
174
|
+
var h = this, M, C, E, _ = "loglevel";
|
|
175
175
|
typeof f == "string" ? _ += ":" + f : typeof f == "symbol" && (_ = void 0);
|
|
176
176
|
function v(S) {
|
|
177
177
|
var R = (i[S] || "silent").toUpperCase();
|
|
@@ -196,13 +196,13 @@ var ht = { exports: {} };
|
|
|
196
196
|
}
|
|
197
197
|
if (typeof S === t)
|
|
198
198
|
try {
|
|
199
|
-
var R = window.document.cookie,
|
|
199
|
+
var R = window.document.cookie, T = encodeURIComponent(_), L = R.indexOf(T + "=");
|
|
200
200
|
L !== -1 && (S = /^([^;]+)/.exec(
|
|
201
|
-
R.slice(L +
|
|
201
|
+
R.slice(L + T.length + 1)
|
|
202
202
|
)[1]);
|
|
203
203
|
} catch {
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return h.levels[S] === void 0 && (S = void 0), S;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
function A() {
|
|
@@ -219,58 +219,58 @@ var ht = { exports: {} };
|
|
|
219
219
|
}
|
|
220
220
|
function D(S) {
|
|
221
221
|
var R = S;
|
|
222
|
-
if (typeof R == "string" &&
|
|
222
|
+
if (typeof R == "string" && h.levels[R.toUpperCase()] !== void 0 && (R = h.levels[R.toUpperCase()]), typeof R == "number" && R >= 0 && R <= h.levels.SILENT)
|
|
223
223
|
return R;
|
|
224
224
|
throw new TypeError("log.setLevel() called with invalid level: " + S);
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
h.name = f, h.levels = {
|
|
227
227
|
TRACE: 0,
|
|
228
228
|
DEBUG: 1,
|
|
229
229
|
INFO: 2,
|
|
230
230
|
WARN: 3,
|
|
231
231
|
ERROR: 4,
|
|
232
232
|
SILENT: 5
|
|
233
|
-
},
|
|
233
|
+
}, h.methodFactory = y || u, h.getLevel = function() {
|
|
234
234
|
return E ?? C ?? M;
|
|
235
|
-
},
|
|
236
|
-
return E = D(S), R !== !1 && v(E), c.call(
|
|
237
|
-
},
|
|
238
|
-
C = D(S), I() ||
|
|
239
|
-
},
|
|
240
|
-
E = null, A(), c.call(
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
if (o !==
|
|
247
|
-
for (var S in
|
|
248
|
-
|
|
235
|
+
}, h.setLevel = function(S, R) {
|
|
236
|
+
return E = D(S), R !== !1 && v(E), c.call(h);
|
|
237
|
+
}, h.setDefaultLevel = function(S) {
|
|
238
|
+
C = D(S), I() || h.setLevel(S, !1);
|
|
239
|
+
}, h.resetLevel = function() {
|
|
240
|
+
E = null, A(), c.call(h);
|
|
241
|
+
}, h.enableAll = function(S) {
|
|
242
|
+
h.setLevel(h.levels.TRACE, S);
|
|
243
|
+
}, h.disableAll = function(S) {
|
|
244
|
+
h.setLevel(h.levels.SILENT, S);
|
|
245
|
+
}, h.rebuild = function() {
|
|
246
|
+
if (o !== h && (M = D(o.getLevel())), c.call(h), o === h)
|
|
247
|
+
for (var S in r)
|
|
248
|
+
r[S].rebuild();
|
|
249
249
|
}, M = D(
|
|
250
250
|
o ? o.getLevel() : "WARN"
|
|
251
251
|
);
|
|
252
252
|
var x = I();
|
|
253
|
-
x != null && (E = D(x)), c.call(
|
|
253
|
+
x != null && (E = D(x)), c.call(h);
|
|
254
254
|
}
|
|
255
|
-
o = new
|
|
256
|
-
if (typeof
|
|
255
|
+
o = new g(), o.getLogger = function(y) {
|
|
256
|
+
if (typeof y != "symbol" && typeof y != "string" || y === "")
|
|
257
257
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
258
|
-
var
|
|
259
|
-
return
|
|
260
|
-
|
|
258
|
+
var h = r[y];
|
|
259
|
+
return h || (h = r[y] = new g(
|
|
260
|
+
y,
|
|
261
261
|
o.methodFactory
|
|
262
|
-
)),
|
|
262
|
+
)), h;
|
|
263
263
|
};
|
|
264
264
|
var m = typeof window !== t ? window.log : void 0;
|
|
265
265
|
return o.noConflict = function() {
|
|
266
266
|
return typeof window !== t && window.log === o && (window.log = m), o;
|
|
267
267
|
}, o.getLoggers = function() {
|
|
268
|
-
return
|
|
268
|
+
return r;
|
|
269
269
|
}, o.default = o, o;
|
|
270
270
|
});
|
|
271
|
-
})(
|
|
272
|
-
var oa =
|
|
273
|
-
const Y = /* @__PURE__ */
|
|
271
|
+
})(gt);
|
|
272
|
+
var oa = gt.exports;
|
|
273
|
+
const Y = /* @__PURE__ */ ra(oa), sa = [
|
|
274
274
|
"DRP",
|
|
275
275
|
"DRP:RENDERING",
|
|
276
276
|
"DRP:INTERACTION",
|
|
@@ -293,49 +293,49 @@ const Y = /* @__PURE__ */ sa(oa), ra = [
|
|
|
293
293
|
}, la = Y.methodFactory, ca = (e, a, t) => {
|
|
294
294
|
const n = la.call(Y, e, a, t);
|
|
295
295
|
return (...i) => {
|
|
296
|
-
const
|
|
296
|
+
const r = da[e] || "#6b7280", s = `%c[${(/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
297
297
|
hour12: !1,
|
|
298
298
|
hour: "2-digit",
|
|
299
299
|
minute: "2-digit",
|
|
300
300
|
second: "2-digit",
|
|
301
301
|
fractionalSecondDigits: 3
|
|
302
302
|
})}] [${e.toUpperCase()}] ${t ? `[${t}]` : ""}`;
|
|
303
|
-
n(
|
|
303
|
+
n(s, `color: ${r}`, ...i);
|
|
304
304
|
};
|
|
305
|
-
},
|
|
305
|
+
}, ht = [];
|
|
306
306
|
function Q(e) {
|
|
307
307
|
const a = Y.getLogger(e);
|
|
308
|
-
return a.methodFactory = ca, a.setLevel("silent"),
|
|
308
|
+
return a.methodFactory = ca, a.setLevel("silent"), ht.push(a), a;
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const k = Q("DRP"), de = Q("DRP:RENDERING"), oe = Q("DRP:INTERACTION"), re = Q("DRP:SELECTION"), w = Q("DRP:NAVIGATION"), O = Q("DRP:UI"), ee = Q("DRP:VALIDATION"), U = Q("DRP:DRAG");
|
|
311
311
|
Y.setLevel("silent");
|
|
312
312
|
const We = (e) => {
|
|
313
|
-
Y.setLevel(e),
|
|
313
|
+
Y.setLevel(e), ht.forEach((a) => a.setLevel(e));
|
|
314
314
|
}, ft = () => {
|
|
315
315
|
We("debug");
|
|
316
316
|
}, mt = () => {
|
|
317
317
|
We("silent");
|
|
318
318
|
}, ua = (e, a = "debug") => {
|
|
319
319
|
const n = {
|
|
320
|
-
DRP:
|
|
320
|
+
DRP: k,
|
|
321
321
|
"DRP:RENDERING": de,
|
|
322
322
|
"DRP:INTERACTION": oe,
|
|
323
|
-
"DRP:SELECTION":
|
|
323
|
+
"DRP:SELECTION": re,
|
|
324
324
|
"DRP:NAVIGATION": w,
|
|
325
|
-
"DRP:UI":
|
|
325
|
+
"DRP:UI": O,
|
|
326
326
|
"DRP:VALIDATION": ee,
|
|
327
327
|
"DRP:DRAG": U
|
|
328
328
|
}[e];
|
|
329
329
|
n && n.setLevel(a);
|
|
330
|
-
},
|
|
330
|
+
}, pa = () => [...sa], le = Math.min, te = Math.max, Ie = Math.round, Me = Math.floor, W = (e) => ({
|
|
331
331
|
x: e,
|
|
332
332
|
y: e
|
|
333
|
-
}),
|
|
333
|
+
}), ga = {
|
|
334
334
|
left: "right",
|
|
335
335
|
right: "left",
|
|
336
336
|
bottom: "top",
|
|
337
337
|
top: "bottom"
|
|
338
|
-
},
|
|
338
|
+
}, ha = {
|
|
339
339
|
start: "end",
|
|
340
340
|
end: "start"
|
|
341
341
|
};
|
|
@@ -351,7 +351,7 @@ function ne(e) {
|
|
|
351
351
|
function we(e) {
|
|
352
352
|
return e.split("-")[1];
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function bt(e) {
|
|
355
355
|
return e === "x" ? "y" : "x";
|
|
356
356
|
}
|
|
357
357
|
function Ke(e) {
|
|
@@ -362,22 +362,22 @@ function X(e) {
|
|
|
362
362
|
return fa.has(ne(e)) ? "y" : "x";
|
|
363
363
|
}
|
|
364
364
|
function Ge(e) {
|
|
365
|
-
return
|
|
365
|
+
return bt(X(e));
|
|
366
366
|
}
|
|
367
367
|
function ma(e, a, t) {
|
|
368
368
|
t === void 0 && (t = !1);
|
|
369
|
-
const n = we(e), i = Ge(e),
|
|
369
|
+
const n = we(e), i = Ge(e), r = Ke(i);
|
|
370
370
|
let o = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
|
-
return a.reference[
|
|
371
|
+
return a.reference[r] > a.floating[r] && (o = Ee(o)), [o, Ee(o)];
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ba(e) {
|
|
374
374
|
const a = Ee(e);
|
|
375
375
|
return [He(e), a, He(a)];
|
|
376
376
|
}
|
|
377
377
|
function He(e) {
|
|
378
|
-
return e.replace(/start|end/g, (a) =>
|
|
378
|
+
return e.replace(/start|end/g, (a) => ha[a]);
|
|
379
379
|
}
|
|
380
|
-
const nt = ["left", "right"], it = ["right", "left"],
|
|
380
|
+
const nt = ["left", "right"], it = ["right", "left"], ya = ["top", "bottom"], va = ["bottom", "top"];
|
|
381
381
|
function Da(e, a, t) {
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "top":
|
|
@@ -385,18 +385,18 @@ function Da(e, a, t) {
|
|
|
385
385
|
return t ? a ? it : nt : a ? nt : it;
|
|
386
386
|
case "left":
|
|
387
387
|
case "right":
|
|
388
|
-
return a ?
|
|
388
|
+
return a ? ya : va;
|
|
389
389
|
default:
|
|
390
390
|
return [];
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
function _a(e, a, t, n) {
|
|
394
394
|
const i = we(e);
|
|
395
|
-
let
|
|
396
|
-
return i && (
|
|
395
|
+
let r = Da(ne(e), t === "start", n);
|
|
396
|
+
return i && (r = r.map((o) => o + "-" + i), a && (r = r.concat(r.map(He)))), r;
|
|
397
397
|
}
|
|
398
398
|
function Ee(e) {
|
|
399
|
-
return e.replace(/left|right|bottom|top/g, (a) =>
|
|
399
|
+
return e.replace(/left|right|bottom|top/g, (a) => ga[a]);
|
|
400
400
|
}
|
|
401
401
|
function wa(e) {
|
|
402
402
|
return {
|
|
@@ -407,7 +407,7 @@ function wa(e) {
|
|
|
407
407
|
...e
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function yt(e) {
|
|
411
411
|
return typeof e != "number" ? wa(e) : {
|
|
412
412
|
top: e,
|
|
413
413
|
right: e,
|
|
@@ -433,85 +433,85 @@ function Re(e) {
|
|
|
433
433
|
y: t
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function rt(e, a, t) {
|
|
437
437
|
let {
|
|
438
438
|
reference: n,
|
|
439
439
|
floating: i
|
|
440
440
|
} = e;
|
|
441
|
-
const
|
|
442
|
-
let
|
|
441
|
+
const r = X(a), o = Ge(a), s = Ke(o), d = ne(a), l = r === "y", c = n.x + n.width / 2 - i.width / 2, p = n.y + n.height / 2 - i.height / 2, u = n[s] / 2 - i[s] / 2;
|
|
442
|
+
let g;
|
|
443
443
|
switch (d) {
|
|
444
444
|
case "top":
|
|
445
|
-
|
|
445
|
+
g = {
|
|
446
446
|
x: c,
|
|
447
447
|
y: n.y - i.height
|
|
448
448
|
};
|
|
449
449
|
break;
|
|
450
450
|
case "bottom":
|
|
451
|
-
|
|
451
|
+
g = {
|
|
452
452
|
x: c,
|
|
453
453
|
y: n.y + n.height
|
|
454
454
|
};
|
|
455
455
|
break;
|
|
456
456
|
case "right":
|
|
457
|
-
|
|
457
|
+
g = {
|
|
458
458
|
x: n.x + n.width,
|
|
459
|
-
y:
|
|
459
|
+
y: p
|
|
460
460
|
};
|
|
461
461
|
break;
|
|
462
462
|
case "left":
|
|
463
|
-
|
|
463
|
+
g = {
|
|
464
464
|
x: n.x - i.width,
|
|
465
|
-
y:
|
|
465
|
+
y: p
|
|
466
466
|
};
|
|
467
467
|
break;
|
|
468
468
|
default:
|
|
469
|
-
|
|
469
|
+
g = {
|
|
470
470
|
x: n.x,
|
|
471
471
|
y: n.y
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
474
|
switch (we(a)) {
|
|
475
475
|
case "start":
|
|
476
|
-
|
|
476
|
+
g[o] -= u * (t && l ? -1 : 1);
|
|
477
477
|
break;
|
|
478
478
|
case "end":
|
|
479
|
-
|
|
479
|
+
g[o] += u * (t && l ? -1 : 1);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
|
-
return
|
|
482
|
+
return g;
|
|
483
483
|
}
|
|
484
484
|
const xa = async (e, a, t) => {
|
|
485
485
|
const {
|
|
486
486
|
placement: n = "bottom",
|
|
487
487
|
strategy: i = "absolute",
|
|
488
|
-
middleware:
|
|
488
|
+
middleware: r = [],
|
|
489
489
|
platform: o
|
|
490
|
-
} = t,
|
|
490
|
+
} = t, s = r.filter(Boolean), d = await (o.isRTL == null ? void 0 : o.isRTL(a));
|
|
491
491
|
let l = await o.getElementRects({
|
|
492
492
|
reference: e,
|
|
493
493
|
floating: a,
|
|
494
494
|
strategy: i
|
|
495
495
|
}), {
|
|
496
496
|
x: c,
|
|
497
|
-
y:
|
|
498
|
-
} =
|
|
499
|
-
for (let f = 0; f <
|
|
497
|
+
y: p
|
|
498
|
+
} = rt(l, n, d), u = n, g = {}, m = 0;
|
|
499
|
+
for (let f = 0; f < s.length; f++) {
|
|
500
500
|
const {
|
|
501
|
-
name:
|
|
502
|
-
fn:
|
|
503
|
-
} =
|
|
501
|
+
name: y,
|
|
502
|
+
fn: h
|
|
503
|
+
} = s[f], {
|
|
504
504
|
x: M,
|
|
505
505
|
y: C,
|
|
506
506
|
data: E,
|
|
507
507
|
reset: _
|
|
508
|
-
} = await
|
|
508
|
+
} = await h({
|
|
509
509
|
x: c,
|
|
510
|
-
y:
|
|
510
|
+
y: p,
|
|
511
511
|
initialPlacement: n,
|
|
512
512
|
placement: u,
|
|
513
513
|
strategy: i,
|
|
514
|
-
middlewareData:
|
|
514
|
+
middlewareData: g,
|
|
515
515
|
rects: l,
|
|
516
516
|
platform: o,
|
|
517
517
|
elements: {
|
|
@@ -519,10 +519,10 @@ const xa = async (e, a, t) => {
|
|
|
519
519
|
floating: a
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
|
-
c = M ?? c,
|
|
523
|
-
...
|
|
524
|
-
[
|
|
525
|
-
...
|
|
522
|
+
c = M ?? c, p = C ?? p, g = {
|
|
523
|
+
...g,
|
|
524
|
+
[y]: {
|
|
525
|
+
...g[y],
|
|
526
526
|
...E
|
|
527
527
|
}
|
|
528
528
|
}, _ && m <= 50 && (m++, typeof _ == "object" && (_.placement && (u = _.placement), _.rects && (l = _.rects === !0 ? await o.getElementRects({
|
|
@@ -531,15 +531,15 @@ const xa = async (e, a, t) => {
|
|
|
531
531
|
strategy: i
|
|
532
532
|
}) : _.rects), {
|
|
533
533
|
x: c,
|
|
534
|
-
y:
|
|
535
|
-
} =
|
|
534
|
+
y: p
|
|
535
|
+
} = rt(l, u, d)), f = -1);
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
538
|
x: c,
|
|
539
|
-
y:
|
|
539
|
+
y: p,
|
|
540
540
|
placement: u,
|
|
541
541
|
strategy: i,
|
|
542
|
-
middlewareData:
|
|
542
|
+
middlewareData: g
|
|
543
543
|
};
|
|
544
544
|
};
|
|
545
545
|
async function vt(e, a) {
|
|
@@ -548,43 +548,43 @@ async function vt(e, a) {
|
|
|
548
548
|
const {
|
|
549
549
|
x: n,
|
|
550
550
|
y: i,
|
|
551
|
-
platform:
|
|
551
|
+
platform: r,
|
|
552
552
|
rects: o,
|
|
553
|
-
elements:
|
|
553
|
+
elements: s,
|
|
554
554
|
strategy: d
|
|
555
555
|
} = e, {
|
|
556
556
|
boundary: l = "clippingAncestors",
|
|
557
557
|
rootBoundary: c = "viewport",
|
|
558
|
-
elementContext:
|
|
558
|
+
elementContext: p = "floating",
|
|
559
559
|
altBoundary: u = !1,
|
|
560
|
-
padding:
|
|
561
|
-
} = _e(a, e), m =
|
|
562
|
-
element: (t = await (
|
|
560
|
+
padding: g = 0
|
|
561
|
+
} = _e(a, e), m = yt(g), y = s[u ? p === "floating" ? "reference" : "floating" : p], h = Re(await r.getClippingRect({
|
|
562
|
+
element: (t = await (r.isElement == null ? void 0 : r.isElement(y))) == null || t ? y : y.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(s.floating)),
|
|
563
563
|
boundary: l,
|
|
564
564
|
rootBoundary: c,
|
|
565
565
|
strategy: d
|
|
566
|
-
})), M =
|
|
566
|
+
})), M = p === "floating" ? {
|
|
567
567
|
x: n,
|
|
568
568
|
y: i,
|
|
569
569
|
width: o.floating.width,
|
|
570
570
|
height: o.floating.height
|
|
571
|
-
} : o.reference, C = await (
|
|
571
|
+
} : o.reference, C = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(s.floating)), E = await (r.isElement == null ? void 0 : r.isElement(C)) ? await (r.getScale == null ? void 0 : r.getScale(C)) || {
|
|
572
572
|
x: 1,
|
|
573
573
|
y: 1
|
|
574
574
|
} : {
|
|
575
575
|
x: 1,
|
|
576
576
|
y: 1
|
|
577
|
-
}, _ = Re(
|
|
578
|
-
elements:
|
|
577
|
+
}, _ = Re(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
578
|
+
elements: s,
|
|
579
579
|
rect: M,
|
|
580
580
|
offsetParent: C,
|
|
581
581
|
strategy: d
|
|
582
582
|
}) : M);
|
|
583
583
|
return {
|
|
584
|
-
top: (
|
|
585
|
-
bottom: (_.bottom -
|
|
586
|
-
left: (
|
|
587
|
-
right: (_.right -
|
|
584
|
+
top: (h.top - _.top + m.top) / E.y,
|
|
585
|
+
bottom: (_.bottom - h.bottom + m.bottom) / E.y,
|
|
586
|
+
left: (h.left - _.left + m.left) / E.x,
|
|
587
|
+
right: (_.right - h.right + m.right) / E.x
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
const Ma = (e) => ({
|
|
@@ -595,9 +595,9 @@ const Ma = (e) => ({
|
|
|
595
595
|
x: t,
|
|
596
596
|
y: n,
|
|
597
597
|
placement: i,
|
|
598
|
-
rects:
|
|
598
|
+
rects: r,
|
|
599
599
|
platform: o,
|
|
600
|
-
elements:
|
|
600
|
+
elements: s,
|
|
601
601
|
middlewareData: d
|
|
602
602
|
} = a, {
|
|
603
603
|
element: l,
|
|
@@ -605,23 +605,23 @@ const Ma = (e) => ({
|
|
|
605
605
|
} = _e(e, a) || {};
|
|
606
606
|
if (l == null)
|
|
607
607
|
return {};
|
|
608
|
-
const
|
|
608
|
+
const p = yt(c), u = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
},
|
|
611
|
+
}, g = Ge(i), m = Ke(g), f = await o.getDimensions(l), y = g === "y", h = y ? "top" : "left", M = y ? "bottom" : "right", C = y ? "clientHeight" : "clientWidth", E = r.reference[m] + r.reference[g] - u[g] - r.floating[m], _ = u[g] - r.reference[g], v = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
612
612
|
let I = v ? v[C] : 0;
|
|
613
|
-
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I =
|
|
614
|
-
const A = E / 2 - _ / 2, D = I / 2 - f[m] / 2 - 1, x = le(
|
|
613
|
+
(!I || !await (o.isElement == null ? void 0 : o.isElement(v))) && (I = s.floating[C] || r.floating[m]);
|
|
614
|
+
const A = E / 2 - _ / 2, D = I / 2 - f[m] / 2 - 1, x = le(p[h], D), S = le(p[M], D), R = x, T = I - f[m] - S, L = I / 2 - f[m] / 2 + A, z = Be(R, L, T), N = !d.arrow && we(i) != null && L !== z && r.reference[m] / 2 - (L < R ? x : S) - f[m] / 2 < 0, $ = N ? L < R ? L - R : L - T : 0;
|
|
615
615
|
return {
|
|
616
|
-
[
|
|
616
|
+
[g]: u[g] + $,
|
|
617
617
|
data: {
|
|
618
|
-
[
|
|
619
|
-
centerOffset: L -
|
|
620
|
-
...
|
|
618
|
+
[g]: z,
|
|
619
|
+
centerOffset: L - z - $,
|
|
620
|
+
...N && {
|
|
621
621
|
alignmentOffset: $
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
|
-
reset:
|
|
624
|
+
reset: N
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
627
|
}), Sa = function(e) {
|
|
@@ -632,27 +632,27 @@ const Ma = (e) => ({
|
|
|
632
632
|
var t, n;
|
|
633
633
|
const {
|
|
634
634
|
placement: i,
|
|
635
|
-
middlewareData:
|
|
635
|
+
middlewareData: r,
|
|
636
636
|
rects: o,
|
|
637
|
-
initialPlacement:
|
|
637
|
+
initialPlacement: s,
|
|
638
638
|
platform: d,
|
|
639
639
|
elements: l
|
|
640
640
|
} = a, {
|
|
641
641
|
mainAxis: c = !0,
|
|
642
|
-
crossAxis:
|
|
642
|
+
crossAxis: p = !0,
|
|
643
643
|
fallbackPlacements: u,
|
|
644
|
-
fallbackStrategy:
|
|
644
|
+
fallbackStrategy: g = "bestFit",
|
|
645
645
|
fallbackAxisSideDirection: m = "none",
|
|
646
646
|
flipAlignment: f = !0,
|
|
647
|
-
...
|
|
647
|
+
...y
|
|
648
648
|
} = _e(e, a);
|
|
649
|
-
if ((t =
|
|
649
|
+
if ((t = r.arrow) != null && t.alignmentOffset)
|
|
650
650
|
return {};
|
|
651
|
-
const
|
|
652
|
-
!u && v && _.push(..._a(
|
|
653
|
-
const I = [
|
|
654
|
-
let x = ((n =
|
|
655
|
-
if (c && D.push(A[
|
|
651
|
+
const h = ne(i), M = X(s), C = ne(s) === s, E = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), _ = u || (C || !f ? [Ee(s)] : ba(s)), v = m !== "none";
|
|
652
|
+
!u && v && _.push(..._a(s, f, m, E));
|
|
653
|
+
const I = [s, ..._], A = await vt(a, y), D = [];
|
|
654
|
+
let x = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
655
|
+
if (c && D.push(A[h]), p) {
|
|
656
656
|
const L = ma(i, o, E);
|
|
657
657
|
D.push(A[L[0]], A[L[1]]);
|
|
658
658
|
}
|
|
@@ -661,8 +661,8 @@ const Ma = (e) => ({
|
|
|
661
661
|
overflows: D
|
|
662
662
|
}], !D.every((L) => L <= 0)) {
|
|
663
663
|
var S, R;
|
|
664
|
-
const L = (((S =
|
|
665
|
-
if (
|
|
664
|
+
const L = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, z = I[L];
|
|
665
|
+
if (z && (!(p === "alignment" ? M !== X(z) : !1) || // We leave the current main axis only if every placement on that axis
|
|
666
666
|
// overflows the main axis.
|
|
667
667
|
x.every((P) => X(P.placement) === M ? P.overflows[0] > 0 : !0)))
|
|
668
668
|
return {
|
|
@@ -671,15 +671,15 @@ const Ma = (e) => ({
|
|
|
671
671
|
overflows: x
|
|
672
672
|
},
|
|
673
673
|
reset: {
|
|
674
|
-
placement:
|
|
674
|
+
placement: z
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
let
|
|
678
|
-
if (!
|
|
679
|
-
switch (
|
|
677
|
+
let N = (R = x.filter(($) => $.overflows[0] <= 0).sort(($, P) => $.overflows[1] - P.overflows[1])[0]) == null ? void 0 : R.placement;
|
|
678
|
+
if (!N)
|
|
679
|
+
switch (g) {
|
|
680
680
|
case "bestFit": {
|
|
681
|
-
var
|
|
682
|
-
const $ = (
|
|
681
|
+
var T;
|
|
682
|
+
const $ = (T = x.filter((P) => {
|
|
683
683
|
if (v) {
|
|
684
684
|
const V = X(P.placement);
|
|
685
685
|
return V === M || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -687,18 +687,18 @@ const Ma = (e) => ({
|
|
|
687
687
|
V === "y";
|
|
688
688
|
}
|
|
689
689
|
return !0;
|
|
690
|
-
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 :
|
|
691
|
-
$ && (
|
|
690
|
+
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 : T[0];
|
|
691
|
+
$ && (N = $);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
694
694
|
case "initialPlacement":
|
|
695
|
-
|
|
695
|
+
N = s;
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
|
-
if (i !==
|
|
698
|
+
if (i !== N)
|
|
699
699
|
return {
|
|
700
700
|
reset: {
|
|
701
|
-
placement:
|
|
701
|
+
placement: N
|
|
702
702
|
}
|
|
703
703
|
};
|
|
704
704
|
}
|
|
@@ -711,26 +711,26 @@ async function Ia(e, a) {
|
|
|
711
711
|
placement: t,
|
|
712
712
|
platform: n,
|
|
713
713
|
elements: i
|
|
714
|
-
} = e,
|
|
714
|
+
} = e, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), o = ne(t), s = we(t), d = X(t) === "y", l = Ca.has(o) ? -1 : 1, c = r && d ? -1 : 1, p = _e(a, e);
|
|
715
715
|
let {
|
|
716
716
|
mainAxis: u,
|
|
717
|
-
crossAxis:
|
|
717
|
+
crossAxis: g,
|
|
718
718
|
alignmentAxis: m
|
|
719
|
-
} = typeof
|
|
720
|
-
mainAxis:
|
|
719
|
+
} = typeof p == "number" ? {
|
|
720
|
+
mainAxis: p,
|
|
721
721
|
crossAxis: 0,
|
|
722
722
|
alignmentAxis: null
|
|
723
723
|
} : {
|
|
724
|
-
mainAxis:
|
|
725
|
-
crossAxis:
|
|
726
|
-
alignmentAxis:
|
|
724
|
+
mainAxis: p.mainAxis || 0,
|
|
725
|
+
crossAxis: p.crossAxis || 0,
|
|
726
|
+
alignmentAxis: p.alignmentAxis
|
|
727
727
|
};
|
|
728
|
-
return
|
|
729
|
-
x:
|
|
728
|
+
return s && typeof m == "number" && (g = s === "end" ? m * -1 : m), d ? {
|
|
729
|
+
x: g * c,
|
|
730
730
|
y: u * l
|
|
731
731
|
} : {
|
|
732
732
|
x: u * l,
|
|
733
|
-
y:
|
|
733
|
+
y: g * c
|
|
734
734
|
};
|
|
735
735
|
}
|
|
736
736
|
const Ea = function(e) {
|
|
@@ -741,13 +741,13 @@ const Ea = function(e) {
|
|
|
741
741
|
var t, n;
|
|
742
742
|
const {
|
|
743
743
|
x: i,
|
|
744
|
-
y:
|
|
744
|
+
y: r,
|
|
745
745
|
placement: o,
|
|
746
|
-
middlewareData:
|
|
746
|
+
middlewareData: s
|
|
747
747
|
} = a, d = await Ia(a, e);
|
|
748
|
-
return o === ((t =
|
|
748
|
+
return o === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
749
749
|
x: i + d.x,
|
|
750
|
-
y:
|
|
750
|
+
y: r + d.y,
|
|
751
751
|
data: {
|
|
752
752
|
...d,
|
|
753
753
|
placement: o
|
|
@@ -765,16 +765,16 @@ const Ea = function(e) {
|
|
|
765
765
|
y: n,
|
|
766
766
|
placement: i
|
|
767
767
|
} = a, {
|
|
768
|
-
mainAxis:
|
|
768
|
+
mainAxis: r = !0,
|
|
769
769
|
crossAxis: o = !1,
|
|
770
|
-
limiter:
|
|
771
|
-
fn: (
|
|
770
|
+
limiter: s = {
|
|
771
|
+
fn: (y) => {
|
|
772
772
|
let {
|
|
773
|
-
x:
|
|
773
|
+
x: h,
|
|
774
774
|
y: M
|
|
775
|
-
} =
|
|
775
|
+
} = y;
|
|
776
776
|
return {
|
|
777
|
-
x:
|
|
777
|
+
x: h,
|
|
778
778
|
y: M
|
|
779
779
|
};
|
|
780
780
|
}
|
|
@@ -783,20 +783,20 @@ const Ea = function(e) {
|
|
|
783
783
|
} = _e(e, a), l = {
|
|
784
784
|
x: t,
|
|
785
785
|
y: n
|
|
786
|
-
}, c = await vt(a, d),
|
|
787
|
-
let
|
|
788
|
-
if (
|
|
789
|
-
const
|
|
790
|
-
|
|
786
|
+
}, c = await vt(a, d), p = X(ne(i)), u = bt(p);
|
|
787
|
+
let g = l[u], m = l[p];
|
|
788
|
+
if (r) {
|
|
789
|
+
const y = u === "y" ? "top" : "left", h = u === "y" ? "bottom" : "right", M = g + c[y], C = g - c[h];
|
|
790
|
+
g = Be(M, g, C);
|
|
791
791
|
}
|
|
792
792
|
if (o) {
|
|
793
|
-
const
|
|
793
|
+
const y = p === "y" ? "top" : "left", h = p === "y" ? "bottom" : "right", M = m + c[y], C = m - c[h];
|
|
794
794
|
m = Be(M, m, C);
|
|
795
795
|
}
|
|
796
|
-
const f =
|
|
796
|
+
const f = s.fn({
|
|
797
797
|
...a,
|
|
798
|
-
[u]:
|
|
799
|
-
[
|
|
798
|
+
[u]: g,
|
|
799
|
+
[p]: m
|
|
800
800
|
});
|
|
801
801
|
return {
|
|
802
802
|
...f,
|
|
@@ -804,8 +804,8 @@ const Ea = function(e) {
|
|
|
804
804
|
x: f.x - t,
|
|
805
805
|
y: f.y - n,
|
|
806
806
|
enabled: {
|
|
807
|
-
[u]:
|
|
808
|
-
[
|
|
807
|
+
[u]: r,
|
|
808
|
+
[p]: o
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
@@ -815,10 +815,10 @@ const Ea = function(e) {
|
|
|
815
815
|
function Pe() {
|
|
816
816
|
return typeof window < "u";
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function ge(e) {
|
|
819
819
|
return Dt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function F(e) {
|
|
822
822
|
var a;
|
|
823
823
|
return (e == null || (a = e.ownerDocument) == null ? void 0 : a.defaultView) || window;
|
|
824
824
|
}
|
|
@@ -827,16 +827,16 @@ function G(e) {
|
|
|
827
827
|
return (a = (Dt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : a.documentElement;
|
|
828
828
|
}
|
|
829
829
|
function Dt(e) {
|
|
830
|
-
return Pe() ? e instanceof Node || e instanceof
|
|
830
|
+
return Pe() ? e instanceof Node || e instanceof F(e).Node : !1;
|
|
831
831
|
}
|
|
832
832
|
function B(e) {
|
|
833
|
-
return Pe() ? e instanceof Element || e instanceof
|
|
833
|
+
return Pe() ? e instanceof Element || e instanceof F(e).Element : !1;
|
|
834
834
|
}
|
|
835
835
|
function K(e) {
|
|
836
|
-
return Pe() ? e instanceof HTMLElement || e instanceof
|
|
836
|
+
return Pe() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
|
|
837
837
|
}
|
|
838
838
|
function ot(e) {
|
|
839
|
-
return !Pe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
|
839
|
+
return !Pe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
|
|
840
840
|
}
|
|
841
841
|
const Aa = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
842
842
|
function xe(e) {
|
|
@@ -849,12 +849,12 @@ function xe(e) {
|
|
|
849
849
|
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(i);
|
|
850
850
|
}
|
|
851
851
|
const La = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
-
function
|
|
853
|
-
return La.has(
|
|
852
|
+
function ka(e) {
|
|
853
|
+
return La.has(ge(e));
|
|
854
854
|
}
|
|
855
|
-
const
|
|
856
|
-
function
|
|
857
|
-
return
|
|
855
|
+
const Ta = [":popover-open", ":modal"];
|
|
856
|
+
function ze(e) {
|
|
857
|
+
return Ta.some((a) => {
|
|
858
858
|
try {
|
|
859
859
|
return e.matches(a);
|
|
860
860
|
} catch {
|
|
@@ -862,17 +862,17 @@ function Ne(e) {
|
|
|
862
862
|
}
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
const $a = ["transform", "translate", "scale", "rotate", "perspective"], Pa = ["transform", "translate", "scale", "rotate", "perspective", "filter"],
|
|
865
|
+
const $a = ["transform", "translate", "scale", "rotate", "perspective"], Pa = ["transform", "translate", "scale", "rotate", "perspective", "filter"], za = ["paint", "layout", "strict", "content"];
|
|
866
866
|
function Xe(e) {
|
|
867
867
|
const a = Je(), t = B(e) ? H(e) : e;
|
|
868
|
-
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || Pa.some((n) => (t.willChange || "").includes(n)) ||
|
|
868
|
+
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || Pa.some((n) => (t.willChange || "").includes(n)) || za.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Na(e) {
|
|
871
871
|
let a = J(e);
|
|
872
872
|
for (; K(a) && !ce(a); ) {
|
|
873
873
|
if (Xe(a))
|
|
874
874
|
return a;
|
|
875
|
-
if (
|
|
875
|
+
if (ze(a))
|
|
876
876
|
return null;
|
|
877
877
|
a = J(a);
|
|
878
878
|
}
|
|
@@ -881,14 +881,14 @@ function Fa(e) {
|
|
|
881
881
|
function Je() {
|
|
882
882
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
883
883
|
}
|
|
884
|
-
const
|
|
884
|
+
const Fa = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
885
885
|
function ce(e) {
|
|
886
|
-
return
|
|
886
|
+
return Fa.has(ge(e));
|
|
887
887
|
}
|
|
888
888
|
function H(e) {
|
|
889
|
-
return
|
|
889
|
+
return F(e).getComputedStyle(e);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Ne(e) {
|
|
892
892
|
return B(e) ? {
|
|
893
893
|
scrollLeft: e.scrollLeft,
|
|
894
894
|
scrollTop: e.scrollTop
|
|
@@ -898,7 +898,7 @@ function Fe(e) {
|
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
function J(e) {
|
|
901
|
-
if (
|
|
901
|
+
if (ge(e) === "html")
|
|
902
902
|
return e;
|
|
903
903
|
const a = (
|
|
904
904
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -916,10 +916,10 @@ function _t(e) {
|
|
|
916
916
|
function ue(e, a, t) {
|
|
917
917
|
var n;
|
|
918
918
|
a === void 0 && (a = []), t === void 0 && (t = !0);
|
|
919
|
-
const i = _t(e),
|
|
920
|
-
if (
|
|
921
|
-
const
|
|
922
|
-
return a.concat(o, o.visualViewport || [], xe(i) ? i : [],
|
|
919
|
+
const i = _t(e), r = i === ((n = e.ownerDocument) == null ? void 0 : n.body), o = F(i);
|
|
920
|
+
if (r) {
|
|
921
|
+
const s = Ve(o);
|
|
922
|
+
return a.concat(o, o.visualViewport || [], xe(i) ? i : [], s && t ? ue(s) : []);
|
|
923
923
|
}
|
|
924
924
|
return a.concat(i, ue(i, [], t));
|
|
925
925
|
}
|
|
@@ -929,70 +929,70 @@ function Ve(e) {
|
|
|
929
929
|
function wt(e) {
|
|
930
930
|
const a = H(e);
|
|
931
931
|
let t = parseFloat(a.width) || 0, n = parseFloat(a.height) || 0;
|
|
932
|
-
const i = K(e),
|
|
933
|
-
return
|
|
932
|
+
const i = K(e), r = i ? e.offsetWidth : t, o = i ? e.offsetHeight : n, s = Ie(t) !== r || Ie(n) !== o;
|
|
933
|
+
return s && (t = r, n = o), {
|
|
934
934
|
width: t,
|
|
935
935
|
height: n,
|
|
936
|
-
$:
|
|
936
|
+
$: s
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
939
|
function Qe(e) {
|
|
940
940
|
return B(e) ? e : e.contextElement;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function se(e) {
|
|
943
943
|
const a = Qe(e);
|
|
944
944
|
if (!K(a))
|
|
945
945
|
return W(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
947
947
|
width: n,
|
|
948
948
|
height: i,
|
|
949
|
-
$:
|
|
949
|
+
$: r
|
|
950
950
|
} = wt(a);
|
|
951
|
-
let o = (
|
|
952
|
-
return (!o || !Number.isFinite(o)) && (o = 1), (!
|
|
951
|
+
let o = (r ? Ie(t.width) : t.width) / n, s = (r ? Ie(t.height) : t.height) / i;
|
|
952
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
953
953
|
x: o,
|
|
954
|
-
y:
|
|
954
|
+
y: s
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
const
|
|
957
|
+
const Oa = /* @__PURE__ */ W(0);
|
|
958
958
|
function xt(e) {
|
|
959
|
-
const a =
|
|
960
|
-
return !Je() || !a.visualViewport ?
|
|
959
|
+
const a = F(e);
|
|
960
|
+
return !Je() || !a.visualViewport ? Oa : {
|
|
961
961
|
x: a.visualViewport.offsetLeft,
|
|
962
962
|
y: a.visualViewport.offsetTop
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
965
|
function Ya(e, a, t) {
|
|
966
|
-
return a === void 0 && (a = !1), !t || a && t !==
|
|
966
|
+
return a === void 0 && (a = !1), !t || a && t !== F(e) ? !1 : a;
|
|
967
967
|
}
|
|
968
968
|
function ie(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const i = e.getBoundingClientRect(),
|
|
970
|
+
const i = e.getBoundingClientRect(), r = Qe(e);
|
|
971
971
|
let o = W(1);
|
|
972
|
-
a && (n ? B(n) && (o =
|
|
973
|
-
const
|
|
974
|
-
let d = (i.left +
|
|
975
|
-
if (
|
|
976
|
-
const u =
|
|
972
|
+
a && (n ? B(n) && (o = se(n)) : o = se(e));
|
|
973
|
+
const s = Ya(r, t, n) ? xt(r) : W(0);
|
|
974
|
+
let d = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, c = i.width / o.x, p = i.height / o.y;
|
|
975
|
+
if (r) {
|
|
976
|
+
const u = F(r), g = n && B(n) ? F(n) : n;
|
|
977
977
|
let m = u, f = Ve(m);
|
|
978
|
-
for (; f && n &&
|
|
979
|
-
const
|
|
980
|
-
d *=
|
|
978
|
+
for (; f && n && g !== m; ) {
|
|
979
|
+
const y = se(f), h = f.getBoundingClientRect(), M = H(f), C = h.left + (f.clientLeft + parseFloat(M.paddingLeft)) * y.x, E = h.top + (f.clientTop + parseFloat(M.paddingTop)) * y.y;
|
|
980
|
+
d *= y.x, l *= y.y, c *= y.x, p *= y.y, d += C, l += E, m = F(f), f = Ve(m);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
return Re({
|
|
984
984
|
width: c,
|
|
985
|
-
height:
|
|
985
|
+
height: p,
|
|
986
986
|
x: d,
|
|
987
987
|
y: l
|
|
988
988
|
});
|
|
989
989
|
}
|
|
990
|
-
function
|
|
991
|
-
const t =
|
|
990
|
+
function Fe(e, a) {
|
|
991
|
+
const t = Ne(e).scrollLeft;
|
|
992
992
|
return a ? a.left + t : ie(G(e)).left + t;
|
|
993
993
|
}
|
|
994
994
|
function Mt(e, a) {
|
|
995
|
-
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft -
|
|
995
|
+
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Fe(e, t), i = t.top + a.scrollTop;
|
|
996
996
|
return {
|
|
997
997
|
x: n,
|
|
998
998
|
y: i
|
|
@@ -1005,19 +1005,19 @@ function Ba(e) {
|
|
|
1005
1005
|
offsetParent: n,
|
|
1006
1006
|
strategy: i
|
|
1007
1007
|
} = e;
|
|
1008
|
-
const
|
|
1009
|
-
if (n === o ||
|
|
1008
|
+
const r = i === "fixed", o = G(n), s = a ? ze(a.floating) : !1;
|
|
1009
|
+
if (n === o || s && r)
|
|
1010
1010
|
return t;
|
|
1011
1011
|
let d = {
|
|
1012
1012
|
scrollLeft: 0,
|
|
1013
1013
|
scrollTop: 0
|
|
1014
1014
|
}, l = W(1);
|
|
1015
|
-
const c = W(0),
|
|
1016
|
-
if ((
|
|
1017
|
-
const
|
|
1018
|
-
l =
|
|
1015
|
+
const c = W(0), p = K(n);
|
|
1016
|
+
if ((p || !p && !r) && ((ge(n) !== "body" || xe(o)) && (d = Ne(n)), K(n))) {
|
|
1017
|
+
const g = ie(n);
|
|
1018
|
+
l = se(n), c.x = g.x + n.clientLeft, c.y = g.y + n.clientTop;
|
|
1019
1019
|
}
|
|
1020
|
-
const u = o && !
|
|
1020
|
+
const u = o && !p && !r ? Mt(o, d) : W(0);
|
|
1021
1021
|
return {
|
|
1022
1022
|
width: t.width * l.x,
|
|
1023
1023
|
height: t.height * l.y,
|
|
@@ -1029,43 +1029,43 @@ function Ha(e) {
|
|
|
1029
1029
|
return Array.from(e.getClientRects());
|
|
1030
1030
|
}
|
|
1031
1031
|
function Va(e) {
|
|
1032
|
-
const a = G(e), t =
|
|
1033
|
-
let o = -t.scrollLeft +
|
|
1034
|
-
const
|
|
1032
|
+
const a = G(e), t = Ne(e), n = e.ownerDocument.body, i = te(a.scrollWidth, a.clientWidth, n.scrollWidth, n.clientWidth), r = te(a.scrollHeight, a.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1033
|
+
let o = -t.scrollLeft + Fe(e);
|
|
1034
|
+
const s = -t.scrollTop;
|
|
1035
1035
|
return H(n).direction === "rtl" && (o += te(a.clientWidth, n.clientWidth) - i), {
|
|
1036
1036
|
width: i,
|
|
1037
|
-
height:
|
|
1037
|
+
height: r,
|
|
1038
1038
|
x: o,
|
|
1039
|
-
y:
|
|
1039
|
+
y: s
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
|
-
const
|
|
1042
|
+
const st = 25;
|
|
1043
1043
|
function qa(e, a) {
|
|
1044
|
-
const t =
|
|
1045
|
-
let
|
|
1044
|
+
const t = F(e), n = G(e), i = t.visualViewport;
|
|
1045
|
+
let r = n.clientWidth, o = n.clientHeight, s = 0, d = 0;
|
|
1046
1046
|
if (i) {
|
|
1047
|
-
|
|
1047
|
+
r = i.width, o = i.height;
|
|
1048
1048
|
const c = Je();
|
|
1049
|
-
(!c || c && a === "fixed") && (
|
|
1049
|
+
(!c || c && a === "fixed") && (s = i.offsetLeft, d = i.offsetTop);
|
|
1050
1050
|
}
|
|
1051
|
-
const l =
|
|
1051
|
+
const l = Fe(n);
|
|
1052
1052
|
if (l <= 0) {
|
|
1053
|
-
const c = n.ownerDocument,
|
|
1054
|
-
m <=
|
|
1055
|
-
} else l <=
|
|
1053
|
+
const c = n.ownerDocument, p = c.body, u = getComputedStyle(p), g = c.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, m = Math.abs(n.clientWidth - p.clientWidth - g);
|
|
1054
|
+
m <= st && (r -= m);
|
|
1055
|
+
} else l <= st && (r += l);
|
|
1056
1056
|
return {
|
|
1057
|
-
width:
|
|
1057
|
+
width: r,
|
|
1058
1058
|
height: o,
|
|
1059
|
-
x:
|
|
1059
|
+
x: s,
|
|
1060
1060
|
y: d
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
1063
|
const Ua = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1064
1064
|
function ja(e, a) {
|
|
1065
|
-
const t = ie(e, !0, a === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft,
|
|
1065
|
+
const t = ie(e, !0, a === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, r = K(e) ? se(e) : W(1), o = e.clientWidth * r.x, s = e.clientHeight * r.y, d = i * r.x, l = n * r.y;
|
|
1066
1066
|
return {
|
|
1067
1067
|
width: o,
|
|
1068
|
-
height:
|
|
1068
|
+
height: s,
|
|
1069
1069
|
x: d,
|
|
1070
1070
|
y: l
|
|
1071
1071
|
};
|
|
@@ -1097,12 +1097,12 @@ function Wa(e, a) {
|
|
|
1097
1097
|
const t = a.get(e);
|
|
1098
1098
|
if (t)
|
|
1099
1099
|
return t;
|
|
1100
|
-
let n = ue(e, [], !1).filter((
|
|
1101
|
-
const
|
|
1102
|
-
let o =
|
|
1100
|
+
let n = ue(e, [], !1).filter((s) => B(s) && ge(s) !== "body"), i = null;
|
|
1101
|
+
const r = H(e).position === "fixed";
|
|
1102
|
+
let o = r ? J(e) : e;
|
|
1103
1103
|
for (; B(o) && !ce(o); ) {
|
|
1104
|
-
const
|
|
1105
|
-
!d &&
|
|
1104
|
+
const s = H(o), d = Xe(o);
|
|
1105
|
+
!d && s.position === "fixed" && (i = null), (r ? !d && !i : !d && s.position === "static" && !!i && Ua.has(i.position) || xe(o) && !d && St(e, o)) ? n = n.filter((c) => c !== o) : i = s, o = J(o);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
1108
1108
|
}
|
|
@@ -1113,10 +1113,10 @@ function Ka(e) {
|
|
|
1113
1113
|
rootBoundary: n,
|
|
1114
1114
|
strategy: i
|
|
1115
1115
|
} = e;
|
|
1116
|
-
const o = [...t === "clippingAncestors" ?
|
|
1117
|
-
const
|
|
1118
|
-
return l.top = te(
|
|
1119
|
-
}, dt(a,
|
|
1116
|
+
const o = [...t === "clippingAncestors" ? ze(a) ? [] : Wa(a, this._c) : [].concat(t), n], s = o[0], d = o.reduce((l, c) => {
|
|
1117
|
+
const p = dt(a, c, i);
|
|
1118
|
+
return l.top = te(p.top, l.top), l.right = le(p.right, l.right), l.bottom = le(p.bottom, l.bottom), l.left = te(p.left, l.left), l;
|
|
1119
|
+
}, dt(a, s, i));
|
|
1120
1120
|
return {
|
|
1121
1121
|
width: d.right - d.left,
|
|
1122
1122
|
height: d.bottom - d.top,
|
|
@@ -1135,24 +1135,24 @@ function Ga(e) {
|
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
function Xa(e, a, t) {
|
|
1138
|
-
const n = K(a), i = G(a),
|
|
1139
|
-
let
|
|
1138
|
+
const n = K(a), i = G(a), r = t === "fixed", o = ie(e, !0, r, a);
|
|
1139
|
+
let s = {
|
|
1140
1140
|
scrollLeft: 0,
|
|
1141
1141
|
scrollTop: 0
|
|
1142
1142
|
};
|
|
1143
1143
|
const d = W(0);
|
|
1144
1144
|
function l() {
|
|
1145
|
-
d.x =
|
|
1145
|
+
d.x = Fe(i);
|
|
1146
1146
|
}
|
|
1147
|
-
if (n || !n && !
|
|
1148
|
-
if ((
|
|
1149
|
-
const
|
|
1150
|
-
d.x =
|
|
1147
|
+
if (n || !n && !r)
|
|
1148
|
+
if ((ge(a) !== "body" || xe(i)) && (s = Ne(a)), n) {
|
|
1149
|
+
const g = ie(a, !0, r, a);
|
|
1150
|
+
d.x = g.x + a.clientLeft, d.y = g.y + a.clientTop;
|
|
1151
1151
|
} else i && l();
|
|
1152
|
-
|
|
1153
|
-
const c = i && !n && !
|
|
1152
|
+
r && !n && i && l();
|
|
1153
|
+
const c = i && !n && !r ? Mt(i, s) : W(0), p = o.left + s.scrollLeft - d.x - c.x, u = o.top + s.scrollTop - d.y - c.y;
|
|
1154
1154
|
return {
|
|
1155
|
-
x:
|
|
1155
|
+
x: p,
|
|
1156
1156
|
y: u,
|
|
1157
1157
|
width: o.width,
|
|
1158
1158
|
height: o.height
|
|
@@ -1170,8 +1170,8 @@ function lt(e, a) {
|
|
|
1170
1170
|
return G(e) === t && (t = t.ownerDocument.body), t;
|
|
1171
1171
|
}
|
|
1172
1172
|
function Ct(e, a) {
|
|
1173
|
-
const t =
|
|
1174
|
-
if (
|
|
1173
|
+
const t = F(e);
|
|
1174
|
+
if (ze(e))
|
|
1175
1175
|
return t;
|
|
1176
1176
|
if (!K(e)) {
|
|
1177
1177
|
let i = J(e);
|
|
@@ -1183,9 +1183,9 @@ function Ct(e, a) {
|
|
|
1183
1183
|
return t;
|
|
1184
1184
|
}
|
|
1185
1185
|
let n = lt(e, a);
|
|
1186
|
-
for (; n &&
|
|
1186
|
+
for (; n && ka(n) && Ye(n); )
|
|
1187
1187
|
n = lt(n, a);
|
|
1188
|
-
return n && ce(n) && Ye(n) && !Xe(n) ? t : n ||
|
|
1188
|
+
return n && ce(n) && Ye(n) && !Xe(n) ? t : n || Na(e) || t;
|
|
1189
1189
|
}
|
|
1190
1190
|
const Ja = async function(e) {
|
|
1191
1191
|
const a = this.getOffsetParent || Ct, t = this.getDimensions, n = await t(e.floating);
|
|
@@ -1210,7 +1210,7 @@ const It = {
|
|
|
1210
1210
|
getElementRects: Ja,
|
|
1211
1211
|
getClientRects: Ha,
|
|
1212
1212
|
getDimensions: Ga,
|
|
1213
|
-
getScale:
|
|
1213
|
+
getScale: se,
|
|
1214
1214
|
isElement: B,
|
|
1215
1215
|
isRTL: Qa
|
|
1216
1216
|
};
|
|
@@ -1220,22 +1220,22 @@ function Et(e, a) {
|
|
|
1220
1220
|
function Za(e, a) {
|
|
1221
1221
|
let t = null, n;
|
|
1222
1222
|
const i = G(e);
|
|
1223
|
-
function
|
|
1224
|
-
var
|
|
1225
|
-
clearTimeout(n), (
|
|
1223
|
+
function r() {
|
|
1224
|
+
var s;
|
|
1225
|
+
clearTimeout(n), (s = t) == null || s.disconnect(), t = null;
|
|
1226
1226
|
}
|
|
1227
|
-
function o(
|
|
1228
|
-
|
|
1227
|
+
function o(s, d) {
|
|
1228
|
+
s === void 0 && (s = !1), d === void 0 && (d = 1), r();
|
|
1229
1229
|
const l = e.getBoundingClientRect(), {
|
|
1230
1230
|
left: c,
|
|
1231
|
-
top:
|
|
1231
|
+
top: p,
|
|
1232
1232
|
width: u,
|
|
1233
|
-
height:
|
|
1233
|
+
height: g
|
|
1234
1234
|
} = l;
|
|
1235
|
-
if (
|
|
1235
|
+
if (s || a(), !u || !g)
|
|
1236
1236
|
return;
|
|
1237
|
-
const m = Me(
|
|
1238
|
-
rootMargin: -m + "px " + -f + "px " + -
|
|
1237
|
+
const m = Me(p), f = Me(i.clientWidth - (c + u)), y = Me(i.clientHeight - (p + g)), h = Me(c), C = {
|
|
1238
|
+
rootMargin: -m + "px " + -f + "px " + -y + "px " + -h + "px",
|
|
1239
1239
|
threshold: te(0, le(1, d)) || 1
|
|
1240
1240
|
};
|
|
1241
1241
|
let E = !0;
|
|
@@ -1261,55 +1261,55 @@ function Za(e, a) {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
t.observe(e);
|
|
1263
1263
|
}
|
|
1264
|
-
return o(!0),
|
|
1264
|
+
return o(!0), r;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Rt(e, a, t, n) {
|
|
1267
1267
|
n === void 0 && (n = {});
|
|
1268
1268
|
const {
|
|
1269
1269
|
ancestorScroll: i = !0,
|
|
1270
|
-
ancestorResize:
|
|
1270
|
+
ancestorResize: r = !0,
|
|
1271
1271
|
elementResize: o = typeof ResizeObserver == "function",
|
|
1272
|
-
layoutShift:
|
|
1272
|
+
layoutShift: s = typeof IntersectionObserver == "function",
|
|
1273
1273
|
animationFrame: d = !1
|
|
1274
|
-
} = n, l = Qe(e), c = i ||
|
|
1275
|
-
c.forEach((
|
|
1276
|
-
i &&
|
|
1274
|
+
} = n, l = Qe(e), c = i || r ? [...l ? ue(l) : [], ...ue(a)] : [];
|
|
1275
|
+
c.forEach((h) => {
|
|
1276
|
+
i && h.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
1278
|
-
}),
|
|
1278
|
+
}), r && h.addEventListener("resize", t);
|
|
1279
1279
|
});
|
|
1280
|
-
const
|
|
1281
|
-
let u = -1,
|
|
1282
|
-
o && (
|
|
1283
|
-
let [M] =
|
|
1284
|
-
M && M.target === l &&
|
|
1280
|
+
const p = l && s ? Za(l, t) : null;
|
|
1281
|
+
let u = -1, g = null;
|
|
1282
|
+
o && (g = new ResizeObserver((h) => {
|
|
1283
|
+
let [M] = h;
|
|
1284
|
+
M && M.target === l && g && (g.unobserve(a), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
1285
1285
|
var C;
|
|
1286
|
-
(C =
|
|
1286
|
+
(C = g) == null || C.observe(a);
|
|
1287
1287
|
})), t();
|
|
1288
|
-
}), l && !d &&
|
|
1288
|
+
}), l && !d && g.observe(l), g.observe(a));
|
|
1289
1289
|
let m, f = d ? ie(e) : null;
|
|
1290
|
-
d &&
|
|
1291
|
-
function
|
|
1292
|
-
const
|
|
1293
|
-
f && !Et(f,
|
|
1290
|
+
d && y();
|
|
1291
|
+
function y() {
|
|
1292
|
+
const h = ie(e);
|
|
1293
|
+
f && !Et(f, h) && t(), f = h, m = requestAnimationFrame(y);
|
|
1294
1294
|
}
|
|
1295
1295
|
return t(), () => {
|
|
1296
|
-
var
|
|
1296
|
+
var h;
|
|
1297
1297
|
c.forEach((M) => {
|
|
1298
|
-
i && M.removeEventListener("scroll", t),
|
|
1299
|
-
}),
|
|
1298
|
+
i && M.removeEventListener("scroll", t), r && M.removeEventListener("resize", t);
|
|
1299
|
+
}), p == null || p(), (h = g) == null || h.disconnect(), g = null, d && cancelAnimationFrame(m);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
1302
|
const Ae = Ea, Le = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
1303
1303
|
const n = /* @__PURE__ */ new Map(), i = {
|
|
1304
1304
|
platform: It,
|
|
1305
1305
|
...t
|
|
1306
|
-
},
|
|
1306
|
+
}, r = {
|
|
1307
1307
|
...i.platform,
|
|
1308
1308
|
_c: n
|
|
1309
1309
|
};
|
|
1310
1310
|
return xa(e, a, {
|
|
1311
1311
|
...i,
|
|
1312
|
-
platform:
|
|
1312
|
+
platform: r
|
|
1313
1313
|
});
|
|
1314
1314
|
}, en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1315
1315
|
__proto__: null,
|
|
@@ -1324,39 +1324,39 @@ const Ae = Ea, Le = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
1325
|
let Se = null;
|
|
1326
1326
|
function Lt(e) {
|
|
1327
|
-
e.options.positioningMode !== "inline" && (
|
|
1327
|
+
e.options.positioningMode !== "inline" && (O.debug("show() - adding visible class"), e.requiresApplyButton() && e.input && (e.originalInputValue = e.input.value, O.debug("show() - stored original input value:", e.originalInputValue)), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1, Tt(e)), e.calendar.classList.add("drp-date-picker--visible"), e.isCalendarActive = !0, O.debug("show() - calendar classes:", e.calendar.className), qe(e), Se = Rt(e.input, e.calendar, () => {
|
|
1328
1328
|
qe(e);
|
|
1329
1329
|
}), e.clickOutsideHandler && setTimeout(() => {
|
|
1330
1330
|
document.addEventListener("click", e.clickOutsideHandler);
|
|
1331
1331
|
}, 0), setTimeout(() => {
|
|
1332
1332
|
const a = window.getComputedStyle(e.calendar);
|
|
1333
|
-
|
|
1333
|
+
O.debug("show() - computed styles - display:", a.display, "position:", a.position, "left:", a.left, "top:", a.top, "z-index:", a.zIndex);
|
|
1334
1334
|
}, 100));
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function kt(e) {
|
|
1337
1337
|
if (e.options.positioningMode !== "inline" && e.calendar.classList.contains("drp-date-picker--visible")) {
|
|
1338
|
-
Se && (Se(), Se = null), e.clickOutsideHandler && document.removeEventListener("click", e.clickOutsideHandler), e.calendar.classList.remove("drp-date-picker--visible"), e.isCalendarActive = !1, e.requiresApplyButton() && e.pendingSelection && e.input && (
|
|
1338
|
+
Se && (Se(), Se = null), e.clickOutsideHandler && document.removeEventListener("click", e.clickOutsideHandler), e.calendar.classList.remove("drp-date-picker--visible"), e.isCalendarActive = !1, e.requiresApplyButton() && e.pendingSelection && e.input && (O.debug("hide() - restoring original input value:", e.originalInputValue), e.originalInputValue !== null && (e.input.value = e.originalInputValue), e.options.selectionMode === "range" ? (e.selectedStartDate = e.committedStartDate, e.selectedEndDate = e.committedEndDate) : e.options.selectionMode === "single" && (e.selectedDate = e.committedDate), O.debug("hide() - reverted selection state")), e.pendingSelection = null;
|
|
1339
1339
|
for (let a = 0; a < e.showingRollingSelector.length; a++)
|
|
1340
1340
|
e.showingRollingSelector[a] = !1;
|
|
1341
1341
|
e.isFirstRender || e.renderCalendar(), e.lockedPlacement = void 0;
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
function tn(e) {
|
|
1345
|
-
e.calendar.classList.contains("drp-date-picker--visible") ?
|
|
1345
|
+
e.calendar.classList.contains("drp-date-picker--visible") ? kt(e) : Lt(e);
|
|
1346
1346
|
}
|
|
1347
1347
|
async function qe(e) {
|
|
1348
|
-
if (
|
|
1348
|
+
if (O.debug("position() - locked placement:", e.lockedPlacement), !e.input)
|
|
1349
1349
|
return;
|
|
1350
1350
|
const a = e.lockedPlacement ? [Ae(8), Le({ padding: 8 })] : [Ae(8), Ze(), Le({ padding: 8 })], t = await et(e.input, e.calendar, {
|
|
1351
1351
|
placement: e.lockedPlacement || e.options.calendarPlacement,
|
|
1352
1352
|
middleware: a
|
|
1353
1353
|
});
|
|
1354
|
-
|
|
1354
|
+
O.debug("position() - FloatingUI computed - x:", t.x, "y:", t.y, "placement:", t.placement), e.lockedPlacement || (e.lockedPlacement = t.placement, O.debug("position() - locked placement to:", e.lockedPlacement)), e.calendar.style.left = `${t.x}px`, e.calendar.style.top = `${t.y}px`, O.debug("position() - applied styles to calendar");
|
|
1355
1355
|
}
|
|
1356
1356
|
async function an(e, a, t) {
|
|
1357
1357
|
if (!e.tooltip || !e.tooltipArrow) return;
|
|
1358
1358
|
e.currentTooltipTarget = a, e.tooltip.innerHTML = t, e.tooltip.appendChild(e.tooltipArrow), e.tooltip.classList.add("drp-date-picker__tooltip--visible");
|
|
1359
|
-
const { x: n, y: i, placement:
|
|
1359
|
+
const { x: n, y: i, placement: r, middlewareData: o } = await et(a, e.tooltip, {
|
|
1360
1360
|
placement: "top",
|
|
1361
1361
|
middleware: [
|
|
1362
1362
|
Ae(6),
|
|
@@ -1369,14 +1369,14 @@ async function an(e, a, t) {
|
|
|
1369
1369
|
left: `${n}px`,
|
|
1370
1370
|
top: `${i}px`
|
|
1371
1371
|
}), o.arrow) {
|
|
1372
|
-
const { x:
|
|
1372
|
+
const { x: s, y: d } = o.arrow, l = {
|
|
1373
1373
|
top: "bottom",
|
|
1374
1374
|
right: "left",
|
|
1375
1375
|
bottom: "top",
|
|
1376
1376
|
left: "right"
|
|
1377
|
-
}[
|
|
1377
|
+
}[r.split("-")[0]];
|
|
1378
1378
|
Object.assign(e.tooltipArrow.style, {
|
|
1379
|
-
left:
|
|
1379
|
+
left: s != null ? `${s}px` : "",
|
|
1380
1380
|
top: d != null ? `${d}px` : "",
|
|
1381
1381
|
right: "",
|
|
1382
1382
|
bottom: "",
|
|
@@ -1387,7 +1387,7 @@ async function an(e, a, t) {
|
|
|
1387
1387
|
function nn(e) {
|
|
1388
1388
|
e.tooltip && (e.tooltip.classList.remove("drp-date-picker__tooltip--visible"), e.currentTooltipTarget = void 0);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function ke(e) {
|
|
1391
1391
|
if (e.loadingOverlay) return;
|
|
1392
1392
|
const a = document.createElement("div");
|
|
1393
1393
|
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
@@ -1405,7 +1405,7 @@ function j(e, a, t) {
|
|
|
1405
1405
|
}
|
|
1406
1406
|
return !1;
|
|
1407
1407
|
}
|
|
1408
|
-
async function
|
|
1408
|
+
async function Tt(e) {
|
|
1409
1409
|
var a, t;
|
|
1410
1410
|
if (e.options.beforeMonthChangedCallback) {
|
|
1411
1411
|
if (e.isMonthChanging) {
|
|
@@ -1414,43 +1414,43 @@ async function kt(e) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
try {
|
|
1416
1416
|
if (e.isMonthChanging = !0, e.options.unifiedNavigation) {
|
|
1417
|
-
const n = e.options.unifiedNavigationAnchorIndex ?? 0, i = e.monthDates[n],
|
|
1418
|
-
let
|
|
1417
|
+
const n = e.options.unifiedNavigationAnchorIndex ?? 0, i = e.monthDates[n], r = i.getFullYear(), o = i.getMonth();
|
|
1418
|
+
let s = 1 / 0, d = 1 / 0, l = -1 / 0, c = -1 / 0;
|
|
1419
1419
|
for (let A = 0; A < e.monthDates.length; A++) {
|
|
1420
1420
|
const D = e.monthDates[A], x = D.getFullYear(), S = D.getMonth();
|
|
1421
|
-
(x <
|
|
1421
|
+
(x < s || x === s && S < d) && (s = x, d = S), (x > l || x === l && S > c) && (l = x, c = S);
|
|
1422
1422
|
}
|
|
1423
|
-
const
|
|
1424
|
-
year:
|
|
1423
|
+
const g = (new Date(s, d, 1).getDay() - e.weekStartDay + 7) % 7, m = new Date(s, d, 1 - g), f = new Date(l, c + 1, 0).getDate(), h = new Date(l, c, f).getDay(), M = (e.weekStartDay + 6 - h) % 7, C = new Date(l, c, f + M), E = {
|
|
1424
|
+
year: r,
|
|
1425
1425
|
month: o,
|
|
1426
1426
|
monthIndex: n,
|
|
1427
1427
|
firstVisibleDate: m,
|
|
1428
1428
|
lastVisibleDate: C
|
|
1429
1429
|
};
|
|
1430
|
-
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${
|
|
1430
|
+
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${r}-${o + 1}, range: ${m.toISOString().split("T")[0]} to ${C.toISOString().split("T")[0]}`);
|
|
1431
1431
|
const _ = e.options.beforeMonthChangedCallback(E), v = _ instanceof Promise;
|
|
1432
|
-
v &&
|
|
1432
|
+
v && ke(e);
|
|
1433
1433
|
const I = await Promise.resolve(_);
|
|
1434
1434
|
v && ae(e), w.debug(`handleInitialMonthLoad() [UNIFIED] - callback completed, metadata items: ${((a = I.metadata) == null ? void 0 : a.size) || 0}`), I.metadata && (e.bulkMetadataCache = I.metadata, w.debug(`handleInitialMonthLoad() [UNIFIED] - bulk metadata cache updated with ${I.metadata.size} entries`), e.renderCalendar());
|
|
1435
1435
|
} else {
|
|
1436
1436
|
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1437
1437
|
const n = /* @__PURE__ */ new Map();
|
|
1438
1438
|
let i = !1;
|
|
1439
|
-
for (let
|
|
1440
|
-
const o = e.monthDates[
|
|
1441
|
-
|
|
1439
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1440
|
+
const o = e.monthDates[r], s = o.getFullYear(), d = o.getMonth(), p = (new Date(s, d, 1).getDay() - e.weekStartDay + 7) % 7, u = new Date(s, d, 1 - p), g = new Date(u);
|
|
1441
|
+
g.setDate(u.getDate() + 41);
|
|
1442
1442
|
const m = {
|
|
1443
|
-
year:
|
|
1443
|
+
year: s,
|
|
1444
1444
|
month: d,
|
|
1445
|
-
monthIndex:
|
|
1445
|
+
monthIndex: r,
|
|
1446
1446
|
firstVisibleDate: u,
|
|
1447
|
-
lastVisibleDate:
|
|
1447
|
+
lastVisibleDate: g
|
|
1448
1448
|
};
|
|
1449
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1449
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${r} - calling callback for ${s}-${d + 1}, range: ${u.toISOString().split("T")[0]} to ${g.toISOString().split("T")[0]}`);
|
|
1450
1450
|
const f = e.options.beforeMonthChangedCallback(m);
|
|
1451
|
-
f instanceof Promise && !i && (i = !0,
|
|
1452
|
-
const
|
|
1453
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1451
|
+
f instanceof Promise && !i && (i = !0, ke(e));
|
|
1452
|
+
const h = await Promise.resolve(f);
|
|
1453
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${r} - callback completed, metadata items: ${((t = h.metadata) == null ? void 0 : t.size) || 0}`), h.metadata && h.metadata.forEach((M, C) => {
|
|
1454
1454
|
n.set(C, M);
|
|
1455
1455
|
});
|
|
1456
1456
|
}
|
|
@@ -1471,42 +1471,42 @@ async function Z(e, a, t, n) {
|
|
|
1471
1471
|
return w.debug("handleBeforeMonthChange() - already changing month, ignoring"), !1;
|
|
1472
1472
|
try {
|
|
1473
1473
|
e.isMonthChanging = !0;
|
|
1474
|
-
let
|
|
1474
|
+
let r, o;
|
|
1475
1475
|
if (e.options.unifiedNavigation) {
|
|
1476
|
-
let
|
|
1476
|
+
let p = 1 / 0, u = 1 / 0, g = -1 / 0, m = -1 / 0;
|
|
1477
1477
|
for (let v = 0; v < e.monthDates.length; v++) {
|
|
1478
1478
|
const I = e.monthDates[v], A = I.getFullYear(), D = I.getMonth();
|
|
1479
|
-
(A <
|
|
1479
|
+
(A < p || A === p && D < u) && (p = A, u = D), (A > g || A === g && D > m) && (g = A, m = D);
|
|
1480
1480
|
}
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
const M = new Date(
|
|
1484
|
-
o = new Date(
|
|
1481
|
+
const h = (new Date(p, u, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1482
|
+
r = new Date(p, u, 1 - h);
|
|
1483
|
+
const M = new Date(g, m + 1, 0).getDate(), E = new Date(g, m, M).getDay(), _ = (e.weekStartDay + 6 - E) % 7;
|
|
1484
|
+
o = new Date(g, m, M + _);
|
|
1485
1485
|
} else {
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1486
|
+
const g = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1487
|
+
r = new Date(a, t, 1 - g), o = new Date(r), o.setDate(r.getDate() + 41);
|
|
1488
1488
|
}
|
|
1489
|
-
const
|
|
1489
|
+
const s = {
|
|
1490
1490
|
year: a,
|
|
1491
1491
|
month: t,
|
|
1492
1492
|
monthIndex: n,
|
|
1493
|
-
firstVisibleDate:
|
|
1493
|
+
firstVisibleDate: r,
|
|
1494
1494
|
lastVisibleDate: o
|
|
1495
1495
|
};
|
|
1496
|
-
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${
|
|
1497
|
-
const d = e.options.beforeMonthChangedCallback(
|
|
1498
|
-
l &&
|
|
1496
|
+
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${r.toISOString().split("T")[0]} to ${o.toISOString().split("T")[0]}`);
|
|
1497
|
+
const d = e.options.beforeMonthChangedCallback(s), l = d instanceof Promise;
|
|
1498
|
+
l && ke(e);
|
|
1499
1499
|
const c = await Promise.resolve(d);
|
|
1500
|
-
return l && ae(e), c.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${c.message || "no reason provided"}`), c.message && console.warn(`[DateRangePicker] Month navigation blocked: ${c.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((i = c.metadata) == null ? void 0 : i.size) || 0}`), c.metadata ? e.bulkMetadataCache ? (c.metadata.forEach((
|
|
1501
|
-
e.bulkMetadataCache.set(u,
|
|
1500
|
+
return l && ae(e), c.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${c.message || "no reason provided"}`), c.message && console.warn(`[DateRangePicker] Month navigation blocked: ${c.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((i = c.metadata) == null ? void 0 : i.size) || 0}`), c.metadata ? e.bulkMetadataCache ? (c.metadata.forEach((p, u) => {
|
|
1501
|
+
e.bulkMetadataCache.set(u, p);
|
|
1502
1502
|
}), w.debug(`handleBeforeMonthChange() - merged ${c.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = c.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${c.metadata.size} entries`)) : e.bulkMetadataCache = null, !0);
|
|
1503
|
-
} catch (
|
|
1504
|
-
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:",
|
|
1503
|
+
} catch (r) {
|
|
1504
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", r), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", r), !1;
|
|
1505
1505
|
} finally {
|
|
1506
1506
|
e.isMonthChanging = !1;
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function rn(e, a) {
|
|
1510
1510
|
e.showingRollingSelector[a] = !e.showingRollingSelector[a], e.renderCalendar();
|
|
1511
1511
|
}
|
|
1512
1512
|
async function on(e, a, t) {
|
|
@@ -1515,23 +1515,23 @@ async function on(e, a, t) {
|
|
|
1515
1515
|
w.debug(`selectYear() Col${t} - navigation blocked by callback`);
|
|
1516
1516
|
return;
|
|
1517
1517
|
}
|
|
1518
|
-
const
|
|
1519
|
-
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${
|
|
1518
|
+
const r = e.monthDates[t].getFullYear();
|
|
1519
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${r} to ${a}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1520
1520
|
}
|
|
1521
|
-
async function
|
|
1521
|
+
async function sn(e, a, t) {
|
|
1522
1522
|
const n = e.monthDates[t].getFullYear();
|
|
1523
1523
|
if (!await Z(e, n, a, t)) {
|
|
1524
1524
|
w.debug(`selectMonth() Col${t} - navigation blocked by callback`);
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${
|
|
1527
|
+
const r = e.monthDates[t].getMonth();
|
|
1528
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${r + 1} to ${a + 1}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1529
1529
|
}
|
|
1530
1530
|
function De(e, a) {
|
|
1531
1531
|
const t = e.monthDates[a];
|
|
1532
1532
|
if (a < e.monthDates.length - 1) {
|
|
1533
1533
|
const n = e.monthDates[a + 1];
|
|
1534
|
-
if (
|
|
1534
|
+
if (Te(t, n)) {
|
|
1535
1535
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a + 1}, shifting forward`);
|
|
1536
1536
|
const i = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1537
1537
|
e.monthDates[a + 1] = i, De(e, a + 1);
|
|
@@ -1539,18 +1539,18 @@ function De(e, a) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
if (a > 0) {
|
|
1541
1541
|
const n = e.monthDates[a - 1];
|
|
1542
|
-
if (
|
|
1542
|
+
if (Te(n, t)) {
|
|
1543
1543
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a - 1}, shifting backward`);
|
|
1544
1544
|
const i = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1545
1545
|
e.monthDates[a - 1] = i, De(e, a - 1);
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const t = e.getFullYear(), n = e.getMonth(), i = a.getFullYear(),
|
|
1551
|
-
return t > i || t === i && n >=
|
|
1549
|
+
function Te(e, a) {
|
|
1550
|
+
const t = e.getFullYear(), n = e.getMonth(), i = a.getFullYear(), r = a.getMonth();
|
|
1551
|
+
return t > i || t === i && n >= r;
|
|
1552
1552
|
}
|
|
1553
|
-
async function
|
|
1553
|
+
async function be(e, a) {
|
|
1554
1554
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1555
1555
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1556
1556
|
const n = e.monthDates[t], i = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
@@ -1564,11 +1564,11 @@ async function ye(e, a) {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
if (e.monthDates[t] = i, w.debug(`prevMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t > 0) {
|
|
1566
1566
|
const o = e.monthDates[t - 1];
|
|
1567
|
-
|
|
1567
|
+
Te(o, i) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await be(e, t - 1));
|
|
1568
1568
|
}
|
|
1569
1569
|
e.renderCalendar();
|
|
1570
1570
|
}
|
|
1571
|
-
async function
|
|
1571
|
+
async function ye(e, a) {
|
|
1572
1572
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1573
1573
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1574
1574
|
const n = e.monthDates[t], i = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
@@ -1582,29 +1582,29 @@ async function be(e, a) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
if (e.monthDates[t] = i, w.debug(`nextMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t < e.monthDates.length - 1) {
|
|
1584
1584
|
const o = e.monthDates[t + 1];
|
|
1585
|
-
|
|
1585
|
+
Te(i, o) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await ye(e, t + 1));
|
|
1586
1586
|
}
|
|
1587
1587
|
e.renderCalendar();
|
|
1588
1588
|
}
|
|
1589
1589
|
function fe(e, a, t, n, i) {
|
|
1590
|
-
let
|
|
1591
|
-
const
|
|
1592
|
-
for (; o <
|
|
1593
|
-
if (
|
|
1594
|
-
const l = n[
|
|
1590
|
+
let r = a, o = 0;
|
|
1591
|
+
const s = 60;
|
|
1592
|
+
for (; o < s; ) {
|
|
1593
|
+
if (r >= 0 && r < n.length) {
|
|
1594
|
+
const l = n[r].dataset.date;
|
|
1595
1595
|
if (l) {
|
|
1596
|
-
const [c,
|
|
1597
|
-
if (!e.isDateDisabledInternal(
|
|
1598
|
-
return { index:
|
|
1596
|
+
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
1597
|
+
if (!e.isDateDisabledInternal(g))
|
|
1598
|
+
return { index: r, monthChanged: !1 };
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
if (
|
|
1601
|
+
if (r += t, o++, r < 0 || r >= n.length)
|
|
1602
1602
|
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
1603
1603
|
}
|
|
1604
1604
|
return { index: null, monthChanged: !1 };
|
|
1605
1605
|
}
|
|
1606
1606
|
function dn(e, a) {
|
|
1607
|
-
var o,
|
|
1607
|
+
var o, s, d, l;
|
|
1608
1608
|
w.debug(`moveFocus(${a}) Col${e.activeMonthIndex} - focusedDayIndex:`, e.focusedDayIndex);
|
|
1609
1609
|
const t = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
1610
1610
|
if (!t) {
|
|
@@ -1614,7 +1614,7 @@ function dn(e, a) {
|
|
|
1614
1614
|
const n = t.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
1615
1615
|
if (w.debug(`moveFocus() Col${e.activeMonthIndex} - found ${n.length} days in column`), n.length === 0) return;
|
|
1616
1616
|
if (e.focusedDayIndex === null) {
|
|
1617
|
-
const c = Array.from(n).findIndex((
|
|
1617
|
+
const c = Array.from(n).findIndex((p) => p.classList.contains("drp-date-picker__day--today"));
|
|
1618
1618
|
e.focusedDayIndex = c !== -1 ? c : 0, w.debug(`moveFocus() Col${e.activeMonthIndex} - initialized focusedDayIndex to ${e.focusedDayIndex} (today or first day), will move by offset ${a}`);
|
|
1619
1619
|
}
|
|
1620
1620
|
(o = n[e.focusedDayIndex]) == null || o.classList.remove("drp-date-picker__day--focused");
|
|
@@ -1622,25 +1622,25 @@ function dn(e, a) {
|
|
|
1622
1622
|
if (i < 0) {
|
|
1623
1623
|
const c = e.activeMonthIndex;
|
|
1624
1624
|
if (a === -1)
|
|
1625
|
-
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`),
|
|
1625
|
+
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1626
1626
|
var m, f;
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1629
|
-
const u =
|
|
1630
|
-
|
|
1627
|
+
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1628
|
+
if (!p) return;
|
|
1629
|
+
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(e, u.length - 1, -1, u);
|
|
1630
|
+
g.index !== null && (e.focusedDayIndex = g.index, (m = u[e.focusedDayIndex]) == null || m.classList.add("drp-date-picker__day--focused"), (f = u[e.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
1631
1631
|
}, 0);
|
|
1632
1632
|
else {
|
|
1633
1633
|
const u = n[e.focusedDayIndex].dataset.date;
|
|
1634
1634
|
if (u) {
|
|
1635
|
-
const [
|
|
1636
|
-
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${f} is weekday ${
|
|
1635
|
+
const [g, m, f] = u.split("-").map(Number), h = new Date(g, m - 1, f).getDay();
|
|
1636
|
+
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${f} is weekday ${h}, going to prev month`), be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1637
1637
|
var v, I;
|
|
1638
1638
|
const M = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1639
1639
|
if (!M) return;
|
|
1640
1640
|
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), _ = C[C.length - 1].dataset.date;
|
|
1641
1641
|
if (_) {
|
|
1642
|
-
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(),
|
|
1643
|
-
e.focusedDayIndex = C.length - 1 -
|
|
1642
|
+
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(), T = (R - h + 7) % 7;
|
|
1643
|
+
e.focusedDayIndex = C.length - 1 - T, w.debug(`moveFocus() Col${c} - last day weekday ${R}, target ${h}, focusing on day ${e.focusedDayIndex + 1}`), (v = C[e.focusedDayIndex]) == null || v.classList.add("drp-date-picker__day--focused"), (I = C[e.focusedDayIndex]) == null || I.scrollIntoView({ block: "nearest" });
|
|
1644
1644
|
}
|
|
1645
1645
|
}, 0);
|
|
1646
1646
|
}
|
|
@@ -1649,49 +1649,49 @@ function dn(e, a) {
|
|
|
1649
1649
|
} else if (i >= n.length) {
|
|
1650
1650
|
const c = e.activeMonthIndex;
|
|
1651
1651
|
if (a === 1)
|
|
1652
|
-
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`),
|
|
1652
|
+
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1653
1653
|
var m, f;
|
|
1654
|
-
const
|
|
1655
|
-
if (!
|
|
1656
|
-
const u =
|
|
1657
|
-
|
|
1654
|
+
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1655
|
+
if (!p) return;
|
|
1656
|
+
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(e, 0, 1, u);
|
|
1657
|
+
g.index !== null && (e.focusedDayIndex = g.index, (m = u[e.focusedDayIndex]) == null || m.classList.add("drp-date-picker__day--focused"), (f = u[e.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
1658
1658
|
}, 0);
|
|
1659
1659
|
else {
|
|
1660
1660
|
const u = n[e.focusedDayIndex].dataset.date;
|
|
1661
1661
|
if (u) {
|
|
1662
|
-
const [
|
|
1663
|
-
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${f} is weekday ${
|
|
1662
|
+
const [g, m, f] = u.split("-").map(Number), h = new Date(g, m - 1, f).getDay();
|
|
1663
|
+
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${f} is weekday ${h}, going to next month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1664
1664
|
var v, I;
|
|
1665
1665
|
const M = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1666
1666
|
if (!M) return;
|
|
1667
1667
|
const C = M.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), _ = C[0].dataset.date;
|
|
1668
1668
|
if (_) {
|
|
1669
|
-
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(),
|
|
1670
|
-
e.focusedDayIndex =
|
|
1669
|
+
const [A, D, x] = _.split("-").map(Number), R = new Date(A, D - 1, x).getDay(), T = (h - R + 7) % 7;
|
|
1670
|
+
e.focusedDayIndex = T, w.debug(`moveFocus() Col${c} - first day weekday ${R}, target ${h}, focusing on day ${e.focusedDayIndex + 1}`), (v = C[e.focusedDayIndex]) == null || v.classList.add("drp-date-picker__day--focused"), (I = C[e.focusedDayIndex]) == null || I.scrollIntoView({ block: "nearest" });
|
|
1671
1671
|
}
|
|
1672
1672
|
}, 0);
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
1675
|
return;
|
|
1676
1676
|
}
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1677
|
+
const r = fe(e, i, a, n, e.activeMonthIndex);
|
|
1678
|
+
if (r.monthChanged) {
|
|
1679
1679
|
const c = e.activeMonthIndex;
|
|
1680
|
-
|
|
1680
|
+
r.direction === "next" ? ye(e, e.activeMonthIndex) : be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1681
1681
|
var m, f;
|
|
1682
|
-
const
|
|
1683
|
-
if (!
|
|
1684
|
-
const u =
|
|
1682
|
+
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1683
|
+
if (!p) return;
|
|
1684
|
+
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(
|
|
1685
1685
|
e,
|
|
1686
|
-
|
|
1686
|
+
r.direction === "next" ? 0 : u.length - 1,
|
|
1687
1687
|
a,
|
|
1688
1688
|
u
|
|
1689
1689
|
);
|
|
1690
|
-
|
|
1690
|
+
g.index !== null && (e.focusedDayIndex = g.index, (m = u[e.focusedDayIndex]) == null || m.classList.add("drp-date-picker__day--focused"), (f = u[e.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
1691
1691
|
}, 0);
|
|
1692
1692
|
return;
|
|
1693
1693
|
}
|
|
1694
|
-
|
|
1694
|
+
r.index !== null ? (e.focusedDayIndex = r.index, (s = n[e.focusedDayIndex]) == null || s.classList.add("drp-date-picker__day--focused"), (d = n[e.focusedDayIndex]) == null || d.scrollIntoView({ block: "nearest" })) : (w.debug("moveFocus() - no enabled day found in search range"), (l = n[e.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"));
|
|
1695
1695
|
}
|
|
1696
1696
|
async function ln(e) {
|
|
1697
1697
|
if (!e.options.unifiedNavigation) return;
|
|
@@ -1701,9 +1701,9 @@ async function ln(e) {
|
|
|
1701
1701
|
return;
|
|
1702
1702
|
}
|
|
1703
1703
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1704
|
-
for (let
|
|
1705
|
-
const o =
|
|
1706
|
-
e.monthDates[
|
|
1704
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1705
|
+
const o = r - a;
|
|
1706
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
1707
1707
|
}
|
|
1708
1708
|
e.renderCalendar();
|
|
1709
1709
|
}
|
|
@@ -1716,9 +1716,9 @@ async function cn(e) {
|
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
1718
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1719
|
-
for (let
|
|
1720
|
-
const o =
|
|
1721
|
-
e.monthDates[
|
|
1719
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1720
|
+
const o = r - a;
|
|
1721
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
1722
1722
|
}
|
|
1723
1723
|
e.renderCalendar();
|
|
1724
1724
|
}
|
|
@@ -1727,23 +1727,23 @@ async function un(e, a) {
|
|
|
1727
1727
|
if (!e.options.unifiedNavigation) return;
|
|
1728
1728
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
1729
1729
|
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Z(e, n, a, t)) {
|
|
1730
|
-
for (let
|
|
1731
|
-
const o =
|
|
1732
|
-
e.monthDates[
|
|
1730
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1731
|
+
const o = r - t;
|
|
1732
|
+
e.monthDates[r] = new Date(n, a + o, 1);
|
|
1733
1733
|
}
|
|
1734
1734
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
|
-
function
|
|
1737
|
+
function pn(e) {
|
|
1738
1738
|
e.options.unifiedNavigation && (e.showingUnifiedRollingSelector = !e.showingUnifiedRollingSelector, w.debug(`toggleUnifiedRollingSelector() - now ${e.showingUnifiedRollingSelector ? "visible" : "hidden"}`), e.renderCalendar());
|
|
1739
1739
|
}
|
|
1740
|
-
async function
|
|
1740
|
+
async function gn(e, a) {
|
|
1741
1741
|
if (!e.options.unifiedNavigation) return;
|
|
1742
1742
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getMonth();
|
|
1743
1743
|
if (w.debug(`setUnifiedYear(${a}) - anchor index: ${t}, month: ${n}`), !!await Z(e, a, n, t)) {
|
|
1744
|
-
for (let
|
|
1745
|
-
const o =
|
|
1746
|
-
e.monthDates[
|
|
1744
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1745
|
+
const o = r - t;
|
|
1746
|
+
e.monthDates[r] = new Date(a, n + o, 1);
|
|
1747
1747
|
}
|
|
1748
1748
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1749
1749
|
}
|
|
@@ -1770,10 +1770,10 @@ function Pt(e) {
|
|
|
1770
1770
|
const [a, t] = e.split("-");
|
|
1771
1771
|
return { min: parseInt(a, 10), max: parseInt(t, 10) };
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1773
|
+
function hn(e) {
|
|
1774
1774
|
de.debug("[DatePicker 18] renderCalendar called, showingRollingSelector:", e.showingRollingSelector, `activeCol: ${e.activeMonthIndex}`), de.debug("[DatePicker 18] monthDates array:", e.monthDates.map((a, t) => `Col${t}: ${a.getFullYear()}-${a.getMonth() + 1}`).join(", ")), e.options.unifiedNavigation && e.showingUnifiedRollingSelector && mn(e);
|
|
1775
1775
|
for (let a = 0; a < e.options.visibleMonthsCount; a++)
|
|
1776
|
-
e.showingRollingSelector[a] ?
|
|
1776
|
+
e.showingRollingSelector[a] ? Ft(e, a) : zt(e, a);
|
|
1777
1777
|
if (e.focusedDayIndex !== null) {
|
|
1778
1778
|
const a = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
1779
1779
|
if (a) {
|
|
@@ -1783,68 +1783,68 @@ function pn(e) {
|
|
|
1783
1783
|
}
|
|
1784
1784
|
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1786
|
+
function zt(e, a) {
|
|
1787
1787
|
de.debug(`[DatePicker Col${a} 19] renderNormalView called for month`, a);
|
|
1788
1788
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1789
1789
|
if (!t) return;
|
|
1790
1790
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1791
1791
|
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
1792
|
-
const i = e.monthDates[a],
|
|
1793
|
-
if (
|
|
1792
|
+
const i = e.monthDates[a], r = t.querySelector(".drp-date-picker__month-year");
|
|
1793
|
+
if (r && (r.textContent = `${e.monthNames[i.getMonth()]} ${i.getFullYear()}`), e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
1794
1794
|
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
1795
|
-
const
|
|
1795
|
+
const y = e.monthDates[0], h = e.monthDates[e.monthDates.length - 1], M = e.options.unifiedNavigationAnchorIndex ?? 0, C = e.monthDates[M];
|
|
1796
1796
|
if (e.options.getUnifiedHeaderCallback) {
|
|
1797
1797
|
const _ = e.options.getUnifiedHeaderCallback({
|
|
1798
|
-
firstMonth:
|
|
1799
|
-
lastMonth:
|
|
1798
|
+
firstMonth: y,
|
|
1799
|
+
lastMonth: h,
|
|
1800
1800
|
anchorMonth: C,
|
|
1801
1801
|
monthNames: e.monthNames
|
|
1802
1802
|
});
|
|
1803
1803
|
e.unifiedRangeDisplay.textContent = _;
|
|
1804
1804
|
} else {
|
|
1805
|
-
const _ = e.monthNames[
|
|
1805
|
+
const _ = e.monthNames[y.getMonth()], v = e.monthNames[h.getMonth()], I = y.getFullYear(), A = h.getFullYear();
|
|
1806
1806
|
I === A ? e.unifiedRangeDisplay.textContent = `${_} ${I} - ${v} ${A}` : e.unifiedRangeDisplay.textContent = `${_} ${I} - ${v} ${A}`;
|
|
1807
1807
|
}
|
|
1808
1808
|
const E = e.unifiedHeader;
|
|
1809
1809
|
if (E) {
|
|
1810
|
-
const _ =
|
|
1810
|
+
const _ = y.getMonth() === 0 ? y.getFullYear() - 1 : y.getFullYear(), v = y.getMonth() === 0 ? 11 : y.getMonth() - 1, I = E.querySelector(".drp-date-picker__nav--prev");
|
|
1811
1811
|
I && (j(e, _, v) ? (I.removeAttribute("disabled"), I.classList.remove("drp-date-picker__nav--disabled")) : (I.setAttribute("disabled", "true"), I.classList.add("drp-date-picker__nav--disabled")));
|
|
1812
|
-
const A =
|
|
1812
|
+
const A = h.getMonth() === 11 ? h.getFullYear() + 1 : h.getFullYear(), D = h.getMonth() === 11 ? 0 : h.getMonth() + 1, x = E.querySelector(".drp-date-picker__nav--next");
|
|
1813
1813
|
x && (j(e, A, D) ? (x.removeAttribute("disabled"), x.classList.remove("drp-date-picker__nav--disabled")) : (x.setAttribute("disabled", "true"), x.classList.add("drp-date-picker__nav--disabled")));
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
|
-
const o = i.getFullYear(),
|
|
1816
|
+
const o = i.getFullYear(), s = i.getMonth(), d = s === 0 ? 11 : s - 1, l = s === 0 ? o - 1 : o, c = t.querySelector(".drp-date-picker__nav--prev");
|
|
1817
1817
|
c && (j(e, l, d) ? (c.removeAttribute("disabled"), c.classList.remove("drp-date-picker__nav--disabled")) : (c.setAttribute("disabled", "true"), c.classList.add("drp-date-picker__nav--disabled")));
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1818
|
+
const p = s === 11 ? 0 : s + 1, u = s === 11 ? o + 1 : o, g = t.querySelector(".drp-date-picker__nav--next");
|
|
1819
|
+
g && (j(e, u, p) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
1820
1820
|
const m = t.querySelector(".drp-date-picker__weekdays"), f = [
|
|
1821
1821
|
...e.weekdayNames.slice(e.weekStartDay),
|
|
1822
1822
|
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
1823
1823
|
];
|
|
1824
|
-
m && (m.innerHTML = f.map((
|
|
1824
|
+
m && (m.innerHTML = f.map((y) => `<div class="drp-date-picker__weekday">${y}</div>`).join("")), Nt(e, a, i);
|
|
1825
1825
|
}
|
|
1826
|
-
function
|
|
1826
|
+
function Nt(e, a, t) {
|
|
1827
1827
|
de.debug(`[DatePicker Col${a} 20] renderDays called for month`, a);
|
|
1828
1828
|
const n = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1829
1829
|
if (!n) return;
|
|
1830
|
-
const i = n.querySelector(".drp-date-picker__days"),
|
|
1831
|
-
de.debug(`[DatePicker Col${a} 21] Rendering days for:`,
|
|
1832
|
-
const d = (new Date(
|
|
1830
|
+
const i = n.querySelector(".drp-date-picker__days"), r = t.getFullYear(), o = t.getMonth();
|
|
1831
|
+
de.debug(`[DatePicker Col${a} 21] Rendering days for:`, r, o + 1);
|
|
1832
|
+
const d = (new Date(r, o, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(r, o + 1, 0).getDate(), c = new Date(r, o, 0).getDate(), p = new Date(r, o - 1, 1), u = p.getFullYear(), g = p.getMonth(), m = new Date(r, o + 1, 1), f = m.getFullYear(), y = m.getMonth(), h = [];
|
|
1833
1833
|
for (let v = d - 1; v >= 0; v--) {
|
|
1834
|
-
const I = c - v, A = new Date(u,
|
|
1835
|
-
|
|
1834
|
+
const I = c - v, A = new Date(u, g, I);
|
|
1835
|
+
h.push({
|
|
1836
1836
|
date: A,
|
|
1837
1837
|
year: u,
|
|
1838
|
-
month:
|
|
1838
|
+
month: g,
|
|
1839
1839
|
day: I,
|
|
1840
1840
|
isOtherMonth: !0
|
|
1841
1841
|
});
|
|
1842
1842
|
}
|
|
1843
1843
|
for (let v = 1; v <= l; v++) {
|
|
1844
|
-
const I = new Date(
|
|
1845
|
-
|
|
1844
|
+
const I = new Date(r, o, v);
|
|
1845
|
+
h.push({
|
|
1846
1846
|
date: I,
|
|
1847
|
-
year:
|
|
1847
|
+
year: r,
|
|
1848
1848
|
month: o,
|
|
1849
1849
|
day: v,
|
|
1850
1850
|
isOtherMonth: !1
|
|
@@ -1852,25 +1852,25 @@ function Ft(e, a, t) {
|
|
|
1852
1852
|
}
|
|
1853
1853
|
const C = Math.ceil((d + l) / 7) * 7 - (d + l);
|
|
1854
1854
|
for (let v = 1; v <= C; v++) {
|
|
1855
|
-
const I = new Date(f,
|
|
1856
|
-
|
|
1855
|
+
const I = new Date(f, y, v);
|
|
1856
|
+
h.push({
|
|
1857
1857
|
date: I,
|
|
1858
1858
|
year: f,
|
|
1859
|
-
month:
|
|
1859
|
+
month: y,
|
|
1860
1860
|
day: v,
|
|
1861
1861
|
isOtherMonth: !0
|
|
1862
1862
|
});
|
|
1863
1863
|
}
|
|
1864
1864
|
const E = [];
|
|
1865
|
-
for (let v = 0; v <
|
|
1866
|
-
E.push(
|
|
1865
|
+
for (let v = 0; v < h.length; v += 7)
|
|
1866
|
+
E.push(h.slice(v, v + 7));
|
|
1867
1867
|
let _ = "";
|
|
1868
1868
|
for (const v of E) {
|
|
1869
1869
|
const I = v.map((D) => {
|
|
1870
1870
|
const x = e.getDateInfoInternal(D.date);
|
|
1871
1871
|
let S = (x == null ? void 0 : x.badgeTooltip) || "";
|
|
1872
1872
|
if (e.options.badgeTooltipCallback && (x != null && x.badgeText)) {
|
|
1873
|
-
const
|
|
1873
|
+
const T = {
|
|
1874
1874
|
date: D.date,
|
|
1875
1875
|
dateString: me(D.date),
|
|
1876
1876
|
dayNumber: D.day,
|
|
@@ -1886,7 +1886,7 @@ function Ft(e, a, t) {
|
|
|
1886
1886
|
element: null,
|
|
1887
1887
|
// Not available during string rendering
|
|
1888
1888
|
picker: e
|
|
1889
|
-
}, L = e.options.badgeTooltipCallback(
|
|
1889
|
+
}, L = e.options.badgeTooltipCallback(T);
|
|
1890
1890
|
L !== null && (S = L);
|
|
1891
1891
|
}
|
|
1892
1892
|
return {
|
|
@@ -1911,14 +1911,14 @@ function Ft(e, a, t) {
|
|
|
1911
1911
|
D.isOtherMonth && x.push("drp-date-picker__day--other-month");
|
|
1912
1912
|
const S = e.getDateInfoInternal(D.date), R = S && S.isDisabled !== void 0 ? S.isDisabled : e.isDateDisabledInternal(D.date);
|
|
1913
1913
|
R && x.push("drp-date-picker__day--disabled"), S && S.dayClass && x.push(S.dayClass), e.isToday(D.date) && x.push("drp-date-picker__day--today");
|
|
1914
|
-
let
|
|
1915
|
-
e.options.selectionMode === "single" ?
|
|
1916
|
-
let L = !1,
|
|
1914
|
+
let T = !1;
|
|
1915
|
+
e.options.selectionMode === "single" ? T = e.isSameDay(D.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((q) => e.isSameDay(D.date, q))), T && x.push("drp-date-picker__day--selected");
|
|
1916
|
+
let L = !1, z = !1, N = !1;
|
|
1917
1917
|
if (e.options.selectionMode === "range")
|
|
1918
|
-
L = e.isSameDay(D.date, e.selectedStartDate),
|
|
1918
|
+
L = e.isSameDay(D.date, e.selectedStartDate), z = e.isSameDay(D.date, e.selectedEndDate), N = e.isInRange(D.date), L && x.push("drp-date-picker__day--range-start"), z && x.push("drp-date-picker__day--range-end"), N && (!R || e.options.highlightDisabledInRange) && x.push("drp-date-picker__day--in-range");
|
|
1919
1919
|
else if (e.options.selectionMode === "multiple")
|
|
1920
1920
|
for (const q of e.selectedRanges)
|
|
1921
|
-
e.isSameDay(D.date, q.start) && (L = !0, x.push("drp-date-picker__day--range-start")), e.isSameDay(D.date, q.end) && (
|
|
1921
|
+
e.isSameDay(D.date, q.start) && (L = !0, x.push("drp-date-picker__day--range-start")), e.isSameDay(D.date, q.end) && (z = !0, x.push("drp-date-picker__day--range-end")), D.date >= q.start && D.date <= q.end && (N = !0, (!R || e.options.highlightDisabledInRange) && x.push("drp-date-picker__day--in-range"));
|
|
1922
1922
|
const $ = `${D.year}-${String(D.month + 1).padStart(2, "0")}-${String(D.day).padStart(2, "0")}`;
|
|
1923
1923
|
let P = (S == null ? void 0 : S.dayTooltip) || "";
|
|
1924
1924
|
if (e.options.dayTooltipCallback) {
|
|
@@ -1927,10 +1927,10 @@ function Ft(e, a, t) {
|
|
|
1927
1927
|
dateString: $,
|
|
1928
1928
|
dayNumber: D.day,
|
|
1929
1929
|
isDisabled: R,
|
|
1930
|
-
isSelected:
|
|
1930
|
+
isSelected: T,
|
|
1931
1931
|
isStartDate: L,
|
|
1932
|
-
isEndDate:
|
|
1933
|
-
isInRange:
|
|
1932
|
+
isEndDate: z,
|
|
1933
|
+
isInRange: N,
|
|
1934
1934
|
isToday: e.isToday(D.date),
|
|
1935
1935
|
isWeekend: D.date.getDay() === 0 || D.date.getDay() === 6,
|
|
1936
1936
|
monthIndex: a,
|
|
@@ -1951,24 +1951,24 @@ function fn(e, a, t) {
|
|
|
1951
1951
|
if (!e.options.renderDayCallback && !e.options.renderDayContentCallback)
|
|
1952
1952
|
return;
|
|
1953
1953
|
t.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
1954
|
-
const
|
|
1954
|
+
const r = i, o = r.getAttribute("data-date"), s = parseInt(r.getAttribute("data-day-number") || "0", 10);
|
|
1955
1955
|
if (!o) return;
|
|
1956
|
-
const [d, l, c] = o.split("-"),
|
|
1956
|
+
const [d, l, c] = o.split("-"), p = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), u = r.querySelector(`slot[name="day-${o}"]`);
|
|
1957
1957
|
if (u && u.assignedNodes().length > 0)
|
|
1958
1958
|
return;
|
|
1959
|
-
const m = e.isDateDisabledInternal(
|
|
1960
|
-
date:
|
|
1959
|
+
const m = e.isDateDisabledInternal(p), f = e.isToday(p), y = p.getDay() === 0 || p.getDay() === 6, h = e.options.selectionMode === "single" && e.isSameDay(p, e.selectedDate), M = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedStartDate), C = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedEndDate), E = e.options.selectionMode === "range" && e.isInRange(p), _ = {
|
|
1960
|
+
date: p,
|
|
1961
1961
|
dateString: o,
|
|
1962
|
-
dayNumber:
|
|
1962
|
+
dayNumber: s,
|
|
1963
1963
|
isDisabled: m,
|
|
1964
|
-
isSelected:
|
|
1964
|
+
isSelected: h || M || C,
|
|
1965
1965
|
isStartDate: M,
|
|
1966
1966
|
isEndDate: C,
|
|
1967
1967
|
isInRange: E,
|
|
1968
1968
|
isToday: f,
|
|
1969
|
-
isWeekend:
|
|
1969
|
+
isWeekend: y,
|
|
1970
1970
|
monthIndex: a,
|
|
1971
|
-
element:
|
|
1971
|
+
element: r,
|
|
1972
1972
|
picker: e
|
|
1973
1973
|
};
|
|
1974
1974
|
if (e.options.renderDayCallback)
|
|
@@ -1987,59 +1987,59 @@ function fn(e, a, t) {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
});
|
|
1989
1989
|
}
|
|
1990
|
-
function
|
|
1990
|
+
function Ft(e, a) {
|
|
1991
1991
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1992
1992
|
if (!t) return;
|
|
1993
1993
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1994
1994
|
n == null || n.classList.add("drp-date-picker__rolling-selector--visible");
|
|
1995
|
-
const i = e.monthDates[a],
|
|
1995
|
+
const i = e.monthDates[a], r = i.getFullYear(), o = i.getMonth(), s = $t(e.options.rollingYearRange, r, e), d = Pt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
1996
1996
|
let c = "";
|
|
1997
|
-
for (let u =
|
|
1998
|
-
const
|
|
1999
|
-
c += `<div class="drp-date-picker__rolling-item ${
|
|
1997
|
+
for (let u = s.min; u <= s.max; u++) {
|
|
1998
|
+
const g = u === r ? "drp-date-picker__rolling-item--selected" : "", f = ct(e, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
1999
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${f}" data-year="${u}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2000
2000
|
}
|
|
2001
2001
|
l && (l.innerHTML = c);
|
|
2002
|
-
const
|
|
2003
|
-
if (
|
|
2002
|
+
const p = n == null ? void 0 : n.querySelector('[data-list="months"]');
|
|
2003
|
+
if (p) {
|
|
2004
2004
|
let u = "";
|
|
2005
|
-
for (let
|
|
2006
|
-
const m = e.monthNames[
|
|
2007
|
-
u += `<div class="drp-date-picker__rolling-item ${f} ${
|
|
2005
|
+
for (let g = d.min - 1; g <= d.max - 1; g++) {
|
|
2006
|
+
const m = e.monthNames[g], f = g === o ? "drp-date-picker__rolling-item--selected" : "", h = j(e, r, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2007
|
+
u += `<div class="drp-date-picker__rolling-item ${f} ${h}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${m}</span></div>`;
|
|
2008
2008
|
}
|
|
2009
|
-
|
|
2009
|
+
p.innerHTML = u;
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
2012
|
function mn(e) {
|
|
2013
2013
|
if (!e.options.unifiedNavigation || !e.unifiedRollingSelector) return;
|
|
2014
2014
|
e.unifiedRollingSelector.classList.add("drp-date-picker__unified-rolling-selector--visible");
|
|
2015
|
-
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), i = t.getMonth(),
|
|
2015
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), i = t.getMonth(), r = e.getEffectiveYearRange(), o = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2016
2016
|
let d = "";
|
|
2017
|
-
for (let c =
|
|
2018
|
-
const
|
|
2019
|
-
d += `<div class="drp-date-picker__rolling-item ${
|
|
2017
|
+
for (let c = r.min; c <= r.max; c++) {
|
|
2018
|
+
const p = c === n ? "drp-date-picker__rolling-item--selected" : "", g = ct(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2019
|
+
d += `<div class="drp-date-picker__rolling-item ${p} ${g}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2020
2020
|
}
|
|
2021
|
-
|
|
2021
|
+
s && (s.innerHTML = d);
|
|
2022
2022
|
const l = e.unifiedRollingSelector.querySelector('[data-list="months"]');
|
|
2023
2023
|
if (l) {
|
|
2024
2024
|
let c = "";
|
|
2025
|
-
for (let
|
|
2026
|
-
const u = e.monthNames[
|
|
2027
|
-
c += `<div class="drp-date-picker__rolling-item ${
|
|
2025
|
+
for (let p = o.min - 1; p <= o.max - 1; p++) {
|
|
2026
|
+
const u = e.monthNames[p], g = p === i ? "drp-date-picker__rolling-item--selected" : "", f = j(e, n, p) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2027
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${f}" data-month="${p}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2028
2028
|
}
|
|
2029
2029
|
l.innerHTML = c;
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
|
-
function
|
|
2032
|
+
function bn(e) {
|
|
2033
2033
|
if (e.options.selectionMode !== "range") return;
|
|
2034
2034
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2035
2035
|
if (a)
|
|
2036
2036
|
if (e.selectedStartDate && e.selectedEndDate) {
|
|
2037
|
-
let t, n, i,
|
|
2037
|
+
let t, n, i, r, o;
|
|
2038
2038
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2039
2039
|
n = e.getEnabledDatesInRange(
|
|
2040
2040
|
e.selectedStartDate,
|
|
2041
2041
|
e.selectedEndDate
|
|
2042
|
-
), t = n.length,
|
|
2042
|
+
), t = n.length, r = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2043
2043
|
e.selectedStartDate,
|
|
2044
2044
|
e.selectedEndDate
|
|
2045
2045
|
));
|
|
@@ -2057,11 +2057,11 @@ function yn(e) {
|
|
|
2057
2057
|
const l = e.selectedEndDate.getTime() - e.selectedStartDate.getTime();
|
|
2058
2058
|
t = Math.floor(l / 864e5) + 1;
|
|
2059
2059
|
}
|
|
2060
|
-
const
|
|
2060
|
+
const s = t > 0 ? t - 1 : 0;
|
|
2061
2061
|
if (a.className = "drp-date-picker__summary drp-date-picker__summary--visible", e.options.formatSummaryCallback) {
|
|
2062
2062
|
const d = {
|
|
2063
2063
|
days: t,
|
|
2064
|
-
nights:
|
|
2064
|
+
nights: s,
|
|
2065
2065
|
startDate: e.selectedStartDate,
|
|
2066
2066
|
endDate: e.selectedEndDate,
|
|
2067
2067
|
selectionMode: e.options.selectionMode,
|
|
@@ -2069,26 +2069,26 @@ function yn(e) {
|
|
|
2069
2069
|
localeStrings: e.localeStrings,
|
|
2070
2070
|
isPreview: !1
|
|
2071
2071
|
};
|
|
2072
|
-
n && (d.enabledDates = n), i && (d.disabledDates = i),
|
|
2072
|
+
n && (d.enabledDates = n), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2073
2073
|
} else
|
|
2074
2074
|
a.innerHTML = `
|
|
2075
2075
|
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2076
2076
|
<span>, </span>
|
|
2077
|
-
<span class="drp-date-picker__summary-count">${
|
|
2077
|
+
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2078
2078
|
`;
|
|
2079
2079
|
} else
|
|
2080
2080
|
a.className = "drp-date-picker__summary drp-date-picker__summary--hidden", a.innerHTML = "";
|
|
2081
2081
|
}
|
|
2082
|
-
function
|
|
2082
|
+
function Ot(e) {
|
|
2083
2083
|
if (e.options.selectionMode !== "range") return;
|
|
2084
2084
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2085
2085
|
if (a && e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2086
|
-
let t, n, i,
|
|
2086
|
+
let t, n, i, r, o;
|
|
2087
2087
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2088
2088
|
n = e.getEnabledDatesInRange(
|
|
2089
2089
|
e.dragPreviewStart,
|
|
2090
2090
|
e.dragPreviewEnd
|
|
2091
|
-
), t = n.length,
|
|
2091
|
+
), t = n.length, r = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2092
2092
|
e.dragPreviewStart,
|
|
2093
2093
|
e.dragPreviewEnd
|
|
2094
2094
|
));
|
|
@@ -2106,11 +2106,11 @@ function zt(e) {
|
|
|
2106
2106
|
const l = e.dragPreviewEnd.getTime() - e.dragPreviewStart.getTime();
|
|
2107
2107
|
t = Math.floor(l / 864e5) + 1;
|
|
2108
2108
|
}
|
|
2109
|
-
const
|
|
2109
|
+
const s = t > 0 ? t - 1 : 0;
|
|
2110
2110
|
if (a.className = "drp-date-picker__summary drp-date-picker__summary--visible", e.options.formatSummaryCallback) {
|
|
2111
2111
|
const d = {
|
|
2112
2112
|
days: t,
|
|
2113
|
-
nights:
|
|
2113
|
+
nights: s,
|
|
2114
2114
|
startDate: e.dragPreviewStart,
|
|
2115
2115
|
endDate: e.dragPreviewEnd,
|
|
2116
2116
|
selectionMode: e.options.selectionMode,
|
|
@@ -2118,33 +2118,33 @@ function zt(e) {
|
|
|
2118
2118
|
localeStrings: e.localeStrings,
|
|
2119
2119
|
isPreview: !0
|
|
2120
2120
|
};
|
|
2121
|
-
n && (d.enabledDates = n), i && (d.disabledDates = i),
|
|
2121
|
+
n && (d.enabledDates = n), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2122
2122
|
} else
|
|
2123
2123
|
a.innerHTML = `
|
|
2124
2124
|
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
2125
2125
|
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
2126
2126
|
<span>, </span>
|
|
2127
|
-
<span class="drp-date-picker__summary-count">${
|
|
2127
|
+
<span class="drp-date-picker__summary-count">${s} ${s === 1 ? e.localeStrings.night : e.localeStrings.nights}</span>
|
|
2128
2128
|
`;
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
|
-
function
|
|
2131
|
+
function yn(e) {
|
|
2132
2132
|
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((i) => {
|
|
2133
2133
|
i.classList.remove("drp-date-picker__day--drag-preview", "drp-date-picker__day--drag-invalid");
|
|
2134
2134
|
}), !e.dragPreviewStart || !e.dragPreviewEnd) return;
|
|
2135
2135
|
const t = e.options.disabledDatesHandling === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd);
|
|
2136
2136
|
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
2137
|
-
const
|
|
2138
|
-
if (!
|
|
2139
|
-
const [o,
|
|
2137
|
+
const r = i.dataset.date;
|
|
2138
|
+
if (!r) return;
|
|
2139
|
+
const [o, s, d] = r.split("-").map(Number), l = new Date(o, s - 1, d);
|
|
2140
2140
|
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (i.classList.add("drp-date-picker__day--drag-preview"), t && i.classList.add("drp-date-picker__day--drag-invalid"));
|
|
2141
|
-
}),
|
|
2141
|
+
}), Ot(e);
|
|
2142
2142
|
}
|
|
2143
2143
|
async function Yt(e, a) {
|
|
2144
2144
|
if (!e.options.beforeDateSelectCallback)
|
|
2145
2145
|
return { isValid: !0 };
|
|
2146
2146
|
try {
|
|
2147
|
-
e.isValidating = !0,
|
|
2147
|
+
e.isValidating = !0, ke(e);
|
|
2148
2148
|
const t = await Promise.resolve(e.options.beforeDateSelectCallback(a));
|
|
2149
2149
|
switch (ae(e), e.isValidating = !1, t.action) {
|
|
2150
2150
|
case "accept":
|
|
@@ -2190,58 +2190,58 @@ async function vn(e, a) {
|
|
|
2190
2190
|
Y.warn("selectDay() - called with invalid element:", a);
|
|
2191
2191
|
return;
|
|
2192
2192
|
}
|
|
2193
|
-
const [t, n, i] = a.dataset.date.split("-").map(Number),
|
|
2193
|
+
const [t, n, i] = a.dataset.date.split("-").map(Number), r = new Date(t, n - 1, i);
|
|
2194
2194
|
a.classList.contains("drp-date-picker__day--other-month");
|
|
2195
2195
|
const o = a.closest(".drp-date-picker__days");
|
|
2196
2196
|
if (o && o instanceof HTMLElement) {
|
|
2197
|
-
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0,
|
|
2198
|
-
const
|
|
2199
|
-
e.focusedDayIndex = Array.from(
|
|
2197
|
+
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0, re.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
2198
|
+
const s = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2199
|
+
e.focusedDayIndex = Array.from(s).indexOf(a), re.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
2200
2200
|
}
|
|
2201
2201
|
if (e.options.selectionMode === "single") {
|
|
2202
|
-
const
|
|
2203
|
-
if (!
|
|
2204
|
-
|
|
2202
|
+
const s = await Yt(e, r);
|
|
2203
|
+
if (!s.isValid) {
|
|
2204
|
+
re.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
2205
2205
|
return;
|
|
2206
2206
|
}
|
|
2207
|
-
const d =
|
|
2207
|
+
const d = s.adjustedDate || r;
|
|
2208
2208
|
e.selectedDate = d, e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(d))), e.requiresApplyButton() ? e.pendingSelection = d : e.options.onSelect && e.options.onSelect(d), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2209
2209
|
} else if (e.options.selectionMode === "multiple") {
|
|
2210
|
-
const
|
|
2211
|
-
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(
|
|
2210
|
+
const s = `${r.getFullYear()}-${String(r.getMonth() + 1).padStart(2, "0")}-${String(r.getDate()).padStart(2, "0")}`, d = e.selectedDates.findIndex((l) => `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` === s);
|
|
2211
|
+
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(r)), e.input && !e.requiresApplyButton()) {
|
|
2212
2212
|
const l = e.selectedDates.length + e.selectedRanges.length;
|
|
2213
2213
|
e.input.value = l > 0 ? `${l} selection(s)` : "";
|
|
2214
2214
|
}
|
|
2215
2215
|
e.selectedRanges.length > 0 && e.selectedDates.length > 0 ? e.pendingSelection = [...e.selectedRanges, ...e.selectedDates] : e.selectedRanges.length > 0 ? e.pendingSelection = e.selectedRanges : e.pendingSelection = e.selectedDates;
|
|
2216
2216
|
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
2217
|
-
e.selectedStartDate =
|
|
2217
|
+
e.selectedStartDate = r, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
2218
2218
|
else {
|
|
2219
|
-
let
|
|
2220
|
-
|
|
2221
|
-
const l = await Bt(e,
|
|
2222
|
-
if (
|
|
2219
|
+
let s = e.selectedStartDate, d = r;
|
|
2220
|
+
r < e.selectedStartDate && (d = e.selectedStartDate, s = r), re.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
2221
|
+
const l = await Bt(e, s, d);
|
|
2222
|
+
if (re.debug(" selectDay - validation result:", l), !l.isValid) {
|
|
2223
2223
|
l.message && Y.warn("selectDay() - range validation failed:", l.message), e.renderCalendar(), e.updateSummary();
|
|
2224
2224
|
return;
|
|
2225
2225
|
}
|
|
2226
|
-
e.selectedStartDate = l.adjustedStart ||
|
|
2226
|
+
e.selectedStartDate = l.adjustedStart || s, e.selectedEndDate = l.adjustedEnd || d, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
2227
2227
|
const c = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2228
2228
|
e.requiresApplyButton() ? e.pendingSelection = c : e.options.onSelect && e.options.onSelect(c), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2229
2229
|
}
|
|
2230
2230
|
if (e.renderCalendar(), e.updateSummary(), e.options.selectionMode === "range" && e.selectedEndDate) {
|
|
2231
|
-
const
|
|
2231
|
+
const s = e.selectedEndDate;
|
|
2232
2232
|
for (let d = 0; d < e.monthDates.length; d++) {
|
|
2233
2233
|
const l = e.monthDates[d];
|
|
2234
|
-
if (
|
|
2234
|
+
if (s.getFullYear() === l.getFullYear() && s.getMonth() === l.getMonth()) {
|
|
2235
2235
|
e.activeMonthIndex = d;
|
|
2236
2236
|
const c = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${d}"]`);
|
|
2237
2237
|
if (c) {
|
|
2238
|
-
const
|
|
2239
|
-
const m =
|
|
2238
|
+
const p = c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), u = Array.from(p).findIndex((g) => {
|
|
2239
|
+
const m = g.dataset.date;
|
|
2240
2240
|
if (!m) return !1;
|
|
2241
|
-
const [f,
|
|
2242
|
-
return e.isSameDay(M,
|
|
2241
|
+
const [f, y, h] = m.split("-").map(Number), M = new Date(f, y - 1, h);
|
|
2242
|
+
return e.isSameDay(M, s);
|
|
2243
2243
|
});
|
|
2244
|
-
u !== -1 && (e.focusedDayIndex = u,
|
|
2244
|
+
u !== -1 && (e.focusedDayIndex = u, p.forEach((g) => g.classList.remove("drp-date-picker__day--focused")), p[u] && p[u].classList.add("drp-date-picker__day--focused"));
|
|
2245
2245
|
}
|
|
2246
2246
|
break;
|
|
2247
2247
|
}
|
|
@@ -2273,14 +2273,14 @@ function wn(e) {
|
|
|
2273
2273
|
function xn(e) {
|
|
2274
2274
|
e.options.selectionMode === "range" && e.calendar.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--disabled)").forEach((t) => {
|
|
2275
2275
|
t.addEventListener("mousedown", (n) => {
|
|
2276
|
-
const i = n,
|
|
2276
|
+
const i = n, r = t, o = i.clientX, s = i.clientY, d = 5;
|
|
2277
2277
|
let l = !1, c = !1;
|
|
2278
|
-
const
|
|
2279
|
-
let
|
|
2280
|
-
|
|
2281
|
-
const m = (
|
|
2282
|
-
const
|
|
2283
|
-
!l && (
|
|
2278
|
+
const p = r.classList.contains("drp-date-picker__day--range-start"), u = r.classList.contains("drp-date-picker__day--range-end");
|
|
2279
|
+
let g;
|
|
2280
|
+
p && e.selectedStartDate && e.selectedEndDate ? g = "start" : u && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
2281
|
+
const m = (y) => {
|
|
2282
|
+
const h = Math.abs(y.clientX - o), M = Math.abs(y.clientY - s);
|
|
2283
|
+
!l && (h > d || M > d) && (l = !0), l && !c && (c = !0, Ht(e, i, g, r), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", f));
|
|
2284
2284
|
}, f = () => {
|
|
2285
2285
|
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", f);
|
|
2286
2286
|
};
|
|
@@ -2290,15 +2290,15 @@ function xn(e) {
|
|
|
2290
2290
|
}
|
|
2291
2291
|
function Ht(e, a, t, n) {
|
|
2292
2292
|
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t;
|
|
2293
|
-
const i = n,
|
|
2293
|
+
const i = n, r = i.dataset.date;
|
|
2294
2294
|
let o = null;
|
|
2295
|
-
if (
|
|
2296
|
-
const [
|
|
2297
|
-
o = new Date(
|
|
2295
|
+
if (r) {
|
|
2296
|
+
const [s, d, l] = r.split("-").map(Number);
|
|
2297
|
+
o = new Date(s, d - 1, l);
|
|
2298
2298
|
}
|
|
2299
2299
|
!e.selectedStartDate && !e.selectedEndDate ? o && (e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : o && e.selectedStartDate && !e.selectedEndDate ? o.getTime() === e.selectedStartDate.getTime() ? (e.originalStartDate = new Date(e.selectedStartDate), e.originalEndDate = null) : (e.selectedStartDate = null, e.selectedEndDate = null, e.focusedDayIndex = null, e.calendar.querySelectorAll(".drp-date-picker__day--range-start, .drp-date-picker__day--range-end, .drp-date-picker__day--selected, .drp-date-picker__day--focused").forEach((d) => {
|
|
2300
2300
|
d.classList.remove("drp-date-picker__day--range-start", "drp-date-picker__day--range-end", "drp-date-picker__day--selected", "drp-date-picker__day--focused");
|
|
2301
|
-
}), e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), i.classList.add("drp-date-picker__day--dragging"), U.debug(`Started dragging ${t} date`), e.onDragMoveBound = (
|
|
2301
|
+
}), e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), i.classList.add("drp-date-picker__day--dragging"), U.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => Vt(e, s), e.onDragEndBound = async (s) => await qt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
2302
2302
|
}
|
|
2303
2303
|
function Vt(e, a) {
|
|
2304
2304
|
if (!e.isDragging) return;
|
|
@@ -2309,31 +2309,31 @@ function Vt(e, a) {
|
|
|
2309
2309
|
if (!e.navInterval) {
|
|
2310
2310
|
const u = (n || i).closest(".drp-date-picker__month");
|
|
2311
2311
|
if (u && u instanceof HTMLElement) {
|
|
2312
|
-
const
|
|
2313
|
-
m ? e.prevMonth(
|
|
2314
|
-
m ? e.prevMonth(
|
|
2312
|
+
const g = parseInt(u.dataset.monthIndex || "0"), m = !!n;
|
|
2313
|
+
m ? e.prevMonth(g) : e.nextMonth(g), e.navInterval = window.setInterval(() => {
|
|
2314
|
+
m ? e.prevMonth(g) : e.nextMonth(g);
|
|
2315
2315
|
}, 1e3);
|
|
2316
2316
|
}
|
|
2317
2317
|
}
|
|
2318
2318
|
return;
|
|
2319
2319
|
} else
|
|
2320
2320
|
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
const o =
|
|
2321
|
+
const r = t;
|
|
2322
|
+
if (!r || !r.classList.contains("drp-date-picker__day")) return;
|
|
2323
|
+
const o = r.dataset.date;
|
|
2324
2324
|
if (!o) return;
|
|
2325
|
-
const [
|
|
2326
|
-
let c = new Date(
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
c = $e(e, c,
|
|
2325
|
+
const [s, d, l] = o.split("-").map(Number);
|
|
2326
|
+
let c = new Date(s, d - 1, l);
|
|
2327
|
+
if (r.classList.contains("drp-date-picker__day--disabled")) {
|
|
2328
|
+
const p = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
2329
|
+
c = $e(e, c, p);
|
|
2330
2330
|
}
|
|
2331
2331
|
if (e.draggingType === "start" && e.originalEndDate ? (e.dragPreviewStart = c, e.dragPreviewEnd = e.originalEndDate, e.dragPreviewStart > e.dragPreviewEnd && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "end")) : e.originalStartDate && (e.dragPreviewStart = e.originalStartDate, e.dragPreviewEnd = c, e.dragPreviewEnd < e.dragPreviewStart && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "start")), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2332
|
-
const
|
|
2333
|
-
if (U.debug("onDragMove - mode:",
|
|
2332
|
+
const p = e.options.disabledDatesHandling;
|
|
2333
|
+
if (U.debug("onDragMove - mode:", p, "start:", e.dragPreviewStart, "end:", e.dragPreviewEnd), p === "prevent" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd)) {
|
|
2334
2334
|
U.debug("PREVENT mode - range contains disabled dates, blocking preview update");
|
|
2335
2335
|
return;
|
|
2336
|
-
} else if (
|
|
2336
|
+
} else if (p === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd)) {
|
|
2337
2337
|
if (U.debug("BLOCK mode - range contains disabled dates, adjusting preview"), e.draggingType === "start" && e.originalEndDate) {
|
|
2338
2338
|
const u = e.findLastEnabledBeforeGap(e.dragPreviewStart, e.originalEndDate);
|
|
2339
2339
|
U.debug("BLOCK mode - adjusted end (dragging start):", u), e.dragPreviewEnd = u;
|
|
@@ -2355,8 +2355,8 @@ async function qt(e, a) {
|
|
|
2355
2355
|
i.message && Y.warn("onDragEnd() - drag validation failed:", i.message);
|
|
2356
2356
|
else {
|
|
2357
2357
|
e.selectedStartDate = i.adjustedStart || t, e.selectedEndDate = i.adjustedEnd || n, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
2358
|
-
const
|
|
2359
|
-
e.requiresApplyButton() ? e.pendingSelection =
|
|
2358
|
+
const r = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2359
|
+
e.requiresApplyButton() ? e.pendingSelection = r : e.options.onSelect && e.options.onSelect(r);
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
2362
|
if (e.isDragging = !1, e.draggingType = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.calendar.querySelectorAll(".drp-date-picker__day--dragging").forEach((t) => {
|
|
@@ -2367,15 +2367,15 @@ async function qt(e, a) {
|
|
|
2367
2367
|
const i = e.monthDates[n];
|
|
2368
2368
|
if (t.getFullYear() === i.getFullYear() && t.getMonth() === i.getMonth()) {
|
|
2369
2369
|
e.activeMonthIndex = n;
|
|
2370
|
-
const
|
|
2371
|
-
if (
|
|
2372
|
-
const o =
|
|
2370
|
+
const r = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
2371
|
+
if (r) {
|
|
2372
|
+
const o = r.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(o).findIndex((d) => {
|
|
2373
2373
|
const l = d.dataset.date;
|
|
2374
2374
|
if (!l) return !1;
|
|
2375
|
-
const [c,
|
|
2376
|
-
return e.isSameDay(
|
|
2375
|
+
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
2376
|
+
return e.isSameDay(g, t);
|
|
2377
2377
|
});
|
|
2378
|
-
|
|
2378
|
+
s !== -1 && (e.focusedDayIndex = s, o.forEach((d) => d.classList.remove("drp-date-picker__day--focused")), o[s] && o[s].classList.add("drp-date-picker__day--focused"));
|
|
2379
2379
|
}
|
|
2380
2380
|
break;
|
|
2381
2381
|
}
|
|
@@ -2388,24 +2388,24 @@ function $e(e, a, t = "forward") {
|
|
|
2388
2388
|
let i = new Date(a);
|
|
2389
2389
|
if (i.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(i))
|
|
2390
2390
|
return i;
|
|
2391
|
-
const
|
|
2392
|
-
for (let
|
|
2391
|
+
const r = t === "forward" ? 1 : -1;
|
|
2392
|
+
for (let s = 1; s <= 60; s++) {
|
|
2393
2393
|
const d = new Date(a);
|
|
2394
|
-
if (d.setDate(d.getDate() +
|
|
2394
|
+
if (d.setDate(d.getDate() + s * r), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2395
2395
|
return d;
|
|
2396
2396
|
}
|
|
2397
|
-
const o = -
|
|
2398
|
-
for (let
|
|
2397
|
+
const o = -r;
|
|
2398
|
+
for (let s = 1; s <= 60; s++) {
|
|
2399
2399
|
const d = new Date(a);
|
|
2400
|
-
if (d.setDate(d.getDate() +
|
|
2400
|
+
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2401
2401
|
return d;
|
|
2402
2402
|
}
|
|
2403
2403
|
return a;
|
|
2404
2404
|
}
|
|
2405
2405
|
function Mn(e, a) {
|
|
2406
|
-
const t = a.target, n = t.value, i = t.selectionStart || 0,
|
|
2406
|
+
const t = a.target, n = t.value, i = t.selectionStart || 0, r = e._previousInputValue || "", o = n.length < r.length, { separator: s } = e.formatInfo;
|
|
2407
2407
|
if (e.options.selectionMode === "range") {
|
|
2408
|
-
const d = n.replace(new RegExp(`[^0-9${
|
|
2408
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l = Ut(e, d);
|
|
2409
2409
|
if (l !== n) {
|
|
2410
2410
|
t.value = l;
|
|
2411
2411
|
let c = i;
|
|
@@ -2413,65 +2413,65 @@ function Mn(e, a) {
|
|
|
2413
2413
|
c = i;
|
|
2414
2414
|
else if (l.length > n.length)
|
|
2415
2415
|
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
2416
|
-
const
|
|
2417
|
-
i >=
|
|
2416
|
+
const p = l.indexOf(" to ");
|
|
2417
|
+
i >= p && i <= p + 4 ? c = p + 4 : c = i + (l.length - n.length);
|
|
2418
2418
|
} else
|
|
2419
2419
|
c = i + (l.length - n.length);
|
|
2420
2420
|
t.setSelectionRange(c, c);
|
|
2421
2421
|
}
|
|
2422
2422
|
} else {
|
|
2423
|
-
const d = n.replace(new RegExp(`[^0-9${
|
|
2423
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l = pe(e, d);
|
|
2424
2424
|
if (l !== n) {
|
|
2425
2425
|
t.value = l;
|
|
2426
2426
|
let c = i;
|
|
2427
2427
|
if (o)
|
|
2428
2428
|
c = i;
|
|
2429
|
-
else if (l.length > n.length && l[i] ===
|
|
2429
|
+
else if (l.length > n.length && l[i] === s)
|
|
2430
2430
|
c = i + 1;
|
|
2431
2431
|
else if (l.length > n.length) {
|
|
2432
|
-
const
|
|
2433
|
-
c = i +
|
|
2432
|
+
const p = (n.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - p;
|
|
2433
|
+
c = i + g;
|
|
2434
2434
|
}
|
|
2435
2435
|
t.setSelectionRange(c, c);
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
2438
2438
|
e._previousInputValue = t.value, tt(e);
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2441
|
-
var c,
|
|
2442
|
-
const { separator: t, parts: n, maxLength: i } = e.formatInfo,
|
|
2440
|
+
function pe(e, a) {
|
|
2441
|
+
var c, p, u;
|
|
2442
|
+
const { separator: t, parts: n, maxLength: i } = e.formatInfo, r = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), o = n.year ? n.year.length : 4, s = [
|
|
2443
2443
|
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: o },
|
|
2444
|
-
{ type: "month", pos: ((
|
|
2444
|
+
{ type: "month", pos: ((p = n.month) == null ? void 0 : p.index) ?? 1, length: 2 },
|
|
2445
2445
|
{ type: "day", pos: ((u = n.day) == null ? void 0 : u.index) ?? 2, length: 2 }
|
|
2446
|
-
].sort((
|
|
2446
|
+
].sort((g, m) => g.pos - m.pos);
|
|
2447
2447
|
let d = "", l = 0;
|
|
2448
|
-
for (let
|
|
2449
|
-
const m =
|
|
2448
|
+
for (let g = 0; g < s.length; g++) {
|
|
2449
|
+
const m = s[g], f = r.substring(l, l + m.length);
|
|
2450
2450
|
if (!f) break;
|
|
2451
|
-
d += f, l += f.length,
|
|
2451
|
+
d += f, l += f.length, g < s.length - 1 && f.length === m.length && (d += t);
|
|
2452
2452
|
}
|
|
2453
2453
|
return d.substring(0, i);
|
|
2454
2454
|
}
|
|
2455
2455
|
function Ut(e, a) {
|
|
2456
2456
|
const { separator: t, maxLength: n } = e.formatInfo, i = " to ";
|
|
2457
|
-
let
|
|
2457
|
+
let r = "", o = "";
|
|
2458
2458
|
if (a.includes(i)) {
|
|
2459
2459
|
const d = a.split(i);
|
|
2460
|
-
|
|
2460
|
+
r = d[0], o = d.slice(1).join(i);
|
|
2461
2461
|
} else
|
|
2462
|
-
|
|
2463
|
-
const
|
|
2464
|
-
if (
|
|
2462
|
+
r = a;
|
|
2463
|
+
const s = pe(e, r);
|
|
2464
|
+
if (s.length === n)
|
|
2465
2465
|
if (a.includes(i)) {
|
|
2466
|
-
const d =
|
|
2467
|
-
return
|
|
2466
|
+
const d = pe(e, o);
|
|
2467
|
+
return s + i + d;
|
|
2468
2468
|
} else
|
|
2469
|
-
return
|
|
2469
|
+
return s + i;
|
|
2470
2470
|
else
|
|
2471
|
-
return
|
|
2471
|
+
return s;
|
|
2472
2472
|
}
|
|
2473
2473
|
function Sn(e, a) {
|
|
2474
|
-
const { key: t, ctrlKey: n, metaKey: i } = a, { separator:
|
|
2474
|
+
const { key: t, ctrlKey: n, metaKey: i } = a, { separator: r } = e.formatInfo;
|
|
2475
2475
|
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
2476
2476
|
a.preventDefault();
|
|
2477
2477
|
return;
|
|
@@ -2489,34 +2489,34 @@ function Sn(e, a) {
|
|
|
2489
2489
|
"Home",
|
|
2490
2490
|
"End"
|
|
2491
2491
|
].includes(t) || n || i)) {
|
|
2492
|
-
if (t ===
|
|
2493
|
-
const
|
|
2492
|
+
if (t === r) {
|
|
2493
|
+
const s = a.target, d = s.selectionStart || 0, l = s.value;
|
|
2494
2494
|
let c = 0;
|
|
2495
2495
|
for (let u = d - 1; u >= 0; u--)
|
|
2496
|
-
if (l[u] ===
|
|
2496
|
+
if (l[u] === r || l[u] === " ") {
|
|
2497
2497
|
c = u + 1;
|
|
2498
2498
|
break;
|
|
2499
2499
|
}
|
|
2500
|
-
const
|
|
2501
|
-
if (/^\d$/.test(
|
|
2500
|
+
const p = l.substring(c, d);
|
|
2501
|
+
if (/^\d$/.test(p)) {
|
|
2502
2502
|
a.preventDefault();
|
|
2503
|
-
const u = l.substring(0, c) + "0" +
|
|
2504
|
-
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2503
|
+
const u = l.substring(0, c) + "0" + p + r + l.substring(d);
|
|
2504
|
+
s.value = u;
|
|
2505
|
+
const g = c + 2 + r.length;
|
|
2506
|
+
s.setSelectionRange(g, g), e._previousInputValue = u, s.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
2507
2507
|
return;
|
|
2508
2508
|
}
|
|
2509
2509
|
}
|
|
2510
|
-
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !==
|
|
2510
|
+
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !== r && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== r && a.preventDefault();
|
|
2511
2511
|
}
|
|
2512
2512
|
}
|
|
2513
2513
|
function Cn(e, a) {
|
|
2514
2514
|
var u;
|
|
2515
2515
|
a.preventDefault();
|
|
2516
|
-
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo, i = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""),
|
|
2517
|
-
o.value =
|
|
2518
|
-
const
|
|
2519
|
-
o.setSelectionRange(
|
|
2516
|
+
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo, i = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), r = pe(e, i), o = a.target, s = o.selectionStart || 0, d = o.selectionEnd || 0, l = o.value, c = l.substring(0, s) + r + l.substring(d);
|
|
2517
|
+
o.value = pe(e, c);
|
|
2518
|
+
const p = s + r.length;
|
|
2519
|
+
o.setSelectionRange(p, p), o.dispatchEvent(new Event("input", { bubbles: !0 })), tt(e);
|
|
2520
2520
|
}
|
|
2521
2521
|
function tt(e) {
|
|
2522
2522
|
if (!e.input) return;
|
|
@@ -2524,42 +2524,42 @@ function tt(e) {
|
|
|
2524
2524
|
if (oe.debug("updateCalendarFromInput - value:", a), !a) return;
|
|
2525
2525
|
const { separator: t, parts: n, maxLength: i } = e.formatInfo;
|
|
2526
2526
|
if (oe.debug("Format info:", { separator: t, parts: n, maxLength: i }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
2527
|
-
const o = a.split(" to "),
|
|
2528
|
-
oe.debug("Range parts - start:",
|
|
2527
|
+
const o = a.split(" to "), s = o[0], d = o[1];
|
|
2528
|
+
oe.debug("Range parts - start:", s, "end:", d), Ce(e, s, "start"), d && Ce(e, d, "end");
|
|
2529
2529
|
return;
|
|
2530
2530
|
}
|
|
2531
|
-
const
|
|
2532
|
-
Ce(e, a,
|
|
2531
|
+
const r = e.options.selectionMode === "range" ? "start" : "single";
|
|
2532
|
+
Ce(e, a, r);
|
|
2533
2533
|
}
|
|
2534
2534
|
function Ce(e, a, t = "single") {
|
|
2535
|
-
const { separator: n, parts: i, maxLength:
|
|
2536
|
-
let
|
|
2537
|
-
if (o.forEach((c,
|
|
2535
|
+
const { separator: n, parts: i, maxLength: r } = e.formatInfo, o = a.split(n);
|
|
2536
|
+
let s = null, d = null, l = null;
|
|
2537
|
+
if (o.forEach((c, p) => {
|
|
2538
2538
|
if (c) {
|
|
2539
|
-
if (i.year && i.year.index ===
|
|
2539
|
+
if (i.year && i.year.index === p) {
|
|
2540
2540
|
const u = parseInt(c, 10);
|
|
2541
|
-
i.year.length === 4 && c.length === 4 ?
|
|
2542
|
-
} else if (i.month && i.month.index ===
|
|
2541
|
+
i.year.length === 4 && c.length === 4 ? s = u : i.year.length === 2 && c.length === 2 && (s = u < 100 ? u + 2e3 : u);
|
|
2542
|
+
} else if (i.month && i.month.index === p) {
|
|
2543
2543
|
const u = parseInt(c, 10);
|
|
2544
2544
|
c.length === 2 && u >= 1 && u <= 12 && (d = u);
|
|
2545
|
-
} else if (i.day && i.day.index ===
|
|
2545
|
+
} else if (i.day && i.day.index === p) {
|
|
2546
2546
|
const u = parseInt(c, 10);
|
|
2547
2547
|
c.length === 2 && u >= 1 && u <= 31 && (l = u);
|
|
2548
2548
|
}
|
|
2549
2549
|
}
|
|
2550
|
-
}), oe.debug(`parseAndUpdateSingleDate(${t}) - year:`,
|
|
2551
|
-
const c =
|
|
2550
|
+
}), oe.debug(`parseAndUpdateSingleDate(${t}) - year:`, s, "month:", d, "day:", l), s !== null || d !== null) {
|
|
2551
|
+
const c = s || (/* @__PURE__ */ new Date()).getFullYear(), p = d !== null ? d - 1 : (/* @__PURE__ */ new Date()).getMonth();
|
|
2552
2552
|
if (e.options.selectionMode === "single") {
|
|
2553
2553
|
e.monthDates = [];
|
|
2554
2554
|
for (let u = 0; u < e.options.visibleMonthsCount; u++) {
|
|
2555
|
-
const
|
|
2556
|
-
e.monthDates.push(
|
|
2555
|
+
const g = new Date(c, p + u, 1);
|
|
2556
|
+
e.monthDates.push(g);
|
|
2557
2557
|
}
|
|
2558
2558
|
} else if (e.options.selectionMode === "range" && (t === "start" || !e.selectedStartDate)) {
|
|
2559
2559
|
if (e.displayMonths = [
|
|
2560
|
-
{ month:
|
|
2560
|
+
{ month: p, year: c }
|
|
2561
2561
|
], e.options.visibleMonthsCount > 1) {
|
|
2562
|
-
const u = new Date(c,
|
|
2562
|
+
const u = new Date(c, p + 1, 1);
|
|
2563
2563
|
e.displayMonths.push({
|
|
2564
2564
|
month: u.getMonth(),
|
|
2565
2565
|
year: u.getFullYear()
|
|
@@ -2567,14 +2567,14 @@ function Ce(e, a, t = "single") {
|
|
|
2567
2567
|
}
|
|
2568
2568
|
e.monthDates = [];
|
|
2569
2569
|
for (let u = 0; u < e.options.visibleMonthsCount; u++) {
|
|
2570
|
-
const
|
|
2570
|
+
const g = e.displayMonths[u], m = new Date(g.year, g.month, 1);
|
|
2571
2571
|
e.monthDates.push(m);
|
|
2572
2572
|
}
|
|
2573
2573
|
}
|
|
2574
2574
|
e.renderCalendar();
|
|
2575
2575
|
}
|
|
2576
|
-
if (
|
|
2577
|
-
const c = new Date(
|
|
2576
|
+
if (s !== null && d !== null && l !== null) {
|
|
2577
|
+
const c = new Date(s, d - 1, l);
|
|
2578
2578
|
c.getMonth() === d - 1 && (t === "single" ? e.selectedDate = c : t === "start" ? e.selectedStartDate = c : t === "end" && (e.selectedEndDate = c), e.renderCalendar(), e.options.selectionMode === "range" && e.updateSummary(), oe.debug(`Set ${t} date:`, c));
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
@@ -2620,7 +2620,7 @@ const Ue = {
|
|
|
2620
2620
|
nights: "noches"
|
|
2621
2621
|
}
|
|
2622
2622
|
};
|
|
2623
|
-
function
|
|
2623
|
+
function Oe(e) {
|
|
2624
2624
|
if (e !== "auto")
|
|
2625
2625
|
return e;
|
|
2626
2626
|
if (typeof navigator < "u" && navigator.language) {
|
|
@@ -2630,16 +2630,16 @@ function ze(e) {
|
|
|
2630
2630
|
return "en";
|
|
2631
2631
|
}
|
|
2632
2632
|
function In(e, a) {
|
|
2633
|
-
const t =
|
|
2633
|
+
const t = Oe(e), n = Ue[t] || Ue.en;
|
|
2634
2634
|
return a ? { ...n, ...a } : n;
|
|
2635
2635
|
}
|
|
2636
2636
|
function En(e) {
|
|
2637
|
-
const a =
|
|
2637
|
+
const a = Oe(e);
|
|
2638
2638
|
try {
|
|
2639
2639
|
const t = new Intl.DateTimeFormat(a, { weekday: "short" }), n = [];
|
|
2640
2640
|
for (let i = 0; i < 7; i++) {
|
|
2641
|
-
const
|
|
2642
|
-
n.push(t.format(
|
|
2641
|
+
const r = new Date(2017, 0, i + 1);
|
|
2642
|
+
n.push(t.format(r));
|
|
2643
2643
|
}
|
|
2644
2644
|
return n;
|
|
2645
2645
|
} catch (t) {
|
|
@@ -2647,12 +2647,12 @@ function En(e) {
|
|
|
2647
2647
|
}
|
|
2648
2648
|
}
|
|
2649
2649
|
function Rn(e) {
|
|
2650
|
-
const a =
|
|
2650
|
+
const a = Oe(e);
|
|
2651
2651
|
try {
|
|
2652
2652
|
const t = new Intl.DateTimeFormat(a, { month: "long" }), n = [];
|
|
2653
2653
|
for (let i = 0; i < 12; i++) {
|
|
2654
|
-
const
|
|
2655
|
-
n.push(t.format(
|
|
2654
|
+
const r = new Date(2017, i, 1);
|
|
2655
|
+
n.push(t.format(r));
|
|
2656
2656
|
}
|
|
2657
2657
|
return n;
|
|
2658
2658
|
} catch (t) {
|
|
@@ -2672,90 +2672,90 @@ function Rn(e) {
|
|
|
2672
2672
|
];
|
|
2673
2673
|
}
|
|
2674
2674
|
}
|
|
2675
|
-
const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: .25rem;--drp-spacing-sm-base: .5rem;--drp-spacing-md-base: 1rem;--drp-spacing-lg-base: 1.5rem;--drp-spacing-xl-base: 2rem;--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: .625rem;--drp-font-size-xs-base: .75rem;--drp-font-size-sm-base: .875rem;--drp-font-size-base-base: 1rem;--drp-font-size-lg-base: 1.125rem;--drp-font-size-xl-base: 1.25rem;--drp-font-size-2xl-base: 1.5rem;--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-card-bg: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-accent-text-color: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-bg: #111827;--drp-tooltip-color: #ffffff;--drp-border-width-base: 1px;--drp-border-radius: .375rem;--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: .75rem;--drp-grid-columns: 3;--drp-grid-rows: 2}.drp-date-picker-input{position:relative;cursor:pointer}.drp-date-picker-input:after{content:"📅";position:absolute;right:var(--drp-input-padding-h);top:50%;transform:translateY(-50%);pointer-events:none;opacity:.6}.drp-date-picker{position:absolute;z-index:9500;background:var(--drp-card-bg);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-text-primary);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-primary-bg)}.drp-date-picker__month-year:active{background-color:var(--drp-primary-bg-hover)}.drp-date-picker__nav{width:calc(2rem * var(--drp-cell-scale));height:calc(2rem * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-text-primary)}.drp-date-picker__nav:hover{background-color:var(--drp-primary-bg);border-color:var(--drp-accent-color)}.drp-date-picker__nav:active{background-color:var(--drp-primary-bg-hover)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-primary-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-border-color);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-accent-color)}.drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:#f3f4f6}.drp-date-picker__rolling-item--selected{background-color:#3b82f6;color:#fff;font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-accent-color-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-text-primary);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-primary-bg)}.drp-date-picker__unified-range:active{background-color:var(--drp-primary-bg-hover)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-card-bg);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-primary-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-border-color);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-accent-color)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:#f3f4f6}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:#3b82f6;color:#fff;font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-accent-color-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-text-secondary);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-text-secondary)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-text-secondary);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-text-primary);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-primary-bg);border-color:var(--drp-accent-color)}.drp-date-picker__day--today{border-color:var(--drp-accent-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-accent-color);color:var(--drp-accent-text-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-accent-color-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-accent-color);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-text-secondary);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-text-secondary);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-accent-color);color:var(--drp-accent-text-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-accent-color) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-accent-color) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-accent-color) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-accent-color)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-accent-color) 60%,transparent);color:var(--drp-accent-text-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-text-secondary);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(1rem * var(--drp-cell-scale));min-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:#10b981;color:#fff;font-size:.7rem;font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:#ef4444;color:#fff;font-size:.7rem;font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:#6b7280;color:#fff;font-size:.65rem;font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-border-width-base) solid var(--drp-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-text-secondary)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-accent-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-primary-bg);border-color:var(--drp-accent-color)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-border-color)}.drp-date-picker__button--today{color:var(--drp-accent-color)}.drp-date-picker__button--clear{color:var(--drp-text-secondary)}.drp-date-picker__button--apply{background-color:var(--drp-accent-color);color:var(--drp-button-text-color);border-color:var(--drp-accent-color)}.drp-date-picker__button--apply:hover{background-color:var(--drp-accent-color-hover)}.drp-date-picker__button--cancel{color:var(--drp-text-secondary)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-bg);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:.375rem}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:#3b82f6;border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker.drp-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2675
|
+
const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: .25rem;--drp-spacing-sm-base: .5rem;--drp-spacing-md-base: 1rem;--drp-spacing-lg-base: 1.5rem;--drp-spacing-xl-base: 2rem;--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: .625rem;--drp-font-size-xs-base: .75rem;--drp-font-size-sm-base: .875rem;--drp-font-size-base-base: 1rem;--drp-font-size-lg-base: 1.125rem;--drp-font-size-xl-base: 1.25rem;--drp-font-size-2xl-base: 1.5rem;--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-card-bg: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-accent-text-color: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-bg: #111827;--drp-tooltip-color: #ffffff;--drp-border-width-base: 1px;--drp-border-radius: .375rem;--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: .75rem;--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-input-background: var(--drp-card-bg);--drp-input-color: var(--drp-text-primary);--drp-input-border-color: var(--drp-border-color);--drp-input-border-color-hover: var(--drp-accent-color);--drp-input-border-color-focus: var(--drp-accent-color);--drp-input-placeholder-color: var(--drp-text-secondary);--drp-input-disabled-background: var(--drp-primary-bg);--drp-input-focus-shadow-color: rgba(59, 130, 246, .1);--drp-input-focus-shadow-size: 3px;--drp-input-icon-opacity: .6;--drp-input-size-xs-font: .75rem;--drp-input-size-xs-padding-v: .25rem;--drp-input-size-xs-padding-h: .25rem;--drp-input-size-xs-height: 1.5rem;--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: .875rem;--drp-input-size-sm-padding-v: .25rem;--drp-input-size-sm-padding-h: .5rem;--drp-input-size-sm-height: 2rem;--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: 1rem;--drp-input-size-md-padding-v: .5rem;--drp-input-size-md-padding-h: .75rem;--drp-input-size-md-height: 2.5rem;--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: 1.125rem;--drp-input-size-lg-padding-v: 1rem;--drp-input-size-lg-padding-h: 1rem;--drp-input-size-lg-height: 3rem;--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: 1.25rem;--drp-input-size-xl-padding-v: 1rem;--drp-input-size-xl-padding-h: 1.5rem;--drp-input-size-xl-height: 3.5rem;--drp-input-size-xl-icon-size: 1.25em;--drp-header-text-color: var(--drp-text-primary);--drp-header-bg-hover: var(--drp-primary-bg);--drp-header-bg-active: var(--drp-primary-bg-hover);--drp-nav-text-color: var(--drp-text-primary);--drp-nav-border-color: var(--drp-border-color);--drp-nav-bg-hover: var(--drp-primary-bg);--drp-nav-bg-active: var(--drp-primary-bg-hover);--drp-nav-border-hover: var(--drp-accent-color);--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-thumb: var(--drp-border-color);--drp-rolling-scrollbar-thumb-hover: var(--drp-accent-color);--drp-rolling-item-bg-hover: var(--drp-primary-bg);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-accent-text-color);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-weekday-color: var(--drp-text-secondary);--drp-day-text-color: var(--drp-text-primary);--drp-day-bg-hover: var(--drp-primary-bg);--drp-day-border-hover: var(--drp-accent-color);--drp-day-today-border: var(--drp-accent-color);--drp-day-selected-bg: var(--drp-accent-color);--drp-day-selected-color: var(--drp-accent-text-color);--drp-day-selected-bg-hover: var(--drp-accent-color-hover);--drp-day-focused-outline: var(--drp-accent-color);--drp-day-disabled-color: var(--drp-text-secondary);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-accent-text-color);--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-today-color: var(--drp-accent-color);--drp-button-clear-color: var(--drp-text-secondary);--drp-button-cancel-color: var(--drp-text-secondary);--drp-button-apply-bg: var(--drp-accent-color);--drp-button-apply-color: var(--drp-button-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-accent-text-color);--drp-badge-count-bg: #ef4444;--drp-badge-count-color: #ffffff;--drp-badge-text-bg: var(--drp-text-secondary);--drp-badge-text-color: #ffffff;--drp-unified-range-text-color: var(--drp-text-primary);--drp-unified-range-bg-hover: var(--drp-primary-bg);--drp-unified-range-bg-active: var(--drp-primary-bg-hover);--drp-unified-month-color: var(--drp-text-secondary);--drp-unified-rolling-disabled-color: var(--drp-text-secondary)}.drp-input{width:100%;font-family:inherit;font-size:var(--drp-input-size-md-font);line-height:1.5;color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-border-width-base) solid var(--drp-input-border-color);border-radius:var(--drp-border-radius);padding:var(--drp-input-size-md-padding-v) var(--drp-input-size-md-padding-h);padding-right:calc(var(--drp-input-size-md-padding-h) * 2.5);height:var(--drp-input-size-md-height);box-sizing:border-box;transition:border-color var(--drp-transition-fast) var(--drp-easing-snappy),box-shadow var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-input::placeholder{color:var(--drp-input-placeholder-color);opacity:.6}.drp-input:hover:not(:disabled){border-color:var(--drp-input-border-color-hover)}.drp-input:focus{outline:none;border-color:var(--drp-input-border-color-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--drp-input-disabled-background)}.drp-input.drp-input--xs{font-size:var(--drp-input-size-xs-font);padding:var(--drp-input-size-xs-padding-v) var(--drp-input-size-xs-padding-h);padding-right:calc(var(--drp-input-size-xs-padding-h) * 2.5);height:var(--drp-input-size-xs-height)}.drp-input.drp-input--sm{font-size:var(--drp-input-size-sm-font);padding:var(--drp-input-size-sm-padding-v) var(--drp-input-size-sm-padding-h);padding-right:calc(var(--drp-input-size-sm-padding-h) * 2.5);height:var(--drp-input-size-sm-height)}.drp-input.drp-input--lg{font-size:var(--drp-input-size-lg-font);padding:var(--drp-input-size-lg-padding-v) var(--drp-input-size-lg-padding-h);padding-right:calc(var(--drp-input-size-lg-padding-h) * 2.5);height:var(--drp-input-size-lg-height)}.drp-input.drp-input--xl{font-size:var(--drp-input-size-xl-font);padding:var(--drp-input-size-xl-padding-v) var(--drp-input-size-xl-padding-h);padding-right:calc(var(--drp-input-size-xl-padding-h) * 2.5);height:var(--drp-input-size-xl-height)}.drp-date-picker-input{position:relative;cursor:pointer;display:inline-block;width:100%}.drp-date-picker-input:after{content:"📅";position:absolute;right:var(--drp-input-size-md-padding-h);top:50%;transform:translateY(-50%);pointer-events:none;opacity:var(--drp-input-icon-opacity);font-size:var(--drp-input-size-md-icon-size)}.drp-date-picker-input.drp-date-picker-input--xs:after{right:var(--drp-input-size-xs-padding-h);font-size:var(--drp-input-size-xs-icon-size)}.drp-date-picker-input.drp-date-picker-input--sm:after{right:var(--drp-input-size-sm-padding-h);font-size:var(--drp-input-size-sm-icon-size)}.drp-date-picker-input.drp-date-picker-input--lg:after{right:var(--drp-input-size-lg-padding-h);font-size:var(--drp-input-size-lg-icon-size)}.drp-date-picker-input.drp-date-picker-input--xl:after{right:var(--drp-input-size-xl-padding-h);font-size:var(--drp-input-size-xl-icon-size)}.drp-date-picker{position:absolute;z-index:9500;background:var(--drp-card-bg);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-header-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-header-bg-hover)}.drp-date-picker__month-year:active{background-color:var(--drp-header-bg-active)}.drp-date-picker__nav{width:calc(2rem * var(--drp-cell-scale));height:calc(2rem * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-nav-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-nav-text-color)}.drp-date-picker__nav:hover{background-color:var(--drp-nav-bg-hover);border-color:var(--drp-nav-border-hover)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-nav-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-unified-range-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-unified-range-bg-hover)}.drp-date-picker__unified-range:active{background-color:var(--drp-unified-range-bg-active)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-card-bg);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-unified-month-color)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-weekday-color);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-day-text-color);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-day-bg-hover);border-color:var(--drp-day-border-hover)}.drp-date-picker__day--today{border-color:var(--drp-day-today-border);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-day-selected-bg);color:var(--drp-day-selected-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-day-selected-bg-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-day-focused-outline);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-day-range-bg);color:var(--drp-day-range-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-day-range-bg) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-day-range-bg)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-day-range-bg) 60%,transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(1rem * var(--drp-cell-scale));min-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size:.7rem;font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:var(--drp-badge-count-bg);color:var(--drp-badge-count-color);font-size:.7rem;font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:var(--drp-badge-text-bg);color:var(--drp-badge-text-color);font-size:.65rem;font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-summary-text-color)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-summary-count-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-button-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-color:var(--drp-button-border-hover)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-button-border-color)}.drp-date-picker__button--today{color:var(--drp-button-today-color)}.drp-date-picker__button--clear{color:var(--drp-button-clear-color)}.drp-date-picker__button--apply{background-color:var(--drp-button-apply-bg);color:var(--drp-button-apply-color);border-color:var(--drp-button-apply-border)}.drp-date-picker__button--apply:hover{background-color:var(--drp-button-apply-bg-hover)}.drp-date-picker__button--cancel{color:var(--drp-button-cancel-color)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-bg);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:.375rem}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:#3b82f6;border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker.drp-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2676
2676
|
constructor(a, t = {}) {
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2677
|
+
b(this, "input");
|
|
2678
|
+
b(this, "options");
|
|
2679
|
+
b(this, "formatInfo");
|
|
2680
|
+
b(this, "_previousInputValue");
|
|
2681
|
+
b(this, "currentDate");
|
|
2682
|
+
b(this, "monthDates");
|
|
2683
|
+
b(this, "displayMonths");
|
|
2684
|
+
b(this, "selectedDate");
|
|
2685
|
+
b(this, "selectedStartDate");
|
|
2686
|
+
b(this, "selectedEndDate");
|
|
2687
|
+
b(this, "selectedRanges");
|
|
2688
|
+
b(this, "selectedDates");
|
|
2689
|
+
b(this, "pendingSelection");
|
|
2690
2690
|
// Stores uncommitted selection when Apply button is required
|
|
2691
2691
|
// State for deferred commit when Apply button is required
|
|
2692
|
-
|
|
2692
|
+
b(this, "originalInputValue", null);
|
|
2693
2693
|
// Stores input value when calendar opens (for restore on close without Apply)
|
|
2694
|
-
|
|
2694
|
+
b(this, "committedDate", null);
|
|
2695
2695
|
// Last committed single date
|
|
2696
|
-
|
|
2696
|
+
b(this, "committedStartDate", null);
|
|
2697
2697
|
// Last committed range start
|
|
2698
|
-
|
|
2698
|
+
b(this, "committedEndDate", null);
|
|
2699
2699
|
// Last committed range end
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2700
|
+
b(this, "focusedDayIndex");
|
|
2701
|
+
b(this, "activeMonthIndex");
|
|
2702
|
+
b(this, "showingRollingSelector");
|
|
2703
|
+
b(this, "draggingType");
|
|
2704
|
+
b(this, "isDragging");
|
|
2705
|
+
b(this, "dragStartDate");
|
|
2706
|
+
b(this, "originalStartDate");
|
|
2707
|
+
b(this, "originalEndDate");
|
|
2708
|
+
b(this, "dragPreviewStart");
|
|
2709
|
+
b(this, "dragPreviewEnd");
|
|
2710
|
+
b(this, "autoScrollInterval");
|
|
2711
|
+
b(this, "navInterval");
|
|
2712
|
+
b(this, "calendar");
|
|
2713
|
+
b(this, "containerElement");
|
|
2714
|
+
b(this, "onDragMoveBound");
|
|
2715
|
+
b(this, "onDragEndBound");
|
|
2716
|
+
b(this, "clickOutsideHandler");
|
|
2717
|
+
b(this, "isFirstRender", !0);
|
|
2718
|
+
b(this, "lockedPlacement");
|
|
2719
2719
|
// Store the initial placement to prevent jumping
|
|
2720
|
-
|
|
2720
|
+
b(this, "calendarContentHeight");
|
|
2721
2721
|
// Store calendar height for rolling selector
|
|
2722
|
-
|
|
2722
|
+
b(this, "calendarContentWidth");
|
|
2723
2723
|
// Store calendar width for rolling selector
|
|
2724
|
-
|
|
2724
|
+
b(this, "isCalendarActive", !1);
|
|
2725
2725
|
// Track if this calendar is actively focused (for inline mode)
|
|
2726
2726
|
// Async validation state
|
|
2727
|
-
|
|
2728
|
-
|
|
2727
|
+
b(this, "isValidating", !1);
|
|
2728
|
+
b(this, "loadingOverlay");
|
|
2729
2729
|
// Month change callback state
|
|
2730
|
-
|
|
2731
|
-
|
|
2730
|
+
b(this, "isMonthChanging", !1);
|
|
2731
|
+
b(this, "bulkMetadataCache", null);
|
|
2732
2732
|
// Unified navigation state
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2733
|
+
b(this, "unifiedHeader");
|
|
2734
|
+
b(this, "unifiedRangeDisplay");
|
|
2735
|
+
b(this, "unifiedRollingSelector");
|
|
2736
|
+
b(this, "showingUnifiedRollingSelector", !1);
|
|
2737
2737
|
// Floating UI tooltips
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2738
|
+
b(this, "tooltip");
|
|
2739
|
+
b(this, "tooltipArrow");
|
|
2740
|
+
b(this, "currentTooltipTarget");
|
|
2741
2741
|
// Action button tooltips
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2742
|
+
b(this, "actionButtonTooltips", /* @__PURE__ */ new Map());
|
|
2743
|
+
b(this, "actionButtonTooltipCleanups", /* @__PURE__ */ new Map());
|
|
2744
|
+
b(this, "actionsContainer", null);
|
|
2745
2745
|
// Week start and date restrictions
|
|
2746
|
-
|
|
2746
|
+
b(this, "weekStartDay", 0);
|
|
2747
2747
|
// 0 = Sunday, 1 = Monday, etc.
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2748
|
+
b(this, "normalizedMinDate", null);
|
|
2749
|
+
b(this, "normalizedMaxDate", null);
|
|
2750
|
+
b(this, "normalizedDisabledDates", /* @__PURE__ */ new Set());
|
|
2751
2751
|
// Store as 'YYYY-MM-DD' strings
|
|
2752
|
-
|
|
2752
|
+
b(this, "normalizedSpecialDates", /* @__PURE__ */ new Map());
|
|
2753
2753
|
// Store as 'YYYY-MM-DD' -> DecoratedDate
|
|
2754
2754
|
// Internationalization
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2755
|
+
b(this, "locale", "en");
|
|
2756
|
+
b(this, "localeStrings");
|
|
2757
|
+
b(this, "weekdayNames", []);
|
|
2758
|
+
b(this, "monthNames", []);
|
|
2759
2759
|
if (this.input = a, this.containerElement = t.container || document.body, this.options = {
|
|
2760
2760
|
selectionMode: t.selectionMode || "single",
|
|
2761
2761
|
calendarPlacement: t.calendarPlacement || (t.monthLayout === "grid" ? "bottom" : "bottom-start"),
|
|
@@ -2813,26 +2813,26 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2813
2813
|
const i = this.options.visibleMonthsCount - 1;
|
|
2814
2814
|
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > i) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2815
2815
|
}
|
|
2816
|
-
this.weekStartDay = Xt(this.options.weekStartDay),
|
|
2816
|
+
this.weekStartDay = Xt(this.options.weekStartDay), k.debug("Week starts on day:", this.weekStartDay), k.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale = Oe(this.options.locale), this.localeStrings = In(this.locale, this.options.customStrings), this.weekdayNames = En(this.locale), this.monthNames = this.options.monthNames || Rn(this.locale), k.debug("Locale:", this.locale, "Weekdays:", this.weekdayNames, "Months:", this.monthNames), this.initializeDateRestrictions(), this.formatInfo = this.parseFormat(this.options.dateFormatMask), k.debug("Format info:", this.formatInfo), this._previousInputValue = "", this.currentDate = /* @__PURE__ */ new Date();
|
|
2817
2817
|
let n;
|
|
2818
2818
|
if (this.options.initialDate)
|
|
2819
|
-
n =
|
|
2819
|
+
n = he(this.options.initialDate) || /* @__PURE__ */ new Date(), k.debug(`Using initialDate: ${n.toISOString()}`);
|
|
2820
2820
|
else if (this.options.rollingYearRange || this.options.rollingMonthRange) {
|
|
2821
|
-
const i = this.getEffectiveYearRange(),
|
|
2822
|
-
n = new Date(o,
|
|
2823
|
-
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate),
|
|
2821
|
+
const i = this.getEffectiveYearRange(), r = this.getEffectiveMonthRange(), o = i.min, s = r.min - 1;
|
|
2822
|
+
n = new Date(o, s, 1), k.debug(`Using first allowed year/month as initial: ${n.toISOString()}`);
|
|
2823
|
+
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate), k.debug(`Using minDate as initial: ${n.toISOString()}`)) : this.normalizedMaxDate && this.normalizedMaxDate < /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMaxDate), k.debug(`Using maxDate as initial: ${n.toISOString()}`)) : (n = /* @__PURE__ */ new Date(), k.debug(`Using current date as initial: ${n.toISOString()}`));
|
|
2824
2824
|
this.monthDates = [];
|
|
2825
2825
|
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2826
|
-
const
|
|
2827
|
-
this.monthDates.push(
|
|
2826
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2827
|
+
this.monthDates.push(r), k.debug(`monthDates[${i}] = ${r.getFullYear()}-${r.getMonth() + 1}`);
|
|
2828
2828
|
}
|
|
2829
2829
|
if (this.options.selectionMode === "range") {
|
|
2830
2830
|
this.displayMonths = [];
|
|
2831
2831
|
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2832
|
-
const
|
|
2832
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2833
2833
|
this.displayMonths.push({
|
|
2834
|
-
month:
|
|
2835
|
-
year:
|
|
2834
|
+
month: r.getMonth(),
|
|
2835
|
+
year: r.getFullYear()
|
|
2836
2836
|
});
|
|
2837
2837
|
}
|
|
2838
2838
|
}
|
|
@@ -2842,14 +2842,14 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2842
2842
|
this.draggingType = null, this.isDragging = !1, this.dragStartDate = null, this.originalStartDate = null, this.originalEndDate = null, this.dragPreviewStart = null, this.dragPreviewEnd = null, this.autoScrollInterval = null, this.init();
|
|
2843
2843
|
}
|
|
2844
2844
|
init() {
|
|
2845
|
-
|
|
2845
|
+
k.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (k.debug("Parsing pre-filled value:", this.input.value), this.updateCalendarFromInput())), this.options.positioningMode === "inline" && (this.renderCalendar(), this.calendar.classList.add("drp-date-picker--visible", "drp-date-picker--inline"), this.isCalendarActive = !0, this.isFirstRender = !1, Tt(this), this.clickOutsideHandler && document.addEventListener("click", this.clickOutsideHandler)), k.debug("Init complete");
|
|
2846
2846
|
}
|
|
2847
2847
|
/**
|
|
2848
2848
|
* Initialize and normalize date restrictions
|
|
2849
2849
|
*/
|
|
2850
2850
|
initializeDateRestrictions() {
|
|
2851
|
-
if (this.options.minDate && (this.normalizedMinDate =
|
|
2852
|
-
const t =
|
|
2851
|
+
if (this.options.minDate && (this.normalizedMinDate = he(this.options.minDate)), this.options.maxDate && (this.normalizedMaxDate = he(this.options.maxDate)), this.options.disabledDates && this.options.disabledDates.length > 0 && this.options.disabledDates.forEach((a) => {
|
|
2852
|
+
const t = he(a);
|
|
2853
2853
|
if (t) {
|
|
2854
2854
|
const n = me(t);
|
|
2855
2855
|
this.normalizedDisabledDates.add(n);
|
|
@@ -2857,7 +2857,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2857
2857
|
}), this.options.specialDates && this.options.specialDates.length > 0) {
|
|
2858
2858
|
const a = this.options.dateMember || "date";
|
|
2859
2859
|
this.options.specialDates.forEach((t) => {
|
|
2860
|
-
const n =
|
|
2860
|
+
const n = he(t[a]);
|
|
2861
2861
|
if (n) {
|
|
2862
2862
|
const i = me(n);
|
|
2863
2863
|
this.normalizedSpecialDates.set(i, t);
|
|
@@ -2901,8 +2901,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2901
2901
|
return;
|
|
2902
2902
|
const i = document.createElement("button");
|
|
2903
2903
|
i.className = `drp-date-picker__button drp-date-picker__button--${n.action}`;
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2904
|
+
const r = n.getClassCallback ? n.getClassCallback(this) : n.cssClass;
|
|
2905
|
+
r && (Array.isArray(r) ? i.classList.add(...r) : i.classList.add(r));
|
|
2906
2906
|
const o = n.getTextCallback ? n.getTextCallback(this) : n.text;
|
|
2907
2907
|
i.innerHTML = o, (n.isDisabledCallback ? n.isDisabledCallback(this) : n.isDisabled ?? !1) && (i.disabled = !0), i.dataset.action = n.action, n.onClick && (i._customOnClick = n.onClick), a.appendChild(i);
|
|
2908
2908
|
}), this.attachActionButtonTooltips();
|
|
@@ -2933,10 +2933,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2933
2933
|
if (!i) return;
|
|
2934
2934
|
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === i);
|
|
2935
2935
|
if (!o) return;
|
|
2936
|
-
let
|
|
2937
|
-
if (o.getTooltipCallback ?
|
|
2936
|
+
let s;
|
|
2937
|
+
if (o.getTooltipCallback ? s = o.getTooltipCallback(this) : s = o.tooltip, !s) return;
|
|
2938
2938
|
const d = `action-${i}-${Date.now()}-${Math.random()}`;
|
|
2939
|
-
this.createActionButtonTooltip(n,
|
|
2939
|
+
this.createActionButtonTooltip(n, s, d);
|
|
2940
2940
|
});
|
|
2941
2941
|
}
|
|
2942
2942
|
/**
|
|
@@ -2945,13 +2945,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2945
2945
|
createActionButtonTooltip(a, t, n) {
|
|
2946
2946
|
const i = document.createElement("div");
|
|
2947
2947
|
i.className = "drp-date-picker__tooltip", i.textContent = t, (this.options.container || document.body).appendChild(i), this.actionButtonTooltips.set(n, i);
|
|
2948
|
-
let o,
|
|
2948
|
+
let o, s;
|
|
2949
2949
|
const d = () => {
|
|
2950
|
-
clearTimeout(
|
|
2950
|
+
clearTimeout(s), o = window.setTimeout(() => {
|
|
2951
2951
|
i.classList.add("drp-date-picker__tooltip--visible"), this.positionActionButtonTooltip(a, i, n);
|
|
2952
2952
|
}, 300);
|
|
2953
2953
|
}, l = () => {
|
|
2954
|
-
clearTimeout(o),
|
|
2954
|
+
clearTimeout(o), s = window.setTimeout(() => {
|
|
2955
2955
|
i.classList.remove("drp-date-picker__tooltip--visible");
|
|
2956
2956
|
const c = this.actionButtonTooltipCleanups.get(n);
|
|
2957
2957
|
c && (c(), this.actionButtonTooltipCleanups.delete(n));
|
|
@@ -2963,19 +2963,19 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2963
2963
|
* Position action button tooltip using Floating UI
|
|
2964
2964
|
*/
|
|
2965
2965
|
async positionActionButtonTooltip(a, t, n) {
|
|
2966
|
-
const { computePosition: i, flip:
|
|
2966
|
+
const { computePosition: i, flip: r, shift: o, offset: s, autoUpdate: d } = await Promise.resolve().then(() => en), l = d(a, t, () => {
|
|
2967
2967
|
i(a, t, {
|
|
2968
2968
|
placement: "top",
|
|
2969
2969
|
strategy: "fixed",
|
|
2970
2970
|
middleware: [
|
|
2971
|
-
|
|
2972
|
-
|
|
2971
|
+
s(8),
|
|
2972
|
+
r(),
|
|
2973
2973
|
o({ padding: 8 })
|
|
2974
2974
|
]
|
|
2975
|
-
}).then(({ x: c, y:
|
|
2975
|
+
}).then(({ x: c, y: p }) => {
|
|
2976
2976
|
Object.assign(t.style, {
|
|
2977
2977
|
left: `${c}px`,
|
|
2978
|
-
top: `${
|
|
2978
|
+
top: `${p}px`
|
|
2979
2979
|
});
|
|
2980
2980
|
});
|
|
2981
2981
|
});
|
|
@@ -2998,8 +2998,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2998
2998
|
const t = this.getEffectiveYearRange(), n = a.getFullYear();
|
|
2999
2999
|
if (n < t.min || n > t.max)
|
|
3000
3000
|
return !0;
|
|
3001
|
-
const i = this.getEffectiveMonthRange(),
|
|
3002
|
-
return
|
|
3001
|
+
const i = this.getEffectiveMonthRange(), r = a.getMonth() + 1;
|
|
3002
|
+
return r < i.min || r > i.max ? !0 : Jt(
|
|
3003
3003
|
a,
|
|
3004
3004
|
this.normalizedMinDate,
|
|
3005
3005
|
this.normalizedMaxDate,
|
|
@@ -3029,13 +3029,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3029
3029
|
};
|
|
3030
3030
|
}
|
|
3031
3031
|
if (this.normalizedSpecialDates.has(t)) {
|
|
3032
|
-
const n = this.normalizedSpecialDates.get(t), i = this.options.badgeTextMember || "badgeText",
|
|
3032
|
+
const n = this.normalizedSpecialDates.get(t), i = this.options.badgeTextMember || "badgeText", r = this.options.badgeClassMember || "badgeClass", o = this.options.dayClassMember || "dayClass", s = this.options.badgeTooltipMember || "badgeTooltip", d = this.options.dayTooltipMember || "dayTooltip", l = this.options.isDisabledMember || "isDisabled";
|
|
3033
3033
|
return {
|
|
3034
3034
|
isDisabled: n[l] !== void 0 ? n[l] : this.isDateDisabledInternal(a),
|
|
3035
|
-
badgeClass: n[
|
|
3035
|
+
badgeClass: n[r],
|
|
3036
3036
|
dayClass: n[o],
|
|
3037
3037
|
badgeText: n[i],
|
|
3038
|
-
badgeTooltip: n[
|
|
3038
|
+
badgeTooltip: n[s],
|
|
3039
3039
|
dayTooltip: n[d]
|
|
3040
3040
|
};
|
|
3041
3041
|
}
|
|
@@ -3075,7 +3075,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3075
3075
|
return ut(a);
|
|
3076
3076
|
}
|
|
3077
3077
|
isSameDay(a, t) {
|
|
3078
|
-
return
|
|
3078
|
+
return pt(a, t);
|
|
3079
3079
|
}
|
|
3080
3080
|
isInRange(a) {
|
|
3081
3081
|
return na(a, this.selectedStartDate, this.selectedEndDate);
|
|
@@ -3095,7 +3095,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3095
3095
|
return this.options.selectionMode === "multiple" ? !1 : this.options.autoClose === "selection";
|
|
3096
3096
|
}
|
|
3097
3097
|
createCalendar() {
|
|
3098
|
-
if (
|
|
3098
|
+
if (k.debug("Creating calendar"), this.calendar = document.createElement("div"), this.calendar.className = "drp-date-picker", this.options.unifiedNavigation && this.calendar.classList.add("drp-date-picker--unified-nav"), this.options.unifiedNavigation) {
|
|
3099
3099
|
this.unifiedHeader = document.createElement("div"), this.unifiedHeader.className = "drp-date-picker__unified-header";
|
|
3100
3100
|
const n = this.options.unifiedHeaderInteractive ? "" : " drp-date-picker__unified-range--static", i = this.options.unifiedHeaderInteractive ? ' data-action="toggle-unified-rolling"' : "";
|
|
3101
3101
|
this.unifiedHeader.innerHTML = `
|
|
@@ -3112,7 +3112,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3112
3112
|
for (let n = 0; n < this.options.visibleMonthsCount; n++) {
|
|
3113
3113
|
const i = document.createElement("div");
|
|
3114
3114
|
i.className = "drp-date-picker__month", i.dataset.monthIndex = String(n);
|
|
3115
|
-
const
|
|
3115
|
+
const r = this.options.unifiedNavigation ? `<div class="drp-date-picker__header drp-date-picker__header--static">
|
|
3116
3116
|
<div class="drp-date-picker__month-year"></div>
|
|
3117
3117
|
</div>` : `<div class="drp-date-picker__header">
|
|
3118
3118
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="prev" data-month-index="${n}"></button>
|
|
@@ -3120,7 +3120,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3120
3120
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="next" data-month-index="${n}"></button>
|
|
3121
3121
|
</div>`;
|
|
3122
3122
|
i.innerHTML = `
|
|
3123
|
-
${
|
|
3123
|
+
${r}
|
|
3124
3124
|
<div class="drp-date-picker__calendar-container">
|
|
3125
3125
|
<div class="drp-date-picker__rolling-selector" data-month-index="${n}">
|
|
3126
3126
|
<div class="drp-date-picker__rolling-list" data-list="years" data-month-index="${n}"></div>
|
|
@@ -3136,33 +3136,33 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3136
3136
|
n.className = "drp-date-picker__summary drp-date-picker__summary--hidden", this.calendar.appendChild(n);
|
|
3137
3137
|
}
|
|
3138
3138
|
const t = document.createElement("div");
|
|
3139
|
-
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar),
|
|
3139
|
+
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar), k.debug("Calendar appended to container:", this.calendar), this.tooltip = document.createElement("div"), this.tooltip.className = "drp-date-picker__tooltip", this.tooltipArrow = document.createElement("div"), this.tooltipArrow.className = "drp-date-picker__tooltip-arrow", this.tooltip.appendChild(this.tooltipArrow), this.containerElement.appendChild(this.tooltip), this.attachCalendarListeners(), this.showingRollingSelector = new Array(this.options.visibleMonthsCount).fill(!1);
|
|
3140
3140
|
}
|
|
3141
3141
|
attachInputListeners() {
|
|
3142
3142
|
if (!this.input) return;
|
|
3143
|
-
|
|
3143
|
+
k.debug("Attaching input listeners");
|
|
3144
3144
|
const a = this.options.calendarOpenTrigger || "focus";
|
|
3145
3145
|
a === "focus" ? this.input.addEventListener("focus", () => {
|
|
3146
|
-
|
|
3146
|
+
k.debug("Input focused - opening calendar"), this.show();
|
|
3147
3147
|
}) : a === "typing" && this.input.addEventListener("input", (t) => {
|
|
3148
|
-
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (
|
|
3148
|
+
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (k.debug("User started typing - opening calendar"), this.show());
|
|
3149
3149
|
}), this.input.addEventListener("input", (t) => this.handleInputMask(t)), this.input.addEventListener("keydown", (t) => this.handleKeydown(t)), this.input.addEventListener("paste", (t) => this.handlePaste(t));
|
|
3150
3150
|
}
|
|
3151
3151
|
attachCalendarListeners() {
|
|
3152
3152
|
this.calendar.addEventListener("click", async (a) => {
|
|
3153
3153
|
const t = a.target;
|
|
3154
3154
|
a.stopPropagation();
|
|
3155
|
-
const n = t.dataset.action, i = t.dataset.monthIndex,
|
|
3155
|
+
const n = t.dataset.action, i = t.dataset.monthIndex, r = i ? parseInt(i) : 0;
|
|
3156
3156
|
if (n === "prev" || n === "next" || n === "unified-prev" || n === "unified-next") {
|
|
3157
3157
|
const o = t;
|
|
3158
3158
|
if (o.disabled || o.classList.contains("drp-date-picker__nav--disabled"))
|
|
3159
3159
|
return;
|
|
3160
3160
|
}
|
|
3161
|
-
if (n === "prev") this.prevMonth(
|
|
3162
|
-
else if (n === "next") this.nextMonth(
|
|
3161
|
+
if (n === "prev") this.prevMonth(r);
|
|
3162
|
+
else if (n === "next") this.nextMonth(r);
|
|
3163
3163
|
else if (n === "unified-prev") this.unifiedPrevMonth();
|
|
3164
3164
|
else if (n === "unified-next") this.unifiedNextMonth();
|
|
3165
|
-
else if (n === "toggle-rolling") this.toggleRollingSelector(
|
|
3165
|
+
else if (n === "toggle-rolling") this.toggleRollingSelector(r);
|
|
3166
3166
|
else if (n === "toggle-unified-rolling") this.toggleUnifiedRollingSelector();
|
|
3167
3167
|
else if (n === "today") this.selectToday();
|
|
3168
3168
|
else if (n === "clear") this.clearSelection();
|
|
@@ -3176,39 +3176,39 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3176
3176
|
const o = t.closest("[data-year]");
|
|
3177
3177
|
if (o.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3178
3178
|
return;
|
|
3179
|
-
const
|
|
3179
|
+
const s = o.dataset.year;
|
|
3180
3180
|
if (o.dataset.unified === "true")
|
|
3181
|
-
|
|
3181
|
+
s && this.setUnifiedYear(parseInt(s));
|
|
3182
3182
|
else {
|
|
3183
3183
|
const d = o.dataset.monthIndex;
|
|
3184
|
-
|
|
3184
|
+
s && d && this.selectYear(parseInt(s), parseInt(d));
|
|
3185
3185
|
}
|
|
3186
3186
|
} else if (t.closest("[data-month]")) {
|
|
3187
3187
|
const o = t.closest("[data-month]");
|
|
3188
3188
|
if (o.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3189
3189
|
return;
|
|
3190
|
-
const
|
|
3190
|
+
const s = o.dataset.month;
|
|
3191
3191
|
if (o.dataset.unified === "true")
|
|
3192
|
-
|
|
3192
|
+
s && this.setUnifiedMonth(parseInt(s));
|
|
3193
3193
|
else {
|
|
3194
3194
|
const d = o.dataset.monthIndex;
|
|
3195
|
-
|
|
3195
|
+
s && d && this.selectMonth(parseInt(s), parseInt(d));
|
|
3196
3196
|
}
|
|
3197
3197
|
} else if (!t.closest(".drp-date-picker__rolling-selector") && !t.closest(".drp-date-picker__unified-rolling-selector")) {
|
|
3198
3198
|
let o = !1;
|
|
3199
|
-
for (let
|
|
3200
|
-
this.showingRollingSelector[
|
|
3199
|
+
for (let s = 0; s < this.showingRollingSelector.length; s++)
|
|
3200
|
+
this.showingRollingSelector[s] && (this.showingRollingSelector[s] = !1, o = !0);
|
|
3201
3201
|
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, o = !0), o && this.renderCalendar();
|
|
3202
3202
|
}
|
|
3203
3203
|
}), this.calendar.addEventListener("mouseenter", (a) => {
|
|
3204
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"),
|
|
3205
|
-
if (
|
|
3206
|
-
const o =
|
|
3207
|
-
o && this.showTooltip(
|
|
3204
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3205
|
+
if (r && r instanceof HTMLElement) {
|
|
3206
|
+
const o = r.dataset.tooltip;
|
|
3207
|
+
o && this.showTooltip(r, o);
|
|
3208
3208
|
}
|
|
3209
3209
|
}, !0), this.calendar.addEventListener("mouseleave", (a) => {
|
|
3210
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"),
|
|
3211
|
-
|
|
3210
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3211
|
+
r && this.currentTooltipTarget === r && this.hideTooltip();
|
|
3212
3212
|
}, !0), this.calendar.addEventListener("mousedown", (a) => {
|
|
3213
3213
|
this.isCalendarActive = !0, a.stopPropagation();
|
|
3214
3214
|
}), this.calendar.addEventListener("focusin", () => {
|
|
@@ -3216,9 +3216,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3216
3216
|
}), document.addEventListener("mousedown", (a) => {
|
|
3217
3217
|
this.calendar.contains(a.target) || (this.isCalendarActive = !1);
|
|
3218
3218
|
}, !0), document.addEventListener("keydown", (a) => {
|
|
3219
|
-
var t, n, i,
|
|
3219
|
+
var t, n, i, r;
|
|
3220
3220
|
if (this.calendar.classList.contains("drp-date-picker--visible") && this.isCalendarActive) {
|
|
3221
|
-
if (
|
|
3221
|
+
if (k.debug("Keydown", a.key, "Ctrl:", a.ctrlKey, "Meta:", a.metaKey, "Shift:", a.shiftKey, "Alt:", a.altKey), a.key === "Escape")
|
|
3222
3222
|
this.hide(), a.preventDefault();
|
|
3223
3223
|
else if (a.key === "ArrowUp")
|
|
3224
3224
|
this.moveFocus(-7), a.preventDefault();
|
|
@@ -3230,7 +3230,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3230
3230
|
const o = this.focusedDayIndex;
|
|
3231
3231
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3232
3232
|
var l, c;
|
|
3233
|
-
const
|
|
3233
|
+
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3234
3234
|
d && (this.focusedDayIndex = Math.min(o !== null ? o : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3235
3235
|
}, 0);
|
|
3236
3236
|
} else
|
|
@@ -3242,7 +3242,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3242
3242
|
const o = this.focusedDayIndex;
|
|
3243
3243
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3244
3244
|
var l, c;
|
|
3245
|
-
const
|
|
3245
|
+
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3246
3246
|
d && (this.focusedDayIndex = Math.min(o !== null ? o : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3247
3247
|
}, 0);
|
|
3248
3248
|
} else
|
|
@@ -3250,18 +3250,18 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3250
3250
|
a.preventDefault();
|
|
3251
3251
|
} else if (a.key === "Enter") {
|
|
3252
3252
|
if (this.focusedDayIndex !== null) {
|
|
3253
|
-
const o = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3253
|
+
const o = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = o == null ? void 0 : o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), d = s == null ? void 0 : s[this.focusedDayIndex];
|
|
3254
3254
|
d && d.click();
|
|
3255
3255
|
} else
|
|
3256
3256
|
this.hide();
|
|
3257
3257
|
a.preventDefault();
|
|
3258
3258
|
} else if (a.key === "Tab") {
|
|
3259
3259
|
if (this.options.visibleMonthsCount > 1) {
|
|
3260
|
-
const o = a.shiftKey ? -1 : 1,
|
|
3261
|
-
if (
|
|
3262
|
-
w.debug(`Tab: switching from Col${this.activeMonthIndex} to Col${
|
|
3260
|
+
const o = a.shiftKey ? -1 : 1, s = this.activeMonthIndex + o;
|
|
3261
|
+
if (s >= 0 && s < this.monthDates.length) {
|
|
3262
|
+
w.debug(`Tab: switching from Col${this.activeMonthIndex} to Col${s}`);
|
|
3263
3263
|
const d = this.focusedDayIndex ?? 0;
|
|
3264
|
-
this.activeMonthIndex =
|
|
3264
|
+
this.activeMonthIndex = s;
|
|
3265
3265
|
const l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`);
|
|
3266
3266
|
if (l) {
|
|
3267
3267
|
const c = l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
@@ -3273,77 +3273,77 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3273
3273
|
}
|
|
3274
3274
|
} else if (a.key === "t" || a.key === "T")
|
|
3275
3275
|
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), this.renderCalendar(), setTimeout(() => {
|
|
3276
|
-
const o = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3277
|
-
if (
|
|
3278
|
-
const d = Array.from(
|
|
3279
|
-
d !== -1 && (this.focusedDayIndex = d,
|
|
3276
|
+
const o = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = o == null ? void 0 : o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3277
|
+
if (s) {
|
|
3278
|
+
const d = Array.from(s).findIndex((l) => l.classList.contains("drp-date-picker__day--today"));
|
|
3279
|
+
d !== -1 && (this.focusedDayIndex = d, s[d].classList.add("drp-date-picker__day--focused"), s[d].scrollIntoView({ block: "nearest" }));
|
|
3280
3280
|
}
|
|
3281
3281
|
}, 0), a.preventDefault();
|
|
3282
3282
|
else if (a.key === "PageUp") {
|
|
3283
3283
|
const o = this.focusedDayIndex;
|
|
3284
3284
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3285
3285
|
var l, c;
|
|
3286
|
-
const
|
|
3286
|
+
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3287
3287
|
d && (this.focusedDayIndex = Math.min(o !== null ? o : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3288
3288
|
}, 0), a.preventDefault();
|
|
3289
3289
|
} else if (a.key === "PageDown") {
|
|
3290
3290
|
const o = this.focusedDayIndex;
|
|
3291
3291
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3292
3292
|
var l, c;
|
|
3293
|
-
const
|
|
3293
|
+
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3294
3294
|
d && (this.focusedDayIndex = Math.min(o !== null ? o : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3295
3295
|
}, 0), a.preventDefault();
|
|
3296
3296
|
} else if (a.key === "Home") {
|
|
3297
3297
|
w.debug("Home key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3298
|
-
const o = this.monthDates[this.activeMonthIndex].getFullYear(),
|
|
3298
|
+
const o = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3299
3299
|
if (a.ctrlKey || a.metaKey) {
|
|
3300
3300
|
w.debug("Ctrl+Home: Navigate to year start");
|
|
3301
|
-
const d =
|
|
3301
|
+
const d = s === 0, l = this.focusedDayIndex === 0;
|
|
3302
3302
|
d && l ? (w.debug("Already at Jan 1, going to previous year"), this.monthDates[this.activeMonthIndex] = new Date(o - 1, 0, 1)) : (w.debug("Going to Jan 1 of current year"), this.monthDates[this.activeMonthIndex] = new Date(o, 0, 1)), this.renderCalendar(), setTimeout(() => {
|
|
3303
|
-
var u,
|
|
3304
|
-
const c = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3305
|
-
|
|
3303
|
+
var u, g;
|
|
3304
|
+
const c = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), p = c == null ? void 0 : c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3305
|
+
p && (this.focusedDayIndex = 0, (u = p[0]) == null || u.classList.add("drp-date-picker__day--focused"), (g = p[0]) == null || g.scrollIntoView({ block: "nearest" }));
|
|
3306
3306
|
}, 0);
|
|
3307
3307
|
} else if (w.debug("Home: Navigate to first day (cycles to previous month if already there)"), this.focusedDayIndex === 0)
|
|
3308
3308
|
w.debug("Already on first day, going to previous month"), this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3309
|
-
var
|
|
3309
|
+
var p, u;
|
|
3310
3310
|
const l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3311
|
-
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3311
|
+
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((g) => g.classList.remove("drp-date-picker__day--focused")), (p = c[0]) == null || p.classList.add("drp-date-picker__day--focused"), (u = c[0]) == null || u.scrollIntoView({ block: "nearest" }));
|
|
3312
3312
|
}, 0);
|
|
3313
3313
|
else {
|
|
3314
3314
|
this.focusedDayIndex = 0;
|
|
3315
3315
|
const l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3316
|
-
c && (this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3316
|
+
c && (this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (t = c[0]) == null || t.classList.add("drp-date-picker__day--focused"), (n = c[0]) == null || n.scrollIntoView({ block: "nearest" }));
|
|
3317
3317
|
}
|
|
3318
3318
|
a.preventDefault();
|
|
3319
3319
|
} else if (a.key === "End") {
|
|
3320
3320
|
w.debug("End key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3321
|
-
const o = this.monthDates[this.activeMonthIndex].getFullYear(),
|
|
3321
|
+
const o = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3322
3322
|
if (a.ctrlKey || a.metaKey) {
|
|
3323
3323
|
w.debug("Ctrl+End: Navigate to year end");
|
|
3324
|
-
const d =
|
|
3325
|
-
d &&
|
|
3324
|
+
const d = s === 11, l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = c && this.focusedDayIndex === c.length - 1;
|
|
3325
|
+
d && p ? this.monthDates[this.activeMonthIndex] = new Date(o + 1, 11, 31) : this.monthDates[this.activeMonthIndex] = new Date(o, 11, 31), this.renderCalendar(), setTimeout(() => {
|
|
3326
3326
|
var m, f;
|
|
3327
|
-
const u = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3328
|
-
|
|
3327
|
+
const u = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), g = u == null ? void 0 : u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3328
|
+
g && (this.focusedDayIndex = g.length - 1, (m = g[this.focusedDayIndex]) == null || m.classList.add("drp-date-picker__day--focused"), (f = g[this.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
3329
3329
|
}, 0);
|
|
3330
3330
|
} else {
|
|
3331
3331
|
w.debug("End: Navigate to last day (cycles to next month if already there)");
|
|
3332
3332
|
const d = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), l = d == null ? void 0 : d.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3333
3333
|
if (!l) return;
|
|
3334
3334
|
this.focusedDayIndex === l.length - 1 ? (w.debug("Already on last day, going to next month"), this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3335
|
-
var
|
|
3336
|
-
const
|
|
3337
|
-
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((f) => f.classList.remove("drp-date-picker__day--focused")), (
|
|
3338
|
-
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3335
|
+
var g, m;
|
|
3336
|
+
const p = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), u = p == null ? void 0 : p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3337
|
+
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((f) => f.classList.remove("drp-date-picker__day--focused")), (g = u[this.focusedDayIndex]) == null || g.classList.add("drp-date-picker__day--focused"), (m = u[this.focusedDayIndex]) == null || m.scrollIntoView({ block: "nearest" }));
|
|
3338
|
+
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (i = l[this.focusedDayIndex]) == null || i.classList.add("drp-date-picker__day--focused"), (r = l[this.focusedDayIndex]) == null || r.scrollIntoView({ block: "nearest" }));
|
|
3339
3339
|
}
|
|
3340
3340
|
a.preventDefault();
|
|
3341
3341
|
}
|
|
3342
3342
|
}
|
|
3343
3343
|
}), this.clickOutsideHandler = (a) => {
|
|
3344
|
-
var
|
|
3345
|
-
const t = a.composedPath(), n = t[0], i = t.includes(this.calendar),
|
|
3346
|
-
if (!i && !
|
|
3344
|
+
var s;
|
|
3345
|
+
const t = a.composedPath(), n = t[0], i = t.includes(this.calendar), r = this.input && t.includes(this.input), o = (s = n.closest) == null ? void 0 : s.call(n, "[data-calendar-button]");
|
|
3346
|
+
if (!i && !r && !o)
|
|
3347
3347
|
if (this.options.positioningMode === "floating")
|
|
3348
3348
|
this.hide();
|
|
3349
3349
|
else {
|
|
@@ -3358,8 +3358,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3358
3358
|
parseFormat(a) {
|
|
3359
3359
|
const t = {};
|
|
3360
3360
|
let n = "";
|
|
3361
|
-
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((
|
|
3362
|
-
|
|
3361
|
+
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((r, o) => {
|
|
3362
|
+
r === "YYYY" || r === "YY" ? t.year = { index: o, length: r.length } : r === "MM" || r === "M" ? t.month = { index: o, length: 2 } : (r === "DD" || r === "D") && (t.day = { index: o, length: 2 });
|
|
3363
3363
|
}), {
|
|
3364
3364
|
format: a,
|
|
3365
3365
|
separator: n,
|
|
@@ -3369,9 +3369,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3369
3369
|
}
|
|
3370
3370
|
formatDate(a) {
|
|
3371
3371
|
if (!a) return "";
|
|
3372
|
-
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), i = String(a.getDate()).padStart(2, "0"), { format:
|
|
3372
|
+
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), i = String(a.getDate()).padStart(2, "0"), { format: r, separator: o, parts: s } = this.formatInfo, d = [];
|
|
3373
3373
|
for (let l = 0; l < 3; l++)
|
|
3374
|
-
|
|
3374
|
+
s.year && s.year.index === l ? d.push(s.year.length === 2 ? String(t).slice(-2) : t) : s.month && s.month.index === l ? d.push(n) : s.day && s.day.index === l && d.push(i);
|
|
3375
3375
|
return d.join(o);
|
|
3376
3376
|
}
|
|
3377
3377
|
// Reactive getters/setters for programmatic control
|
|
@@ -3429,7 +3429,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3429
3429
|
return Lt(this);
|
|
3430
3430
|
}
|
|
3431
3431
|
hide() {
|
|
3432
|
-
return
|
|
3432
|
+
return kt(this);
|
|
3433
3433
|
}
|
|
3434
3434
|
toggle() {
|
|
3435
3435
|
return tn(this);
|
|
@@ -3445,44 +3445,44 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3445
3445
|
}
|
|
3446
3446
|
// Rendering methods - wrappers for pure functions
|
|
3447
3447
|
renderCalendar() {
|
|
3448
|
-
return
|
|
3448
|
+
return hn(this);
|
|
3449
3449
|
}
|
|
3450
3450
|
renderNormalView(a) {
|
|
3451
|
-
return
|
|
3451
|
+
return zt(this, a);
|
|
3452
3452
|
}
|
|
3453
3453
|
renderDays(a, t) {
|
|
3454
|
-
return
|
|
3454
|
+
return Nt(this, a, t);
|
|
3455
3455
|
}
|
|
3456
3456
|
renderRollingSelector(a) {
|
|
3457
|
-
return
|
|
3457
|
+
return Ft(this, a);
|
|
3458
3458
|
}
|
|
3459
3459
|
updateSummary() {
|
|
3460
|
-
return
|
|
3460
|
+
return bn(this);
|
|
3461
3461
|
}
|
|
3462
3462
|
updateSummaryWithPreview() {
|
|
3463
|
-
return
|
|
3463
|
+
return Ot(this);
|
|
3464
3464
|
}
|
|
3465
3465
|
updateDragPreview() {
|
|
3466
|
-
return
|
|
3466
|
+
return yn(this);
|
|
3467
3467
|
}
|
|
3468
3468
|
// Navigation methods - wrappers for pure functions
|
|
3469
3469
|
toggleRollingSelector(a) {
|
|
3470
|
-
return
|
|
3470
|
+
return rn(this, a);
|
|
3471
3471
|
}
|
|
3472
3472
|
selectYear(a, t) {
|
|
3473
3473
|
return on(this, a, t);
|
|
3474
3474
|
}
|
|
3475
3475
|
selectMonth(a, t) {
|
|
3476
|
-
return
|
|
3476
|
+
return sn(this, a, t);
|
|
3477
3477
|
}
|
|
3478
3478
|
checkAndResolveCollisions(a) {
|
|
3479
3479
|
return De(this, a);
|
|
3480
3480
|
}
|
|
3481
3481
|
prevMonth(a) {
|
|
3482
|
-
return
|
|
3482
|
+
return be(this, a);
|
|
3483
3483
|
}
|
|
3484
3484
|
nextMonth(a) {
|
|
3485
|
-
return
|
|
3485
|
+
return ye(this, a);
|
|
3486
3486
|
}
|
|
3487
3487
|
// Unified navigation methods
|
|
3488
3488
|
unifiedPrevMonth() {
|
|
@@ -3492,13 +3492,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3492
3492
|
return ln(this);
|
|
3493
3493
|
}
|
|
3494
3494
|
toggleUnifiedRollingSelector() {
|
|
3495
|
-
return
|
|
3495
|
+
return pn(this);
|
|
3496
3496
|
}
|
|
3497
3497
|
setUnifiedMonth(a) {
|
|
3498
3498
|
return un(this, a);
|
|
3499
3499
|
}
|
|
3500
3500
|
setUnifiedYear(a) {
|
|
3501
|
-
return
|
|
3501
|
+
return gn(this, a);
|
|
3502
3502
|
}
|
|
3503
3503
|
findNextEnabledDayIndex(a, t, n, i) {
|
|
3504
3504
|
return fe(this, a, t, n);
|
|
@@ -3539,7 +3539,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3539
3539
|
return Mn(this, a);
|
|
3540
3540
|
}
|
|
3541
3541
|
applyMask(a) {
|
|
3542
|
-
return
|
|
3542
|
+
return pe(this, a);
|
|
3543
3543
|
}
|
|
3544
3544
|
applyRangeMask(a) {
|
|
3545
3545
|
return Ut(this, a);
|
|
@@ -3581,11 +3581,11 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3581
3581
|
*/
|
|
3582
3582
|
static injectGlobalStyles(a = !1) {
|
|
3583
3583
|
if (ve.stylesInjected && !a) {
|
|
3584
|
-
|
|
3584
|
+
k.debug("Styles already injected, skipping");
|
|
3585
3585
|
return;
|
|
3586
3586
|
}
|
|
3587
3587
|
const t = document.createElement("style");
|
|
3588
|
-
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0,
|
|
3588
|
+
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0, k.info("Global styles injected successfully");
|
|
3589
3589
|
}
|
|
3590
3590
|
/**
|
|
3591
3591
|
* Check if styles appear to be loaded
|
|
@@ -3605,39 +3605,39 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3605
3605
|
}
|
|
3606
3606
|
};
|
|
3607
3607
|
// Static flag to track if styles have been injected
|
|
3608
|
-
|
|
3608
|
+
b(ve, "stylesInjected", !1);
|
|
3609
3609
|
let je = ve;
|
|
3610
3610
|
class Wt extends HTMLElement {
|
|
3611
3611
|
constructor() {
|
|
3612
3612
|
super();
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3613
|
+
b(this, "picker");
|
|
3614
|
+
b(this, "inputElement");
|
|
3615
|
+
b(this, "shadow");
|
|
3616
3616
|
// Properties for complex data (not attributes)
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3617
|
+
b(this, "_specialDates");
|
|
3618
|
+
b(this, "_disabledDates");
|
|
3619
|
+
b(this, "_getDateMetadataCallback");
|
|
3620
|
+
b(this, "_badgeTooltipCallback");
|
|
3621
|
+
b(this, "_dayTooltipCallback");
|
|
3622
|
+
b(this, "_customStylesCallback");
|
|
3623
|
+
b(this, "_renderDayCallback");
|
|
3624
|
+
b(this, "_renderDayContentCallback");
|
|
3625
|
+
b(this, "_beforeDateSelectCallback");
|
|
3626
|
+
b(this, "_beforeMonthChangedCallback");
|
|
3627
|
+
b(this, "_formatSummaryCallback");
|
|
3628
|
+
b(this, "_getUnifiedHeaderCallback");
|
|
3629
3629
|
// Member mapping properties for specialDates array
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3630
|
+
b(this, "_dateMember");
|
|
3631
|
+
b(this, "_badgeTextMember");
|
|
3632
|
+
b(this, "_badgeClassMember");
|
|
3633
|
+
b(this, "_dayClassMember");
|
|
3634
|
+
b(this, "_badgeTooltipMember");
|
|
3635
|
+
b(this, "_dayTooltipMember");
|
|
3636
|
+
b(this, "_isDisabledMember");
|
|
3637
3637
|
// Action button configuration
|
|
3638
|
-
|
|
3638
|
+
b(this, "_actionButtons");
|
|
3639
3639
|
// Deferred re-initialization flag
|
|
3640
|
-
|
|
3640
|
+
b(this, "_pendingReinit", !1);
|
|
3641
3641
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
3642
3642
|
}
|
|
3643
3643
|
static get observedAttributes() {
|
|
@@ -3676,14 +3676,20 @@ class Wt extends HTMLElement {
|
|
|
3676
3676
|
"show-apply-button",
|
|
3677
3677
|
"unified-navigation",
|
|
3678
3678
|
"unified-navigation-anchor-index",
|
|
3679
|
-
"unified-header-interactive"
|
|
3679
|
+
"unified-header-interactive",
|
|
3680
|
+
"input-size"
|
|
3680
3681
|
];
|
|
3681
3682
|
}
|
|
3682
3683
|
applySizeStyles() {
|
|
3683
3684
|
const t = this.shadow.querySelector(".drp-date-picker");
|
|
3684
3685
|
if (!t) return;
|
|
3685
|
-
const n = this.getAttribute("spacing"), i = this.getAttribute("font-size"),
|
|
3686
|
-
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`), i && i !== "md" && t.classList.add(`drp-font-${i}`),
|
|
3686
|
+
const n = this.getAttribute("spacing"), i = this.getAttribute("font-size"), r = this.getAttribute("cell-size"), o = this.hasAttribute("enable-transitions");
|
|
3687
|
+
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`), i && i !== "md" && t.classList.add(`drp-font-${i}`), r && r !== "md" && t.classList.add(`drp-cell-${r}`), o ? t.classList.add("drp-transitions-enabled") : t.classList.remove("drp-transitions-enabled");
|
|
3688
|
+
}
|
|
3689
|
+
applyInputSizeStyles() {
|
|
3690
|
+
if (!this.inputElement) return;
|
|
3691
|
+
const t = this.getAttribute("input-size");
|
|
3692
|
+
this.inputElement.classList.remove("drp-input--xs", "drp-input--sm", "drp-input--lg", "drp-input--xl"), this.inputElement.classList.remove("drp-date-picker-input--xs", "drp-date-picker-input--sm", "drp-date-picker-input--lg", "drp-date-picker-input--xl"), t && t !== "md" && (this.inputElement.classList.add(`drp-input--${t}`), this.inputElement.classList.add(`drp-date-picker-input--${t}`));
|
|
3687
3693
|
}
|
|
3688
3694
|
connectedCallback() {
|
|
3689
3695
|
this.render(), this.initializePicker();
|
|
@@ -3697,6 +3703,10 @@ class Wt extends HTMLElement {
|
|
|
3697
3703
|
this.applySizeStyles(), this.picker && t === "cell-size" && this.picker.renderCalendar();
|
|
3698
3704
|
return;
|
|
3699
3705
|
}
|
|
3706
|
+
if (t === "input-size") {
|
|
3707
|
+
this.applyInputSizeStyles();
|
|
3708
|
+
return;
|
|
3709
|
+
}
|
|
3700
3710
|
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement && i !== null && (this.inputElement.value = i), t === "placeholder" && this.inputElement && i !== null && (this.inputElement.placeholder = i), t === "disabled" && this.inputElement && (i !== null ? this.inputElement.disabled = !0 : this.inputElement.disabled = !1);
|
|
3701
3711
|
}
|
|
3702
3712
|
}
|
|
@@ -3706,8 +3716,8 @@ class Wt extends HTMLElement {
|
|
|
3706
3716
|
this.inputElement = document.createElement("input"), this.inputElement.type = "text", this.inputElement.classList.add("drp-input", "drp-date-picker-input");
|
|
3707
3717
|
const i = this.getAttribute("placeholder");
|
|
3708
3718
|
i && (this.inputElement.placeholder = i);
|
|
3709
|
-
const
|
|
3710
|
-
|
|
3719
|
+
const r = this.getAttribute("value");
|
|
3720
|
+
r && (this.inputElement.value = r), this.hasAttribute("disabled") && (this.inputElement.disabled = !0), this.shadow.appendChild(this.inputElement), this.applyInputSizeStyles();
|
|
3711
3721
|
}
|
|
3712
3722
|
}
|
|
3713
3723
|
initializePicker() {
|
|
@@ -3716,16 +3726,16 @@ class Wt extends HTMLElement {
|
|
|
3716
3726
|
let n;
|
|
3717
3727
|
const i = this.getAttribute("disabled-weekdays");
|
|
3718
3728
|
i && (n = i.split(",").map((l) => parseInt(l.trim())).filter((l) => !isNaN(l) && l >= 0 && l <= 6));
|
|
3719
|
-
let
|
|
3729
|
+
let r;
|
|
3720
3730
|
const o = this.getAttribute("week-start-day");
|
|
3721
3731
|
if (o)
|
|
3722
3732
|
if (o === "auto")
|
|
3723
|
-
|
|
3733
|
+
r = "auto";
|
|
3724
3734
|
else {
|
|
3725
3735
|
const l = parseInt(o);
|
|
3726
|
-
!isNaN(l) && l >= 0 && l <= 6 && (
|
|
3736
|
+
!isNaN(l) && l >= 0 && l <= 6 && (r = l);
|
|
3727
3737
|
}
|
|
3728
|
-
const
|
|
3738
|
+
const s = {
|
|
3729
3739
|
selectionMode: this.getAttribute("selection-mode") || "single",
|
|
3730
3740
|
dateFormatMask: this.getAttribute("date-format-mask") || "YYYY-MM-DD",
|
|
3731
3741
|
visibleMonthsCount: parseInt(this.getAttribute("visible-months-count") || "0") || void 0,
|
|
@@ -3744,7 +3754,7 @@ class Wt extends HTMLElement {
|
|
|
3744
3754
|
// Positioning
|
|
3745
3755
|
calendarPlacement: this.getAttribute("calendar-placement") || void 0,
|
|
3746
3756
|
// New options
|
|
3747
|
-
weekStartDay:
|
|
3757
|
+
weekStartDay: r,
|
|
3748
3758
|
minDate: this.getAttribute("min-date") || void 0,
|
|
3749
3759
|
maxDate: this.getAttribute("max-date") || void 0,
|
|
3750
3760
|
initialDate: this.getAttribute("initial-date") || void 0,
|
|
@@ -3786,7 +3796,7 @@ class Wt extends HTMLElement {
|
|
|
3786
3796
|
showClearButton: this.hasAttribute("show-clear-button") ? this.getAttribute("show-clear-button") === "true" : void 0,
|
|
3787
3797
|
showApplyButton: this.hasAttribute("show-apply-button") ? this.getAttribute("show-apply-button") === "true" : void 0
|
|
3788
3798
|
}, d = t === "inline" ? null : this.inputElement;
|
|
3789
|
-
if (this.picker = new je(d,
|
|
3799
|
+
if (this.picker = new je(d, s), this._customStylesCallback) {
|
|
3790
3800
|
const l = this._customStylesCallback();
|
|
3791
3801
|
if (l) {
|
|
3792
3802
|
const c = document.createElement("style");
|
|
@@ -3805,11 +3815,11 @@ class Wt extends HTMLElement {
|
|
|
3805
3815
|
}));
|
|
3806
3816
|
}
|
|
3807
3817
|
handleDateSelect(t) {
|
|
3808
|
-
var
|
|
3818
|
+
var r;
|
|
3809
3819
|
const n = {
|
|
3810
3820
|
date: t instanceof Date ? t : void 0,
|
|
3811
3821
|
dateRange: t instanceof Date || Array.isArray(t) ? void 0 : t,
|
|
3812
|
-
formattedValue: ((
|
|
3822
|
+
formattedValue: ((r = this.inputElement) == null ? void 0 : r.value) || ""
|
|
3813
3823
|
};
|
|
3814
3824
|
if (!this.picker) {
|
|
3815
3825
|
this.dispatchEvent(new CustomEvent("date-select", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: n, bubbles: !0, composed: !0 }));
|
|
@@ -3819,19 +3829,19 @@ class Wt extends HTMLElement {
|
|
|
3819
3829
|
return;
|
|
3820
3830
|
const i = this.picker.options.disabledDatesHandling;
|
|
3821
3831
|
if (!(t instanceof Date) && !Array.isArray(t) && "start" in t && "end" in t) {
|
|
3822
|
-
const o = t.start,
|
|
3832
|
+
const o = t.start, s = t.end;
|
|
3823
3833
|
switch (i) {
|
|
3824
3834
|
case "allow":
|
|
3825
|
-
n.enabledDates = this.picker.getEnabledDatesInRange(o,
|
|
3835
|
+
n.enabledDates = this.picker.getEnabledDatesInRange(o, s), n.disabledDates = this.picker.getDisabledDatesInRange(o, s), n.getEnabledDateCount = () => n.enabledDates.length, n.getTotalDays = () => Math.floor((s.getTime() - o.getTime()) / 864e5) + 1;
|
|
3826
3836
|
break;
|
|
3827
3837
|
case "split":
|
|
3828
|
-
n.dateRanges = this.picker.splitRangeByDisabled(o,
|
|
3838
|
+
n.dateRanges = this.picker.splitRangeByDisabled(o, s), n.dates = this.picker.getEnabledDatesInRange(o, s), n.dateRanges.length > 0 && (n.formattedValue = n.dateRanges.map((d) => `${this.picker.formatDate(d.start)} - ${this.picker.formatDate(d.end)}`).join(", "));
|
|
3829
3839
|
break;
|
|
3830
3840
|
case "individual":
|
|
3831
|
-
n.dates = this.picker.getEnabledDatesInRange(o,
|
|
3841
|
+
n.dates = this.picker.getEnabledDatesInRange(o, s), n.dateRange = null, n.dates.length > 0 && (n.formattedValue = n.dates.map((d) => this.picker.formatDate(d)).join(", "));
|
|
3832
3842
|
break;
|
|
3833
3843
|
case "block":
|
|
3834
|
-
n.dates = this.picker.getEnabledDatesInRange(o,
|
|
3844
|
+
n.dates = this.picker.getEnabledDatesInRange(o, s);
|
|
3835
3845
|
break;
|
|
3836
3846
|
}
|
|
3837
3847
|
}
|
|
@@ -3970,6 +3980,12 @@ class Wt extends HTMLElement {
|
|
|
3970
3980
|
set enableTransitions(t) {
|
|
3971
3981
|
t ? this.setAttribute("enable-transitions", "") : this.removeAttribute("enable-transitions");
|
|
3972
3982
|
}
|
|
3983
|
+
get inputSize() {
|
|
3984
|
+
return this.getAttribute("input-size") || "md";
|
|
3985
|
+
}
|
|
3986
|
+
set inputSize(t) {
|
|
3987
|
+
this.setAttribute("input-size", t);
|
|
3988
|
+
}
|
|
3973
3989
|
// Complex data properties (not attributes)
|
|
3974
3990
|
get specialDates() {
|
|
3975
3991
|
return this._specialDates;
|
|
@@ -4129,10 +4145,10 @@ function An() {
|
|
|
4129
4145
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4130
4146
|
}
|
|
4131
4147
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4132
|
-
version: () => "1.
|
|
4148
|
+
version: () => "1.4.0",
|
|
4133
4149
|
config: {
|
|
4134
4150
|
name: "@keenmate/web-daterangepicker",
|
|
4135
|
-
version: "1.
|
|
4151
|
+
version: "1.4.0",
|
|
4136
4152
|
author: "Keenmate",
|
|
4137
4153
|
license: "MIT",
|
|
4138
4154
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|
|
@@ -4147,7 +4163,7 @@ typeof window < "u" && (window.components = window.components || {}, window.comp
|
|
|
4147
4163
|
disableLogging: mt,
|
|
4148
4164
|
setLogLevel: We,
|
|
4149
4165
|
setCategoryLevel: ua,
|
|
4150
|
-
getCategories:
|
|
4166
|
+
getCategories: pa
|
|
4151
4167
|
}
|
|
4152
4168
|
}, window.components["web-daterangepicker"].register());
|
|
4153
4169
|
export {
|