@nysds/nys-textinput 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nys-textinput.d.ts +0 -4
- package/dist/nys-textinput.js +327 -1483
- package/dist/nys-textinput.js.map +1 -1
- package/package.json +7 -8
package/dist/nys-textinput.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import "@nysds/nys-icon";
|
|
3
|
-
import "@nysds/nys-label";
|
|
4
|
-
import "@nysds/nys-errormessage";
|
|
1
|
+
import { css as lt, LitElement as ht, html as F } from "lit";
|
|
5
2
|
/*!
|
|
6
3
|
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
7
4
|
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
@@ -17,18 +14,18 @@ import "@nysds/nys-errormessage";
|
|
|
17
14
|
* Copyright 2019 Google LLC
|
|
18
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
16
|
*/
|
|
20
|
-
const
|
|
21
|
-
let
|
|
17
|
+
const O = globalThis, D = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, it = Symbol(), Y = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let dt = class {
|
|
22
19
|
constructor(t, e, s) {
|
|
23
|
-
if (this._$cssResult$ = !0, s !==
|
|
20
|
+
if (this._$cssResult$ = !0, s !== it) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
24
21
|
this.cssText = t, this.t = e;
|
|
25
22
|
}
|
|
26
23
|
get styleSheet() {
|
|
27
24
|
let t = this.o;
|
|
28
25
|
const e = this.t;
|
|
29
|
-
if (
|
|
26
|
+
if (D && t === void 0) {
|
|
30
27
|
const s = e !== void 0 && e.length === 1;
|
|
31
|
-
s && (t =
|
|
28
|
+
s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
|
|
32
29
|
}
|
|
33
30
|
return t;
|
|
34
31
|
}
|
|
@@ -36,101 +33,101 @@ let oe = class {
|
|
|
36
33
|
return this.cssText;
|
|
37
34
|
}
|
|
38
35
|
};
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
36
|
+
const ut = (n) => new dt(typeof n == "string" ? n : n + "", void 0, it), ct = (n, t) => {
|
|
37
|
+
if (D) n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
41
38
|
else for (const e of t) {
|
|
42
|
-
const s = document.createElement("style"),
|
|
43
|
-
|
|
39
|
+
const s = document.createElement("style"), i = O.litNonce;
|
|
40
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, n.appendChild(s);
|
|
44
41
|
}
|
|
45
|
-
},
|
|
42
|
+
}, G = D ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
|
|
46
43
|
let e = "";
|
|
47
44
|
for (const s of t.cssRules) e += s.cssText;
|
|
48
|
-
return
|
|
49
|
-
})(
|
|
45
|
+
return ut(e);
|
|
46
|
+
})(n) : n;
|
|
50
47
|
/**
|
|
51
48
|
* @license
|
|
52
49
|
* Copyright 2017 Google LLC
|
|
53
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
51
|
*/
|
|
55
|
-
const { is:
|
|
52
|
+
const { is: pt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: vt, getPrototypeOf: bt } = Object, $ = globalThis, J = $.trustedTypes, gt = J ? J.emptyScript : "", z = $.reactiveElementPolyfillSupport, M = (n, t) => n, N = { toAttribute(n, t) {
|
|
56
53
|
switch (t) {
|
|
57
54
|
case Boolean:
|
|
58
|
-
|
|
55
|
+
n = n ? gt : null;
|
|
59
56
|
break;
|
|
60
57
|
case Object:
|
|
61
58
|
case Array:
|
|
62
|
-
|
|
59
|
+
n = n == null ? n : JSON.stringify(n);
|
|
63
60
|
}
|
|
64
|
-
return
|
|
65
|
-
}, fromAttribute(
|
|
66
|
-
let e =
|
|
61
|
+
return n;
|
|
62
|
+
}, fromAttribute(n, t) {
|
|
63
|
+
let e = n;
|
|
67
64
|
switch (t) {
|
|
68
65
|
case Boolean:
|
|
69
|
-
e =
|
|
66
|
+
e = n !== null;
|
|
70
67
|
break;
|
|
71
68
|
case Number:
|
|
72
|
-
e =
|
|
69
|
+
e = n === null ? null : Number(n);
|
|
73
70
|
break;
|
|
74
71
|
case Object:
|
|
75
72
|
case Array:
|
|
76
73
|
try {
|
|
77
|
-
e = JSON.parse(
|
|
74
|
+
e = JSON.parse(n);
|
|
78
75
|
} catch {
|
|
79
76
|
e = null;
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
return e;
|
|
83
|
-
} },
|
|
84
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
85
|
-
|
|
80
|
+
} }, j = (n, t) => !pt(n, t), K = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: j };
|
|
81
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
82
|
+
class S extends HTMLElement {
|
|
86
83
|
static addInitializer(t) {
|
|
87
84
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
88
85
|
}
|
|
89
86
|
static get observedAttributes() {
|
|
90
87
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
91
88
|
}
|
|
92
|
-
static createProperty(t, e =
|
|
89
|
+
static createProperty(t, e = K) {
|
|
93
90
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
94
|
-
const s = Symbol(),
|
|
95
|
-
|
|
91
|
+
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
92
|
+
i !== void 0 && yt(this.prototype, t, i);
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
static getPropertyDescriptor(t, e, s) {
|
|
99
|
-
const { get:
|
|
96
|
+
const { get: i, set: r } = _t(this.prototype, t) ?? { get() {
|
|
100
97
|
return this[e];
|
|
101
|
-
}, set(
|
|
102
|
-
this[e] =
|
|
98
|
+
}, set(o) {
|
|
99
|
+
this[e] = o;
|
|
103
100
|
} };
|
|
104
101
|
return { get() {
|
|
105
|
-
return
|
|
106
|
-
}, set(
|
|
107
|
-
const l =
|
|
108
|
-
|
|
102
|
+
return i == null ? void 0 : i.call(this);
|
|
103
|
+
}, set(o) {
|
|
104
|
+
const l = i == null ? void 0 : i.call(this);
|
|
105
|
+
r.call(this, o), this.requestUpdate(t, l, s);
|
|
109
106
|
}, configurable: !0, enumerable: !0 };
|
|
110
107
|
}
|
|
111
108
|
static getPropertyOptions(t) {
|
|
112
|
-
return this.elementProperties.get(t) ??
|
|
109
|
+
return this.elementProperties.get(t) ?? K;
|
|
113
110
|
}
|
|
114
111
|
static _$Ei() {
|
|
115
|
-
if (this.hasOwnProperty(
|
|
116
|
-
const t =
|
|
112
|
+
if (this.hasOwnProperty(M("elementProperties"))) return;
|
|
113
|
+
const t = bt(this);
|
|
117
114
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
118
115
|
}
|
|
119
116
|
static finalize() {
|
|
120
|
-
if (this.hasOwnProperty(
|
|
121
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
122
|
-
const e = this.properties, s = [...
|
|
123
|
-
for (const
|
|
117
|
+
if (this.hasOwnProperty(M("finalized"))) return;
|
|
118
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
119
|
+
const e = this.properties, s = [...ft(e), ...vt(e)];
|
|
120
|
+
for (const i of s) this.createProperty(i, e[i]);
|
|
124
121
|
}
|
|
125
122
|
const t = this[Symbol.metadata];
|
|
126
123
|
if (t !== null) {
|
|
127
124
|
const e = litPropertyMetadata.get(t);
|
|
128
|
-
if (e !== void 0) for (const [s,
|
|
125
|
+
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
|
|
129
126
|
}
|
|
130
127
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
131
128
|
for (const [e, s] of this.elementProperties) {
|
|
132
|
-
const
|
|
133
|
-
|
|
129
|
+
const i = this._$Eu(e, s);
|
|
130
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
134
131
|
}
|
|
135
132
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
136
133
|
}
|
|
@@ -138,8 +135,8 @@ let L = class extends HTMLElement {
|
|
|
138
135
|
const e = [];
|
|
139
136
|
if (Array.isArray(t)) {
|
|
140
137
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
141
|
-
for (const
|
|
142
|
-
} else t !== void 0 && e.push(
|
|
138
|
+
for (const i of s) e.unshift(G(i));
|
|
139
|
+
} else t !== void 0 && e.push(G(t));
|
|
143
140
|
return e;
|
|
144
141
|
}
|
|
145
142
|
static _$Eu(t, e) {
|
|
@@ -168,7 +165,7 @@ let L = class extends HTMLElement {
|
|
|
168
165
|
}
|
|
169
166
|
createRenderRoot() {
|
|
170
167
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
171
|
-
return
|
|
168
|
+
return ct(t, this.constructor.elementStyles), t;
|
|
172
169
|
}
|
|
173
170
|
connectedCallback() {
|
|
174
171
|
var t;
|
|
@@ -190,24 +187,24 @@ let L = class extends HTMLElement {
|
|
|
190
187
|
this._$AK(t, s);
|
|
191
188
|
}
|
|
192
189
|
_$EC(t, e) {
|
|
193
|
-
var
|
|
194
|
-
const s = this.constructor.elementProperties.get(t),
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
this._$Em = t,
|
|
190
|
+
var r;
|
|
191
|
+
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
192
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
193
|
+
const o = (((r = s.converter) == null ? void 0 : r.toAttribute) !== void 0 ? s.converter : N).toAttribute(e, s.type);
|
|
194
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
198
195
|
}
|
|
199
196
|
}
|
|
200
197
|
_$AK(t, e) {
|
|
201
|
-
var
|
|
202
|
-
const s = this.constructor,
|
|
203
|
-
if (
|
|
204
|
-
const
|
|
205
|
-
this._$Em =
|
|
198
|
+
var r;
|
|
199
|
+
const s = this.constructor, i = s._$Eh.get(t);
|
|
200
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
201
|
+
const o = s.getPropertyOptions(i), l = typeof o.converter == "function" ? { fromAttribute: o.converter } : ((r = o.converter) == null ? void 0 : r.fromAttribute) !== void 0 ? o.converter : N;
|
|
202
|
+
this._$Em = i, this[i] = l.fromAttribute(e, o.type), this._$Em = null;
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
205
|
requestUpdate(t, e, s) {
|
|
209
206
|
if (t !== void 0) {
|
|
210
|
-
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ??
|
|
207
|
+
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? j)(this[t], e)) return;
|
|
211
208
|
this.P(t, e, s);
|
|
212
209
|
}
|
|
213
210
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -233,21 +230,21 @@ let L = class extends HTMLElement {
|
|
|
233
230
|
if (!this.isUpdatePending) return;
|
|
234
231
|
if (!this.hasUpdated) {
|
|
235
232
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
236
|
-
for (const [
|
|
233
|
+
for (const [r, o] of this._$Ep) this[r] = o;
|
|
237
234
|
this._$Ep = void 0;
|
|
238
235
|
}
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
236
|
+
const i = this.constructor.elementProperties;
|
|
237
|
+
if (i.size > 0) for (const [r, o] of i) o.wrapped !== !0 || this._$AL.has(r) || this[r] === void 0 || this.P(r, this[r], o);
|
|
241
238
|
}
|
|
242
239
|
let t = !1;
|
|
243
240
|
const e = this._$AL;
|
|
244
241
|
try {
|
|
245
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((
|
|
246
|
-
var
|
|
247
|
-
return (
|
|
242
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
|
|
243
|
+
var r;
|
|
244
|
+
return (r = i.hostUpdate) == null ? void 0 : r.call(i);
|
|
248
245
|
}), this.update(e)) : this._$EU();
|
|
249
|
-
} catch (
|
|
250
|
-
throw t = !1, this._$EU(),
|
|
246
|
+
} catch (i) {
|
|
247
|
+
throw t = !1, this._$EU(), i;
|
|
251
248
|
}
|
|
252
249
|
t && this._$AE(e);
|
|
253
250
|
}
|
|
@@ -256,8 +253,8 @@ let L = class extends HTMLElement {
|
|
|
256
253
|
_$AE(t) {
|
|
257
254
|
var e;
|
|
258
255
|
(e = this._$EO) == null || e.forEach((s) => {
|
|
259
|
-
var
|
|
260
|
-
return (
|
|
256
|
+
var i;
|
|
257
|
+
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
261
258
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
262
259
|
}
|
|
263
260
|
_$EU() {
|
|
@@ -279,49 +276,49 @@ let L = class extends HTMLElement {
|
|
|
279
276
|
}
|
|
280
277
|
firstUpdated(t) {
|
|
281
278
|
}
|
|
282
|
-
}
|
|
283
|
-
|
|
279
|
+
}
|
|
280
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[M("elementProperties")] = /* @__PURE__ */ new Map(), S[M("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: S }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
|
|
284
281
|
/**
|
|
285
282
|
* @license
|
|
286
283
|
* Copyright 2017 Google LLC
|
|
287
284
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
288
285
|
*/
|
|
289
|
-
const
|
|
290
|
-
const { kind: s, metadata:
|
|
291
|
-
let
|
|
292
|
-
if (
|
|
293
|
-
const { name:
|
|
286
|
+
const $t = { attribute: !0, type: String, converter: N, reflect: !1, hasChanged: j }, mt = (n = $t, t, e) => {
|
|
287
|
+
const { kind: s, metadata: i } = e;
|
|
288
|
+
let r = globalThis.litPropertyMetadata.get(i);
|
|
289
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), r.set(e.name, n), s === "accessor") {
|
|
290
|
+
const { name: o } = e;
|
|
294
291
|
return { set(l) {
|
|
295
292
|
const a = t.get.call(this);
|
|
296
|
-
t.set.call(this, l), this.requestUpdate(
|
|
293
|
+
t.set.call(this, l), this.requestUpdate(o, a, n);
|
|
297
294
|
}, init(l) {
|
|
298
|
-
return l !== void 0 && this.P(
|
|
295
|
+
return l !== void 0 && this.P(o, void 0, n), l;
|
|
299
296
|
} };
|
|
300
297
|
}
|
|
301
298
|
if (s === "setter") {
|
|
302
|
-
const { name:
|
|
299
|
+
const { name: o } = e;
|
|
303
300
|
return function(l) {
|
|
304
|
-
const a = this[
|
|
305
|
-
t.call(this, l), this.requestUpdate(
|
|
301
|
+
const a = this[o];
|
|
302
|
+
t.call(this, l), this.requestUpdate(o, a, n);
|
|
306
303
|
};
|
|
307
304
|
}
|
|
308
305
|
throw Error("Unsupported decorator location: " + s);
|
|
309
306
|
};
|
|
310
|
-
function
|
|
311
|
-
return (t, e) => typeof e == "object" ?
|
|
312
|
-
const
|
|
313
|
-
return
|
|
314
|
-
})(
|
|
307
|
+
function u(n) {
|
|
308
|
+
return (t, e) => typeof e == "object" ? mt(n, t, e) : ((s, i, r) => {
|
|
309
|
+
const o = i.hasOwnProperty(r);
|
|
310
|
+
return i.constructor.createProperty(r, o ? { ...s, wrapped: !0 } : s), o ? Object.getOwnPropertyDescriptor(i, r) : void 0;
|
|
311
|
+
})(n, t, e);
|
|
315
312
|
}
|
|
316
313
|
/**
|
|
317
314
|
* @license
|
|
318
315
|
* Copyright 2017 Google LLC
|
|
319
316
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
320
317
|
*/
|
|
321
|
-
function
|
|
322
|
-
return
|
|
318
|
+
function xt(n) {
|
|
319
|
+
return u({ ...n, state: !0, attribute: !1 });
|
|
323
320
|
}
|
|
324
|
-
const
|
|
321
|
+
const wt = lt`
|
|
325
322
|
:host {
|
|
326
323
|
/* Anything that can be overridden should be defined here */
|
|
327
324
|
|
|
@@ -498,17 +495,16 @@ const ve = qt`
|
|
|
498
495
|
transform: translateY(-50%);
|
|
499
496
|
cursor: pointer;
|
|
500
497
|
color: var(--_nys-textinput-icon-color);
|
|
501
|
-
--_nys-button-color-bg:
|
|
502
|
-
--_nys-button-color-bg-hover:
|
|
503
|
-
--_nys-button-color-bg-active:
|
|
498
|
+
--_nys-button-color-bg: var(--_nys-textinput-background-color);
|
|
499
|
+
--_nys-button-color-bg-hover: var(--_nys-textinput-background-color);
|
|
500
|
+
--_nys-button-color-bg-active: var(--_nys-textinput-background-color);
|
|
504
501
|
--_nys-button-offset-focus: calc(
|
|
505
502
|
var(--_nys-button-width-focus) * -1
|
|
506
503
|
); /* Needs to be negative of the offset width */
|
|
507
|
-
--_nys-button-
|
|
508
|
-
--_nys-button-
|
|
509
|
-
--_nys-button-height: var(--nys-size-
|
|
504
|
+
--_nys-button-padding-y: var(--nys-space-50, 4px);
|
|
505
|
+
--_nys-button-padding-x: var(--nys-space-50, 4px);
|
|
506
|
+
--_nys-button-height: var(--nys-size-300, 32px);
|
|
510
507
|
--_nys-button-width: var(--nys-size-400, 32px);
|
|
511
|
-
--_nys-button-padding-x: 0;
|
|
512
508
|
}
|
|
513
509
|
|
|
514
510
|
/* Hovered */
|
|
@@ -541,70 +537,70 @@ const ve = qt`
|
|
|
541
537
|
* Copyright 2017 Google LLC
|
|
542
538
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
543
539
|
*/
|
|
544
|
-
const
|
|
545
|
-
\f\r]`,
|
|
546
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
547
|
-
function
|
|
548
|
-
if (!
|
|
549
|
-
return
|
|
540
|
+
const C = globalThis, R = C.trustedTypes, Z = R ? R.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, nt = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, rt = "?" + g, At = `<${rt}>`, A = document, k = () => A.createComment(""), U = (n) => n === null || typeof n != "object" && typeof n != "function", W = Array.isArray, Et = (n) => W(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", L = `[
|
|
541
|
+
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, m = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
|
|
542
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, ot = /^(?:script|style|textarea|title)$/i, H = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), w = A.createTreeWalker(A, 129);
|
|
543
|
+
function at(n, t) {
|
|
544
|
+
if (!W(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
545
|
+
return Z !== void 0 ? Z.createHTML(t) : t;
|
|
550
546
|
}
|
|
551
|
-
const
|
|
552
|
-
const e =
|
|
553
|
-
let
|
|
547
|
+
const St = (n, t) => {
|
|
548
|
+
const e = n.length - 1, s = [];
|
|
549
|
+
let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
|
|
554
550
|
for (let l = 0; l < e; l++) {
|
|
555
|
-
const a =
|
|
556
|
-
let
|
|
557
|
-
for (;
|
|
558
|
-
const
|
|
559
|
-
|
|
551
|
+
const a = n[l];
|
|
552
|
+
let p, _, h = -1, v = 0;
|
|
553
|
+
for (; v < a.length && (o.lastIndex = v, _ = o.exec(a), _ !== null); ) v = o.lastIndex, o === P ? _[1] === "!--" ? o = Q : _[1] !== void 0 ? o = X : _[2] !== void 0 ? (ot.test(_[2]) && (i = RegExp("</" + _[2], "g")), o = m) : _[3] !== void 0 && (o = m) : o === m ? _[0] === ">" ? (o = i ?? P, h = -1) : _[1] === void 0 ? h = -2 : (h = o.lastIndex - _[2].length, p = _[1], o = _[3] === void 0 ? m : _[3] === '"' ? et : tt) : o === et || o === tt ? o = m : o === Q || o === X ? o = P : (o = m, i = void 0);
|
|
554
|
+
const b = o === m && n[l + 1].startsWith("/>") ? " " : "";
|
|
555
|
+
r += o === P ? a + At : h >= 0 ? (s.push(p), a.slice(0, h) + nt + a.slice(h) + g + b) : a + g + (h === -2 ? l : b);
|
|
560
556
|
}
|
|
561
|
-
return [
|
|
557
|
+
return [at(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
562
558
|
};
|
|
563
|
-
|
|
559
|
+
class T {
|
|
564
560
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
565
|
-
let
|
|
561
|
+
let i;
|
|
566
562
|
this.parts = [];
|
|
567
|
-
let
|
|
568
|
-
const l = t.length - 1, a = this.parts, [
|
|
569
|
-
if (this.el =
|
|
563
|
+
let r = 0, o = 0;
|
|
564
|
+
const l = t.length - 1, a = this.parts, [p, _] = St(t, e);
|
|
565
|
+
if (this.el = T.createElement(p, s), w.currentNode = this.el.content, e === 2 || e === 3) {
|
|
570
566
|
const h = this.el.content.firstChild;
|
|
571
567
|
h.replaceWith(...h.childNodes);
|
|
572
568
|
}
|
|
573
|
-
for (; (
|
|
574
|
-
if (
|
|
575
|
-
if (
|
|
576
|
-
const
|
|
577
|
-
a.push({ type: 1, index:
|
|
578
|
-
} else h.startsWith(
|
|
579
|
-
if (
|
|
580
|
-
const h =
|
|
581
|
-
if (
|
|
582
|
-
|
|
583
|
-
for (let
|
|
584
|
-
|
|
569
|
+
for (; (i = w.nextNode()) !== null && a.length < l; ) {
|
|
570
|
+
if (i.nodeType === 1) {
|
|
571
|
+
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(nt)) {
|
|
572
|
+
const v = _[o++], b = i.getAttribute(h).split(g), I = /([.?@])?(.*)/.exec(v);
|
|
573
|
+
a.push({ type: 1, index: r, name: I[2], strings: b, ctor: I[1] === "." ? Mt : I[1] === "?" ? Ct : I[1] === "@" ? Ut : V }), i.removeAttribute(h);
|
|
574
|
+
} else h.startsWith(g) && (a.push({ type: 6, index: r }), i.removeAttribute(h));
|
|
575
|
+
if (ot.test(i.tagName)) {
|
|
576
|
+
const h = i.textContent.split(g), v = h.length - 1;
|
|
577
|
+
if (v > 0) {
|
|
578
|
+
i.textContent = R ? R.emptyScript : "";
|
|
579
|
+
for (let b = 0; b < v; b++) i.append(h[b], k()), w.nextNode(), a.push({ type: 2, index: ++r });
|
|
580
|
+
i.append(h[v], k());
|
|
585
581
|
}
|
|
586
582
|
}
|
|
587
|
-
} else if (
|
|
583
|
+
} else if (i.nodeType === 8) if (i.data === rt) a.push({ type: 2, index: r });
|
|
588
584
|
else {
|
|
589
585
|
let h = -1;
|
|
590
|
-
for (; (h =
|
|
586
|
+
for (; (h = i.data.indexOf(g, h + 1)) !== -1; ) a.push({ type: 7, index: r }), h += g.length - 1;
|
|
591
587
|
}
|
|
592
|
-
|
|
588
|
+
r++;
|
|
593
589
|
}
|
|
594
590
|
}
|
|
595
591
|
static createElement(t, e) {
|
|
596
|
-
const s =
|
|
592
|
+
const s = A.createElement("template");
|
|
597
593
|
return s.innerHTML = t, s;
|
|
598
594
|
}
|
|
599
|
-
};
|
|
600
|
-
function R(o, t, e = o, s) {
|
|
601
|
-
var n, l;
|
|
602
|
-
if (t === K) return t;
|
|
603
|
-
let r = s !== void 0 ? (n = e._$Co) == null ? void 0 : n[s] : e._$Cl;
|
|
604
|
-
const i = G(t) ? void 0 : t._$litDirective$;
|
|
605
|
-
return (r == null ? void 0 : r.constructor) !== i && ((l = r == null ? void 0 : r._$AO) == null || l.call(r, !1), i === void 0 ? r = void 0 : (r = new i(o), r._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = R(o, r._$AS(o, t.values), r, s)), t;
|
|
606
595
|
}
|
|
607
|
-
|
|
596
|
+
function E(n, t, e = n, s) {
|
|
597
|
+
var o, l;
|
|
598
|
+
if (t === H) return t;
|
|
599
|
+
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
|
|
600
|
+
const r = U(t) ? void 0 : t._$litDirective$;
|
|
601
|
+
return (i == null ? void 0 : i.constructor) !== r && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), r === void 0 ? i = void 0 : (i = new r(n), i._$AT(n, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = E(n, i._$AS(n, t.values), i, s)), t;
|
|
602
|
+
}
|
|
603
|
+
class Pt {
|
|
608
604
|
constructor(t, e) {
|
|
609
605
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
610
606
|
}
|
|
@@ -615,29 +611,30 @@ let me = class {
|
|
|
615
611
|
return this._$AM._$AU;
|
|
616
612
|
}
|
|
617
613
|
u(t) {
|
|
618
|
-
const { el: { content: e }, parts: s } = this._$AD,
|
|
619
|
-
|
|
620
|
-
let
|
|
614
|
+
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
|
|
615
|
+
w.currentNode = i;
|
|
616
|
+
let r = w.nextNode(), o = 0, l = 0, a = s[0];
|
|
621
617
|
for (; a !== void 0; ) {
|
|
622
|
-
if (
|
|
623
|
-
let
|
|
624
|
-
a.type === 2 ?
|
|
618
|
+
if (o === a.index) {
|
|
619
|
+
let p;
|
|
620
|
+
a.type === 2 ? p = new B(r, r.nextSibling, this, t) : a.type === 1 ? p = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (p = new Ht(r, this, t)), this._$AV.push(p), a = s[++l];
|
|
625
621
|
}
|
|
626
|
-
|
|
622
|
+
o !== (a == null ? void 0 : a.index) && (r = w.nextNode(), o++);
|
|
627
623
|
}
|
|
628
|
-
return
|
|
624
|
+
return w.currentNode = A, i;
|
|
629
625
|
}
|
|
630
626
|
p(t) {
|
|
631
627
|
let e = 0;
|
|
632
628
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
633
629
|
}
|
|
634
|
-
}
|
|
630
|
+
}
|
|
631
|
+
class B {
|
|
635
632
|
get _$AU() {
|
|
636
633
|
var t;
|
|
637
634
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
638
635
|
}
|
|
639
|
-
constructor(t, e, s,
|
|
640
|
-
this.type = 2, this._$AH =
|
|
636
|
+
constructor(t, e, s, i) {
|
|
637
|
+
this.type = 2, this._$AH = y, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
641
638
|
}
|
|
642
639
|
get parentNode() {
|
|
643
640
|
let t = this._$AA.parentNode;
|
|
@@ -651,7 +648,7 @@ let me = class {
|
|
|
651
648
|
return this._$AB;
|
|
652
649
|
}
|
|
653
650
|
_$AI(t, e = this) {
|
|
654
|
-
t =
|
|
651
|
+
t = E(this, t, e), U(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Et(t) ? this.k(t) : this._(t);
|
|
655
652
|
}
|
|
656
653
|
O(t) {
|
|
657
654
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -660,93 +657,96 @@ let me = class {
|
|
|
660
657
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
661
658
|
}
|
|
662
659
|
_(t) {
|
|
663
|
-
this._$AH !==
|
|
660
|
+
this._$AH !== y && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
|
|
664
661
|
}
|
|
665
662
|
$(t) {
|
|
666
|
-
var
|
|
667
|
-
const { values: e, _$litType$: s } = t,
|
|
668
|
-
if (((
|
|
663
|
+
var r;
|
|
664
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = T.createElement(at(s.h, s.h[0]), this.options)), s);
|
|
665
|
+
if (((r = this._$AH) == null ? void 0 : r._$AD) === i) this._$AH.p(e);
|
|
669
666
|
else {
|
|
670
|
-
const
|
|
671
|
-
|
|
667
|
+
const o = new Pt(i, this), l = o.u(this.options);
|
|
668
|
+
o.p(e), this.T(l), this._$AH = o;
|
|
672
669
|
}
|
|
673
670
|
}
|
|
674
671
|
_$AC(t) {
|
|
675
|
-
let e =
|
|
676
|
-
return e === void 0 &&
|
|
672
|
+
let e = st.get(t.strings);
|
|
673
|
+
return e === void 0 && st.set(t.strings, e = new T(t)), e;
|
|
677
674
|
}
|
|
678
675
|
k(t) {
|
|
679
|
-
|
|
676
|
+
W(this._$AH) || (this._$AH = [], this._$AR());
|
|
680
677
|
const e = this._$AH;
|
|
681
|
-
let s,
|
|
682
|
-
for (const
|
|
683
|
-
|
|
678
|
+
let s, i = 0;
|
|
679
|
+
for (const r of t) i === e.length ? e.push(s = new B(this.O(k()), this.O(k()), this, this.options)) : s = e[i], s._$AI(r), i++;
|
|
680
|
+
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
684
681
|
}
|
|
685
682
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
686
683
|
var s;
|
|
687
684
|
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
688
|
-
const
|
|
689
|
-
t.remove(), t =
|
|
685
|
+
const i = t.nextSibling;
|
|
686
|
+
t.remove(), t = i;
|
|
690
687
|
}
|
|
691
688
|
}
|
|
692
689
|
setConnected(t) {
|
|
693
690
|
var e;
|
|
694
691
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
695
692
|
}
|
|
696
|
-
}
|
|
693
|
+
}
|
|
694
|
+
class V {
|
|
697
695
|
get tagName() {
|
|
698
696
|
return this.element.tagName;
|
|
699
697
|
}
|
|
700
698
|
get _$AU() {
|
|
701
699
|
return this._$AM._$AU;
|
|
702
700
|
}
|
|
703
|
-
constructor(t, e, s,
|
|
704
|
-
this.type = 1, this._$AH =
|
|
701
|
+
constructor(t, e, s, i, r) {
|
|
702
|
+
this.type = 1, this._$AH = y, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = y;
|
|
705
703
|
}
|
|
706
|
-
_$AI(t, e = this, s,
|
|
707
|
-
const
|
|
708
|
-
let
|
|
709
|
-
if (
|
|
704
|
+
_$AI(t, e = this, s, i) {
|
|
705
|
+
const r = this.strings;
|
|
706
|
+
let o = !1;
|
|
707
|
+
if (r === void 0) t = E(this, t, e, 0), o = !U(t) || t !== this._$AH && t !== H, o && (this._$AH = t);
|
|
710
708
|
else {
|
|
711
709
|
const l = t;
|
|
712
|
-
let a,
|
|
713
|
-
for (t =
|
|
710
|
+
let a, p;
|
|
711
|
+
for (t = r[0], a = 0; a < r.length - 1; a++) p = E(this, l[s + a], e, a), p === H && (p = this._$AH[a]), o || (o = !U(p) || p !== this._$AH[a]), p === y ? t = y : t !== y && (t += (p ?? "") + r[a + 1]), this._$AH[a] = p;
|
|
714
712
|
}
|
|
715
|
-
|
|
713
|
+
o && !i && this.j(t);
|
|
716
714
|
}
|
|
717
715
|
j(t) {
|
|
718
|
-
t ===
|
|
716
|
+
t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
719
717
|
}
|
|
720
|
-
}
|
|
721
|
-
class
|
|
718
|
+
}
|
|
719
|
+
class Mt extends V {
|
|
722
720
|
constructor() {
|
|
723
721
|
super(...arguments), this.type = 3;
|
|
724
722
|
}
|
|
725
723
|
j(t) {
|
|
726
|
-
this.element[this.name] = t ===
|
|
724
|
+
this.element[this.name] = t === y ? void 0 : t;
|
|
727
725
|
}
|
|
728
726
|
}
|
|
729
|
-
|
|
727
|
+
class Ct extends V {
|
|
730
728
|
constructor() {
|
|
731
729
|
super(...arguments), this.type = 4;
|
|
732
730
|
}
|
|
733
731
|
j(t) {
|
|
734
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
732
|
+
this.element.toggleAttribute(this.name, !!t && t !== y);
|
|
735
733
|
}
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
|
|
734
|
+
}
|
|
735
|
+
class Ut extends V {
|
|
736
|
+
constructor(t, e, s, i, r) {
|
|
737
|
+
super(t, e, s, i, r), this.type = 5;
|
|
739
738
|
}
|
|
740
739
|
_$AI(t, e = this) {
|
|
741
|
-
if ((t =
|
|
742
|
-
const s = this._$AH,
|
|
743
|
-
|
|
740
|
+
if ((t = E(this, t, e, 0) ?? y) === H) return;
|
|
741
|
+
const s = this._$AH, i = t === y && s !== y || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== y && (s === y || i);
|
|
742
|
+
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
744
743
|
}
|
|
745
744
|
handleEvent(t) {
|
|
746
745
|
var e;
|
|
747
746
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
748
747
|
}
|
|
749
|
-
}
|
|
748
|
+
}
|
|
749
|
+
class Ht {
|
|
750
750
|
constructor(t, e, s) {
|
|
751
751
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
752
752
|
}
|
|
@@ -754,1233 +754,77 @@ let Ae = class extends at {
|
|
|
754
754
|
return this._$AM._$AU;
|
|
755
755
|
}
|
|
756
756
|
_$AI(t) {
|
|
757
|
-
|
|
757
|
+
E(this, t);
|
|
758
758
|
}
|
|
759
|
-
}
|
|
760
|
-
const
|
|
761
|
-
|
|
759
|
+
}
|
|
760
|
+
const q = C.litHtmlPolyfillSupport;
|
|
761
|
+
q == null || q(T, B), (C.litHtmlVersions ?? (C.litHtmlVersions = [])).push("3.2.1");
|
|
762
762
|
/**
|
|
763
763
|
* @license
|
|
764
764
|
* Copyright 2018 Google LLC
|
|
765
765
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
766
766
|
*/
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
* ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
|
|
773
|
-
*
|
|
774
|
-
* Button Component
|
|
775
|
-
* Part of the New York State Design System
|
|
776
|
-
* Repository: https://github.com/its-hcd/nysds
|
|
777
|
-
* License: MIT
|
|
778
|
-
*/
|
|
779
|
-
/**
|
|
780
|
-
* @license
|
|
781
|
-
* Copyright 2019 Google LLC
|
|
782
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
783
|
-
*/
|
|
784
|
-
const X = globalThis, _t = X.ShadowRoot && (X.ShadyCSS === void 0 || X.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Xt = Symbol(), Tt = /* @__PURE__ */ new WeakMap();
|
|
785
|
-
let Ee = class {
|
|
786
|
-
constructor(o, t, e) {
|
|
787
|
-
if (this._$cssResult$ = !0, e !== Xt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
788
|
-
this.cssText = o, this.t = t;
|
|
789
|
-
}
|
|
790
|
-
get styleSheet() {
|
|
791
|
-
let o = this.o;
|
|
792
|
-
const t = this.t;
|
|
793
|
-
if (_t && o === void 0) {
|
|
794
|
-
const e = t !== void 0 && t.length === 1;
|
|
795
|
-
e && (o = Tt.get(t)), o === void 0 && ((this.o = o = new CSSStyleSheet()).replaceSync(this.cssText), e && Tt.set(t, o));
|
|
796
|
-
}
|
|
797
|
-
return o;
|
|
798
|
-
}
|
|
799
|
-
toString() {
|
|
800
|
-
return this.cssText;
|
|
801
|
-
}
|
|
767
|
+
const x = (n) => n ?? y;
|
|
768
|
+
var Tt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, c = (n, t, e, s) => {
|
|
769
|
+
for (var i = s > 1 ? void 0 : s ? It(t, e) : t, r = n.length - 1, o; r >= 0; r--)
|
|
770
|
+
(o = n[r]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
771
|
+
return s && i && Tt(t, e, i), i;
|
|
802
772
|
};
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, o.appendChild(s);
|
|
808
|
-
}
|
|
809
|
-
}, Mt = _t ? (o) => o : (o) => o instanceof CSSStyleSheet ? ((t) => {
|
|
810
|
-
let e = "";
|
|
811
|
-
for (const s of t.cssRules) e += s.cssText;
|
|
812
|
-
return Pe(e);
|
|
813
|
-
})(o) : o;
|
|
814
|
-
/**
|
|
815
|
-
* @license
|
|
816
|
-
* Copyright 2017 Google LLC
|
|
817
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
818
|
-
*/
|
|
819
|
-
const { is: Ie, defineProperty: Ue, getOwnPropertyDescriptor: Te, getOwnPropertyNames: Me, getOwnPropertySymbols: He, getPrototypeOf: Oe } = Object, z = globalThis, Ht = z.trustedTypes, ke = Ht ? Ht.emptyScript : "", Ot = z.reactiveElementPolyfillSupport, W = (o, t) => o, rt = { toAttribute(o, t) {
|
|
820
|
-
switch (t) {
|
|
821
|
-
case Boolean:
|
|
822
|
-
o = o ? ke : null;
|
|
823
|
-
break;
|
|
824
|
-
case Object:
|
|
825
|
-
case Array:
|
|
826
|
-
o = o == null ? o : JSON.stringify(o);
|
|
827
|
-
}
|
|
828
|
-
return o;
|
|
829
|
-
}, fromAttribute(o, t) {
|
|
830
|
-
let e = o;
|
|
831
|
-
switch (t) {
|
|
832
|
-
case Boolean:
|
|
833
|
-
e = o !== null;
|
|
834
|
-
break;
|
|
835
|
-
case Number:
|
|
836
|
-
e = o === null ? null : Number(o);
|
|
837
|
-
break;
|
|
838
|
-
case Object:
|
|
839
|
-
case Array:
|
|
840
|
-
try {
|
|
841
|
-
e = JSON.parse(o);
|
|
842
|
-
} catch {
|
|
843
|
-
e = null;
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
return e;
|
|
847
|
-
} }, gt = (o, t) => !Ie(o, t), kt = { attribute: !0, type: String, converter: rt, reflect: !1, hasChanged: gt };
|
|
848
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), z.litPropertyMetadata ?? (z.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
849
|
-
class B extends HTMLElement {
|
|
850
|
-
static addInitializer(t) {
|
|
851
|
-
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
852
|
-
}
|
|
853
|
-
static get observedAttributes() {
|
|
854
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
855
|
-
}
|
|
856
|
-
static createProperty(t, e = kt) {
|
|
857
|
-
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
858
|
-
const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
|
|
859
|
-
r !== void 0 && Ue(this.prototype, t, r);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
static getPropertyDescriptor(t, e, s) {
|
|
863
|
-
const { get: r, set: i } = Te(this.prototype, t) ?? { get() {
|
|
864
|
-
return this[e];
|
|
865
|
-
}, set(n) {
|
|
866
|
-
this[e] = n;
|
|
867
|
-
} };
|
|
868
|
-
return { get() {
|
|
869
|
-
return r == null ? void 0 : r.call(this);
|
|
870
|
-
}, set(n) {
|
|
871
|
-
const l = r == null ? void 0 : r.call(this);
|
|
872
|
-
i.call(this, n), this.requestUpdate(t, l, s);
|
|
873
|
-
}, configurable: !0, enumerable: !0 };
|
|
874
|
-
}
|
|
875
|
-
static getPropertyOptions(t) {
|
|
876
|
-
return this.elementProperties.get(t) ?? kt;
|
|
877
|
-
}
|
|
878
|
-
static _$Ei() {
|
|
879
|
-
if (this.hasOwnProperty(W("elementProperties"))) return;
|
|
880
|
-
const t = Oe(this);
|
|
881
|
-
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
882
|
-
}
|
|
883
|
-
static finalize() {
|
|
884
|
-
if (this.hasOwnProperty(W("finalized"))) return;
|
|
885
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(W("properties"))) {
|
|
886
|
-
const e = this.properties, s = [...Me(e), ...He(e)];
|
|
887
|
-
for (const r of s) this.createProperty(r, e[r]);
|
|
888
|
-
}
|
|
889
|
-
const t = this[Symbol.metadata];
|
|
890
|
-
if (t !== null) {
|
|
891
|
-
const e = litPropertyMetadata.get(t);
|
|
892
|
-
if (e !== void 0) for (const [s, r] of e) this.elementProperties.set(s, r);
|
|
893
|
-
}
|
|
894
|
-
this._$Eh = /* @__PURE__ */ new Map();
|
|
895
|
-
for (const [e, s] of this.elementProperties) {
|
|
896
|
-
const r = this._$Eu(e, s);
|
|
897
|
-
r !== void 0 && this._$Eh.set(r, e);
|
|
898
|
-
}
|
|
899
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
900
|
-
}
|
|
901
|
-
static finalizeStyles(t) {
|
|
902
|
-
const e = [];
|
|
903
|
-
if (Array.isArray(t)) {
|
|
904
|
-
const s = new Set(t.flat(1 / 0).reverse());
|
|
905
|
-
for (const r of s) e.unshift(Mt(r));
|
|
906
|
-
} else t !== void 0 && e.push(Mt(t));
|
|
907
|
-
return e;
|
|
908
|
-
}
|
|
909
|
-
static _$Eu(t, e) {
|
|
910
|
-
const s = e.attribute;
|
|
911
|
-
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
912
|
-
}
|
|
773
|
+
let Ot = 0;
|
|
774
|
+
var f;
|
|
775
|
+
const d = (f = class extends ht {
|
|
776
|
+
// allows use of elementInternals' API
|
|
913
777
|
constructor() {
|
|
914
|
-
super(), this.
|
|
915
|
-
}
|
|
916
|
-
_$Ev() {
|
|
917
|
-
var t;
|
|
918
|
-
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
|
|
919
|
-
}
|
|
920
|
-
addController(t) {
|
|
921
|
-
var e;
|
|
922
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
778
|
+
super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
|
|
923
779
|
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
(e = this._$EO) == null || e.delete(t);
|
|
780
|
+
get type() {
|
|
781
|
+
return this._type;
|
|
927
782
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
783
|
+
set type(t) {
|
|
784
|
+
this._type = f.VALID_TYPES.includes(
|
|
785
|
+
t
|
|
786
|
+
) ? t : "text";
|
|
932
787
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
788
|
+
// Ensure the "width" property is valid after updates
|
|
789
|
+
async updated(t) {
|
|
790
|
+
t.has("width") && (await Promise.resolve(), this.width = f.VALID_WIDTHS.includes(this.width) ? this.width : "full"), t.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton"));
|
|
936
791
|
}
|
|
792
|
+
// Generate a unique ID if one is not provided
|
|
937
793
|
connectedCallback() {
|
|
938
|
-
|
|
939
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
940
|
-
var s;
|
|
941
|
-
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
enableUpdating(t) {
|
|
794
|
+
super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Ot++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
|
|
945
795
|
}
|
|
946
796
|
disconnectedCallback() {
|
|
947
|
-
|
|
948
|
-
(t = this._$EO) == null || t.forEach((e) => {
|
|
949
|
-
var s;
|
|
950
|
-
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
attributeChangedCallback(t, e, s) {
|
|
954
|
-
this._$AK(t, s);
|
|
955
|
-
}
|
|
956
|
-
_$EC(t, e) {
|
|
957
|
-
var s;
|
|
958
|
-
const r = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, r);
|
|
959
|
-
if (i !== void 0 && r.reflect === !0) {
|
|
960
|
-
const n = (((s = r.converter) == null ? void 0 : s.toAttribute) !== void 0 ? r.converter : rt).toAttribute(e, r.type);
|
|
961
|
-
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
_$AK(t, e) {
|
|
965
|
-
var s;
|
|
966
|
-
const r = this.constructor, i = r._$Eh.get(t);
|
|
967
|
-
if (i !== void 0 && this._$Em !== i) {
|
|
968
|
-
const n = r.getPropertyOptions(i), l = typeof n.converter == "function" ? { fromAttribute: n.converter } : ((s = n.converter) == null ? void 0 : s.fromAttribute) !== void 0 ? n.converter : rt;
|
|
969
|
-
this._$Em = i, this[i] = l.fromAttribute(e, n.type), this._$Em = null;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
requestUpdate(t, e, s) {
|
|
973
|
-
if (t !== void 0) {
|
|
974
|
-
if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? gt)(this[t], e)) return;
|
|
975
|
-
this.P(t, e, s);
|
|
976
|
-
}
|
|
977
|
-
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
978
|
-
}
|
|
979
|
-
P(t, e, s) {
|
|
980
|
-
this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
981
|
-
}
|
|
982
|
-
async _$ET() {
|
|
983
|
-
this.isUpdatePending = !0;
|
|
984
|
-
try {
|
|
985
|
-
await this._$ES;
|
|
986
|
-
} catch (e) {
|
|
987
|
-
Promise.reject(e);
|
|
988
|
-
}
|
|
989
|
-
const t = this.scheduleUpdate();
|
|
990
|
-
return t != null && await t, !this.isUpdatePending;
|
|
991
|
-
}
|
|
992
|
-
scheduleUpdate() {
|
|
993
|
-
return this.performUpdate();
|
|
994
|
-
}
|
|
995
|
-
performUpdate() {
|
|
996
|
-
var t;
|
|
997
|
-
if (!this.isUpdatePending) return;
|
|
998
|
-
if (!this.hasUpdated) {
|
|
999
|
-
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
1000
|
-
for (const [i, n] of this._$Ep) this[i] = n;
|
|
1001
|
-
this._$Ep = void 0;
|
|
1002
|
-
}
|
|
1003
|
-
const r = this.constructor.elementProperties;
|
|
1004
|
-
if (r.size > 0) for (const [i, n] of r) n.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], n);
|
|
1005
|
-
}
|
|
1006
|
-
let e = !1;
|
|
1007
|
-
const s = this._$AL;
|
|
1008
|
-
try {
|
|
1009
|
-
e = this.shouldUpdate(s), e ? (this.willUpdate(s), (t = this._$EO) == null || t.forEach((r) => {
|
|
1010
|
-
var i;
|
|
1011
|
-
return (i = r.hostUpdate) == null ? void 0 : i.call(r);
|
|
1012
|
-
}), this.update(s)) : this._$EU();
|
|
1013
|
-
} catch (r) {
|
|
1014
|
-
throw e = !1, this._$EU(), r;
|
|
1015
|
-
}
|
|
1016
|
-
e && this._$AE(s);
|
|
1017
|
-
}
|
|
1018
|
-
willUpdate(t) {
|
|
1019
|
-
}
|
|
1020
|
-
_$AE(t) {
|
|
1021
|
-
var e;
|
|
1022
|
-
(e = this._$EO) == null || e.forEach((s) => {
|
|
1023
|
-
var r;
|
|
1024
|
-
return (r = s.hostUpdated) == null ? void 0 : r.call(s);
|
|
1025
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
1026
|
-
}
|
|
1027
|
-
_$EU() {
|
|
1028
|
-
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
1029
|
-
}
|
|
1030
|
-
get updateComplete() {
|
|
1031
|
-
return this.getUpdateComplete();
|
|
1032
|
-
}
|
|
1033
|
-
getUpdateComplete() {
|
|
1034
|
-
return this._$ES;
|
|
1035
|
-
}
|
|
1036
|
-
shouldUpdate(t) {
|
|
1037
|
-
return !0;
|
|
797
|
+
super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
|
|
1038
798
|
}
|
|
1039
|
-
|
|
1040
|
-
this.
|
|
799
|
+
firstUpdated() {
|
|
800
|
+
this._setValue();
|
|
1041
801
|
}
|
|
1042
|
-
|
|
802
|
+
// This callback is automatically called when the parent form is reset.
|
|
803
|
+
formResetCallback() {
|
|
804
|
+
this.value = "";
|
|
1043
805
|
}
|
|
1044
|
-
|
|
806
|
+
/********************** Form Integration **********************/
|
|
807
|
+
_setValue() {
|
|
808
|
+
this._internals.setFormValue(this.value), this._manageRequire();
|
|
1045
809
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
*/
|
|
1053
|
-
const Ne = { attribute: !0, type: String, converter: rt, reflect: !1, hasChanged: gt }, Re = (o = Ne, t, e) => {
|
|
1054
|
-
const { kind: s, metadata: r } = e;
|
|
1055
|
-
let i = globalThis.litPropertyMetadata.get(r);
|
|
1056
|
-
if (i === void 0 && globalThis.litPropertyMetadata.set(r, i = /* @__PURE__ */ new Map()), i.set(e.name, o), s === "accessor") {
|
|
1057
|
-
const { name: n } = e;
|
|
1058
|
-
return { set(l) {
|
|
1059
|
-
const a = t.get.call(this);
|
|
1060
|
-
t.set.call(this, l), this.requestUpdate(n, a, o);
|
|
1061
|
-
}, init(l) {
|
|
1062
|
-
return l !== void 0 && this.P(n, void 0, o), l;
|
|
1063
|
-
} };
|
|
810
|
+
_manageRequire() {
|
|
811
|
+
var i, r;
|
|
812
|
+
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
813
|
+
if (!t) return;
|
|
814
|
+
const e = this.errorMessage || "This field is required";
|
|
815
|
+
this.required && (!this.value || ((r = this.value) == null ? void 0 : r.trim()) === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
|
|
1064
816
|
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
};
|
|
1071
|
-
|
|
1072
|
-
throw Error("Unsupported decorator location: " + s);
|
|
1073
|
-
};
|
|
1074
|
-
function $(o) {
|
|
1075
|
-
return (t, e) => typeof e == "object" ? Re(o, t, e) : ((s, r, i) => {
|
|
1076
|
-
const n = r.hasOwnProperty(i);
|
|
1077
|
-
return r.constructor.createProperty(i, n ? { ...s, wrapped: !0 } : s), n ? Object.getOwnPropertyDescriptor(r, i) : void 0;
|
|
1078
|
-
})(o, t, e);
|
|
1079
|
-
}
|
|
1080
|
-
const ze = qt`
|
|
1081
|
-
:host {
|
|
1082
|
-
/* Anything that can be overridden should be defined here */
|
|
1083
|
-
|
|
1084
|
-
/* Global Button Styles */
|
|
1085
|
-
--_nys-button-width: fit-content;
|
|
1086
|
-
--_nys-button-height: var(--nys-size-600, 48px);
|
|
1087
|
-
--_nys-button-radius-left: var(--nys-radius-xl, 12px);
|
|
1088
|
-
--_nys-button-radius-right: var(--nys-radius-xl, 12px);
|
|
1089
|
-
--_nys-button-padding-y: var(--nys-space-150, 12px);
|
|
1090
|
-
--_nys-button-padding-x: var(--nys-space-250, 20px);
|
|
1091
|
-
--_nys-button-gap: var(--nys-space-100, 8px);
|
|
1092
|
-
--_nys-button-width-border: var(--nys-border-width-md, 2px);
|
|
1093
|
-
--_nys-button-width-focus: var(--nys-border-width-md, 2px);
|
|
1094
|
-
--_nys-button-offset-focus: var(--nys-space-2px, 2px);
|
|
1095
|
-
--_nys-button-color-focus: var(--nys-color-focus, #004dd1);
|
|
1096
|
-
|
|
1097
|
-
/* Global Button Colors */
|
|
1098
|
-
--_nys-button-color-bg: var(--nys-color-theme, #154973);
|
|
1099
|
-
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1100
|
-
--_nys-button-color-border: var(--nys-color-theme, #154973);
|
|
1101
|
-
|
|
1102
|
-
--_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1103
|
-
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1104
|
-
--_nys-button-color-border-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1105
|
-
|
|
1106
|
-
--_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1107
|
-
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1108
|
-
--_nys-button-color-border-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1109
|
-
|
|
1110
|
-
--_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1111
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1112
|
-
--_nys-button-color-border-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1113
|
-
|
|
1114
|
-
/* Typography */
|
|
1115
|
-
--_nys-button-font-size: var(--nys-font-size-ui-md, 16px);
|
|
1116
|
-
--_nys-button-font-weight: var(--nys-font-weight-semibold, 600);
|
|
1117
|
-
--_nys-button-line-height: var(--nys-font-lineheight-ui-md, 24px);
|
|
1118
|
-
--_nys-button-font-family: var(
|
|
1119
|
-
--nys-font-family-ui,
|
|
1120
|
-
var(
|
|
1121
|
-
--nys-font-family-sans,
|
|
1122
|
-
"Proxima Nova",
|
|
1123
|
-
"Helvetica Neue",
|
|
1124
|
-
"Helvetica",
|
|
1125
|
-
"Arial",
|
|
1126
|
-
sans-serif
|
|
1127
|
-
)
|
|
1128
|
-
);
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
/* Sizes */
|
|
1132
|
-
:host([size="sm"]) {
|
|
1133
|
-
--_nys-button-height: var(--nys-size-500, 40px);
|
|
1134
|
-
--_nys-button-padding-y: var(--nys-space-100, 8px);
|
|
1135
|
-
--_nys-button-padding-x: var(--nys-space-200, 16px);
|
|
1136
|
-
}
|
|
1137
|
-
:host([size="md"]) {
|
|
1138
|
-
--_nys-button-height: var(--nys-size-600, 48px);
|
|
1139
|
-
--_nys-button-padding-y: var(--nys-space-150, 12px);
|
|
1140
|
-
--_nys-button-padding-x: var(--nys-space-250, 20px);
|
|
1141
|
-
}
|
|
1142
|
-
:host([size="lg"]) {
|
|
1143
|
-
--_nys-button-height: var(--nys-size-700, 56px);
|
|
1144
|
-
--_nys-button-padding-y: var(--nys-space-200, 16px);
|
|
1145
|
-
--_nys-button-padding-x: var(--nys-space-300, 24px);
|
|
1146
|
-
}
|
|
1147
|
-
:host([fullWidth]) {
|
|
1148
|
-
--_nys-button-width: 100%;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
/* VARIANTS */
|
|
1152
|
-
|
|
1153
|
-
/* Filled */
|
|
1154
|
-
:host([variant="filled"]) {
|
|
1155
|
-
/* Filled - Default */
|
|
1156
|
-
--_nys-button-color-bg: var(--nys-color-theme, #154973);
|
|
1157
|
-
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1158
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1159
|
-
|
|
1160
|
-
/* Filled - Hover */
|
|
1161
|
-
--_nys-button-color-bg-hover: var(--nys-color-theme-strong, #0e324f);
|
|
1162
|
-
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1163
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1164
|
-
|
|
1165
|
-
/* Filled - Pressed/Active */
|
|
1166
|
-
--_nys-button-color-bg-active: var(--nys-color-theme-stronger, #081b2b);
|
|
1167
|
-
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1168
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1169
|
-
|
|
1170
|
-
/* Filled - Disabled */
|
|
1171
|
-
--_nys-button-color-bg-disabled: var(--nys-color-neutral-10, #f6f6f6);
|
|
1172
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1173
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
/* Outline */
|
|
1177
|
-
:host([variant="outline"]) {
|
|
1178
|
-
/* Outline - Default */
|
|
1179
|
-
--_nys-button-color-bg: var(--nys-color-surface, #ffffff);
|
|
1180
|
-
--_nys-button-color-text: var(--nys-color-theme, #154973);
|
|
1181
|
-
--_nys-button-color-border: var(--nys-color-theme, #154973);
|
|
1182
|
-
|
|
1183
|
-
/* Outline - Hover */
|
|
1184
|
-
--_nys-button-color-bg-hover: var(--nys-color-theme-weaker, #eff6fb);
|
|
1185
|
-
--_nys-button-color-text-hover: var(--nys-color-theme, #154973);
|
|
1186
|
-
--_nys-button-color-border-hover: var(--nys-color-theme, #154973);
|
|
1187
|
-
|
|
1188
|
-
/* Outline - Pressed/Active */
|
|
1189
|
-
--_nys-button-color-bg-active: var(--nys-color-theme-weak, #cddde9);
|
|
1190
|
-
--_nys-button-color-text-active: var(--nys-color-theme, #154973);
|
|
1191
|
-
--_nys-button-color-border-active: var(--nys-color-theme, #154973);
|
|
1192
|
-
|
|
1193
|
-
/* Outline - Disabled */
|
|
1194
|
-
--_nys-button-color-bg-disabled: var(--nys-color-surface, #ffffff);
|
|
1195
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1196
|
-
--_nys-button-color-border-disabled: var(--nys-color-neutral-100, #d0d0ce);
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
/* Text */
|
|
1200
|
-
:host([variant="text"]) {
|
|
1201
|
-
--_nys-button-height: fit-content;
|
|
1202
|
-
--_nys-button-radius-left: var(--nys-radius-md, 4px);
|
|
1203
|
-
--_nys-button-radius-right: var(--nys-radius-md, 4px);
|
|
1204
|
-
--_nys-button-padding-y: var(--nys-space-2px, 2px);
|
|
1205
|
-
--_nys-button-padding-x: var(--nys-space-50, 4px);
|
|
1206
|
-
--_nys-button-width-border: 0px;
|
|
1207
|
-
--_nys-button-text-decoration: underline;
|
|
1208
|
-
|
|
1209
|
-
/* Text - Default */
|
|
1210
|
-
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1211
|
-
--_nys-button-color-text: var(--nys-color-link, #004dd1);
|
|
1212
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1213
|
-
|
|
1214
|
-
/* Text - Hover */
|
|
1215
|
-
--_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
|
|
1216
|
-
--_nys-button-color-text-hover: var(--nys-color-link-strong, #003ba1);
|
|
1217
|
-
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1218
|
-
|
|
1219
|
-
/* Text - Pressed/Active */
|
|
1220
|
-
--_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
|
|
1221
|
-
--_nys-button-color-text-active: var(--nys-color-link-strongest, #002971);
|
|
1222
|
-
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1223
|
-
|
|
1224
|
-
/* Text - Disabled */
|
|
1225
|
-
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1226
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1227
|
-
--_nys-button-color-border-disabled: var(
|
|
1228
|
-
--nys-color-transparent,
|
|
1229
|
-
#ffffff00
|
|
1230
|
-
);
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
/* Ghost */
|
|
1234
|
-
:host([variant="ghost"]) {
|
|
1235
|
-
/* Ghost - Default */
|
|
1236
|
-
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1237
|
-
--_nys-button-color-text: var(--nys-color-text, #1b1b1b);
|
|
1238
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1239
|
-
|
|
1240
|
-
/* Ghost - Hover */
|
|
1241
|
-
--_nys-button-color-bg-hover: var(
|
|
1242
|
-
--nys-color-black-transparent-100,
|
|
1243
|
-
#0000001a
|
|
1244
|
-
);
|
|
1245
|
-
--_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
|
|
1246
|
-
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1247
|
-
|
|
1248
|
-
/* Ghost - Active */
|
|
1249
|
-
--_nys-button-color-bg-active: var(
|
|
1250
|
-
--nys-color-black-transparent-200,
|
|
1251
|
-
#00000033
|
|
1252
|
-
);
|
|
1253
|
-
--_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
|
|
1254
|
-
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1255
|
-
|
|
1256
|
-
/* Ghost - Disabled */
|
|
1257
|
-
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1258
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
1259
|
-
--_nys-button-color-border-disabled: var(
|
|
1260
|
-
--nys-color-transparent,
|
|
1261
|
-
#ffffff00
|
|
1262
|
-
);
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
/* INVERTED VARIANTS */
|
|
1266
|
-
|
|
1267
|
-
/* Filled Inverted */
|
|
1268
|
-
:host([variant="filled"][inverted]) {
|
|
1269
|
-
/* Filled Inverted - Default */
|
|
1270
|
-
--_nys-button-color-bg: var(--nys-color-surface, #ffffff);
|
|
1271
|
-
--_nys-button-color-text: var(--nys-color-text, #1b1b1b);
|
|
1272
|
-
--_nys-button-color-border-disabled: var(
|
|
1273
|
-
--nys-color-transparent,
|
|
1274
|
-
#ffffff00
|
|
1275
|
-
);
|
|
1276
|
-
|
|
1277
|
-
/* Filled Inverted - Hover */
|
|
1278
|
-
--_nys-button-color-bg-hover: var(--nys-color-neutral-100, #d0d0ce);
|
|
1279
|
-
--_nys-button-color-text-hover: var(--nys-color-text, #1b1b1b);
|
|
1280
|
-
--_nys-button-color-border-disabled: var(
|
|
1281
|
-
--nys-color-transparent,
|
|
1282
|
-
#ffffff00
|
|
1283
|
-
);
|
|
1284
|
-
|
|
1285
|
-
/* Filled Inverted - Pressed/Active */
|
|
1286
|
-
--_nys-button-color-bg-active: var(--nys-color-neutral-300, #a7a9ab);
|
|
1287
|
-
--_nys-button-color-text-active: var(--nys-color-text, #1b1b1b);
|
|
1288
|
-
--_nys-button-color-border-disabled: var(
|
|
1289
|
-
--nys-color-transparent,
|
|
1290
|
-
#ffffff00
|
|
1291
|
-
);
|
|
1292
|
-
|
|
1293
|
-
/* Filled Inverted - Disabled */
|
|
1294
|
-
--_nys-button-color-bg-disabled: var(--nys-color-text, #1b1b1b);
|
|
1295
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
|
|
1296
|
-
--_nys-button-color-border-disabled: var(
|
|
1297
|
-
--nys-color-transparent,
|
|
1298
|
-
#ffffff00
|
|
1299
|
-
);
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
/* Outline Inverted */
|
|
1303
|
-
:host([variant="outline"][inverted]) {
|
|
1304
|
-
/* Outline Inverted - Default */
|
|
1305
|
-
--_nys-button-color-bg: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1306
|
-
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1307
|
-
--_nys-button-color-border: var(--nys-color-ink-reverse, #ffffff);
|
|
1308
|
-
|
|
1309
|
-
/* Outline Inverted - Hover */
|
|
1310
|
-
--_nys-button-color-bg-hover: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1311
|
-
--_nys-button-color-text-hover: var(--nys-color-text-reverse-weak, #d0d0ce);
|
|
1312
|
-
--_nys-button-color-border-hover: var(--nys-color-neutral-100, #d0d0ce);
|
|
1313
|
-
|
|
1314
|
-
/* Outline Inverted - Pressed/Active */
|
|
1315
|
-
--_nys-button-color-bg-active: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1316
|
-
--_nys-button-color-text-active: var(
|
|
1317
|
-
--nys-color-text-reverse-weaker,
|
|
1318
|
-
#bec0c1
|
|
1319
|
-
);
|
|
1320
|
-
--_nys-button-color-border-active: var(--nys-color-neutral-300, #a7a9ab);
|
|
1321
|
-
|
|
1322
|
-
/* Outline Inverted - Disabled */
|
|
1323
|
-
--_nys-button-color-bg-disabled: var(--nys-color-surface-reverse, #1b1b1b);
|
|
1324
|
-
--_nys-button-color-text-disabled: var(
|
|
1325
|
-
--nys-color-text-reverse-disabled,
|
|
1326
|
-
#62666a
|
|
1327
|
-
);
|
|
1328
|
-
--_nys-button-color-border-disabled: var(--nys-color-neutral-600, #62666a);
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
/* Text Inverted */
|
|
1332
|
-
:host([variant="text"][inverted]) {
|
|
1333
|
-
--_nys-button-height: fit-content;
|
|
1334
|
-
--_nys-button-radius-left: var(--nys-radius-md, 4px);
|
|
1335
|
-
--_nys-button-radius-right: var(--nys-radius-md, 4px);
|
|
1336
|
-
--_nys-button-padding-y: var(--nys-space-2px, 2px);
|
|
1337
|
-
--_nys-button-padding-x: var(--nys-space-50, 4px);
|
|
1338
|
-
--_nys-button-width-border: 0px;
|
|
1339
|
-
--_nys-button-text-decoration: underline;
|
|
1340
|
-
|
|
1341
|
-
/* Text Inverted - Default */
|
|
1342
|
-
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1343
|
-
--_nys-button-color-text: var(--nys-color-link-reverse, #a7a9ab);
|
|
1344
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1345
|
-
|
|
1346
|
-
/* Text Inverted - Hover */
|
|
1347
|
-
--_nys-button-color-bg-hover: var(--nys-color-transparent, #ffffff00);
|
|
1348
|
-
--_nys-button-color-text-hover: var(
|
|
1349
|
-
--nys-color-link-reverse-strong,
|
|
1350
|
-
#ededed
|
|
1351
|
-
);
|
|
1352
|
-
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1353
|
-
|
|
1354
|
-
/* Text Inverted - Pressed/Active */
|
|
1355
|
-
--_nys-button-color-bg-active: var(--nys-color-transparent, #ffffff00);
|
|
1356
|
-
--_nys-button-color-text-active: var(
|
|
1357
|
-
--nys-color-reverse-strongest,
|
|
1358
|
-
#ffffff
|
|
1359
|
-
);
|
|
1360
|
-
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1361
|
-
|
|
1362
|
-
/* Text Inverted - Disabled */
|
|
1363
|
-
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1364
|
-
--_nys-button-color-text-disabled: var(
|
|
1365
|
-
--nys-color-text-reverse-disabled,
|
|
1366
|
-
#62666a
|
|
1367
|
-
);
|
|
1368
|
-
--_nys-button-color-border-disabled: var(
|
|
1369
|
-
--nys-color-transparent,
|
|
1370
|
-
#ffffff00
|
|
1371
|
-
);
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
/* Ghost Inverted */
|
|
1375
|
-
:host([variant="ghost"][inverted]) {
|
|
1376
|
-
/* Ghost Inverted - Default */
|
|
1377
|
-
--_nys-button-color-bg: var(--nys-color-transparent, #ffffff00);
|
|
1378
|
-
--_nys-button-color-text: var(--nys-color-text-reverse, #ffffff);
|
|
1379
|
-
--_nys-button-color-border: var(--nys-color-transparent, #ffffff00);
|
|
1380
|
-
|
|
1381
|
-
/* Ghost Inverted - Hover */
|
|
1382
|
-
--_nys-button-color-bg-hover: var(
|
|
1383
|
-
--nys-color-white-transparent-100,
|
|
1384
|
-
#ffffff1a
|
|
1385
|
-
);
|
|
1386
|
-
--_nys-button-color-text-hover: var(--nys-color-text-reverse, #ffffff);
|
|
1387
|
-
--_nys-button-color-border-hover: var(--nys-color-transparent, #ffffff00);
|
|
1388
|
-
|
|
1389
|
-
/* Ghost Inverted - Pressed/Active */
|
|
1390
|
-
--_nys-button-color-bg-active: var(
|
|
1391
|
-
--nys-color-white-transparent-200,
|
|
1392
|
-
#ffffff33
|
|
1393
|
-
);
|
|
1394
|
-
--_nys-button-color-text-active: var(--nys-color-text-reverse, #ffffff);
|
|
1395
|
-
--_nys-button-color-border-active: var(--nys-color-transparent, #ffffff00);
|
|
1396
|
-
|
|
1397
|
-
/* Ghost Inverted - Disabled */
|
|
1398
|
-
--_nys-button-color-bg-disabled: var(--nys-color-transparent, #ffffff00);
|
|
1399
|
-
--_nys-button-color-text-disabled: var(--nys-color-text-disabled, #62666a);
|
|
1400
|
-
--_nys-button-color-border-disabled: var(
|
|
1401
|
-
--nys-color-transparent,
|
|
1402
|
-
#ffffff00
|
|
1403
|
-
);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
.nys-button {
|
|
1407
|
-
width: var(--_nys-button-width);
|
|
1408
|
-
height: var(--_nys-button-height);
|
|
1409
|
-
/* set every corner individually */
|
|
1410
|
-
border-top-left-radius: var(--_nys-button-radius-left);
|
|
1411
|
-
border-bottom-left-radius: var(--_nys-button-radius-left);
|
|
1412
|
-
border-top-right-radius: var(--_nys-button-radius-right);
|
|
1413
|
-
border-bottom-right-radius: var(--_nys-button-radius-right);
|
|
1414
|
-
padding: var(--_nys-button-padding-y) var(--_nys-button-padding-x);
|
|
1415
|
-
display: flex;
|
|
1416
|
-
align-items: center;
|
|
1417
|
-
justify-content: center;
|
|
1418
|
-
gap: var(--_nys-button-gap);
|
|
1419
|
-
font-family: var(--_nys-button-font-family);
|
|
1420
|
-
font-size: var(--_nys-button-font-size);
|
|
1421
|
-
font-weight: var(--_nys-button-font-weight);
|
|
1422
|
-
line-height: var(--_nys-button-line-height);
|
|
1423
|
-
text-decoration: var(--_nys-button-text-decoration);
|
|
1424
|
-
box-sizing: border-box;
|
|
1425
|
-
background-color: var(--_nys-button-color-bg);
|
|
1426
|
-
color: var(--_nys-button-color-text);
|
|
1427
|
-
border: solid var(--_nys-button-width-border)
|
|
1428
|
-
var(--_nys-button-color-border);
|
|
1429
|
-
cursor: pointer;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
.nys-button:hover {
|
|
1433
|
-
background-color: var(--_nys-button-color-bg-hover);
|
|
1434
|
-
color: var(--_nys-button-color-text-hover);
|
|
1435
|
-
border-color: var(--_nys-button-color-border-hover);
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
.nys-button:active {
|
|
1439
|
-
background-color: var(--_nys-button-color-bg-active);
|
|
1440
|
-
color: var(--_nys-button-color-text-active);
|
|
1441
|
-
border-color: var(--_nys-button-color-border-active);
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
.nys-button:disabled,
|
|
1445
|
-
a[disabled] {
|
|
1446
|
-
background-color: var(--_nys-button-color-bg-disabled);
|
|
1447
|
-
color: var(--_nys-button-color-text-disabled);
|
|
1448
|
-
border-color: var(--_nys-button-color-border-disabled);
|
|
1449
|
-
cursor: not-allowed;
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
.nys-button__linkwrapper:has([disabled]) {
|
|
1453
|
-
cursor: not-allowed;
|
|
1454
|
-
width: fit-content;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
/* Remove click functionality from disabled link button */
|
|
1458
|
-
a[disabled] {
|
|
1459
|
-
pointer-events: none;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
a[disabled]:hover {
|
|
1463
|
-
background-color: var(--_nys-button-color-bg-disabled);
|
|
1464
|
-
color: var(--_nys-button-color-text-disabled);
|
|
1465
|
-
border-color: var(--_nys-button-color-border-disabled);
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
.nys-button * {
|
|
1469
|
-
cursor: pointer;
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
.nys-button:disabled * {
|
|
1473
|
-
cursor: not-allowed;
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
.nys-button:focus-visible {
|
|
1477
|
-
outline-offset: var(--_nys-button-offset-focus);
|
|
1478
|
-
outline: solid var(--_nys-button-width-focus) var(--_nys-button-color-focus);
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
.nys-button__text {
|
|
1482
|
-
display: flex;
|
|
1483
|
-
align-items: center;
|
|
1484
|
-
user-select: none;
|
|
1485
|
-
}
|
|
1486
|
-
`;
|
|
1487
|
-
/**
|
|
1488
|
-
* @license
|
|
1489
|
-
* Copyright 2017 Google LLC
|
|
1490
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1491
|
-
*/
|
|
1492
|
-
const ot = globalThis, nt = ot.trustedTypes, Nt = nt ? nt.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, te = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, ee = "?" + C, De = `<${ee}>`, N = document, it = () => N.createComment(""), Z = (o) => o === null || typeof o != "object" && typeof o != "function", $t = Array.isArray, Le = (o) => $t(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", pt = `[
|
|
1493
|
-
\f\r]`, q = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Rt = /-->/g, zt = />/g, M = RegExp(`>|${pt}(?:([^\\s"'>=/]+)(${pt}*=${pt}*(?:[^
|
|
1494
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Dt = /'/g, Lt = /"/g, se = /^(?:script|style|textarea|title)$/i, Y = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), Vt = /* @__PURE__ */ new WeakMap(), O = N.createTreeWalker(N, 129);
|
|
1495
|
-
function re(o, t) {
|
|
1496
|
-
if (!$t(o) || !o.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
1497
|
-
return Nt !== void 0 ? Nt.createHTML(t) : t;
|
|
1498
|
-
}
|
|
1499
|
-
const Ve = (o, t) => {
|
|
1500
|
-
const e = o.length - 1, s = [];
|
|
1501
|
-
let r, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = q;
|
|
1502
|
-
for (let l = 0; l < e; l++) {
|
|
1503
|
-
const a = o[l];
|
|
1504
|
-
let c, d, h = -1, y = 0;
|
|
1505
|
-
for (; y < a.length && (n.lastIndex = y, d = n.exec(a), d !== null); ) y = n.lastIndex, n === q ? d[1] === "!--" ? n = Rt : d[1] !== void 0 ? n = zt : d[2] !== void 0 ? (se.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = M) : d[3] !== void 0 && (n = M) : n === M ? d[0] === ">" ? (n = r ?? q, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, c = d[1], n = d[3] === void 0 ? M : d[3] === '"' ? Lt : Dt) : n === Lt || n === Dt ? n = M : n === Rt || n === zt ? n = q : (n = M, r = void 0);
|
|
1506
|
-
const g = n === M && o[l + 1].startsWith("/>") ? " " : "";
|
|
1507
|
-
i += n === q ? a + De : h >= 0 ? (s.push(c), a.slice(0, h) + te + a.slice(h) + C + g) : a + C + (h === -2 ? l : g);
|
|
1508
|
-
}
|
|
1509
|
-
return [re(o, i + (o[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
1510
|
-
};
|
|
1511
|
-
class J {
|
|
1512
|
-
constructor({ strings: t, _$litType$: e }, s) {
|
|
1513
|
-
let r;
|
|
1514
|
-
this.parts = [];
|
|
1515
|
-
let i = 0, n = 0;
|
|
1516
|
-
const l = t.length - 1, a = this.parts, [c, d] = Ve(t, e);
|
|
1517
|
-
if (this.el = J.createElement(c, s), O.currentNode = this.el.content, e === 2 || e === 3) {
|
|
1518
|
-
const h = this.el.content.firstChild;
|
|
1519
|
-
h.replaceWith(...h.childNodes);
|
|
1520
|
-
}
|
|
1521
|
-
for (; (r = O.nextNode()) !== null && a.length < l; ) {
|
|
1522
|
-
if (r.nodeType === 1) {
|
|
1523
|
-
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(te)) {
|
|
1524
|
-
const y = d[n++], g = r.getAttribute(h).split(C), S = /([.?@])?(.*)/.exec(y);
|
|
1525
|
-
a.push({ type: 1, index: i, name: S[2], strings: g, ctor: S[1] === "." ? qe : S[1] === "?" ? je : S[1] === "@" ? Fe : ht }), r.removeAttribute(h);
|
|
1526
|
-
} else h.startsWith(C) && (a.push({ type: 6, index: i }), r.removeAttribute(h));
|
|
1527
|
-
if (se.test(r.tagName)) {
|
|
1528
|
-
const h = r.textContent.split(C), y = h.length - 1;
|
|
1529
|
-
if (y > 0) {
|
|
1530
|
-
r.textContent = nt ? nt.emptyScript : "";
|
|
1531
|
-
for (let g = 0; g < y; g++) r.append(h[g], it()), O.nextNode(), a.push({ type: 2, index: ++i });
|
|
1532
|
-
r.append(h[y], it());
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
} else if (r.nodeType === 8) if (r.data === ee) a.push({ type: 2, index: i });
|
|
1536
|
-
else {
|
|
1537
|
-
let h = -1;
|
|
1538
|
-
for (; (h = r.data.indexOf(C, h + 1)) !== -1; ) a.push({ type: 7, index: i }), h += C.length - 1;
|
|
1539
|
-
}
|
|
1540
|
-
i++;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
static createElement(t, e) {
|
|
1544
|
-
const s = N.createElement("template");
|
|
1545
|
-
return s.innerHTML = t, s;
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
function D(o, t, e = o, s) {
|
|
1549
|
-
var r, i;
|
|
1550
|
-
if (t === Y) return t;
|
|
1551
|
-
let n = s !== void 0 ? (r = e._$Co) == null ? void 0 : r[s] : e._$Cl;
|
|
1552
|
-
const l = Z(t) ? void 0 : t._$litDirective$;
|
|
1553
|
-
return (n == null ? void 0 : n.constructor) !== l && ((i = n == null ? void 0 : n._$AO) == null || i.call(n, !1), l === void 0 ? n = void 0 : (n = new l(o), n._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = n : e._$Cl = n), n !== void 0 && (t = D(o, n._$AS(o, t.values), n, s)), t;
|
|
1554
|
-
}
|
|
1555
|
-
class Be {
|
|
1556
|
-
constructor(t, e) {
|
|
1557
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
1558
|
-
}
|
|
1559
|
-
get parentNode() {
|
|
1560
|
-
return this._$AM.parentNode;
|
|
1561
|
-
}
|
|
1562
|
-
get _$AU() {
|
|
1563
|
-
return this._$AM._$AU;
|
|
1564
|
-
}
|
|
1565
|
-
u(t) {
|
|
1566
|
-
const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? N).importNode(e, !0);
|
|
1567
|
-
O.currentNode = r;
|
|
1568
|
-
let i = O.nextNode(), n = 0, l = 0, a = s[0];
|
|
1569
|
-
for (; a !== void 0; ) {
|
|
1570
|
-
if (n === a.index) {
|
|
1571
|
-
let c;
|
|
1572
|
-
a.type === 2 ? c = new lt(i, i.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(i, a.name, a.strings, this, t) : a.type === 6 && (c = new We(i, this, t)), this._$AV.push(c), a = s[++l];
|
|
1573
|
-
}
|
|
1574
|
-
n !== (a == null ? void 0 : a.index) && (i = O.nextNode(), n++);
|
|
1575
|
-
}
|
|
1576
|
-
return O.currentNode = N, r;
|
|
1577
|
-
}
|
|
1578
|
-
p(t) {
|
|
1579
|
-
let e = 0;
|
|
1580
|
-
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
class lt {
|
|
1584
|
-
get _$AU() {
|
|
1585
|
-
var t;
|
|
1586
|
-
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
1587
|
-
}
|
|
1588
|
-
constructor(t, e, s, r) {
|
|
1589
|
-
this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
|
|
1590
|
-
}
|
|
1591
|
-
get parentNode() {
|
|
1592
|
-
let t = this._$AA.parentNode;
|
|
1593
|
-
const e = this._$AM;
|
|
1594
|
-
return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
|
|
1595
|
-
}
|
|
1596
|
-
get startNode() {
|
|
1597
|
-
return this._$AA;
|
|
1598
|
-
}
|
|
1599
|
-
get endNode() {
|
|
1600
|
-
return this._$AB;
|
|
1601
|
-
}
|
|
1602
|
-
_$AI(t, e = this) {
|
|
1603
|
-
t = D(this, t, e), Z(t) ? t === v || t == null || t === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : t !== this._$AH && t !== Y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
|
|
1604
|
-
}
|
|
1605
|
-
O(t) {
|
|
1606
|
-
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
1607
|
-
}
|
|
1608
|
-
T(t) {
|
|
1609
|
-
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
1610
|
-
}
|
|
1611
|
-
_(t) {
|
|
1612
|
-
this._$AH !== v && Z(this._$AH) ? this._$AA.nextSibling.data = t : this.T(N.createTextNode(t)), this._$AH = t;
|
|
1613
|
-
}
|
|
1614
|
-
$(t) {
|
|
1615
|
-
var e;
|
|
1616
|
-
const { values: s, _$litType$: r } = t, i = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = J.createElement(re(r.h, r.h[0]), this.options)), r);
|
|
1617
|
-
if (((e = this._$AH) == null ? void 0 : e._$AD) === i) this._$AH.p(s);
|
|
1618
|
-
else {
|
|
1619
|
-
const n = new Be(i, this), l = n.u(this.options);
|
|
1620
|
-
n.p(s), this.T(l), this._$AH = n;
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
_$AC(t) {
|
|
1624
|
-
let e = Vt.get(t.strings);
|
|
1625
|
-
return e === void 0 && Vt.set(t.strings, e = new J(t)), e;
|
|
1626
|
-
}
|
|
1627
|
-
k(t) {
|
|
1628
|
-
$t(this._$AH) || (this._$AH = [], this._$AR());
|
|
1629
|
-
const e = this._$AH;
|
|
1630
|
-
let s, r = 0;
|
|
1631
|
-
for (const i of t) r === e.length ? e.push(s = new lt(this.O(it()), this.O(it()), this, this.options)) : s = e[r], s._$AI(i), r++;
|
|
1632
|
-
r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
|
|
1633
|
-
}
|
|
1634
|
-
_$AR(t = this._$AA.nextSibling, e) {
|
|
1635
|
-
var s;
|
|
1636
|
-
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
1637
|
-
const r = t.nextSibling;
|
|
1638
|
-
t.remove(), t = r;
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
setConnected(t) {
|
|
1642
|
-
var e;
|
|
1643
|
-
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
class ht {
|
|
1647
|
-
get tagName() {
|
|
1648
|
-
return this.element.tagName;
|
|
1649
|
-
}
|
|
1650
|
-
get _$AU() {
|
|
1651
|
-
return this._$AM._$AU;
|
|
1652
|
-
}
|
|
1653
|
-
constructor(t, e, s, r, i) {
|
|
1654
|
-
this.type = 1, this._$AH = v, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = v;
|
|
1655
|
-
}
|
|
1656
|
-
_$AI(t, e = this, s, r) {
|
|
1657
|
-
const i = this.strings;
|
|
1658
|
-
let n = !1;
|
|
1659
|
-
if (i === void 0) t = D(this, t, e, 0), n = !Z(t) || t !== this._$AH && t !== Y, n && (this._$AH = t);
|
|
1660
|
-
else {
|
|
1661
|
-
const l = t;
|
|
1662
|
-
let a, c;
|
|
1663
|
-
for (t = i[0], a = 0; a < i.length - 1; a++) c = D(this, l[s + a], e, a), c === Y && (c = this._$AH[a]), n || (n = !Z(c) || c !== this._$AH[a]), c === v ? t = v : t !== v && (t += (c ?? "") + i[a + 1]), this._$AH[a] = c;
|
|
1664
|
-
}
|
|
1665
|
-
n && !r && this.j(t);
|
|
1666
|
-
}
|
|
1667
|
-
j(t) {
|
|
1668
|
-
t === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
class qe extends ht {
|
|
1672
|
-
constructor() {
|
|
1673
|
-
super(...arguments), this.type = 3;
|
|
1674
|
-
}
|
|
1675
|
-
j(t) {
|
|
1676
|
-
this.element[this.name] = t === v ? void 0 : t;
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
class je extends ht {
|
|
1680
|
-
constructor() {
|
|
1681
|
-
super(...arguments), this.type = 4;
|
|
1682
|
-
}
|
|
1683
|
-
j(t) {
|
|
1684
|
-
this.element.toggleAttribute(this.name, !!t && t !== v);
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
class Fe extends ht {
|
|
1688
|
-
constructor(t, e, s, r, i) {
|
|
1689
|
-
super(t, e, s, r, i), this.type = 5;
|
|
1690
|
-
}
|
|
1691
|
-
_$AI(t, e = this) {
|
|
1692
|
-
if ((t = D(this, t, e, 0) ?? v) === Y) return;
|
|
1693
|
-
const s = this._$AH, r = t === v && s !== v || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, i = t !== v && (s === v || r);
|
|
1694
|
-
r && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
1695
|
-
}
|
|
1696
|
-
handleEvent(t) {
|
|
1697
|
-
var e;
|
|
1698
|
-
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
class We {
|
|
1702
|
-
constructor(t, e, s) {
|
|
1703
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
1704
|
-
}
|
|
1705
|
-
get _$AU() {
|
|
1706
|
-
return this._$AM._$AU;
|
|
1707
|
-
}
|
|
1708
|
-
_$AI(t) {
|
|
1709
|
-
D(this, t);
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
const Bt = ot.litHtmlPolyfillSupport;
|
|
1713
|
-
Bt == null || Bt(J, lt), (ot.litHtmlVersions ?? (ot.litHtmlVersions = [])).push("3.2.1");
|
|
1714
|
-
/**
|
|
1715
|
-
* @license
|
|
1716
|
-
* Copyright 2018 Google LLC
|
|
1717
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1718
|
-
*/
|
|
1719
|
-
const E = (o) => o ?? v;
|
|
1720
|
-
var Ge = Object.defineProperty, Ke = Object.getOwnPropertyDescriptor, m = (o, t, e, s) => {
|
|
1721
|
-
for (var r = s > 1 ? void 0 : s ? Ke(t, e) : t, i = o.length - 1, n; i >= 0; i--)
|
|
1722
|
-
(n = o[i]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
1723
|
-
return s && r && Ge(t, e, r), r;
|
|
1724
|
-
};
|
|
1725
|
-
let Ze = 0;
|
|
1726
|
-
var x;
|
|
1727
|
-
const _ = (x = class extends jt {
|
|
1728
|
-
// allows use of elementInternals' API
|
|
1729
|
-
constructor() {
|
|
1730
|
-
super(), this.id = "", this.name = "", this._size = "md", this.fullWidth = !1, this._variant = "filled", this.inverted = !1, this.label = "", this.ariaLabel = "", this.prefixIcon = "", this.suffixIcon = "", this.disabled = !1, this.form = "", this.value = "", this._type = "button", this.onClick = () => {
|
|
1731
|
-
}, this.href = "", this._target = "_self", this._internals = this.attachInternals();
|
|
1732
|
-
}
|
|
1733
|
-
get size() {
|
|
1734
|
-
return this._size;
|
|
1735
|
-
}
|
|
1736
|
-
set size(o) {
|
|
1737
|
-
this._size = x.VALID_SIZES.includes(
|
|
1738
|
-
o
|
|
1739
|
-
) ? o : "md";
|
|
1740
|
-
}
|
|
1741
|
-
get variant() {
|
|
1742
|
-
return this._variant;
|
|
1743
|
-
}
|
|
1744
|
-
set variant(o) {
|
|
1745
|
-
this._variant = x.VALID_VARIANTS.includes(
|
|
1746
|
-
o
|
|
1747
|
-
) ? o : "filled";
|
|
1748
|
-
}
|
|
1749
|
-
get type() {
|
|
1750
|
-
return this._type;
|
|
1751
|
-
}
|
|
1752
|
-
set type(o) {
|
|
1753
|
-
this._type = x.VALID_TYPES.includes(
|
|
1754
|
-
o
|
|
1755
|
-
) ? o : "button";
|
|
1756
|
-
}
|
|
1757
|
-
get target() {
|
|
1758
|
-
return this._target;
|
|
1759
|
-
}
|
|
1760
|
-
set target(o) {
|
|
1761
|
-
this._target = x.VALID_TARGETS.includes(
|
|
1762
|
-
o
|
|
1763
|
-
) ? o : "_self";
|
|
1764
|
-
}
|
|
1765
|
-
connectedCallback() {
|
|
1766
|
-
super.connectedCallback(), this.id || (this.id = this._generateUniqueId());
|
|
1767
|
-
}
|
|
1768
|
-
/******************** Functions ********************/
|
|
1769
|
-
_generateUniqueId() {
|
|
1770
|
-
return `nys-button-${Date.now()}-${Ze++}`;
|
|
1771
|
-
}
|
|
1772
|
-
_manageFormAction(o) {
|
|
1773
|
-
typeof this.onClick == "function" && this.onClick(o);
|
|
1774
|
-
const t = this._internals.form;
|
|
1775
|
-
if (t)
|
|
1776
|
-
switch (this.type) {
|
|
1777
|
-
case "submit":
|
|
1778
|
-
t.requestSubmit();
|
|
1779
|
-
break;
|
|
1780
|
-
case "reset":
|
|
1781
|
-
t.reset();
|
|
1782
|
-
break;
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
/******************** Event Handlers ********************/
|
|
1786
|
-
// Handle focus event
|
|
1787
|
-
_handleFocus() {
|
|
1788
|
-
this.dispatchEvent(new Event("nys-focus"));
|
|
1789
|
-
}
|
|
1790
|
-
// Handle blur event
|
|
1791
|
-
_handleBlur() {
|
|
1792
|
-
this.dispatchEvent(new Event("nys-blur"));
|
|
1793
|
-
}
|
|
1794
|
-
_handleClick(o) {
|
|
1795
|
-
if (this.disabled) {
|
|
1796
|
-
o.preventDefault();
|
|
1797
|
-
return;
|
|
1798
|
-
}
|
|
1799
|
-
this._manageFormAction(o), this.dispatchEvent(new Event("nys-click"));
|
|
1800
|
-
}
|
|
1801
|
-
// Handle keydown for keyboard accessibility
|
|
1802
|
-
_handleKeydown(o) {
|
|
1803
|
-
(o.code === "Space" || o.code === "Enter" || o.key === " " || o.key === "Enter") && (o.preventDefault(), this.disabled || this._manageFormAction(o));
|
|
1804
|
-
}
|
|
1805
|
-
render() {
|
|
1806
|
-
return A`
|
|
1807
|
-
${this.href ? A`
|
|
1808
|
-
<div class="nys-button__linkwrapper">
|
|
1809
|
-
<a
|
|
1810
|
-
class="nys-button"
|
|
1811
|
-
id=${E(this.id)}
|
|
1812
|
-
name=${E(this.name ? this.name : void 0)}
|
|
1813
|
-
?disabled=${this.disabled}
|
|
1814
|
-
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
1815
|
-
form=${E(this.form ? this.form : void 0)}
|
|
1816
|
-
value=${E(this.value ? this.value : void 0)}
|
|
1817
|
-
href=${this.href}
|
|
1818
|
-
target=${this.target}
|
|
1819
|
-
aria-label=${this.ariaLabel || this.label || "button"}
|
|
1820
|
-
@click=${this._handleClick}
|
|
1821
|
-
@focus="${this._handleFocus}"
|
|
1822
|
-
@blur="${this._handleBlur}"
|
|
1823
|
-
>
|
|
1824
|
-
${this.prefixIcon && this.variant !== "text" ? A`<slot name="prefix-icon">
|
|
1825
|
-
<nys-icon size="16" name=${this.prefixIcon}></nys-icon>
|
|
1826
|
-
</slot>` : ""}
|
|
1827
|
-
${this.label ? A`<label class="nys-button__text">${this.label}</label>` : ""}
|
|
1828
|
-
${this.suffixIcon && this.variant !== "text" ? A`<slot name="suffix-icon">
|
|
1829
|
-
<nys-icon size="16" name=${this.suffixIcon}></nys-icon>
|
|
1830
|
-
</slot>` : ""}
|
|
1831
|
-
</a>
|
|
1832
|
-
</div>
|
|
1833
|
-
` : A`
|
|
1834
|
-
<button
|
|
1835
|
-
class="nys-button"
|
|
1836
|
-
id=${E(this.id)}
|
|
1837
|
-
name=${E(this.name ? this.name : void 0)}
|
|
1838
|
-
?disabled=${this.disabled}
|
|
1839
|
-
form=${E(this.form ? this.form : void 0)}
|
|
1840
|
-
value=${E(this.value ? this.value : void 0)}
|
|
1841
|
-
type=${this.type}
|
|
1842
|
-
aria-label=${this.ariaLabel || this.label || "button"}
|
|
1843
|
-
@click=${this._handleClick}
|
|
1844
|
-
@focus="${this._handleFocus}"
|
|
1845
|
-
@blur="${this._handleBlur}"
|
|
1846
|
-
@keydown="${this._handleKeydown}"
|
|
1847
|
-
>
|
|
1848
|
-
${this.prefixIcon && this.variant !== "text" ? A`<slot name="prefix-icon">
|
|
1849
|
-
<nys-icon size="16" name=${this.prefixIcon}></nys-icon>
|
|
1850
|
-
</slot>` : ""}
|
|
1851
|
-
${this.label ? A`<label class="nys-button__text">${this.label}</label>` : ""}
|
|
1852
|
-
${this.suffixIcon && this.variant !== "text" ? A`<slot name="suffix-icon">
|
|
1853
|
-
<nys-icon size="16" name=${this.suffixIcon}></nys-icon>
|
|
1854
|
-
</slot>` : ""}
|
|
1855
|
-
</button>
|
|
1856
|
-
`}
|
|
1857
|
-
`;
|
|
1858
|
-
}
|
|
1859
|
-
}, x.VALID_SIZES = ["sm", "md", "lg"], x.VALID_VARIANTS = [
|
|
1860
|
-
"filled",
|
|
1861
|
-
"outline",
|
|
1862
|
-
"ghost",
|
|
1863
|
-
"text"
|
|
1864
|
-
], x.VALID_TYPES = ["submit", "reset", "button"], x.VALID_TARGETS = [
|
|
1865
|
-
"_self",
|
|
1866
|
-
"_blank",
|
|
1867
|
-
"_parent",
|
|
1868
|
-
"_top",
|
|
1869
|
-
"framename"
|
|
1870
|
-
], x.styles = ze, x.formAssociated = !0, x);
|
|
1871
|
-
m([
|
|
1872
|
-
$({ type: String })
|
|
1873
|
-
], _.prototype, "id", 2);
|
|
1874
|
-
m([
|
|
1875
|
-
$({ type: String, reflect: !0 })
|
|
1876
|
-
], _.prototype, "name", 2);
|
|
1877
|
-
m([
|
|
1878
|
-
$({ reflect: !0 })
|
|
1879
|
-
], _.prototype, "size", 1);
|
|
1880
|
-
m([
|
|
1881
|
-
$({ type: Boolean, reflect: !0 })
|
|
1882
|
-
], _.prototype, "fullWidth", 2);
|
|
1883
|
-
m([
|
|
1884
|
-
$({ reflect: !0 })
|
|
1885
|
-
], _.prototype, "variant", 1);
|
|
1886
|
-
m([
|
|
1887
|
-
$({ type: Boolean, reflect: !0 })
|
|
1888
|
-
], _.prototype, "inverted", 2);
|
|
1889
|
-
m([
|
|
1890
|
-
$({ type: String })
|
|
1891
|
-
], _.prototype, "label", 2);
|
|
1892
|
-
m([
|
|
1893
|
-
$({ type: String })
|
|
1894
|
-
], _.prototype, "ariaLabel", 2);
|
|
1895
|
-
m([
|
|
1896
|
-
$({ type: String })
|
|
1897
|
-
], _.prototype, "prefixIcon", 2);
|
|
1898
|
-
m([
|
|
1899
|
-
$({ type: String })
|
|
1900
|
-
], _.prototype, "suffixIcon", 2);
|
|
1901
|
-
m([
|
|
1902
|
-
$({ type: Boolean, reflect: !0 })
|
|
1903
|
-
], _.prototype, "disabled", 2);
|
|
1904
|
-
m([
|
|
1905
|
-
$({ type: String })
|
|
1906
|
-
], _.prototype, "form", 2);
|
|
1907
|
-
m([
|
|
1908
|
-
$({ type: String })
|
|
1909
|
-
], _.prototype, "value", 2);
|
|
1910
|
-
m([
|
|
1911
|
-
$({ reflect: !0 })
|
|
1912
|
-
], _.prototype, "type", 1);
|
|
1913
|
-
m([
|
|
1914
|
-
$({ type: Function })
|
|
1915
|
-
], _.prototype, "onClick", 2);
|
|
1916
|
-
m([
|
|
1917
|
-
$({ type: String })
|
|
1918
|
-
], _.prototype, "href", 2);
|
|
1919
|
-
m([
|
|
1920
|
-
$({ reflect: !0 })
|
|
1921
|
-
], _.prototype, "target", 1);
|
|
1922
|
-
let Ye = _;
|
|
1923
|
-
customElements.get("nys-button") || customElements.define("nys-button", Ye);
|
|
1924
|
-
var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, f = (o, t, e, s) => {
|
|
1925
|
-
for (var r = s > 1 ? void 0 : s ? Qe(t, e) : t, i = o.length - 1, n; i >= 0; i--)
|
|
1926
|
-
(n = o[i]) && (r = (s ? n(t, e, r) : n(r)) || r);
|
|
1927
|
-
return s && r && Je(t, e, r), r;
|
|
1928
|
-
};
|
|
1929
|
-
let Xe = 0;
|
|
1930
|
-
var w;
|
|
1931
|
-
const u = (w = class extends jt {
|
|
1932
|
-
// allows use of elementInternals' API
|
|
1933
|
-
constructor() {
|
|
1934
|
-
super(), this.id = "", this.name = "", this._type = "text", this.label = "", this.description = "", this.placeholder = "", this.value = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.optional = !1, this.form = "", this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._internals = this.attachInternals();
|
|
1935
|
-
}
|
|
1936
|
-
get type() {
|
|
1937
|
-
return this._type;
|
|
1938
|
-
}
|
|
1939
|
-
set type(t) {
|
|
1940
|
-
this._type = w.VALID_TYPES.includes(
|
|
1941
|
-
t
|
|
1942
|
-
) ? t : "text";
|
|
1943
|
-
}
|
|
1944
|
-
// Ensure the "width" property is valid after updates
|
|
1945
|
-
async updated(t) {
|
|
1946
|
-
t.has("width") && (await Promise.resolve(), this.width = w.VALID_WIDTHS.includes(this.width) ? this.width : "full"), t.has("disabled") && (this._validateButtonSlot("startButton"), this._validateButtonSlot("endButton"));
|
|
1947
|
-
}
|
|
1948
|
-
// Generate a unique ID if one is not provided
|
|
1949
|
-
connectedCallback() {
|
|
1950
|
-
super.connectedCallback(), this.id || (this.id = `nys-textinput-${Date.now()}-${Xe++}`), this._originalErrorMessage = this.errorMessage ?? "", this.addEventListener("invalid", this._handleInvalid);
|
|
1951
|
-
}
|
|
1952
|
-
disconnectedCallback() {
|
|
1953
|
-
super.disconnectedCallback(), this.removeEventListener("invalid", this._handleInvalid);
|
|
1954
|
-
}
|
|
1955
|
-
firstUpdated() {
|
|
1956
|
-
this._setValue(), this._manageRequire();
|
|
1957
|
-
}
|
|
1958
|
-
// This callback is automatically called when the parent form is reset.
|
|
1959
|
-
formResetCallback() {
|
|
1960
|
-
this.value = "";
|
|
1961
|
-
}
|
|
1962
|
-
/********************** Form Integration **********************/
|
|
1963
|
-
_setValue() {
|
|
1964
|
-
this._internals.setFormValue(this.value), this._manageRequire();
|
|
1965
|
-
}
|
|
1966
|
-
_manageRequire() {
|
|
1967
|
-
var r, i;
|
|
1968
|
-
const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("input");
|
|
1969
|
-
if (!t) return;
|
|
1970
|
-
const e = this.errorMessage || "This field is required";
|
|
1971
|
-
this.required && (!this.value || ((i = this.value) == null ? void 0 : i.trim()) === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
|
|
1972
|
-
}
|
|
1973
|
-
_setValidityMessage(t = "") {
|
|
1974
|
-
var r, i;
|
|
1975
|
-
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("input");
|
|
1976
|
-
if (!e) return;
|
|
1977
|
-
this.showError = !!t, (i = this._originalErrorMessage) != null && i.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
|
|
1978
|
-
const s = t ? { customError: !0 } : {};
|
|
1979
|
-
this._internals.setValidity(s, this.errorMessage, e);
|
|
817
|
+
_setValidityMessage(t = "") {
|
|
818
|
+
var i, r;
|
|
819
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
820
|
+
if (!e) return;
|
|
821
|
+
this.showError = !!t, (r = this._originalErrorMessage) != null && r.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
|
|
822
|
+
const s = t ? { customError: !0 } : {};
|
|
823
|
+
this._internals.setValidity(s, this.errorMessage, e);
|
|
1980
824
|
}
|
|
1981
825
|
_validate() {
|
|
1982
|
-
var
|
|
1983
|
-
const t = (
|
|
826
|
+
var i;
|
|
827
|
+
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
1984
828
|
if (!t) return;
|
|
1985
829
|
const e = t.validity;
|
|
1986
830
|
let s = "";
|
|
@@ -1998,8 +842,8 @@ const u = (w = class extends jt {
|
|
|
1998
842
|
t.preventDefault(), this._hasUserInteracted = !0, this._validate();
|
|
1999
843
|
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input");
|
|
2000
844
|
if (e) {
|
|
2001
|
-
const
|
|
2002
|
-
|
|
845
|
+
const i = this._internals.form;
|
|
846
|
+
i ? Array.from(i.elements).find(
|
|
2003
847
|
(l) => typeof l.checkValidity == "function" && !l.checkValidity()
|
|
2004
848
|
) === this && e.focus() : e.focus();
|
|
2005
849
|
}
|
|
@@ -2028,24 +872,24 @@ const u = (w = class extends jt {
|
|
|
2028
872
|
this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(new Event("nys-blur"));
|
|
2029
873
|
}
|
|
2030
874
|
_validateButtonSlot(t) {
|
|
2031
|
-
var
|
|
2032
|
-
const e = (
|
|
875
|
+
var o, l;
|
|
876
|
+
const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector(
|
|
2033
877
|
'slot[name="' + t + '"]'
|
|
2034
878
|
), s = (l = this.shadowRoot) == null ? void 0 : l.querySelector(
|
|
2035
879
|
".nys-textinput__buttoncontainer"
|
|
2036
880
|
);
|
|
2037
881
|
if (!e || !s) return;
|
|
2038
|
-
const
|
|
2039
|
-
let
|
|
2040
|
-
|
|
2041
|
-
a instanceof HTMLElement && a.tagName.toLowerCase() === "nys-button" && !
|
|
882
|
+
const i = e.assignedElements();
|
|
883
|
+
let r = !1;
|
|
884
|
+
i.forEach((a) => {
|
|
885
|
+
a instanceof HTMLElement && a.tagName.toLowerCase() === "nys-button" && !r ? (r = !0, a.setAttribute("size", "sm"), a.setAttribute("variant", "primary"), this.disabled ? a.setAttribute("disabled", "true") : a.removeAttribute("disabled")) : (console.warn(
|
|
2042
886
|
"The '" + t + "' slot only accepts a single <nys-button> element. Removing invalid or extra node:",
|
|
2043
887
|
a
|
|
2044
888
|
), a.remove());
|
|
2045
|
-
}), t === "startButton" ? s.classList.toggle("has-start-button",
|
|
889
|
+
}), t === "startButton" ? s.classList.toggle("has-start-button", r) : t === "endButton" && s.classList.toggle("has-end-button", r);
|
|
2046
890
|
}
|
|
2047
891
|
render() {
|
|
2048
|
-
return
|
|
892
|
+
return F`
|
|
2049
893
|
<div class="nys-textinput">
|
|
2050
894
|
<nys-label
|
|
2051
895
|
id=${this.id}
|
|
@@ -2073,22 +917,22 @@ const u = (w = class extends jt {
|
|
|
2073
917
|
aria-disabled="${this.disabled}"
|
|
2074
918
|
aria-label="${[this.label, this.description].filter(Boolean).join(" ")}"
|
|
2075
919
|
.value=${this.value}
|
|
2076
|
-
placeholder=${
|
|
920
|
+
placeholder=${x(
|
|
2077
921
|
this.placeholder ? this.placeholder : void 0
|
|
2078
922
|
)}
|
|
2079
|
-
pattern=${
|
|
2080
|
-
min=${
|
|
2081
|
-
maxlength=${
|
|
923
|
+
pattern=${x(this.pattern ? this.pattern : void 0)}
|
|
924
|
+
min=${x(this.min !== "" ? this.min : void 0)}
|
|
925
|
+
maxlength=${x(
|
|
2082
926
|
this.maxlength !== "" ? this.maxlength : void 0
|
|
2083
927
|
)}
|
|
2084
|
-
step=${
|
|
2085
|
-
max=${
|
|
2086
|
-
form=${
|
|
928
|
+
step=${x(this.step !== "" ? this.step : void 0)}
|
|
929
|
+
max=${x(this.max !== "" ? this.max : void 0)}
|
|
930
|
+
form=${x(this.form ? this.form : void 0)}
|
|
2087
931
|
@input=${this._handleInput}
|
|
2088
932
|
@focus="${this._handleFocus}"
|
|
2089
933
|
@blur="${this._handleBlur}"
|
|
2090
934
|
/>
|
|
2091
|
-
${this.type === "password" ?
|
|
935
|
+
${this.type === "password" ? F` <nys-button
|
|
2092
936
|
class="eye-icon"
|
|
2093
937
|
id="password-toggle"
|
|
2094
938
|
suffixIcon="slotted"
|
|
@@ -2115,7 +959,7 @@ const u = (w = class extends jt {
|
|
|
2115
959
|
</div>
|
|
2116
960
|
`;
|
|
2117
961
|
}
|
|
2118
|
-
},
|
|
962
|
+
}, f.VALID_TYPES = [
|
|
2119
963
|
"email",
|
|
2120
964
|
"number",
|
|
2121
965
|
"password",
|
|
@@ -2123,73 +967,73 @@ const u = (w = class extends jt {
|
|
|
2123
967
|
"tel",
|
|
2124
968
|
"text",
|
|
2125
969
|
"url"
|
|
2126
|
-
],
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
],
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
],
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
],
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
],
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
],
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
],
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
],
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
],
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
],
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
],
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
],
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
],
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
],
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
],
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
],
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
],
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
],
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
],
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
],
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
],
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
],
|
|
2190
|
-
let
|
|
2191
|
-
customElements.get("nys-textinput") || customElements.define("nys-textinput",
|
|
970
|
+
], f.VALID_WIDTHS = ["sm", "md", "lg", "full"], f.styles = wt, f.formAssociated = !0, f);
|
|
971
|
+
c([
|
|
972
|
+
u({ type: String })
|
|
973
|
+
], d.prototype, "id", 2);
|
|
974
|
+
c([
|
|
975
|
+
u({ type: String, reflect: !0 })
|
|
976
|
+
], d.prototype, "name", 2);
|
|
977
|
+
c([
|
|
978
|
+
u({ reflect: !0 })
|
|
979
|
+
], d.prototype, "type", 1);
|
|
980
|
+
c([
|
|
981
|
+
u({ type: String })
|
|
982
|
+
], d.prototype, "label", 2);
|
|
983
|
+
c([
|
|
984
|
+
u({ type: String })
|
|
985
|
+
], d.prototype, "description", 2);
|
|
986
|
+
c([
|
|
987
|
+
u({ type: String })
|
|
988
|
+
], d.prototype, "placeholder", 2);
|
|
989
|
+
c([
|
|
990
|
+
u({ type: String })
|
|
991
|
+
], d.prototype, "value", 2);
|
|
992
|
+
c([
|
|
993
|
+
u({ type: Boolean, reflect: !0 })
|
|
994
|
+
], d.prototype, "disabled", 2);
|
|
995
|
+
c([
|
|
996
|
+
u({ type: Boolean, reflect: !0 })
|
|
997
|
+
], d.prototype, "readonly", 2);
|
|
998
|
+
c([
|
|
999
|
+
u({ type: Boolean, reflect: !0 })
|
|
1000
|
+
], d.prototype, "required", 2);
|
|
1001
|
+
c([
|
|
1002
|
+
u({ type: Boolean, reflect: !0 })
|
|
1003
|
+
], d.prototype, "optional", 2);
|
|
1004
|
+
c([
|
|
1005
|
+
u({ type: String })
|
|
1006
|
+
], d.prototype, "form", 2);
|
|
1007
|
+
c([
|
|
1008
|
+
u({ type: String })
|
|
1009
|
+
], d.prototype, "pattern", 2);
|
|
1010
|
+
c([
|
|
1011
|
+
u({ type: Number })
|
|
1012
|
+
], d.prototype, "maxlength", 2);
|
|
1013
|
+
c([
|
|
1014
|
+
u({ reflect: !0 })
|
|
1015
|
+
], d.prototype, "width", 2);
|
|
1016
|
+
c([
|
|
1017
|
+
u({ type: Number })
|
|
1018
|
+
], d.prototype, "step", 2);
|
|
1019
|
+
c([
|
|
1020
|
+
u({ type: Number })
|
|
1021
|
+
], d.prototype, "min", 2);
|
|
1022
|
+
c([
|
|
1023
|
+
u({ type: Number })
|
|
1024
|
+
], d.prototype, "max", 2);
|
|
1025
|
+
c([
|
|
1026
|
+
u({ type: Boolean, reflect: !0 })
|
|
1027
|
+
], d.prototype, "showError", 2);
|
|
1028
|
+
c([
|
|
1029
|
+
u({ type: String })
|
|
1030
|
+
], d.prototype, "errorMessage", 2);
|
|
1031
|
+
c([
|
|
1032
|
+
xt()
|
|
1033
|
+
], d.prototype, "showPassword", 2);
|
|
1034
|
+
let Nt = d;
|
|
1035
|
+
customElements.get("nys-textinput") || customElements.define("nys-textinput", Nt);
|
|
2192
1036
|
export {
|
|
2193
|
-
|
|
1037
|
+
Nt as NysTextinput
|
|
2194
1038
|
};
|
|
2195
1039
|
//# sourceMappingURL=nys-textinput.js.map
|