@nysds/nys-textinput 1.10.0 → 1.11.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 +1 -0
- package/dist/nys-textinput.js +223 -250
- package/dist/nys-textinput.js.map +1 -1
- package/package.json +5 -8
package/dist/nys-textinput.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as ot, LitElement as at, html as j } from "lit";
|
|
2
2
|
/*!
|
|
3
3
|
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
4
4
|
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
@@ -14,18 +14,18 @@ import { css as lt, LitElement as ht, html as F } from "lit";
|
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
18
|
-
let
|
|
17
|
+
const O = globalThis, L = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, et = Symbol(), W = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let lt = class {
|
|
19
19
|
constructor(t, e, s) {
|
|
20
|
-
if (this._$cssResult$ = !0, s !==
|
|
20
|
+
if (this._$cssResult$ = !0, s !== et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
21
21
|
this.cssText = t, this.t = e;
|
|
22
22
|
}
|
|
23
23
|
get styleSheet() {
|
|
24
24
|
let t = this.o;
|
|
25
25
|
const e = this.t;
|
|
26
|
-
if (
|
|
26
|
+
if (L && t === void 0) {
|
|
27
27
|
const s = e !== void 0 && e.length === 1;
|
|
28
|
-
s && (t =
|
|
28
|
+
s && (t = W.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && W.set(e, t));
|
|
29
29
|
}
|
|
30
30
|
return t;
|
|
31
31
|
}
|
|
@@ -33,90 +33,88 @@ let dt = class {
|
|
|
33
33
|
return this.cssText;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
36
|
+
const ht = (r) => new lt(typeof r == "string" ? r : r + "", void 0, et), dt = (r, t) => {
|
|
37
|
+
if (L) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
38
38
|
else for (const e of t) {
|
|
39
|
-
const s = document.createElement("style"), i =
|
|
40
|
-
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText,
|
|
39
|
+
const s = document.createElement("style"), i = O.litNonce;
|
|
40
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, F = L ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
43
43
|
let e = "";
|
|
44
44
|
for (const s of t.cssRules) e += s.cssText;
|
|
45
|
-
return
|
|
46
|
-
})(
|
|
45
|
+
return ht(e);
|
|
46
|
+
})(r) : r;
|
|
47
47
|
/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
51
|
*/
|
|
52
|
-
const { is:
|
|
52
|
+
const { is: ut, defineProperty: ct, getOwnPropertyDescriptor: pt, getOwnPropertyNames: yt, getOwnPropertySymbols: _t, getPrototypeOf: ft } = Object, I = globalThis, Y = I.trustedTypes, vt = Y ? Y.emptyScript : "", bt = I.reactiveElementPolyfillSupport, P = (r, t) => r, T = { toAttribute(r, t) {
|
|
53
53
|
switch (t) {
|
|
54
54
|
case Boolean:
|
|
55
|
-
|
|
55
|
+
r = r ? vt : null;
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
|
-
|
|
59
|
+
r = r == null ? r : JSON.stringify(r);
|
|
60
60
|
}
|
|
61
|
-
return
|
|
62
|
-
}, fromAttribute(
|
|
63
|
-
let e =
|
|
61
|
+
return r;
|
|
62
|
+
}, fromAttribute(r, t) {
|
|
63
|
+
let e = r;
|
|
64
64
|
switch (t) {
|
|
65
65
|
case Boolean:
|
|
66
|
-
e =
|
|
66
|
+
e = r !== null;
|
|
67
67
|
break;
|
|
68
68
|
case Number:
|
|
69
|
-
e =
|
|
69
|
+
e = r === null ? null : Number(r);
|
|
70
70
|
break;
|
|
71
71
|
case Object:
|
|
72
72
|
case Array:
|
|
73
73
|
try {
|
|
74
|
-
e = JSON.parse(
|
|
74
|
+
e = JSON.parse(r);
|
|
75
75
|
} catch {
|
|
76
76
|
e = null;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
return e;
|
|
80
|
-
} },
|
|
81
|
-
Symbol.metadata
|
|
82
|
-
class
|
|
80
|
+
} }, V = (r, t) => !ut(r, t), G = { attribute: !0, type: String, converter: T, reflect: !1, useDefault: !1, hasChanged: V };
|
|
81
|
+
Symbol.metadata ??= Symbol("metadata"), I.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
82
|
+
class E extends HTMLElement {
|
|
83
83
|
static addInitializer(t) {
|
|
84
|
-
this._$Ei(), (this.l
|
|
84
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
85
85
|
}
|
|
86
86
|
static get observedAttributes() {
|
|
87
87
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
88
88
|
}
|
|
89
|
-
static createProperty(t, e =
|
|
90
|
-
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
89
|
+
static createProperty(t, e = G) {
|
|
90
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
91
91
|
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
92
|
-
i !== void 0 &&
|
|
92
|
+
i !== void 0 && ct(this.prototype, t, i);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
static getPropertyDescriptor(t, e, s) {
|
|
96
|
-
const { get: i, set: n } =
|
|
96
|
+
const { get: i, set: n } = pt(this.prototype, t) ?? { get() {
|
|
97
97
|
return this[e];
|
|
98
|
-
}, set(
|
|
99
|
-
this[e] =
|
|
98
|
+
}, set(o) {
|
|
99
|
+
this[e] = o;
|
|
100
100
|
} };
|
|
101
|
-
return { get() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const l = i == null ? void 0 : i.call(this);
|
|
105
|
-
n.call(this, r), this.requestUpdate(t, l, s);
|
|
101
|
+
return { get: i, set(o) {
|
|
102
|
+
const l = i?.call(this);
|
|
103
|
+
n?.call(this, o), this.requestUpdate(t, l, s);
|
|
106
104
|
}, configurable: !0, enumerable: !0 };
|
|
107
105
|
}
|
|
108
106
|
static getPropertyOptions(t) {
|
|
109
|
-
return this.elementProperties.get(t) ??
|
|
107
|
+
return this.elementProperties.get(t) ?? G;
|
|
110
108
|
}
|
|
111
109
|
static _$Ei() {
|
|
112
|
-
if (this.hasOwnProperty(
|
|
113
|
-
const t =
|
|
110
|
+
if (this.hasOwnProperty(P("elementProperties"))) return;
|
|
111
|
+
const t = ft(this);
|
|
114
112
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
115
113
|
}
|
|
116
114
|
static finalize() {
|
|
117
|
-
if (this.hasOwnProperty(
|
|
118
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
119
|
-
const e = this.properties, s = [...
|
|
115
|
+
if (this.hasOwnProperty(P("finalized"))) return;
|
|
116
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
|
|
117
|
+
const e = this.properties, s = [...yt(e), ..._t(e)];
|
|
120
118
|
for (const i of s) this.createProperty(i, e[i]);
|
|
121
119
|
}
|
|
122
120
|
const t = this[Symbol.metadata];
|
|
@@ -135,8 +133,8 @@ class S extends HTMLElement {
|
|
|
135
133
|
const e = [];
|
|
136
134
|
if (Array.isArray(t)) {
|
|
137
135
|
const s = new Set(t.flat(1 / 0).reverse());
|
|
138
|
-
for (const i of s) e.unshift(
|
|
139
|
-
} else t !== void 0 && e.push(
|
|
136
|
+
for (const i of s) e.unshift(F(i));
|
|
137
|
+
} else t !== void 0 && e.push(F(t));
|
|
140
138
|
return e;
|
|
141
139
|
}
|
|
142
140
|
static _$Eu(t, e) {
|
|
@@ -147,16 +145,13 @@ class S extends HTMLElement {
|
|
|
147
145
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
148
146
|
}
|
|
149
147
|
_$Ev() {
|
|
150
|
-
|
|
151
|
-
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));
|
|
148
|
+
this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
|
|
152
149
|
}
|
|
153
150
|
addController(t) {
|
|
154
|
-
|
|
155
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
|
|
151
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
156
152
|
}
|
|
157
153
|
removeController(t) {
|
|
158
|
-
|
|
159
|
-
(e = this._$EO) == null || e.delete(t);
|
|
154
|
+
this._$EO?.delete(t);
|
|
160
155
|
}
|
|
161
156
|
_$E_() {
|
|
162
157
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
@@ -165,54 +160,47 @@ class S extends HTMLElement {
|
|
|
165
160
|
}
|
|
166
161
|
createRenderRoot() {
|
|
167
162
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return
|
|
163
|
+
return dt(t, this.constructor.elementStyles), t;
|
|
169
164
|
}
|
|
170
165
|
connectedCallback() {
|
|
171
|
-
|
|
172
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
173
|
-
var s;
|
|
174
|
-
return (s = e.hostConnected) == null ? void 0 : s.call(e);
|
|
175
|
-
});
|
|
166
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
176
167
|
}
|
|
177
168
|
enableUpdating(t) {
|
|
178
169
|
}
|
|
179
170
|
disconnectedCallback() {
|
|
180
|
-
|
|
181
|
-
(t = this._$EO) == null || t.forEach((e) => {
|
|
182
|
-
var s;
|
|
183
|
-
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
|
|
184
|
-
});
|
|
171
|
+
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
185
172
|
}
|
|
186
173
|
attributeChangedCallback(t, e, s) {
|
|
187
174
|
this._$AK(t, s);
|
|
188
175
|
}
|
|
189
|
-
_$
|
|
190
|
-
var n;
|
|
176
|
+
_$ET(t, e) {
|
|
191
177
|
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
192
178
|
if (i !== void 0 && s.reflect === !0) {
|
|
193
|
-
const
|
|
194
|
-
this._$Em = t,
|
|
179
|
+
const n = (s.converter?.toAttribute !== void 0 ? s.converter : T).toAttribute(e, s.type);
|
|
180
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
195
181
|
}
|
|
196
182
|
}
|
|
197
183
|
_$AK(t, e) {
|
|
198
|
-
var n;
|
|
199
184
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
200
185
|
if (i !== void 0 && this._$Em !== i) {
|
|
201
|
-
const
|
|
202
|
-
this._$Em = i
|
|
186
|
+
const n = s.getPropertyOptions(i), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : T;
|
|
187
|
+
this._$Em = i;
|
|
188
|
+
const l = o.fromAttribute(e, n.type);
|
|
189
|
+
this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
|
|
203
190
|
}
|
|
204
191
|
}
|
|
205
192
|
requestUpdate(t, e, s) {
|
|
206
193
|
if (t !== void 0) {
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
const i = this.constructor, n = this[t];
|
|
195
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? V)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
196
|
+
this.C(t, e, s);
|
|
209
197
|
}
|
|
210
|
-
this.isUpdatePending === !1 && (this._$ES = this._$
|
|
198
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
211
199
|
}
|
|
212
|
-
|
|
213
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
200
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
|
|
201
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
214
202
|
}
|
|
215
|
-
async _$
|
|
203
|
+
async _$EP() {
|
|
216
204
|
this.isUpdatePending = !0;
|
|
217
205
|
try {
|
|
218
206
|
await this._$ES;
|
|
@@ -226,38 +214,33 @@ class S extends HTMLElement {
|
|
|
226
214
|
return this.performUpdate();
|
|
227
215
|
}
|
|
228
216
|
performUpdate() {
|
|
229
|
-
var s;
|
|
230
217
|
if (!this.isUpdatePending) return;
|
|
231
218
|
if (!this.hasUpdated) {
|
|
232
|
-
if (this.renderRoot
|
|
233
|
-
for (const [
|
|
219
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
220
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
234
221
|
this._$Ep = void 0;
|
|
235
222
|
}
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
223
|
+
const s = this.constructor.elementProperties;
|
|
224
|
+
if (s.size > 0) for (const [i, n] of s) {
|
|
225
|
+
const { wrapped: o } = n, l = this[i];
|
|
226
|
+
o !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, n, l);
|
|
227
|
+
}
|
|
238
228
|
}
|
|
239
229
|
let t = !1;
|
|
240
230
|
const e = this._$AL;
|
|
241
231
|
try {
|
|
242
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}), this.update(e)) : this._$EU();
|
|
246
|
-
} catch (i) {
|
|
247
|
-
throw t = !1, this._$EU(), i;
|
|
232
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
233
|
+
} catch (s) {
|
|
234
|
+
throw t = !1, this._$EM(), s;
|
|
248
235
|
}
|
|
249
236
|
t && this._$AE(e);
|
|
250
237
|
}
|
|
251
238
|
willUpdate(t) {
|
|
252
239
|
}
|
|
253
240
|
_$AE(t) {
|
|
254
|
-
|
|
255
|
-
(e = this._$EO) == null || e.forEach((s) => {
|
|
256
|
-
var i;
|
|
257
|
-
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
|
|
258
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
241
|
+
this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
259
242
|
}
|
|
260
|
-
_$
|
|
243
|
+
_$EM() {
|
|
261
244
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
262
245
|
}
|
|
263
246
|
get updateComplete() {
|
|
@@ -270,55 +253,55 @@ class S extends HTMLElement {
|
|
|
270
253
|
return !0;
|
|
271
254
|
}
|
|
272
255
|
update(t) {
|
|
273
|
-
this._$
|
|
256
|
+
this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
|
|
274
257
|
}
|
|
275
258
|
updated(t) {
|
|
276
259
|
}
|
|
277
260
|
firstUpdated(t) {
|
|
278
261
|
}
|
|
279
262
|
}
|
|
280
|
-
|
|
263
|
+
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[P("elementProperties")] = /* @__PURE__ */ new Map(), E[P("finalized")] = /* @__PURE__ */ new Map(), bt?.({ ReactiveElement: E }), (I.reactiveElementVersions ??= []).push("2.1.1");
|
|
281
264
|
/**
|
|
282
265
|
* @license
|
|
283
266
|
* Copyright 2017 Google LLC
|
|
284
267
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
285
268
|
*/
|
|
286
|
-
const
|
|
269
|
+
const gt = { attribute: !0, type: String, converter: T, reflect: !1, hasChanged: V }, $t = (r = gt, t, e) => {
|
|
287
270
|
const { kind: s, metadata: i } = e;
|
|
288
271
|
let n = globalThis.litPropertyMetadata.get(i);
|
|
289
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name,
|
|
290
|
-
const { name:
|
|
272
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
|
|
273
|
+
const { name: o } = e;
|
|
291
274
|
return { set(l) {
|
|
292
275
|
const a = t.get.call(this);
|
|
293
|
-
t.set.call(this, l), this.requestUpdate(
|
|
276
|
+
t.set.call(this, l), this.requestUpdate(o, a, r);
|
|
294
277
|
}, init(l) {
|
|
295
|
-
return l !== void 0 && this.
|
|
278
|
+
return l !== void 0 && this.C(o, void 0, r, l), l;
|
|
296
279
|
} };
|
|
297
280
|
}
|
|
298
281
|
if (s === "setter") {
|
|
299
|
-
const { name:
|
|
282
|
+
const { name: o } = e;
|
|
300
283
|
return function(l) {
|
|
301
|
-
const a = this[
|
|
302
|
-
t.call(this, l), this.requestUpdate(
|
|
284
|
+
const a = this[o];
|
|
285
|
+
t.call(this, l), this.requestUpdate(o, a, r);
|
|
303
286
|
};
|
|
304
287
|
}
|
|
305
288
|
throw Error("Unsupported decorator location: " + s);
|
|
306
289
|
};
|
|
307
|
-
function u(
|
|
308
|
-
return (t, e) => typeof e == "object" ? $t(
|
|
309
|
-
const
|
|
310
|
-
return i.constructor.createProperty(n,
|
|
311
|
-
})(
|
|
290
|
+
function u(r) {
|
|
291
|
+
return (t, e) => typeof e == "object" ? $t(r, t, e) : ((s, i, n) => {
|
|
292
|
+
const o = i.hasOwnProperty(n);
|
|
293
|
+
return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
294
|
+
})(r, t, e);
|
|
312
295
|
}
|
|
313
296
|
/**
|
|
314
297
|
* @license
|
|
315
298
|
* Copyright 2017 Google LLC
|
|
316
299
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
317
300
|
*/
|
|
318
|
-
function
|
|
319
|
-
return u({ ...
|
|
301
|
+
function mt(r) {
|
|
302
|
+
return u({ ...r, state: !0, attribute: !1 });
|
|
320
303
|
}
|
|
321
|
-
const
|
|
304
|
+
const xt = ot`
|
|
322
305
|
:host {
|
|
323
306
|
/* Anything that can be overridden should be defined here */
|
|
324
307
|
|
|
@@ -562,50 +545,50 @@ const wt = lt`
|
|
|
562
545
|
* Copyright 2017 Google LLC
|
|
563
546
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
564
547
|
*/
|
|
565
|
-
const
|
|
566
|
-
\f\r]`,
|
|
567
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
568
|
-
function
|
|
569
|
-
if (!
|
|
570
|
-
return
|
|
548
|
+
const z = globalThis, R = z.trustedTypes, J = R ? R.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, st = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, it = "?" + g, wt = `<${it}>`, w = document, H = () => w.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", D = Array.isArray, At = (r) => D(r) || typeof r?.[Symbol.iterator] == "function", B = `[
|
|
549
|
+
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, K = /-->/g, Z = />/g, $ = RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
550
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Q = /'/g, X = /"/g, nt = /^(?:script|style|textarea|title)$/i, C = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), tt = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
|
|
551
|
+
function rt(r, t) {
|
|
552
|
+
if (!D(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
553
|
+
return J !== void 0 ? J.createHTML(t) : t;
|
|
571
554
|
}
|
|
572
|
-
const
|
|
573
|
-
const e =
|
|
574
|
-
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "",
|
|
555
|
+
const Et = (r, t) => {
|
|
556
|
+
const e = r.length - 1, s = [];
|
|
557
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = S;
|
|
575
558
|
for (let l = 0; l < e; l++) {
|
|
576
|
-
const a =
|
|
577
|
-
let
|
|
578
|
-
for (; v < a.length && (
|
|
579
|
-
const b =
|
|
580
|
-
n +=
|
|
559
|
+
const a = r[l];
|
|
560
|
+
let y, _, h = -1, v = 0;
|
|
561
|
+
for (; v < a.length && (o.lastIndex = v, _ = o.exec(a), _ !== null); ) v = o.lastIndex, o === S ? _[1] === "!--" ? o = K : _[1] !== void 0 ? o = Z : _[2] !== void 0 ? (nt.test(_[2]) && (i = RegExp("</" + _[2], "g")), o = $) : _[3] !== void 0 && (o = $) : o === $ ? _[0] === ">" ? (o = i ?? S, h = -1) : _[1] === void 0 ? h = -2 : (h = o.lastIndex - _[2].length, y = _[1], o = _[3] === void 0 ? $ : _[3] === '"' ? X : Q) : o === X || o === Q ? o = $ : o === K || o === Z ? o = S : (o = $, i = void 0);
|
|
562
|
+
const b = o === $ && r[l + 1].startsWith("/>") ? " " : "";
|
|
563
|
+
n += o === S ? a + wt : h >= 0 ? (s.push(y), a.slice(0, h) + st + a.slice(h) + g + b) : a + g + (h === -2 ? l : b);
|
|
581
564
|
}
|
|
582
|
-
return [
|
|
565
|
+
return [rt(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
583
566
|
};
|
|
584
|
-
class
|
|
567
|
+
class k {
|
|
585
568
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
586
569
|
let i;
|
|
587
570
|
this.parts = [];
|
|
588
|
-
let n = 0,
|
|
589
|
-
const l = t.length - 1, a = this.parts, [
|
|
590
|
-
if (this.el =
|
|
571
|
+
let n = 0, o = 0;
|
|
572
|
+
const l = t.length - 1, a = this.parts, [y, _] = Et(t, e);
|
|
573
|
+
if (this.el = k.createElement(y, s), x.currentNode = this.el.content, e === 2 || e === 3) {
|
|
591
574
|
const h = this.el.content.firstChild;
|
|
592
575
|
h.replaceWith(...h.childNodes);
|
|
593
576
|
}
|
|
594
|
-
for (; (i =
|
|
577
|
+
for (; (i = x.nextNode()) !== null && a.length < l; ) {
|
|
595
578
|
if (i.nodeType === 1) {
|
|
596
|
-
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(
|
|
597
|
-
const v = _[
|
|
598
|
-
a.push({ type: 1, index: n, name:
|
|
579
|
+
if (i.hasAttributes()) for (const h of i.getAttributeNames()) if (h.endsWith(st)) {
|
|
580
|
+
const v = _[o++], b = i.getAttribute(h).split(g), U = /([.?@])?(.*)/.exec(v);
|
|
581
|
+
a.push({ type: 1, index: n, name: U[2], strings: b, ctor: U[1] === "." ? Pt : U[1] === "?" ? Mt : U[1] === "@" ? Ct : q }), i.removeAttribute(h);
|
|
599
582
|
} else h.startsWith(g) && (a.push({ type: 6, index: n }), i.removeAttribute(h));
|
|
600
|
-
if (
|
|
583
|
+
if (nt.test(i.tagName)) {
|
|
601
584
|
const h = i.textContent.split(g), v = h.length - 1;
|
|
602
585
|
if (v > 0) {
|
|
603
|
-
i.textContent =
|
|
604
|
-
for (let b = 0; b < v; b++) i.append(h[b],
|
|
605
|
-
i.append(h[v],
|
|
586
|
+
i.textContent = R ? R.emptyScript : "";
|
|
587
|
+
for (let b = 0; b < v; b++) i.append(h[b], H()), x.nextNode(), a.push({ type: 2, index: ++n });
|
|
588
|
+
i.append(h[v], H());
|
|
606
589
|
}
|
|
607
590
|
}
|
|
608
|
-
} else if (i.nodeType === 8) if (i.data ===
|
|
591
|
+
} else if (i.nodeType === 8) if (i.data === it) a.push({ type: 2, index: n });
|
|
609
592
|
else {
|
|
610
593
|
let h = -1;
|
|
611
594
|
for (; (h = i.data.indexOf(g, h + 1)) !== -1; ) a.push({ type: 7, index: n }), h += g.length - 1;
|
|
@@ -614,18 +597,17 @@ class T {
|
|
|
614
597
|
}
|
|
615
598
|
}
|
|
616
599
|
static createElement(t, e) {
|
|
617
|
-
const s =
|
|
600
|
+
const s = w.createElement("template");
|
|
618
601
|
return s.innerHTML = t, s;
|
|
619
602
|
}
|
|
620
603
|
}
|
|
621
|
-
function
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return (i == null ? void 0 : i.constructor) !== n && ((l = i == null ? void 0 : i._$AO) == null || l.call(i, !1), n === void 0 ? i = void 0 : (i = new n(o), i._$AT(o, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = E(o, i._$AS(o, t.values), i, s)), t;
|
|
604
|
+
function A(r, t, e = r, s) {
|
|
605
|
+
if (t === C) return t;
|
|
606
|
+
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
607
|
+
const n = M(t) ? void 0 : t._$litDirective$;
|
|
608
|
+
return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = A(r, i._$AS(r, t.values), i, s)), t;
|
|
627
609
|
}
|
|
628
|
-
class
|
|
610
|
+
class St {
|
|
629
611
|
constructor(t, e) {
|
|
630
612
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
631
613
|
}
|
|
@@ -636,35 +618,34 @@ class Pt {
|
|
|
636
618
|
return this._$AM._$AU;
|
|
637
619
|
}
|
|
638
620
|
u(t) {
|
|
639
|
-
const { el: { content: e }, parts: s } = this._$AD, i = (
|
|
640
|
-
|
|
641
|
-
let n =
|
|
621
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? w).importNode(e, !0);
|
|
622
|
+
x.currentNode = i;
|
|
623
|
+
let n = x.nextNode(), o = 0, l = 0, a = s[0];
|
|
642
624
|
for (; a !== void 0; ) {
|
|
643
|
-
if (
|
|
644
|
-
let
|
|
645
|
-
a.type === 2 ?
|
|
625
|
+
if (o === a.index) {
|
|
626
|
+
let y;
|
|
627
|
+
a.type === 2 ? y = new N(n, n.nextSibling, this, t) : a.type === 1 ? y = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (y = new kt(n, this, t)), this._$AV.push(y), a = s[++l];
|
|
646
628
|
}
|
|
647
|
-
|
|
629
|
+
o !== a?.index && (n = x.nextNode(), o++);
|
|
648
630
|
}
|
|
649
|
-
return
|
|
631
|
+
return x.currentNode = w, i;
|
|
650
632
|
}
|
|
651
633
|
p(t) {
|
|
652
634
|
let e = 0;
|
|
653
635
|
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++;
|
|
654
636
|
}
|
|
655
637
|
}
|
|
656
|
-
class
|
|
638
|
+
class N {
|
|
657
639
|
get _$AU() {
|
|
658
|
-
|
|
659
|
-
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
640
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
660
641
|
}
|
|
661
642
|
constructor(t, e, s, i) {
|
|
662
|
-
this.type = 2, this._$AH =
|
|
643
|
+
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
663
644
|
}
|
|
664
645
|
get parentNode() {
|
|
665
646
|
let t = this._$AA.parentNode;
|
|
666
647
|
const e = this._$AM;
|
|
667
|
-
return e !== void 0 &&
|
|
648
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
668
649
|
}
|
|
669
650
|
get startNode() {
|
|
670
651
|
return this._$AA;
|
|
@@ -673,7 +654,7 @@ class B {
|
|
|
673
654
|
return this._$AB;
|
|
674
655
|
}
|
|
675
656
|
_$AI(t, e = this) {
|
|
676
|
-
t =
|
|
657
|
+
t = A(this, t, e), M(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== C && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : At(t) ? this.k(t) : this._(t);
|
|
677
658
|
}
|
|
678
659
|
O(t) {
|
|
679
660
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -682,41 +663,38 @@ class B {
|
|
|
682
663
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
683
664
|
}
|
|
684
665
|
_(t) {
|
|
685
|
-
this._$AH !==
|
|
666
|
+
this._$AH !== p && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
686
667
|
}
|
|
687
668
|
$(t) {
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
|
|
669
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(rt(s.h, s.h[0]), this.options)), s);
|
|
670
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
691
671
|
else {
|
|
692
|
-
const
|
|
693
|
-
|
|
672
|
+
const n = new St(i, this), o = n.u(this.options);
|
|
673
|
+
n.p(e), this.T(o), this._$AH = n;
|
|
694
674
|
}
|
|
695
675
|
}
|
|
696
676
|
_$AC(t) {
|
|
697
|
-
let e =
|
|
698
|
-
return e === void 0 &&
|
|
677
|
+
let e = tt.get(t.strings);
|
|
678
|
+
return e === void 0 && tt.set(t.strings, e = new k(t)), e;
|
|
699
679
|
}
|
|
700
680
|
k(t) {
|
|
701
|
-
|
|
681
|
+
D(this._$AH) || (this._$AH = [], this._$AR());
|
|
702
682
|
const e = this._$AH;
|
|
703
683
|
let s, i = 0;
|
|
704
|
-
for (const n of t) i === e.length ? e.push(s = new
|
|
684
|
+
for (const n of t) i === e.length ? e.push(s = new N(this.O(H()), this.O(H()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
705
685
|
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
706
686
|
}
|
|
707
687
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
t.remove(), t = i;
|
|
688
|
+
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
689
|
+
const s = t.nextSibling;
|
|
690
|
+
t.remove(), t = s;
|
|
712
691
|
}
|
|
713
692
|
}
|
|
714
693
|
setConnected(t) {
|
|
715
|
-
|
|
716
|
-
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
694
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
717
695
|
}
|
|
718
696
|
}
|
|
719
|
-
class
|
|
697
|
+
class q {
|
|
720
698
|
get tagName() {
|
|
721
699
|
return this.element.tagName;
|
|
722
700
|
}
|
|
@@ -724,51 +702,50 @@ class L {
|
|
|
724
702
|
return this._$AM._$AU;
|
|
725
703
|
}
|
|
726
704
|
constructor(t, e, s, i, n) {
|
|
727
|
-
this.type = 1, this._$AH =
|
|
705
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = p;
|
|
728
706
|
}
|
|
729
707
|
_$AI(t, e = this, s, i) {
|
|
730
708
|
const n = this.strings;
|
|
731
|
-
let
|
|
732
|
-
if (n === void 0) t =
|
|
709
|
+
let o = !1;
|
|
710
|
+
if (n === void 0) t = A(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== C, o && (this._$AH = t);
|
|
733
711
|
else {
|
|
734
712
|
const l = t;
|
|
735
|
-
let a,
|
|
736
|
-
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
713
|
+
let a, y;
|
|
714
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) y = A(this, l[s + a], e, a), y === C && (y = this._$AH[a]), o ||= !M(y) || y !== this._$AH[a], y === p ? t = p : t !== p && (t += (y ?? "") + n[a + 1]), this._$AH[a] = y;
|
|
737
715
|
}
|
|
738
|
-
|
|
716
|
+
o && !i && this.j(t);
|
|
739
717
|
}
|
|
740
718
|
j(t) {
|
|
741
|
-
t ===
|
|
719
|
+
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
742
720
|
}
|
|
743
721
|
}
|
|
744
|
-
class
|
|
722
|
+
class Pt extends q {
|
|
745
723
|
constructor() {
|
|
746
724
|
super(...arguments), this.type = 3;
|
|
747
725
|
}
|
|
748
726
|
j(t) {
|
|
749
|
-
this.element[this.name] = t ===
|
|
727
|
+
this.element[this.name] = t === p ? void 0 : t;
|
|
750
728
|
}
|
|
751
729
|
}
|
|
752
|
-
class
|
|
730
|
+
class Mt extends q {
|
|
753
731
|
constructor() {
|
|
754
732
|
super(...arguments), this.type = 4;
|
|
755
733
|
}
|
|
756
734
|
j(t) {
|
|
757
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
735
|
+
this.element.toggleAttribute(this.name, !!t && t !== p);
|
|
758
736
|
}
|
|
759
737
|
}
|
|
760
|
-
class
|
|
738
|
+
class Ct extends q {
|
|
761
739
|
constructor(t, e, s, i, n) {
|
|
762
740
|
super(t, e, s, i, n), this.type = 5;
|
|
763
741
|
}
|
|
764
742
|
_$AI(t, e = this) {
|
|
765
|
-
if ((t =
|
|
766
|
-
const s = this._$AH, i = t ===
|
|
743
|
+
if ((t = A(this, t, e, 0) ?? p) === C) return;
|
|
744
|
+
const s = this._$AH, i = t === p && s !== p || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== p && (s === p || i);
|
|
767
745
|
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
768
746
|
}
|
|
769
747
|
handleEvent(t) {
|
|
770
|
-
|
|
771
|
-
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
748
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
772
749
|
}
|
|
773
750
|
}
|
|
774
751
|
class kt {
|
|
@@ -779,28 +756,28 @@ class kt {
|
|
|
779
756
|
return this._$AM._$AU;
|
|
780
757
|
}
|
|
781
758
|
_$AI(t) {
|
|
782
|
-
|
|
759
|
+
A(this, t);
|
|
783
760
|
}
|
|
784
761
|
}
|
|
785
|
-
const
|
|
786
|
-
|
|
762
|
+
const Ut = z.litHtmlPolyfillSupport;
|
|
763
|
+
Ut?.(k, N), (z.litHtmlVersions ??= []).push("3.3.1");
|
|
787
764
|
/**
|
|
788
765
|
* @license
|
|
789
766
|
* Copyright 2018 Google LLC
|
|
790
767
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
791
768
|
*/
|
|
792
|
-
const
|
|
793
|
-
var
|
|
794
|
-
for (var i = s > 1 ? void 0 : s ?
|
|
795
|
-
(
|
|
796
|
-
return s && i &&
|
|
769
|
+
const m = (r) => r ?? p;
|
|
770
|
+
var Ot = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, c = (r, t, e, s) => {
|
|
771
|
+
for (var i = s > 1 ? void 0 : s ? Tt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
|
772
|
+
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
773
|
+
return s && i && Ot(t, e, i), i;
|
|
797
774
|
};
|
|
798
775
|
let Rt = 0;
|
|
799
776
|
var f;
|
|
800
|
-
const d = (f = class extends
|
|
777
|
+
const d = (f = class extends at {
|
|
801
778
|
// allows use of elementInternals' API
|
|
802
779
|
constructor() {
|
|
803
|
-
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._tooltip = "", this.form = null, 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._maskPatterns = {
|
|
780
|
+
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._tooltip = "", this.form = null, this.pattern = "", this.maxlength = null, this.width = "full", this.step = null, this.min = null, this.max = null, this.inverted = !1, this.showError = !1, this.errorMessage = "", this.showPassword = !1, this._originalErrorMessage = "", this._hasUserInteracted = !1, this._maskPatterns = {
|
|
804
781
|
tel: "(___) ___-____"
|
|
805
782
|
}, this._internals = this.attachInternals();
|
|
806
783
|
}
|
|
@@ -824,18 +801,17 @@ const d = (f = class extends ht {
|
|
|
824
801
|
}
|
|
825
802
|
// Ensure the "width" property is valid after updates
|
|
826
803
|
async updated(t) {
|
|
827
|
-
var e, s;
|
|
828
804
|
if (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")), t.has("type")) {
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
832
|
-
|
|
805
|
+
const e = this._maskPatterns[this.type], s = this.shadowRoot?.querySelector("input");
|
|
806
|
+
if (s)
|
|
807
|
+
if (e)
|
|
808
|
+
s.maxLength = e.length, this._updateOverlay(s.value, e);
|
|
833
809
|
else {
|
|
834
|
-
|
|
835
|
-
const
|
|
810
|
+
s.removeAttribute("maxLength");
|
|
811
|
+
const i = this.shadowRoot?.querySelector(
|
|
836
812
|
".nys-textinput__mask-overlay"
|
|
837
813
|
);
|
|
838
|
-
|
|
814
|
+
i && (i.textContent = "");
|
|
839
815
|
}
|
|
840
816
|
}
|
|
841
817
|
}
|
|
@@ -848,23 +824,20 @@ const d = (f = class extends ht {
|
|
|
848
824
|
this._internals.setFormValue(this.value), this._manageRequire();
|
|
849
825
|
}
|
|
850
826
|
_manageRequire() {
|
|
851
|
-
|
|
852
|
-
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
827
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
853
828
|
if (!t) return;
|
|
854
829
|
const e = this.errorMessage || "This field is required";
|
|
855
|
-
this.required && (!this.value ||
|
|
830
|
+
this.required && (!this.value || this.value?.trim() === "") ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, e, t)) : (this._internals.ariaRequired = "false", this._internals.setValidity({}), this._hasUserInteracted = !1);
|
|
856
831
|
}
|
|
857
832
|
_setValidityMessage(t = "") {
|
|
858
|
-
|
|
859
|
-
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
833
|
+
const e = this.shadowRoot?.querySelector("input");
|
|
860
834
|
if (!e) return;
|
|
861
|
-
this.showError = !!t,
|
|
835
|
+
this.showError = !!t, this._originalErrorMessage?.trim() && t !== "" ? this.errorMessage = this._originalErrorMessage : this.errorMessage = t;
|
|
862
836
|
const s = t ? { customError: !0 } : {};
|
|
863
837
|
this._internals.setValidity(s, this.errorMessage, e);
|
|
864
838
|
}
|
|
865
839
|
_validate() {
|
|
866
|
-
|
|
867
|
-
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("input");
|
|
840
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
868
841
|
if (!t) return;
|
|
869
842
|
const e = t.validity;
|
|
870
843
|
let s = "";
|
|
@@ -873,18 +846,16 @@ const d = (f = class extends ht {
|
|
|
873
846
|
/********************** Functions **********************/
|
|
874
847
|
// This helper function is called to perform the element's native validation.
|
|
875
848
|
checkValidity() {
|
|
876
|
-
|
|
877
|
-
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("input");
|
|
849
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
878
850
|
return t ? t.checkValidity() : !0;
|
|
879
851
|
}
|
|
880
852
|
_handleInvalid(t) {
|
|
881
|
-
var s;
|
|
882
853
|
t.preventDefault(), this._hasUserInteracted = !0, this._validate();
|
|
883
|
-
const e =
|
|
854
|
+
const e = this.shadowRoot?.querySelector("input");
|
|
884
855
|
if (e) {
|
|
885
|
-
const
|
|
886
|
-
|
|
887
|
-
(
|
|
856
|
+
const s = this._internals.form;
|
|
857
|
+
s ? Array.from(s.elements).find(
|
|
858
|
+
(o) => typeof o.checkValidity == "function" && !o.checkValidity()
|
|
888
859
|
) === this && e.focus() : e.focus();
|
|
889
860
|
}
|
|
890
861
|
}
|
|
@@ -892,8 +863,7 @@ const d = (f = class extends ht {
|
|
|
892
863
|
this.showPassword = !this.showPassword;
|
|
893
864
|
}
|
|
894
865
|
_updateOverlay(t, e) {
|
|
895
|
-
|
|
896
|
-
const s = (r = this.shadowRoot) == null ? void 0 : r.querySelector(
|
|
866
|
+
const s = this.shadowRoot?.querySelector(
|
|
897
867
|
".nys-textinput__mask-overlay"
|
|
898
868
|
);
|
|
899
869
|
if (!s) return;
|
|
@@ -906,14 +876,14 @@ const d = (f = class extends ht {
|
|
|
906
876
|
if (this.type === "tel")
|
|
907
877
|
return s.length > 0 && (i = "(" + s.substring(0, 3)), s.length >= 4 && (i += ") " + s.substring(3, 6)), s.length > 6 && (i += "-" + s.substring(6, 10)), i;
|
|
908
878
|
let n = 0;
|
|
909
|
-
for (let
|
|
910
|
-
if (e[
|
|
879
|
+
for (let o = 0; o < e.length; o++)
|
|
880
|
+
if (e[o] === "_" || e[o].match(/[d9]/i))
|
|
911
881
|
if (n < s.length)
|
|
912
882
|
i += s[n++];
|
|
913
883
|
else
|
|
914
884
|
break;
|
|
915
885
|
else
|
|
916
|
-
i += e[
|
|
886
|
+
i += e[o];
|
|
917
887
|
return i;
|
|
918
888
|
}
|
|
919
889
|
/******************** Event Handlers ********************/
|
|
@@ -939,24 +909,23 @@ const d = (f = class extends ht {
|
|
|
939
909
|
this._hasUserInteracted || (this._hasUserInteracted = !0), this._validate(), this.dispatchEvent(new Event("nys-blur"));
|
|
940
910
|
}
|
|
941
911
|
_validateButtonSlot(t) {
|
|
942
|
-
|
|
943
|
-
const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector(
|
|
912
|
+
const e = this.shadowRoot?.querySelector(
|
|
944
913
|
'slot[name="' + t + '"]'
|
|
945
|
-
), s =
|
|
914
|
+
), s = this.shadowRoot?.querySelector(
|
|
946
915
|
".nys-textinput__buttoncontainer"
|
|
947
916
|
);
|
|
948
917
|
if (!e || !s) return;
|
|
949
918
|
const i = e.assignedElements();
|
|
950
919
|
let n = !1;
|
|
951
|
-
i.forEach((
|
|
952
|
-
|
|
920
|
+
i.forEach((o) => {
|
|
921
|
+
o instanceof HTMLElement && o.tagName.toLowerCase() === "nys-button" && !n ? (n = !0, o.setAttribute("size", "sm"), o.setAttribute("variant", "primary"), this.disabled ? o.setAttribute("disabled", "true") : o.removeAttribute("disabled")) : (console.warn(
|
|
953
922
|
"The '" + t + "' slot only accepts a single <nys-button> element. Removing invalid or extra node:",
|
|
954
|
-
|
|
955
|
-
),
|
|
923
|
+
o
|
|
924
|
+
), o.remove());
|
|
956
925
|
}), t === "startButton" ? s.classList.toggle("has-start-button", n) : t === "endButton" && s.classList.toggle("has-end-button", n);
|
|
957
926
|
}
|
|
958
927
|
render() {
|
|
959
|
-
return
|
|
928
|
+
return j`
|
|
960
929
|
<div class="nys-textinput">
|
|
961
930
|
<nys-label
|
|
962
931
|
for=${this.id}
|
|
@@ -964,6 +933,7 @@ const d = (f = class extends ht {
|
|
|
964
933
|
description=${this.description}
|
|
965
934
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
966
935
|
_tooltip=${this._tooltip}
|
|
936
|
+
?inverted=${this.inverted}
|
|
967
937
|
>
|
|
968
938
|
<slot name="description" slot="description">${this.description}</slot>
|
|
969
939
|
</nys-label>
|
|
@@ -986,29 +956,29 @@ const d = (f = class extends ht {
|
|
|
986
956
|
aria-disabled="${this.disabled}"
|
|
987
957
|
aria-label="${[this.label, this.description].filter(Boolean).join(" ")}"
|
|
988
958
|
.value=${this.value}
|
|
989
|
-
placeholder=${
|
|
959
|
+
placeholder=${m(
|
|
990
960
|
this.placeholder ? this.placeholder : void 0
|
|
991
961
|
)}
|
|
992
|
-
pattern=${
|
|
993
|
-
min=${
|
|
994
|
-
maxlength=${
|
|
962
|
+
pattern=${m(this.pattern ? this.pattern : void 0)}
|
|
963
|
+
min=${m(this.min !== null ? this.min : void 0)}
|
|
964
|
+
maxlength=${m(
|
|
995
965
|
this.maxlength !== null ? this.maxlength : void 0
|
|
996
966
|
)}
|
|
997
|
-
step=${
|
|
998
|
-
max=${
|
|
999
|
-
form=${
|
|
967
|
+
step=${m(this.step !== null ? this.step : void 0)}
|
|
968
|
+
max=${m(this.max !== null ? this.max : void 0)}
|
|
969
|
+
form=${m(this.form || void 0)}
|
|
1000
970
|
@input=${this._handleInput}
|
|
1001
971
|
@focus="${this._handleFocus}"
|
|
1002
972
|
@blur="${this._handleBlur}"
|
|
1003
973
|
/>
|
|
1004
|
-
${this.type === "password" ?
|
|
974
|
+
${this.type === "password" ? j` <nys-button
|
|
1005
975
|
class="eye-icon"
|
|
1006
976
|
id="password-toggle"
|
|
1007
977
|
suffixIcon="slotted"
|
|
1008
978
|
ariaLabel="password toggle"
|
|
1009
|
-
.onClick=${() => !this.disabled && this._togglePasswordVisibility()}
|
|
1010
979
|
variant="ghost"
|
|
1011
980
|
size="sm"
|
|
981
|
+
@nys-click=${() => !this.disabled && this._togglePasswordVisibility()}
|
|
1012
982
|
>
|
|
1013
983
|
<nys-icon
|
|
1014
984
|
slot="suffix-icon"
|
|
@@ -1037,7 +1007,7 @@ const d = (f = class extends ht {
|
|
|
1037
1007
|
"tel",
|
|
1038
1008
|
"text",
|
|
1039
1009
|
"url"
|
|
1040
|
-
], f.VALID_WIDTHS = ["sm", "md", "lg", "full"], f.styles =
|
|
1010
|
+
], f.VALID_WIDTHS = ["sm", "md", "lg", "full"], f.styles = xt, f.formAssociated = !0, f);
|
|
1041
1011
|
c([
|
|
1042
1012
|
u({ type: String })
|
|
1043
1013
|
], d.prototype, "id", 2);
|
|
@@ -1095,6 +1065,9 @@ c([
|
|
|
1095
1065
|
c([
|
|
1096
1066
|
u({ type: Number })
|
|
1097
1067
|
], d.prototype, "max", 2);
|
|
1068
|
+
c([
|
|
1069
|
+
u({ type: Boolean, reflect: !0 })
|
|
1070
|
+
], d.prototype, "inverted", 2);
|
|
1098
1071
|
c([
|
|
1099
1072
|
u({ type: Boolean, reflect: !0 })
|
|
1100
1073
|
], d.prototype, "showError", 2);
|
|
@@ -1102,7 +1075,7 @@ c([
|
|
|
1102
1075
|
u({ type: String })
|
|
1103
1076
|
], d.prototype, "errorMessage", 2);
|
|
1104
1077
|
c([
|
|
1105
|
-
|
|
1078
|
+
mt()
|
|
1106
1079
|
], d.prototype, "showPassword", 2);
|
|
1107
1080
|
let Ht = d;
|
|
1108
1081
|
customElements.get("nys-textinput") || customElements.define("nys-textinput", Ht);
|