@nysds/nys-datepicker 1.17.0 → 1.18.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 +127 -120
- package/dist/nys-datepicker.js.map +1 -1
- package/package.json +5 -5
package/dist/nys-datepicker.js
CHANGED
|
@@ -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.18.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, n = null, i = !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" && ((i = typeof t != "function" && !re(s)) && (s = String(s)), i && o ? c[c.length - 1].$text$ += s : c.push(i ? j(null, s) : s), o = i);
|
|
110
110
|
};
|
|
111
111
|
if (l(a), e) {
|
|
112
|
-
e.key && (r = e.key), e.name && (
|
|
112
|
+
e.key && (r = e.key), e.name && (n = 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$ = n, u;
|
|
122
122
|
}, j = (t, e) => {
|
|
123
123
|
const a = {
|
|
124
124
|
$flags$: 0,
|
|
@@ -163,28 +163,28 @@ const h = (t, e, ...a) => {
|
|
|
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 n = Se(e, a);
|
|
167
|
+
const i = K.get(n);
|
|
168
|
+
if (t = t.nodeType === 11 ? t : w, i)
|
|
169
|
+
if (typeof i == "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(n)) {
|
|
173
173
|
{
|
|
174
|
-
c = w.createElement("style"), c.innerHTML =
|
|
174
|
+
c = w.createElement("style"), c.innerHTML = i;
|
|
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(n);
|
|
179
179
|
}
|
|
180
|
-
} else t.adoptedStyleSheets.includes(
|
|
181
|
-
return
|
|
180
|
+
} else t.adoptedStyleSheets.includes(i) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, i]);
|
|
181
|
+
return n;
|
|
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$), n = nt(a.shadowRoot ? a.shadowRoot : a.getRootNode(), e, t.$modeName$);
|
|
184
|
+
s & 10 && (a["s-sc"] = n, a.classList.add(n + "-h"), s & 2 && a.classList.add(n + "-s")), r();
|
|
185
|
+
}, Se = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), pe = (t, e, a, s, r, n) => {
|
|
186
186
|
if (a !== s) {
|
|
187
|
-
let
|
|
187
|
+
let i = 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)));
|
|
@@ -200,29 +200,29 @@ const h = (t, e, ...a) => {
|
|
|
200
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 ((i || 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" ? i = !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)) : (!i || n & 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 i)
|
|
220
|
-
s in n || pe(r, s, i[s], void 0, a, e.$flags$);
|
|
218
|
+
const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, n = t && t.$attrs$ || le, i = e.$attrs$ || le;
|
|
221
219
|
for (s in n)
|
|
222
|
-
pe(r, s,
|
|
220
|
+
s in i || pe(r, s, n[s], void 0, a, e.$flags$);
|
|
221
|
+
for (s in i)
|
|
222
|
+
pe(r, s, n[s], i[s], a, e.$flags$);
|
|
223
223
|
}, H = (t, e, a, s) => {
|
|
224
224
|
const r = e.$children$[a];
|
|
225
|
-
let
|
|
225
|
+
let n = 0, i, 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,16 +230,16 @@ const h = (t, e, ...a) => {
|
|
|
230
230
|
// slot element does not have fallback content
|
|
231
231
|
1
|
|
232
232
|
))), r.$text$ !== null)
|
|
233
|
-
|
|
233
|
+
i = r.$elm$ = w.createTextNode(r.$text$);
|
|
234
234
|
else if (r.$flags$ & 1)
|
|
235
|
-
|
|
235
|
+
i = 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"), i = r.$elm$ = w.createElementNS($ ? Qe : Ge, r.$flags$ & 2 ? "slot-fb" : r.$tag$), $ && r.$tag$ === "foreignObject" && ($ = !1), Me(null, r, $), Xe(O) && i["s-si"] !== O && i.classList.add(i["s-si"] = O), r.$children$)
|
|
238
|
+
for (n = 0; n < r.$children$.length; ++n)
|
|
239
|
+
o = H(t, r, n, i), o && i.appendChild(o);
|
|
240
|
+
r.$tag$ === "svg" ? $ = !1 : i.tagName === "foreignObject" && ($ = !0);
|
|
241
241
|
}
|
|
242
|
-
return
|
|
242
|
+
return i["s-hn"] = X, r.$flags$ & 3 && (i["s-sr"] = !0, i["s-cr"] = we, i["s-sn"] = r.$name$ || "", c = t && t.$children$ && t.$children$[a], c && c.$tag$ === r.$tag$ && t.$elm$ && q(t.$elm$, !1)), i;
|
|
243
243
|
}, q = (t, e) => {
|
|
244
244
|
b.$flags$ |= 1;
|
|
245
245
|
const a = t.childNodes;
|
|
@@ -248,58 +248,58 @@ const h = (t, e, ...a) => {
|
|
|
248
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, n) => {
|
|
252
|
+
let i = t["s-cr"] && t["s-cr"].parentNode || t, o;
|
|
253
|
+
for (i.shadowRoot && i.tagName === X && (i = i.shadowRoot); r <= n; ++r)
|
|
254
|
+
s[r] && (o = H(null, a, r, t), o && (s[r].$elm$ = o, i.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, n = 0, i = 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 && n <= 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[++
|
|
266
|
+
p = s[++n];
|
|
267
267
|
else if (v == null)
|
|
268
268
|
v = s[--d];
|
|
269
269
|
else if (P(l, p))
|
|
270
|
-
R(l, p), l = e[++r], p = s[++
|
|
270
|
+
R(l, p), l = e[++r], p = s[++n];
|
|
271
271
|
else if (P(u, v))
|
|
272
272
|
R(u, v), u = e[--c], v = s[--d];
|
|
273
273
|
else if (P(l, v))
|
|
274
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" || v.$tag$ === "slot") && q(u.$elm$.parentNode, !1), R(u, p), t.insertBefore(u.$elm$, l.$elm$), u = e[--c], p = s[++
|
|
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[++n];
|
|
277
277
|
else {
|
|
278
|
-
for (
|
|
278
|
+
for (i = -1, o = r; o <= c; ++o)
|
|
279
279
|
if (e[o] && e[o].$key$ !== null && e[o].$key$ === p.$key$) {
|
|
280
|
-
|
|
280
|
+
i = o;
|
|
281
281
|
break;
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
i >= 0 ? (S = e[i], S.$tag$ !== p.$tag$ ? _ = H(e && e[n], a, i, t) : (R(S, p), e[i] = void 0, _ = S.$elm$), p = s[++n]) : (_ = H(e && e[n], a, n, t), p = s[++n]), _ && 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,
|
|
285
|
+
r > c ? Ce(t, s[d + 1] == null ? null : s[d + 1].$elm$, a, s, n, d) : n > d && Te(e, r, c);
|
|
286
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$,
|
|
287
|
+
const a = e.$elm$ = t.$elm$, s = t.$children$, r = e.$children$, n = e.$tag$, i = e.$text$;
|
|
288
288
|
let o;
|
|
289
|
-
|
|
289
|
+
i === null ? ($ = n === "svg" ? !0 : n === "foreignObject" ? !1 : $, n === "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), $ && n === "svg" && ($ = !1)) : (o = a["s-cr"]) ? o.parentNode.textContent = i : t.$text$ !== i && (a.data = i);
|
|
290
290
|
}, Ee = (t) => {
|
|
291
291
|
const e = t.childNodes;
|
|
292
|
-
let a, s, r,
|
|
292
|
+
let a, s, r, n, i, 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 (i = a["s-sn"], a.hidden = !1, n = 0; n < r; n++)
|
|
297
|
+
if (o = e[n].nodeType, e[n]["s-hn"] !== a["s-hn"] || i !== "") {
|
|
298
|
+
if (o === 1 && i === e[n].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[n].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, n, i, 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"], i = s.length - 1; i >= 0; i--)
|
|
315
|
+
a = s[i], !a["s-cn"] && !a["s-nr"] && a["s-hn"] !== e["s-hn"] && (ye(a, r) ? (n = m.find((u) => u.$nodeToRelocate$ === a), z = !0, a["s-sn"] = a["s-sn"] || r, n ? n.$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"]) && (n = m.find((d) => d.$nodeToRelocate$ === a), n && !u.$slotRefNode$ && (u.$slotRefNode$ = n.$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), n = Ze(e) ? e : h(null, null, e);
|
|
329
|
+
X = a.tagName, s.$attrsToReflect$ && (n.$attrs$ = n.$attrs$ || {}, s.$attrsToReflect$.map(([i, o]) => n.$attrs$[o] = a[i])), n.$tag$ = null, n.$flags$ |= 4, t.$vnode$ = n, n.$elm$ = r.$elm$ = a.shadowRoot || a, O = a["s-sc"], we = a["s-cr"], De = (s.$flags$ & 1) !== 0, z = !1, R(r, n);
|
|
330
330
|
{
|
|
331
331
|
if (b.$flags$ |= 1, se) {
|
|
332
|
-
Be(
|
|
333
|
-
let
|
|
332
|
+
Be(n.$elm$);
|
|
333
|
+
let i, o, c, l, u, d, p = 0;
|
|
334
334
|
for (; p < m.length; p++)
|
|
335
|
-
|
|
335
|
+
i = m[p], o = i.$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 (i = m[p], o = i.$nodeToRelocate$, i.$slotRefNode$) {
|
|
338
|
+
for (l = i.$slotRefNode$.parentNode, u = i.$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(n.$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 n;
|
|
353
|
+
return e ? n = N(r, "componentWillLoad") : n = N(r, "componentWillUpdate"), n = ge(n, () => N(r, "componentWillRender")), s(), ge(n, () => 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 n = T("render", t.$cmpMeta$.$tagName$);
|
|
358
|
+
ft(t, e, s), n(), 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));
|
|
@@ -374,24 +374,24 @@ const h = (t, e, ...a) => {
|
|
|
374
374
|
Y(s);
|
|
375
375
|
}
|
|
376
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),
|
|
377
|
+
const r = J(t), n = t, i = r.$instanceValues$.get(e), o = r.$flags$, c = n;
|
|
378
378
|
a = at(a, s.$members$[e][0]);
|
|
379
|
-
const l = Number.isNaN(
|
|
380
|
-
if (a !==
|
|
379
|
+
const l = Number.isNaN(i) && Number.isNaN(a);
|
|
380
|
+
if (a !== i && !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,
|
|
387
|
+
c[p](a, i, e);
|
|
388
388
|
} catch (v) {
|
|
389
|
-
Y(v,
|
|
389
|
+
Y(v, n);
|
|
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, i, e) === !1)
|
|
395
395
|
return;
|
|
396
396
|
Re(r, !1);
|
|
397
397
|
}
|
|
@@ -401,23 +401,23 @@ const h = (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(([n, [i]]) => {
|
|
405
|
+
(i & 31 || i & 32) && Object.defineProperty(r, n, {
|
|
406
406
|
get() {
|
|
407
|
-
return gt(this,
|
|
407
|
+
return gt(this, n);
|
|
408
408
|
},
|
|
409
409
|
set(o) {
|
|
410
|
-
vt(this,
|
|
410
|
+
vt(this, n, 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 n = /* @__PURE__ */ new Map();
|
|
418
|
+
r.attributeChangedCallback = function(i, o, c) {
|
|
419
419
|
b.jmp(() => {
|
|
420
|
-
const l =
|
|
420
|
+
const l = n.get(i);
|
|
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
|
+
([i, o]) => o[0] & 15
|
|
429
429
|
/* MEMBER_FLAGS.HasAttribute */
|
|
430
|
-
).map(([
|
|
431
|
-
const c = o[1] ||
|
|
432
|
-
return
|
|
430
|
+
).map(([i, o]) => {
|
|
431
|
+
const c = o[1] || i;
|
|
432
|
+
return n.set(c, i), o[0] & 512 && e.$attrsToReflect$.push([i, 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 i = r.style;
|
|
440
|
+
typeof i != "string" && (i = i[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
|
-
it(o,
|
|
444
|
+
it(o, i, !!(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, [n]]) => {
|
|
453
|
+
if (n & 31 && t.hasOwnProperty(r)) {
|
|
454
|
+
const i = t[r];
|
|
455
|
+
delete t[r], t[r] = i;
|
|
456
456
|
}
|
|
457
457
|
}), bt(t, e, a)), s();
|
|
458
458
|
}
|
|
@@ -489,9 +489,9 @@ const h = (t, e, ...a) => {
|
|
|
489
489
|
}
|
|
490
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, n, i]) => {
|
|
493
|
+
const o = St(t, r), c = xt(e, i), l = Mt(r);
|
|
494
|
+
b.ael(o, n, c, l), (e.$rmListeners$ = e.$rmListeners$ || []).push(() => b.rel(o, n, c, l));
|
|
495
495
|
});
|
|
496
496
|
}, xt = (t, e) => (a) => {
|
|
497
497
|
try {
|
|
@@ -554,13 +554,13 @@ function U(t, e) {
|
|
|
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), n = r.getDay() === 0 ? 7 : r.getDay(), i = F(t), o = i.getDay() === 0 ? 7 : i.getDay(), c = a === 1 ? 7 : a - 1, l = [], u = [];
|
|
558
558
|
{
|
|
559
|
-
let v = (7 - a +
|
|
559
|
+
let v = (7 - a + n) % 7, _ = G(r);
|
|
560
560
|
for (; v > 0; )
|
|
561
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(i);
|
|
564
564
|
for (; L > 0; )
|
|
565
565
|
u.push(E), E = A(E), L -= 1;
|
|
566
566
|
}
|
|
@@ -759,15 +759,15 @@ const Yt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
759
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(), n = Math.min(a, r), i = new Date(this.currentDate.getFullYear(), e, n);
|
|
763
|
+
this.updateCurrentDate(i);
|
|
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(), n = /* @__PURE__ */ new Date();
|
|
769
|
+
n.setFullYear(e, r, 1);
|
|
770
|
+
const i = F(n).getDate(), o = Math.min(s, i), 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)));
|
|
@@ -912,11 +912,11 @@ 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, n, i, 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, v = !((
|
|
918
|
+
to: ((n = this.value) === null || n === void 0 ? void 0 : n[1]) || this.hoveredDate || this.currentDate
|
|
919
|
+
}) : !1, v = !((i = this.value) === null || i === void 0) && i[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
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 = {
|
|
@@ -984,8 +984,8 @@ 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, n = t.length - 1, i; n >= 0; n--)
|
|
988
|
+
(i = t[n]) && (r = i(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);
|
|
@@ -1048,8 +1048,8 @@ const f = (x = class extends ne {
|
|
|
1048
1048
|
this.value = a, this._internals.setFormValue(s);
|
|
1049
1049
|
const r = this.shadowRoot?.querySelector("input");
|
|
1050
1050
|
r && (r.value = s);
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1051
|
+
const n = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1052
|
+
n && (n.value = a), this._manageRequire();
|
|
1053
1053
|
}
|
|
1054
1054
|
// Called to internally set the initial internalElement required flag.
|
|
1055
1055
|
_manageRequire() {
|
|
@@ -1098,7 +1098,7 @@ const f = (x = class extends ne {
|
|
|
1098
1098
|
if (a) {
|
|
1099
1099
|
const s = this._internals.form;
|
|
1100
1100
|
s ? Array.from(s.elements).find(
|
|
1101
|
-
(
|
|
1101
|
+
(i) => typeof i.checkValidity == "function" && !i.checkValidity()
|
|
1102
1102
|
) === this && a.focus() : a.focus();
|
|
1103
1103
|
}
|
|
1104
1104
|
}
|
|
@@ -1147,6 +1147,12 @@ const f = (x = class extends ne {
|
|
|
1147
1147
|
e.setHours(0, 0, 0, 0), this._setValue(e), this._setFocusOnTodayDate();
|
|
1148
1148
|
}
|
|
1149
1149
|
async _setFocusOnTodayDate(e = !1) {
|
|
1150
|
+
if (this.minDate) {
|
|
1151
|
+
const i = /* @__PURE__ */ new Date();
|
|
1152
|
+
i.setHours(0, 0, 0, 0);
|
|
1153
|
+
const o = this._parseLocalDate(this.minDate);
|
|
1154
|
+
if (i < o) return;
|
|
1155
|
+
}
|
|
1150
1156
|
const a = /* @__PURE__ */ new Date();
|
|
1151
1157
|
a.setHours(0, 0, 0, 0);
|
|
1152
1158
|
const s = [
|
|
@@ -1155,10 +1161,10 @@ const f = (x = class extends ne {
|
|
|
1155
1161
|
String(a.getDate()).padStart(2, "0")
|
|
1156
1162
|
].join("-"), r = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1157
1163
|
if (!r) return;
|
|
1158
|
-
const
|
|
1164
|
+
const n = r.querySelector(
|
|
1159
1165
|
`td[data-date="${s}"]`
|
|
1160
1166
|
);
|
|
1161
|
-
|
|
1167
|
+
n && (e || n.focus());
|
|
1162
1168
|
}
|
|
1163
1169
|
_isOutOfRange(e) {
|
|
1164
1170
|
if (this.minDate) {
|
|
@@ -1189,7 +1195,8 @@ const f = (x = class extends ne {
|
|
|
1189
1195
|
}
|
|
1190
1196
|
_handleBlur(e) {
|
|
1191
1197
|
const a = e.relatedTarget;
|
|
1192
|
-
if (a && (this.contains(a) || this.shadowRoot?.contains(a)))
|
|
1198
|
+
if (a && (this.contains(a) || this.shadowRoot?.contains(a)) || this.datepickerIsOpen && !a)
|
|
1199
|
+
return;
|
|
1193
1200
|
this._hasUserInteracted || (this._hasUserInteracted = !0), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active"), this.datepickerIsOpen = !1, this._validate(), this.dispatchEvent(
|
|
1194
1201
|
new Event("nys-blur", { bubbles: !0, composed: !0 })
|
|
1195
1202
|
), this.removeEventListener("keydown", this._handleFocusTrap);
|
|
@@ -1200,10 +1207,10 @@ const f = (x = class extends ne {
|
|
|
1200
1207
|
const e = (a) => {
|
|
1201
1208
|
const s = a.composedPath(), r = this.shadowRoot?.querySelector(
|
|
1202
1209
|
".nys-datepicker--input-container"
|
|
1203
|
-
),
|
|
1210
|
+
), n = this.shadowRoot?.querySelector(
|
|
1204
1211
|
".wc-datepicker--container"
|
|
1205
|
-
),
|
|
1206
|
-
r && s.includes(r) ||
|
|
1212
|
+
), i = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1213
|
+
r && s.includes(r) || n && s.includes(n) || i && s.includes(i) || i?.classList.remove("active");
|
|
1207
1214
|
};
|
|
1208
1215
|
document.addEventListener("click", e);
|
|
1209
1216
|
}
|
|
@@ -1277,8 +1284,8 @@ const f = (x = class extends ne {
|
|
|
1277
1284
|
a.querySelectorAll(s.join(","))
|
|
1278
1285
|
).filter((c) => c.offsetParent !== null)
|
|
1279
1286
|
), r.length === 0) return;
|
|
1280
|
-
const
|
|
1281
|
-
e.shiftKey ? o ===
|
|
1287
|
+
const n = r[0], i = r[r.length - 1], o = this.shadowRoot?.activeElement;
|
|
1288
|
+
e.shiftKey ? o === n && (e.preventDefault(), i.focus()) : o === i && (e.preventDefault(), n.focus());
|
|
1282
1289
|
}
|
|
1283
1290
|
_isSafari() {
|
|
1284
1291
|
const e = navigator.userAgent;
|