@nysds/nys-datepicker 1.16.1 → 1.17.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/dist/nys-datepicker.js +167 -162
- package/dist/nys-datepicker.js.map +1 -1
- package/package.json +5 -5
package/dist/nys-datepicker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement as
|
|
1
|
+
import { LitElement as ne, unsafeCSS as je, html as I } from "lit";
|
|
2
2
|
import { property as g, state as He } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined as M } from "lit/directives/if-defined.js";
|
|
4
4
|
/*!
|
|
@@ -6,7 +6,7 @@ import { ifDefined as M } from "lit/directives/if-defined.js";
|
|
|
6
6
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
7
7
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
8
8
|
*
|
|
9
|
-
* Datepicker Component v1.
|
|
9
|
+
* Datepicker Component v1.17.0
|
|
10
10
|
* Part of the New York State Design System
|
|
11
11
|
* Repository: https://github.com/its-hcd/nysds
|
|
12
12
|
* License: MIT
|
|
@@ -103,13 +103,13 @@ function Je(t) {
|
|
|
103
103
|
return (s = (a = (e = t.head) === null || e === void 0 ? void 0 : e.querySelector('meta[name="csp-nonce"]')) === null || a === void 0 ? void 0 : a.getAttribute("content")) !== null && s !== void 0 ? s : void 0;
|
|
104
104
|
}
|
|
105
105
|
const h = (t, e, ...a) => {
|
|
106
|
-
let s = null, r = null,
|
|
106
|
+
let s = null, r = null, i = null, n = !1, o = !1;
|
|
107
107
|
const c = [], l = (d) => {
|
|
108
108
|
for (let p = 0; p < d.length; p++)
|
|
109
|
-
s = d[p], Array.isArray(s) ? l(s) : s != null && typeof s != "boolean" && ((
|
|
109
|
+
s = d[p], Array.isArray(s) ? l(s) : s != null && typeof s != "boolean" && ((n = typeof t != "function" && !re(s)) && (s = String(s)), n && o ? c[c.length - 1].$text$ += s : c.push(n ? j(null, s) : s), o = n);
|
|
110
110
|
};
|
|
111
111
|
if (l(a), e) {
|
|
112
|
-
e.key && (r = e.key), e.name && (
|
|
112
|
+
e.key && (r = e.key), e.name && (i = e.name);
|
|
113
113
|
{
|
|
114
114
|
const d = e.className || e.class;
|
|
115
115
|
d && (e.class = typeof d != "object" ? d : Object.keys(d).filter((p) => d[p]).join(" "));
|
|
@@ -118,7 +118,7 @@ const h = (t, e, ...a) => {
|
|
|
118
118
|
if (typeof t == "function")
|
|
119
119
|
return t(e === null ? {} : e, c, Ve);
|
|
120
120
|
const u = j(t, null);
|
|
121
|
-
return u.$attrs$ = e, c.length > 0 && (u.$children$ = c), u.$key$ = r, u.$name$ =
|
|
121
|
+
return u.$attrs$ = e, c.length > 0 && (u.$children$ = c), u.$key$ = r, u.$name$ = i, u;
|
|
122
122
|
}, j = (t, e) => {
|
|
123
123
|
const a = {
|
|
124
124
|
$flags$: 0,
|
|
@@ -158,33 +158,33 @@ const h = (t, e, ...a) => {
|
|
|
158
158
|
}, rt = (t, e, a) => {
|
|
159
159
|
const s = b.ce(e, a);
|
|
160
160
|
return t.dispatchEvent(s), s;
|
|
161
|
-
}, he = /* @__PURE__ */ new WeakMap(),
|
|
161
|
+
}, he = /* @__PURE__ */ new WeakMap(), it = (t, e, a) => {
|
|
162
162
|
let s = K.get(t);
|
|
163
163
|
Ot && a ? (s = s || new CSSStyleSheet(), typeof s == "string" ? s = e : s.replaceSync(e)) : s = e, K.set(t, s);
|
|
164
|
-
},
|
|
164
|
+
}, nt = (t, e, a, s) => {
|
|
165
165
|
var r;
|
|
166
|
-
let
|
|
167
|
-
const
|
|
168
|
-
if (t = t.nodeType === 11 ? t : w,
|
|
169
|
-
if (typeof
|
|
166
|
+
let i = Se(e, a);
|
|
167
|
+
const n = K.get(i);
|
|
168
|
+
if (t = t.nodeType === 11 ? t : w, n)
|
|
169
|
+
if (typeof n == "string") {
|
|
170
170
|
t = t.head || t;
|
|
171
171
|
let o = he.get(t), c;
|
|
172
|
-
if (o || he.set(t, o = /* @__PURE__ */ new Set()), !o.has(
|
|
172
|
+
if (o || he.set(t, o = /* @__PURE__ */ new Set()), !o.has(i)) {
|
|
173
173
|
{
|
|
174
|
-
c = w.createElement("style"), c.innerHTML =
|
|
174
|
+
c = w.createElement("style"), c.innerHTML = n;
|
|
175
175
|
const l = (r = b.$nonce$) !== null && r !== void 0 ? r : Je(w);
|
|
176
176
|
l != null && c.setAttribute("nonce", l), t.insertBefore(c, t.querySelector("link"));
|
|
177
177
|
}
|
|
178
|
-
o && o.add(
|
|
178
|
+
o && o.add(i);
|
|
179
179
|
}
|
|
180
|
-
} else t.adoptedStyleSheets.includes(
|
|
181
|
-
return
|
|
180
|
+
} else t.adoptedStyleSheets.includes(n) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, n]);
|
|
181
|
+
return i;
|
|
182
182
|
}, ot = (t) => {
|
|
183
|
-
const e = t.$cmpMeta$, a = t.$hostElement$, s = e.$flags$, r = T("attachStyles", e.$tagName$),
|
|
184
|
-
s & 10 && (a["s-sc"] =
|
|
185
|
-
}, Se = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), pe = (t, e, a, s, r,
|
|
183
|
+
const e = t.$cmpMeta$, a = t.$hostElement$, s = e.$flags$, r = T("attachStyles", e.$tagName$), i = nt(a.shadowRoot ? a.shadowRoot : a.getRootNode(), e, t.$modeName$);
|
|
184
|
+
s & 10 && (a["s-sc"] = i, a.classList.add(i + "-h"), s & 2 && a.classList.add(i + "-s")), r();
|
|
185
|
+
}, Se = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), pe = (t, e, a, s, r, i) => {
|
|
186
186
|
if (a !== s) {
|
|
187
|
-
let
|
|
187
|
+
let n = ve(t, e), o = e.toLowerCase();
|
|
188
188
|
if (e === "class") {
|
|
189
189
|
const c = t.classList, l = fe(a), u = fe(s);
|
|
190
190
|
c.remove(...l.filter((d) => d && !u.includes(d))), c.add(...u.filter((d) => d && !l.includes(d)));
|
|
@@ -197,32 +197,32 @@ const h = (t, e, ...a) => {
|
|
|
197
197
|
if (e === "ref")
|
|
198
198
|
s && s(t);
|
|
199
199
|
else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n")
|
|
200
|
-
e[2] === "-" ? e = e.slice(3) :
|
|
200
|
+
e[2] === "-" ? e = e.slice(3) : ve(Z, o) ? e = o.slice(2) : e = o[2] + e.slice(3), a && b.rel(t, e, a, !1), s && b.ael(t, e, s, !1);
|
|
201
201
|
else {
|
|
202
202
|
const c = re(s);
|
|
203
|
-
if ((
|
|
203
|
+
if ((n || c && s !== null) && !r)
|
|
204
204
|
try {
|
|
205
205
|
if (t.tagName.includes("-"))
|
|
206
206
|
t[e] = s;
|
|
207
207
|
else {
|
|
208
208
|
const u = s ?? "";
|
|
209
|
-
e === "list" ?
|
|
209
|
+
e === "list" ? n = !1 : (a == null || t[e] != u) && (t[e] = u);
|
|
210
210
|
}
|
|
211
211
|
} catch {
|
|
212
212
|
}
|
|
213
213
|
let l = !1;
|
|
214
|
-
o !== (o = o.replace(/^xlink\:?/, "")) && (e = o, l = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (l ? t.removeAttributeNS(ce, e) : t.removeAttribute(e)) : (!
|
|
214
|
+
o !== (o = o.replace(/^xlink\:?/, "")) && (e = o, l = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (l ? t.removeAttributeNS(ce, e) : t.removeAttribute(e)) : (!n || i & 4 || r) && !c && (s = s === !0 ? "" : s, l ? t.setAttributeNS(ce, e, s) : t.setAttribute(e, s));
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}, ct = /\s/, fe = (t) => t ? t.split(ct) : [], Me = (t, e, a, s) => {
|
|
218
|
-
const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$,
|
|
219
|
-
for (s in n)
|
|
220
|
-
s in i || pe(r, s, n[s], void 0, a, e.$flags$);
|
|
218
|
+
const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, i = t && t.$attrs$ || le, n = e.$attrs$ || le;
|
|
221
219
|
for (s in i)
|
|
222
|
-
pe(r, s,
|
|
220
|
+
s in n || pe(r, s, i[s], void 0, a, e.$flags$);
|
|
221
|
+
for (s in n)
|
|
222
|
+
pe(r, s, i[s], n[s], a, e.$flags$);
|
|
223
223
|
}, H = (t, e, a, s) => {
|
|
224
224
|
const r = e.$children$[a];
|
|
225
|
-
let
|
|
225
|
+
let i = 0, n, o, c;
|
|
226
226
|
if (De || (se = !0, r.$tag$ === "slot" && (O && s.classList.add(O + "-s"), r.$flags$ |= r.$children$ ? (
|
|
227
227
|
// slot element has fallback content
|
|
228
228
|
2
|
|
@@ -230,76 +230,76 @@ const h = (t, e, ...a) => {
|
|
|
230
230
|
// slot element does not have fallback content
|
|
231
231
|
1
|
|
232
232
|
))), r.$text$ !== null)
|
|
233
|
-
|
|
233
|
+
n = r.$elm$ = w.createTextNode(r.$text$);
|
|
234
234
|
else if (r.$flags$ & 1)
|
|
235
|
-
|
|
235
|
+
n = r.$elm$ = w.createTextNode("");
|
|
236
236
|
else {
|
|
237
|
-
if ($ || ($ = r.$tag$ === "svg"),
|
|
238
|
-
for (
|
|
239
|
-
o = H(t, r,
|
|
240
|
-
r.$tag$ === "svg" ? $ = !1 :
|
|
237
|
+
if ($ || ($ = r.$tag$ === "svg"), n = r.$elm$ = w.createElementNS($ ? Qe : Ge, r.$flags$ & 2 ? "slot-fb" : r.$tag$), $ && r.$tag$ === "foreignObject" && ($ = !1), Me(null, r, $), Xe(O) && n["s-si"] !== O && n.classList.add(n["s-si"] = O), r.$children$)
|
|
238
|
+
for (i = 0; i < r.$children$.length; ++i)
|
|
239
|
+
o = H(t, r, i, n), o && n.appendChild(o);
|
|
240
|
+
r.$tag$ === "svg" ? $ = !1 : n.tagName === "foreignObject" && ($ = !0);
|
|
241
241
|
}
|
|
242
|
-
return
|
|
242
|
+
return n["s-hn"] = X, r.$flags$ & 3 && (n["s-sr"] = !0, n["s-cr"] = we, n["s-sn"] = r.$name$ || "", c = t && t.$children$ && t.$children$[a], c && c.$tag$ === r.$tag$ && t.$elm$ && q(t.$elm$, !1)), n;
|
|
243
243
|
}, q = (t, e) => {
|
|
244
244
|
b.$flags$ |= 1;
|
|
245
245
|
const a = t.childNodes;
|
|
246
246
|
for (let s = a.length - 1; s >= 0; s--) {
|
|
247
247
|
const r = a[s];
|
|
248
|
-
r["s-hn"] !== X && r["s-ol"] && (Le(r).insertBefore(r,
|
|
248
|
+
r["s-hn"] !== X && r["s-ol"] && (Le(r).insertBefore(r, ie(r)), r["s-ol"].remove(), r["s-ol"] = void 0, se = !0), e && q(r, e);
|
|
249
249
|
}
|
|
250
250
|
b.$flags$ &= -2;
|
|
251
|
-
}, Ce = (t, e, a, s, r,
|
|
252
|
-
let
|
|
253
|
-
for (
|
|
254
|
-
s[r] && (o = H(null, a, r, t), o && (s[r].$elm$ = o,
|
|
251
|
+
}, Ce = (t, e, a, s, r, i) => {
|
|
252
|
+
let n = t["s-cr"] && t["s-cr"].parentNode || t, o;
|
|
253
|
+
for (n.shadowRoot && n.tagName === X && (n = n.shadowRoot); r <= i; ++r)
|
|
254
|
+
s[r] && (o = H(null, a, r, t), o && (s[r].$elm$ = o, n.insertBefore(o, ie(e))));
|
|
255
255
|
}, Te = (t, e, a, s, r) => {
|
|
256
256
|
for (; e <= a; ++e)
|
|
257
257
|
(s = t[e]) && (r = s.$elm$, Oe(s), z = !0, r["s-ol"] ? r["s-ol"].remove() : q(r, !0), r.remove());
|
|
258
258
|
}, lt = (t, e, a, s) => {
|
|
259
|
-
let r = 0,
|
|
260
|
-
for (; r <= c &&
|
|
259
|
+
let r = 0, i = 0, n = 0, o = 0, c = e.length - 1, l = e[0], u = e[c], d = s.length - 1, p = s[0], v = s[d], _, S;
|
|
260
|
+
for (; r <= c && i <= d; )
|
|
261
261
|
if (l == null)
|
|
262
262
|
l = e[++r];
|
|
263
263
|
else if (u == null)
|
|
264
264
|
u = e[--c];
|
|
265
265
|
else if (p == null)
|
|
266
|
-
p = s[++
|
|
267
|
-
else if (
|
|
268
|
-
|
|
266
|
+
p = s[++i];
|
|
267
|
+
else if (v == null)
|
|
268
|
+
v = s[--d];
|
|
269
269
|
else if (P(l, p))
|
|
270
|
-
R(l, p), l = e[++r], p = s[++
|
|
271
|
-
else if (P(u,
|
|
272
|
-
R(u,
|
|
273
|
-
else if (P(l,
|
|
274
|
-
(l.$tag$ === "slot" ||
|
|
270
|
+
R(l, p), l = e[++r], p = s[++i];
|
|
271
|
+
else if (P(u, v))
|
|
272
|
+
R(u, v), u = e[--c], v = s[--d];
|
|
273
|
+
else if (P(l, v))
|
|
274
|
+
(l.$tag$ === "slot" || v.$tag$ === "slot") && q(l.$elm$.parentNode, !1), R(l, v), t.insertBefore(l.$elm$, u.$elm$.nextSibling), l = e[++r], v = s[--d];
|
|
275
275
|
else if (P(u, p))
|
|
276
|
-
(l.$tag$ === "slot" ||
|
|
276
|
+
(l.$tag$ === "slot" || v.$tag$ === "slot") && q(u.$elm$.parentNode, !1), R(u, p), t.insertBefore(u.$elm$, l.$elm$), u = e[--c], p = s[++i];
|
|
277
277
|
else {
|
|
278
|
-
for (
|
|
278
|
+
for (n = -1, o = r; o <= c; ++o)
|
|
279
279
|
if (e[o] && e[o].$key$ !== null && e[o].$key$ === p.$key$) {
|
|
280
|
-
|
|
280
|
+
n = o;
|
|
281
281
|
break;
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
n >= 0 ? (S = e[n], S.$tag$ !== p.$tag$ ? _ = H(e && e[i], a, n, t) : (R(S, p), e[n] = void 0, _ = S.$elm$), p = s[++i]) : (_ = H(e && e[i], a, i, t), p = s[++i]), _ && Le(l.$elm$).insertBefore(_, ie(l.$elm$));
|
|
284
284
|
}
|
|
285
|
-
r > c ? Ce(t, s[d + 1] == null ? null : s[d + 1].$elm$, a, s,
|
|
286
|
-
}, P = (t, e) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : t.$key$ === e.$key$ : !1,
|
|
287
|
-
const a = e.$elm$ = t.$elm$, s = t.$children$, r = e.$children$,
|
|
285
|
+
r > c ? Ce(t, s[d + 1] == null ? null : s[d + 1].$elm$, a, s, i, d) : i > d && Te(e, r, c);
|
|
286
|
+
}, P = (t, e) => t.$tag$ === e.$tag$ ? t.$tag$ === "slot" ? t.$name$ === e.$name$ : t.$key$ === e.$key$ : !1, ie = (t) => t && t["s-ol"] || t, Le = (t) => (t["s-ol"] ? t["s-ol"] : t).parentNode, R = (t, e) => {
|
|
287
|
+
const a = e.$elm$ = t.$elm$, s = t.$children$, r = e.$children$, i = e.$tag$, n = e.$text$;
|
|
288
288
|
let o;
|
|
289
|
-
|
|
289
|
+
n === null ? ($ = i === "svg" ? !0 : i === "foreignObject" ? !1 : $, i === "slot" || Me(t, e, $), s !== null && r !== null ? lt(a, s, e, r) : r !== null ? (t.$text$ !== null && (a.textContent = ""), Ce(a, null, e, r, 0, r.length - 1)) : s !== null && Te(s, 0, s.length - 1), $ && i === "svg" && ($ = !1)) : (o = a["s-cr"]) ? o.parentNode.textContent = n : t.$text$ !== n && (a.data = n);
|
|
290
290
|
}, Ee = (t) => {
|
|
291
291
|
const e = t.childNodes;
|
|
292
|
-
let a, s, r,
|
|
292
|
+
let a, s, r, i, n, o;
|
|
293
293
|
for (s = 0, r = e.length; s < r; s++)
|
|
294
294
|
if (a = e[s], a.nodeType === 1) {
|
|
295
295
|
if (a["s-sr"]) {
|
|
296
|
-
for (
|
|
297
|
-
if (o = e[
|
|
298
|
-
if (o === 1 &&
|
|
296
|
+
for (n = a["s-sn"], a.hidden = !1, i = 0; i < r; i++)
|
|
297
|
+
if (o = e[i].nodeType, e[i]["s-hn"] !== a["s-hn"] || n !== "") {
|
|
298
|
+
if (o === 1 && n === e[i].getAttribute("slot")) {
|
|
299
299
|
a.hidden = !0;
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
|
-
} else if (o === 1 || o === 3 && e[
|
|
302
|
+
} else if (o === 1 || o === 3 && e[i].textContent.trim() !== "") {
|
|
303
303
|
a.hidden = !0;
|
|
304
304
|
break;
|
|
305
305
|
}
|
|
@@ -307,16 +307,16 @@ const h = (t, e, ...a) => {
|
|
|
307
307
|
Ee(a);
|
|
308
308
|
}
|
|
309
309
|
}, m = [], Be = (t) => {
|
|
310
|
-
let e, a, s, r,
|
|
310
|
+
let e, a, s, r, i, n, o = 0;
|
|
311
311
|
const c = t.childNodes, l = c.length;
|
|
312
312
|
for (; o < l; o++) {
|
|
313
313
|
if (e = c[o], e["s-sr"] && (a = e["s-cr"]) && a.parentNode)
|
|
314
|
-
for (s = a.parentNode.childNodes, r = e["s-sn"],
|
|
315
|
-
a = s[
|
|
314
|
+
for (s = a.parentNode.childNodes, r = e["s-sn"], n = s.length - 1; n >= 0; n--)
|
|
315
|
+
a = s[n], !a["s-cn"] && !a["s-nr"] && a["s-hn"] !== e["s-hn"] && (ye(a, r) ? (i = m.find((u) => u.$nodeToRelocate$ === a), z = !0, a["s-sn"] = a["s-sn"] || r, i ? i.$slotRefNode$ = e : m.push({
|
|
316
316
|
$slotRefNode$: e,
|
|
317
317
|
$nodeToRelocate$: a
|
|
318
318
|
}), a["s-sr"] && m.map((u) => {
|
|
319
|
-
ye(u.$nodeToRelocate$, a["s-sn"]) && (
|
|
319
|
+
ye(u.$nodeToRelocate$, a["s-sn"]) && (i = m.find((d) => d.$nodeToRelocate$ === a), i && !u.$slotRefNode$ && (u.$slotRefNode$ = i.$slotRefNode$));
|
|
320
320
|
})) : m.some((u) => u.$nodeToRelocate$ === a) || m.push({
|
|
321
321
|
$nodeToRelocate$: a
|
|
322
322
|
}));
|
|
@@ -325,17 +325,17 @@ const h = (t, e, ...a) => {
|
|
|
325
325
|
}, ye = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", Oe = (t) => {
|
|
326
326
|
t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(Oe);
|
|
327
327
|
}, dt = (t, e) => {
|
|
328
|
-
const a = t.$hostElement$, s = t.$cmpMeta$, r = t.$vnode$ || j(null, null),
|
|
329
|
-
X = a.tagName, s.$attrsToReflect$ && (
|
|
328
|
+
const a = t.$hostElement$, s = t.$cmpMeta$, r = t.$vnode$ || j(null, null), i = Ze(e) ? e : h(null, null, e);
|
|
329
|
+
X = a.tagName, s.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, s.$attrsToReflect$.map(([n, o]) => i.$attrs$[o] = a[n])), i.$tag$ = null, i.$flags$ |= 4, t.$vnode$ = i, i.$elm$ = r.$elm$ = a.shadowRoot || a, O = a["s-sc"], we = a["s-cr"], De = (s.$flags$ & 1) !== 0, z = !1, R(r, i);
|
|
330
330
|
{
|
|
331
331
|
if (b.$flags$ |= 1, se) {
|
|
332
|
-
Be(
|
|
333
|
-
let
|
|
332
|
+
Be(i.$elm$);
|
|
333
|
+
let n, o, c, l, u, d, p = 0;
|
|
334
334
|
for (; p < m.length; p++)
|
|
335
|
-
|
|
335
|
+
n = m[p], o = n.$nodeToRelocate$, o["s-ol"] || (c = w.createTextNode(""), c["s-nr"] = o, o.parentNode.insertBefore(o["s-ol"] = c, o));
|
|
336
336
|
for (p = 0; p < m.length; p++)
|
|
337
|
-
if (
|
|
338
|
-
for (l =
|
|
337
|
+
if (n = m[p], o = n.$nodeToRelocate$, n.$slotRefNode$) {
|
|
338
|
+
for (l = n.$slotRefNode$.parentNode, u = n.$slotRefNode$.nextSibling, c = o["s-ol"]; c = c.previousSibling; )
|
|
339
339
|
if (d = c["s-nr"], d && d["s-sn"] === o["s-sn"] && l === d.parentNode && (d = d.nextSibling, !d || !d["s-nr"])) {
|
|
340
340
|
u = d;
|
|
341
341
|
break;
|
|
@@ -344,18 +344,18 @@ const h = (t, e, ...a) => {
|
|
|
344
344
|
} else
|
|
345
345
|
o.nodeType === 1 && (o.hidden = !0);
|
|
346
346
|
}
|
|
347
|
-
z && Ee(
|
|
347
|
+
z && Ee(i.$elm$), b.$flags$ &= -2, m.length = 0;
|
|
348
348
|
}
|
|
349
349
|
}, ut = (t, e) => {
|
|
350
350
|
}, Re = (t, e) => (t.$flags$ |= 16, ut(t, t.$ancestorComponent$), It(() => ht(t, e))), ht = (t, e) => {
|
|
351
351
|
const a = t.$hostElement$, s = T("scheduleUpdate", t.$cmpMeta$.$tagName$), r = a;
|
|
352
|
-
let
|
|
353
|
-
return e ?
|
|
352
|
+
let i;
|
|
353
|
+
return e ? i = N(r, "componentWillLoad") : i = N(r, "componentWillUpdate"), i = ge(i, () => N(r, "componentWillRender")), s(), ge(i, () => pt(t, r, e));
|
|
354
354
|
}, pt = async (t, e, a) => {
|
|
355
355
|
const s = t.$hostElement$, r = T("update", t.$cmpMeta$.$tagName$);
|
|
356
356
|
s["s-rc"], a && ot(t);
|
|
357
|
-
const
|
|
358
|
-
ft(t, e, s),
|
|
357
|
+
const i = T("render", t.$cmpMeta$.$tagName$);
|
|
358
|
+
ft(t, e, s), i(), r(), yt(t);
|
|
359
359
|
}, ft = (t, e, a) => {
|
|
360
360
|
try {
|
|
361
361
|
oe = e, e = e.render && e.render(), t.$flags$ &= -17, t.$flags$ |= 2, (B.hasRenderFn || B.reflect) && (B.vdomRender || B.reflect) && (B.hydrateServerSide || dt(t, e));
|
|
@@ -373,51 +373,51 @@ const h = (t, e, ...a) => {
|
|
|
373
373
|
} catch (s) {
|
|
374
374
|
Y(s);
|
|
375
375
|
}
|
|
376
|
-
}, ge = (t, e) => t && t.then ? t.then(e) : e(), gt = (t, e) => J(t).$instanceValues$.get(e),
|
|
377
|
-
const r = J(t),
|
|
376
|
+
}, ge = (t, e) => t && t.then ? t.then(e) : e(), gt = (t, e) => J(t).$instanceValues$.get(e), vt = (t, e, a, s) => {
|
|
377
|
+
const r = J(t), i = t, n = r.$instanceValues$.get(e), o = r.$flags$, c = i;
|
|
378
378
|
a = at(a, s.$members$[e][0]);
|
|
379
|
-
const l = Number.isNaN(
|
|
380
|
-
if (a !==
|
|
379
|
+
const l = Number.isNaN(n) && Number.isNaN(a);
|
|
380
|
+
if (a !== n && !l) {
|
|
381
381
|
r.$instanceValues$.set(e, a);
|
|
382
382
|
{
|
|
383
383
|
if (s.$watchers$ && o & 128) {
|
|
384
384
|
const d = s.$watchers$[e];
|
|
385
385
|
d && d.map((p) => {
|
|
386
386
|
try {
|
|
387
|
-
c[p](a,
|
|
388
|
-
} catch (
|
|
389
|
-
Y(
|
|
387
|
+
c[p](a, n, e);
|
|
388
|
+
} catch (v) {
|
|
389
|
+
Y(v, i);
|
|
390
390
|
}
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
if ((o & 18) === 2) {
|
|
394
|
-
if (c.componentShouldUpdate && c.componentShouldUpdate(a,
|
|
394
|
+
if (c.componentShouldUpdate && c.componentShouldUpdate(a, n, e) === !1)
|
|
395
395
|
return;
|
|
396
396
|
Re(r, !1);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
},
|
|
400
|
+
}, kt = (t, e, a) => {
|
|
401
401
|
if (e.$members$) {
|
|
402
402
|
t.watchers && (e.$watchers$ = t.watchers);
|
|
403
403
|
const s = Object.entries(e.$members$), r = t.prototype;
|
|
404
|
-
s.map(([
|
|
405
|
-
(
|
|
404
|
+
s.map(([i, [n]]) => {
|
|
405
|
+
(n & 31 || n & 32) && Object.defineProperty(r, i, {
|
|
406
406
|
get() {
|
|
407
|
-
return gt(this,
|
|
407
|
+
return gt(this, i);
|
|
408
408
|
},
|
|
409
409
|
set(o) {
|
|
410
|
-
|
|
410
|
+
vt(this, i, o, e);
|
|
411
411
|
},
|
|
412
412
|
configurable: !0,
|
|
413
413
|
enumerable: !0
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
{
|
|
417
|
-
const
|
|
418
|
-
r.attributeChangedCallback = function(
|
|
417
|
+
const i = /* @__PURE__ */ new Map();
|
|
418
|
+
r.attributeChangedCallback = function(n, o, c) {
|
|
419
419
|
b.jmp(() => {
|
|
420
|
-
const l =
|
|
420
|
+
const l = i.get(n);
|
|
421
421
|
if (this.hasOwnProperty(l))
|
|
422
422
|
c = this[l], delete this[l];
|
|
423
423
|
else if (r.hasOwnProperty(l) && typeof this[l] == "number" && this[l] == c)
|
|
@@ -425,23 +425,23 @@ const h = (t, e, ...a) => {
|
|
|
425
425
|
this[l] = c === null && typeof this[l] == "boolean" ? !1 : c;
|
|
426
426
|
});
|
|
427
427
|
}, t.observedAttributes = s.filter(
|
|
428
|
-
([
|
|
428
|
+
([n, o]) => o[0] & 15
|
|
429
429
|
/* MEMBER_FLAGS.HasAttribute */
|
|
430
|
-
).map(([
|
|
431
|
-
const c = o[1] ||
|
|
432
|
-
return
|
|
430
|
+
).map(([n, o]) => {
|
|
431
|
+
const c = o[1] || n;
|
|
432
|
+
return i.set(c, n), o[0] & 512 && e.$attrsToReflect$.push([n, c]), c;
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
return t;
|
|
437
437
|
}, bt = async (t, e, a, s, r) => {
|
|
438
438
|
if ((e.$flags$ & 32) === 0 && (r = t.constructor, e.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then(() => e.$flags$ |= 128), r.style)) {
|
|
439
|
-
let
|
|
440
|
-
typeof
|
|
439
|
+
let n = r.style;
|
|
440
|
+
typeof n != "string" && (n = n[e.$modeName$ = tt(t)]);
|
|
441
441
|
const o = Se(a, e.$modeName$);
|
|
442
442
|
if (!K.has(o)) {
|
|
443
443
|
const c = T("registerStyles", a.$tagName$);
|
|
444
|
-
|
|
444
|
+
it(o, n, !!(a.$flags$ & 1)), c();
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
e.$ancestorComponent$, Re(e, !0);
|
|
@@ -449,10 +449,10 @@ const h = (t, e, ...a) => {
|
|
|
449
449
|
}, _t = (t) => {
|
|
450
450
|
if ((b.$flags$ & 1) === 0) {
|
|
451
451
|
const e = J(t), a = e.$cmpMeta$, s = T("connectedCallback", a.$tagName$);
|
|
452
|
-
e.$flags$ & 1 ? (Ne(t, e, a.$listeners$), $t(e.$lazyInstance$)) : (e.$flags$ |= 1, a.$flags$ & 12 && mt(t), a.$members$ && Object.entries(a.$members$).map(([r, [
|
|
453
|
-
if (
|
|
454
|
-
const
|
|
455
|
-
delete t[r], t[r] =
|
|
452
|
+
e.$flags$ & 1 ? (Ne(t, e, a.$listeners$), $t(e.$lazyInstance$)) : (e.$flags$ |= 1, a.$flags$ & 12 && mt(t), a.$members$ && Object.entries(a.$members$).map(([r, [i]]) => {
|
|
453
|
+
if (i & 31 && t.hasOwnProperty(r)) {
|
|
454
|
+
const n = t[r];
|
|
455
|
+
delete t[r], t[r] = n;
|
|
456
456
|
}
|
|
457
457
|
}), bt(t, e, a)), s();
|
|
458
458
|
}
|
|
@@ -487,11 +487,11 @@ const h = (t, e, ...a) => {
|
|
|
487
487
|
delegatesFocus: !!(a.$flags$ & 16)
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
}), t.is = a.$tagName$,
|
|
490
|
+
}), t.is = a.$tagName$, kt(t, a);
|
|
491
491
|
}, Ne = (t, e, a, s) => {
|
|
492
|
-
a && a.map(([r,
|
|
493
|
-
const o = St(t, r), c = xt(e,
|
|
494
|
-
b.ael(o,
|
|
492
|
+
a && a.map(([r, i, n]) => {
|
|
493
|
+
const o = St(t, r), c = xt(e, n), l = Mt(r);
|
|
494
|
+
b.ael(o, i, c, l), (e.$rmListeners$ = e.$rmListeners$ || []).push(() => b.rel(o, i, c, l));
|
|
495
495
|
});
|
|
496
496
|
}, xt = (t, e) => (a) => {
|
|
497
497
|
try {
|
|
@@ -510,7 +510,7 @@ const h = (t, e, ...a) => {
|
|
|
510
510
|
$instanceValues$: /* @__PURE__ */ new Map()
|
|
511
511
|
};
|
|
512
512
|
return Ne(t, a, e.$listeners$), Ie.set(t, a);
|
|
513
|
-
},
|
|
513
|
+
}, ve = (t, e) => e in t, Y = (t, e) => (0, console.error)(t, e), K = /* @__PURE__ */ new Map(), Tt = [], Z = typeof window < "u" ? window : {}, w = Z.document || { head: {} }, Lt = Z.HTMLElement || class {
|
|
514
514
|
}, b = {
|
|
515
515
|
$flags$: 0,
|
|
516
516
|
$resourcesUrl$: "",
|
|
@@ -536,7 +536,7 @@ const h = (t, e, ...a) => {
|
|
|
536
536
|
} catch {
|
|
537
537
|
}
|
|
538
538
|
return !1;
|
|
539
|
-
})(),
|
|
539
|
+
})(), ke = [], Fe = [], Rt = (t, e) => (a) => {
|
|
540
540
|
t.push(a), te || (te = !0, e && b.$flags$ & 4 ? Nt(ae) : b.raf(ae));
|
|
541
541
|
}, be = (t) => {
|
|
542
542
|
for (let e = 0; e < t.length; e++)
|
|
@@ -547,20 +547,20 @@ const h = (t, e, ...a) => {
|
|
|
547
547
|
}
|
|
548
548
|
t.length = 0;
|
|
549
549
|
}, ae = () => {
|
|
550
|
-
be(
|
|
550
|
+
be(ke), be(Fe), (te = ke.length > 0) && b.raf(ae);
|
|
551
551
|
}, Nt = (t) => Bt().then(t), It = /* @__PURE__ */ Rt(Fe, !0);
|
|
552
552
|
function U(t, e) {
|
|
553
553
|
const a = new Date(t);
|
|
554
554
|
return a.setDate(a.getDate() + e), a;
|
|
555
555
|
}
|
|
556
556
|
function Ft(t, e, a) {
|
|
557
|
-
const s = [], r = Q(t),
|
|
557
|
+
const s = [], r = Q(t), i = r.getDay() === 0 ? 7 : r.getDay(), n = F(t), o = n.getDay() === 0 ? 7 : n.getDay(), c = a === 1 ? 7 : a - 1, l = [], u = [];
|
|
558
558
|
{
|
|
559
|
-
let
|
|
560
|
-
for (;
|
|
561
|
-
l.push(_), _ = G(_),
|
|
559
|
+
let v = (7 - a + i) % 7, _ = G(r);
|
|
560
|
+
for (; v > 0; )
|
|
561
|
+
l.push(_), _ = G(_), v -= 1;
|
|
562
562
|
l.reverse();
|
|
563
|
-
let L = (7 - o + c) % 7, E = A(
|
|
563
|
+
let L = (7 - o + c) % 7, E = A(n);
|
|
564
564
|
for (; L > 0; )
|
|
565
565
|
u.push(E), E = A(E), L -= 1;
|
|
566
566
|
}
|
|
@@ -570,7 +570,7 @@ function Ft(t, e, a) {
|
|
|
570
570
|
return [...l, ...s, ...u];
|
|
571
571
|
}
|
|
572
572
|
function Q(t) {
|
|
573
|
-
return
|
|
573
|
+
return k(/* @__PURE__ */ new Date(`${String(qe(t)).padStart(4, "0")}-${String(Ae(t)).padStart(2, "0")}-01`));
|
|
574
574
|
}
|
|
575
575
|
function C(t) {
|
|
576
576
|
if (t instanceof Date)
|
|
@@ -585,7 +585,7 @@ function Ae(t) {
|
|
|
585
585
|
}
|
|
586
586
|
function At(t) {
|
|
587
587
|
return new Array(12).fill(void 0).map((e, a) => {
|
|
588
|
-
const s =
|
|
588
|
+
const s = k(/* @__PURE__ */ new Date(`2006-${String(a + 1).padStart(2, "0")}-01`));
|
|
589
589
|
return Intl.DateTimeFormat(t, {
|
|
590
590
|
month: "long"
|
|
591
591
|
}).format(s);
|
|
@@ -615,7 +615,7 @@ function _e(t) {
|
|
|
615
615
|
}
|
|
616
616
|
function qt(t, e) {
|
|
617
617
|
return new Array(7).fill(void 0).map((a, s) => (t + s) % 7 + 1).map((a) => {
|
|
618
|
-
const s =
|
|
618
|
+
const s = k(/* @__PURE__ */ new Date(`2006-01-0${a}`));
|
|
619
619
|
return [
|
|
620
620
|
Intl.DateTimeFormat(e, {
|
|
621
621
|
weekday: "short"
|
|
@@ -638,7 +638,7 @@ function me(t, e) {
|
|
|
638
638
|
function D(t, e) {
|
|
639
639
|
return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function k(t) {
|
|
642
642
|
const e = new Date(t);
|
|
643
643
|
return e.setMinutes(e.getMinutes() + e.getTimezoneOffset()), e;
|
|
644
644
|
}
|
|
@@ -659,7 +659,7 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
659
659
|
}, Ut = /* @__PURE__ */ Dt(class extends Lt {
|
|
660
660
|
constructor() {
|
|
661
661
|
super(), this.__registerHost(), this.selectDate = ue(this, "selectDate"), this.changeMonth = ue(this, "changeMonth"), this.disabled = !1, this.disableDate = () => !1, this.elementClassName = "wc-datepicker", this.firstDayOfWeek = 0, this.goToRangeStartOnSelect = !0, this.labels = Pt, this.locale = navigator?.language || "en-US", this.maxSearchDays = 365, this.showClearButton = !1, this.showMonthStepper = !0, this.showTodayButton = !1, this.showYearStepper = !1, this.startDate = C(/* @__PURE__ */ new Date()), this.pendingClick = !1, this.init = () => {
|
|
662
|
-
this.currentDate = this.startDate ?
|
|
662
|
+
this.currentDate = this.startDate ? k(new Date(this.startDate)) : /* @__PURE__ */ new Date(), this.updateWeekdays(), this.handleMinDate(), this.handleMaxDate();
|
|
663
663
|
}, this.getAvailableDate = (t, e) => {
|
|
664
664
|
let a, s = !1;
|
|
665
665
|
switch (e) {
|
|
@@ -756,25 +756,25 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
756
756
|
const e = t.target.closest("[data-date]");
|
|
757
757
|
if (!e)
|
|
758
758
|
return;
|
|
759
|
-
const a =
|
|
759
|
+
const a = k(new Date(e.dataset.date));
|
|
760
760
|
this.isDateDisabled(a) || (this.updateCurrentDate(a), this.onSelectDate(a));
|
|
761
761
|
}, this.onMonthSelect = (t) => {
|
|
762
|
-
const e = +t.target.value - 1, a = this.currentDate.getDate(), s = new Date(this.currentDate.getFullYear(), e, 1), r = F(s).getDate(),
|
|
763
|
-
this.updateCurrentDate(
|
|
762
|
+
const e = +t.target.value - 1, a = this.currentDate.getDate(), s = new Date(this.currentDate.getFullYear(), e, 1), r = F(s).getDate(), i = Math.min(a, r), n = new Date(this.currentDate.getFullYear(), e, i);
|
|
763
|
+
this.updateCurrentDate(n);
|
|
764
764
|
}, this.onYearSelect = (t) => {
|
|
765
765
|
let e = +t.target.value;
|
|
766
766
|
const a = t.target;
|
|
767
767
|
isNaN(e) ? (e = (/* @__PURE__ */ new Date()).getFullYear(), a.value = String(e)) : e < 0 ? (e = 0, a.value = String(e)) : e > 9999 && (e = 9999, a.value = String(e));
|
|
768
|
-
const s = this.currentDate.getDate(), r = this.currentDate.getMonth(),
|
|
769
|
-
|
|
770
|
-
const
|
|
768
|
+
const s = this.currentDate.getDate(), r = this.currentDate.getMonth(), i = /* @__PURE__ */ new Date();
|
|
769
|
+
i.setFullYear(e, r, 1);
|
|
770
|
+
const n = F(i).getDate(), o = Math.min(s, n), c = /* @__PURE__ */ new Date();
|
|
771
771
|
c.setFullYear(e, r, o), this.updateCurrentDate(c);
|
|
772
772
|
}, this.onKeyDown = (t) => {
|
|
773
773
|
this.disabled || (t.code === "ArrowLeft" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousDay"), !0)) : t.code === "ArrowRight" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextDay"), !0)) : t.code === "ArrowUp" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousSameWeekDay"), !0)) : t.code === "ArrowDown" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextSameWeekDay"), !0)) : t.code === "PageUp" ? (t.preventDefault(), t.shiftKey ? this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousYear"), !0) : this.updateCurrentDate(this.getAvailableDate(this.currentDate, "previousMonth"), !0)) : t.code === "PageDown" ? (t.preventDefault(), t.shiftKey ? this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextYear"), !0) : this.updateCurrentDate(this.getAvailableDate(this.currentDate, "nextMonth"), !0)) : t.code === "Home" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "firstOfMonth"), !0)) : t.code === "End" ? (t.preventDefault(), this.updateCurrentDate(this.getAvailableDate(this.currentDate, "lastOfMonth"), !0)) : (t.code === "Space" || t.code === "Enter") && (t.preventDefault(), this.isDateDisabled(this.currentDate) || this.onSelectDate(this.currentDate)));
|
|
774
774
|
}, this.onMouseEnter = (t) => {
|
|
775
775
|
if (this.disabled)
|
|
776
776
|
return;
|
|
777
|
-
const e =
|
|
777
|
+
const e = k(new Date(t.target.closest("td").dataset.date));
|
|
778
778
|
this.hoveredDate = e;
|
|
779
779
|
}, this.onMouseLeave = () => {
|
|
780
780
|
this.hoveredDate = void 0;
|
|
@@ -783,7 +783,7 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
783
783
|
}, this.onFocus = (t) => {
|
|
784
784
|
if (this.pendingClick)
|
|
785
785
|
return;
|
|
786
|
-
const e =
|
|
786
|
+
const e = k(new Date(t.target.dataset.date));
|
|
787
787
|
D(e, this.currentDate) || this.updateCurrentDate(e);
|
|
788
788
|
};
|
|
789
789
|
}
|
|
@@ -800,16 +800,16 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
800
800
|
this.value = void 0, this.selectDate.emit(void 0);
|
|
801
801
|
}
|
|
802
802
|
watchStartDate() {
|
|
803
|
-
this.currentDate = this.startDate ?
|
|
803
|
+
this.currentDate = this.startDate ? k(new Date(this.startDate)) : /* @__PURE__ */ new Date();
|
|
804
804
|
}
|
|
805
805
|
watchValue() {
|
|
806
806
|
this.value && (Array.isArray(this.value) ? this.currentDate = this.value.length > 1 && !this.goToRangeStartOnSelect ? this.value[1] : this.value[0] : this.value instanceof Date && (this.currentDate = this.value));
|
|
807
807
|
}
|
|
808
808
|
handleMinDate() {
|
|
809
|
-
this.minDate && this.currentDate <
|
|
809
|
+
this.minDate && this.currentDate < k(new Date(this.minDate)) && (this.currentDate = k(new Date(this.minDate)));
|
|
810
810
|
}
|
|
811
811
|
handleMaxDate() {
|
|
812
|
-
this.maxDate && this.currentDate >
|
|
812
|
+
this.maxDate && this.currentDate > k(new Date(this.maxDate)) && (this.currentDate = k(new Date(this.maxDate)));
|
|
813
813
|
}
|
|
814
814
|
componentDidRender() {
|
|
815
815
|
this.moveFocusAfterMonthChanged && (this.focusDate(this.currentDate), this.moveFocusAfterMonthChanged = !1);
|
|
@@ -883,19 +883,19 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
883
883
|
get isPreviousMonthDisabled() {
|
|
884
884
|
if (!this.minDate)
|
|
885
885
|
return !1;
|
|
886
|
-
const t = ee(this.currentDate), e =
|
|
886
|
+
const t = ee(this.currentDate), e = k(new Date(this.minDate));
|
|
887
887
|
return F(t) < e;
|
|
888
888
|
}
|
|
889
889
|
get isNextMonthDisabled() {
|
|
890
890
|
if (!this.maxDate)
|
|
891
891
|
return !1;
|
|
892
|
-
const t = V(this.currentDate), e =
|
|
892
|
+
const t = V(this.currentDate), e = k(new Date(this.maxDate));
|
|
893
893
|
return Q(t) > e;
|
|
894
894
|
}
|
|
895
895
|
isDateDisabled(t) {
|
|
896
896
|
if (this.disableDate(t))
|
|
897
897
|
return !0;
|
|
898
|
-
const e = this.minDate && t <
|
|
898
|
+
const e = this.minDate && t < k(new Date(this.minDate)), a = this.maxDate && t > k(new Date(this.maxDate));
|
|
899
899
|
return !!(e || a);
|
|
900
900
|
}
|
|
901
901
|
render() {
|
|
@@ -912,14 +912,14 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
912
912
|
}, disabled: this.disabled || this.isNextMonthDisabled, innerHTML: this.nextMonthButtonContent || void 0, onClick: this.nextMonth, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "9 18 15 12 9 6" }))), this.showYearStepper && h("button", { "aria-label": this.labels.nextYearButton, class: this.getClassName("next-year-button"), disabled: this.disabled, innerHTML: this.nextYearButtonContent || void 0, onClick: this.nextYear, type: "button" }, h("svg", { fill: "none", height: "24", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", stroke: "currentColor", viewBox: "0 0 24 24", width: "24" }, h("polyline", { points: "13 17 18 12 13 7" }), h("polyline", { points: "6 17 11 12 6 7" })))), h("div", { class: this.getClassName("body") }, h("table", { class: this.getClassName("calendar"), onKeyDown: this.onKeyDown, role: "grid" }, h("thead", { class: this.getClassName("calendar-header") }, h("tr", { class: this.getClassName("weekday-row") }, this.weekdays.map((e) => h("th", { "aria-label": e[1], abbr: e[1], class: this.getClassName("weekday"), key: e[0], scope: "col" }, h("span", null, e[0]))))), h("tbody", null, this.getCalendarRows().map((e) => {
|
|
913
913
|
const a = `row-${e[0].getMonth()}-${e[0].getDate()}`;
|
|
914
914
|
return h("tr", { class: this.getClassName("calendar-row"), key: a }, e.map((s) => {
|
|
915
|
-
var r,
|
|
915
|
+
var r, i, n, o, c;
|
|
916
916
|
const l = D(s, this.currentDate), u = s.getMonth() !== this.currentDate.getMonth(), d = Array.isArray(this.value) ? D(s, this.value[0]) || D(s, this.value[1]) : D(s, this.value), p = this.isRangeValue ? me(s, {
|
|
917
917
|
from: (r = this.value) === null || r === void 0 ? void 0 : r[0],
|
|
918
|
-
to: ((
|
|
919
|
-
}) : !1,
|
|
918
|
+
to: ((i = this.value) === null || i === void 0 ? void 0 : i[1]) || this.hoveredDate || this.currentDate
|
|
919
|
+
}) : !1, v = !((n = this.value) === null || n === void 0) && n[0] ? [
|
|
920
920
|
(o = this.value) === null || o === void 0 ? void 0 : o[0],
|
|
921
921
|
((c = this.value) === null || c === void 0 ? void 0 : c[1]) || this.hoveredDate
|
|
922
|
-
].sort((We, ze) => We - ze) : [], _ = this.range && D(
|
|
922
|
+
].sort((We, ze) => We - ze) : [], _ = this.range && D(v[0], s), S = this.range && D(v[1], s), L = D(s, /* @__PURE__ */ new Date()), E = this.isDateDisabled(s), Ye = `cell-${s.getMonth()}-${s.getDate()}`, Pe = {
|
|
923
923
|
[this.getClassName("date")]: !0,
|
|
924
924
|
[this.getClassName("date--current")]: l,
|
|
925
925
|
[this.getClassName("date--disabled")]: E,
|
|
@@ -984,14 +984,14 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
984
984
|
weekdays: [32]
|
|
985
985
|
}]), Wt = Ut;
|
|
986
986
|
var zt = Object.defineProperty, y = (t, e, a, s) => {
|
|
987
|
-
for (var r = void 0,
|
|
988
|
-
(
|
|
987
|
+
for (var r = void 0, i = t.length - 1, n; i >= 0; i--)
|
|
988
|
+
(n = t[i]) && (r = n(e, a, r) || r);
|
|
989
989
|
return r && zt(e, a, r), r;
|
|
990
990
|
};
|
|
991
991
|
customElements.get("wc-datepicker") || customElements.define("wc-datepicker", Wt);
|
|
992
992
|
let jt = 0;
|
|
993
993
|
var x;
|
|
994
|
-
const f = (x = class extends
|
|
994
|
+
const f = (x = class extends ne {
|
|
995
995
|
// allows use of elementInternals' API
|
|
996
996
|
constructor() {
|
|
997
997
|
super(), this.id = "", this.name = "", this.width = "md", this.hideTodayButton = !1, this.hideClearButton = !1, this.disabled = !1, this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.form = null, this.tooltip = "", this.type = "date", this.label = "", this.description = "", this.startDate = "", this.minDate = "", this.maxDate = "", this.inverted = !1, this.value = void 0, this.datepickerIsOpen = !1, this._hasUserInteracted = !1, this._onKeydownEsc = (e) => {
|
|
@@ -1009,6 +1009,12 @@ const f = (x = class extends ie {
|
|
|
1009
1009
|
async firstUpdated() {
|
|
1010
1010
|
this._setValue(this.value), !(this._shouldUseNativeDatepicker() || !await this._whenWcDatepickerReady()) && (setTimeout(() => this._replaceButtonSVG(), 0), setTimeout(() => this._addMonthDropdownIcon(), 0), setTimeout(() => this._handleDateChange(), 0), setTimeout(() => this._onDocumentClick(), 0));
|
|
1011
1011
|
}
|
|
1012
|
+
updated(e) {
|
|
1013
|
+
if (super.updated(e), e.has("value")) {
|
|
1014
|
+
const a = e.get("value"), s = this.value;
|
|
1015
|
+
!s && a !== s ? (this._internals.setFormValue(""), this._manageRequire()) : s && this._setValue(s);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1012
1018
|
async _whenWcDatepickerReady() {
|
|
1013
1019
|
await customElements.whenDefined("wc-datepicker");
|
|
1014
1020
|
const e = this.shadowRoot?.querySelector(
|
|
@@ -1042,8 +1048,8 @@ const f = (x = class extends ie {
|
|
|
1042
1048
|
this.value = a, this._internals.setFormValue(s);
|
|
1043
1049
|
const r = this.shadowRoot?.querySelector("input");
|
|
1044
1050
|
r && (r.value = s);
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1051
|
+
const i = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1052
|
+
i && (i.value = a), this._manageRequire();
|
|
1047
1053
|
}
|
|
1048
1054
|
// Called to internally set the initial internalElement required flag.
|
|
1049
1055
|
_manageRequire() {
|
|
@@ -1062,8 +1068,8 @@ const f = (x = class extends ie {
|
|
|
1062
1068
|
const e = this.shadowRoot?.querySelector("input");
|
|
1063
1069
|
if (!e) return;
|
|
1064
1070
|
this._manageRequire();
|
|
1065
|
-
|
|
1066
|
-
this._setValidityMessage(a);
|
|
1071
|
+
let a = "";
|
|
1072
|
+
e.validity.valueMissing ? a = this.errorMessage || "This field is required." : a = e.validationMessage, this._setValidityMessage(a);
|
|
1067
1073
|
}
|
|
1068
1074
|
/**
|
|
1069
1075
|
* Passive check of validity:
|
|
@@ -1079,11 +1085,11 @@ const f = (x = class extends ie {
|
|
|
1079
1085
|
_setValidityMessage(e = "") {
|
|
1080
1086
|
if (!this._internals) return;
|
|
1081
1087
|
const a = this.shadowRoot?.querySelector("input");
|
|
1082
|
-
a && (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
|
|
1088
|
+
a && (!e && this.showError && this.errorMessage?.trim() || (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
|
|
1083
1089
|
e ? { customError: !0 } : {},
|
|
1084
1090
|
e,
|
|
1085
1091
|
a
|
|
1086
|
-
));
|
|
1092
|
+
)));
|
|
1087
1093
|
}
|
|
1088
1094
|
// Handles native 'invalid' events
|
|
1089
1095
|
_handleInvalid(e) {
|
|
@@ -1092,7 +1098,7 @@ const f = (x = class extends ie {
|
|
|
1092
1098
|
if (a) {
|
|
1093
1099
|
const s = this._internals.form;
|
|
1094
1100
|
s ? Array.from(s.elements).find(
|
|
1095
|
-
(
|
|
1101
|
+
(n) => typeof n.checkValidity == "function" && !n.checkValidity()
|
|
1096
1102
|
) === this && a.focus() : a.focus();
|
|
1097
1103
|
}
|
|
1098
1104
|
}
|
|
@@ -1149,10 +1155,10 @@ const f = (x = class extends ie {
|
|
|
1149
1155
|
String(a.getDate()).padStart(2, "0")
|
|
1150
1156
|
].join("-"), r = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1151
1157
|
if (!r) return;
|
|
1152
|
-
const
|
|
1158
|
+
const i = r.querySelector(
|
|
1153
1159
|
`td[data-date="${s}"]`
|
|
1154
1160
|
);
|
|
1155
|
-
|
|
1161
|
+
i && (e || i.focus());
|
|
1156
1162
|
}
|
|
1157
1163
|
_isOutOfRange(e) {
|
|
1158
1164
|
if (this.minDate) {
|
|
@@ -1194,10 +1200,10 @@ const f = (x = class extends ie {
|
|
|
1194
1200
|
const e = (a) => {
|
|
1195
1201
|
const s = a.composedPath(), r = this.shadowRoot?.querySelector(
|
|
1196
1202
|
".nys-datepicker--input-container"
|
|
1197
|
-
),
|
|
1203
|
+
), i = this.shadowRoot?.querySelector(
|
|
1198
1204
|
".wc-datepicker--container"
|
|
1199
|
-
),
|
|
1200
|
-
r && s.includes(r) ||
|
|
1205
|
+
), n = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1206
|
+
r && s.includes(r) || i && s.includes(i) || n && s.includes(n) || n?.classList.remove("active");
|
|
1201
1207
|
};
|
|
1202
1208
|
document.addEventListener("click", e);
|
|
1203
1209
|
}
|
|
@@ -1271,8 +1277,8 @@ const f = (x = class extends ie {
|
|
|
1271
1277
|
a.querySelectorAll(s.join(","))
|
|
1272
1278
|
).filter((c) => c.offsetParent !== null)
|
|
1273
1279
|
), r.length === 0) return;
|
|
1274
|
-
const
|
|
1275
|
-
e.shiftKey ? o ===
|
|
1280
|
+
const i = r[0], n = r[r.length - 1], o = this.shadowRoot?.activeElement;
|
|
1281
|
+
e.shiftKey ? o === i && (e.preventDefault(), n.focus()) : o === n && (e.preventDefault(), i.focus());
|
|
1276
1282
|
}
|
|
1277
1283
|
_isSafari() {
|
|
1278
1284
|
const e = navigator.userAgent;
|
|
@@ -1299,7 +1305,6 @@ const f = (x = class extends ie {
|
|
|
1299
1305
|
const e = this._shouldUseNativeDatepicker();
|
|
1300
1306
|
return I` <div class="nys-datepicker--container">
|
|
1301
1307
|
<nys-label
|
|
1302
|
-
for=${this.id}
|
|
1303
1308
|
label=${this.label}
|
|
1304
1309
|
description=${this.description}
|
|
1305
1310
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
@@ -1387,7 +1392,7 @@ const f = (x = class extends ie {
|
|
|
1387
1392
|
></nys-errormessage>`;
|
|
1388
1393
|
}
|
|
1389
1394
|
}, x.styles = je(Ke), x.shadowRootOptions = {
|
|
1390
|
-
...
|
|
1395
|
+
...ne.shadowRootOptions,
|
|
1391
1396
|
delegatesFocus: !0
|
|
1392
1397
|
}, x.formAssociated = !0, x);
|
|
1393
1398
|
y([
|