@keenmate/web-daterangepicker 1.5.0 → 1.7.0-rc01
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 +65 -3
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +1051 -1048
- package/dist/web-daterangepicker.umd.js +9 -9
- package/package.json +1 -1
- package/src/scss/_badges.scss +4 -8
- package/src/scss/_base.scss +67 -74
- package/src/scss/_calendar-grid.scss +4 -7
- package/src/scss/_header-navigation.scss +5 -8
- package/src/scss/_loading.scss +4 -4
- package/src/scss/_modifiers.scss +0 -215
- package/src/scss/_summary-actions.scss +1 -0
- package/src/scss/_tooltips.scss +3 -3
- package/src/scss/_variables.scss +0 -13
|
@@ -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 i = n.weekInfo.firstDay;
|
|
11
|
+
return i === 7 ? 0 : i;
|
|
12
12
|
}
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
@@ -31,75 +31,75 @@ function Xt(e) {
|
|
|
31
31
|
// South Korea
|
|
32
32
|
].some((n) => a.startsWith(n)) ? 0 : 1;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function fe(e) {
|
|
35
35
|
if (!e) return null;
|
|
36
36
|
let a;
|
|
37
37
|
return typeof e == "string" ? a = /* @__PURE__ */ new Date(e + "T00:00:00") : a = new Date(e), a.setHours(0, 0, 0, 0), isNaN(a.getTime()) ? null : a;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function be(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, i) {
|
|
44
|
+
const r = be(e), o = e.getDay();
|
|
45
|
+
return !!(a && e < a || t && e > t || i && i.includes(o) || n.has(r));
|
|
46
46
|
}
|
|
47
47
|
function ct(e, a) {
|
|
48
48
|
for (let t = 0; t < 12; t++) {
|
|
49
49
|
const n = new Date(a, t + 1, 0).getDate();
|
|
50
|
-
for (let
|
|
51
|
-
const
|
|
52
|
-
if (!e.isDateDisabledInternal(
|
|
50
|
+
for (let i = 1; i <= n; i++) {
|
|
51
|
+
const r = new Date(a, t, i);
|
|
52
|
+
if (!e.isDateDisabledInternal(r))
|
|
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), i = new Date(a);
|
|
60
|
+
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
61
|
+
const r = new Date(n);
|
|
62
|
+
for (; r <= i; ) {
|
|
63
|
+
if (t(r))
|
|
64
64
|
return !0;
|
|
65
|
-
|
|
65
|
+
r.setDate(r.getDate() + 1);
|
|
66
66
|
}
|
|
67
67
|
return !1;
|
|
68
68
|
}
|
|
69
69
|
function Zt(e, a, t) {
|
|
70
|
-
const n = [],
|
|
71
|
-
|
|
72
|
-
const o = new Date(
|
|
73
|
-
for (; o <=
|
|
70
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
71
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
72
|
+
const o = new Date(i);
|
|
73
|
+
for (; o <= r; )
|
|
74
74
|
t(o) || n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
75
75
|
return n;
|
|
76
76
|
}
|
|
77
77
|
function ea(e, a, t) {
|
|
78
|
-
const n = [],
|
|
79
|
-
|
|
80
|
-
const o = new Date(
|
|
81
|
-
for (; o <=
|
|
78
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
79
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
80
|
+
const o = new Date(i);
|
|
81
|
+
for (; o <= r; )
|
|
82
82
|
t(o) && n.push(new Date(o)), o.setDate(o.getDate() + 1);
|
|
83
83
|
return n;
|
|
84
84
|
}
|
|
85
85
|
function ta(e, a, t) {
|
|
86
|
-
const n = new Date(e),
|
|
87
|
-
n.setHours(0, 0, 0, 0),
|
|
88
|
-
let
|
|
86
|
+
const n = new Date(e), i = new Date(a);
|
|
87
|
+
n.setHours(0, 0, 0, 0), i.setHours(0, 0, 0, 0);
|
|
88
|
+
let r = new Date(n);
|
|
89
89
|
const o = new Date(n);
|
|
90
|
-
for (o.setDate(o.getDate() + 1); o <=
|
|
90
|
+
for (o.setDate(o.getDate() + 1); o <= i; ) {
|
|
91
91
|
if (t(o))
|
|
92
|
-
return
|
|
93
|
-
|
|
92
|
+
return r;
|
|
93
|
+
r = new Date(o), o.setDate(o.getDate() + 1);
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return i;
|
|
96
96
|
}
|
|
97
97
|
function aa(e, a, t) {
|
|
98
|
-
const n = [],
|
|
99
|
-
|
|
98
|
+
const n = [], i = new Date(e), r = new Date(a);
|
|
99
|
+
i.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0);
|
|
100
100
|
let o = null;
|
|
101
|
-
const s = new Date(
|
|
102
|
-
for (; s <=
|
|
101
|
+
const s = new Date(i);
|
|
102
|
+
for (; s <= r; ) {
|
|
103
103
|
if (!t(s))
|
|
104
104
|
o || (o = new Date(s));
|
|
105
105
|
else if (o) {
|
|
@@ -108,169 +108,169 @@ function aa(e, a, t) {
|
|
|
108
108
|
}
|
|
109
109
|
s.setDate(s.getDate() + 1);
|
|
110
110
|
}
|
|
111
|
-
return o && n.push({ start: o, end: new Date(
|
|
111
|
+
return o && n.push({ start: o, end: new Date(r) }), n;
|
|
112
112
|
}
|
|
113
113
|
function ut(e) {
|
|
114
|
-
return
|
|
114
|
+
return ht(e, /* @__PURE__ */ new Date());
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ht(e, a) {
|
|
117
117
|
return !e || !a ? !1 : e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate();
|
|
118
118
|
}
|
|
119
119
|
function na(e, a, t) {
|
|
120
120
|
return !a || !t ? !1 : e > a && e < t;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var ia = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
123
|
+
function oa(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
|
+
})(ia, 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), i = [
|
|
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
|
+
], r = {}, o = null;
|
|
139
|
+
function s(p, D) {
|
|
140
|
+
var m = p[D];
|
|
141
|
+
if (typeof m.bind == "function")
|
|
142
|
+
return m.bind(p);
|
|
143
143
|
try {
|
|
144
|
-
return Function.prototype.bind.call(
|
|
144
|
+
return Function.prototype.bind.call(m, p);
|
|
145
145
|
} catch {
|
|
146
146
|
return function() {
|
|
147
|
-
return Function.prototype.apply.apply(
|
|
147
|
+
return Function.prototype.apply.apply(m, [p, 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(p) {
|
|
155
|
+
return p === "debug" && (p = "log"), typeof console === t ? !1 : p === "trace" && n ? d : console[p] !== void 0 ? s(console, p) : console.log !== void 0 ? s(console, "log") : a;
|
|
156
156
|
}
|
|
157
157
|
function c() {
|
|
158
|
-
for (var
|
|
159
|
-
var
|
|
160
|
-
this[
|
|
158
|
+
for (var p = this.getLevel(), D = 0; D < i.length; D++) {
|
|
159
|
+
var m = i[D];
|
|
160
|
+
this[m] = D < p ? a : this.methodFactory(m, p, this.name);
|
|
161
161
|
}
|
|
162
|
-
if (this.log = this.debug, typeof console === t &&
|
|
162
|
+
if (this.log = this.debug, typeof console === t && p < this.levels.SILENT)
|
|
163
163
|
return "No console available for logging";
|
|
164
164
|
}
|
|
165
|
-
function p
|
|
165
|
+
function h(p) {
|
|
166
166
|
return function() {
|
|
167
|
-
typeof console !== t && (c.call(this), this[
|
|
167
|
+
typeof console !== t && (c.call(this), this[p].apply(this, arguments));
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
function u(
|
|
171
|
-
return l(
|
|
170
|
+
function u(p, D, m) {
|
|
171
|
+
return l(p) || h.apply(this, arguments);
|
|
172
172
|
}
|
|
173
|
-
function g(
|
|
174
|
-
var
|
|
175
|
-
typeof
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
if (!(typeof window === t || !
|
|
173
|
+
function g(p, D) {
|
|
174
|
+
var m = this, C, I, S, v = "loglevel";
|
|
175
|
+
typeof p == "string" ? v += ":" + p : typeof p == "symbol" && (v = void 0);
|
|
176
|
+
function _(x) {
|
|
177
|
+
var E = (i[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, T = encodeURIComponent(v), A = E.indexOf(T + "=");
|
|
200
|
+
A !== -1 && (x = /^([^;]+)/.exec(
|
|
201
|
+
E.slice(A + T.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 = p, 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 (o !==
|
|
247
|
-
for (var
|
|
248
|
-
|
|
249
|
-
},
|
|
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 (o !== m && (C = y(o.getLevel())), c.call(m), o === m)
|
|
247
|
+
for (var x in r)
|
|
248
|
+
r[x].rebuild();
|
|
249
|
+
}, C = y(
|
|
250
250
|
o ? o.getLevel() : "WARN"
|
|
251
251
|
);
|
|
252
|
-
var
|
|
253
|
-
|
|
252
|
+
var M = R();
|
|
253
|
+
M != null && (S = y(M)), c.call(m);
|
|
254
254
|
}
|
|
255
|
-
o = new g(), o.getLogger = function(
|
|
256
|
-
if (typeof
|
|
255
|
+
o = new g(), o.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
|
-
|
|
258
|
+
var m = r[D];
|
|
259
|
+
return m || (m = r[D] = new g(
|
|
260
|
+
D,
|
|
261
261
|
o.methodFactory
|
|
262
|
-
)),
|
|
262
|
+
)), m;
|
|
263
263
|
};
|
|
264
|
-
var
|
|
264
|
+
var f = typeof window !== t ? window.log : void 0;
|
|
265
265
|
return o.noConflict = function() {
|
|
266
|
-
return typeof window !== t && window.log === o && (window.log =
|
|
266
|
+
return typeof window !== t && window.log === o && (window.log = f), o;
|
|
267
267
|
}, o.getLoggers = function() {
|
|
268
|
-
return
|
|
268
|
+
return r;
|
|
269
269
|
}, o.default = o, o;
|
|
270
270
|
});
|
|
271
271
|
})(gt);
|
|
272
|
-
var
|
|
273
|
-
const
|
|
272
|
+
var ra = gt.exports;
|
|
273
|
+
const O = /* @__PURE__ */ oa(ra), sa = [
|
|
274
274
|
"DRP",
|
|
275
275
|
"DRP:RENDERING",
|
|
276
276
|
"DRP:INTERACTION",
|
|
@@ -290,27 +290,27 @@ const Y = /* @__PURE__ */ ia(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 (...i) => {
|
|
296
|
+
const r = da[e] || "#6b7280", s = `%c[${(/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
297
297
|
hour12: !1,
|
|
298
298
|
hour: "2-digit",
|
|
299
299
|
minute: "2-digit",
|
|
300
300
|
second: "2-digit",
|
|
301
301
|
fractionalSecondDigits: 3
|
|
302
302
|
})}] [${e.toUpperCase()}] ${t ? `[${t}]` : ""}`;
|
|
303
|
-
n(s, `color: ${
|
|
303
|
+
n(s, `color: ${r}`, ...i);
|
|
304
304
|
};
|
|
305
|
-
},
|
|
305
|
+
}, pt = [];
|
|
306
306
|
function Q(e) {
|
|
307
|
-
const a =
|
|
308
|
-
return a.methodFactory = ca, a.setLevel("silent"),
|
|
307
|
+
const a = O.getLogger(e);
|
|
308
|
+
return a.methodFactory = ca, a.setLevel("silent"), pt.push(a), a;
|
|
309
309
|
}
|
|
310
|
-
const k = Q("DRP"), de = Q("DRP:RENDERING"),
|
|
311
|
-
|
|
310
|
+
const k = Q("DRP"), de = Q("DRP:RENDERING"), re = Q("DRP:INTERACTION"), oe = 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), pt.forEach((a) => a.setLevel(e));
|
|
314
314
|
}, ft = () => {
|
|
315
315
|
We("debug");
|
|
316
316
|
}, mt = () => {
|
|
@@ -319,15 +319,15 @@ const We = (e) => {
|
|
|
319
319
|
const n = {
|
|
320
320
|
DRP: k,
|
|
321
321
|
"DRP:RENDERING": de,
|
|
322
|
-
"DRP:INTERACTION":
|
|
323
|
-
"DRP:SELECTION":
|
|
322
|
+
"DRP:INTERACTION": re,
|
|
323
|
+
"DRP:SELECTION": oe,
|
|
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];
|
|
329
329
|
n && n.setLevel(a);
|
|
330
|
-
},
|
|
330
|
+
}, ha = () => [...sa], le = Math.min, te = Math.max, Ie = Math.round, Me = Math.floor, W = (e) => ({
|
|
331
331
|
x: e,
|
|
332
332
|
y: e
|
|
333
333
|
}), ga = {
|
|
@@ -335,7 +335,7 @@ const We = (e) => {
|
|
|
335
335
|
right: "left",
|
|
336
336
|
bottom: "top",
|
|
337
337
|
top: "bottom"
|
|
338
|
-
},
|
|
338
|
+
}, pa = {
|
|
339
339
|
start: "end",
|
|
340
340
|
end: "start"
|
|
341
341
|
};
|
|
@@ -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 o =
|
|
371
|
-
return a.reference[
|
|
369
|
+
const n = we(e), i = Ge(e), r = Ke(i);
|
|
370
|
+
let o = i === "x" ? n === (t ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
371
|
+
return a.reference[r] > a.floating[r] && (o = Ee(o)), [o, Ee(o)];
|
|
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
|
|
378
|
-
return e.replace(/start|end/g, (a) =>
|
|
377
|
+
function Ye(e) {
|
|
378
|
+
return e.replace(/start|end/g, (a) => pa[a]);
|
|
379
379
|
}
|
|
380
|
-
const nt = ["left", "right"],
|
|
380
|
+
const nt = ["left", "right"], it = ["right", "left"], ya = ["top", "bottom"], va = ["bottom", "top"];
|
|
381
381
|
function Da(e, a, t) {
|
|
382
382
|
switch (e) {
|
|
383
383
|
case "top":
|
|
384
384
|
case "bottom":
|
|
385
|
-
return t ? a ?
|
|
385
|
+
return t ? a ? it : nt : a ? nt : it;
|
|
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 i = we(e);
|
|
395
|
+
let r = Da(ne(e), t === "start", n);
|
|
396
|
+
return i && (r = r.map((o) => o + "-" + i), a && (r = r.concat(r.map(Ye)))), r;
|
|
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: i
|
|
424
424
|
} = e;
|
|
425
425
|
return {
|
|
426
426
|
width: n,
|
|
427
|
-
height:
|
|
427
|
+
height: i,
|
|
428
428
|
top: t,
|
|
429
429
|
left: a,
|
|
430
430
|
right: a + n,
|
|
431
|
-
bottom: t +
|
|
431
|
+
bottom: t + i,
|
|
432
432
|
x: a,
|
|
433
433
|
y: t
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ot(e, a, t) {
|
|
437
437
|
let {
|
|
438
438
|
reference: n,
|
|
439
|
-
floating:
|
|
439
|
+
floating: i
|
|
440
440
|
} = e;
|
|
441
|
-
const
|
|
441
|
+
const r = X(a), o = Ge(a), s = Ke(o), d = ne(a), l = r === "y", c = n.x + n.width / 2 - i.width / 2, h = n.y + n.height / 2 - i.height / 2, u = n[s] / 2 - i[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 - i.height
|
|
448
448
|
};
|
|
449
449
|
break;
|
|
450
450
|
case "bottom":
|
|
@@ -456,13 +456,13 @@ function it(e, a, t) {
|
|
|
456
456
|
case "right":
|
|
457
457
|
g = {
|
|
458
458
|
x: n.x + n.width,
|
|
459
|
-
y:
|
|
459
|
+
y: h
|
|
460
460
|
};
|
|
461
461
|
break;
|
|
462
462
|
case "left":
|
|
463
463
|
g = {
|
|
464
|
-
x: n.x -
|
|
465
|
-
y:
|
|
464
|
+
x: n.x - i.width,
|
|
465
|
+
y: h
|
|
466
466
|
};
|
|
467
467
|
break;
|
|
468
468
|
default:
|
|
@@ -484,33 +484,33 @@ function it(e, a, t) {
|
|
|
484
484
|
const xa = async (e, a, t) => {
|
|
485
485
|
const {
|
|
486
486
|
placement: n = "bottom",
|
|
487
|
-
strategy:
|
|
488
|
-
middleware:
|
|
487
|
+
strategy: i = "absolute",
|
|
488
|
+
middleware: r = [],
|
|
489
489
|
platform: o
|
|
490
|
-
} = t, s =
|
|
490
|
+
} = t, s = r.filter(Boolean), d = await (o.isRTL == null ? void 0 : o.isRTL(a));
|
|
491
491
|
let l = await o.getElementRects({
|
|
492
492
|
reference: e,
|
|
493
493
|
floating: a,
|
|
494
|
-
strategy:
|
|
494
|
+
strategy: i
|
|
495
495
|
}), {
|
|
496
496
|
x: c,
|
|
497
|
-
y:
|
|
498
|
-
} =
|
|
499
|
-
for (let
|
|
497
|
+
y: h
|
|
498
|
+
} = ot(l, n, d), u = n, g = {}, f = 0;
|
|
499
|
+
for (let p = 0; p < s.length; p++) {
|
|
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[p], {
|
|
504
|
+
x: C,
|
|
505
|
+
y: I,
|
|
506
|
+
data: S,
|
|
507
|
+
reset: v
|
|
508
|
+
} = await m({
|
|
509
509
|
x: c,
|
|
510
|
-
y:
|
|
510
|
+
y: h,
|
|
511
511
|
initialPlacement: n,
|
|
512
512
|
placement: u,
|
|
513
|
-
strategy:
|
|
513
|
+
strategy: i,
|
|
514
514
|
middlewareData: g,
|
|
515
515
|
rects: l,
|
|
516
516
|
platform: o,
|
|
@@ -519,26 +519,26 @@ const xa = async (e, a, t) => {
|
|
|
519
519
|
floating: a
|
|
520
520
|
}
|
|
521
521
|
});
|
|
522
|
-
c =
|
|
522
|
+
c = C ?? c, h = I ?? h, 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 o.getElementRects({
|
|
529
529
|
reference: e,
|
|
530
530
|
floating: a,
|
|
531
|
-
strategy:
|
|
532
|
-
}) :
|
|
531
|
+
strategy: i
|
|
532
|
+
}) : v.rects), {
|
|
533
533
|
x: c,
|
|
534
|
-
y:
|
|
535
|
-
} =
|
|
534
|
+
y: h
|
|
535
|
+
} = ot(l, u, d)), p = -1);
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
538
|
x: c,
|
|
539
|
-
y:
|
|
539
|
+
y: h,
|
|
540
540
|
placement: u,
|
|
541
|
-
strategy:
|
|
541
|
+
strategy: i,
|
|
542
542
|
middlewareData: g
|
|
543
543
|
};
|
|
544
544
|
};
|
|
@@ -547,44 +547,44 @@ async function vt(e, a) {
|
|
|
547
547
|
a === void 0 && (a = {});
|
|
548
548
|
const {
|
|
549
549
|
x: n,
|
|
550
|
-
y:
|
|
551
|
-
platform:
|
|
550
|
+
y: i,
|
|
551
|
+
platform: r,
|
|
552
552
|
rects: o,
|
|
553
553
|
elements: s,
|
|
554
554
|
strategy: d
|
|
555
555
|
} = e, {
|
|
556
556
|
boundary: l = "clippingAncestors",
|
|
557
557
|
rootBoundary: c = "viewport",
|
|
558
|
-
elementContext:
|
|
558
|
+
elementContext: h = "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 ? h === "floating" ? "reference" : "floating" : h], m = Re(await r.getClippingRect({
|
|
562
|
+
element: (t = await (r.isElement == null ? void 0 : r.isElement(D))) == null || t ? D : D.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(s.floating)),
|
|
563
563
|
boundary: l,
|
|
564
564
|
rootBoundary: c,
|
|
565
565
|
strategy: d
|
|
566
|
-
})),
|
|
566
|
+
})), C = h === "floating" ? {
|
|
567
567
|
x: n,
|
|
568
|
-
y:
|
|
568
|
+
y: i,
|
|
569
569
|
width: o.floating.width,
|
|
570
570
|
height: o.floating.height
|
|
571
|
-
} : o.reference,
|
|
571
|
+
} : o.reference, I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(s.floating)), S = await (r.isElement == null ? void 0 : r.isElement(I)) ? await (r.getScale == null ? void 0 : r.getScale(I)) || {
|
|
572
572
|
x: 1,
|
|
573
573
|
y: 1
|
|
574
574
|
} : {
|
|
575
575
|
x: 1,
|
|
576
576
|
y: 1
|
|
577
|
-
},
|
|
577
|
+
}, v = Re(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.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,8 +594,8 @@ const Ma = (e) => ({
|
|
|
594
594
|
const {
|
|
595
595
|
x: t,
|
|
596
596
|
y: n,
|
|
597
|
-
placement:
|
|
598
|
-
rects:
|
|
597
|
+
placement: i,
|
|
598
|
+
rects: r,
|
|
599
599
|
platform: o,
|
|
600
600
|
elements: s,
|
|
601
601
|
middlewareData: d
|
|
@@ -605,20 +605,20 @@ const Ma = (e) => ({
|
|
|
605
605
|
} = _e(e, a) || {};
|
|
606
606
|
if (l == null)
|
|
607
607
|
return {};
|
|
608
|
-
const
|
|
608
|
+
const h = yt(c), u = {
|
|
609
609
|
x: t,
|
|
610
610
|
y: n
|
|
611
|
-
}, g = Ge(
|
|
612
|
-
let
|
|
613
|
-
(!
|
|
614
|
-
const
|
|
611
|
+
}, g = Ge(i), f = Ke(g), p = await o.getDimensions(l), D = g === "y", m = D ? "top" : "left", C = D ? "bottom" : "right", I = D ? "clientHeight" : "clientWidth", S = r.reference[f] + r.reference[g] - u[g] - r.floating[f], v = u[g] - r.reference[g], _ = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
|
|
612
|
+
let R = _ ? _[I] : 0;
|
|
613
|
+
(!R || !await (o.isElement == null ? void 0 : o.isElement(_))) && (R = s.floating[I] || r.floating[f]);
|
|
614
|
+
const L = S / 2 - v / 2, y = R / 2 - p[f] / 2 - 1, M = le(h[m], y), x = le(h[C], y), E = M, T = R - p[f] - x, A = R / 2 - p[f] / 2 + L, $ = Be(E, A, T), N = !d.arrow && we(i) != null && A !== $ && r.reference[f] / 2 - (A < E ? M : x) - p[f] / 2 < 0, P = N ? A < E ? A - E : A - T : 0;
|
|
615
615
|
return {
|
|
616
|
-
[g]: u[g] +
|
|
616
|
+
[g]: u[g] + P,
|
|
617
617
|
data: {
|
|
618
|
-
[g]:
|
|
619
|
-
centerOffset:
|
|
618
|
+
[g]: $,
|
|
619
|
+
centerOffset: A - $ - P,
|
|
620
620
|
...N && {
|
|
621
|
-
alignmentOffset:
|
|
621
|
+
alignmentOffset: P
|
|
622
622
|
}
|
|
623
623
|
},
|
|
624
624
|
reset: N
|
|
@@ -631,71 +631,71 @@ const Ma = (e) => ({
|
|
|
631
631
|
async fn(a) {
|
|
632
632
|
var t, n;
|
|
633
633
|
const {
|
|
634
|
-
placement:
|
|
635
|
-
middlewareData:
|
|
634
|
+
placement: i,
|
|
635
|
+
middlewareData: r,
|
|
636
636
|
rects: o,
|
|
637
637
|
initialPlacement: s,
|
|
638
638
|
platform: d,
|
|
639
639
|
elements: l
|
|
640
640
|
} = a, {
|
|
641
641
|
mainAxis: c = !0,
|
|
642
|
-
crossAxis:
|
|
642
|
+
crossAxis: h = !0,
|
|
643
643
|
fallbackPlacements: u,
|
|
644
644
|
fallbackStrategy: g = "bestFit",
|
|
645
|
-
fallbackAxisSideDirection:
|
|
646
|
-
flipAlignment:
|
|
647
|
-
...
|
|
645
|
+
fallbackAxisSideDirection: f = "none",
|
|
646
|
+
flipAlignment: p = !0,
|
|
647
|
+
...D
|
|
648
648
|
} = _e(e, a);
|
|
649
|
-
if ((t =
|
|
649
|
+
if ((t = r.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(i), C = X(s), I = ne(s) === s, S = await (d.isRTL == null ? void 0 : d.isRTL(l.floating)), v = u || (I || !p ? [Ee(s)] : ba(s)), _ = f !== "none";
|
|
652
|
+
!u && _ && v.push(..._a(s, p, f, S));
|
|
653
|
+
const R = [s, ...v], L = await vt(a, D), y = [];
|
|
654
|
+
let M = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
655
|
+
if (c && y.push(L[m]), h) {
|
|
656
|
+
const A = ma(i, o, 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: i,
|
|
661
|
+
overflows: y
|
|
662
|
+
}], !y.every((A) => A <= 0)) {
|
|
663
|
+
var x, E;
|
|
664
|
+
const A = (((x = r.flip) == null ? void 0 : x.index) || 0) + 1, $ = R[A];
|
|
665
|
+
if ($ && (!(h === "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((z) => X(z.placement) === C ? z.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((P) => P.overflows[0] <= 0).sort((P, z) => P.overflows[1] - z.overflows[1])[0]) == null ? void 0 : E.placement;
|
|
678
678
|
if (!N)
|
|
679
679
|
switch (g) {
|
|
680
680
|
case "bestFit": {
|
|
681
681
|
var T;
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
684
|
-
const V = X(
|
|
685
|
-
return V ===
|
|
682
|
+
const P = (T = M.filter((z) => {
|
|
683
|
+
if (_) {
|
|
684
|
+
const V = X(z.placement);
|
|
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((
|
|
691
|
-
|
|
690
|
+
}).map((z) => [z.placement, z.overflows.filter((V) => V > 0).reduce((V, q) => V + q, 0)]).sort((z, V) => z[1] - V[1])[0]) == null ? void 0 : T[0];
|
|
691
|
+
P && (N = P);
|
|
692
692
|
break;
|
|
693
693
|
}
|
|
694
694
|
case "initialPlacement":
|
|
695
695
|
N = s;
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
|
-
if (
|
|
698
|
+
if (i !== N)
|
|
699
699
|
return {
|
|
700
700
|
reset: {
|
|
701
701
|
placement: N
|
|
@@ -710,22 +710,22 @@ async function Ia(e, a) {
|
|
|
710
710
|
const {
|
|
711
711
|
placement: t,
|
|
712
712
|
platform: n,
|
|
713
|
-
elements:
|
|
714
|
-
} = e,
|
|
713
|
+
elements: i
|
|
714
|
+
} = e, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), o = ne(t), s = we(t), d = X(t) === "y", l = Ca.has(o) ? -1 : 1, c = r && d ? -1 : 1, h = _e(a, e);
|
|
715
715
|
let {
|
|
716
716
|
mainAxis: u,
|
|
717
717
|
crossAxis: g,
|
|
718
|
-
alignmentAxis:
|
|
719
|
-
} = typeof
|
|
720
|
-
mainAxis:
|
|
718
|
+
alignmentAxis: f
|
|
719
|
+
} = typeof h == "number" ? {
|
|
720
|
+
mainAxis: h,
|
|
721
721
|
crossAxis: 0,
|
|
722
722
|
alignmentAxis: null
|
|
723
723
|
} : {
|
|
724
|
-
mainAxis:
|
|
725
|
-
crossAxis:
|
|
726
|
-
alignmentAxis:
|
|
724
|
+
mainAxis: h.mainAxis || 0,
|
|
725
|
+
crossAxis: h.crossAxis || 0,
|
|
726
|
+
alignmentAxis: h.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,14 +740,14 @@ const Ea = function(e) {
|
|
|
740
740
|
async fn(a) {
|
|
741
741
|
var t, n;
|
|
742
742
|
const {
|
|
743
|
-
x:
|
|
744
|
-
y:
|
|
743
|
+
x: i,
|
|
744
|
+
y: r,
|
|
745
745
|
placement: o,
|
|
746
746
|
middlewareData: s
|
|
747
747
|
} = a, d = await Ia(a, e);
|
|
748
748
|
return o === ((t = s.offset) == null ? void 0 : t.placement) && (n = s.arrow) != null && n.alignmentOffset ? {} : {
|
|
749
|
-
x:
|
|
750
|
-
y:
|
|
749
|
+
x: i + d.x,
|
|
750
|
+
y: r + d.y,
|
|
751
751
|
data: {
|
|
752
752
|
...d,
|
|
753
753
|
placement: o
|
|
@@ -763,19 +763,19 @@ const Ea = function(e) {
|
|
|
763
763
|
const {
|
|
764
764
|
x: t,
|
|
765
765
|
y: n,
|
|
766
|
-
placement:
|
|
766
|
+
placement: i
|
|
767
767
|
} = a, {
|
|
768
|
-
mainAxis:
|
|
768
|
+
mainAxis: r = !0,
|
|
769
769
|
crossAxis: o = !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,29 +783,29 @@ const Ea = function(e) {
|
|
|
783
783
|
} = _e(e, a), l = {
|
|
784
784
|
x: t,
|
|
785
785
|
y: n
|
|
786
|
-
}, c = await vt(a, d),
|
|
787
|
-
let g = l[u],
|
|
788
|
-
if (
|
|
789
|
-
const
|
|
790
|
-
g = Be(
|
|
786
|
+
}, c = await vt(a, d), h = X(ne(i)), u = bt(h);
|
|
787
|
+
let g = l[u], f = l[h];
|
|
788
|
+
if (r) {
|
|
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
791
|
}
|
|
792
792
|
if (o) {
|
|
793
|
-
const
|
|
794
|
-
|
|
793
|
+
const D = h === "y" ? "top" : "left", m = h === "y" ? "bottom" : "right", C = f + c[D], I = f - c[m];
|
|
794
|
+
f = Be(C, f, I);
|
|
795
795
|
}
|
|
796
|
-
const
|
|
796
|
+
const p = s.fn({
|
|
797
797
|
...a,
|
|
798
798
|
[u]: g,
|
|
799
|
-
[
|
|
799
|
+
[h]: f
|
|
800
800
|
});
|
|
801
801
|
return {
|
|
802
|
-
...
|
|
802
|
+
...p,
|
|
803
803
|
data: {
|
|
804
|
-
x:
|
|
805
|
-
y:
|
|
804
|
+
x: p.x - t,
|
|
805
|
+
y: p.y - n,
|
|
806
806
|
enabled: {
|
|
807
|
-
[u]:
|
|
808
|
-
[
|
|
807
|
+
[u]: r,
|
|
808
|
+
[h]: o
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
};
|
|
@@ -815,7 +815,7 @@ const Ea = function(e) {
|
|
|
815
815
|
function Pe() {
|
|
816
816
|
return typeof window < "u";
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function pe(e) {
|
|
819
819
|
return Dt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
820
820
|
}
|
|
821
821
|
function F(e) {
|
|
@@ -835,7 +835,7 @@ function B(e) {
|
|
|
835
835
|
function K(e) {
|
|
836
836
|
return Pe() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function rt(e) {
|
|
839
839
|
return !Pe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
|
|
840
840
|
}
|
|
841
841
|
const Aa = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -844,17 +844,17 @@ 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: i
|
|
848
|
+
} = Y(e);
|
|
849
|
+
return /auto|scroll|overlay|hidden|clip/.test(a + n + t) && !Aa.has(i);
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
function
|
|
853
|
-
return
|
|
851
|
+
const Ta = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
852
|
+
function La(e) {
|
|
853
|
+
return Ta.has(pe(e));
|
|
854
854
|
}
|
|
855
|
-
const
|
|
855
|
+
const ka = [":popover-open", ":modal"];
|
|
856
856
|
function ze(e) {
|
|
857
|
-
return
|
|
857
|
+
return ka.some((a) => {
|
|
858
858
|
try {
|
|
859
859
|
return e.matches(a);
|
|
860
860
|
} catch {
|
|
@@ -864,7 +864,7 @@ function ze(e) {
|
|
|
864
864
|
}
|
|
865
865
|
const $a = ["transform", "translate", "scale", "rotate", "perspective"], Pa = ["transform", "translate", "scale", "rotate", "perspective", "filter"], za = ["paint", "layout", "strict", "content"];
|
|
866
866
|
function Xe(e) {
|
|
867
|
-
const a = Je(), t = B(e) ?
|
|
867
|
+
const a = Je(), t = B(e) ? Y(e) : e;
|
|
868
868
|
return $a.some((n) => t[n] ? t[n] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !a && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !a && (t.filter ? t.filter !== "none" : !1) || Pa.some((n) => (t.willChange || "").includes(n)) || za.some((n) => (t.contain || "").includes(n));
|
|
869
869
|
}
|
|
870
870
|
function Na(e) {
|
|
@@ -883,9 +883,9 @@ function Je() {
|
|
|
883
883
|
}
|
|
884
884
|
const Fa = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
885
885
|
function ce(e) {
|
|
886
|
-
return Fa.has(
|
|
886
|
+
return Fa.has(pe(e));
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Y(e) {
|
|
889
889
|
return F(e).getComputedStyle(e);
|
|
890
890
|
}
|
|
891
891
|
function Ne(e) {
|
|
@@ -898,16 +898,16 @@ function Ne(e) {
|
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
function J(e) {
|
|
901
|
-
if (
|
|
901
|
+
if (pe(e) === "html")
|
|
902
902
|
return e;
|
|
903
903
|
const a = (
|
|
904
904
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
905
905
|
e.assignedSlot || // DOM Element detected.
|
|
906
906
|
e.parentNode || // ShadowRoot detected.
|
|
907
|
-
|
|
907
|
+
rt(e) && e.host || // Fallback.
|
|
908
908
|
G(e)
|
|
909
909
|
);
|
|
910
|
-
return
|
|
910
|
+
return rt(a) ? a.host : a;
|
|
911
911
|
}
|
|
912
912
|
function _t(e) {
|
|
913
913
|
const a = J(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 (
|
|
919
|
+
const i = _t(e), r = i === ((n = e.ownerDocument) == null ? void 0 : n.body), o = F(i);
|
|
920
|
+
if (r) {
|
|
921
921
|
const s = Ve(o);
|
|
922
|
-
return a.concat(o, o.visualViewport || [], xe(
|
|
922
|
+
return a.concat(o, o.visualViewport || [], xe(i) ? i : [], s && t ? ue(s) : []);
|
|
923
923
|
}
|
|
924
|
-
return a.concat(
|
|
924
|
+
return a.concat(i, ue(i, [], 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 i = K(e), r = i ? e.offsetWidth : t, o = i ? e.offsetHeight : n, s = Ie(t) !== r || Ie(n) !== o;
|
|
933
|
+
return s && (t = r, n = o), {
|
|
934
934
|
width: t,
|
|
935
935
|
height: n,
|
|
936
936
|
$: s
|
|
@@ -945,57 +945,57 @@ function se(e) {
|
|
|
945
945
|
return W(1);
|
|
946
946
|
const t = a.getBoundingClientRect(), {
|
|
947
947
|
width: n,
|
|
948
|
-
height:
|
|
949
|
-
$:
|
|
948
|
+
height: i,
|
|
949
|
+
$: r
|
|
950
950
|
} = wt(a);
|
|
951
|
-
let o = (
|
|
951
|
+
let o = (r ? Ie(t.width) : t.width) / n, s = (r ? Ie(t.height) : t.height) / i;
|
|
952
952
|
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
953
953
|
x: o,
|
|
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 ie(e, a, t, n) {
|
|
969
969
|
a === void 0 && (a = !1), t === void 0 && (t = !1);
|
|
970
|
-
const
|
|
970
|
+
const i = e.getBoundingClientRect(), r = Qe(e);
|
|
971
971
|
let o = W(1);
|
|
972
972
|
a && (n ? B(n) && (o = se(n)) : o = se(e));
|
|
973
|
-
const s =
|
|
974
|
-
let d = (
|
|
975
|
-
if (
|
|
976
|
-
const u = F(
|
|
977
|
-
let
|
|
978
|
-
for (;
|
|
979
|
-
const
|
|
980
|
-
d *=
|
|
973
|
+
const s = Oa(r, t, n) ? xt(r) : W(0);
|
|
974
|
+
let d = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, c = i.width / o.x, h = i.height / o.y;
|
|
975
|
+
if (r) {
|
|
976
|
+
const u = F(r), g = n && B(n) ? F(n) : n;
|
|
977
|
+
let f = u, p = Ve(f);
|
|
978
|
+
for (; p && n && g !== f; ) {
|
|
979
|
+
const D = se(p), m = p.getBoundingClientRect(), C = Y(p), I = m.left + (p.clientLeft + parseFloat(C.paddingLeft)) * D.x, S = m.top + (p.clientTop + parseFloat(C.paddingTop)) * D.y;
|
|
980
|
+
d *= D.x, l *= D.y, c *= D.x, h *= D.y, d += I, l += S, f = F(p), p = Ve(f);
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
return Re({
|
|
984
984
|
width: c,
|
|
985
|
-
height:
|
|
985
|
+
height: h,
|
|
986
986
|
x: d,
|
|
987
987
|
y: l
|
|
988
988
|
});
|
|
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 : ie(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), i = t.top + a.scrollTop;
|
|
996
996
|
return {
|
|
997
997
|
x: n,
|
|
998
|
-
y:
|
|
998
|
+
y: i
|
|
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: i
|
|
1007
1007
|
} = e;
|
|
1008
|
-
const
|
|
1009
|
-
if (n === o || s &&
|
|
1008
|
+
const r = i === "fixed", o = G(n), s = a ? ze(a.floating) : !1;
|
|
1009
|
+
if (n === o || s && r)
|
|
1010
1010
|
return t;
|
|
1011
1011
|
let d = {
|
|
1012
1012
|
scrollLeft: 0,
|
|
1013
1013
|
scrollTop: 0
|
|
1014
1014
|
}, l = W(1);
|
|
1015
|
-
const c = W(0),
|
|
1016
|
-
if ((
|
|
1017
|
-
const g =
|
|
1015
|
+
const c = W(0), h = K(n);
|
|
1016
|
+
if ((h || !h && !r) && ((pe(n) !== "body" || xe(o)) && (d = Ne(n)), K(n))) {
|
|
1017
|
+
const g = ie(n);
|
|
1018
1018
|
l = se(n), c.x = g.x + n.clientLeft, c.y = g.y + n.clientTop;
|
|
1019
1019
|
}
|
|
1020
|
-
const u = o && !
|
|
1020
|
+
const u = o && !h && !r ? Mt(o, d) : W(0);
|
|
1021
1021
|
return {
|
|
1022
1022
|
width: t.width * l.x,
|
|
1023
1023
|
height: t.height * l.y,
|
|
@@ -1025,36 +1025,36 @@ 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,
|
|
1032
|
+
const a = G(e), t = Ne(e), n = e.ownerDocument.body, i = te(a.scrollWidth, a.clientWidth, n.scrollWidth, n.clientWidth), r = te(a.scrollHeight, a.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1033
1033
|
let o = -t.scrollLeft + Fe(e);
|
|
1034
1034
|
const s = -t.scrollTop;
|
|
1035
|
-
return
|
|
1036
|
-
width:
|
|
1037
|
-
height:
|
|
1035
|
+
return Y(n).direction === "rtl" && (o += te(a.clientWidth, n.clientWidth) - i), {
|
|
1036
|
+
width: i,
|
|
1037
|
+
height: r,
|
|
1038
1038
|
x: o,
|
|
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), i = t.visualViewport;
|
|
1045
|
+
let r = n.clientWidth, o = n.clientHeight, s = 0, d = 0;
|
|
1046
|
+
if (i) {
|
|
1047
|
+
r = i.width, o = i.height;
|
|
1048
1048
|
const c = Je();
|
|
1049
|
-
(!c || c && a === "fixed") && (s =
|
|
1049
|
+
(!c || c && a === "fixed") && (s = i.offsetLeft, d = i.offsetTop);
|
|
1050
1050
|
}
|
|
1051
1051
|
const l = Fe(n);
|
|
1052
1052
|
if (l <= 0) {
|
|
1053
|
-
const c = n.ownerDocument,
|
|
1054
|
-
|
|
1055
|
-
} else l <= st && (
|
|
1053
|
+
const c = n.ownerDocument, h = c.body, u = getComputedStyle(h), g = c.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, f = Math.abs(n.clientWidth - h.clientWidth - g);
|
|
1054
|
+
f <= st && (r -= f);
|
|
1055
|
+
} else l <= st && (r += l);
|
|
1056
1056
|
return {
|
|
1057
|
-
width:
|
|
1057
|
+
width: r,
|
|
1058
1058
|
height: o,
|
|
1059
1059
|
x: s,
|
|
1060
1060
|
y: d
|
|
@@ -1062,7 +1062,7 @@ function qa(e, a) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
const Ua = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1064
1064
|
function ja(e, a) {
|
|
1065
|
-
const t =
|
|
1065
|
+
const t = ie(e, !0, a === "fixed"), n = t.top + e.clientTop, i = t.left + e.clientLeft, r = K(e) ? se(e) : W(1), o = e.clientWidth * r.x, s = e.clientHeight * r.y, d = i * r.x, l = n * r.y;
|
|
1066
1066
|
return {
|
|
1067
1067
|
width: o,
|
|
1068
1068
|
height: s,
|
|
@@ -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 i = xt(e);
|
|
1083
1083
|
n = {
|
|
1084
|
-
x: a.x -
|
|
1085
|
-
y: a.y -
|
|
1084
|
+
x: a.x - i.x,
|
|
1085
|
+
y: a.y - i.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) &&
|
|
1101
|
-
const
|
|
1102
|
-
let o =
|
|
1100
|
+
let n = ue(e, [], !1).filter((s) => B(s) && pe(s) !== "body"), i = null;
|
|
1101
|
+
const r = Y(e).position === "fixed";
|
|
1102
|
+
let o = r ? J(e) : e;
|
|
1103
1103
|
for (; B(o) && !ce(o); ) {
|
|
1104
|
-
const s =
|
|
1105
|
-
!d && s.position === "fixed" && (
|
|
1104
|
+
const s = Y(o), d = Xe(o);
|
|
1105
|
+
!d && s.position === "fixed" && (i = null), (r ? !d && !i : !d && s.position === "static" && !!i && Ua.has(i.position) || xe(o) && !d && St(e, o)) ? n = n.filter((c) => c !== o) : i = s, o = J(o);
|
|
1106
1106
|
}
|
|
1107
1107
|
return a.set(e, n), n;
|
|
1108
1108
|
}
|
|
@@ -1111,12 +1111,12 @@ function Ka(e) {
|
|
|
1111
1111
|
element: a,
|
|
1112
1112
|
boundary: t,
|
|
1113
1113
|
rootBoundary: n,
|
|
1114
|
-
strategy:
|
|
1114
|
+
strategy: i
|
|
1115
1115
|
} = e;
|
|
1116
1116
|
const o = [...t === "clippingAncestors" ? ze(a) ? [] : Wa(a, this._c) : [].concat(t), n], s = o[0], d = o.reduce((l, c) => {
|
|
1117
|
-
const
|
|
1118
|
-
return l.top = te(
|
|
1119
|
-
}, dt(a, s,
|
|
1117
|
+
const h = dt(a, c, i);
|
|
1118
|
+
return l.top = te(h.top, l.top), l.right = le(h.right, l.right), l.bottom = le(h.bottom, l.bottom), l.left = te(h.left, l.left), l;
|
|
1119
|
+
}, dt(a, s, i));
|
|
1120
1120
|
return {
|
|
1121
1121
|
width: d.right - d.left,
|
|
1122
1122
|
height: d.bottom - d.top,
|
|
@@ -1135,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), i = G(a), r = t === "fixed", o = ie(e, !0, r, 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(i);
|
|
1146
1146
|
}
|
|
1147
|
-
if (n || !n && !
|
|
1148
|
-
if ((
|
|
1149
|
-
const g =
|
|
1147
|
+
if (n || !n && !r)
|
|
1148
|
+
if ((pe(a) !== "body" || xe(i)) && (s = Ne(a)), n) {
|
|
1149
|
+
const g = ie(a, !0, r, a);
|
|
1150
1150
|
d.x = g.x + a.clientLeft, d.y = g.y + a.clientTop;
|
|
1151
|
-
} else
|
|
1152
|
-
|
|
1153
|
-
const c =
|
|
1151
|
+
} else i && l();
|
|
1152
|
+
r && !n && i && l();
|
|
1153
|
+
const c = i && !n && !r ? Mt(i, s) : W(0), h = o.left + s.scrollLeft - d.x - c.x, u = o.top + s.scrollTop - d.y - c.y;
|
|
1154
1154
|
return {
|
|
1155
|
-
x:
|
|
1155
|
+
x: h,
|
|
1156
1156
|
y: u,
|
|
1157
1157
|
width: o.width,
|
|
1158
1158
|
height: o.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);
|
|
@@ -1174,18 +1174,18 @@ function Ct(e, a) {
|
|
|
1174
1174
|
if (ze(e))
|
|
1175
1175
|
return t;
|
|
1176
1176
|
if (!K(e)) {
|
|
1177
|
-
let
|
|
1178
|
-
for (;
|
|
1179
|
-
if (B(
|
|
1180
|
-
return
|
|
1181
|
-
|
|
1177
|
+
let i = J(e);
|
|
1178
|
+
for (; i && !ce(i); ) {
|
|
1179
|
+
if (B(i) && !Oe(i))
|
|
1180
|
+
return i;
|
|
1181
|
+
i = J(i);
|
|
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,97 +1219,97 @@ function Et(e, a) {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
function Za(e, a) {
|
|
1221
1221
|
let t = null, n;
|
|
1222
|
-
const
|
|
1223
|
-
function
|
|
1222
|
+
const i = G(e);
|
|
1223
|
+
function r() {
|
|
1224
1224
|
var s;
|
|
1225
1225
|
clearTimeout(n), (s = t) == null || s.disconnect(), t = null;
|
|
1226
1226
|
}
|
|
1227
1227
|
function o(s, d) {
|
|
1228
|
-
s === void 0 && (s = !1), d === void 0 && (d = 1),
|
|
1228
|
+
s === void 0 && (s = !1), d === void 0 && (d = 1), r();
|
|
1229
1229
|
const l = e.getBoundingClientRect(), {
|
|
1230
1230
|
left: c,
|
|
1231
|
-
top:
|
|
1231
|
+
top: h,
|
|
1232
1232
|
width: u,
|
|
1233
1233
|
height: g
|
|
1234
1234
|
} = l;
|
|
1235
1235
|
if (s || a(), !u || !g)
|
|
1236
1236
|
return;
|
|
1237
|
-
const
|
|
1238
|
-
rootMargin: -
|
|
1237
|
+
const f = Me(h), p = Me(i.clientWidth - (c + u)), D = Me(i.clientHeight - (h + g)), m = Me(c), I = {
|
|
1238
|
+
rootMargin: -f + "px " + -p + "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 (!
|
|
1241
|
+
let S = !0;
|
|
1242
|
+
function v(_) {
|
|
1243
|
+
const R = _[0].intersectionRatio;
|
|
1244
|
+
if (R !== d) {
|
|
1245
|
+
if (!S)
|
|
1246
1246
|
return o();
|
|
1247
|
-
|
|
1247
|
+
R ? o(!1, R) : n = setTimeout(() => {
|
|
1248
1248
|
o(!1, 1e-7);
|
|
1249
1249
|
}, 1e3);
|
|
1250
1250
|
}
|
|
1251
|
-
|
|
1251
|
+
R === 1 && !Et(l, e.getBoundingClientRect()) && o(), 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: i.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 o(!0),
|
|
1264
|
+
return o(!0), r;
|
|
1265
1265
|
}
|
|
1266
1266
|
function Rt(e, a, t, n) {
|
|
1267
1267
|
n === void 0 && (n = {});
|
|
1268
1268
|
const {
|
|
1269
|
-
ancestorScroll:
|
|
1270
|
-
ancestorResize:
|
|
1269
|
+
ancestorScroll: i = !0,
|
|
1270
|
+
ancestorResize: r = !0,
|
|
1271
1271
|
elementResize: o = 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 = i || r ? [...l ? ue(l) : [], ...ue(a)] : [];
|
|
1275
|
+
c.forEach((m) => {
|
|
1276
|
+
i && m.addEventListener("scroll", t, {
|
|
1277
1277
|
passive: !0
|
|
1278
|
-
}),
|
|
1278
|
+
}), r && m.addEventListener("resize", t);
|
|
1279
1279
|
});
|
|
1280
|
-
const
|
|
1280
|
+
const h = l && s ? Za(l, t) : null;
|
|
1281
1281
|
let u = -1, g = null;
|
|
1282
|
-
o && (g = new ResizeObserver((
|
|
1283
|
-
let [
|
|
1284
|
-
|
|
1285
|
-
var
|
|
1286
|
-
(
|
|
1282
|
+
o && (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, p = d ? ie(e) : null;
|
|
1290
|
+
d && D();
|
|
1291
|
+
function D() {
|
|
1292
|
+
const m = ie(e);
|
|
1293
|
+
p && !Et(p, m) && t(), p = m, f = requestAnimationFrame(D);
|
|
1294
1294
|
}
|
|
1295
1295
|
return t(), () => {
|
|
1296
|
-
var
|
|
1297
|
-
c.forEach((
|
|
1298
|
-
|
|
1299
|
-
}),
|
|
1296
|
+
var m;
|
|
1297
|
+
c.forEach((C) => {
|
|
1298
|
+
i && C.removeEventListener("scroll", t), r && C.removeEventListener("resize", t);
|
|
1299
|
+
}), h == null || h(), (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, Te = Ra, Ze = Sa, At = Ma, et = (e, a, t) => {
|
|
1303
|
+
const n = /* @__PURE__ */ new Map(), i = {
|
|
1304
1304
|
platform: It,
|
|
1305
1305
|
...t
|
|
1306
|
-
},
|
|
1307
|
-
...
|
|
1306
|
+
}, r = {
|
|
1307
|
+
...i.platform,
|
|
1308
1308
|
_c: n
|
|
1309
1309
|
};
|
|
1310
1310
|
return xa(e, a, {
|
|
1311
|
-
...
|
|
1312
|
-
platform:
|
|
1311
|
+
...i,
|
|
1312
|
+
platform: r
|
|
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: Te
|
|
1324
1324
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1325
1325
|
let Se = null;
|
|
1326
|
-
function
|
|
1327
|
-
e.options.positioningMode !== "inline" && (
|
|
1326
|
+
function Tt(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, kt(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) : Tt(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), Te({ padding: 8 })] : [Ae(8), Ze(), Te({ 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: i, placement: r, middlewareData: o } = await et(a, e.tooltip, {
|
|
1360
1360
|
placement: "top",
|
|
1361
1361
|
middleware: [
|
|
1362
1362
|
Ae(6),
|
|
1363
1363
|
Ze(),
|
|
1364
|
-
|
|
1364
|
+
Te({ 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: `${
|
|
1370
|
+
top: `${i}px`
|
|
1371
1371
|
}), o.arrow) {
|
|
1372
1372
|
const { x: s, y: d } = o.arrow, l = {
|
|
1373
1373
|
top: "bottom",
|
|
1374
1374
|
right: "left",
|
|
1375
1375
|
bottom: "top",
|
|
1376
1376
|
left: "right"
|
|
1377
|
-
}[
|
|
1377
|
+
}[r.split("-")[0]];
|
|
1378
1378
|
Object.assign(e.tooltipArrow.style, {
|
|
1379
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 i = new Date(a, t, n);
|
|
1403
|
+
if (i.getMonth() === t && !e.isDateDisabledInternal(i))
|
|
1404
1404
|
return !0;
|
|
1405
1405
|
}
|
|
1406
1406
|
return !1;
|
|
1407
1407
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
var a, t;
|
|
1408
|
+
async function kt(e) {
|
|
1409
|
+
var a, t, n, i;
|
|
1410
1410
|
if (e.options.beforeMonthChangedCallback) {
|
|
1411
1411
|
if (e.isMonthChanging) {
|
|
1412
1412
|
w.debug("handleInitialMonthLoad() - already changing month, skipping");
|
|
@@ -1414,109 +1414,113 @@ 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 r = e.options.unifiedNavigationAnchorIndex ?? 0, o = e.monthDates[r], s = o.getFullYear(), d = o.getMonth();
|
|
1418
|
+
let l = 1 / 0, c = 1 / 0, h = -1 / 0, u = -1 / 0;
|
|
1419
|
+
for (let M = 0; M < e.monthDates.length; M++) {
|
|
1420
|
+
const x = e.monthDates[M], E = x.getFullYear(), T = x.getMonth();
|
|
1421
|
+
(E < l || E === l && T < c) && (l = E, c = T), (E > h || E === h && T > u) && (h = E, u = T);
|
|
1422
1422
|
}
|
|
1423
|
-
const
|
|
1424
|
-
year:
|
|
1425
|
-
month:
|
|
1426
|
-
monthIndex:
|
|
1427
|
-
firstVisibleDate:
|
|
1428
|
-
lastVisibleDate:
|
|
1423
|
+
const p = (new Date(l, c, 1).getDay() - e.weekStartDay + 7) % 7, D = new Date(l, c, 1 - p), m = new Date(h, u + 1, 0).getDate(), I = new Date(h, u, m).getDay(), S = (e.weekStartDay + 6 - I) % 7, v = new Date(h, u, m + S), _ = {
|
|
1424
|
+
year: s,
|
|
1425
|
+
month: d,
|
|
1426
|
+
monthIndex: r,
|
|
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 r = /* @__PURE__ */ new Map(), o = /* @__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(), h = l.getMonth(), f = (new Date(c, h, 1).getDay() - e.weekStartDay + 7) % 7, p = new Date(c, h, 1 - f), D = new Date(p);
|
|
1441
|
+
D.setDate(p.getDate() + 41);
|
|
1442
1442
|
const m = {
|
|
1443
|
-
year:
|
|
1444
|
-
month:
|
|
1445
|
-
monthIndex:
|
|
1446
|
-
firstVisibleDate:
|
|
1447
|
-
lastVisibleDate:
|
|
1443
|
+
year: c,
|
|
1444
|
+
month: h,
|
|
1445
|
+
monthIndex: d,
|
|
1446
|
+
firstVisibleDate: p,
|
|
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}-${h + 1}, range: ${p.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: ${((i = S.monthHeaders) == null ? void 0 : i.size) || 0}`), S.metadata && S.metadata.forEach((v, _) => {
|
|
1454
|
+
r.set(_, v);
|
|
1455
|
+
}), S.monthHeaders && S.monthHeaders.forEach((v, _) => {
|
|
1456
|
+
o.set(_, v);
|
|
1455
1457
|
});
|
|
1456
1458
|
}
|
|
1457
|
-
|
|
1459
|
+
s && ae(e), r.size > 0 && (e.bulkMetadataCache = r, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined metadata cache updated with ${r.size} entries`)), o.size > 0 && (e.monthHeadersCache = o, w.debug(`handleInitialMonthLoad() [NON-UNIFIED] - combined month headers cache updated with ${o.size} entries`)), (r.size > 0 || o.size > 0) && e.renderCalendar();
|
|
1458
1460
|
}
|
|
1459
|
-
} catch (
|
|
1460
|
-
ae(e), w.debug("handleInitialMonthLoad() - error in callback:",
|
|
1461
|
+
} catch (r) {
|
|
1462
|
+
ae(e), w.debug("handleInitialMonthLoad() - error in callback:", r), console.error("[DateRangePicker] Error in beforeMonthChangedCallback (initial load):", r);
|
|
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 r;
|
|
1469
|
+
var i, r;
|
|
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 o, 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, p = -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 > p) && (f = y, p = M);
|
|
1480
1482
|
}
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1483
|
+
const C = (new Date(u, g, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1484
|
+
o = new Date(u, g, 1 - C);
|
|
1485
|
+
const I = new Date(f, p + 1, 0).getDate(), v = new Date(f, p, I).getDay(), _ = (e.weekStartDay + 6 - v) % 7;
|
|
1486
|
+
s = new Date(f, p, I + _);
|
|
1485
1487
|
} else {
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
+
const f = (new Date(a, t, 1).getDay() - e.weekStartDay + 7) % 7;
|
|
1489
|
+
o = new Date(a, t, 1 - f), s = new Date(o), s.setDate(o.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: o,
|
|
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: ${o.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 h = await Promise.resolve(l);
|
|
1502
|
+
return c && ae(e), h.action === "block" ? (w.debug(`handleBeforeMonthChange() - navigation blocked: ${h.message || "no reason provided"}`), h.message && console.warn(`[DateRangePicker] Month navigation blocked: ${h.message}`), !1) : (w.debug(`handleBeforeMonthChange() - navigation accepted, metadata items: ${((i = h.metadata) == null ? void 0 : i.size) || 0}, monthHeaders: ${((r = h.monthHeaders) == null ? void 0 : r.size) || 0}`), h.metadata ? e.bulkMetadataCache ? (h.metadata.forEach((u, g) => {
|
|
1503
|
+
e.bulkMetadataCache.set(g, u);
|
|
1504
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${h.metadata.size} entries into cache (total: ${e.bulkMetadataCache.size})`)) : (e.bulkMetadataCache = h.metadata, w.debug(`handleBeforeMonthChange() - bulk metadata cache created with ${h.metadata.size} entries`)) : e.bulkMetadataCache = null, h.monthHeaders && (e.monthHeadersCache ? (h.monthHeaders.forEach((u, g) => {
|
|
1505
|
+
e.monthHeadersCache.set(g, u);
|
|
1506
|
+
}), w.debug(`handleBeforeMonthChange() - merged ${h.monthHeaders.size} entries into headers cache (total: ${e.monthHeadersCache.size})`)) : (e.monthHeadersCache = h.monthHeaders, w.debug(`handleBeforeMonthChange() - month headers cache created with ${h.monthHeaders.size} entries`))), !0);
|
|
1507
|
+
} catch (o) {
|
|
1508
|
+
return ae(e), w.debug("handleBeforeMonthChange() - error in callback:", o), console.error("[DateRangePicker] Error in beforeMonthChangedCallback:", o), !1;
|
|
1505
1509
|
} finally {
|
|
1506
1510
|
e.isMonthChanging = !1;
|
|
1507
1511
|
}
|
|
1508
1512
|
}
|
|
1509
|
-
function
|
|
1513
|
+
function on(e, a) {
|
|
1510
1514
|
e.showingRollingSelector[a] = !e.showingRollingSelector[a], e.renderCalendar();
|
|
1511
1515
|
}
|
|
1512
|
-
async function
|
|
1516
|
+
async function rn(e, a, t) {
|
|
1513
1517
|
const n = e.monthDates[t].getMonth();
|
|
1514
1518
|
if (!await Z(e, a, n, 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 r = e.monthDates[t].getFullYear();
|
|
1523
|
+
e.monthDates[t].setFullYear(a), w.debug(`selectYear() Col${t} - changed from ${r} to ${a}`), he(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,81 +1528,81 @@ 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 r = e.monthDates[t].getMonth();
|
|
1532
|
+
e.monthDates[t].setMonth(a), w.debug(`selectMonth() Col${t} - changed from ${r + 1} to ${a + 1}`), he(e, t), e.showingRollingSelector[t] = !1, e.renderCalendar();
|
|
1529
1533
|
}
|
|
1530
|
-
function
|
|
1534
|
+
function he(e, a) {
|
|
1531
1535
|
const t = e.monthDates[a];
|
|
1532
1536
|
if (a < e.monthDates.length - 1) {
|
|
1533
1537
|
const n = e.monthDates[a + 1];
|
|
1534
|
-
if (
|
|
1538
|
+
if (ke(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 i = new Date(t.getFullYear(), t.getMonth() + 1, 1);
|
|
1541
|
+
e.monthDates[a + 1] = i, he(e, a + 1);
|
|
1538
1542
|
}
|
|
1539
1543
|
}
|
|
1540
1544
|
if (a > 0) {
|
|
1541
1545
|
const n = e.monthDates[a - 1];
|
|
1542
|
-
if (
|
|
1546
|
+
if (ke(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 i = new Date(t.getFullYear(), t.getMonth() - 1, 1);
|
|
1549
|
+
e.monthDates[a - 1] = i, he(e, a - 1);
|
|
1546
1550
|
}
|
|
1547
1551
|
}
|
|
1548
1552
|
}
|
|
1549
|
-
function
|
|
1550
|
-
const t = e.getFullYear(), n = e.getMonth(),
|
|
1551
|
-
return t >
|
|
1553
|
+
function ke(e, a) {
|
|
1554
|
+
const t = e.getFullYear(), n = e.getMonth(), i = a.getFullYear(), r = a.getMonth();
|
|
1555
|
+
return t > i || t === i && n >= r;
|
|
1552
1556
|
}
|
|
1553
|
-
async function
|
|
1557
|
+
async function ye(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], i = new Date(n.getFullYear(), n.getMonth() - 1, 1);
|
|
1561
|
+
if (!j(e, i.getFullYear(), i.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, i.getFullYear(), i.getMonth(), t)) {
|
|
1562
1566
|
w.debug(`prevMonth() Col${t} - navigation blocked by callback`);
|
|
1563
1567
|
return;
|
|
1564
1568
|
}
|
|
1565
|
-
if (e.monthDates[t] =
|
|
1569
|
+
if (e.monthDates[t] = i, w.debug(`prevMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t > 0) {
|
|
1566
1570
|
const o = e.monthDates[t - 1];
|
|
1567
|
-
|
|
1571
|
+
ke(o, i) && (w.debug(`prevMonth() Col${t} - collision detected with Col${t - 1}, shifting previous columns back`), await ye(e, t - 1));
|
|
1568
1572
|
}
|
|
1569
1573
|
e.renderCalendar();
|
|
1570
1574
|
}
|
|
1571
|
-
async function
|
|
1575
|
+
async function ve(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], i = new Date(n.getFullYear(), n.getMonth() + 1, 1);
|
|
1579
|
+
if (!j(e, i.getFullYear(), i.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, i.getFullYear(), i.getMonth(), t)) {
|
|
1580
1584
|
w.debug(`nextMonth() Col${t} - navigation blocked by callback`);
|
|
1581
1585
|
return;
|
|
1582
1586
|
}
|
|
1583
|
-
if (e.monthDates[t] =
|
|
1587
|
+
if (e.monthDates[t] = i, w.debug(`nextMonth() Col${t} - changed from ${n.getFullYear()}-${n.getMonth() + 1} to ${i.getFullYear()}-${i.getMonth() + 1}`), t < e.monthDates.length - 1) {
|
|
1584
1588
|
const o = e.monthDates[t + 1];
|
|
1585
|
-
|
|
1589
|
+
ke(i, o) && (w.debug(`nextMonth() Col${t} - collision detected with Col${t + 1}, shifting next columns forward`), await ve(e, t + 1));
|
|
1586
1590
|
}
|
|
1587
1591
|
e.renderCalendar();
|
|
1588
1592
|
}
|
|
1589
|
-
function
|
|
1590
|
-
let
|
|
1593
|
+
function me(e, a, t, n, i) {
|
|
1594
|
+
let r = a, o = 0;
|
|
1591
1595
|
const s = 60;
|
|
1592
1596
|
for (; o < s; ) {
|
|
1593
|
-
if (
|
|
1594
|
-
const l = n[
|
|
1597
|
+
if (r >= 0 && r < n.length) {
|
|
1598
|
+
const l = n[r].dataset.date;
|
|
1595
1599
|
if (l) {
|
|
1596
|
-
const [c,
|
|
1600
|
+
const [c, h, u] = l.split("-").map(Number), g = new Date(c, h - 1, u);
|
|
1597
1601
|
if (!e.isDateDisabledInternal(g))
|
|
1598
|
-
return { index:
|
|
1602
|
+
return { index: r, monthChanged: !1 };
|
|
1599
1603
|
}
|
|
1600
1604
|
}
|
|
1601
|
-
if (
|
|
1605
|
+
if (r += t, o++, r < 0 || r >= n.length)
|
|
1602
1606
|
return { index: null, monthChanged: !0, direction: t > 0 ? "next" : "prev" };
|
|
1603
1607
|
}
|
|
1604
1608
|
return { index: null, monthChanged: !1 };
|
|
@@ -1614,84 +1618,84 @@ function dn(e, a) {
|
|
|
1614
1618
|
const n = t.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
1615
1619
|
if (w.debug(`moveFocus() Col${e.activeMonthIndex} - found ${n.length} days in column`), n.length === 0) return;
|
|
1616
1620
|
if (e.focusedDayIndex === null) {
|
|
1617
|
-
const c = Array.from(n).findIndex((
|
|
1621
|
+
const c = Array.from(n).findIndex((h) => h.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
1624
|
(o = n[e.focusedDayIndex]) == null || o.classList.remove("drp-date-picker__day--focused");
|
|
1621
|
-
const
|
|
1622
|
-
if (
|
|
1625
|
+
const i = e.focusedDayIndex + a;
|
|
1626
|
+
if (i < 0) {
|
|
1623
1627
|
const c = e.activeMonthIndex;
|
|
1624
1628
|
if (a === -1)
|
|
1625
|
-
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`),
|
|
1626
|
-
var
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1629
|
-
const u =
|
|
1630
|
-
g.index !== null && (e.focusedDayIndex = g.index, (
|
|
1629
|
+
w.debug(`moveFocus() Col${c} - edge navigation LEFT: going to last enabled day of prev month`), ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1630
|
+
var f, p;
|
|
1631
|
+
const h = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1632
|
+
if (!h) return;
|
|
1633
|
+
const u = h.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(e, u.length - 1, -1, u);
|
|
1634
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = u[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (p = u[e.focusedDayIndex]) == null || p.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, p] = u.split("-").map(Number), m = new Date(g, f - 1, p).getDay();
|
|
1640
|
+
w.debug(`moveFocus() Col${c} - edge navigation UP: current day ${p} is weekday ${m}, going to prev month`), ye(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(), T = (E - m + 7) % 7;
|
|
1647
|
+
e.focusedDayIndex = I.length - 1 - T, 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 (i >= n.length) {
|
|
1650
1654
|
const c = e.activeMonthIndex;
|
|
1651
1655
|
if (a === 1)
|
|
1652
|
-
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`),
|
|
1653
|
-
var
|
|
1654
|
-
const
|
|
1655
|
-
if (!
|
|
1656
|
-
const u =
|
|
1657
|
-
g.index !== null && (e.focusedDayIndex = g.index, (
|
|
1656
|
+
w.debug(`moveFocus() Col${c} - edge navigation RIGHT: going to first enabled day of next month`), ve(e, e.activeMonthIndex), setTimeout(() => {
|
|
1657
|
+
var f, p;
|
|
1658
|
+
const h = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1659
|
+
if (!h) return;
|
|
1660
|
+
const u = h.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(e, 0, 1, u);
|
|
1661
|
+
g.index !== null && (e.focusedDayIndex = g.index, (f = u[e.focusedDayIndex]) == null || f.classList.add("drp-date-picker__day--focused"), (p = u[e.focusedDayIndex]) == null || p.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 = T, w.debug(`moveFocus() Col${c} - first day weekday ${
|
|
1666
|
+
const [g, f, p] = u.split("-").map(Number), m = new Date(g, f - 1, p).getDay();
|
|
1667
|
+
w.debug(`moveFocus() Col${c} - edge navigation DOWN: current day ${p} is weekday ${m}, going to next month`), ve(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(), T = (m - E + 7) % 7;
|
|
1674
|
+
e.focusedDayIndex = T, 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 r = me(e, i, a, n, e.activeMonthIndex);
|
|
1682
|
+
if (r.monthChanged) {
|
|
1679
1683
|
const c = e.activeMonthIndex;
|
|
1680
|
-
|
|
1681
|
-
var
|
|
1682
|
-
const
|
|
1683
|
-
if (!
|
|
1684
|
-
const u =
|
|
1684
|
+
r.direction === "next" ? ve(e, e.activeMonthIndex) : ye(e, e.activeMonthIndex), setTimeout(() => {
|
|
1685
|
+
var f, p;
|
|
1686
|
+
const h = e.calendar.querySelector(`.drp-date-picker__month[data-month-index="${c}"] .drp-date-picker__days`);
|
|
1687
|
+
if (!h) return;
|
|
1688
|
+
const u = h.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), g = me(
|
|
1685
1689
|
e,
|
|
1686
|
-
|
|
1690
|
+
r.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"), (p = u[e.focusedDayIndex]) == null || p.scrollIntoView({ block: "nearest" }));
|
|
1691
1695
|
}, 0);
|
|
1692
1696
|
return;
|
|
1693
1697
|
}
|
|
1694
|
-
|
|
1698
|
+
r.index !== null ? (e.focusedDayIndex = r.index, (s = n[e.focusedDayIndex]) == null || s.classList.add("drp-date-picker__day--focused"), (d = n[e.focusedDayIndex]) == null || d.scrollIntoView({ block: "nearest" })) : (w.debug("moveFocus() - no enabled day found in search range"), (l = n[e.focusedDayIndex]) == null || l.classList.add("drp-date-picker__day--focused"));
|
|
1695
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 o =
|
|
1706
|
-
e.monthDates[
|
|
1708
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1709
|
+
const o = r - a;
|
|
1710
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 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 o =
|
|
1721
|
-
e.monthDates[
|
|
1723
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1724
|
+
const o = r - a;
|
|
1725
|
+
e.monthDates[r] = new Date(n.getFullYear(), n.getMonth() + o, 1);
|
|
1722
1726
|
}
|
|
1723
1727
|
e.renderCalendar();
|
|
1724
1728
|
}
|
|
@@ -1727,23 +1731,23 @@ 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 o =
|
|
1732
|
-
e.monthDates[
|
|
1734
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1735
|
+
const o = r - t;
|
|
1736
|
+
e.monthDates[r] = new Date(n, a + o, 1);
|
|
1733
1737
|
}
|
|
1734
1738
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1735
1739
|
}
|
|
1736
1740
|
}
|
|
1737
|
-
function
|
|
1741
|
+
function hn(e) {
|
|
1738
1742
|
e.options.unifiedNavigation && (e.showingUnifiedRollingSelector = !e.showingUnifiedRollingSelector, w.debug(`toggleUnifiedRollingSelector() - now ${e.showingUnifiedRollingSelector ? "visible" : "hidden"}`), e.renderCalendar());
|
|
1739
1743
|
}
|
|
1740
1744
|
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 o =
|
|
1746
|
-
e.monthDates[
|
|
1748
|
+
for (let r = 0; r < e.monthDates.length; r++) {
|
|
1749
|
+
const o = r - t;
|
|
1750
|
+
e.monthDates[r] = new Date(a, n + o, 1);
|
|
1747
1751
|
}
|
|
1748
1752
|
e.showingUnifiedRollingSelector = !1, e.renderCalendar();
|
|
1749
1753
|
}
|
|
@@ -1751,14 +1755,14 @@ 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, i = t.normalizedMaxDate ? t.normalizedMaxDate.getFullYear() : a + 1;
|
|
1759
|
+
return { min: n, max: i };
|
|
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, i] = e.split("-");
|
|
1765
|
+
return { min: parseInt(n, 10), max: parseInt(i, 10) };
|
|
1762
1766
|
} else {
|
|
1763
1767
|
const n = parseInt(e, 10);
|
|
1764
1768
|
return { min: n, max: n };
|
|
@@ -1770,7 +1774,7 @@ function Pt(e) {
|
|
|
1770
1774
|
const [a, t] = e.split("-");
|
|
1771
1775
|
return { min: parseInt(a, 10), max: parseInt(t, 10) };
|
|
1772
1776
|
}
|
|
1773
|
-
function
|
|
1777
|
+
function pn(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
1780
|
e.showingRollingSelector[a] ? Ft(e, a) : zt(e, a);
|
|
@@ -1784,206 +1788,217 @@ function hn(e) {
|
|
|
1784
1788
|
e.options.selectionMode === "range" && !e.isDragging && e.initDragListeners(), e.actionsContainer && e.renderButtons(e.actionsContainer);
|
|
1785
1789
|
}
|
|
1786
1790
|
function zt(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 i = e.monthDates[a], r = i.getFullYear(), o = i.getMonth(), s = e.monthNames[o], d = t.querySelector(".drp-date-picker__month-year");
|
|
1798
|
+
if (d) {
|
|
1799
|
+
const S = `${r}-${String(o).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: i,
|
|
1803
|
+
monthIndex: a,
|
|
1804
|
+
monthName: s,
|
|
1805
|
+
year: r
|
|
1806
|
+
}) : v = `${s} ${r}`, 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(), T = v.getMonth() === 11 ? 0 : v.getMonth() + 1, A = L.querySelector(".drp-date-picker__nav--next");
|
|
1828
|
+
A && (j(e, E, T) ? (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
|
-
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
const m = t.querySelector(".drp-date-picker__weekdays"),
|
|
1831
|
+
const l = i.getFullYear(), c = i.getMonth(), h = c === 0 ? 11 : c - 1, u = c === 0 ? l - 1 : l, g = t.querySelector(".drp-date-picker__nav--prev");
|
|
1832
|
+
g && (j(e, u, h) ? (g.removeAttribute("disabled"), g.classList.remove("drp-date-picker__nav--disabled")) : (g.setAttribute("disabled", "true"), g.classList.add("drp-date-picker__nav--disabled")));
|
|
1833
|
+
const f = c === 11 ? 0 : c + 1, p = c === 11 ? l + 1 : l, D = t.querySelector(".drp-date-picker__nav--next");
|
|
1834
|
+
D && (j(e, p, 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, i);
|
|
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 i = n.querySelector(".drp-date-picker__days"), r = t.getFullYear(), o = t.getMonth();
|
|
1846
|
+
de.debug(`[DatePicker Col${a} 21] Rendering days for:`, r, o + 1);
|
|
1847
|
+
const d = (new Date(r, o, 1).getDay() - e.weekStartDay + 7) % 7, l = new Date(r, o + 1, 0).getDate(), c = new Date(r, o, 0).getDate(), h = new Date(r, o - 1, 1), u = h.getFullYear(), g = h.getMonth(), f = new Date(r, o + 1, 1), p = 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:
|
|
1858
|
+
for (let _ = 1; _ <= l; _++) {
|
|
1859
|
+
const R = new Date(r, o, _);
|
|
1860
|
+
m.push({
|
|
1861
|
+
date: R,
|
|
1862
|
+
year: r,
|
|
1848
1863
|
month: o,
|
|
1849
|
-
day:
|
|
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(p, D, _);
|
|
1871
|
+
m.push({
|
|
1872
|
+
date: R,
|
|
1873
|
+
year: p,
|
|
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 && (
|
|
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)) {
|
|
1873
1888
|
const T = {
|
|
1874
|
-
date:
|
|
1875
|
-
dateString:
|
|
1876
|
-
dayNumber:
|
|
1877
|
-
isDisabled: e.isDateDisabledInternal(
|
|
1889
|
+
date: y.date,
|
|
1890
|
+
dateString: be(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(T);
|
|
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
|
-
|
|
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");
|
|
1914
1929
|
let T = !1;
|
|
1915
|
-
e.options.selectionMode === "single" ? T = e.isSameDay(
|
|
1916
|
-
let
|
|
1930
|
+
e.options.selectionMode === "single" ? T = e.isSameDay(y.date, e.selectedDate) : e.options.selectionMode === "multiple" && (T = e.selectedDates.some((q) => e.isSameDay(y.date, q))), T && 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
|
|
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 P = `${y.year}-${String(y.month + 1).padStart(2, "0")}-${String(y.day).padStart(2, "0")}`;
|
|
1938
|
+
let z = (x == null ? void 0 : x.dayTooltip) || "";
|
|
1924
1939
|
if (e.options.dayTooltipCallback) {
|
|
1925
1940
|
const q = {
|
|
1926
|
-
date:
|
|
1927
|
-
dateString:
|
|
1928
|
-
dayNumber:
|
|
1929
|
-
isDisabled:
|
|
1941
|
+
date: y.date,
|
|
1942
|
+
dateString: P,
|
|
1943
|
+
dayNumber: y.day,
|
|
1944
|
+
isDisabled: E,
|
|
1930
1945
|
isSelected: T,
|
|
1931
|
-
isStartDate:
|
|
1932
|
-
isEndDate:
|
|
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
|
|
1939
1954
|
picker: e
|
|
1940
1955
|
}, at = e.options.dayTooltipCallback(q);
|
|
1941
|
-
at !== null && (
|
|
1956
|
+
at !== null && (z = at);
|
|
1942
1957
|
}
|
|
1943
|
-
const V =
|
|
1944
|
-
|
|
1958
|
+
const V = z ? ` data-tooltip="${z.replace(/"/g, """)}"` : "";
|
|
1959
|
+
v += `<div class="${M.join(" ")}" data-date="${P}" data-day-number="${y.day}"${V}>`, v += `<slot name="day-${P}">${y.day}</slot>`, v += "</div>";
|
|
1945
1960
|
}
|
|
1946
|
-
|
|
1961
|
+
v += "</div>";
|
|
1947
1962
|
}
|
|
1948
|
-
|
|
1963
|
+
i && (i.innerHTML = v, fn(e, a, i));
|
|
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
|
|
1968
|
+
t.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
1969
|
+
const r = i, o = r.getAttribute("data-date"), s = parseInt(r.getAttribute("data-day-number") || "0", 10);
|
|
1955
1970
|
if (!o) return;
|
|
1956
|
-
const [d, l, c] = o.split("-"),
|
|
1971
|
+
const [d, l, c] = o.split("-"), h = new Date(parseInt(d), parseInt(l) - 1, parseInt(c)), u = r.querySelector(`slot[name="day-${o}"]`);
|
|
1957
1972
|
if (u && u.assignedNodes().length > 0)
|
|
1958
1973
|
return;
|
|
1959
|
-
const
|
|
1960
|
-
date:
|
|
1974
|
+
const f = e.isDateDisabledInternal(h), p = e.isToday(h), D = h.getDay() === 0 || h.getDay() === 6, m = e.options.selectionMode === "single" && e.isSameDay(h, e.selectedDate), C = e.options.selectionMode === "range" && e.isSameDay(h, e.selectedStartDate), I = e.options.selectionMode === "range" && e.isSameDay(h, e.selectedEndDate), S = e.options.selectionMode === "range" && e.isInRange(h), v = {
|
|
1975
|
+
date: h,
|
|
1961
1976
|
dateString: o,
|
|
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: p,
|
|
1984
|
+
isWeekend: D,
|
|
1970
1985
|
monthIndex: a,
|
|
1971
|
-
element:
|
|
1986
|
+
element: r,
|
|
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,39 +2007,39 @@ 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 i = e.monthDates[a], r = i.getFullYear(), o = i.getMonth(), s = $t(e.options.rollingYearRange, r, e), d = Pt(e.options.rollingMonthRange), l = n == null ? void 0 : n.querySelector('[data-list="years"]');
|
|
1996
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 === r ? "drp-date-picker__rolling-item--selected" : "", p = ct(e, u) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2014
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${p}" 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
|
-
const
|
|
2003
|
-
if (
|
|
2017
|
+
const h = n == null ? void 0 : n.querySelector('[data-list="months"]');
|
|
2018
|
+
if (h) {
|
|
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], p = g === o ? "drp-date-picker__rolling-item--selected" : "", m = j(e, r, g) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2022
|
+
u += `<div class="drp-date-picker__rolling-item ${p} ${m}" data-month="${g}" data-month-index="${a}"><span class="drp-date-picker__rolling-item-text">${f}</span></div>`;
|
|
2008
2023
|
}
|
|
2009
|
-
|
|
2024
|
+
h.innerHTML = u;
|
|
2010
2025
|
}
|
|
2011
2026
|
}
|
|
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(), i = t.getMonth(), r = e.getEffectiveYearRange(), o = e.getEffectiveMonthRange(), s = e.unifiedRollingSelector.querySelector('[data-list="years"]');
|
|
2016
2031
|
let d = "";
|
|
2017
|
-
for (let c =
|
|
2018
|
-
const
|
|
2019
|
-
d += `<div class="drp-date-picker__rolling-item ${
|
|
2032
|
+
for (let c = r.min; c <= r.max; c++) {
|
|
2033
|
+
const h = c === n ? "drp-date-picker__rolling-item--selected" : "", g = ct(e, c) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2034
|
+
d += `<div class="drp-date-picker__rolling-item ${h} ${g}" data-year="${c}" data-unified="true"><span class="drp-date-picker__rolling-item-text">${c}</span></div>`;
|
|
2020
2035
|
}
|
|
2021
2036
|
s && (s.innerHTML = d);
|
|
2022
2037
|
const l = e.unifiedRollingSelector.querySelector('[data-list="months"]');
|
|
2023
2038
|
if (l) {
|
|
2024
2039
|
let c = "";
|
|
2025
|
-
for (let
|
|
2026
|
-
const u = e.monthNames[
|
|
2027
|
-
c += `<div class="drp-date-picker__rolling-item ${g} ${
|
|
2040
|
+
for (let h = o.min - 1; h <= o.max - 1; h++) {
|
|
2041
|
+
const u = e.monthNames[h], g = h === i ? "drp-date-picker__rolling-item--selected" : "", p = j(e, n, h) ? "" : "drp-date-picker__rolling-item--disabled";
|
|
2042
|
+
c += `<div class="drp-date-picker__rolling-item ${g} ${p}" data-month="${h}" 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, i, r, o;
|
|
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, r = n, e.options.disabledDatesHandling === "split" && (o = 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
|
+
), i = 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), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), 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, i, r, o;
|
|
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, r = n, e.options.disabledDatesHandling === "split" && (o = 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
|
+
), i = 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), i && (d.disabledDates = i), r && (d.dates = r), o && (d.dateRanges = o), 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((i) => {
|
|
2148
|
+
i.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 [o, s, d] =
|
|
2140
|
-
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (
|
|
2141
|
-
}),
|
|
2142
|
-
}
|
|
2143
|
-
async function
|
|
2151
|
+
e.calendar.querySelectorAll(".drp-date-picker__day").forEach((i) => {
|
|
2152
|
+
const r = i.dataset.date;
|
|
2153
|
+
if (!r) return;
|
|
2154
|
+
const [o, s, d] = r.split("-").map(Number), l = new Date(o, s - 1, d);
|
|
2155
|
+
l >= e.dragPreviewStart && l <= e.dragPreviewEnd && (i.classList.add("drp-date-picker__day--drag-preview"), t && i.classList.add("drp-date-picker__day--drag-invalid"));
|
|
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 i = e.findLastEnabledBeforeGap(a, t);
|
|
2192
|
+
return ee.debug(" BLOCK mode - adjusted end:", i), { isValid: !0, adjustedStart: a, adjustedEnd: i };
|
|
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, i] = a.dataset.date.split("-").map(Number), r = new Date(t, n - 1, i);
|
|
2194
2209
|
a.classList.contains("drp-date-picker__day--other-month");
|
|
2195
2210
|
const o = a.closest(".drp-date-picker__days");
|
|
2196
2211
|
if (o && o instanceof HTMLElement) {
|
|
2197
|
-
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0,
|
|
2212
|
+
e.activeMonthIndex = parseInt(o.dataset.monthIndex || "0") || 0, oe.debug(`Col${e.activeMonthIndex} selectDay - activeMonthIndex:`, e.activeMonthIndex);
|
|
2198
2213
|
const s = o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
2199
|
-
e.focusedDayIndex = Array.from(s).indexOf(a),
|
|
2214
|
+
e.focusedDayIndex = Array.from(s).indexOf(a), oe.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, r);
|
|
2203
2218
|
if (!s.isValid) {
|
|
2204
|
-
|
|
2219
|
+
oe.debug("Single mode selection prevented by beforeDateSelectCallback");
|
|
2205
2220
|
return;
|
|
2206
2221
|
}
|
|
2207
|
-
const d = s.adjustedDate ||
|
|
2222
|
+
const d = s.adjustedDate || r;
|
|
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 = `${r.getFullYear()}-${String(r.getMonth() + 1).padStart(2, "0")}-${String(r.getDate()).padStart(2, "0")}`, d = e.selectedDates.findIndex((l) => `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` === s);
|
|
2226
|
+
if (d !== -1 ? e.selectedDates.splice(d, 1) : e.selectedDates.push(new Date(r)), 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 = r, 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 = r;
|
|
2235
|
+
r < e.selectedStartDate && (d = e.selectedStartDate, s = r), oe.debug(" selectDay - calling validateRangeAsync with:", s, d);
|
|
2221
2236
|
const l = await Bt(e, s, d);
|
|
2222
|
-
if (
|
|
2223
|
-
l.message &&
|
|
2237
|
+
if (oe.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)}`));
|
|
@@ -2235,13 +2250,13 @@ async function vn(e, a) {
|
|
|
2235
2250
|
e.activeMonthIndex = d;
|
|
2236
2251
|
const c = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${d}"]`);
|
|
2237
2252
|
if (c) {
|
|
2238
|
-
const
|
|
2239
|
-
const
|
|
2240
|
-
if (!
|
|
2241
|
-
const [
|
|
2242
|
-
return e.isSameDay(
|
|
2253
|
+
const h = c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), u = Array.from(h).findIndex((g) => {
|
|
2254
|
+
const f = g.dataset.date;
|
|
2255
|
+
if (!f) return !1;
|
|
2256
|
+
const [p, D, m] = f.split("-").map(Number), C = new Date(p, D - 1, m);
|
|
2257
|
+
return e.isSameDay(C, s);
|
|
2243
2258
|
});
|
|
2244
|
-
u !== -1 && (e.focusedDayIndex = u,
|
|
2259
|
+
u !== -1 && (e.focusedDayIndex = u, h.forEach((g) => g.classList.remove("drp-date-picker__day--focused")), h[u] && h[u].classList.add("drp-date-picker__day--focused"));
|
|
2245
2260
|
}
|
|
2246
2261
|
break;
|
|
2247
2262
|
}
|
|
@@ -2273,67 +2288,67 @@ 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 i = n, r = t, o = i.clientX, s = i.clientY, d = 5;
|
|
2277
2292
|
let l = !1, c = !1;
|
|
2278
|
-
const
|
|
2293
|
+
const h = r.classList.contains("drp-date-picker__day--range-start"), u = r.classList.contains("drp-date-picker__day--range-end");
|
|
2279
2294
|
let g;
|
|
2280
|
-
|
|
2281
|
-
const
|
|
2282
|
-
const
|
|
2283
|
-
!l && (
|
|
2284
|
-
},
|
|
2285
|
-
document.removeEventListener("mousemove",
|
|
2295
|
+
h && e.selectedStartDate && e.selectedEndDate ? g = "start" : u && e.selectedStartDate && e.selectedEndDate ? g = "end" : g = "start";
|
|
2296
|
+
const f = (D) => {
|
|
2297
|
+
const m = Math.abs(D.clientX - o), C = Math.abs(D.clientY - s);
|
|
2298
|
+
!l && (m > d || C > d) && (l = !0), l && !c && (c = !0, Yt(e, i, g, r), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p));
|
|
2299
|
+
}, p = () => {
|
|
2300
|
+
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
|
|
2286
2301
|
};
|
|
2287
|
-
document.addEventListener("mousemove",
|
|
2302
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
|
|
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
|
|
2308
|
+
const i = n, r = i.dataset.date;
|
|
2294
2309
|
let o = null;
|
|
2295
|
-
if (
|
|
2296
|
-
const [s, d, l] =
|
|
2310
|
+
if (r) {
|
|
2311
|
+
const [s, d, l] = r.split("-").map(Number);
|
|
2297
2312
|
o = new Date(s, d - 1, l);
|
|
2298
2313
|
}
|
|
2299
2314
|
!e.selectedStartDate && !e.selectedEndDate ? o && (e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : o && e.selectedStartDate && !e.selectedEndDate ? o.getTime() === e.selectedStartDate.getTime() ? (e.originalStartDate = new Date(e.selectedStartDate), e.originalEndDate = null) : (e.selectedStartDate = null, e.selectedEndDate = null, e.focusedDayIndex = null, e.calendar.querySelectorAll(".drp-date-picker__day--range-start, .drp-date-picker__day--range-end, .drp-date-picker__day--selected, .drp-date-picker__day--focused").forEach((d) => {
|
|
2300
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 = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))),
|
|
2316
|
+
}), e.originalStartDate = o, e.originalEndDate = null, e.draggingType = "end") : (e.selectedStartDate && (e.originalStartDate = new Date(e.selectedStartDate)), e.selectedEndDate && (e.originalEndDate = new Date(e.selectedEndDate))), i.classList.add("drp-date-picker__day--dragging"), U.debug(`Started dragging ${t} date`), e.onDragMoveBound = (s) => Vt(e, s), e.onDragEndBound = async (s) => await qt(e), document.addEventListener("mousemove", e.onDragMoveBound), document.addEventListener("mouseup", e.onDragEndBound), document.body.style.cursor = "grabbing";
|
|
2302
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"), i = t == null ? void 0 : t.closest(".drp-date-picker__nav--next");
|
|
2323
|
+
if (n || i) {
|
|
2309
2324
|
if (!e.navInterval) {
|
|
2310
|
-
const u = (n ||
|
|
2325
|
+
const u = (n || i).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 o =
|
|
2336
|
+
const r = t;
|
|
2337
|
+
if (!r || !r.classList.contains("drp-date-picker__day")) return;
|
|
2338
|
+
const o = r.dataset.date;
|
|
2324
2339
|
if (!o) return;
|
|
2325
2340
|
const [s, d, l] = o.split("-").map(Number);
|
|
2326
2341
|
let c = new Date(s, d - 1, l);
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
c = $e(e, c,
|
|
2342
|
+
if (r.classList.contains("drp-date-picker__day--disabled")) {
|
|
2343
|
+
const h = e.draggingType === "start" ? e.originalEndDate && c > e.originalEndDate ? "backward" : "forward" : e.originalStartDate && c < e.originalStartDate ? "forward" : "backward";
|
|
2344
|
+
c = $e(e, c, h);
|
|
2330
2345
|
}
|
|
2331
2346
|
if (e.draggingType === "start" && e.originalEndDate ? (e.dragPreviewStart = c, e.dragPreviewEnd = e.originalEndDate, e.dragPreviewStart > e.dragPreviewEnd && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "end")) : e.originalStartDate && (e.dragPreviewStart = e.originalStartDate, e.dragPreviewEnd = c, e.dragPreviewEnd < e.dragPreviewStart && ([e.dragPreviewStart, e.dragPreviewEnd] = [e.dragPreviewEnd, e.dragPreviewStart], e.draggingType = "start")), e.dragPreviewStart && e.dragPreviewEnd) {
|
|
2332
|
-
const
|
|
2333
|
-
if (U.debug("onDragMove - mode:",
|
|
2347
|
+
const h = e.options.disabledDatesHandling;
|
|
2348
|
+
if (U.debug("onDragMove - mode:", h, "start:", e.dragPreviewStart, "end:", e.dragPreviewEnd), h === "prevent" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd)) {
|
|
2334
2349
|
U.debug("PREVENT mode - range contains disabled dates, blocking preview update");
|
|
2335
2350
|
return;
|
|
2336
|
-
} else if (
|
|
2351
|
+
} else if (h === "block" && e.hasDisabledDatesInRange(e.dragPreviewStart, e.dragPreviewEnd)) {
|
|
2337
2352
|
if (U.debug("BLOCK mode - range contains disabled dates, adjusting preview"), e.draggingType === "start" && e.originalEndDate) {
|
|
2338
2353
|
const u = e.findLastEnabledBeforeGap(e.dragPreviewStart, e.originalEndDate);
|
|
2339
2354
|
U.debug("BLOCK mode - adjusted end (dragging start):", u), e.dragPreviewEnd = u;
|
|
@@ -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 i = await Bt(e, t, n);
|
|
2369
|
+
if (U.debug("onDragEnd - validation result:", i), !i.isValid)
|
|
2370
|
+
i.message && O.warn("onDragEnd() - drag validation failed:", i.message);
|
|
2356
2371
|
else {
|
|
2357
|
-
e.selectedStartDate =
|
|
2358
|
-
const
|
|
2359
|
-
e.requiresApplyButton() ? e.pendingSelection =
|
|
2372
|
+
e.selectedStartDate = i.adjustedStart || t, e.selectedEndDate = i.adjustedEnd || n, e.input && (e.requiresApplyButton() || (e.input.value = `${e.formatDate(e.selectedStartDate)} - ${e.formatDate(e.selectedEndDate)}`));
|
|
2373
|
+
const r = { start: e.selectedStartDate, end: e.selectedEndDate };
|
|
2374
|
+
e.requiresApplyButton() ? e.pendingSelection = r : e.options.onSelect && e.options.onSelect(r);
|
|
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,15 +2379,15 @@ 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 i = e.monthDates[n];
|
|
2383
|
+
if (t.getFullYear() === i.getFullYear() && t.getMonth() === i.getMonth()) {
|
|
2369
2384
|
e.activeMonthIndex = n;
|
|
2370
|
-
const
|
|
2371
|
-
if (
|
|
2372
|
-
const o =
|
|
2385
|
+
const r = e.calendar.querySelector(`.drp-date-picker__days[data-month-index="${n}"]`);
|
|
2386
|
+
if (r) {
|
|
2387
|
+
const o = r.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)"), s = Array.from(o).findIndex((d) => {
|
|
2373
2388
|
const l = d.dataset.date;
|
|
2374
2389
|
if (!l) return !1;
|
|
2375
|
-
const [c,
|
|
2390
|
+
const [c, h, u] = l.split("-").map(Number), g = new Date(c, h - 1, u);
|
|
2376
2391
|
return e.isSameDay(g, t);
|
|
2377
2392
|
});
|
|
2378
2393
|
s !== -1 && (e.focusedDayIndex = s, o.forEach((d) => d.classList.remove("drp-date-picker__day--focused")), o[s] && o[s].classList.add("drp-date-picker__day--focused"));
|
|
@@ -2385,16 +2400,16 @@ 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 i = new Date(a);
|
|
2404
|
+
if (i.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(i))
|
|
2405
|
+
return i;
|
|
2406
|
+
const r = 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 * r), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
2395
2410
|
return d;
|
|
2396
2411
|
}
|
|
2397
|
-
const o = -
|
|
2412
|
+
const o = -r;
|
|
2398
2413
|
for (let s = 1; s <= 60; s++) {
|
|
2399
2414
|
const d = new Date(a);
|
|
2400
2415
|
if (d.setDate(d.getDate() + s * o), d.setHours(0, 0, 0, 0), !e.isDateDisabledInternal(d))
|
|
@@ -2403,75 +2418,75 @@ function $e(e, a, t = "forward") {
|
|
|
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, i = t.selectionStart || 0, r = e._previousInputValue || "", o = n.length < r.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 =
|
|
2426
|
+
let c = i;
|
|
2412
2427
|
if (o)
|
|
2413
|
-
c =
|
|
2428
|
+
c = i;
|
|
2414
2429
|
else if (l.length > n.length)
|
|
2415
2430
|
if (l.includes(" to ") && !n.includes(" to ")) {
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2431
|
+
const h = l.indexOf(" to ");
|
|
2432
|
+
i >= h && i <= h + 4 ? c = h + 4 : c = i + (l.length - n.length);
|
|
2418
2433
|
} else
|
|
2419
|
-
c =
|
|
2434
|
+
c = i + (l.length - n.length);
|
|
2420
2435
|
t.setSelectionRange(c, c);
|
|
2421
2436
|
}
|
|
2422
2437
|
} else {
|
|
2423
|
-
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l =
|
|
2438
|
+
const d = n.replace(new RegExp(`[^0-9${s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), l = ge(e, d);
|
|
2424
2439
|
if (l !== n) {
|
|
2425
2440
|
t.value = l;
|
|
2426
|
-
let c =
|
|
2441
|
+
let c = i;
|
|
2427
2442
|
if (o)
|
|
2428
|
-
c =
|
|
2429
|
-
else if (l.length > n.length && l[
|
|
2430
|
-
c =
|
|
2443
|
+
c = i;
|
|
2444
|
+
else if (l.length > n.length && l[i] === s)
|
|
2445
|
+
c = i + 1;
|
|
2431
2446
|
else if (l.length > n.length) {
|
|
2432
|
-
const
|
|
2433
|
-
c =
|
|
2447
|
+
const h = (n.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length, g = (l.substring(0, i).match(new RegExp(s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g")) || []).length - h;
|
|
2448
|
+
c = i + g;
|
|
2434
2449
|
}
|
|
2435
2450
|
t.setSelectionRange(c, c);
|
|
2436
2451
|
}
|
|
2437
2452
|
}
|
|
2438
2453
|
e._previousInputValue = t.value, tt(e);
|
|
2439
2454
|
}
|
|
2440
|
-
function
|
|
2441
|
-
var c,
|
|
2442
|
-
const { separator: t, parts: n, maxLength:
|
|
2455
|
+
function ge(e, a) {
|
|
2456
|
+
var c, h, u;
|
|
2457
|
+
const { separator: t, parts: n, maxLength: i } = e.formatInfo, r = a.replace(new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), o = n.year ? n.year.length : 4, s = [
|
|
2443
2458
|
{ type: "year", pos: ((c = n.year) == null ? void 0 : c.index) ?? 0, length: o },
|
|
2444
|
-
{ type: "month", pos: ((
|
|
2459
|
+
{ type: "month", pos: ((h = n.month) == null ? void 0 : h.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], p = r.substring(l, l + f.length);
|
|
2465
|
+
if (!p) break;
|
|
2466
|
+
d += p, l += p.length, g < s.length - 1 && p.length === f.length && (d += t);
|
|
2452
2467
|
}
|
|
2453
|
-
return d.substring(0,
|
|
2468
|
+
return d.substring(0, i);
|
|
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, i = " to ";
|
|
2472
|
+
let r = "", o = "";
|
|
2473
|
+
if (a.includes(i)) {
|
|
2474
|
+
const d = a.split(i);
|
|
2475
|
+
r = d[0], o = d.slice(1).join(i);
|
|
2461
2476
|
} else
|
|
2462
|
-
|
|
2463
|
-
const s =
|
|
2477
|
+
r = a;
|
|
2478
|
+
const s = ge(e, r);
|
|
2464
2479
|
if (s.length === n)
|
|
2465
|
-
if (a.includes(
|
|
2466
|
-
const d =
|
|
2467
|
-
return s +
|
|
2480
|
+
if (a.includes(i)) {
|
|
2481
|
+
const d = ge(e, o);
|
|
2482
|
+
return s + i + d;
|
|
2468
2483
|
} else
|
|
2469
|
-
return s +
|
|
2484
|
+
return s + i;
|
|
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: i } = a, { separator: r } = 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,78 +2503,78 @@ function Sn(e, a) {
|
|
|
2488
2503
|
"ArrowDown",
|
|
2489
2504
|
"Home",
|
|
2490
2505
|
"End"
|
|
2491
|
-
].includes(t) || n ||
|
|
2492
|
-
if (t ===
|
|
2506
|
+
].includes(t) || n || i)) {
|
|
2507
|
+
if (t === r) {
|
|
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] === r || l[u] === " ") {
|
|
2497
2512
|
c = u + 1;
|
|
2498
2513
|
break;
|
|
2499
2514
|
}
|
|
2500
|
-
const
|
|
2501
|
-
if (/^\d$/.test(
|
|
2515
|
+
const h = l.substring(c, d);
|
|
2516
|
+
if (/^\d$/.test(h)) {
|
|
2502
2517
|
a.preventDefault();
|
|
2503
|
-
const u = l.substring(0, c) + "0" +
|
|
2518
|
+
const u = l.substring(0, c) + "0" + h + r + l.substring(d);
|
|
2504
2519
|
s.value = u;
|
|
2505
|
-
const g = c + 2 +
|
|
2520
|
+
const g = c + 2 + r.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 !== r && t !== " " && t.toLowerCase() !== "t" && t.toLowerCase() !== "o" && a.preventDefault() : !/^\d$/.test(t) && t !== r && 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
|
-
o.value =
|
|
2518
|
-
const
|
|
2519
|
-
o.setSelectionRange(
|
|
2531
|
+
const t = ((u = a.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: n } = e.formatInfo, i = t.replace(new RegExp(`[^0-9${n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}]`, "g"), ""), r = ge(e, i), o = a.target, s = o.selectionStart || 0, d = o.selectionEnd || 0, l = o.value, c = l.substring(0, s) + r + l.substring(d);
|
|
2532
|
+
o.value = ge(e, c);
|
|
2533
|
+
const h = s + r.length;
|
|
2534
|
+
o.setSelectionRange(h, h), o.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
|
-
if (
|
|
2525
|
-
const { separator: t, parts: n, maxLength:
|
|
2526
|
-
if (
|
|
2539
|
+
if (re.debug("updateCalendarFromInput - value:", a), !a) return;
|
|
2540
|
+
const { separator: t, parts: n, maxLength: i } = e.formatInfo;
|
|
2541
|
+
if (re.debug("Format info:", { separator: t, parts: n, maxLength: i }), e.options.selectionMode === "range" && a.includes(" to ")) {
|
|
2527
2542
|
const o = a.split(" to "), s = o[0], d = o[1];
|
|
2528
|
-
|
|
2543
|
+
re.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 r = e.options.selectionMode === "range" ? "start" : "single";
|
|
2547
|
+
Ce(e, a, r);
|
|
2533
2548
|
}
|
|
2534
2549
|
function Ce(e, a, t = "single") {
|
|
2535
|
-
const { separator: n, parts:
|
|
2550
|
+
const { separator: n, parts: i, maxLength: r } = e.formatInfo, o = a.split(n);
|
|
2536
2551
|
let s = null, d = null, l = null;
|
|
2537
|
-
if (o.forEach((c,
|
|
2552
|
+
if (o.forEach((c, h) => {
|
|
2538
2553
|
if (c) {
|
|
2539
|
-
if (
|
|
2554
|
+
if (i.year && i.year.index === h) {
|
|
2540
2555
|
const u = parseInt(c, 10);
|
|
2541
|
-
|
|
2542
|
-
} else if (
|
|
2556
|
+
i.year.length === 4 && c.length === 4 ? s = u : i.year.length === 2 && c.length === 2 && (s = u < 100 ? u + 2e3 : u);
|
|
2557
|
+
} else if (i.month && i.month.index === h) {
|
|
2543
2558
|
const u = parseInt(c, 10);
|
|
2544
2559
|
c.length === 2 && u >= 1 && u <= 12 && (d = u);
|
|
2545
|
-
} else if (
|
|
2560
|
+
} else if (i.day && i.day.index === h) {
|
|
2546
2561
|
const u = parseInt(c, 10);
|
|
2547
2562
|
c.length === 2 && u >= 1 && u <= 31 && (l = u);
|
|
2548
2563
|
}
|
|
2549
2564
|
}
|
|
2550
|
-
}),
|
|
2551
|
-
const c = s || (/* @__PURE__ */ new Date()).getFullYear(),
|
|
2565
|
+
}), re.debug(`parseAndUpdateSingleDate(${t}) - year:`, s, "month:", d, "day:", l), s !== null || d !== null) {
|
|
2566
|
+
const c = s || (/* @__PURE__ */ new Date()).getFullYear(), h = d !== null ? d - 1 : (/* @__PURE__ */ new Date()).getMonth();
|
|
2552
2567
|
if (e.options.selectionMode === "single") {
|
|
2553
2568
|
e.monthDates = [];
|
|
2554
2569
|
for (let u = 0; u < e.options.visibleMonthsCount; u++) {
|
|
2555
|
-
const g = new Date(c,
|
|
2570
|
+
const g = new Date(c, h + u, 1);
|
|
2556
2571
|
e.monthDates.push(g);
|
|
2557
2572
|
}
|
|
2558
2573
|
} else if (e.options.selectionMode === "range" && (t === "start" || !e.selectedStartDate)) {
|
|
2559
2574
|
if (e.displayMonths = [
|
|
2560
|
-
{ month:
|
|
2575
|
+
{ month: h, year: c }
|
|
2561
2576
|
], e.options.visibleMonthsCount > 1) {
|
|
2562
|
-
const u = new Date(c,
|
|
2577
|
+
const u = new Date(c, h + 1, 1);
|
|
2563
2578
|
e.displayMonths.push({
|
|
2564
2579
|
month: u.getMonth(),
|
|
2565
2580
|
year: u.getFullYear()
|
|
@@ -2567,15 +2582,15 @@ 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();
|
|
2575
2590
|
}
|
|
2576
2591
|
if (s !== null && d !== null && l !== null) {
|
|
2577
2592
|
const c = new Date(s, d - 1, l);
|
|
2578
|
-
c.getMonth() === d - 1 && (t === "single" ? e.selectedDate = c : t === "start" ? e.selectedStartDate = c : t === "end" && (e.selectedEndDate = c), e.renderCalendar(), e.options.selectionMode === "range" && e.updateSummary(),
|
|
2593
|
+
c.getMonth() === d - 1 && (t === "single" ? e.selectedDate = c : t === "start" ? e.selectedStartDate = c : t === "end" && (e.selectedEndDate = c), e.renderCalendar(), e.options.selectionMode === "range" && e.updateSummary(), re.debug(`Set ${t} date:`, c));
|
|
2579
2594
|
}
|
|
2580
2595
|
}
|
|
2581
2596
|
const Ue = {
|
|
@@ -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 i = 0; i < 7; i++) {
|
|
2656
|
+
const r = new Date(2017, 0, i + 1);
|
|
2657
|
+
n.push(t.format(r));
|
|
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 i = 0; i < 12; i++) {
|
|
2669
|
+
const r = new Date(2017, i, 1);
|
|
2670
|
+
n.push(t.format(r));
|
|
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-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-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: 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-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: 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-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(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-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: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-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:calc(.6 * var(--drp-rem))}.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-spacing-xs: calc(.4 * var(--drp-rem));--drp-spacing-sm: calc(.8 * var(--drp-rem));--drp-spacing-md: calc(1.6 * var(--drp-rem));--drp-spacing-lg: calc(2.4 * var(--drp-rem));--drp-spacing-xl: calc(3.2 * var(--drp-rem));--drp-font-size-2xs: calc(var(--base-font-size-2xs, 1) * var(--drp-rem));--drp-font-size-xs: calc(var(--base-font-size-xs, 1.2) * var(--drp-rem));--drp-font-size-sm: calc(var(--base-font-size-sm, 1.4) * var(--drp-rem));--drp-font-size-base: calc(var(--base-font-size-base, 1.6) * var(--drp-rem));--drp-font-size-lg: calc(var(--base-font-size-lg, 1.8) * var(--drp-rem));--drp-font-size-xl: calc(var(--base-font-size-xl, 2) * var(--drp-rem));--drp-font-size-2xl: calc(var(--base-font-size-2xl, 2.4) * var(--drp-rem));--drp-font-weight-normal: var(--base-font-weight-normal, 400);--drp-font-weight-medium: var(--base-font-weight-medium, 500);--drp-font-weight-semibold: var(--base-font-weight-semibold, 600);--drp-line-height-tight: var(--base-line-height-tight, 1.25);--drp-line-height-normal: var(--base-line-height-normal, 1.5);--drp-line-height-relaxed: var(--base-line-height-relaxed, 1.75);--drp-dropdown-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(.8 * 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.3 * var(--drp-rem));--drp-input-size-sm-padding-v: calc(.5 * 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.4 * 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.6 * var(--drp-rem));--drp-input-size-lg-padding-v: calc(1 * var(--drp-rem));--drp-input-size-lg-padding-h: calc(1.4 * var(--drp-rem));--drp-input-size-lg-height: calc(3.8 * var(--drp-rem));--drp-input-size-lg-icon-size: 1.125em;--drp-input-size-xl-font: calc(1.8 * var(--drp-rem));--drp-input-size-xl-padding-v: calc(1.2 * var(--drp-rem));--drp-input-size-xl-padding-h: calc(1.6 * var(--drp-rem));--drp-input-size-xl-height: calc(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:var(--drp-font-family, var(--base-font-family, inherit));font-size:var(--drp-input-size-md-font);line-height:var(--drp-line-height-normal);color:var(--drp-input-color);background-color:var(--drp-input-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;font-family:var(--drp-font-family, var(--base-font-family, inherit));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-badge-row-height: calc(1.6 * var(--drp-rem))}.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:280px;display:flex;flex-direction:column}.drp-date-picker--inline .drp-date-picker__month{min-width:250px}.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(3.2 * var(--drp-rem));height:calc(3.2 * var(--drp-rem));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(3.2 * var(--drp-rem));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(3.2 * var(--drp-rem));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:2px 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:2px solid var(--drp-day-focused-outline);outline-offset:2px}.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:2px 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);max-height:var(--drp-badge-row-height);min-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell{display:flex;align-items:center;justify-content:center;font-size:var(--drp-font-size-2xs);padding:1px 2px;border-radius:2px;cursor:pointer;height:100%;max-height:var(--drp-badge-row-height)}.drp-date-picker__badge-cell:empty{visibility:hidden}.drp-date-picker__badge-cell:hover:not(:empty){transform:scale(1.05)}.drp-date-picker__badge-cell.badge-number{background-color:var(--drp-badge-number-bg);color:var(--drp-badge-number-color);font-size:calc(1.12 * var(--drp-rem));font-weight:600}.drp-date-picker__badge-cell.badge-count{background-color:var(--drp-badge-count-bg);color:var(--drp-badge-count-color);font-size:calc(1.12 * var(--drp-rem));font-weight:700}.drp-date-picker__badge-cell.badge-text{background-color:var(--drp-badge-text-bg);color:var(--drp-badge-text-color);font-size:calc(1.04 * var(--drp-rem));font-weight:700;text-transform:uppercase}.drp-date-picker__summary{text-align:center;padding:var(--drp-spacing-md);border-top:var(--drp-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-family:inherit;font-size:var(--drp-font-size-sm);font-weight:var(--drp-font-weight-medium)}.drp-date-picker__button:hover{background-color:var(--drp-button-bg-hover);border-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-transitions-enabled .drp-date-picker__badge-cell{transition:transform var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__nav,.drp-date-picker.drp-transitions-enabled .drp-date-picker__action-btn{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy),border-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker.drp-transitions-enabled .drp-date-picker__month-year,.drp-date-picker.drp-transitions-enabled .drp-date-picker__rolling-item{transition:background-color var(--drp-transition-fast) var(--drp-easing-snappy)}.drp-date-picker--inline{position:static;display:block;box-shadow:none}', De = class De {
|
|
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-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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,57 +2827,57 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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 i = this.options.visibleMonthsCount - 1;
|
|
2831
|
+
(this.options.unifiedNavigationAnchorIndex < 0 || this.options.unifiedNavigationAnchorIndex > i) && (console.warn(`unifiedNavigationAnchorIndex (${this.options.unifiedNavigationAnchorIndex}) out of bounds. Using 0.`), this.options.unifiedNavigationAnchorIndex = 0);
|
|
2815
2832
|
}
|
|
2816
|
-
this.weekStartDay = Xt(this.options.weekStartDay), k.debug("Week starts on day:", this.weekStartDay), k.debug("disabledDatesHandling:", this.options.disabledDatesHandling), this.locale =
|
|
2833
|
+
this.weekStartDay = Xt(this.options.weekStartDay), k.debug("Week starts on day:", this.weekStartDay), k.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), k.debug("Locale:", this.locale, "Weekdays:", this.weekdayNames, "Months:", this.monthNames), this.initializeDateRestrictions(), this.formatInfo = this.parseFormat(this.options.dateFormatMask), k.debug("Format info:", this.formatInfo), this._previousInputValue = "", this.currentDate = /* @__PURE__ */ new Date();
|
|
2817
2834
|
let n;
|
|
2818
2835
|
if (this.options.initialDate)
|
|
2819
|
-
n =
|
|
2836
|
+
n = fe(this.options.initialDate) || /* @__PURE__ */ new Date(), k.debug(`Using initialDate: ${n.toISOString()}`);
|
|
2820
2837
|
else if (this.options.rollingYearRange || this.options.rollingMonthRange) {
|
|
2821
|
-
const
|
|
2838
|
+
const i = this.getEffectiveYearRange(), r = this.getEffectiveMonthRange(), o = i.min, s = r.min - 1;
|
|
2822
2839
|
n = new Date(o, s, 1), k.debug(`Using first allowed year/month as initial: ${n.toISOString()}`);
|
|
2823
2840
|
} else this.normalizedMinDate && this.normalizedMinDate > /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMinDate), k.debug(`Using minDate as initial: ${n.toISOString()}`)) : this.normalizedMaxDate && this.normalizedMaxDate < /* @__PURE__ */ new Date() ? (n = new Date(this.normalizedMaxDate), k.debug(`Using maxDate as initial: ${n.toISOString()}`)) : (n = /* @__PURE__ */ new Date(), k.debug(`Using current date as initial: ${n.toISOString()}`));
|
|
2824
2841
|
this.monthDates = [];
|
|
2825
|
-
for (let
|
|
2826
|
-
const
|
|
2827
|
-
this.monthDates.push(
|
|
2842
|
+
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2843
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2844
|
+
this.monthDates.push(r), k.debug(`monthDates[${i}] = ${r.getFullYear()}-${r.getMonth() + 1}`);
|
|
2828
2845
|
}
|
|
2829
2846
|
if (this.options.selectionMode === "range") {
|
|
2830
2847
|
this.displayMonths = [];
|
|
2831
|
-
for (let
|
|
2832
|
-
const
|
|
2848
|
+
for (let i = 0; i < this.options.visibleMonthsCount; i++) {
|
|
2849
|
+
const r = new Date(n.getFullYear(), n.getMonth() + i, 1);
|
|
2833
2850
|
this.displayMonths.push({
|
|
2834
|
-
month:
|
|
2835
|
-
year:
|
|
2851
|
+
month: r.getMonth(),
|
|
2852
|
+
year: r.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 i = 0; i < this.options.visibleMonthsCount; i++)
|
|
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
|
-
k.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (k.debug("Parsing pre-filled value:", this.input.value), this.updateCalendarFromInput())), this.options.positioningMode === "inline" && (this.renderCalendar(), this.calendar.classList.add("drp-date-picker--visible", "drp-date-picker--inline"), this.isCalendarActive = !0, this.isFirstRender = !1,
|
|
2862
|
+
k.debug("Init called"), this.createCalendar(), this.input && (this.attachInputListeners(), this.input.value && (k.debug("Parsing pre-filled value:", this.input.value), this.updateCalendarFromInput())), this.options.positioningMode === "inline" && (this.renderCalendar(), this.calendar.classList.add("drp-date-picker--visible", "drp-date-picker--inline"), this.isCalendarActive = !0, this.isFirstRender = !1, kt(this), this.clickOutsideHandler && document.addEventListener("click", this.clickOutsideHandler)), k.debug("Init complete");
|
|
2846
2863
|
}
|
|
2847
2864
|
/**
|
|
2848
2865
|
* Initialize and normalize date restrictions
|
|
2849
2866
|
*/
|
|
2850
2867
|
initializeDateRestrictions() {
|
|
2851
|
-
if (this.options.minDate && (this.normalizedMinDate =
|
|
2852
|
-
const t =
|
|
2868
|
+
if (this.options.minDate && (this.normalizedMinDate = fe(this.options.minDate)), this.options.maxDate && (this.normalizedMaxDate = fe(this.options.maxDate)), this.options.disabledDates && this.options.disabledDates.length > 0 && this.options.disabledDates.forEach((a) => {
|
|
2869
|
+
const t = fe(a);
|
|
2853
2870
|
if (t) {
|
|
2854
|
-
const n =
|
|
2871
|
+
const n = be(t);
|
|
2855
2872
|
this.normalizedDisabledDates.add(n);
|
|
2856
2873
|
}
|
|
2857
2874
|
}), this.options.specialDates && this.options.specialDates.length > 0) {
|
|
2858
2875
|
const a = this.options.dateMember || "date";
|
|
2859
2876
|
this.options.specialDates.forEach((t) => {
|
|
2860
|
-
const n =
|
|
2877
|
+
const n = fe(t[a]);
|
|
2861
2878
|
if (n) {
|
|
2862
|
-
const
|
|
2863
|
-
this.normalizedSpecialDates.set(
|
|
2879
|
+
const i = be(n);
|
|
2880
|
+
this.normalizedSpecialDates.set(i, t);
|
|
2864
2881
|
} else
|
|
2865
2882
|
console.warn("[Special Dates] Failed to normalize date:", t[a]);
|
|
2866
2883
|
});
|
|
@@ -2899,12 +2916,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
2899
2916
|
return;
|
|
2900
2917
|
} else if (n.isVisible !== void 0 && !n.isVisible)
|
|
2901
2918
|
return;
|
|
2902
|
-
const
|
|
2903
|
-
|
|
2904
|
-
const
|
|
2905
|
-
|
|
2919
|
+
const i = document.createElement("button");
|
|
2920
|
+
i.className = `drp-date-picker__button drp-date-picker__button--${n.action}`;
|
|
2921
|
+
const r = n.getClassCallback ? n.getClassCallback(this) : n.cssClass;
|
|
2922
|
+
r && (Array.isArray(r) ? i.classList.add(...r) : i.classList.add(r));
|
|
2906
2923
|
const o = n.getTextCallback ? n.getTextCallback(this) : n.text;
|
|
2907
|
-
|
|
2924
|
+
i.innerHTML = o, (n.isDisabledCallback ? n.isDisabledCallback(this) : n.isDisabled ?? !1) && (i.disabled = !0), i.dataset.action = n.action, n.onClick && (i._customOnClick = n.onClick), a.appendChild(i);
|
|
2908
2925
|
}), this.attachActionButtonTooltips();
|
|
2909
2926
|
}
|
|
2910
2927
|
/**
|
|
@@ -2929,13 +2946,13 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
2929
2946
|
attachActionButtonTooltips() {
|
|
2930
2947
|
if (!this.actionsContainer) return;
|
|
2931
2948
|
this.actionsContainer.querySelectorAll(".drp-date-picker__action").forEach((t) => {
|
|
2932
|
-
const n = t,
|
|
2933
|
-
if (!
|
|
2934
|
-
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action ===
|
|
2949
|
+
const n = t, i = n.dataset.action;
|
|
2950
|
+
if (!i) return;
|
|
2951
|
+
const o = (this.options.actionButtons || this.getDefaultButtons()).find((l) => l.action === i);
|
|
2935
2952
|
if (!o) return;
|
|
2936
2953
|
let s;
|
|
2937
2954
|
if (o.getTooltipCallback ? s = o.getTooltipCallback(this) : s = o.tooltip, !s) return;
|
|
2938
|
-
const d = `action-${
|
|
2955
|
+
const d = `action-${i}-${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-rem: 10px;--drp-font-scale: 1;--d
|
|
|
2943
2960
|
* Create a Floating UI tooltip for an action button
|
|
2944
2961
|
*/
|
|
2945
2962
|
createActionButtonTooltip(a, t, n) {
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2963
|
+
const i = document.createElement("div");
|
|
2964
|
+
i.className = "drp-date-picker__tooltip", i.textContent = t, (this.options.container || document.body).appendChild(i), this.actionButtonTooltips.set(n, i);
|
|
2948
2965
|
let o, s;
|
|
2949
2966
|
const d = () => {
|
|
2950
2967
|
clearTimeout(s), o = window.setTimeout(() => {
|
|
2951
|
-
|
|
2968
|
+
i.classList.add("drp-date-picker__tooltip--visible"), this.positionActionButtonTooltip(a, i, n);
|
|
2952
2969
|
}, 300);
|
|
2953
2970
|
}, l = () => {
|
|
2954
2971
|
clearTimeout(o), s = window.setTimeout(() => {
|
|
2955
|
-
|
|
2972
|
+
i.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,19 +2980,19 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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: i, flip: r, shift: o, offset: s, autoUpdate: d } = await Promise.resolve().then(() => en), l = d(a, t, () => {
|
|
2984
|
+
i(a, t, {
|
|
2968
2985
|
placement: "top",
|
|
2969
2986
|
strategy: "fixed",
|
|
2970
2987
|
middleware: [
|
|
2971
2988
|
s(8),
|
|
2972
|
-
|
|
2989
|
+
r(),
|
|
2973
2990
|
o({ padding: 8 })
|
|
2974
2991
|
]
|
|
2975
|
-
}).then(({ x: c, y:
|
|
2992
|
+
}).then(({ x: c, y: h }) => {
|
|
2976
2993
|
Object.assign(t.style, {
|
|
2977
2994
|
left: `${c}px`,
|
|
2978
|
-
top: `${
|
|
2995
|
+
top: `${h}px`
|
|
2979
2996
|
});
|
|
2980
2997
|
});
|
|
2981
2998
|
});
|
|
@@ -2998,8 +3015,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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 i = this.getEffectiveMonthRange(), r = a.getMonth() + 1;
|
|
3019
|
+
return r < i.min || r > i.max ? !0 : Jt(
|
|
3003
3020
|
a,
|
|
3004
3021
|
this.normalizedMinDate,
|
|
3005
3022
|
this.normalizedMaxDate,
|
|
@@ -3012,7 +3029,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3012
3029
|
* Priority: bulkMetadataCache > callback > specialDates
|
|
3013
3030
|
*/
|
|
3014
3031
|
getDateInfoInternal(a) {
|
|
3015
|
-
const t =
|
|
3032
|
+
const t = be(a);
|
|
3016
3033
|
if (this.bulkMetadataCache && this.bulkMetadataCache.has(t)) {
|
|
3017
3034
|
const n = this.bulkMetadataCache.get(t);
|
|
3018
3035
|
return {
|
|
@@ -3029,12 +3046,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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), i = this.options.badgeTextMember || "badgeText", r = this.options.badgeClassMember || "badgeClass", o = this.options.dayClassMember || "dayClass", s = this.options.badgeTooltipMember || "badgeTooltip", d = this.options.dayTooltipMember || "dayTooltip", l = this.options.isDisabledMember || "isDisabled";
|
|
3033
3050
|
return {
|
|
3034
3051
|
isDisabled: n[l] !== void 0 ? n[l] : this.isDateDisabledInternal(a),
|
|
3035
|
-
badgeClass: n[
|
|
3052
|
+
badgeClass: n[r],
|
|
3036
3053
|
dayClass: n[o],
|
|
3037
|
-
badgeText: n[
|
|
3054
|
+
badgeText: n[i],
|
|
3038
3055
|
badgeTooltip: n[s],
|
|
3039
3056
|
dayTooltip: n[d]
|
|
3040
3057
|
};
|
|
@@ -3075,7 +3092,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3075
3092
|
return ut(a);
|
|
3076
3093
|
}
|
|
3077
3094
|
isSameDay(a, t) {
|
|
3078
|
-
return
|
|
3095
|
+
return ht(a, t);
|
|
3079
3096
|
}
|
|
3080
3097
|
isInRange(a) {
|
|
3081
3098
|
return na(a, this.selectedStartDate, this.selectedEndDate);
|
|
@@ -3097,10 +3114,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3097
3114
|
createCalendar() {
|
|
3098
3115
|
if (k.debug("Creating calendar"), this.calendar = document.createElement("div"), this.calendar.className = "drp-date-picker", this.options.unifiedNavigation && this.calendar.classList.add("drp-date-picker--unified-nav"), this.options.unifiedNavigation) {
|
|
3099
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", i = 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}"${i}></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-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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 i = document.createElement("div");
|
|
3131
|
+
i.className = "drp-date-picker__month", i.dataset.monthIndex = String(n);
|
|
3132
|
+
const r = 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
|
+
i.innerHTML = `
|
|
3140
|
+
${r}
|
|
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,7 +3146,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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(i);
|
|
3133
3150
|
}
|
|
3134
3151
|
if (this.calendar.appendChild(a), this.options.selectionMode === "range") {
|
|
3135
3152
|
const n = document.createElement("div");
|
|
@@ -3152,17 +3169,17 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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, i = t.dataset.monthIndex, r = i ? parseInt(i) : 0;
|
|
3156
3173
|
if (n === "prev" || n === "next" || n === "unified-prev" || n === "unified-next") {
|
|
3157
3174
|
const o = t;
|
|
3158
3175
|
if (o.disabled || o.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(r);
|
|
3179
|
+
else if (n === "next") this.nextMonth(r);
|
|
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(r);
|
|
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();
|
|
@@ -3201,14 +3218,14 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3201
3218
|
this.showingUnifiedRollingSelector && (this.showingUnifiedRollingSelector = !1, o = !0), o && 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 o =
|
|
3207
|
-
o && this.showTooltip(
|
|
3221
|
+
const t = a.target, n = t.closest(".drp-date-picker__day"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3222
|
+
if (r && r instanceof HTMLElement) {
|
|
3223
|
+
const o = r.dataset.tooltip;
|
|
3224
|
+
o && this.showTooltip(r, o);
|
|
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"), i = t.closest(".drp-date-picker__badge-cell"), r = n || i;
|
|
3228
|
+
r && this.currentTooltipTarget === r && this.hideTooltip();
|
|
3212
3229
|
}, !0), this.calendar.addEventListener("mousedown", (a) => {
|
|
3213
3230
|
this.isCalendarActive = !0, a.stopPropagation();
|
|
3214
3231
|
}), this.calendar.addEventListener("focusin", () => {
|
|
@@ -3216,7 +3233,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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, i, r;
|
|
3220
3237
|
if (this.calendar.classList.contains("drp-date-picker--visible") && this.isCalendarActive) {
|
|
3221
3238
|
if (k.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();
|
|
@@ -3272,7 +3289,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3272
3289
|
a.preventDefault();
|
|
3273
3290
|
}
|
|
3274
3291
|
} else if (a.key === "t" || a.key === "T")
|
|
3275
|
-
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), this.renderCalendar(), setTimeout(() => {
|
|
3292
|
+
this.monthDates[this.activeMonthIndex] = /* @__PURE__ */ new Date(), he(this, this.activeMonthIndex), this.renderCalendar(), setTimeout(() => {
|
|
3276
3293
|
const o = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), s = o == null ? void 0 : o.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3277
3294
|
if (s) {
|
|
3278
3295
|
const d = Array.from(s).findIndex((l) => l.classList.contains("drp-date-picker__day--today"));
|
|
@@ -3301,19 +3318,19 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3301
3318
|
const d = s === 0, l = this.focusedDayIndex === 0;
|
|
3302
3319
|
d && l ? (w.debug("Already at Jan 1, going to previous year"), this.monthDates[this.activeMonthIndex] = new Date(o - 1, 0, 1)) : (w.debug("Going to Jan 1 of current year"), this.monthDates[this.activeMonthIndex] = new Date(o, 0, 1)), this.renderCalendar(), setTimeout(() => {
|
|
3303
3320
|
var u, g;
|
|
3304
|
-
const c = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`),
|
|
3305
|
-
|
|
3321
|
+
const c = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), h = c == null ? void 0 : c.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3322
|
+
h && (this.focusedDayIndex = 0, (u = h[0]) == null || u.classList.add("drp-date-picker__day--focused"), (g = h[0]) == null || g.scrollIntoView({ block: "nearest" }));
|
|
3306
3323
|
}, 0);
|
|
3307
3324
|
} else if (w.debug("Home: Navigate to first day (cycles to previous month if already there)"), this.focusedDayIndex === 0)
|
|
3308
3325
|
w.debug("Already on first day, going to previous month"), this.prevMonth(this.activeMonthIndex), setTimeout(() => {
|
|
3309
|
-
var
|
|
3326
|
+
var h, u;
|
|
3310
3327
|
const l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3311
|
-
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((g) => g.classList.remove("drp-date-picker__day--focused")), (
|
|
3328
|
+
c && (this.focusedDayIndex = 0, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((g) => g.classList.remove("drp-date-picker__day--focused")), (h = c[0]) == null || h.classList.add("drp-date-picker__day--focused"), (u = c[0]) == null || u.scrollIntoView({ block: "nearest" }));
|
|
3312
3329
|
}, 0);
|
|
3313
3330
|
else {
|
|
3314
3331
|
this.focusedDayIndex = 0;
|
|
3315
3332
|
const l = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), c = l == null ? void 0 : l.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3316
|
-
c && (this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((
|
|
3333
|
+
c && (this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((h) => h.classList.remove("drp-date-picker__day--focused")), (t = c[0]) == null || t.classList.add("drp-date-picker__day--focused"), (n = c[0]) == null || n.scrollIntoView({ block: "nearest" }));
|
|
3317
3334
|
}
|
|
3318
3335
|
a.preventDefault();
|
|
3319
3336
|
} else if (a.key === "End") {
|
|
@@ -3321,29 +3338,29 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3321
3338
|
const o = 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
|
-
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)"),
|
|
3325
|
-
d &&
|
|
3326
|
-
var
|
|
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)"), h = c && this.focusedDayIndex === c.length - 1;
|
|
3342
|
+
d && h ? this.monthDates[this.activeMonthIndex] = new Date(o + 1, 11, 31) : this.monthDates[this.activeMonthIndex] = new Date(o, 11, 31), this.renderCalendar(), setTimeout(() => {
|
|
3343
|
+
var f, p;
|
|
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"), (p = g[this.focusedDayIndex]) == null || p.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,
|
|
3336
|
-
const
|
|
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((
|
|
3352
|
+
var g, f;
|
|
3353
|
+
const h = this.calendar.querySelector(`.drp-date-picker__days[data-month-index="${this.activeMonthIndex}"]`), u = h == null ? void 0 : h.querySelectorAll(".drp-date-picker__day:not(.drp-date-picker__day--other-month)");
|
|
3354
|
+
u && (this.focusedDayIndex = u.length - 1, this.calendar.querySelectorAll(".drp-date-picker__day--focused").forEach((p) => p.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((h) => h.classList.remove("drp-date-picker__day--focused")), (i = l[this.focusedDayIndex]) == null || i.classList.add("drp-date-picker__day--focused"), (r = l[this.focusedDayIndex]) == null || r.scrollIntoView({ block: "nearest" }));
|
|
3339
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], i = t.includes(this.calendar), r = this.input && t.includes(this.input), o = (s = n.closest) == null ? void 0 : s.call(n, "[data-calendar-button]");
|
|
3363
|
+
if (!i && !r && !o)
|
|
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-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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((r, o) => {
|
|
3379
|
+
r === "YYYY" || r === "YY" ? t.year = { index: o, length: r.length } : r === "MM" || r === "M" ? t.month = { index: o, length: 2 } : (r === "DD" || r === "D") && (t.day = { index: o, length: 2 });
|
|
3363
3380
|
}), {
|
|
3364
3381
|
format: a,
|
|
3365
3382
|
separator: n,
|
|
@@ -3369,9 +3386,9 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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"), i = String(a.getDate()).padStart(2, "0"), { format: r, separator: o, 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(
|
|
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(i);
|
|
3375
3392
|
return d.join(o);
|
|
3376
3393
|
}
|
|
3377
3394
|
// Reactive getters/setters for programmatic control
|
|
@@ -3426,10 +3443,10 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3426
3443
|
}
|
|
3427
3444
|
// UI methods - wrappers for pure functions
|
|
3428
3445
|
show() {
|
|
3429
|
-
return
|
|
3446
|
+
return Tt(this);
|
|
3430
3447
|
}
|
|
3431
3448
|
hide() {
|
|
3432
|
-
return
|
|
3449
|
+
return Lt(this);
|
|
3433
3450
|
}
|
|
3434
3451
|
toggle() {
|
|
3435
3452
|
return tn(this);
|
|
@@ -3445,7 +3462,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3445
3462
|
}
|
|
3446
3463
|
// Rendering methods - wrappers for pure functions
|
|
3447
3464
|
renderCalendar() {
|
|
3448
|
-
return
|
|
3465
|
+
return pn(this);
|
|
3449
3466
|
}
|
|
3450
3467
|
renderNormalView(a) {
|
|
3451
3468
|
return zt(this, a);
|
|
@@ -3460,29 +3477,29 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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);
|
|
3467
3484
|
}
|
|
3468
3485
|
// Navigation methods - wrappers for pure functions
|
|
3469
3486
|
toggleRollingSelector(a) {
|
|
3470
|
-
return
|
|
3487
|
+
return on(this, a);
|
|
3471
3488
|
}
|
|
3472
3489
|
selectYear(a, t) {
|
|
3473
|
-
return
|
|
3490
|
+
return rn(this, a, t);
|
|
3474
3491
|
}
|
|
3475
3492
|
selectMonth(a, t) {
|
|
3476
3493
|
return sn(this, a, t);
|
|
3477
3494
|
}
|
|
3478
3495
|
checkAndResolveCollisions(a) {
|
|
3479
|
-
return
|
|
3496
|
+
return he(this, a);
|
|
3480
3497
|
}
|
|
3481
3498
|
prevMonth(a) {
|
|
3482
|
-
return
|
|
3499
|
+
return ye(this, a);
|
|
3483
3500
|
}
|
|
3484
3501
|
nextMonth(a) {
|
|
3485
|
-
return
|
|
3502
|
+
return ve(this, a);
|
|
3486
3503
|
}
|
|
3487
3504
|
// Unified navigation methods
|
|
3488
3505
|
unifiedPrevMonth() {
|
|
@@ -3492,7 +3509,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3492
3509
|
return ln(this);
|
|
3493
3510
|
}
|
|
3494
3511
|
toggleUnifiedRollingSelector() {
|
|
3495
|
-
return
|
|
3512
|
+
return hn(this);
|
|
3496
3513
|
}
|
|
3497
3514
|
setUnifiedMonth(a) {
|
|
3498
3515
|
return un(this, a);
|
|
@@ -3500,8 +3517,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3500
3517
|
setUnifiedYear(a) {
|
|
3501
3518
|
return gn(this, a);
|
|
3502
3519
|
}
|
|
3503
|
-
findNextEnabledDayIndex(a, t, n,
|
|
3504
|
-
return
|
|
3520
|
+
findNextEnabledDayIndex(a, t, n, i) {
|
|
3521
|
+
return me(this, a, t, n);
|
|
3505
3522
|
}
|
|
3506
3523
|
moveFocus(a) {
|
|
3507
3524
|
return dn(this, a);
|
|
@@ -3524,7 +3541,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
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);
|
|
@@ -3539,7 +3556,7 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3539
3556
|
return Mn(this, a);
|
|
3540
3557
|
}
|
|
3541
3558
|
applyMask(a) {
|
|
3542
|
-
return
|
|
3559
|
+
return ge(this, a);
|
|
3543
3560
|
}
|
|
3544
3561
|
applyRangeMask(a) {
|
|
3545
3562
|
return Ut(this, a);
|
|
@@ -3580,12 +3597,12 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3580
3597
|
* ```
|
|
3581
3598
|
*/
|
|
3582
3599
|
static injectGlobalStyles(a = !1) {
|
|
3583
|
-
if (
|
|
3600
|
+
if (De.stylesInjected && !a) {
|
|
3584
3601
|
k.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),
|
|
3605
|
+
t.setAttribute("data-source", "web-daterangepicker"), t.textContent = jt, document.head.appendChild(t), De.stylesInjected = !0, k.info("Global styles injected successfully");
|
|
3589
3606
|
}
|
|
3590
3607
|
/**
|
|
3591
3608
|
* Check if styles appear to be loaded
|
|
@@ -3605,8 +3622,8 @@ const jt = '@charset "UTF-8";:host,:root{--drp-rem: 10px;--drp-font-scale: 1;--d
|
|
|
3605
3622
|
}
|
|
3606
3623
|
};
|
|
3607
3624
|
// Static flag to track if styles have been injected
|
|
3608
|
-
b(
|
|
3609
|
-
let je =
|
|
3625
|
+
b(De, "stylesInjected", !1);
|
|
3626
|
+
let je = De;
|
|
3610
3627
|
class Wt extends HTMLElement {
|
|
3611
3628
|
constructor() {
|
|
3612
3629
|
super();
|
|
@@ -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");
|
|
@@ -3666,9 +3684,6 @@ class Wt extends HTMLElement {
|
|
|
3666
3684
|
"initial-date",
|
|
3667
3685
|
"rolling-year-range",
|
|
3668
3686
|
"rolling-month-range",
|
|
3669
|
-
"spacing",
|
|
3670
|
-
"font-size",
|
|
3671
|
-
"cell-size",
|
|
3672
3687
|
"enable-transitions",
|
|
3673
3688
|
"auto-close",
|
|
3674
3689
|
"show-today-button",
|
|
@@ -3680,11 +3695,10 @@ class Wt extends HTMLElement {
|
|
|
3680
3695
|
"input-size"
|
|
3681
3696
|
];
|
|
3682
3697
|
}
|
|
3683
|
-
|
|
3698
|
+
applyTransitionStyles() {
|
|
3684
3699
|
const t = this.shadow.querySelector(".drp-date-picker");
|
|
3685
3700
|
if (!t) return;
|
|
3686
|
-
|
|
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}`), r && r !== "md" && t.classList.add(`drp-font-${r}`), i && i !== "md" && t.classList.add(`drp-cell-${i}`), o ? t.classList.add("drp-transitions-enabled") : t.classList.remove("drp-transitions-enabled");
|
|
3701
|
+
this.hasAttribute("enable-transitions") ? t.classList.add("drp-transitions-enabled") : t.classList.remove("drp-transitions-enabled");
|
|
3688
3702
|
}
|
|
3689
3703
|
applyInputSizeStyles() {
|
|
3690
3704
|
if (!this.inputElement) return;
|
|
@@ -3697,43 +3711,43 @@ class Wt extends HTMLElement {
|
|
|
3697
3711
|
disconnectedCallback() {
|
|
3698
3712
|
this.picker && this.picker.destroy();
|
|
3699
3713
|
}
|
|
3700
|
-
attributeChangedCallback(t, n,
|
|
3701
|
-
if (n !==
|
|
3702
|
-
if (t === "
|
|
3703
|
-
this.
|
|
3714
|
+
attributeChangedCallback(t, n, i) {
|
|
3715
|
+
if (n !== i) {
|
|
3716
|
+
if (t === "enable-transitions") {
|
|
3717
|
+
this.applyTransitionStyles();
|
|
3704
3718
|
return;
|
|
3705
3719
|
}
|
|
3706
3720
|
if (t === "input-size") {
|
|
3707
3721
|
this.applyInputSizeStyles();
|
|
3708
3722
|
return;
|
|
3709
3723
|
}
|
|
3710
|
-
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement &&
|
|
3724
|
+
this.picker && t !== "value" && t !== "placeholder" && (this.picker.destroy(), this.initializePicker()), t === "value" && this.inputElement && i !== null && (this.inputElement.value = i), t === "placeholder" && this.inputElement && i !== null && (this.inputElement.placeholder = i), t === "disabled" && this.inputElement && (i !== null ? this.inputElement.disabled = !0 : this.inputElement.disabled = !1);
|
|
3711
3725
|
}
|
|
3712
3726
|
}
|
|
3713
3727
|
render() {
|
|
3714
3728
|
const t = document.createElement("style");
|
|
3715
3729
|
if (t.textContent = jt, this.shadow.appendChild(t), (this.getAttribute("positioning-mode") || "floating") === "floating") {
|
|
3716
3730
|
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
|
-
|
|
3731
|
+
const i = this.getAttribute("placeholder");
|
|
3732
|
+
i && (this.inputElement.placeholder = i);
|
|
3733
|
+
const r = this.getAttribute("value");
|
|
3734
|
+
r && (this.inputElement.value = r), this.hasAttribute("disabled") && (this.inputElement.disabled = !0), this.shadow.appendChild(this.inputElement), this.applyInputSizeStyles();
|
|
3721
3735
|
}
|
|
3722
3736
|
}
|
|
3723
3737
|
initializePicker() {
|
|
3724
3738
|
const t = this.getAttribute("positioning-mode") || "floating";
|
|
3725
3739
|
if (t === "floating" && !this.inputElement) return;
|
|
3726
3740
|
let n;
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3729
|
-
let
|
|
3741
|
+
const i = this.getAttribute("disabled-weekdays");
|
|
3742
|
+
i && (n = i.split(",").map((l) => parseInt(l.trim())).filter((l) => !isNaN(l) && l >= 0 && l <= 6));
|
|
3743
|
+
let r;
|
|
3730
3744
|
const o = this.getAttribute("week-start-day");
|
|
3731
3745
|
if (o)
|
|
3732
3746
|
if (o === "auto")
|
|
3733
|
-
|
|
3747
|
+
r = "auto";
|
|
3734
3748
|
else {
|
|
3735
3749
|
const l = parseInt(o);
|
|
3736
|
-
!isNaN(l) && l >= 0 && l <= 6 && (
|
|
3750
|
+
!isNaN(l) && l >= 0 && l <= 6 && (r = l);
|
|
3737
3751
|
}
|
|
3738
3752
|
const s = {
|
|
3739
3753
|
selectionMode: this.getAttribute("selection-mode") || "single",
|
|
@@ -3754,7 +3768,7 @@ class Wt extends HTMLElement {
|
|
|
3754
3768
|
// Positioning
|
|
3755
3769
|
calendarPlacement: this.getAttribute("calendar-placement") || void 0,
|
|
3756
3770
|
// New options
|
|
3757
|
-
weekStartDay:
|
|
3771
|
+
weekStartDay: r,
|
|
3758
3772
|
minDate: this.getAttribute("min-date") || void 0,
|
|
3759
3773
|
maxDate: this.getAttribute("max-date") || void 0,
|
|
3760
3774
|
initialDate: this.getAttribute("initial-date") || void 0,
|
|
@@ -3789,6 +3803,7 @@ class Wt extends HTMLElement {
|
|
|
3789
3803
|
beforeMonthChangedCallback: this._beforeMonthChangedCallback,
|
|
3790
3804
|
formatSummaryCallback: this._formatSummaryCallback,
|
|
3791
3805
|
getUnifiedHeaderCallback: this._getUnifiedHeaderCallback,
|
|
3806
|
+
getMonthHeaderCallback: this._getMonthHeaderCallback,
|
|
3792
3807
|
// Action button configuration
|
|
3793
3808
|
autoClose: this.getAttribute("auto-close") || void 0,
|
|
3794
3809
|
actionButtons: this._actionButtons,
|
|
@@ -3803,7 +3818,7 @@ class Wt extends HTMLElement {
|
|
|
3803
3818
|
c.className = "drp-custom-styles", c.textContent = l, this.shadow.appendChild(c);
|
|
3804
3819
|
}
|
|
3805
3820
|
}
|
|
3806
|
-
setTimeout(() => this.
|
|
3821
|
+
setTimeout(() => this.applyTransitionStyles(), 0);
|
|
3807
3822
|
}
|
|
3808
3823
|
/**
|
|
3809
3824
|
* Schedule a deferred re-initialization of the picker
|
|
@@ -3815,11 +3830,11 @@ class Wt extends HTMLElement {
|
|
|
3815
3830
|
}));
|
|
3816
3831
|
}
|
|
3817
3832
|
handleDateSelect(t) {
|
|
3818
|
-
var
|
|
3833
|
+
var r;
|
|
3819
3834
|
const n = {
|
|
3820
3835
|
date: t instanceof Date ? t : void 0,
|
|
3821
3836
|
dateRange: t instanceof Date || Array.isArray(t) ? void 0 : t,
|
|
3822
|
-
formattedValue: ((
|
|
3837
|
+
formattedValue: ((r = this.inputElement) == null ? void 0 : r.value) || ""
|
|
3823
3838
|
};
|
|
3824
3839
|
if (!this.picker) {
|
|
3825
3840
|
this.dispatchEvent(new CustomEvent("date-select", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: n, bubbles: !0, composed: !0 }));
|
|
@@ -3827,10 +3842,10 @@ class Wt extends HTMLElement {
|
|
|
3827
3842
|
}
|
|
3828
3843
|
if (this.picker.requiresApplyButton() && this.picker.pendingSelection)
|
|
3829
3844
|
return;
|
|
3830
|
-
const
|
|
3845
|
+
const i = this.picker.options.disabledDatesHandling;
|
|
3831
3846
|
if (!(t instanceof Date) && !Array.isArray(t) && "start" in t && "end" in t) {
|
|
3832
3847
|
const o = t.start, s = t.end;
|
|
3833
|
-
switch (
|
|
3848
|
+
switch (i) {
|
|
3834
3849
|
case "allow":
|
|
3835
3850
|
n.enabledDates = this.picker.getEnabledDatesInRange(o, s), n.disabledDates = this.picker.getDisabledDatesInRange(o, s), n.getEnabledDateCount = () => n.enabledDates.length, n.getTotalDays = () => Math.floor((s.getTime() - o.getTime()) / 864e5) + 1;
|
|
3836
3851
|
break;
|
|
@@ -3955,25 +3970,7 @@ class Wt extends HTMLElement {
|
|
|
3955
3970
|
set disabledWeekdays(t) {
|
|
3956
3971
|
t && t.length > 0 ? this.setAttribute("disabled-weekdays", t.join(",")) : this.removeAttribute("disabled-weekdays");
|
|
3957
3972
|
}
|
|
3958
|
-
//
|
|
3959
|
-
get spacing() {
|
|
3960
|
-
return this.getAttribute("spacing") || "md";
|
|
3961
|
-
}
|
|
3962
|
-
set spacing(t) {
|
|
3963
|
-
this.setAttribute("spacing", t);
|
|
3964
|
-
}
|
|
3965
|
-
get fontSize() {
|
|
3966
|
-
return this.getAttribute("font-size") || "md";
|
|
3967
|
-
}
|
|
3968
|
-
set fontSize(t) {
|
|
3969
|
-
this.setAttribute("font-size", t);
|
|
3970
|
-
}
|
|
3971
|
-
get cellSize() {
|
|
3972
|
-
return this.getAttribute("cell-size") || "md";
|
|
3973
|
-
}
|
|
3974
|
-
set cellSize(t) {
|
|
3975
|
-
this.setAttribute("cell-size", t);
|
|
3976
|
-
}
|
|
3973
|
+
// Transition property
|
|
3977
3974
|
get enableTransitions() {
|
|
3978
3975
|
return this.hasAttribute("enable-transitions");
|
|
3979
3976
|
}
|
|
@@ -4060,6 +4057,12 @@ class Wt extends HTMLElement {
|
|
|
4060
4057
|
set getUnifiedHeaderCallback(t) {
|
|
4061
4058
|
this._getUnifiedHeaderCallback = t, this.scheduleReinit();
|
|
4062
4059
|
}
|
|
4060
|
+
get getMonthHeaderCallback() {
|
|
4061
|
+
return this._getMonthHeaderCallback;
|
|
4062
|
+
}
|
|
4063
|
+
set getMonthHeaderCallback(t) {
|
|
4064
|
+
this._getMonthHeaderCallback = t, this.scheduleReinit();
|
|
4065
|
+
}
|
|
4063
4066
|
// Member mapping getters/setters
|
|
4064
4067
|
get dateMember() {
|
|
4065
4068
|
return this._dateMember;
|
|
@@ -4145,10 +4148,10 @@ function An() {
|
|
|
4145
4148
|
return Array.from(document.querySelectorAll("web-daterangepicker"));
|
|
4146
4149
|
}
|
|
4147
4150
|
typeof window < "u" && (window.components = window.components || {}, window.components["web-daterangepicker"] = {
|
|
4148
|
-
version: () => "1.
|
|
4151
|
+
version: () => "1.7.0-rc01",
|
|
4149
4152
|
config: {
|
|
4150
4153
|
name: "@keenmate/web-daterangepicker",
|
|
4151
|
-
version: "1.
|
|
4154
|
+
version: "1.7.0-rc01",
|
|
4152
4155
|
author: "Keenmate",
|
|
4153
4156
|
license: "MIT",
|
|
4154
4157
|
repository: "git+https://github.com/keenmate/web-daterangepicker.git",
|
|
@@ -4163,7 +4166,7 @@ typeof window < "u" && (window.components = window.components || {}, window.comp
|
|
|
4163
4166
|
disableLogging: mt,
|
|
4164
4167
|
setLogLevel: We,
|
|
4165
4168
|
setCategoryLevel: ua,
|
|
4166
|
-
getCategories:
|
|
4169
|
+
getCategories: ha
|
|
4167
4170
|
}
|
|
4168
4171
|
}, window.components["web-daterangepicker"].register());
|
|
4169
4172
|
export {
|