@nysds/nys-checkbox 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-checkbox.d.ts +1 -0
- package/dist/nys-checkbox.js +215 -237
- package/dist/nys-checkbox.js.map +1 -1
- package/dist/nys-checkboxgroup.d.ts +2 -0
- package/package.json +5 -8
package/dist/nys-checkbox.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as de, LitElement as re, html as P } from "lit";
|
|
2
2
|
/*!
|
|
3
3
|
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
4
4
|
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
@@ -14,18 +14,18 @@ import { css as ue, LitElement as ce, html as z } from "lit";
|
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const I = globalThis,
|
|
18
|
-
let
|
|
17
|
+
const I = globalThis, B = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ie = Symbol(), G = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let be = class {
|
|
19
19
|
constructor(e, t, s) {
|
|
20
|
-
if (this._$cssResult$ = !0, s !==
|
|
20
|
+
if (this._$cssResult$ = !0, s !== ie) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
21
21
|
this.cssText = e, this.t = t;
|
|
22
22
|
}
|
|
23
23
|
get styleSheet() {
|
|
24
24
|
let e = this.o;
|
|
25
25
|
const t = this.t;
|
|
26
|
-
if (
|
|
26
|
+
if (B && e === void 0) {
|
|
27
27
|
const s = t !== void 0 && t.length === 1;
|
|
28
|
-
s && (e =
|
|
28
|
+
s && (e = G.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(t, e));
|
|
29
29
|
}
|
|
30
30
|
return e;
|
|
31
31
|
}
|
|
@@ -33,26 +33,26 @@ let pe = class {
|
|
|
33
33
|
return this.cssText;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
36
|
+
const ue = (r) => new be(typeof r == "string" ? r : r + "", void 0, ie), pe = (r, e) => {
|
|
37
|
+
if (B) r.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
|
|
38
38
|
else for (const t of e) {
|
|
39
39
|
const s = document.createElement("style"), o = I.litNonce;
|
|
40
40
|
o !== void 0 && s.setAttribute("nonce", o), s.textContent = t.cssText, r.appendChild(s);
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, K = B ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((e) => {
|
|
43
43
|
let t = "";
|
|
44
44
|
for (const s of e.cssRules) t += s.cssText;
|
|
45
|
-
return
|
|
45
|
+
return ue(t);
|
|
46
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: ye, defineProperty: _e, getOwnPropertyDescriptor: ke, getOwnPropertyNames: fe, getOwnPropertySymbols: ve, getPrototypeOf: xe } = Object, N = globalThis, J = N.trustedTypes, ge = J ? J.emptyScript : "", me = N.reactiveElementPolyfillSupport, q = (r, e) => r, R = { toAttribute(r, e) {
|
|
53
53
|
switch (e) {
|
|
54
54
|
case Boolean:
|
|
55
|
-
r = r ?
|
|
55
|
+
r = r ? ge : null;
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
@@ -77,46 +77,44 @@ const { is: ke, defineProperty: fe, getOwnPropertyDescriptor: ve, getOwnProperty
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
return t;
|
|
80
|
-
} },
|
|
81
|
-
Symbol.metadata
|
|
82
|
-
class
|
|
80
|
+
} }, F = (r, e) => !ye(r, e), Y = { attribute: !0, type: String, converter: R, reflect: !1, useDefault: !1, hasChanged: F };
|
|
81
|
+
Symbol.metadata ??= Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
82
|
+
class S extends HTMLElement {
|
|
83
83
|
static addInitializer(e) {
|
|
84
|
-
this._$Ei(), (this.l
|
|
84
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
85
85
|
}
|
|
86
86
|
static get observedAttributes() {
|
|
87
87
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
88
88
|
}
|
|
89
|
-
static createProperty(e, t =
|
|
90
|
-
if (t.state && (t.attribute = !1), this._$Ei(), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
89
|
+
static createProperty(e, t = Y) {
|
|
90
|
+
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
91
91
|
const s = Symbol(), o = this.getPropertyDescriptor(e, s, t);
|
|
92
|
-
o !== void 0 &&
|
|
92
|
+
o !== void 0 && _e(this.prototype, e, o);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
static getPropertyDescriptor(e, t, s) {
|
|
96
|
-
const { get: o, set:
|
|
96
|
+
const { get: o, set: i } = ke(this.prototype, e) ?? { get() {
|
|
97
97
|
return this[t];
|
|
98
|
-
}, set(
|
|
99
|
-
this[t] =
|
|
98
|
+
}, set(c) {
|
|
99
|
+
this[t] = c;
|
|
100
100
|
} };
|
|
101
|
-
return { get() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const h = o == null ? void 0 : o.call(this);
|
|
105
|
-
c.call(this, i), this.requestUpdate(e, h, s);
|
|
101
|
+
return { get: o, set(c) {
|
|
102
|
+
const h = o?.call(this);
|
|
103
|
+
i?.call(this, c), this.requestUpdate(e, h, s);
|
|
106
104
|
}, configurable: !0, enumerable: !0 };
|
|
107
105
|
}
|
|
108
106
|
static getPropertyOptions(e) {
|
|
109
|
-
return this.elementProperties.get(e) ??
|
|
107
|
+
return this.elementProperties.get(e) ?? Y;
|
|
110
108
|
}
|
|
111
109
|
static _$Ei() {
|
|
112
110
|
if (this.hasOwnProperty(q("elementProperties"))) return;
|
|
113
|
-
const e =
|
|
111
|
+
const e = xe(this);
|
|
114
112
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
115
113
|
}
|
|
116
114
|
static finalize() {
|
|
117
115
|
if (this.hasOwnProperty(q("finalized"))) return;
|
|
118
116
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(q("properties"))) {
|
|
119
|
-
const t = this.properties, s = [...
|
|
117
|
+
const t = this.properties, s = [...fe(t), ...ve(t)];
|
|
120
118
|
for (const o of s) this.createProperty(o, t[o]);
|
|
121
119
|
}
|
|
122
120
|
const e = this[Symbol.metadata];
|
|
@@ -135,8 +133,8 @@ class C extends HTMLElement {
|
|
|
135
133
|
const t = [];
|
|
136
134
|
if (Array.isArray(e)) {
|
|
137
135
|
const s = new Set(e.flat(1 / 0).reverse());
|
|
138
|
-
for (const o of s) t.unshift(
|
|
139
|
-
} else e !== void 0 && t.push(
|
|
136
|
+
for (const o of s) t.unshift(K(o));
|
|
137
|
+
} else e !== void 0 && t.push(K(e));
|
|
140
138
|
return t;
|
|
141
139
|
}
|
|
142
140
|
static _$Eu(e, t) {
|
|
@@ -147,16 +145,13 @@ class C 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((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((t) => t(this));
|
|
148
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
|
|
152
149
|
}
|
|
153
150
|
addController(e) {
|
|
154
|
-
|
|
155
|
-
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
|
|
151
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
156
152
|
}
|
|
157
153
|
removeController(e) {
|
|
158
|
-
|
|
159
|
-
(t = this._$EO) == null || t.delete(e);
|
|
154
|
+
this._$EO?.delete(e);
|
|
160
155
|
}
|
|
161
156
|
_$E_() {
|
|
162
157
|
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
@@ -165,54 +160,47 @@ class C extends HTMLElement {
|
|
|
165
160
|
}
|
|
166
161
|
createRenderRoot() {
|
|
167
162
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return
|
|
163
|
+
return pe(e, this.constructor.elementStyles), e;
|
|
169
164
|
}
|
|
170
165
|
connectedCallback() {
|
|
171
|
-
|
|
172
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
|
|
173
|
-
var s;
|
|
174
|
-
return (s = t.hostConnected) == null ? void 0 : s.call(t);
|
|
175
|
-
});
|
|
166
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
|
|
176
167
|
}
|
|
177
168
|
enableUpdating(e) {
|
|
178
169
|
}
|
|
179
170
|
disconnectedCallback() {
|
|
180
|
-
|
|
181
|
-
(e = this._$EO) == null || e.forEach((t) => {
|
|
182
|
-
var s;
|
|
183
|
-
return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
|
|
184
|
-
});
|
|
171
|
+
this._$EO?.forEach(((e) => e.hostDisconnected?.()));
|
|
185
172
|
}
|
|
186
173
|
attributeChangedCallback(e, t, s) {
|
|
187
174
|
this._$AK(e, s);
|
|
188
175
|
}
|
|
189
|
-
_$
|
|
190
|
-
var c;
|
|
176
|
+
_$ET(e, t) {
|
|
191
177
|
const s = this.constructor.elementProperties.get(e), o = this.constructor._$Eu(e, s);
|
|
192
178
|
if (o !== void 0 && s.reflect === !0) {
|
|
193
|
-
const i = (
|
|
179
|
+
const i = (s.converter?.toAttribute !== void 0 ? s.converter : R).toAttribute(t, s.type);
|
|
194
180
|
this._$Em = e, i == null ? this.removeAttribute(o) : this.setAttribute(o, i), this._$Em = null;
|
|
195
181
|
}
|
|
196
182
|
}
|
|
197
183
|
_$AK(e, t) {
|
|
198
|
-
var c;
|
|
199
184
|
const s = this.constructor, o = s._$Eh.get(e);
|
|
200
185
|
if (o !== void 0 && this._$Em !== o) {
|
|
201
|
-
const i = s.getPropertyOptions(o),
|
|
202
|
-
this._$Em = o
|
|
186
|
+
const i = s.getPropertyOptions(o), c = typeof i.converter == "function" ? { fromAttribute: i.converter } : i.converter?.fromAttribute !== void 0 ? i.converter : R;
|
|
187
|
+
this._$Em = o;
|
|
188
|
+
const h = c.fromAttribute(t, i.type);
|
|
189
|
+
this[o] = h ?? this._$Ej?.get(o) ?? h, this._$Em = null;
|
|
203
190
|
}
|
|
204
191
|
}
|
|
205
192
|
requestUpdate(e, t, s) {
|
|
206
193
|
if (e !== void 0) {
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
const o = this.constructor, i = this[e];
|
|
195
|
+
if (s ??= o.getPropertyOptions(e), !((s.hasChanged ?? F)(i, t) || s.useDefault && s.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, s)))) return;
|
|
196
|
+
this.C(e, t, 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(e) || this._$AL.set(e, t),
|
|
200
|
+
C(e, t, { useDefault: s, reflect: o, wrapped: i }, c) {
|
|
201
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, c ?? t ?? this[e]), i !== !0 || c !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), o === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
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 C 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 [o, i] of this._$Ep) this[o] = i;
|
|
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 [o, i] of s) {
|
|
225
|
+
const { wrapped: c } = i, h = this[o];
|
|
226
|
+
c !== !0 || this._$AL.has(o) || h === void 0 || this.C(o, void 0, i, h);
|
|
227
|
+
}
|
|
238
228
|
}
|
|
239
229
|
let e = !1;
|
|
240
230
|
const t = this._$AL;
|
|
241
231
|
try {
|
|
242
|
-
e = this.shouldUpdate(t), e ? (this.willUpdate(t),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}), this.update(t)) : this._$EU();
|
|
246
|
-
} catch (o) {
|
|
247
|
-
throw e = !1, this._$EU(), o;
|
|
232
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((s) => s.hostUpdate?.())), this.update(t)) : this._$EM();
|
|
233
|
+
} catch (s) {
|
|
234
|
+
throw e = !1, this._$EM(), s;
|
|
248
235
|
}
|
|
249
236
|
e && this._$AE(t);
|
|
250
237
|
}
|
|
251
238
|
willUpdate(e) {
|
|
252
239
|
}
|
|
253
240
|
_$AE(e) {
|
|
254
|
-
|
|
255
|
-
(t = this._$EO) == null || t.forEach((s) => {
|
|
256
|
-
var o;
|
|
257
|
-
return (o = s.hostUpdated) == null ? void 0 : o.call(s);
|
|
258
|
-
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
241
|
+
this._$EO?.forEach(((t) => t.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
259
242
|
}
|
|
260
|
-
_$
|
|
243
|
+
_$EM() {
|
|
261
244
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
262
245
|
}
|
|
263
246
|
get updateComplete() {
|
|
@@ -270,44 +253,44 @@ class C extends HTMLElement {
|
|
|
270
253
|
return !0;
|
|
271
254
|
}
|
|
272
255
|
update(e) {
|
|
273
|
-
this._$
|
|
256
|
+
this._$Eq &&= this._$Eq.forEach(((t) => this._$ET(t, this[t]))), this._$EM();
|
|
274
257
|
}
|
|
275
258
|
updated(e) {
|
|
276
259
|
}
|
|
277
260
|
firstUpdated(e) {
|
|
278
261
|
}
|
|
279
262
|
}
|
|
280
|
-
|
|
263
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[q("elementProperties")] = /* @__PURE__ */ new Map(), S[q("finalized")] = /* @__PURE__ */ new Map(), me?.({ ReactiveElement: S }), (N.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 $e = { attribute: !0, type: String, converter: R, reflect: !1, hasChanged: F }, Ae = (r = $e, e, t) => {
|
|
287
270
|
const { kind: s, metadata: o } = t;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
290
|
-
const { name:
|
|
271
|
+
let i = globalThis.litPropertyMetadata.get(o);
|
|
272
|
+
if (i === void 0 && globalThis.litPropertyMetadata.set(o, i = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), i.set(t.name, r), s === "accessor") {
|
|
273
|
+
const { name: c } = t;
|
|
291
274
|
return { set(h) {
|
|
292
275
|
const n = e.get.call(this);
|
|
293
|
-
e.set.call(this, h), this.requestUpdate(
|
|
276
|
+
e.set.call(this, h), this.requestUpdate(c, n, r);
|
|
294
277
|
}, init(h) {
|
|
295
|
-
return h !== void 0 && this.
|
|
278
|
+
return h !== void 0 && this.C(c, void 0, r, h), h;
|
|
296
279
|
} };
|
|
297
280
|
}
|
|
298
281
|
if (s === "setter") {
|
|
299
|
-
const { name:
|
|
282
|
+
const { name: c } = t;
|
|
300
283
|
return function(h) {
|
|
301
|
-
const n = this[
|
|
302
|
-
e.call(this, h), this.requestUpdate(
|
|
284
|
+
const n = this[c];
|
|
285
|
+
e.call(this, h), this.requestUpdate(c, n, r);
|
|
303
286
|
};
|
|
304
287
|
}
|
|
305
288
|
throw Error("Unsupported decorator location: " + s);
|
|
306
289
|
};
|
|
307
290
|
function a(r) {
|
|
308
|
-
return (e, t) => typeof t == "object" ?
|
|
309
|
-
const
|
|
310
|
-
return o.constructor.createProperty(
|
|
291
|
+
return (e, t) => typeof t == "object" ? Ae(r, e, t) : ((s, o, i) => {
|
|
292
|
+
const c = o.hasOwnProperty(i);
|
|
293
|
+
return o.constructor.createProperty(i, s), c ? Object.getOwnPropertyDescriptor(o, i) : void 0;
|
|
311
294
|
})(r, e, t);
|
|
312
295
|
}
|
|
313
296
|
/**
|
|
@@ -315,7 +298,7 @@ function a(r) {
|
|
|
315
298
|
* Copyright 2017 Google LLC
|
|
316
299
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
317
300
|
*/
|
|
318
|
-
function
|
|
301
|
+
function Ee(r) {
|
|
319
302
|
return a({ ...r, state: !0, attribute: !1 });
|
|
320
303
|
}
|
|
321
304
|
/**
|
|
@@ -323,70 +306,69 @@ function we(r) {
|
|
|
323
306
|
* Copyright 2017 Google LLC
|
|
324
307
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
325
308
|
*/
|
|
326
|
-
const
|
|
327
|
-
\f\r]`,
|
|
328
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
329
|
-
function
|
|
330
|
-
if (!
|
|
331
|
-
return
|
|
309
|
+
const W = globalThis, H = W.trustedTypes, Q = H ? H.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ce = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, ne = "?" + m, we = `<${ne}>`, E = document, D = () => E.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", Z = Array.isArray, Se = (r) => Z(r) || typeof r?.[Symbol.iterator] == "function", j = `[
|
|
310
|
+
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, ee = />/g, $ = RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
|
|
311
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), te = /'/g, se = /"/g, he = /^(?:script|style|textarea|title)$/i, z = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), A = E.createTreeWalker(E, 129);
|
|
312
|
+
function ae(r, e) {
|
|
313
|
+
if (!Z(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
314
|
+
return Q !== void 0 ? Q.createHTML(e) : e;
|
|
332
315
|
}
|
|
333
|
-
const
|
|
316
|
+
const Ce = (r, e) => {
|
|
334
317
|
const t = r.length - 1, s = [];
|
|
335
|
-
let o,
|
|
318
|
+
let o, i = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", c = C;
|
|
336
319
|
for (let h = 0; h < t; h++) {
|
|
337
320
|
const n = r[h];
|
|
338
321
|
let d, u, l = -1, f = 0;
|
|
339
|
-
for (; f < n.length && (
|
|
340
|
-
const g =
|
|
341
|
-
|
|
322
|
+
for (; f < n.length && (c.lastIndex = f, u = c.exec(n), u !== null); ) f = c.lastIndex, c === C ? u[1] === "!--" ? c = X : u[1] !== void 0 ? c = ee : u[2] !== void 0 ? (he.test(u[2]) && (o = RegExp("</" + u[2], "g")), c = $) : u[3] !== void 0 && (c = $) : c === $ ? u[0] === ">" ? (c = o ?? C, l = -1) : u[1] === void 0 ? l = -2 : (l = c.lastIndex - u[2].length, d = u[1], c = u[3] === void 0 ? $ : u[3] === '"' ? se : te) : c === se || c === te ? c = $ : c === X || c === ee ? c = C : (c = $, o = void 0);
|
|
323
|
+
const g = c === $ && r[h + 1].startsWith("/>") ? " " : "";
|
|
324
|
+
i += c === C ? n + we : l >= 0 ? (s.push(d), n.slice(0, l) + ce + n.slice(l) + m + g) : n + m + (l === -2 ? h : g);
|
|
342
325
|
}
|
|
343
|
-
return [
|
|
326
|
+
return [ae(r, i + (r[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
344
327
|
};
|
|
345
328
|
class O {
|
|
346
329
|
constructor({ strings: e, _$litType$: t }, s) {
|
|
347
330
|
let o;
|
|
348
331
|
this.parts = [];
|
|
349
|
-
let
|
|
350
|
-
const h = e.length - 1, n = this.parts, [d, u] =
|
|
351
|
-
if (this.el = O.createElement(d, s),
|
|
332
|
+
let i = 0, c = 0;
|
|
333
|
+
const h = e.length - 1, n = this.parts, [d, u] = Ce(e, t);
|
|
334
|
+
if (this.el = O.createElement(d, s), A.currentNode = this.el.content, t === 2 || t === 3) {
|
|
352
335
|
const l = this.el.content.firstChild;
|
|
353
336
|
l.replaceWith(...l.childNodes);
|
|
354
337
|
}
|
|
355
|
-
for (; (o =
|
|
338
|
+
for (; (o = A.nextNode()) !== null && n.length < h; ) {
|
|
356
339
|
if (o.nodeType === 1) {
|
|
357
|
-
if (o.hasAttributes()) for (const l of o.getAttributeNames()) if (l.endsWith(
|
|
358
|
-
const f = u[
|
|
359
|
-
n.push({ type: 1, index:
|
|
360
|
-
} else l.startsWith(m) && (n.push({ type: 6, index:
|
|
361
|
-
if (
|
|
340
|
+
if (o.hasAttributes()) for (const l of o.getAttributeNames()) if (l.endsWith(ce)) {
|
|
341
|
+
const f = u[c++], g = o.getAttribute(l).split(m), T = /([.?@])?(.*)/.exec(f);
|
|
342
|
+
n.push({ type: 1, index: i, name: T[2], strings: g, ctor: T[1] === "." ? qe : T[1] === "?" ? Me : T[1] === "@" ? ze : L }), o.removeAttribute(l);
|
|
343
|
+
} else l.startsWith(m) && (n.push({ type: 6, index: i }), o.removeAttribute(l));
|
|
344
|
+
if (he.test(o.tagName)) {
|
|
362
345
|
const l = o.textContent.split(m), f = l.length - 1;
|
|
363
346
|
if (f > 0) {
|
|
364
|
-
o.textContent =
|
|
365
|
-
for (let g = 0; g < f; g++) o.append(l[g],
|
|
366
|
-
o.append(l[f],
|
|
347
|
+
o.textContent = H ? H.emptyScript : "";
|
|
348
|
+
for (let g = 0; g < f; g++) o.append(l[g], D()), A.nextNode(), n.push({ type: 2, index: ++i });
|
|
349
|
+
o.append(l[f], D());
|
|
367
350
|
}
|
|
368
351
|
}
|
|
369
|
-
} else if (o.nodeType === 8) if (o.data ===
|
|
352
|
+
} else if (o.nodeType === 8) if (o.data === ne) n.push({ type: 2, index: i });
|
|
370
353
|
else {
|
|
371
354
|
let l = -1;
|
|
372
|
-
for (; (l = o.data.indexOf(m, l + 1)) !== -1; ) n.push({ type: 7, index:
|
|
355
|
+
for (; (l = o.data.indexOf(m, l + 1)) !== -1; ) n.push({ type: 7, index: i }), l += m.length - 1;
|
|
373
356
|
}
|
|
374
|
-
|
|
357
|
+
i++;
|
|
375
358
|
}
|
|
376
359
|
}
|
|
377
360
|
static createElement(e, t) {
|
|
378
|
-
const s =
|
|
361
|
+
const s = E.createElement("template");
|
|
379
362
|
return s.innerHTML = e, s;
|
|
380
363
|
}
|
|
381
364
|
}
|
|
382
|
-
function
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return (o == null ? void 0 : o.constructor) !== c && ((h = o == null ? void 0 : o._$AO) == null || h.call(o, !1), c === void 0 ? o = void 0 : (o = new c(r), o._$AT(r, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = o : t._$Cl = o), o !== void 0 && (e = S(r, o._$AS(r, e.values), o, s)), e;
|
|
365
|
+
function w(r, e, t = r, s) {
|
|
366
|
+
if (e === z) return e;
|
|
367
|
+
let o = s !== void 0 ? t._$Co?.[s] : t._$Cl;
|
|
368
|
+
const i = M(e) ? void 0 : e._$litDirective$;
|
|
369
|
+
return o?.constructor !== i && (o?._$AO?.(!1), i === void 0 ? o = void 0 : (o = new i(r), o._$AT(r, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = o : t._$Cl = o), o !== void 0 && (e = w(r, o._$AS(r, e.values), o, s)), e;
|
|
388
370
|
}
|
|
389
|
-
class
|
|
371
|
+
class Pe {
|
|
390
372
|
constructor(e, t) {
|
|
391
373
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
392
374
|
}
|
|
@@ -397,35 +379,34 @@ class ze {
|
|
|
397
379
|
return this._$AM._$AU;
|
|
398
380
|
}
|
|
399
381
|
u(e) {
|
|
400
|
-
const { el: { content: t }, parts: s } = this._$AD, o = (
|
|
401
|
-
|
|
402
|
-
let
|
|
382
|
+
const { el: { content: t }, parts: s } = this._$AD, o = (e?.creationScope ?? E).importNode(t, !0);
|
|
383
|
+
A.currentNode = o;
|
|
384
|
+
let i = A.nextNode(), c = 0, h = 0, n = s[0];
|
|
403
385
|
for (; n !== void 0; ) {
|
|
404
|
-
if (
|
|
386
|
+
if (c === n.index) {
|
|
405
387
|
let d;
|
|
406
|
-
n.type === 2 ? d = new
|
|
388
|
+
n.type === 2 ? d = new V(i, i.nextSibling, this, e) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, e) : n.type === 6 && (d = new Oe(i, this, e)), this._$AV.push(d), n = s[++h];
|
|
407
389
|
}
|
|
408
|
-
|
|
390
|
+
c !== n?.index && (i = A.nextNode(), c++);
|
|
409
391
|
}
|
|
410
|
-
return
|
|
392
|
+
return A.currentNode = E, o;
|
|
411
393
|
}
|
|
412
394
|
p(e) {
|
|
413
395
|
let t = 0;
|
|
414
396
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
|
|
415
397
|
}
|
|
416
398
|
}
|
|
417
|
-
class
|
|
399
|
+
class V {
|
|
418
400
|
get _$AU() {
|
|
419
|
-
|
|
420
|
-
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
401
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
421
402
|
}
|
|
422
403
|
constructor(e, t, s, o) {
|
|
423
|
-
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = o, this._$Cv =
|
|
404
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = o, this._$Cv = o?.isConnected ?? !0;
|
|
424
405
|
}
|
|
425
406
|
get parentNode() {
|
|
426
407
|
let e = this._$AA.parentNode;
|
|
427
408
|
const t = this._$AM;
|
|
428
|
-
return t !== void 0 &&
|
|
409
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
429
410
|
}
|
|
430
411
|
get startNode() {
|
|
431
412
|
return this._$AA;
|
|
@@ -434,7 +415,7 @@ class L {
|
|
|
434
415
|
return this._$AB;
|
|
435
416
|
}
|
|
436
417
|
_$AI(e, t = this) {
|
|
437
|
-
e =
|
|
418
|
+
e = w(this, e, t), M(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== z && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
|
|
438
419
|
}
|
|
439
420
|
O(e) {
|
|
440
421
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -443,66 +424,63 @@ class L {
|
|
|
443
424
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
444
425
|
}
|
|
445
426
|
_(e) {
|
|
446
|
-
this._$AH !== b &&
|
|
427
|
+
this._$AH !== b && M(this._$AH) ? this._$AA.nextSibling.data = e : this.T(E.createTextNode(e)), this._$AH = e;
|
|
447
428
|
}
|
|
448
429
|
$(e) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (((c = this._$AH) == null ? void 0 : c._$AD) === o) this._$AH.p(t);
|
|
430
|
+
const { values: t, _$litType$: s } = e, o = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = O.createElement(ae(s.h, s.h[0]), this.options)), s);
|
|
431
|
+
if (this._$AH?._$AD === o) this._$AH.p(t);
|
|
452
432
|
else {
|
|
453
|
-
const i = new
|
|
454
|
-
i.p(t), this.T(
|
|
433
|
+
const i = new Pe(o, this), c = i.u(this.options);
|
|
434
|
+
i.p(t), this.T(c), this._$AH = i;
|
|
455
435
|
}
|
|
456
436
|
}
|
|
457
437
|
_$AC(e) {
|
|
458
|
-
let t =
|
|
459
|
-
return t === void 0 &&
|
|
438
|
+
let t = oe.get(e.strings);
|
|
439
|
+
return t === void 0 && oe.set(e.strings, t = new O(e)), t;
|
|
460
440
|
}
|
|
461
441
|
k(e) {
|
|
462
|
-
|
|
442
|
+
Z(this._$AH) || (this._$AH = [], this._$AR());
|
|
463
443
|
const t = this._$AH;
|
|
464
444
|
let s, o = 0;
|
|
465
|
-
for (const
|
|
445
|
+
for (const i of e) o === t.length ? t.push(s = new V(this.O(D()), this.O(D()), this, this.options)) : s = t[o], s._$AI(i), o++;
|
|
466
446
|
o < t.length && (this._$AR(s && s._$AB.nextSibling, o), t.length = o);
|
|
467
447
|
}
|
|
468
448
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
e.remove(), e = o;
|
|
449
|
+
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
450
|
+
const s = e.nextSibling;
|
|
451
|
+
e.remove(), e = s;
|
|
473
452
|
}
|
|
474
453
|
}
|
|
475
454
|
setConnected(e) {
|
|
476
|
-
|
|
477
|
-
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
455
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
478
456
|
}
|
|
479
457
|
}
|
|
480
|
-
class
|
|
458
|
+
class L {
|
|
481
459
|
get tagName() {
|
|
482
460
|
return this.element.tagName;
|
|
483
461
|
}
|
|
484
462
|
get _$AU() {
|
|
485
463
|
return this._$AM._$AU;
|
|
486
464
|
}
|
|
487
|
-
constructor(e, t, s, o,
|
|
488
|
-
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = o, this.options =
|
|
465
|
+
constructor(e, t, s, o, i) {
|
|
466
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = o, this.options = i, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = b;
|
|
489
467
|
}
|
|
490
468
|
_$AI(e, t = this, s, o) {
|
|
491
|
-
const
|
|
492
|
-
let
|
|
493
|
-
if (
|
|
469
|
+
const i = this.strings;
|
|
470
|
+
let c = !1;
|
|
471
|
+
if (i === void 0) e = w(this, e, t, 0), c = !M(e) || e !== this._$AH && e !== z, c && (this._$AH = e);
|
|
494
472
|
else {
|
|
495
473
|
const h = e;
|
|
496
474
|
let n, d;
|
|
497
|
-
for (e =
|
|
475
|
+
for (e = i[0], n = 0; n < i.length - 1; n++) d = w(this, h[s + n], t, n), d === z && (d = this._$AH[n]), c ||= !M(d) || d !== this._$AH[n], d === b ? e = b : e !== b && (e += (d ?? "") + i[n + 1]), this._$AH[n] = d;
|
|
498
476
|
}
|
|
499
|
-
|
|
477
|
+
c && !o && this.j(e);
|
|
500
478
|
}
|
|
501
479
|
j(e) {
|
|
502
480
|
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
503
481
|
}
|
|
504
482
|
}
|
|
505
|
-
class qe extends
|
|
483
|
+
class qe extends L {
|
|
506
484
|
constructor() {
|
|
507
485
|
super(...arguments), this.type = 3;
|
|
508
486
|
}
|
|
@@ -510,7 +488,7 @@ class qe extends B {
|
|
|
510
488
|
this.element[this.name] = e === b ? void 0 : e;
|
|
511
489
|
}
|
|
512
490
|
}
|
|
513
|
-
class Me extends
|
|
491
|
+
class Me extends L {
|
|
514
492
|
constructor() {
|
|
515
493
|
super(...arguments), this.type = 4;
|
|
516
494
|
}
|
|
@@ -518,21 +496,20 @@ class Me extends B {
|
|
|
518
496
|
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
519
497
|
}
|
|
520
498
|
}
|
|
521
|
-
class
|
|
522
|
-
constructor(e, t, s, o,
|
|
523
|
-
super(e, t, s, o,
|
|
499
|
+
class ze extends L {
|
|
500
|
+
constructor(e, t, s, o, i) {
|
|
501
|
+
super(e, t, s, o, i), this.type = 5;
|
|
524
502
|
}
|
|
525
503
|
_$AI(e, t = this) {
|
|
526
|
-
if ((e =
|
|
527
|
-
const s = this._$AH, o = e === b && s !== b || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive,
|
|
528
|
-
o && this.element.removeEventListener(this.name, this, s),
|
|
504
|
+
if ((e = w(this, e, t, 0) ?? b) === z) return;
|
|
505
|
+
const s = this._$AH, o = e === b && s !== b || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, i = e !== b && (s === b || o);
|
|
506
|
+
o && this.element.removeEventListener(this.name, this, s), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
529
507
|
}
|
|
530
508
|
handleEvent(e) {
|
|
531
|
-
|
|
532
|
-
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
509
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
533
510
|
}
|
|
534
511
|
}
|
|
535
|
-
class
|
|
512
|
+
class Oe {
|
|
536
513
|
constructor(e, t, s) {
|
|
537
514
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
|
|
538
515
|
}
|
|
@@ -540,17 +517,17 @@ class Te {
|
|
|
540
517
|
return this._$AM._$AU;
|
|
541
518
|
}
|
|
542
519
|
_$AI(e) {
|
|
543
|
-
|
|
520
|
+
w(this, e);
|
|
544
521
|
}
|
|
545
522
|
}
|
|
546
|
-
const
|
|
547
|
-
|
|
523
|
+
const Te = W.litHtmlPolyfillSupport;
|
|
524
|
+
Te?.(O, V), (W.litHtmlVersions ??= []).push("3.3.1");
|
|
548
525
|
/**
|
|
549
526
|
* @license
|
|
550
527
|
* Copyright 2018 Google LLC
|
|
551
528
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
552
529
|
*/
|
|
553
|
-
const
|
|
530
|
+
const U = (r) => r ?? b, le = de`
|
|
554
531
|
:host {
|
|
555
532
|
/* Anything that can be overridden should be defined here */
|
|
556
533
|
|
|
@@ -933,17 +910,17 @@ const H = (r) => r ?? b, be = ue`
|
|
|
933
910
|
border: 0;
|
|
934
911
|
}
|
|
935
912
|
`;
|
|
936
|
-
var
|
|
937
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
938
|
-
(
|
|
939
|
-
return s && o &&
|
|
913
|
+
var Ue = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, k = (r, e, t, s) => {
|
|
914
|
+
for (var o = s > 1 ? void 0 : s ? Ie(e, t) : e, i = r.length - 1, c; i >= 0; i--)
|
|
915
|
+
(c = r[i]) && (o = (s ? c(e, t, o) : c(o)) || o);
|
|
916
|
+
return s && o && Ue(e, t, o), o;
|
|
940
917
|
};
|
|
941
|
-
let
|
|
918
|
+
let Re = 0;
|
|
942
919
|
var v;
|
|
943
|
-
const y = (v = class extends
|
|
920
|
+
const y = (v = class extends re {
|
|
944
921
|
// allows use of elementInternals' API
|
|
945
922
|
constructor() {
|
|
946
|
-
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this._tooltip = "", this.form = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
|
|
923
|
+
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this._tooltip = "", this.inverted = !1, this.form = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
|
|
947
924
|
}
|
|
948
925
|
get size() {
|
|
949
926
|
return this._size;
|
|
@@ -955,7 +932,7 @@ const y = (v = class extends ce {
|
|
|
955
932
|
}
|
|
956
933
|
// Generate a unique ID if one is not provided
|
|
957
934
|
connectedCallback() {
|
|
958
|
-
super.connectedCallback(), this.id || (this.id = `nys-checkbox-${Date.now()}-${
|
|
935
|
+
super.connectedCallback(), this.id || (this.id = `nys-checkbox-${Date.now()}-${Re++}`), this.addEventListener("nys-change", this._handleCheckboxChange), this.addEventListener("invalid", this._handleInvalid);
|
|
959
936
|
}
|
|
960
937
|
disconnectedCallback() {
|
|
961
938
|
super.disconnectedCallback(), this.removeEventListener("nys-change", this._handleCheckboxChange), this.removeEventListener("invalid", this._handleInvalid);
|
|
@@ -964,7 +941,7 @@ const y = (v = class extends ce {
|
|
|
964
941
|
this._setGroupExist(), this._updateCheckboxSize(), this._updateCheckboxTile(), this._updateCheckboxShowError(), this._getSlotDescriptionForAria();
|
|
965
942
|
}
|
|
966
943
|
updated(e) {
|
|
967
|
-
e.has("required") && this.required && this._setupCheckboxRequired(), e.has("size") && this._updateCheckboxSize(), e.has("tile") && this._updateCheckboxTile(), e.has("showError") && this._updateCheckboxShowError(), e.has("form") && this._updateCheckboxForm();
|
|
944
|
+
e.has("required") && this.required && this._setupCheckboxRequired(), e.has("size") && this._updateCheckboxSize(), e.has("tile") && this._updateCheckboxTile(), e.has("inverted") && this._updateCheckboxInvert(), e.has("showError") && this._updateCheckboxShowError(), e.has("form") && this._updateCheckboxForm();
|
|
968
945
|
}
|
|
969
946
|
/********************** Functions **********************/
|
|
970
947
|
_setGroupExist() {
|
|
@@ -986,7 +963,7 @@ const y = (v = class extends ce {
|
|
|
986
963
|
if (this.required) {
|
|
987
964
|
const e = this.errorMessage || "Please select at least one option.", t = this.querySelector("nys-checkbox"), s = t ? await t.getInputElement().catch(() => null) : null, o = this.querySelectorAll("nys-checkbox");
|
|
988
965
|
Array.from(o).some(
|
|
989
|
-
(
|
|
966
|
+
(c) => c.checked
|
|
990
967
|
) ? (this._internals.setValidity({}), this.showError = !1) : (this._internals.setValidity(
|
|
991
968
|
{ valueMissing: !0 },
|
|
992
969
|
e,
|
|
@@ -1005,6 +982,11 @@ const y = (v = class extends ce {
|
|
|
1005
982
|
this.tile ? t.toggleAttribute("tile", !0) : t.removeAttribute("tile");
|
|
1006
983
|
});
|
|
1007
984
|
}
|
|
985
|
+
_updateCheckboxInvert() {
|
|
986
|
+
this.querySelectorAll("nys-checkbox").forEach((t) => {
|
|
987
|
+
this.inverted ? t.toggleAttribute("inverted", !0) : t.removeAttribute("inverted");
|
|
988
|
+
});
|
|
989
|
+
}
|
|
1008
990
|
_updateCheckboxShowError() {
|
|
1009
991
|
this.querySelectorAll("nys-checkbox").forEach((t) => {
|
|
1010
992
|
this.showError ? t.setAttribute("showError", "") : t.removeAttribute("showError");
|
|
@@ -1017,14 +999,10 @@ const y = (v = class extends ce {
|
|
|
1017
999
|
}
|
|
1018
1000
|
// Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset
|
|
1019
1001
|
_getSlotDescriptionForAria() {
|
|
1020
|
-
|
|
1021
|
-
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
|
|
1002
|
+
const t = this.shadowRoot?.querySelector(
|
|
1022
1003
|
'slot[name="description"]'
|
|
1023
|
-
)
|
|
1024
|
-
this._slottedDescriptionText = t.map((
|
|
1025
|
-
var c;
|
|
1026
|
-
return (c = o.textContent) == null ? void 0 : c.trim();
|
|
1027
|
-
}).filter(Boolean).join(", ");
|
|
1004
|
+
)?.assignedNodes({ flatten: !0 }) || [];
|
|
1005
|
+
this._slottedDescriptionText = t.map((s) => s.textContent?.trim()).filter(Boolean).join(", ");
|
|
1028
1006
|
}
|
|
1029
1007
|
async _handleInvalid(e) {
|
|
1030
1008
|
e.preventDefault(), this.showError = !0, this._manageRequire();
|
|
@@ -1047,11 +1025,11 @@ const y = (v = class extends ce {
|
|
|
1047
1025
|
/******************** Event Handlers ********************/
|
|
1048
1026
|
// Similar to how native forms handle multiple same-name fields, we group the selected values into a list for FormData.
|
|
1049
1027
|
_handleCheckboxChange(e) {
|
|
1050
|
-
const t = e, { name: s } = t.detail,
|
|
1051
|
-
this.name = s, this._internals.setFormValue(
|
|
1028
|
+
const t = e, { name: s } = t.detail, i = Array.from(this.querySelectorAll("nys-checkbox")).filter((c) => c.checked).map((c) => c.value);
|
|
1029
|
+
this.name = s, this._internals.setFormValue(i.join(", ")), this._manageRequire();
|
|
1052
1030
|
}
|
|
1053
1031
|
render() {
|
|
1054
|
-
return
|
|
1032
|
+
return P`
|
|
1055
1033
|
<div class="nys-checkboxgroup">
|
|
1056
1034
|
<nys-label
|
|
1057
1035
|
for=${this.id}
|
|
@@ -1059,6 +1037,7 @@ const y = (v = class extends ce {
|
|
|
1059
1037
|
description=${this.description}
|
|
1060
1038
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
1061
1039
|
tooltip=${this._tooltip}
|
|
1040
|
+
?inverted=${this.inverted}
|
|
1062
1041
|
>
|
|
1063
1042
|
<slot name="description" slot="description">${this.description}</slot>
|
|
1064
1043
|
</nys-label>
|
|
@@ -1078,7 +1057,7 @@ const y = (v = class extends ce {
|
|
|
1078
1057
|
</div>
|
|
1079
1058
|
`;
|
|
1080
1059
|
}
|
|
1081
|
-
}, v.VALID_SIZES = ["sm", "md"], v.styles =
|
|
1060
|
+
}, v.VALID_SIZES = ["sm", "md"], v.styles = le, v.formAssociated = !0, v);
|
|
1082
1061
|
k([
|
|
1083
1062
|
a({ type: String })
|
|
1084
1063
|
], y.prototype, "id", 2);
|
|
@@ -1109,30 +1088,32 @@ k([
|
|
|
1109
1088
|
k([
|
|
1110
1089
|
a({ type: String })
|
|
1111
1090
|
], y.prototype, "_tooltip", 2);
|
|
1091
|
+
k([
|
|
1092
|
+
a({ type: Boolean, reflect: !0 })
|
|
1093
|
+
], y.prototype, "inverted", 2);
|
|
1112
1094
|
k([
|
|
1113
1095
|
a({ type: String, reflect: !0 })
|
|
1114
1096
|
], y.prototype, "form", 2);
|
|
1115
1097
|
k([
|
|
1116
|
-
|
|
1098
|
+
Ee()
|
|
1117
1099
|
], y.prototype, "_slottedDescriptionText", 2);
|
|
1118
1100
|
k([
|
|
1119
1101
|
a({ reflect: !0 })
|
|
1120
1102
|
], y.prototype, "size", 1);
|
|
1121
|
-
let
|
|
1122
|
-
customElements.get("nys-checkboxgroup") || customElements.define("nys-checkboxgroup",
|
|
1103
|
+
let He = y;
|
|
1104
|
+
customElements.get("nys-checkboxgroup") || customElements.define("nys-checkboxgroup", He);
|
|
1123
1105
|
var De = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, _ = (r, e, t, s) => {
|
|
1124
|
-
for (var o = s > 1 ? void 0 : s ? Ne(e, t) : e,
|
|
1125
|
-
(
|
|
1106
|
+
for (var o = s > 1 ? void 0 : s ? Ne(e, t) : e, i = r.length - 1, c; i >= 0; i--)
|
|
1107
|
+
(c = r[i]) && (o = (s ? c(e, t, o) : c(o)) || o);
|
|
1126
1108
|
return s && o && De(e, t, o), o;
|
|
1127
1109
|
};
|
|
1128
1110
|
let Ve = 0;
|
|
1129
1111
|
var x;
|
|
1130
|
-
const p = (x = class extends
|
|
1112
|
+
const p = (x = class extends re {
|
|
1131
1113
|
// allows use of elementInternals' API
|
|
1132
1114
|
constructor() {
|
|
1133
|
-
super(), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.form = null, this.showError = !1, this.errorMessage = "", this.groupExist = !1, this.tile = !1, this._size = "md", this._manageLabelClick = () => {
|
|
1134
|
-
|
|
1135
|
-
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("nys-label"), t = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
|
|
1115
|
+
super(), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.form = null, this.showError = !1, this.errorMessage = "", this.groupExist = !1, this.tile = !1, this.inverted = !1, this._size = "md", this._manageLabelClick = () => {
|
|
1116
|
+
const e = this.shadowRoot?.querySelector("nys-label"), t = this.shadowRoot?.querySelector("input");
|
|
1136
1117
|
e && t && e.addEventListener("click", () => t.click());
|
|
1137
1118
|
}, this._internals = this.attachInternals();
|
|
1138
1119
|
}
|
|
@@ -1145,8 +1126,7 @@ const p = (x = class extends ce {
|
|
|
1145
1126
|
) ? e : "md";
|
|
1146
1127
|
}
|
|
1147
1128
|
async getInputElement() {
|
|
1148
|
-
|
|
1149
|
-
return await this.updateComplete, ((e = this.shadowRoot) == null ? void 0 : e.querySelector("input")) || null;
|
|
1129
|
+
return await this.updateComplete, this.shadowRoot?.querySelector("input") || null;
|
|
1150
1130
|
}
|
|
1151
1131
|
// Generate a unique ID if one is not provided
|
|
1152
1132
|
connectedCallback() {
|
|
@@ -1167,22 +1147,19 @@ const p = (x = class extends ce {
|
|
|
1167
1147
|
this.groupExist || this._internals.setFormValue(this.checked ? this.value : null);
|
|
1168
1148
|
}
|
|
1169
1149
|
_manageRequire() {
|
|
1170
|
-
|
|
1171
|
-
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("input"), t = this.errorMessage || "This field is required";
|
|
1150
|
+
const e = this.shadowRoot?.querySelector("input"), t = this.errorMessage || "This field is required";
|
|
1172
1151
|
e && (this.required && !this.checked ? (this._internals.ariaRequired = "true", this._internals.setValidity({ valueMissing: !0 }, t, e)) : this._internals.setValidity({}));
|
|
1173
1152
|
}
|
|
1174
1153
|
_setValidityMessage(e = "") {
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
t && (this.showError = !!e, (o = this.errorMessage) != null && o.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
|
|
1154
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
1155
|
+
t && (this.showError = !!e, this.errorMessage?.trim() && e !== "" && (e = this.errorMessage), this._internals.setValidity(
|
|
1178
1156
|
e ? { customError: !0 } : {},
|
|
1179
1157
|
e,
|
|
1180
1158
|
t
|
|
1181
1159
|
));
|
|
1182
1160
|
}
|
|
1183
1161
|
_validate() {
|
|
1184
|
-
|
|
1185
|
-
const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("input");
|
|
1162
|
+
const e = this.shadowRoot?.querySelector("input");
|
|
1186
1163
|
if (!e) return;
|
|
1187
1164
|
const t = e.validity;
|
|
1188
1165
|
let s = "";
|
|
@@ -1191,20 +1168,18 @@ const p = (x = class extends ce {
|
|
|
1191
1168
|
/********************** Functions **********************/
|
|
1192
1169
|
// This helper function is called to perform the element's native validation.
|
|
1193
1170
|
checkValidity() {
|
|
1194
|
-
var t;
|
|
1195
1171
|
if (this.required && !this.checked)
|
|
1196
1172
|
return !1;
|
|
1197
|
-
const e =
|
|
1173
|
+
const e = this.shadowRoot?.querySelector("input");
|
|
1198
1174
|
return e ? e.checkValidity() : !0;
|
|
1199
1175
|
}
|
|
1200
1176
|
_handleInvalid(e) {
|
|
1201
|
-
var s;
|
|
1202
1177
|
e.preventDefault(), this.showError = !0, this._validate();
|
|
1203
|
-
const t =
|
|
1178
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
1204
1179
|
if (t) {
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
(
|
|
1180
|
+
const s = this._internals.form;
|
|
1181
|
+
s ? Array.from(s.elements).find(
|
|
1182
|
+
(c) => typeof c.checkValidity == "function" && !c.checkValidity()
|
|
1208
1183
|
) === this && t.focus() : t.focus();
|
|
1209
1184
|
}
|
|
1210
1185
|
}
|
|
@@ -1241,20 +1216,19 @@ const p = (x = class extends ce {
|
|
|
1241
1216
|
e.code === "Space" && (e.preventDefault(), this.disabled || (this.checked = !this.checked, this._internals.setFormValue(this.checked ? this.value : null), await this.updateComplete, this._validate(), this._emitChangeEvent()));
|
|
1242
1217
|
}
|
|
1243
1218
|
render() {
|
|
1244
|
-
|
|
1245
|
-
return z`
|
|
1219
|
+
return P`
|
|
1246
1220
|
<label class="nys-checkbox">
|
|
1247
1221
|
<div class="nys-checkbox__checkboxwrapper">
|
|
1248
1222
|
<input
|
|
1249
1223
|
id="${this.id}"
|
|
1250
1224
|
class="nys-checkbox__checkbox"
|
|
1251
1225
|
type="checkbox"
|
|
1252
|
-
name="${
|
|
1226
|
+
name="${U(this.name ? this.name : void 0)}"
|
|
1253
1227
|
.checked=${this.checked}
|
|
1254
1228
|
?disabled=${this.disabled}
|
|
1255
1229
|
.value=${this.value}
|
|
1256
1230
|
?required="${this.required}"
|
|
1257
|
-
form=${
|
|
1231
|
+
form=${U(this.form || void 0)}
|
|
1258
1232
|
aria-checked="${this.checked}"
|
|
1259
1233
|
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
1260
1234
|
aria-required="${this.required}"
|
|
@@ -1265,19 +1239,20 @@ const p = (x = class extends ce {
|
|
|
1265
1239
|
@keydown="${this._handleKeydown}"
|
|
1266
1240
|
aria-label="${this.label}"
|
|
1267
1241
|
/>
|
|
1268
|
-
${this.checked ?
|
|
1242
|
+
${this.checked ? P`<nys-icon
|
|
1269
1243
|
for="${this.id}"
|
|
1270
1244
|
name="check"
|
|
1271
1245
|
size="${this.size === "md" ? "4xl" : this.size === "sm" ? "2xl" : "xl"}"
|
|
1272
1246
|
class="nys-checkbox__icon"
|
|
1273
1247
|
></nys-icon>` : ""}
|
|
1274
1248
|
</div>
|
|
1275
|
-
${this.label &&
|
|
1249
|
+
${this.label && P`
|
|
1276
1250
|
<nys-label
|
|
1277
1251
|
for=${this.id}
|
|
1278
1252
|
label=${this.label}
|
|
1279
|
-
description=${
|
|
1280
|
-
flag=${
|
|
1253
|
+
description=${U(this.description ?? void 0)}
|
|
1254
|
+
flag=${U(this.required ? "required" : void 0)}
|
|
1255
|
+
?inverted=${this.inverted}
|
|
1281
1256
|
>
|
|
1282
1257
|
<slot name="description" slot="description"
|
|
1283
1258
|
>${this.description}</slot
|
|
@@ -1285,7 +1260,7 @@ const p = (x = class extends ce {
|
|
|
1285
1260
|
</nys-label>
|
|
1286
1261
|
`}
|
|
1287
1262
|
</label>
|
|
1288
|
-
${
|
|
1263
|
+
${this.parentElement?.tagName.toLowerCase() !== "nys-checkboxgroup" ? P`<nys-errormessage
|
|
1289
1264
|
id="single-error-message"
|
|
1290
1265
|
?showError=${this.showError}
|
|
1291
1266
|
errorMessage=${this._internals.validationMessage || this.errorMessage}
|
|
@@ -1293,7 +1268,7 @@ const p = (x = class extends ce {
|
|
|
1293
1268
|
></nys-errormessage>` : ""}
|
|
1294
1269
|
`;
|
|
1295
1270
|
}
|
|
1296
|
-
}, x.VALID_SIZES = ["sm", "md"], x.styles =
|
|
1271
|
+
}, x.VALID_SIZES = ["sm", "md"], x.styles = le, x.formAssociated = !0, x);
|
|
1297
1272
|
_([
|
|
1298
1273
|
a({ type: Boolean, reflect: !0 })
|
|
1299
1274
|
], p.prototype, "checked", 2);
|
|
@@ -1333,6 +1308,9 @@ _([
|
|
|
1333
1308
|
_([
|
|
1334
1309
|
a({ type: Boolean, reflect: !0 })
|
|
1335
1310
|
], p.prototype, "tile", 2);
|
|
1311
|
+
_([
|
|
1312
|
+
a({ type: Boolean, reflect: !0 })
|
|
1313
|
+
], p.prototype, "inverted", 2);
|
|
1336
1314
|
_([
|
|
1337
1315
|
a({ reflect: !0 })
|
|
1338
1316
|
], p.prototype, "size", 1);
|
|
@@ -1340,6 +1318,6 @@ let Le = p;
|
|
|
1340
1318
|
customElements.get("nys-checkbox") || customElements.define("nys-checkbox", Le);
|
|
1341
1319
|
export {
|
|
1342
1320
|
Le as NysCheckbox,
|
|
1343
|
-
|
|
1321
|
+
He as NysCheckboxgroup
|
|
1344
1322
|
};
|
|
1345
1323
|
//# sourceMappingURL=nys-checkbox.js.map
|