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