@nysds/nys-radiobutton 1.1.8 → 1.1.9
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.d.ts +1 -0
- package/dist/nys-radiobutton.js +460 -323
- package/dist/nys-radiobutton.js.map +1 -1
- package/dist/nys-radiogroup.d.ts +3 -0
- package/package.json +11 -9
package/dist/nys-radiobutton.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as ut, LitElement as
|
|
1
|
+
import { css as ut, LitElement as it, html as j } from "lit";
|
|
2
2
|
import "@nysds/nys-label";
|
|
3
3
|
import "@nysds/nys-errormessage";
|
|
4
4
|
/*!
|
|
@@ -16,18 +16,18 @@ import "@nysds/nys-errormessage";
|
|
|
16
16
|
* Copyright 2019 Google LLC
|
|
17
17
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
constructor(t, e,
|
|
22
|
-
if (this._$cssResult$ = !0,
|
|
19
|
+
const O = globalThis, W = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, nt = Symbol(), K = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
let bt = class {
|
|
21
|
+
constructor(t, e, o) {
|
|
22
|
+
if (this._$cssResult$ = !0, o !== nt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
23
23
|
this.cssText = t, this.t = e;
|
|
24
24
|
}
|
|
25
25
|
get styleSheet() {
|
|
26
26
|
let t = this.o;
|
|
27
27
|
const e = this.t;
|
|
28
28
|
if (W && t === void 0) {
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const o = e !== void 0 && e.length === 1;
|
|
30
|
+
o && (t = K.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), o && K.set(e, t));
|
|
31
31
|
}
|
|
32
32
|
return t;
|
|
33
33
|
}
|
|
@@ -35,51 +35,51 @@ let pt = class {
|
|
|
35
35
|
return this.cssText;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
if (W)
|
|
38
|
+
const pt = (r) => new bt(typeof r == "string" ? r : r + "", void 0, nt), yt = (r, t) => {
|
|
39
|
+
if (W) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
40
40
|
else for (const e of t) {
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const o = document.createElement("style"), s = O.litNonce;
|
|
42
|
+
s !== void 0 && o.setAttribute("nonce", s), o.textContent = e.cssText, r.appendChild(o);
|
|
43
43
|
}
|
|
44
|
-
}, J = W ? (
|
|
44
|
+
}, J = W ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
45
45
|
let e = "";
|
|
46
|
-
for (const
|
|
47
|
-
return
|
|
48
|
-
})(
|
|
46
|
+
for (const o of t.cssRules) e += o.cssText;
|
|
47
|
+
return pt(e);
|
|
48
|
+
})(r) : r;
|
|
49
49
|
/**
|
|
50
50
|
* @license
|
|
51
51
|
* Copyright 2017 Google LLC
|
|
52
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
53
|
*/
|
|
54
|
-
const { is:
|
|
54
|
+
const { is: _t, defineProperty: ft, getOwnPropertyDescriptor: vt, getOwnPropertyNames: gt, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, w = globalThis, Q = w.trustedTypes, At = Q ? Q.emptyScript : "", D = w.reactiveElementPolyfillSupport, R = (r, t) => r, M = { toAttribute(r, t) {
|
|
55
55
|
switch (t) {
|
|
56
56
|
case Boolean:
|
|
57
|
-
|
|
57
|
+
r = r ? At : null;
|
|
58
58
|
break;
|
|
59
59
|
case Object:
|
|
60
60
|
case Array:
|
|
61
|
-
|
|
61
|
+
r = r == null ? r : JSON.stringify(r);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
64
|
-
}, fromAttribute(
|
|
65
|
-
let e =
|
|
63
|
+
return r;
|
|
64
|
+
}, fromAttribute(r, t) {
|
|
65
|
+
let e = r;
|
|
66
66
|
switch (t) {
|
|
67
67
|
case Boolean:
|
|
68
|
-
e =
|
|
68
|
+
e = r !== null;
|
|
69
69
|
break;
|
|
70
70
|
case Number:
|
|
71
|
-
e =
|
|
71
|
+
e = r === null ? null : Number(r);
|
|
72
72
|
break;
|
|
73
73
|
case Object:
|
|
74
74
|
case Array:
|
|
75
75
|
try {
|
|
76
|
-
e = JSON.parse(
|
|
76
|
+
e = JSON.parse(r);
|
|
77
77
|
} catch {
|
|
78
78
|
e = null;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return e;
|
|
82
|
-
} }, F = (
|
|
82
|
+
} }, F = (r, t) => !_t(r, t), X = { attribute: !0, type: String, converter: M, reflect: !1, hasChanged: F };
|
|
83
83
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), w.litPropertyMetadata ?? (w.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
84
84
|
class C extends HTMLElement {
|
|
85
85
|
static addInitializer(t) {
|
|
@@ -90,60 +90,60 @@ class C extends HTMLElement {
|
|
|
90
90
|
}
|
|
91
91
|
static createProperty(t, e = X) {
|
|
92
92
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const o = Symbol(), s = this.getPropertyDescriptor(t, o, e);
|
|
94
|
+
s !== void 0 && ft(this.prototype, t, s);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
static getPropertyDescriptor(t, e,
|
|
98
|
-
const { get:
|
|
97
|
+
static getPropertyDescriptor(t, e, o) {
|
|
98
|
+
const { get: s, set: n } = vt(this.prototype, t) ?? { get() {
|
|
99
99
|
return this[e];
|
|
100
|
-
}, set(
|
|
101
|
-
this[e] =
|
|
100
|
+
}, set(i) {
|
|
101
|
+
this[e] = i;
|
|
102
102
|
} };
|
|
103
103
|
return { get() {
|
|
104
|
-
return
|
|
105
|
-
}, set(
|
|
106
|
-
const
|
|
107
|
-
n.call(this,
|
|
104
|
+
return s == null ? void 0 : s.call(this);
|
|
105
|
+
}, set(i) {
|
|
106
|
+
const d = s == null ? void 0 : s.call(this);
|
|
107
|
+
n.call(this, i), this.requestUpdate(t, d, o);
|
|
108
108
|
}, configurable: !0, enumerable: !0 };
|
|
109
109
|
}
|
|
110
110
|
static getPropertyOptions(t) {
|
|
111
111
|
return this.elementProperties.get(t) ?? X;
|
|
112
112
|
}
|
|
113
113
|
static _$Ei() {
|
|
114
|
-
if (this.hasOwnProperty(
|
|
114
|
+
if (this.hasOwnProperty(R("elementProperties"))) return;
|
|
115
115
|
const t = $t(this);
|
|
116
116
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
117
117
|
}
|
|
118
118
|
static finalize() {
|
|
119
|
-
if (this.hasOwnProperty(
|
|
120
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
121
|
-
const e = this.properties,
|
|
122
|
-
for (const
|
|
119
|
+
if (this.hasOwnProperty(R("finalized"))) return;
|
|
120
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(R("properties"))) {
|
|
121
|
+
const e = this.properties, o = [...gt(e), ...mt(e)];
|
|
122
|
+
for (const s of o) this.createProperty(s, e[s]);
|
|
123
123
|
}
|
|
124
124
|
const t = this[Symbol.metadata];
|
|
125
125
|
if (t !== null) {
|
|
126
126
|
const e = litPropertyMetadata.get(t);
|
|
127
|
-
if (e !== void 0) for (const [
|
|
127
|
+
if (e !== void 0) for (const [o, s] of e) this.elementProperties.set(o, s);
|
|
128
128
|
}
|
|
129
129
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
130
|
-
for (const [e,
|
|
131
|
-
const
|
|
132
|
-
|
|
130
|
+
for (const [e, o] of this.elementProperties) {
|
|
131
|
+
const s = this._$Eu(e, o);
|
|
132
|
+
s !== void 0 && this._$Eh.set(s, e);
|
|
133
133
|
}
|
|
134
134
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
135
135
|
}
|
|
136
136
|
static finalizeStyles(t) {
|
|
137
137
|
const e = [];
|
|
138
138
|
if (Array.isArray(t)) {
|
|
139
|
-
const
|
|
140
|
-
for (const
|
|
139
|
+
const o = new Set(t.flat(1 / 0).reverse());
|
|
140
|
+
for (const s of o) e.unshift(J(s));
|
|
141
141
|
} else t !== void 0 && e.push(J(t));
|
|
142
142
|
return e;
|
|
143
143
|
}
|
|
144
144
|
static _$Eu(t, e) {
|
|
145
|
-
const
|
|
146
|
-
return
|
|
145
|
+
const o = e.attribute;
|
|
146
|
+
return o === !1 ? void 0 : typeof o == "string" ? o : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
147
147
|
}
|
|
148
148
|
constructor() {
|
|
149
149
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
@@ -162,18 +162,18 @@ class C extends HTMLElement {
|
|
|
162
162
|
}
|
|
163
163
|
_$E_() {
|
|
164
164
|
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
165
|
-
for (const
|
|
165
|
+
for (const o of e.keys()) this.hasOwnProperty(o) && (t.set(o, this[o]), delete this[o]);
|
|
166
166
|
t.size > 0 && (this._$Ep = t);
|
|
167
167
|
}
|
|
168
168
|
createRenderRoot() {
|
|
169
169
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
170
|
-
return
|
|
170
|
+
return yt(t, this.constructor.elementStyles), t;
|
|
171
171
|
}
|
|
172
172
|
connectedCallback() {
|
|
173
173
|
var t;
|
|
174
174
|
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
|
|
175
|
-
var
|
|
176
|
-
return (
|
|
175
|
+
var o;
|
|
176
|
+
return (o = e.hostConnected) == null ? void 0 : o.call(e);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
enableUpdating(t) {
|
|
@@ -181,38 +181,38 @@ class C extends HTMLElement {
|
|
|
181
181
|
disconnectedCallback() {
|
|
182
182
|
var t;
|
|
183
183
|
(t = this._$EO) == null || t.forEach((e) => {
|
|
184
|
-
var
|
|
185
|
-
return (
|
|
184
|
+
var o;
|
|
185
|
+
return (o = e.hostDisconnected) == null ? void 0 : o.call(e);
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
attributeChangedCallback(t, e,
|
|
189
|
-
this._$AK(t,
|
|
188
|
+
attributeChangedCallback(t, e, o) {
|
|
189
|
+
this._$AK(t, o);
|
|
190
190
|
}
|
|
191
191
|
_$EC(t, e) {
|
|
192
192
|
var n;
|
|
193
|
-
const
|
|
194
|
-
if (
|
|
195
|
-
const
|
|
196
|
-
this._$Em = t,
|
|
193
|
+
const o = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, o);
|
|
194
|
+
if (s !== void 0 && o.reflect === !0) {
|
|
195
|
+
const i = (((n = o.converter) == null ? void 0 : n.toAttribute) !== void 0 ? o.converter : M).toAttribute(e, o.type);
|
|
196
|
+
this._$Em = t, i == null ? this.removeAttribute(s) : this.setAttribute(s, i), this._$Em = null;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
_$AK(t, e) {
|
|
200
200
|
var n;
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
this._$Em =
|
|
201
|
+
const o = this.constructor, s = o._$Eh.get(t);
|
|
202
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
203
|
+
const i = o.getPropertyOptions(s), d = typeof i.converter == "function" ? { fromAttribute: i.converter } : ((n = i.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? i.converter : M;
|
|
204
|
+
this._$Em = s, this[s] = d.fromAttribute(e, i.type), this._$Em = null;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
-
requestUpdate(t, e,
|
|
207
|
+
requestUpdate(t, e, o) {
|
|
208
208
|
if (t !== void 0) {
|
|
209
|
-
if (
|
|
210
|
-
this.P(t, e,
|
|
209
|
+
if (o ?? (o = this.constructor.getPropertyOptions(t)), !(o.hasChanged ?? F)(this[t], e)) return;
|
|
210
|
+
this.P(t, e, o);
|
|
211
211
|
}
|
|
212
212
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
213
213
|
}
|
|
214
|
-
P(t, e,
|
|
215
|
-
this._$AL.has(t) || this._$AL.set(t, e),
|
|
214
|
+
P(t, e, o) {
|
|
215
|
+
this._$AL.has(t) || this._$AL.set(t, e), o.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
|
|
216
216
|
}
|
|
217
217
|
async _$ET() {
|
|
218
218
|
this.isUpdatePending = !0;
|
|
@@ -228,25 +228,25 @@ class C extends HTMLElement {
|
|
|
228
228
|
return this.performUpdate();
|
|
229
229
|
}
|
|
230
230
|
performUpdate() {
|
|
231
|
-
var
|
|
231
|
+
var o;
|
|
232
232
|
if (!this.isUpdatePending) return;
|
|
233
233
|
if (!this.hasUpdated) {
|
|
234
234
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
235
|
-
for (const [n,
|
|
235
|
+
for (const [n, i] of this._$Ep) this[n] = i;
|
|
236
236
|
this._$Ep = void 0;
|
|
237
237
|
}
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
238
|
+
const s = this.constructor.elementProperties;
|
|
239
|
+
if (s.size > 0) for (const [n, i] of s) i.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], i);
|
|
240
240
|
}
|
|
241
241
|
let t = !1;
|
|
242
242
|
const e = this._$AL;
|
|
243
243
|
try {
|
|
244
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (
|
|
244
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (o = this._$EO) == null || o.forEach((s) => {
|
|
245
245
|
var n;
|
|
246
|
-
return (n =
|
|
246
|
+
return (n = s.hostUpdate) == null ? void 0 : n.call(s);
|
|
247
247
|
}), this.update(e)) : this._$EU();
|
|
248
|
-
} catch (
|
|
249
|
-
throw t = !1, this._$EU(),
|
|
248
|
+
} catch (s) {
|
|
249
|
+
throw t = !1, this._$EU(), s;
|
|
250
250
|
}
|
|
251
251
|
t && this._$AE(e);
|
|
252
252
|
}
|
|
@@ -254,9 +254,9 @@ class C extends HTMLElement {
|
|
|
254
254
|
}
|
|
255
255
|
_$AE(t) {
|
|
256
256
|
var e;
|
|
257
|
-
(e = this._$EO) == null || e.forEach((
|
|
258
|
-
var
|
|
259
|
-
return (
|
|
257
|
+
(e = this._$EO) == null || e.forEach((o) => {
|
|
258
|
+
var s;
|
|
259
|
+
return (s = o.hostUpdated) == null ? void 0 : s.call(o);
|
|
260
260
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
261
261
|
}
|
|
262
262
|
_$EU() {
|
|
@@ -279,114 +279,114 @@ class C extends HTMLElement {
|
|
|
279
279
|
firstUpdated(t) {
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[
|
|
282
|
+
C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[R("elementProperties")] = /* @__PURE__ */ new Map(), C[R("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ ReactiveElement: C }), (w.reactiveElementVersions ?? (w.reactiveElementVersions = [])).push("2.0.4");
|
|
283
283
|
/**
|
|
284
284
|
* @license
|
|
285
285
|
* Copyright 2017 Google LLC
|
|
286
286
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
287
287
|
*/
|
|
288
|
-
const wt = { attribute: !0, type: String, converter:
|
|
289
|
-
const { kind:
|
|
290
|
-
let n = globalThis.litPropertyMetadata.get(
|
|
291
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(
|
|
292
|
-
const { name:
|
|
293
|
-
return { set(
|
|
288
|
+
const wt = { attribute: !0, type: String, converter: M, reflect: !1, hasChanged: F }, Et = (r = wt, t, e) => {
|
|
289
|
+
const { kind: o, metadata: s } = e;
|
|
290
|
+
let n = globalThis.litPropertyMetadata.get(s);
|
|
291
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(s, n = /* @__PURE__ */ new Map()), n.set(e.name, r), o === "accessor") {
|
|
292
|
+
const { name: i } = e;
|
|
293
|
+
return { set(d) {
|
|
294
294
|
const a = t.get.call(this);
|
|
295
|
-
t.set.call(this,
|
|
296
|
-
}, init(
|
|
297
|
-
return
|
|
295
|
+
t.set.call(this, d), this.requestUpdate(i, a, r);
|
|
296
|
+
}, init(d) {
|
|
297
|
+
return d !== void 0 && this.P(i, void 0, r), d;
|
|
298
298
|
} };
|
|
299
299
|
}
|
|
300
|
-
if (
|
|
301
|
-
const { name:
|
|
302
|
-
return function(
|
|
303
|
-
const a = this[
|
|
304
|
-
t.call(this,
|
|
300
|
+
if (o === "setter") {
|
|
301
|
+
const { name: i } = e;
|
|
302
|
+
return function(d) {
|
|
303
|
+
const a = this[i];
|
|
304
|
+
t.call(this, d), this.requestUpdate(i, a, r);
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
throw Error("Unsupported decorator location: " +
|
|
307
|
+
throw Error("Unsupported decorator location: " + o);
|
|
308
308
|
};
|
|
309
|
-
function
|
|
310
|
-
return (t, e) => typeof e == "object" ? Et(
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
})(
|
|
309
|
+
function c(r) {
|
|
310
|
+
return (t, e) => typeof e == "object" ? Et(r, t, e) : ((o, s, n) => {
|
|
311
|
+
const i = s.hasOwnProperty(n);
|
|
312
|
+
return s.constructor.createProperty(n, i ? { ...o, wrapped: !0 } : o), i ? Object.getOwnPropertyDescriptor(s, n) : void 0;
|
|
313
|
+
})(r, t, e);
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
316
|
* @license
|
|
317
317
|
* Copyright 2017 Google LLC
|
|
318
318
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
319
319
|
*/
|
|
320
|
-
function St(
|
|
321
|
-
return
|
|
320
|
+
function St(r) {
|
|
321
|
+
return c({ ...r, state: !0, attribute: !1 });
|
|
322
322
|
}
|
|
323
323
|
/**
|
|
324
324
|
* @license
|
|
325
325
|
* Copyright 2017 Google LLC
|
|
326
326
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
327
327
|
*/
|
|
328
|
-
const
|
|
328
|
+
const z = globalThis, T = z.trustedTypes, Y = T ? T.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, at = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, dt = "?" + A, kt = `<${dt}>`, k = document, V = () => k.createComment(""), U = (r) => r === null || typeof r != "object" && typeof r != "function", Z = Array.isArray, xt = (r) => Z(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", L = `[
|
|
329
329
|
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, E = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
|
|
330
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
331
|
-
function ht(
|
|
332
|
-
if (!Z(
|
|
330
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, st = /"/g, lt = /^(?:script|style|textarea|title)$/i, q = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), S = k.createTreeWalker(k, 129);
|
|
331
|
+
function ht(r, t) {
|
|
332
|
+
if (!Z(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
333
333
|
return Y !== void 0 ? Y.createHTML(t) : t;
|
|
334
334
|
}
|
|
335
|
-
const Ct = (
|
|
336
|
-
const e =
|
|
337
|
-
let
|
|
338
|
-
for (let
|
|
339
|
-
const a =
|
|
340
|
-
let
|
|
341
|
-
for (;
|
|
342
|
-
const $ =
|
|
343
|
-
n +=
|
|
344
|
-
}
|
|
345
|
-
return [ht(
|
|
335
|
+
const Ct = (r, t) => {
|
|
336
|
+
const e = r.length - 1, o = [];
|
|
337
|
+
let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", i = P;
|
|
338
|
+
for (let d = 0; d < e; d++) {
|
|
339
|
+
const a = r[d];
|
|
340
|
+
let b, p, h = -1, g = 0;
|
|
341
|
+
for (; g < a.length && (i.lastIndex = g, p = i.exec(a), p !== null); ) g = i.lastIndex, i === P ? p[1] === "!--" ? i = tt : p[1] !== void 0 ? i = et : p[2] !== void 0 ? (lt.test(p[2]) && (s = RegExp("</" + p[2], "g")), i = E) : p[3] !== void 0 && (i = E) : i === E ? p[0] === ">" ? (i = s ?? P, h = -1) : p[1] === void 0 ? h = -2 : (h = i.lastIndex - p[2].length, b = p[1], i = p[3] === void 0 ? E : p[3] === '"' ? st : ot) : i === st || i === ot ? i = E : i === tt || i === et ? i = P : (i = E, s = void 0);
|
|
342
|
+
const $ = i === E && r[d + 1].startsWith("/>") ? " " : "";
|
|
343
|
+
n += i === P ? a + kt : h >= 0 ? (o.push(b), a.slice(0, h) + at + a.slice(h) + A + $) : a + A + (h === -2 ? d : $);
|
|
344
|
+
}
|
|
345
|
+
return [ht(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
|
|
346
346
|
};
|
|
347
|
-
class
|
|
348
|
-
constructor({ strings: t, _$litType$: e },
|
|
349
|
-
let
|
|
347
|
+
class B {
|
|
348
|
+
constructor({ strings: t, _$litType$: e }, o) {
|
|
349
|
+
let s;
|
|
350
350
|
this.parts = [];
|
|
351
|
-
let n = 0,
|
|
352
|
-
const
|
|
353
|
-
if (this.el =
|
|
351
|
+
let n = 0, i = 0;
|
|
352
|
+
const d = t.length - 1, a = this.parts, [b, p] = Ct(t, e);
|
|
353
|
+
if (this.el = B.createElement(b, o), S.currentNode = this.el.content, e === 2 || e === 3) {
|
|
354
354
|
const h = this.el.content.firstChild;
|
|
355
355
|
h.replaceWith(...h.childNodes);
|
|
356
356
|
}
|
|
357
|
-
for (; (
|
|
358
|
-
if (
|
|
359
|
-
if (
|
|
360
|
-
const
|
|
361
|
-
a.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ?
|
|
362
|
-
} else h.startsWith(A) && (a.push({ type: 6, index: n }),
|
|
363
|
-
if (
|
|
364
|
-
const h =
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
for (let $ = 0; $ <
|
|
368
|
-
|
|
357
|
+
for (; (s = S.nextNode()) !== null && a.length < d; ) {
|
|
358
|
+
if (s.nodeType === 1) {
|
|
359
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(at)) {
|
|
360
|
+
const g = p[i++], $ = s.getAttribute(h).split(A), H = /([.?@])?(.*)/.exec(g);
|
|
361
|
+
a.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ? Rt : H[1] === "?" ? zt : H[1] === "@" ? Ut : I }), s.removeAttribute(h);
|
|
362
|
+
} else h.startsWith(A) && (a.push({ type: 6, index: n }), s.removeAttribute(h));
|
|
363
|
+
if (lt.test(s.tagName)) {
|
|
364
|
+
const h = s.textContent.split(A), g = h.length - 1;
|
|
365
|
+
if (g > 0) {
|
|
366
|
+
s.textContent = T ? T.emptyScript : "";
|
|
367
|
+
for (let $ = 0; $ < g; $++) s.append(h[$], V()), S.nextNode(), a.push({ type: 2, index: ++n });
|
|
368
|
+
s.append(h[g], V());
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
} else if (
|
|
371
|
+
} else if (s.nodeType === 8) if (s.data === dt) a.push({ type: 2, index: n });
|
|
372
372
|
else {
|
|
373
373
|
let h = -1;
|
|
374
|
-
for (; (h =
|
|
374
|
+
for (; (h = s.data.indexOf(A, h + 1)) !== -1; ) a.push({ type: 7, index: n }), h += A.length - 1;
|
|
375
375
|
}
|
|
376
376
|
n++;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
static createElement(t, e) {
|
|
380
|
-
const
|
|
381
|
-
return
|
|
380
|
+
const o = k.createElement("template");
|
|
381
|
+
return o.innerHTML = t, o;
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function x(
|
|
385
|
-
var
|
|
386
|
-
if (t ===
|
|
387
|
-
let
|
|
384
|
+
function x(r, t, e = r, o) {
|
|
385
|
+
var i, d;
|
|
386
|
+
if (t === q) return t;
|
|
387
|
+
let s = o !== void 0 ? (i = e._$Co) == null ? void 0 : i[o] : e._$Cl;
|
|
388
388
|
const n = U(t) ? void 0 : t._$litDirective$;
|
|
389
|
-
return (
|
|
389
|
+
return (s == null ? void 0 : s.constructor) !== n && ((d = s == null ? void 0 : s._$AO) == null || d.call(s, !1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, o)), o !== void 0 ? (e._$Co ?? (e._$Co = []))[o] = s : e._$Cl = s), s !== void 0 && (t = x(r, s._$AS(r, t.values), s, o)), t;
|
|
390
390
|
}
|
|
391
391
|
class Pt {
|
|
392
392
|
constructor(t, e) {
|
|
@@ -399,30 +399,30 @@ class Pt {
|
|
|
399
399
|
return this._$AM._$AU;
|
|
400
400
|
}
|
|
401
401
|
u(t) {
|
|
402
|
-
const { el: { content: e }, parts:
|
|
403
|
-
S.currentNode =
|
|
404
|
-
let n = S.nextNode(),
|
|
402
|
+
const { el: { content: e }, parts: o } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? k).importNode(e, !0);
|
|
403
|
+
S.currentNode = s;
|
|
404
|
+
let n = S.nextNode(), i = 0, d = 0, a = o[0];
|
|
405
405
|
for (; a !== void 0; ) {
|
|
406
|
-
if (
|
|
407
|
-
let
|
|
408
|
-
a.type === 2 ?
|
|
406
|
+
if (i === a.index) {
|
|
407
|
+
let b;
|
|
408
|
+
a.type === 2 ? b = new N(n, n.nextSibling, this, t) : a.type === 1 ? b = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (b = new qt(n, this, t)), this._$AV.push(b), a = o[++d];
|
|
409
409
|
}
|
|
410
|
-
|
|
410
|
+
i !== (a == null ? void 0 : a.index) && (n = S.nextNode(), i++);
|
|
411
411
|
}
|
|
412
|
-
return S.currentNode = k,
|
|
412
|
+
return S.currentNode = k, s;
|
|
413
413
|
}
|
|
414
414
|
p(t) {
|
|
415
415
|
let e = 0;
|
|
416
|
-
for (const
|
|
416
|
+
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++;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
class
|
|
419
|
+
class N {
|
|
420
420
|
get _$AU() {
|
|
421
421
|
var t;
|
|
422
422
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
423
423
|
}
|
|
424
|
-
constructor(t, e,
|
|
425
|
-
this.type = 2, this._$AH =
|
|
424
|
+
constructor(t, e, o, s) {
|
|
425
|
+
this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
426
426
|
}
|
|
427
427
|
get parentNode() {
|
|
428
428
|
let t = this._$AA.parentNode;
|
|
@@ -436,7 +436,7 @@ class I {
|
|
|
436
436
|
return this._$AB;
|
|
437
437
|
}
|
|
438
438
|
_$AI(t, e = this) {
|
|
439
|
-
t = x(this, t, e), U(t) ? t ===
|
|
439
|
+
t = x(this, t, e), U(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== q && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
|
|
440
440
|
}
|
|
441
441
|
O(t) {
|
|
442
442
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -445,33 +445,33 @@ class I {
|
|
|
445
445
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
446
446
|
}
|
|
447
447
|
_(t) {
|
|
448
|
-
this._$AH !==
|
|
448
|
+
this._$AH !== u && U(this._$AH) ? this._$AA.nextSibling.data = t : this.T(k.createTextNode(t)), this._$AH = t;
|
|
449
449
|
}
|
|
450
450
|
$(t) {
|
|
451
451
|
var n;
|
|
452
|
-
const { values: e, _$litType$:
|
|
453
|
-
if (((n = this._$AH) == null ? void 0 : n._$AD) ===
|
|
452
|
+
const { values: e, _$litType$: o } = t, s = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = B.createElement(ht(o.h, o.h[0]), this.options)), o);
|
|
453
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === s) this._$AH.p(e);
|
|
454
454
|
else {
|
|
455
|
-
const
|
|
456
|
-
|
|
455
|
+
const i = new Pt(s, this), d = i.u(this.options);
|
|
456
|
+
i.p(e), this.T(d), this._$AH = i;
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
_$AC(t) {
|
|
460
|
-
let e =
|
|
461
|
-
return e === void 0 &&
|
|
460
|
+
let e = rt.get(t.strings);
|
|
461
|
+
return e === void 0 && rt.set(t.strings, e = new B(t)), e;
|
|
462
462
|
}
|
|
463
463
|
k(t) {
|
|
464
464
|
Z(this._$AH) || (this._$AH = [], this._$AR());
|
|
465
465
|
const e = this._$AH;
|
|
466
|
-
let
|
|
467
|
-
for (const n of t)
|
|
468
|
-
|
|
466
|
+
let o, s = 0;
|
|
467
|
+
for (const n of t) s === e.length ? e.push(o = new N(this.O(V()), this.O(V()), this, this.options)) : o = e[s], o._$AI(n), s++;
|
|
468
|
+
s < e.length && (this._$AR(o && o._$AB.nextSibling, s), e.length = s);
|
|
469
469
|
}
|
|
470
470
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
471
|
-
var
|
|
472
|
-
for ((
|
|
473
|
-
const
|
|
474
|
-
t.remove(), t =
|
|
471
|
+
var o;
|
|
472
|
+
for ((o = this._$AP) == null ? void 0 : o.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
473
|
+
const s = t.nextSibling;
|
|
474
|
+
t.remove(), t = s;
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
setConnected(t) {
|
|
@@ -479,64 +479,64 @@ class I {
|
|
|
479
479
|
this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
class
|
|
482
|
+
class I {
|
|
483
483
|
get tagName() {
|
|
484
484
|
return this.element.tagName;
|
|
485
485
|
}
|
|
486
486
|
get _$AU() {
|
|
487
487
|
return this._$AM._$AU;
|
|
488
488
|
}
|
|
489
|
-
constructor(t, e,
|
|
490
|
-
this.type = 1, this._$AH =
|
|
489
|
+
constructor(t, e, o, s, n) {
|
|
490
|
+
this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = u;
|
|
491
491
|
}
|
|
492
|
-
_$AI(t, e = this,
|
|
492
|
+
_$AI(t, e = this, o, s) {
|
|
493
493
|
const n = this.strings;
|
|
494
|
-
let
|
|
495
|
-
if (n === void 0) t = x(this, t, e, 0),
|
|
494
|
+
let i = !1;
|
|
495
|
+
if (n === void 0) t = x(this, t, e, 0), i = !U(t) || t !== this._$AH && t !== q, i && (this._$AH = t);
|
|
496
496
|
else {
|
|
497
|
-
const
|
|
498
|
-
let a,
|
|
499
|
-
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
497
|
+
const d = t;
|
|
498
|
+
let a, b;
|
|
499
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) b = x(this, d[o + a], e, a), b === q && (b = this._$AH[a]), i || (i = !U(b) || b !== this._$AH[a]), b === u ? t = u : t !== u && (t += (b ?? "") + n[a + 1]), this._$AH[a] = b;
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
i && !s && this.j(t);
|
|
502
502
|
}
|
|
503
503
|
j(t) {
|
|
504
|
-
t ===
|
|
504
|
+
t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
class
|
|
507
|
+
class Rt extends I {
|
|
508
508
|
constructor() {
|
|
509
509
|
super(...arguments), this.type = 3;
|
|
510
510
|
}
|
|
511
511
|
j(t) {
|
|
512
|
-
this.element[this.name] = t ===
|
|
512
|
+
this.element[this.name] = t === u ? void 0 : t;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
class
|
|
515
|
+
class zt extends I {
|
|
516
516
|
constructor() {
|
|
517
517
|
super(...arguments), this.type = 4;
|
|
518
518
|
}
|
|
519
519
|
j(t) {
|
|
520
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
520
|
+
this.element.toggleAttribute(this.name, !!t && t !== u);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
class Ut extends
|
|
524
|
-
constructor(t, e,
|
|
525
|
-
super(t, e,
|
|
523
|
+
class Ut extends I {
|
|
524
|
+
constructor(t, e, o, s, n) {
|
|
525
|
+
super(t, e, o, s, n), this.type = 5;
|
|
526
526
|
}
|
|
527
527
|
_$AI(t, e = this) {
|
|
528
|
-
if ((t = x(this, t, e, 0) ??
|
|
529
|
-
const
|
|
530
|
-
|
|
528
|
+
if ((t = x(this, t, e, 0) ?? u) === q) return;
|
|
529
|
+
const o = this._$AH, s = t === u && o !== u || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, n = t !== u && (o === u || s);
|
|
530
|
+
s && this.element.removeEventListener(this.name, this, o), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
531
531
|
}
|
|
532
532
|
handleEvent(t) {
|
|
533
533
|
var e;
|
|
534
534
|
typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
class
|
|
538
|
-
constructor(t, e,
|
|
539
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options =
|
|
537
|
+
class qt {
|
|
538
|
+
constructor(t, e, o) {
|
|
539
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = o;
|
|
540
540
|
}
|
|
541
541
|
get _$AU() {
|
|
542
542
|
return this._$AM._$AU;
|
|
@@ -545,30 +545,26 @@ class Ot {
|
|
|
545
545
|
x(this, t);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
const G =
|
|
549
|
-
G == null || G(
|
|
548
|
+
const G = z.litHtmlPolyfillSupport;
|
|
549
|
+
G == null || G(B, N), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.2.1");
|
|
550
550
|
/**
|
|
551
551
|
* @license
|
|
552
552
|
* Copyright 2018 Google LLC
|
|
553
553
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
554
554
|
*/
|
|
555
|
-
const
|
|
555
|
+
const Bt = (r) => r ?? u, ct = ut`
|
|
556
556
|
:host {
|
|
557
557
|
/* Global Radiobutton Styles */
|
|
558
558
|
--_nys-radiobutton-size: var(--nys-size-400, 32px);
|
|
559
|
-
--_nys-radiobutton-radius: var(--nys-
|
|
559
|
+
--_nys-radiobutton-radius: var(--nys-radius-md, 4px);
|
|
560
560
|
--_nys-radiobutton-width-border: var(--nys-border-width-md, 2px);
|
|
561
561
|
--_nys-radiobutton-color-focus: var(--nys-color-focus, #004dd1);
|
|
562
562
|
--_nys-radiobutton-width-focus: var(--nys-border-width-md, 2px);
|
|
563
|
-
--_nys-radiobutton-offset
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
--_nys-radiogroup-gap: var(
|
|
569
|
-
--nys-space-200,
|
|
570
|
-
16px
|
|
571
|
-
); /* space between radio buttons */
|
|
563
|
+
--_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);
|
|
564
|
+
/* space between radio and it's label */
|
|
565
|
+
--_nys-radiobutton-gap: var(--nys-space-150, 12px);
|
|
566
|
+
/* space between radio buttons */
|
|
567
|
+
--_nys-radiogroup-gap: var(--nys-space-200, 16px);
|
|
572
568
|
|
|
573
569
|
/* Typography */
|
|
574
570
|
--_nys-radiobutton-font-family: var(
|
|
@@ -583,8 +579,11 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
583
579
|
)
|
|
584
580
|
);
|
|
585
581
|
--_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);
|
|
586
|
-
--_nys-radiobutton-font-weight-
|
|
587
|
-
--_nys-radiobutton-font-weight-
|
|
582
|
+
--_nys-radiobutton-font-weight-label: var(--nys-font-weight-regular, 400);
|
|
583
|
+
--_nys-radiobutton-font-weight-description: var(
|
|
584
|
+
--nys-font-weight-regular,
|
|
585
|
+
400
|
|
586
|
+
);
|
|
588
587
|
--_nys-radiobutton-line-height: var(--nys-font-lineheight-ui-md, 24px);
|
|
589
588
|
|
|
590
589
|
/* Global Radio Button Colors */
|
|
@@ -650,18 +649,86 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
650
649
|
/* Small Variant */
|
|
651
650
|
:host([size="sm"]) {
|
|
652
651
|
--_nys-radiobutton-size: var(--nys-size-300, 24px);
|
|
653
|
-
--_nys-radiobutton-radius: var(--nys-
|
|
652
|
+
--_nys-radiobutton-radius: var(--nys-radius-sm, 2px);
|
|
654
653
|
--_nys-radiogroup-gap: var(--nys-space-100, 8px);
|
|
655
654
|
--_nys-radiobutton-gap: var(--nys-space-100, 8px);
|
|
656
655
|
}
|
|
657
656
|
/* Medium Variant */
|
|
658
657
|
:host([size="md"]) {
|
|
659
658
|
--_nys-radiobutton-size: var(--nys-size-400, 32px);
|
|
660
|
-
--_nys-radiobutton-radius: var(--nys-
|
|
659
|
+
--_nys-radiobutton-radius: var(--nys-radius-md, 4px);
|
|
661
660
|
--_nys-radiogroup-gap: var(--nys-space-200, 16px);
|
|
662
661
|
--_nys-radiobutton-gap: var(--nys-space-150, 12px);
|
|
663
662
|
}
|
|
664
663
|
|
|
664
|
+
/* Tile Variant */
|
|
665
|
+
:host([tile]) {
|
|
666
|
+
--_nys-radiobutton-font-weight-label: var(--nys-font-weight-semibold, 600);
|
|
667
|
+
--_nys-radiobutton-tile-border-width: var(--nys-border-width-sm, 1px);
|
|
668
|
+
--_nys-radiobutton-tile-border-radius: var(--nys-radius-md, 4px);
|
|
669
|
+
--_nys-radiobutton-tile-border-color: var(--nys-color-neutral-100, #d0d0ce);
|
|
670
|
+
--_nys-radiobutton-tile-bg-color: var(--nys-color-ink-reverse, #ffffff);
|
|
671
|
+
--_nys-radiobutton-tile-padding-x: var(--nys-space-250, 20px);
|
|
672
|
+
--_nys-radiobutton-tile-padding-y: var(--nys-space-200, 16px);
|
|
673
|
+
/* Hover */
|
|
674
|
+
--_nys-radiobutton-hover-tile-border-color: var(
|
|
675
|
+
--nys-color-neutral-700,
|
|
676
|
+
#4a4d4f
|
|
677
|
+
);
|
|
678
|
+
--_nys-radiobutton-hover-tile-bg-color: var(
|
|
679
|
+
--nys-color-ink-reverse,
|
|
680
|
+
#ffffff
|
|
681
|
+
);
|
|
682
|
+
/* Pressed */
|
|
683
|
+
--_nys-radiobutton-pressed-tile-border-color: var(
|
|
684
|
+
--nys-color-neutral-900,
|
|
685
|
+
#1b1b1b
|
|
686
|
+
);
|
|
687
|
+
--_nys-radiobutton-pressed-tile-bg-color: var(
|
|
688
|
+
--nys-color-ink-reverse,
|
|
689
|
+
#ffffff
|
|
690
|
+
);
|
|
691
|
+
/* Checked */
|
|
692
|
+
--_nys-radiobutton-checked-tile-border-color: var(
|
|
693
|
+
--nys-color-theme-mid,
|
|
694
|
+
#457aa5
|
|
695
|
+
);
|
|
696
|
+
--_nys-radiobutton-checked-tile-bg-color: var(
|
|
697
|
+
--nys-color-theme-faint,
|
|
698
|
+
#f7fafd
|
|
699
|
+
);
|
|
700
|
+
/* Disabled */
|
|
701
|
+
--_nys-radiobutton-disabled-tile-bg-color: var(
|
|
702
|
+
--nys-color-ink-reverse,
|
|
703
|
+
#f0f0f0
|
|
704
|
+
);
|
|
705
|
+
--_nys-radiobutton-disabled-tile-border-color: var(
|
|
706
|
+
--nys-color-neutral-100,
|
|
707
|
+
#d0d0ce
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
:host([tile][size="sm"]) {
|
|
712
|
+
--_nys-radiobutton-tile-padding-x: var(--nys-space-200, 16px);
|
|
713
|
+
--_nys-radiobutton-tile-padding-y: var(--nys-space-150, 12px);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
:host([tile][showError]) {
|
|
717
|
+
--_nys-radiobutton-tile-border-color: var(--nys-color-danger, #b52c2c);
|
|
718
|
+
--_nys-radiobutton-hover-tile-border-color: var(
|
|
719
|
+
--nys-color-danger,
|
|
720
|
+
#b52c2c
|
|
721
|
+
);
|
|
722
|
+
--_nys-radiobutton-pressed-tile-border-color: var(
|
|
723
|
+
--nys-color-danger,
|
|
724
|
+
#b52c2c
|
|
725
|
+
);
|
|
726
|
+
--_nys-radiobutton-checked-tile-border-color: var(
|
|
727
|
+
--nys-color-danger,
|
|
728
|
+
#b52c2c
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
|
|
665
732
|
.nys-radiogroup {
|
|
666
733
|
display: flex;
|
|
667
734
|
flex-direction: column;
|
|
@@ -683,6 +750,14 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
683
750
|
font-family: var(--_nys-radiobutton-font-family);
|
|
684
751
|
font-size: var(--_nys-radiobutton-font-size);
|
|
685
752
|
line-height: var(--_nys-radiobutton-line-height);
|
|
753
|
+
|
|
754
|
+
/* Tile */
|
|
755
|
+
border-radius: var(--_nys-radiobutton-tile-border-radius);
|
|
756
|
+
border: var(--_nys-radiobutton-tile-border-width) solid
|
|
757
|
+
var(--_nys-radiobutton-tile-border-color);
|
|
758
|
+
background: var(--_nys-radiobutton-tile-bg-color);
|
|
759
|
+
padding: var(--_nys-radiobutton-tile-padding-y)
|
|
760
|
+
var(--_nys-radiobutton-tile-padding-x);
|
|
686
761
|
}
|
|
687
762
|
|
|
688
763
|
.nys-radiobutton__radio {
|
|
@@ -700,10 +775,13 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
700
775
|
background-repeat: no-repeat;
|
|
701
776
|
background-position: center;
|
|
702
777
|
background-size: contain;
|
|
778
|
+
outline-offset: var(--_nys-radiobutton-outline-offset);
|
|
779
|
+
outline: none;
|
|
703
780
|
margin: 0 0 auto 0; /* Causes centered radio button if single line of label but top aligned if multiline */
|
|
704
781
|
}
|
|
705
782
|
|
|
706
783
|
/* Pointer cursor for unchecked radio button */
|
|
784
|
+
.nys-radiobutton:hover,
|
|
707
785
|
.nys-radiobutton:hover * {
|
|
708
786
|
cursor: pointer;
|
|
709
787
|
}
|
|
@@ -713,6 +791,15 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
713
791
|
background-image: url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="11" cy="11" r="11" stroke="white" stroke-width="6"/></svg>');
|
|
714
792
|
background-color: var(--_nys-radiobutton-checked-color-bg);
|
|
715
793
|
}
|
|
794
|
+
:host([tile])
|
|
795
|
+
.nys-radiobutton:has(.nys-radiobutton__radio:not(:disabled):checked) {
|
|
796
|
+
border-color: var(--_nys-radiobutton-checked-tile-border-color);
|
|
797
|
+
background-color: var(--_nys-radiobutton-checked-tile-bg-color);
|
|
798
|
+
}
|
|
799
|
+
:host([tile])
|
|
800
|
+
.nys-radiobutton:has(.nys-radiobutton__radio:not(:disabled):checked:hover) {
|
|
801
|
+
cursor: default;
|
|
802
|
+
}
|
|
716
803
|
|
|
717
804
|
/* Checked + Disabled */
|
|
718
805
|
.nys-radiobutton__radio:disabled:checked {
|
|
@@ -720,6 +807,10 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
720
807
|
border-color: var(--_nys-radiobutton-disabled-checked-color-border);
|
|
721
808
|
background-color: var(--_nys-radiobutton-disabled-checked-color-bg);
|
|
722
809
|
}
|
|
810
|
+
:host([tile]) .nys-radiobutton:has(.nys-radiobutton__radio:disabled:checked) {
|
|
811
|
+
border-color: var(--_nys-radiobutton-disabled-tile-border-color);
|
|
812
|
+
background-color: var(--_nys-radiobutton-disabled-tile-bg-color);
|
|
813
|
+
}
|
|
723
814
|
|
|
724
815
|
/* Disabled */
|
|
725
816
|
.nys-radiobutton__radio:disabled {
|
|
@@ -727,24 +818,51 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
727
818
|
border-color: var(--_nys-radiobutton-disabled-color-border);
|
|
728
819
|
cursor: not-allowed;
|
|
729
820
|
}
|
|
821
|
+
:host([tile]) .nys-radiobutton:has(.nys-radiobutton__radio:disabled) {
|
|
822
|
+
background-color: var(--_nys-radiobutton-disabled-color-bg);
|
|
823
|
+
border-color: var(--_nys-radiobutton-disabled-color-border);
|
|
824
|
+
cursor: not-allowed;
|
|
825
|
+
}
|
|
730
826
|
|
|
731
827
|
/* Hover - only allow hover on unchecked */
|
|
732
828
|
.nys-radiobutton__radio:hover:not(:disabled):not(:checked) {
|
|
733
829
|
border-color: var(--_nys-radiobutton-hover-color-border);
|
|
734
830
|
background-color: var(--_nys-radiobutton-hover-color-bg);
|
|
735
831
|
}
|
|
832
|
+
:host([tile])
|
|
833
|
+
.nys-radiobutton:has(
|
|
834
|
+
.nys-radiobutton__radio:hover:not(:disabled):not(:checked)
|
|
835
|
+
) {
|
|
836
|
+
border-color: var(--_nys-radiobutton-hover-tile-border-color);
|
|
837
|
+
background-color: var(--_nys-radiobutton-hover-tile-bg-color);
|
|
838
|
+
outline: solid var(--_nys-radiobutton-tile-border-width)
|
|
839
|
+
var(--_nys-radiobutton-hover-tile-border-color);
|
|
840
|
+
}
|
|
736
841
|
|
|
737
842
|
/* Pressed - only allow pressed on unchecked */
|
|
738
843
|
.nys-radiobutton__radio:active:not(:disabled):not(:checked) {
|
|
739
844
|
border-color: var(--_nys-radiobutton-pressed-color-border);
|
|
740
845
|
background-color: var(--_nys-radiobutton-pressed-color-bg);
|
|
741
846
|
}
|
|
847
|
+
:host([tile])
|
|
848
|
+
.nys-radiobutton:has(
|
|
849
|
+
.nys-radiobutton__radio:active:not(:disabled):not(:checked)
|
|
850
|
+
) {
|
|
851
|
+
border-color: var(--_nys-radiobutton-pressed-tile-border-color);
|
|
852
|
+
background-color: var(--_nys-radiobutton-pressed-tile-bg-color);
|
|
853
|
+
outline: solid var(--_nys-radiobutton-tile-border-width)
|
|
854
|
+
var(--_nys-radiobutton-pressed-tile-border-color);
|
|
855
|
+
}
|
|
742
856
|
|
|
743
857
|
/* Focused */
|
|
744
|
-
.nys-radiobutton__radio:focus {
|
|
858
|
+
:host(:not([tile])) .nys-radiobutton__radio:focus-visible {
|
|
745
859
|
outline: solid var(--_nys-radiobutton-width-focus)
|
|
746
860
|
var(--_nys-radiobutton-color-focus);
|
|
747
|
-
|
|
861
|
+
}
|
|
862
|
+
:host([tile]) .nys-radiobutton:has(*:focus-visible) {
|
|
863
|
+
outline: solid var(--_nys-radiobutton-tile-border-width)
|
|
864
|
+
var(--_nys-radiobutton-color-focus) !important;
|
|
865
|
+
border-color: var(--_nys-radiobutton-color-focus) !important;
|
|
748
866
|
}
|
|
749
867
|
|
|
750
868
|
/* Radiobutton Label Holder */
|
|
@@ -756,16 +874,19 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
756
874
|
|
|
757
875
|
/* Label styling */
|
|
758
876
|
.nys-radiobutton__label {
|
|
759
|
-
font-weight: var(--_nys-radiobutton-font-weight-
|
|
877
|
+
font-weight: var(--_nys-radiobutton-font-weight-label);
|
|
760
878
|
color: var(--_nys-radiobutton-color-text);
|
|
761
879
|
}
|
|
762
880
|
|
|
763
881
|
/* Description styling */
|
|
764
882
|
.nys-radiobutton__description {
|
|
765
|
-
font-weight: var(--_nys-radiobutton-font-weight-
|
|
883
|
+
font-weight: var(--_nys-radiobutton-font-weight-description);
|
|
766
884
|
font-style: italic;
|
|
767
885
|
text-align: left;
|
|
768
886
|
}
|
|
887
|
+
:host([tile]) .nys-radiobutton__description {
|
|
888
|
+
font-style: normal;
|
|
889
|
+
}
|
|
769
890
|
|
|
770
891
|
/* gap between radio and it's label */
|
|
771
892
|
.nys-radiobutton__label,
|
|
@@ -784,38 +905,38 @@ const qt = (o) => o ?? c, ct = ut`
|
|
|
784
905
|
cursor: not-allowed;
|
|
785
906
|
}
|
|
786
907
|
`;
|
|
787
|
-
var Ht = Object.defineProperty,
|
|
788
|
-
for (var
|
|
789
|
-
(
|
|
790
|
-
return
|
|
908
|
+
var Ht = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, _ = (r, t, e, o) => {
|
|
909
|
+
for (var s = o > 1 ? void 0 : o ? Ot(t, e) : t, n = r.length - 1, i; n >= 0; n--)
|
|
910
|
+
(i = r[n]) && (s = (o ? i(t, e, s) : i(s)) || s);
|
|
911
|
+
return o && s && Ht(t, e, s), s;
|
|
791
912
|
};
|
|
792
|
-
let
|
|
793
|
-
var
|
|
794
|
-
const
|
|
913
|
+
let Mt = 0;
|
|
914
|
+
var m;
|
|
915
|
+
const y = (m = class extends it {
|
|
795
916
|
// allows use of elementInternals' API
|
|
796
917
|
constructor() {
|
|
797
|
-
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.selectedValue = null, this._size = "md", this._internals = this.attachInternals();
|
|
918
|
+
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.selectedValue = null, this._size = "md", this.tile = !1, this._internals = this.attachInternals();
|
|
798
919
|
}
|
|
799
920
|
get size() {
|
|
800
921
|
return this._size;
|
|
801
922
|
}
|
|
802
923
|
set size(t) {
|
|
803
|
-
this._size =
|
|
924
|
+
this._size = m.VALID_SIZES.includes(
|
|
804
925
|
t
|
|
805
926
|
) ? t : "md";
|
|
806
927
|
}
|
|
807
928
|
// Generate a unique ID if one is not provided
|
|
808
929
|
connectedCallback() {
|
|
809
|
-
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${
|
|
930
|
+
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${Mt++}`), this.addEventListener("change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid);
|
|
810
931
|
}
|
|
811
932
|
disconnectedCallback() {
|
|
812
933
|
super.disconnectedCallback(), this.removeEventListener("change", this._handleRadioButtonChange), this.removeEventListener("invalid", this._handleInvalid);
|
|
813
934
|
}
|
|
814
935
|
firstUpdated() {
|
|
815
|
-
this._initializeCheckedRadioValue(), this._setValue(), this.setRadioButtonRequire();
|
|
936
|
+
this._initializeCheckedRadioValue(), this._setValue(), this.setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError();
|
|
816
937
|
}
|
|
817
938
|
updated(t) {
|
|
818
|
-
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize();
|
|
939
|
+
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("showError") && this._updateRadioButtonsShowError();
|
|
819
940
|
}
|
|
820
941
|
// This callback is automatically called when the parent form is reset.
|
|
821
942
|
formResetCallback() {
|
|
@@ -829,17 +950,17 @@ const b = (g = class extends rt {
|
|
|
829
950
|
}
|
|
830
951
|
// Updates the "require" attribute of the first radiobutton underneath a radiogroup to ensure requirement for all radiobutton under the same name/group
|
|
831
952
|
setRadioButtonRequire() {
|
|
832
|
-
this.querySelectorAll("nys-radiobutton").forEach((e,
|
|
833
|
-
this.required &&
|
|
953
|
+
this.querySelectorAll("nys-radiobutton").forEach((e, o) => {
|
|
954
|
+
this.required && o === 0 && e.setAttribute("required", "required");
|
|
834
955
|
});
|
|
835
956
|
}
|
|
836
957
|
async _manageRequire() {
|
|
837
|
-
const t = this.errorMessage || "Please select an option.", e = this.querySelector("nys-radiobutton"),
|
|
838
|
-
|
|
958
|
+
const t = this.errorMessage || "Please select an option.", e = this.querySelector("nys-radiobutton"), o = e ? await e.getInputElement() : null;
|
|
959
|
+
o && (this.required && !this.selectedValue ? this._internals.setValidity(
|
|
839
960
|
{ valueMissing: !0 },
|
|
840
961
|
t,
|
|
841
|
-
|
|
842
|
-
) : (this.showError = !1, this._internals.setValidity({}, "",
|
|
962
|
+
o
|
|
963
|
+
) : (this.showError = !1, this._internals.setValidity({}, "", o)));
|
|
843
964
|
}
|
|
844
965
|
// Need to account for if radiogroup already have a radiobutton checked at initialization
|
|
845
966
|
_initializeCheckedRadioValue() {
|
|
@@ -853,24 +974,34 @@ const b = (g = class extends rt {
|
|
|
853
974
|
e.setAttribute("size", this.size);
|
|
854
975
|
});
|
|
855
976
|
}
|
|
977
|
+
_updateRadioButtonsTile() {
|
|
978
|
+
this.querySelectorAll("nys-radiobutton").forEach((e) => {
|
|
979
|
+
this.tile ? e.toggleAttribute("tile", !0) : e.removeAttribute("tile");
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
_updateRadioButtonsShowError() {
|
|
983
|
+
this.querySelectorAll("nys-radiobutton").forEach((e) => {
|
|
984
|
+
this.showError ? e.setAttribute("showError", "") : e.removeAttribute("showError");
|
|
985
|
+
});
|
|
986
|
+
}
|
|
856
987
|
// Keeps radiogroup informed of the name and value of its current selected radiobutton at each change
|
|
857
988
|
_handleRadioButtonChange(t) {
|
|
858
|
-
const e = t, { name:
|
|
859
|
-
this.name =
|
|
989
|
+
const e = t, { name: o, value: s } = e.detail;
|
|
990
|
+
this.name = o, this.selectedValue = s, this._internals.setFormValue(this.selectedValue);
|
|
860
991
|
}
|
|
861
992
|
async _handleInvalid(t) {
|
|
862
993
|
if (t.preventDefault(), this._internals.validity.valueMissing) {
|
|
863
994
|
this.showError = !0, this._manageRequire();
|
|
864
|
-
const e = this.querySelector("nys-radiobutton"),
|
|
865
|
-
if (
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
if (
|
|
869
|
-
if (!
|
|
870
|
-
return
|
|
995
|
+
const e = this.querySelector("nys-radiobutton"), o = e ? await e.getInputElement() : null;
|
|
996
|
+
if (o) {
|
|
997
|
+
const s = this._internals.form;
|
|
998
|
+
s ? Array.from(s.elements).find((d) => {
|
|
999
|
+
if (d.tagName.toLowerCase() === "nys-radiogroup") {
|
|
1000
|
+
if (!d.querySelector("nys-radiobutton").checkValidity())
|
|
1001
|
+
return d;
|
|
871
1002
|
} else
|
|
872
|
-
return typeof
|
|
873
|
-
}) === this &&
|
|
1003
|
+
return typeof d.checkValidity == "function" && !d.checkValidity();
|
|
1004
|
+
}) === this && o.focus() : o.focus();
|
|
874
1005
|
}
|
|
875
1006
|
}
|
|
876
1007
|
}
|
|
@@ -895,59 +1026,62 @@ const b = (g = class extends rt {
|
|
|
895
1026
|
<nys-errormessage
|
|
896
1027
|
?showError=${this.showError}
|
|
897
1028
|
errorMessage=${this._internals.validationMessage || this.errorMessage}
|
|
898
|
-
showDivider
|
|
1029
|
+
.showDivider=${!this.tile}
|
|
899
1030
|
></nys-errormessage>
|
|
900
1031
|
</div>`;
|
|
901
1032
|
}
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
],
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
],
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
],
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
],
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
],
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
],
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
],
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
],
|
|
927
|
-
|
|
1033
|
+
}, m.VALID_SIZES = ["sm", "md"], m.styles = ct, m.formAssociated = !0, m);
|
|
1034
|
+
_([
|
|
1035
|
+
c({ type: String })
|
|
1036
|
+
], y.prototype, "id", 2);
|
|
1037
|
+
_([
|
|
1038
|
+
c({ type: String, reflect: !0 })
|
|
1039
|
+
], y.prototype, "name", 2);
|
|
1040
|
+
_([
|
|
1041
|
+
c({ type: Boolean, reflect: !0 })
|
|
1042
|
+
], y.prototype, "required", 2);
|
|
1043
|
+
_([
|
|
1044
|
+
c({ type: Boolean, reflect: !0 })
|
|
1045
|
+
], y.prototype, "optional", 2);
|
|
1046
|
+
_([
|
|
1047
|
+
c({ type: Boolean, reflect: !0 })
|
|
1048
|
+
], y.prototype, "showError", 2);
|
|
1049
|
+
_([
|
|
1050
|
+
c({ type: String })
|
|
1051
|
+
], y.prototype, "errorMessage", 2);
|
|
1052
|
+
_([
|
|
1053
|
+
c({ type: String })
|
|
1054
|
+
], y.prototype, "label", 2);
|
|
1055
|
+
_([
|
|
1056
|
+
c({ type: String })
|
|
1057
|
+
], y.prototype, "description", 2);
|
|
1058
|
+
_([
|
|
928
1059
|
St()
|
|
929
|
-
],
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
],
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1060
|
+
], y.prototype, "selectedValue", 2);
|
|
1061
|
+
_([
|
|
1062
|
+
c({ reflect: !0 })
|
|
1063
|
+
], y.prototype, "size", 1);
|
|
1064
|
+
_([
|
|
1065
|
+
c({ type: Boolean, reflect: !0 })
|
|
1066
|
+
], y.prototype, "tile", 2);
|
|
1067
|
+
let Tt = y;
|
|
1068
|
+
customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", Tt);
|
|
1069
|
+
var Vt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, v = (r, t, e, o) => {
|
|
1070
|
+
for (var s = o > 1 ? void 0 : o ? Nt(t, e) : t, n = r.length - 1, i; n >= 0; n--)
|
|
1071
|
+
(i = r[n]) && (s = (o ? i(t, e, s) : i(s)) || s);
|
|
1072
|
+
return o && s && Vt(t, e, s), s;
|
|
939
1073
|
};
|
|
940
|
-
let
|
|
941
|
-
var
|
|
942
|
-
const
|
|
1074
|
+
let It = 0;
|
|
1075
|
+
var l;
|
|
1076
|
+
const f = (l = class extends it {
|
|
943
1077
|
constructor() {
|
|
944
|
-
super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this._size = "md";
|
|
1078
|
+
super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this._size = "md", this.tile = !1;
|
|
945
1079
|
}
|
|
946
1080
|
get size() {
|
|
947
1081
|
return this._size;
|
|
948
1082
|
}
|
|
949
1083
|
set size(t) {
|
|
950
|
-
this._size =
|
|
1084
|
+
this._size = l.VALID_SIZES.includes(
|
|
951
1085
|
t
|
|
952
1086
|
) ? t : "md";
|
|
953
1087
|
}
|
|
@@ -962,10 +1096,10 @@ const _ = (d = class extends rt {
|
|
|
962
1096
|
/********************** Lifecycle updates **********************/
|
|
963
1097
|
// Generate a unique ID if one is not provided
|
|
964
1098
|
connectedCallback() {
|
|
965
|
-
super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${
|
|
1099
|
+
super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${It++}`), this.checked && (l.buttonGroup[this.name] && (l.buttonGroup[this.name].checked = !1, l.buttonGroup[this.name].requestUpdate()), l.buttonGroup[this.name] = this);
|
|
966
1100
|
}
|
|
967
1101
|
updated(t) {
|
|
968
|
-
t.has("checked") && this.checked &&
|
|
1102
|
+
t.has("checked") && this.checked && l.buttonGroup[this.name] !== this && (l.buttonGroup[this.name] && (l.buttonGroup[this.name].checked = !1, l.buttonGroup[this.name].requestUpdate()), l.buttonGroup[this.name] = this);
|
|
969
1103
|
}
|
|
970
1104
|
/******************** Function ********************/
|
|
971
1105
|
// This helper function is called to perform the element's native validation.
|
|
@@ -979,7 +1113,7 @@ const _ = (d = class extends rt {
|
|
|
979
1113
|
/******************** Event Handlers ********************/
|
|
980
1114
|
// Handle radiobutton change event & unselection of other options in group
|
|
981
1115
|
_handleChange() {
|
|
982
|
-
this.checked || (
|
|
1116
|
+
this.checked || (l.buttonGroup[this.name] && (l.buttonGroup[this.name].checked = !1, l.buttonGroup[this.name].requestUpdate()), l.buttonGroup[this.name] = this, this.checked = !0, this.dispatchEvent(
|
|
983
1117
|
new CustomEvent("change", {
|
|
984
1118
|
detail: { checked: this.checked, name: this.name, value: this.value },
|
|
985
1119
|
bubbles: !0,
|
|
@@ -997,7 +1131,7 @@ const _ = (d = class extends rt {
|
|
|
997
1131
|
}
|
|
998
1132
|
// Handle keydown for keyboard accessibility
|
|
999
1133
|
_handleKeydown(t) {
|
|
1000
|
-
t.code === "Space" && (t.preventDefault(), !this.disabled && !this.checked && (
|
|
1134
|
+
t.code === "Space" && (t.preventDefault(), !this.disabled && !this.checked && (l.buttonGroup[this.name] && (l.buttonGroup[this.name].checked = !1, l.buttonGroup[this.name].requestUpdate()), l.buttonGroup[this.name] = this, this.checked = !0, this.dispatchEvent(
|
|
1001
1135
|
new CustomEvent("change", {
|
|
1002
1136
|
detail: {
|
|
1003
1137
|
checked: this.checked,
|
|
@@ -1016,7 +1150,7 @@ const _ = (d = class extends rt {
|
|
|
1016
1150
|
id="${this.id}"
|
|
1017
1151
|
class="nys-radiobutton__radio"
|
|
1018
1152
|
type="radio"
|
|
1019
|
-
name="${
|
|
1153
|
+
name="${Bt(this.name ? this.name : void 0)}"
|
|
1020
1154
|
.checked=${this.checked}
|
|
1021
1155
|
?disabled=${this.disabled}
|
|
1022
1156
|
.value=${this.value}
|
|
@@ -1040,38 +1174,41 @@ const _ = (d = class extends rt {
|
|
|
1040
1174
|
</label>
|
|
1041
1175
|
`;
|
|
1042
1176
|
}
|
|
1043
|
-
},
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
],
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
],
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
],
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
],
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
],
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
],
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
],
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
],
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
],
|
|
1071
|
-
|
|
1177
|
+
}, l.VALID_SIZES = ["sm", "md"], l.buttonGroup = {}, l.styles = ct, l);
|
|
1178
|
+
v([
|
|
1179
|
+
c({ type: Boolean, reflect: !0 })
|
|
1180
|
+
], f.prototype, "checked", 2);
|
|
1181
|
+
v([
|
|
1182
|
+
c({ type: Boolean, reflect: !0 })
|
|
1183
|
+
], f.prototype, "disabled", 2);
|
|
1184
|
+
v([
|
|
1185
|
+
c({ type: Boolean, reflect: !0 })
|
|
1186
|
+
], f.prototype, "required", 2);
|
|
1187
|
+
v([
|
|
1188
|
+
c({ type: String })
|
|
1189
|
+
], f.prototype, "label", 2);
|
|
1190
|
+
v([
|
|
1191
|
+
c({ type: String })
|
|
1192
|
+
], f.prototype, "description", 2);
|
|
1193
|
+
v([
|
|
1194
|
+
c({ type: String })
|
|
1195
|
+
], f.prototype, "id", 2);
|
|
1196
|
+
v([
|
|
1197
|
+
c({ type: String, reflect: !0 })
|
|
1198
|
+
], f.prototype, "name", 2);
|
|
1199
|
+
v([
|
|
1200
|
+
c({ type: String })
|
|
1201
|
+
], f.prototype, "value", 2);
|
|
1202
|
+
v([
|
|
1203
|
+
c({ reflect: !0 })
|
|
1204
|
+
], f.prototype, "size", 1);
|
|
1205
|
+
v([
|
|
1206
|
+
c({ type: Boolean, reflect: !0 })
|
|
1207
|
+
], f.prototype, "tile", 2);
|
|
1208
|
+
let Dt = f;
|
|
1072
1209
|
customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", Dt);
|
|
1073
1210
|
export {
|
|
1074
1211
|
Dt as NysRadiobutton,
|
|
1075
|
-
|
|
1212
|
+
Tt as NysRadiogroup
|
|
1076
1213
|
};
|
|
1077
1214
|
//# sourceMappingURL=nys-radiobutton.js.map
|