@nysds/nys-radiobutton 1.10.1 → 1.11.1
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-radiobutton.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as ut, LitElement as st, html as L } from "lit";
|
|
2
2
|
/*!
|
|
3
3
|
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
4
4
|
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
@@ -14,18 +14,18 @@ import { css as bt, LitElement as nt, 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 U = globalThis, j = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, rt = Symbol(), Z = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let pt = class {
|
|
19
19
|
constructor(t, e, o) {
|
|
20
|
-
if (this._$cssResult$ = !0, o !==
|
|
20
|
+
if (this._$cssResult$ = !0, o !== rt) 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 (j && t === void 0) {
|
|
27
27
|
const o = e !== void 0 && e.length === 1;
|
|
28
|
-
o && (t =
|
|
28
|
+
o && (t = Z.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), o && Z.set(e, t));
|
|
29
29
|
}
|
|
30
30
|
return t;
|
|
31
31
|
}
|
|
@@ -33,90 +33,88 @@ let yt = class {
|
|
|
33
33
|
return this.cssText;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
36
|
+
const bt = (s) => new pt(typeof s == "string" ? s : s + "", void 0, rt), yt = (s, t) => {
|
|
37
|
+
if (j) s.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
38
38
|
else for (const e of t) {
|
|
39
|
-
const o = document.createElement("style"), i =
|
|
40
|
-
i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText,
|
|
39
|
+
const o = document.createElement("style"), i = U.litNonce;
|
|
40
|
+
i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText, s.appendChild(o);
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, K = j ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
43
43
|
let e = "";
|
|
44
44
|
for (const o of t.cssRules) e += o.cssText;
|
|
45
|
-
return
|
|
46
|
-
})(
|
|
45
|
+
return bt(e);
|
|
46
|
+
})(s) : s;
|
|
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: ft, defineProperty: _t, getOwnPropertyDescriptor: vt, getOwnPropertyNames: gt, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, D = globalThis, J = D.trustedTypes, At = J ? J.emptyScript : "", wt = D.reactiveElementPolyfillSupport, R = (s, t) => s, T = { toAttribute(s, t) {
|
|
53
53
|
switch (t) {
|
|
54
54
|
case Boolean:
|
|
55
|
-
|
|
55
|
+
s = s ? At : null;
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
59
|
-
|
|
59
|
+
s = s == null ? s : JSON.stringify(s);
|
|
60
60
|
}
|
|
61
|
-
return
|
|
62
|
-
}, fromAttribute(
|
|
63
|
-
let e =
|
|
61
|
+
return s;
|
|
62
|
+
}, fromAttribute(s, t) {
|
|
63
|
+
let e = s;
|
|
64
64
|
switch (t) {
|
|
65
65
|
case Boolean:
|
|
66
|
-
e =
|
|
66
|
+
e = s !== null;
|
|
67
67
|
break;
|
|
68
68
|
case Number:
|
|
69
|
-
e =
|
|
69
|
+
e = s === null ? null : Number(s);
|
|
70
70
|
break;
|
|
71
71
|
case Object:
|
|
72
72
|
case Array:
|
|
73
73
|
try {
|
|
74
|
-
e = JSON.parse(
|
|
74
|
+
e = JSON.parse(s);
|
|
75
75
|
} catch {
|
|
76
76
|
e = null;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
return e;
|
|
80
|
-
} },
|
|
81
|
-
Symbol.metadata
|
|
82
|
-
class
|
|
80
|
+
} }, G = (s, t) => !ft(s, t), Y = { attribute: !0, type: String, converter: T, reflect: !1, useDefault: !1, hasChanged: G };
|
|
81
|
+
Symbol.metadata ??= Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
82
|
+
class x 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 = Y) {
|
|
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 o = Symbol(), i = this.getPropertyDescriptor(t, o, e);
|
|
92
|
-
i !== void 0 &&
|
|
92
|
+
i !== void 0 && _t(this.prototype, t, i);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
static getPropertyDescriptor(t, e, o) {
|
|
96
|
-
const { get: i, set:
|
|
96
|
+
const { get: i, set: r } = vt(this.prototype, t) ?? { get() {
|
|
97
97
|
return this[e];
|
|
98
|
-
}, set(
|
|
99
|
-
this[e] =
|
|
98
|
+
}, set(n) {
|
|
99
|
+
this[e] = n;
|
|
100
100
|
} };
|
|
101
|
-
return { get() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const d = i == null ? void 0 : i.call(this);
|
|
105
|
-
n.call(this, s), this.requestUpdate(t, d, o);
|
|
101
|
+
return { get: i, set(n) {
|
|
102
|
+
const d = i?.call(this);
|
|
103
|
+
r?.call(this, n), this.requestUpdate(t, d, o);
|
|
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) ?? Y;
|
|
110
108
|
}
|
|
111
109
|
static _$Ei() {
|
|
112
|
-
if (this.hasOwnProperty(
|
|
113
|
-
const t =
|
|
110
|
+
if (this.hasOwnProperty(R("elementProperties"))) return;
|
|
111
|
+
const t = $t(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, o = [
|
|
115
|
+
if (this.hasOwnProperty(R("finalized"))) return;
|
|
116
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
|
|
117
|
+
const e = this.properties, o = [...gt(e), ...mt(e)];
|
|
120
118
|
for (const i of o) this.createProperty(i, e[i]);
|
|
121
119
|
}
|
|
122
120
|
const t = this[Symbol.metadata];
|
|
@@ -135,8 +133,8 @@ class C extends HTMLElement {
|
|
|
135
133
|
const e = [];
|
|
136
134
|
if (Array.isArray(t)) {
|
|
137
135
|
const o = new Set(t.flat(1 / 0).reverse());
|
|
138
|
-
for (const i of o) e.unshift(
|
|
139
|
-
} else t !== void 0 && e.push(
|
|
136
|
+
for (const i of o) e.unshift(K(i));
|
|
137
|
+
} else t !== void 0 && e.push(K(t));
|
|
140
138
|
return e;
|
|
141
139
|
}
|
|
142
140
|
static _$Eu(t, e) {
|
|
@@ -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((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 C extends HTMLElement {
|
|
|
165
160
|
}
|
|
166
161
|
createRenderRoot() {
|
|
167
162
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return
|
|
163
|
+
return yt(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 o;
|
|
174
|
-
return (o = e.hostConnected) == null ? void 0 : o.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 o;
|
|
183
|
-
return (o = e.hostDisconnected) == null ? void 0 : o.call(e);
|
|
184
|
-
});
|
|
171
|
+
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
185
172
|
}
|
|
186
173
|
attributeChangedCallback(t, e, o) {
|
|
187
174
|
this._$AK(t, o);
|
|
188
175
|
}
|
|
189
|
-
_$
|
|
190
|
-
var n;
|
|
176
|
+
_$ET(t, e) {
|
|
191
177
|
const o = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, o);
|
|
192
178
|
if (i !== void 0 && o.reflect === !0) {
|
|
193
|
-
const
|
|
194
|
-
this._$Em = t,
|
|
179
|
+
const r = (o.converter?.toAttribute !== void 0 ? o.converter : T).toAttribute(e, o.type);
|
|
180
|
+
this._$Em = t, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
|
|
195
181
|
}
|
|
196
182
|
}
|
|
197
183
|
_$AK(t, e) {
|
|
198
|
-
var n;
|
|
199
184
|
const o = this.constructor, i = o._$Eh.get(t);
|
|
200
185
|
if (i !== void 0 && this._$Em !== i) {
|
|
201
|
-
const
|
|
202
|
-
this._$Em = i
|
|
186
|
+
const r = o.getPropertyOptions(i), n = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : T;
|
|
187
|
+
this._$Em = i;
|
|
188
|
+
const d = n.fromAttribute(e, r.type);
|
|
189
|
+
this[i] = d ?? this._$Ej?.get(i) ?? d, this._$Em = null;
|
|
203
190
|
}
|
|
204
191
|
}
|
|
205
192
|
requestUpdate(t, e, o) {
|
|
206
193
|
if (t !== void 0) {
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
const i = this.constructor, r = this[t];
|
|
195
|
+
if (o ??= i.getPropertyOptions(t), !((o.hasChanged ?? G)(r, e) || o.useDefault && o.reflect && r === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, o)))) return;
|
|
196
|
+
this.C(t, e, o);
|
|
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: o, reflect: i, wrapped: r }, n) {
|
|
201
|
+
o && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), r !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || o || (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 C extends HTMLElement {
|
|
|
226
214
|
return this.performUpdate();
|
|
227
215
|
}
|
|
228
216
|
performUpdate() {
|
|
229
|
-
var o;
|
|
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, r] of this._$Ep) this[i] = r;
|
|
234
221
|
this._$Ep = void 0;
|
|
235
222
|
}
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
223
|
+
const o = this.constructor.elementProperties;
|
|
224
|
+
if (o.size > 0) for (const [i, r] of o) {
|
|
225
|
+
const { wrapped: n } = r, d = this[i];
|
|
226
|
+
n !== !0 || this._$AL.has(i) || d === void 0 || this.C(i, void 0, r, d);
|
|
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(((o) => o.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
233
|
+
} catch (o) {
|
|
234
|
+
throw t = !1, this._$EM(), o;
|
|
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((o) => {
|
|
256
|
-
var i;
|
|
257
|
-
return (i = o.hostUpdated) == null ? void 0 : i.call(o);
|
|
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,123 +253,122 @@ class C 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
|
+
x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[R("elementProperties")] = /* @__PURE__ */ new Map(), x[R("finalized")] = /* @__PURE__ */ new Map(), wt?.({ ReactiveElement: x }), (D.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 Et = { attribute: !0, type: String, converter:
|
|
269
|
+
const Et = { attribute: !0, type: String, converter: T, reflect: !1, hasChanged: G }, kt = (s = Et, t, e) => {
|
|
287
270
|
const { kind: o, metadata: i } = e;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
290
|
-
const { name:
|
|
271
|
+
let r = globalThis.litPropertyMetadata.get(i);
|
|
272
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), o === "setter" && ((s = Object.create(s)).wrapped = !0), r.set(e.name, s), o === "accessor") {
|
|
273
|
+
const { name: n } = e;
|
|
291
274
|
return { set(d) {
|
|
292
275
|
const a = t.get.call(this);
|
|
293
|
-
t.set.call(this, d), this.requestUpdate(
|
|
276
|
+
t.set.call(this, d), this.requestUpdate(n, a, s);
|
|
294
277
|
}, init(d) {
|
|
295
|
-
return d !== void 0 && this.
|
|
278
|
+
return d !== void 0 && this.C(n, void 0, s, d), d;
|
|
296
279
|
} };
|
|
297
280
|
}
|
|
298
281
|
if (o === "setter") {
|
|
299
|
-
const { name:
|
|
282
|
+
const { name: n } = e;
|
|
300
283
|
return function(d) {
|
|
301
|
-
const a = this[
|
|
302
|
-
t.call(this, d), this.requestUpdate(
|
|
284
|
+
const a = this[n];
|
|
285
|
+
t.call(this, d), this.requestUpdate(n, a, s);
|
|
303
286
|
};
|
|
304
287
|
}
|
|
305
288
|
throw Error("Unsupported decorator location: " + o);
|
|
306
289
|
};
|
|
307
|
-
function l(
|
|
308
|
-
return (t, e) => typeof e == "object" ?
|
|
309
|
-
const
|
|
310
|
-
return i.constructor.createProperty(
|
|
311
|
-
})(
|
|
290
|
+
function l(s) {
|
|
291
|
+
return (t, e) => typeof e == "object" ? kt(s, t, e) : ((o, i, r) => {
|
|
292
|
+
const n = i.hasOwnProperty(r);
|
|
293
|
+
return i.constructor.createProperty(r, o), n ? Object.getOwnPropertyDescriptor(i, r) : void 0;
|
|
294
|
+
})(s, 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 l({ ...
|
|
301
|
+
function nt(s) {
|
|
302
|
+
return l({ ...s, state: !0, attribute: !1 });
|
|
320
303
|
}
|
|
321
304
|
/**
|
|
322
305
|
* @license
|
|
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 F = globalThis, O = F.trustedTypes, Q = O ? O.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, at = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, dt = "?" + A, St = `<${dt}>`, k = document, M = () => k.createComment(""), P = (s) => s === null || typeof s != "object" && typeof s != "function", W = Array.isArray, xt = (s) => W(s) || typeof s?.[Symbol.iterator] == "function", N = `[
|
|
310
|
+
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, tt = />/g, w = RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^
|
|
311
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), et = /'/g, ot = /"/g, lt = /^(?:script|style|textarea|title)$/i, z = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), E = k.createTreeWalker(k, 129);
|
|
312
|
+
function ct(s, t) {
|
|
313
|
+
if (!W(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
314
|
+
return Q !== void 0 ? Q.createHTML(t) : t;
|
|
332
315
|
}
|
|
333
|
-
const
|
|
334
|
-
const e =
|
|
335
|
-
let i,
|
|
316
|
+
const Ct = (s, t) => {
|
|
317
|
+
const e = s.length - 1, o = [];
|
|
318
|
+
let i, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = C;
|
|
336
319
|
for (let d = 0; d < e; d++) {
|
|
337
|
-
const a =
|
|
320
|
+
const a = s[d];
|
|
338
321
|
let h, b, c = -1, g = 0;
|
|
339
|
-
for (; g < a.length && (
|
|
340
|
-
const $ =
|
|
341
|
-
|
|
322
|
+
for (; g < a.length && (n.lastIndex = g, b = n.exec(a), b !== null); ) g = n.lastIndex, n === C ? b[1] === "!--" ? n = X : b[1] !== void 0 ? n = tt : b[2] !== void 0 ? (lt.test(b[2]) && (i = RegExp("</" + b[2], "g")), n = w) : b[3] !== void 0 && (n = w) : n === w ? b[0] === ">" ? (n = i ?? C, c = -1) : b[1] === void 0 ? c = -2 : (c = n.lastIndex - b[2].length, h = b[1], n = b[3] === void 0 ? w : b[3] === '"' ? ot : et) : n === ot || n === et ? n = w : n === X || n === tt ? n = C : (n = w, i = void 0);
|
|
323
|
+
const $ = n === w && s[d + 1].startsWith("/>") ? " " : "";
|
|
324
|
+
r += n === C ? a + St : c >= 0 ? (o.push(h), a.slice(0, c) + at + a.slice(c) + A + $) : a + A + (c === -2 ? d : $);
|
|
342
325
|
}
|
|
343
|
-
return [
|
|
326
|
+
return [ct(s, r + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
|
|
344
327
|
};
|
|
345
|
-
class
|
|
328
|
+
class B {
|
|
346
329
|
constructor({ strings: t, _$litType$: e }, o) {
|
|
347
330
|
let i;
|
|
348
331
|
this.parts = [];
|
|
349
|
-
let
|
|
350
|
-
const d = t.length - 1, a = this.parts, [h, b] =
|
|
351
|
-
if (this.el =
|
|
332
|
+
let r = 0, n = 0;
|
|
333
|
+
const d = t.length - 1, a = this.parts, [h, b] = Ct(t, e);
|
|
334
|
+
if (this.el = B.createElement(h, o), E.currentNode = this.el.content, e === 2 || e === 3) {
|
|
352
335
|
const c = this.el.content.firstChild;
|
|
353
336
|
c.replaceWith(...c.childNodes);
|
|
354
337
|
}
|
|
355
338
|
for (; (i = E.nextNode()) !== null && a.length < d; ) {
|
|
356
339
|
if (i.nodeType === 1) {
|
|
357
|
-
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(
|
|
358
|
-
const g = b[
|
|
359
|
-
a.push({ type: 1, index:
|
|
360
|
-
} else c.startsWith(A) && (a.push({ type: 6, index:
|
|
361
|
-
if (
|
|
340
|
+
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(at)) {
|
|
341
|
+
const g = b[n++], $ = i.getAttribute(c).split(A), q = /([.?@])?(.*)/.exec(g);
|
|
342
|
+
a.push({ type: 1, index: r, name: q[2], strings: $, ctor: q[1] === "." ? Pt : q[1] === "?" ? zt : q[1] === "@" ? Bt : I }), i.removeAttribute(c);
|
|
343
|
+
} else c.startsWith(A) && (a.push({ type: 6, index: r }), i.removeAttribute(c));
|
|
344
|
+
if (lt.test(i.tagName)) {
|
|
362
345
|
const c = i.textContent.split(A), g = c.length - 1;
|
|
363
346
|
if (g > 0) {
|
|
364
|
-
i.textContent =
|
|
365
|
-
for (let $ = 0; $ < g; $++) i.append(c[$],
|
|
366
|
-
i.append(c[g],
|
|
347
|
+
i.textContent = O ? O.emptyScript : "";
|
|
348
|
+
for (let $ = 0; $ < g; $++) i.append(c[$], M()), E.nextNode(), a.push({ type: 2, index: ++r });
|
|
349
|
+
i.append(c[g], M());
|
|
367
350
|
}
|
|
368
351
|
}
|
|
369
|
-
} else if (i.nodeType === 8) if (i.data ===
|
|
352
|
+
} else if (i.nodeType === 8) if (i.data === dt) a.push({ type: 2, index: r });
|
|
370
353
|
else {
|
|
371
354
|
let c = -1;
|
|
372
|
-
for (; (c = i.data.indexOf(A, c + 1)) !== -1; ) a.push({ type: 7, index:
|
|
355
|
+
for (; (c = i.data.indexOf(A, c + 1)) !== -1; ) a.push({ type: 7, index: r }), c += A.length - 1;
|
|
373
356
|
}
|
|
374
|
-
|
|
357
|
+
r++;
|
|
375
358
|
}
|
|
376
359
|
}
|
|
377
360
|
static createElement(t, e) {
|
|
378
|
-
const o =
|
|
361
|
+
const o = k.createElement("template");
|
|
379
362
|
return o.innerHTML = t, o;
|
|
380
363
|
}
|
|
381
364
|
}
|
|
382
|
-
function
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return (i == null ? void 0 : i.constructor) !== n && ((d = i == null ? void 0 : i._$AO) == null || d.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, o)), o !== void 0 ? (e._$Co ?? (e._$Co = []))[o] = i : e._$Cl = i), i !== void 0 && (t = x(r, i._$AS(r, t.values), i, o)), t;
|
|
365
|
+
function S(s, t, e = s, o) {
|
|
366
|
+
if (t === z) return t;
|
|
367
|
+
let i = o !== void 0 ? e._$Co?.[o] : e._$Cl;
|
|
368
|
+
const r = P(t) ? void 0 : t._$litDirective$;
|
|
369
|
+
return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(s), i._$AT(s, e, o)), o !== void 0 ? (e._$Co ??= [])[o] = i : e._$Cl = i), i !== void 0 && (t = S(s, i._$AS(s, t.values), i, o)), t;
|
|
388
370
|
}
|
|
389
|
-
class
|
|
371
|
+
class Rt {
|
|
390
372
|
constructor(t, e) {
|
|
391
373
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
392
374
|
}
|
|
@@ -397,35 +379,34 @@ class Pt {
|
|
|
397
379
|
return this._$AM._$AU;
|
|
398
380
|
}
|
|
399
381
|
u(t) {
|
|
400
|
-
const { el: { content: e }, parts: o } = this._$AD, i = (
|
|
382
|
+
const { el: { content: e }, parts: o } = this._$AD, i = (t?.creationScope ?? k).importNode(e, !0);
|
|
401
383
|
E.currentNode = i;
|
|
402
|
-
let
|
|
384
|
+
let r = E.nextNode(), n = 0, d = 0, a = o[0];
|
|
403
385
|
for (; a !== void 0; ) {
|
|
404
|
-
if (
|
|
386
|
+
if (n === a.index) {
|
|
405
387
|
let h;
|
|
406
|
-
a.type === 2 ? h = new
|
|
388
|
+
a.type === 2 ? h = new H(r, r.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (h = new qt(r, this, t)), this._$AV.push(h), a = o[++d];
|
|
407
389
|
}
|
|
408
|
-
|
|
390
|
+
n !== a?.index && (r = E.nextNode(), n++);
|
|
409
391
|
}
|
|
410
|
-
return E.currentNode =
|
|
392
|
+
return E.currentNode = k, i;
|
|
411
393
|
}
|
|
412
394
|
p(t) {
|
|
413
395
|
let e = 0;
|
|
414
396
|
for (const o of this._$AV) o !== void 0 && (o.strings !== void 0 ? (o._$AI(t, o, e), e += o.strings.length - 2) : o._$AI(t[e])), e++;
|
|
415
397
|
}
|
|
416
398
|
}
|
|
417
|
-
class
|
|
399
|
+
class H {
|
|
418
400
|
get _$AU() {
|
|
419
|
-
|
|
420
|
-
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
401
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
421
402
|
}
|
|
422
403
|
constructor(t, e, o, i) {
|
|
423
|
-
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options = i, this._$Cv =
|
|
404
|
+
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
424
405
|
}
|
|
425
406
|
get parentNode() {
|
|
426
407
|
let t = this._$AA.parentNode;
|
|
427
408
|
const e = this._$AM;
|
|
428
|
-
return e !== void 0 &&
|
|
409
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
429
410
|
}
|
|
430
411
|
get startNode() {
|
|
431
412
|
return this._$AA;
|
|
@@ -434,7 +415,7 @@ class D {
|
|
|
434
415
|
return this._$AB;
|
|
435
416
|
}
|
|
436
417
|
_$AI(t, e = this) {
|
|
437
|
-
t =
|
|
418
|
+
t = S(this, t, e), P(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
|
|
438
419
|
}
|
|
439
420
|
O(t) {
|
|
440
421
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -443,66 +424,63 @@ class D {
|
|
|
443
424
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
444
425
|
}
|
|
445
426
|
_(t) {
|
|
446
|
-
this._$AH !== p &&
|
|
427
|
+
this._$AH !== p && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
|
|
447
428
|
}
|
|
448
429
|
$(t) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
|
|
430
|
+
const { values: e, _$litType$: o } = t, i = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = B.createElement(ct(o.h, o.h[0]), this.options)), o);
|
|
431
|
+
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
452
432
|
else {
|
|
453
|
-
const
|
|
454
|
-
|
|
433
|
+
const r = new Rt(i, this), n = r.u(this.options);
|
|
434
|
+
r.p(e), this.T(n), this._$AH = r;
|
|
455
435
|
}
|
|
456
436
|
}
|
|
457
437
|
_$AC(t) {
|
|
458
|
-
let e =
|
|
459
|
-
return e === void 0 &&
|
|
438
|
+
let e = it.get(t.strings);
|
|
439
|
+
return e === void 0 && it.set(t.strings, e = new B(t)), e;
|
|
460
440
|
}
|
|
461
441
|
k(t) {
|
|
462
|
-
|
|
442
|
+
W(this._$AH) || (this._$AH = [], this._$AR());
|
|
463
443
|
const e = this._$AH;
|
|
464
444
|
let o, i = 0;
|
|
465
|
-
for (const
|
|
445
|
+
for (const r of t) i === e.length ? e.push(o = new H(this.O(M()), this.O(M()), this, this.options)) : o = e[i], o._$AI(r), i++;
|
|
466
446
|
i < e.length && (this._$AR(o && o._$AB.nextSibling, i), e.length = i);
|
|
467
447
|
}
|
|
468
448
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
t.remove(), t = i;
|
|
449
|
+
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
450
|
+
const o = t.nextSibling;
|
|
451
|
+
t.remove(), t = o;
|
|
473
452
|
}
|
|
474
453
|
}
|
|
475
454
|
setConnected(t) {
|
|
476
|
-
|
|
477
|
-
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
455
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
478
456
|
}
|
|
479
457
|
}
|
|
480
|
-
class
|
|
458
|
+
class I {
|
|
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(t, e, o, i,
|
|
488
|
-
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options =
|
|
465
|
+
constructor(t, e, o, i, r) {
|
|
466
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = r, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = p;
|
|
489
467
|
}
|
|
490
468
|
_$AI(t, e = this, o, i) {
|
|
491
|
-
const
|
|
492
|
-
let
|
|
493
|
-
if (
|
|
469
|
+
const r = this.strings;
|
|
470
|
+
let n = !1;
|
|
471
|
+
if (r === void 0) t = S(this, t, e, 0), n = !P(t) || t !== this._$AH && t !== z, n && (this._$AH = t);
|
|
494
472
|
else {
|
|
495
473
|
const d = t;
|
|
496
474
|
let a, h;
|
|
497
|
-
for (t =
|
|
475
|
+
for (t = r[0], a = 0; a < r.length - 1; a++) h = S(this, d[o + a], e, a), h === z && (h = this._$AH[a]), n ||= !P(h) || h !== this._$AH[a], h === p ? t = p : t !== p && (t += (h ?? "") + r[a + 1]), this._$AH[a] = h;
|
|
498
476
|
}
|
|
499
|
-
|
|
477
|
+
n && !i && this.j(t);
|
|
500
478
|
}
|
|
501
479
|
j(t) {
|
|
502
480
|
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
503
481
|
}
|
|
504
482
|
}
|
|
505
|
-
class
|
|
483
|
+
class Pt extends I {
|
|
506
484
|
constructor() {
|
|
507
485
|
super(...arguments), this.type = 3;
|
|
508
486
|
}
|
|
@@ -510,7 +488,7 @@ class zt extends N {
|
|
|
510
488
|
this.element[this.name] = t === p ? void 0 : t;
|
|
511
489
|
}
|
|
512
490
|
}
|
|
513
|
-
class
|
|
491
|
+
class zt extends I {
|
|
514
492
|
constructor() {
|
|
515
493
|
super(...arguments), this.type = 4;
|
|
516
494
|
}
|
|
@@ -518,18 +496,17 @@ class Bt extends N {
|
|
|
518
496
|
this.element.toggleAttribute(this.name, !!t && t !== p);
|
|
519
497
|
}
|
|
520
498
|
}
|
|
521
|
-
class
|
|
522
|
-
constructor(t, e, o, i,
|
|
523
|
-
super(t, e, o, i,
|
|
499
|
+
class Bt extends I {
|
|
500
|
+
constructor(t, e, o, i, r) {
|
|
501
|
+
super(t, e, o, i, r), this.type = 5;
|
|
524
502
|
}
|
|
525
503
|
_$AI(t, e = this) {
|
|
526
|
-
if ((t =
|
|
527
|
-
const o = this._$AH, i = t === p && o !== p || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive,
|
|
528
|
-
i && this.element.removeEventListener(this.name, this, o),
|
|
504
|
+
if ((t = S(this, t, e, 0) ?? p) === z) return;
|
|
505
|
+
const o = this._$AH, i = t === p && o !== p || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, r = t !== p && (o === p || i);
|
|
506
|
+
i && this.element.removeEventListener(this.name, this, o), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
529
507
|
}
|
|
530
508
|
handleEvent(t) {
|
|
531
|
-
|
|
532
|
-
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
509
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
533
510
|
}
|
|
534
511
|
}
|
|
535
512
|
class qt {
|
|
@@ -540,17 +517,17 @@ class qt {
|
|
|
540
517
|
return this._$AM._$AU;
|
|
541
518
|
}
|
|
542
519
|
_$AI(t) {
|
|
543
|
-
|
|
520
|
+
S(this, t);
|
|
544
521
|
}
|
|
545
522
|
}
|
|
546
|
-
const
|
|
547
|
-
|
|
523
|
+
const Ut = F.litHtmlPolyfillSupport;
|
|
524
|
+
Ut?.(B, H), (F.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 V = (s) => s ?? p, ht = ut`
|
|
554
531
|
:host {
|
|
555
532
|
/* Global Radiobutton Styles */
|
|
556
533
|
--_nys-radiobutton-size: var(--nys-size-400, 32px);
|
|
@@ -910,17 +887,17 @@ const j = (r) => r ?? p, pt = bt`
|
|
|
910
887
|
border: 0;
|
|
911
888
|
}
|
|
912
889
|
`;
|
|
913
|
-
var Tt = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, f = (
|
|
914
|
-
for (var i = o > 1 ? void 0 : o ? Ot(t, e) : t,
|
|
915
|
-
(
|
|
890
|
+
var Tt = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, f = (s, t, e, o) => {
|
|
891
|
+
for (var i = o > 1 ? void 0 : o ? Ot(t, e) : t, r = s.length - 1, n; r >= 0; r--)
|
|
892
|
+
(n = s[r]) && (i = (o ? n(t, e, i) : n(i)) || i);
|
|
916
893
|
return o && i && Tt(t, e, i), i;
|
|
917
894
|
};
|
|
918
|
-
let
|
|
895
|
+
let Mt = 0;
|
|
919
896
|
var m;
|
|
920
|
-
const y = (m = class extends
|
|
897
|
+
const y = (m = class extends st {
|
|
921
898
|
// allows use of elementInternals' API
|
|
922
899
|
constructor() {
|
|
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.
|
|
900
|
+
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.selectedValue = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
|
|
924
901
|
}
|
|
925
902
|
get size() {
|
|
926
903
|
return this._size;
|
|
@@ -932,7 +909,7 @@ const y = (m = class extends nt {
|
|
|
932
909
|
}
|
|
933
910
|
// Generate a unique ID if one is not provided
|
|
934
911
|
connectedCallback() {
|
|
935
|
-
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${
|
|
912
|
+
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${Mt++}`), this.addEventListener("nys-change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid);
|
|
936
913
|
}
|
|
937
914
|
disconnectedCallback() {
|
|
938
915
|
super.disconnectedCallback(), this.removeEventListener("nys-change", this._handleRadioButtonChange), this.removeEventListener("invalid", this._handleInvalid);
|
|
@@ -941,7 +918,7 @@ const y = (m = class extends nt {
|
|
|
941
918
|
this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError(), this._getSlotDescriptionForAria(), await this.updateComplete, this._initializeChildAttributes(), this._updateGroupTabIndex();
|
|
942
919
|
}
|
|
943
920
|
updated(t) {
|
|
944
|
-
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("
|
|
921
|
+
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("inverted") && this._updateRadioButtonsInvert(), t.has("showError") && this._updateRadioButtonsShowError(), t.has("form") && this._updateRadioButtonsForm();
|
|
945
922
|
}
|
|
946
923
|
// This callback is automatically called when the parent form is reset.
|
|
947
924
|
formResetCallback() {
|
|
@@ -980,7 +957,9 @@ const y = (m = class extends nt {
|
|
|
980
957
|
}
|
|
981
958
|
/********************** Core Keyboard & Click Logic **********************/
|
|
982
959
|
_getAllRadios() {
|
|
983
|
-
return Array.from(
|
|
960
|
+
return Array.from(
|
|
961
|
+
this.querySelectorAll("nys-radiobutton")
|
|
962
|
+
);
|
|
984
963
|
}
|
|
985
964
|
// Arrow / Space / Enter navigation at group level
|
|
986
965
|
async _handleKeyDown(t) {
|
|
@@ -993,11 +972,11 @@ const y = (m = class extends nt {
|
|
|
993
972
|
"Enter"
|
|
994
973
|
].includes(t.key)) return;
|
|
995
974
|
t.preventDefault();
|
|
996
|
-
const o = this._getAllRadios().filter((h) => !h.disabled), i = o.find((h) => h.checked) || o[0],
|
|
997
|
-
let
|
|
998
|
-
|
|
999
|
-
const d = o[
|
|
1000
|
-
|
|
975
|
+
const o = this._getAllRadios().filter((h) => !h.disabled), i = o.find((h) => h.checked) || o[0], r = t.key === " " || t.key === "Enter" ? 0 : ["ArrowUp", "ArrowLeft"].includes(t.key) ? -1 : 1;
|
|
976
|
+
let n = o.indexOf(i) + r;
|
|
977
|
+
n < 0 && (n = o.length - 1), n >= o.length && (n = 0);
|
|
978
|
+
const d = o[n];
|
|
979
|
+
(await d.getInputElement())?.click(), this._updateGroupTabIndex(), d.focus();
|
|
1001
980
|
}
|
|
1002
981
|
_updateGroupTabIndex() {
|
|
1003
982
|
const t = this._getAllRadios(), e = t.find((o) => o.checked) || t[0];
|
|
@@ -1025,7 +1004,7 @@ const y = (m = class extends nt {
|
|
|
1025
1004
|
}
|
|
1026
1005
|
_updateRadioButtonsInvert() {
|
|
1027
1006
|
this.querySelectorAll("nys-radiobutton").forEach((e) => {
|
|
1028
|
-
this.
|
|
1007
|
+
this.inverted ? e.toggleAttribute("inverted", !0) : e.removeAttribute("inverted");
|
|
1029
1008
|
});
|
|
1030
1009
|
}
|
|
1031
1010
|
_updateRadioButtonsShowError() {
|
|
@@ -1040,14 +1019,10 @@ const y = (m = class extends nt {
|
|
|
1040
1019
|
}
|
|
1041
1020
|
// Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset
|
|
1042
1021
|
_getSlotDescriptionForAria() {
|
|
1043
|
-
|
|
1044
|
-
const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(
|
|
1022
|
+
const e = this.shadowRoot?.querySelector(
|
|
1045
1023
|
'slot[name="description"]'
|
|
1046
|
-
)
|
|
1047
|
-
this._slottedDescriptionText = e.map((
|
|
1048
|
-
var n;
|
|
1049
|
-
return (n = i.textContent) == null ? void 0 : n.trim();
|
|
1050
|
-
}).filter(Boolean).join(", ");
|
|
1024
|
+
)?.assignedNodes({ flatten: !0 }) || [];
|
|
1025
|
+
this._slottedDescriptionText = e.map((o) => o.textContent?.trim()).filter(Boolean).join(", ");
|
|
1051
1026
|
}
|
|
1052
1027
|
/******************** Event Handlers ********************/
|
|
1053
1028
|
// Keeps radiogroup informed of the name and value of its current selected radiobutton at each change
|
|
@@ -1058,24 +1033,26 @@ const y = (m = class extends nt {
|
|
|
1058
1033
|
async _handleInvalid(t) {
|
|
1059
1034
|
if (t.preventDefault(), this._internals.validity.valueMissing) {
|
|
1060
1035
|
this.showError = !0, this._manageRequire();
|
|
1061
|
-
const e = this.querySelector(
|
|
1036
|
+
const e = this.querySelector(
|
|
1037
|
+
"nys-radiobutton"
|
|
1038
|
+
);
|
|
1062
1039
|
if (e) {
|
|
1063
1040
|
const o = this._internals.form;
|
|
1064
1041
|
o ? Array.from(o.elements).find(
|
|
1065
|
-
(
|
|
1042
|
+
(n) => typeof n.checkValidity == "function" && !n.checkValidity()
|
|
1066
1043
|
) === this && (e.focus(), e.classList.add("active-focus")) : (e.focus(), e.classList.add("active-focus"));
|
|
1067
1044
|
}
|
|
1068
1045
|
}
|
|
1069
1046
|
}
|
|
1070
1047
|
render() {
|
|
1071
|
-
return
|
|
1048
|
+
return L`<div class="nys-radiogroup">
|
|
1072
1049
|
<nys-label
|
|
1073
1050
|
for=${this.id}
|
|
1074
1051
|
label=${this.label}
|
|
1075
1052
|
description=${this.description}
|
|
1076
1053
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
1077
1054
|
_tooltip=${this._tooltip}
|
|
1078
|
-
?
|
|
1055
|
+
?inverted=${this.inverted}
|
|
1079
1056
|
>
|
|
1080
1057
|
<slot name="description" slot="description">${this.description}</slot>
|
|
1081
1058
|
</nys-label>
|
|
@@ -1094,7 +1071,7 @@ const y = (m = class extends nt {
|
|
|
1094
1071
|
></nys-errormessage>
|
|
1095
1072
|
</div>`;
|
|
1096
1073
|
}
|
|
1097
|
-
}, m.VALID_SIZES = ["sm", "md"], m.styles =
|
|
1074
|
+
}, m.VALID_SIZES = ["sm", "md"], m.styles = ht, m.formAssociated = !0, m);
|
|
1098
1075
|
f([
|
|
1099
1076
|
l({ type: String })
|
|
1100
1077
|
], y.prototype, "id", 2);
|
|
@@ -1127,31 +1104,31 @@ f([
|
|
|
1127
1104
|
], y.prototype, "_tooltip", 2);
|
|
1128
1105
|
f([
|
|
1129
1106
|
l({ type: Boolean, reflect: !0 })
|
|
1130
|
-
], y.prototype, "
|
|
1107
|
+
], y.prototype, "inverted", 2);
|
|
1131
1108
|
f([
|
|
1132
1109
|
l({ type: String, reflect: !0 })
|
|
1133
1110
|
], y.prototype, "form", 2);
|
|
1134
1111
|
f([
|
|
1135
|
-
|
|
1112
|
+
nt()
|
|
1136
1113
|
], y.prototype, "selectedValue", 2);
|
|
1137
1114
|
f([
|
|
1138
|
-
|
|
1115
|
+
nt()
|
|
1139
1116
|
], y.prototype, "_slottedDescriptionText", 2);
|
|
1140
1117
|
f([
|
|
1141
1118
|
l({ reflect: !0 })
|
|
1142
1119
|
], y.prototype, "size", 1);
|
|
1143
|
-
let
|
|
1144
|
-
customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup",
|
|
1145
|
-
var
|
|
1146
|
-
for (var i = o > 1 ? void 0 : o ?
|
|
1147
|
-
(
|
|
1148
|
-
return o && i &&
|
|
1120
|
+
let Dt = y;
|
|
1121
|
+
customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", Dt);
|
|
1122
|
+
var Ht = Object.defineProperty, It = Object.getOwnPropertyDescriptor, v = (s, t, e, o) => {
|
|
1123
|
+
for (var i = o > 1 ? void 0 : o ? It(t, e) : t, r = s.length - 1, n; r >= 0; r--)
|
|
1124
|
+
(n = s[r]) && (i = (o ? n(t, e, i) : n(i)) || i);
|
|
1125
|
+
return o && i && Ht(t, e, i), i;
|
|
1149
1126
|
};
|
|
1150
1127
|
let Nt = 0;
|
|
1151
1128
|
var u;
|
|
1152
|
-
const _ = (u = class extends
|
|
1129
|
+
const _ = (u = class extends st {
|
|
1153
1130
|
constructor() {
|
|
1154
|
-
super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.
|
|
1131
|
+
super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.inverted = !1, this.form = null, this._size = "md", this.tile = !1;
|
|
1155
1132
|
}
|
|
1156
1133
|
get size() {
|
|
1157
1134
|
return this._size;
|
|
@@ -1162,8 +1139,7 @@ const _ = (u = class extends nt {
|
|
|
1162
1139
|
) ? t : "md";
|
|
1163
1140
|
}
|
|
1164
1141
|
async getInputElement() {
|
|
1165
|
-
|
|
1166
|
-
return await this.updateComplete, ((t = this.shadowRoot) == null ? void 0 : t.querySelector("input")) || null;
|
|
1142
|
+
return await this.updateComplete, this.shadowRoot?.querySelector("input") || null;
|
|
1167
1143
|
}
|
|
1168
1144
|
// This callback is automatically called when the parent form is reset.
|
|
1169
1145
|
formResetUpdate() {
|
|
@@ -1183,10 +1159,9 @@ const _ = (u = class extends nt {
|
|
|
1183
1159
|
/********************** Functions **********************/
|
|
1184
1160
|
// This helper function is called to perform the element's native validation.
|
|
1185
1161
|
checkValidity() {
|
|
1186
|
-
var e;
|
|
1187
1162
|
if (this.required && !this.checked)
|
|
1188
1163
|
return !1;
|
|
1189
|
-
const t =
|
|
1164
|
+
const t = this.shadowRoot?.querySelector("input");
|
|
1190
1165
|
return t ? t.checkValidity() : !0;
|
|
1191
1166
|
}
|
|
1192
1167
|
/******************** Event Handlers ********************/
|
|
@@ -1217,24 +1192,23 @@ const _ = (u = class extends nt {
|
|
|
1217
1192
|
this.classList.remove("active-focus"), this.dispatchEvent(new Event("nys-blur"));
|
|
1218
1193
|
}
|
|
1219
1194
|
_callInputHandling() {
|
|
1220
|
-
var e;
|
|
1221
1195
|
if (this.disabled) return;
|
|
1222
|
-
const t =
|
|
1196
|
+
const t = this.shadowRoot?.querySelector(
|
|
1223
1197
|
'input[type="radio"]'
|
|
1224
1198
|
);
|
|
1225
1199
|
t && (t.focus(), t.click());
|
|
1226
1200
|
}
|
|
1227
1201
|
render() {
|
|
1228
|
-
return
|
|
1202
|
+
return L`
|
|
1229
1203
|
<input
|
|
1230
1204
|
id="${this.id}"
|
|
1231
1205
|
type="radio"
|
|
1232
|
-
name="${
|
|
1206
|
+
name="${V(this.name ? this.name : void 0)}"
|
|
1233
1207
|
.checked=${this.checked}
|
|
1234
1208
|
?disabled=${this.disabled}
|
|
1235
1209
|
.value=${this.value}
|
|
1236
1210
|
?required="${this.required}"
|
|
1237
|
-
form=${
|
|
1211
|
+
form=${V(this.form || void 0)}
|
|
1238
1212
|
@change="${this._handleChange}"
|
|
1239
1213
|
hidden
|
|
1240
1214
|
aria-hidden="true"
|
|
@@ -1246,18 +1220,18 @@ const _ = (u = class extends nt {
|
|
|
1246
1220
|
aria-label=${this.label}
|
|
1247
1221
|
>
|
|
1248
1222
|
<span class="nys-radiobutton__radio"></span>
|
|
1249
|
-
${this.label &&
|
|
1223
|
+
${this.label && L`<nys-label
|
|
1250
1224
|
for=${this.id}
|
|
1251
1225
|
label=${this.label}
|
|
1252
|
-
description=${
|
|
1253
|
-
?
|
|
1226
|
+
description=${V(this.description || void 0)}
|
|
1227
|
+
?inverted=${this.inverted}
|
|
1254
1228
|
>
|
|
1255
1229
|
<slot name="description" slot="description">${this.description}</slot>
|
|
1256
1230
|
</nys-label> `}
|
|
1257
1231
|
</label>
|
|
1258
1232
|
`;
|
|
1259
1233
|
}
|
|
1260
|
-
}, u.VALID_SIZES = ["sm", "md"], u.buttonGroup = {}, u.styles =
|
|
1234
|
+
}, u.VALID_SIZES = ["sm", "md"], u.buttonGroup = {}, u.styles = ht, u);
|
|
1261
1235
|
v([
|
|
1262
1236
|
l({ type: Boolean, reflect: !0 })
|
|
1263
1237
|
], _.prototype, "checked", 2);
|
|
@@ -1284,7 +1258,7 @@ v([
|
|
|
1284
1258
|
], _.prototype, "value", 2);
|
|
1285
1259
|
v([
|
|
1286
1260
|
l({ type: Boolean, reflect: !0 })
|
|
1287
|
-
], _.prototype, "
|
|
1261
|
+
], _.prototype, "inverted", 2);
|
|
1288
1262
|
v([
|
|
1289
1263
|
l({ type: String, reflect: !0 })
|
|
1290
1264
|
], _.prototype, "form", 2);
|
|
@@ -1298,6 +1272,6 @@ let Vt = _;
|
|
|
1298
1272
|
customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", Vt);
|
|
1299
1273
|
export {
|
|
1300
1274
|
Vt as NysRadiobutton,
|
|
1301
|
-
|
|
1275
|
+
Dt as NysRadiogroup
|
|
1302
1276
|
};
|
|
1303
1277
|
//# sourceMappingURL=nys-radiobutton.js.map
|