@nysds/nys-datepicker 1.19.4 → 1.20.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/index.d.ts +1 -0
- package/dist/nys-datepicker.d.ts +259 -0
- package/dist/nys-datepicker.figma.d.ts +1 -0
- package/dist/nys-datepicker.js +378 -247
- package/dist/nys-datepicker.js.map +1 -1
- package/package.json +6 -5
package/dist/nys-datepicker.js
CHANGED
|
@@ -1,17 +1,111 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as g, state as
|
|
3
|
-
import { ifDefined as
|
|
1
|
+
import { LitElement as me, unsafeCSS as je, html as A } from "lit";
|
|
2
|
+
import { property as g, state as ze } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as D } from "lit/directives/if-defined.js";
|
|
4
|
+
import "@nysds/nys-label";
|
|
5
|
+
import "@nysds/nys-errormessage";
|
|
6
|
+
import "@nysds/nys-icon";
|
|
7
|
+
import "@nysds/nys-button";
|
|
4
8
|
/*!
|
|
5
9
|
* █▄ █ █ █ █▀▀▀█ █▀▀▄ █▀▀▀█
|
|
6
10
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
7
11
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
8
12
|
*
|
|
9
|
-
* Datepicker Component v1.
|
|
13
|
+
* Datepicker Component v1.20.0
|
|
10
14
|
* Part of the New York State Design System
|
|
11
15
|
* Repository: https://github.com/its-hcd/nysds
|
|
12
16
|
* License: MIT
|
|
13
17
|
*/
|
|
14
|
-
const Qe = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-width--input: var(--nys-form-width-md, 200px);--_nys-datepicker-gap: var(--nys-space-100, 8px);--_nys-datepicker-height: var(--nys-size-600, 48px);--_nys-datepicker-radius: var(--nys-radius-xl, 12px);--_nys-datepicker-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-datepicker-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-space-sm: var(--nys-space-50, 4px);--_nys-datepicker-space-md: var(--nys-space-100, 8px);--_nys-datepicker-space-lg: var(--nys-space-150, 12px);--_nys-datepicker-border-width: var(--nys-border-width-sm, 1px);--_nys-datepicker-border-color: var(--nys-color-neutral-400, #909395);--_nys-datepicker-border-radius: var(--nys-radius-md, 4px);--_nys-datepicker-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-datepicker-font-size: var(--nys-font-size-ui-md, 16px);--_nys-datepicker-font-weight: var(--nys-font-weight-regular, 400);--_nys-datepicker-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-datepicker-letterspacing: var(--nys-font-letterspacing-ui-md, .044px);--_nys-datepicker-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-datepicker-text-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker-text-disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-datepicker-background-color--button--active: var( --nys-color-gray-100, #d0d0ce );--_nys-datepicker-padding--calendar: var(--nys-space-200, 16px);--_nys-datepicker-color--calendar--weekends: var( --nys-color-text-weaker, #797c7f );--_nys-datepicker-gap--calendar-row: var(--nys-space-2-px, 2px);--_nys-datepicker-font-size--date: var(--nys-font-size-ui-sm, 14px);--_nys-datepicker-background-color--date--hover: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--date--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-datepicker-background-color--date--selected: var( --nys-color-info-weak, #e5effa );--_nys-datepicker-focus-ring--date: var(--nys-color-link, #004dd1);--_nys-datepicker-color--date: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--hover: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--selected: var(--nys-color-info, #004dd1);--_nys-datepicker-color--date--disabled: var( --nys-color-text-disabled, #bec0c1 );--_nys-datepicker-border-color--date--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-background-color--navigation--hover: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-background-color--navigation--pressed: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--navigation--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-color--navigation--hover: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--pressed: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-box-shadow-border--navigation: inset 0 0 0 1px var(--nys-color-neutral-900, #1b1b1b)}:host([width=lg]){--_nys-datepicker-width--input: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-datepicker-width--input: 100%}:host([showError]){--_nys-datepicker-border-color: var(--nys-color-danger, #b52c2c)}:host([inverted]){--_nys-datepicker-outline-color--focus: var( --nys-color-focus-reverse, #7aa5e7 )}.nys-datepicker--container{display:flex;flex-direction:column;gap:var(--_nys-datepicker-space-sm);font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);font-weight:var(--_nys-datepicker-font-weight);line-height:var(--_nys-datepicker-line-height);width:100%}.nys-datepicker--container .nys-datepicker--input-container{position:relative;width:var(--_nys-datepicker-width--input);display:flex;cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container.disabled #calendar-button{cursor:not-allowed;color:var(--_nys-datepicker-color--date--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input{cursor:text;text-align:start;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);flex:1;height:24px;outline:transparent solid 1px;border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-border-color);background-color:var(--_nys-datepicker-background-color);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);color:var(--_nys-datepicker-color)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:hover{outline-color:var(--_nys-datepicker-outline-color--hover);border-color:var(--_nys-datepicker-outline-color--hover)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:focus{outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:disabled{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);cursor:not-allowed;color:var(--_nys-datepicker-color--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input::-webkit-date-and-time-value{text-align:start}.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-inner-spin-button,.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-calendar-picker-indicator{display:none;appearance:none}.nys-datepicker--container .nys-datepicker--input-container #calendar-button{display:flex;align-items:center;justify-content:center;padding:var(--_nys-datepicker-space-sm);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-background-color);outline:transparent solid 1px;background-color:var(--_nys-datepicker-background-color);position:absolute;top:50%;right:var(--_nys-datepicker-space-sm);transform:translateY(-50%);cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:hover{outline-color:var(--_nys-datepicker-background-color--date--hover);border-color:var(--_nys-datepicker-background-color--date--hover);background:var(--_nys-datepicker-background-color--date--hover)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:active{outline-color:var(--_nys-datepicker-background-color--button--active);border-color:var(--_nys-datepicker-background-color--button--active);background:var(--_nys-datepicker-background-color--button--active)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:focus:not(:active):not(:disabled){outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .wc-datepicker--container{display:flex;width:fit-content}.nys-datepicker--container .wc-datepicker--container *{flex:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}wc-datepicker{display:none;padding:var(--_nys-datepicker-padding--calendar);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--nys-color-neutral-100, #d0d0ce);background-color:var(--_nys-datepicker-background-color);box-shadow:0 4px 6px -1px var(--nys-color-black-transparent-100, rgba(27, 27, 27, .1)),0 4px 6px -1px var(--nys-color-black-transparent-50, rgba(27, 27, 27, .01));color:var(--_nys-datepicker-text-color);margin-bottom:3px}wc-datepicker.active{display:flex;flex-direction:column-reverse;position:absolute;z-index:1}wc-datepicker *,wc-datepicker *:before,wc-datepicker *:after{margin:0;box-sizing:border-box}.wc-datepicker{display:block;width:min-content;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size--date);font-weight:400;line-height:var(--_nys-datepicker-line-height);letter-spacing:var(--_nys-datepicker-letterspacing)}.wc-datepicker--disabled *:disabled{opacity:.5;cursor:not-allowed}.wc-datepicker--disabled .wc-datepicker__date{cursor:not-allowed;opacity:.5}.wc-datepicker--disabled .wc-datepicker__date:focus{outline:none;border-color:var(--_nys-datepicker-border-color--date--disabled);box-shadow:none}.wc-datepicker--disabled .wc-datepicker__date:hover:not(.wc-datepicker__date--selected){background-color:transparent}.wc-datepicker--disabled .wc-datepicker__date--selected:hover{color:var(--_nys-datepicker-background-color);background-color:var(--_nys-datepicker-background-color--date--selected)}.wc-datepicker--disabled #wc-month-dropdown-icon{color:var(--_nys-datepicker-color--date--disabled)}.wc-datepicker__header{display:flex;align-items:center;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__current-month{display:flex;flex-grow:1;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__month-select,.wc-datepicker__year-select{display:flex;align-items:center;font-size:var(--_nys-datepicker-font-size);font-family:var(--_nys-datepicker-font-family);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color);background-color:var(--_nys-datepicker-background-color);line-height:var(--_nys-datepicker-line-height)}.wc-datepicker__month-select:hover:not(:disabled),.wc-datepicker__year-select:hover:not(:disabled){border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover);background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:active:not(:disabled),.wc-datepicker__month-select[aria-pressed=true],.wc-datepicker__year-select:active:not(:disabled),.wc-datepicker__year-select[aria-pressed=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed);background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:disabled,.wc-datepicker__month-select[aria-disabled=true],.wc-datepicker__year-select:disabled,.wc-datepicker__year-select[aria-disabled=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);background-color:var(--_nys-datepicker-background-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker .month-wrapper{position:relative;width:135px;display:flex;align-items:center;align-self:stretch}.wc-datepicker .month-wrapper #wc-month-dropdown-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.wc-datepicker__month-select{width:100%;max-width:100%;flex-grow:1;cursor:pointer;appearance:none;text-overflow:ellipsis;padding-right:var(--nys-space-400, 32px)}.wc-datepicker__month-select>*{width:91px;height:24px}.wc-datepicker__year-select{border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;padding-right:var(--_nys-datepicker-space-sm);max-width:5rem}.wc-datepicker__previous-month-button,.wc-datepicker__next-month-button,.wc-datepicker__previous-year-button,.wc-datepicker__next-year-button{display:inline-flex;width:40px;max-width:40px;max-height:42px;padding:var(--_nys-datepicker-space-lg);justify-content:center;align-items:center;border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color--date);background-color:var(--_nys-datepicker-background-color);cursor:pointer}.wc-datepicker__previous-month-button:hover:not(:disabled),.wc-datepicker__next-month-button:hover:not(:disabled),.wc-datepicker__previous-year-button:hover:not(:disabled),.wc-datepicker__next-year-button:hover:not(:disabled){background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover)}.wc-datepicker__previous-month-button:active:not(:disabled),.wc-datepicker__previous-month-button[aria-pressed=true],.wc-datepicker__next-month-button:active:not(:disabled),.wc-datepicker__next-month-button[aria-pressed=true],.wc-datepicker__previous-year-button:active:not(:disabled),.wc-datepicker__previous-year-button[aria-pressed=true],.wc-datepicker__next-year-button:active:not(:disabled),.wc-datepicker__next-year-button[aria-pressed=true]{background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed)}.wc-datepicker__previous-month-button:disabled,.wc-datepicker__previous-month-button[aria-disabled=true],.wc-datepicker__next-month-button:disabled,.wc-datepicker__next-month-button[aria-disabled=true],.wc-datepicker__previous-year-button:disabled,.wc-datepicker__previous-year-button[aria-disabled=true],.wc-datepicker__next-year-button:disabled,.wc-datepicker__next-year-button[aria-disabled=true]{background-color:var(--_nys-datepicker-background-color--navigation--disabled);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker__calendar{width:100%;table-layout:fixed;border-collapse:collapse}.wc-datepicker__weekday{padding:var(--_nys-datepicker-padding--calendar) 0 var(--_nys-datepicker-space-sm) 0;min-width:var(--nys-size-500, 40px);font-weight:600;aspect-ratio:1}.wc-datepicker__weekday>span{width:42.3px;height:24px;display:flex;justify-content:center;align-items:center}.wc-datepicker__weekday[aria-label=Saturday],.wc-datepicker__weekday[aria-label=Sunday]{color:var(--_nys-datepicker-color--calendar--weekends)}.wc-datepicker__date{padding:var(--_nys-datepicker-space-md);text-align:center;cursor:pointer;border-radius:var(--nys-radius-lg)}.wc-datepicker__date:focus,.wc-datepicker__date:focus-visible{outline:none}.wc-datepicker__date:focus{box-shadow:inset 0 0 0 2px var(--_nys-datepicker-focus-ring--date)}.wc-datepicker__date:hover:not(.wc-datepicker__date--selected):not(:active){color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--hover)}.wc-datepicker__date:active{color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--active)}.wc-datepicker__date>*{display:flex;justify-content:center;align-items:center;aspect-ratio:1;width:24.3px;height:24px}.wc-datepicker__date--today{font-weight:600;color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--today>*{font-style:normal;text-decoration-line:underline}.wc-datepicker__date--selected{text-decoration-line:none;background-color:var(--_nys-datepicker-background-color--date--selected);color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--selected>*{font-weight:600}.wc-datepicker__date--disabled{color:var(--_nys-datepicker-color--date--disabled);cursor:default}.wc-datepicker__date--disabled:not(.wc-datepicker__date--disabled--selected,.wc-datepicker__date--disabled--in-range):hover{background-color:transparent}.wc-datepicker__date.wc-datepicker__date--overflowing{color:var(--_nys-datepicker-text-disabled)}.wc-datepicker__date.wc-datepicker__date--overflowing:hover,.wc-datepicker__date.wc-datepicker__date--overflowing:active{color:var(--_nys-datepicker-color)}.wc-datepicker--button-container{display:flex;padding-top:var(--_nys-datepicker-space-lg);align-items:flex-end;gap:var(--_nys-datepicker-padding--calendar);align-self:stretch}.wc-datepicker tr.wc-datepicker__calendar-row.sc-wc-datepicker{display:flex;align-items:center;gap:var(--_nys-datepicker-gap--calendar-row);align-self:stretch}', B = {
|
|
18
|
+
/*!
|
|
19
|
+
* New York State Design System v1.20.0
|
|
20
|
+
* Description: A design system for New York State's digital products.
|
|
21
|
+
* Repository: https://github.com/its-hcd/nysds
|
|
22
|
+
* License: MIT
|
|
23
|
+
*/
|
|
24
|
+
let Ke = 0;
|
|
25
|
+
function Ge(t) {
|
|
26
|
+
return `${t}-${Date.now()}-${Ke++}`;
|
|
27
|
+
}
|
|
28
|
+
const Qe = (t) => {
|
|
29
|
+
class e extends t {
|
|
30
|
+
get idPrefix() {
|
|
31
|
+
return this.localName || "nys-element";
|
|
32
|
+
}
|
|
33
|
+
ensureId() {
|
|
34
|
+
this.id || (this.id = Ge(this.idPrefix));
|
|
35
|
+
}
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback(), this.ensureId();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return e;
|
|
41
|
+
}, Xe = (t) => {
|
|
42
|
+
class e extends Qe(t) {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments), this.__internals = null;
|
|
45
|
+
}
|
|
46
|
+
get internals() {
|
|
47
|
+
if (this.__internals) return this.__internals;
|
|
48
|
+
if (typeof this.attachInternals == "function")
|
|
49
|
+
try {
|
|
50
|
+
this.__internals = this.attachInternals();
|
|
51
|
+
} catch {
|
|
52
|
+
this.__internals = null;
|
|
53
|
+
}
|
|
54
|
+
return this.__internals;
|
|
55
|
+
}
|
|
56
|
+
get defaultRole() {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
setHostAria(s, r) {
|
|
60
|
+
const n = this.internals;
|
|
61
|
+
if (n && s in n) {
|
|
62
|
+
n[s] = r;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const i = Je(s);
|
|
66
|
+
r === null ? this.removeAttribute(i) : this.setAttribute(i, r);
|
|
67
|
+
}
|
|
68
|
+
reflectDefaultSemantics() {
|
|
69
|
+
const s = this.defaultRole;
|
|
70
|
+
s && this.setHostAria("role", s);
|
|
71
|
+
}
|
|
72
|
+
connectedCallback() {
|
|
73
|
+
super.connectedCallback(), this.reflectDefaultSemantics();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return e;
|
|
77
|
+
};
|
|
78
|
+
function Je(t) {
|
|
79
|
+
if (t === "role") return "role";
|
|
80
|
+
const e = t.replace(/^aria/, "");
|
|
81
|
+
return "aria-" + e.charAt(0).toLowerCase() + e.slice(1);
|
|
82
|
+
}
|
|
83
|
+
const Ve = (t) => {
|
|
84
|
+
const e = class extends Xe(t) {
|
|
85
|
+
setFormValue(r) {
|
|
86
|
+
this.internals?.setFormValue(r ?? null);
|
|
87
|
+
}
|
|
88
|
+
setValidityFromState(r, n, i) {
|
|
89
|
+
const o = this.internals;
|
|
90
|
+
if (!o) return;
|
|
91
|
+
const c = Object.values(r).some(Boolean);
|
|
92
|
+
c ? o.setValidity(r, n ?? "Invalid value", i) : o.setValidity({}), this.setHostAria("ariaInvalid", c ? "true" : "false");
|
|
93
|
+
}
|
|
94
|
+
clearValidity() {
|
|
95
|
+
this.internals?.setValidity({}), this.setHostAria("ariaInvalid", "false");
|
|
96
|
+
}
|
|
97
|
+
checkValidity() {
|
|
98
|
+
return this.internals?.checkValidity() ?? !0;
|
|
99
|
+
}
|
|
100
|
+
reportValidity() {
|
|
101
|
+
return this.internals?.reportValidity() ?? !0;
|
|
102
|
+
}
|
|
103
|
+
formResetCallback() {
|
|
104
|
+
this.clearValidity();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return e.formAssociated = !0, e;
|
|
108
|
+
}, Ze = /* @__PURE__ */ Ve(me), et = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-width--input: var(--nys-form-width-md, 200px);--_nys-datepicker-gap: var(--nys-space-100, 8px);--_nys-datepicker-height: var(--nys-size-600, 48px);--_nys-datepicker-radius: var(--nys-radius-xl, 12px);--_nys-datepicker-color: var( --nys-color-text, var(--nys-color-neutral-900, #1b1b1b) );--_nys-datepicker-color--disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-space-sm: var(--nys-space-50, 4px);--_nys-datepicker-space-md: var(--nys-space-100, 8px);--_nys-datepicker-space-lg: var(--nys-space-150, 12px);--_nys-datepicker-border-width: var(--nys-border-width-sm, 1px);--_nys-datepicker-border-color: var(--nys-color-neutral-400, #909395);--_nys-datepicker-border-radius: var(--nys-radius-md, 4px);--_nys-datepicker-outline-color--hover: var(--nys-color-neutral-900, #1b1b1b);--_nys-datepicker-outline-color--focus: var(--nys-color-focus, #004dd1);--_nys-datepicker-font-size: var(--nys-font-size-ui-md, 16px);--_nys-datepicker-font-weight: var(--nys-font-weight-regular, 400);--_nys-datepicker-line-height: var(--nys-font-lineheight-ui-md, 24px);--_nys-datepicker-letterspacing: var(--nys-font-letterspacing-ui-md, .044px);--_nys-datepicker-font-family: var( --nys-font-family-ui, var( --nys-font-family-sans, "Proxima Nova", "Helvetica Neue", "Helvetica", "Arial", sans-serif ) );--_nys-datepicker-text-color: var(--nys-color-text, #1b1b1b);--_nys-datepicker-text-disabled: var(--nys-color-text-disabled, #bec0c1);--_nys-datepicker-background-color: var(--nys-color-ink-reverse, #ffffff);--_nys-datepicker-background-color--button--active: var( --nys-color-gray-100, #d0d0ce );--_nys-datepicker-padding--calendar: var(--nys-space-200, 16px);--_nys-datepicker-color--calendar--weekends: var( --nys-color-text-weaker, #797c7f );--_nys-datepicker-gap--calendar-row: var(--nys-space-2-px, 2px);--_nys-datepicker-font-size--date: var(--nys-font-size-ui-sm, 14px);--_nys-datepicker-background-color--date--hover: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--date--active: var( --nys-color-neutral-100, #d0d0ce );--_nys-datepicker-background-color--date--selected: var( --nys-color-info-weak, #e5effa );--_nys-datepicker-focus-ring--date: var(--nys-color-link, #004dd1);--_nys-datepicker-color--date: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--hover: var(--nys-color-text, #1b1b1b);--_nys-datepicker-color--date--selected: var(--nys-color-info, #004dd1);--_nys-datepicker-color--date--disabled: var( --nys-color-text-disabled, #bec0c1 );--_nys-datepicker-border-color--date--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-background-color--navigation--hover: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-background-color--navigation--pressed: var( --nys-color-neutral-50, #ededed );--_nys-datepicker-background-color--navigation--disabled: var( --nys-color-neutral-10, #f6f6f6 );--_nys-datepicker-color--navigation--hover: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--pressed: var( --nys-color-neutral-900, #1b1b1b );--_nys-datepicker-color--navigation--disabled: var( --nys-color-neutral-200, #bec0c1 );--_nys-datepicker-box-shadow-border--navigation: inset 0 0 0 1px var(--nys-color-neutral-900, #1b1b1b)}:host([width=lg]){--_nys-datepicker-width--input: var(--nys-form-width-lg, 384px)}:host([width=full]){--_nys-datepicker-width--input: 100%}:host([showError]){--_nys-datepicker-border-color: var(--nys-color-danger, #b52c2c)}:host([inverted]){--_nys-datepicker-outline-color--focus: var( --nys-color-focus-reverse, #7aa5e7 )}.nys-datepicker--container{position:relative;display:flex;flex-direction:column;gap:var(--_nys-datepicker-space-sm);font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);font-weight:var(--_nys-datepicker-font-weight);line-height:var(--_nys-datepicker-line-height);width:100%}.nys-datepicker--container .nys-datepicker--input-container{position:relative;width:var(--_nys-datepicker-width--input);display:flex;cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container.disabled #calendar-button{cursor:not-allowed;color:var(--_nys-datepicker-color--date--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input{cursor:text;text-align:start;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size);flex:1;height:24px;outline:transparent solid 1px;border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-border-color);background-color:var(--_nys-datepicker-background-color);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);color:var(--_nys-datepicker-color)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:hover{outline-color:var(--_nys-datepicker-outline-color--hover);border-color:var(--_nys-datepicker-outline-color--hover)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:focus{outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input:disabled{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);cursor:not-allowed;color:var(--_nys-datepicker-color--disabled)}.nys-datepicker--container .nys-datepicker--input-container .nys-datepicker--input::-webkit-date-and-time-value{text-align:start}.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-inner-spin-button,.nys-datepicker--container .nys-datepicker--input-container input[type=date]::-webkit-calendar-picker-indicator{display:none;appearance:none}.nys-datepicker--container .nys-datepicker--input-container #calendar-button{display:flex;align-items:center;justify-content:center;padding:var(--_nys-datepicker-space-sm);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-background-color);outline:transparent solid 1px;background-color:var(--_nys-datepicker-background-color);position:absolute;top:50%;right:var(--_nys-datepicker-space-sm);transform:translateY(-50%);cursor:pointer}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:hover{outline-color:var(--_nys-datepicker-background-color--date--hover);border-color:var(--_nys-datepicker-background-color--date--hover);background:var(--_nys-datepicker-background-color--date--hover)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:active{outline-color:var(--_nys-datepicker-background-color--button--active);border-color:var(--_nys-datepicker-background-color--button--active);background:var(--_nys-datepicker-background-color--button--active)}.nys-datepicker--container .nys-datepicker--input-container #calendar-button:focus:not(:active):not(:disabled){outline-color:var(--_nys-datepicker-outline-color--focus);border-color:var(--_nys-datepicker-outline-color--focus)}.nys-datepicker--container .wc-datepicker--container{display:flex;width:fit-content}.nys-datepicker--container .wc-datepicker--container *{flex:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;border:0}wc-datepicker{display:none;padding:var(--_nys-datepicker-padding--calendar);border-radius:var(--_nys-datepicker-border-radius);border:var(--_nys-datepicker-border-width) solid var(--nys-color-neutral-100, #d0d0ce);background-color:var(--_nys-datepicker-background-color);box-shadow:0 4px 6px -1px var(--nys-color-black-transparent-100, rgba(27, 27, 27, .1)),0 4px 6px -1px var(--nys-color-black-transparent-50, rgba(27, 27, 27, .01));color:var(--_nys-datepicker-text-color);margin-bottom:3px}wc-datepicker.active{display:flex;flex-direction:column-reverse;position:absolute;z-index:1}wc-datepicker .position-top{box-shadow:0 -4px 6px -1px var(--nys-color-black-transparent-100, rgba(27, 27, 27, .1)),0 -4px 6px -1px var(--nys-color-black-transparent-50, rgba(27, 27, 27, .01))}wc-datepicker *,wc-datepicker *:before,wc-datepicker *:after{margin:0;box-sizing:border-box}.wc-datepicker{display:block;width:min-content;font-family:var(--_nys-datepicker-font-family);font-size:var(--_nys-datepicker-font-size--date);font-weight:400;line-height:var(--_nys-datepicker-line-height);letter-spacing:var(--_nys-datepicker-letterspacing)}.wc-datepicker--disabled *:disabled{opacity:.5;cursor:not-allowed}.wc-datepicker--disabled .wc-datepicker__date{cursor:not-allowed;opacity:.5}.wc-datepicker--disabled .wc-datepicker__date:focus{outline:none;border-color:var(--_nys-datepicker-border-color--date--disabled);box-shadow:none}.wc-datepicker--disabled .wc-datepicker__date:hover:not(.wc-datepicker__date--selected){background-color:transparent}.wc-datepicker--disabled .wc-datepicker__date--selected:hover{color:var(--_nys-datepicker-background-color);background-color:var(--_nys-datepicker-background-color--date--selected)}.wc-datepicker--disabled #wc-month-dropdown-icon{color:var(--_nys-datepicker-color--date--disabled)}.wc-datepicker__header{display:flex;align-items:center;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__current-month{display:flex;flex-grow:1;gap:var(--_nys-datepicker-space-sm)}.wc-datepicker__month-select,.wc-datepicker__year-select{display:flex;align-items:center;font-size:var(--_nys-datepicker-font-size);font-family:var(--_nys-datepicker-font-family);padding:var(--_nys-datepicker-space-md) var(--_nys-datepicker-space-lg);border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color);background-color:var(--_nys-datepicker-background-color);line-height:var(--_nys-datepicker-line-height)}.wc-datepicker__month-select:hover:not(:disabled),.wc-datepicker__year-select:hover:not(:disabled){border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover);background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:active:not(:disabled),.wc-datepicker__month-select[aria-pressed=true],.wc-datepicker__year-select:active:not(:disabled),.wc-datepicker__year-select[aria-pressed=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed);background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation)}.wc-datepicker__month-select:disabled,.wc-datepicker__month-select[aria-disabled=true],.wc-datepicker__year-select:disabled,.wc-datepicker__year-select[aria-disabled=true]{border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);background-color:var(--_nys-datepicker-background-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker .month-wrapper{position:relative;width:135px;display:flex;align-items:center;align-self:stretch}.wc-datepicker .month-wrapper #wc-month-dropdown-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);pointer-events:none}.wc-datepicker__month-select{width:100%;max-width:100%;flex-grow:1;cursor:pointer;appearance:none;text-overflow:ellipsis;padding-right:var(--nys-space-400, 32px)}.wc-datepicker__month-select>*{width:91px;height:24px}.wc-datepicker__year-select{border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;padding-right:var(--_nys-datepicker-space-sm);max-width:5rem}.wc-datepicker__previous-month-button,.wc-datepicker__next-month-button,.wc-datepicker__previous-year-button,.wc-datepicker__next-year-button{display:inline-flex;width:40px;max-width:40px;max-height:42px;padding:var(--_nys-datepicker-space-lg);justify-content:center;align-items:center;border:solid var(--_nys-datepicker-border-width) var(--_nys-datepicker-border-color);border-radius:.25rem;color:var(--_nys-datepicker-color--date);background-color:var(--_nys-datepicker-background-color);cursor:pointer}.wc-datepicker__previous-month-button:hover:not(:disabled),.wc-datepicker__next-month-button:hover:not(:disabled),.wc-datepicker__previous-year-button:hover:not(:disabled),.wc-datepicker__next-year-button:hover:not(:disabled){background-color:var(--_nys-datepicker-background-color--navigation--hover);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--hover)}.wc-datepicker__previous-month-button:active:not(:disabled),.wc-datepicker__previous-month-button[aria-pressed=true],.wc-datepicker__next-month-button:active:not(:disabled),.wc-datepicker__next-month-button[aria-pressed=true],.wc-datepicker__previous-year-button:active:not(:disabled),.wc-datepicker__previous-year-button[aria-pressed=true],.wc-datepicker__next-year-button:active:not(:disabled),.wc-datepicker__next-year-button[aria-pressed=true]{background-color:var(--_nys-datepicker-background-color--navigation--pressed);box-shadow:var(--_nys-datepicker-box-shadow-border--navigation);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--pressed)}.wc-datepicker__previous-month-button:disabled,.wc-datepicker__previous-month-button[aria-disabled=true],.wc-datepicker__next-month-button:disabled,.wc-datepicker__next-month-button[aria-disabled=true],.wc-datepicker__previous-year-button:disabled,.wc-datepicker__previous-year-button[aria-disabled=true],.wc-datepicker__next-year-button:disabled,.wc-datepicker__next-year-button[aria-disabled=true]{background-color:var(--_nys-datepicker-background-color--navigation--disabled);border:var(--_nys-datepicker-border-width) solid var(--_nys-datepicker-color--navigation--disabled);color:var(--_nys-datepicker-color--disabled)}.wc-datepicker__calendar{width:100%;table-layout:fixed;border-collapse:collapse}.wc-datepicker__weekday{padding:var(--_nys-datepicker-padding--calendar) 0 var(--_nys-datepicker-space-sm) 0;min-width:var(--nys-size-500, 40px);font-weight:600;aspect-ratio:1}.wc-datepicker__weekday>span{width:42.3px;height:24px;display:flex;justify-content:center;align-items:center}.wc-datepicker__weekday[aria-label=Saturday],.wc-datepicker__weekday[aria-label=Sunday]{color:var(--_nys-datepicker-color--calendar--weekends)}.wc-datepicker__date{padding:var(--_nys-datepicker-space-md);text-align:center;cursor:pointer;border-radius:var(--nys-radius-lg)}.wc-datepicker__date:focus,.wc-datepicker__date:focus-visible{outline:none}.wc-datepicker__date:focus{box-shadow:inset 0 0 0 2px var(--_nys-datepicker-focus-ring--date)}.wc-datepicker__date:hover:not(.wc-datepicker__date--selected):not(:active){color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--hover)}.wc-datepicker__date:active{color:var(--_nys-datepicker-color--date--hover);background-color:var(--_nys-datepicker-background-color--date--active)}.wc-datepicker__date>*{display:flex;justify-content:center;align-items:center;aspect-ratio:1;width:24.3px;height:24px}.wc-datepicker__date--today{font-weight:600;color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--today>*{font-style:normal;text-decoration-line:underline}.wc-datepicker__date--selected{text-decoration-line:none;background-color:var(--_nys-datepicker-background-color--date--selected);color:var(--_nys-datepicker-color--date--selected)}.wc-datepicker__date--selected>*{font-weight:600}.wc-datepicker__date--disabled{color:var(--_nys-datepicker-color--date--disabled);cursor:default}.wc-datepicker__date--disabled:not(.wc-datepicker__date--disabled--selected,.wc-datepicker__date--disabled--in-range):hover{background-color:transparent}.wc-datepicker__date.wc-datepicker__date--overflowing{color:var(--_nys-datepicker-text-disabled)}.wc-datepicker__date.wc-datepicker__date--overflowing:hover,.wc-datepicker__date.wc-datepicker__date--overflowing:active{color:var(--_nys-datepicker-color)}.wc-datepicker--button-container{display:flex;padding-top:var(--_nys-datepicker-space-lg);align-items:flex-end;gap:var(--_nys-datepicker-padding--calendar);align-self:stretch}.wc-datepicker tr.wc-datepicker__calendar-row.sc-wc-datepicker{display:flex;align-items:center;gap:var(--_nys-datepicker-gap--calendar-row);align-self:stretch}', R = {
|
|
15
109
|
allRenderFn: !1,
|
|
16
110
|
cmpDidLoad: !0,
|
|
17
111
|
cmpDidUnload: !1,
|
|
@@ -95,10 +189,10 @@ const Qe = ':host{--_nys-datepicker-width: fit-content;--_nys-datepicker-width--
|
|
|
95
189
|
transformTagName: !1,
|
|
96
190
|
attachStyles: !0
|
|
97
191
|
};
|
|
98
|
-
let
|
|
192
|
+
let B, we, X, De = !1, H = !1, se = !1, $ = !1, ne = null, te = !1;
|
|
99
193
|
const T = (t, e = "") => () => {
|
|
100
|
-
},
|
|
101
|
-
function
|
|
194
|
+
}, oe = "http://www.w3.org/1999/xlink", ce = {}, tt = "http://www.w3.org/2000/svg", at = "http://www.w3.org/1999/xhtml", st = (t) => t != null, re = (t) => (t = typeof t, t === "object" || t === "function");
|
|
195
|
+
function rt(t) {
|
|
102
196
|
var e, a, s;
|
|
103
197
|
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
198
|
}
|
|
@@ -116,7 +210,7 @@ const h = (t, e, ...a) => {
|
|
|
116
210
|
}
|
|
117
211
|
}
|
|
118
212
|
if (typeof t == "function")
|
|
119
|
-
return t(e === null ? {} : e, c,
|
|
213
|
+
return t(e === null ? {} : e, c, nt);
|
|
120
214
|
const u = j(t, null);
|
|
121
215
|
return u.$attrs$ = e, c.length > 0 && (u.$children$ = c), u.$key$ = r, u.$name$ = n, u;
|
|
122
216
|
}, j = (t, e) => {
|
|
@@ -128,65 +222,65 @@ const h = (t, e, ...a) => {
|
|
|
128
222
|
$children$: null
|
|
129
223
|
};
|
|
130
224
|
return a.$attrs$ = null, a.$key$ = null, a.$name$ = null, a;
|
|
131
|
-
}, xe = {},
|
|
132
|
-
forEach: (t, e) => t.map(
|
|
133
|
-
map: (t, e) => t.map(
|
|
134
|
-
},
|
|
225
|
+
}, xe = {}, it = (t) => t && t.$tag$ === xe, nt = {
|
|
226
|
+
forEach: (t, e) => t.map(le).forEach(e),
|
|
227
|
+
map: (t, e) => t.map(le).map(e).map(ot)
|
|
228
|
+
}, le = (t) => ({
|
|
135
229
|
vattrs: t.$attrs$,
|
|
136
230
|
vchildren: t.$children$,
|
|
137
231
|
vkey: t.$key$,
|
|
138
232
|
vname: t.$name$,
|
|
139
233
|
vtag: t.$tag$,
|
|
140
234
|
vtext: t.$text$
|
|
141
|
-
}),
|
|
235
|
+
}), ot = (t) => {
|
|
142
236
|
if (typeof t.vtag == "function") {
|
|
143
237
|
const a = Object.assign({}, t.vattrs);
|
|
144
238
|
return t.vkey && (a.key = t.vkey), t.vname && (a.name = t.vname), h(t.vtag, a, ...t.vchildren || []);
|
|
145
239
|
}
|
|
146
240
|
const e = j(t.vtag, t.vtext);
|
|
147
241
|
return e.$attrs$ = t.vattrs, e.$children$ = t.vchildren, e.$key$ = t.vkey, e.$name$ = t.vname, e;
|
|
148
|
-
},
|
|
149
|
-
const s =
|
|
242
|
+
}, ct = (t) => At.map((e) => e(t)).find((e) => !!e), lt = (t, e) => t != null && !re(t) ? e & 4 ? t === "false" ? !1 : t === "" || !!t : e & 2 ? parseFloat(t) : e & 1 ? String(t) : t : t, dt = (t) => t, de = (t, e, a) => {
|
|
243
|
+
const s = dt(t);
|
|
150
244
|
return {
|
|
151
|
-
emit: (r) =>
|
|
245
|
+
emit: (r) => ut(s, e, {
|
|
152
246
|
bubbles: !0,
|
|
153
247
|
composed: !0,
|
|
154
248
|
cancelable: !0,
|
|
155
249
|
detail: r
|
|
156
250
|
})
|
|
157
251
|
};
|
|
158
|
-
},
|
|
252
|
+
}, ut = (t, e, a) => {
|
|
159
253
|
const s = b.ce(e, a);
|
|
160
254
|
return t.dispatchEvent(s), s;
|
|
161
|
-
},
|
|
255
|
+
}, ue = /* @__PURE__ */ new WeakMap(), ht = (t, e, a) => {
|
|
162
256
|
let s = K.get(t);
|
|
163
|
-
|
|
164
|
-
},
|
|
257
|
+
qt && a ? (s = s || new CSSStyleSheet(), typeof s == "string" ? s = e : s.replaceSync(e)) : s = e, K.set(t, s);
|
|
258
|
+
}, pt = (t, e, a, s) => {
|
|
165
259
|
var r;
|
|
166
260
|
let n = Se(e, a);
|
|
167
261
|
const i = K.get(n);
|
|
168
262
|
if (t = t.nodeType === 11 ? t : w, i)
|
|
169
263
|
if (typeof i == "string") {
|
|
170
264
|
t = t.head || t;
|
|
171
|
-
let o =
|
|
172
|
-
if (o ||
|
|
265
|
+
let o = ue.get(t), c;
|
|
266
|
+
if (o || ue.set(t, o = /* @__PURE__ */ new Set()), !o.has(n)) {
|
|
173
267
|
{
|
|
174
268
|
c = w.createElement("style"), c.innerHTML = i;
|
|
175
|
-
const l = (r = b.$nonce$) !== null && r !== void 0 ? r :
|
|
269
|
+
const l = (r = b.$nonce$) !== null && r !== void 0 ? r : rt(w);
|
|
176
270
|
l != null && c.setAttribute("nonce", l), t.insertBefore(c, t.querySelector("link"));
|
|
177
271
|
}
|
|
178
272
|
o && o.add(n);
|
|
179
273
|
}
|
|
180
274
|
} else t.adoptedStyleSheets.includes(i) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, i]);
|
|
181
275
|
return n;
|
|
182
|
-
},
|
|
183
|
-
const e = t.$cmpMeta$, a = t.$hostElement$, s = e.$flags$, r = T("attachStyles", e.$tagName$), n =
|
|
276
|
+
}, ft = (t) => {
|
|
277
|
+
const e = t.$cmpMeta$, a = t.$hostElement$, s = e.$flags$, r = T("attachStyles", e.$tagName$), n = pt(a.shadowRoot ? a.shadowRoot : a.getRootNode(), e, t.$modeName$);
|
|
184
278
|
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$),
|
|
279
|
+
}, Se = (t, e) => "sc-" + (e && t.$flags$ & 32 ? t.$tagName$ + "-" + e : t.$tagName$), he = (t, e, a, s, r, n) => {
|
|
186
280
|
if (a !== s) {
|
|
187
|
-
let i =
|
|
281
|
+
let i = ge(t, e), o = e.toLowerCase();
|
|
188
282
|
if (e === "class") {
|
|
189
|
-
const c = t.classList, l =
|
|
283
|
+
const c = t.classList, l = pe(a), u = pe(s);
|
|
190
284
|
c.remove(...l.filter((d) => d && !u.includes(d))), c.add(...u.filter((d) => d && !l.includes(d)));
|
|
191
285
|
} else if (e === "style") {
|
|
192
286
|
for (const c in a)
|
|
@@ -197,7 +291,7 @@ const h = (t, e, ...a) => {
|
|
|
197
291
|
if (e === "ref")
|
|
198
292
|
s && s(t);
|
|
199
293
|
else if (!t.__lookupSetter__(e) && e[0] === "o" && e[1] === "n")
|
|
200
|
-
e[2] === "-" ? e = e.slice(3) :
|
|
294
|
+
e[2] === "-" ? e = e.slice(3) : ge(V, 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
295
|
else {
|
|
202
296
|
const c = re(s);
|
|
203
297
|
if ((i || c && s !== null) && !r)
|
|
@@ -211,19 +305,19 @@ const h = (t, e, ...a) => {
|
|
|
211
305
|
} catch {
|
|
212
306
|
}
|
|
213
307
|
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(
|
|
308
|
+
o !== (o = o.replace(/^xlink\:?/, "")) && (e = o, l = !0), s == null || s === !1 ? (s !== !1 || t.getAttribute(e) === "") && (l ? t.removeAttributeNS(oe, e) : t.removeAttribute(e)) : (!i || n & 4 || r) && !c && (s = s === !0 ? "" : s, l ? t.setAttributeNS(oe, e, s) : t.setAttribute(e, s));
|
|
215
309
|
}
|
|
216
310
|
}
|
|
217
|
-
},
|
|
218
|
-
const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, n = t && t.$attrs$ ||
|
|
311
|
+
}, yt = /\s/, pe = (t) => t ? t.split(yt) : [], Me = (t, e, a, s) => {
|
|
312
|
+
const r = e.$elm$.nodeType === 11 && e.$elm$.host ? e.$elm$.host : e.$elm$, n = t && t.$attrs$ || ce, i = e.$attrs$ || ce;
|
|
219
313
|
for (s in n)
|
|
220
|
-
s in i ||
|
|
314
|
+
s in i || he(r, s, n[s], void 0, a, e.$flags$);
|
|
221
315
|
for (s in i)
|
|
222
|
-
|
|
223
|
-
},
|
|
316
|
+
he(r, s, n[s], i[s], a, e.$flags$);
|
|
317
|
+
}, z = (t, e, a, s) => {
|
|
224
318
|
const r = e.$children$[a];
|
|
225
319
|
let n = 0, i, o, c;
|
|
226
|
-
if (De || (se = !0, r.$tag$ === "slot" && (
|
|
320
|
+
if (De || (se = !0, r.$tag$ === "slot" && (B && s.classList.add(B + "-s"), r.$flags$ |= r.$children$ ? (
|
|
227
321
|
// slot element has fallback content
|
|
228
322
|
2
|
|
229
323
|
) : (
|
|
@@ -234,29 +328,29 @@ const h = (t, e, ...a) => {
|
|
|
234
328
|
else if (r.$flags$ & 1)
|
|
235
329
|
i = r.$elm$ = w.createTextNode("");
|
|
236
330
|
else {
|
|
237
|
-
if ($ || ($ = r.$tag$ === "svg"), i = r.$elm$ = w.createElementNS($ ?
|
|
331
|
+
if ($ || ($ = r.$tag$ === "svg"), i = r.$elm$ = w.createElementNS($ ? tt : at, r.$flags$ & 2 ? "slot-fb" : r.$tag$), $ && r.$tag$ === "foreignObject" && ($ = !1), Me(null, r, $), st(B) && i["s-si"] !== B && i.classList.add(i["s-si"] = B), r.$children$)
|
|
238
332
|
for (n = 0; n < r.$children$.length; ++n)
|
|
239
|
-
o =
|
|
333
|
+
o = z(t, r, n, i), o && i.appendChild(o);
|
|
240
334
|
r.$tag$ === "svg" ? $ = !1 : i.tagName === "foreignObject" && ($ = !0);
|
|
241
335
|
}
|
|
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$ &&
|
|
243
|
-
},
|
|
336
|
+
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$ && P(t.$elm$, !1)), i;
|
|
337
|
+
}, P = (t, e) => {
|
|
244
338
|
b.$flags$ |= 1;
|
|
245
339
|
const a = t.childNodes;
|
|
246
340
|
for (let s = a.length - 1; s >= 0; s--) {
|
|
247
341
|
const r = a[s];
|
|
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 &&
|
|
342
|
+
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 && P(r, e);
|
|
249
343
|
}
|
|
250
344
|
b.$flags$ &= -2;
|
|
251
345
|
}, Ce = (t, e, a, s, r, n) => {
|
|
252
346
|
let i = t["s-cr"] && t["s-cr"].parentNode || t, o;
|
|
253
347
|
for (i.shadowRoot && i.tagName === X && (i = i.shadowRoot); r <= n; ++r)
|
|
254
|
-
s[r] && (o =
|
|
348
|
+
s[r] && (o = z(null, a, r, t), o && (s[r].$elm$ = o, i.insertBefore(o, ie(e))));
|
|
255
349
|
}, Te = (t, e, a, s, r) => {
|
|
256
350
|
for (; e <= a; ++e)
|
|
257
|
-
(s = t[e]) && (r = s.$elm$,
|
|
258
|
-
},
|
|
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],
|
|
351
|
+
(s = t[e]) && (r = s.$elm$, Be(s), H = !0, r["s-ol"] ? r["s-ol"].remove() : P(r, !0), r.remove());
|
|
352
|
+
}, gt = (t, e, a, s) => {
|
|
353
|
+
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], k = s[d], _, S;
|
|
260
354
|
for (; r <= c && n <= d; )
|
|
261
355
|
if (l == null)
|
|
262
356
|
l = e[++r];
|
|
@@ -264,29 +358,29 @@ const h = (t, e, ...a) => {
|
|
|
264
358
|
u = e[--c];
|
|
265
359
|
else if (p == null)
|
|
266
360
|
p = s[++n];
|
|
267
|
-
else if (
|
|
268
|
-
|
|
269
|
-
else if (
|
|
270
|
-
|
|
271
|
-
else if (
|
|
272
|
-
|
|
273
|
-
else if (
|
|
274
|
-
(l.$tag$ === "slot" ||
|
|
275
|
-
else if (
|
|
276
|
-
(l.$tag$ === "slot" ||
|
|
361
|
+
else if (k == null)
|
|
362
|
+
k = s[--d];
|
|
363
|
+
else if (Y(l, p))
|
|
364
|
+
O(l, p), l = e[++r], p = s[++n];
|
|
365
|
+
else if (Y(u, k))
|
|
366
|
+
O(u, k), u = e[--c], k = s[--d];
|
|
367
|
+
else if (Y(l, k))
|
|
368
|
+
(l.$tag$ === "slot" || k.$tag$ === "slot") && P(l.$elm$.parentNode, !1), O(l, k), t.insertBefore(l.$elm$, u.$elm$.nextSibling), l = e[++r], k = s[--d];
|
|
369
|
+
else if (Y(u, p))
|
|
370
|
+
(l.$tag$ === "slot" || k.$tag$ === "slot") && P(u.$elm$.parentNode, !1), O(u, p), t.insertBefore(u.$elm$, l.$elm$), u = e[--c], p = s[++n];
|
|
277
371
|
else {
|
|
278
372
|
for (i = -1, o = r; o <= c; ++o)
|
|
279
373
|
if (e[o] && e[o].$key$ !== null && e[o].$key$ === p.$key$) {
|
|
280
374
|
i = o;
|
|
281
375
|
break;
|
|
282
376
|
}
|
|
283
|
-
i >= 0 ? (S = e[i], S.$tag$ !== p.$tag$ ? _ =
|
|
377
|
+
i >= 0 ? (S = e[i], S.$tag$ !== p.$tag$ ? _ = z(e && e[n], a, i, t) : (O(S, p), e[i] = void 0, _ = S.$elm$), p = s[++n]) : (_ = z(e && e[n], a, n, t), p = s[++n]), _ && Le(l.$elm$).insertBefore(_, ie(l.$elm$));
|
|
284
378
|
}
|
|
285
379
|
r > c ? Ce(t, s[d + 1] == null ? null : s[d + 1].$elm$, a, s, n, d) : n > d && Te(e, r, c);
|
|
286
|
-
},
|
|
380
|
+
}, Y = (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, O = (t, e) => {
|
|
287
381
|
const a = e.$elm$ = t.$elm$, s = t.$children$, r = e.$children$, n = e.$tag$, i = e.$text$;
|
|
288
382
|
let o;
|
|
289
|
-
i === null ? ($ = n === "svg" ? !0 : n === "foreignObject" ? !1 : $, n === "slot" || Me(t, e, $), s !== null && r !== null ?
|
|
383
|
+
i === null ? ($ = n === "svg" ? !0 : n === "foreignObject" ? !1 : $, n === "slot" || Me(t, e, $), s !== null && r !== null ? gt(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
384
|
}, Ee = (t) => {
|
|
291
385
|
const e = t.childNodes;
|
|
292
386
|
let a, s, r, n, i, o;
|
|
@@ -306,30 +400,30 @@ const h = (t, e, ...a) => {
|
|
|
306
400
|
}
|
|
307
401
|
Ee(a);
|
|
308
402
|
}
|
|
309
|
-
}, m = [],
|
|
403
|
+
}, m = [], Re = (t) => {
|
|
310
404
|
let e, a, s, r, n, i, o = 0;
|
|
311
405
|
const c = t.childNodes, l = c.length;
|
|
312
406
|
for (; o < l; o++) {
|
|
313
407
|
if (e = c[o], e["s-sr"] && (a = e["s-cr"]) && a.parentNode)
|
|
314
408
|
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"] && (
|
|
409
|
+
a = s[i], !a["s-cn"] && !a["s-nr"] && a["s-hn"] !== e["s-hn"] && (fe(a, r) ? (n = m.find((u) => u.$nodeToRelocate$ === a), H = !0, a["s-sn"] = a["s-sn"] || r, n ? n.$slotRefNode$ = e : m.push({
|
|
316
410
|
$slotRefNode$: e,
|
|
317
411
|
$nodeToRelocate$: a
|
|
318
412
|
}), a["s-sr"] && m.map((u) => {
|
|
319
|
-
|
|
413
|
+
fe(u.$nodeToRelocate$, a["s-sn"]) && (n = m.find((d) => d.$nodeToRelocate$ === a), n && !u.$slotRefNode$ && (u.$slotRefNode$ = n.$slotRefNode$));
|
|
320
414
|
})) : m.some((u) => u.$nodeToRelocate$ === a) || m.push({
|
|
321
415
|
$nodeToRelocate$: a
|
|
322
416
|
}));
|
|
323
|
-
e.nodeType === 1 &&
|
|
417
|
+
e.nodeType === 1 && Re(e);
|
|
324
418
|
}
|
|
325
|
-
},
|
|
326
|
-
t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(
|
|
327
|
-
},
|
|
328
|
-
const a = t.$hostElement$, s = t.$cmpMeta$, r = t.$vnode$ || j(null, null), n =
|
|
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,
|
|
419
|
+
}, fe = (t, e) => t.nodeType === 1 ? t.getAttribute("slot") === null && e === "" || t.getAttribute("slot") === e : t["s-sn"] === e ? !0 : e === "", Be = (t) => {
|
|
420
|
+
t.$attrs$ && t.$attrs$.ref && t.$attrs$.ref(null), t.$children$ && t.$children$.map(Be);
|
|
421
|
+
}, kt = (t, e) => {
|
|
422
|
+
const a = t.$hostElement$, s = t.$cmpMeta$, r = t.$vnode$ || j(null, null), n = it(e) ? e : h(null, null, e);
|
|
423
|
+
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, B = a["s-sc"], we = a["s-cr"], De = (s.$flags$ & 1) !== 0, H = !1, O(r, n);
|
|
330
424
|
{
|
|
331
425
|
if (b.$flags$ |= 1, se) {
|
|
332
|
-
|
|
426
|
+
Re(n.$elm$);
|
|
333
427
|
let i, o, c, l, u, d, p = 0;
|
|
334
428
|
for (; p < m.length; p++)
|
|
335
429
|
i = m[p], o = i.$nodeToRelocate$, o["s-ol"] || (c = w.createTextNode(""), c["s-nr"] = o, o.parentNode.insertBefore(o["s-ol"] = c, o));
|
|
@@ -344,38 +438,38 @@ const h = (t, e, ...a) => {
|
|
|
344
438
|
} else
|
|
345
439
|
o.nodeType === 1 && (o.hidden = !0);
|
|
346
440
|
}
|
|
347
|
-
|
|
441
|
+
H && Ee(n.$elm$), b.$flags$ &= -2, m.length = 0;
|
|
348
442
|
}
|
|
349
|
-
},
|
|
350
|
-
},
|
|
443
|
+
}, vt = (t, e) => {
|
|
444
|
+
}, Oe = (t, e) => (t.$flags$ |= 16, vt(t, t.$ancestorComponent$), Wt(() => bt(t, e))), bt = (t, e) => {
|
|
351
445
|
const a = t.$hostElement$, s = T("scheduleUpdate", t.$cmpMeta$.$tagName$), r = a;
|
|
352
446
|
let n;
|
|
353
|
-
return e ? n =
|
|
354
|
-
},
|
|
447
|
+
return e ? n = I(r, "componentWillLoad") : n = I(r, "componentWillUpdate"), n = ye(n, () => I(r, "componentWillRender")), s(), ye(n, () => $t(t, r, e));
|
|
448
|
+
}, $t = async (t, e, a) => {
|
|
355
449
|
const s = t.$hostElement$, r = T("update", t.$cmpMeta$.$tagName$);
|
|
356
|
-
s["s-rc"], a &&
|
|
450
|
+
s["s-rc"], a && ft(t);
|
|
357
451
|
const n = T("render", t.$cmpMeta$.$tagName$);
|
|
358
|
-
|
|
359
|
-
},
|
|
452
|
+
_t(t, e, s), n(), r(), mt(t);
|
|
453
|
+
}, _t = (t, e, a) => {
|
|
360
454
|
try {
|
|
361
|
-
|
|
455
|
+
ne = e, e = e.render && e.render(), t.$flags$ &= -17, t.$flags$ |= 2, (R.hasRenderFn || R.reflect) && (R.vdomRender || R.reflect) && (R.hydrateServerSide || kt(t, e));
|
|
362
456
|
} catch (o) {
|
|
363
|
-
|
|
457
|
+
q(o, t.$hostElement$);
|
|
364
458
|
}
|
|
365
|
-
return
|
|
366
|
-
},
|
|
459
|
+
return ne = null, null;
|
|
460
|
+
}, mt = (t) => {
|
|
367
461
|
const e = t.$cmpMeta$.$tagName$, a = t.$hostElement$, s = T("postUpdate", e), r = a;
|
|
368
|
-
t.$ancestorComponent$,
|
|
369
|
-
},
|
|
462
|
+
t.$ancestorComponent$, I(r, "componentDidRender"), t.$flags$ & 64 ? (I(r, "componentDidUpdate"), s()) : (t.$flags$ |= 64, I(r, "componentDidLoad"), s());
|
|
463
|
+
}, I = (t, e, a) => {
|
|
370
464
|
if (t && t[e])
|
|
371
465
|
try {
|
|
372
466
|
return t[e](a);
|
|
373
467
|
} catch (s) {
|
|
374
|
-
|
|
468
|
+
q(s);
|
|
375
469
|
}
|
|
376
|
-
},
|
|
470
|
+
}, ye = (t, e) => t && t.then ? t.then(e) : e(), wt = (t, e) => J(t).$instanceValues$.get(e), Dt = (t, e, a, s) => {
|
|
377
471
|
const r = J(t), n = t, i = r.$instanceValues$.get(e), o = r.$flags$, c = n;
|
|
378
|
-
a =
|
|
472
|
+
a = lt(a, s.$members$[e][0]);
|
|
379
473
|
const l = Number.isNaN(i) && Number.isNaN(a);
|
|
380
474
|
if (a !== i && !l) {
|
|
381
475
|
r.$instanceValues$.set(e, a);
|
|
@@ -385,29 +479,29 @@ const h = (t, e, ...a) => {
|
|
|
385
479
|
d && d.map((p) => {
|
|
386
480
|
try {
|
|
387
481
|
c[p](a, i, e);
|
|
388
|
-
} catch (
|
|
389
|
-
|
|
482
|
+
} catch (k) {
|
|
483
|
+
q(k, n);
|
|
390
484
|
}
|
|
391
485
|
});
|
|
392
486
|
}
|
|
393
487
|
if ((o & 18) === 2) {
|
|
394
488
|
if (c.componentShouldUpdate && c.componentShouldUpdate(a, i, e) === !1)
|
|
395
489
|
return;
|
|
396
|
-
|
|
490
|
+
Oe(r, !1);
|
|
397
491
|
}
|
|
398
492
|
}
|
|
399
493
|
}
|
|
400
|
-
},
|
|
494
|
+
}, xt = (t, e, a) => {
|
|
401
495
|
if (e.$members$) {
|
|
402
496
|
t.watchers && (e.$watchers$ = t.watchers);
|
|
403
497
|
const s = Object.entries(e.$members$), r = t.prototype;
|
|
404
498
|
s.map(([n, [i]]) => {
|
|
405
499
|
(i & 31 || i & 32) && Object.defineProperty(r, n, {
|
|
406
500
|
get() {
|
|
407
|
-
return
|
|
501
|
+
return wt(this, n);
|
|
408
502
|
},
|
|
409
503
|
set(o) {
|
|
410
|
-
|
|
504
|
+
Dt(this, n, o, e);
|
|
411
505
|
},
|
|
412
506
|
configurable: !0,
|
|
413
507
|
enumerable: !0
|
|
@@ -434,37 +528,37 @@ const h = (t, e, ...a) => {
|
|
|
434
528
|
}
|
|
435
529
|
}
|
|
436
530
|
return t;
|
|
437
|
-
},
|
|
531
|
+
}, St = async (t, e, a, s, r) => {
|
|
438
532
|
if ((e.$flags$ & 32) === 0 && (r = t.constructor, e.$flags$ |= 32, customElements.whenDefined(a.$tagName$).then(() => e.$flags$ |= 128), r.style)) {
|
|
439
533
|
let i = r.style;
|
|
440
|
-
typeof i != "string" && (i = i[e.$modeName$ =
|
|
534
|
+
typeof i != "string" && (i = i[e.$modeName$ = ct(t)]);
|
|
441
535
|
const o = Se(a, e.$modeName$);
|
|
442
536
|
if (!K.has(o)) {
|
|
443
537
|
const c = T("registerStyles", a.$tagName$);
|
|
444
|
-
|
|
538
|
+
ht(o, i, !!(a.$flags$ & 1)), c();
|
|
445
539
|
}
|
|
446
540
|
}
|
|
447
|
-
e.$ancestorComponent$,
|
|
448
|
-
},
|
|
449
|
-
},
|
|
541
|
+
e.$ancestorComponent$, Oe(e, !0);
|
|
542
|
+
}, Mt = (t) => {
|
|
543
|
+
}, Ct = (t) => {
|
|
450
544
|
if ((b.$flags$ & 1) === 0) {
|
|
451
545
|
const e = J(t), a = e.$cmpMeta$, s = T("connectedCallback", a.$tagName$);
|
|
452
|
-
e.$flags$ & 1 ? (
|
|
546
|
+
e.$flags$ & 1 ? (Ie(t, e, a.$listeners$), Mt(e.$lazyInstance$)) : (e.$flags$ |= 1, a.$flags$ & 12 && Tt(t), a.$members$ && Object.entries(a.$members$).map(([r, [n]]) => {
|
|
453
547
|
if (n & 31 && t.hasOwnProperty(r)) {
|
|
454
548
|
const i = t[r];
|
|
455
549
|
delete t[r], t[r] = i;
|
|
456
550
|
}
|
|
457
|
-
}),
|
|
551
|
+
}), St(t, e, a)), s();
|
|
458
552
|
}
|
|
459
|
-
},
|
|
553
|
+
}, Tt = (t) => {
|
|
460
554
|
const e = t["s-cr"] = w.createComment("");
|
|
461
555
|
e["s-cn"] = !0, t.insertBefore(e, t.firstChild);
|
|
462
|
-
},
|
|
556
|
+
}, Lt = (t) => {
|
|
463
557
|
if ((b.$flags$ & 1) === 0) {
|
|
464
558
|
const e = J(t);
|
|
465
559
|
e.$rmListeners$ && (e.$rmListeners$.map((a) => a()), e.$rmListeners$ = void 0);
|
|
466
560
|
}
|
|
467
|
-
},
|
|
561
|
+
}, Et = (t, e) => {
|
|
468
562
|
const a = {
|
|
469
563
|
$flags$: e[0],
|
|
470
564
|
$tagName$: e[1]
|
|
@@ -473,13 +567,13 @@ const h = (t, e, ...a) => {
|
|
|
473
567
|
const s = t.prototype.connectedCallback, r = t.prototype.disconnectedCallback;
|
|
474
568
|
return Object.assign(t.prototype, {
|
|
475
569
|
__registerHost() {
|
|
476
|
-
|
|
570
|
+
It(this, a);
|
|
477
571
|
},
|
|
478
572
|
connectedCallback() {
|
|
479
|
-
|
|
573
|
+
Ct(this), s && s.call(this);
|
|
480
574
|
},
|
|
481
575
|
disconnectedCallback() {
|
|
482
|
-
|
|
576
|
+
Lt(this), r && r.call(this);
|
|
483
577
|
},
|
|
484
578
|
__attachShadow() {
|
|
485
579
|
this.attachShadow({
|
|
@@ -487,30 +581,30 @@ const h = (t, e, ...a) => {
|
|
|
487
581
|
delegatesFocus: !!(a.$flags$ & 16)
|
|
488
582
|
});
|
|
489
583
|
}
|
|
490
|
-
}), t.is = a.$tagName$,
|
|
491
|
-
},
|
|
584
|
+
}), t.is = a.$tagName$, xt(t, a);
|
|
585
|
+
}, Ie = (t, e, a, s) => {
|
|
492
586
|
a && a.map(([r, n, i]) => {
|
|
493
|
-
const o =
|
|
587
|
+
const o = Bt(t, r), c = Rt(e, i), l = Ot(r);
|
|
494
588
|
b.ael(o, n, c, l), (e.$rmListeners$ = e.$rmListeners$ || []).push(() => b.rel(o, n, c, l));
|
|
495
589
|
});
|
|
496
|
-
},
|
|
590
|
+
}, Rt = (t, e) => (a) => {
|
|
497
591
|
try {
|
|
498
|
-
|
|
592
|
+
R.lazyLoad || t.$hostElement$[e](a);
|
|
499
593
|
} catch (s) {
|
|
500
|
-
|
|
594
|
+
q(s);
|
|
501
595
|
}
|
|
502
|
-
},
|
|
596
|
+
}, Bt = (t, e) => e & 4 ? w : e & 8 ? V : e & 16 ? w.body : t, Ot = (t) => Ft ? {
|
|
503
597
|
passive: (t & 1) !== 0,
|
|
504
598
|
capture: (t & 2) !== 0
|
|
505
|
-
} : (t & 2) !== 0,
|
|
599
|
+
} : (t & 2) !== 0, Ae = /* @__PURE__ */ new WeakMap(), J = (t) => Ae.get(t), It = (t, e) => {
|
|
506
600
|
const a = {
|
|
507
601
|
$flags$: 0,
|
|
508
602
|
$hostElement$: t,
|
|
509
603
|
$cmpMeta$: e,
|
|
510
604
|
$instanceValues$: /* @__PURE__ */ new Map()
|
|
511
605
|
};
|
|
512
|
-
return
|
|
513
|
-
},
|
|
606
|
+
return Ie(t, a, e.$listeners$), Ae.set(t, a);
|
|
607
|
+
}, ge = (t, e) => e in t, q = (t, e) => (0, console.error)(t, e), K = /* @__PURE__ */ new Map(), At = [], V = typeof window < "u" ? window : {}, w = V.document || { head: {} }, Nt = V.HTMLElement || class {
|
|
514
608
|
}, b = {
|
|
515
609
|
$flags$: 0,
|
|
516
610
|
$resourcesUrl$: "",
|
|
@@ -519,7 +613,7 @@ const h = (t, e, ...a) => {
|
|
|
519
613
|
ael: (t, e, a, s) => t.addEventListener(e, a, s),
|
|
520
614
|
rel: (t, e, a, s) => t.removeEventListener(e, a, s),
|
|
521
615
|
ce: (t, e) => new CustomEvent(t, e)
|
|
522
|
-
},
|
|
616
|
+
}, Ft = /* @__PURE__ */ (() => {
|
|
523
617
|
let t = !1;
|
|
524
618
|
try {
|
|
525
619
|
w.addEventListener("e", null, Object.defineProperty({}, "passive", {
|
|
@@ -530,92 +624,92 @@ const h = (t, e, ...a) => {
|
|
|
530
624
|
} catch {
|
|
531
625
|
}
|
|
532
626
|
return t;
|
|
533
|
-
})(),
|
|
627
|
+
})(), Pt = (t) => Promise.resolve(t), qt = /* @__PURE__ */ (() => {
|
|
534
628
|
try {
|
|
535
629
|
return new CSSStyleSheet(), typeof new CSSStyleSheet().replaceSync == "function";
|
|
536
630
|
} catch {
|
|
537
631
|
}
|
|
538
632
|
return !1;
|
|
539
|
-
})(), ke = [],
|
|
540
|
-
t.push(a), te || (te = !0, e && b.$flags$ & 4 ?
|
|
541
|
-
},
|
|
633
|
+
})(), ke = [], Ne = [], Yt = (t, e) => (a) => {
|
|
634
|
+
t.push(a), te || (te = !0, e && b.$flags$ & 4 ? Ut(ae) : b.raf(ae));
|
|
635
|
+
}, ve = (t) => {
|
|
542
636
|
for (let e = 0; e < t.length; e++)
|
|
543
637
|
try {
|
|
544
638
|
t[e](performance.now());
|
|
545
639
|
} catch (a) {
|
|
546
|
-
|
|
640
|
+
q(a);
|
|
547
641
|
}
|
|
548
642
|
t.length = 0;
|
|
549
643
|
}, ae = () => {
|
|
550
|
-
|
|
551
|
-
},
|
|
644
|
+
ve(ke), ve(Ne), (te = ke.length > 0) && b.raf(ae);
|
|
645
|
+
}, Ut = (t) => Pt().then(t), Wt = /* @__PURE__ */ Yt(Ne, !0);
|
|
552
646
|
function U(t, e) {
|
|
553
647
|
const a = new Date(t);
|
|
554
648
|
return a.setDate(a.getDate() + e), a;
|
|
555
649
|
}
|
|
556
|
-
function
|
|
557
|
-
const s = [], r =
|
|
650
|
+
function Ht(t, e, a) {
|
|
651
|
+
const s = [], r = G(t), n = r.getDay() === 0 ? 7 : r.getDay(), i = N(t), o = i.getDay() === 0 ? 7 : i.getDay(), c = a === 1 ? 7 : a - 1, l = [], u = [];
|
|
558
652
|
{
|
|
559
|
-
let
|
|
560
|
-
for (;
|
|
561
|
-
l.push(_), _ =
|
|
653
|
+
let k = (7 - a + n) % 7, _ = Q(r);
|
|
654
|
+
for (; k > 0; )
|
|
655
|
+
l.push(_), _ = Q(_), k -= 1;
|
|
562
656
|
l.reverse();
|
|
563
|
-
let L = (7 - o + c) % 7, E =
|
|
657
|
+
let L = (7 - o + c) % 7, E = F(i);
|
|
564
658
|
for (; L > 0; )
|
|
565
|
-
u.push(E), E =
|
|
659
|
+
u.push(E), E = F(E), L -= 1;
|
|
566
660
|
}
|
|
567
661
|
let d = r;
|
|
568
662
|
for (; d.getMonth() === t.getMonth(); )
|
|
569
|
-
s.push(d), d =
|
|
663
|
+
s.push(d), d = F(d);
|
|
570
664
|
return [...l, ...s, ...u];
|
|
571
665
|
}
|
|
572
|
-
function
|
|
573
|
-
return
|
|
666
|
+
function G(t) {
|
|
667
|
+
return v(/* @__PURE__ */ new Date(`${String(Pe(t)).padStart(4, "0")}-${String(Fe(t)).padStart(2, "0")}-01`));
|
|
574
668
|
}
|
|
575
|
-
function
|
|
669
|
+
function M(t) {
|
|
576
670
|
if (t instanceof Date)
|
|
577
671
|
return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
|
|
578
672
|
}
|
|
579
|
-
function
|
|
580
|
-
const e =
|
|
673
|
+
function N(t) {
|
|
674
|
+
const e = G(t);
|
|
581
675
|
return e.setMonth(e.getMonth() + 1), e.setDate(e.getDate() - 1), e;
|
|
582
676
|
}
|
|
583
|
-
function
|
|
677
|
+
function Fe(t) {
|
|
584
678
|
return t.getMonth() + 1;
|
|
585
679
|
}
|
|
586
|
-
function
|
|
680
|
+
function jt(t) {
|
|
587
681
|
return new Array(12).fill(void 0).map((e, a) => {
|
|
588
|
-
const s =
|
|
682
|
+
const s = v(/* @__PURE__ */ new Date(`2006-${String(a + 1).padStart(2, "0")}-01`));
|
|
589
683
|
return Intl.DateTimeFormat(t, {
|
|
590
684
|
month: "long"
|
|
591
685
|
}).format(s);
|
|
592
686
|
});
|
|
593
687
|
}
|
|
594
|
-
function
|
|
688
|
+
function F(t) {
|
|
595
689
|
return U(t, 1);
|
|
596
690
|
}
|
|
597
|
-
function
|
|
691
|
+
function Z(t) {
|
|
598
692
|
const e = new Date(t);
|
|
599
693
|
return e.setDate(1), e.setMonth(e.getMonth() + 1), e;
|
|
600
694
|
}
|
|
601
|
-
function
|
|
695
|
+
function be(t) {
|
|
602
696
|
const e = new Date(t);
|
|
603
697
|
return e.setFullYear(e.getFullYear() + 1), e;
|
|
604
698
|
}
|
|
605
|
-
function
|
|
699
|
+
function Q(t) {
|
|
606
700
|
return W(t, 1);
|
|
607
701
|
}
|
|
608
702
|
function ee(t) {
|
|
609
703
|
const e = new Date(t);
|
|
610
704
|
return e.setDate(1), e.setMonth(e.getMonth() - 1), e;
|
|
611
705
|
}
|
|
612
|
-
function
|
|
706
|
+
function $e(t) {
|
|
613
707
|
const e = new Date(t);
|
|
614
708
|
return e.setFullYear(e.getFullYear() - 1), e;
|
|
615
709
|
}
|
|
616
|
-
function
|
|
710
|
+
function zt(t, e) {
|
|
617
711
|
return new Array(7).fill(void 0).map((a, s) => (t + s) % 7 + 1).map((a) => {
|
|
618
|
-
const s =
|
|
712
|
+
const s = v(/* @__PURE__ */ new Date(`2006-01-0${a}`));
|
|
619
713
|
return [
|
|
620
714
|
Intl.DateTimeFormat(e, {
|
|
621
715
|
weekday: "short"
|
|
@@ -626,19 +720,19 @@ function Yt(t, e) {
|
|
|
626
720
|
];
|
|
627
721
|
});
|
|
628
722
|
}
|
|
629
|
-
function
|
|
723
|
+
function Pe(t) {
|
|
630
724
|
return t.getFullYear();
|
|
631
725
|
}
|
|
632
|
-
function
|
|
726
|
+
function _e(t, e) {
|
|
633
727
|
if (!t || !e || !e.from || !e.to)
|
|
634
728
|
return !1;
|
|
635
729
|
const a = e.from < e.to ? e.from : e.to, s = e.from < e.to ? e.to : e.from;
|
|
636
730
|
return t >= a && t <= s;
|
|
637
731
|
}
|
|
638
|
-
function
|
|
732
|
+
function x(t, e) {
|
|
639
733
|
return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
640
734
|
}
|
|
641
|
-
function
|
|
735
|
+
function v(t) {
|
|
642
736
|
const e = new Date(t);
|
|
643
737
|
return e.setMinutes(e.getMinutes() + e.getTimezoneOffset()), e;
|
|
644
738
|
}
|
|
@@ -646,7 +740,7 @@ function W(t, e) {
|
|
|
646
740
|
const a = new Date(t);
|
|
647
741
|
return a.setDate(a.getDate() - e), a;
|
|
648
742
|
}
|
|
649
|
-
const
|
|
743
|
+
const Kt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);clip-path:inset(50%)}", Gt = {
|
|
650
744
|
clearButton: "Clear value",
|
|
651
745
|
monthSelect: "Select month",
|
|
652
746
|
nextMonthButton: "Next month",
|
|
@@ -656,18 +750,18 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
656
750
|
previousYearButton: "Previous year",
|
|
657
751
|
todayButton: "Show today",
|
|
658
752
|
yearSelect: "Select year"
|
|
659
|
-
},
|
|
753
|
+
}, Qt = /* @__PURE__ */ Et(class extends Nt {
|
|
660
754
|
constructor() {
|
|
661
|
-
super(), this.__registerHost(), this.selectDate =
|
|
662
|
-
this.currentDate = this.startDate ?
|
|
755
|
+
super(), this.__registerHost(), this.selectDate = de(this, "selectDate"), this.changeMonth = de(this, "changeMonth"), this.disabled = !1, this.disableDate = () => !1, this.elementClassName = "wc-datepicker", this.firstDayOfWeek = 0, this.goToRangeStartOnSelect = !0, this.labels = Gt, this.locale = navigator?.language || "en-US", this.maxSearchDays = 365, this.showClearButton = !1, this.showMonthStepper = !0, this.showTodayButton = !1, this.showYearStepper = !1, this.startDate = M(/* @__PURE__ */ new Date()), this.pendingClick = !1, this.init = () => {
|
|
756
|
+
this.currentDate = this.startDate ? v(new Date(this.startDate)) : /* @__PURE__ */ new Date(), this.updateWeekdays(), this.handleMinDate(), this.handleMaxDate();
|
|
663
757
|
}, this.getAvailableDate = (t, e) => {
|
|
664
758
|
let a, s = !1;
|
|
665
759
|
switch (e) {
|
|
666
760
|
case "previousDay":
|
|
667
|
-
a =
|
|
761
|
+
a = Q(t);
|
|
668
762
|
break;
|
|
669
763
|
case "nextDay":
|
|
670
|
-
a =
|
|
764
|
+
a = F(t);
|
|
671
765
|
break;
|
|
672
766
|
case "previousSameWeekDay":
|
|
673
767
|
a = W(t, 7);
|
|
@@ -676,29 +770,29 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
676
770
|
a = U(t, 7);
|
|
677
771
|
break;
|
|
678
772
|
case "firstOfMonth":
|
|
679
|
-
a =
|
|
773
|
+
a = G(t);
|
|
680
774
|
break;
|
|
681
775
|
case "lastOfMonth":
|
|
682
|
-
a =
|
|
776
|
+
a = N(t);
|
|
683
777
|
break;
|
|
684
778
|
case "previousMonth":
|
|
685
779
|
a = ee(t);
|
|
686
780
|
break;
|
|
687
781
|
case "nextMonth":
|
|
688
|
-
a =
|
|
782
|
+
a = Z(t);
|
|
689
783
|
break;
|
|
690
784
|
case "previousYear":
|
|
691
|
-
a =
|
|
785
|
+
a = $e(t);
|
|
692
786
|
break;
|
|
693
787
|
case "nextYear":
|
|
694
|
-
a =
|
|
788
|
+
a = be(t);
|
|
695
789
|
break;
|
|
696
790
|
}
|
|
697
791
|
for (; this.disableDate(a) && !s; ) {
|
|
698
792
|
switch (e) {
|
|
699
793
|
case "previousDay":
|
|
700
794
|
case "lastOfMonth":
|
|
701
|
-
a =
|
|
795
|
+
a = Q(a);
|
|
702
796
|
break;
|
|
703
797
|
case "nextDay":
|
|
704
798
|
case "firstOfMonth":
|
|
@@ -706,7 +800,7 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
706
800
|
case "nextMonth":
|
|
707
801
|
case "previousYear":
|
|
708
802
|
case "nextYear":
|
|
709
|
-
a =
|
|
803
|
+
a = F(a);
|
|
710
804
|
break;
|
|
711
805
|
case "previousSameWeekDay":
|
|
712
806
|
a = W(a, 7);
|
|
@@ -729,7 +823,7 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
729
823
|
s = a.getMonth() !== t.getMonth() + 1;
|
|
730
824
|
break;
|
|
731
825
|
default:
|
|
732
|
-
s = !
|
|
826
|
+
s = !_e(a, {
|
|
733
827
|
from: W(t, this.maxSearchDays),
|
|
734
828
|
to: U(t, this.maxSearchDays)
|
|
735
829
|
});
|
|
@@ -738,13 +832,13 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
738
832
|
}
|
|
739
833
|
return s ? t : a;
|
|
740
834
|
}, this.nextMonth = () => {
|
|
741
|
-
this.updateCurrentDate(
|
|
835
|
+
this.updateCurrentDate(Z(this.currentDate));
|
|
742
836
|
}, this.nextYear = () => {
|
|
743
|
-
this.updateCurrentDate(
|
|
837
|
+
this.updateCurrentDate(be(this.currentDate));
|
|
744
838
|
}, this.previousMonth = () => {
|
|
745
839
|
this.updateCurrentDate(ee(this.currentDate));
|
|
746
840
|
}, this.previousYear = () => {
|
|
747
|
-
this.updateCurrentDate(
|
|
841
|
+
this.updateCurrentDate($e(this.currentDate));
|
|
748
842
|
}, this.showToday = () => {
|
|
749
843
|
this.updateCurrentDate(/* @__PURE__ */ new Date());
|
|
750
844
|
}, this.clear = () => {
|
|
@@ -756,10 +850,10 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
756
850
|
const e = t.target.closest("[data-date]");
|
|
757
851
|
if (!e)
|
|
758
852
|
return;
|
|
759
|
-
const a =
|
|
853
|
+
const a = v(new Date(e.dataset.date));
|
|
760
854
|
this.isDateDisabled(a) || (this.updateCurrentDate(a), this.onSelectDate(a));
|
|
761
855
|
}, this.onMonthSelect = (t) => {
|
|
762
|
-
const e = +t.target.value - 1, a = this.currentDate.getDate(), s = new Date(this.currentDate.getFullYear(), e, 1), r =
|
|
856
|
+
const e = +t.target.value - 1, a = this.currentDate.getDate(), s = new Date(this.currentDate.getFullYear(), e, 1), r = N(s).getDate(), n = Math.min(a, r), i = new Date(this.currentDate.getFullYear(), e, n);
|
|
763
857
|
this.updateCurrentDate(i);
|
|
764
858
|
}, this.onYearSelect = (t) => {
|
|
765
859
|
let e = +t.target.value;
|
|
@@ -767,14 +861,14 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
767
861
|
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
862
|
const s = this.currentDate.getDate(), r = this.currentDate.getMonth(), n = /* @__PURE__ */ new Date();
|
|
769
863
|
n.setFullYear(e, r, 1);
|
|
770
|
-
const i =
|
|
864
|
+
const i = N(n).getDate(), o = Math.min(s, i), c = /* @__PURE__ */ new Date();
|
|
771
865
|
c.setFullYear(e, r, o), this.updateCurrentDate(c);
|
|
772
866
|
}, this.onKeyDown = (t) => {
|
|
773
867
|
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
868
|
}, this.onMouseEnter = (t) => {
|
|
775
869
|
if (this.disabled)
|
|
776
870
|
return;
|
|
777
|
-
const e =
|
|
871
|
+
const e = v(new Date(t.target.closest("td").dataset.date));
|
|
778
872
|
this.hoveredDate = e;
|
|
779
873
|
}, this.onMouseLeave = () => {
|
|
780
874
|
this.hoveredDate = void 0;
|
|
@@ -783,8 +877,8 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
783
877
|
}, this.onFocus = (t) => {
|
|
784
878
|
if (this.pendingClick)
|
|
785
879
|
return;
|
|
786
|
-
const e =
|
|
787
|
-
|
|
880
|
+
const e = v(new Date(t.target.dataset.date));
|
|
881
|
+
x(e, this.currentDate) || this.updateCurrentDate(e);
|
|
788
882
|
};
|
|
789
883
|
}
|
|
790
884
|
componentWillLoad() {
|
|
@@ -800,28 +894,28 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
800
894
|
this.value = void 0, this.selectDate.emit(void 0);
|
|
801
895
|
}
|
|
802
896
|
watchStartDate() {
|
|
803
|
-
this.currentDate = this.startDate ?
|
|
897
|
+
this.currentDate = this.startDate ? v(new Date(this.startDate)) : /* @__PURE__ */ new Date();
|
|
804
898
|
}
|
|
805
899
|
watchValue() {
|
|
806
900
|
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
901
|
}
|
|
808
902
|
handleMinDate() {
|
|
809
|
-
this.minDate && this.currentDate <
|
|
903
|
+
this.minDate && this.currentDate < v(new Date(this.minDate)) && (this.currentDate = v(new Date(this.minDate)));
|
|
810
904
|
}
|
|
811
905
|
handleMaxDate() {
|
|
812
|
-
this.maxDate && this.currentDate >
|
|
906
|
+
this.maxDate && this.currentDate > v(new Date(this.maxDate)) && (this.currentDate = v(new Date(this.maxDate)));
|
|
813
907
|
}
|
|
814
908
|
componentDidRender() {
|
|
815
909
|
this.moveFocusAfterMonthChanged && (this.focusDate(this.currentDate), this.moveFocusAfterMonthChanged = !1);
|
|
816
910
|
}
|
|
817
911
|
updateWeekdays() {
|
|
818
|
-
this.weekdays =
|
|
912
|
+
this.weekdays = zt(this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek, this.locale);
|
|
819
913
|
}
|
|
820
914
|
getClassName(t) {
|
|
821
915
|
return t ? `${this.elementClassName}__${t}` : this.elementClassName;
|
|
822
916
|
}
|
|
823
917
|
getCalendarRows() {
|
|
824
|
-
const t =
|
|
918
|
+
const t = Ht(this.currentDate, !0, this.firstDayOfWeek === 0 ? 7 : this.firstDayOfWeek), e = [];
|
|
825
919
|
for (let a = 0; a < t.length; a += 7) {
|
|
826
920
|
const s = t.slice(a, a + 7);
|
|
827
921
|
e.push(s);
|
|
@@ -850,15 +944,15 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
850
944
|
}
|
|
851
945
|
focusDate(t) {
|
|
852
946
|
var e;
|
|
853
|
-
(e = this.el.querySelector(`[data-date="${
|
|
947
|
+
(e = this.el.querySelector(`[data-date="${M(t)}"]`)) === null || e === void 0 || e.focus();
|
|
854
948
|
}
|
|
855
949
|
updateCurrentDate(t, e) {
|
|
856
950
|
const a = t.getMonth(), s = t.getFullYear();
|
|
857
951
|
if (s > 9999 || s < 0)
|
|
858
952
|
return;
|
|
859
953
|
(a !== this.currentDate.getMonth() || s !== this.currentDate.getFullYear()) && (this.changeMonth.emit({
|
|
860
|
-
month:
|
|
861
|
-
year:
|
|
954
|
+
month: Fe(t),
|
|
955
|
+
year: Pe(t),
|
|
862
956
|
day: t.getDate()
|
|
863
957
|
}), e && (this.moveFocusAfterMonthChanged = !0)), this.currentDate = t, e && this.focusDate(this.currentDate);
|
|
864
958
|
}
|
|
@@ -868,12 +962,12 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
868
962
|
if (this.isRangeValue(this.value)) {
|
|
869
963
|
const s = ((e = this.value) === null || e === void 0 ? void 0 : e[0]) === void 0 || this.value.length === 2 ? [t] : [this.value[0], t];
|
|
870
964
|
s.length === 2 && s[0] > s[1] && s.reverse();
|
|
871
|
-
const r = s[1] === void 0 ? [
|
|
965
|
+
const r = s[1] === void 0 ? [M(s[0])] : [M(s[0]), M(s[1])];
|
|
872
966
|
this.value = s, this.selectDate.emit(r);
|
|
873
967
|
} else {
|
|
874
968
|
if (((a = this.value) === null || a === void 0 ? void 0 : a.getTime()) === t.getTime())
|
|
875
969
|
return;
|
|
876
|
-
this.value = t, this.selectDate.emit(
|
|
970
|
+
this.value = t, this.selectDate.emit(M(t));
|
|
877
971
|
}
|
|
878
972
|
}
|
|
879
973
|
// @ts-ignore
|
|
@@ -883,19 +977,19 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
883
977
|
get isPreviousMonthDisabled() {
|
|
884
978
|
if (!this.minDate)
|
|
885
979
|
return !1;
|
|
886
|
-
const t = ee(this.currentDate), e =
|
|
887
|
-
return
|
|
980
|
+
const t = ee(this.currentDate), e = v(new Date(this.minDate));
|
|
981
|
+
return N(t) < e;
|
|
888
982
|
}
|
|
889
983
|
get isNextMonthDisabled() {
|
|
890
984
|
if (!this.maxDate)
|
|
891
985
|
return !1;
|
|
892
|
-
const t =
|
|
893
|
-
return
|
|
986
|
+
const t = Z(this.currentDate), e = v(new Date(this.maxDate));
|
|
987
|
+
return G(t) > e;
|
|
894
988
|
}
|
|
895
989
|
isDateDisabled(t) {
|
|
896
990
|
if (this.disableDate(t))
|
|
897
991
|
return !0;
|
|
898
|
-
const e = this.minDate && t <
|
|
992
|
+
const e = this.minDate && t < v(new Date(this.minDate)), a = this.maxDate && t > v(new Date(this.maxDate));
|
|
899
993
|
return !!(e || a);
|
|
900
994
|
}
|
|
901
995
|
render() {
|
|
@@ -906,20 +1000,20 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
906
1000
|
}, role: "group" }, h("div", { class: this.getClassName("header") }, h("span", { "aria-atomic": "true", "aria-live": "polite", class: "visually-hidden" }, this.getTitle()), this.showYearStepper && h("button", { "aria-label": this.labels.previousYearButton, class: this.getClassName("previous-year-button"), disabled: this.disabled, innerHTML: this.previousYearButtonContent || void 0, onClick: this.previousYear, 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: "11 17 6 12 11 7" }), h("polyline", { points: "18 17 13 12 18 7" }))), this.showMonthStepper && h("button", { "aria-label": this.labels.previousMonthButton, class: {
|
|
907
1001
|
[this.getClassName("previous-month-button")]: !0,
|
|
908
1002
|
[this.getClassName("next-month-button--disabled")]: this.isPreviousMonthDisabled
|
|
909
|
-
}, disabled: this.disabled || this.isPreviousMonthDisabled, innerHTML: this.previousMonthButtonContent || void 0, onClick: this.previousMonth, 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: "15 18 9 12 15 6" }))), h("span", { class: this.getClassName("current-month") }, h("select", { title: this.labels.monthSelect, "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), disabled: this.disabled, onChange: this.onMonthSelect },
|
|
1003
|
+
}, disabled: this.disabled || this.isPreviousMonthDisabled, innerHTML: this.previousMonthButtonContent || void 0, onClick: this.previousMonth, 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: "15 18 9 12 15 6" }))), h("span", { class: this.getClassName("current-month") }, h("select", { title: this.labels.monthSelect, "aria-label": this.labels.monthSelect, class: this.getClassName("month-select"), disabled: this.disabled, onChange: this.onMonthSelect }, jt(this.locale).map((e, a) => h("option", { key: e, selected: this.currentDate.getMonth() === a, value: a + 1 }, e))), h("input", { title: this.labels.yearSelect, "aria-label": this.labels.yearSelect, class: this.getClassName("year-select"), disabled: this.disabled, max: 9999, maxLength: 4, min: 1, onChange: this.onYearSelect, type: "number", value: this.currentDate.getFullYear() })), this.showMonthStepper && h("button", { "aria-label": this.labels.nextMonthButton, class: {
|
|
910
1004
|
[this.getClassName("next-month-button")]: !0,
|
|
911
1005
|
[this.getClassName("next-month-button--disabled")]: this.isNextMonthDisabled
|
|
912
1006
|
}, 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
1007
|
const a = `row-${e[0].getMonth()}-${e[0].getDate()}`;
|
|
914
1008
|
return h("tr", { class: this.getClassName("calendar-row"), key: a }, e.map((s) => {
|
|
915
1009
|
var r, n, i, o, c;
|
|
916
|
-
const l =
|
|
1010
|
+
const l = x(s, this.currentDate), u = s.getMonth() !== this.currentDate.getMonth(), d = Array.isArray(this.value) ? x(s, this.value[0]) || x(s, this.value[1]) : x(s, this.value), p = this.isRangeValue ? _e(s, {
|
|
917
1011
|
from: (r = this.value) === null || r === void 0 ? void 0 : r[0],
|
|
918
1012
|
to: ((n = this.value) === null || n === void 0 ? void 0 : n[1]) || this.hoveredDate || this.currentDate
|
|
919
|
-
}) : !1,
|
|
1013
|
+
}) : !1, k = !((i = this.value) === null || i === void 0) && i[0] ? [
|
|
920
1014
|
(o = this.value) === null || o === void 0 ? void 0 : o[0],
|
|
921
1015
|
((c = this.value) === null || c === void 0 ? void 0 : c[1]) || this.hoveredDate
|
|
922
|
-
].sort((We,
|
|
1016
|
+
].sort((We, He) => We - He) : [], _ = this.range && x(k[0], s), S = this.range && x(k[1], s), L = x(s, /* @__PURE__ */ new Date()), E = this.isDateDisabled(s), qe = `cell-${s.getMonth()}-${s.getDate()}`, Ye = {
|
|
923
1017
|
[this.getClassName("date")]: !0,
|
|
924
1018
|
[this.getClassName("date--current")]: l,
|
|
925
1019
|
[this.getClassName("date--disabled")]: E,
|
|
@@ -930,7 +1024,7 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
930
1024
|
[this.getClassName("date--start")]: _,
|
|
931
1025
|
[this.getClassName("date--end")]: S
|
|
932
1026
|
}, Ue = d ? "strong" : L ? "em" : "span";
|
|
933
|
-
return h("td", { "aria-disabled": String(E), "aria-selected": d ? "true" : void 0, "aria-current": L ? "date" : d ? "true" : void 0, class:
|
|
1027
|
+
return h("td", { "aria-disabled": String(E), "aria-selected": d ? "true" : void 0, "aria-current": L ? "date" : d ? "true" : void 0, class: Ye, "data-date": M(s), key: qe, onClick: this.onClick, onMouseDown: this.onMouseDown, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave, onFocus: this.onFocus, role: "gridcell", tabIndex: x(s, this.currentDate) && !this.disabled ? 0 : -1 }, h(Ue, { "aria-hidden": "true" }, s.getDate()), h("span", { class: "visually-hidden" }, Intl.DateTimeFormat(this.locale, {
|
|
934
1028
|
day: "numeric",
|
|
935
1029
|
month: "long",
|
|
936
1030
|
year: "numeric"
|
|
@@ -953,7 +1047,7 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
953
1047
|
};
|
|
954
1048
|
}
|
|
955
1049
|
static get style() {
|
|
956
|
-
return
|
|
1050
|
+
return Kt;
|
|
957
1051
|
}
|
|
958
1052
|
}, [2, "wc-datepicker", {
|
|
959
1053
|
clearButtonContent: [1, "clear-button-content"],
|
|
@@ -982,29 +1076,35 @@ const Pt = ".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;
|
|
|
982
1076
|
currentDate: [32],
|
|
983
1077
|
hoveredDate: [32],
|
|
984
1078
|
weekdays: [32]
|
|
985
|
-
}]),
|
|
986
|
-
var
|
|
1079
|
+
}]), Xt = Qt;
|
|
1080
|
+
var Jt = Object.defineProperty, y = (t, e, a, s) => {
|
|
987
1081
|
for (var r = void 0, n = t.length - 1, i; n >= 0; n--)
|
|
988
1082
|
(i = t[n]) && (r = i(e, a, r) || r);
|
|
989
|
-
return r &&
|
|
1083
|
+
return r && Jt(e, a, r), r;
|
|
990
1084
|
};
|
|
991
|
-
customElements.get("wc-datepicker") || customElements.define("wc-datepicker",
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
const f = (x = class extends ne {
|
|
995
|
-
// allows use of elementInternals' API
|
|
1085
|
+
customElements.get("wc-datepicker") || customElements.define("wc-datepicker", Xt);
|
|
1086
|
+
var C;
|
|
1087
|
+
const f = (C = class extends Ze {
|
|
996
1088
|
constructor() {
|
|
997
|
-
super(), this.id = "", this.name = "", this.width = "full", 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) => {
|
|
1089
|
+
super(...arguments), this.id = "", this.name = "", this.width = "full", 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.DATEPICKER_GAP = 4, this._hasUserInteracted = !1, this._onKeydownEsc = (e) => {
|
|
998
1090
|
if (e.key !== "Escape" || e.code !== "Escape" || !this.datepickerIsOpen) return;
|
|
999
1091
|
e.preventDefault(), e.stopPropagation(), this.shadowRoot?.querySelector("wc-datepicker")?.classList.remove("active"), this.datepickerIsOpen = !1, this.removeEventListener("keydown", this._handleFocusTrap), this.shadowRoot?.querySelector("input")?.focus();
|
|
1000
|
-
}, this.
|
|
1092
|
+
}, this._handleScrollReposition = () => {
|
|
1093
|
+
this.datepickerIsOpen && this._positionDatepicker();
|
|
1094
|
+
};
|
|
1001
1095
|
}
|
|
1002
|
-
//
|
|
1096
|
+
// need this flag for "eager mode"
|
|
1097
|
+
/**
|
|
1098
|
+
* Lifecycle methods
|
|
1099
|
+
* --------------------------------------------------------------------------
|
|
1100
|
+
* Form association, ElementInternals, and id generation are provided by
|
|
1101
|
+
* NysFormControlElement (@nysds/internals).
|
|
1102
|
+
*/
|
|
1003
1103
|
connectedCallback() {
|
|
1004
|
-
super.connectedCallback(), this.
|
|
1104
|
+
super.connectedCallback(), this.addEventListener("invalid", this._handleInvalid), this.addEventListener("focusout", this._handleBlur), this.addEventListener("keydown", this._onKeydownEsc);
|
|
1005
1105
|
}
|
|
1006
1106
|
disconnectedCallback() {
|
|
1007
|
-
super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid), this.removeEventListener("focusout", this._handleBlur), this.removeEventListener("keydown", this._onKeydownEsc);
|
|
1107
|
+
super.disconnectedCallback(), this._stopDatepickerPositioning(), this.removeEventListener("invalid", this._handleInvalid), this.removeEventListener("focusout", this._handleBlur), this.removeEventListener("keydown", this._onKeydownEsc);
|
|
1008
1108
|
}
|
|
1009
1109
|
async firstUpdated() {
|
|
1010
1110
|
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));
|
|
@@ -1012,7 +1112,7 @@ const f = (x = class extends ne {
|
|
|
1012
1112
|
updated(e) {
|
|
1013
1113
|
if (super.updated(e), e.has("value")) {
|
|
1014
1114
|
const a = e.get("value"), s = this.value;
|
|
1015
|
-
!s && a !== s ? (this.
|
|
1115
|
+
!s && a !== s ? (this.setFormValue(""), this._manageRequire()) : s && this._setValue(s);
|
|
1016
1116
|
}
|
|
1017
1117
|
}
|
|
1018
1118
|
async _whenWcDatepickerReady() {
|
|
@@ -1037,7 +1137,7 @@ const f = (x = class extends ne {
|
|
|
1037
1137
|
*/
|
|
1038
1138
|
_setValue(e) {
|
|
1039
1139
|
if (!e) {
|
|
1040
|
-
this.value = void 0, this.
|
|
1140
|
+
this.value = void 0, this.setFormValue(""), this._manageRequire();
|
|
1041
1141
|
return;
|
|
1042
1142
|
}
|
|
1043
1143
|
const a = e instanceof Date ? e : this._parseLocalDate(e), s = [
|
|
@@ -1045,7 +1145,7 @@ const f = (x = class extends ne {
|
|
|
1045
1145
|
String(a.getMonth() + 1).padStart(2, "0"),
|
|
1046
1146
|
String(a.getDate()).padStart(2, "0")
|
|
1047
1147
|
].join("-");
|
|
1048
|
-
this.value = a, this.
|
|
1148
|
+
this.value = a, this.setFormValue(s);
|
|
1049
1149
|
const r = this.shadowRoot?.querySelector("input");
|
|
1050
1150
|
r && (r.value = s);
|
|
1051
1151
|
const n = this.shadowRoot?.querySelector("wc-datepicker");
|
|
@@ -1056,7 +1156,7 @@ const f = (x = class extends ne {
|
|
|
1056
1156
|
const e = this.shadowRoot?.querySelector("input");
|
|
1057
1157
|
if (!e) return;
|
|
1058
1158
|
const a = this.errorMessage || "This field is required.";
|
|
1059
|
-
this.required && !this.value ?
|
|
1159
|
+
this.required && !this.value ? this.setValidityFromState({ valueMissing: !0 }, a, e) : this.clearValidity();
|
|
1060
1160
|
}
|
|
1061
1161
|
/**
|
|
1062
1162
|
* Actively validates the component:
|
|
@@ -1083,20 +1183,15 @@ const f = (x = class extends ne {
|
|
|
1083
1183
|
}
|
|
1084
1184
|
// Sets custom validity message
|
|
1085
1185
|
_setValidityMessage(e = "") {
|
|
1086
|
-
if (!this._internals) return;
|
|
1087
1186
|
const a = this.shadowRoot?.querySelector("input");
|
|
1088
|
-
a && (!e && this.showError && this.errorMessage?.trim() || (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this.
|
|
1089
|
-
e ? { customError: !0 } : {},
|
|
1090
|
-
e,
|
|
1091
|
-
a
|
|
1092
|
-
)));
|
|
1187
|
+
a && (!e && this.showError && this.errorMessage?.trim() || (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), e ? this.setValidityFromState({ customError: !0 }, e, a) : this.clearValidity()));
|
|
1093
1188
|
}
|
|
1094
1189
|
// Handles native 'invalid' events
|
|
1095
1190
|
_handleInvalid(e) {
|
|
1096
1191
|
e.preventDefault(), this._hasUserInteracted = !0, this._validate();
|
|
1097
1192
|
const a = this.shadowRoot?.querySelector("input");
|
|
1098
1193
|
if (a) {
|
|
1099
|
-
const s = this.
|
|
1194
|
+
const s = this.internals?.form;
|
|
1100
1195
|
s ? Array.from(s.elements).find(
|
|
1101
1196
|
(i) => typeof i.checkValidity == "function" && !i.checkValidity()
|
|
1102
1197
|
) === this && a.focus() : a.focus();
|
|
@@ -1224,12 +1319,12 @@ const f = (x = class extends ne {
|
|
|
1224
1319
|
return;
|
|
1225
1320
|
}
|
|
1226
1321
|
const a = this.shadowRoot?.querySelector("wc-datepicker")?.classList.toggle("active");
|
|
1227
|
-
this.datepickerIsOpen = !!a, this.value || this._setFocusOnTodayDate(), this.addEventListener("keydown", this._handleFocusTrap);
|
|
1322
|
+
this.datepickerIsOpen = !!a, a ? (this.value || this._setFocusOnTodayDate(), this._startDatepickerPositioning(), this.addEventListener("keydown", this._handleFocusTrap)) : this._stopDatepickerPositioning();
|
|
1228
1323
|
}
|
|
1229
1324
|
_openDatepicker() {
|
|
1230
1325
|
if (this.disabled || this._shouldUseNativeDatepicker()) return;
|
|
1231
1326
|
const e = this.shadowRoot?.querySelector("wc-datepicker");
|
|
1232
|
-
e && (this.value || this._setFocusOnTodayDate(!0), e?.classList.add("active"), this.datepickerIsOpen = !0, this.addEventListener("keydown", this._handleFocusTrap));
|
|
1327
|
+
e && (this.value || this._setFocusOnTodayDate(!0), e?.classList.add("active"), this.datepickerIsOpen = !0, this._startDatepickerPositioning(), this.addEventListener("keydown", this._handleFocusTrap));
|
|
1233
1328
|
}
|
|
1234
1329
|
_handleDateChange() {
|
|
1235
1330
|
const e = this.shadowRoot?.querySelector("wc-datepicker");
|
|
@@ -1243,20 +1338,20 @@ const f = (x = class extends ne {
|
|
|
1243
1338
|
});
|
|
1244
1339
|
}
|
|
1245
1340
|
_handleTodayClick() {
|
|
1246
|
-
this.disabled || (this._setTodayDate(), this._hasUserInteracted
|
|
1341
|
+
this.disabled || (this._setTodayDate(), this._hasUserInteracted = !0, this._validate(), this._dispatchInputEvent());
|
|
1247
1342
|
}
|
|
1248
1343
|
_handleClearClick() {
|
|
1249
1344
|
if (this.disabled) return;
|
|
1250
|
-
this.value = void 0, this.
|
|
1345
|
+
this.value = void 0, this.setFormValue("");
|
|
1251
1346
|
const e = this.shadowRoot?.querySelector("input");
|
|
1252
|
-
e && (e.value = ""), this._hasUserInteracted
|
|
1347
|
+
e && (e.value = ""), this._hasUserInteracted = !0, this._validate(), this._dispatchInputEvent();
|
|
1253
1348
|
}
|
|
1254
1349
|
_handleInputChange(e) {
|
|
1255
1350
|
const a = e.target;
|
|
1256
1351
|
if (!a) return;
|
|
1257
1352
|
const s = this._getValidDateFromInput(a.value);
|
|
1258
1353
|
if (!s) {
|
|
1259
|
-
a.value || (this.value = void 0, this.
|
|
1354
|
+
a.value || (this.value = void 0, this.setFormValue(""), this._hasUserInteracted && this._validate());
|
|
1260
1355
|
return;
|
|
1261
1356
|
}
|
|
1262
1357
|
this._setValue(s), this._hasUserInteracted && this._validate(), this._dispatchInputEvent();
|
|
@@ -1308,10 +1403,37 @@ const f = (x = class extends ne {
|
|
|
1308
1403
|
_shouldUseNativeDatepicker() {
|
|
1309
1404
|
return this._isSafari() || this._isMobile();
|
|
1310
1405
|
}
|
|
1406
|
+
/**
|
|
1407
|
+
* Auto-Positioning
|
|
1408
|
+
* --------------------------------------------------------------------------
|
|
1409
|
+
* Opens the calendar below the input by default. If there isn't enough
|
|
1410
|
+
* room below (and there's more room above), it opens above instead.
|
|
1411
|
+
*/
|
|
1412
|
+
_positionDatepicker() {
|
|
1413
|
+
const e = this.shadowRoot?.querySelector("wc-datepicker"), a = this.shadowRoot?.querySelector(
|
|
1414
|
+
".nys-datepicker--input-container"
|
|
1415
|
+
), s = this.shadowRoot?.querySelector(
|
|
1416
|
+
".nys-datepicker--container"
|
|
1417
|
+
);
|
|
1418
|
+
if (!e || !a || !s) return;
|
|
1419
|
+
e.classList.remove("position-top"), e.style.top = "";
|
|
1420
|
+
const r = e?.getBoundingClientRect();
|
|
1421
|
+
if (window.innerHeight - r?.bottom < this.DATEPICKER_GAP) {
|
|
1422
|
+
const i = a.getBoundingClientRect(), o = s.getBoundingClientRect(), c = i.top - o.top - r.height - this.DATEPICKER_GAP;
|
|
1423
|
+
e.style.top = `${c}px`, e.classList.add("position-top");
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
_startDatepickerPositioning() {
|
|
1427
|
+
this._positionDatepicker(), window.addEventListener("scroll", this._handleScrollReposition, !0);
|
|
1428
|
+
}
|
|
1429
|
+
_stopDatepickerPositioning() {
|
|
1430
|
+
window.removeEventListener("scroll", this._handleScrollReposition, !0);
|
|
1431
|
+
}
|
|
1311
1432
|
render() {
|
|
1312
1433
|
const e = this._shouldUseNativeDatepicker();
|
|
1313
|
-
return
|
|
1434
|
+
return A` <div class="nys-datepicker--container">
|
|
1314
1435
|
<nys-label
|
|
1436
|
+
id="${this.id}--label"
|
|
1315
1437
|
label=${this.label}
|
|
1316
1438
|
description=${this.description}
|
|
1317
1439
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
@@ -1325,21 +1447,30 @@ const f = (x = class extends ne {
|
|
|
1325
1447
|
id=${this.id}
|
|
1326
1448
|
class="nys-datepicker--input"
|
|
1327
1449
|
type="date"
|
|
1328
|
-
min=${
|
|
1450
|
+
min=${D(this.minDate || void 0)}
|
|
1329
1451
|
max=${this.maxDate || "9999-12-31"}
|
|
1330
1452
|
?required=${this.required}
|
|
1331
1453
|
.value=${this.value instanceof Date ? this.value.toISOString().split("T")[0] : this.value || ""}
|
|
1332
1454
|
?disabled=${this.disabled}
|
|
1333
|
-
aria-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
aria-
|
|
1455
|
+
aria-labelledby=${D(
|
|
1456
|
+
this.label ? this.id + "--label" : void 0
|
|
1457
|
+
)}
|
|
1458
|
+
aria-label=${D(
|
|
1459
|
+
!this.label && this.ariaLabel ? this.ariaLabel : void 0
|
|
1460
|
+
)}
|
|
1461
|
+
aria-disabled=${D(this.disabled ? "true" : void 0)}
|
|
1462
|
+
aria-required=${D(this.required ? "true" : void 0)}
|
|
1463
|
+
aria-invalid=${this.showError ? "true" : "false"}
|
|
1464
|
+
aria-errormessage=${this.id + "--error"}
|
|
1465
|
+
aria-describedby=${D(
|
|
1466
|
+
this.showError ? this.id + "--error" : void 0
|
|
1467
|
+
)}
|
|
1337
1468
|
@click=${this._openDatepicker}
|
|
1338
1469
|
@input=${this._handleInputChange}
|
|
1339
1470
|
@blur=${this._handleBlur}
|
|
1340
1471
|
@keydown=${this._handleInputKeydown}
|
|
1341
1472
|
/>
|
|
1342
|
-
${e ? null :
|
|
1473
|
+
${e ? null : A`
|
|
1343
1474
|
<button
|
|
1344
1475
|
id="calendar-button"
|
|
1345
1476
|
@click=${this._toggleDatepicker}
|
|
@@ -1361,15 +1492,15 @@ const f = (x = class extends ne {
|
|
|
1361
1492
|
locale="en-US"
|
|
1362
1493
|
.value=${this.value instanceof Date ? this.value : this.value ? this._parseLocalDate(this.value) : void 0}
|
|
1363
1494
|
?disabled=${this.disabled}
|
|
1364
|
-
start-date=${
|
|
1365
|
-
min-date=${
|
|
1366
|
-
max-date=${
|
|
1495
|
+
start-date=${D(this.startDate ? this.startDate : void 0)}
|
|
1496
|
+
min-date=${D(this.minDate || void 0)}
|
|
1497
|
+
max-date=${D(this.maxDate || void 0)}
|
|
1367
1498
|
role="dialog"
|
|
1368
1499
|
aria-modal=${this.datepickerIsOpen ? "true" : "false"}
|
|
1369
1500
|
>
|
|
1370
|
-
${!this.hideTodayButton || !this.hideClearButton ?
|
|
1501
|
+
${!this.hideTodayButton || !this.hideClearButton ? A`
|
|
1371
1502
|
<div class="wc-datepicker--button-container">
|
|
1372
|
-
${this.hideTodayButton ? null :
|
|
1503
|
+
${this.hideTodayButton ? null : A`
|
|
1373
1504
|
<nys-button
|
|
1374
1505
|
label="Today"
|
|
1375
1506
|
size="sm"
|
|
@@ -1379,7 +1510,7 @@ const f = (x = class extends ne {
|
|
|
1379
1510
|
@nys-click=${this._handleTodayClick}
|
|
1380
1511
|
></nys-button>
|
|
1381
1512
|
`}
|
|
1382
|
-
${this.hideClearButton ? null :
|
|
1513
|
+
${this.hideClearButton ? null : A`
|
|
1383
1514
|
<nys-button
|
|
1384
1515
|
label="Clear"
|
|
1385
1516
|
size="sm"
|
|
@@ -1395,15 +1526,15 @@ const f = (x = class extends ne {
|
|
|
1395
1526
|
</div>
|
|
1396
1527
|
</div>
|
|
1397
1528
|
<nys-errormessage
|
|
1398
|
-
id=${
|
|
1529
|
+
id=${this.id + "--error"}
|
|
1399
1530
|
?showError=${this.showError}
|
|
1400
|
-
errorMessage=${this.
|
|
1531
|
+
errorMessage=${this.internals.validationMessage || this.errorMessage}
|
|
1401
1532
|
></nys-errormessage>`;
|
|
1402
1533
|
}
|
|
1403
|
-
},
|
|
1404
|
-
...
|
|
1534
|
+
}, C.styles = je(et), C.shadowRootOptions = {
|
|
1535
|
+
...me.shadowRootOptions,
|
|
1405
1536
|
delegatesFocus: !0
|
|
1406
|
-
},
|
|
1537
|
+
}, C);
|
|
1407
1538
|
y([
|
|
1408
1539
|
g({ type: String, reflect: !0 })
|
|
1409
1540
|
], f.prototype, "id");
|
|
@@ -1471,11 +1602,11 @@ y([
|
|
|
1471
1602
|
})
|
|
1472
1603
|
], f.prototype, "value");
|
|
1473
1604
|
y([
|
|
1474
|
-
|
|
1605
|
+
ze()
|
|
1475
1606
|
], f.prototype, "datepickerIsOpen");
|
|
1476
|
-
let
|
|
1477
|
-
customElements.get("nys-datepicker") || customElements.define("nys-datepicker",
|
|
1607
|
+
let Vt = f;
|
|
1608
|
+
customElements.get("nys-datepicker") || customElements.define("nys-datepicker", Vt);
|
|
1478
1609
|
export {
|
|
1479
|
-
|
|
1610
|
+
Vt as NysDatepicker
|
|
1480
1611
|
};
|
|
1481
1612
|
//# sourceMappingURL=nys-datepicker.js.map
|