@keenmate/web-daterangepicker 1.9.4 → 1.10.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 +203 -0
- package/component-variables.manifest.json +268 -0
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +1400 -1176
- package/dist/web-daterangepicker.umd.js +10 -7
- package/package.json +5 -3
- package/src/css/_calendar-grid.css +15 -0
- package/src/css/_message.css +114 -0
- package/src/css/_summary-actions.css +3 -1
- package/src/css/_variables.css +25 -0
- package/src/css/main.css +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (e, a, t) =>
|
|
4
|
-
function
|
|
1
|
+
var Jt = Object.defineProperty;
|
|
2
|
+
var Qt = (e, a, t) => a in e ? Jt(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var b = (e, a, t) => Qt(e, typeof a != "symbol" ? a + "" : a, t);
|
|
4
|
+
function Zt(e) {
|
|
5
5
|
if (e !== "auto")
|
|
6
6
|
return e;
|
|
7
7
|
try {
|
|
@@ -31,103 +31,103 @@ function Xt(e) {
|
|
|
31
31
|
// South Korea
|
|
32
32
|
].some((n) => a.startsWith(n)) ? 0 : 1;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function me(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;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ye(e) {
|
|
40
40
|
const a = e.getFullYear(), t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
41
41
|
return `${a}-${t}-${n}`;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
return !!(a && e < a || t && e > t || r && r.includes(
|
|
43
|
+
function ea(e, a, t, n, r) {
|
|
44
|
+
const i = ye(e), o = e.getDay();
|
|
45
|
+
return !!(a && e < a || t && e > t || r && r.includes(o) || n.has(i));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function gt(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 r = 1; r <= n; r++) {
|
|
51
|
-
const
|
|
52
|
-
if (!e.isDateDisabledInternal(
|
|
51
|
+
const i = new Date(a, t, r);
|
|
52
|
+
if (!e.isDateDisabledInternal(i))
|
|
53
53
|
return !0;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return !1;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ta(e, a, t) {
|
|
59
59
|
const n = new Date(e), r = new Date(a);
|
|
60
60
|
n.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
61
|
-
const
|
|
62
|
-
for (;
|
|
63
|
-
if (t(
|
|
61
|
+
const i = new Date(n);
|
|
62
|
+
for (; i <= r; ) {
|
|
63
|
+
if (t(i))
|
|
64
64
|
return !0;
|
|
65
|
-
|
|
65
|
+
i.setDate(i.getDate() + 1);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const n = [], r = new Date(e),
|
|
71
|
-
r.setHours(0, 0, 0, 0),
|
|
72
|
-
const
|
|
73
|
-
for (;
|
|
74
|
-
t(
|
|
69
|
+
function aa(e, a, t) {
|
|
70
|
+
const n = [], r = new Date(e), i = new Date(a);
|
|
71
|
+
r.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
72
|
+
const o = new Date(r);
|
|
73
|
+
for (; o <= i; )
|
|
74
|
+
t(o) || n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const n = [], r = new Date(e),
|
|
79
|
-
r.setHours(0, 0, 0, 0),
|
|
80
|
-
const
|
|
81
|
-
for (;
|
|
82
|
-
t(
|
|
77
|
+
function na(e, a, t) {
|
|
78
|
+
const n = [], r = new Date(e), i = new Date(a);
|
|
79
|
+
r.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
80
|
+
const o = new Date(r);
|
|
81
|
+
for (; o <= i; )
|
|
82
|
+
t(o) && n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ra(e, a, t) {
|
|
86
86
|
const n = new Date(e), r = new Date(a);
|
|
87
87
|
n.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
88
|
-
let
|
|
89
|
-
const
|
|
90
|
-
for (
|
|
91
|
-
if (t(
|
|
92
|
-
return
|
|
93
|
-
|
|
88
|
+
let i = new Date(n);
|
|
89
|
+
const o = new Date(n);
|
|
90
|
+
for (o.setDate(o.getDate() + 1); o <= r; ) {
|
|
91
|
+
if (t(o))
|
|
92
|
+
return i;
|
|
93
|
+
i = new Date(o), o.setDate(o.getDate() + 1);
|
|
94
94
|
}
|
|
95
95
|
return r;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const n = [], r = new Date(e),
|
|
99
|
-
r.setHours(0, 0, 0, 0),
|
|
100
|
-
let
|
|
97
|
+
function ia(e, a, t) {
|
|
98
|
+
const n = [], r = new Date(e), i = new Date(a);
|
|
99
|
+
r.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
100
|
+
let o = null;
|
|
101
101
|
const s = new Date(r);
|
|
102
|
-
for (; s <=
|
|
102
|
+
for (; s <= i; ) {
|
|
103
103
|
if (!t(s))
|
|
104
|
-
|
|
105
|
-
else if (
|
|
104
|
+
o || (o = new Date(s));
|
|
105
|
+
else if (o) {
|
|
106
106
|
const d = new Date(s);
|
|
107
|
-
d.setDate(d.getDate() - 1), n.push({ start:
|
|
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
|
|
111
|
+
return o && n.push({ start: o, end: new Date(i) }), n;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
113
|
+
function pt(e) {
|
|
114
|
+
return ht(e, /* @__PURE__ */ new Date());
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ht(e, a) {
|
|
117
117
|
return !e || !a ? !1 : e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate();
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function oa(e, a, t) {
|
|
120
120
|
return !a || !t ? !1 : e > a && e < t;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var sa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
123
|
+
function da(e) {
|
|
124
124
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
126
|
+
var ft = { exports: {} };
|
|
127
127
|
(function(e) {
|
|
128
128
|
(function(a, t) {
|
|
129
129
|
e.exports ? e.exports = t() : a.log = t();
|
|
130
|
-
})(
|
|
130
|
+
})(sa, function() {
|
|
131
131
|
var a = function() {
|
|
132
132
|
}, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), r = [
|
|
133
133
|
"trace",
|
|
@@ -135,7 +135,7 @@ var gt = { exports: {} };
|
|
|
135
135
|
"info",
|
|
136
136
|
"warn",
|
|
137
137
|
"error"
|
|
138
|
-
],
|
|
138
|
+
], i = {}, o = null;
|
|
139
139
|
function s(h, v) {
|
|
140
140
|
var m = h[v];
|
|
141
141
|
if (typeof m.bind == "function")
|
|
@@ -167,42 +167,42 @@ var gt = { exports: {} };
|
|
|
167
167
|
typeof console !== t && (c.call(this), this[h].apply(this, arguments));
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function g(h, v, m) {
|
|
171
171
|
return l(h) || u.apply(this, arguments);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var m = this,
|
|
173
|
+
function p(h, v) {
|
|
174
|
+
var m = this, x, C, M, D = "loglevel";
|
|
175
175
|
typeof h == "string" ? D += ":" + h : typeof h == "symbol" && (D = void 0);
|
|
176
|
-
function _(
|
|
177
|
-
var
|
|
176
|
+
function _(E) {
|
|
177
|
+
var I = (r[E] || "silent").toUpperCase();
|
|
178
178
|
if (!(typeof window === t || !D)) {
|
|
179
179
|
try {
|
|
180
|
-
window.localStorage[D] =
|
|
180
|
+
window.localStorage[D] = I;
|
|
181
181
|
return;
|
|
182
182
|
} catch {
|
|
183
183
|
}
|
|
184
184
|
try {
|
|
185
|
-
window.document.cookie = encodeURIComponent(D) + "=" +
|
|
185
|
+
window.document.cookie = encodeURIComponent(D) + "=" + I + ";";
|
|
186
186
|
} catch {
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
function R() {
|
|
191
|
-
var
|
|
191
|
+
var E;
|
|
192
192
|
if (!(typeof window === t || !D)) {
|
|
193
193
|
try {
|
|
194
|
-
|
|
194
|
+
E = window.localStorage[D];
|
|
195
195
|
} catch {
|
|
196
196
|
}
|
|
197
|
-
if (typeof
|
|
197
|
+
if (typeof E === t)
|
|
198
198
|
try {
|
|
199
|
-
var
|
|
200
|
-
A !== -1 && (
|
|
201
|
-
|
|
199
|
+
var I = window.document.cookie, T = encodeURIComponent(D), A = I.indexOf(T + "=");
|
|
200
|
+
A !== -1 && (E = /^([^;]+)/.exec(
|
|
201
|
+
I.slice(A + T.length + 1)
|
|
202
202
|
)[1]);
|
|
203
203
|
} catch {
|
|
204
204
|
}
|
|
205
|
-
return m.levels[
|
|
205
|
+
return m.levels[E] === void 0 && (E = void 0), E;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
function L() {
|
|
@@ -217,11 +217,11 @@ var gt = { exports: {} };
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function y(
|
|
221
|
-
var
|
|
222
|
-
if (typeof
|
|
223
|
-
return
|
|
224
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
220
|
+
function y(E) {
|
|
221
|
+
var I = E;
|
|
222
|
+
if (typeof I == "string" && m.levels[I.toUpperCase()] !== void 0 && (I = m.levels[I.toUpperCase()]), typeof I == "number" && I >= 0 && I <= m.levels.SILENT)
|
|
223
|
+
return I;
|
|
224
|
+
throw new TypeError("log.setLevel() called with invalid level: " + E);
|
|
225
225
|
}
|
|
226
226
|
m.name = h, m.levels = {
|
|
227
227
|
TRACE: 0,
|
|
@@ -230,47 +230,47 @@ var gt = { exports: {} };
|
|
|
230
230
|
WARN: 3,
|
|
231
231
|
ERROR: 4,
|
|
232
232
|
SILENT: 5
|
|
233
|
-
}, m.methodFactory = v ||
|
|
234
|
-
return
|
|
235
|
-
}, m.setLevel = function(
|
|
236
|
-
return
|
|
237
|
-
}, m.setDefaultLevel = function(
|
|
238
|
-
C = y(
|
|
233
|
+
}, m.methodFactory = v || g, m.getLevel = function() {
|
|
234
|
+
return M ?? C ?? x;
|
|
235
|
+
}, m.setLevel = function(E, I) {
|
|
236
|
+
return M = y(E), I !== !1 && _(M), c.call(m);
|
|
237
|
+
}, m.setDefaultLevel = function(E) {
|
|
238
|
+
C = y(E), R() || m.setLevel(E, !1);
|
|
239
239
|
}, m.resetLevel = function() {
|
|
240
|
-
|
|
241
|
-
}, m.enableAll = function(
|
|
242
|
-
m.setLevel(m.levels.TRACE,
|
|
243
|
-
}, m.disableAll = function(
|
|
244
|
-
m.setLevel(m.levels.SILENT,
|
|
240
|
+
M = null, L(), c.call(m);
|
|
241
|
+
}, m.enableAll = function(E) {
|
|
242
|
+
m.setLevel(m.levels.TRACE, E);
|
|
243
|
+
}, m.disableAll = function(E) {
|
|
244
|
+
m.setLevel(m.levels.SILENT, E);
|
|
245
245
|
}, m.rebuild = function() {
|
|
246
|
-
if (
|
|
247
|
-
for (var
|
|
248
|
-
|
|
249
|
-
},
|
|
250
|
-
|
|
246
|
+
if (o !== m && (x = y(o.getLevel())), c.call(m), o === m)
|
|
247
|
+
for (var E in i)
|
|
248
|
+
i[E].rebuild();
|
|
249
|
+
}, x = y(
|
|
250
|
+
o ? o.getLevel() : "WARN"
|
|
251
251
|
);
|
|
252
|
-
var
|
|
253
|
-
|
|
252
|
+
var S = R();
|
|
253
|
+
S != null && (M = y(S)), c.call(m);
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
o = new p(), o.getLogger = function(v) {
|
|
256
256
|
if (typeof v != "symbol" && typeof v != "string" || v === "")
|
|
257
257
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
258
|
-
var m =
|
|
259
|
-
return m || (m =
|
|
258
|
+
var m = i[v];
|
|
259
|
+
return m || (m = i[v] = new p(
|
|
260
260
|
v,
|
|
261
|
-
|
|
261
|
+
o.methodFactory
|
|
262
262
|
)), m;
|
|
263
263
|
};
|
|
264
264
|
var f = typeof window !== t ? window.log : void 0;
|
|
265
|
-
return
|
|
266
|
-
return typeof window !== t && window.log ===
|
|
267
|
-
},
|
|
268
|
-
return
|
|
269
|
-
},
|
|
265
|
+
return o.noConflict = function() {
|
|
266
|
+
return typeof window !== t && window.log === o && (window.log = f), o;
|
|
267
|
+
}, o.getLoggers = function() {
|
|
268
|
+
return i;
|
|
269
|
+
}, o.default = o, o;
|
|
270
270
|
});
|
|
271
|
-
})(
|
|
272
|
-
var
|
|
273
|
-
const
|
|
271
|
+
})(ft);
|
|
272
|
+
var la = ft.exports;
|
|
273
|
+
const Y = /* @__PURE__ */ da(la), ca = [
|
|
274
274
|
"DRP",
|
|
275
275
|
"DRP:RENDERING",
|
|
276
276
|
"DRP:INTERACTION",
|
|
@@ -279,7 +279,7 @@ const O = /* @__PURE__ */ ia(oa), sa = [
|
|
|
279
279
|
"DRP:UI",
|
|
280
280
|
"DRP:VALIDATION",
|
|
281
281
|
"DRP:DRAG"
|
|
282
|
-
],
|
|
282
|
+
], ua = {
|
|
283
283
|
trace: "#6b7280",
|
|
284
284
|
// Gray
|
|
285
285
|
debug: "#0ea5e9",
|
|
@@ -290,115 +290,115 @@ const O = /* @__PURE__ */ ia(oa), sa = [
|
|
|
290
290
|
// Orange
|
|
291
291
|
error: "#ef4444"
|
|
292
292
|
// Red
|
|
293
|
-
},
|
|
294
|
-
const n =
|
|
293
|
+
}, ga = Y.methodFactory, pa = (e, a, t) => {
|
|
294
|
+
const n = ga.call(Y, e, a, t);
|
|
295
295
|
return (...r) => {
|
|
296
|
-
const
|
|
296
|
+
const i = ua[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(s, `color: ${
|
|
303
|
+
n(s, `color: ${i}`, ...r);
|
|
304
304
|
};
|
|
305
|
-
},
|
|
305
|
+
}, mt = [];
|
|
306
306
|
function J(e) {
|
|
307
|
-
const a =
|
|
308
|
-
return a.methodFactory =
|
|
309
|
-
}
|
|
310
|
-
const k = J("DRP"),
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
},
|
|
307
|
+
const a = Y.getLogger(e);
|
|
308
|
+
return a.methodFactory = pa, a.setLevel("silent"), mt.push(a), a;
|
|
309
|
+
}
|
|
310
|
+
const k = J("DRP"), le = J("DRP:RENDERING"), se = J("DRP:INTERACTION"), oe = J("DRP:SELECTION"), w = J("DRP:NAVIGATION"), O = J("DRP:UI"), Z = J("DRP:VALIDATION"), ee = J("DRP:DRAG");
|
|
311
|
+
Y.setLevel("silent");
|
|
312
|
+
const Je = (e) => {
|
|
313
|
+
Y.setLevel(e), mt.forEach((a) => a.setLevel(e));
|
|
314
|
+
}, bt = () => {
|
|
315
|
+
Je("debug");
|
|
316
|
+
}, yt = () => {
|
|
317
|
+
Je("silent");
|
|
318
|
+
}, ha = (e, a = "debug") => {
|
|
319
319
|
const n = {
|
|
320
320
|
DRP: k,
|
|
321
|
-
"DRP:RENDERING":
|
|
322
|
-
"DRP:INTERACTION":
|
|
323
|
-
"DRP:SELECTION":
|
|
321
|
+
"DRP:RENDERING": le,
|
|
322
|
+
"DRP:INTERACTION": se,
|
|
323
|
+
"DRP:SELECTION": oe,
|
|
324
324
|
"DRP:NAVIGATION": w,
|
|
325
|
-
"DRP:UI":
|
|
325
|
+
"DRP:UI": O,
|
|
326
326
|
"DRP:VALIDATION": Z,
|
|
327
327
|
"DRP:DRAG": ee
|
|
328
328
|
}[e];
|
|
329
329
|
n && n.setLevel(a);
|
|
330
|
-
},
|
|
330
|
+
}, fa = () => [...ca], ce = Math.min, te = Math.max, Re = Math.round, Ce = Math.floor, j = (e) => ({
|
|
331
331
|
x: e,
|
|
332
332
|
y: e
|
|
333
|
-
}),
|
|
333
|
+
}), ma = {
|
|
334
334
|
left: "right",
|
|
335
335
|
right: "left",
|
|
336
336
|
bottom: "top",
|
|
337
337
|
top: "bottom"
|
|
338
|
-
},
|
|
338
|
+
}, ba = {
|
|
339
339
|
start: "end",
|
|
340
340
|
end: "start"
|
|
341
341
|
};
|
|
342
|
-
function
|
|
343
|
-
return te(e,
|
|
342
|
+
function qe(e, a, t) {
|
|
343
|
+
return te(e, ce(a, t));
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function we(e, a) {
|
|
346
346
|
return typeof e == "function" ? e(a) : e;
|
|
347
347
|
}
|
|
348
348
|
function ne(e) {
|
|
349
349
|
return e.split("-")[0];
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function xe(e) {
|
|
352
352
|
return e.split("-")[1];
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function vt(e) {
|
|
355
355
|
return e === "x" ? "y" : "x";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Qe(e) {
|
|
358
358
|
return e === "y" ? "height" : "width";
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const ya = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
361
361
|
function G(e) {
|
|
362
|
-
return
|
|
362
|
+
return ya.has(ne(e)) ? "y" : "x";
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
return
|
|
364
|
+
function Ze(e) {
|
|
365
|
+
return vt(G(e));
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function va(e, a, t) {
|
|
368
368
|
t === void 0 && (t = !1);
|
|
369
|
-
const n =
|
|
370
|
-
let
|
|
371
|
-
return a.reference[
|
|
369
|
+
const n = xe(e), r = Ze(e), i = Qe(r);
|
|
370
|
+
let o = r === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
|
+
return a.reference[i] > a.floating[i] && (o = Ae(o)), [o, Ae(o)];
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
const a =
|
|
375
|
-
return [
|
|
373
|
+
function Da(e) {
|
|
374
|
+
const a = Ae(e);
|
|
375
|
+
return [Ue(e), a, Ue(a)];
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
return e.replace(/start|end/g, (a) =>
|
|
377
|
+
function Ue(e) {
|
|
378
|
+
return e.replace(/start|end/g, (a) => ba[a]);
|
|
379
379
|
}
|
|
380
|
-
const
|
|
381
|
-
function
|
|
380
|
+
const it = ["left", "right"], ot = ["right", "left"], _a = ["top", "bottom"], wa = ["bottom", "top"];
|
|
381
|
+
function xa(e, a, t) {
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "top":
|
|
384
384
|
case "bottom":
|
|
385
|
-
return t ? a ?
|
|
385
|
+
return t ? a ? ot : it : a ? it : ot;
|
|
386
386
|
case "left":
|
|
387
387
|
case "right":
|
|
388
|
-
return a ?
|
|
388
|
+
return a ? _a : wa;
|
|
389
389
|
default:
|
|
390
390
|
return [];
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
const r =
|
|
395
|
-
let
|
|
396
|
-
return r && (
|
|
393
|
+
function Ma(e, a, t, n) {
|
|
394
|
+
const r = xe(e);
|
|
395
|
+
let i = xa(ne(e), t === "start", n);
|
|
396
|
+
return r && (i = i.map((o) => o + "-" + r), a && (i = i.concat(i.map(Ue)))), i;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return e.replace(/left|right|bottom|top/g, (a) =>
|
|
398
|
+
function Ae(e) {
|
|
399
|
+
return e.replace(/left|right|bottom|top/g, (a) => ma[a]);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Sa(e) {
|
|
402
402
|
return {
|
|
403
403
|
top: 0,
|
|
404
404
|
right: 0,
|
|
@@ -407,15 +407,15 @@ function wa(e) {
|
|
|
407
407
|
...e
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
return typeof e != "number" ?
|
|
410
|
+
function Dt(e) {
|
|
411
|
+
return typeof e != "number" ? Sa(e) : {
|
|
412
412
|
top: e,
|
|
413
413
|
right: e,
|
|
414
414
|
bottom: e,
|
|
415
415
|
left: e
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function Te(e) {
|
|
419
419
|
const {
|
|
420
420
|
x: a,
|
|
421
421
|
y: t,
|
|
@@ -433,161 +433,161 @@ function Re(e) {
|
|
|
433
433
|
y: t
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function st(e, a, t) {
|
|
437
437
|
let {
|
|
438
438
|
reference: n,
|
|
439
439
|
floating: r
|
|
440
440
|
} = e;
|
|
441
|
-
const
|
|
442
|
-
let
|
|
441
|
+
const i = G(a), o = Ze(a), s = Qe(o), d = ne(a), l = i === "y", c = n.x + n.width / 2 - r.width / 2, u = n.y + n.height / 2 - r.height / 2, g = n[s] / 2 - r[s] / 2;
|
|
442
|
+
let p;
|
|
443
443
|
switch (d) {
|
|
444
444
|
case "top":
|
|
445
|
-
|
|
445
|
+
p = {
|
|
446
446
|
x: c,
|
|
447
447
|
y: n.y - r.height
|
|
448
448
|
};
|
|
449
449
|
break;
|
|
450
450
|
case "bottom":
|
|
451
|
-
|
|
451
|
+
p = {
|
|
452
452
|
x: c,
|
|
453
453
|
y: n.y + n.height
|
|
454
454
|
};
|
|
455
455
|
break;
|
|
456
456
|
case "right":
|
|
457
|
-
|
|
457
|
+
p = {
|
|
458
458
|
x: n.x + n.width,
|
|
459
459
|
y: u
|
|
460
460
|
};
|
|
461
461
|
break;
|
|
462
462
|
case "left":
|
|
463
|
-
|
|
463
|
+
p = {
|
|
464
464
|
x: n.x - r.width,
|
|
465
465
|
y: u
|
|
466
466
|
};
|
|
467
467
|
break;
|
|
468
468
|
default:
|
|
469
|
-
|
|
469
|
+
p = {
|
|
470
470
|
x: n.x,
|
|
471
471
|
y: n.y
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
-
switch (
|
|
474
|
+
switch (xe(a)) {
|
|
475
475
|
case "start":
|
|
476
|
-
|
|
476
|
+
p[o] -= g * (t && l ? -1 : 1);
|
|
477
477
|
break;
|
|
478
478
|
case "end":
|
|
479
|
-
|
|
479
|
+
p[o] += g * (t && l ? -1 : 1);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
|
-
return
|
|
482
|
+
return p;
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const Ca = async (e, a, t) => {
|
|
485
485
|
const {
|
|
486
486
|
placement: n = "bottom",
|
|
487
487
|
strategy: r = "absolute",
|
|
488
|
-
middleware:
|
|
489
|
-
platform:
|
|
490
|
-
} = t, s =
|
|
491
|
-
let l = await
|
|
488
|
+
middleware: i = [],
|
|
489
|
+
platform: o
|
|
490
|
+
} = t, s = i.filter(Boolean), d = await (o.isRTL == null ? void 0 : o.isRTL(a));
|
|
491
|
+
let l = await o.getElementRects({
|
|
492
492
|
reference: e,
|
|
493
493
|
floating: a,
|
|
494
494
|
strategy: r
|
|
495
495
|
}), {
|
|
496
496
|
x: c,
|
|
497
497
|
y: u
|
|
498
|
-
} =
|
|
498
|
+
} = st(l, n, d), g = n, p = {}, f = 0;
|
|
499
499
|
for (let h = 0; h < s.length; h++) {
|
|
500
500
|
const {
|
|
501
501
|
name: v,
|
|
502
502
|
fn: m
|
|
503
503
|
} = s[h], {
|
|
504
|
-
x
|
|
504
|
+
x,
|
|
505
505
|
y: C,
|
|
506
|
-
data:
|
|
506
|
+
data: M,
|
|
507
507
|
reset: D
|
|
508
508
|
} = await m({
|
|
509
509
|
x: c,
|
|
510
510
|
y: u,
|
|
511
511
|
initialPlacement: n,
|
|
512
|
-
placement:
|
|
512
|
+
placement: g,
|
|
513
513
|
strategy: r,
|
|
514
|
-
middlewareData:
|
|
514
|
+
middlewareData: p,
|
|
515
515
|
rects: l,
|
|
516
|
-
platform:
|
|
516
|
+
platform: o,
|
|
517
517
|
elements: {
|
|
518
518
|
reference: e,
|
|
519
519
|
floating: a
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
|
-
c =
|
|
523
|
-
...
|
|
522
|
+
c = x ?? c, u = C ?? u, p = {
|
|
523
|
+
...p,
|
|
524
524
|
[v]: {
|
|
525
|
-
...
|
|
526
|
-
...
|
|
525
|
+
...p[v],
|
|
526
|
+
...M
|
|
527
527
|
}
|
|
528
|
-
}, D && f <= 50 && (f++, typeof D == "object" && (D.placement && (
|
|
528
|
+
}, D && f <= 50 && (f++, typeof D == "object" && (D.placement && (g = D.placement), D.rects && (l = D.rects === !0 ? await o.getElementRects({
|
|
529
529
|
reference: e,
|
|
530
530
|
floating: a,
|
|
531
531
|
strategy: r
|
|
532
532
|
}) : D.rects), {
|
|
533
533
|
x: c,
|
|
534
534
|
y: u
|
|
535
|
-
} =
|
|
535
|
+
} = st(l, g, d)), h = -1);
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
538
|
x: c,
|
|
539
539
|
y: u,
|
|
540
|
-
placement:
|
|
540
|
+
placement: g,
|
|
541
541
|
strategy: r,
|
|
542
|
-
middlewareData:
|
|
542
|
+
middlewareData: p
|
|
543
543
|
};
|
|
544
544
|
};
|
|
545
|
-
async function
|
|
545
|
+
async function _t(e, a) {
|
|
546
546
|
var t;
|
|
547
547
|
a === void 0 && (a = {});
|
|
548
548
|
const {
|
|
549
549
|
x: n,
|
|
550
550
|
y: r,
|
|
551
|
-
platform:
|
|
552
|
-
rects:
|
|
551
|
+
platform: i,
|
|
552
|
+
rects: o,
|
|
553
553
|
elements: s,
|
|
554
554
|
strategy: d
|
|
555
555
|
} = e, {
|
|
556
556
|
boundary: l = "clippingAncestors",
|
|
557
557
|
rootBoundary: c = "viewport",
|
|
558
558
|
elementContext: u = "floating",
|
|
559
|
-
altBoundary:
|
|
560
|
-
padding:
|
|
561
|
-
} =
|
|
562
|
-
element: (t = await (
|
|
559
|
+
altBoundary: g = !1,
|
|
560
|
+
padding: p = 0
|
|
561
|
+
} = we(a, e), f = Dt(p), v = s[g ? u === "floating" ? "reference" : "floating" : u], m = Te(await i.getClippingRect({
|
|
562
|
+
element: (t = await (i.isElement == null ? void 0 : i.isElement(v))) == null || t ? v : v.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(s.floating)),
|
|
563
563
|
boundary: l,
|
|
564
564
|
rootBoundary: c,
|
|
565
565
|
strategy: d
|
|
566
|
-
})),
|
|
566
|
+
})), x = u === "floating" ? {
|
|
567
567
|
x: n,
|
|
568
568
|
y: r,
|
|
569
|
-
width:
|
|
570
|
-
height:
|
|
571
|
-
} :
|
|
569
|
+
width: o.floating.width,
|
|
570
|
+
height: o.floating.height
|
|
571
|
+
} : o.reference, C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s.floating)), M = await (i.isElement == null ? void 0 : i.isElement(C)) ? await (i.getScale == null ? void 0 : i.getScale(C)) || {
|
|
572
572
|
x: 1,
|
|
573
573
|
y: 1
|
|
574
574
|
} : {
|
|
575
575
|
x: 1,
|
|
576
576
|
y: 1
|
|
577
|
-
}, D =
|
|
577
|
+
}, D = Te(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
578
578
|
elements: s,
|
|
579
|
-
rect:
|
|
579
|
+
rect: x,
|
|
580
580
|
offsetParent: C,
|
|
581
581
|
strategy: d
|
|
582
|
-
}) :
|
|
582
|
+
}) : x);
|
|
583
583
|
return {
|
|
584
|
-
top: (m.top - D.top + f.top) /
|
|
585
|
-
bottom: (D.bottom - m.bottom + f.bottom) /
|
|
586
|
-
left: (m.left - D.left + f.left) /
|
|
587
|
-
right: (D.right - m.right + f.right) /
|
|
584
|
+
top: (m.top - D.top + f.top) / M.y,
|
|
585
|
+
bottom: (D.bottom - m.bottom + f.bottom) / M.y,
|
|
586
|
+
left: (m.left - D.left + f.left) / M.x,
|
|
587
|
+
right: (D.right - m.right + f.right) / M.x
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
const
|
|
590
|
+
const Ea = (e) => ({
|
|
591
591
|
name: "arrow",
|
|
592
592
|
options: e,
|
|
593
593
|
async fn(a) {
|
|
@@ -595,27 +595,27 @@ const Ma = (e) => ({
|
|
|
595
595
|
x: t,
|
|
596
596
|
y: n,
|
|
597
597
|
placement: r,
|
|
598
|
-
rects:
|
|
599
|
-
platform:
|
|
598
|
+
rects: i,
|
|
599
|
+
platform: o,
|
|
600
600
|
elements: s,
|
|
601
601
|
middlewareData: d
|
|
602
602
|
} = a, {
|
|
603
603
|
element: l,
|
|
604
604
|
padding: c = 0
|
|
605
|
-
} =
|
|
605
|
+
} = we(e, a) || {};
|
|
606
606
|
if (l == null)
|
|
607
607
|
return {};
|
|
608
|
-
const u =
|
|
608
|
+
const u = Dt(c), g = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
},
|
|
611
|
+
}, p = Ze(r), f = Qe(p), h = await o.getDimensions(l), v = p === "y", m = v ? "top" : "left", x = v ? "bottom" : "right", C = v ? "clientHeight" : "clientWidth", M = i.reference[f] + i.reference[p] - g[p] - i.floating[f], D = g[p] - i.reference[p], _ = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
612
612
|
let R = _ ? _[C] : 0;
|
|
613
|
-
(!R || !await (
|
|
614
|
-
const L =
|
|
613
|
+
(!R || !await (o.isElement == null ? void 0 : o.isElement(_))) && (R = s.floating[C] || i.floating[f]);
|
|
614
|
+
const L = M / 2 - D / 2, y = R / 2 - h[f] / 2 - 1, S = ce(u[m], y), E = ce(u[x], y), I = S, T = R - h[f] - E, A = R / 2 - h[f] / 2 + L, $ = qe(I, A, T), N = !d.arrow && xe(r) != null && A !== $ && i.reference[f] / 2 - (A < I ? S : E) - h[f] / 2 < 0, z = N ? A < I ? A - I : A - T : 0;
|
|
615
615
|
return {
|
|
616
|
-
[
|
|
616
|
+
[p]: g[p] + z,
|
|
617
617
|
data: {
|
|
618
|
-
[
|
|
618
|
+
[p]: $,
|
|
619
619
|
centerOffset: A - $ - z,
|
|
620
620
|
...N && {
|
|
621
621
|
alignmentOffset: z
|
|
@@ -624,7 +624,7 @@ const Ma = (e) => ({
|
|
|
624
624
|
reset: N
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
}),
|
|
627
|
+
}), Ia = function(e) {
|
|
628
628
|
return e === void 0 && (e = {}), {
|
|
629
629
|
name: "flip",
|
|
630
630
|
options: e,
|
|
@@ -632,62 +632,62 @@ const Ma = (e) => ({
|
|
|
632
632
|
var t, n;
|
|
633
633
|
const {
|
|
634
634
|
placement: r,
|
|
635
|
-
middlewareData:
|
|
636
|
-
rects:
|
|
635
|
+
middlewareData: i,
|
|
636
|
+
rects: o,
|
|
637
637
|
initialPlacement: s,
|
|
638
638
|
platform: d,
|
|
639
639
|
elements: l
|
|
640
640
|
} = a, {
|
|
641
641
|
mainAxis: c = !0,
|
|
642
642
|
crossAxis: u = !0,
|
|
643
|
-
fallbackPlacements:
|
|
644
|
-
fallbackStrategy:
|
|
643
|
+
fallbackPlacements: g,
|
|
644
|
+
fallbackStrategy: p = "bestFit",
|
|
645
645
|
fallbackAxisSideDirection: f = "none",
|
|
646
646
|
flipAlignment: h = !0,
|
|
647
647
|
...v
|
|
648
|
-
} =
|
|
649
|
-
if ((t =
|
|
648
|
+
} = we(e, a);
|
|
649
|
+
if ((t = i.arrow) != null && t.alignmentOffset)
|
|
650
650
|
return {};
|
|
651
|
-
const m = ne(r),
|
|
652
|
-
!
|
|
653
|
-
const R = [s, ...D], L = await
|
|
654
|
-
let
|
|
651
|
+
const m = ne(r), x = G(s), C = ne(s) === s, M = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), D = g || (C || !h ? [Ae(s)] : Da(s)), _ = f !== "none";
|
|
652
|
+
!g && _ && D.push(...Ma(s, h, f, M));
|
|
653
|
+
const R = [s, ...D], L = await _t(a, v), y = [];
|
|
654
|
+
let S = ((n = i.flip) == null ? void 0 : n.overflows) || [];
|
|
655
655
|
if (c && y.push(L[m]), u) {
|
|
656
|
-
const A =
|
|
656
|
+
const A = va(r, o, M);
|
|
657
657
|
y.push(L[A[0]], L[A[1]]);
|
|
658
658
|
}
|
|
659
|
-
if (
|
|
659
|
+
if (S = [...S, {
|
|
660
660
|
placement: r,
|
|
661
661
|
overflows: y
|
|
662
662
|
}], !y.every((A) => A <= 0)) {
|
|
663
|
-
var
|
|
664
|
-
const A = (((
|
|
665
|
-
if ($ && (!(u === "alignment" ?
|
|
663
|
+
var E, I;
|
|
664
|
+
const A = (((E = i.flip) == null ? void 0 : E.index) || 0) + 1, $ = R[A];
|
|
665
|
+
if ($ && (!(u === "alignment" ? x !== G($) : !1) || // We leave the current main axis only if every placement on that axis
|
|
666
666
|
// overflows the main axis.
|
|
667
|
-
|
|
667
|
+
S.every((P) => G(P.placement) === x ? P.overflows[0] > 0 : !0)))
|
|
668
668
|
return {
|
|
669
669
|
data: {
|
|
670
670
|
index: A,
|
|
671
|
-
overflows:
|
|
671
|
+
overflows: S
|
|
672
672
|
},
|
|
673
673
|
reset: {
|
|
674
674
|
placement: $
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
let N = (
|
|
677
|
+
let N = (I = S.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : I.placement;
|
|
678
678
|
if (!N)
|
|
679
|
-
switch (
|
|
679
|
+
switch (p) {
|
|
680
680
|
case "bestFit": {
|
|
681
681
|
var T;
|
|
682
|
-
const z = (T =
|
|
682
|
+
const z = (T = S.filter((P) => {
|
|
683
683
|
if (_) {
|
|
684
|
-
const
|
|
685
|
-
return
|
|
684
|
+
const q = G(P.placement);
|
|
685
|
+
return q === x || // Create a bias to the `y` side axis due to horizontal
|
|
686
686
|
// reading directions favoring greater width.
|
|
687
|
-
|
|
687
|
+
q === "y";
|
|
688
688
|
}
|
|
689
689
|
return !0;
|
|
690
|
-
}).map((P) => [P.placement, P.overflows.filter((
|
|
690
|
+
}).map((P) => [P.placement, P.overflows.filter((q) => q > 0).reduce((q, H) => q + H, 0)]).sort((P, q) => P[1] - q[1])[0]) == null ? void 0 : T[0];
|
|
691
691
|
z && (N = z);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
@@ -705,16 +705,16 @@ const Ma = (e) => ({
|
|
|
705
705
|
return {};
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
},
|
|
709
|
-
async function
|
|
708
|
+
}, Ra = /* @__PURE__ */ new Set(["left", "top"]);
|
|
709
|
+
async function Aa(e, a) {
|
|
710
710
|
const {
|
|
711
711
|
placement: t,
|
|
712
712
|
platform: n,
|
|
713
713
|
elements: r
|
|
714
|
-
} = e,
|
|
714
|
+
} = e, i = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), o = ne(t), s = xe(t), d = G(t) === "y", l = Ra.has(o) ? -1 : 1, c = i && d ? -1 : 1, u = we(a, e);
|
|
715
715
|
let {
|
|
716
|
-
mainAxis:
|
|
717
|
-
crossAxis:
|
|
716
|
+
mainAxis: g,
|
|
717
|
+
crossAxis: p,
|
|
718
718
|
alignmentAxis: f
|
|
719
719
|
} = typeof u == "number" ? {
|
|
720
720
|
mainAxis: u,
|
|
@@ -725,15 +725,15 @@ async function Ia(e, a) {
|
|
|
725
725
|
crossAxis: u.crossAxis || 0,
|
|
726
726
|
alignmentAxis: u.alignmentAxis
|
|
727
727
|
};
|
|
728
|
-
return s && typeof f == "number" && (
|
|
729
|
-
x:
|
|
730
|
-
y:
|
|
728
|
+
return s && typeof f == "number" && (p = s === "end" ? f * -1 : f), d ? {
|
|
729
|
+
x: p * c,
|
|
730
|
+
y: g * l
|
|
731
731
|
} : {
|
|
732
|
-
x:
|
|
733
|
-
y:
|
|
732
|
+
x: g * l,
|
|
733
|
+
y: p * c
|
|
734
734
|
};
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const Ta = function(e) {
|
|
737
737
|
return e === void 0 && (e = 0), {
|
|
738
738
|
name: "offset",
|
|
739
739
|
options: e,
|
|
@@ -741,21 +741,21 @@ const Ea = function(e) {
|
|
|
741
741
|
var t, n;
|
|
742
742
|
const {
|
|
743
743
|
x: r,
|
|
744
|
-
y:
|
|
745
|
-
placement:
|
|
744
|
+
y: i,
|
|
745
|
+
placement: o,
|
|
746
746
|
middlewareData: s
|
|
747
|
-
} = a, d = await
|
|
748
|
-
return
|
|
747
|
+
} = a, d = await Aa(a, e);
|
|
748
|
+
return o === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
749
749
|
x: r + d.x,
|
|
750
|
-
y:
|
|
750
|
+
y: i + d.y,
|
|
751
751
|
data: {
|
|
752
752
|
...d,
|
|
753
|
-
placement:
|
|
753
|
+
placement: o
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
},
|
|
758
|
+
}, ka = function(e) {
|
|
759
759
|
return e === void 0 && (e = {}), {
|
|
760
760
|
name: "shift",
|
|
761
761
|
options: e,
|
|
@@ -765,37 +765,37 @@ const Ea = function(e) {
|
|
|
765
765
|
y: n,
|
|
766
766
|
placement: r
|
|
767
767
|
} = a, {
|
|
768
|
-
mainAxis:
|
|
769
|
-
crossAxis:
|
|
768
|
+
mainAxis: i = !0,
|
|
769
|
+
crossAxis: o = !1,
|
|
770
770
|
limiter: s = {
|
|
771
771
|
fn: (v) => {
|
|
772
772
|
let {
|
|
773
773
|
x: m,
|
|
774
|
-
y:
|
|
774
|
+
y: x
|
|
775
775
|
} = v;
|
|
776
776
|
return {
|
|
777
777
|
x: m,
|
|
778
|
-
y:
|
|
778
|
+
y: x
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
781
|
},
|
|
782
782
|
...d
|
|
783
|
-
} =
|
|
783
|
+
} = we(e, a), l = {
|
|
784
784
|
x: t,
|
|
785
785
|
y: n
|
|
786
|
-
}, c = await
|
|
787
|
-
let
|
|
788
|
-
if (o) {
|
|
789
|
-
const v = p === "y" ? "top" : "left", m = p === "y" ? "bottom" : "right", M = g + c[v], C = g - c[m];
|
|
790
|
-
g = Be(M, g, C);
|
|
791
|
-
}
|
|
786
|
+
}, c = await _t(a, d), u = G(ne(r)), g = vt(u);
|
|
787
|
+
let p = l[g], f = l[u];
|
|
792
788
|
if (i) {
|
|
793
|
-
const v =
|
|
794
|
-
|
|
789
|
+
const v = g === "y" ? "top" : "left", m = g === "y" ? "bottom" : "right", x = p + c[v], C = p - c[m];
|
|
790
|
+
p = qe(x, p, C);
|
|
791
|
+
}
|
|
792
|
+
if (o) {
|
|
793
|
+
const v = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", x = f + c[v], C = f - c[m];
|
|
794
|
+
f = qe(x, f, C);
|
|
795
795
|
}
|
|
796
796
|
const h = s.fn({
|
|
797
797
|
...a,
|
|
798
|
-
[
|
|
798
|
+
[g]: p,
|
|
799
799
|
[u]: f
|
|
800
800
|
});
|
|
801
801
|
return {
|
|
@@ -804,19 +804,19 @@ const Ea = function(e) {
|
|
|
804
804
|
x: h.x - t,
|
|
805
805
|
y: h.y - n,
|
|
806
806
|
enabled: {
|
|
807
|
-
[
|
|
808
|
-
[u]:
|
|
807
|
+
[g]: i,
|
|
808
|
+
[u]: o
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
813
|
};
|
|
814
814
|
};
|
|
815
|
-
function
|
|
815
|
+
function Ne() {
|
|
816
816
|
return typeof window < "u";
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
return
|
|
818
|
+
function fe(e) {
|
|
819
|
+
return wt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
820
820
|
}
|
|
821
821
|
function F(e) {
|
|
822
822
|
var a;
|
|
@@ -824,37 +824,37 @@ function F(e) {
|
|
|
824
824
|
}
|
|
825
825
|
function K(e) {
|
|
826
826
|
var a;
|
|
827
|
-
return (a = (
|
|
827
|
+
return (a = (wt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : a.documentElement;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
return
|
|
829
|
+
function wt(e) {
|
|
830
|
+
return Ne() ? e instanceof Node || e instanceof F(e).Node : !1;
|
|
831
831
|
}
|
|
832
|
-
function
|
|
833
|
-
return
|
|
832
|
+
function B(e) {
|
|
833
|
+
return Ne() ? e instanceof Element || e instanceof F(e).Element : !1;
|
|
834
834
|
}
|
|
835
835
|
function W(e) {
|
|
836
|
-
return
|
|
836
|
+
return Ne() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
return !
|
|
838
|
+
function dt(e) {
|
|
839
|
+
return !Ne() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
841
|
+
const La = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
842
|
+
function Me(e) {
|
|
843
843
|
const {
|
|
844
844
|
overflow: a,
|
|
845
845
|
overflowX: t,
|
|
846
846
|
overflowY: n,
|
|
847
847
|
display: r
|
|
848
|
-
} =
|
|
849
|
-
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !
|
|
848
|
+
} = V(e);
|
|
849
|
+
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !La.has(r);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
853
|
-
return
|
|
851
|
+
const $a = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
+
function za(e) {
|
|
853
|
+
return $a.has(fe(e));
|
|
854
854
|
}
|
|
855
|
-
const
|
|
856
|
-
function
|
|
857
|
-
return
|
|
855
|
+
const Pa = [":popover-open", ":modal"];
|
|
856
|
+
function Fe(e) {
|
|
857
|
+
return Pa.some((a) => {
|
|
858
858
|
try {
|
|
859
859
|
return e.matches(a);
|
|
860
860
|
} catch {
|
|
@@ -862,34 +862,34 @@ function Pe(e) {
|
|
|
862
862
|
}
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
const
|
|
866
|
-
function
|
|
867
|
-
const a =
|
|
868
|
-
return
|
|
865
|
+
const Na = ["transform", "translate", "scale", "rotate", "perspective"], Fa = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Ha = ["paint", "layout", "strict", "content"];
|
|
866
|
+
function et(e) {
|
|
867
|
+
const a = tt(), t = B(e) ? V(e) : e;
|
|
868
|
+
return Na.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) || Fa.some((n) => (t.willChange || "").includes(n)) || Ha.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Oa(e) {
|
|
871
871
|
let a = X(e);
|
|
872
|
-
for (; W(a) && !
|
|
873
|
-
if (
|
|
872
|
+
for (; W(a) && !ue(a); ) {
|
|
873
|
+
if (et(a))
|
|
874
874
|
return a;
|
|
875
|
-
if (
|
|
875
|
+
if (Fe(a))
|
|
876
876
|
return null;
|
|
877
877
|
a = X(a);
|
|
878
878
|
}
|
|
879
879
|
return null;
|
|
880
880
|
}
|
|
881
|
-
function
|
|
881
|
+
function tt() {
|
|
882
882
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
883
883
|
}
|
|
884
|
-
const
|
|
885
|
-
function
|
|
886
|
-
return
|
|
884
|
+
const Ya = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
885
|
+
function ue(e) {
|
|
886
|
+
return Ya.has(fe(e));
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function V(e) {
|
|
889
889
|
return F(e).getComputedStyle(e);
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
891
|
+
function He(e) {
|
|
892
|
+
return B(e) ? {
|
|
893
893
|
scrollLeft: e.scrollLeft,
|
|
894
894
|
scrollTop: e.scrollTop
|
|
895
895
|
} : {
|
|
@@ -898,188 +898,188 @@ function Ne(e) {
|
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
function X(e) {
|
|
901
|
-
if (
|
|
901
|
+
if (fe(e) === "html")
|
|
902
902
|
return e;
|
|
903
903
|
const a = (
|
|
904
904
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
905
905
|
e.assignedSlot || // DOM Element detected.
|
|
906
906
|
e.parentNode || // ShadowRoot detected.
|
|
907
|
-
|
|
907
|
+
dt(e) && e.host || // Fallback.
|
|
908
908
|
K(e)
|
|
909
909
|
);
|
|
910
|
-
return
|
|
910
|
+
return dt(a) ? a.host : a;
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function xt(e) {
|
|
913
913
|
const a = X(e);
|
|
914
|
-
return
|
|
914
|
+
return ue(a) ? e.ownerDocument ? e.ownerDocument.body : e.body : W(a) && Me(a) ? a : xt(a);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function ge(e, a, t) {
|
|
917
917
|
var n;
|
|
918
918
|
a === void 0 && (a = []), t === void 0 && (t = !0);
|
|
919
|
-
const r =
|
|
920
|
-
if (
|
|
921
|
-
const s =
|
|
922
|
-
return a.concat(
|
|
919
|
+
const r = xt(e), i = r === ((n = e.ownerDocument) == null ? void 0 : n.body), o = F(r);
|
|
920
|
+
if (i) {
|
|
921
|
+
const s = je(o);
|
|
922
|
+
return a.concat(o, o.visualViewport || [], Me(r) ? r : [], s && t ? ge(s) : []);
|
|
923
923
|
}
|
|
924
|
-
return a.concat(r,
|
|
924
|
+
return a.concat(r, ge(r, [], t));
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function je(e) {
|
|
927
927
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
const a =
|
|
929
|
+
function Mt(e) {
|
|
930
|
+
const a = V(e);
|
|
931
931
|
let t = parseFloat(a.width) || 0, n = parseFloat(a.height) || 0;
|
|
932
|
-
const r = W(e),
|
|
933
|
-
return s && (t =
|
|
932
|
+
const r = W(e), i = r ? e.offsetWidth : t, o = r ? e.offsetHeight : n, s = Re(t) !== i || Re(n) !== o;
|
|
933
|
+
return s && (t = i, n = o), {
|
|
934
934
|
width: t,
|
|
935
935
|
height: n,
|
|
936
936
|
$: s
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
939
|
+
function at(e) {
|
|
940
|
+
return B(e) ? e : e.contextElement;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
943
|
-
const a =
|
|
942
|
+
function de(e) {
|
|
943
|
+
const a = at(e);
|
|
944
944
|
if (!W(a))
|
|
945
945
|
return j(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
947
947
|
width: n,
|
|
948
948
|
height: r,
|
|
949
|
-
$:
|
|
950
|
-
} =
|
|
951
|
-
let
|
|
952
|
-
return (!
|
|
953
|
-
x:
|
|
949
|
+
$: i
|
|
950
|
+
} = Mt(a);
|
|
951
|
+
let o = (i ? Re(t.width) : t.width) / n, s = (i ? Re(t.height) : t.height) / r;
|
|
952
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
953
|
+
x: o,
|
|
954
954
|
y: s
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
const
|
|
958
|
-
function
|
|
957
|
+
const Ba = /* @__PURE__ */ j(0);
|
|
958
|
+
function St(e) {
|
|
959
959
|
const a = F(e);
|
|
960
|
-
return !
|
|
960
|
+
return !tt() || !a.visualViewport ? Ba : {
|
|
961
961
|
x: a.visualViewport.offsetLeft,
|
|
962
962
|
y: a.visualViewport.offsetTop
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Va(e, a, t) {
|
|
966
966
|
return a === void 0 && (a = !1), !t || a && t !== F(e) ? !1 : a;
|
|
967
967
|
}
|
|
968
968
|
function re(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const r = e.getBoundingClientRect(),
|
|
971
|
-
let
|
|
972
|
-
a && (n ?
|
|
973
|
-
const s =
|
|
974
|
-
let d = (r.left + s.x) /
|
|
975
|
-
if (
|
|
976
|
-
const
|
|
977
|
-
let f =
|
|
978
|
-
for (; h && n &&
|
|
979
|
-
const v =
|
|
980
|
-
d *= v.x, l *= v.y, c *= v.x, u *= v.y, d += C, l +=
|
|
970
|
+
const r = e.getBoundingClientRect(), i = at(e);
|
|
971
|
+
let o = j(1);
|
|
972
|
+
a && (n ? B(n) && (o = de(n)) : o = de(e));
|
|
973
|
+
const s = Va(i, t, n) ? St(i) : j(0);
|
|
974
|
+
let d = (r.left + s.x) / o.x, l = (r.top + s.y) / o.y, c = r.width / o.x, u = r.height / o.y;
|
|
975
|
+
if (i) {
|
|
976
|
+
const g = F(i), p = n && B(n) ? F(n) : n;
|
|
977
|
+
let f = g, h = je(f);
|
|
978
|
+
for (; h && n && p !== f; ) {
|
|
979
|
+
const v = de(h), m = h.getBoundingClientRect(), x = V(h), C = m.left + (h.clientLeft + parseFloat(x.paddingLeft)) * v.x, M = m.top + (h.clientTop + parseFloat(x.paddingTop)) * v.y;
|
|
980
|
+
d *= v.x, l *= v.y, c *= v.x, u *= v.y, d += C, l += M, f = F(h), h = je(f);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
return
|
|
983
|
+
return Te({
|
|
984
984
|
width: c,
|
|
985
985
|
height: u,
|
|
986
986
|
x: d,
|
|
987
987
|
y: l
|
|
988
988
|
});
|
|
989
989
|
}
|
|
990
|
-
function
|
|
991
|
-
const t =
|
|
990
|
+
function Oe(e, a) {
|
|
991
|
+
const t = He(e).scrollLeft;
|
|
992
992
|
return a ? a.left + t : re(K(e)).left + t;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft -
|
|
994
|
+
function Ct(e, a) {
|
|
995
|
+
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Oe(e, t), r = t.top + a.scrollTop;
|
|
996
996
|
return {
|
|
997
997
|
x: n,
|
|
998
998
|
y: r
|
|
999
999
|
};
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function qa(e) {
|
|
1002
1002
|
let {
|
|
1003
1003
|
elements: a,
|
|
1004
1004
|
rect: t,
|
|
1005
1005
|
offsetParent: n,
|
|
1006
1006
|
strategy: r
|
|
1007
1007
|
} = e;
|
|
1008
|
-
const
|
|
1009
|
-
if (n ===
|
|
1008
|
+
const i = r === "fixed", o = K(n), s = a ? Fe(a.floating) : !1;
|
|
1009
|
+
if (n === o || s && i)
|
|
1010
1010
|
return t;
|
|
1011
1011
|
let d = {
|
|
1012
1012
|
scrollLeft: 0,
|
|
1013
1013
|
scrollTop: 0
|
|
1014
1014
|
}, l = j(1);
|
|
1015
1015
|
const c = j(0), u = W(n);
|
|
1016
|
-
if ((u || !u && !
|
|
1017
|
-
const
|
|
1018
|
-
l =
|
|
1016
|
+
if ((u || !u && !i) && ((fe(n) !== "body" || Me(o)) && (d = He(n)), W(n))) {
|
|
1017
|
+
const p = re(n);
|
|
1018
|
+
l = de(n), c.x = p.x + n.clientLeft, c.y = p.y + n.clientTop;
|
|
1019
1019
|
}
|
|
1020
|
-
const
|
|
1020
|
+
const g = o && !u && !i ? Ct(o, d) : j(0);
|
|
1021
1021
|
return {
|
|
1022
1022
|
width: t.width * l.x,
|
|
1023
1023
|
height: t.height * l.y,
|
|
1024
|
-
x: t.x * l.x - d.scrollLeft * l.x + c.x +
|
|
1025
|
-
y: t.y * l.y - d.scrollTop * l.y + c.y +
|
|
1024
|
+
x: t.x * l.x - d.scrollLeft * l.x + c.x + g.x,
|
|
1025
|
+
y: t.y * l.y - d.scrollTop * l.y + c.y + g.y
|
|
1026
1026
|
};
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function Ua(e) {
|
|
1029
1029
|
return Array.from(e.getClientRects());
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1032
|
-
const a = K(e), t =
|
|
1033
|
-
let
|
|
1031
|
+
function ja(e) {
|
|
1032
|
+
const a = K(e), t = He(e), n = e.ownerDocument.body, r = te(a.scrollWidth, a.clientWidth, n.scrollWidth, n.clientWidth), i = te(a.scrollHeight, a.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1033
|
+
let o = -t.scrollLeft + Oe(e);
|
|
1034
1034
|
const s = -t.scrollTop;
|
|
1035
|
-
return
|
|
1035
|
+
return V(n).direction === "rtl" && (o += te(a.clientWidth, n.clientWidth) - r), {
|
|
1036
1036
|
width: r,
|
|
1037
|
-
height:
|
|
1038
|
-
x:
|
|
1037
|
+
height: i,
|
|
1038
|
+
x: o,
|
|
1039
1039
|
y: s
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
|
-
const
|
|
1043
|
-
function
|
|
1042
|
+
const lt = 25;
|
|
1043
|
+
function Wa(e, a) {
|
|
1044
1044
|
const t = F(e), n = K(e), r = t.visualViewport;
|
|
1045
|
-
let
|
|
1045
|
+
let i = n.clientWidth, o = n.clientHeight, s = 0, d = 0;
|
|
1046
1046
|
if (r) {
|
|
1047
|
-
|
|
1048
|
-
const c =
|
|
1047
|
+
i = r.width, o = r.height;
|
|
1048
|
+
const c = tt();
|
|
1049
1049
|
(!c || c && a === "fixed") && (s = r.offsetLeft, d = r.offsetTop);
|
|
1050
1050
|
}
|
|
1051
|
-
const l =
|
|
1051
|
+
const l = Oe(n);
|
|
1052
1052
|
if (l <= 0) {
|
|
1053
|
-
const c = n.ownerDocument, u = c.body,
|
|
1054
|
-
f <=
|
|
1055
|
-
} else l <=
|
|
1053
|
+
const c = n.ownerDocument, u = c.body, g = getComputedStyle(u), p = c.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, f = Math.abs(n.clientWidth - u.clientWidth - p);
|
|
1054
|
+
f <= lt && (i -= f);
|
|
1055
|
+
} else l <= lt && (i += l);
|
|
1056
1056
|
return {
|
|
1057
|
-
width:
|
|
1058
|
-
height:
|
|
1057
|
+
width: i,
|
|
1058
|
+
height: o,
|
|
1059
1059
|
x: s,
|
|
1060
1060
|
y: d
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
|
-
const
|
|
1064
|
-
function
|
|
1065
|
-
const t = re(e, !0, a === "fixed"), n = t.top + e.clientTop, r = t.left + e.clientLeft,
|
|
1063
|
+
const Ka = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1064
|
+
function Ga(e, a) {
|
|
1065
|
+
const t = re(e, !0, a === "fixed"), n = t.top + e.clientTop, r = t.left + e.clientLeft, i = W(e) ? de(e) : j(1), o = e.clientWidth * i.x, s = e.clientHeight * i.y, d = r * i.x, l = n * i.y;
|
|
1066
1066
|
return {
|
|
1067
|
-
width:
|
|
1067
|
+
width: o,
|
|
1068
1068
|
height: s,
|
|
1069
1069
|
x: d,
|
|
1070
1070
|
y: l
|
|
1071
1071
|
};
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function ct(e, a, t) {
|
|
1074
1074
|
let n;
|
|
1075
1075
|
if (a === "viewport")
|
|
1076
|
-
n =
|
|
1076
|
+
n = Wa(e, t);
|
|
1077
1077
|
else if (a === "document")
|
|
1078
|
-
n =
|
|
1079
|
-
else if (
|
|
1080
|
-
n =
|
|
1078
|
+
n = ja(K(e));
|
|
1079
|
+
else if (B(a))
|
|
1080
|
+
n = Ga(a, t);
|
|
1081
1081
|
else {
|
|
1082
|
-
const r =
|
|
1082
|
+
const r = St(e);
|
|
1083
1083
|
n = {
|
|
1084
1084
|
x: a.x - r.x,
|
|
1085
1085
|
y: a.y - r.y,
|
|
@@ -1087,36 +1087,36 @@ function dt(e, a, t) {
|
|
|
1087
1087
|
height: a.height
|
|
1088
1088
|
};
|
|
1089
1089
|
}
|
|
1090
|
-
return
|
|
1090
|
+
return Te(n);
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function Et(e, a) {
|
|
1093
1093
|
const t = X(e);
|
|
1094
|
-
return t === a || !
|
|
1094
|
+
return t === a || !B(t) || ue(t) ? !1 : V(t).position === "fixed" || Et(t, a);
|
|
1095
1095
|
}
|
|
1096
|
-
function
|
|
1096
|
+
function Xa(e, a) {
|
|
1097
1097
|
const t = a.get(e);
|
|
1098
1098
|
if (t)
|
|
1099
1099
|
return t;
|
|
1100
|
-
let n =
|
|
1101
|
-
const
|
|
1102
|
-
let
|
|
1103
|
-
for (;
|
|
1104
|
-
const s =
|
|
1105
|
-
!d && s.position === "fixed" && (r = null), (
|
|
1100
|
+
let n = ge(e, [], !1).filter((s) => B(s) && fe(s) !== "body"), r = null;
|
|
1101
|
+
const i = V(e).position === "fixed";
|
|
1102
|
+
let o = i ? X(e) : e;
|
|
1103
|
+
for (; B(o) && !ue(o); ) {
|
|
1104
|
+
const s = V(o), d = et(o);
|
|
1105
|
+
!d && s.position === "fixed" && (r = null), (i ? !d && !r : !d && s.position === "static" && !!r && Ka.has(r.position) || Me(o) && !d && Et(e, o)) ? n = n.filter((c) => c !== o) : r = s, o = X(o);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function Ja(e) {
|
|
1110
1110
|
let {
|
|
1111
1111
|
element: a,
|
|
1112
1112
|
boundary: t,
|
|
1113
1113
|
rootBoundary: n,
|
|
1114
1114
|
strategy: r
|
|
1115
1115
|
} = e;
|
|
1116
|
-
const
|
|
1117
|
-
const u =
|
|
1118
|
-
return l.top = te(u.top, l.top), l.right =
|
|
1119
|
-
},
|
|
1116
|
+
const o = [...t === "clippingAncestors" ? Fe(a) ? [] : Xa(a, this._c) : [].concat(t), n], s = o[0], d = o.reduce((l, c) => {
|
|
1117
|
+
const u = ct(a, c, r);
|
|
1118
|
+
return l.top = te(u.top, l.top), l.right = ce(u.right, l.right), l.bottom = ce(u.bottom, l.bottom), l.left = te(u.left, l.left), l;
|
|
1119
|
+
}, ct(a, s, r));
|
|
1120
1120
|
return {
|
|
1121
1121
|
width: d.right - d.left,
|
|
1122
1122
|
height: d.bottom - d.top,
|
|
@@ -1124,73 +1124,73 @@ function Ka(e) {
|
|
|
1124
1124
|
y: d.top
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function Qa(e) {
|
|
1128
1128
|
const {
|
|
1129
1129
|
width: a,
|
|
1130
1130
|
height: t
|
|
1131
|
-
} =
|
|
1131
|
+
} = Mt(e);
|
|
1132
1132
|
return {
|
|
1133
1133
|
width: a,
|
|
1134
1134
|
height: t
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1138
|
-
const n = W(a), r = K(a),
|
|
1137
|
+
function Za(e, a, t) {
|
|
1138
|
+
const n = W(a), r = K(a), i = t === "fixed", o = re(e, !0, i, a);
|
|
1139
1139
|
let s = {
|
|
1140
1140
|
scrollLeft: 0,
|
|
1141
1141
|
scrollTop: 0
|
|
1142
1142
|
};
|
|
1143
1143
|
const d = j(0);
|
|
1144
1144
|
function l() {
|
|
1145
|
-
d.x =
|
|
1145
|
+
d.x = Oe(r);
|
|
1146
1146
|
}
|
|
1147
|
-
if (n || !n && !
|
|
1148
|
-
if ((
|
|
1149
|
-
const
|
|
1150
|
-
d.x =
|
|
1147
|
+
if (n || !n && !i)
|
|
1148
|
+
if ((fe(a) !== "body" || Me(r)) && (s = He(a)), n) {
|
|
1149
|
+
const p = re(a, !0, i, a);
|
|
1150
|
+
d.x = p.x + a.clientLeft, d.y = p.y + a.clientTop;
|
|
1151
1151
|
} else r && l();
|
|
1152
|
-
|
|
1153
|
-
const c = r && !n && !
|
|
1152
|
+
i && !n && r && l();
|
|
1153
|
+
const c = r && !n && !i ? Ct(r, s) : j(0), u = o.left + s.scrollLeft - d.x - c.x, g = o.top + s.scrollTop - d.y - c.y;
|
|
1154
1154
|
return {
|
|
1155
1155
|
x: u,
|
|
1156
|
-
y:
|
|
1157
|
-
width:
|
|
1158
|
-
height:
|
|
1156
|
+
y: g,
|
|
1157
|
+
width: o.width,
|
|
1158
|
+
height: o.height
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return
|
|
1161
|
+
function Ve(e) {
|
|
1162
|
+
return V(e).position === "static";
|
|
1163
1163
|
}
|
|
1164
|
-
function
|
|
1165
|
-
if (!W(e) ||
|
|
1164
|
+
function ut(e, a) {
|
|
1165
|
+
if (!W(e) || V(e).position === "fixed")
|
|
1166
1166
|
return null;
|
|
1167
1167
|
if (a)
|
|
1168
1168
|
return a(e);
|
|
1169
1169
|
let t = e.offsetParent;
|
|
1170
1170
|
return K(e) === t && (t = t.ownerDocument.body), t;
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function It(e, a) {
|
|
1173
1173
|
const t = F(e);
|
|
1174
|
-
if (
|
|
1174
|
+
if (Fe(e))
|
|
1175
1175
|
return t;
|
|
1176
1176
|
if (!W(e)) {
|
|
1177
1177
|
let r = X(e);
|
|
1178
|
-
for (; r && !
|
|
1179
|
-
if (
|
|
1178
|
+
for (; r && !ue(r); ) {
|
|
1179
|
+
if (B(r) && !Ve(r))
|
|
1180
1180
|
return r;
|
|
1181
1181
|
r = X(r);
|
|
1182
1182
|
}
|
|
1183
1183
|
return t;
|
|
1184
1184
|
}
|
|
1185
|
-
let n =
|
|
1186
|
-
for (; n &&
|
|
1187
|
-
n =
|
|
1188
|
-
return n &&
|
|
1185
|
+
let n = ut(e, a);
|
|
1186
|
+
for (; n && za(n) && Ve(n); )
|
|
1187
|
+
n = ut(n, a);
|
|
1188
|
+
return n && ue(n) && Ve(n) && !et(n) ? t : n || Oa(e) || t;
|
|
1189
1189
|
}
|
|
1190
|
-
const
|
|
1191
|
-
const a = this.getOffsetParent ||
|
|
1190
|
+
const en = async function(e) {
|
|
1191
|
+
const a = this.getOffsetParent || It, t = this.getDimensions, n = await t(e.floating);
|
|
1192
1192
|
return {
|
|
1193
|
-
reference:
|
|
1193
|
+
reference: Za(e.reference, await a(e.floating), e.strategy),
|
|
1194
1194
|
floating: {
|
|
1195
1195
|
x: 0,
|
|
1196
1196
|
y: 0,
|
|
@@ -1199,56 +1199,56 @@ const Ja = async function(e) {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
1201
|
};
|
|
1202
|
-
function
|
|
1203
|
-
return
|
|
1202
|
+
function tn(e) {
|
|
1203
|
+
return V(e).direction === "rtl";
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1206
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1205
|
+
const Rt = {
|
|
1206
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: qa,
|
|
1207
1207
|
getDocumentElement: K,
|
|
1208
|
-
getClippingRect:
|
|
1209
|
-
getOffsetParent:
|
|
1210
|
-
getElementRects:
|
|
1211
|
-
getClientRects:
|
|
1212
|
-
getDimensions:
|
|
1213
|
-
getScale:
|
|
1214
|
-
isElement:
|
|
1215
|
-
isRTL:
|
|
1208
|
+
getClippingRect: Ja,
|
|
1209
|
+
getOffsetParent: It,
|
|
1210
|
+
getElementRects: en,
|
|
1211
|
+
getClientRects: Ua,
|
|
1212
|
+
getDimensions: Qa,
|
|
1213
|
+
getScale: de,
|
|
1214
|
+
isElement: B,
|
|
1215
|
+
isRTL: tn
|
|
1216
1216
|
};
|
|
1217
|
-
function
|
|
1217
|
+
function At(e, a) {
|
|
1218
1218
|
return e.x === a.x && e.y === a.y && e.width === a.width && e.height === a.height;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function an(e, a) {
|
|
1221
1221
|
let t = null, n;
|
|
1222
1222
|
const r = K(e);
|
|
1223
|
-
function
|
|
1223
|
+
function i() {
|
|
1224
1224
|
var s;
|
|
1225
1225
|
clearTimeout(n), (s = t) == null || s.disconnect(), t = null;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1228
|
-
s === void 0 && (s = !1), d === void 0 && (d = 1),
|
|
1227
|
+
function o(s, d) {
|
|
1228
|
+
s === void 0 && (s = !1), d === void 0 && (d = 1), i();
|
|
1229
1229
|
const l = e.getBoundingClientRect(), {
|
|
1230
1230
|
left: c,
|
|
1231
1231
|
top: u,
|
|
1232
|
-
width:
|
|
1233
|
-
height:
|
|
1232
|
+
width: g,
|
|
1233
|
+
height: p
|
|
1234
1234
|
} = l;
|
|
1235
|
-
if (s || a(), !
|
|
1235
|
+
if (s || a(), !g || !p)
|
|
1236
1236
|
return;
|
|
1237
|
-
const f =
|
|
1237
|
+
const f = Ce(u), h = Ce(r.clientWidth - (c + g)), v = Ce(r.clientHeight - (u + p)), m = Ce(c), C = {
|
|
1238
1238
|
rootMargin: -f + "px " + -h + "px " + -v + "px " + -m + "px",
|
|
1239
|
-
threshold: te(0,
|
|
1239
|
+
threshold: te(0, ce(1, d)) || 1
|
|
1240
1240
|
};
|
|
1241
|
-
let
|
|
1241
|
+
let M = !0;
|
|
1242
1242
|
function D(_) {
|
|
1243
1243
|
const R = _[0].intersectionRatio;
|
|
1244
1244
|
if (R !== d) {
|
|
1245
|
-
if (!
|
|
1246
|
-
return
|
|
1247
|
-
R ?
|
|
1248
|
-
|
|
1245
|
+
if (!M)
|
|
1246
|
+
return o();
|
|
1247
|
+
R ? o(!1, R) : n = setTimeout(() => {
|
|
1248
|
+
o(!1, 1e-7);
|
|
1249
1249
|
}, 1e3);
|
|
1250
1250
|
}
|
|
1251
|
-
R === 1 && !
|
|
1251
|
+
R === 1 && !At(l, e.getBoundingClientRect()) && o(), M = !1;
|
|
1252
1252
|
}
|
|
1253
1253
|
try {
|
|
1254
1254
|
t = new IntersectionObserver(D, {
|
|
@@ -1261,95 +1261,101 @@ function Za(e, a) {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
t.observe(e);
|
|
1263
1263
|
}
|
|
1264
|
-
return
|
|
1264
|
+
return o(!0), i;
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function Tt(e, a, t, n) {
|
|
1267
1267
|
n === void 0 && (n = {});
|
|
1268
1268
|
const {
|
|
1269
1269
|
ancestorScroll: r = !0,
|
|
1270
|
-
ancestorResize:
|
|
1271
|
-
elementResize:
|
|
1270
|
+
ancestorResize: i = !0,
|
|
1271
|
+
elementResize: o = typeof ResizeObserver == "function",
|
|
1272
1272
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
1273
1273
|
animationFrame: d = !1
|
|
1274
|
-
} = n, l =
|
|
1274
|
+
} = n, l = at(e), c = r || i ? [...l ? ge(l) : [], ...ge(a)] : [];
|
|
1275
1275
|
c.forEach((m) => {
|
|
1276
1276
|
r && m.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
1278
|
-
}),
|
|
1278
|
+
}), i && m.addEventListener("resize", t);
|
|
1279
1279
|
});
|
|
1280
|
-
const u = l && s ?
|
|
1281
|
-
let
|
|
1282
|
-
|
|
1283
|
-
let [
|
|
1284
|
-
|
|
1280
|
+
const u = l && s ? an(l, t) : null;
|
|
1281
|
+
let g = -1, p = null;
|
|
1282
|
+
o && (p = new ResizeObserver((m) => {
|
|
1283
|
+
let [x] = m;
|
|
1284
|
+
x && x.target === l && p && (p.unobserve(a), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
1285
1285
|
var C;
|
|
1286
|
-
(C =
|
|
1286
|
+
(C = p) == null || C.observe(a);
|
|
1287
1287
|
})), t();
|
|
1288
|
-
}), l && !d &&
|
|
1288
|
+
}), l && !d && p.observe(l), p.observe(a));
|
|
1289
1289
|
let f, h = d ? re(e) : null;
|
|
1290
1290
|
d && v();
|
|
1291
1291
|
function v() {
|
|
1292
1292
|
const m = re(e);
|
|
1293
|
-
h && !
|
|
1293
|
+
h && !At(h, m) && t(), h = m, f = requestAnimationFrame(v);
|
|
1294
1294
|
}
|
|
1295
1295
|
return t(), () => {
|
|
1296
1296
|
var m;
|
|
1297
|
-
c.forEach((
|
|
1298
|
-
r &&
|
|
1299
|
-
}), u == null || u(), (m =
|
|
1297
|
+
c.forEach((x) => {
|
|
1298
|
+
r && x.removeEventListener("scroll", t), i && x.removeEventListener("resize", t);
|
|
1299
|
+
}), u == null || u(), (m = p) == null || m.disconnect(), p = null, d && cancelAnimationFrame(f);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
-
const
|
|
1302
|
+
const ke = Ta, Le = ka, nt = Ia, kt = Ea, rt = (e, a, t) => {
|
|
1303
1303
|
const n = /* @__PURE__ */ new Map(), r = {
|
|
1304
|
-
platform:
|
|
1304
|
+
platform: Rt,
|
|
1305
1305
|
...t
|
|
1306
|
-
},
|
|
1306
|
+
}, i = {
|
|
1307
1307
|
...r.platform,
|
|
1308
1308
|
_c: n
|
|
1309
1309
|
};
|
|
1310
|
-
return
|
|
1310
|
+
return Ca(e, a, {
|
|
1311
1311
|
...r,
|
|
1312
|
-
platform:
|
|
1312
|
+
platform: i
|
|
1313
1313
|
});
|
|
1314
|
-
},
|
|
1314
|
+
}, nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1315
1315
|
__proto__: null,
|
|
1316
|
-
arrow:
|
|
1317
|
-
autoUpdate:
|
|
1318
|
-
computePosition:
|
|
1319
|
-
flip:
|
|
1320
|
-
getOverflowAncestors:
|
|
1321
|
-
offset:
|
|
1322
|
-
platform:
|
|
1323
|
-
shift:
|
|
1316
|
+
arrow: kt,
|
|
1317
|
+
autoUpdate: Tt,
|
|
1318
|
+
computePosition: rt,
|
|
1319
|
+
flip: nt,
|
|
1320
|
+
getOverflowAncestors: ge,
|
|
1321
|
+
offset: ke,
|
|
1322
|
+
platform: Rt,
|
|
1323
|
+
shift: Le
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
|
-
async function
|
|
1325
|
+
async function Lt(e, a) {
|
|
1326
1326
|
if (!e.options.beforeDateSelectCallback)
|
|
1327
1327
|
return { isValid: !0 };
|
|
1328
1328
|
try {
|
|
1329
|
-
e.isValidating = !0,
|
|
1329
|
+
e.isValidating = !0, ze(e);
|
|
1330
1330
|
const t = await Promise.resolve(e.options.beforeDateSelectCallback(a));
|
|
1331
1331
|
switch (ae(e), e.isValidating = !1, t.action) {
|
|
1332
1332
|
case "accept":
|
|
1333
|
-
return { isValid: !0 };
|
|
1333
|
+
return ie(e), { isValid: !0 };
|
|
1334
1334
|
case "adjust":
|
|
1335
|
-
return a instanceof Date && t.adjustedDate ? { isValid: !0, adjustedDate: t.adjustedDate, message: t.message } : typeof a == "object" && "start" in a && t.adjustedStartDate && t.adjustedEndDate ? {
|
|
1335
|
+
return a instanceof Date && t.adjustedDate ? (t.message && Ke(e, t.message, "info"), { isValid: !0, adjustedDate: t.adjustedDate, message: t.message }) : typeof a == "object" && "start" in a && t.adjustedStartDate && t.adjustedEndDate ? (t.message && Ke(e, t.message, "info"), {
|
|
1336
1336
|
isValid: !0,
|
|
1337
1337
|
adjustedStart: t.adjustedStartDate,
|
|
1338
1338
|
adjustedEnd: t.adjustedEndDate,
|
|
1339
1339
|
message: t.message
|
|
1340
|
-
} : { isValid: !1, message: t.message || "Invalid adjustment" };
|
|
1340
|
+
}) : { isValid: !1, message: t.message || "Invalid adjustment" };
|
|
1341
1341
|
case "restore":
|
|
1342
|
-
return
|
|
1342
|
+
return t.showInvalidRange && typeof a == "object" && "start" in a ? {
|
|
1343
|
+
isValid: !1,
|
|
1344
|
+
message: t.message,
|
|
1345
|
+
showInvalidRange: !0,
|
|
1346
|
+
invalidStart: a.start,
|
|
1347
|
+
invalidEnd: a.end
|
|
1348
|
+
} : { isValid: !1, message: t.message };
|
|
1343
1349
|
case "clear":
|
|
1344
1350
|
return e.clearSelection(), { isValid: !1, message: t.message };
|
|
1345
1351
|
default:
|
|
1346
1352
|
return { isValid: !1, message: "Unknown validation action" };
|
|
1347
1353
|
}
|
|
1348
1354
|
} catch (t) {
|
|
1349
|
-
return ae(e), e.isValidating = !1,
|
|
1355
|
+
return ae(e), e.isValidating = !1, Y.error("beforeDateSelectCallback error:", t), { isValid: !1, message: "Validation error occurred" };
|
|
1350
1356
|
}
|
|
1351
1357
|
}
|
|
1352
|
-
async function
|
|
1358
|
+
async function $t(e, a, t) {
|
|
1353
1359
|
if (Z.debug(" validateRangeAsync called - mode:", e.options.disabledDatesHandling, "start:", a, "end:", t), e.options.disabledDatesHandling === "prevent") {
|
|
1354
1360
|
if (Z.debug(" Checking PREVENT mode"), e.hasDisabledDatesInRange(a, t))
|
|
1355
1361
|
return Z.debug(" PREVENT mode - range contains disabled dates"), { isValid: !1, message: "Range contains disabled dates" };
|
|
@@ -1358,85 +1364,119 @@ async function Lt(e, a, t) {
|
|
|
1358
1364
|
const r = e.findLastEnabledBeforeGap(a, t);
|
|
1359
1365
|
return Z.debug(" BLOCK mode - adjusted end:", r), { isValid: !0, adjustedStart: a, adjustedEnd: r };
|
|
1360
1366
|
}
|
|
1361
|
-
const n = await
|
|
1367
|
+
const n = await Lt(e, { start: a, end: t });
|
|
1362
1368
|
return n.isValid ? n.adjustedStart || n.adjustedEnd ? {
|
|
1363
1369
|
isValid: !0,
|
|
1364
1370
|
adjustedStart: n.adjustedStart,
|
|
1365
1371
|
adjustedEnd: n.adjustedEnd,
|
|
1366
1372
|
message: n.message
|
|
1367
|
-
} : { isValid: !0 } : n
|
|
1368
|
-
|
|
1369
|
-
|
|
1373
|
+
} : { isValid: !0 } : n.showInvalidRange ? {
|
|
1374
|
+
isValid: !1,
|
|
1375
|
+
message: n.message,
|
|
1376
|
+
showInvalidRange: !0,
|
|
1377
|
+
invalidStart: n.invalidStart,
|
|
1378
|
+
invalidEnd: n.invalidEnd
|
|
1379
|
+
} : { isValid: !1, message: n.message };
|
|
1380
|
+
}
|
|
1381
|
+
async function rn(e, a) {
|
|
1370
1382
|
if (a.classList.contains("drp-date-picker__day--disabled")) return;
|
|
1371
1383
|
if (!a.dataset || !a.dataset.date) {
|
|
1372
|
-
|
|
1384
|
+
Y.warn("selectDay() - called with invalid element:", a);
|
|
1373
1385
|
return;
|
|
1374
1386
|
}
|
|
1375
|
-
const [t, n, r] = a.dataset.date.split("-").map(Number),
|
|
1387
|
+
const [t, n, r] = a.dataset.date.split("-").map(Number), i = new Date(t, n - 1, r);
|
|
1388
|
+
let o = null;
|
|
1376
1389
|
a.classList.contains("drp-date-picker__day--other-month");
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
e.activeMonthIndex = parseInt(
|
|
1380
|
-
const
|
|
1381
|
-
e.focusedDayIndex = Array.from(
|
|
1390
|
+
const s = a.closest(".drp-date-picker__days");
|
|
1391
|
+
if (s && s instanceof HTMLElement) {
|
|
1392
|
+
e.activeMonthIndex = parseInt(s.dataset.monthIndex || "0") || 0, oe.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
1393
|
+
const d = s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
1394
|
+
e.focusedDayIndex = Array.from(d).indexOf(a), oe.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
1382
1395
|
}
|
|
1383
1396
|
if (e.options.selectionMode === "single") {
|
|
1384
|
-
const
|
|
1385
|
-
if (!
|
|
1386
|
-
|
|
1397
|
+
const d = await Lt(e, i);
|
|
1398
|
+
if (!d.isValid) {
|
|
1399
|
+
oe.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
1387
1400
|
return;
|
|
1388
1401
|
}
|
|
1389
|
-
|
|
1390
|
-
|
|
1402
|
+
d.message || ie(e);
|
|
1403
|
+
const l = d.adjustedDate || i;
|
|
1404
|
+
d.adjustedDate && !e.isSameDay(i, l) && (o = l), e.selectedDate = l, e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(l))), e.requiresApplyButton() ? e.pendingSelection = l : e.options.onSelect && e.options.onSelect(l), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1391
1405
|
} else if (e.options.selectionMode === "multiple") {
|
|
1392
|
-
const
|
|
1393
|
-
if (
|
|
1394
|
-
const
|
|
1395
|
-
e.input.value =
|
|
1406
|
+
const d = `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}-${String(i.getDate()).padStart(2, "0")}`, l = e.selectedDates.findIndex((c) => `${c.getFullYear()}-${String(c.getMonth() + 1).padStart(2, "0")}-${String(c.getDate()).padStart(2, "0")}` === d);
|
|
1407
|
+
if (l !== -1 ? e.selectedDates.splice(l, 1) : e.selectedDates.push(new Date(i)), e.input && !e.requiresApplyButton()) {
|
|
1408
|
+
const c = e.selectedDates.length + e.selectedRanges.length;
|
|
1409
|
+
e.input.value = c > 0 ? `${c} selection(s)` : "";
|
|
1396
1410
|
}
|
|
1397
1411
|
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;
|
|
1398
1412
|
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
1399
|
-
e.selectedStartDate =
|
|
1413
|
+
e.invalidRangeStart = null, e.invalidRangeEnd = null, e.selectedStartDate = i, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
1400
1414
|
else {
|
|
1401
|
-
let
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1415
|
+
let d = e.selectedStartDate, l = i;
|
|
1416
|
+
i < e.selectedStartDate && (l = e.selectedStartDate, d = i), oe.debug(" selectDay - calling validateRangeAsync with:", d, l);
|
|
1417
|
+
const c = await $t(e, d, l);
|
|
1418
|
+
if (oe.debug(" selectDay - validation result:", c), !c.isValid) {
|
|
1419
|
+
c.message && Y.warn("selectDay() - range validation failed:", c.message), c.showInvalidRange && c.invalidStart && c.invalidEnd && (e.invalidRangeStart = c.invalidStart, e.invalidRangeEnd = c.invalidEnd, e.selectedStartDate = null, e.selectedEndDate = null), e.renderCalendar(), e.updateSummary();
|
|
1406
1420
|
return;
|
|
1407
1421
|
}
|
|
1408
|
-
e.selectedStartDate =
|
|
1409
|
-
const
|
|
1410
|
-
e.requiresApplyButton() ? e.pendingSelection =
|
|
1422
|
+
e.selectedStartDate = c.adjustedStart || d, e.selectedEndDate = c.adjustedEnd || l, e.invalidRangeStart = null, e.invalidRangeEnd = null, c.message || ie(e), e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
1423
|
+
const u = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
1424
|
+
e.requiresApplyButton() ? e.pendingSelection = u : e.options.onSelect && e.options.onSelect(u), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1411
1425
|
}
|
|
1412
|
-
if (e.renderCalendar(), e.updateSummary(),
|
|
1413
|
-
const s = e.selectedEndDate;
|
|
1426
|
+
if (e.renderCalendar(), e.updateSummary(), o)
|
|
1414
1427
|
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1415
1428
|
const l = e.monthDates[d];
|
|
1416
|
-
if (
|
|
1429
|
+
if (o.getFullYear() === l.getFullYear() && o.getMonth() === l.getMonth()) {
|
|
1417
1430
|
e.activeMonthIndex = d;
|
|
1418
|
-
const c = e.calendar.querySelector(
|
|
1431
|
+
const c = e.calendar.querySelector(
|
|
1432
|
+
`.drp-date-picker__days[data-month-index="${d}"]`
|
|
1433
|
+
);
|
|
1419
1434
|
if (c) {
|
|
1420
|
-
const u = c.querySelectorAll(
|
|
1421
|
-
|
|
1435
|
+
const u = c.querySelectorAll(
|
|
1436
|
+
".drp-date-picker__day:not(.drp-date-picker__day--other-month)"
|
|
1437
|
+
), g = Array.from(u).findIndex((p) => {
|
|
1438
|
+
const f = p.dataset.date;
|
|
1422
1439
|
if (!f) return !1;
|
|
1423
|
-
const [h, v, m] = f.split("-").map(Number),
|
|
1424
|
-
return e.isSameDay(
|
|
1440
|
+
const [h, v, m] = f.split("-").map(Number), x = new Date(h, v - 1, m);
|
|
1441
|
+
return e.isSameDay(x, o);
|
|
1425
1442
|
});
|
|
1426
|
-
|
|
1443
|
+
g !== -1 && (e.focusedDayIndex = g, u.forEach(
|
|
1444
|
+
(p) => p.classList.remove("drp-date-picker__day--focused")
|
|
1445
|
+
), u[g] && u[g].classList.add(
|
|
1446
|
+
"drp-date-picker__day--focused"
|
|
1447
|
+
));
|
|
1448
|
+
}
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (e.options.selectionMode === "range" && e.selectedEndDate) {
|
|
1453
|
+
const d = e.selectedEndDate;
|
|
1454
|
+
for (let l = 0; l < e.monthDates.length; l++) {
|
|
1455
|
+
const c = e.monthDates[l];
|
|
1456
|
+
if (d.getFullYear() === c.getFullYear() && d.getMonth() === c.getMonth()) {
|
|
1457
|
+
e.activeMonthIndex = l;
|
|
1458
|
+
const u = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${l}"]`);
|
|
1459
|
+
if (u) {
|
|
1460
|
+
const g = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = Array.from(g).findIndex((f) => {
|
|
1461
|
+
const h = f.dataset.date;
|
|
1462
|
+
if (!h) return !1;
|
|
1463
|
+
const [v, m, x] = h.split("-").map(Number), C = new Date(v, m - 1, x);
|
|
1464
|
+
return e.isSameDay(C, d);
|
|
1465
|
+
});
|
|
1466
|
+
p !== -1 && (e.focusedDayIndex = p, g.forEach((f) => f.classList.remove("drp-date-picker__day--focused")), g[p] && g[p].classList.add("drp-date-picker__day--focused"));
|
|
1427
1467
|
}
|
|
1428
1468
|
break;
|
|
1429
1469
|
}
|
|
1430
1470
|
}
|
|
1431
1471
|
}
|
|
1432
1472
|
}
|
|
1433
|
-
function
|
|
1473
|
+
function on(e) {
|
|
1434
1474
|
e.monthDates[e.activeMonthIndex] = /* @__PURE__ */ new Date(), e.selectedDate = /* @__PURE__ */ new Date(), e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(e.selectedDate))), e.requiresApplyButton() ? e.pendingSelection = e.selectedDate : e.options.onSelect && e.options.onSelect(e.selectedDate), e.renderCalendar(), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1435
1475
|
}
|
|
1436
|
-
function
|
|
1437
|
-
e.selectedDate = null, e.selectedStartDate = null, e.selectedEndDate = null, e.selectedRanges = [], e.selectedDates = [], e.pendingSelection = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.focusedDayIndex = null, e.input && (e.input.value = ""), e.renderCalendar(), e.updateSummary();
|
|
1476
|
+
function sn(e) {
|
|
1477
|
+
e.selectedDate = null, e.selectedStartDate = null, e.selectedEndDate = null, e.selectedRanges = [], e.selectedDates = [], e.pendingSelection = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.invalidRangeStart = null, e.invalidRangeEnd = null, e.focusedDayIndex = null, ie(e), e.input && (e.input.value = ""), e.renderCalendar(), e.updateSummary();
|
|
1438
1478
|
}
|
|
1439
|
-
function
|
|
1479
|
+
function dn(e) {
|
|
1440
1480
|
if (e.input) {
|
|
1441
1481
|
if (e.options.selectionMode === "range" && e.selectedStartDate && e.selectedEndDate)
|
|
1442
1482
|
e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`;
|
|
@@ -1449,17 +1489,17 @@ function rn(e) {
|
|
|
1449
1489
|
}
|
|
1450
1490
|
e.pendingSelection && (e.options.onSelect && e.options.onSelect(e.pendingSelection), e.pendingSelection = null), e.options.selectionMode === "range" ? (e.committedStartDate = e.selectedStartDate, e.committedEndDate = e.selectedEndDate) : e.options.selectionMode === "single" && (e.committedDate = e.selectedDate), e.options.positioningMode === "floating" && e.hide();
|
|
1451
1491
|
}
|
|
1452
|
-
function
|
|
1492
|
+
function ln(e) {
|
|
1453
1493
|
e.options.selectionMode === "range" && e.calendar.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--disabled)").forEach((t) => {
|
|
1454
1494
|
t.addEventListener("mousedown", (n) => {
|
|
1455
|
-
const r = n,
|
|
1495
|
+
const r = n, i = t, o = r.clientX, s = r.clientY, d = 5;
|
|
1456
1496
|
let l = !1, c = !1;
|
|
1457
|
-
const u =
|
|
1458
|
-
let
|
|
1459
|
-
u && e.selectedStartDate && e.selectedEndDate ?
|
|
1497
|
+
const u = i.classList.contains("drp-date-picker__day--range-start"), g = i.classList.contains("drp-date-picker__day--range-end");
|
|
1498
|
+
let p;
|
|
1499
|
+
u && e.selectedStartDate && e.selectedEndDate ? p = "start" : g && e.selectedStartDate && e.selectedEndDate ? p = "end" : p = "start";
|
|
1460
1500
|
const f = (v) => {
|
|
1461
|
-
const m = Math.abs(v.clientX -
|
|
1462
|
-
!l && (m > d ||
|
|
1501
|
+
const m = Math.abs(v.clientX - o), x = Math.abs(v.clientY - s);
|
|
1502
|
+
!l && (m > d || x > d) && (l = !0), l && !c && (c = !0, zt(e, r, p, i), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h));
|
|
1463
1503
|
}, h = () => {
|
|
1464
1504
|
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h);
|
|
1465
1505
|
};
|
|
@@ -1467,45 +1507,45 @@ function on(e) {
|
|
|
1467
1507
|
});
|
|
1468
1508
|
});
|
|
1469
1509
|
}
|
|
1470
|
-
function
|
|
1471
|
-
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t;
|
|
1472
|
-
const r = n,
|
|
1473
|
-
let
|
|
1474
|
-
if (
|
|
1475
|
-
const [s, d, l] =
|
|
1476
|
-
|
|
1510
|
+
function zt(e, a, t, n) {
|
|
1511
|
+
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t, e.invalidRangeStart = null, e.invalidRangeEnd = null;
|
|
1512
|
+
const r = n, i = r.dataset.date;
|
|
1513
|
+
let o = null;
|
|
1514
|
+
if (i) {
|
|
1515
|
+
const [s, d, l] = i.split("-").map(Number);
|
|
1516
|
+
o = new Date(s, d - 1, l);
|
|
1477
1517
|
}
|
|
1478
|
-
!e.selectedStartDate && !e.selectedEndDate ?
|
|
1518
|
+
!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) => {
|
|
1479
1519
|
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");
|
|
1480
|
-
}), e.originalStartDate =
|
|
1520
|
+
}), 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))), r.classList.add("drp-date-picker__day--dragging"), ee.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => Pt(e, s), e.onDragEndBound = async (s) => await Nt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
1481
1521
|
}
|
|
1482
|
-
function
|
|
1522
|
+
function Pt(e, a) {
|
|
1483
1523
|
if (!e.isDragging) return;
|
|
1484
1524
|
let t = null;
|
|
1485
1525
|
e.containerElement instanceof ShadowRoot && "elementsFromPoint" in e.containerElement ? t = e.containerElement.elementsFromPoint(a.clientX, a.clientY)[0] || null : t = document.elementFromPoint(a.clientX, a.clientY);
|
|
1486
1526
|
const n = t == null ? void 0 : t.closest(".drp-date-picker__nav--prev"), r = t == null ? void 0 : t.closest(".drp-date-picker__nav--next");
|
|
1487
1527
|
if (n || r) {
|
|
1488
1528
|
if (!e.navInterval) {
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1491
|
-
const
|
|
1492
|
-
f ? e.prevMonth(
|
|
1493
|
-
f ? e.prevMonth(
|
|
1529
|
+
const g = (n || r).closest(".drp-date-picker__month");
|
|
1530
|
+
if (g && g instanceof HTMLElement) {
|
|
1531
|
+
const p = parseInt(g.dataset.monthIndex || "0"), f = !!n;
|
|
1532
|
+
f ? e.prevMonth(p) : e.nextMonth(p), e.navInterval = window.setInterval(() => {
|
|
1533
|
+
f ? e.prevMonth(p) : e.nextMonth(p);
|
|
1494
1534
|
}, 1e3);
|
|
1495
1535
|
}
|
|
1496
1536
|
}
|
|
1497
1537
|
return;
|
|
1498
1538
|
} else
|
|
1499
1539
|
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
1500
|
-
const
|
|
1501
|
-
if (!
|
|
1502
|
-
const
|
|
1503
|
-
if (!
|
|
1504
|
-
const [s, d, l] =
|
|
1540
|
+
const i = t;
|
|
1541
|
+
if (!i || !i.classList.contains("drp-date-picker__day")) return;
|
|
1542
|
+
const o = i.dataset.date;
|
|
1543
|
+
if (!o) return;
|
|
1544
|
+
const [s, d, l] = o.split("-").map(Number);
|
|
1505
1545
|
let c = new Date(s, d - 1, l);
|
|
1506
|
-
if (
|
|
1546
|
+
if (i.classList.contains("drp-date-picker__day--disabled")) {
|
|
1507
1547
|
const u = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
1508
|
-
c =
|
|
1548
|
+
c = $e(e, c, u);
|
|
1509
1549
|
}
|
|
1510
1550
|
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) {
|
|
1511
1551
|
const u = e.options.disabledDatesHandling;
|
|
@@ -1516,71 +1556,72 @@ function $t(e, a) {
|
|
|
1516
1556
|
}
|
|
1517
1557
|
e.updateDragPreview();
|
|
1518
1558
|
}
|
|
1519
|
-
async function
|
|
1520
|
-
if (e.isDragging)
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
}
|
|
1559
|
+
async function Nt(e, a) {
|
|
1560
|
+
if (!e.isDragging) return;
|
|
1561
|
+
ee.debug("Ended dragging, finalizing selection"), console.log("[onDragEnd] Started - dragPreviewStart:", e.dragPreviewStart, "dragPreviewEnd:", e.dragPreviewEnd);
|
|
1562
|
+
let t = !1;
|
|
1563
|
+
if (e.dragPreviewStart && e.dragPreviewEnd) {
|
|
1564
|
+
let n = $e(e, e.dragPreviewStart, "forward"), r = $e(e, e.dragPreviewEnd, "backward");
|
|
1565
|
+
n > r && ([n, r] = [r, n]), ee.debug("onDragEnd - calling validateRangeAsync with:", n, r), console.log("[onDragEnd] Calling validateRangeAsync with:", n, r);
|
|
1566
|
+
const i = await $t(e, n, r);
|
|
1567
|
+
if (ee.debug("onDragEnd - validation result:", i), console.log("[onDragEnd] Validation result:", i), !i.isValid)
|
|
1568
|
+
i.message && Y.warn("onDragEnd() - drag validation failed:", i.message), i.showInvalidRange && i.invalidStart && i.invalidEnd && (e.invalidRangeStart = i.invalidStart, e.invalidRangeEnd = i.invalidEnd, e.selectedStartDate = null, e.selectedEndDate = null), t = !1;
|
|
1569
|
+
else {
|
|
1570
|
+
e.selectedStartDate = i.adjustedStart || n, e.selectedEndDate = i.adjustedEnd || r, t = !0, e.invalidRangeStart = null, e.invalidRangeEnd = null, i.message || ie(e), e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
1571
|
+
const o = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
1572
|
+
e.requiresApplyButton() ? e.pendingSelection = o : e.options.onSelect && e.options.onSelect(o);
|
|
1532
1573
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
break;
|
|
1574
|
+
}
|
|
1575
|
+
if (e.isDragging = !1, e.draggingType = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.calendar.querySelectorAll(".drp-date-picker__day--dragging").forEach((n) => {
|
|
1576
|
+
n.classList.remove("drp-date-picker__day--dragging");
|
|
1577
|
+
}), e.onDragMoveBound && document.removeEventListener("mousemove", e.onDragMoveBound), e.onDragEndBound && document.removeEventListener("mouseup", e.onDragEndBound), e.navInterval && (clearInterval(e.navInterval), e.navInterval = null), document.body.style.cursor = "", e.renderCalendar(), e.updateSummary(), e.selectedEndDate) {
|
|
1578
|
+
const n = e.selectedEndDate;
|
|
1579
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1580
|
+
const i = e.monthDates[r];
|
|
1581
|
+
if (n.getFullYear() === i.getFullYear() && n.getMonth() === i.getMonth()) {
|
|
1582
|
+
e.activeMonthIndex = r;
|
|
1583
|
+
const o = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${r}"]`);
|
|
1584
|
+
if (o) {
|
|
1585
|
+
const s = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), d = Array.from(s).findIndex((l) => {
|
|
1586
|
+
const c = l.dataset.date;
|
|
1587
|
+
if (!c) return !1;
|
|
1588
|
+
const [u, g, p] = c.split("-").map(Number), f = new Date(u, g - 1, p);
|
|
1589
|
+
return e.isSameDay(f, n);
|
|
1590
|
+
});
|
|
1591
|
+
d !== -1 && (e.focusedDayIndex = d, s.forEach((l) => l.classList.remove("drp-date-picker__day--focused")), s[d] && s[d].classList.add("drp-date-picker__day--focused"));
|
|
1552
1592
|
}
|
|
1593
|
+
break;
|
|
1553
1594
|
}
|
|
1554
1595
|
}
|
|
1555
|
-
e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
1556
1596
|
}
|
|
1597
|
+
e.options.positioningMode === "floating" && e.shouldAutoClose() && t && e.hide();
|
|
1557
1598
|
}
|
|
1558
|
-
function
|
|
1599
|
+
function $e(e, a, t = "forward") {
|
|
1559
1600
|
let r = new Date(a);
|
|
1560
1601
|
if (r.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(r))
|
|
1561
1602
|
return r;
|
|
1562
|
-
const
|
|
1603
|
+
const i = t === "forward" ? 1 : -1;
|
|
1563
1604
|
for (let s = 1; s <= 60; s++) {
|
|
1564
1605
|
const d = new Date(a);
|
|
1565
|
-
if (d.setDate(d.getDate() + s *
|
|
1606
|
+
if (d.setDate(d.getDate() + s * i), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
1566
1607
|
return d;
|
|
1567
1608
|
}
|
|
1568
|
-
const
|
|
1609
|
+
const o = -i;
|
|
1569
1610
|
for (let s = 1; s <= 60; s++) {
|
|
1570
1611
|
const d = new Date(a);
|
|
1571
|
-
if (d.setDate(d.getDate() + s *
|
|
1612
|
+
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
1572
1613
|
return d;
|
|
1573
1614
|
}
|
|
1574
1615
|
return a;
|
|
1575
1616
|
}
|
|
1576
|
-
function
|
|
1577
|
-
const t = a.target, n = t.value, r = t.selectionStart || 0,
|
|
1617
|
+
function cn(e, a) {
|
|
1618
|
+
const t = a.target, n = t.value, r = t.selectionStart || 0, i = e._previousInputValue || "", o = n.length < i.length, { separator: s } = e.formatInfo;
|
|
1578
1619
|
if (e.options.selectionMode === "range") {
|
|
1579
|
-
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l =
|
|
1620
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l = Ft(e, d);
|
|
1580
1621
|
if (l !== n) {
|
|
1581
1622
|
t.value = l;
|
|
1582
1623
|
let c = r;
|
|
1583
|
-
if (
|
|
1624
|
+
if (o)
|
|
1584
1625
|
c = r;
|
|
1585
1626
|
else if (l.length > n.length)
|
|
1586
1627
|
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
@@ -1595,54 +1636,54 @@ function sn(e, a) {
|
|
|
1595
1636
|
if (l !== n) {
|
|
1596
1637
|
t.value = l;
|
|
1597
1638
|
let c = r;
|
|
1598
|
-
if (
|
|
1639
|
+
if (o)
|
|
1599
1640
|
c = r;
|
|
1600
1641
|
else if (l.length > n.length && l[r] === s)
|
|
1601
1642
|
c = r + 1;
|
|
1602
1643
|
else if (l.length > n.length) {
|
|
1603
|
-
const u = (n.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length,
|
|
1604
|
-
c = r +
|
|
1644
|
+
const u = (n.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, p = (l.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - u;
|
|
1645
|
+
c = r + p;
|
|
1605
1646
|
}
|
|
1606
1647
|
t.setSelectionRange(c, c);
|
|
1607
1648
|
}
|
|
1608
1649
|
}
|
|
1609
|
-
e._previousInputValue = t.value,
|
|
1650
|
+
e._previousInputValue = t.value, Ye(e);
|
|
1610
1651
|
}
|
|
1611
1652
|
function pe(e, a) {
|
|
1612
|
-
var c, u,
|
|
1613
|
-
const { separator: t, parts: n, maxLength: r } = e.formatInfo,
|
|
1614
|
-
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length:
|
|
1653
|
+
var c, u, g;
|
|
1654
|
+
const { separator: t, parts: n, maxLength: r } = e.formatInfo, i = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), o = n.year ? n.year.length : 4, s = [
|
|
1655
|
+
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: o },
|
|
1615
1656
|
{ type: "month", pos: ((u = n.month) == null ? void 0 : u.index) ?? 1, length: 2 },
|
|
1616
|
-
{ type: "day", pos: ((
|
|
1617
|
-
].sort((
|
|
1657
|
+
{ type: "day", pos: ((g = n.day) == null ? void 0 : g.index) ?? 2, length: 2 }
|
|
1658
|
+
].sort((p, f) => p.pos - f.pos);
|
|
1618
1659
|
let d = "", l = 0;
|
|
1619
|
-
for (let
|
|
1620
|
-
const f = s[
|
|
1660
|
+
for (let p = 0; p < s.length; p++) {
|
|
1661
|
+
const f = s[p], h = i.substring(l, l + f.length);
|
|
1621
1662
|
if (!h) break;
|
|
1622
|
-
d += h, l += h.length,
|
|
1663
|
+
d += h, l += h.length, p < s.length - 1 && h.length === f.length && (d += t);
|
|
1623
1664
|
}
|
|
1624
1665
|
return d.substring(0, r);
|
|
1625
1666
|
}
|
|
1626
|
-
function
|
|
1667
|
+
function Ft(e, a) {
|
|
1627
1668
|
const { separator: t, maxLength: n } = e.formatInfo, r = " to ";
|
|
1628
|
-
let
|
|
1669
|
+
let i = "", o = "";
|
|
1629
1670
|
if (a.includes(r)) {
|
|
1630
1671
|
const d = a.split(r);
|
|
1631
|
-
|
|
1672
|
+
i = d[0], o = d.slice(1).join(r);
|
|
1632
1673
|
} else
|
|
1633
|
-
|
|
1634
|
-
const s = pe(e,
|
|
1674
|
+
i = a;
|
|
1675
|
+
const s = pe(e, i);
|
|
1635
1676
|
if (s.length === n)
|
|
1636
1677
|
if (a.includes(r)) {
|
|
1637
|
-
const d = pe(e,
|
|
1678
|
+
const d = pe(e, o);
|
|
1638
1679
|
return s + r + d;
|
|
1639
1680
|
} else
|
|
1640
1681
|
return s + r;
|
|
1641
1682
|
else
|
|
1642
1683
|
return s;
|
|
1643
1684
|
}
|
|
1644
|
-
function
|
|
1645
|
-
const { key: t, ctrlKey: n, metaKey: r } = a, { separator:
|
|
1685
|
+
function un(e, a) {
|
|
1686
|
+
const { key: t, ctrlKey: n, metaKey: r } = a, { separator: i } = e.formatInfo;
|
|
1646
1687
|
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
1647
1688
|
a.preventDefault();
|
|
1648
1689
|
return;
|
|
@@ -1660,88 +1701,88 @@ function dn(e, a) {
|
|
|
1660
1701
|
"Home",
|
|
1661
1702
|
"End"
|
|
1662
1703
|
].includes(t) || n || r)) {
|
|
1663
|
-
if (t ===
|
|
1704
|
+
if (t === i) {
|
|
1664
1705
|
const s = a.target, d = s.selectionStart || 0, l = s.value;
|
|
1665
1706
|
let c = 0;
|
|
1666
|
-
for (let
|
|
1667
|
-
if (l[
|
|
1668
|
-
c =
|
|
1707
|
+
for (let g = d - 1; g >= 0; g--)
|
|
1708
|
+
if (l[g] === i || l[g] === " ") {
|
|
1709
|
+
c = g + 1;
|
|
1669
1710
|
break;
|
|
1670
1711
|
}
|
|
1671
1712
|
const u = l.substring(c, d);
|
|
1672
1713
|
if (/^\d$/.test(u)) {
|
|
1673
1714
|
a.preventDefault();
|
|
1674
|
-
const
|
|
1675
|
-
s.value =
|
|
1676
|
-
const
|
|
1677
|
-
s.setSelectionRange(
|
|
1715
|
+
const g = l.substring(0, c) + "0" + u + i + l.substring(d);
|
|
1716
|
+
s.value = g;
|
|
1717
|
+
const p = c + 2 + i.length;
|
|
1718
|
+
s.setSelectionRange(p, p), e._previousInputValue = g, s.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
1678
1719
|
return;
|
|
1679
1720
|
}
|
|
1680
1721
|
}
|
|
1681
|
-
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !==
|
|
1722
|
+
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !== i && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== i && a.preventDefault();
|
|
1682
1723
|
}
|
|
1683
1724
|
}
|
|
1684
|
-
function
|
|
1685
|
-
var
|
|
1725
|
+
function gn(e, a) {
|
|
1726
|
+
var g;
|
|
1686
1727
|
a.preventDefault();
|
|
1687
|
-
const t = ((
|
|
1688
|
-
|
|
1689
|
-
const u = s +
|
|
1690
|
-
|
|
1728
|
+
const t = ((g = a.clipboardData) == null ? void 0 : g.getData("text")) || "", { separator: n } = e.formatInfo, r = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), i = pe(e, r), o = a.target, s = o.selectionStart || 0, d = o.selectionEnd || 0, l = o.value, c = l.substring(0, s) + i + l.substring(d);
|
|
1729
|
+
o.value = pe(e, c);
|
|
1730
|
+
const u = s + i.length;
|
|
1731
|
+
o.setSelectionRange(u, u), o.dispatchEvent(new Event("input", { bubbles: !0 })), Ye(e);
|
|
1691
1732
|
}
|
|
1692
|
-
function
|
|
1733
|
+
function Ye(e) {
|
|
1693
1734
|
if (!e.input) return;
|
|
1694
1735
|
const a = e.input.value;
|
|
1695
|
-
if (
|
|
1736
|
+
if (se.debug("updateCalendarFromInput - value:", a), !a) {
|
|
1696
1737
|
e.clearSelection(), e.renderCalendar();
|
|
1697
1738
|
return;
|
|
1698
1739
|
}
|
|
1699
1740
|
const { separator: t, parts: n, maxLength: r } = e.formatInfo;
|
|
1700
|
-
if (
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1741
|
+
if (se.debug("Format info:", { separator: t, parts: n, maxLength: r }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
1742
|
+
const o = a.split(" to "), s = o[0], d = o[1];
|
|
1743
|
+
se.debug("Range parts - start:", s, "end:", d), Ee(e, s, "start"), d ? Ee(e, d, "end") : e.selectedEndDate = null;
|
|
1703
1744
|
return;
|
|
1704
1745
|
}
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1746
|
+
const i = e.options.selectionMode === "range" ? "start" : "single";
|
|
1747
|
+
Ee(e, a, i);
|
|
1707
1748
|
}
|
|
1708
|
-
function
|
|
1709
|
-
const { separator: n, parts: r, maxLength:
|
|
1749
|
+
function Ee(e, a, t = "single") {
|
|
1750
|
+
const { separator: n, parts: r, maxLength: i } = e.formatInfo, o = a.split(n);
|
|
1710
1751
|
let s = null, d = null, l = null;
|
|
1711
|
-
if (
|
|
1752
|
+
if (o.forEach((c, u) => {
|
|
1712
1753
|
if (c) {
|
|
1713
1754
|
if (r.year && r.year.index === u) {
|
|
1714
|
-
const
|
|
1715
|
-
r.year.length === 4 && c.length === 4 ? s =
|
|
1755
|
+
const g = parseInt(c, 10);
|
|
1756
|
+
r.year.length === 4 && c.length === 4 ? s = g : r.year.length === 2 && c.length === 2 && (s = g < 100 ? g + 2e3 : g);
|
|
1716
1757
|
} else if (r.month && r.month.index === u) {
|
|
1717
|
-
const
|
|
1718
|
-
c.length === 2 &&
|
|
1758
|
+
const g = parseInt(c, 10);
|
|
1759
|
+
c.length === 2 && g >= 1 && g <= 12 && (d = g);
|
|
1719
1760
|
} else if (r.day && r.day.index === u) {
|
|
1720
|
-
const
|
|
1721
|
-
c.length === 2 &&
|
|
1761
|
+
const g = parseInt(c, 10);
|
|
1762
|
+
c.length === 2 && g >= 1 && g <= 31 && (l = g);
|
|
1722
1763
|
}
|
|
1723
1764
|
}
|
|
1724
|
-
}),
|
|
1765
|
+
}), se.debug(`parseAndUpdateSingleDate(${t}) - year:`, s, "month:", d, "day:", l), s !== null || d !== null) {
|
|
1725
1766
|
const c = s || (/* @__PURE__ */ new Date()).getFullYear(), u = d !== null ? d - 1 : (/* @__PURE__ */ new Date()).getMonth();
|
|
1726
1767
|
if (e.options.selectionMode === "single") {
|
|
1727
1768
|
e.monthDates = [];
|
|
1728
|
-
for (let
|
|
1729
|
-
const
|
|
1730
|
-
e.monthDates.push(
|
|
1769
|
+
for (let g = 0; g < e.options.visibleMonthsCount; g++) {
|
|
1770
|
+
const p = new Date(c, u + g, 1);
|
|
1771
|
+
e.monthDates.push(p);
|
|
1731
1772
|
}
|
|
1732
1773
|
} else if (e.options.selectionMode === "range" && (t === "start" || !e.selectedStartDate)) {
|
|
1733
1774
|
if (e.displayMonths = [
|
|
1734
1775
|
{ month: u, year: c }
|
|
1735
1776
|
], e.options.visibleMonthsCount > 1) {
|
|
1736
|
-
const
|
|
1777
|
+
const g = new Date(c, u + 1, 1);
|
|
1737
1778
|
e.displayMonths.push({
|
|
1738
|
-
month:
|
|
1739
|
-
year:
|
|
1779
|
+
month: g.getMonth(),
|
|
1780
|
+
year: g.getFullYear()
|
|
1740
1781
|
});
|
|
1741
1782
|
}
|
|
1742
1783
|
e.monthDates = [];
|
|
1743
|
-
for (let
|
|
1744
|
-
const
|
|
1784
|
+
for (let g = 0; g < e.options.visibleMonthsCount; g++) {
|
|
1785
|
+
const p = e.displayMonths[g], f = new Date(p.year, p.month, 1);
|
|
1745
1786
|
e.monthDates.push(f);
|
|
1746
1787
|
}
|
|
1747
1788
|
}
|
|
@@ -1749,62 +1790,60 @@ function Se(e, a, t = "single") {
|
|
|
1749
1790
|
}
|
|
1750
1791
|
if (s !== null && d !== null && l !== null) {
|
|
1751
1792
|
const c = new Date(s, d - 1, l);
|
|
1752
|
-
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(),
|
|
1793
|
+
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(), se.debug(`Set ${t} date:`, c));
|
|
1753
1794
|
}
|
|
1754
1795
|
}
|
|
1755
|
-
let
|
|
1756
|
-
function
|
|
1757
|
-
e.options.positioningMode !== "inline" && (
|
|
1758
|
-
|
|
1759
|
-
}),
|
|
1760
|
-
document.addEventListener("click", e.clickOutsideHandler);
|
|
1761
|
-
}, 0), setTimeout(() => {
|
|
1796
|
+
let Ie = null;
|
|
1797
|
+
function Ht(e) {
|
|
1798
|
+
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)), Ye(e), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1, Yt(e)), e.calendar.classList.add("drp-date-picker--visible"), e.isCalendarActive = !0, O.debug("show() - calendar classes:", e.calendar.className), We(e), Ie = Tt(e.input, e.calendar, () => {
|
|
1799
|
+
We(e);
|
|
1800
|
+
}), setTimeout(() => {
|
|
1762
1801
|
const a = window.getComputedStyle(e.calendar);
|
|
1763
|
-
|
|
1802
|
+
O.debug("show() - computed styles - display:", a.display, "position:", a.position, "left:", a.left, "top:", a.top, "z-index:", a.zIndex);
|
|
1764
1803
|
}, 100));
|
|
1765
1804
|
}
|
|
1766
|
-
function
|
|
1805
|
+
function Ot(e) {
|
|
1767
1806
|
if (e.options.positioningMode !== "inline" && e.calendar.classList.contains("drp-date-picker--visible")) {
|
|
1768
|
-
|
|
1807
|
+
Ie && (Ie(), Ie = null), 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;
|
|
1769
1808
|
for (let a = 0; a < e.showingRollingSelector.length; a++)
|
|
1770
1809
|
e.showingRollingSelector[a] = !1;
|
|
1771
1810
|
e.isFirstRender || e.renderCalendar(), e.lockedPlacement = void 0;
|
|
1772
1811
|
}
|
|
1773
1812
|
}
|
|
1774
|
-
function
|
|
1775
|
-
e.calendar.classList.contains("drp-date-picker--visible") ?
|
|
1813
|
+
function pn(e) {
|
|
1814
|
+
e.calendar.classList.contains("drp-date-picker--visible") ? Ot(e) : Ht(e);
|
|
1776
1815
|
}
|
|
1777
|
-
async function
|
|
1778
|
-
if (
|
|
1816
|
+
async function We(e) {
|
|
1817
|
+
if (O.debug("position() - locked placement:", e.lockedPlacement), !e.input)
|
|
1779
1818
|
return;
|
|
1780
|
-
const a = e.lockedPlacement ? [
|
|
1819
|
+
const a = e.lockedPlacement ? [ke(8), Le({ padding: 8 })] : [ke(8), nt(), Le({ padding: 8 })], t = await rt(e.input, e.calendar, {
|
|
1781
1820
|
placement: e.lockedPlacement || e.options.calendarPlacement,
|
|
1782
1821
|
middleware: a
|
|
1783
1822
|
});
|
|
1784
|
-
|
|
1823
|
+
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");
|
|
1785
1824
|
}
|
|
1786
|
-
async function
|
|
1825
|
+
async function hn(e, a, t) {
|
|
1787
1826
|
if (!e.tooltip || !e.tooltipArrow) return;
|
|
1788
1827
|
e.currentTooltipTarget = a, e.tooltip.innerHTML = t, e.tooltip.appendChild(e.tooltipArrow), e.tooltip.classList.add("drp-date-picker__tooltip--visible");
|
|
1789
|
-
const { x: n, y: r, placement:
|
|
1828
|
+
const { x: n, y: r, placement: i, middlewareData: o } = await rt(a, e.tooltip, {
|
|
1790
1829
|
placement: "top",
|
|
1791
1830
|
middleware: [
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1831
|
+
ke(6),
|
|
1832
|
+
nt(),
|
|
1833
|
+
Le({ padding: 5 }),
|
|
1834
|
+
kt({ element: e.tooltipArrow })
|
|
1796
1835
|
]
|
|
1797
1836
|
});
|
|
1798
1837
|
if (Object.assign(e.tooltip.style, {
|
|
1799
1838
|
left: `${n}px`,
|
|
1800
1839
|
top: `${r}px`
|
|
1801
|
-
}),
|
|
1802
|
-
const { x: s, y: d } =
|
|
1840
|
+
}), o.arrow) {
|
|
1841
|
+
const { x: s, y: d } = o.arrow, l = {
|
|
1803
1842
|
top: "bottom",
|
|
1804
1843
|
right: "left",
|
|
1805
1844
|
bottom: "top",
|
|
1806
1845
|
left: "right"
|
|
1807
|
-
}[
|
|
1846
|
+
}[i.split("-")[0]];
|
|
1808
1847
|
Object.assign(e.tooltipArrow.style, {
|
|
1809
1848
|
left: s != null ? `${s}px` : "",
|
|
1810
1849
|
top: d != null ? `${d}px` : "",
|
|
@@ -1814,10 +1853,10 @@ async function un(e, a, t) {
|
|
|
1814
1853
|
});
|
|
1815
1854
|
}
|
|
1816
1855
|
}
|
|
1817
|
-
function
|
|
1856
|
+
function fn(e) {
|
|
1818
1857
|
e.tooltip && (e.tooltip.classList.remove("drp-date-picker__tooltip--visible"), e.currentTooltipTarget = void 0);
|
|
1819
1858
|
}
|
|
1820
|
-
function
|
|
1859
|
+
function ze(e) {
|
|
1821
1860
|
if (e.loadingOverlay) return;
|
|
1822
1861
|
const a = document.createElement("div");
|
|
1823
1862
|
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
@@ -1827,6 +1866,26 @@ function ke(e) {
|
|
|
1827
1866
|
function ae(e) {
|
|
1828
1867
|
e.loadingOverlay && (e.loadingOverlay.remove(), e.loadingOverlay = void 0);
|
|
1829
1868
|
}
|
|
1869
|
+
function Ke(e, a, t, n) {
|
|
1870
|
+
if (console.log("[showMessage] content:", a, "type:", t), !e.messageElement) {
|
|
1871
|
+
console.log("[showMessage] ERROR: messageElement is null/undefined!");
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
e.messageAutoHideTimeout && (clearTimeout(e.messageAutoHideTimeout), e.messageAutoHideTimeout = void 0), e.messageElement.classList.remove(
|
|
1875
|
+
"drp-date-picker__message--error",
|
|
1876
|
+
"drp-date-picker__message--warning",
|
|
1877
|
+
"drp-date-picker__message--info",
|
|
1878
|
+
"drp-date-picker__message--success",
|
|
1879
|
+
"drp-date-picker__message--custom"
|
|
1880
|
+
);
|
|
1881
|
+
const r = e.messageElement.querySelector(".drp-date-picker__message-text");
|
|
1882
|
+
r && (r.innerHTML = a), t ? e.messageElement.classList.add(`drp-date-picker__message--${t}`) : e.messageElement.classList.add("drp-date-picker__message--custom"), e.messageElement.classList.add("drp-date-picker__message--visible"), n && n > 0 && (e.messageAutoHideTimeout = setTimeout(() => {
|
|
1883
|
+
ie(e);
|
|
1884
|
+
}, n));
|
|
1885
|
+
}
|
|
1886
|
+
function ie(e) {
|
|
1887
|
+
e.messageElement && (e.messageAutoHideTimeout && (clearTimeout(e.messageAutoHideTimeout), e.messageAutoHideTimeout = void 0), e.messageElement.classList.remove("drp-date-picker__message--visible"));
|
|
1888
|
+
}
|
|
1830
1889
|
function U(e, a, t) {
|
|
1831
1890
|
for (let n = 1; n <= 31; n++) {
|
|
1832
1891
|
const r = new Date(a, t, n);
|
|
@@ -1835,7 +1894,7 @@ function U(e, a, t) {
|
|
|
1835
1894
|
}
|
|
1836
1895
|
return !1;
|
|
1837
1896
|
}
|
|
1838
|
-
async function
|
|
1897
|
+
async function Yt(e) {
|
|
1839
1898
|
var a, t, n, r;
|
|
1840
1899
|
if (e.options.beforeMonthChangedCallback) {
|
|
1841
1900
|
if (e.isMonthChanging) {
|
|
@@ -1844,27 +1903,27 @@ async function Ht(e) {
|
|
|
1844
1903
|
}
|
|
1845
1904
|
try {
|
|
1846
1905
|
if (e.isMonthChanging = !0, e.options.unifiedNavigation) {
|
|
1847
|
-
const
|
|
1848
|
-
let l = 1 / 0, c = 1 / 0, u = -1 / 0,
|
|
1849
|
-
for (let
|
|
1850
|
-
const
|
|
1851
|
-
(
|
|
1906
|
+
const i = e.options.unifiedNavigationAnchorIndex ?? 0, o = e.monthDates[i], s = o.getFullYear(), d = o.getMonth();
|
|
1907
|
+
let l = 1 / 0, c = 1 / 0, u = -1 / 0, g = -1 / 0;
|
|
1908
|
+
for (let S = 0; S < e.monthDates.length; S++) {
|
|
1909
|
+
const E = e.monthDates[S], I = E.getFullYear(), T = E.getMonth();
|
|
1910
|
+
(I < l || I === l && T < c) && (l = I, c = T), (I > u || I === u && T > g) && (u = I, g = T);
|
|
1852
1911
|
}
|
|
1853
|
-
const h = (new Date(l, c, 1).getDay() - e.weekStartDay + 7) % 7, v = new Date(l, c, 1 - h), m = new Date(u,
|
|
1912
|
+
const h = (new Date(l, c, 1).getDay() - e.weekStartDay + 7) % 7, v = new Date(l, c, 1 - h), m = new Date(u, g + 1, 0).getDate(), C = new Date(u, g, m).getDay(), M = (e.weekStartDay + 6 - C) % 7, D = new Date(u, g, m + M), _ = {
|
|
1854
1913
|
year: s,
|
|
1855
1914
|
month: d,
|
|
1856
|
-
monthIndex:
|
|
1915
|
+
monthIndex: i,
|
|
1857
1916
|
firstVisibleDate: v,
|
|
1858
1917
|
lastVisibleDate: D
|
|
1859
1918
|
};
|
|
1860
1919
|
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${s}-${d + 1}, range: ${v.toISOString().split("T")[0]} to ${D.toISOString().split("T")[0]}`);
|
|
1861
1920
|
const R = e.options.beforeMonthChangedCallback(_), L = R instanceof Promise;
|
|
1862
|
-
L &&
|
|
1921
|
+
L && ze(e);
|
|
1863
1922
|
const y = await Promise.resolve(R);
|
|
1864
1923
|
L && ae(e), w.debug(`handleInitialMonthLoad() [UNIFIED] - callback completed, metadata items: ${((a = y.metadata) == null ? void 0 : a.size) || 0}, monthHeaders: ${((t = y.monthHeaders) == null ? void 0 : t.size) || 0}`), y.metadata && (e.bulkMetadataCache = y.metadata, w.debug(`handleInitialMonthLoad() [UNIFIED] - bulk metadata cache updated with ${y.metadata.size} entries`)), y.monthHeaders && (e.monthHeadersCache = y.monthHeaders, w.debug(`handleInitialMonthLoad() [UNIFIED] - month headers cache updated with ${y.monthHeaders.size} entries`)), (y.metadata || y.monthHeaders) && e.renderCalendar();
|
|
1865
1924
|
} else {
|
|
1866
1925
|
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1867
|
-
const
|
|
1926
|
+
const i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1868
1927
|
let s = !1;
|
|
1869
1928
|
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1870
1929
|
const l = e.monthDates[d], c = l.getFullYear(), u = l.getMonth(), f = (new Date(c, u, 1).getDay() - e.weekStartDay + 7) % 7, h = new Date(c, u, 1 - f), v = new Date(h);
|
|
@@ -1877,114 +1936,114 @@ async function Ht(e) {
|
|
|
1877
1936
|
lastVisibleDate: v
|
|
1878
1937
|
};
|
|
1879
1938
|
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - calling callback for ${c}-${u + 1}, range: ${h.toISOString().split("T")[0]} to ${v.toISOString().split("T")[0]}`);
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1882
|
-
const
|
|
1883
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - callback completed, metadata items: ${((n =
|
|
1884
|
-
o.set(_, D);
|
|
1885
|
-
}), x.monthHeaders && x.monthHeaders.forEach((D, _) => {
|
|
1939
|
+
const x = e.options.beforeMonthChangedCallback(m);
|
|
1940
|
+
x instanceof Promise && !s && (s = !0, ze(e));
|
|
1941
|
+
const M = await Promise.resolve(x);
|
|
1942
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - callback completed, metadata items: ${((n = M.metadata) == null ? void 0 : n.size) || 0}, monthHeaders: ${((r = M.monthHeaders) == null ? void 0 : r.size) || 0}`), M.metadata && M.metadata.forEach((D, _) => {
|
|
1886
1943
|
i.set(_, D);
|
|
1944
|
+
}), M.monthHeaders && M.monthHeaders.forEach((D, _) => {
|
|
1945
|
+
o.set(_, D);
|
|
1887
1946
|
});
|
|
1888
1947
|
}
|
|
1889
|
-
s && ae(e),
|
|
1948
|
+
s && ae(e), i.size > 0 && (e.bulkMetadataCache = i, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${i.size} entries`)), o.size > 0 && (e.monthHeadersCache = o, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined month headers cache updated with ${o.size} entries`)), (i.size > 0 || o.size > 0) && e.renderCalendar();
|
|
1890
1949
|
}
|
|
1891
|
-
} catch (
|
|
1892
|
-
ae(e), w.debug("handleInitialMonthLoad() - error in callback:",
|
|
1950
|
+
} catch (i) {
|
|
1951
|
+
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", i), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", i);
|
|
1893
1952
|
} finally {
|
|
1894
1953
|
e.isMonthChanging = !1;
|
|
1895
1954
|
}
|
|
1896
1955
|
}
|
|
1897
1956
|
}
|
|
1898
1957
|
async function Q(e, a, t, n) {
|
|
1899
|
-
var r,
|
|
1958
|
+
var r, i;
|
|
1900
1959
|
if (!e.options.beforeMonthChangedCallback)
|
|
1901
1960
|
return !0;
|
|
1902
1961
|
if (e.isMonthChanging)
|
|
1903
1962
|
return w.debug("handleBeforeMonthChange() - already changing month, ignoring"), !1;
|
|
1904
1963
|
try {
|
|
1905
1964
|
e.isMonthChanging = !0;
|
|
1906
|
-
let
|
|
1965
|
+
let o, s;
|
|
1907
1966
|
if (e.options.unifiedNavigation) {
|
|
1908
|
-
let
|
|
1967
|
+
let g = 1 / 0, p = 1 / 0, f = -1 / 0, h = -1 / 0;
|
|
1909
1968
|
for (let R = 0; R < e.monthDates.length; R++) {
|
|
1910
|
-
const L = e.monthDates[R], y = L.getFullYear(),
|
|
1911
|
-
(y <
|
|
1969
|
+
const L = e.monthDates[R], y = L.getFullYear(), S = L.getMonth();
|
|
1970
|
+
(y < g || y === g && S < p) && (g = y, p = S), (y > f || y === f && S > h) && (f = y, h = S);
|
|
1912
1971
|
}
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1972
|
+
const x = (new Date(g, p, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1973
|
+
o = new Date(g, p, 1 - x);
|
|
1915
1974
|
const C = new Date(f, h + 1, 0).getDate(), D = new Date(f, h, C).getDay(), _ = (e.weekStartDay + 6 - D) % 7;
|
|
1916
1975
|
s = new Date(f, h, C + _);
|
|
1917
1976
|
} else {
|
|
1918
1977
|
const f = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1919
|
-
|
|
1978
|
+
o = new Date(a, t, 1 - f), s = new Date(o), s.setDate(o.getDate() + 41);
|
|
1920
1979
|
}
|
|
1921
1980
|
const d = {
|
|
1922
1981
|
year: a,
|
|
1923
1982
|
month: t,
|
|
1924
1983
|
monthIndex: n,
|
|
1925
|
-
firstVisibleDate:
|
|
1984
|
+
firstVisibleDate: o,
|
|
1926
1985
|
lastVisibleDate: s
|
|
1927
1986
|
};
|
|
1928
|
-
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${
|
|
1987
|
+
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${o.toISOString().split("T")[0]} to ${s.toISOString().split("T")[0]}`);
|
|
1929
1988
|
const l = e.options.beforeMonthChangedCallback(d), c = l instanceof Promise;
|
|
1930
|
-
c &&
|
|
1989
|
+
c && ze(e);
|
|
1931
1990
|
const u = await Promise.resolve(l);
|
|
1932
|
-
return c && ae(e), u.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${u.message || "no reason provided"}`), u.message && console.warn(`[DateRangePicker] Month navigation blocked: ${u.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((r = u.metadata) == null ? void 0 : r.size) || 0}, monthHeaders: ${((
|
|
1933
|
-
e.bulkMetadataCache.set(
|
|
1934
|
-
}), w.debug(`handleBeforeMonthChange() - merged ${u.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = u.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${u.metadata.size} entries`)) : e.bulkMetadataCache = null, u.monthHeaders && (e.monthHeadersCache ? (u.monthHeaders.forEach((
|
|
1935
|
-
e.monthHeadersCache.set(
|
|
1991
|
+
return c && ae(e), u.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${u.message || "no reason provided"}`), u.message && console.warn(`[DateRangePicker] Month navigation blocked: ${u.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((r = u.metadata) == null ? void 0 : r.size) || 0}, monthHeaders: ${((i = u.monthHeaders) == null ? void 0 : i.size) || 0}`), u.metadata ? e.bulkMetadataCache ? (u.metadata.forEach((g, p) => {
|
|
1992
|
+
e.bulkMetadataCache.set(p, g);
|
|
1993
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${u.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = u.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${u.metadata.size} entries`)) : e.bulkMetadataCache = null, u.monthHeaders && (e.monthHeadersCache ? (u.monthHeaders.forEach((g, p) => {
|
|
1994
|
+
e.monthHeadersCache.set(p, g);
|
|
1936
1995
|
}), w.debug(`handleBeforeMonthChange() - merged ${u.monthHeaders.size} entries into headers cache (total: ${e.monthHeadersCache.size})`)) : (e.monthHeadersCache = u.monthHeaders, w.debug(`handleBeforeMonthChange() - month headers cache created with ${u.monthHeaders.size} entries`))), !0);
|
|
1937
|
-
} catch (
|
|
1938
|
-
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:",
|
|
1996
|
+
} catch (o) {
|
|
1997
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", o), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", o), !1;
|
|
1939
1998
|
} finally {
|
|
1940
1999
|
e.isMonthChanging = !1;
|
|
1941
2000
|
}
|
|
1942
2001
|
}
|
|
1943
|
-
function
|
|
2002
|
+
function mn(e, a) {
|
|
1944
2003
|
e.showingRollingSelector[a] = !e.showingRollingSelector[a], e.renderCalendar();
|
|
1945
2004
|
}
|
|
1946
|
-
async function
|
|
2005
|
+
async function bn(e, a, t) {
|
|
1947
2006
|
const n = e.monthDates[t].getMonth();
|
|
1948
2007
|
if (!await Q(e, a, n, t)) {
|
|
1949
2008
|
w.debug(`selectYear() Col${t} - navigation blocked by callback`);
|
|
1950
2009
|
return;
|
|
1951
2010
|
}
|
|
1952
|
-
const
|
|
1953
|
-
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${
|
|
2011
|
+
const i = e.monthDates[t].getFullYear();
|
|
2012
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${i} to ${a}`), he(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1954
2013
|
}
|
|
1955
|
-
async function
|
|
2014
|
+
async function yn(e, a, t) {
|
|
1956
2015
|
const n = e.monthDates[t].getFullYear();
|
|
1957
2016
|
if (!await Q(e, n, a, t)) {
|
|
1958
2017
|
w.debug(`selectMonth() Col${t} - navigation blocked by callback`);
|
|
1959
2018
|
return;
|
|
1960
2019
|
}
|
|
1961
|
-
const
|
|
1962
|
-
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${
|
|
2020
|
+
const i = e.monthDates[t].getMonth();
|
|
2021
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${i + 1} to ${a + 1}`), he(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1963
2022
|
}
|
|
1964
|
-
function
|
|
2023
|
+
function he(e, a) {
|
|
1965
2024
|
const t = e.monthDates[a];
|
|
1966
2025
|
if (a < e.monthDates.length - 1) {
|
|
1967
2026
|
const n = e.monthDates[a + 1];
|
|
1968
|
-
if (
|
|
2027
|
+
if (Pe(t, n)) {
|
|
1969
2028
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a + 1}, shifting forward`);
|
|
1970
2029
|
const r = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1971
|
-
e.monthDates[a + 1] = r,
|
|
2030
|
+
e.monthDates[a + 1] = r, he(e, a + 1);
|
|
1972
2031
|
}
|
|
1973
2032
|
}
|
|
1974
2033
|
if (a > 0) {
|
|
1975
2034
|
const n = e.monthDates[a - 1];
|
|
1976
|
-
if (
|
|
2035
|
+
if (Pe(n, t)) {
|
|
1977
2036
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a - 1}, shifting backward`);
|
|
1978
2037
|
const r = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1979
|
-
e.monthDates[a - 1] = r,
|
|
2038
|
+
e.monthDates[a - 1] = r, he(e, a - 1);
|
|
1980
2039
|
}
|
|
1981
2040
|
}
|
|
1982
2041
|
}
|
|
1983
|
-
function
|
|
1984
|
-
const t = e.getFullYear(), n = e.getMonth(), r = a.getFullYear(),
|
|
1985
|
-
return t > r || t === r && n >=
|
|
2042
|
+
function Pe(e, a) {
|
|
2043
|
+
const t = e.getFullYear(), n = e.getMonth(), r = a.getFullYear(), i = a.getMonth();
|
|
2044
|
+
return t > r || t === r && n >= i;
|
|
1986
2045
|
}
|
|
1987
|
-
async function
|
|
2046
|
+
async function ve(e, a) {
|
|
1988
2047
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1989
2048
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1990
2049
|
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
@@ -1997,12 +2056,12 @@ async function ye(e, a) {
|
|
|
1997
2056
|
return;
|
|
1998
2057
|
}
|
|
1999
2058
|
if (e.monthDates[t] = r, w.debug(`prevMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${r.getFullYear()}-${r.getMonth() + 1}`), t > 0) {
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2059
|
+
const o = e.monthDates[t - 1];
|
|
2060
|
+
Pe(o, r) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await ve(e, t - 1));
|
|
2002
2061
|
}
|
|
2003
2062
|
e.renderCalendar();
|
|
2004
2063
|
}
|
|
2005
|
-
async function
|
|
2064
|
+
async function De(e, a) {
|
|
2006
2065
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
2007
2066
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
2008
2067
|
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
@@ -2015,30 +2074,30 @@ async function ve(e, a) {
|
|
|
2015
2074
|
return;
|
|
2016
2075
|
}
|
|
2017
2076
|
if (e.monthDates[t] = r, w.debug(`nextMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${r.getFullYear()}-${r.getMonth() + 1}`), t < e.monthDates.length - 1) {
|
|
2018
|
-
const
|
|
2019
|
-
|
|
2077
|
+
const o = e.monthDates[t + 1];
|
|
2078
|
+
Pe(r, o) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await De(e, t + 1));
|
|
2020
2079
|
}
|
|
2021
2080
|
e.renderCalendar();
|
|
2022
2081
|
}
|
|
2023
|
-
function
|
|
2024
|
-
let
|
|
2082
|
+
function be(e, a, t, n, r) {
|
|
2083
|
+
let i = a, o = 0;
|
|
2025
2084
|
const s = 60;
|
|
2026
|
-
for (;
|
|
2027
|
-
if (
|
|
2028
|
-
const l = n[
|
|
2085
|
+
for (; o < s; ) {
|
|
2086
|
+
if (i >= 0 && i < n.length) {
|
|
2087
|
+
const l = n[i].dataset.date;
|
|
2029
2088
|
if (l) {
|
|
2030
|
-
const [c, u,
|
|
2031
|
-
if (!e.isDateDisabledInternal(
|
|
2032
|
-
return { index:
|
|
2089
|
+
const [c, u, g] = l.split("-").map(Number), p = new Date(c, u - 1, g);
|
|
2090
|
+
if (!e.isDateDisabledInternal(p))
|
|
2091
|
+
return { index: i, monthChanged: !1 };
|
|
2033
2092
|
}
|
|
2034
2093
|
}
|
|
2035
|
-
if (
|
|
2094
|
+
if (i += t, o++, i < 0 || i >= n.length)
|
|
2036
2095
|
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
2037
2096
|
}
|
|
2038
2097
|
return { index: null, monthChanged: !1 };
|
|
2039
2098
|
}
|
|
2040
|
-
function
|
|
2041
|
-
var
|
|
2099
|
+
function vn(e, a) {
|
|
2100
|
+
var o, s, d, l;
|
|
2042
2101
|
w.debug(`moveFocus(${a}) Col${e.activeMonthIndex} - focusedDayIndex:`, e.focusedDayIndex);
|
|
2043
2102
|
const t = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
2044
2103
|
if (!t) {
|
|
@@ -2051,30 +2110,30 @@ function mn(e, a) {
|
|
|
2051
2110
|
const c = Array.from(n).findIndex((u) => u.classList.contains("drp-date-picker__day--today"));
|
|
2052
2111
|
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}`);
|
|
2053
2112
|
}
|
|
2054
|
-
(
|
|
2113
|
+
(o = n[e.focusedDayIndex]) == null || o.classList.remove("drp-date-picker__day--focused");
|
|
2055
2114
|
const r = e.focusedDayIndex + a;
|
|
2056
2115
|
if (r < 0) {
|
|
2057
2116
|
const c = e.activeMonthIndex;
|
|
2058
2117
|
if (a === -1)
|
|
2059
|
-
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`),
|
|
2118
|
+
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
2060
2119
|
var f, h;
|
|
2061
2120
|
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2062
2121
|
if (!u) return;
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2122
|
+
const g = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = be(e, g.length - 1, -1, g);
|
|
2123
|
+
p.index !== null && (e.focusedDayIndex = p.index, (f = g[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = g[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2065
2124
|
}, 0);
|
|
2066
2125
|
else {
|
|
2067
|
-
const
|
|
2068
|
-
if (
|
|
2069
|
-
const [
|
|
2070
|
-
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${h} is weekday ${m}, going to prev month`),
|
|
2126
|
+
const g = n[e.focusedDayIndex].dataset.date;
|
|
2127
|
+
if (g) {
|
|
2128
|
+
const [p, f, h] = g.split("-").map(Number), m = new Date(p, f - 1, h).getDay();
|
|
2129
|
+
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${h} is weekday ${m}, going to prev month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
2071
2130
|
var _, R;
|
|
2072
|
-
const
|
|
2073
|
-
if (!
|
|
2074
|
-
const C =
|
|
2131
|
+
const x = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2132
|
+
if (!x) return;
|
|
2133
|
+
const C = x.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), D = C[C.length - 1].dataset.date;
|
|
2075
2134
|
if (D) {
|
|
2076
|
-
const [L, y,
|
|
2077
|
-
e.focusedDayIndex = C.length - 1 - T, w.debug(`moveFocus() Col${c} - last day weekday ${
|
|
2135
|
+
const [L, y, S] = D.split("-").map(Number), I = new Date(L, y - 1, S).getDay(), T = (I - m + 7) % 7;
|
|
2136
|
+
e.focusedDayIndex = C.length - 1 - T, w.debug(`moveFocus() Col${c} - last day weekday ${I}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
2078
2137
|
}
|
|
2079
2138
|
}, 0);
|
|
2080
2139
|
}
|
|
@@ -2083,51 +2142,51 @@ function mn(e, a) {
|
|
|
2083
2142
|
} else if (r >= n.length) {
|
|
2084
2143
|
const c = e.activeMonthIndex;
|
|
2085
2144
|
if (a === 1)
|
|
2086
|
-
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`),
|
|
2145
|
+
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), De(e, e.activeMonthIndex), setTimeout(() => {
|
|
2087
2146
|
var f, h;
|
|
2088
2147
|
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2089
2148
|
if (!u) return;
|
|
2090
|
-
const
|
|
2091
|
-
|
|
2149
|
+
const g = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = be(e, 0, 1, g);
|
|
2150
|
+
p.index !== null && (e.focusedDayIndex = p.index, (f = g[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = g[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2092
2151
|
}, 0);
|
|
2093
2152
|
else {
|
|
2094
|
-
const
|
|
2095
|
-
if (
|
|
2096
|
-
const [
|
|
2097
|
-
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${h} is weekday ${m}, going to next month`),
|
|
2153
|
+
const g = n[e.focusedDayIndex].dataset.date;
|
|
2154
|
+
if (g) {
|
|
2155
|
+
const [p, f, h] = g.split("-").map(Number), m = new Date(p, f - 1, h).getDay();
|
|
2156
|
+
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${h} is weekday ${m}, going to next month`), De(e, e.activeMonthIndex), setTimeout(() => {
|
|
2098
2157
|
var _, R;
|
|
2099
|
-
const
|
|
2100
|
-
if (!
|
|
2101
|
-
const C =
|
|
2158
|
+
const x = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2159
|
+
if (!x) return;
|
|
2160
|
+
const C = x.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), D = C[0].dataset.date;
|
|
2102
2161
|
if (D) {
|
|
2103
|
-
const [L, y,
|
|
2104
|
-
e.focusedDayIndex = T, w.debug(`moveFocus() Col${c} - first day weekday ${
|
|
2162
|
+
const [L, y, S] = D.split("-").map(Number), I = new Date(L, y - 1, S).getDay(), T = (m - I + 7) % 7;
|
|
2163
|
+
e.focusedDayIndex = T, w.debug(`moveFocus() Col${c} - first day weekday ${I}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = C[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = C[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
2105
2164
|
}
|
|
2106
2165
|
}, 0);
|
|
2107
2166
|
}
|
|
2108
2167
|
}
|
|
2109
2168
|
return;
|
|
2110
2169
|
}
|
|
2111
|
-
const
|
|
2112
|
-
if (
|
|
2170
|
+
const i = be(e, r, a, n, e.activeMonthIndex);
|
|
2171
|
+
if (i.monthChanged) {
|
|
2113
2172
|
const c = e.activeMonthIndex;
|
|
2114
|
-
|
|
2173
|
+
i.direction === "next" ? De(e, e.activeMonthIndex) : ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
2115
2174
|
var f, h;
|
|
2116
2175
|
const u = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
2117
2176
|
if (!u) return;
|
|
2118
|
-
const
|
|
2177
|
+
const g = u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = be(
|
|
2119
2178
|
e,
|
|
2120
|
-
|
|
2179
|
+
i.direction === "next" ? 0 : g.length - 1,
|
|
2121
2180
|
a,
|
|
2122
|
-
|
|
2181
|
+
g
|
|
2123
2182
|
);
|
|
2124
|
-
|
|
2183
|
+
p.index !== null && (e.focusedDayIndex = p.index, (f = g[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = g[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
2125
2184
|
}, 0);
|
|
2126
2185
|
return;
|
|
2127
2186
|
}
|
|
2128
|
-
|
|
2187
|
+
i.index !== null ? (e.focusedDayIndex = i.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"));
|
|
2129
2188
|
}
|
|
2130
|
-
async function
|
|
2189
|
+
async function Dn(e) {
|
|
2131
2190
|
if (!e.options.unifiedNavigation) return;
|
|
2132
2191
|
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
2133
2192
|
if (w.debug(`unifiedNextMonth() - anchor index: ${a}, current: ${t.getFullYear()}-${t.getMonth() + 1}, new: ${n.getFullYear()}-${n.getMonth() + 1}`), !U(e, n.getFullYear(), n.getMonth())) {
|
|
@@ -2135,14 +2194,14 @@ async function bn(e) {
|
|
|
2135
2194
|
return;
|
|
2136
2195
|
}
|
|
2137
2196
|
if (await Q(e, n.getFullYear(), n.getMonth(), a)) {
|
|
2138
|
-
for (let
|
|
2139
|
-
const
|
|
2140
|
-
e.monthDates[
|
|
2197
|
+
for (let i = 0; i < e.monthDates.length; i++) {
|
|
2198
|
+
const o = i - a;
|
|
2199
|
+
e.monthDates[i] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
2141
2200
|
}
|
|
2142
2201
|
e.renderCalendar();
|
|
2143
2202
|
}
|
|
2144
2203
|
}
|
|
2145
|
-
async function
|
|
2204
|
+
async function _n(e) {
|
|
2146
2205
|
if (!e.options.unifiedNavigation) return;
|
|
2147
2206
|
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
2148
2207
|
if (w.debug(`unifiedPrevMonth() - anchor index: ${a}, current: ${t.getFullYear()}-${t.getMonth() + 1}, new: ${n.getFullYear()}-${n.getMonth() + 1}`), !U(e, n.getFullYear(), n.getMonth())) {
|
|
@@ -2150,39 +2209,39 @@ async function yn(e) {
|
|
|
2150
2209
|
return;
|
|
2151
2210
|
}
|
|
2152
2211
|
if (await Q(e, n.getFullYear(), n.getMonth(), a)) {
|
|
2153
|
-
for (let
|
|
2154
|
-
const
|
|
2155
|
-
e.monthDates[
|
|
2212
|
+
for (let i = 0; i < e.monthDates.length; i++) {
|
|
2213
|
+
const o = i - a;
|
|
2214
|
+
e.monthDates[i] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
2156
2215
|
}
|
|
2157
2216
|
e.renderCalendar();
|
|
2158
2217
|
}
|
|
2159
2218
|
}
|
|
2160
|
-
async function
|
|
2219
|
+
async function wn(e, a) {
|
|
2161
2220
|
if (!e.options.unifiedNavigation) return;
|
|
2162
2221
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
2163
2222
|
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Q(e, n, a, t)) {
|
|
2164
|
-
for (let
|
|
2165
|
-
const
|
|
2166
|
-
e.monthDates[
|
|
2223
|
+
for (let i = 0; i < e.monthDates.length; i++) {
|
|
2224
|
+
const o = i - t;
|
|
2225
|
+
e.monthDates[i] = new Date(n, a + o, 1);
|
|
2167
2226
|
}
|
|
2168
2227
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
2169
2228
|
}
|
|
2170
2229
|
}
|
|
2171
|
-
function
|
|
2230
|
+
function xn(e) {
|
|
2172
2231
|
e.options.unifiedNavigation && (e.showingUnifiedRollingSelector = !e.showingUnifiedRollingSelector, w.debug(`toggleUnifiedRollingSelector() - now ${e.showingUnifiedRollingSelector ? "visible" : "hidden"}`), e.renderCalendar());
|
|
2173
2232
|
}
|
|
2174
|
-
async function
|
|
2233
|
+
async function Mn(e, a) {
|
|
2175
2234
|
if (!e.options.unifiedNavigation) return;
|
|
2176
2235
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getMonth();
|
|
2177
2236
|
if (w.debug(`setUnifiedYear(${a}) - anchor index: ${t}, month: ${n}`), !!await Q(e, a, n, t)) {
|
|
2178
|
-
for (let
|
|
2179
|
-
const
|
|
2180
|
-
e.monthDates[
|
|
2237
|
+
for (let i = 0; i < e.monthDates.length; i++) {
|
|
2238
|
+
const o = i - t;
|
|
2239
|
+
e.monthDates[i] = new Date(a, n + o, 1);
|
|
2181
2240
|
}
|
|
2182
2241
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
2183
2242
|
}
|
|
2184
2243
|
}
|
|
2185
|
-
function
|
|
2244
|
+
function Bt(e, a, t) {
|
|
2186
2245
|
if (!e) {
|
|
2187
2246
|
if (t != null && t.normalizedMinDate || t != null && t.normalizedMaxDate) {
|
|
2188
2247
|
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1, r = t.normalizedMaxDate ? t.normalizedMaxDate.getFullYear() : a + 1;
|
|
@@ -2198,16 +2257,16 @@ function Ot(e, a, t) {
|
|
|
2198
2257
|
return { min: n, max: n };
|
|
2199
2258
|
}
|
|
2200
2259
|
}
|
|
2201
|
-
function
|
|
2260
|
+
function Vt(e) {
|
|
2202
2261
|
if (!e)
|
|
2203
2262
|
return { min: 1, max: 12 };
|
|
2204
2263
|
const [a, t] = e.split("-");
|
|
2205
2264
|
return { min: parseInt(a, 10), max: parseInt(t, 10) };
|
|
2206
2265
|
}
|
|
2207
|
-
function
|
|
2208
|
-
|
|
2266
|
+
function Sn(e) {
|
|
2267
|
+
le.debug("[DatePicker 18] renderCalendar called, showingRollingSelector:", e.showingRollingSelector, `activeCol: ${e.activeMonthIndex}`), le.debug("[DatePicker 18] monthDates array:", e.monthDates.map((a, t) => `Col${t}: ${a.getFullYear()}-${a.getMonth() + 1}`).join(", ")), e.options.unifiedNavigation && e.showingUnifiedRollingSelector && En(e);
|
|
2209
2268
|
for (let a = 0; a < e.options.visibleMonthsCount; a++)
|
|
2210
|
-
e.showingRollingSelector[a] ?
|
|
2269
|
+
e.showingRollingSelector[a] ? jt(e, a) : qt(e, a);
|
|
2211
2270
|
if (e.focusedDayIndex !== null) {
|
|
2212
2271
|
const a = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
2213
2272
|
if (a) {
|
|
@@ -2217,80 +2276,80 @@ function wn(e) {
|
|
|
2217
2276
|
}
|
|
2218
2277
|
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
2219
2278
|
}
|
|
2220
|
-
function
|
|
2279
|
+
function qt(e, a) {
|
|
2221
2280
|
var C;
|
|
2222
|
-
|
|
2281
|
+
le.debug(`[DatePicker Col${a} 19] renderNormalView called for month`, a);
|
|
2223
2282
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2224
2283
|
if (!t) return;
|
|
2225
2284
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
2226
2285
|
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
2227
|
-
const r = e.monthDates[a],
|
|
2286
|
+
const r = e.monthDates[a], i = r.getFullYear(), o = r.getMonth(), s = e.monthNames[o], d = t.querySelector(".drp-date-picker__month-year");
|
|
2228
2287
|
if (d) {
|
|
2229
|
-
const
|
|
2288
|
+
const M = `${i}-${String(o + 1).padStart(2, "0")}`;
|
|
2230
2289
|
let D;
|
|
2231
|
-
(C = e.monthHeadersCache) != null && C.has(
|
|
2290
|
+
(C = e.monthHeadersCache) != null && C.has(M) ? D = e.monthHeadersCache.get(M) : e.options.getMonthHeaderCallback ? D = e.options.getMonthHeaderCallback({
|
|
2232
2291
|
month: r,
|
|
2233
2292
|
monthIndex: a,
|
|
2234
2293
|
monthName: s,
|
|
2235
|
-
year:
|
|
2236
|
-
}) : D = `${s} ${
|
|
2294
|
+
year: i
|
|
2295
|
+
}) : D = `${s} ${i}`, d.textContent = D;
|
|
2237
2296
|
}
|
|
2238
2297
|
if (e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
2239
2298
|
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
2240
|
-
const
|
|
2299
|
+
const M = e.monthDates[0], D = e.monthDates[e.monthDates.length - 1], _ = e.options.unifiedNavigationAnchorIndex ?? 0, R = e.monthDates[_];
|
|
2241
2300
|
if (e.options.getUnifiedHeaderCallback) {
|
|
2242
2301
|
const y = e.options.getUnifiedHeaderCallback({
|
|
2243
|
-
firstMonth:
|
|
2302
|
+
firstMonth: M,
|
|
2244
2303
|
lastMonth: D,
|
|
2245
2304
|
anchorMonth: R,
|
|
2246
2305
|
monthNames: e.monthNames
|
|
2247
2306
|
});
|
|
2248
2307
|
e.unifiedRangeDisplay.textContent = y;
|
|
2249
2308
|
} else {
|
|
2250
|
-
const y = e.monthNames[
|
|
2251
|
-
|
|
2309
|
+
const y = e.monthNames[M.getMonth()], S = e.monthNames[D.getMonth()], E = M.getFullYear(), I = D.getFullYear();
|
|
2310
|
+
E === I ? e.unifiedRangeDisplay.textContent = `${y} ${E} - ${S} ${I}` : e.unifiedRangeDisplay.textContent = `${y} ${E} - ${S} ${I}`;
|
|
2252
2311
|
}
|
|
2253
2312
|
const L = e.unifiedHeader;
|
|
2254
2313
|
if (L) {
|
|
2255
|
-
const y =
|
|
2256
|
-
|
|
2257
|
-
const
|
|
2258
|
-
A && (U(e,
|
|
2314
|
+
const y = M.getMonth() === 0 ? M.getFullYear() - 1 : M.getFullYear(), S = M.getMonth() === 0 ? 11 : M.getMonth() - 1, E = L.querySelector(".drp-date-picker__nav--prev");
|
|
2315
|
+
E && (U(e, y, S) ? (E.removeAttribute("disabled"), E.classList.remove("drp-date-picker__nav--disabled")) : (E.setAttribute("disabled", "true"), E.classList.add("drp-date-picker__nav--disabled")));
|
|
2316
|
+
const I = D.getMonth() === 11 ? D.getFullYear() + 1 : D.getFullYear(), T = D.getMonth() === 11 ? 0 : D.getMonth() + 1, A = L.querySelector(".drp-date-picker__nav--next");
|
|
2317
|
+
A && (U(e, I, T) ? (A.removeAttribute("disabled"), A.classList.remove("drp-date-picker__nav--disabled")) : (A.setAttribute("disabled", "true"), A.classList.add("drp-date-picker__nav--disabled")));
|
|
2259
2318
|
}
|
|
2260
2319
|
}
|
|
2261
|
-
const l = r.getFullYear(), c = r.getMonth(), u = c === 0 ? 11 : c - 1,
|
|
2262
|
-
|
|
2320
|
+
const l = r.getFullYear(), c = r.getMonth(), u = c === 0 ? 11 : c - 1, g = c === 0 ? l - 1 : l, p = t.querySelector(".drp-date-picker__nav--prev");
|
|
2321
|
+
p && (U(e, g, u) ? (p.removeAttribute("disabled"), p.classList.remove("drp-date-picker__nav--disabled")) : (p.setAttribute("disabled", "true"), p.classList.add("drp-date-picker__nav--disabled")));
|
|
2263
2322
|
const f = c === 11 ? 0 : c + 1, h = c === 11 ? l + 1 : l, v = t.querySelector(".drp-date-picker__nav--next");
|
|
2264
2323
|
v && (U(e, h, f) ? (v.removeAttribute("disabled"), v.classList.remove("drp-date-picker__nav--disabled")) : (v.setAttribute("disabled", "true"), v.classList.add("drp-date-picker__nav--disabled")));
|
|
2265
|
-
const m = t.querySelector(".drp-date-picker__weekdays"),
|
|
2324
|
+
const m = t.querySelector(".drp-date-picker__weekdays"), x = [
|
|
2266
2325
|
...e.weekdayNames.slice(e.weekStartDay),
|
|
2267
2326
|
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
2268
2327
|
];
|
|
2269
|
-
m && (m.innerHTML =
|
|
2328
|
+
m && (m.innerHTML = x.map((M) => `<div class="drp-date-picker__weekday">${M}</div>`).join("")), Ut(e, a, r);
|
|
2270
2329
|
}
|
|
2271
|
-
function
|
|
2272
|
-
|
|
2330
|
+
function Ut(e, a, t) {
|
|
2331
|
+
le.debug(`[DatePicker Col${a} 20] renderDays called for month`, a);
|
|
2273
2332
|
const n = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2274
2333
|
if (!n) return;
|
|
2275
|
-
const r = n.querySelector(".drp-date-picker__days"),
|
|
2276
|
-
|
|
2277
|
-
const d = (new Date(
|
|
2334
|
+
const r = n.querySelector(".drp-date-picker__days"), i = t.getFullYear(), o = t.getMonth();
|
|
2335
|
+
le.debug(`[DatePicker Col${a} 21] Rendering days for:`, i, o + 1);
|
|
2336
|
+
const d = (new Date(i, o, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(i, o + 1, 0).getDate(), c = new Date(i, o, 0).getDate(), u = new Date(i, o - 1, 1), g = u.getFullYear(), p = u.getMonth(), f = new Date(i, o + 1, 1), h = f.getFullYear(), v = f.getMonth(), m = [];
|
|
2278
2337
|
for (let _ = d - 1; _ >= 0; _--) {
|
|
2279
|
-
const R = c - _, L = new Date(
|
|
2338
|
+
const R = c - _, L = new Date(g, p, R);
|
|
2280
2339
|
m.push({
|
|
2281
2340
|
date: L,
|
|
2282
|
-
year:
|
|
2283
|
-
month:
|
|
2341
|
+
year: g,
|
|
2342
|
+
month: p,
|
|
2284
2343
|
day: R,
|
|
2285
2344
|
isOtherMonth: !0
|
|
2286
2345
|
});
|
|
2287
2346
|
}
|
|
2288
2347
|
for (let _ = 1; _ <= l; _++) {
|
|
2289
|
-
const R = new Date(
|
|
2348
|
+
const R = new Date(i, o, _);
|
|
2290
2349
|
m.push({
|
|
2291
2350
|
date: R,
|
|
2292
|
-
year:
|
|
2293
|
-
month:
|
|
2351
|
+
year: i,
|
|
2352
|
+
month: o,
|
|
2294
2353
|
day: _,
|
|
2295
2354
|
isOtherMonth: !1
|
|
2296
2355
|
});
|
|
@@ -2306,18 +2365,18 @@ function Vt(e, a, t) {
|
|
|
2306
2365
|
isOtherMonth: !0
|
|
2307
2366
|
});
|
|
2308
2367
|
}
|
|
2309
|
-
const
|
|
2368
|
+
const M = [];
|
|
2310
2369
|
for (let _ = 0; _ < m.length; _ += 7)
|
|
2311
|
-
|
|
2370
|
+
M.push(m.slice(_, _ + 7));
|
|
2312
2371
|
let D = "";
|
|
2313
|
-
for (const _ of
|
|
2372
|
+
for (const _ of M) {
|
|
2314
2373
|
const R = _.map((y) => {
|
|
2315
|
-
const
|
|
2316
|
-
let
|
|
2317
|
-
if (e.options.badgeTooltipCallback && (
|
|
2374
|
+
const S = e.getDateInfoInternal(y.date);
|
|
2375
|
+
let E = (S == null ? void 0 : S.badgeTooltip) || "";
|
|
2376
|
+
if (e.options.badgeTooltipCallback && (S != null && S.badgeText)) {
|
|
2318
2377
|
const T = {
|
|
2319
2378
|
date: y.date,
|
|
2320
|
-
dateString:
|
|
2379
|
+
dateString: ye(y.date),
|
|
2321
2380
|
dayNumber: y.day,
|
|
2322
2381
|
isDisabled: e.isDateDisabledInternal(y.date),
|
|
2323
2382
|
isSelected: !1,
|
|
@@ -2325,53 +2384,56 @@ function Vt(e, a, t) {
|
|
|
2325
2384
|
isStartDate: !1,
|
|
2326
2385
|
isEndDate: !1,
|
|
2327
2386
|
isInRange: !1,
|
|
2328
|
-
isToday:
|
|
2387
|
+
isToday: pt(y.date),
|
|
2329
2388
|
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
2330
2389
|
monthIndex: a,
|
|
2331
2390
|
element: null,
|
|
2332
2391
|
// Not available during string rendering
|
|
2333
2392
|
picker: e
|
|
2334
2393
|
}, A = e.options.badgeTooltipCallback(T);
|
|
2335
|
-
A !== null && (
|
|
2394
|
+
A !== null && (E = A);
|
|
2336
2395
|
}
|
|
2337
2396
|
return {
|
|
2338
|
-
text: (
|
|
2339
|
-
tooltip:
|
|
2340
|
-
class: (
|
|
2397
|
+
text: (S == null ? void 0 : S.badgeText) || "",
|
|
2398
|
+
tooltip: E,
|
|
2399
|
+
class: (S == null ? void 0 : S.badgeClass) || ""
|
|
2341
2400
|
};
|
|
2342
2401
|
});
|
|
2343
2402
|
if (R.some((y) => y.text)) {
|
|
2344
2403
|
D += '<div class="drp-date-picker__badge-row">';
|
|
2345
2404
|
for (const y of R)
|
|
2346
2405
|
if (y.text) {
|
|
2347
|
-
const
|
|
2348
|
-
D += `<div class="drp-date-picker__badge-cell${
|
|
2406
|
+
const S = y.tooltip ? ` data-tooltip="${y.tooltip.replace(/"/g, """)}"` : "", E = y.class ? ` ${y.class}` : "";
|
|
2407
|
+
D += `<div class="drp-date-picker__badge-cell${E}"${S}>${y.text}</div>`;
|
|
2349
2408
|
} else
|
|
2350
2409
|
D += '<div class="drp-date-picker__badge-cell"></div>';
|
|
2351
2410
|
D += "</div>";
|
|
2352
2411
|
}
|
|
2353
2412
|
D += '<div class="drp-date-picker__date-row">';
|
|
2354
2413
|
for (const y of _) {
|
|
2355
|
-
const
|
|
2356
|
-
y.isOtherMonth &&
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2414
|
+
const S = ["drp-date-picker__day"];
|
|
2415
|
+
y.isOtherMonth && S.push("drp-date-picker__day--other-month");
|
|
2416
|
+
const E = e.getDateInfoInternal(y.date), I = E && E.isDisabled !== void 0 ? E.isDisabled : e.isDateDisabledInternal(y.date);
|
|
2417
|
+
I && S.push("drp-date-picker__day--disabled"), E && E.dayClass && S.push(E.dayClass), e.isToday(y.date) && S.push("drp-date-picker__day--today");
|
|
2359
2418
|
let T = !1;
|
|
2360
|
-
e.options.selectionMode === "single" ? T = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((
|
|
2419
|
+
e.options.selectionMode === "single" ? T = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((H) => e.isSameDay(y.date, H))), T && S.push("drp-date-picker__day--selected");
|
|
2361
2420
|
let A = !1, $ = !1, N = !1;
|
|
2362
|
-
if (e.options.selectionMode === "range")
|
|
2363
|
-
A = e.isSameDay(y.date, e.selectedStartDate), $ = e.isSameDay(y.date, e.selectedEndDate), N = e.isInRange(y.date), A &&
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2421
|
+
if (e.options.selectionMode === "range") {
|
|
2422
|
+
if (A = e.isSameDay(y.date, e.selectedStartDate), $ = e.isSameDay(y.date, e.selectedEndDate), N = e.isInRange(y.date), A && S.push("drp-date-picker__day--range-start"), $ && S.push("drp-date-picker__day--range-end"), N && (!I || e.options.highlightDisabledInRange) && S.push("drp-date-picker__day--in-range"), e.invalidRangeStart && e.invalidRangeEnd) {
|
|
2423
|
+
const H = e.isSameDay(y.date, e.invalidRangeStart), Se = e.isSameDay(y.date, e.invalidRangeEnd), Xt = y.date > e.invalidRangeStart && y.date < e.invalidRangeEnd;
|
|
2424
|
+
H && S.push("drp-date-picker__day--invalid-range-start"), Se && S.push("drp-date-picker__day--invalid-range-end"), Xt && S.push("drp-date-picker__day--invalid-range");
|
|
2425
|
+
}
|
|
2426
|
+
} else if (e.options.selectionMode === "multiple")
|
|
2427
|
+
for (const H of e.selectedRanges)
|
|
2428
|
+
e.isSameDay(y.date, H.start) && (A = !0, S.push("drp-date-picker__day--range-start")), e.isSameDay(y.date, H.end) && ($ = !0, S.push("drp-date-picker__day--range-end")), y.date >= H.start && y.date <= H.end && (N = !0, (!I || e.options.highlightDisabledInRange) && S.push("drp-date-picker__day--in-range"));
|
|
2367
2429
|
const z = `${y.year}-${String(y.month + 1).padStart(2, "0")}-${String(y.day).padStart(2, "0")}`;
|
|
2368
|
-
let P = (
|
|
2430
|
+
let P = (E == null ? void 0 : E.dayTooltip) || "";
|
|
2369
2431
|
if (e.options.dayTooltipCallback) {
|
|
2370
|
-
const
|
|
2432
|
+
const H = {
|
|
2371
2433
|
date: y.date,
|
|
2372
2434
|
dateString: z,
|
|
2373
2435
|
dayNumber: y.day,
|
|
2374
|
-
isDisabled:
|
|
2436
|
+
isDisabled: I,
|
|
2375
2437
|
isSelected: T,
|
|
2376
2438
|
isStartDate: A,
|
|
2377
2439
|
isEndDate: $,
|
|
@@ -2382,109 +2444,109 @@ function Vt(e, a, t) {
|
|
|
2382
2444
|
element: null,
|
|
2383
2445
|
// Not available during string rendering
|
|
2384
2446
|
picker: e
|
|
2385
|
-
},
|
|
2386
|
-
|
|
2447
|
+
}, Se = e.options.dayTooltipCallback(H);
|
|
2448
|
+
Se !== null && (P = Se);
|
|
2387
2449
|
}
|
|
2388
|
-
const
|
|
2389
|
-
D += `<div class="${
|
|
2450
|
+
const q = P ? ` data-tooltip="${P.replace(/"/g, """)}"` : "";
|
|
2451
|
+
D += `<div class="${S.join(" ")}" data-date="${z}" data-day-number="${y.day}"${q}>`, D += `<slot name="day-${z}">${y.day}</slot>`, D += "</div>";
|
|
2390
2452
|
}
|
|
2391
2453
|
D += "</div>";
|
|
2392
2454
|
}
|
|
2393
|
-
r && (r.innerHTML = D,
|
|
2455
|
+
r && (r.innerHTML = D, Cn(e, a, r));
|
|
2394
2456
|
}
|
|
2395
|
-
function
|
|
2457
|
+
function Cn(e, a, t) {
|
|
2396
2458
|
if (!e.options.renderDayCallback && !e.options.renderDayContentCallback)
|
|
2397
2459
|
return;
|
|
2398
2460
|
t.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
2399
|
-
const
|
|
2400
|
-
if (!
|
|
2401
|
-
const [d, l, c] =
|
|
2402
|
-
if (
|
|
2461
|
+
const i = r, o = i.getAttribute("data-date"), s = parseInt(i.getAttribute("data-day-number") || "0", 10);
|
|
2462
|
+
if (!o) return;
|
|
2463
|
+
const [d, l, c] = o.split("-"), u = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), g = i.querySelector(`slot[name="day-${o}"]`);
|
|
2464
|
+
if (g && g.assignedNodes().length > 0)
|
|
2403
2465
|
return;
|
|
2404
|
-
const f = e.isDateDisabledInternal(u), h = e.isToday(u), v = u.getDay() === 0 || u.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(u, e.selectedDate),
|
|
2466
|
+
const f = e.isDateDisabledInternal(u), h = e.isToday(u), v = u.getDay() === 0 || u.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(u, e.selectedDate), x = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedStartDate), C = e.options.selectionMode === "range" && e.isSameDay(u, e.selectedEndDate), M = e.options.selectionMode === "range" && e.isInRange(u), D = {
|
|
2405
2467
|
date: u,
|
|
2406
|
-
dateString:
|
|
2468
|
+
dateString: o,
|
|
2407
2469
|
dayNumber: s,
|
|
2408
2470
|
isDisabled: f,
|
|
2409
|
-
isSelected: m ||
|
|
2410
|
-
isStartDate:
|
|
2471
|
+
isSelected: m || x || C,
|
|
2472
|
+
isStartDate: x,
|
|
2411
2473
|
isEndDate: C,
|
|
2412
|
-
isInRange:
|
|
2474
|
+
isInRange: M,
|
|
2413
2475
|
isToday: h,
|
|
2414
2476
|
isWeekend: v,
|
|
2415
2477
|
monthIndex: a,
|
|
2416
|
-
element:
|
|
2478
|
+
element: i,
|
|
2417
2479
|
picker: e
|
|
2418
2480
|
};
|
|
2419
2481
|
if (e.options.renderDayCallback)
|
|
2420
2482
|
try {
|
|
2421
2483
|
const _ = e.options.renderDayCallback(D);
|
|
2422
|
-
_ != null && (typeof _ == "string" ?
|
|
2484
|
+
_ != null && (typeof _ == "string" ? g && (g.innerHTML = _) : _ instanceof HTMLElement && g && (g.innerHTML = "", g.appendChild(_)));
|
|
2423
2485
|
} catch (_) {
|
|
2424
2486
|
console.error("[DatePicker] Error in renderDayCallback:", _);
|
|
2425
2487
|
}
|
|
2426
2488
|
else if (e.options.renderDayContentCallback)
|
|
2427
2489
|
try {
|
|
2428
2490
|
const _ = e.options.renderDayContentCallback(D);
|
|
2429
|
-
_ != null && (typeof _ == "string" ?
|
|
2491
|
+
_ != null && (typeof _ == "string" ? g && (g.innerHTML += _) : _ instanceof HTMLElement && g && g.appendChild(_));
|
|
2430
2492
|
} catch (_) {
|
|
2431
2493
|
console.error("[DatePicker] Error in renderDayContentCallback:", _);
|
|
2432
2494
|
}
|
|
2433
2495
|
});
|
|
2434
2496
|
}
|
|
2435
|
-
function
|
|
2497
|
+
function jt(e, a) {
|
|
2436
2498
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
2437
2499
|
if (!t) return;
|
|
2438
2500
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
2439
2501
|
n == null || n.classList.add("drp-date-picker__rolling-selector--visible");
|
|
2440
|
-
const r = e.monthDates[a],
|
|
2502
|
+
const r = e.monthDates[a], i = r.getFullYear(), o = r.getMonth(), s = Bt(e.options.rollingYearRange, i, e), d = Vt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
2441
2503
|
let c = "";
|
|
2442
|
-
for (let
|
|
2443
|
-
const
|
|
2444
|
-
c += `<div class="drp-date-picker__rolling-item ${
|
|
2504
|
+
for (let g = s.min; g <= s.max; g++) {
|
|
2505
|
+
const p = g === i ? "drp-date-picker__rolling-item--selected" : "", h = gt(e, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2506
|
+
c += `<div class="drp-date-picker__rolling-item ${p} ${h}" data-year="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${g}</span></div>`;
|
|
2445
2507
|
}
|
|
2446
2508
|
l && (l.innerHTML = c);
|
|
2447
2509
|
const u = n == null ? void 0 : n.querySelector('[data-list="months"]');
|
|
2448
2510
|
if (u) {
|
|
2449
|
-
let
|
|
2450
|
-
for (let
|
|
2451
|
-
const f = e.monthNames[
|
|
2452
|
-
|
|
2511
|
+
let g = "";
|
|
2512
|
+
for (let p = d.min - 1; p <= d.max - 1; p++) {
|
|
2513
|
+
const f = e.monthNames[p], h = p === o ? "drp-date-picker__rolling-item--selected" : "", m = U(e, i, p) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2514
|
+
g += `<div class="drp-date-picker__rolling-item ${h} ${m}" data-month="${p}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${f}</span></div>`;
|
|
2453
2515
|
}
|
|
2454
|
-
u.innerHTML =
|
|
2516
|
+
u.innerHTML = g;
|
|
2455
2517
|
}
|
|
2456
2518
|
}
|
|
2457
|
-
function
|
|
2519
|
+
function En(e) {
|
|
2458
2520
|
if (!e.options.unifiedNavigation || !e.unifiedRollingSelector) return;
|
|
2459
2521
|
e.unifiedRollingSelector.classList.add("drp-date-picker__unified-rolling-selector--visible");
|
|
2460
|
-
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), r = t.getMonth(),
|
|
2522
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), r = t.getMonth(), i = e.getEffectiveYearRange(), o = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2461
2523
|
let d = "";
|
|
2462
|
-
for (let c =
|
|
2463
|
-
const u = c === n ? "drp-date-picker__rolling-item--selected" : "",
|
|
2464
|
-
d += `<div class="drp-date-picker__rolling-item ${u} ${
|
|
2524
|
+
for (let c = i.min; c <= i.max; c++) {
|
|
2525
|
+
const u = c === n ? "drp-date-picker__rolling-item--selected" : "", p = gt(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2526
|
+
d += `<div class="drp-date-picker__rolling-item ${u} ${p}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2465
2527
|
}
|
|
2466
2528
|
s && (s.innerHTML = d);
|
|
2467
2529
|
const l = e.unifiedRollingSelector.querySelector('[data-list="months"]');
|
|
2468
2530
|
if (l) {
|
|
2469
2531
|
let c = "";
|
|
2470
|
-
for (let u =
|
|
2471
|
-
const
|
|
2472
|
-
c += `<div class="drp-date-picker__rolling-item ${
|
|
2532
|
+
for (let u = o.min - 1; u <= o.max - 1; u++) {
|
|
2533
|
+
const g = e.monthNames[u], p = u === r ? "drp-date-picker__rolling-item--selected" : "", h = U(e, n, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2534
|
+
c += `<div class="drp-date-picker__rolling-item ${p} ${h}" data-month="${u}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${g}</span></div>`;
|
|
2473
2535
|
}
|
|
2474
2536
|
l.innerHTML = c;
|
|
2475
2537
|
}
|
|
2476
2538
|
}
|
|
2477
|
-
function
|
|
2539
|
+
function In(e) {
|
|
2478
2540
|
if (e.options.selectionMode !== "range") return;
|
|
2479
2541
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2480
2542
|
if (a)
|
|
2481
2543
|
if (e.selectedStartDate && e.selectedEndDate) {
|
|
2482
|
-
let t, n, r,
|
|
2544
|
+
let t, n, r, i, o;
|
|
2483
2545
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2484
2546
|
n = e.getEnabledDatesInRange(
|
|
2485
2547
|
e.selectedStartDate,
|
|
2486
2548
|
e.selectedEndDate
|
|
2487
|
-
), t = n.length,
|
|
2549
|
+
), t = n.length, i = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2488
2550
|
e.selectedStartDate,
|
|
2489
2551
|
e.selectedEndDate
|
|
2490
2552
|
));
|
|
@@ -2514,7 +2576,7 @@ function Sn(e) {
|
|
|
2514
2576
|
localeStrings: e.localeStrings,
|
|
2515
2577
|
isPreview: !1
|
|
2516
2578
|
};
|
|
2517
|
-
n && (d.enabledDates = n), r && (d.disabledDates = r),
|
|
2579
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), i && (d.dates = i), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2518
2580
|
} else
|
|
2519
2581
|
a.innerHTML = `
|
|
2520
2582
|
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
@@ -2524,16 +2586,16 @@ function Sn(e) {
|
|
|
2524
2586
|
} else
|
|
2525
2587
|
a.className = "drp-date-picker__summary drp-date-picker__summary--hidden", a.innerHTML = "";
|
|
2526
2588
|
}
|
|
2527
|
-
function
|
|
2589
|
+
function Wt(e) {
|
|
2528
2590
|
if (e.options.selectionMode !== "range") return;
|
|
2529
2591
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2530
2592
|
if (a && e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2531
|
-
let t, n, r,
|
|
2593
|
+
let t, n, r, i, o;
|
|
2532
2594
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2533
2595
|
n = e.getEnabledDatesInRange(
|
|
2534
2596
|
e.dragPreviewStart,
|
|
2535
2597
|
e.dragPreviewEnd
|
|
2536
|
-
), t = n.length,
|
|
2598
|
+
), t = n.length, i = n, e.options.disabledDatesHandling === "split" && (o = e.splitRangeByDisabled(
|
|
2537
2599
|
e.dragPreviewStart,
|
|
2538
2600
|
e.dragPreviewEnd
|
|
2539
2601
|
));
|
|
@@ -2563,7 +2625,7 @@ function Ut(e) {
|
|
|
2563
2625
|
localeStrings: e.localeStrings,
|
|
2564
2626
|
isPreview: !0
|
|
2565
2627
|
};
|
|
2566
|
-
n && (d.enabledDates = n), r && (d.disabledDates = r),
|
|
2628
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), i && (d.dates = i), o && (d.dateRanges = o), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2567
2629
|
} else
|
|
2568
2630
|
a.innerHTML = `
|
|
2569
2631
|
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
@@ -2573,19 +2635,19 @@ function Ut(e) {
|
|
|
2573
2635
|
`;
|
|
2574
2636
|
}
|
|
2575
2637
|
}
|
|
2576
|
-
function
|
|
2638
|
+
function Rn(e) {
|
|
2577
2639
|
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((r) => {
|
|
2578
2640
|
r.classList.remove("drp-date-picker__day--drag-preview", "drp-date-picker__day--drag-invalid");
|
|
2579
2641
|
}), !e.dragPreviewStart || !e.dragPreviewEnd) return;
|
|
2580
2642
|
const t = e.options.disabledDatesHandling === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd);
|
|
2581
2643
|
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
2582
|
-
const
|
|
2583
|
-
if (!
|
|
2584
|
-
const [
|
|
2644
|
+
const i = r.dataset.date;
|
|
2645
|
+
if (!i) return;
|
|
2646
|
+
const [o, s, d] = i.split("-").map(Number), l = new Date(o, s - 1, d);
|
|
2585
2647
|
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (r.classList.add("drp-date-picker__day--drag-preview"), t && r.classList.add("drp-date-picker__day--drag-invalid"));
|
|
2586
|
-
}),
|
|
2648
|
+
}), Wt(e);
|
|
2587
2649
|
}
|
|
2588
|
-
const
|
|
2650
|
+
const Ge = {
|
|
2589
2651
|
en: {
|
|
2590
2652
|
today: "Today",
|
|
2591
2653
|
clear: "Clear",
|
|
@@ -2627,43 +2689,43 @@ const je = {
|
|
|
2627
2689
|
nights: "noches"
|
|
2628
2690
|
}
|
|
2629
2691
|
};
|
|
2630
|
-
function
|
|
2692
|
+
function Be(e) {
|
|
2631
2693
|
if (e !== "auto")
|
|
2632
2694
|
return e;
|
|
2633
2695
|
if (typeof navigator < "u" && navigator.language) {
|
|
2634
2696
|
const a = navigator.language.split("-")[0].toLowerCase();
|
|
2635
|
-
return
|
|
2697
|
+
return Ge[a] ? a : "en";
|
|
2636
2698
|
}
|
|
2637
2699
|
return "en";
|
|
2638
2700
|
}
|
|
2639
|
-
function
|
|
2640
|
-
const t =
|
|
2701
|
+
function An(e, a) {
|
|
2702
|
+
const t = Be(e), n = Ge[t] || Ge.en;
|
|
2641
2703
|
return a ? { ...n, ...a } : n;
|
|
2642
2704
|
}
|
|
2643
|
-
function
|
|
2644
|
-
const a =
|
|
2705
|
+
function Tn(e) {
|
|
2706
|
+
const a = Be(e);
|
|
2645
2707
|
try {
|
|
2646
2708
|
const t = new Intl.DateTimeFormat(a, { weekday: "short" }), n = [];
|
|
2647
2709
|
for (let r = 0; r < 7; r++) {
|
|
2648
|
-
const
|
|
2649
|
-
n.push(t.format(
|
|
2710
|
+
const i = new Date(2017, 0, r + 1);
|
|
2711
|
+
n.push(t.format(i));
|
|
2650
2712
|
}
|
|
2651
2713
|
return n;
|
|
2652
2714
|
} catch (t) {
|
|
2653
|
-
return
|
|
2715
|
+
return Y.warn("getWeekdayNames() - Intl.DateTimeFormat failed, using English weekdays", t), ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2654
2716
|
}
|
|
2655
2717
|
}
|
|
2656
|
-
function
|
|
2657
|
-
const a =
|
|
2718
|
+
function kn(e) {
|
|
2719
|
+
const a = Be(e);
|
|
2658
2720
|
try {
|
|
2659
2721
|
const t = new Intl.DateTimeFormat(a, { month: "long" }), n = [];
|
|
2660
2722
|
for (let r = 0; r < 12; r++) {
|
|
2661
|
-
const
|
|
2662
|
-
n.push(t.format(
|
|
2723
|
+
const i = new Date(2017, r, 1);
|
|
2724
|
+
n.push(t.format(i));
|
|
2663
2725
|
}
|
|
2664
2726
|
return n;
|
|
2665
2727
|
} catch (t) {
|
|
2666
|
-
return
|
|
2728
|
+
return Y.warn("getMonthNames() - Intl.DateTimeFormat failed, using English months", t), [
|
|
2667
2729
|
"January",
|
|
2668
2730
|
"February",
|
|
2669
2731
|
"March",
|
|
@@ -2679,7 +2741,88 @@ function Rn(e) {
|
|
|
2679
2741
|
];
|
|
2680
2742
|
}
|
|
2681
2743
|
}
|
|
2682
|
-
const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(--base-font-family, inherit));--drp-spacing-xs: calc(.4 * var(--drp-rem));--drp-spacing-sm: calc(.8 * var(--drp-rem));--drp-spacing-md: calc(1.6 * var(--drp-rem));--drp-spacing-lg: calc(2.4 * var(--drp-rem));--drp-spacing-xl: calc(3.2 * var(--drp-rem));--drp-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--drp-rem));--drp-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--drp-rem));--drp-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--drp-rem));--drp-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--drp-rem));--drp-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--drp-rem));--drp-font-size-xl: calc(var(--base-font-size-xl, 2) * var(--drp-rem));--drp-font-size-2xl: calc(var(--base-font-size-2xl, 2.4) * var(--drp-rem));--drp-font-weight-normal: var(--base-font-weight-normal, 400);--drp-font-weight-medium: var(--base-font-weight-medium, 500);--drp-font-weight-semibold: var(--base-font-weight-semibold, 600);--drp-line-height-tight: var(--base-line-height-tight, 1.25);--drp-line-height-normal: var(--base-line-height-normal, 1.5);--drp-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--drp-dropdown-bg: var(--base-dropdown-bg, #ffffff);--drp-border-color: var(--base-border-color, #e5e7eb);--drp-border: var(--base-border, var(--drp-border-width-base) solid var(--drp-border-color));--drp-primary-bg: var(--base-main-bg, #f3f4f6);--drp-primary-bg-hover: var(--base-hover-bg, #e5e7eb);--drp-accent-color: var(--base-accent-color, #3b82f6);--drp-accent-color-hover: var(--base-accent-color-hover, #2563eb);--drp-text-primary: var(--base-text-color-1, #111827);--drp-text-secondary: var(--base-text-color-3, #6b7280);--drp-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--drp-button-accent-text-color: var(--drp-text-color-on-accent);--drp-tooltip-bg: var(--base-tooltip-bg, #111827);--drp-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--drp-loading-overlay-bg: rgba(255, 255, 255, .8);--drp-loading-spinner-size: 40px;--drp-loading-spinner-border-width: 4px;--drp-loading-spinner-color: var(--drp-border-color);--drp-loading-spinner-accent: var(--drp-accent-color);--drp-border-width-base: 1px;--drp-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--drp-rem));--drp-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--drp-rem));--drp-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--drp-rem));--drp-border-radius: var(--drp-border-radius-md);--drp-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-z-index-dropdown: 9500;--drp-z-index-tooltip: 9999;--drp-input-padding-h: calc(1.2 * var(--drp-rem));--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-opacity-disabled: .6;--drp-opacity-other-month: .5;--drp-opacity-hover: .8;--drp-opacity-dragging: .7;--drp-input-bg: var(--base-input-bg, var(--drp-dropdown-bg));--drp-input-color: var(--base-input-color, var(--drp-text-primary));--drp-input-border: var(--base-input-border, var(--drp-border));--drp-input-border-hover: var(--base-input-border-hover, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-border-focus: var(--base-input-border-focus, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-placeholder-color: var(--base-input-placeholder-color, var(--drp-text-secondary));--drp-input-bg-disabled: var(--base-input-bg-disabled, 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: var(--drp-font-size-xs);--drp-input-size-xs-padding-v: var(--drp-spacing-xs);--drp-input-size-xs-padding-h: calc(.8 * var(--drp-rem));--drp-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--drp-rem));--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: calc(1.3 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.5 * var(--drp-rem));--drp-input-size-sm-padding-h: var(--drp-spacing-sm);--drp-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--drp-rem));--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: calc(1.4 * var(--drp-rem));--drp-input-size-md-padding-v: var(--drp-spacing-sm);--drp-input-size-md-padding-h: calc(1.2 * var(--drp-rem));--drp-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--drp-rem));--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: calc(1.6 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.4 * var(--drp-rem));--drp-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(1.8 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.2 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--drp-rem));--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-border: var(--drp-border);--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-nav-border-hover-full: var(--drp-border-width-base) solid var(--drp-nav-border-hover);--drp-nav-size: calc(3.2 * var(--drp-rem));--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-border: var(--drp-border);--drp-rolling-scrollbar-width: 6px;--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-color: var(--drp-text-primary);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-text-color-on-accent);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-rolling-item-justify-content: center;--drp-rolling-item-min-height: calc(3.2 * var(--drp-rem));--drp-rolling-item-padding-v: var(--drp-spacing-xs);--drp-rolling-item-padding-h: var(--drp-spacing-md);--drp-rolling-item-font-size: var(--drp-font-size-sm);--drp-rolling-item-font-weight-selected: var(--drp-font-weight-semibold);--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-text-color-on-accent);--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-disabled-bg: var(--base-disabled-bg, transparent);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-text-color-on-accent);--drp-day-border-width: 2px;--drp-day-border-color: transparent;--drp-day-border: var(--drp-day-border-width) solid var(--drp-day-border-color);--drp-day-focused-outline-width: 2px;--drp-day-focused-outline-offset: 2px;--drp-day-in-range-bg-opacity: .15;--drp-day-in-range-hover-bg-opacity: .25;--drp-day-drag-preview-bg-opacity: .3;--drp-day-drag-preview-edge-bg-opacity: .6;--drp-day-disabled-pattern-opacity: .1;--drp-day-dragging-scale: 1.1;--drp-day-drag-preview-border-style: dashed;--drp-day-drag-border: var(--drp-day-border-width) var(--drp-day-drag-preview-border-style) var(--drp-day-range-bg);--drp-day-drag-invalid-bg: #ef4444;--drp-day-drag-invalid-bg-opacity: .2;--drp-holiday-color: #ef4444;--drp-holiday-bg-opacity: .1;--drp-holiday-hover-bg-opacity: .2;--drp-event-color: #10b981;--drp-event-bg-opacity: .1;--drp-event-hover-bg-opacity: .2;--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-border: var(--drp-border);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-border: var(--drp-border);--drp-button-bg: transparent;--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-color: var(--drp-text-primary);--drp-button-border-hover: var(--drp-accent-color);--drp-button-border-hover-full: var(--drp-border-width-base) solid var(--drp-button-border-hover);--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-accent-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-font-size: var(--drp-font-size-2xs);--drp-badge-padding-v: 1px;--drp-badge-padding-h: 2px;--drp-badge-border-radius: 2px;--drp-badge-max-height: var(--drp-font-size-base);--drp-badge-row-height: var(--drp-badge-max-height);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-text-color-on-accent);--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-tooltip-line-height: 1.4;--drp-tooltip-max-width: 200px;--drp-tooltip-arrow-size: 8px;--drp-month-min-width: 280px;--drp-month-min-width-inline: 250px;--drp-calendar-max-width: calc(100vw - 2rem) }.drp-input{width:100%;font-family:var(--drp-font-family, var(--base-font-family, inherit));font-size:var(--drp-input-size-md-font);line-height:var(--drp-line-height-normal);color:var(--drp-input-color);background-color:var(--drp-input-bg);border:var(--drp-input-border);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:var(--drp-input-border-hover)}.drp-input:focus{outline:none;border:var(--drp-input-border-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:var(--drp-opacity-disabled);cursor:not-allowed;background-color:var(--drp-input-bg-disabled)}.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:var(--drp-z-index-dropdown);font-family:var(--drp-font-family, var(--base-font-family, inherit));background:var(--drp-dropdown-bg);border:var(--drp-border);border-radius:var(--drp-border-radius-lg);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:var(--drp-month-min-width);max-width:var(--drp-calendar-max-width);box-sizing:border-box;-webkit-user-select:none;user-select:none}.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:var(--drp-month-min-width);display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:var(--drp-month-min-width-inline)}.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:var(--drp-nav-size);height:var(--drp-nav-size);display:flex;align-items:center;justify-content:center;border:var(--drp-nav-border);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:var(--drp-nav-border-hover-full)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border:var(--drp-nav-border)}.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;gap:var(--drp-spacing-xs)}.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-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);color:var(--drp-rolling-item-color);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-dropdown-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-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-sm);cursor:pointer;border:var(--drp-day-border);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:var(--drp-day-focused-outline-width) solid var(--drp-day-focused-outline);outline-offset:var(--drp-day-focused-outline-offset)}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:var(--drp-opacity-disabled);cursor:not-allowed;position:relative;background-color:var(--drp-day-disabled-bg)}.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,var(--drp-day-disabled-pattern-opacity)) 0px,rgba(0,0,0,var(--drp-day-disabled-pattern-opacity)) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius-sm);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--disabled.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:var(--drp-opacity-other-month)}.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) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:var(--drp-opacity-dragging);transform:scale(var(--drp-day-dragging-scale));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) calc(var(--drp-day-drag-preview-bg-opacity) * 100%),transparent);border:var(--drp-day-drag-border)}.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) calc(var(--drp-day-drag-preview-edge-bg-opacity) * 100%),transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,var(--drp-day-drag-invalid-bg) calc(var(--drp-day-drag-invalid-bg-opacity) * 100%),transparent)!important;border-color:var(--drp-day-drag-invalid-bg)!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-bg-opacity) * 100%),transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-hover-bg-opacity) * 100%),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);max-height:var(--drp-badge-row-height);min-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:var(--drp-badge-padding-v) var(--drp-badge-padding-h);border-radius:var(--drp-badge-border-radius);cursor:pointer;max-height:var(--drp-badge-row-height)}.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:calc(1.12 * var(--drp-rem));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:calc(1.12 * var(--drp-rem));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:calc(1.04 * var(--drp-rem));font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-summary-border);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-summary-border)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-button-border);border-radius:var(--drp-border-radius);background:var(--drp-button-bg);color:var(--drp-button-color);cursor:pointer;font-family:inherit;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:var(--drp-button-border-hover-full)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:var(--drp-button-bg);border:var(--drp-button-border)}.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:var(--drp-z-index-tooltip);background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-text-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius-sm);font-size:var(--drp-font-size-xs);line-height:var(--drp-tooltip-line-height);max-width:var(--drp-tooltip-max-width);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:var(--drp-tooltip-arrow-size);height:var(--drp-tooltip-arrow-size);transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--drp-loading-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:var(--drp-z-index-dropdown);border-radius:var(--drp-border-radius-lg)}.drp-date-picker__loading-spinner{width:var(--drp-loading-spinner-size);height:var(--drp-loading-spinner-size);border:var(--drp-loading-spinner-border-width) solid var(--drp-loading-spinner-color);border-top-color:var(--drp-loading-spinner-accent);border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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}', De = class De {
|
|
2744
|
+
function Ln() {
|
|
2745
|
+
const e = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
2746
|
+
let t = null, n = !1, r = !1;
|
|
2747
|
+
const i = () => {
|
|
2748
|
+
e.forEach((s) => s());
|
|
2749
|
+
}, o = () => {
|
|
2750
|
+
a.forEach((s) => s());
|
|
2751
|
+
};
|
|
2752
|
+
return {
|
|
2753
|
+
subscribe(s, d) {
|
|
2754
|
+
const l = s === "window" ? e : a;
|
|
2755
|
+
return l.add(d), {
|
|
2756
|
+
unsubscribe: () => {
|
|
2757
|
+
l.delete(d);
|
|
2758
|
+
}
|
|
2759
|
+
};
|
|
2760
|
+
},
|
|
2761
|
+
init(s) {
|
|
2762
|
+
n || (window.addEventListener("scroll", i, { capture: !0, passive: !0 }), n = !0), s && !r && (t = s, s.addEventListener("scroll", o, { passive: !0 }), r = !0);
|
|
2763
|
+
},
|
|
2764
|
+
destroy() {
|
|
2765
|
+
n && (window.removeEventListener("scroll", i, !0), n = !1), t && r && (t.removeEventListener("scroll", o), r = !1), t = null, e.clear(), a.clear();
|
|
2766
|
+
}
|
|
2767
|
+
};
|
|
2768
|
+
}
|
|
2769
|
+
function $n() {
|
|
2770
|
+
const e = {
|
|
2771
|
+
outsideClick: /* @__PURE__ */ new Set(),
|
|
2772
|
+
calendarClick: /* @__PURE__ */ new Set()
|
|
2773
|
+
};
|
|
2774
|
+
let a = null, t = null, n = null, r = !1, i = !1;
|
|
2775
|
+
const o = (c, u) => {
|
|
2776
|
+
for (const g of e[c])
|
|
2777
|
+
if (g(u) === !0)
|
|
2778
|
+
return !0;
|
|
2779
|
+
return !1;
|
|
2780
|
+
}, s = (c) => {
|
|
2781
|
+
i = !0;
|
|
2782
|
+
const u = c, g = u.composedPath(), p = g[0] || u.target;
|
|
2783
|
+
o("calendarClick", {
|
|
2784
|
+
target: p,
|
|
2785
|
+
event: u,
|
|
2786
|
+
path: g
|
|
2787
|
+
});
|
|
2788
|
+
}, d = () => {
|
|
2789
|
+
setTimeout(() => {
|
|
2790
|
+
i && (i = !1);
|
|
2791
|
+
}, 10);
|
|
2792
|
+
}, l = (c) => {
|
|
2793
|
+
var x;
|
|
2794
|
+
if (!a) return;
|
|
2795
|
+
if (i) {
|
|
2796
|
+
i = !1;
|
|
2797
|
+
return;
|
|
2798
|
+
}
|
|
2799
|
+
const u = c, g = u.composedPath ? u.composedPath() : [], p = g[0] || u.target, f = g.includes(a), h = t && g.includes(t), v = n && g.includes(n), m = (x = p.closest) == null ? void 0 : x.call(p, "[data-calendar-button]");
|
|
2800
|
+
!f && !h && !v && !m && o("outsideClick", {
|
|
2801
|
+
target: p,
|
|
2802
|
+
event: u,
|
|
2803
|
+
path: g
|
|
2804
|
+
});
|
|
2805
|
+
};
|
|
2806
|
+
return {
|
|
2807
|
+
subscribe(c, u) {
|
|
2808
|
+
return e[c].add(u), {
|
|
2809
|
+
unsubscribe: () => {
|
|
2810
|
+
e[c].delete(u);
|
|
2811
|
+
}
|
|
2812
|
+
};
|
|
2813
|
+
},
|
|
2814
|
+
init(c, u, g) {
|
|
2815
|
+
a = c, t = u || null, n = g || null, c.addEventListener("mousedown", s), c.addEventListener("mouseup", d), r || (document.addEventListener("click", l, !0), r = !0);
|
|
2816
|
+
},
|
|
2817
|
+
updateReferences(c, u) {
|
|
2818
|
+
t = c || null, n = u || null;
|
|
2819
|
+
},
|
|
2820
|
+
destroy() {
|
|
2821
|
+
a && (a.removeEventListener("mousedown", s), a.removeEventListener("mouseup", d)), r && (document.removeEventListener("click", l, !0), r = !1), a = null, t = null, n = null, i = !1, Object.values(e).forEach((c) => c.clear());
|
|
2822
|
+
}
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
const Kt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(--base-font-family, inherit));--drp-spacing-xs: calc(.4 * var(--drp-rem));--drp-spacing-sm: calc(.8 * var(--drp-rem));--drp-spacing-md: calc(1.6 * var(--drp-rem));--drp-spacing-lg: calc(2.4 * var(--drp-rem));--drp-spacing-xl: calc(3.2 * var(--drp-rem));--drp-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--drp-rem));--drp-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--drp-rem));--drp-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--drp-rem));--drp-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--drp-rem));--drp-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--drp-rem));--drp-font-size-xl: calc(var(--base-font-size-xl, 2) * var(--drp-rem));--drp-font-size-2xl: calc(var(--base-font-size-2xl, 2.4) * var(--drp-rem));--drp-font-weight-normal: var(--base-font-weight-normal, 400);--drp-font-weight-medium: var(--base-font-weight-medium, 500);--drp-font-weight-semibold: var(--base-font-weight-semibold, 600);--drp-line-height-tight: var(--base-line-height-tight, 1.25);--drp-line-height-normal: var(--base-line-height-normal, 1.5);--drp-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--drp-dropdown-bg: var(--base-dropdown-bg, #ffffff);--drp-border-color: var(--base-border-color, #e5e7eb);--drp-border: var(--base-border, var(--drp-border-width-base) solid var(--drp-border-color));--drp-primary-bg: var(--base-main-bg, #f3f4f6);--drp-primary-bg-hover: var(--base-hover-bg, #e5e7eb);--drp-accent-color: var(--base-accent-color, #3b82f6);--drp-accent-color-hover: var(--base-accent-color-hover, #2563eb);--drp-text-primary: var(--base-text-color-1, #111827);--drp-text-secondary: var(--base-text-color-3, #6b7280);--drp-text-color-on-accent: var(--base-text-color-on-accent, #ffffff);--drp-button-accent-text-color: var(--drp-text-color-on-accent);--drp-tooltip-bg: var(--base-tooltip-bg, #111827);--drp-tooltip-text-color: var(--base-tooltip-text-color, #ffffff);--drp-loading-overlay-bg: rgba(255, 255, 255, .8);--drp-loading-spinner-size: 40px;--drp-loading-spinner-border-width: 4px;--drp-loading-spinner-color: var(--drp-border-color);--drp-loading-spinner-accent: var(--drp-accent-color);--drp-border-width-base: 1px;--drp-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--drp-rem));--drp-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--drp-rem));--drp-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--drp-rem));--drp-border-radius: var(--drp-border-radius-md);--drp-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-z-index-dropdown: 9500;--drp-z-index-tooltip: 9999;--drp-input-padding-h: calc(1.2 * var(--drp-rem));--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-opacity-disabled: .6;--drp-opacity-other-month: .5;--drp-opacity-hover: .8;--drp-opacity-dragging: .7;--drp-input-bg: var(--base-input-bg, var(--drp-dropdown-bg));--drp-input-color: var(--base-input-color, var(--drp-text-primary));--drp-input-border: var(--base-input-border, var(--drp-border));--drp-input-border-hover: var(--base-input-border-hover, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-border-focus: var(--base-input-border-focus, var(--drp-border-width-base) solid var(--drp-accent-color));--drp-input-placeholder-color: var(--base-input-placeholder-color, var(--drp-text-secondary));--drp-input-bg-disabled: var(--base-input-bg-disabled, 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: var(--drp-font-size-xs);--drp-input-size-xs-padding-v: var(--drp-spacing-xs);--drp-input-size-xs-padding-h: calc(.8 * var(--drp-rem));--drp-input-size-xs-height: calc(var(--base-input-size-xs-height, 3.1) * var(--drp-rem));--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: calc(1.3 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.5 * var(--drp-rem));--drp-input-size-sm-padding-h: var(--drp-spacing-sm);--drp-input-size-sm-height: calc(var(--base-input-size-sm-height, 3.3) * var(--drp-rem));--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: calc(1.4 * var(--drp-rem));--drp-input-size-md-padding-v: var(--drp-spacing-sm);--drp-input-size-md-padding-h: calc(1.2 * var(--drp-rem));--drp-input-size-md-height: calc(var(--base-input-size-md-height, 3.5) * var(--drp-rem));--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: calc(1.6 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.4 * var(--drp-rem));--drp-input-size-lg-height: calc(var(--base-input-size-lg-height, 3.8) * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(1.8 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.2 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-xl-height: calc(var(--base-input-size-xl-height, 4.1) * var(--drp-rem));--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-border: var(--drp-border);--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-nav-border-hover-full: var(--drp-border-width-base) solid var(--drp-nav-border-hover);--drp-nav-size: calc(3.2 * var(--drp-rem));--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-border: var(--drp-border);--drp-rolling-scrollbar-width: 6px;--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-color: var(--drp-text-primary);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-text-color-on-accent);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-rolling-item-justify-content: center;--drp-rolling-item-min-height: calc(3.2 * var(--drp-rem));--drp-rolling-item-padding-v: var(--drp-spacing-xs);--drp-rolling-item-padding-h: var(--drp-spacing-md);--drp-rolling-item-font-size: var(--drp-font-size-sm);--drp-rolling-item-font-weight-selected: var(--drp-font-weight-semibold);--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-text-color-on-accent);--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-disabled-bg: var(--base-disabled-bg, transparent);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-text-color-on-accent);--drp-day-border-width: 2px;--drp-day-border-color: transparent;--drp-day-border: var(--drp-day-border-width) solid var(--drp-day-border-color);--drp-day-focused-outline-width: 2px;--drp-day-focused-outline-offset: 2px;--drp-day-in-range-bg-opacity: .15;--drp-day-in-range-hover-bg-opacity: .25;--drp-day-drag-preview-bg-opacity: .3;--drp-day-drag-preview-edge-bg-opacity: .6;--drp-day-disabled-pattern-opacity: .1;--drp-day-dragging-scale: 1.1;--drp-day-drag-preview-border-style: dashed;--drp-day-drag-border: var(--drp-day-border-width) var(--drp-day-drag-preview-border-style) var(--drp-day-range-bg);--drp-day-drag-invalid-bg: #ef4444;--drp-day-drag-invalid-bg-opacity: .2;--drp-holiday-color: #ef4444;--drp-holiday-bg-opacity: .1;--drp-holiday-hover-bg-opacity: .2;--drp-event-color: #10b981;--drp-event-bg-opacity: .1;--drp-event-hover-bg-opacity: .2;--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-border: var(--drp-border);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-border: var(--drp-border);--drp-button-bg: transparent;--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-color: var(--drp-text-primary);--drp-button-border-hover: var(--drp-accent-color);--drp-button-border-hover-full: var(--drp-border-width-base) solid var(--drp-button-border-hover);--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-accent-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-font-size: var(--drp-font-size-2xs);--drp-badge-padding-v: 1px;--drp-badge-padding-h: 2px;--drp-badge-border-radius: 2px;--drp-badge-max-height: var(--drp-font-size-base);--drp-badge-row-height: var(--drp-badge-max-height);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-text-color-on-accent);--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-tooltip-line-height: 1.4;--drp-tooltip-max-width: 200px;--drp-tooltip-arrow-size: 8px;--drp-message-error-bg: #fef2f2;--drp-message-error-color: #991b1b;--drp-message-error-border: #fecaca;--drp-message-warning-bg: #fffbeb;--drp-message-warning-color: #92400e;--drp-message-warning-border: #fde68a;--drp-message-info-bg: #eff6ff;--drp-message-info-color: #1e40af;--drp-message-info-border: #bfdbfe;--drp-message-success-bg: #f0fdf4;--drp-message-success-color: #166534;--drp-message-success-border: #bbf7d0;--drp-month-min-width: 280px;--drp-month-min-width-inline: 250px;--drp-calendar-max-width: calc(100vw - 2rem) }.drp-input{width:100%;font-family:var(--drp-font-family, var(--base-font-family, inherit));font-size:var(--drp-input-size-md-font);line-height:var(--drp-line-height-normal);color:var(--drp-input-color);background-color:var(--drp-input-bg);border:var(--drp-input-border);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:var(--drp-input-border-hover)}.drp-input:focus{outline:none;border:var(--drp-input-border-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:var(--drp-opacity-disabled);cursor:not-allowed;background-color:var(--drp-input-bg-disabled)}.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:var(--drp-z-index-dropdown);font-family:var(--drp-font-family, var(--base-font-family, inherit));background:var(--drp-dropdown-bg);border:var(--drp-border);border-radius:var(--drp-border-radius-lg);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:var(--drp-month-min-width);max-width:var(--drp-calendar-max-width);box-sizing:border-box;-webkit-user-select:none;user-select:none}.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:var(--drp-month-min-width);display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:var(--drp-month-min-width-inline)}.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:var(--drp-nav-size);height:var(--drp-nav-size);display:flex;align-items:center;justify-content:center;border:var(--drp-nav-border);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:var(--drp-nav-border-hover-full)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border:var(--drp-nav-border)}.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;gap:var(--drp-spacing-xs)}.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-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);color:var(--drp-rolling-item-color);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-dropdown-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-rolling-border);border-radius:var(--drp-border-radius-lg);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:var(--drp-rolling-scrollbar-width)}.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:var(--drp-rolling-item-padding-v) var(--drp-rolling-item-padding-h);cursor:pointer;font-size:var(--drp-rolling-item-font-size);min-height:var(--drp-rolling-item-min-height);flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content)}.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:var(--drp-rolling-item-font-weight-selected)}.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-sm);cursor:pointer;border:var(--drp-day-border);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:var(--drp-day-focused-outline-width) solid var(--drp-day-focused-outline);outline-offset:var(--drp-day-focused-outline-offset)}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:var(--drp-opacity-disabled);cursor:not-allowed;position:relative;background-color:var(--drp-day-disabled-bg)}.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,var(--drp-day-disabled-pattern-opacity)) 0px,rgba(0,0,0,var(--drp-day-disabled-pattern-opacity)) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius-sm);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--disabled.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:var(--drp-opacity-other-month)}.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) calc(var(--drp-day-in-range-bg-opacity) * 100%),transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) calc(var(--drp-day-in-range-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:var(--drp-opacity-dragging);transform:scale(var(--drp-day-dragging-scale));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) calc(var(--drp-day-drag-preview-bg-opacity) * 100%),transparent);border:var(--drp-day-drag-border)}.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) calc(var(--drp-day-drag-preview-edge-bg-opacity) * 100%),transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,var(--drp-day-drag-invalid-bg) calc(var(--drp-day-drag-invalid-bg-opacity) * 100%),transparent)!important;border-color:var(--drp-day-drag-invalid-bg)!important;border-style:dashed!important}.drp-date-picker__day--invalid-range{background-color:color-mix(in srgb,var(--drp-message-error-border) 20%,transparent)}.drp-date-picker__day--invalid-range-start,.drp-date-picker__day--invalid-range-end{background-color:var(--drp-message-error-border);color:#fff;font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-bg-opacity) * 100%),transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-holiday-color) calc(var(--drp-holiday-hover-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-bg-opacity) * 100%),transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,var(--drp-event-color) calc(var(--drp-event-hover-bg-opacity) * 100%),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);max-height:var(--drp-badge-row-height);min-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:var(--drp-badge-padding-v) var(--drp-badge-padding-h);border-radius:var(--drp-badge-border-radius);cursor:pointer;max-height:var(--drp-badge-row-height)}.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:calc(1.12 * var(--drp-rem));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:calc(1.12 * var(--drp-rem));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:calc(1.04 * var(--drp-rem));font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:0;margin:0;margin-bottom:var(--drp-spacing-sm);border-top:var(--drp-summary-border);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-summary-border)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-button-border);border-radius:var(--drp-border-radius);background:var(--drp-button-bg);color:var(--drp-button-color);cursor:pointer;font-family:inherit;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:var(--drp-button-border-hover-full)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-opacity-disabled);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:var(--drp-button-bg);border:var(--drp-button-border)}.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:var(--drp-z-index-tooltip);background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-text-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius-sm);font-size:var(--drp-font-size-xs);line-height:var(--drp-tooltip-line-height);max-width:var(--drp-tooltip-max-width);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:var(--drp-tooltip-arrow-size);height:var(--drp-tooltip-arrow-size);transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--drp-loading-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:var(--drp-z-index-dropdown);border-radius:var(--drp-border-radius-lg)}.drp-date-picker__loading-spinner{width:var(--drp-loading-spinner-size);height:var(--drp-loading-spinner-size);border:var(--drp-loading-spinner-border-width) solid var(--drp-loading-spinner-color);border-top-color:var(--drp-loading-spinner-accent);border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker__message{display:none;align-items:center;gap:var(--drp-spacing-sm);padding:var(--drp-spacing-sm) var(--drp-spacing-md);margin:0 var(--drp-spacing-sm);margin-bottom:var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-sm);line-height:var(--drp-line-height-normal)}.drp-date-picker__message--visible{display:flex}.drp-date-picker__message-text{flex:1}.drp-date-picker__message-close{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:calc(2 * var(--drp-rem));height:calc(2 * var(--drp-rem));padding:0;border:none;background:transparent;font-size:var(--drp-font-size-lg);line-height:1;cursor:pointer;opacity:.6;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__message-close:hover{opacity:1}.drp-date-picker__message--error{background-color:var(--drp-message-error-bg);color:var(--drp-message-error-color);border:1px solid var(--drp-message-error-border)}.drp-date-picker__message--error .drp-date-picker__message-close{color:var(--drp-message-error-color)}.drp-date-picker__message--warning{background-color:var(--drp-message-warning-bg);color:var(--drp-message-warning-color);border:1px solid var(--drp-message-warning-border)}.drp-date-picker__message--warning .drp-date-picker__message-close{color:var(--drp-message-warning-color)}.drp-date-picker__message--info{background-color:var(--drp-message-info-bg);color:var(--drp-message-info-color);border:1px solid var(--drp-message-info-border)}.drp-date-picker__message--info .drp-date-picker__message-close{color:var(--drp-message-info-color)}.drp-date-picker__message--success{background-color:var(--drp-message-success-bg);color:var(--drp-message-success-color);border:1px solid var(--drp-message-success-border)}.drp-date-picker__message--success .drp-date-picker__message-close{color:var(--drp-message-success-color)}.drp-date-picker__message--custom{background:transparent;border:none;padding:0;margin:0;margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__message--custom .drp-date-picker__message-close{display:none}.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}', _e = class _e {
|
|
2683
2826
|
constructor(a, t = {}) {
|
|
2684
2827
|
b(this, "input");
|
|
2685
2828
|
b(this, "options");
|
|
@@ -2714,13 +2857,14 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2714
2857
|
b(this, "originalEndDate");
|
|
2715
2858
|
b(this, "dragPreviewStart");
|
|
2716
2859
|
b(this, "dragPreviewEnd");
|
|
2860
|
+
b(this, "invalidRangeStart");
|
|
2861
|
+
b(this, "invalidRangeEnd");
|
|
2717
2862
|
b(this, "autoScrollInterval");
|
|
2718
2863
|
b(this, "navInterval");
|
|
2719
2864
|
b(this, "calendar");
|
|
2720
2865
|
b(this, "containerElement");
|
|
2721
2866
|
b(this, "onDragMoveBound");
|
|
2722
2867
|
b(this, "onDragEndBound");
|
|
2723
|
-
b(this, "clickOutsideHandler");
|
|
2724
2868
|
b(this, "isFirstRender", !0);
|
|
2725
2869
|
b(this, "lockedPlacement");
|
|
2726
2870
|
// Store the initial placement to prevent jumping
|
|
@@ -2746,10 +2890,18 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2746
2890
|
b(this, "tooltip");
|
|
2747
2891
|
b(this, "tooltipArrow");
|
|
2748
2892
|
b(this, "currentTooltipTarget");
|
|
2893
|
+
// Message area
|
|
2894
|
+
b(this, "messageElement");
|
|
2895
|
+
b(this, "messageAutoHideTimeout");
|
|
2749
2896
|
// Action button tooltips
|
|
2750
2897
|
b(this, "actionButtonTooltips", /* @__PURE__ */ new Map());
|
|
2751
2898
|
b(this, "actionButtonTooltipCleanups", /* @__PURE__ */ new Map());
|
|
2752
2899
|
b(this, "actionsContainer", null);
|
|
2900
|
+
// Event managers (Pub/Sub pattern)
|
|
2901
|
+
b(this, "scrollEvents");
|
|
2902
|
+
b(this, "clickEvents");
|
|
2903
|
+
b(this, "scrollSubscriptions", []);
|
|
2904
|
+
b(this, "clickSubscriptions", []);
|
|
2753
2905
|
// Week start and date restrictions
|
|
2754
2906
|
b(this, "weekStartDay", 0);
|
|
2755
2907
|
// 0 = Sunday, 1 = Monday, etc.
|
|
@@ -2814,61 +2966,99 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2814
2966
|
dayTooltipMember: t.dayTooltipMember,
|
|
2815
2967
|
isDisabledMember: t.isDisabledMember,
|
|
2816
2968
|
autoClose: t.autoClose || "selection",
|
|
2969
|
+
closeOnScroll: t.closeOnScroll !== void 0 ? t.closeOnScroll : !0,
|
|
2817
2970
|
actionButtons: t.actionButtons,
|
|
2818
2971
|
showTodayButton: t.showTodayButton !== void 0 ? t.showTodayButton : !0,
|
|
2819
2972
|
showClearButton: t.showClearButton !== void 0 ? t.showClearButton : !0,
|
|
2820
2973
|
showApplyButton: t.showApplyButton !== void 0 ? t.showApplyButton : t.selectionMode === "range" || t.selectionMode === "multiple"
|
|
2821
|
-
}, this.options.showDebugInfo ?
|
|
2974
|
+
}, this.options.showDebugInfo ? bt() : yt(), this.options.unifiedNavigation && this.options.unifiedNavigationAnchorIndex !== void 0) {
|
|
2822
2975
|
const r = this.options.visibleMonthsCount - 1;
|
|
2823
2976
|
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > r) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2824
2977
|
}
|
|
2825
|
-
this.weekStartDay =
|
|
2978
|
+
this.weekStartDay = Zt(this.options.weekStartDay), k.debug("Week starts on day:", this.weekStartDay), k.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale = Be(this.options.locale), this.localeStrings = An(this.locale, this.options.customStrings), this.weekdayNames = Tn(this.locale), this.monthNames = this.options.monthNames || kn(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();
|
|
2826
2979
|
let n;
|
|
2827
2980
|
if (this.options.initialDate)
|
|
2828
|
-
n =
|
|
2981
|
+
n = me(this.options.initialDate) || /* @__PURE__ */ new Date(), k.debug(`Using initialDate: ${n.toISOString()}`);
|
|
2829
2982
|
else if (this.options.rollingYearRange || this.options.rollingMonthRange) {
|
|
2830
|
-
const r = this.getEffectiveYearRange(),
|
|
2831
|
-
n = new Date(
|
|
2983
|
+
const r = this.getEffectiveYearRange(), i = this.getEffectiveMonthRange(), o = r.min, s = i.min - 1;
|
|
2984
|
+
n = new Date(o, s, 1), k.debug(`Using first allowed year/month as initial: ${n.toISOString()}`);
|
|
2832
2985
|
} 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()}`));
|
|
2833
2986
|
this.monthDates = [];
|
|
2834
2987
|
for (let r = 0; r < this.options.visibleMonthsCount; r++) {
|
|
2835
|
-
const
|
|
2836
|
-
this.monthDates.push(
|
|
2988
|
+
const i = new Date(n.getFullYear(), n.getMonth() + r, 1);
|
|
2989
|
+
this.monthDates.push(i), k.debug(`monthDates[${r}] = ${i.getFullYear()}-${i.getMonth() + 1}`);
|
|
2837
2990
|
}
|
|
2838
2991
|
if (this.options.selectionMode === "range") {
|
|
2839
2992
|
this.displayMonths = [];
|
|
2840
2993
|
for (let r = 0; r < this.options.visibleMonthsCount; r++) {
|
|
2841
|
-
const
|
|
2994
|
+
const i = new Date(n.getFullYear(), n.getMonth() + r, 1);
|
|
2842
2995
|
this.displayMonths.push({
|
|
2843
|
-
month:
|
|
2844
|
-
year:
|
|
2996
|
+
month: i.getMonth(),
|
|
2997
|
+
year: i.getFullYear()
|
|
2845
2998
|
});
|
|
2846
2999
|
}
|
|
2847
3000
|
}
|
|
2848
3001
|
this.selectedDate = null, this.selectedStartDate = null, this.selectedEndDate = null, this.selectedRanges = [], this.selectedDates = [], this.pendingSelection = null, this.focusedDayIndex = null, this.activeMonthIndex = 0, this.showingRollingSelector = [];
|
|
2849
3002
|
for (let r = 0; r < this.options.visibleMonthsCount; r++)
|
|
2850
3003
|
this.showingRollingSelector.push(!1);
|
|
2851
|
-
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();
|
|
3004
|
+
this.draggingType = null, this.isDragging = !1, this.dragStartDate = null, this.originalStartDate = null, this.originalEndDate = null, this.dragPreviewStart = null, this.dragPreviewEnd = null, this.invalidRangeStart = null, this.invalidRangeEnd = null, this.autoScrollInterval = null, this.scrollEvents = Ln(), this.clickEvents = $n(), this.init();
|
|
2852
3005
|
}
|
|
2853
3006
|
init() {
|
|
2854
|
-
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,
|
|
3007
|
+
k.debug("Init called"), this.createCalendar(), this.scrollEvents.init(), this.clickEvents.init(this.calendar, this.input), this.setupEventSubscriptions(), 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, Yt(this)), k.debug("Init complete");
|
|
3008
|
+
}
|
|
3009
|
+
/**
|
|
3010
|
+
* Set up event subscriptions using the pub/sub event managers
|
|
3011
|
+
*/
|
|
3012
|
+
setupEventSubscriptions() {
|
|
3013
|
+
const a = this.scrollEvents.subscribe("window", () => {
|
|
3014
|
+
var r;
|
|
3015
|
+
if (this.options.positioningMode === "floating" && this.isOpen) {
|
|
3016
|
+
if (this.options.closeOnScroll === !1)
|
|
3017
|
+
return;
|
|
3018
|
+
if (this.requiresApplyButton()) {
|
|
3019
|
+
k.debug("Window scroll detected - NOT closing (Apply button required)");
|
|
3020
|
+
return;
|
|
3021
|
+
}
|
|
3022
|
+
if ((r = this.messageElement) != null && r.classList.contains("drp-date-picker__message--visible")) {
|
|
3023
|
+
k.debug("Window scroll detected - NOT closing (message visible)");
|
|
3024
|
+
return;
|
|
3025
|
+
}
|
|
3026
|
+
k.debug("Window scroll detected - closing calendar"), this.hide();
|
|
3027
|
+
}
|
|
3028
|
+
});
|
|
3029
|
+
this.scrollSubscriptions.push(a);
|
|
3030
|
+
const t = this.clickEvents.subscribe("outsideClick", (r) => {
|
|
3031
|
+
if (k.debug("Outside click detected", r.target), this.options.positioningMode === "floating")
|
|
3032
|
+
this.hide();
|
|
3033
|
+
else {
|
|
3034
|
+
let i = !1;
|
|
3035
|
+
for (let o = 0; o < this.showingRollingSelector.length; o++)
|
|
3036
|
+
this.showingRollingSelector[o] && (this.showingRollingSelector[o] = !1, i = !0);
|
|
3037
|
+
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, i = !0), i && this.renderCalendar();
|
|
3038
|
+
}
|
|
3039
|
+
});
|
|
3040
|
+
this.clickSubscriptions.push(t);
|
|
3041
|
+
const n = this.clickEvents.subscribe("calendarClick", () => {
|
|
3042
|
+
this.isCalendarActive = !0;
|
|
3043
|
+
});
|
|
3044
|
+
this.clickSubscriptions.push(n);
|
|
2855
3045
|
}
|
|
2856
3046
|
/**
|
|
2857
3047
|
* Initialize and normalize date restrictions
|
|
2858
3048
|
*/
|
|
2859
3049
|
initializeDateRestrictions() {
|
|
2860
|
-
if (this.options.minDate && (this.normalizedMinDate =
|
|
2861
|
-
const t =
|
|
3050
|
+
if (this.options.minDate && (this.normalizedMinDate = me(this.options.minDate)), this.options.maxDate && (this.normalizedMaxDate = me(this.options.maxDate)), this.options.disabledDates && this.options.disabledDates.length > 0 && this.options.disabledDates.forEach((a) => {
|
|
3051
|
+
const t = me(a);
|
|
2862
3052
|
if (t) {
|
|
2863
|
-
const n =
|
|
3053
|
+
const n = ye(t);
|
|
2864
3054
|
this.normalizedDisabledDates.add(n);
|
|
2865
3055
|
}
|
|
2866
3056
|
}), this.options.specialDates && this.options.specialDates.length > 0) {
|
|
2867
3057
|
const a = this.options.dateMember || "date";
|
|
2868
3058
|
this.options.specialDates.forEach((t) => {
|
|
2869
|
-
const n =
|
|
3059
|
+
const n = me(t[a]);
|
|
2870
3060
|
if (n) {
|
|
2871
|
-
const r =
|
|
3061
|
+
const r = ye(n);
|
|
2872
3062
|
this.normalizedSpecialDates.set(r, t);
|
|
2873
3063
|
} else
|
|
2874
3064
|
console.warn("[Special Dates] Failed to normalize date:", t[a]);
|
|
@@ -2882,7 +3072,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2882
3072
|
*/
|
|
2883
3073
|
getEffectiveYearRange() {
|
|
2884
3074
|
const a = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2885
|
-
return
|
|
3075
|
+
return Bt(this.options.rollingYearRange, a, this);
|
|
2886
3076
|
}
|
|
2887
3077
|
/**
|
|
2888
3078
|
* Get effective month range considering all constraints
|
|
@@ -2890,7 +3080,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2890
3080
|
* Considers: rollingMonthRange option, or defaults to all months (1-12)
|
|
2891
3081
|
*/
|
|
2892
3082
|
getEffectiveMonthRange() {
|
|
2893
|
-
return
|
|
3083
|
+
return Vt(this.options.rollingMonthRange);
|
|
2894
3084
|
}
|
|
2895
3085
|
/**
|
|
2896
3086
|
* Render action buttons based on configuration
|
|
@@ -2910,10 +3100,10 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2910
3100
|
return;
|
|
2911
3101
|
const r = document.createElement("button");
|
|
2912
3102
|
r.className = `drp-date-picker__button drp-date-picker__button--${n.action}`;
|
|
2913
|
-
const
|
|
2914
|
-
|
|
2915
|
-
const
|
|
2916
|
-
r.innerHTML =
|
|
3103
|
+
const i = n.getClassCallback ? n.getClassCallback(this) : n.cssClass;
|
|
3104
|
+
i && (Array.isArray(i) ? r.classList.add(...i) : r.classList.add(i));
|
|
3105
|
+
const o = n.getTextCallback ? n.getTextCallback(this) : n.text;
|
|
3106
|
+
r.innerHTML = o, (n.isDisabledCallback ? n.isDisabledCallback(this) : n.isDisabled ?? !1) && (r.disabled = !0), r.dataset.action = n.action, n.onClick && (r._customOnClick = n.onClick), a.appendChild(r);
|
|
2917
3107
|
}), this.attachActionButtonTooltips();
|
|
2918
3108
|
}
|
|
2919
3109
|
/**
|
|
@@ -2940,10 +3130,10 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2940
3130
|
this.actionsContainer.querySelectorAll(".drp-date-picker__action").forEach((t) => {
|
|
2941
3131
|
const n = t, r = n.dataset.action;
|
|
2942
3132
|
if (!r) return;
|
|
2943
|
-
const
|
|
2944
|
-
if (!
|
|
3133
|
+
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === r);
|
|
3134
|
+
if (!o) return;
|
|
2945
3135
|
let s;
|
|
2946
|
-
if (
|
|
3136
|
+
if (o.getTooltipCallback ? s = o.getTooltipCallback(this) : s = o.tooltip, !s) return;
|
|
2947
3137
|
const d = `action-${r}-${Date.now()}-${Math.random()}`;
|
|
2948
3138
|
this.createActionButtonTooltip(n, s, d);
|
|
2949
3139
|
});
|
|
@@ -2954,13 +3144,13 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2954
3144
|
createActionButtonTooltip(a, t, n) {
|
|
2955
3145
|
const r = document.createElement("div");
|
|
2956
3146
|
r.className = "drp-date-picker__tooltip", r.textContent = t, (this.options.container || document.body).appendChild(r), this.actionButtonTooltips.set(n, r);
|
|
2957
|
-
let
|
|
3147
|
+
let o, s;
|
|
2958
3148
|
const d = () => {
|
|
2959
|
-
clearTimeout(s),
|
|
3149
|
+
clearTimeout(s), o = window.setTimeout(() => {
|
|
2960
3150
|
r.classList.add("drp-date-picker__tooltip--visible"), this.positionActionButtonTooltip(a, r, n);
|
|
2961
3151
|
}, 300);
|
|
2962
3152
|
}, l = () => {
|
|
2963
|
-
clearTimeout(
|
|
3153
|
+
clearTimeout(o), s = window.setTimeout(() => {
|
|
2964
3154
|
r.classList.remove("drp-date-picker__tooltip--visible");
|
|
2965
3155
|
const c = this.actionButtonTooltipCleanups.get(n);
|
|
2966
3156
|
c && (c(), this.actionButtonTooltipCleanups.delete(n));
|
|
@@ -2972,14 +3162,14 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
2972
3162
|
* Position action button tooltip using Floating UI
|
|
2973
3163
|
*/
|
|
2974
3164
|
async positionActionButtonTooltip(a, t, n) {
|
|
2975
|
-
const { computePosition: r, flip:
|
|
3165
|
+
const { computePosition: r, flip: i, shift: o, offset: s, autoUpdate: d } = await Promise.resolve().then(() => nn), l = d(a, t, () => {
|
|
2976
3166
|
r(a, t, {
|
|
2977
3167
|
placement: "top",
|
|
2978
3168
|
strategy: "fixed",
|
|
2979
3169
|
middleware: [
|
|
2980
3170
|
s(8),
|
|
2981
|
-
|
|
2982
|
-
|
|
3171
|
+
i(),
|
|
3172
|
+
o({ padding: 8 })
|
|
2983
3173
|
]
|
|
2984
3174
|
}).then(({ x: c, y: u }) => {
|
|
2985
3175
|
Object.assign(t.style, {
|
|
@@ -3007,8 +3197,8 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3007
3197
|
const t = this.getEffectiveYearRange(), n = a.getFullYear();
|
|
3008
3198
|
if (n < t.min || n > t.max)
|
|
3009
3199
|
return !0;
|
|
3010
|
-
const r = this.getEffectiveMonthRange(),
|
|
3011
|
-
return
|
|
3200
|
+
const r = this.getEffectiveMonthRange(), i = a.getMonth() + 1;
|
|
3201
|
+
return i < r.min || i > r.max ? !0 : ea(
|
|
3012
3202
|
a,
|
|
3013
3203
|
this.normalizedMinDate,
|
|
3014
3204
|
this.normalizedMaxDate,
|
|
@@ -3021,7 +3211,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3021
3211
|
* Priority: bulkMetadataCache > callback > specialDates
|
|
3022
3212
|
*/
|
|
3023
3213
|
getDateInfoInternal(a) {
|
|
3024
|
-
const t =
|
|
3214
|
+
const t = ye(a);
|
|
3025
3215
|
if (this.bulkMetadataCache && this.bulkMetadataCache.has(t)) {
|
|
3026
3216
|
const n = this.bulkMetadataCache.get(t);
|
|
3027
3217
|
return {
|
|
@@ -3038,11 +3228,11 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3038
3228
|
};
|
|
3039
3229
|
}
|
|
3040
3230
|
if (this.normalizedSpecialDates.has(t)) {
|
|
3041
|
-
const n = this.normalizedSpecialDates.get(t), r = this.options.badgeTextMember || "badgeText",
|
|
3231
|
+
const n = this.normalizedSpecialDates.get(t), r = this.options.badgeTextMember || "badgeText", i = this.options.badgeClassMember || "badgeClass", o = this.options.dayClassMember || "dayClass", s = this.options.badgeTooltipMember || "badgeTooltip", d = this.options.dayTooltipMember || "dayTooltip", l = this.options.isDisabledMember || "isDisabled";
|
|
3042
3232
|
return {
|
|
3043
3233
|
isDisabled: n[l] !== void 0 ? n[l] : this.isDateDisabledInternal(a),
|
|
3044
|
-
badgeClass: n[
|
|
3045
|
-
dayClass: n[
|
|
3234
|
+
badgeClass: n[i],
|
|
3235
|
+
dayClass: n[o],
|
|
3046
3236
|
badgeText: n[r],
|
|
3047
3237
|
badgeTooltip: n[s],
|
|
3048
3238
|
dayTooltip: n[d]
|
|
@@ -3054,40 +3244,40 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3054
3244
|
* Check if there are any disabled dates in a range
|
|
3055
3245
|
*/
|
|
3056
3246
|
hasDisabledDatesInRange(a, t) {
|
|
3057
|
-
return
|
|
3247
|
+
return ta(a, t, (n) => this.isDateDisabledInternal(n));
|
|
3058
3248
|
}
|
|
3059
3249
|
/**
|
|
3060
3250
|
* Get all enabled dates in a range
|
|
3061
3251
|
*/
|
|
3062
3252
|
getEnabledDatesInRange(a, t) {
|
|
3063
|
-
return
|
|
3253
|
+
return aa(a, t, (n) => this.isDateDisabledInternal(n));
|
|
3064
3254
|
}
|
|
3065
3255
|
/**
|
|
3066
3256
|
* Get all disabled dates in a range
|
|
3067
3257
|
*/
|
|
3068
3258
|
getDisabledDatesInRange(a, t) {
|
|
3069
|
-
return
|
|
3259
|
+
return na(a, t, (n) => this.isDateDisabledInternal(n));
|
|
3070
3260
|
}
|
|
3071
3261
|
/**
|
|
3072
3262
|
* For 'block' mode: Find the last enabled date before hitting a disabled date
|
|
3073
3263
|
*/
|
|
3074
3264
|
findLastEnabledBeforeGap(a, t) {
|
|
3075
|
-
return
|
|
3265
|
+
return ra(a, t, (n) => this.isDateDisabledInternal(n));
|
|
3076
3266
|
}
|
|
3077
3267
|
/**
|
|
3078
3268
|
* For 'split' mode: Split a range into multiple ranges separated by disabled dates
|
|
3079
3269
|
*/
|
|
3080
3270
|
splitRangeByDisabled(a, t) {
|
|
3081
|
-
return
|
|
3271
|
+
return ia(a, t, (n) => this.isDateDisabledInternal(n));
|
|
3082
3272
|
}
|
|
3083
3273
|
isToday(a) {
|
|
3084
|
-
return
|
|
3274
|
+
return pt(a);
|
|
3085
3275
|
}
|
|
3086
3276
|
isSameDay(a, t) {
|
|
3087
|
-
return
|
|
3277
|
+
return ht(a, t);
|
|
3088
3278
|
}
|
|
3089
3279
|
isInRange(a) {
|
|
3090
|
-
return
|
|
3280
|
+
return oa(a, this.selectedStartDate, this.selectedEndDate);
|
|
3091
3281
|
}
|
|
3092
3282
|
/**
|
|
3093
3283
|
* Determine if events/callbacks should be deferred until Apply button click
|
|
@@ -3121,7 +3311,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3121
3311
|
for (let n = 0; n < this.options.visibleMonthsCount; n++) {
|
|
3122
3312
|
const r = document.createElement("div");
|
|
3123
3313
|
r.className = "drp-date-picker__month", r.dataset.monthIndex = String(n);
|
|
3124
|
-
const
|
|
3314
|
+
const i = this.options.unifiedNavigation ? `<div class="drp-date-picker__header drp-date-picker__header--static">
|
|
3125
3315
|
<div class="drp-date-picker__month-year"></div>
|
|
3126
3316
|
</div>` : `<div class="drp-date-picker__header">
|
|
3127
3317
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="prev" data-month-index="${n}"></button>
|
|
@@ -3129,7 +3319,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3129
3319
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="next" data-month-index="${n}"></button>
|
|
3130
3320
|
</div>`;
|
|
3131
3321
|
r.innerHTML = `
|
|
3132
|
-
${
|
|
3322
|
+
${i}
|
|
3133
3323
|
<div class="drp-date-picker__calendar-container">
|
|
3134
3324
|
<div class="drp-date-picker__rolling-selector" data-month-index="${n}">
|
|
3135
3325
|
<div class="drp-date-picker__rolling-list" data-list="years" data-month-index="${n}"></div>
|
|
@@ -3140,7 +3330,10 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3140
3330
|
</div>
|
|
3141
3331
|
`, a.appendChild(r);
|
|
3142
3332
|
}
|
|
3143
|
-
if (this.calendar.appendChild(a), this.
|
|
3333
|
+
if (this.calendar.appendChild(a), this.messageElement = document.createElement("div"), this.messageElement.className = "drp-date-picker__message", this.messageElement.innerHTML = `
|
|
3334
|
+
<span class="drp-date-picker__message-text"></span>
|
|
3335
|
+
<button class="drp-date-picker__message-close" data-action="close-message">×</button>
|
|
3336
|
+
`, this.calendar.appendChild(this.messageElement), this.options.selectionMode === "range") {
|
|
3144
3337
|
const n = document.createElement("div");
|
|
3145
3338
|
n.className = "drp-date-picker__summary drp-date-picker__summary--hidden", this.calendar.appendChild(n);
|
|
3146
3339
|
}
|
|
@@ -3160,72 +3353,75 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3160
3353
|
attachCalendarListeners() {
|
|
3161
3354
|
this.calendar.addEventListener("click", async (a) => {
|
|
3162
3355
|
const t = a.target;
|
|
3163
|
-
a.stopPropagation();
|
|
3164
|
-
const n = t.dataset.action, r = t.dataset.monthIndex,
|
|
3356
|
+
console.log("[click handler] clicked:", t.tagName, t.className, "data-action:", t.dataset.action), a.stopPropagation();
|
|
3357
|
+
const n = t.dataset.action, r = t.dataset.monthIndex, i = r ? parseInt(r) : 0, o = t.closest('[data-action="custom"]');
|
|
3358
|
+
if (o) {
|
|
3359
|
+
const s = {};
|
|
3360
|
+
for (const [l, c] of Object.entries(o.dataset))
|
|
3361
|
+
l !== "action" && (s[l] = c);
|
|
3362
|
+
this.fireCustomActionEvent(s);
|
|
3363
|
+
const d = o._customOnClick;
|
|
3364
|
+
d && await Promise.resolve(d(this));
|
|
3365
|
+
return;
|
|
3366
|
+
}
|
|
3165
3367
|
if (n === "prev" || n === "next" || n === "unified-prev" || n === "unified-next") {
|
|
3166
|
-
const
|
|
3167
|
-
if (
|
|
3368
|
+
const s = t;
|
|
3369
|
+
if (s.disabled || s.classList.contains("drp-date-picker__nav--disabled"))
|
|
3168
3370
|
return;
|
|
3169
3371
|
}
|
|
3170
|
-
if (n === "prev") this.prevMonth(
|
|
3171
|
-
else if (n === "next") this.nextMonth(
|
|
3372
|
+
if (n === "prev") this.prevMonth(i);
|
|
3373
|
+
else if (n === "next") this.nextMonth(i);
|
|
3172
3374
|
else if (n === "unified-prev") this.unifiedPrevMonth();
|
|
3173
3375
|
else if (n === "unified-next") this.unifiedNextMonth();
|
|
3174
|
-
else if (n === "toggle-rolling") this.toggleRollingSelector(
|
|
3376
|
+
else if (n === "toggle-rolling") this.toggleRollingSelector(i);
|
|
3175
3377
|
else if (n === "toggle-unified-rolling") this.toggleUnifiedRollingSelector();
|
|
3176
3378
|
else if (n === "today") this.selectToday();
|
|
3177
3379
|
else if (n === "clear") this.clearSelection();
|
|
3178
3380
|
else if (n === "apply") this.apply();
|
|
3179
|
-
else if (n === "
|
|
3180
|
-
|
|
3181
|
-
i && await Promise.resolve(i(this));
|
|
3182
|
-
} else if (t.closest(".drp-date-picker__day:not(.drp-date-picker__day--disabled)"))
|
|
3381
|
+
else if (n === "close-message") this.hideMessage();
|
|
3382
|
+
else if (t.closest(".drp-date-picker__day:not(.drp-date-picker__day--disabled)"))
|
|
3183
3383
|
await this.selectDay(t.closest(".drp-date-picker__day"));
|
|
3184
3384
|
else if (t.closest("[data-year]")) {
|
|
3185
|
-
const
|
|
3186
|
-
if (
|
|
3385
|
+
const s = t.closest("[data-year]");
|
|
3386
|
+
if (s.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3187
3387
|
return;
|
|
3188
|
-
const
|
|
3189
|
-
if (
|
|
3190
|
-
|
|
3388
|
+
const d = s.dataset.year;
|
|
3389
|
+
if (s.dataset.unified === "true")
|
|
3390
|
+
d && this.setUnifiedYear(parseInt(d));
|
|
3191
3391
|
else {
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3392
|
+
const l = s.dataset.monthIndex;
|
|
3393
|
+
d && l && this.selectYear(parseInt(d), parseInt(l));
|
|
3194
3394
|
}
|
|
3195
3395
|
} else if (t.closest("[data-month]")) {
|
|
3196
|
-
const
|
|
3197
|
-
if (
|
|
3396
|
+
const s = t.closest("[data-month]");
|
|
3397
|
+
if (s.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3198
3398
|
return;
|
|
3199
|
-
const
|
|
3200
|
-
if (
|
|
3201
|
-
|
|
3399
|
+
const d = s.dataset.month;
|
|
3400
|
+
if (s.dataset.unified === "true")
|
|
3401
|
+
d && this.setUnifiedMonth(parseInt(d));
|
|
3202
3402
|
else {
|
|
3203
|
-
const
|
|
3204
|
-
|
|
3403
|
+
const l = s.dataset.monthIndex;
|
|
3404
|
+
d && l && this.selectMonth(parseInt(d), parseInt(l));
|
|
3205
3405
|
}
|
|
3206
3406
|
} else if (!t.closest(".drp-date-picker__rolling-selector") && !t.closest(".drp-date-picker__unified-rolling-selector")) {
|
|
3207
|
-
let
|
|
3208
|
-
for (let
|
|
3209
|
-
this.showingRollingSelector[
|
|
3210
|
-
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1,
|
|
3407
|
+
let s = !1;
|
|
3408
|
+
for (let d = 0; d < this.showingRollingSelector.length; d++)
|
|
3409
|
+
this.showingRollingSelector[d] && (this.showingRollingSelector[d] = !1, s = !0);
|
|
3410
|
+
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, s = !0), s && this.renderCalendar();
|
|
3211
3411
|
}
|
|
3212
3412
|
}), this.calendar.addEventListener("mouseenter", (a) => {
|
|
3213
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"),
|
|
3214
|
-
if (
|
|
3215
|
-
const
|
|
3216
|
-
|
|
3413
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"), i = n || r;
|
|
3414
|
+
if (i && i instanceof HTMLElement) {
|
|
3415
|
+
const o = i.dataset.tooltip;
|
|
3416
|
+
o && this.showTooltip(i, o);
|
|
3217
3417
|
}
|
|
3218
3418
|
}, !0), this.calendar.addEventListener("mouseleave", (a) => {
|
|
3219
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"),
|
|
3220
|
-
|
|
3221
|
-
}, !0), this.calendar.addEventListener("
|
|
3222
|
-
this.isCalendarActive = !0, a.stopPropagation();
|
|
3223
|
-
}), this.calendar.addEventListener("focusin", () => {
|
|
3419
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"), i = n || r;
|
|
3420
|
+
i && this.currentTooltipTarget === i && this.hideTooltip();
|
|
3421
|
+
}, !0), this.calendar.addEventListener("focusin", () => {
|
|
3224
3422
|
this.isCalendarActive = !0;
|
|
3225
|
-
}), document.addEventListener("
|
|
3226
|
-
|
|
3227
|
-
}, !0), document.addEventListener("keydown", (a) => {
|
|
3228
|
-
var t, n, r, o;
|
|
3423
|
+
}), document.addEventListener("keydown", (a) => {
|
|
3424
|
+
var t, n, r, i;
|
|
3229
3425
|
if (this.calendar.classList.contains("drp-date-picker--visible") && this.isCalendarActive) {
|
|
3230
3426
|
if (k.debug("Keydown", a.key, "Ctrl:", a.ctrlKey, "Meta:", a.metaKey, "Shift:", a.shiftKey, "Alt:", a.altKey), a.key === "Escape")
|
|
3231
3427
|
this.hide(), a.preventDefault();
|
|
@@ -3236,11 +3432,11 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3236
3432
|
else if (a.key === "ArrowLeft") {
|
|
3237
3433
|
if (a.ctrlKey || a.metaKey) {
|
|
3238
3434
|
w.debug("Ctrl+Left: Navigate to previous month");
|
|
3239
|
-
const
|
|
3435
|
+
const o = this.focusedDayIndex;
|
|
3240
3436
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3241
3437
|
var l, c;
|
|
3242
3438
|
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)");
|
|
3243
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3439
|
+
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" }));
|
|
3244
3440
|
}, 0);
|
|
3245
3441
|
} else
|
|
3246
3442
|
this.moveFocus(-1);
|
|
@@ -3248,25 +3444,25 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3248
3444
|
} else if (a.key === "ArrowRight") {
|
|
3249
3445
|
if (a.ctrlKey || a.metaKey) {
|
|
3250
3446
|
w.debug("Ctrl+Right: Navigate to next month");
|
|
3251
|
-
const
|
|
3447
|
+
const o = this.focusedDayIndex;
|
|
3252
3448
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3253
3449
|
var l, c;
|
|
3254
3450
|
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)");
|
|
3255
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3451
|
+
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" }));
|
|
3256
3452
|
}, 0);
|
|
3257
3453
|
} else
|
|
3258
3454
|
this.moveFocus(1);
|
|
3259
3455
|
a.preventDefault();
|
|
3260
3456
|
} else if (a.key === "Enter") {
|
|
3261
3457
|
if (this.focusedDayIndex !== null) {
|
|
3262
|
-
const
|
|
3458
|
+
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];
|
|
3263
3459
|
d && d.click();
|
|
3264
3460
|
} else
|
|
3265
3461
|
this.hide();
|
|
3266
3462
|
a.preventDefault();
|
|
3267
3463
|
} else if (a.key === "Tab") {
|
|
3268
3464
|
if (this.options.visibleMonthsCount > 1) {
|
|
3269
|
-
const
|
|
3465
|
+
const o = a.shiftKey ? -1 : 1, s = this.activeMonthIndex + o;
|
|
3270
3466
|
if (s >= 0 && s < this.monthDates.length) {
|
|
3271
3467
|
w.debug(`Tab: switching from Col${this.activeMonthIndex} to Col${s}`);
|
|
3272
3468
|
const d = this.focusedDayIndex ?? 0;
|
|
@@ -3281,46 +3477,46 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3281
3477
|
a.preventDefault();
|
|
3282
3478
|
}
|
|
3283
3479
|
} else if (a.key === "t" || a.key === "T")
|
|
3284
|
-
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(),
|
|
3285
|
-
const
|
|
3480
|
+
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), he(this, this.activeMonthIndex), this.renderCalendar(), setTimeout(() => {
|
|
3481
|
+
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)");
|
|
3286
3482
|
if (s) {
|
|
3287
3483
|
const d = Array.from(s).findIndex((l) => l.classList.contains("drp-date-picker__day--today"));
|
|
3288
3484
|
d !== -1 && (this.focusedDayIndex = d, s[d].classList.add("drp-date-picker__day--focused"), s[d].scrollIntoView({ block: "nearest" }));
|
|
3289
3485
|
}
|
|
3290
3486
|
}, 0), a.preventDefault();
|
|
3291
3487
|
else if (a.key === "PageUp") {
|
|
3292
|
-
const
|
|
3488
|
+
const o = this.focusedDayIndex;
|
|
3293
3489
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3294
3490
|
var l, c;
|
|
3295
3491
|
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)");
|
|
3296
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3492
|
+
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" }));
|
|
3297
3493
|
}, 0), a.preventDefault();
|
|
3298
3494
|
} else if (a.key === "PageDown") {
|
|
3299
|
-
const
|
|
3495
|
+
const o = this.focusedDayIndex;
|
|
3300
3496
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3301
3497
|
var l, c;
|
|
3302
3498
|
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)");
|
|
3303
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3499
|
+
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" }));
|
|
3304
3500
|
}, 0), a.preventDefault();
|
|
3305
3501
|
} else if (a.key === "Home") {
|
|
3306
3502
|
w.debug("Home key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3307
|
-
const
|
|
3503
|
+
const o = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3308
3504
|
if (a.ctrlKey || a.metaKey) {
|
|
3309
3505
|
w.debug("Ctrl+Home: Navigate to year start");
|
|
3310
3506
|
const d = this.getEffectiveYearRange(), l = this.getEffectiveMonthRange(), c = s === 0, u = this.focusedDayIndex === 0;
|
|
3311
|
-
let
|
|
3312
|
-
c && u && (
|
|
3313
|
-
const f = new Date(
|
|
3314
|
-
(f.getFullYear() !== h.getFullYear() || f.getMonth() !== h.getMonth() || this.focusedDayIndex !== 0) && (w.debug("Going to",
|
|
3315
|
-
var
|
|
3507
|
+
let g = o, p = Math.max(0, l.min - 1);
|
|
3508
|
+
c && u && (g = o - 1), g < d.min && (w.debug("Ctrl+Home: Target year below min, clamping to", d.min), g = d.min);
|
|
3509
|
+
const f = new Date(g, p, 1), h = this.monthDates[this.activeMonthIndex];
|
|
3510
|
+
(f.getFullYear() !== h.getFullYear() || f.getMonth() !== h.getMonth() || this.focusedDayIndex !== 0) && (w.debug("Going to", p + 1, "/", g), this.monthDates[this.activeMonthIndex] = f, this.renderCalendar(), setTimeout(() => {
|
|
3511
|
+
var x, C;
|
|
3316
3512
|
const v = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), m = v == null ? void 0 : v.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3317
|
-
m && (this.focusedDayIndex = 0, (
|
|
3513
|
+
m && (this.focusedDayIndex = 0, (x = m[0]) == null || x.classList.add("drp-date-picker__day--focused"), (C = m[0]) == null || C.scrollIntoView({ block: "nearest" }));
|
|
3318
3514
|
}, 0));
|
|
3319
3515
|
} else if (w.debug("Home: Navigate to first day (cycles to previous month if already there)"), this.focusedDayIndex === 0)
|
|
3320
3516
|
w.debug("Already on first day, going to previous month"), this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3321
|
-
var u,
|
|
3517
|
+
var u, g;
|
|
3322
3518
|
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)");
|
|
3323
|
-
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3519
|
+
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (u = c[0]) == null || u.classList.add("drp-date-picker__day--focused"), (g = c[0]) == null || g.scrollIntoView({ block: "nearest" }));
|
|
3324
3520
|
}, 0);
|
|
3325
3521
|
else {
|
|
3326
3522
|
this.focusedDayIndex = 0;
|
|
@@ -3330,51 +3526,39 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3330
3526
|
a.preventDefault();
|
|
3331
3527
|
} else if (a.key === "End") {
|
|
3332
3528
|
w.debug("End key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3333
|
-
const
|
|
3529
|
+
const o = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3334
3530
|
if (a.ctrlKey || a.metaKey) {
|
|
3335
3531
|
w.debug("Ctrl+End: Navigate to year end");
|
|
3336
|
-
const d = this.getEffectiveYearRange(), l = this.getEffectiveMonthRange(), c = s === 11, u = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3337
|
-
let f =
|
|
3338
|
-
c &&
|
|
3339
|
-
const v = new Date(f, h + 1, 0).getDate(), m = new Date(f, h, v),
|
|
3340
|
-
(m.getFullYear() !==
|
|
3532
|
+
const d = this.getEffectiveYearRange(), l = this.getEffectiveMonthRange(), c = s === 11, 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)"), p = g && this.focusedDayIndex === g.length - 1;
|
|
3533
|
+
let f = o, h = Math.min(11, l.max - 1);
|
|
3534
|
+
c && p && (f = o + 1), f > d.max && (w.debug("Ctrl+End: Target year above max, clamping to", d.max), f = d.max);
|
|
3535
|
+
const v = new Date(f, h + 1, 0).getDate(), m = new Date(f, h, v), x = this.monthDates[this.activeMonthIndex];
|
|
3536
|
+
(m.getFullYear() !== x.getFullYear() || m.getMonth() !== x.getMonth() || !p) && (w.debug("Going to", h + 1, "/", f), this.monthDates[this.activeMonthIndex] = m, this.renderCalendar(), setTimeout(() => {
|
|
3341
3537
|
var D, _;
|
|
3342
|
-
const C = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3343
|
-
|
|
3538
|
+
const C = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), M = C == null ? void 0 : C.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3539
|
+
M && (this.focusedDayIndex = M.length - 1, (D = M[this.focusedDayIndex]) == null || D.classList.add("drp-date-picker__day--focused"), (_ = M[this.focusedDayIndex]) == null || _.scrollIntoView({ block: "nearest" }));
|
|
3344
3540
|
}, 0));
|
|
3345
3541
|
} else {
|
|
3346
3542
|
w.debug("End: Navigate to last day (cycles to next month if already there)");
|
|
3347
3543
|
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)");
|
|
3348
3544
|
if (!l) return;
|
|
3349
3545
|
this.focusedDayIndex === l.length - 1 ? (w.debug("Already on last day, going to next month"), this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3350
|
-
var
|
|
3351
|
-
const u = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3352
|
-
|
|
3353
|
-
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((u) => u.classList.remove("drp-date-picker__day--focused")), (r = l[this.focusedDayIndex]) == null || r.classList.add("drp-date-picker__day--focused"), (
|
|
3546
|
+
var p, f;
|
|
3547
|
+
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)");
|
|
3548
|
+
g && (this.focusedDayIndex = g.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((h) => h.classList.remove("drp-date-picker__day--focused")), (p = g[this.focusedDayIndex]) == null || p.classList.add("drp-date-picker__day--focused"), (f = g[this.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
3549
|
+
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((u) => u.classList.remove("drp-date-picker__day--focused")), (r = l[this.focusedDayIndex]) == null || r.classList.add("drp-date-picker__day--focused"), (i = l[this.focusedDayIndex]) == null || i.scrollIntoView({ block: "nearest" }));
|
|
3354
3550
|
}
|
|
3355
3551
|
a.preventDefault();
|
|
3356
3552
|
}
|
|
3357
3553
|
}
|
|
3358
|
-
})
|
|
3359
|
-
var s;
|
|
3360
|
-
const t = a.composedPath(), n = t[0], r = t.includes(this.calendar), o = this.input && t.includes(this.input), i = (s = n.closest) == null ? void 0 : s.call(n, "[data-calendar-button]");
|
|
3361
|
-
if (!r && !o && !i)
|
|
3362
|
-
if (this.options.positioningMode === "floating")
|
|
3363
|
-
this.hide();
|
|
3364
|
-
else {
|
|
3365
|
-
let d = !1;
|
|
3366
|
-
for (let l = 0; l < this.showingRollingSelector.length; l++)
|
|
3367
|
-
this.showingRollingSelector[l] && (this.showingRollingSelector[l] = !1, d = !0);
|
|
3368
|
-
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, d = !0), d && this.renderCalendar();
|
|
3369
|
-
}
|
|
3370
|
-
};
|
|
3554
|
+
});
|
|
3371
3555
|
}
|
|
3372
3556
|
// Helper methods
|
|
3373
3557
|
parseFormat(a) {
|
|
3374
3558
|
const t = {};
|
|
3375
3559
|
let n = "";
|
|
3376
|
-
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((
|
|
3377
|
-
|
|
3560
|
+
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((i, o) => {
|
|
3561
|
+
i === "YYYY" || i === "YY" ? t.year = { index: o, length: i.length } : i === "MM" || i === "M" ? t.month = { index: o, length: 2 } : (i === "DD" || i === "D") && (t.day = { index: o, length: 2 });
|
|
3378
3562
|
}), {
|
|
3379
3563
|
format: a,
|
|
3380
3564
|
separator: n,
|
|
@@ -3384,10 +3568,10 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3384
3568
|
}
|
|
3385
3569
|
formatDate(a) {
|
|
3386
3570
|
if (!a) return "";
|
|
3387
|
-
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), r = String(a.getDate()).padStart(2, "0"), { format:
|
|
3571
|
+
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), r = String(a.getDate()).padStart(2, "0"), { format: i, separator: o, parts: s } = this.formatInfo, d = [];
|
|
3388
3572
|
for (let l = 0; l < 3; l++)
|
|
3389
3573
|
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(r);
|
|
3390
|
-
return d.join(
|
|
3574
|
+
return d.join(o);
|
|
3391
3575
|
}
|
|
3392
3576
|
// Reactive getters/setters for programmatic control
|
|
3393
3577
|
/**
|
|
@@ -3416,7 +3600,7 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3416
3600
|
this.selectedRanges = a.map((t) => ({
|
|
3417
3601
|
start: new Date(t.start),
|
|
3418
3602
|
end: new Date(t.end)
|
|
3419
|
-
})), this.options.selectionMode === "range" && a.length > 0 ? (this.selectedStartDate = new Date(a[0].start), this.selectedEndDate = new Date(a[0].end), this.input && !this.requiresApplyButton() && (this.input.value = `${this.formatDate(this.selectedStartDate)} - ${this.formatDate(this.selectedEndDate)}`)) : this.input && !this.requiresApplyButton() && (this.input.value = ""), this.renderCalendar(), this.updateSummary();
|
|
3603
|
+
})), this.invalidRangeStart = null, this.invalidRangeEnd = null, this.focusedDayIndex = null, this.options.selectionMode === "range" && a.length > 0 ? (this.selectedStartDate = new Date(a[0].start), this.selectedEndDate = new Date(a[0].end), this.input && !this.requiresApplyButton() && (this.input.value = `${this.formatDate(this.selectedStartDate)} - ${this.formatDate(this.selectedEndDate)}`)) : this.input && !this.requiresApplyButton() && (this.input.value = ""), this.renderCalendar(), this.updateSummary();
|
|
3420
3604
|
}
|
|
3421
3605
|
/**
|
|
3422
3606
|
* Get/set selected individual dates (for multiple mode)
|
|
@@ -3436,140 +3620,157 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3436
3620
|
set selectedDateReactive(a) {
|
|
3437
3621
|
this.selectedDate = a ? new Date(a) : null, this.input && a ? this.input.value = this.formatDate(a) : this.input && (this.input.value = ""), this.renderCalendar(), this.updateSummary();
|
|
3438
3622
|
}
|
|
3623
|
+
/**
|
|
3624
|
+
* Fire a custom-action event with the provided data attributes
|
|
3625
|
+
*/
|
|
3626
|
+
fireCustomActionEvent(a) {
|
|
3627
|
+
this.calendar.dispatchEvent(new CustomEvent("custom-action", {
|
|
3628
|
+
detail: a,
|
|
3629
|
+
bubbles: !0,
|
|
3630
|
+
composed: !0
|
|
3631
|
+
// Cross shadow DOM boundary
|
|
3632
|
+
}));
|
|
3633
|
+
}
|
|
3439
3634
|
destroy() {
|
|
3440
|
-
this.
|
|
3635
|
+
this.scrollSubscriptions.forEach((a) => a.unsubscribe()), this.scrollSubscriptions = [], this.clickSubscriptions.forEach((a) => a.unsubscribe()), this.clickSubscriptions = [], this.scrollEvents.destroy(), this.clickEvents.destroy(), this.destroyAllActionButtonTooltips(), this.calendar.remove(), this.tooltip && this.tooltip.remove();
|
|
3441
3636
|
}
|
|
3442
3637
|
// UI methods - wrappers for pure functions
|
|
3443
3638
|
show() {
|
|
3444
|
-
return
|
|
3639
|
+
return Ht(this);
|
|
3445
3640
|
}
|
|
3446
3641
|
hide() {
|
|
3447
|
-
return
|
|
3642
|
+
return Ot(this);
|
|
3448
3643
|
}
|
|
3449
3644
|
toggle() {
|
|
3450
|
-
return
|
|
3645
|
+
return pn(this);
|
|
3451
3646
|
}
|
|
3452
3647
|
position() {
|
|
3453
|
-
return
|
|
3648
|
+
return We(this);
|
|
3454
3649
|
}
|
|
3455
3650
|
showTooltip(a, t) {
|
|
3456
|
-
return
|
|
3651
|
+
return hn(this, a, t);
|
|
3457
3652
|
}
|
|
3458
3653
|
hideTooltip() {
|
|
3459
|
-
return
|
|
3654
|
+
return fn(this);
|
|
3655
|
+
}
|
|
3656
|
+
showMessage(a, t, n) {
|
|
3657
|
+
return Ke(this, a, t, n);
|
|
3658
|
+
}
|
|
3659
|
+
hideMessage() {
|
|
3660
|
+
return ie(this);
|
|
3460
3661
|
}
|
|
3461
3662
|
// Rendering methods - wrappers for pure functions
|
|
3462
3663
|
renderCalendar() {
|
|
3463
|
-
return
|
|
3664
|
+
return Sn(this);
|
|
3464
3665
|
}
|
|
3465
3666
|
renderNormalView(a) {
|
|
3466
|
-
return
|
|
3667
|
+
return qt(this, a);
|
|
3467
3668
|
}
|
|
3468
3669
|
renderDays(a, t) {
|
|
3469
|
-
return
|
|
3670
|
+
return Ut(this, a, t);
|
|
3470
3671
|
}
|
|
3471
3672
|
renderRollingSelector(a) {
|
|
3472
|
-
return
|
|
3673
|
+
return jt(this, a);
|
|
3473
3674
|
}
|
|
3474
3675
|
updateSummary() {
|
|
3475
|
-
return
|
|
3676
|
+
return In(this);
|
|
3476
3677
|
}
|
|
3477
3678
|
updateSummaryWithPreview() {
|
|
3478
|
-
return
|
|
3679
|
+
return Wt(this);
|
|
3479
3680
|
}
|
|
3480
3681
|
updateDragPreview() {
|
|
3481
|
-
return
|
|
3682
|
+
return Rn(this);
|
|
3482
3683
|
}
|
|
3483
3684
|
// Navigation methods - wrappers for pure functions
|
|
3484
3685
|
toggleRollingSelector(a) {
|
|
3485
|
-
return
|
|
3686
|
+
return mn(this, a);
|
|
3486
3687
|
}
|
|
3487
3688
|
selectYear(a, t) {
|
|
3488
|
-
return
|
|
3689
|
+
return bn(this, a, t);
|
|
3489
3690
|
}
|
|
3490
3691
|
selectMonth(a, t) {
|
|
3491
|
-
return
|
|
3692
|
+
return yn(this, a, t);
|
|
3492
3693
|
}
|
|
3493
3694
|
checkAndResolveCollisions(a) {
|
|
3494
|
-
return
|
|
3695
|
+
return he(this, a);
|
|
3495
3696
|
}
|
|
3496
3697
|
prevMonth(a) {
|
|
3497
|
-
return
|
|
3698
|
+
return ve(this, a);
|
|
3498
3699
|
}
|
|
3499
3700
|
nextMonth(a) {
|
|
3500
|
-
return
|
|
3701
|
+
return De(this, a);
|
|
3501
3702
|
}
|
|
3502
3703
|
// Unified navigation methods
|
|
3503
3704
|
unifiedPrevMonth() {
|
|
3504
|
-
return
|
|
3705
|
+
return _n(this);
|
|
3505
3706
|
}
|
|
3506
3707
|
unifiedNextMonth() {
|
|
3507
|
-
return
|
|
3708
|
+
return Dn(this);
|
|
3508
3709
|
}
|
|
3509
3710
|
toggleUnifiedRollingSelector() {
|
|
3510
|
-
return
|
|
3711
|
+
return xn(this);
|
|
3511
3712
|
}
|
|
3512
3713
|
setUnifiedMonth(a) {
|
|
3513
|
-
return
|
|
3714
|
+
return wn(this, a);
|
|
3514
3715
|
}
|
|
3515
3716
|
setUnifiedYear(a) {
|
|
3516
|
-
return
|
|
3717
|
+
return Mn(this, a);
|
|
3517
3718
|
}
|
|
3518
3719
|
findNextEnabledDayIndex(a, t, n, r) {
|
|
3519
|
-
return
|
|
3720
|
+
return be(this, a, t, n);
|
|
3520
3721
|
}
|
|
3521
3722
|
moveFocus(a) {
|
|
3522
|
-
return
|
|
3723
|
+
return vn(this, a);
|
|
3523
3724
|
}
|
|
3524
3725
|
// Selection methods - wrappers for pure functions
|
|
3525
3726
|
async selectDay(a) {
|
|
3526
|
-
return await
|
|
3727
|
+
return await rn(this, a);
|
|
3527
3728
|
}
|
|
3528
3729
|
selectToday() {
|
|
3529
|
-
return
|
|
3730
|
+
return on(this);
|
|
3530
3731
|
}
|
|
3531
3732
|
clearSelection() {
|
|
3532
|
-
return
|
|
3733
|
+
return sn(this);
|
|
3533
3734
|
}
|
|
3534
3735
|
apply() {
|
|
3535
|
-
return
|
|
3736
|
+
return dn(this);
|
|
3536
3737
|
}
|
|
3537
3738
|
// Interaction methods - wrappers for pure functions
|
|
3538
3739
|
initDragListeners() {
|
|
3539
|
-
return
|
|
3740
|
+
return ln(this);
|
|
3540
3741
|
}
|
|
3541
3742
|
startDrag(a, t, n) {
|
|
3542
|
-
return
|
|
3743
|
+
return zt(this, a, t, n);
|
|
3543
3744
|
}
|
|
3544
3745
|
onDragMove(a) {
|
|
3545
|
-
return
|
|
3746
|
+
return Pt(this, a);
|
|
3546
3747
|
}
|
|
3547
3748
|
async onDragEnd(a) {
|
|
3548
|
-
return await
|
|
3749
|
+
return await Nt(this);
|
|
3549
3750
|
}
|
|
3550
3751
|
findNearestEnabledDate(a, t = "forward") {
|
|
3551
|
-
return
|
|
3752
|
+
return $e(this, a, t);
|
|
3552
3753
|
}
|
|
3553
3754
|
handleInputMask(a) {
|
|
3554
|
-
return
|
|
3755
|
+
return cn(this, a);
|
|
3555
3756
|
}
|
|
3556
3757
|
applyMask(a) {
|
|
3557
3758
|
return pe(this, a);
|
|
3558
3759
|
}
|
|
3559
3760
|
applyRangeMask(a) {
|
|
3560
|
-
return
|
|
3761
|
+
return Ft(this, a);
|
|
3561
3762
|
}
|
|
3562
3763
|
handleKeydown(a) {
|
|
3563
|
-
return
|
|
3764
|
+
return un(this, a);
|
|
3564
3765
|
}
|
|
3565
3766
|
handlePaste(a) {
|
|
3566
|
-
return
|
|
3767
|
+
return gn(this, a);
|
|
3567
3768
|
}
|
|
3568
3769
|
updateCalendarFromInput() {
|
|
3569
|
-
return
|
|
3770
|
+
return Ye(this);
|
|
3570
3771
|
}
|
|
3571
3772
|
parseAndUpdateSingleDate(a, t = "single") {
|
|
3572
|
-
return
|
|
3773
|
+
return Ee(this, a, t);
|
|
3573
3774
|
}
|
|
3574
3775
|
/**
|
|
3575
3776
|
* Inject global styles for the date picker
|
|
@@ -3595,12 +3796,12 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3595
3796
|
* ```
|
|
3596
3797
|
*/
|
|
3597
3798
|
static injectGlobalStyles(a = !1) {
|
|
3598
|
-
if (
|
|
3799
|
+
if (_e.stylesInjected && !a) {
|
|
3599
3800
|
k.debug("Styles already injected, skipping");
|
|
3600
3801
|
return;
|
|
3601
3802
|
}
|
|
3602
3803
|
const t = document.createElement("style");
|
|
3603
|
-
t.setAttribute("data-source", "web-daterangepicker"), t.textContent =
|
|
3804
|
+
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = Kt, document.head.appendChild(t), _e.stylesInjected = !0, k.info("Global styles injected successfully");
|
|
3604
3805
|
}
|
|
3605
3806
|
/**
|
|
3606
3807
|
* Check if styles appear to be loaded
|
|
@@ -3620,9 +3821,9 @@ const jt = ':host,:root{--drp-rem: 10px;font-family:var(--drp-font-family, var(-
|
|
|
3620
3821
|
}
|
|
3621
3822
|
};
|
|
3622
3823
|
// Static flag to track if styles have been injected
|
|
3623
|
-
b(
|
|
3624
|
-
let
|
|
3625
|
-
class
|
|
3824
|
+
b(_e, "stylesInjected", !1);
|
|
3825
|
+
let Xe = _e;
|
|
3826
|
+
class Gt extends HTMLElement {
|
|
3626
3827
|
constructor() {
|
|
3627
3828
|
super();
|
|
3628
3829
|
b(this, "picker");
|
|
@@ -3684,6 +3885,7 @@ class Wt extends HTMLElement {
|
|
|
3684
3885
|
"rolling-month-range",
|
|
3685
3886
|
"enable-transitions",
|
|
3686
3887
|
"auto-close",
|
|
3888
|
+
"close-on-scroll",
|
|
3687
3889
|
"show-today-button",
|
|
3688
3890
|
"show-clear-button",
|
|
3689
3891
|
"show-apply-button",
|
|
@@ -3724,12 +3926,12 @@ class Wt extends HTMLElement {
|
|
|
3724
3926
|
}
|
|
3725
3927
|
render() {
|
|
3726
3928
|
const t = document.createElement("style");
|
|
3727
|
-
if (t.textContent =
|
|
3929
|
+
if (t.textContent = Kt, this.shadow.appendChild(t), (this.getAttribute("positioning-mode") || "floating") === "floating") {
|
|
3728
3930
|
this.inputElement = document.createElement("input"), this.inputElement.type = "text", this.inputElement.classList.add("drp-input", "drp-date-picker-input");
|
|
3729
3931
|
const r = this.getAttribute("placeholder");
|
|
3730
3932
|
r && (this.inputElement.placeholder = r);
|
|
3731
|
-
const
|
|
3732
|
-
|
|
3933
|
+
const i = this.getAttribute("value");
|
|
3934
|
+
i && (this.inputElement.value = i), this.hasAttribute("disabled") && (this.inputElement.disabled = !0), this.shadow.appendChild(this.inputElement), this.applyInputSizeStyles();
|
|
3733
3935
|
}
|
|
3734
3936
|
}
|
|
3735
3937
|
initializePicker() {
|
|
@@ -3738,14 +3940,14 @@ class Wt extends HTMLElement {
|
|
|
3738
3940
|
let n;
|
|
3739
3941
|
const r = this.getAttribute("disabled-weekdays");
|
|
3740
3942
|
r && (n = r.split(",").map((l) => parseInt(l.trim())).filter((l) => !isNaN(l) && l >= 0 && l <= 6));
|
|
3741
|
-
let
|
|
3742
|
-
const
|
|
3743
|
-
if (
|
|
3744
|
-
if (
|
|
3745
|
-
|
|
3943
|
+
let i;
|
|
3944
|
+
const o = this.getAttribute("week-start-day");
|
|
3945
|
+
if (o)
|
|
3946
|
+
if (o === "auto")
|
|
3947
|
+
i = "auto";
|
|
3746
3948
|
else {
|
|
3747
|
-
const l = parseInt(
|
|
3748
|
-
!isNaN(l) && l >= 0 && l <= 6 && (
|
|
3949
|
+
const l = parseInt(o);
|
|
3950
|
+
!isNaN(l) && l >= 0 && l <= 6 && (i = l);
|
|
3749
3951
|
}
|
|
3750
3952
|
const s = {
|
|
3751
3953
|
selectionMode: this.getAttribute("selection-mode") || "single",
|
|
@@ -3766,7 +3968,7 @@ class Wt extends HTMLElement {
|
|
|
3766
3968
|
// Positioning
|
|
3767
3969
|
calendarPlacement: this.getAttribute("calendar-placement") || void 0,
|
|
3768
3970
|
// New options
|
|
3769
|
-
weekStartDay:
|
|
3971
|
+
weekStartDay: i,
|
|
3770
3972
|
minDate: this.getAttribute("min-date") || void 0,
|
|
3771
3973
|
maxDate: this.getAttribute("max-date") || void 0,
|
|
3772
3974
|
initialDate: this.getAttribute("initial-date") || void 0,
|
|
@@ -3804,12 +4006,20 @@ class Wt extends HTMLElement {
|
|
|
3804
4006
|
getMonthHeaderCallback: this._getMonthHeaderCallback,
|
|
3805
4007
|
// Action button configuration
|
|
3806
4008
|
autoClose: this.getAttribute("auto-close") || void 0,
|
|
4009
|
+
closeOnScroll: this.hasAttribute("close-on-scroll") ? this.getAttribute("close-on-scroll") !== "false" : void 0,
|
|
3807
4010
|
actionButtons: this._actionButtons,
|
|
3808
4011
|
showTodayButton: this.hasAttribute("show-today-button") ? this.getAttribute("show-today-button") === "true" : void 0,
|
|
3809
4012
|
showClearButton: this.hasAttribute("show-clear-button") ? this.getAttribute("show-clear-button") === "true" : void 0,
|
|
3810
4013
|
showApplyButton: this.hasAttribute("show-apply-button") ? this.getAttribute("show-apply-button") === "true" : void 0
|
|
3811
4014
|
}, d = t === "inline" ? null : this.inputElement;
|
|
3812
|
-
if (this.picker = new
|
|
4015
|
+
if (this.picker = new Xe(d, s), this.picker.calendar.addEventListener("custom-action", (l) => {
|
|
4016
|
+
const c = l;
|
|
4017
|
+
this.dispatchEvent(new CustomEvent("custom-action", {
|
|
4018
|
+
detail: c.detail,
|
|
4019
|
+
bubbles: !0,
|
|
4020
|
+
composed: !0
|
|
4021
|
+
}));
|
|
4022
|
+
}), this._customStylesCallback) {
|
|
3813
4023
|
const l = this._customStylesCallback();
|
|
3814
4024
|
if (l) {
|
|
3815
4025
|
const c = document.createElement("style");
|
|
@@ -3828,11 +4038,11 @@ class Wt extends HTMLElement {
|
|
|
3828
4038
|
}));
|
|
3829
4039
|
}
|
|
3830
4040
|
handleDateSelect(t) {
|
|
3831
|
-
var
|
|
4041
|
+
var i;
|
|
3832
4042
|
const n = {
|
|
3833
4043
|
date: t instanceof Date ? t : void 0,
|
|
3834
4044
|
dateRange: t instanceof Date || Array.isArray(t) ? void 0 : t,
|
|
3835
|
-
formattedValue: ((
|
|
4045
|
+
formattedValue: ((i = this.inputElement) == null ? void 0 : i.value) || ""
|
|
3836
4046
|
};
|
|
3837
4047
|
if (!this.picker) {
|
|
3838
4048
|
this.dispatchEvent(new CustomEvent("date-select", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: n, bubbles: !0, composed: !0 }));
|
|
@@ -3842,19 +4052,19 @@ class Wt extends HTMLElement {
|
|
|
3842
4052
|
return;
|
|
3843
4053
|
const r = this.picker.options.disabledDatesHandling;
|
|
3844
4054
|
if (!(t instanceof Date) && !Array.isArray(t) && "start" in t && "end" in t) {
|
|
3845
|
-
const
|
|
4055
|
+
const o = t.start, s = t.end;
|
|
3846
4056
|
switch (r) {
|
|
3847
4057
|
case "allow":
|
|
3848
|
-
n.enabledDates = this.picker.getEnabledDatesInRange(
|
|
4058
|
+
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;
|
|
3849
4059
|
break;
|
|
3850
4060
|
case "split":
|
|
3851
|
-
n.dateRanges = this.picker.splitRangeByDisabled(
|
|
4061
|
+
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(", "));
|
|
3852
4062
|
break;
|
|
3853
4063
|
case "individual":
|
|
3854
|
-
n.dates = this.picker.getEnabledDatesInRange(
|
|
4064
|
+
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(", "));
|
|
3855
4065
|
break;
|
|
3856
4066
|
case "block":
|
|
3857
|
-
n.dates = this.picker.getEnabledDatesInRange(
|
|
4067
|
+
n.dates = this.picker.getEnabledDatesInRange(o, s);
|
|
3858
4068
|
break;
|
|
3859
4069
|
}
|
|
3860
4070
|
}
|
|
@@ -3897,6 +4107,20 @@ class Wt extends HTMLElement {
|
|
|
3897
4107
|
}
|
|
3898
4108
|
this.picker.clearSelection();
|
|
3899
4109
|
}
|
|
4110
|
+
showMessage(t, n, r) {
|
|
4111
|
+
if (!this.picker) {
|
|
4112
|
+
console.warn("[web-daterangepicker] showMessage() called but picker not initialized yet");
|
|
4113
|
+
return;
|
|
4114
|
+
}
|
|
4115
|
+
console.log("[web-component] showMessage() called with:", t, n), this.picker.showMessage(t, n, r);
|
|
4116
|
+
}
|
|
4117
|
+
hideMessage() {
|
|
4118
|
+
if (!this.picker) {
|
|
4119
|
+
console.warn("[web-daterangepicker] hideMessage() called but picker not initialized yet");
|
|
4120
|
+
return;
|
|
4121
|
+
}
|
|
4122
|
+
this.picker.hideMessage();
|
|
4123
|
+
}
|
|
3900
4124
|
getInputValue() {
|
|
3901
4125
|
var t;
|
|
3902
4126
|
return ((t = this.inputElement) == null ? void 0 : t.value) || "";
|
|
@@ -4141,33 +4365,33 @@ class Wt extends HTMLElement {
|
|
|
4141
4365
|
this.picker && (this.picker.isOpen = t);
|
|
4142
4366
|
}
|
|
4143
4367
|
}
|
|
4144
|
-
customElements.get("web-daterangepicker") || customElements.define("web-daterangepicker",
|
|
4145
|
-
function
|
|
4368
|
+
customElements.get("web-daterangepicker") || customElements.define("web-daterangepicker", Gt);
|
|
4369
|
+
function zn() {
|
|
4146
4370
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4147
4371
|
}
|
|
4148
4372
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4149
|
-
version: () => "1.
|
|
4373
|
+
version: () => "1.10.0",
|
|
4150
4374
|
config: {
|
|
4151
4375
|
name: "@keenmate/web-daterangepicker",
|
|
4152
|
-
version: "1.
|
|
4376
|
+
version: "1.10.0",
|
|
4153
4377
|
author: "Keenmate",
|
|
4154
4378
|
license: "MIT",
|
|
4155
4379
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|
|
4156
4380
|
homepage: "https://github.com/keenmate/web-daterangepicker#readme"
|
|
4157
4381
|
},
|
|
4158
4382
|
register: () => {
|
|
4159
|
-
typeof customElements < "u" && !customElements.get("web-daterangepicker") && customElements.define("web-daterangepicker",
|
|
4383
|
+
typeof customElements < "u" && !customElements.get("web-daterangepicker") && customElements.define("web-daterangepicker", Gt);
|
|
4160
4384
|
},
|
|
4161
|
-
getInstances: () =>
|
|
4385
|
+
getInstances: () => zn(),
|
|
4162
4386
|
logging: {
|
|
4163
|
-
enableLogging:
|
|
4164
|
-
disableLogging:
|
|
4165
|
-
setLogLevel:
|
|
4166
|
-
setCategoryLevel:
|
|
4167
|
-
getCategories:
|
|
4387
|
+
enableLogging: bt,
|
|
4388
|
+
disableLogging: yt,
|
|
4389
|
+
setLogLevel: Je,
|
|
4390
|
+
setCategoryLevel: ha,
|
|
4391
|
+
getCategories: fa
|
|
4168
4392
|
}
|
|
4169
4393
|
}, window.components["web-daterangepicker"].register());
|
|
4170
4394
|
export {
|
|
4171
|
-
|
|
4172
|
-
|
|
4395
|
+
Xe as DateRangePicker,
|
|
4396
|
+
Gt as WebDaterangepickerElement
|
|
4173
4397
|
};
|