@keenmate/web-daterangepicker 1.4.0 → 1.6.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 +96 -3
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +1067 -1042
- package/dist/web-daterangepicker.umd.js +9 -9
- package/package.json +1 -1
- package/src/scss/_badges.scss +3 -3
- package/src/scss/_base.scss +36 -19
- package/src/scss/_header-navigation.scss +1 -1
- package/src/scss/_loading.scss +4 -4
- package/src/scss/_tooltips.scss +3 -3
- package/src/scss/_variables.scss +25 -23
|
@@ -7,8 +7,8 @@ function Xt(e) {
|
|
|
7
7
|
try {
|
|
8
8
|
const n = new Intl.Locale(navigator.language);
|
|
9
9
|
if ("weekInfo" in n && n.weekInfo && "firstDay" in n.weekInfo) {
|
|
10
|
-
const
|
|
11
|
-
return
|
|
10
|
+
const r = n.weekInfo.firstDay;
|
|
11
|
+
return r === 7 ? 0 : r;
|
|
12
12
|
}
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
@@ -40,75 +40,75 @@ function me(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 Jt(e, a, t, n,
|
|
44
|
-
const
|
|
45
|
-
return !!(a && e < a || t && e > t ||
|
|
43
|
+
function Jt(e, a, t, n, r) {
|
|
44
|
+
const o = me(e), i = e.getDay();
|
|
45
|
+
return !!(a && e < a || t && e > t || r && r.includes(i) || n.has(o));
|
|
46
46
|
}
|
|
47
47
|
function ct(e, a) {
|
|
48
48
|
for (let t = 0; t < 12; t++) {
|
|
49
49
|
const n = new Date(a, t + 1, 0).getDate();
|
|
50
|
-
for (let
|
|
51
|
-
const
|
|
52
|
-
if (!e.isDateDisabledInternal(
|
|
50
|
+
for (let r = 1; r <= n; r++) {
|
|
51
|
+
const o = new Date(a, t, r);
|
|
52
|
+
if (!e.isDateDisabledInternal(o))
|
|
53
53
|
return !0;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return !1;
|
|
57
57
|
}
|
|
58
58
|
function Qt(e, a, t) {
|
|
59
|
-
const n = new Date(e),
|
|
60
|
-
n.setHours(0, 0, 0, 0),
|
|
61
|
-
const
|
|
62
|
-
for (;
|
|
63
|
-
if (t(
|
|
59
|
+
const n = new Date(e), r = new Date(a);
|
|
60
|
+
n.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
61
|
+
const o = new Date(n);
|
|
62
|
+
for (; o <= r; ) {
|
|
63
|
+
if (t(o))
|
|
64
64
|
return !0;
|
|
65
|
-
|
|
65
|
+
o.setDate(o.getDate() + 1);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
function Zt(e, a, t) {
|
|
70
|
-
const n = [],
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
for (;
|
|
74
|
-
t(
|
|
70
|
+
const n = [], r = new Date(e), o = new Date(a);
|
|
71
|
+
r.setHours(0, 0, 0, 0), o.setHours(0, 0, 0, 0);
|
|
72
|
+
const i = new Date(r);
|
|
73
|
+
for (; i <= o; )
|
|
74
|
+
t(i) || n.push(new Date(i)), i.setDate(i.getDate() + 1);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
77
|
function ea(e, a, t) {
|
|
78
|
-
const n = [],
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
for (;
|
|
82
|
-
t(
|
|
78
|
+
const n = [], r = new Date(e), o = new Date(a);
|
|
79
|
+
r.setHours(0, 0, 0, 0), o.setHours(0, 0, 0, 0);
|
|
80
|
+
const i = new Date(r);
|
|
81
|
+
for (; i <= o; )
|
|
82
|
+
t(i) && n.push(new Date(i)), i.setDate(i.getDate() + 1);
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
85
|
function ta(e, a, t) {
|
|
86
|
-
const n = new Date(e),
|
|
87
|
-
n.setHours(0, 0, 0, 0),
|
|
88
|
-
let
|
|
89
|
-
const
|
|
90
|
-
for (
|
|
91
|
-
if (t(
|
|
92
|
-
return
|
|
93
|
-
|
|
86
|
+
const n = new Date(e), r = new Date(a);
|
|
87
|
+
n.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
88
|
+
let o = new Date(n);
|
|
89
|
+
const i = new Date(n);
|
|
90
|
+
for (i.setDate(i.getDate() + 1); i <= r; ) {
|
|
91
|
+
if (t(i))
|
|
92
|
+
return o;
|
|
93
|
+
o = new Date(i), i.setDate(i.getDate() + 1);
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return r;
|
|
96
96
|
}
|
|
97
97
|
function aa(e, a, t) {
|
|
98
|
-
const n = [],
|
|
99
|
-
|
|
100
|
-
let
|
|
101
|
-
const s = new Date(
|
|
102
|
-
for (; s <=
|
|
98
|
+
const n = [], r = new Date(e), o = new Date(a);
|
|
99
|
+
r.setHours(0, 0, 0, 0), o.setHours(0, 0, 0, 0);
|
|
100
|
+
let i = null;
|
|
101
|
+
const s = new Date(r);
|
|
102
|
+
for (; s <= o; ) {
|
|
103
103
|
if (!t(s))
|
|
104
|
-
|
|
105
|
-
else if (
|
|
104
|
+
i || (i = new Date(s));
|
|
105
|
+
else if (i) {
|
|
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: i, end: d }), i = null;
|
|
108
108
|
}
|
|
109
109
|
s.setDate(s.getDate() + 1);
|
|
110
110
|
}
|
|
111
|
-
return
|
|
111
|
+
return i && n.push({ start: i, end: new Date(o) }), n;
|
|
112
112
|
}
|
|
113
113
|
function ut(e) {
|
|
114
114
|
return pt(e, /* @__PURE__ */ new Date());
|
|
@@ -119,158 +119,158 @@ function pt(e, a) {
|
|
|
119
119
|
function na(e, a, t) {
|
|
120
120
|
return !a || !t ? !1 : e > a && e < t;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var ra = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
123
|
+
function ia(e) {
|
|
124
124
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
125
125
|
}
|
|
126
126
|
var gt = { exports: {} };
|
|
127
127
|
(function(e) {
|
|
128
128
|
(function(a, t) {
|
|
129
129
|
e.exports ? e.exports = t() : a.log = t();
|
|
130
|
-
})(
|
|
130
|
+
})(ra, function() {
|
|
131
131
|
var a = function() {
|
|
132
|
-
}, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent),
|
|
132
|
+
}, t = "undefined", n = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), r = [
|
|
133
133
|
"trace",
|
|
134
134
|
"debug",
|
|
135
135
|
"info",
|
|
136
136
|
"warn",
|
|
137
137
|
"error"
|
|
138
|
-
],
|
|
139
|
-
function s(
|
|
140
|
-
var
|
|
141
|
-
if (typeof
|
|
142
|
-
return
|
|
138
|
+
], o = {}, i = null;
|
|
139
|
+
function s(h, D) {
|
|
140
|
+
var m = h[D];
|
|
141
|
+
if (typeof m.bind == "function")
|
|
142
|
+
return m.bind(h);
|
|
143
143
|
try {
|
|
144
|
-
return Function.prototype.bind.call(
|
|
144
|
+
return Function.prototype.bind.call(m, h);
|
|
145
145
|
} catch {
|
|
146
146
|
return function() {
|
|
147
|
-
return Function.prototype.apply.apply(
|
|
147
|
+
return Function.prototype.apply.apply(m, [h, arguments]);
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
function d() {
|
|
152
152
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
153
153
|
}
|
|
154
|
-
function l(
|
|
155
|
-
return
|
|
154
|
+
function l(h) {
|
|
155
|
+
return h === "debug" && (h = "log"), typeof console === t ? !1 : h === "trace" && n ? d : console[h] !== void 0 ? s(console, h) : console.log !== void 0 ? s(console, "log") : a;
|
|
156
156
|
}
|
|
157
157
|
function c() {
|
|
158
|
-
for (var
|
|
159
|
-
var
|
|
160
|
-
this[
|
|
158
|
+
for (var h = this.getLevel(), D = 0; D < r.length; D++) {
|
|
159
|
+
var m = r[D];
|
|
160
|
+
this[m] = D < h ? a : this.methodFactory(m, h, this.name);
|
|
161
161
|
}
|
|
162
|
-
if (this.log = this.debug, typeof console === t &&
|
|
162
|
+
if (this.log = this.debug, typeof console === t && h < this.levels.SILENT)
|
|
163
163
|
return "No console available for logging";
|
|
164
164
|
}
|
|
165
|
-
function p(
|
|
165
|
+
function p(h) {
|
|
166
166
|
return function() {
|
|
167
|
-
typeof console !== t && (c.call(this), this[
|
|
167
|
+
typeof console !== t && (c.call(this), this[h].apply(this, arguments));
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function u(
|
|
171
|
-
return l(
|
|
170
|
+
function u(h, D, m) {
|
|
171
|
+
return l(h) || p.apply(this, arguments);
|
|
172
172
|
}
|
|
173
|
-
function g(
|
|
174
|
-
var
|
|
175
|
-
typeof
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
if (!(typeof window === t || !
|
|
173
|
+
function g(h, D) {
|
|
174
|
+
var m = this, C, I, S, v = "loglevel";
|
|
175
|
+
typeof h == "string" ? v += ":" + h : typeof h == "symbol" && (v = void 0);
|
|
176
|
+
function _(x) {
|
|
177
|
+
var E = (r[x] || "silent").toUpperCase();
|
|
178
|
+
if (!(typeof window === t || !v)) {
|
|
179
179
|
try {
|
|
180
|
-
window.localStorage[
|
|
180
|
+
window.localStorage[v] = E;
|
|
181
181
|
return;
|
|
182
182
|
} catch {
|
|
183
183
|
}
|
|
184
184
|
try {
|
|
185
|
-
window.document.cookie = encodeURIComponent(
|
|
185
|
+
window.document.cookie = encodeURIComponent(v) + "=" + E + ";";
|
|
186
186
|
} catch {
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (!(typeof window === t || !
|
|
190
|
+
function R() {
|
|
191
|
+
var x;
|
|
192
|
+
if (!(typeof window === t || !v)) {
|
|
193
193
|
try {
|
|
194
|
-
|
|
194
|
+
x = window.localStorage[v];
|
|
195
195
|
} catch {
|
|
196
196
|
}
|
|
197
|
-
if (typeof
|
|
197
|
+
if (typeof x === t)
|
|
198
198
|
try {
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
var E = window.document.cookie, k = encodeURIComponent(v), A = E.indexOf(k + "=");
|
|
200
|
+
A !== -1 && (x = /^([^;]+)/.exec(
|
|
201
|
+
E.slice(A + k.length + 1)
|
|
202
202
|
)[1]);
|
|
203
203
|
} catch {
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return m.levels[x] === void 0 && (x = void 0), x;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
if (!(typeof window === t || !
|
|
208
|
+
function L() {
|
|
209
|
+
if (!(typeof window === t || !v)) {
|
|
210
210
|
try {
|
|
211
|
-
window.localStorage.removeItem(
|
|
211
|
+
window.localStorage.removeItem(v);
|
|
212
212
|
} catch {
|
|
213
213
|
}
|
|
214
214
|
try {
|
|
215
|
-
window.document.cookie = encodeURIComponent(
|
|
215
|
+
window.document.cookie = encodeURIComponent(v) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
216
216
|
} catch {
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
var
|
|
222
|
-
if (typeof
|
|
223
|
-
return
|
|
224
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
220
|
+
function y(x) {
|
|
221
|
+
var E = x;
|
|
222
|
+
if (typeof E == "string" && m.levels[E.toUpperCase()] !== void 0 && (E = m.levels[E.toUpperCase()]), typeof E == "number" && E >= 0 && E <= m.levels.SILENT)
|
|
223
|
+
return E;
|
|
224
|
+
throw new TypeError("log.setLevel() called with invalid level: " + x);
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
m.name = h, m.levels = {
|
|
227
227
|
TRACE: 0,
|
|
228
228
|
DEBUG: 1,
|
|
229
229
|
INFO: 2,
|
|
230
230
|
WARN: 3,
|
|
231
231
|
ERROR: 4,
|
|
232
232
|
SILENT: 5
|
|
233
|
-
},
|
|
234
|
-
return
|
|
235
|
-
},
|
|
236
|
-
return
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
},
|
|
240
|
-
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
if (
|
|
247
|
-
for (var
|
|
248
|
-
|
|
249
|
-
},
|
|
250
|
-
|
|
233
|
+
}, m.methodFactory = D || u, m.getLevel = function() {
|
|
234
|
+
return S ?? I ?? C;
|
|
235
|
+
}, m.setLevel = function(x, E) {
|
|
236
|
+
return S = y(x), E !== !1 && _(S), c.call(m);
|
|
237
|
+
}, m.setDefaultLevel = function(x) {
|
|
238
|
+
I = y(x), R() || m.setLevel(x, !1);
|
|
239
|
+
}, m.resetLevel = function() {
|
|
240
|
+
S = null, L(), c.call(m);
|
|
241
|
+
}, m.enableAll = function(x) {
|
|
242
|
+
m.setLevel(m.levels.TRACE, x);
|
|
243
|
+
}, m.disableAll = function(x) {
|
|
244
|
+
m.setLevel(m.levels.SILENT, x);
|
|
245
|
+
}, m.rebuild = function() {
|
|
246
|
+
if (i !== m && (C = y(i.getLevel())), c.call(m), i === m)
|
|
247
|
+
for (var x in o)
|
|
248
|
+
o[x].rebuild();
|
|
249
|
+
}, C = y(
|
|
250
|
+
i ? i.getLevel() : "WARN"
|
|
251
251
|
);
|
|
252
|
-
var
|
|
253
|
-
|
|
252
|
+
var M = R();
|
|
253
|
+
M != null && (S = y(M)), c.call(m);
|
|
254
254
|
}
|
|
255
|
-
|
|
256
|
-
if (typeof
|
|
255
|
+
i = new g(), i.getLogger = function(D) {
|
|
256
|
+
if (typeof D != "symbol" && typeof D != "string" || D === "")
|
|
257
257
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
258
|
-
var
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
)),
|
|
258
|
+
var m = o[D];
|
|
259
|
+
return m || (m = o[D] = new g(
|
|
260
|
+
D,
|
|
261
|
+
i.methodFactory
|
|
262
|
+
)), m;
|
|
263
263
|
};
|
|
264
|
-
var
|
|
265
|
-
return
|
|
266
|
-
return typeof window !== t && window.log ===
|
|
267
|
-
},
|
|
268
|
-
return
|
|
269
|
-
},
|
|
264
|
+
var f = typeof window !== t ? window.log : void 0;
|
|
265
|
+
return i.noConflict = function() {
|
|
266
|
+
return typeof window !== t && window.log === i && (window.log = f), i;
|
|
267
|
+
}, i.getLoggers = function() {
|
|
268
|
+
return o;
|
|
269
|
+
}, i.default = i, i;
|
|
270
270
|
});
|
|
271
271
|
})(gt);
|
|
272
272
|
var oa = gt.exports;
|
|
273
|
-
const
|
|
273
|
+
const O = /* @__PURE__ */ ia(oa), sa = [
|
|
274
274
|
"DRP",
|
|
275
275
|
"DRP:RENDERING",
|
|
276
276
|
"DRP:INTERACTION",
|
|
@@ -290,39 +290,39 @@ const Y = /* @__PURE__ */ ra(oa), sa = [
|
|
|
290
290
|
// Orange
|
|
291
291
|
error: "#ef4444"
|
|
292
292
|
// Red
|
|
293
|
-
}, la =
|
|
294
|
-
const n = la.call(
|
|
295
|
-
return (...
|
|
296
|
-
const
|
|
293
|
+
}, la = O.methodFactory, ca = (e, a, t) => {
|
|
294
|
+
const n = la.call(O, e, a, t);
|
|
295
|
+
return (...r) => {
|
|
296
|
+
const o = da[e] || "#6b7280", s = `%c[${(/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
297
297
|
hour12: !1,
|
|
298
298
|
hour: "2-digit",
|
|
299
299
|
minute: "2-digit",
|
|
300
300
|
second: "2-digit",
|
|
301
301
|
fractionalSecondDigits: 3
|
|
302
302
|
})}] [${e.toUpperCase()}] ${t ? `[${t}]` : ""}`;
|
|
303
|
-
n(s, `color: ${
|
|
303
|
+
n(s, `color: ${o}`, ...r);
|
|
304
304
|
};
|
|
305
305
|
}, ht = [];
|
|
306
306
|
function Q(e) {
|
|
307
|
-
const a =
|
|
307
|
+
const a = O.getLogger(e);
|
|
308
308
|
return a.methodFactory = ca, a.setLevel("silent"), ht.push(a), a;
|
|
309
309
|
}
|
|
310
|
-
const
|
|
311
|
-
|
|
310
|
+
const T = Q("DRP"), de = Q("DRP:RENDERING"), oe = Q("DRP:INTERACTION"), ie = Q("DRP:SELECTION"), w = Q("DRP:NAVIGATION"), H = Q("DRP:UI"), ee = Q("DRP:VALIDATION"), U = Q("DRP:DRAG");
|
|
311
|
+
O.setLevel("silent");
|
|
312
312
|
const We = (e) => {
|
|
313
|
-
|
|
313
|
+
O.setLevel(e), ht.forEach((a) => a.setLevel(e));
|
|
314
314
|
}, ft = () => {
|
|
315
315
|
We("debug");
|
|
316
316
|
}, mt = () => {
|
|
317
317
|
We("silent");
|
|
318
318
|
}, ua = (e, a = "debug") => {
|
|
319
319
|
const n = {
|
|
320
|
-
DRP:
|
|
320
|
+
DRP: T,
|
|
321
321
|
"DRP:RENDERING": de,
|
|
322
322
|
"DRP:INTERACTION": oe,
|
|
323
|
-
"DRP:SELECTION":
|
|
323
|
+
"DRP:SELECTION": ie,
|
|
324
324
|
"DRP:NAVIGATION": w,
|
|
325
|
-
"DRP:UI":
|
|
325
|
+
"DRP:UI": H,
|
|
326
326
|
"DRP:VALIDATION": ee,
|
|
327
327
|
"DRP:DRAG": U
|
|
328
328
|
}[e];
|
|
@@ -366,23 +366,23 @@ function Ge(e) {
|
|
|
366
366
|
}
|
|
367
367
|
function ma(e, a, t) {
|
|
368
368
|
t === void 0 && (t = !1);
|
|
369
|
-
const n = we(e),
|
|
370
|
-
let
|
|
371
|
-
return a.reference[
|
|
369
|
+
const n = we(e), r = Ge(e), o = Ke(r);
|
|
370
|
+
let i = r === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
|
+
return a.reference[o] > a.floating[o] && (i = Ee(i)), [i, Ee(i)];
|
|
372
372
|
}
|
|
373
373
|
function ba(e) {
|
|
374
374
|
const a = Ee(e);
|
|
375
|
-
return [
|
|
375
|
+
return [Ye(e), a, Ye(a)];
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function Ye(e) {
|
|
378
378
|
return e.replace(/start|end/g, (a) => ha[a]);
|
|
379
379
|
}
|
|
380
|
-
const nt = ["left", "right"],
|
|
380
|
+
const nt = ["left", "right"], rt = ["right", "left"], ya = ["top", "bottom"], va = ["bottom", "top"];
|
|
381
381
|
function Da(e, a, t) {
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "top":
|
|
384
384
|
case "bottom":
|
|
385
|
-
return t ? a ?
|
|
385
|
+
return t ? a ? rt : nt : a ? nt : rt;
|
|
386
386
|
case "left":
|
|
387
387
|
case "right":
|
|
388
388
|
return a ? ya : va;
|
|
@@ -391,9 +391,9 @@ function Da(e, a, t) {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
function _a(e, a, t, n) {
|
|
394
|
-
const
|
|
395
|
-
let
|
|
396
|
-
return
|
|
394
|
+
const r = we(e);
|
|
395
|
+
let o = Da(ne(e), t === "start", n);
|
|
396
|
+
return r && (o = o.map((i) => i + "-" + r), a && (o = o.concat(o.map(Ye)))), o;
|
|
397
397
|
}
|
|
398
398
|
function Ee(e) {
|
|
399
399
|
return e.replace(/left|right|bottom|top/g, (a) => ga[a]);
|
|
@@ -420,31 +420,31 @@ function Re(e) {
|
|
|
420
420
|
x: a,
|
|
421
421
|
y: t,
|
|
422
422
|
width: n,
|
|
423
|
-
height:
|
|
423
|
+
height: r
|
|
424
424
|
} = e;
|
|
425
425
|
return {
|
|
426
426
|
width: n,
|
|
427
|
-
height:
|
|
427
|
+
height: r,
|
|
428
428
|
top: t,
|
|
429
429
|
left: a,
|
|
430
430
|
right: a + n,
|
|
431
|
-
bottom: t +
|
|
431
|
+
bottom: t + r,
|
|
432
432
|
x: a,
|
|
433
433
|
y: t
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function it(e, a, t) {
|
|
437
437
|
let {
|
|
438
438
|
reference: n,
|
|
439
|
-
floating:
|
|
439
|
+
floating: r
|
|
440
440
|
} = e;
|
|
441
|
-
const
|
|
441
|
+
const o = X(a), i = Ge(a), s = Ke(i), d = ne(a), l = o === "y", c = n.x + n.width / 2 - r.width / 2, p = n.y + n.height / 2 - r.height / 2, u = n[s] / 2 - r[s] / 2;
|
|
442
442
|
let g;
|
|
443
443
|
switch (d) {
|
|
444
444
|
case "top":
|
|
445
445
|
g = {
|
|
446
446
|
x: c,
|
|
447
|
-
y: n.y -
|
|
447
|
+
y: n.y - r.height
|
|
448
448
|
};
|
|
449
449
|
break;
|
|
450
450
|
case "bottom":
|
|
@@ -461,7 +461,7 @@ function rt(e, a, t) {
|
|
|
461
461
|
break;
|
|
462
462
|
case "left":
|
|
463
463
|
g = {
|
|
464
|
-
x: n.x -
|
|
464
|
+
x: n.x - r.width,
|
|
465
465
|
y: p
|
|
466
466
|
};
|
|
467
467
|
break;
|
|
@@ -473,10 +473,10 @@ function rt(e, a, t) {
|
|
|
473
473
|
}
|
|
474
474
|
switch (we(a)) {
|
|
475
475
|
case "start":
|
|
476
|
-
g[
|
|
476
|
+
g[i] -= u * (t && l ? -1 : 1);
|
|
477
477
|
break;
|
|
478
478
|
case "end":
|
|
479
|
-
g[
|
|
479
|
+
g[i] += u * (t && l ? -1 : 1);
|
|
480
480
|
break;
|
|
481
481
|
}
|
|
482
482
|
return g;
|
|
@@ -484,61 +484,61 @@ function rt(e, a, t) {
|
|
|
484
484
|
const xa = async (e, a, t) => {
|
|
485
485
|
const {
|
|
486
486
|
placement: n = "bottom",
|
|
487
|
-
strategy:
|
|
488
|
-
middleware:
|
|
489
|
-
platform:
|
|
490
|
-
} = t, s =
|
|
491
|
-
let l = await
|
|
487
|
+
strategy: r = "absolute",
|
|
488
|
+
middleware: o = [],
|
|
489
|
+
platform: i
|
|
490
|
+
} = t, s = o.filter(Boolean), d = await (i.isRTL == null ? void 0 : i.isRTL(a));
|
|
491
|
+
let l = await i.getElementRects({
|
|
492
492
|
reference: e,
|
|
493
493
|
floating: a,
|
|
494
|
-
strategy:
|
|
494
|
+
strategy: r
|
|
495
495
|
}), {
|
|
496
496
|
x: c,
|
|
497
497
|
y: p
|
|
498
|
-
} =
|
|
499
|
-
for (let
|
|
498
|
+
} = it(l, n, d), u = n, g = {}, f = 0;
|
|
499
|
+
for (let h = 0; h < s.length; h++) {
|
|
500
500
|
const {
|
|
501
|
-
name:
|
|
502
|
-
fn:
|
|
503
|
-
} = s[
|
|
504
|
-
x:
|
|
505
|
-
y:
|
|
506
|
-
data:
|
|
507
|
-
reset:
|
|
508
|
-
} = await
|
|
501
|
+
name: D,
|
|
502
|
+
fn: m
|
|
503
|
+
} = s[h], {
|
|
504
|
+
x: C,
|
|
505
|
+
y: I,
|
|
506
|
+
data: S,
|
|
507
|
+
reset: v
|
|
508
|
+
} = await m({
|
|
509
509
|
x: c,
|
|
510
510
|
y: p,
|
|
511
511
|
initialPlacement: n,
|
|
512
512
|
placement: u,
|
|
513
|
-
strategy:
|
|
513
|
+
strategy: r,
|
|
514
514
|
middlewareData: g,
|
|
515
515
|
rects: l,
|
|
516
|
-
platform:
|
|
516
|
+
platform: i,
|
|
517
517
|
elements: {
|
|
518
518
|
reference: e,
|
|
519
519
|
floating: a
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
|
-
c =
|
|
522
|
+
c = C ?? c, p = I ?? p, g = {
|
|
523
523
|
...g,
|
|
524
|
-
[
|
|
525
|
-
...g[
|
|
526
|
-
...
|
|
524
|
+
[D]: {
|
|
525
|
+
...g[D],
|
|
526
|
+
...S
|
|
527
527
|
}
|
|
528
|
-
},
|
|
528
|
+
}, v && f <= 50 && (f++, typeof v == "object" && (v.placement && (u = v.placement), v.rects && (l = v.rects === !0 ? await i.getElementRects({
|
|
529
529
|
reference: e,
|
|
530
530
|
floating: a,
|
|
531
|
-
strategy:
|
|
532
|
-
}) :
|
|
531
|
+
strategy: r
|
|
532
|
+
}) : v.rects), {
|
|
533
533
|
x: c,
|
|
534
534
|
y: p
|
|
535
|
-
} =
|
|
535
|
+
} = it(l, u, d)), h = -1);
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
538
|
x: c,
|
|
539
539
|
y: p,
|
|
540
540
|
placement: u,
|
|
541
|
-
strategy:
|
|
541
|
+
strategy: r,
|
|
542
542
|
middlewareData: g
|
|
543
543
|
};
|
|
544
544
|
};
|
|
@@ -547,9 +547,9 @@ async function vt(e, a) {
|
|
|
547
547
|
a === void 0 && (a = {});
|
|
548
548
|
const {
|
|
549
549
|
x: n,
|
|
550
|
-
y:
|
|
551
|
-
platform:
|
|
552
|
-
rects:
|
|
550
|
+
y: r,
|
|
551
|
+
platform: o,
|
|
552
|
+
rects: i,
|
|
553
553
|
elements: s,
|
|
554
554
|
strategy: d
|
|
555
555
|
} = e, {
|
|
@@ -558,33 +558,33 @@ async function vt(e, a) {
|
|
|
558
558
|
elementContext: p = "floating",
|
|
559
559
|
altBoundary: u = !1,
|
|
560
560
|
padding: g = 0
|
|
561
|
-
} = _e(a, e),
|
|
562
|
-
element: (t = await (
|
|
561
|
+
} = _e(a, e), f = yt(g), D = s[u ? p === "floating" ? "reference" : "floating" : p], m = Re(await o.getClippingRect({
|
|
562
|
+
element: (t = await (o.isElement == null ? void 0 : o.isElement(D))) == null || t ? D : D.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(s.floating)),
|
|
563
563
|
boundary: l,
|
|
564
564
|
rootBoundary: c,
|
|
565
565
|
strategy: d
|
|
566
|
-
})),
|
|
566
|
+
})), C = p === "floating" ? {
|
|
567
567
|
x: n,
|
|
568
|
-
y:
|
|
569
|
-
width:
|
|
570
|
-
height:
|
|
571
|
-
} :
|
|
568
|
+
y: r,
|
|
569
|
+
width: i.floating.width,
|
|
570
|
+
height: i.floating.height
|
|
571
|
+
} : i.reference, I = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(s.floating)), S = await (o.isElement == null ? void 0 : o.isElement(I)) ? await (o.getScale == null ? void 0 : o.getScale(I)) || {
|
|
572
572
|
x: 1,
|
|
573
573
|
y: 1
|
|
574
574
|
} : {
|
|
575
575
|
x: 1,
|
|
576
576
|
y: 1
|
|
577
|
-
},
|
|
577
|
+
}, v = Re(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
578
578
|
elements: s,
|
|
579
|
-
rect:
|
|
580
|
-
offsetParent:
|
|
579
|
+
rect: C,
|
|
580
|
+
offsetParent: I,
|
|
581
581
|
strategy: d
|
|
582
|
-
}) :
|
|
582
|
+
}) : C);
|
|
583
583
|
return {
|
|
584
|
-
top: (
|
|
585
|
-
bottom: (
|
|
586
|
-
left: (
|
|
587
|
-
right: (
|
|
584
|
+
top: (m.top - v.top + f.top) / S.y,
|
|
585
|
+
bottom: (v.bottom - m.bottom + f.bottom) / S.y,
|
|
586
|
+
left: (m.left - v.left + f.left) / S.x,
|
|
587
|
+
right: (v.right - m.right + f.right) / S.x
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
const Ma = (e) => ({
|
|
@@ -594,9 +594,9 @@ const Ma = (e) => ({
|
|
|
594
594
|
const {
|
|
595
595
|
x: t,
|
|
596
596
|
y: n,
|
|
597
|
-
placement:
|
|
598
|
-
rects:
|
|
599
|
-
platform:
|
|
597
|
+
placement: r,
|
|
598
|
+
rects: o,
|
|
599
|
+
platform: i,
|
|
600
600
|
elements: s,
|
|
601
601
|
middlewareData: d
|
|
602
602
|
} = a, {
|
|
@@ -608,17 +608,17 @@ const Ma = (e) => ({
|
|
|
608
608
|
const p = yt(c), u = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
}, g = Ge(
|
|
612
|
-
let
|
|
613
|
-
(!
|
|
614
|
-
const
|
|
611
|
+
}, g = Ge(r), f = Ke(g), h = await i.getDimensions(l), D = g === "y", m = D ? "top" : "left", C = D ? "bottom" : "right", I = D ? "clientHeight" : "clientWidth", S = o.reference[f] + o.reference[g] - u[g] - o.floating[f], v = u[g] - o.reference[g], _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
|
|
612
|
+
let R = _ ? _[I] : 0;
|
|
613
|
+
(!R || !await (i.isElement == null ? void 0 : i.isElement(_))) && (R = s.floating[I] || o.floating[f]);
|
|
614
|
+
const L = S / 2 - v / 2, y = R / 2 - h[f] / 2 - 1, M = le(p[m], y), x = le(p[C], y), E = M, k = R - h[f] - x, A = R / 2 - h[f] / 2 + L, $ = Be(E, A, k), N = !d.arrow && we(r) != null && A !== $ && o.reference[f] / 2 - (A < E ? M : x) - h[f] / 2 < 0, z = N ? A < E ? A - E : A - k : 0;
|
|
615
615
|
return {
|
|
616
|
-
[g]: u[g] +
|
|
616
|
+
[g]: u[g] + z,
|
|
617
617
|
data: {
|
|
618
|
-
[g]:
|
|
619
|
-
centerOffset:
|
|
618
|
+
[g]: $,
|
|
619
|
+
centerOffset: A - $ - z,
|
|
620
620
|
...N && {
|
|
621
|
-
alignmentOffset:
|
|
621
|
+
alignmentOffset: z
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
624
|
reset: N
|
|
@@ -631,9 +631,9 @@ const Ma = (e) => ({
|
|
|
631
631
|
async fn(a) {
|
|
632
632
|
var t, n;
|
|
633
633
|
const {
|
|
634
|
-
placement:
|
|
635
|
-
middlewareData:
|
|
636
|
-
rects:
|
|
634
|
+
placement: r,
|
|
635
|
+
middlewareData: o,
|
|
636
|
+
rects: i,
|
|
637
637
|
initialPlacement: s,
|
|
638
638
|
platform: d,
|
|
639
639
|
elements: l
|
|
@@ -642,60 +642,60 @@ const Ma = (e) => ({
|
|
|
642
642
|
crossAxis: p = !0,
|
|
643
643
|
fallbackPlacements: u,
|
|
644
644
|
fallbackStrategy: g = "bestFit",
|
|
645
|
-
fallbackAxisSideDirection:
|
|
646
|
-
flipAlignment:
|
|
647
|
-
...
|
|
645
|
+
fallbackAxisSideDirection: f = "none",
|
|
646
|
+
flipAlignment: h = !0,
|
|
647
|
+
...D
|
|
648
648
|
} = _e(e, a);
|
|
649
|
-
if ((t =
|
|
649
|
+
if ((t = o.arrow) != null && t.alignmentOffset)
|
|
650
650
|
return {};
|
|
651
|
-
const
|
|
652
|
-
!u &&
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
if (c &&
|
|
656
|
-
const
|
|
657
|
-
|
|
651
|
+
const m = ne(r), C = X(s), I = ne(s) === s, S = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), v = u || (I || !h ? [Ee(s)] : ba(s)), _ = f !== "none";
|
|
652
|
+
!u && _ && v.push(..._a(s, h, f, S));
|
|
653
|
+
const R = [s, ...v], L = await vt(a, D), y = [];
|
|
654
|
+
let M = ((n = o.flip) == null ? void 0 : n.overflows) || [];
|
|
655
|
+
if (c && y.push(L[m]), p) {
|
|
656
|
+
const A = ma(r, i, S);
|
|
657
|
+
y.push(L[A[0]], L[A[1]]);
|
|
658
658
|
}
|
|
659
|
-
if (
|
|
660
|
-
placement:
|
|
661
|
-
overflows:
|
|
662
|
-
}], !
|
|
663
|
-
var
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
659
|
+
if (M = [...M, {
|
|
660
|
+
placement: r,
|
|
661
|
+
overflows: y
|
|
662
|
+
}], !y.every((A) => A <= 0)) {
|
|
663
|
+
var x, E;
|
|
664
|
+
const A = (((x = o.flip) == null ? void 0 : x.index) || 0) + 1, $ = R[A];
|
|
665
|
+
if ($ && (!(p === "alignment" ? C !== X($) : !1) || // We leave the current main axis only if every placement on that axis
|
|
666
666
|
// overflows the main axis.
|
|
667
|
-
|
|
667
|
+
M.every((P) => X(P.placement) === C ? P.overflows[0] > 0 : !0)))
|
|
668
668
|
return {
|
|
669
669
|
data: {
|
|
670
|
-
index:
|
|
671
|
-
overflows:
|
|
670
|
+
index: A,
|
|
671
|
+
overflows: M
|
|
672
672
|
},
|
|
673
673
|
reset: {
|
|
674
|
-
placement:
|
|
674
|
+
placement: $
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
let N = (
|
|
677
|
+
let N = (E = M.filter((z) => z.overflows[0] <= 0).sort((z, P) => z.overflows[1] - P.overflows[1])[0]) == null ? void 0 : E.placement;
|
|
678
678
|
if (!N)
|
|
679
679
|
switch (g) {
|
|
680
680
|
case "bestFit": {
|
|
681
|
-
var
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
681
|
+
var k;
|
|
682
|
+
const z = (k = M.filter((P) => {
|
|
683
|
+
if (_) {
|
|
684
684
|
const V = X(P.placement);
|
|
685
|
-
return V ===
|
|
685
|
+
return V === C || // Create a bias to the `y` side axis due to horizontal
|
|
686
686
|
// reading directions favoring greater width.
|
|
687
687
|
V === "y";
|
|
688
688
|
}
|
|
689
689
|
return !0;
|
|
690
|
-
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 :
|
|
691
|
-
|
|
690
|
+
}).map((P) => [P.placement, P.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((P, V) => P[1] - V[1])[0]) == null ? void 0 : k[0];
|
|
691
|
+
z && (N = z);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
694
694
|
case "initialPlacement":
|
|
695
695
|
N = s;
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
|
-
if (
|
|
698
|
+
if (r !== N)
|
|
699
699
|
return {
|
|
700
700
|
reset: {
|
|
701
701
|
placement: N
|
|
@@ -710,12 +710,12 @@ async function Ia(e, a) {
|
|
|
710
710
|
const {
|
|
711
711
|
placement: t,
|
|
712
712
|
platform: n,
|
|
713
|
-
elements:
|
|
714
|
-
} = e,
|
|
713
|
+
elements: r
|
|
714
|
+
} = e, o = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = ne(t), s = we(t), d = X(t) === "y", l = Ca.has(i) ? -1 : 1, c = o && d ? -1 : 1, p = _e(a, e);
|
|
715
715
|
let {
|
|
716
716
|
mainAxis: u,
|
|
717
717
|
crossAxis: g,
|
|
718
|
-
alignmentAxis:
|
|
718
|
+
alignmentAxis: f
|
|
719
719
|
} = typeof p == "number" ? {
|
|
720
720
|
mainAxis: p,
|
|
721
721
|
crossAxis: 0,
|
|
@@ -725,7 +725,7 @@ async function Ia(e, a) {
|
|
|
725
725
|
crossAxis: p.crossAxis || 0,
|
|
726
726
|
alignmentAxis: p.alignmentAxis
|
|
727
727
|
};
|
|
728
|
-
return s && typeof
|
|
728
|
+
return s && typeof f == "number" && (g = s === "end" ? f * -1 : f), d ? {
|
|
729
729
|
x: g * c,
|
|
730
730
|
y: u * l
|
|
731
731
|
} : {
|
|
@@ -740,17 +740,17 @@ const Ea = function(e) {
|
|
|
740
740
|
async fn(a) {
|
|
741
741
|
var t, n;
|
|
742
742
|
const {
|
|
743
|
-
x:
|
|
744
|
-
y:
|
|
745
|
-
placement:
|
|
743
|
+
x: r,
|
|
744
|
+
y: o,
|
|
745
|
+
placement: i,
|
|
746
746
|
middlewareData: s
|
|
747
747
|
} = a, d = await Ia(a, e);
|
|
748
|
-
return
|
|
749
|
-
x:
|
|
750
|
-
y:
|
|
748
|
+
return i === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
749
|
+
x: r + d.x,
|
|
750
|
+
y: o + d.y,
|
|
751
751
|
data: {
|
|
752
752
|
...d,
|
|
753
|
-
placement:
|
|
753
|
+
placement: i
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
756
|
}
|
|
@@ -763,19 +763,19 @@ const Ea = function(e) {
|
|
|
763
763
|
const {
|
|
764
764
|
x: t,
|
|
765
765
|
y: n,
|
|
766
|
-
placement:
|
|
766
|
+
placement: r
|
|
767
767
|
} = a, {
|
|
768
|
-
mainAxis:
|
|
769
|
-
crossAxis:
|
|
768
|
+
mainAxis: o = !0,
|
|
769
|
+
crossAxis: i = !1,
|
|
770
770
|
limiter: s = {
|
|
771
|
-
fn: (
|
|
771
|
+
fn: (D) => {
|
|
772
772
|
let {
|
|
773
|
-
x:
|
|
774
|
-
y:
|
|
775
|
-
} =
|
|
773
|
+
x: m,
|
|
774
|
+
y: C
|
|
775
|
+
} = D;
|
|
776
776
|
return {
|
|
777
|
-
x:
|
|
778
|
-
y:
|
|
777
|
+
x: m,
|
|
778
|
+
y: C
|
|
779
779
|
};
|
|
780
780
|
}
|
|
781
781
|
},
|
|
@@ -783,36 +783,36 @@ const Ea = function(e) {
|
|
|
783
783
|
} = _e(e, a), l = {
|
|
784
784
|
x: t,
|
|
785
785
|
y: n
|
|
786
|
-
}, c = await vt(a, d), p = X(ne(
|
|
787
|
-
let g = l[u],
|
|
788
|
-
if (r) {
|
|
789
|
-
const y = u === "y" ? "top" : "left", h = u === "y" ? "bottom" : "right", M = g + c[y], C = g - c[h];
|
|
790
|
-
g = Be(M, g, C);
|
|
791
|
-
}
|
|
786
|
+
}, c = await vt(a, d), p = X(ne(r)), u = bt(p);
|
|
787
|
+
let g = l[u], f = l[p];
|
|
792
788
|
if (o) {
|
|
793
|
-
const
|
|
794
|
-
|
|
789
|
+
const D = u === "y" ? "top" : "left", m = u === "y" ? "bottom" : "right", C = g + c[D], I = g - c[m];
|
|
790
|
+
g = Be(C, g, I);
|
|
791
|
+
}
|
|
792
|
+
if (i) {
|
|
793
|
+
const D = p === "y" ? "top" : "left", m = p === "y" ? "bottom" : "right", C = f + c[D], I = f - c[m];
|
|
794
|
+
f = Be(C, f, I);
|
|
795
795
|
}
|
|
796
|
-
const
|
|
796
|
+
const h = s.fn({
|
|
797
797
|
...a,
|
|
798
798
|
[u]: g,
|
|
799
|
-
[p]:
|
|
799
|
+
[p]: f
|
|
800
800
|
});
|
|
801
801
|
return {
|
|
802
|
-
...
|
|
802
|
+
...h,
|
|
803
803
|
data: {
|
|
804
|
-
x:
|
|
805
|
-
y:
|
|
804
|
+
x: h.x - t,
|
|
805
|
+
y: h.y - n,
|
|
806
806
|
enabled: {
|
|
807
|
-
[u]:
|
|
808
|
-
[p]:
|
|
807
|
+
[u]: o,
|
|
808
|
+
[p]: i
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
812
|
}
|
|
813
813
|
};
|
|
814
814
|
};
|
|
815
|
-
function
|
|
815
|
+
function ze() {
|
|
816
816
|
return typeof window < "u";
|
|
817
817
|
}
|
|
818
818
|
function ge(e) {
|
|
@@ -827,16 +827,16 @@ function G(e) {
|
|
|
827
827
|
return (a = (Dt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : a.documentElement;
|
|
828
828
|
}
|
|
829
829
|
function Dt(e) {
|
|
830
|
-
return
|
|
830
|
+
return ze() ? e instanceof Node || e instanceof F(e).Node : !1;
|
|
831
831
|
}
|
|
832
832
|
function B(e) {
|
|
833
|
-
return
|
|
833
|
+
return ze() ? e instanceof Element || e instanceof F(e).Element : !1;
|
|
834
834
|
}
|
|
835
835
|
function K(e) {
|
|
836
|
-
return
|
|
836
|
+
return ze() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
|
|
837
837
|
}
|
|
838
838
|
function ot(e) {
|
|
839
|
-
return !
|
|
839
|
+
return !ze() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
|
|
840
840
|
}
|
|
841
841
|
const Aa = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
842
842
|
function xe(e) {
|
|
@@ -844,16 +844,16 @@ function xe(e) {
|
|
|
844
844
|
overflow: a,
|
|
845
845
|
overflowX: t,
|
|
846
846
|
overflowY: n,
|
|
847
|
-
display:
|
|
848
|
-
} =
|
|
849
|
-
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(
|
|
847
|
+
display: r
|
|
848
|
+
} = Y(e);
|
|
849
|
+
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(r);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
853
|
-
return
|
|
851
|
+
const ka = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
+
function La(e) {
|
|
853
|
+
return ka.has(ge(e));
|
|
854
854
|
}
|
|
855
855
|
const Ta = [":popover-open", ":modal"];
|
|
856
|
-
function
|
|
856
|
+
function Pe(e) {
|
|
857
857
|
return Ta.some((a) => {
|
|
858
858
|
try {
|
|
859
859
|
return e.matches(a);
|
|
@@ -862,17 +862,17 @@ function ze(e) {
|
|
|
862
862
|
}
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
|
-
const $a = ["transform", "translate", "scale", "rotate", "perspective"],
|
|
865
|
+
const $a = ["transform", "translate", "scale", "rotate", "perspective"], za = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Pa = ["paint", "layout", "strict", "content"];
|
|
866
866
|
function Xe(e) {
|
|
867
|
-
const a = Je(), t = B(e) ?
|
|
868
|
-
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) ||
|
|
867
|
+
const a = Je(), t = B(e) ? Y(e) : e;
|
|
868
|
+
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || za.some((n) => (t.willChange || "").includes(n)) || Pa.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
870
|
function Na(e) {
|
|
871
871
|
let a = J(e);
|
|
872
872
|
for (; K(a) && !ce(a); ) {
|
|
873
873
|
if (Xe(a))
|
|
874
874
|
return a;
|
|
875
|
-
if (
|
|
875
|
+
if (Pe(a))
|
|
876
876
|
return null;
|
|
877
877
|
a = J(a);
|
|
878
878
|
}
|
|
@@ -885,7 +885,7 @@ const Fa = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
|
885
885
|
function ce(e) {
|
|
886
886
|
return Fa.has(ge(e));
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Y(e) {
|
|
889
889
|
return F(e).getComputedStyle(e);
|
|
890
890
|
}
|
|
891
891
|
function Ne(e) {
|
|
@@ -916,21 +916,21 @@ function _t(e) {
|
|
|
916
916
|
function ue(e, a, t) {
|
|
917
917
|
var n;
|
|
918
918
|
a === void 0 && (a = []), t === void 0 && (t = !0);
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
921
|
-
const s = Ve(
|
|
922
|
-
return a.concat(
|
|
919
|
+
const r = _t(e), o = r === ((n = e.ownerDocument) == null ? void 0 : n.body), i = F(r);
|
|
920
|
+
if (o) {
|
|
921
|
+
const s = Ve(i);
|
|
922
|
+
return a.concat(i, i.visualViewport || [], xe(r) ? r : [], s && t ? ue(s) : []);
|
|
923
923
|
}
|
|
924
|
-
return a.concat(
|
|
924
|
+
return a.concat(r, ue(r, [], t));
|
|
925
925
|
}
|
|
926
926
|
function Ve(e) {
|
|
927
927
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
928
928
|
}
|
|
929
929
|
function wt(e) {
|
|
930
|
-
const a =
|
|
930
|
+
const a = Y(e);
|
|
931
931
|
let t = parseFloat(a.width) || 0, n = parseFloat(a.height) || 0;
|
|
932
|
-
const
|
|
933
|
-
return s && (t =
|
|
932
|
+
const r = K(e), o = r ? e.offsetWidth : t, i = r ? e.offsetHeight : n, s = Ie(t) !== o || Ie(n) !== i;
|
|
933
|
+
return s && (t = o, n = i), {
|
|
934
934
|
width: t,
|
|
935
935
|
height: n,
|
|
936
936
|
$: s
|
|
@@ -945,39 +945,39 @@ function se(e) {
|
|
|
945
945
|
return W(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
947
947
|
width: n,
|
|
948
|
-
height:
|
|
949
|
-
$:
|
|
948
|
+
height: r,
|
|
949
|
+
$: o
|
|
950
950
|
} = wt(a);
|
|
951
|
-
let
|
|
952
|
-
return (!
|
|
953
|
-
x:
|
|
951
|
+
let i = (o ? Ie(t.width) : t.width) / n, s = (o ? Ie(t.height) : t.height) / r;
|
|
952
|
+
return (!i || !Number.isFinite(i)) && (i = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
953
|
+
x: i,
|
|
954
954
|
y: s
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
const
|
|
957
|
+
const Ha = /* @__PURE__ */ W(0);
|
|
958
958
|
function xt(e) {
|
|
959
959
|
const a = F(e);
|
|
960
|
-
return !Je() || !a.visualViewport ?
|
|
960
|
+
return !Je() || !a.visualViewport ? Ha : {
|
|
961
961
|
x: a.visualViewport.offsetLeft,
|
|
962
962
|
y: a.visualViewport.offsetTop
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
|
-
function
|
|
965
|
+
function Oa(e, a, t) {
|
|
966
966
|
return a === void 0 && (a = !1), !t || a && t !== F(e) ? !1 : a;
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function re(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const
|
|
971
|
-
let
|
|
972
|
-
a && (n ? B(n) && (
|
|
973
|
-
const s =
|
|
974
|
-
let d = (
|
|
975
|
-
if (
|
|
976
|
-
const u = F(
|
|
977
|
-
let
|
|
978
|
-
for (;
|
|
979
|
-
const
|
|
980
|
-
d *=
|
|
970
|
+
const r = e.getBoundingClientRect(), o = Qe(e);
|
|
971
|
+
let i = W(1);
|
|
972
|
+
a && (n ? B(n) && (i = se(n)) : i = se(e));
|
|
973
|
+
const s = Oa(o, t, n) ? xt(o) : W(0);
|
|
974
|
+
let d = (r.left + s.x) / i.x, l = (r.top + s.y) / i.y, c = r.width / i.x, p = r.height / i.y;
|
|
975
|
+
if (o) {
|
|
976
|
+
const u = F(o), g = n && B(n) ? F(n) : n;
|
|
977
|
+
let f = u, h = Ve(f);
|
|
978
|
+
for (; h && n && g !== f; ) {
|
|
979
|
+
const D = se(h), m = h.getBoundingClientRect(), C = Y(h), I = m.left + (h.clientLeft + parseFloat(C.paddingLeft)) * D.x, S = m.top + (h.clientTop + parseFloat(C.paddingTop)) * D.y;
|
|
980
|
+
d *= D.x, l *= D.y, c *= D.x, p *= D.y, d += I, l += S, f = F(h), h = Ve(f);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
return Re({
|
|
@@ -989,13 +989,13 @@ function ie(e, a, t, n) {
|
|
|
989
989
|
}
|
|
990
990
|
function Fe(e, a) {
|
|
991
991
|
const t = Ne(e).scrollLeft;
|
|
992
|
-
return a ? a.left + t :
|
|
992
|
+
return a ? a.left + t : re(G(e)).left + t;
|
|
993
993
|
}
|
|
994
994
|
function Mt(e, a) {
|
|
995
|
-
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Fe(e, t),
|
|
995
|
+
const t = e.getBoundingClientRect(), n = t.left + a.scrollLeft - Fe(e, t), r = t.top + a.scrollTop;
|
|
996
996
|
return {
|
|
997
997
|
x: n,
|
|
998
|
-
y:
|
|
998
|
+
y: r
|
|
999
999
|
};
|
|
1000
1000
|
}
|
|
1001
1001
|
function Ba(e) {
|
|
@@ -1003,21 +1003,21 @@ function Ba(e) {
|
|
|
1003
1003
|
elements: a,
|
|
1004
1004
|
rect: t,
|
|
1005
1005
|
offsetParent: n,
|
|
1006
|
-
strategy:
|
|
1006
|
+
strategy: r
|
|
1007
1007
|
} = e;
|
|
1008
|
-
const
|
|
1009
|
-
if (n ===
|
|
1008
|
+
const o = r === "fixed", i = G(n), s = a ? Pe(a.floating) : !1;
|
|
1009
|
+
if (n === i || s && o)
|
|
1010
1010
|
return t;
|
|
1011
1011
|
let d = {
|
|
1012
1012
|
scrollLeft: 0,
|
|
1013
1013
|
scrollTop: 0
|
|
1014
1014
|
}, l = W(1);
|
|
1015
1015
|
const c = W(0), p = K(n);
|
|
1016
|
-
if ((p || !p && !
|
|
1017
|
-
const g =
|
|
1016
|
+
if ((p || !p && !o) && ((ge(n) !== "body" || xe(i)) && (d = Ne(n)), K(n))) {
|
|
1017
|
+
const g = re(n);
|
|
1018
1018
|
l = se(n), c.x = g.x + n.clientLeft, c.y = g.y + n.clientTop;
|
|
1019
1019
|
}
|
|
1020
|
-
const u =
|
|
1020
|
+
const u = i && !p && !o ? Mt(i, d) : W(0);
|
|
1021
1021
|
return {
|
|
1022
1022
|
width: t.width * l.x,
|
|
1023
1023
|
height: t.height * l.y,
|
|
@@ -1025,46 +1025,46 @@ function Ba(e) {
|
|
|
1025
1025
|
y: t.y * l.y - d.scrollTop * l.y + c.y + u.y
|
|
1026
1026
|
};
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function Ya(e) {
|
|
1029
1029
|
return Array.from(e.getClientRects());
|
|
1030
1030
|
}
|
|
1031
1031
|
function Va(e) {
|
|
1032
|
-
const a = G(e), t = Ne(e), n = e.ownerDocument.body,
|
|
1033
|
-
let
|
|
1032
|
+
const a = G(e), t = Ne(e), n = e.ownerDocument.body, r = te(a.scrollWidth, a.clientWidth, n.scrollWidth, n.clientWidth), o = te(a.scrollHeight, a.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1033
|
+
let i = -t.scrollLeft + Fe(e);
|
|
1034
1034
|
const s = -t.scrollTop;
|
|
1035
|
-
return
|
|
1036
|
-
width:
|
|
1037
|
-
height:
|
|
1038
|
-
x:
|
|
1035
|
+
return Y(n).direction === "rtl" && (i += te(a.clientWidth, n.clientWidth) - r), {
|
|
1036
|
+
width: r,
|
|
1037
|
+
height: o,
|
|
1038
|
+
x: i,
|
|
1039
1039
|
y: s
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
1042
|
const st = 25;
|
|
1043
1043
|
function qa(e, a) {
|
|
1044
|
-
const t = F(e), n = G(e),
|
|
1045
|
-
let
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1044
|
+
const t = F(e), n = G(e), r = t.visualViewport;
|
|
1045
|
+
let o = n.clientWidth, i = n.clientHeight, s = 0, d = 0;
|
|
1046
|
+
if (r) {
|
|
1047
|
+
o = r.width, i = r.height;
|
|
1048
1048
|
const c = Je();
|
|
1049
|
-
(!c || c && a === "fixed") && (s =
|
|
1049
|
+
(!c || c && a === "fixed") && (s = r.offsetLeft, d = r.offsetTop);
|
|
1050
1050
|
}
|
|
1051
1051
|
const l = Fe(n);
|
|
1052
1052
|
if (l <= 0) {
|
|
1053
|
-
const c = n.ownerDocument, p = c.body, u = getComputedStyle(p), g = c.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0,
|
|
1054
|
-
|
|
1055
|
-
} else l <= st && (
|
|
1053
|
+
const c = n.ownerDocument, p = c.body, u = getComputedStyle(p), g = c.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, f = Math.abs(n.clientWidth - p.clientWidth - g);
|
|
1054
|
+
f <= st && (o -= f);
|
|
1055
|
+
} else l <= st && (o += l);
|
|
1056
1056
|
return {
|
|
1057
|
-
width:
|
|
1058
|
-
height:
|
|
1057
|
+
width: o,
|
|
1058
|
+
height: i,
|
|
1059
1059
|
x: s,
|
|
1060
1060
|
y: d
|
|
1061
1061
|
};
|
|
1062
1062
|
}
|
|
1063
1063
|
const Ua = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1064
1064
|
function ja(e, a) {
|
|
1065
|
-
const t =
|
|
1065
|
+
const t = re(e, !0, a === "fixed"), n = t.top + e.clientTop, r = t.left + e.clientLeft, o = K(e) ? se(e) : W(1), i = e.clientWidth * o.x, s = e.clientHeight * o.y, d = r * o.x, l = n * o.y;
|
|
1066
1066
|
return {
|
|
1067
|
-
width:
|
|
1067
|
+
width: i,
|
|
1068
1068
|
height: s,
|
|
1069
1069
|
x: d,
|
|
1070
1070
|
y: l
|
|
@@ -1079,10 +1079,10 @@ function dt(e, a, t) {
|
|
|
1079
1079
|
else if (B(a))
|
|
1080
1080
|
n = ja(a, t);
|
|
1081
1081
|
else {
|
|
1082
|
-
const
|
|
1082
|
+
const r = xt(e);
|
|
1083
1083
|
n = {
|
|
1084
|
-
x: a.x -
|
|
1085
|
-
y: a.y -
|
|
1084
|
+
x: a.x - r.x,
|
|
1085
|
+
y: a.y - r.y,
|
|
1086
1086
|
width: a.width,
|
|
1087
1087
|
height: a.height
|
|
1088
1088
|
};
|
|
@@ -1091,18 +1091,18 @@ function dt(e, a, t) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
function St(e, a) {
|
|
1093
1093
|
const t = J(e);
|
|
1094
|
-
return t === a || !B(t) || ce(t) ? !1 :
|
|
1094
|
+
return t === a || !B(t) || ce(t) ? !1 : Y(t).position === "fixed" || St(t, a);
|
|
1095
1095
|
}
|
|
1096
1096
|
function Wa(e, a) {
|
|
1097
1097
|
const t = a.get(e);
|
|
1098
1098
|
if (t)
|
|
1099
1099
|
return t;
|
|
1100
|
-
let n = ue(e, [], !1).filter((s) => B(s) && ge(s) !== "body"),
|
|
1101
|
-
const
|
|
1102
|
-
let
|
|
1103
|
-
for (; B(
|
|
1104
|
-
const s =
|
|
1105
|
-
!d && s.position === "fixed" && (
|
|
1100
|
+
let n = ue(e, [], !1).filter((s) => B(s) && ge(s) !== "body"), r = null;
|
|
1101
|
+
const o = Y(e).position === "fixed";
|
|
1102
|
+
let i = o ? J(e) : e;
|
|
1103
|
+
for (; B(i) && !ce(i); ) {
|
|
1104
|
+
const s = Y(i), d = Xe(i);
|
|
1105
|
+
!d && s.position === "fixed" && (r = null), (o ? !d && !r : !d && s.position === "static" && !!r && Ua.has(r.position) || xe(i) && !d && St(e, i)) ? n = n.filter((c) => c !== i) : r = s, i = J(i);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
1108
1108
|
}
|
|
@@ -1111,12 +1111,12 @@ function Ka(e) {
|
|
|
1111
1111
|
element: a,
|
|
1112
1112
|
boundary: t,
|
|
1113
1113
|
rootBoundary: n,
|
|
1114
|
-
strategy:
|
|
1114
|
+
strategy: r
|
|
1115
1115
|
} = e;
|
|
1116
|
-
const
|
|
1117
|
-
const p = dt(a, c,
|
|
1116
|
+
const i = [...t === "clippingAncestors" ? Pe(a) ? [] : Wa(a, this._c) : [].concat(t), n], s = i[0], d = i.reduce((l, c) => {
|
|
1117
|
+
const p = dt(a, c, r);
|
|
1118
1118
|
return l.top = te(p.top, l.top), l.right = le(p.right, l.right), l.bottom = le(p.bottom, l.bottom), l.left = te(p.left, l.left), l;
|
|
1119
|
-
}, dt(a, s,
|
|
1119
|
+
}, dt(a, s, r));
|
|
1120
1120
|
return {
|
|
1121
1121
|
width: d.right - d.left,
|
|
1122
1122
|
height: d.bottom - d.top,
|
|
@@ -1135,34 +1135,34 @@ function Ga(e) {
|
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
function Xa(e, a, t) {
|
|
1138
|
-
const n = K(a),
|
|
1138
|
+
const n = K(a), r = G(a), o = t === "fixed", i = re(e, !0, o, a);
|
|
1139
1139
|
let s = {
|
|
1140
1140
|
scrollLeft: 0,
|
|
1141
1141
|
scrollTop: 0
|
|
1142
1142
|
};
|
|
1143
1143
|
const d = W(0);
|
|
1144
1144
|
function l() {
|
|
1145
|
-
d.x = Fe(
|
|
1145
|
+
d.x = Fe(r);
|
|
1146
1146
|
}
|
|
1147
|
-
if (n || !n && !
|
|
1148
|
-
if ((ge(a) !== "body" || xe(
|
|
1149
|
-
const g =
|
|
1147
|
+
if (n || !n && !o)
|
|
1148
|
+
if ((ge(a) !== "body" || xe(r)) && (s = Ne(a)), n) {
|
|
1149
|
+
const g = re(a, !0, o, a);
|
|
1150
1150
|
d.x = g.x + a.clientLeft, d.y = g.y + a.clientTop;
|
|
1151
|
-
} else
|
|
1152
|
-
|
|
1153
|
-
const c =
|
|
1151
|
+
} else r && l();
|
|
1152
|
+
o && !n && r && l();
|
|
1153
|
+
const c = r && !n && !o ? Mt(r, s) : W(0), p = i.left + s.scrollLeft - d.x - c.x, u = i.top + s.scrollTop - d.y - c.y;
|
|
1154
1154
|
return {
|
|
1155
1155
|
x: p,
|
|
1156
1156
|
y: u,
|
|
1157
|
-
width:
|
|
1158
|
-
height:
|
|
1157
|
+
width: i.width,
|
|
1158
|
+
height: i.height
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return
|
|
1161
|
+
function Oe(e) {
|
|
1162
|
+
return Y(e).position === "static";
|
|
1163
1163
|
}
|
|
1164
1164
|
function lt(e, a) {
|
|
1165
|
-
if (!K(e) ||
|
|
1165
|
+
if (!K(e) || Y(e).position === "fixed")
|
|
1166
1166
|
return null;
|
|
1167
1167
|
if (a)
|
|
1168
1168
|
return a(e);
|
|
@@ -1171,21 +1171,21 @@ function lt(e, a) {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
function Ct(e, a) {
|
|
1173
1173
|
const t = F(e);
|
|
1174
|
-
if (
|
|
1174
|
+
if (Pe(e))
|
|
1175
1175
|
return t;
|
|
1176
1176
|
if (!K(e)) {
|
|
1177
|
-
let
|
|
1178
|
-
for (;
|
|
1179
|
-
if (B(
|
|
1180
|
-
return
|
|
1181
|
-
|
|
1177
|
+
let r = J(e);
|
|
1178
|
+
for (; r && !ce(r); ) {
|
|
1179
|
+
if (B(r) && !Oe(r))
|
|
1180
|
+
return r;
|
|
1181
|
+
r = J(r);
|
|
1182
1182
|
}
|
|
1183
1183
|
return t;
|
|
1184
1184
|
}
|
|
1185
1185
|
let n = lt(e, a);
|
|
1186
|
-
for (; n &&
|
|
1186
|
+
for (; n && La(n) && Oe(n); )
|
|
1187
1187
|
n = lt(n, a);
|
|
1188
|
-
return n && ce(n) &&
|
|
1188
|
+
return n && ce(n) && Oe(n) && !Xe(n) ? t : n || Na(e) || t;
|
|
1189
1189
|
}
|
|
1190
1190
|
const Ja = async function(e) {
|
|
1191
1191
|
const a = this.getOffsetParent || Ct, t = this.getDimensions, n = await t(e.floating);
|
|
@@ -1200,7 +1200,7 @@ const Ja = async function(e) {
|
|
|
1200
1200
|
};
|
|
1201
1201
|
};
|
|
1202
1202
|
function Qa(e) {
|
|
1203
|
-
return
|
|
1203
|
+
return Y(e).direction === "rtl";
|
|
1204
1204
|
}
|
|
1205
1205
|
const It = {
|
|
1206
1206
|
convertOffsetParentRelativeRectToViewportRelativeRect: Ba,
|
|
@@ -1208,7 +1208,7 @@ const It = {
|
|
|
1208
1208
|
getClippingRect: Ka,
|
|
1209
1209
|
getOffsetParent: Ct,
|
|
1210
1210
|
getElementRects: Ja,
|
|
1211
|
-
getClientRects:
|
|
1211
|
+
getClientRects: Ya,
|
|
1212
1212
|
getDimensions: Ga,
|
|
1213
1213
|
getScale: se,
|
|
1214
1214
|
isElement: B,
|
|
@@ -1219,13 +1219,13 @@ function Et(e, a) {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
function Za(e, a) {
|
|
1221
1221
|
let t = null, n;
|
|
1222
|
-
const
|
|
1223
|
-
function
|
|
1222
|
+
const r = G(e);
|
|
1223
|
+
function o() {
|
|
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 i(s, d) {
|
|
1228
|
+
s === void 0 && (s = !1), d === void 0 && (d = 1), o();
|
|
1229
1229
|
const l = e.getBoundingClientRect(), {
|
|
1230
1230
|
left: c,
|
|
1231
1231
|
top: p,
|
|
@@ -1234,82 +1234,82 @@ function Za(e, a) {
|
|
|
1234
1234
|
} = l;
|
|
1235
1235
|
if (s || a(), !u || !g)
|
|
1236
1236
|
return;
|
|
1237
|
-
const
|
|
1238
|
-
rootMargin: -
|
|
1237
|
+
const f = Me(p), h = Me(r.clientWidth - (c + u)), D = Me(r.clientHeight - (p + g)), m = Me(c), I = {
|
|
1238
|
+
rootMargin: -f + "px " + -h + "px " + -D + "px " + -m + "px",
|
|
1239
1239
|
threshold: te(0, le(1, d)) || 1
|
|
1240
1240
|
};
|
|
1241
|
-
let
|
|
1242
|
-
function _
|
|
1243
|
-
const
|
|
1244
|
-
if (
|
|
1245
|
-
if (!
|
|
1246
|
-
return
|
|
1247
|
-
|
|
1248
|
-
|
|
1241
|
+
let S = !0;
|
|
1242
|
+
function v(_) {
|
|
1243
|
+
const R = _[0].intersectionRatio;
|
|
1244
|
+
if (R !== d) {
|
|
1245
|
+
if (!S)
|
|
1246
|
+
return i();
|
|
1247
|
+
R ? i(!1, R) : n = setTimeout(() => {
|
|
1248
|
+
i(!1, 1e-7);
|
|
1249
1249
|
}, 1e3);
|
|
1250
1250
|
}
|
|
1251
|
-
|
|
1251
|
+
R === 1 && !Et(l, e.getBoundingClientRect()) && i(), S = !1;
|
|
1252
1252
|
}
|
|
1253
1253
|
try {
|
|
1254
|
-
t = new IntersectionObserver(
|
|
1255
|
-
...
|
|
1254
|
+
t = new IntersectionObserver(v, {
|
|
1255
|
+
...I,
|
|
1256
1256
|
// Handle <iframe>s
|
|
1257
|
-
root:
|
|
1257
|
+
root: r.ownerDocument
|
|
1258
1258
|
});
|
|
1259
1259
|
} catch {
|
|
1260
|
-
t = new IntersectionObserver(
|
|
1260
|
+
t = new IntersectionObserver(v, I);
|
|
1261
1261
|
}
|
|
1262
1262
|
t.observe(e);
|
|
1263
1263
|
}
|
|
1264
|
-
return
|
|
1264
|
+
return i(!0), o;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Rt(e, a, t, n) {
|
|
1267
1267
|
n === void 0 && (n = {});
|
|
1268
1268
|
const {
|
|
1269
|
-
ancestorScroll:
|
|
1270
|
-
ancestorResize:
|
|
1271
|
-
elementResize:
|
|
1269
|
+
ancestorScroll: r = !0,
|
|
1270
|
+
ancestorResize: o = !0,
|
|
1271
|
+
elementResize: i = typeof ResizeObserver == "function",
|
|
1272
1272
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
1273
1273
|
animationFrame: d = !1
|
|
1274
|
-
} = n, l = Qe(e), c =
|
|
1275
|
-
c.forEach((
|
|
1276
|
-
|
|
1274
|
+
} = n, l = Qe(e), c = r || o ? [...l ? ue(l) : [], ...ue(a)] : [];
|
|
1275
|
+
c.forEach((m) => {
|
|
1276
|
+
r && m.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
1278
|
-
}),
|
|
1278
|
+
}), o && m.addEventListener("resize", t);
|
|
1279
1279
|
});
|
|
1280
1280
|
const p = l && s ? Za(l, t) : null;
|
|
1281
1281
|
let u = -1, g = null;
|
|
1282
|
-
|
|
1283
|
-
let [
|
|
1284
|
-
|
|
1285
|
-
var
|
|
1286
|
-
(
|
|
1282
|
+
i && (g = new ResizeObserver((m) => {
|
|
1283
|
+
let [C] = m;
|
|
1284
|
+
C && C.target === l && g && (g.unobserve(a), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
1285
|
+
var I;
|
|
1286
|
+
(I = g) == null || I.observe(a);
|
|
1287
1287
|
})), t();
|
|
1288
1288
|
}), l && !d && g.observe(l), g.observe(a));
|
|
1289
|
-
let
|
|
1290
|
-
d &&
|
|
1291
|
-
function
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1289
|
+
let f, h = d ? re(e) : null;
|
|
1290
|
+
d && D();
|
|
1291
|
+
function D() {
|
|
1292
|
+
const m = re(e);
|
|
1293
|
+
h && !Et(h, m) && t(), h = m, f = requestAnimationFrame(D);
|
|
1294
1294
|
}
|
|
1295
1295
|
return t(), () => {
|
|
1296
|
-
var
|
|
1297
|
-
c.forEach((
|
|
1298
|
-
|
|
1299
|
-
}), p == null || p(), (
|
|
1296
|
+
var m;
|
|
1297
|
+
c.forEach((C) => {
|
|
1298
|
+
r && C.removeEventListener("scroll", t), o && C.removeEventListener("resize", t);
|
|
1299
|
+
}), p == null || p(), (m = g) == null || m.disconnect(), g = null, d && cancelAnimationFrame(f);
|
|
1300
1300
|
};
|
|
1301
1301
|
}
|
|
1302
|
-
const Ae = Ea,
|
|
1303
|
-
const n = /* @__PURE__ */ new Map(),
|
|
1302
|
+
const Ae = Ea, ke = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
1303
|
+
const n = /* @__PURE__ */ new Map(), r = {
|
|
1304
1304
|
platform: It,
|
|
1305
1305
|
...t
|
|
1306
|
-
},
|
|
1307
|
-
...
|
|
1306
|
+
}, o = {
|
|
1307
|
+
...r.platform,
|
|
1308
1308
|
_c: n
|
|
1309
1309
|
};
|
|
1310
1310
|
return xa(e, a, {
|
|
1311
|
-
...
|
|
1312
|
-
platform:
|
|
1311
|
+
...r,
|
|
1312
|
+
platform: o
|
|
1313
1313
|
});
|
|
1314
1314
|
}, en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1315
1315
|
__proto__: null,
|
|
@@ -1320,61 +1320,61 @@ const Ae = Ea, Le = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
|
1320
1320
|
getOverflowAncestors: ue,
|
|
1321
1321
|
offset: Ae,
|
|
1322
1322
|
platform: It,
|
|
1323
|
-
shift:
|
|
1323
|
+
shift: ke
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
1325
|
let Se = null;
|
|
1326
|
-
function
|
|
1327
|
-
e.options.positioningMode !== "inline" && (
|
|
1326
|
+
function kt(e) {
|
|
1327
|
+
e.options.positioningMode !== "inline" && (H.debug("show() - adding visible class"), e.requiresApplyButton() && e.input && (e.originalInputValue = e.input.value, H.debug("show() - stored original input value:", e.originalInputValue)), e.isFirstRender && (e.renderCalendar(), e.isFirstRender = !1, Tt(e)), e.calendar.classList.add("drp-date-picker--visible"), e.isCalendarActive = !0, H.debug("show() - calendar classes:", e.calendar.className), qe(e), Se = Rt(e.input, e.calendar, () => {
|
|
1328
1328
|
qe(e);
|
|
1329
1329
|
}), e.clickOutsideHandler && setTimeout(() => {
|
|
1330
1330
|
document.addEventListener("click", e.clickOutsideHandler);
|
|
1331
1331
|
}, 0), setTimeout(() => {
|
|
1332
1332
|
const a = window.getComputedStyle(e.calendar);
|
|
1333
|
-
|
|
1333
|
+
H.debug("show() - computed styles - display:", a.display, "position:", a.position, "left:", a.left, "top:", a.top, "z-index:", a.zIndex);
|
|
1334
1334
|
}, 100));
|
|
1335
1335
|
}
|
|
1336
|
-
function
|
|
1336
|
+
function Lt(e) {
|
|
1337
1337
|
if (e.options.positioningMode !== "inline" && e.calendar.classList.contains("drp-date-picker--visible")) {
|
|
1338
|
-
Se && (Se(), Se = null), e.clickOutsideHandler && document.removeEventListener("click", e.clickOutsideHandler), e.calendar.classList.remove("drp-date-picker--visible"), e.isCalendarActive = !1, e.requiresApplyButton() && e.pendingSelection && e.input && (
|
|
1338
|
+
Se && (Se(), Se = null), e.clickOutsideHandler && document.removeEventListener("click", e.clickOutsideHandler), e.calendar.classList.remove("drp-date-picker--visible"), e.isCalendarActive = !1, e.requiresApplyButton() && e.pendingSelection && e.input && (H.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), H.debug("hide() - reverted selection state")), e.pendingSelection = null;
|
|
1339
1339
|
for (let a = 0; a < e.showingRollingSelector.length; a++)
|
|
1340
1340
|
e.showingRollingSelector[a] = !1;
|
|
1341
1341
|
e.isFirstRender || e.renderCalendar(), e.lockedPlacement = void 0;
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
function tn(e) {
|
|
1345
|
-
e.calendar.classList.contains("drp-date-picker--visible") ?
|
|
1345
|
+
e.calendar.classList.contains("drp-date-picker--visible") ? Lt(e) : kt(e);
|
|
1346
1346
|
}
|
|
1347
1347
|
async function qe(e) {
|
|
1348
|
-
if (
|
|
1348
|
+
if (H.debug("position() - locked placement:", e.lockedPlacement), !e.input)
|
|
1349
1349
|
return;
|
|
1350
|
-
const a = e.lockedPlacement ? [Ae(8),
|
|
1350
|
+
const a = e.lockedPlacement ? [Ae(8), ke({ padding: 8 })] : [Ae(8), Ze(), ke({ padding: 8 })], t = await et(e.input, e.calendar, {
|
|
1351
1351
|
placement: e.lockedPlacement || e.options.calendarPlacement,
|
|
1352
1352
|
middleware: a
|
|
1353
1353
|
});
|
|
1354
|
-
|
|
1354
|
+
H.debug("position() - FloatingUI computed - x:", t.x, "y:", t.y, "placement:", t.placement), e.lockedPlacement || (e.lockedPlacement = t.placement, H.debug("position() - locked placement to:", e.lockedPlacement)), e.calendar.style.left = `${t.x}px`, e.calendar.style.top = `${t.y}px`, H.debug("position() - applied styles to calendar");
|
|
1355
1355
|
}
|
|
1356
1356
|
async function an(e, a, t) {
|
|
1357
1357
|
if (!e.tooltip || !e.tooltipArrow) return;
|
|
1358
1358
|
e.currentTooltipTarget = a, e.tooltip.innerHTML = t, e.tooltip.appendChild(e.tooltipArrow), e.tooltip.classList.add("drp-date-picker__tooltip--visible");
|
|
1359
|
-
const { x: n, y:
|
|
1359
|
+
const { x: n, y: r, placement: o, middlewareData: i } = await et(a, e.tooltip, {
|
|
1360
1360
|
placement: "top",
|
|
1361
1361
|
middleware: [
|
|
1362
1362
|
Ae(6),
|
|
1363
1363
|
Ze(),
|
|
1364
|
-
|
|
1364
|
+
ke({ padding: 5 }),
|
|
1365
1365
|
At({ element: e.tooltipArrow })
|
|
1366
1366
|
]
|
|
1367
1367
|
});
|
|
1368
1368
|
if (Object.assign(e.tooltip.style, {
|
|
1369
1369
|
left: `${n}px`,
|
|
1370
|
-
top: `${
|
|
1371
|
-
}),
|
|
1372
|
-
const { x: s, y: d } =
|
|
1370
|
+
top: `${r}px`
|
|
1371
|
+
}), i.arrow) {
|
|
1372
|
+
const { x: s, y: d } = i.arrow, l = {
|
|
1373
1373
|
top: "bottom",
|
|
1374
1374
|
right: "left",
|
|
1375
1375
|
bottom: "top",
|
|
1376
1376
|
left: "right"
|
|
1377
|
-
}[
|
|
1377
|
+
}[o.split("-")[0]];
|
|
1378
1378
|
Object.assign(e.tooltipArrow.style, {
|
|
1379
1379
|
left: s != null ? `${s}px` : "",
|
|
1380
1380
|
top: d != null ? `${d}px` : "",
|
|
@@ -1387,7 +1387,7 @@ async function an(e, a, t) {
|
|
|
1387
1387
|
function nn(e) {
|
|
1388
1388
|
e.tooltip && (e.tooltip.classList.remove("drp-date-picker__tooltip--visible"), e.currentTooltipTarget = void 0);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Le(e) {
|
|
1391
1391
|
if (e.loadingOverlay) return;
|
|
1392
1392
|
const a = document.createElement("div");
|
|
1393
1393
|
a.className = "drp-date-picker__loading-overlay", a.innerHTML = `
|
|
@@ -1399,14 +1399,14 @@ function ae(e) {
|
|
|
1399
1399
|
}
|
|
1400
1400
|
function j(e, a, t) {
|
|
1401
1401
|
for (let n = 1; n <= 31; n++) {
|
|
1402
|
-
const
|
|
1403
|
-
if (
|
|
1402
|
+
const r = new Date(a, t, n);
|
|
1403
|
+
if (r.getMonth() === t && !e.isDateDisabledInternal(r))
|
|
1404
1404
|
return !0;
|
|
1405
1405
|
}
|
|
1406
1406
|
return !1;
|
|
1407
1407
|
}
|
|
1408
1408
|
async function Tt(e) {
|
|
1409
|
-
var a, t;
|
|
1409
|
+
var a, t, n, r;
|
|
1410
1410
|
if (e.options.beforeMonthChangedCallback) {
|
|
1411
1411
|
if (e.isMonthChanging) {
|
|
1412
1412
|
w.debug("handleInitialMonthLoad() - already changing month, skipping");
|
|
@@ -1414,94 +1414,98 @@ async function Tt(e) {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
try {
|
|
1416
1416
|
if (e.isMonthChanging = !0, e.options.unifiedNavigation) {
|
|
1417
|
-
const
|
|
1418
|
-
let
|
|
1419
|
-
for (let
|
|
1420
|
-
const
|
|
1421
|
-
(
|
|
1417
|
+
const o = e.options.unifiedNavigationAnchorIndex ?? 0, i = e.monthDates[o], s = i.getFullYear(), d = i.getMonth();
|
|
1418
|
+
let l = 1 / 0, c = 1 / 0, p = -1 / 0, u = -1 / 0;
|
|
1419
|
+
for (let M = 0; M < e.monthDates.length; M++) {
|
|
1420
|
+
const x = e.monthDates[M], E = x.getFullYear(), k = x.getMonth();
|
|
1421
|
+
(E < l || E === l && k < c) && (l = E, c = k), (E > p || E === p && k > u) && (p = E, u = k);
|
|
1422
1422
|
}
|
|
1423
|
-
const
|
|
1424
|
-
year:
|
|
1425
|
-
month:
|
|
1426
|
-
monthIndex:
|
|
1427
|
-
firstVisibleDate:
|
|
1428
|
-
lastVisibleDate:
|
|
1423
|
+
const h = (new Date(l, c, 1).getDay() - e.weekStartDay + 7) % 7, D = new Date(l, c, 1 - h), m = new Date(p, u + 1, 0).getDate(), I = new Date(p, u, m).getDay(), S = (e.weekStartDay + 6 - I) % 7, v = new Date(p, u, m + S), _ = {
|
|
1424
|
+
year: s,
|
|
1425
|
+
month: d,
|
|
1426
|
+
monthIndex: o,
|
|
1427
|
+
firstVisibleDate: D,
|
|
1428
|
+
lastVisibleDate: v
|
|
1429
1429
|
};
|
|
1430
|
-
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1430
|
+
w.debug(`handleInitialMonthLoad() [UNIFIED] - calling callback for ${s}-${d + 1}, range: ${D.toISOString().split("T")[0]} to ${v.toISOString().split("T")[0]}`);
|
|
1431
|
+
const R = e.options.beforeMonthChangedCallback(_), L = R instanceof Promise;
|
|
1432
|
+
L && Le(e);
|
|
1433
|
+
const y = await Promise.resolve(R);
|
|
1434
|
+
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();
|
|
1435
1435
|
} else {
|
|
1436
1436
|
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - calling callback for ${e.monthDates.length} months`);
|
|
1437
|
-
const
|
|
1438
|
-
let
|
|
1439
|
-
for (let
|
|
1440
|
-
const
|
|
1441
|
-
|
|
1437
|
+
const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1438
|
+
let s = !1;
|
|
1439
|
+
for (let d = 0; d < e.monthDates.length; d++) {
|
|
1440
|
+
const l = e.monthDates[d], c = l.getFullYear(), p = l.getMonth(), f = (new Date(c, p, 1).getDay() - e.weekStartDay + 7) % 7, h = new Date(c, p, 1 - f), D = new Date(h);
|
|
1441
|
+
D.setDate(h.getDate() + 41);
|
|
1442
1442
|
const m = {
|
|
1443
|
-
year:
|
|
1444
|
-
month:
|
|
1445
|
-
monthIndex:
|
|
1446
|
-
firstVisibleDate:
|
|
1447
|
-
lastVisibleDate:
|
|
1443
|
+
year: c,
|
|
1444
|
+
month: p,
|
|
1445
|
+
monthIndex: d,
|
|
1446
|
+
firstVisibleDate: h,
|
|
1447
|
+
lastVisibleDate: D
|
|
1448
1448
|
};
|
|
1449
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1452
|
-
const
|
|
1453
|
-
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${
|
|
1454
|
-
|
|
1449
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - calling callback for ${c}-${p + 1}, range: ${h.toISOString().split("T")[0]} to ${D.toISOString().split("T")[0]}`);
|
|
1450
|
+
const C = e.options.beforeMonthChangedCallback(m);
|
|
1451
|
+
C instanceof Promise && !s && (s = !0, Le(e));
|
|
1452
|
+
const S = await Promise.resolve(C);
|
|
1453
|
+
w.debug(`handleInitialMonthLoad() [NON-UNIFIED] Col${d} - callback completed, metadata items: ${((n = S.metadata) == null ? void 0 : n.size) || 0}, monthHeaders: ${((r = S.monthHeaders) == null ? void 0 : r.size) || 0}`), S.metadata && S.metadata.forEach((v, _) => {
|
|
1454
|
+
o.set(_, v);
|
|
1455
|
+
}), S.monthHeaders && S.monthHeaders.forEach((v, _) => {
|
|
1456
|
+
i.set(_, v);
|
|
1455
1457
|
});
|
|
1456
1458
|
}
|
|
1457
|
-
|
|
1459
|
+
s && ae(e), o.size > 0 && (e.bulkMetadataCache = o, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${o.size} entries`)), i.size > 0 && (e.monthHeadersCache = i, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined month headers cache updated with ${i.size} entries`)), (o.size > 0 || i.size > 0) && e.renderCalendar();
|
|
1458
1460
|
}
|
|
1459
|
-
} catch (
|
|
1460
|
-
ae(e), w.debug("handleInitialMonthLoad() - error in callback:",
|
|
1461
|
+
} catch (o) {
|
|
1462
|
+
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", o), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", o);
|
|
1461
1463
|
} finally {
|
|
1462
1464
|
e.isMonthChanging = !1;
|
|
1463
1465
|
}
|
|
1464
1466
|
}
|
|
1465
1467
|
}
|
|
1466
1468
|
async function Z(e, a, t, n) {
|
|
1467
|
-
var
|
|
1469
|
+
var r, o;
|
|
1468
1470
|
if (!e.options.beforeMonthChangedCallback)
|
|
1469
1471
|
return !0;
|
|
1470
1472
|
if (e.isMonthChanging)
|
|
1471
1473
|
return w.debug("handleBeforeMonthChange() - already changing month, ignoring"), !1;
|
|
1472
1474
|
try {
|
|
1473
1475
|
e.isMonthChanging = !0;
|
|
1474
|
-
let
|
|
1476
|
+
let i, s;
|
|
1475
1477
|
if (e.options.unifiedNavigation) {
|
|
1476
|
-
let
|
|
1477
|
-
for (let
|
|
1478
|
-
const
|
|
1479
|
-
(
|
|
1478
|
+
let u = 1 / 0, g = 1 / 0, f = -1 / 0, h = -1 / 0;
|
|
1479
|
+
for (let R = 0; R < e.monthDates.length; R++) {
|
|
1480
|
+
const L = e.monthDates[R], y = L.getFullYear(), M = L.getMonth();
|
|
1481
|
+
(y < u || y === u && M < g) && (u = y, g = M), (y > f || y === f && M > h) && (f = y, h = M);
|
|
1480
1482
|
}
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1483
|
+
const C = (new Date(u, g, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1484
|
+
i = new Date(u, g, 1 - C);
|
|
1485
|
+
const I = new Date(f, h + 1, 0).getDate(), v = new Date(f, h, I).getDay(), _ = (e.weekStartDay + 6 - v) % 7;
|
|
1486
|
+
s = new Date(f, h, I + _);
|
|
1485
1487
|
} else {
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
+
const f = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1489
|
+
i = new Date(a, t, 1 - f), s = new Date(i), s.setDate(i.getDate() + 41);
|
|
1488
1490
|
}
|
|
1489
|
-
const
|
|
1491
|
+
const d = {
|
|
1490
1492
|
year: a,
|
|
1491
1493
|
month: t,
|
|
1492
1494
|
monthIndex: n,
|
|
1493
|
-
firstVisibleDate:
|
|
1494
|
-
lastVisibleDate:
|
|
1495
|
+
firstVisibleDate: i,
|
|
1496
|
+
lastVisibleDate: s
|
|
1495
1497
|
};
|
|
1496
|
-
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1501
|
-
e.bulkMetadataCache.set(
|
|
1502
|
-
}), w.debug(`handleBeforeMonthChange() - merged ${
|
|
1503
|
-
|
|
1504
|
-
|
|
1498
|
+
w.debug(`handleBeforeMonthChange() - calling callback for ${a}-${t + 1}, range: ${i.toISOString().split("T")[0]} to ${s.toISOString().split("T")[0]}`);
|
|
1499
|
+
const l = e.options.beforeMonthChangedCallback(d), c = l instanceof Promise;
|
|
1500
|
+
c && Le(e);
|
|
1501
|
+
const p = await Promise.resolve(l);
|
|
1502
|
+
return c && ae(e), p.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${p.message || "no reason provided"}`), p.message && console.warn(`[DateRangePicker] Month navigation blocked: ${p.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((r = p.metadata) == null ? void 0 : r.size) || 0}, monthHeaders: ${((o = p.monthHeaders) == null ? void 0 : o.size) || 0}`), p.metadata ? e.bulkMetadataCache ? (p.metadata.forEach((u, g) => {
|
|
1503
|
+
e.bulkMetadataCache.set(g, u);
|
|
1504
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${p.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = p.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${p.metadata.size} entries`)) : e.bulkMetadataCache = null, p.monthHeaders && (e.monthHeadersCache ? (p.monthHeaders.forEach((u, g) => {
|
|
1505
|
+
e.monthHeadersCache.set(g, u);
|
|
1506
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${p.monthHeaders.size} entries into headers cache (total: ${e.monthHeadersCache.size})`)) : (e.monthHeadersCache = p.monthHeaders, w.debug(`handleBeforeMonthChange() - month headers cache created with ${p.monthHeaders.size} entries`))), !0);
|
|
1507
|
+
} catch (i) {
|
|
1508
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", i), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", i), !1;
|
|
1505
1509
|
} finally {
|
|
1506
1510
|
e.isMonthChanging = !1;
|
|
1507
1511
|
}
|
|
@@ -1515,8 +1519,8 @@ async function on(e, a, t) {
|
|
|
1515
1519
|
w.debug(`selectYear() Col${t} - navigation blocked by callback`);
|
|
1516
1520
|
return;
|
|
1517
1521
|
}
|
|
1518
|
-
const
|
|
1519
|
-
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${
|
|
1522
|
+
const o = e.monthDates[t].getFullYear();
|
|
1523
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${o} to ${a}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1520
1524
|
}
|
|
1521
1525
|
async function sn(e, a, t) {
|
|
1522
1526
|
const n = e.monthDates[t].getFullYear();
|
|
@@ -1524,8 +1528,8 @@ async function sn(e, a, t) {
|
|
|
1524
1528
|
w.debug(`selectMonth() Col${t} - navigation blocked by callback`);
|
|
1525
1529
|
return;
|
|
1526
1530
|
}
|
|
1527
|
-
const
|
|
1528
|
-
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${
|
|
1531
|
+
const o = e.monthDates[t].getMonth();
|
|
1532
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${o + 1} to ${a + 1}`), De(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1529
1533
|
}
|
|
1530
1534
|
function De(e, a) {
|
|
1531
1535
|
const t = e.monthDates[a];
|
|
@@ -1533,78 +1537,78 @@ function De(e, a) {
|
|
|
1533
1537
|
const n = e.monthDates[a + 1];
|
|
1534
1538
|
if (Te(t, n)) {
|
|
1535
1539
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a + 1}, shifting forward`);
|
|
1536
|
-
const
|
|
1537
|
-
e.monthDates[a + 1] =
|
|
1540
|
+
const r = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1541
|
+
e.monthDates[a + 1] = r, De(e, a + 1);
|
|
1538
1542
|
}
|
|
1539
1543
|
}
|
|
1540
1544
|
if (a > 0) {
|
|
1541
1545
|
const n = e.monthDates[a - 1];
|
|
1542
1546
|
if (Te(n, t)) {
|
|
1543
1547
|
w.debug(`checkAndResolveCollisions() Col${a} - collision with Col${a - 1}, shifting backward`);
|
|
1544
|
-
const
|
|
1545
|
-
e.monthDates[a - 1] =
|
|
1548
|
+
const r = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1549
|
+
e.monthDates[a - 1] = r, De(e, a - 1);
|
|
1546
1550
|
}
|
|
1547
1551
|
}
|
|
1548
1552
|
}
|
|
1549
1553
|
function Te(e, a) {
|
|
1550
|
-
const t = e.getFullYear(), n = e.getMonth(),
|
|
1551
|
-
return t >
|
|
1554
|
+
const t = e.getFullYear(), n = e.getMonth(), r = a.getFullYear(), o = a.getMonth();
|
|
1555
|
+
return t > r || t === r && n >= o;
|
|
1552
1556
|
}
|
|
1553
1557
|
async function be(e, a) {
|
|
1554
1558
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1555
1559
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1556
|
-
const n = e.monthDates[t],
|
|
1557
|
-
if (!j(e,
|
|
1560
|
+
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
1561
|
+
if (!j(e, r.getFullYear(), r.getMonth())) {
|
|
1558
1562
|
w.debug(`prevMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
1559
1563
|
return;
|
|
1560
1564
|
}
|
|
1561
|
-
if (!await Z(e,
|
|
1565
|
+
if (!await Z(e, r.getFullYear(), r.getMonth(), t)) {
|
|
1562
1566
|
w.debug(`prevMonth() Col${t} - navigation blocked by callback`);
|
|
1563
1567
|
return;
|
|
1564
1568
|
}
|
|
1565
|
-
if (e.monthDates[t] =
|
|
1566
|
-
const
|
|
1567
|
-
Te(
|
|
1569
|
+
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) {
|
|
1570
|
+
const i = e.monthDates[t - 1];
|
|
1571
|
+
Te(i, r) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await be(e, t - 1));
|
|
1568
1572
|
}
|
|
1569
1573
|
e.renderCalendar();
|
|
1570
1574
|
}
|
|
1571
1575
|
async function ye(e, a) {
|
|
1572
1576
|
const t = isNaN(a) ? e.activeMonthIndex : a;
|
|
1573
1577
|
e.showingRollingSelector[t] && (e.showingRollingSelector[t] = !1);
|
|
1574
|
-
const n = e.monthDates[t],
|
|
1575
|
-
if (!j(e,
|
|
1578
|
+
const n = e.monthDates[t], r = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
1579
|
+
if (!j(e, r.getFullYear(), r.getMonth())) {
|
|
1576
1580
|
w.debug(`nextMonth() Col${t} - navigation blocked: target month has no enabled days`);
|
|
1577
1581
|
return;
|
|
1578
1582
|
}
|
|
1579
|
-
if (!await Z(e,
|
|
1583
|
+
if (!await Z(e, r.getFullYear(), r.getMonth(), t)) {
|
|
1580
1584
|
w.debug(`nextMonth() Col${t} - navigation blocked by callback`);
|
|
1581
1585
|
return;
|
|
1582
1586
|
}
|
|
1583
|
-
if (e.monthDates[t] =
|
|
1584
|
-
const
|
|
1585
|
-
Te(
|
|
1587
|
+
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) {
|
|
1588
|
+
const i = e.monthDates[t + 1];
|
|
1589
|
+
Te(r, i) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await ye(e, t + 1));
|
|
1586
1590
|
}
|
|
1587
1591
|
e.renderCalendar();
|
|
1588
1592
|
}
|
|
1589
|
-
function fe(e, a, t, n,
|
|
1590
|
-
let
|
|
1593
|
+
function fe(e, a, t, n, r) {
|
|
1594
|
+
let o = a, i = 0;
|
|
1591
1595
|
const s = 60;
|
|
1592
|
-
for (;
|
|
1593
|
-
if (
|
|
1594
|
-
const l = n[
|
|
1596
|
+
for (; i < s; ) {
|
|
1597
|
+
if (o >= 0 && o < n.length) {
|
|
1598
|
+
const l = n[o].dataset.date;
|
|
1595
1599
|
if (l) {
|
|
1596
1600
|
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
1597
1601
|
if (!e.isDateDisabledInternal(g))
|
|
1598
|
-
return { index:
|
|
1602
|
+
return { index: o, monthChanged: !1 };
|
|
1599
1603
|
}
|
|
1600
1604
|
}
|
|
1601
|
-
if (
|
|
1605
|
+
if (o += t, i++, o < 0 || o >= n.length)
|
|
1602
1606
|
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
1603
1607
|
}
|
|
1604
1608
|
return { index: null, monthChanged: !1 };
|
|
1605
1609
|
}
|
|
1606
1610
|
function dn(e, a) {
|
|
1607
|
-
var
|
|
1611
|
+
var i, s, d, l;
|
|
1608
1612
|
w.debug(`moveFocus(${a}) Col${e.activeMonthIndex} - focusedDayIndex:`, e.focusedDayIndex);
|
|
1609
1613
|
const t = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
1610
1614
|
if (!t) {
|
|
@@ -1617,81 +1621,81 @@ function dn(e, a) {
|
|
|
1617
1621
|
const c = Array.from(n).findIndex((p) => p.classList.contains("drp-date-picker__day--today"));
|
|
1618
1622
|
e.focusedDayIndex = c !== -1 ? c : 0, w.debug(`moveFocus() Col${e.activeMonthIndex} - initialized focusedDayIndex to ${e.focusedDayIndex} (today or first day), will move by offset ${a}`);
|
|
1619
1623
|
}
|
|
1620
|
-
(
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1624
|
+
(i = n[e.focusedDayIndex]) == null || i.classList.remove("drp-date-picker__day--focused");
|
|
1625
|
+
const r = e.focusedDayIndex + a;
|
|
1626
|
+
if (r < 0) {
|
|
1623
1627
|
const c = e.activeMonthIndex;
|
|
1624
1628
|
if (a === -1)
|
|
1625
1629
|
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1626
|
-
var
|
|
1630
|
+
var f, h;
|
|
1627
1631
|
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1628
1632
|
if (!p) return;
|
|
1629
1633
|
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(e, u.length - 1, -1, u);
|
|
1630
|
-
g.index !== null && (e.focusedDayIndex = g.index, (
|
|
1634
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = u[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = u[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
1631
1635
|
}, 0);
|
|
1632
1636
|
else {
|
|
1633
1637
|
const u = n[e.focusedDayIndex].dataset.date;
|
|
1634
1638
|
if (u) {
|
|
1635
|
-
const [g,
|
|
1636
|
-
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${
|
|
1637
|
-
var
|
|
1638
|
-
const
|
|
1639
|
-
if (!
|
|
1640
|
-
const
|
|
1641
|
-
if (
|
|
1642
|
-
const [
|
|
1643
|
-
e.focusedDayIndex =
|
|
1639
|
+
const [g, f, h] = u.split("-").map(Number), m = new Date(g, f - 1, h).getDay();
|
|
1640
|
+
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${h} is weekday ${m}, going to prev month`), be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1641
|
+
var _, R;
|
|
1642
|
+
const C = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1643
|
+
if (!C) return;
|
|
1644
|
+
const I = C.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), v = I[I.length - 1].dataset.date;
|
|
1645
|
+
if (v) {
|
|
1646
|
+
const [L, y, M] = v.split("-").map(Number), E = new Date(L, y - 1, M).getDay(), k = (E - m + 7) % 7;
|
|
1647
|
+
e.focusedDayIndex = I.length - 1 - k, w.debug(`moveFocus() Col${c} - last day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = I[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = I[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
1644
1648
|
}
|
|
1645
1649
|
}, 0);
|
|
1646
1650
|
}
|
|
1647
1651
|
}
|
|
1648
1652
|
return;
|
|
1649
|
-
} else if (
|
|
1653
|
+
} else if (r >= n.length) {
|
|
1650
1654
|
const c = e.activeMonthIndex;
|
|
1651
1655
|
if (a === 1)
|
|
1652
1656
|
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1653
|
-
var
|
|
1657
|
+
var f, h;
|
|
1654
1658
|
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1655
1659
|
if (!p) return;
|
|
1656
1660
|
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(e, 0, 1, u);
|
|
1657
|
-
g.index !== null && (e.focusedDayIndex = g.index, (
|
|
1661
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = u[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = u[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
1658
1662
|
}, 0);
|
|
1659
1663
|
else {
|
|
1660
1664
|
const u = n[e.focusedDayIndex].dataset.date;
|
|
1661
1665
|
if (u) {
|
|
1662
|
-
const [g,
|
|
1663
|
-
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${
|
|
1664
|
-
var
|
|
1665
|
-
const
|
|
1666
|
-
if (!
|
|
1667
|
-
const
|
|
1668
|
-
if (
|
|
1669
|
-
const [
|
|
1670
|
-
e.focusedDayIndex =
|
|
1666
|
+
const [g, f, h] = u.split("-").map(Number), m = new Date(g, f - 1, h).getDay();
|
|
1667
|
+
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${h} is weekday ${m}, going to next month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1668
|
+
var _, R;
|
|
1669
|
+
const C = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1670
|
+
if (!C) return;
|
|
1671
|
+
const I = C.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), v = I[0].dataset.date;
|
|
1672
|
+
if (v) {
|
|
1673
|
+
const [L, y, M] = v.split("-").map(Number), E = new Date(L, y - 1, M).getDay(), k = (m - E + 7) % 7;
|
|
1674
|
+
e.focusedDayIndex = k, w.debug(`moveFocus() Col${c} - first day weekday ${E}, target ${m}, focusing on day ${e.focusedDayIndex + 1}`), (_ = I[e.focusedDayIndex]) == null || _.classList.add("drp-date-picker__day--focused"), (R = I[e.focusedDayIndex]) == null || R.scrollIntoView({ block: "nearest" });
|
|
1671
1675
|
}
|
|
1672
1676
|
}, 0);
|
|
1673
1677
|
}
|
|
1674
1678
|
}
|
|
1675
1679
|
return;
|
|
1676
1680
|
}
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1681
|
+
const o = fe(e, r, a, n, e.activeMonthIndex);
|
|
1682
|
+
if (o.monthChanged) {
|
|
1679
1683
|
const c = e.activeMonthIndex;
|
|
1680
|
-
|
|
1681
|
-
var
|
|
1684
|
+
o.direction === "next" ? ye(e, e.activeMonthIndex) : be(e, e.activeMonthIndex), setTimeout(() => {
|
|
1685
|
+
var f, h;
|
|
1682
1686
|
const p = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1683
1687
|
if (!p) return;
|
|
1684
1688
|
const u = p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = fe(
|
|
1685
1689
|
e,
|
|
1686
|
-
|
|
1690
|
+
o.direction === "next" ? 0 : u.length - 1,
|
|
1687
1691
|
a,
|
|
1688
1692
|
u
|
|
1689
1693
|
);
|
|
1690
|
-
g.index !== null && (e.focusedDayIndex = g.index, (
|
|
1694
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = u[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = u[e.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
1691
1695
|
}, 0);
|
|
1692
1696
|
return;
|
|
1693
1697
|
}
|
|
1694
|
-
|
|
1698
|
+
o.index !== null ? (e.focusedDayIndex = o.index, (s = n[e.focusedDayIndex]) == null || s.classList.add("drp-date-picker__day--focused"), (d = n[e.focusedDayIndex]) == null || d.scrollIntoView({ block: "nearest" })) : (w.debug("moveFocus() - no enabled day found in search range"), (l = n[e.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"));
|
|
1695
1699
|
}
|
|
1696
1700
|
async function ln(e) {
|
|
1697
1701
|
if (!e.options.unifiedNavigation) return;
|
|
@@ -1701,9 +1705,9 @@ async function ln(e) {
|
|
|
1701
1705
|
return;
|
|
1702
1706
|
}
|
|
1703
1707
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1704
|
-
for (let
|
|
1705
|
-
const
|
|
1706
|
-
e.monthDates[
|
|
1708
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
1709
|
+
const i = o - a;
|
|
1710
|
+
e.monthDates[o] = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
1707
1711
|
}
|
|
1708
1712
|
e.renderCalendar();
|
|
1709
1713
|
}
|
|
@@ -1716,9 +1720,9 @@ async function cn(e) {
|
|
|
1716
1720
|
return;
|
|
1717
1721
|
}
|
|
1718
1722
|
if (await Z(e, n.getFullYear(), n.getMonth(), a)) {
|
|
1719
|
-
for (let
|
|
1720
|
-
const
|
|
1721
|
-
e.monthDates[
|
|
1723
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
1724
|
+
const i = o - a;
|
|
1725
|
+
e.monthDates[o] = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
1722
1726
|
}
|
|
1723
1727
|
e.renderCalendar();
|
|
1724
1728
|
}
|
|
@@ -1727,9 +1731,9 @@ async function un(e, a) {
|
|
|
1727
1731
|
if (!e.options.unifiedNavigation) return;
|
|
1728
1732
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getFullYear();
|
|
1729
1733
|
if (w.debug(`setUnifiedMonth(${a}) - anchor index: ${t}, year: ${n}`), !!await Z(e, n, a, t)) {
|
|
1730
|
-
for (let
|
|
1731
|
-
const
|
|
1732
|
-
e.monthDates[
|
|
1734
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
1735
|
+
const i = o - t;
|
|
1736
|
+
e.monthDates[o] = new Date(n, a + i, 1);
|
|
1733
1737
|
}
|
|
1734
1738
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1735
1739
|
}
|
|
@@ -1741,9 +1745,9 @@ async function gn(e, a) {
|
|
|
1741
1745
|
if (!e.options.unifiedNavigation) return;
|
|
1742
1746
|
const t = e.options.unifiedNavigationAnchorIndex ?? 0, n = e.monthDates[t].getMonth();
|
|
1743
1747
|
if (w.debug(`setUnifiedYear(${a}) - anchor index: ${t}, month: ${n}`), !!await Z(e, a, n, t)) {
|
|
1744
|
-
for (let
|
|
1745
|
-
const
|
|
1746
|
-
e.monthDates[
|
|
1748
|
+
for (let o = 0; o < e.monthDates.length; o++) {
|
|
1749
|
+
const i = o - t;
|
|
1750
|
+
e.monthDates[o] = new Date(a, n + i, 1);
|
|
1747
1751
|
}
|
|
1748
1752
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1749
1753
|
}
|
|
@@ -1751,20 +1755,20 @@ async function gn(e, a) {
|
|
|
1751
1755
|
function $t(e, a, t) {
|
|
1752
1756
|
if (!e) {
|
|
1753
1757
|
if (t != null && t.normalizedMinDate || t != null && t.normalizedMaxDate) {
|
|
1754
|
-
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1,
|
|
1755
|
-
return { min: n, max:
|
|
1758
|
+
const n = t.normalizedMinDate ? t.normalizedMinDate.getFullYear() : a - 1, r = t.normalizedMaxDate ? t.normalizedMaxDate.getFullYear() : a + 1;
|
|
1759
|
+
return { min: n, max: r };
|
|
1756
1760
|
}
|
|
1757
1761
|
return { min: a - 1, max: a + 1 };
|
|
1758
1762
|
}
|
|
1759
1763
|
if (e.includes("-")) {
|
|
1760
|
-
const [n,
|
|
1761
|
-
return { min: parseInt(n, 10), max: parseInt(
|
|
1764
|
+
const [n, r] = e.split("-");
|
|
1765
|
+
return { min: parseInt(n, 10), max: parseInt(r, 10) };
|
|
1762
1766
|
} else {
|
|
1763
1767
|
const n = parseInt(e, 10);
|
|
1764
1768
|
return { min: n, max: n };
|
|
1765
1769
|
}
|
|
1766
1770
|
}
|
|
1767
|
-
function
|
|
1771
|
+
function zt(e) {
|
|
1768
1772
|
if (!e)
|
|
1769
1773
|
return { min: 1, max: 12 };
|
|
1770
1774
|
const [a, t] = e.split("-");
|
|
@@ -1773,7 +1777,7 @@ function Pt(e) {
|
|
|
1773
1777
|
function hn(e) {
|
|
1774
1778
|
de.debug("[DatePicker 18] renderCalendar called, showingRollingSelector:", e.showingRollingSelector, `activeCol: ${e.activeMonthIndex}`), de.debug("[DatePicker 18] monthDates array:", e.monthDates.map((a, t) => `Col${t}: ${a.getFullYear()}-${a.getMonth() + 1}`).join(", ")), e.options.unifiedNavigation && e.showingUnifiedRollingSelector && mn(e);
|
|
1775
1779
|
for (let a = 0; a < e.options.visibleMonthsCount; a++)
|
|
1776
|
-
e.showingRollingSelector[a] ? Ft(e, a) :
|
|
1780
|
+
e.showingRollingSelector[a] ? Ft(e, a) : Pt(e, a);
|
|
1777
1781
|
if (e.focusedDayIndex !== null) {
|
|
1778
1782
|
const a = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${e.activeMonthIndex}"]`);
|
|
1779
1783
|
if (a) {
|
|
@@ -1783,156 +1787,167 @@ function hn(e) {
|
|
|
1783
1787
|
}
|
|
1784
1788
|
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
1785
1789
|
}
|
|
1786
|
-
function
|
|
1790
|
+
function Pt(e, a) {
|
|
1791
|
+
var I;
|
|
1787
1792
|
de.debug(`[DatePicker Col${a} 19] renderNormalView called for month`, a);
|
|
1788
1793
|
const t = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1789
1794
|
if (!t) return;
|
|
1790
1795
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1791
1796
|
n == null || n.classList.remove("drp-date-picker__rolling-selector--visible");
|
|
1792
|
-
const
|
|
1793
|
-
if (
|
|
1797
|
+
const r = e.monthDates[a], o = r.getFullYear(), i = r.getMonth(), s = e.monthNames[i], d = t.querySelector(".drp-date-picker__month-year");
|
|
1798
|
+
if (d) {
|
|
1799
|
+
const S = `${o}-${String(i).padStart(2, "0")}`;
|
|
1800
|
+
let v;
|
|
1801
|
+
(I = e.monthHeadersCache) != null && I.has(S) ? v = e.monthHeadersCache.get(S) : e.options.getMonthHeaderCallback ? v = e.options.getMonthHeaderCallback({
|
|
1802
|
+
month: r,
|
|
1803
|
+
monthIndex: a,
|
|
1804
|
+
monthName: s,
|
|
1805
|
+
year: o
|
|
1806
|
+
}) : v = `${s} ${o}`, d.textContent = v;
|
|
1807
|
+
}
|
|
1808
|
+
if (e.options.unifiedNavigation && a === 0 && e.unifiedRangeDisplay) {
|
|
1794
1809
|
e.unifiedRollingSelector && !e.showingUnifiedRollingSelector && e.unifiedRollingSelector.classList.remove("drp-date-picker__unified-rolling-selector--visible");
|
|
1795
|
-
const
|
|
1810
|
+
const S = e.monthDates[0], v = e.monthDates[e.monthDates.length - 1], _ = e.options.unifiedNavigationAnchorIndex ?? 0, R = e.monthDates[_];
|
|
1796
1811
|
if (e.options.getUnifiedHeaderCallback) {
|
|
1797
|
-
const
|
|
1798
|
-
firstMonth:
|
|
1799
|
-
lastMonth:
|
|
1800
|
-
anchorMonth:
|
|
1812
|
+
const y = e.options.getUnifiedHeaderCallback({
|
|
1813
|
+
firstMonth: S,
|
|
1814
|
+
lastMonth: v,
|
|
1815
|
+
anchorMonth: R,
|
|
1801
1816
|
monthNames: e.monthNames
|
|
1802
1817
|
});
|
|
1803
|
-
e.unifiedRangeDisplay.textContent =
|
|
1818
|
+
e.unifiedRangeDisplay.textContent = y;
|
|
1804
1819
|
} else {
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1820
|
+
const y = e.monthNames[S.getMonth()], M = e.monthNames[v.getMonth()], x = S.getFullYear(), E = v.getFullYear();
|
|
1821
|
+
x === E ? e.unifiedRangeDisplay.textContent = `${y} ${x} - ${M} ${E}` : e.unifiedRangeDisplay.textContent = `${y} ${x} - ${M} ${E}`;
|
|
1807
1822
|
}
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1823
|
+
const L = e.unifiedHeader;
|
|
1824
|
+
if (L) {
|
|
1825
|
+
const y = S.getMonth() === 0 ? S.getFullYear() - 1 : S.getFullYear(), M = S.getMonth() === 0 ? 11 : S.getMonth() - 1, x = L.querySelector(".drp-date-picker__nav--prev");
|
|
1826
|
+
x && (j(e, y, M) ? (x.removeAttribute("disabled"), x.classList.remove("drp-date-picker__nav--disabled")) : (x.setAttribute("disabled", "true"), x.classList.add("drp-date-picker__nav--disabled")));
|
|
1827
|
+
const E = v.getMonth() === 11 ? v.getFullYear() + 1 : v.getFullYear(), k = v.getMonth() === 11 ? 0 : v.getMonth() + 1, A = L.querySelector(".drp-date-picker__nav--next");
|
|
1828
|
+
A && (j(e, E, k) ? (A.removeAttribute("disabled"), A.classList.remove("drp-date-picker__nav--disabled")) : (A.setAttribute("disabled", "true"), A.classList.add("drp-date-picker__nav--disabled")));
|
|
1814
1829
|
}
|
|
1815
1830
|
}
|
|
1816
|
-
const
|
|
1817
|
-
c && (j(e, l, d) ? (c.removeAttribute("disabled"), c.classList.remove("drp-date-picker__nav--disabled")) : (c.setAttribute("disabled", "true"), c.classList.add("drp-date-picker__nav--disabled")));
|
|
1818
|
-
const p = s === 11 ? 0 : s + 1, u = s === 11 ? o + 1 : o, g = t.querySelector(".drp-date-picker__nav--next");
|
|
1831
|
+
const l = r.getFullYear(), c = r.getMonth(), p = c === 0 ? 11 : c - 1, u = c === 0 ? l - 1 : l, g = t.querySelector(".drp-date-picker__nav--prev");
|
|
1819
1832
|
g && (j(e, u, p) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
1820
|
-
const
|
|
1833
|
+
const f = c === 11 ? 0 : c + 1, h = c === 11 ? l + 1 : l, D = t.querySelector(".drp-date-picker__nav--next");
|
|
1834
|
+
D && (j(e, h, f) ? (D.removeAttribute("disabled"), D.classList.remove("drp-date-picker__nav--disabled")) : (D.setAttribute("disabled", "true"), D.classList.add("drp-date-picker__nav--disabled")));
|
|
1835
|
+
const m = t.querySelector(".drp-date-picker__weekdays"), C = [
|
|
1821
1836
|
...e.weekdayNames.slice(e.weekStartDay),
|
|
1822
1837
|
...e.weekdayNames.slice(0, e.weekStartDay)
|
|
1823
1838
|
];
|
|
1824
|
-
m && (m.innerHTML =
|
|
1839
|
+
m && (m.innerHTML = C.map((S) => `<div class="drp-date-picker__weekday">${S}</div>`).join("")), Nt(e, a, r);
|
|
1825
1840
|
}
|
|
1826
1841
|
function Nt(e, a, t) {
|
|
1827
1842
|
de.debug(`[DatePicker Col${a} 20] renderDays called for month`, a);
|
|
1828
1843
|
const n = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${a}"]`);
|
|
1829
1844
|
if (!n) return;
|
|
1830
|
-
const
|
|
1831
|
-
de.debug(`[DatePicker Col${a} 21] Rendering days for:`,
|
|
1832
|
-
const d = (new Date(
|
|
1833
|
-
for (let
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
date:
|
|
1845
|
+
const r = n.querySelector(".drp-date-picker__days"), o = t.getFullYear(), i = t.getMonth();
|
|
1846
|
+
de.debug(`[DatePicker Col${a} 21] Rendering days for:`, o, i + 1);
|
|
1847
|
+
const d = (new Date(o, i, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(o, i + 1, 0).getDate(), c = new Date(o, i, 0).getDate(), p = new Date(o, i - 1, 1), u = p.getFullYear(), g = p.getMonth(), f = new Date(o, i + 1, 1), h = f.getFullYear(), D = f.getMonth(), m = [];
|
|
1848
|
+
for (let _ = d - 1; _ >= 0; _--) {
|
|
1849
|
+
const R = c - _, L = new Date(u, g, R);
|
|
1850
|
+
m.push({
|
|
1851
|
+
date: L,
|
|
1837
1852
|
year: u,
|
|
1838
1853
|
month: g,
|
|
1839
|
-
day:
|
|
1854
|
+
day: R,
|
|
1840
1855
|
isOtherMonth: !0
|
|
1841
1856
|
});
|
|
1842
1857
|
}
|
|
1843
|
-
for (let
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
date:
|
|
1847
|
-
year:
|
|
1848
|
-
month:
|
|
1849
|
-
day:
|
|
1858
|
+
for (let _ = 1; _ <= l; _++) {
|
|
1859
|
+
const R = new Date(o, i, _);
|
|
1860
|
+
m.push({
|
|
1861
|
+
date: R,
|
|
1862
|
+
year: o,
|
|
1863
|
+
month: i,
|
|
1864
|
+
day: _,
|
|
1850
1865
|
isOtherMonth: !1
|
|
1851
1866
|
});
|
|
1852
1867
|
}
|
|
1853
|
-
const
|
|
1854
|
-
for (let
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
date:
|
|
1858
|
-
year:
|
|
1859
|
-
month:
|
|
1860
|
-
day:
|
|
1868
|
+
const I = Math.ceil((d + l) / 7) * 7 - (d + l);
|
|
1869
|
+
for (let _ = 1; _ <= I; _++) {
|
|
1870
|
+
const R = new Date(h, D, _);
|
|
1871
|
+
m.push({
|
|
1872
|
+
date: R,
|
|
1873
|
+
year: h,
|
|
1874
|
+
month: D,
|
|
1875
|
+
day: _,
|
|
1861
1876
|
isOtherMonth: !0
|
|
1862
1877
|
});
|
|
1863
1878
|
}
|
|
1864
|
-
const
|
|
1865
|
-
for (let
|
|
1866
|
-
|
|
1867
|
-
let
|
|
1868
|
-
for (const
|
|
1869
|
-
const
|
|
1870
|
-
const
|
|
1871
|
-
let
|
|
1872
|
-
if (e.options.badgeTooltipCallback && (
|
|
1873
|
-
const
|
|
1874
|
-
date:
|
|
1875
|
-
dateString: me(
|
|
1876
|
-
dayNumber:
|
|
1877
|
-
isDisabled: e.isDateDisabledInternal(
|
|
1879
|
+
const S = [];
|
|
1880
|
+
for (let _ = 0; _ < m.length; _ += 7)
|
|
1881
|
+
S.push(m.slice(_, _ + 7));
|
|
1882
|
+
let v = "";
|
|
1883
|
+
for (const _ of S) {
|
|
1884
|
+
const R = _.map((y) => {
|
|
1885
|
+
const M = e.getDateInfoInternal(y.date);
|
|
1886
|
+
let x = (M == null ? void 0 : M.badgeTooltip) || "";
|
|
1887
|
+
if (e.options.badgeTooltipCallback && (M != null && M.badgeText)) {
|
|
1888
|
+
const k = {
|
|
1889
|
+
date: y.date,
|
|
1890
|
+
dateString: me(y.date),
|
|
1891
|
+
dayNumber: y.day,
|
|
1892
|
+
isDisabled: e.isDateDisabledInternal(y.date),
|
|
1878
1893
|
isSelected: !1,
|
|
1879
1894
|
// Will be set below
|
|
1880
1895
|
isStartDate: !1,
|
|
1881
1896
|
isEndDate: !1,
|
|
1882
1897
|
isInRange: !1,
|
|
1883
|
-
isToday: ut(
|
|
1884
|
-
isWeekend:
|
|
1898
|
+
isToday: ut(y.date),
|
|
1899
|
+
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
1885
1900
|
monthIndex: a,
|
|
1886
1901
|
element: null,
|
|
1887
1902
|
// Not available during string rendering
|
|
1888
1903
|
picker: e
|
|
1889
|
-
},
|
|
1890
|
-
|
|
1904
|
+
}, A = e.options.badgeTooltipCallback(k);
|
|
1905
|
+
A !== null && (x = A);
|
|
1891
1906
|
}
|
|
1892
1907
|
return {
|
|
1893
|
-
text: (
|
|
1894
|
-
tooltip:
|
|
1895
|
-
class: (
|
|
1908
|
+
text: (M == null ? void 0 : M.badgeText) || "",
|
|
1909
|
+
tooltip: x,
|
|
1910
|
+
class: (M == null ? void 0 : M.badgeClass) || ""
|
|
1896
1911
|
};
|
|
1897
1912
|
});
|
|
1898
|
-
if (
|
|
1899
|
-
|
|
1900
|
-
for (const
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1913
|
+
if (R.some((y) => y.text)) {
|
|
1914
|
+
v += '<div class="drp-date-picker__badge-row">';
|
|
1915
|
+
for (const y of R)
|
|
1916
|
+
if (y.text) {
|
|
1917
|
+
const M = y.tooltip ? ` data-tooltip="${y.tooltip.replace(/"/g, """)}"` : "", x = y.class ? ` ${y.class}` : "";
|
|
1918
|
+
v += `<div class="drp-date-picker__badge-cell${x}"${M}>${y.text}</div>`;
|
|
1904
1919
|
} else
|
|
1905
|
-
|
|
1906
|
-
|
|
1920
|
+
v += '<div class="drp-date-picker__badge-cell"></div>';
|
|
1921
|
+
v += "</div>";
|
|
1907
1922
|
}
|
|
1908
|
-
|
|
1909
|
-
for (const
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1912
|
-
const
|
|
1913
|
-
|
|
1914
|
-
let
|
|
1915
|
-
e.options.selectionMode === "single" ?
|
|
1916
|
-
let
|
|
1923
|
+
v += '<div class="drp-date-picker__date-row">';
|
|
1924
|
+
for (const y of _) {
|
|
1925
|
+
const M = ["drp-date-picker__day"];
|
|
1926
|
+
y.isOtherMonth && M.push("drp-date-picker__day--other-month");
|
|
1927
|
+
const x = e.getDateInfoInternal(y.date), E = x && x.isDisabled !== void 0 ? x.isDisabled : e.isDateDisabledInternal(y.date);
|
|
1928
|
+
E && M.push("drp-date-picker__day--disabled"), x && x.dayClass && M.push(x.dayClass), e.isToday(y.date) && M.push("drp-date-picker__day--today");
|
|
1929
|
+
let k = !1;
|
|
1930
|
+
e.options.selectionMode === "single" ? k = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (k = e.selectedDates.some((q) => e.isSameDay(y.date, q))), k && M.push("drp-date-picker__day--selected");
|
|
1931
|
+
let A = !1, $ = !1, N = !1;
|
|
1917
1932
|
if (e.options.selectionMode === "range")
|
|
1918
|
-
|
|
1933
|
+
A = e.isSameDay(y.date, e.selectedStartDate), $ = e.isSameDay(y.date, e.selectedEndDate), N = e.isInRange(y.date), A && M.push("drp-date-picker__day--range-start"), $ && M.push("drp-date-picker__day--range-end"), N && (!E || e.options.highlightDisabledInRange) && M.push("drp-date-picker__day--in-range");
|
|
1919
1934
|
else if (e.options.selectionMode === "multiple")
|
|
1920
1935
|
for (const q of e.selectedRanges)
|
|
1921
|
-
e.isSameDay(
|
|
1922
|
-
const
|
|
1923
|
-
let P = (
|
|
1936
|
+
e.isSameDay(y.date, q.start) && (A = !0, M.push("drp-date-picker__day--range-start")), e.isSameDay(y.date, q.end) && ($ = !0, M.push("drp-date-picker__day--range-end")), y.date >= q.start && y.date <= q.end && (N = !0, (!E || e.options.highlightDisabledInRange) && M.push("drp-date-picker__day--in-range"));
|
|
1937
|
+
const z = `${y.year}-${String(y.month + 1).padStart(2, "0")}-${String(y.day).padStart(2, "0")}`;
|
|
1938
|
+
let P = (x == null ? void 0 : x.dayTooltip) || "";
|
|
1924
1939
|
if (e.options.dayTooltipCallback) {
|
|
1925
1940
|
const q = {
|
|
1926
|
-
date:
|
|
1927
|
-
dateString:
|
|
1928
|
-
dayNumber:
|
|
1929
|
-
isDisabled:
|
|
1930
|
-
isSelected:
|
|
1931
|
-
isStartDate:
|
|
1932
|
-
isEndDate:
|
|
1941
|
+
date: y.date,
|
|
1942
|
+
dateString: z,
|
|
1943
|
+
dayNumber: y.day,
|
|
1944
|
+
isDisabled: E,
|
|
1945
|
+
isSelected: k,
|
|
1946
|
+
isStartDate: A,
|
|
1947
|
+
isEndDate: $,
|
|
1933
1948
|
isInRange: N,
|
|
1934
|
-
isToday: e.isToday(
|
|
1935
|
-
isWeekend:
|
|
1949
|
+
isToday: e.isToday(y.date),
|
|
1950
|
+
isWeekend: y.date.getDay() === 0 || y.date.getDay() === 6,
|
|
1936
1951
|
monthIndex: a,
|
|
1937
1952
|
element: null,
|
|
1938
1953
|
// Not available during string rendering
|
|
@@ -1941,49 +1956,49 @@ function Nt(e, a, t) {
|
|
|
1941
1956
|
at !== null && (P = at);
|
|
1942
1957
|
}
|
|
1943
1958
|
const V = P ? ` data-tooltip="${P.replace(/"/g, """)}"` : "";
|
|
1944
|
-
|
|
1959
|
+
v += `<div class="${M.join(" ")}" data-date="${z}" data-day-number="${y.day}"${V}>`, v += `<slot name="day-${z}">${y.day}</slot>`, v += "</div>";
|
|
1945
1960
|
}
|
|
1946
|
-
|
|
1961
|
+
v += "</div>";
|
|
1947
1962
|
}
|
|
1948
|
-
|
|
1963
|
+
r && (r.innerHTML = v, fn(e, a, r));
|
|
1949
1964
|
}
|
|
1950
1965
|
function fn(e, a, t) {
|
|
1951
1966
|
if (!e.options.renderDayCallback && !e.options.renderDayContentCallback)
|
|
1952
1967
|
return;
|
|
1953
|
-
t.querySelectorAll(".drp-date-picker__day").forEach((
|
|
1954
|
-
const
|
|
1955
|
-
if (!
|
|
1956
|
-
const [d, l, c] =
|
|
1968
|
+
t.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
1969
|
+
const o = r, i = o.getAttribute("data-date"), s = parseInt(o.getAttribute("data-day-number") || "0", 10);
|
|
1970
|
+
if (!i) return;
|
|
1971
|
+
const [d, l, c] = i.split("-"), p = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), u = o.querySelector(`slot[name="day-${i}"]`);
|
|
1957
1972
|
if (u && u.assignedNodes().length > 0)
|
|
1958
1973
|
return;
|
|
1959
|
-
const
|
|
1974
|
+
const f = e.isDateDisabledInternal(p), h = e.isToday(p), D = p.getDay() === 0 || p.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(p, e.selectedDate), C = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedStartDate), I = e.options.selectionMode === "range" && e.isSameDay(p, e.selectedEndDate), S = e.options.selectionMode === "range" && e.isInRange(p), v = {
|
|
1960
1975
|
date: p,
|
|
1961
|
-
dateString:
|
|
1976
|
+
dateString: i,
|
|
1962
1977
|
dayNumber: s,
|
|
1963
|
-
isDisabled:
|
|
1964
|
-
isSelected:
|
|
1965
|
-
isStartDate:
|
|
1966
|
-
isEndDate:
|
|
1967
|
-
isInRange:
|
|
1968
|
-
isToday:
|
|
1969
|
-
isWeekend:
|
|
1978
|
+
isDisabled: f,
|
|
1979
|
+
isSelected: m || C || I,
|
|
1980
|
+
isStartDate: C,
|
|
1981
|
+
isEndDate: I,
|
|
1982
|
+
isInRange: S,
|
|
1983
|
+
isToday: h,
|
|
1984
|
+
isWeekend: D,
|
|
1970
1985
|
monthIndex: a,
|
|
1971
|
-
element:
|
|
1986
|
+
element: o,
|
|
1972
1987
|
picker: e
|
|
1973
1988
|
};
|
|
1974
1989
|
if (e.options.renderDayCallback)
|
|
1975
1990
|
try {
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1978
|
-
} catch (
|
|
1979
|
-
console.error("[DatePicker] Error in renderDayCallback:",
|
|
1991
|
+
const _ = e.options.renderDayCallback(v);
|
|
1992
|
+
_ != null && (typeof _ == "string" ? u && (u.innerHTML = _) : _ instanceof HTMLElement && u && (u.innerHTML = "", u.appendChild(_)));
|
|
1993
|
+
} catch (_) {
|
|
1994
|
+
console.error("[DatePicker] Error in renderDayCallback:", _);
|
|
1980
1995
|
}
|
|
1981
1996
|
else if (e.options.renderDayContentCallback)
|
|
1982
1997
|
try {
|
|
1983
|
-
const
|
|
1984
|
-
|
|
1985
|
-
} catch (
|
|
1986
|
-
console.error("[DatePicker] Error in renderDayContentCallback:",
|
|
1998
|
+
const _ = e.options.renderDayContentCallback(v);
|
|
1999
|
+
_ != null && (typeof _ == "string" ? u && (u.innerHTML += _) : _ instanceof HTMLElement && u && u.appendChild(_));
|
|
2000
|
+
} catch (_) {
|
|
2001
|
+
console.error("[DatePicker] Error in renderDayContentCallback:", _);
|
|
1987
2002
|
}
|
|
1988
2003
|
});
|
|
1989
2004
|
}
|
|
@@ -1992,19 +2007,19 @@ function Ft(e, a) {
|
|
|
1992
2007
|
if (!t) return;
|
|
1993
2008
|
const n = t.querySelector(".drp-date-picker__rolling-selector");
|
|
1994
2009
|
n == null || n.classList.add("drp-date-picker__rolling-selector--visible");
|
|
1995
|
-
const
|
|
2010
|
+
const r = e.monthDates[a], o = r.getFullYear(), i = r.getMonth(), s = $t(e.options.rollingYearRange, o, e), d = zt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
1996
2011
|
let c = "";
|
|
1997
2012
|
for (let u = s.min; u <= s.max; u++) {
|
|
1998
|
-
const g = u ===
|
|
1999
|
-
c += `<div class="drp-date-picker__rolling-item ${g} ${
|
|
2013
|
+
const g = u === o ? "drp-date-picker__rolling-item--selected" : "", h = ct(e, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2014
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${h}" data-year="${u}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2000
2015
|
}
|
|
2001
2016
|
l && (l.innerHTML = c);
|
|
2002
2017
|
const p = n == null ? void 0 : n.querySelector('[data-list="months"]');
|
|
2003
2018
|
if (p) {
|
|
2004
2019
|
let u = "";
|
|
2005
2020
|
for (let g = d.min - 1; g <= d.max - 1; g++) {
|
|
2006
|
-
const
|
|
2007
|
-
u += `<div class="drp-date-picker__rolling-item ${
|
|
2021
|
+
const f = e.monthNames[g], h = g === i ? "drp-date-picker__rolling-item--selected" : "", m = j(e, o, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2022
|
+
u += `<div class="drp-date-picker__rolling-item ${h} ${m}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${f}</span></div>`;
|
|
2008
2023
|
}
|
|
2009
2024
|
p.innerHTML = u;
|
|
2010
2025
|
}
|
|
@@ -2012,9 +2027,9 @@ function Ft(e, a) {
|
|
|
2012
2027
|
function mn(e) {
|
|
2013
2028
|
if (!e.options.unifiedNavigation || !e.unifiedRollingSelector) return;
|
|
2014
2029
|
e.unifiedRollingSelector.classList.add("drp-date-picker__unified-rolling-selector--visible");
|
|
2015
|
-
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(),
|
|
2030
|
+
const a = e.options.unifiedNavigationAnchorIndex ?? 0, t = e.monthDates[a], n = t.getFullYear(), r = t.getMonth(), o = e.getEffectiveYearRange(), i = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2016
2031
|
let d = "";
|
|
2017
|
-
for (let c =
|
|
2032
|
+
for (let c = o.min; c <= o.max; c++) {
|
|
2018
2033
|
const p = c === n ? "drp-date-picker__rolling-item--selected" : "", g = ct(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2019
2034
|
d += `<div class="drp-date-picker__rolling-item ${p} ${g}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2020
2035
|
}
|
|
@@ -2022,9 +2037,9 @@ function mn(e) {
|
|
|
2022
2037
|
const l = e.unifiedRollingSelector.querySelector('[data-list="months"]');
|
|
2023
2038
|
if (l) {
|
|
2024
2039
|
let c = "";
|
|
2025
|
-
for (let p =
|
|
2026
|
-
const u = e.monthNames[p], g = p ===
|
|
2027
|
-
c += `<div class="drp-date-picker__rolling-item ${g} ${
|
|
2040
|
+
for (let p = i.min - 1; p <= i.max - 1; p++) {
|
|
2041
|
+
const u = e.monthNames[p], g = p === r ? "drp-date-picker__rolling-item--selected" : "", h = j(e, n, p) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2042
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${h}" data-month="${p}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${u}</span></div>`;
|
|
2028
2043
|
}
|
|
2029
2044
|
l.innerHTML = c;
|
|
2030
2045
|
}
|
|
@@ -2034,12 +2049,12 @@ function bn(e) {
|
|
|
2034
2049
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2035
2050
|
if (a)
|
|
2036
2051
|
if (e.selectedStartDate && e.selectedEndDate) {
|
|
2037
|
-
let t, n,
|
|
2052
|
+
let t, n, r, o, i;
|
|
2038
2053
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2039
2054
|
n = e.getEnabledDatesInRange(
|
|
2040
2055
|
e.selectedStartDate,
|
|
2041
2056
|
e.selectedEndDate
|
|
2042
|
-
), t = n.length,
|
|
2057
|
+
), t = n.length, o = n, e.options.disabledDatesHandling === "split" && (i = e.splitRangeByDisabled(
|
|
2043
2058
|
e.selectedStartDate,
|
|
2044
2059
|
e.selectedEndDate
|
|
2045
2060
|
));
|
|
@@ -2047,7 +2062,7 @@ function bn(e) {
|
|
|
2047
2062
|
n = e.getEnabledDatesInRange(
|
|
2048
2063
|
e.selectedStartDate,
|
|
2049
2064
|
e.selectedEndDate
|
|
2050
|
-
),
|
|
2065
|
+
), r = e.getDisabledDatesInRange(
|
|
2051
2066
|
e.selectedStartDate,
|
|
2052
2067
|
e.selectedEndDate
|
|
2053
2068
|
);
|
|
@@ -2069,7 +2084,7 @@ function bn(e) {
|
|
|
2069
2084
|
localeStrings: e.localeStrings,
|
|
2070
2085
|
isPreview: !1
|
|
2071
2086
|
};
|
|
2072
|
-
n && (d.enabledDates = n),
|
|
2087
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2073
2088
|
} else
|
|
2074
2089
|
a.innerHTML = `
|
|
2075
2090
|
<span class="drp-date-picker__summary-count">${t} ${t === 1 ? e.localeStrings.day : e.localeStrings.days}</span>
|
|
@@ -2079,16 +2094,16 @@ function bn(e) {
|
|
|
2079
2094
|
} else
|
|
2080
2095
|
a.className = "drp-date-picker__summary drp-date-picker__summary--hidden", a.innerHTML = "";
|
|
2081
2096
|
}
|
|
2082
|
-
function
|
|
2097
|
+
function Ht(e) {
|
|
2083
2098
|
if (e.options.selectionMode !== "range") return;
|
|
2084
2099
|
const a = e.calendar.querySelector(".drp-date-picker__summary");
|
|
2085
2100
|
if (a && e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2086
|
-
let t, n,
|
|
2101
|
+
let t, n, r, o, i;
|
|
2087
2102
|
if (e.options.disabledDatesHandling === "individual" || e.options.disabledDatesHandling === "split")
|
|
2088
2103
|
n = e.getEnabledDatesInRange(
|
|
2089
2104
|
e.dragPreviewStart,
|
|
2090
2105
|
e.dragPreviewEnd
|
|
2091
|
-
), t = n.length,
|
|
2106
|
+
), t = n.length, o = n, e.options.disabledDatesHandling === "split" && (i = e.splitRangeByDisabled(
|
|
2092
2107
|
e.dragPreviewStart,
|
|
2093
2108
|
e.dragPreviewEnd
|
|
2094
2109
|
));
|
|
@@ -2096,7 +2111,7 @@ function Ot(e) {
|
|
|
2096
2111
|
n = e.getEnabledDatesInRange(
|
|
2097
2112
|
e.dragPreviewStart,
|
|
2098
2113
|
e.dragPreviewEnd
|
|
2099
|
-
),
|
|
2114
|
+
), r = e.getDisabledDatesInRange(
|
|
2100
2115
|
e.dragPreviewStart,
|
|
2101
2116
|
e.dragPreviewEnd
|
|
2102
2117
|
);
|
|
@@ -2118,7 +2133,7 @@ function Ot(e) {
|
|
|
2118
2133
|
localeStrings: e.localeStrings,
|
|
2119
2134
|
isPreview: !0
|
|
2120
2135
|
};
|
|
2121
|
-
n && (d.enabledDates = n),
|
|
2136
|
+
n && (d.enabledDates = n), r && (d.disabledDates = r), o && (d.dates = o), i && (d.dateRanges = i), a.innerHTML = e.options.formatSummaryCallback(d);
|
|
2122
2137
|
} else
|
|
2123
2138
|
a.innerHTML = `
|
|
2124
2139
|
<span style="opacity: 0.7;">${e.localeStrings.preview}: </span>
|
|
@@ -2129,22 +2144,22 @@ function Ot(e) {
|
|
|
2129
2144
|
}
|
|
2130
2145
|
}
|
|
2131
2146
|
function yn(e) {
|
|
2132
|
-
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((
|
|
2133
|
-
|
|
2147
|
+
if (e.calendar.querySelectorAll(".drp-date-picker__day--drag-preview, .drp-date-picker__day--drag-invalid").forEach((r) => {
|
|
2148
|
+
r.classList.remove("drp-date-picker__day--drag-preview", "drp-date-picker__day--drag-invalid");
|
|
2134
2149
|
}), !e.dragPreviewStart || !e.dragPreviewEnd) return;
|
|
2135
2150
|
const t = e.options.disabledDatesHandling === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd);
|
|
2136
|
-
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((
|
|
2137
|
-
const
|
|
2138
|
-
if (!
|
|
2139
|
-
const [
|
|
2140
|
-
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (
|
|
2141
|
-
}),
|
|
2142
|
-
}
|
|
2143
|
-
async function
|
|
2151
|
+
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((r) => {
|
|
2152
|
+
const o = r.dataset.date;
|
|
2153
|
+
if (!o) return;
|
|
2154
|
+
const [i, s, d] = o.split("-").map(Number), l = new Date(i, s - 1, d);
|
|
2155
|
+
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"));
|
|
2156
|
+
}), Ht(e);
|
|
2157
|
+
}
|
|
2158
|
+
async function Ot(e, a) {
|
|
2144
2159
|
if (!e.options.beforeDateSelectCallback)
|
|
2145
2160
|
return { isValid: !0 };
|
|
2146
2161
|
try {
|
|
2147
|
-
e.isValidating = !0,
|
|
2162
|
+
e.isValidating = !0, Le(e);
|
|
2148
2163
|
const t = await Promise.resolve(e.options.beforeDateSelectCallback(a));
|
|
2149
2164
|
switch (ae(e), e.isValidating = !1, t.action) {
|
|
2150
2165
|
case "accept":
|
|
@@ -2164,7 +2179,7 @@ async function Yt(e, a) {
|
|
|
2164
2179
|
return { isValid: !1, message: "Unknown validation action" };
|
|
2165
2180
|
}
|
|
2166
2181
|
} catch (t) {
|
|
2167
|
-
return ae(e), e.isValidating = !1,
|
|
2182
|
+
return ae(e), e.isValidating = !1, O.error("beforeDateSelectCallback error:", t), { isValid: !1, message: "Validation error occurred" };
|
|
2168
2183
|
}
|
|
2169
2184
|
}
|
|
2170
2185
|
async function Bt(e, a, t) {
|
|
@@ -2173,10 +2188,10 @@ async function Bt(e, a, t) {
|
|
|
2173
2188
|
return ee.debug(" PREVENT mode - range contains disabled dates"), { isValid: !1, message: "Range contains disabled dates" };
|
|
2174
2189
|
} else if (e.options.disabledDatesHandling === "block" && (ee.debug(" Checking BLOCK mode"), e.hasDisabledDatesInRange(a, t))) {
|
|
2175
2190
|
ee.debug(" BLOCK mode - range contains disabled dates, adjusting");
|
|
2176
|
-
const
|
|
2177
|
-
return ee.debug(" BLOCK mode - adjusted end:",
|
|
2191
|
+
const r = e.findLastEnabledBeforeGap(a, t);
|
|
2192
|
+
return ee.debug(" BLOCK mode - adjusted end:", r), { isValid: !0, adjustedStart: a, adjustedEnd: r };
|
|
2178
2193
|
}
|
|
2179
|
-
const n = await
|
|
2194
|
+
const n = await Ot(e, { start: a, end: t });
|
|
2180
2195
|
return n.isValid ? n.adjustedStart || n.adjustedEnd ? {
|
|
2181
2196
|
isValid: !0,
|
|
2182
2197
|
adjustedStart: n.adjustedStart,
|
|
@@ -2187,40 +2202,40 @@ async function Bt(e, a, t) {
|
|
|
2187
2202
|
async function vn(e, a) {
|
|
2188
2203
|
if (a.classList.contains("drp-date-picker__day--disabled")) return;
|
|
2189
2204
|
if (!a.dataset || !a.dataset.date) {
|
|
2190
|
-
|
|
2205
|
+
O.warn("selectDay() - called with invalid element:", a);
|
|
2191
2206
|
return;
|
|
2192
2207
|
}
|
|
2193
|
-
const [t, n,
|
|
2208
|
+
const [t, n, r] = a.dataset.date.split("-").map(Number), o = new Date(t, n - 1, r);
|
|
2194
2209
|
a.classList.contains("drp-date-picker__day--other-month");
|
|
2195
|
-
const
|
|
2196
|
-
if (
|
|
2197
|
-
e.activeMonthIndex = parseInt(
|
|
2198
|
-
const s =
|
|
2199
|
-
e.focusedDayIndex = Array.from(s).indexOf(a),
|
|
2210
|
+
const i = a.closest(".drp-date-picker__days");
|
|
2211
|
+
if (i && i instanceof HTMLElement) {
|
|
2212
|
+
e.activeMonthIndex = parseInt(i.dataset.monthIndex || "0") || 0, ie.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
2213
|
+
const s = i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2214
|
+
e.focusedDayIndex = Array.from(s).indexOf(a), ie.debug(`Col${e.activeMonthIndex} selectDay - set focusedDayIndex to:`, e.focusedDayIndex);
|
|
2200
2215
|
}
|
|
2201
2216
|
if (e.options.selectionMode === "single") {
|
|
2202
|
-
const s = await
|
|
2217
|
+
const s = await Ot(e, o);
|
|
2203
2218
|
if (!s.isValid) {
|
|
2204
|
-
|
|
2219
|
+
ie.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
2205
2220
|
return;
|
|
2206
2221
|
}
|
|
2207
|
-
const d = s.adjustedDate ||
|
|
2222
|
+
const d = s.adjustedDate || o;
|
|
2208
2223
|
e.selectedDate = d, e.input && (e.requiresApplyButton() || (e.input.value = e.formatDate(d))), e.requiresApplyButton() ? e.pendingSelection = d : e.options.onSelect && e.options.onSelect(d), e.options.positioningMode === "floating" && e.shouldAutoClose() && e.hide();
|
|
2209
2224
|
} else if (e.options.selectionMode === "multiple") {
|
|
2210
|
-
const s = `${
|
|
2211
|
-
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(
|
|
2225
|
+
const s = `${o.getFullYear()}-${String(o.getMonth() + 1).padStart(2, "0")}-${String(o.getDate()).padStart(2, "0")}`, d = e.selectedDates.findIndex((l) => `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` === s);
|
|
2226
|
+
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(o)), e.input && !e.requiresApplyButton()) {
|
|
2212
2227
|
const l = e.selectedDates.length + e.selectedRanges.length;
|
|
2213
2228
|
e.input.value = l > 0 ? `${l} selection(s)` : "";
|
|
2214
2229
|
}
|
|
2215
2230
|
e.selectedRanges.length > 0 && e.selectedDates.length > 0 ? e.pendingSelection = [...e.selectedRanges, ...e.selectedDates] : e.selectedRanges.length > 0 ? e.pendingSelection = e.selectedRanges : e.pendingSelection = e.selectedDates;
|
|
2216
2231
|
} else if (!e.selectedStartDate || e.selectedEndDate)
|
|
2217
|
-
e.selectedStartDate =
|
|
2232
|
+
e.selectedStartDate = o, e.selectedEndDate = null, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ...`));
|
|
2218
2233
|
else {
|
|
2219
|
-
let s = e.selectedStartDate, d =
|
|
2220
|
-
|
|
2234
|
+
let s = e.selectedStartDate, d = o;
|
|
2235
|
+
o < e.selectedStartDate && (d = e.selectedStartDate, s = o), ie.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
2221
2236
|
const l = await Bt(e, s, d);
|
|
2222
|
-
if (
|
|
2223
|
-
l.message &&
|
|
2237
|
+
if (ie.debug(" selectDay - validation result:", l), !l.isValid) {
|
|
2238
|
+
l.message && O.warn("selectDay() - range validation failed:", l.message), e.renderCalendar(), e.updateSummary();
|
|
2224
2239
|
return;
|
|
2225
2240
|
}
|
|
2226
2241
|
e.selectedStartDate = l.adjustedStart || s, e.selectedEndDate = l.adjustedEnd || d, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
@@ -2236,10 +2251,10 @@ async function vn(e, a) {
|
|
|
2236
2251
|
const c = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${d}"]`);
|
|
2237
2252
|
if (c) {
|
|
2238
2253
|
const p = c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), u = Array.from(p).findIndex((g) => {
|
|
2239
|
-
const
|
|
2240
|
-
if (!
|
|
2241
|
-
const [
|
|
2242
|
-
return e.isSameDay(
|
|
2254
|
+
const f = g.dataset.date;
|
|
2255
|
+
if (!f) return !1;
|
|
2256
|
+
const [h, D, m] = f.split("-").map(Number), C = new Date(h, D - 1, m);
|
|
2257
|
+
return e.isSameDay(C, s);
|
|
2243
2258
|
});
|
|
2244
2259
|
u !== -1 && (e.focusedDayIndex = u, p.forEach((g) => g.classList.remove("drp-date-picker__day--focused")), p[u] && p[u].classList.add("drp-date-picker__day--focused"));
|
|
2245
2260
|
}
|
|
@@ -2273,58 +2288,58 @@ function wn(e) {
|
|
|
2273
2288
|
function xn(e) {
|
|
2274
2289
|
e.options.selectionMode === "range" && e.calendar.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--disabled)").forEach((t) => {
|
|
2275
2290
|
t.addEventListener("mousedown", (n) => {
|
|
2276
|
-
const
|
|
2291
|
+
const r = n, o = t, i = r.clientX, s = r.clientY, d = 5;
|
|
2277
2292
|
let l = !1, c = !1;
|
|
2278
|
-
const p =
|
|
2293
|
+
const p = o.classList.contains("drp-date-picker__day--range-start"), u = o.classList.contains("drp-date-picker__day--range-end");
|
|
2279
2294
|
let g;
|
|
2280
2295
|
p && e.selectedStartDate && e.selectedEndDate ? g = "start" : u && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
2281
|
-
const
|
|
2282
|
-
const
|
|
2283
|
-
!l && (
|
|
2284
|
-
},
|
|
2285
|
-
document.removeEventListener("mousemove",
|
|
2296
|
+
const f = (D) => {
|
|
2297
|
+
const m = Math.abs(D.clientX - i), C = Math.abs(D.clientY - s);
|
|
2298
|
+
!l && (m > d || C > d) && (l = !0), l && !c && (c = !0, Yt(e, r, g, o), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h));
|
|
2299
|
+
}, h = () => {
|
|
2300
|
+
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", h);
|
|
2286
2301
|
};
|
|
2287
|
-
document.addEventListener("mousemove",
|
|
2302
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", h);
|
|
2288
2303
|
});
|
|
2289
2304
|
});
|
|
2290
2305
|
}
|
|
2291
|
-
function
|
|
2306
|
+
function Yt(e, a, t, n) {
|
|
2292
2307
|
a.preventDefault(), a.stopPropagation(), e.isDragging = !0, e.draggingType = t;
|
|
2293
|
-
const
|
|
2294
|
-
let
|
|
2295
|
-
if (
|
|
2296
|
-
const [s, d, l] =
|
|
2297
|
-
|
|
2308
|
+
const r = n, o = r.dataset.date;
|
|
2309
|
+
let i = null;
|
|
2310
|
+
if (o) {
|
|
2311
|
+
const [s, d, l] = o.split("-").map(Number);
|
|
2312
|
+
i = new Date(s, d - 1, l);
|
|
2298
2313
|
}
|
|
2299
|
-
!e.selectedStartDate && !e.selectedEndDate ?
|
|
2314
|
+
!e.selectedStartDate && !e.selectedEndDate ? i && (e.originalStartDate = i, e.originalEndDate = null, e.draggingType = "end") : i && e.selectedStartDate && !e.selectedEndDate ? i.getTime() === e.selectedStartDate.getTime() ? (e.originalStartDate = new Date(e.selectedStartDate), e.originalEndDate = null) : (e.selectedStartDate = null, e.selectedEndDate = null, e.focusedDayIndex = null, e.calendar.querySelectorAll(".drp-date-picker__day--range-start, .drp-date-picker__day--range-end, .drp-date-picker__day--selected, .drp-date-picker__day--focused").forEach((d) => {
|
|
2300
2315
|
d.classList.remove("drp-date-picker__day--range-start", "drp-date-picker__day--range-end", "drp-date-picker__day--selected", "drp-date-picker__day--focused");
|
|
2301
|
-
}), e.originalStartDate =
|
|
2316
|
+
}), e.originalStartDate = i, 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"), U.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => Vt(e, s), e.onDragEndBound = async (s) => await qt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
2302
2317
|
}
|
|
2303
2318
|
function Vt(e, a) {
|
|
2304
2319
|
if (!e.isDragging) return;
|
|
2305
2320
|
let t = null;
|
|
2306
2321
|
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);
|
|
2307
|
-
const n = t == null ? void 0 : t.closest(".drp-date-picker__nav--prev"),
|
|
2308
|
-
if (n ||
|
|
2322
|
+
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");
|
|
2323
|
+
if (n || r) {
|
|
2309
2324
|
if (!e.navInterval) {
|
|
2310
|
-
const u = (n ||
|
|
2325
|
+
const u = (n || r).closest(".drp-date-picker__month");
|
|
2311
2326
|
if (u && u instanceof HTMLElement) {
|
|
2312
|
-
const g = parseInt(u.dataset.monthIndex || "0"),
|
|
2313
|
-
|
|
2314
|
-
|
|
2327
|
+
const g = parseInt(u.dataset.monthIndex || "0"), f = !!n;
|
|
2328
|
+
f ? e.prevMonth(g) : e.nextMonth(g), e.navInterval = window.setInterval(() => {
|
|
2329
|
+
f ? e.prevMonth(g) : e.nextMonth(g);
|
|
2315
2330
|
}, 1e3);
|
|
2316
2331
|
}
|
|
2317
2332
|
}
|
|
2318
2333
|
return;
|
|
2319
2334
|
} else
|
|
2320
2335
|
e.navInterval && (clearInterval(e.navInterval), e.navInterval = null);
|
|
2321
|
-
const
|
|
2322
|
-
if (!
|
|
2323
|
-
const
|
|
2324
|
-
if (!
|
|
2325
|
-
const [s, d, l] =
|
|
2336
|
+
const o = t;
|
|
2337
|
+
if (!o || !o.classList.contains("drp-date-picker__day")) return;
|
|
2338
|
+
const i = o.dataset.date;
|
|
2339
|
+
if (!i) return;
|
|
2340
|
+
const [s, d, l] = i.split("-").map(Number);
|
|
2326
2341
|
let c = new Date(s, d - 1, l);
|
|
2327
|
-
if (
|
|
2342
|
+
if (o.classList.contains("drp-date-picker__day--disabled")) {
|
|
2328
2343
|
const p = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
2329
2344
|
c = $e(e, c, p);
|
|
2330
2345
|
}
|
|
@@ -2350,13 +2365,13 @@ async function qt(e, a) {
|
|
|
2350
2365
|
if (U.debug("Ended dragging, finalizing selection"), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2351
2366
|
let t = $e(e, e.dragPreviewStart, "forward"), n = $e(e, e.dragPreviewEnd, "backward");
|
|
2352
2367
|
t > n && ([t, n] = [n, t]), U.debug("onDragEnd - calling validateRangeAsync with:", t, n);
|
|
2353
|
-
const
|
|
2354
|
-
if (U.debug("onDragEnd - validation result:",
|
|
2355
|
-
|
|
2368
|
+
const r = await Bt(e, t, n);
|
|
2369
|
+
if (U.debug("onDragEnd - validation result:", r), !r.isValid)
|
|
2370
|
+
r.message && O.warn("onDragEnd() - drag validation failed:", r.message);
|
|
2356
2371
|
else {
|
|
2357
|
-
e.selectedStartDate =
|
|
2358
|
-
const
|
|
2359
|
-
e.requiresApplyButton() ? e.pendingSelection =
|
|
2372
|
+
e.selectedStartDate = r.adjustedStart || t, e.selectedEndDate = r.adjustedEnd || n, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
2373
|
+
const o = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2374
|
+
e.requiresApplyButton() ? e.pendingSelection = o : e.options.onSelect && e.options.onSelect(o);
|
|
2360
2375
|
}
|
|
2361
2376
|
}
|
|
2362
2377
|
if (e.isDragging = !1, e.draggingType = null, e.dragPreviewStart = null, e.dragPreviewEnd = null, e.calendar.querySelectorAll(".drp-date-picker__day--dragging").forEach((t) => {
|
|
@@ -2364,18 +2379,18 @@ async function qt(e, a) {
|
|
|
2364
2379
|
}), 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) {
|
|
2365
2380
|
const t = e.selectedEndDate;
|
|
2366
2381
|
for (let n = 0; n < e.monthDates.length; n++) {
|
|
2367
|
-
const
|
|
2368
|
-
if (t.getFullYear() ===
|
|
2382
|
+
const r = e.monthDates[n];
|
|
2383
|
+
if (t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth()) {
|
|
2369
2384
|
e.activeMonthIndex = n;
|
|
2370
|
-
const
|
|
2371
|
-
if (
|
|
2372
|
-
const
|
|
2385
|
+
const o = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
2386
|
+
if (o) {
|
|
2387
|
+
const i = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(i).findIndex((d) => {
|
|
2373
2388
|
const l = d.dataset.date;
|
|
2374
2389
|
if (!l) return !1;
|
|
2375
2390
|
const [c, p, u] = l.split("-").map(Number), g = new Date(c, p - 1, u);
|
|
2376
2391
|
return e.isSameDay(g, t);
|
|
2377
2392
|
});
|
|
2378
|
-
s !== -1 && (e.focusedDayIndex = s,
|
|
2393
|
+
s !== -1 && (e.focusedDayIndex = s, i.forEach((d) => d.classList.remove("drp-date-picker__day--focused")), i[s] && i[s].classList.add("drp-date-picker__day--focused"));
|
|
2379
2394
|
}
|
|
2380
2395
|
break;
|
|
2381
2396
|
}
|
|
@@ -2385,52 +2400,52 @@ async function qt(e, a) {
|
|
|
2385
2400
|
}
|
|
2386
2401
|
}
|
|
2387
2402
|
function $e(e, a, t = "forward") {
|
|
2388
|
-
let
|
|
2389
|
-
if (
|
|
2390
|
-
return
|
|
2391
|
-
const
|
|
2403
|
+
let r = new Date(a);
|
|
2404
|
+
if (r.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(r))
|
|
2405
|
+
return r;
|
|
2406
|
+
const o = t === "forward" ? 1 : -1;
|
|
2392
2407
|
for (let s = 1; s <= 60; s++) {
|
|
2393
2408
|
const d = new Date(a);
|
|
2394
|
-
if (d.setDate(d.getDate() + s *
|
|
2409
|
+
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2395
2410
|
return d;
|
|
2396
2411
|
}
|
|
2397
|
-
const
|
|
2412
|
+
const i = -o;
|
|
2398
2413
|
for (let s = 1; s <= 60; s++) {
|
|
2399
2414
|
const d = new Date(a);
|
|
2400
|
-
if (d.setDate(d.getDate() + s *
|
|
2415
|
+
if (d.setDate(d.getDate() + s * i), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2401
2416
|
return d;
|
|
2402
2417
|
}
|
|
2403
2418
|
return a;
|
|
2404
2419
|
}
|
|
2405
2420
|
function Mn(e, a) {
|
|
2406
|
-
const t = a.target, n = t.value,
|
|
2421
|
+
const t = a.target, n = t.value, r = t.selectionStart || 0, o = e._previousInputValue || "", i = n.length < o.length, { separator: s } = e.formatInfo;
|
|
2407
2422
|
if (e.options.selectionMode === "range") {
|
|
2408
2423
|
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}to ]`, "gi"), ""), l = Ut(e, d);
|
|
2409
2424
|
if (l !== n) {
|
|
2410
2425
|
t.value = l;
|
|
2411
|
-
let c =
|
|
2412
|
-
if (
|
|
2413
|
-
c =
|
|
2426
|
+
let c = r;
|
|
2427
|
+
if (i)
|
|
2428
|
+
c = r;
|
|
2414
2429
|
else if (l.length > n.length)
|
|
2415
2430
|
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
2416
2431
|
const p = l.indexOf(" to ");
|
|
2417
|
-
|
|
2432
|
+
r >= p && r <= p + 4 ? c = p + 4 : c = r + (l.length - n.length);
|
|
2418
2433
|
} else
|
|
2419
|
-
c =
|
|
2434
|
+
c = r + (l.length - n.length);
|
|
2420
2435
|
t.setSelectionRange(c, c);
|
|
2421
2436
|
}
|
|
2422
2437
|
} else {
|
|
2423
2438
|
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l = pe(e, d);
|
|
2424
2439
|
if (l !== n) {
|
|
2425
2440
|
t.value = l;
|
|
2426
|
-
let c =
|
|
2427
|
-
if (
|
|
2428
|
-
c =
|
|
2429
|
-
else if (l.length > n.length && l[
|
|
2430
|
-
c =
|
|
2441
|
+
let c = r;
|
|
2442
|
+
if (i)
|
|
2443
|
+
c = r;
|
|
2444
|
+
else if (l.length > n.length && l[r] === s)
|
|
2445
|
+
c = r + 1;
|
|
2431
2446
|
else if (l.length > n.length) {
|
|
2432
|
-
const p = (n.substring(0,
|
|
2433
|
-
c =
|
|
2447
|
+
const p = (n.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, r).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - p;
|
|
2448
|
+
c = r + g;
|
|
2434
2449
|
}
|
|
2435
2450
|
t.setSelectionRange(c, c);
|
|
2436
2451
|
}
|
|
@@ -2439,39 +2454,39 @@ function Mn(e, a) {
|
|
|
2439
2454
|
}
|
|
2440
2455
|
function pe(e, a) {
|
|
2441
2456
|
var c, p, u;
|
|
2442
|
-
const { separator: t, parts: n, maxLength:
|
|
2443
|
-
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length:
|
|
2457
|
+
const { separator: t, parts: n, maxLength: r } = e.formatInfo, o = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), i = n.year ? n.year.length : 4, s = [
|
|
2458
|
+
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: i },
|
|
2444
2459
|
{ type: "month", pos: ((p = n.month) == null ? void 0 : p.index) ?? 1, length: 2 },
|
|
2445
2460
|
{ type: "day", pos: ((u = n.day) == null ? void 0 : u.index) ?? 2, length: 2 }
|
|
2446
|
-
].sort((g,
|
|
2461
|
+
].sort((g, f) => g.pos - f.pos);
|
|
2447
2462
|
let d = "", l = 0;
|
|
2448
2463
|
for (let g = 0; g < s.length; g++) {
|
|
2449
|
-
const
|
|
2450
|
-
if (!
|
|
2451
|
-
d +=
|
|
2464
|
+
const f = s[g], h = o.substring(l, l + f.length);
|
|
2465
|
+
if (!h) break;
|
|
2466
|
+
d += h, l += h.length, g < s.length - 1 && h.length === f.length && (d += t);
|
|
2452
2467
|
}
|
|
2453
|
-
return d.substring(0,
|
|
2468
|
+
return d.substring(0, r);
|
|
2454
2469
|
}
|
|
2455
2470
|
function Ut(e, a) {
|
|
2456
|
-
const { separator: t, maxLength: n } = e.formatInfo,
|
|
2457
|
-
let
|
|
2458
|
-
if (a.includes(
|
|
2459
|
-
const d = a.split(
|
|
2460
|
-
|
|
2471
|
+
const { separator: t, maxLength: n } = e.formatInfo, r = " to ";
|
|
2472
|
+
let o = "", i = "";
|
|
2473
|
+
if (a.includes(r)) {
|
|
2474
|
+
const d = a.split(r);
|
|
2475
|
+
o = d[0], i = d.slice(1).join(r);
|
|
2461
2476
|
} else
|
|
2462
|
-
|
|
2463
|
-
const s = pe(e,
|
|
2477
|
+
o = a;
|
|
2478
|
+
const s = pe(e, o);
|
|
2464
2479
|
if (s.length === n)
|
|
2465
|
-
if (a.includes(
|
|
2466
|
-
const d = pe(e,
|
|
2467
|
-
return s +
|
|
2480
|
+
if (a.includes(r)) {
|
|
2481
|
+
const d = pe(e, i);
|
|
2482
|
+
return s + r + d;
|
|
2468
2483
|
} else
|
|
2469
|
-
return s +
|
|
2484
|
+
return s + r;
|
|
2470
2485
|
else
|
|
2471
2486
|
return s;
|
|
2472
2487
|
}
|
|
2473
2488
|
function Sn(e, a) {
|
|
2474
|
-
const { key: t, ctrlKey: n, metaKey:
|
|
2489
|
+
const { key: t, ctrlKey: n, metaKey: r } = a, { separator: o } = e.formatInfo;
|
|
2475
2490
|
if (e.calendar.classList.contains("drp-date-picker--visible") && ["ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(t)) {
|
|
2476
2491
|
a.preventDefault();
|
|
2477
2492
|
return;
|
|
@@ -2488,61 +2503,61 @@ function Sn(e, a) {
|
|
|
2488
2503
|
"ArrowDown",
|
|
2489
2504
|
"Home",
|
|
2490
2505
|
"End"
|
|
2491
|
-
].includes(t) || n ||
|
|
2492
|
-
if (t ===
|
|
2506
|
+
].includes(t) || n || r)) {
|
|
2507
|
+
if (t === o) {
|
|
2493
2508
|
const s = a.target, d = s.selectionStart || 0, l = s.value;
|
|
2494
2509
|
let c = 0;
|
|
2495
2510
|
for (let u = d - 1; u >= 0; u--)
|
|
2496
|
-
if (l[u] ===
|
|
2511
|
+
if (l[u] === o || l[u] === " ") {
|
|
2497
2512
|
c = u + 1;
|
|
2498
2513
|
break;
|
|
2499
2514
|
}
|
|
2500
2515
|
const p = l.substring(c, d);
|
|
2501
2516
|
if (/^\d$/.test(p)) {
|
|
2502
2517
|
a.preventDefault();
|
|
2503
|
-
const u = l.substring(0, c) + "0" + p +
|
|
2518
|
+
const u = l.substring(0, c) + "0" + p + o + l.substring(d);
|
|
2504
2519
|
s.value = u;
|
|
2505
|
-
const g = c + 2 +
|
|
2520
|
+
const g = c + 2 + o.length;
|
|
2506
2521
|
s.setSelectionRange(g, g), e._previousInputValue = u, s.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
2507
2522
|
return;
|
|
2508
2523
|
}
|
|
2509
2524
|
}
|
|
2510
|
-
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !==
|
|
2525
|
+
e.options.selectionMode === "range" ? !/^\d$/.test(t) && t !== o && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== o && a.preventDefault();
|
|
2511
2526
|
}
|
|
2512
2527
|
}
|
|
2513
2528
|
function Cn(e, a) {
|
|
2514
2529
|
var u;
|
|
2515
2530
|
a.preventDefault();
|
|
2516
|
-
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo,
|
|
2517
|
-
|
|
2518
|
-
const p = s +
|
|
2519
|
-
|
|
2531
|
+
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo, r = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), o = pe(e, r), i = a.target, s = i.selectionStart || 0, d = i.selectionEnd || 0, l = i.value, c = l.substring(0, s) + o + l.substring(d);
|
|
2532
|
+
i.value = pe(e, c);
|
|
2533
|
+
const p = s + o.length;
|
|
2534
|
+
i.setSelectionRange(p, p), i.dispatchEvent(new Event("input", { bubbles: !0 })), tt(e);
|
|
2520
2535
|
}
|
|
2521
2536
|
function tt(e) {
|
|
2522
2537
|
if (!e.input) return;
|
|
2523
2538
|
const a = e.input.value;
|
|
2524
2539
|
if (oe.debug("updateCalendarFromInput - value:", a), !a) return;
|
|
2525
|
-
const { separator: t, parts: n, maxLength:
|
|
2526
|
-
if (oe.debug("Format info:", { separator: t, parts: n, maxLength:
|
|
2527
|
-
const
|
|
2540
|
+
const { separator: t, parts: n, maxLength: r } = e.formatInfo;
|
|
2541
|
+
if (oe.debug("Format info:", { separator: t, parts: n, maxLength: r }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
2542
|
+
const i = a.split(" to "), s = i[0], d = i[1];
|
|
2528
2543
|
oe.debug("Range parts - start:", s, "end:", d), Ce(e, s, "start"), d && Ce(e, d, "end");
|
|
2529
2544
|
return;
|
|
2530
2545
|
}
|
|
2531
|
-
const
|
|
2532
|
-
Ce(e, a,
|
|
2546
|
+
const o = e.options.selectionMode === "range" ? "start" : "single";
|
|
2547
|
+
Ce(e, a, o);
|
|
2533
2548
|
}
|
|
2534
2549
|
function Ce(e, a, t = "single") {
|
|
2535
|
-
const { separator: n, parts:
|
|
2550
|
+
const { separator: n, parts: r, maxLength: o } = e.formatInfo, i = a.split(n);
|
|
2536
2551
|
let s = null, d = null, l = null;
|
|
2537
|
-
if (
|
|
2552
|
+
if (i.forEach((c, p) => {
|
|
2538
2553
|
if (c) {
|
|
2539
|
-
if (
|
|
2554
|
+
if (r.year && r.year.index === p) {
|
|
2540
2555
|
const u = parseInt(c, 10);
|
|
2541
|
-
|
|
2542
|
-
} else if (
|
|
2556
|
+
r.year.length === 4 && c.length === 4 ? s = u : r.year.length === 2 && c.length === 2 && (s = u < 100 ? u + 2e3 : u);
|
|
2557
|
+
} else if (r.month && r.month.index === p) {
|
|
2543
2558
|
const u = parseInt(c, 10);
|
|
2544
2559
|
c.length === 2 && u >= 1 && u <= 12 && (d = u);
|
|
2545
|
-
} else if (
|
|
2560
|
+
} else if (r.day && r.day.index === p) {
|
|
2546
2561
|
const u = parseInt(c, 10);
|
|
2547
2562
|
c.length === 2 && u >= 1 && u <= 31 && (l = u);
|
|
2548
2563
|
}
|
|
@@ -2567,8 +2582,8 @@ function Ce(e, a, t = "single") {
|
|
|
2567
2582
|
}
|
|
2568
2583
|
e.monthDates = [];
|
|
2569
2584
|
for (let u = 0; u < e.options.visibleMonthsCount; u++) {
|
|
2570
|
-
const g = e.displayMonths[u],
|
|
2571
|
-
e.monthDates.push(
|
|
2585
|
+
const g = e.displayMonths[u], f = new Date(g.year, g.month, 1);
|
|
2586
|
+
e.monthDates.push(f);
|
|
2572
2587
|
}
|
|
2573
2588
|
}
|
|
2574
2589
|
e.renderCalendar();
|
|
@@ -2620,7 +2635,7 @@ const Ue = {
|
|
|
2620
2635
|
nights: "noches"
|
|
2621
2636
|
}
|
|
2622
2637
|
};
|
|
2623
|
-
function
|
|
2638
|
+
function He(e) {
|
|
2624
2639
|
if (e !== "auto")
|
|
2625
2640
|
return e;
|
|
2626
2641
|
if (typeof navigator < "u" && navigator.language) {
|
|
@@ -2630,33 +2645,33 @@ function Oe(e) {
|
|
|
2630
2645
|
return "en";
|
|
2631
2646
|
}
|
|
2632
2647
|
function In(e, a) {
|
|
2633
|
-
const t =
|
|
2648
|
+
const t = He(e), n = Ue[t] || Ue.en;
|
|
2634
2649
|
return a ? { ...n, ...a } : n;
|
|
2635
2650
|
}
|
|
2636
2651
|
function En(e) {
|
|
2637
|
-
const a =
|
|
2652
|
+
const a = He(e);
|
|
2638
2653
|
try {
|
|
2639
2654
|
const t = new Intl.DateTimeFormat(a, { weekday: "short" }), n = [];
|
|
2640
|
-
for (let
|
|
2641
|
-
const
|
|
2642
|
-
n.push(t.format(
|
|
2655
|
+
for (let r = 0; r < 7; r++) {
|
|
2656
|
+
const o = new Date(2017, 0, r + 1);
|
|
2657
|
+
n.push(t.format(o));
|
|
2643
2658
|
}
|
|
2644
2659
|
return n;
|
|
2645
2660
|
} catch (t) {
|
|
2646
|
-
return
|
|
2661
|
+
return O.warn("getWeekdayNames() - Intl.DateTimeFormat failed, using English weekdays", t), ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
2647
2662
|
}
|
|
2648
2663
|
}
|
|
2649
2664
|
function Rn(e) {
|
|
2650
|
-
const a =
|
|
2665
|
+
const a = He(e);
|
|
2651
2666
|
try {
|
|
2652
2667
|
const t = new Intl.DateTimeFormat(a, { month: "long" }), n = [];
|
|
2653
|
-
for (let
|
|
2654
|
-
const
|
|
2655
|
-
n.push(t.format(
|
|
2668
|
+
for (let r = 0; r < 12; r++) {
|
|
2669
|
+
const o = new Date(2017, r, 1);
|
|
2670
|
+
n.push(t.format(o));
|
|
2656
2671
|
}
|
|
2657
2672
|
return n;
|
|
2658
2673
|
} catch (t) {
|
|
2659
|
-
return
|
|
2674
|
+
return O.warn("getMonthNames() - Intl.DateTimeFormat failed, using English months", t), [
|
|
2660
2675
|
"January",
|
|
2661
2676
|
"February",
|
|
2662
2677
|
"March",
|
|
@@ -2672,7 +2687,7 @@ function Rn(e) {
|
|
|
2672
2687
|
];
|
|
2673
2688
|
}
|
|
2674
2689
|
}
|
|
2675
|
-
const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: .25rem;--drp-spacing-sm-base: .5rem;--drp-spacing-md-base: 1rem;--drp-spacing-lg-base: 1.5rem;--drp-spacing-xl-base: 2rem;--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: .625rem;--drp-font-size-xs-base: .75rem;--drp-font-size-sm-base: .875rem;--drp-font-size-base-base: 1rem;--drp-font-size-lg-base: 1.125rem;--drp-font-size-xl-base: 1.25rem;--drp-font-size-2xl-base: 1.5rem;--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-card-bg: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-accent-text-color: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-bg: #111827;--drp-tooltip-color: #ffffff;--drp-border-width-base: 1px;--drp-border-radius: .375rem;--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: .75rem;--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-input-background: var(--drp-card-bg);--drp-input-color: var(--drp-text-primary);--drp-input-border-color: var(--drp-border-color);--drp-input-border-color-hover: var(--drp-accent-color);--drp-input-border-color-focus: var(--drp-accent-color);--drp-input-placeholder-color: var(--drp-text-secondary);--drp-input-disabled-background: var(--drp-primary-bg);--drp-input-focus-shadow-color: rgba(59, 130, 246, .1);--drp-input-focus-shadow-size: 3px;--drp-input-icon-opacity: .6;--drp-input-size-xs-font: .75rem;--drp-input-size-xs-padding-v: .25rem;--drp-input-size-xs-padding-h: .25rem;--drp-input-size-xs-height: 1.5rem;--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: .875rem;--drp-input-size-sm-padding-v: .25rem;--drp-input-size-sm-padding-h: .5rem;--drp-input-size-sm-height: 2rem;--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: 1rem;--drp-input-size-md-padding-v: .5rem;--drp-input-size-md-padding-h: .75rem;--drp-input-size-md-height: 2.5rem;--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: 1.125rem;--drp-input-size-lg-padding-v: 1rem;--drp-input-size-lg-padding-h: 1rem;--drp-input-size-lg-height: 3rem;--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: 1.25rem;--drp-input-size-xl-padding-v: 1rem;--drp-input-size-xl-padding-h: 1.5rem;--drp-input-size-xl-height: 3.5rem;--drp-input-size-xl-icon-size: 1.25em;--drp-header-text-color: var(--drp-text-primary);--drp-header-bg-hover: var(--drp-primary-bg);--drp-header-bg-active: var(--drp-primary-bg-hover);--drp-nav-text-color: var(--drp-text-primary);--drp-nav-border-color: var(--drp-border-color);--drp-nav-bg-hover: var(--drp-primary-bg);--drp-nav-bg-active: var(--drp-primary-bg-hover);--drp-nav-border-hover: var(--drp-accent-color);--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-thumb: var(--drp-border-color);--drp-rolling-scrollbar-thumb-hover: var(--drp-accent-color);--drp-rolling-item-bg-hover: var(--drp-primary-bg);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-accent-text-color);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-weekday-color: var(--drp-text-secondary);--drp-day-text-color: var(--drp-text-primary);--drp-day-bg-hover: var(--drp-primary-bg);--drp-day-border-hover: var(--drp-accent-color);--drp-day-today-border: var(--drp-accent-color);--drp-day-selected-bg: var(--drp-accent-color);--drp-day-selected-color: var(--drp-accent-text-color);--drp-day-selected-bg-hover: var(--drp-accent-color-hover);--drp-day-focused-outline: var(--drp-accent-color);--drp-day-disabled-color: var(--drp-text-secondary);--drp-day-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-accent-text-color);--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-today-color: var(--drp-accent-color);--drp-button-clear-color: var(--drp-text-secondary);--drp-button-cancel-color: var(--drp-text-secondary);--drp-button-apply-bg: var(--drp-accent-color);--drp-button-apply-color: var(--drp-button-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-accent-text-color);--drp-badge-count-bg: #ef4444;--drp-badge-count-color: #ffffff;--drp-badge-text-bg: var(--drp-text-secondary);--drp-badge-text-color: #ffffff;--drp-unified-range-text-color: var(--drp-text-primary);--drp-unified-range-bg-hover: var(--drp-primary-bg);--drp-unified-range-bg-active: var(--drp-primary-bg-hover);--drp-unified-month-color: var(--drp-text-secondary);--drp-unified-rolling-disabled-color: var(--drp-text-secondary)}.drp-input{width:100%;font-family:inherit;font-size:var(--drp-input-size-md-font);line-height:1.5;color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-border-width-base) solid var(--drp-input-border-color);border-radius:var(--drp-border-radius);padding:var(--drp-input-size-md-padding-v) var(--drp-input-size-md-padding-h);padding-right:calc(var(--drp-input-size-md-padding-h) * 2.5);height:var(--drp-input-size-md-height);box-sizing:border-box;transition:border-color var(--drp-transition-fast) var(--drp-easing-snappy),box-shadow var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-input::placeholder{color:var(--drp-input-placeholder-color);opacity:.6}.drp-input:hover:not(:disabled){border-color:var(--drp-input-border-color-hover)}.drp-input:focus{outline:none;border-color:var(--drp-input-border-color-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--drp-input-disabled-background)}.drp-input.drp-input--xs{font-size:var(--drp-input-size-xs-font);padding:var(--drp-input-size-xs-padding-v) var(--drp-input-size-xs-padding-h);padding-right:calc(var(--drp-input-size-xs-padding-h) * 2.5);height:var(--drp-input-size-xs-height)}.drp-input.drp-input--sm{font-size:var(--drp-input-size-sm-font);padding:var(--drp-input-size-sm-padding-v) var(--drp-input-size-sm-padding-h);padding-right:calc(var(--drp-input-size-sm-padding-h) * 2.5);height:var(--drp-input-size-sm-height)}.drp-input.drp-input--lg{font-size:var(--drp-input-size-lg-font);padding:var(--drp-input-size-lg-padding-v) var(--drp-input-size-lg-padding-h);padding-right:calc(var(--drp-input-size-lg-padding-h) * 2.5);height:var(--drp-input-size-lg-height)}.drp-input.drp-input--xl{font-size:var(--drp-input-size-xl-font);padding:var(--drp-input-size-xl-padding-v) var(--drp-input-size-xl-padding-h);padding-right:calc(var(--drp-input-size-xl-padding-h) * 2.5);height:var(--drp-input-size-xl-height)}.drp-date-picker-input{position:relative;cursor:pointer;display:inline-block;width:100%}.drp-date-picker-input:after{content:"📅";position:absolute;right:var(--drp-input-size-md-padding-h);top:50%;transform:translateY(-50%);pointer-events:none;opacity:var(--drp-input-icon-opacity);font-size:var(--drp-input-size-md-icon-size)}.drp-date-picker-input.drp-date-picker-input--xs:after{right:var(--drp-input-size-xs-padding-h);font-size:var(--drp-input-size-xs-icon-size)}.drp-date-picker-input.drp-date-picker-input--sm:after{right:var(--drp-input-size-sm-padding-h);font-size:var(--drp-input-size-sm-icon-size)}.drp-date-picker-input.drp-date-picker-input--lg:after{right:var(--drp-input-size-lg-padding-h);font-size:var(--drp-input-size-lg-icon-size)}.drp-date-picker-input.drp-date-picker-input--xl:after{right:var(--drp-input-size-xl-padding-h);font-size:var(--drp-input-size-xl-icon-size)}.drp-date-picker{position:absolute;z-index:9500;background:var(--drp-card-bg);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-header-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-header-bg-hover)}.drp-date-picker__month-year:active{background-color:var(--drp-header-bg-active)}.drp-date-picker__nav{width:calc(2rem * var(--drp-cell-scale));height:calc(2rem * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-nav-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-nav-text-color)}.drp-date-picker__nav:hover{background-color:var(--drp-nav-bg-hover);border-color:var(--drp-nav-border-hover)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-nav-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-unified-range-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-unified-range-bg-hover)}.drp-date-picker__unified-range:active{background-color:var(--drp-unified-range-bg-active)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-card-bg);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:.25rem 1rem;cursor:pointer;font-size:.875rem;min-height:calc(2rem * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-unified-month-color)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-weekday-color);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-day-text-color);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-day-bg-hover);border-color:var(--drp-day-border-hover)}.drp-date-picker__day--today{border-color:var(--drp-day-today-border);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-day-selected-bg);color:var(--drp-day-selected-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-day-selected-bg-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-day-focused-outline);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-day-range-bg);color:var(--drp-day-range-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-day-range-bg) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-day-range-bg)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-day-range-bg) 60%,transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(1rem * var(--drp-cell-scale));min-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(1rem * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size:.7rem;font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:var(--drp-badge-count-bg);color:var(--drp-badge-count-color);font-size:.7rem;font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:var(--drp-badge-text-bg);color:var(--drp-badge-text-color);font-size:.65rem;font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-summary-text-color)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-summary-count-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-button-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-color:var(--drp-button-border-hover)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-button-border-color)}.drp-date-picker__button--today{color:var(--drp-button-today-color)}.drp-date-picker__button--clear{color:var(--drp-button-clear-color)}.drp-date-picker__button--apply{background-color:var(--drp-button-apply-bg);color:var(--drp-button-apply-color);border-color:var(--drp-button-apply-border)}.drp-date-picker__button--apply:hover{background-color:var(--drp-button-apply-bg-hover)}.drp-date-picker__button--cancel{color:var(--drp-button-cancel-color)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-bg);color:var(--drp-tooltip-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-bg);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fffc;display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:.375rem}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px solid #e5e7eb;border-top-color:#3b82f6;border-radius:50%;animation:drp-spin .8s linear infinite}@keyframes drp-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.drp-date-picker.drp-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2690
|
+
const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--drp-spacing-scale: 1;--drp-cell-scale: 1;--drp-spacing-xs-base: calc(.4 * var(--drp-rem));--drp-spacing-sm-base: calc(.8 * var(--drp-rem));--drp-spacing-md-base: calc(1.6 * var(--drp-rem));--drp-spacing-lg-base: calc(2.4 * var(--drp-rem));--drp-spacing-xl-base: calc(3.2 * var(--drp-rem));--drp-spacing-xs: calc(var(--drp-spacing-xs-base) * var(--drp-spacing-scale));--drp-spacing-sm: calc(var(--drp-spacing-sm-base) * var(--drp-spacing-scale));--drp-spacing-md: calc(var(--drp-spacing-md-base) * var(--drp-spacing-scale));--drp-spacing-lg: calc(var(--drp-spacing-lg-base) * var(--drp-spacing-scale));--drp-spacing-xl: calc(var(--drp-spacing-xl-base) * var(--drp-spacing-scale));--drp-font-size-2xs-base: calc(1 * var(--drp-rem));--drp-font-size-xs-base: calc(1.2 * var(--drp-rem));--drp-font-size-sm-base: calc(1.4 * var(--drp-rem));--drp-font-size-base-base: calc(1.6 * var(--drp-rem));--drp-font-size-lg-base: calc(1.8 * var(--drp-rem));--drp-font-size-xl-base: calc(2 * var(--drp-rem));--drp-font-size-2xl-base: calc(2.4 * var(--drp-rem));--drp-font-weight-medium: 500;--drp-font-weight-semibold: 600;--drp-dropdown-background: #ffffff;--drp-border-color: #e5e7eb;--drp-primary-bg: #f3f4f6;--drp-primary-bg-hover: #e5e7eb;--drp-accent-color: #3b82f6;--drp-accent-color-hover: #2563eb;--drp-text-primary: #111827;--drp-text-secondary: #6b7280;--drp-text-on-accent: #ffffff;--drp-button-text-color: #ffffff;--drp-tooltip-background: #111827;--drp-tooltip-text-color: #ffffff;--drp-loading-overlay-background: rgba(255, 255, 255, .8);--drp-loading-spinner-color: var(--drp-border-color);--drp-loading-spinner-accent: var(--drp-accent-color);--drp-border-width-base: 1px;--drp-border-radius: calc(.6 * var(--drp-rem));--drp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);--drp-transition-fast: .15s;--drp-easing-snappy: cubic-bezier(.4, 0, .2, 1);--drp-input-padding-h: calc(1.2 * var(--drp-rem));--drp-grid-columns: 3;--drp-grid-rows: 2;--drp-input-background: var(--drp-dropdown-background);--drp-input-color: var(--drp-text-primary);--drp-input-border-color: var(--drp-border-color);--drp-input-border-color-hover: var(--drp-accent-color);--drp-input-border-color-focus: var(--drp-accent-color);--drp-input-placeholder-color: var(--drp-text-secondary);--drp-input-background-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: calc(1.2 * var(--drp-rem));--drp-input-size-xs-padding-v: calc(.4 * var(--drp-rem));--drp-input-size-xs-padding-h: calc(.4 * var(--drp-rem));--drp-input-size-xs-height: calc(3.1 * var(--drp-rem));--drp-input-size-xs-icon-size: .75em;--drp-input-size-sm-font: calc(1.4 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.4 * var(--drp-rem));--drp-input-size-sm-padding-h: calc(.8 * var(--drp-rem));--drp-input-size-sm-height: calc(3.3 * var(--drp-rem));--drp-input-size-sm-icon-size: .875em;--drp-input-size-md-font: calc(1.6 * var(--drp-rem));--drp-input-size-md-padding-v: calc(.8 * var(--drp-rem));--drp-input-size-md-padding-h: calc(1.2 * var(--drp-rem));--drp-input-size-md-height: calc(3.5 * var(--drp-rem));--drp-input-size-md-icon-size: 1em;--drp-input-size-lg-font: calc(1.8 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1.6 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-lg-height: calc(3.8 * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(2 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.6 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(2.4 * var(--drp-rem));--drp-input-size-xl-height: calc(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-bg-hover: var(--drp-primary-bg);--drp-nav-bg-active: var(--drp-primary-bg-hover);--drp-nav-border-hover: var(--drp-accent-color);--drp-rolling-bg: var(--drp-primary-bg);--drp-rolling-border-color: var(--drp-border-color);--drp-rolling-scrollbar-thumb: var(--drp-border-color);--drp-rolling-scrollbar-thumb-hover: var(--drp-accent-color);--drp-rolling-item-bg-hover: var(--drp-primary-bg);--drp-rolling-item-bg-selected: var(--drp-accent-color);--drp-rolling-item-color-selected: var(--drp-text-on-accent);--drp-rolling-item-bg-selected-hover: var(--drp-accent-color-hover);--drp-weekday-color: var(--drp-text-secondary);--drp-day-text-color: var(--drp-text-primary);--drp-day-bg-hover: var(--drp-primary-bg);--drp-day-border-hover: var(--drp-accent-color);--drp-day-today-border: var(--drp-accent-color);--drp-day-selected-bg: var(--drp-accent-color);--drp-day-selected-color: var(--drp-text-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-other-month-color: var(--drp-text-secondary);--drp-day-range-bg: var(--drp-accent-color);--drp-day-range-color: var(--drp-text-on-accent);--drp-summary-text-color: var(--drp-text-secondary);--drp-summary-border-color: var(--drp-border-color);--drp-summary-count-color: var(--drp-accent-color);--drp-button-border-color: var(--drp-border-color);--drp-button-bg-hover: var(--drp-primary-bg);--drp-button-border-hover: var(--drp-accent-color);--drp-button-today-color: var(--drp-accent-color);--drp-button-clear-color: var(--drp-text-secondary);--drp-button-cancel-color: var(--drp-text-secondary);--drp-button-apply-bg: var(--drp-accent-color);--drp-button-apply-color: var(--drp-button-text-color);--drp-button-apply-border: var(--drp-accent-color);--drp-button-apply-bg-hover: var(--drp-accent-color-hover);--drp-badge-number-bg: var(--drp-accent-color);--drp-badge-number-color: var(--drp-text-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-input{width:100%;font-family:inherit;font-size:var(--drp-input-size-md-font);line-height:1.5;color:var(--drp-input-color);background-color:var(--drp-input-background);border:var(--drp-border-width-base) solid var(--drp-input-border-color);border-radius:var(--drp-border-radius);padding:var(--drp-input-size-md-padding-v) var(--drp-input-size-md-padding-h);padding-right:calc(var(--drp-input-size-md-padding-h) * 2.5);height:var(--drp-input-size-md-height);box-sizing:border-box;transition:border-color var(--drp-transition-fast) var(--drp-easing-snappy),box-shadow var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-input::placeholder{color:var(--drp-input-placeholder-color);opacity:.6}.drp-input:hover:not(:disabled){border-color:var(--drp-input-border-color-hover)}.drp-input:focus{outline:none;border-color:var(--drp-input-border-color-focus);box-shadow:0 0 0 var(--drp-input-focus-shadow-size) var(--drp-input-focus-shadow-color)}.drp-input:disabled{opacity:.6;cursor:not-allowed;background-color:var(--drp-input-background-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:9500;background:var(--drp-dropdown-background);border:var(--drp-border-width-base) solid var(--drp-border-color);border-radius:var(--drp-border-radius);box-shadow:var(--drp-shadow-xl);padding:var(--drp-spacing-md);min-width:280px;max-width:calc(100vw - 2rem);box-sizing:border-box;-webkit-user-select:none;user-select:none;--drp-font-size-2xs: calc(var(--drp-font-size-2xs-base) * var(--drp-font-scale));--drp-font-size-xs: calc(var(--drp-font-size-xs-base) * var(--drp-font-scale));--drp-font-size-sm: calc(var(--drp-font-size-sm-base) * var(--drp-font-scale));--drp-font-size-base: calc(var(--drp-font-size-base-base) * var(--drp-font-scale));--drp-font-size-lg: calc(var(--drp-font-size-lg-base) * var(--drp-font-scale));--drp-font-size-xl: calc(var(--drp-font-size-xl-base) * var(--drp-font-scale));--drp-font-size-2xl: calc(var(--drp-font-size-2xl-base) * var(--drp-font-scale))}.drp-date-picker:not(.drp-date-picker--visible){display:none}.drp-date-picker--inline{position:relative!important;display:block!important;z-index:auto;min-width:0;max-width:100%;width:fit-content;box-sizing:border-box}.drp-date-picker__months{display:flex;gap:var(--drp-spacing-lg)}.drp-date-picker--inline .drp-date-picker__months{flex-wrap:wrap}.drp-date-picker__months--grid{display:grid;grid-template-columns:repeat(var(--drp-grid-columns, 3),minmax(0,1fr));grid-template-rows:repeat(var(--drp-grid-rows, 2),auto);gap:var(--drp-spacing-lg);width:100%}@media (max-width: 1200px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),3),minmax(0,1fr))}}@media (max-width: 768px){.drp-date-picker__months--grid{grid-template-columns:repeat(min(var(--drp-grid-columns, 3),2),minmax(0,1fr))}}@media (max-width: 480px){.drp-date-picker__months--grid{grid-template-columns:minmax(0,1fr)}}.drp-date-picker__month{flex:1;min-width:calc(280px * var(--drp-cell-scale));display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:calc(250px * var(--drp-cell-scale))}.drp-date-picker__months--grid .drp-date-picker__month{min-width:0;width:100%}.drp-date-picker__calendar-container{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.drp-date-picker__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-md);gap:var(--drp-spacing-sm)}.drp-date-picker__header--static{justify-content:center}.drp-date-picker__header--static .drp-date-picker__month-year{cursor:default}.drp-date-picker__header--static .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker__month-year{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-base);color:var(--drp-header-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__month-year:hover{background-color:var(--drp-header-bg-hover)}.drp-date-picker__month-year:active{background-color:var(--drp-header-bg-active)}.drp-date-picker__nav{width:calc(calc(3.2 * var(--drp-rem)) * var(--drp-cell-scale));height:calc(calc(3.2 * var(--drp-rem)) * var(--drp-cell-scale));display:flex;align-items:center;justify-content:center;border:var(--drp-border-width-base) solid var(--drp-nav-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-lg);color:var(--drp-nav-text-color)}.drp-date-picker__nav:hover{background-color:var(--drp-nav-bg-hover);border-color:var(--drp-nav-border-hover)}.drp-date-picker__nav:active{background-color:var(--drp-nav-bg-active)}.drp-date-picker__nav--disabled,.drp-date-picker__nav[disabled]{opacity:.6;cursor:not-allowed;pointer-events:none}.drp-date-picker__nav--disabled:hover,.drp-date-picker__nav[disabled]:hover{background-color:transparent;border-color:var(--drp-nav-border-color)}.drp-date-picker__nav--prev:before{content:"‹"}.drp-date-picker__nav--next:before{content:"›"}.drp-date-picker__rolling-selector{position:absolute;top:0;right:0;bottom:0;left:0;display:none;z-index:10}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible{display:flex}.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__weekdays,.drp-date-picker__rolling-selector.drp-date-picker__rolling-selector--visible~.drp-date-picker__days{visibility:hidden}.drp-date-picker__rolling-selector{gap:var(--drp-spacing-xs)}.drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__rolling-item{padding:calc(.4 * var(--drp-rem)) calc(1.6 * var(--drp-rem));cursor:pointer;font-size:calc(1.4 * var(--drp-rem));min-height:calc(calc(3.2 * var(--drp-rem)) * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker__unified-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--drp-spacing-lg);gap:var(--drp-spacing-sm);padding:0 var(--drp-spacing-sm)}.drp-date-picker__unified-range{flex:1;text-align:center;font-weight:var(--drp-font-weight-semibold);font-size:var(--drp-font-size-lg);color:var(--drp-unified-range-text-color);padding:var(--drp-spacing-sm) var(--drp-spacing-md);border-radius:var(--drp-border-radius);cursor:pointer}.drp-date-picker__unified-range:hover{background-color:var(--drp-unified-range-bg-hover)}.drp-date-picker__unified-range:active{background-color:var(--drp-unified-range-bg-active)}.drp-date-picker__unified-range--static{cursor:default!important}.drp-date-picker__unified-range--static:hover,.drp-date-picker__unified-range--static:active{background-color:transparent}.drp-date-picker__unified-rolling-selector{position:absolute;top:calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);left:50%;transform:translate(-50%);width:min(90%,450px);height:350px;max-height:350px;display:none;z-index:100;background:var(--drp-dropdown-background);gap:var(--drp-spacing-xs)}.drp-date-picker__unified-rolling-selector--visible{display:flex}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list{flex:1;min-width:0;height:100%;overflow-y:auto;border:var(--drp-border-width-base) solid var(--drp-rolling-border-color);border-radius:var(--drp-border-radius);display:flex;flex-direction:column;scroll-behavior:smooth}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar{width:6px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-track{background:var(--drp-rolling-bg)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb{background:var(--drp-rolling-scrollbar-thumb);border-radius:3px}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-list::-webkit-scrollbar-thumb:hover{background:var(--drp-rolling-scrollbar-thumb-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item{padding:calc(.4 * var(--drp-rem)) calc(1.6 * var(--drp-rem));cursor:pointer;font-size:calc(1.4 * var(--drp-rem));min-height:calc(calc(3.2 * var(--drp-rem)) * var(--drp-cell-scale));flex-shrink:0;display:flex;align-items:center;justify-content:var(--drp-rolling-item-justify-content, center)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item:hover{background-color:var(--drp-rolling-item-bg-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected{background-color:var(--drp-rolling-item-bg-selected);color:var(--drp-rolling-item-color-selected);font-weight:600}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--selected:hover{background-color:var(--drp-rolling-item-bg-selected-hover)}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed}.drp-date-picker__unified-rolling-selector .drp-date-picker__rolling-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__nav{display:none}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year{cursor:default;font-size:var(--drp-font-size-base);font-weight:var(--drp-font-weight-normal);color:var(--drp-unified-month-color)}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__header .drp-date-picker__month-year:hover{background-color:transparent}.drp-date-picker--unified-nav .drp-date-picker__month .drp-date-picker__rolling-selector{display:none!important}.drp-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-sm)}.drp-date-picker__weekday{text-align:center;font-size:var(--drp-font-size-xs);font-weight:var(--drp-font-weight-semibold);color:var(--drp-weekday-color);padding:var(--drp-spacing-xs);text-transform:uppercase}.drp-date-picker__days{display:flex;flex-direction:column;gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-md)}.drp-date-picker__date-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs)}.drp-date-picker__day{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-sm);color:var(--drp-day-text-color);border-radius:var(--drp-border-radius);cursor:pointer;border:calc(2px * var(--drp-cell-scale)) solid transparent;position:relative}.drp-date-picker__day:hover:not(.drp-date-picker__day--disabled):not(.drp-date-picker__day--other-month){background-color:var(--drp-day-bg-hover);border-color:var(--drp-day-border-hover)}.drp-date-picker__day--today{border-color:var(--drp-day-today-border);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected{background-color:var(--drp-day-selected-bg);color:var(--drp-day-selected-color);font-weight:var(--drp-font-weight-semibold)}.drp-date-picker__day--selected:hover{background-color:var(--drp-day-selected-bg-hover)}.drp-date-picker__day--focused{outline:calc(2px * var(--drp-cell-scale)) solid var(--drp-day-focused-outline);outline-offset:calc(2px * var(--drp-cell-scale))}.drp-date-picker__day--disabled{color:var(--drp-day-disabled-color);opacity:.6;cursor:not-allowed;position:relative}.drp-date-picker__day--disabled:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(45deg,rgba(0,0,0,.1) 0px,rgba(0,0,0,.1) 1px,transparent 1px,transparent 6px);border-radius:var(--drp-border-radius);pointer-events:none}.drp-date-picker__day--disabled:hover{background-color:transparent;border-color:transparent}.drp-date-picker__day--other-month{color:var(--drp-day-other-month-color);opacity:.5}.drp-date-picker__day--other-month.drp-date-picker__day--range-start,.drp-date-picker__day--other-month.drp-date-picker__day--range-end,.drp-date-picker__day--other-month.drp-date-picker__day--in-range,.drp-date-picker__day--other-month.drp-date-picker__day--drag-preview{opacity:1}.drp-date-picker__day--range-start,.drp-date-picker__day--range-end{background-color:var(--drp-day-range-bg);color:var(--drp-day-range-color);font-weight:var(--drp-font-weight-semibold);cursor:grab;-webkit-user-select:none;user-select:none}.drp-date-picker__day--range-start:active,.drp-date-picker__day--range-end:active{cursor:grabbing}.drp-date-picker__day--in-range{background-color:color-mix(in srgb,var(--drp-day-range-bg) 15%,transparent)}.drp-date-picker__day--in-range:hover{background-color:color-mix(in srgb,var(--drp-day-range-bg) 25%,transparent)}.drp-date-picker__day--dragging{cursor:grabbing!important;opacity:.7;transform:scale(1.1);transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__day--drag-preview{background-color:color-mix(in srgb,var(--drp-day-range-bg) 30%,transparent);border:calc(2px * var(--drp-cell-scale)) dashed var(--drp-day-range-bg)}.drp-date-picker__day--drag-preview.drp-date-picker__day--range-start,.drp-date-picker__day--drag-preview.drp-date-picker__day--range-end{background-color:color-mix(in srgb,var(--drp-day-range-bg) 60%,transparent);color:var(--drp-day-range-color)}.drp-date-picker__day--drag-invalid{background-color:color-mix(in srgb,#ef4444 20%,transparent)!important;border-color:#ef4444!important;border-style:dashed!important}.drp-date-picker__day.holiday{background-color:color-mix(in srgb,#ef4444 10%,transparent)}.drp-date-picker__day.holiday:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#ef4444 20%,transparent)}.drp-date-picker__day.event{background-color:color-mix(in srgb,#10b981 10%,transparent)}.drp-date-picker__day.event:hover:not(.drp-date-picker__day--disabled){background-color:color-mix(in srgb,#10b981 20%,transparent)}.drp-date-picker__rolling-item--disabled{color:var(--drp-unified-rolling-disabled-color);opacity:.4;cursor:not-allowed;pointer-events:none;text-decoration:line-through}.drp-date-picker__rolling-item--disabled:hover{background-color:transparent}.drp-date-picker__badge-row{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--drp-spacing-xs);margin-bottom:var(--drp-spacing-xs);max-height:calc(calc(1.6 * var(--drp-rem)) * var(--drp-cell-scale));min-height:calc(calc(1.6 * var(--drp-rem)) * var(--drp-cell-scale))}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:calc(1px * var(--drp-cell-scale)) calc(2px * var(--drp-cell-scale));border-radius:2px;cursor:pointer;height:100%;max-height:calc(calc(1.6 * var(--drp-rem)) * var(--drp-cell-scale))}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size: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-border-width-base) solid var(--drp-summary-border-color);font-size:var(--drp-font-size-sm);color:var(--drp-summary-text-color)}.drp-date-picker__summary--visible{display:block}.drp-date-picker__summary--hidden{display:none}.drp-date-picker__summary-count{font-weight:var(--drp-font-weight-semibold);color:var(--drp-summary-count-color);font-size:var(--drp-font-size-base)}.drp-date-picker__actions{display:flex;gap:var(--drp-spacing-sm);justify-content:space-between;padding-top:var(--drp-spacing-sm);border-top:var(--drp-border-width-base) solid var(--drp-summary-border-color)}.drp-date-picker__button{flex:1;padding:var(--drp-spacing-sm) var(--drp-spacing-md);border:var(--drp-border-width-base) solid var(--drp-button-border-color);border-radius:var(--drp-border-radius);background:transparent;cursor:pointer;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-color:var(--drp-button-border-hover)}.drp-date-picker__button:disabled,.drp-date-picker__button[disabled]{opacity:var(--drp-disabled-opacity, .6);cursor:not-allowed;pointer-events:none}.drp-date-picker__button:disabled:hover,.drp-date-picker__button[disabled]:hover{background-color:transparent;border-color:var(--drp-button-border-color)}.drp-date-picker__button--today{color:var(--drp-button-today-color)}.drp-date-picker__button--clear{color:var(--drp-button-clear-color)}.drp-date-picker__button--apply{background-color:var(--drp-button-apply-bg);color:var(--drp-button-apply-color);border-color:var(--drp-button-apply-border)}.drp-date-picker__button--apply:hover{background-color:var(--drp-button-apply-bg-hover)}.drp-date-picker__button--cancel{color:var(--drp-button-cancel-color)}.drp-date-picker__tooltip{position:absolute;z-index:9999;background-color:var(--drp-tooltip-background);color:var(--drp-tooltip-text-color);padding:var(--drp-spacing-xs) var(--drp-spacing-sm);border-radius:var(--drp-border-radius);font-size:var(--drp-font-size-xs);line-height:1.4;max-width:200px;word-wrap:break-word;pointer-events:none;opacity:0;transition:opacity var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker__tooltip--visible{opacity:1}.drp-date-picker__tooltip-arrow{position:absolute;background-color:var(--drp-tooltip-background);width:8px;height:8px;transform:rotate(45deg)}.drp-date-picker__loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--drp-loading-overlay-background);display:flex;align-items:center;justify-content:center;z-index:9500;border-radius:var(--drp-border-radius)}.drp-date-picker__loading-spinner{width:40px;height:40px;border:4px 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-font-xs{--drp-font-scale: .6}.drp-date-picker.drp-font-sm{--drp-font-scale: .8}.drp-date-picker.drp-font-md{--drp-font-scale: 1}.drp-date-picker.drp-font-lg{--drp-font-scale: 1.5}.drp-date-picker.drp-font-xl{--drp-font-scale: 2}.drp-date-picker.drp-spacing-xs{--drp-spacing-scale: .6}.drp-date-picker.drp-spacing-sm{--drp-spacing-scale: .8}.drp-date-picker.drp-spacing-md{--drp-spacing-scale: 1}.drp-date-picker.drp-spacing-lg{--drp-spacing-scale: 1.5}.drp-date-picker.drp-spacing-xl{--drp-spacing-scale: 2}.drp-date-picker.drp-cell-xs{--drp-cell-scale: .6}.drp-date-picker.drp-cell-sm{--drp-cell-scale: .8}.drp-date-picker.drp-cell-md{--drp-cell-scale: 1}.drp-date-picker.drp-cell-lg{--drp-cell-scale: 1.5}.drp-date-picker.drp-cell-xl{--drp-cell-scale: 2}@media (max-width: 1200px){.drp-responsive.drp-font-xl{--drp-font-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-font-xl{--drp-font-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-font-lg{--drp-font-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-font-lg{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-md{--drp-font-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-font-sm{--drp-font-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-spacing-xl{--drp-spacing-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-spacing-lg{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-md{--drp-spacing-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-spacing-sm{--drp-spacing-scale: .6}}@media (max-width: 1200px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1.5}}@media (max-width: 768px){.drp-responsive.drp-cell-xl{--drp-cell-scale: 1}}@media (max-width: 1200px){.drp-responsive.drp-cell-lg{--drp-cell-scale: 1}}@media (max-width: 768px){.drp-responsive.drp-cell-lg{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-md{--drp-cell-scale: .8}}@media (max-width: 768px){.drp-responsive.drp-cell-sm{--drp-cell-scale: .6}}.drp-date-picker--xs{--drp-font-scale: .6;--drp-spacing-scale: .6;--drp-cell-scale: .6;min-width:168px}.drp-date-picker--sm{--drp-font-scale: .8;--drp-spacing-scale: .8;--drp-cell-scale: .8;min-width:224px}.drp-date-picker--lg{--drp-font-scale: 1.5;--drp-spacing-scale: 1.5;--drp-cell-scale: 1.5;min-width:420px}.drp-date-picker--xl{--drp-font-scale: 2;--drp-spacing-scale: 2;--drp-cell-scale: 2;min-width:560px}.drp-date-picker.drp-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', ve = class ve {
|
|
2676
2691
|
constructor(a, t = {}) {
|
|
2677
2692
|
b(this, "input");
|
|
2678
2693
|
b(this, "options");
|
|
@@ -2729,6 +2744,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2729
2744
|
// Month change callback state
|
|
2730
2745
|
b(this, "isMonthChanging", !1);
|
|
2731
2746
|
b(this, "bulkMetadataCache", null);
|
|
2747
|
+
b(this, "monthHeadersCache", null);
|
|
2732
2748
|
// Unified navigation state
|
|
2733
2749
|
b(this, "unifiedHeader");
|
|
2734
2750
|
b(this, "unifiedRangeDisplay");
|
|
@@ -2772,6 +2788,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2772
2788
|
unifiedNavigationAnchorIndex: t.unifiedNavigationAnchorIndex ?? 0,
|
|
2773
2789
|
unifiedHeaderInteractive: t.unifiedHeaderInteractive || !1,
|
|
2774
2790
|
getUnifiedHeaderCallback: t.getUnifiedHeaderCallback,
|
|
2791
|
+
getMonthHeaderCallback: t.getMonthHeaderCallback,
|
|
2775
2792
|
weekStartDay: t.weekStartDay !== void 0 ? t.weekStartDay : "auto",
|
|
2776
2793
|
minDate: t.minDate,
|
|
2777
2794
|
maxDate: t.maxDate,
|
|
@@ -2810,39 +2827,39 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2810
2827
|
showClearButton: t.showClearButton !== void 0 ? t.showClearButton : !0,
|
|
2811
2828
|
showApplyButton: t.showApplyButton !== void 0 ? t.showApplyButton : t.selectionMode === "range" || t.selectionMode === "multiple"
|
|
2812
2829
|
}, this.options.showDebugInfo ? ft() : mt(), this.options.unifiedNavigation && this.options.unifiedNavigationAnchorIndex !== void 0) {
|
|
2813
|
-
const
|
|
2814
|
-
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex >
|
|
2830
|
+
const r = this.options.visibleMonthsCount - 1;
|
|
2831
|
+
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > r) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2815
2832
|
}
|
|
2816
|
-
this.weekStartDay = Xt(this.options.weekStartDay),
|
|
2833
|
+
this.weekStartDay = Xt(this.options.weekStartDay), T.debug("Week starts on day:", this.weekStartDay), T.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale = He(this.options.locale), this.localeStrings = In(this.locale, this.options.customStrings), this.weekdayNames = En(this.locale), this.monthNames = this.options.monthNames || Rn(this.locale), T.debug("Locale:", this.locale, "Weekdays:", this.weekdayNames, "Months:", this.monthNames), this.initializeDateRestrictions(), this.formatInfo = this.parseFormat(this.options.dateFormatMask), T.debug("Format info:", this.formatInfo), this._previousInputValue = "", this.currentDate = /* @__PURE__ */ new Date();
|
|
2817
2834
|
let n;
|
|
2818
2835
|
if (this.options.initialDate)
|
|
2819
|
-
n = he(this.options.initialDate) || /* @__PURE__ */ new Date(),
|
|
2836
|
+
n = he(this.options.initialDate) || /* @__PURE__ */ new Date(), T.debug(`Using initialDate: ${n.toISOString()}`);
|
|
2820
2837
|
else if (this.options.rollingYearRange || this.options.rollingMonthRange) {
|
|
2821
|
-
const
|
|
2822
|
-
n = new Date(
|
|
2823
|
-
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate),
|
|
2838
|
+
const r = this.getEffectiveYearRange(), o = this.getEffectiveMonthRange(), i = r.min, s = o.min - 1;
|
|
2839
|
+
n = new Date(i, s, 1), T.debug(`Using first allowed year/month as initial: ${n.toISOString()}`);
|
|
2840
|
+
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate), T.debug(`Using minDate as initial: ${n.toISOString()}`)) : this.normalizedMaxDate && this.normalizedMaxDate < /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMaxDate), T.debug(`Using maxDate as initial: ${n.toISOString()}`)) : (n = /* @__PURE__ */ new Date(), T.debug(`Using current date as initial: ${n.toISOString()}`));
|
|
2824
2841
|
this.monthDates = [];
|
|
2825
|
-
for (let
|
|
2826
|
-
const
|
|
2827
|
-
this.monthDates.push(
|
|
2842
|
+
for (let r = 0; r < this.options.visibleMonthsCount; r++) {
|
|
2843
|
+
const o = new Date(n.getFullYear(), n.getMonth() + r, 1);
|
|
2844
|
+
this.monthDates.push(o), T.debug(`monthDates[${r}] = ${o.getFullYear()}-${o.getMonth() + 1}`);
|
|
2828
2845
|
}
|
|
2829
2846
|
if (this.options.selectionMode === "range") {
|
|
2830
2847
|
this.displayMonths = [];
|
|
2831
|
-
for (let
|
|
2832
|
-
const
|
|
2848
|
+
for (let r = 0; r < this.options.visibleMonthsCount; r++) {
|
|
2849
|
+
const o = new Date(n.getFullYear(), n.getMonth() + r, 1);
|
|
2833
2850
|
this.displayMonths.push({
|
|
2834
|
-
month:
|
|
2835
|
-
year:
|
|
2851
|
+
month: o.getMonth(),
|
|
2852
|
+
year: o.getFullYear()
|
|
2836
2853
|
});
|
|
2837
2854
|
}
|
|
2838
2855
|
}
|
|
2839
2856
|
this.selectedDate = null, this.selectedStartDate = null, this.selectedEndDate = null, this.selectedRanges = [], this.selectedDates = [], this.pendingSelection = null, this.focusedDayIndex = null, this.activeMonthIndex = 0, this.showingRollingSelector = [];
|
|
2840
|
-
for (let
|
|
2857
|
+
for (let r = 0; r < this.options.visibleMonthsCount; r++)
|
|
2841
2858
|
this.showingRollingSelector.push(!1);
|
|
2842
2859
|
this.draggingType = null, this.isDragging = !1, this.dragStartDate = null, this.originalStartDate = null, this.originalEndDate = null, this.dragPreviewStart = null, this.dragPreviewEnd = null, this.autoScrollInterval = null, this.init();
|
|
2843
2860
|
}
|
|
2844
2861
|
init() {
|
|
2845
|
-
|
|
2862
|
+
T.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (T.debug("Parsing pre-filled value:", this.input.value), this.updateCalendarFromInput())), this.options.positioningMode === "inline" && (this.renderCalendar(), this.calendar.classList.add("drp-date-picker--visible", "drp-date-picker--inline"), this.isCalendarActive = !0, this.isFirstRender = !1, Tt(this), this.clickOutsideHandler && document.addEventListener("click", this.clickOutsideHandler)), T.debug("Init complete");
|
|
2846
2863
|
}
|
|
2847
2864
|
/**
|
|
2848
2865
|
* Initialize and normalize date restrictions
|
|
@@ -2859,8 +2876,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2859
2876
|
this.options.specialDates.forEach((t) => {
|
|
2860
2877
|
const n = he(t[a]);
|
|
2861
2878
|
if (n) {
|
|
2862
|
-
const
|
|
2863
|
-
this.normalizedSpecialDates.set(
|
|
2879
|
+
const r = me(n);
|
|
2880
|
+
this.normalizedSpecialDates.set(r, t);
|
|
2864
2881
|
} else
|
|
2865
2882
|
console.warn("[Special Dates] Failed to normalize date:", t[a]);
|
|
2866
2883
|
});
|
|
@@ -2881,7 +2898,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2881
2898
|
* Considers: rollingMonthRange option, or defaults to all months (1-12)
|
|
2882
2899
|
*/
|
|
2883
2900
|
getEffectiveMonthRange() {
|
|
2884
|
-
return
|
|
2901
|
+
return zt(this.options.rollingMonthRange);
|
|
2885
2902
|
}
|
|
2886
2903
|
/**
|
|
2887
2904
|
* Render action buttons based on configuration
|
|
@@ -2899,12 +2916,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2899
2916
|
return;
|
|
2900
2917
|
} else if (n.isVisible !== void 0 && !n.isVisible)
|
|
2901
2918
|
return;
|
|
2902
|
-
const
|
|
2903
|
-
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2906
|
-
const
|
|
2907
|
-
|
|
2919
|
+
const r = document.createElement("button");
|
|
2920
|
+
r.className = `drp-date-picker__button drp-date-picker__button--${n.action}`;
|
|
2921
|
+
const o = n.getClassCallback ? n.getClassCallback(this) : n.cssClass;
|
|
2922
|
+
o && (Array.isArray(o) ? r.classList.add(...o) : r.classList.add(o));
|
|
2923
|
+
const i = n.getTextCallback ? n.getTextCallback(this) : n.text;
|
|
2924
|
+
r.innerHTML = i, (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);
|
|
2908
2925
|
}), this.attachActionButtonTooltips();
|
|
2909
2926
|
}
|
|
2910
2927
|
/**
|
|
@@ -2929,13 +2946,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2929
2946
|
attachActionButtonTooltips() {
|
|
2930
2947
|
if (!this.actionsContainer) return;
|
|
2931
2948
|
this.actionsContainer.querySelectorAll(".drp-date-picker__action").forEach((t) => {
|
|
2932
|
-
const n = t,
|
|
2949
|
+
const n = t, r = n.dataset.action;
|
|
2950
|
+
if (!r) return;
|
|
2951
|
+
const i = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === r);
|
|
2933
2952
|
if (!i) return;
|
|
2934
|
-
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === i);
|
|
2935
|
-
if (!o) return;
|
|
2936
2953
|
let s;
|
|
2937
|
-
if (
|
|
2938
|
-
const d = `action-${
|
|
2954
|
+
if (i.getTooltipCallback ? s = i.getTooltipCallback(this) : s = i.tooltip, !s) return;
|
|
2955
|
+
const d = `action-${r}-${Date.now()}-${Math.random()}`;
|
|
2939
2956
|
this.createActionButtonTooltip(n, s, d);
|
|
2940
2957
|
});
|
|
2941
2958
|
}
|
|
@@ -2943,16 +2960,16 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2943
2960
|
* Create a Floating UI tooltip for an action button
|
|
2944
2961
|
*/
|
|
2945
2962
|
createActionButtonTooltip(a, t, n) {
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2948
|
-
let
|
|
2963
|
+
const r = document.createElement("div");
|
|
2964
|
+
r.className = "drp-date-picker__tooltip", r.textContent = t, (this.options.container || document.body).appendChild(r), this.actionButtonTooltips.set(n, r);
|
|
2965
|
+
let i, s;
|
|
2949
2966
|
const d = () => {
|
|
2950
|
-
clearTimeout(s),
|
|
2951
|
-
|
|
2967
|
+
clearTimeout(s), i = window.setTimeout(() => {
|
|
2968
|
+
r.classList.add("drp-date-picker__tooltip--visible"), this.positionActionButtonTooltip(a, r, n);
|
|
2952
2969
|
}, 300);
|
|
2953
2970
|
}, l = () => {
|
|
2954
|
-
clearTimeout(
|
|
2955
|
-
|
|
2971
|
+
clearTimeout(i), s = window.setTimeout(() => {
|
|
2972
|
+
r.classList.remove("drp-date-picker__tooltip--visible");
|
|
2956
2973
|
const c = this.actionButtonTooltipCleanups.get(n);
|
|
2957
2974
|
c && (c(), this.actionButtonTooltipCleanups.delete(n));
|
|
2958
2975
|
}, 100);
|
|
@@ -2963,14 +2980,14 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2963
2980
|
* Position action button tooltip using Floating UI
|
|
2964
2981
|
*/
|
|
2965
2982
|
async positionActionButtonTooltip(a, t, n) {
|
|
2966
|
-
const { computePosition:
|
|
2967
|
-
|
|
2983
|
+
const { computePosition: r, flip: o, shift: i, offset: s, autoUpdate: d } = await Promise.resolve().then(() => en), l = d(a, t, () => {
|
|
2984
|
+
r(a, t, {
|
|
2968
2985
|
placement: "top",
|
|
2969
2986
|
strategy: "fixed",
|
|
2970
2987
|
middleware: [
|
|
2971
2988
|
s(8),
|
|
2972
|
-
|
|
2973
|
-
|
|
2989
|
+
o(),
|
|
2990
|
+
i({ padding: 8 })
|
|
2974
2991
|
]
|
|
2975
2992
|
}).then(({ x: c, y: p }) => {
|
|
2976
2993
|
Object.assign(t.style, {
|
|
@@ -2998,8 +3015,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
2998
3015
|
const t = this.getEffectiveYearRange(), n = a.getFullYear();
|
|
2999
3016
|
if (n < t.min || n > t.max)
|
|
3000
3017
|
return !0;
|
|
3001
|
-
const
|
|
3002
|
-
return
|
|
3018
|
+
const r = this.getEffectiveMonthRange(), o = a.getMonth() + 1;
|
|
3019
|
+
return o < r.min || o > r.max ? !0 : Jt(
|
|
3003
3020
|
a,
|
|
3004
3021
|
this.normalizedMinDate,
|
|
3005
3022
|
this.normalizedMaxDate,
|
|
@@ -3029,12 +3046,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3029
3046
|
};
|
|
3030
3047
|
}
|
|
3031
3048
|
if (this.normalizedSpecialDates.has(t)) {
|
|
3032
|
-
const n = this.normalizedSpecialDates.get(t),
|
|
3049
|
+
const n = this.normalizedSpecialDates.get(t), r = this.options.badgeTextMember || "badgeText", o = this.options.badgeClassMember || "badgeClass", i = this.options.dayClassMember || "dayClass", s = this.options.badgeTooltipMember || "badgeTooltip", d = this.options.dayTooltipMember || "dayTooltip", l = this.options.isDisabledMember || "isDisabled";
|
|
3033
3050
|
return {
|
|
3034
3051
|
isDisabled: n[l] !== void 0 ? n[l] : this.isDateDisabledInternal(a),
|
|
3035
|
-
badgeClass: n[
|
|
3036
|
-
dayClass: n[
|
|
3037
|
-
badgeText: n[
|
|
3052
|
+
badgeClass: n[o],
|
|
3053
|
+
dayClass: n[i],
|
|
3054
|
+
badgeText: n[r],
|
|
3038
3055
|
badgeTooltip: n[s],
|
|
3039
3056
|
dayTooltip: n[d]
|
|
3040
3057
|
};
|
|
@@ -3095,12 +3112,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3095
3112
|
return this.options.selectionMode === "multiple" ? !1 : this.options.autoClose === "selection";
|
|
3096
3113
|
}
|
|
3097
3114
|
createCalendar() {
|
|
3098
|
-
if (
|
|
3115
|
+
if (T.debug("Creating calendar"), this.calendar = document.createElement("div"), this.calendar.className = "drp-date-picker", this.options.unifiedNavigation && this.calendar.classList.add("drp-date-picker--unified-nav"), this.options.unifiedNavigation) {
|
|
3099
3116
|
this.unifiedHeader = document.createElement("div"), this.unifiedHeader.className = "drp-date-picker__unified-header";
|
|
3100
|
-
const n = this.options.unifiedHeaderInteractive ? "" : " drp-date-picker__unified-range--static",
|
|
3117
|
+
const n = this.options.unifiedHeaderInteractive ? "" : " drp-date-picker__unified-range--static", r = this.options.unifiedHeaderInteractive ? ' data-action="toggle-unified-rolling"' : "";
|
|
3101
3118
|
this.unifiedHeader.innerHTML = `
|
|
3102
3119
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="unified-prev"></button>
|
|
3103
|
-
<div class="drp-date-picker__unified-range${n}"${
|
|
3120
|
+
<div class="drp-date-picker__unified-range${n}"${r}></div>
|
|
3104
3121
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="unified-next"></button>
|
|
3105
3122
|
`, this.unifiedRollingSelector = document.createElement("div"), this.unifiedRollingSelector.className = "drp-date-picker__unified-rolling-selector", this.unifiedRollingSelector.innerHTML = `
|
|
3106
3123
|
<div class="drp-date-picker__rolling-list" data-list="years" data-unified="true"></div>
|
|
@@ -3110,17 +3127,17 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3110
3127
|
const a = document.createElement("div");
|
|
3111
3128
|
this.options.monthLayout === "grid" ? (a.className = "drp-date-picker__months drp-date-picker__months--grid", this.options.gridRows && a.style.setProperty("--drp-grid-rows", String(this.options.gridRows)), this.options.gridColumns && a.style.setProperty("--drp-grid-columns", String(this.options.gridColumns))) : a.className = "drp-date-picker__months drp-date-picker__months--horizontal";
|
|
3112
3129
|
for (let n = 0; n < this.options.visibleMonthsCount; n++) {
|
|
3113
|
-
const
|
|
3114
|
-
|
|
3115
|
-
const
|
|
3130
|
+
const r = document.createElement("div");
|
|
3131
|
+
r.className = "drp-date-picker__month", r.dataset.monthIndex = String(n);
|
|
3132
|
+
const o = this.options.unifiedNavigation ? `<div class="drp-date-picker__header drp-date-picker__header--static">
|
|
3116
3133
|
<div class="drp-date-picker__month-year"></div>
|
|
3117
3134
|
</div>` : `<div class="drp-date-picker__header">
|
|
3118
3135
|
<button class="drp-date-picker__nav drp-date-picker__nav--prev" data-action="prev" data-month-index="${n}"></button>
|
|
3119
3136
|
<div class="drp-date-picker__month-year" data-action="toggle-rolling" data-month-index="${n}"></div>
|
|
3120
3137
|
<button class="drp-date-picker__nav drp-date-picker__nav--next" data-action="next" data-month-index="${n}"></button>
|
|
3121
3138
|
</div>`;
|
|
3122
|
-
|
|
3123
|
-
${
|
|
3139
|
+
r.innerHTML = `
|
|
3140
|
+
${o}
|
|
3124
3141
|
<div class="drp-date-picker__calendar-container">
|
|
3125
3142
|
<div class="drp-date-picker__rolling-selector" data-month-index="${n}">
|
|
3126
3143
|
<div class="drp-date-picker__rolling-list" data-list="years" data-month-index="${n}"></div>
|
|
@@ -3129,86 +3146,86 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3129
3146
|
<div class="drp-date-picker__weekdays"></div>
|
|
3130
3147
|
<div class="drp-date-picker__days" data-month-index="${n}"></div>
|
|
3131
3148
|
</div>
|
|
3132
|
-
`, a.appendChild(
|
|
3149
|
+
`, a.appendChild(r);
|
|
3133
3150
|
}
|
|
3134
3151
|
if (this.calendar.appendChild(a), this.options.selectionMode === "range") {
|
|
3135
3152
|
const n = document.createElement("div");
|
|
3136
3153
|
n.className = "drp-date-picker__summary drp-date-picker__summary--hidden", this.calendar.appendChild(n);
|
|
3137
3154
|
}
|
|
3138
3155
|
const t = document.createElement("div");
|
|
3139
|
-
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar),
|
|
3156
|
+
t.className = "drp-date-picker__actions", this.renderButtons(t), t.children.length > 0 && this.calendar.appendChild(t), this.containerElement.appendChild(this.calendar), T.debug("Calendar appended to container:", this.calendar), this.tooltip = document.createElement("div"), this.tooltip.className = "drp-date-picker__tooltip", this.tooltipArrow = document.createElement("div"), this.tooltipArrow.className = "drp-date-picker__tooltip-arrow", this.tooltip.appendChild(this.tooltipArrow), this.containerElement.appendChild(this.tooltip), this.attachCalendarListeners(), this.showingRollingSelector = new Array(this.options.visibleMonthsCount).fill(!1);
|
|
3140
3157
|
}
|
|
3141
3158
|
attachInputListeners() {
|
|
3142
3159
|
if (!this.input) return;
|
|
3143
|
-
|
|
3160
|
+
T.debug("Attaching input listeners");
|
|
3144
3161
|
const a = this.options.calendarOpenTrigger || "focus";
|
|
3145
3162
|
a === "focus" ? this.input.addEventListener("focus", () => {
|
|
3146
|
-
|
|
3163
|
+
T.debug("Input focused - opening calendar"), this.show();
|
|
3147
3164
|
}) : a === "typing" && this.input.addEventListener("input", (t) => {
|
|
3148
|
-
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (
|
|
3165
|
+
!this.calendar.classList.contains("drp-date-picker--visible") && this.input && this.input.value.length > 0 && (T.debug("User started typing - opening calendar"), this.show());
|
|
3149
3166
|
}), this.input.addEventListener("input", (t) => this.handleInputMask(t)), this.input.addEventListener("keydown", (t) => this.handleKeydown(t)), this.input.addEventListener("paste", (t) => this.handlePaste(t));
|
|
3150
3167
|
}
|
|
3151
3168
|
attachCalendarListeners() {
|
|
3152
3169
|
this.calendar.addEventListener("click", async (a) => {
|
|
3153
3170
|
const t = a.target;
|
|
3154
3171
|
a.stopPropagation();
|
|
3155
|
-
const n = t.dataset.action,
|
|
3172
|
+
const n = t.dataset.action, r = t.dataset.monthIndex, o = r ? parseInt(r) : 0;
|
|
3156
3173
|
if (n === "prev" || n === "next" || n === "unified-prev" || n === "unified-next") {
|
|
3157
|
-
const
|
|
3158
|
-
if (
|
|
3174
|
+
const i = t;
|
|
3175
|
+
if (i.disabled || i.classList.contains("drp-date-picker__nav--disabled"))
|
|
3159
3176
|
return;
|
|
3160
3177
|
}
|
|
3161
|
-
if (n === "prev") this.prevMonth(
|
|
3162
|
-
else if (n === "next") this.nextMonth(
|
|
3178
|
+
if (n === "prev") this.prevMonth(o);
|
|
3179
|
+
else if (n === "next") this.nextMonth(o);
|
|
3163
3180
|
else if (n === "unified-prev") this.unifiedPrevMonth();
|
|
3164
3181
|
else if (n === "unified-next") this.unifiedNextMonth();
|
|
3165
|
-
else if (n === "toggle-rolling") this.toggleRollingSelector(
|
|
3182
|
+
else if (n === "toggle-rolling") this.toggleRollingSelector(o);
|
|
3166
3183
|
else if (n === "toggle-unified-rolling") this.toggleUnifiedRollingSelector();
|
|
3167
3184
|
else if (n === "today") this.selectToday();
|
|
3168
3185
|
else if (n === "clear") this.clearSelection();
|
|
3169
3186
|
else if (n === "apply") this.apply();
|
|
3170
3187
|
else if (n === "custom") {
|
|
3171
|
-
const
|
|
3172
|
-
|
|
3188
|
+
const i = t._customOnClick;
|
|
3189
|
+
i && await Promise.resolve(i(this));
|
|
3173
3190
|
} else if (t.closest(".drp-date-picker__day:not(.drp-date-picker__day--disabled)"))
|
|
3174
3191
|
await this.selectDay(t.closest(".drp-date-picker__day"));
|
|
3175
3192
|
else if (t.closest("[data-year]")) {
|
|
3176
|
-
const
|
|
3177
|
-
if (
|
|
3193
|
+
const i = t.closest("[data-year]");
|
|
3194
|
+
if (i.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3178
3195
|
return;
|
|
3179
|
-
const s =
|
|
3180
|
-
if (
|
|
3196
|
+
const s = i.dataset.year;
|
|
3197
|
+
if (i.dataset.unified === "true")
|
|
3181
3198
|
s && this.setUnifiedYear(parseInt(s));
|
|
3182
3199
|
else {
|
|
3183
|
-
const d =
|
|
3200
|
+
const d = i.dataset.monthIndex;
|
|
3184
3201
|
s && d && this.selectYear(parseInt(s), parseInt(d));
|
|
3185
3202
|
}
|
|
3186
3203
|
} else if (t.closest("[data-month]")) {
|
|
3187
|
-
const
|
|
3188
|
-
if (
|
|
3204
|
+
const i = t.closest("[data-month]");
|
|
3205
|
+
if (i.classList.contains("drp-date-picker__rolling-item--disabled"))
|
|
3189
3206
|
return;
|
|
3190
|
-
const s =
|
|
3191
|
-
if (
|
|
3207
|
+
const s = i.dataset.month;
|
|
3208
|
+
if (i.dataset.unified === "true")
|
|
3192
3209
|
s && this.setUnifiedMonth(parseInt(s));
|
|
3193
3210
|
else {
|
|
3194
|
-
const d =
|
|
3211
|
+
const d = i.dataset.monthIndex;
|
|
3195
3212
|
s && d && this.selectMonth(parseInt(s), parseInt(d));
|
|
3196
3213
|
}
|
|
3197
3214
|
} else if (!t.closest(".drp-date-picker__rolling-selector") && !t.closest(".drp-date-picker__unified-rolling-selector")) {
|
|
3198
|
-
let
|
|
3215
|
+
let i = !1;
|
|
3199
3216
|
for (let s = 0; s < this.showingRollingSelector.length; s++)
|
|
3200
|
-
this.showingRollingSelector[s] && (this.showingRollingSelector[s] = !1,
|
|
3201
|
-
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1,
|
|
3217
|
+
this.showingRollingSelector[s] && (this.showingRollingSelector[s] = !1, i = !0);
|
|
3218
|
+
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, i = !0), i && this.renderCalendar();
|
|
3202
3219
|
}
|
|
3203
3220
|
}), this.calendar.addEventListener("mouseenter", (a) => {
|
|
3204
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"),
|
|
3205
|
-
if (
|
|
3206
|
-
const
|
|
3207
|
-
|
|
3221
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"), o = n || r;
|
|
3222
|
+
if (o && o instanceof HTMLElement) {
|
|
3223
|
+
const i = o.dataset.tooltip;
|
|
3224
|
+
i && this.showTooltip(o, i);
|
|
3208
3225
|
}
|
|
3209
3226
|
}, !0), this.calendar.addEventListener("mouseleave", (a) => {
|
|
3210
|
-
const t = a.target, n = t.closest(".drp-date-picker__day"),
|
|
3211
|
-
|
|
3227
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), r = t.closest(".drp-date-picker__badge-cell"), o = n || r;
|
|
3228
|
+
o && this.currentTooltipTarget === o && this.hideTooltip();
|
|
3212
3229
|
}, !0), this.calendar.addEventListener("mousedown", (a) => {
|
|
3213
3230
|
this.isCalendarActive = !0, a.stopPropagation();
|
|
3214
3231
|
}), this.calendar.addEventListener("focusin", () => {
|
|
@@ -3216,9 +3233,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3216
3233
|
}), document.addEventListener("mousedown", (a) => {
|
|
3217
3234
|
this.calendar.contains(a.target) || (this.isCalendarActive = !1);
|
|
3218
3235
|
}, !0), document.addEventListener("keydown", (a) => {
|
|
3219
|
-
var t, n,
|
|
3236
|
+
var t, n, r, o;
|
|
3220
3237
|
if (this.calendar.classList.contains("drp-date-picker--visible") && this.isCalendarActive) {
|
|
3221
|
-
if (
|
|
3238
|
+
if (T.debug("Keydown", a.key, "Ctrl:", a.ctrlKey, "Meta:", a.metaKey, "Shift:", a.shiftKey, "Alt:", a.altKey), a.key === "Escape")
|
|
3222
3239
|
this.hide(), a.preventDefault();
|
|
3223
3240
|
else if (a.key === "ArrowUp")
|
|
3224
3241
|
this.moveFocus(-7), a.preventDefault();
|
|
@@ -3227,11 +3244,11 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3227
3244
|
else if (a.key === "ArrowLeft") {
|
|
3228
3245
|
if (a.ctrlKey || a.metaKey) {
|
|
3229
3246
|
w.debug("Ctrl+Left: Navigate to previous month");
|
|
3230
|
-
const
|
|
3247
|
+
const i = this.focusedDayIndex;
|
|
3231
3248
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3232
3249
|
var l, c;
|
|
3233
3250
|
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3234
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3251
|
+
d && (this.focusedDayIndex = Math.min(i !== null ? i : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3235
3252
|
}, 0);
|
|
3236
3253
|
} else
|
|
3237
3254
|
this.moveFocus(-1);
|
|
@@ -3239,25 +3256,25 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3239
3256
|
} else if (a.key === "ArrowRight") {
|
|
3240
3257
|
if (a.ctrlKey || a.metaKey) {
|
|
3241
3258
|
w.debug("Ctrl+Right: Navigate to next month");
|
|
3242
|
-
const
|
|
3259
|
+
const i = this.focusedDayIndex;
|
|
3243
3260
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3244
3261
|
var l, c;
|
|
3245
3262
|
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3246
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3263
|
+
d && (this.focusedDayIndex = Math.min(i !== null ? i : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3247
3264
|
}, 0);
|
|
3248
3265
|
} else
|
|
3249
3266
|
this.moveFocus(1);
|
|
3250
3267
|
a.preventDefault();
|
|
3251
3268
|
} else if (a.key === "Enter") {
|
|
3252
3269
|
if (this.focusedDayIndex !== null) {
|
|
3253
|
-
const
|
|
3270
|
+
const i = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = i == null ? void 0 : i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), d = s == null ? void 0 : s[this.focusedDayIndex];
|
|
3254
3271
|
d && d.click();
|
|
3255
3272
|
} else
|
|
3256
3273
|
this.hide();
|
|
3257
3274
|
a.preventDefault();
|
|
3258
3275
|
} else if (a.key === "Tab") {
|
|
3259
3276
|
if (this.options.visibleMonthsCount > 1) {
|
|
3260
|
-
const
|
|
3277
|
+
const i = a.shiftKey ? -1 : 1, s = this.activeMonthIndex + i;
|
|
3261
3278
|
if (s >= 0 && s < this.monthDates.length) {
|
|
3262
3279
|
w.debug(`Tab: switching from Col${this.activeMonthIndex} to Col${s}`);
|
|
3263
3280
|
const d = this.focusedDayIndex ?? 0;
|
|
@@ -3273,33 +3290,33 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3273
3290
|
}
|
|
3274
3291
|
} else if (a.key === "t" || a.key === "T")
|
|
3275
3292
|
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), this.renderCalendar(), setTimeout(() => {
|
|
3276
|
-
const
|
|
3293
|
+
const i = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = i == null ? void 0 : i.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3277
3294
|
if (s) {
|
|
3278
3295
|
const d = Array.from(s).findIndex((l) => l.classList.contains("drp-date-picker__day--today"));
|
|
3279
3296
|
d !== -1 && (this.focusedDayIndex = d, s[d].classList.add("drp-date-picker__day--focused"), s[d].scrollIntoView({ block: "nearest" }));
|
|
3280
3297
|
}
|
|
3281
3298
|
}, 0), a.preventDefault();
|
|
3282
3299
|
else if (a.key === "PageUp") {
|
|
3283
|
-
const
|
|
3300
|
+
const i = this.focusedDayIndex;
|
|
3284
3301
|
this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3285
3302
|
var l, c;
|
|
3286
3303
|
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3287
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3304
|
+
d && (this.focusedDayIndex = Math.min(i !== null ? i : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3288
3305
|
}, 0), a.preventDefault();
|
|
3289
3306
|
} else if (a.key === "PageDown") {
|
|
3290
|
-
const
|
|
3307
|
+
const i = this.focusedDayIndex;
|
|
3291
3308
|
this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3292
3309
|
var l, c;
|
|
3293
3310
|
const s = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), d = s == null ? void 0 : s.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3294
|
-
d && (this.focusedDayIndex = Math.min(
|
|
3311
|
+
d && (this.focusedDayIndex = Math.min(i !== null ? i : 0, d.length - 1), (l = d[this.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"), (c = d[this.focusedDayIndex]) == null || c.scrollIntoView({ block: "nearest" }));
|
|
3295
3312
|
}, 0), a.preventDefault();
|
|
3296
3313
|
} else if (a.key === "Home") {
|
|
3297
3314
|
w.debug("Home key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3298
|
-
const
|
|
3315
|
+
const i = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3299
3316
|
if (a.ctrlKey || a.metaKey) {
|
|
3300
3317
|
w.debug("Ctrl+Home: Navigate to year start");
|
|
3301
3318
|
const d = s === 0, l = this.focusedDayIndex === 0;
|
|
3302
|
-
d && l ? (w.debug("Already at Jan 1, going to previous year"), this.monthDates[this.activeMonthIndex] = new Date(
|
|
3319
|
+
d && l ? (w.debug("Already at Jan 1, going to previous year"), this.monthDates[this.activeMonthIndex] = new Date(i - 1, 0, 1)) : (w.debug("Going to Jan 1 of current year"), this.monthDates[this.activeMonthIndex] = new Date(i, 0, 1)), this.renderCalendar(), setTimeout(() => {
|
|
3303
3320
|
var u, g;
|
|
3304
3321
|
const c = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), p = c == null ? void 0 : c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3305
3322
|
p && (this.focusedDayIndex = 0, (u = p[0]) == null || u.classList.add("drp-date-picker__day--focused"), (g = p[0]) == null || g.scrollIntoView({ block: "nearest" }));
|
|
@@ -3318,32 +3335,32 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3318
3335
|
a.preventDefault();
|
|
3319
3336
|
} else if (a.key === "End") {
|
|
3320
3337
|
w.debug("End key pressed, Ctrl:", a.ctrlKey, "Meta:", a.metaKey);
|
|
3321
|
-
const
|
|
3338
|
+
const i = this.monthDates[this.activeMonthIndex].getFullYear(), s = this.monthDates[this.activeMonthIndex].getMonth();
|
|
3322
3339
|
if (a.ctrlKey || a.metaKey) {
|
|
3323
3340
|
w.debug("Ctrl+End: Navigate to year end");
|
|
3324
3341
|
const d = s === 11, l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), p = c && this.focusedDayIndex === c.length - 1;
|
|
3325
|
-
d && p ? this.monthDates[this.activeMonthIndex] = new Date(
|
|
3326
|
-
var
|
|
3342
|
+
d && p ? this.monthDates[this.activeMonthIndex] = new Date(i + 1, 11, 31) : this.monthDates[this.activeMonthIndex] = new Date(i, 11, 31), this.renderCalendar(), setTimeout(() => {
|
|
3343
|
+
var f, h;
|
|
3327
3344
|
const u = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), g = u == null ? void 0 : u.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3328
|
-
g && (this.focusedDayIndex = g.length - 1, (
|
|
3345
|
+
g && (this.focusedDayIndex = g.length - 1, (f = g[this.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (h = g[this.focusedDayIndex]) == null || h.scrollIntoView({ block: "nearest" }));
|
|
3329
3346
|
}, 0);
|
|
3330
3347
|
} else {
|
|
3331
3348
|
w.debug("End: Navigate to last day (cycles to next month if already there)");
|
|
3332
3349
|
const d = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), l = d == null ? void 0 : d.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3333
3350
|
if (!l) return;
|
|
3334
3351
|
this.focusedDayIndex === l.length - 1 ? (w.debug("Already on last day, going to next month"), this.nextMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3335
|
-
var g,
|
|
3352
|
+
var g, f;
|
|
3336
3353
|
const p = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), u = p == null ? void 0 : p.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3337
|
-
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3338
|
-
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (
|
|
3354
|
+
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((h) => h.classList.remove("drp-date-picker__day--focused")), (g = u[this.focusedDayIndex]) == null || g.classList.add("drp-date-picker__day--focused"), (f = u[this.focusedDayIndex]) == null || f.scrollIntoView({ block: "nearest" }));
|
|
3355
|
+
}, 0)) : (this.focusedDayIndex = l.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.classList.remove("drp-date-picker__day--focused")), (r = l[this.focusedDayIndex]) == null || r.classList.add("drp-date-picker__day--focused"), (o = l[this.focusedDayIndex]) == null || o.scrollIntoView({ block: "nearest" }));
|
|
3339
3356
|
}
|
|
3340
3357
|
a.preventDefault();
|
|
3341
3358
|
}
|
|
3342
3359
|
}
|
|
3343
3360
|
}), this.clickOutsideHandler = (a) => {
|
|
3344
3361
|
var s;
|
|
3345
|
-
const t = a.composedPath(), n = t[0],
|
|
3346
|
-
if (!
|
|
3362
|
+
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]");
|
|
3363
|
+
if (!r && !o && !i)
|
|
3347
3364
|
if (this.options.positioningMode === "floating")
|
|
3348
3365
|
this.hide();
|
|
3349
3366
|
else {
|
|
@@ -3358,8 +3375,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3358
3375
|
parseFormat(a) {
|
|
3359
3376
|
const t = {};
|
|
3360
3377
|
let n = "";
|
|
3361
|
-
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((
|
|
3362
|
-
|
|
3378
|
+
return a.includes("-") ? n = "-" : a.includes("/") ? n = "/" : a.includes(".") && (n = "."), a.split(n).forEach((o, i) => {
|
|
3379
|
+
o === "YYYY" || o === "YY" ? t.year = { index: i, length: o.length } : o === "MM" || o === "M" ? t.month = { index: i, length: 2 } : (o === "DD" || o === "D") && (t.day = { index: i, length: 2 });
|
|
3363
3380
|
}), {
|
|
3364
3381
|
format: a,
|
|
3365
3382
|
separator: n,
|
|
@@ -3369,10 +3386,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3369
3386
|
}
|
|
3370
3387
|
formatDate(a) {
|
|
3371
3388
|
if (!a) return "";
|
|
3372
|
-
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"),
|
|
3389
|
+
const t = a.getFullYear(), n = String(a.getMonth() + 1).padStart(2, "0"), r = String(a.getDate()).padStart(2, "0"), { format: o, separator: i, parts: s } = this.formatInfo, d = [];
|
|
3373
3390
|
for (let l = 0; l < 3; l++)
|
|
3374
|
-
s.year && s.year.index === l ? d.push(s.year.length === 2 ? String(t).slice(-2) : t) : s.month && s.month.index === l ? d.push(n) : s.day && s.day.index === l && d.push(
|
|
3375
|
-
return d.join(
|
|
3391
|
+
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);
|
|
3392
|
+
return d.join(i);
|
|
3376
3393
|
}
|
|
3377
3394
|
// Reactive getters/setters for programmatic control
|
|
3378
3395
|
/**
|
|
@@ -3426,10 +3443,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3426
3443
|
}
|
|
3427
3444
|
// UI methods - wrappers for pure functions
|
|
3428
3445
|
show() {
|
|
3429
|
-
return
|
|
3446
|
+
return kt(this);
|
|
3430
3447
|
}
|
|
3431
3448
|
hide() {
|
|
3432
|
-
return
|
|
3449
|
+
return Lt(this);
|
|
3433
3450
|
}
|
|
3434
3451
|
toggle() {
|
|
3435
3452
|
return tn(this);
|
|
@@ -3448,7 +3465,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3448
3465
|
return hn(this);
|
|
3449
3466
|
}
|
|
3450
3467
|
renderNormalView(a) {
|
|
3451
|
-
return
|
|
3468
|
+
return Pt(this, a);
|
|
3452
3469
|
}
|
|
3453
3470
|
renderDays(a, t) {
|
|
3454
3471
|
return Nt(this, a, t);
|
|
@@ -3460,7 +3477,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3460
3477
|
return bn(this);
|
|
3461
3478
|
}
|
|
3462
3479
|
updateSummaryWithPreview() {
|
|
3463
|
-
return
|
|
3480
|
+
return Ht(this);
|
|
3464
3481
|
}
|
|
3465
3482
|
updateDragPreview() {
|
|
3466
3483
|
return yn(this);
|
|
@@ -3500,7 +3517,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3500
3517
|
setUnifiedYear(a) {
|
|
3501
3518
|
return gn(this, a);
|
|
3502
3519
|
}
|
|
3503
|
-
findNextEnabledDayIndex(a, t, n,
|
|
3520
|
+
findNextEnabledDayIndex(a, t, n, r) {
|
|
3504
3521
|
return fe(this, a, t, n);
|
|
3505
3522
|
}
|
|
3506
3523
|
moveFocus(a) {
|
|
@@ -3524,7 +3541,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3524
3541
|
return xn(this);
|
|
3525
3542
|
}
|
|
3526
3543
|
startDrag(a, t, n) {
|
|
3527
|
-
return
|
|
3544
|
+
return Yt(this, a, t, n);
|
|
3528
3545
|
}
|
|
3529
3546
|
onDragMove(a) {
|
|
3530
3547
|
return Vt(this, a);
|
|
@@ -3581,11 +3598,11 @@ const jt = '@charset "UTF-8";:host,:root{--drp-font-scale: 1;--drp-spacing-scale
|
|
|
3581
3598
|
*/
|
|
3582
3599
|
static injectGlobalStyles(a = !1) {
|
|
3583
3600
|
if (ve.stylesInjected && !a) {
|
|
3584
|
-
|
|
3601
|
+
T.debug("Styles already injected, skipping");
|
|
3585
3602
|
return;
|
|
3586
3603
|
}
|
|
3587
3604
|
const t = document.createElement("style");
|
|
3588
|
-
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0,
|
|
3605
|
+
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), ve.stylesInjected = !0, T.info("Global styles injected successfully");
|
|
3589
3606
|
}
|
|
3590
3607
|
/**
|
|
3591
3608
|
* Check if styles appear to be loaded
|
|
@@ -3626,6 +3643,7 @@ class Wt extends HTMLElement {
|
|
|
3626
3643
|
b(this, "_beforeMonthChangedCallback");
|
|
3627
3644
|
b(this, "_formatSummaryCallback");
|
|
3628
3645
|
b(this, "_getUnifiedHeaderCallback");
|
|
3646
|
+
b(this, "_getMonthHeaderCallback");
|
|
3629
3647
|
// Member mapping properties for specialDates array
|
|
3630
3648
|
b(this, "_dateMember");
|
|
3631
3649
|
b(this, "_badgeTextMember");
|
|
@@ -3683,8 +3701,8 @@ class Wt extends HTMLElement {
|
|
|
3683
3701
|
applySizeStyles() {
|
|
3684
3702
|
const t = this.shadow.querySelector(".drp-date-picker");
|
|
3685
3703
|
if (!t) return;
|
|
3686
|
-
const n = this.getAttribute("spacing"),
|
|
3687
|
-
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`),
|
|
3704
|
+
const n = this.getAttribute("spacing"), r = this.getAttribute("font-size"), o = this.getAttribute("cell-size"), i = this.hasAttribute("enable-transitions");
|
|
3705
|
+
t.classList.remove("drp-spacing-xs", "drp-spacing-sm", "drp-spacing-lg", "drp-spacing-xl"), t.classList.remove("drp-font-xs", "drp-font-sm", "drp-font-lg", "drp-font-xl"), t.classList.remove("drp-cell-xs", "drp-cell-sm", "drp-cell-lg", "drp-cell-xl"), n && n !== "md" && t.classList.add(`drp-spacing-${n}`), r && r !== "md" && t.classList.add(`drp-font-${r}`), o && o !== "md" && t.classList.add(`drp-cell-${o}`), i ? t.classList.add("drp-transitions-enabled") : t.classList.remove("drp-transitions-enabled");
|
|
3688
3706
|
}
|
|
3689
3707
|
applyInputSizeStyles() {
|
|
3690
3708
|
if (!this.inputElement) return;
|
|
@@ -3697,8 +3715,8 @@ class Wt extends HTMLElement {
|
|
|
3697
3715
|
disconnectedCallback() {
|
|
3698
3716
|
this.picker && this.picker.destroy();
|
|
3699
3717
|
}
|
|
3700
|
-
attributeChangedCallback(t, n,
|
|
3701
|
-
if (n !==
|
|
3718
|
+
attributeChangedCallback(t, n, r) {
|
|
3719
|
+
if (n !== r) {
|
|
3702
3720
|
if (t === "spacing" || t === "font-size" || t === "cell-size" || t === "enable-transitions") {
|
|
3703
3721
|
this.applySizeStyles(), this.picker && t === "cell-size" && this.picker.renderCalendar();
|
|
3704
3722
|
return;
|
|
@@ -3707,33 +3725,33 @@ class Wt extends HTMLElement {
|
|
|
3707
3725
|
this.applyInputSizeStyles();
|
|
3708
3726
|
return;
|
|
3709
3727
|
}
|
|
3710
|
-
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement &&
|
|
3728
|
+
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement && r !== null && (this.inputElement.value = r), t === "placeholder" && this.inputElement && r !== null && (this.inputElement.placeholder = r), t === "disabled" && this.inputElement && (r !== null ? this.inputElement.disabled = !0 : this.inputElement.disabled = !1);
|
|
3711
3729
|
}
|
|
3712
3730
|
}
|
|
3713
3731
|
render() {
|
|
3714
3732
|
const t = document.createElement("style");
|
|
3715
3733
|
if (t.textContent = jt, this.shadow.appendChild(t), (this.getAttribute("positioning-mode") || "floating") === "floating") {
|
|
3716
3734
|
this.inputElement = document.createElement("input"), this.inputElement.type = "text", this.inputElement.classList.add("drp-input", "drp-date-picker-input");
|
|
3717
|
-
const
|
|
3718
|
-
|
|
3719
|
-
const
|
|
3720
|
-
|
|
3735
|
+
const r = this.getAttribute("placeholder");
|
|
3736
|
+
r && (this.inputElement.placeholder = r);
|
|
3737
|
+
const o = this.getAttribute("value");
|
|
3738
|
+
o && (this.inputElement.value = o), this.hasAttribute("disabled") && (this.inputElement.disabled = !0), this.shadow.appendChild(this.inputElement), this.applyInputSizeStyles();
|
|
3721
3739
|
}
|
|
3722
3740
|
}
|
|
3723
3741
|
initializePicker() {
|
|
3724
3742
|
const t = this.getAttribute("positioning-mode") || "floating";
|
|
3725
3743
|
if (t === "floating" && !this.inputElement) return;
|
|
3726
3744
|
let n;
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3729
|
-
let
|
|
3730
|
-
const
|
|
3731
|
-
if (
|
|
3732
|
-
if (
|
|
3733
|
-
|
|
3745
|
+
const r = this.getAttribute("disabled-weekdays");
|
|
3746
|
+
r && (n = r.split(",").map((l) => parseInt(l.trim())).filter((l) => !isNaN(l) && l >= 0 && l <= 6));
|
|
3747
|
+
let o;
|
|
3748
|
+
const i = this.getAttribute("week-start-day");
|
|
3749
|
+
if (i)
|
|
3750
|
+
if (i === "auto")
|
|
3751
|
+
o = "auto";
|
|
3734
3752
|
else {
|
|
3735
|
-
const l = parseInt(
|
|
3736
|
-
!isNaN(l) && l >= 0 && l <= 6 && (
|
|
3753
|
+
const l = parseInt(i);
|
|
3754
|
+
!isNaN(l) && l >= 0 && l <= 6 && (o = l);
|
|
3737
3755
|
}
|
|
3738
3756
|
const s = {
|
|
3739
3757
|
selectionMode: this.getAttribute("selection-mode") || "single",
|
|
@@ -3754,7 +3772,7 @@ class Wt extends HTMLElement {
|
|
|
3754
3772
|
// Positioning
|
|
3755
3773
|
calendarPlacement: this.getAttribute("calendar-placement") || void 0,
|
|
3756
3774
|
// New options
|
|
3757
|
-
weekStartDay:
|
|
3775
|
+
weekStartDay: o,
|
|
3758
3776
|
minDate: this.getAttribute("min-date") || void 0,
|
|
3759
3777
|
maxDate: this.getAttribute("max-date") || void 0,
|
|
3760
3778
|
initialDate: this.getAttribute("initial-date") || void 0,
|
|
@@ -3789,6 +3807,7 @@ class Wt extends HTMLElement {
|
|
|
3789
3807
|
beforeMonthChangedCallback: this._beforeMonthChangedCallback,
|
|
3790
3808
|
formatSummaryCallback: this._formatSummaryCallback,
|
|
3791
3809
|
getUnifiedHeaderCallback: this._getUnifiedHeaderCallback,
|
|
3810
|
+
getMonthHeaderCallback: this._getMonthHeaderCallback,
|
|
3792
3811
|
// Action button configuration
|
|
3793
3812
|
autoClose: this.getAttribute("auto-close") || void 0,
|
|
3794
3813
|
actionButtons: this._actionButtons,
|
|
@@ -3815,11 +3834,11 @@ class Wt extends HTMLElement {
|
|
|
3815
3834
|
}));
|
|
3816
3835
|
}
|
|
3817
3836
|
handleDateSelect(t) {
|
|
3818
|
-
var
|
|
3837
|
+
var o;
|
|
3819
3838
|
const n = {
|
|
3820
3839
|
date: t instanceof Date ? t : void 0,
|
|
3821
3840
|
dateRange: t instanceof Date || Array.isArray(t) ? void 0 : t,
|
|
3822
|
-
formattedValue: ((
|
|
3841
|
+
formattedValue: ((o = this.inputElement) == null ? void 0 : o.value) || ""
|
|
3823
3842
|
};
|
|
3824
3843
|
if (!this.picker) {
|
|
3825
3844
|
this.dispatchEvent(new CustomEvent("date-select", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: n, bubbles: !0, composed: !0 }));
|
|
@@ -3827,21 +3846,21 @@ class Wt extends HTMLElement {
|
|
|
3827
3846
|
}
|
|
3828
3847
|
if (this.picker.requiresApplyButton() && this.picker.pendingSelection)
|
|
3829
3848
|
return;
|
|
3830
|
-
const
|
|
3849
|
+
const r = this.picker.options.disabledDatesHandling;
|
|
3831
3850
|
if (!(t instanceof Date) && !Array.isArray(t) && "start" in t && "end" in t) {
|
|
3832
|
-
const
|
|
3833
|
-
switch (
|
|
3851
|
+
const i = t.start, s = t.end;
|
|
3852
|
+
switch (r) {
|
|
3834
3853
|
case "allow":
|
|
3835
|
-
n.enabledDates = this.picker.getEnabledDatesInRange(
|
|
3854
|
+
n.enabledDates = this.picker.getEnabledDatesInRange(i, s), n.disabledDates = this.picker.getDisabledDatesInRange(i, s), n.getEnabledDateCount = () => n.enabledDates.length, n.getTotalDays = () => Math.floor((s.getTime() - i.getTime()) / 864e5) + 1;
|
|
3836
3855
|
break;
|
|
3837
3856
|
case "split":
|
|
3838
|
-
n.dateRanges = this.picker.splitRangeByDisabled(
|
|
3857
|
+
n.dateRanges = this.picker.splitRangeByDisabled(i, s), n.dates = this.picker.getEnabledDatesInRange(i, s), n.dateRanges.length > 0 && (n.formattedValue = n.dateRanges.map((d) => `${this.picker.formatDate(d.start)} - ${this.picker.formatDate(d.end)}`).join(", "));
|
|
3839
3858
|
break;
|
|
3840
3859
|
case "individual":
|
|
3841
|
-
n.dates = this.picker.getEnabledDatesInRange(
|
|
3860
|
+
n.dates = this.picker.getEnabledDatesInRange(i, s), n.dateRange = null, n.dates.length > 0 && (n.formattedValue = n.dates.map((d) => this.picker.formatDate(d)).join(", "));
|
|
3842
3861
|
break;
|
|
3843
3862
|
case "block":
|
|
3844
|
-
n.dates = this.picker.getEnabledDatesInRange(
|
|
3863
|
+
n.dates = this.picker.getEnabledDatesInRange(i, s);
|
|
3845
3864
|
break;
|
|
3846
3865
|
}
|
|
3847
3866
|
}
|
|
@@ -4060,6 +4079,12 @@ class Wt extends HTMLElement {
|
|
|
4060
4079
|
set getUnifiedHeaderCallback(t) {
|
|
4061
4080
|
this._getUnifiedHeaderCallback = t, this.scheduleReinit();
|
|
4062
4081
|
}
|
|
4082
|
+
get getMonthHeaderCallback() {
|
|
4083
|
+
return this._getMonthHeaderCallback;
|
|
4084
|
+
}
|
|
4085
|
+
set getMonthHeaderCallback(t) {
|
|
4086
|
+
this._getMonthHeaderCallback = t, this.scheduleReinit();
|
|
4087
|
+
}
|
|
4063
4088
|
// Member mapping getters/setters
|
|
4064
4089
|
get dateMember() {
|
|
4065
4090
|
return this._dateMember;
|
|
@@ -4145,10 +4170,10 @@ function An() {
|
|
|
4145
4170
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4146
4171
|
}
|
|
4147
4172
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4148
|
-
version: () => "1.
|
|
4173
|
+
version: () => "1.6.0",
|
|
4149
4174
|
config: {
|
|
4150
4175
|
name: "@keenmate/web-daterangepicker",
|
|
4151
|
-
version: "1.
|
|
4176
|
+
version: "1.6.0",
|
|
4152
4177
|
author: "Keenmate",
|
|
4153
4178
|
license: "MIT",
|
|
4154
4179
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|