@nysds/nys-radiobutton 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nys-radiobutton.d.ts +1 -0
- package/dist/nys-radiobutton.js +309 -293
- package/dist/nys-radiobutton.js.map +1 -1
- package/dist/nys-radiogroup.d.ts +3 -0
- package/package.json +6 -5
package/dist/nys-radiobutton.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css as
|
|
1
|
+
import { css as bt, LitElement as nt, html as j } from "lit";
|
|
2
2
|
/*!
|
|
3
3
|
* ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
|
|
4
4
|
* ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
|
|
@@ -14,10 +14,10 @@ import { css as pt, LitElement as rt, html as j } from "lit";
|
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
18
|
-
let
|
|
17
|
+
const O = globalThis, F = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), K = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
let yt = class {
|
|
19
19
|
constructor(t, e, o) {
|
|
20
|
-
if (this._$cssResult$ = !0, o !==
|
|
20
|
+
if (this._$cssResult$ = !0, o !== at) 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() {
|
|
@@ -33,26 +33,26 @@ let bt = class {
|
|
|
33
33
|
return this.cssText;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const _t = (r) => new yt(typeof r == "string" ? r : r + "", void 0, at), ft = (r, t) => {
|
|
37
37
|
if (F) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
|
38
38
|
else for (const e of t) {
|
|
39
|
-
const o = document.createElement("style"),
|
|
40
|
-
|
|
39
|
+
const o = document.createElement("style"), i = O.litNonce;
|
|
40
|
+
i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText, r.appendChild(o);
|
|
41
41
|
}
|
|
42
42
|
}, J = F ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
43
43
|
let e = "";
|
|
44
44
|
for (const o of t.cssRules) e += o.cssText;
|
|
45
|
-
return
|
|
45
|
+
return _t(e);
|
|
46
46
|
})(r) : r;
|
|
47
47
|
/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
51
|
*/
|
|
52
|
-
const { is:
|
|
52
|
+
const { is: vt, defineProperty: gt, getOwnPropertyDescriptor: mt, getOwnPropertyNames: $t, getOwnPropertySymbols: At, getPrototypeOf: wt } = Object, w = globalThis, Y = w.trustedTypes, kt = Y ? Y.emptyScript : "", N = w.reactiveElementPolyfillSupport, P = (r, t) => r, H = { toAttribute(r, t) {
|
|
53
53
|
switch (t) {
|
|
54
54
|
case Boolean:
|
|
55
|
-
r = r ?
|
|
55
|
+
r = r ? kt : null;
|
|
56
56
|
break;
|
|
57
57
|
case Object:
|
|
58
58
|
case Array:
|
|
@@ -77,7 +77,7 @@ const { is: ft, defineProperty: vt, getOwnPropertyDescriptor: gt, getOwnProperty
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
return e;
|
|
80
|
-
} }, W = (r, t) => !
|
|
80
|
+
} }, W = (r, t) => !vt(r, t), Q = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: W };
|
|
81
81
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), w.litPropertyMetadata ?? (w.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
82
82
|
class C extends HTMLElement {
|
|
83
83
|
static addInitializer(t) {
|
|
@@ -88,21 +88,21 @@ class C extends HTMLElement {
|
|
|
88
88
|
}
|
|
89
89
|
static createProperty(t, e = Q) {
|
|
90
90
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
91
|
-
const o = Symbol(),
|
|
92
|
-
|
|
91
|
+
const o = Symbol(), i = this.getPropertyDescriptor(t, o, e);
|
|
92
|
+
i !== void 0 && gt(this.prototype, t, i);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
static getPropertyDescriptor(t, e, o) {
|
|
96
|
-
const { get:
|
|
96
|
+
const { get: i, set: n } = mt(this.prototype, t) ?? { get() {
|
|
97
97
|
return this[e];
|
|
98
|
-
}, set(
|
|
99
|
-
this[e] =
|
|
98
|
+
}, set(s) {
|
|
99
|
+
this[e] = s;
|
|
100
100
|
} };
|
|
101
101
|
return { get() {
|
|
102
|
-
return
|
|
103
|
-
}, set(
|
|
104
|
-
const d =
|
|
105
|
-
n.call(this,
|
|
102
|
+
return i == null ? void 0 : i.call(this);
|
|
103
|
+
}, set(s) {
|
|
104
|
+
const d = i == null ? void 0 : i.call(this);
|
|
105
|
+
n.call(this, s), this.requestUpdate(t, d, o);
|
|
106
106
|
}, configurable: !0, enumerable: !0 };
|
|
107
107
|
}
|
|
108
108
|
static getPropertyOptions(t) {
|
|
@@ -110,24 +110,24 @@ class C extends HTMLElement {
|
|
|
110
110
|
}
|
|
111
111
|
static _$Ei() {
|
|
112
112
|
if (this.hasOwnProperty(P("elementProperties"))) return;
|
|
113
|
-
const t =
|
|
113
|
+
const t = wt(this);
|
|
114
114
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
115
115
|
}
|
|
116
116
|
static finalize() {
|
|
117
117
|
if (this.hasOwnProperty(P("finalized"))) return;
|
|
118
118
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
|
|
119
|
-
const e = this.properties, o = [
|
|
120
|
-
for (const
|
|
119
|
+
const e = this.properties, o = [...$t(e), ...At(e)];
|
|
120
|
+
for (const i of o) this.createProperty(i, e[i]);
|
|
121
121
|
}
|
|
122
122
|
const t = this[Symbol.metadata];
|
|
123
123
|
if (t !== null) {
|
|
124
124
|
const e = litPropertyMetadata.get(t);
|
|
125
|
-
if (e !== void 0) for (const [o,
|
|
125
|
+
if (e !== void 0) for (const [o, i] of e) this.elementProperties.set(o, i);
|
|
126
126
|
}
|
|
127
127
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
128
128
|
for (const [e, o] of this.elementProperties) {
|
|
129
|
-
const
|
|
130
|
-
|
|
129
|
+
const i = this._$Eu(e, o);
|
|
130
|
+
i !== void 0 && this._$Eh.set(i, e);
|
|
131
131
|
}
|
|
132
132
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
133
133
|
}
|
|
@@ -135,7 +135,7 @@ class C extends HTMLElement {
|
|
|
135
135
|
const e = [];
|
|
136
136
|
if (Array.isArray(t)) {
|
|
137
137
|
const o = new Set(t.flat(1 / 0).reverse());
|
|
138
|
-
for (const
|
|
138
|
+
for (const i of o) e.unshift(J(i));
|
|
139
139
|
} else t !== void 0 && e.push(J(t));
|
|
140
140
|
return e;
|
|
141
141
|
}
|
|
@@ -165,7 +165,7 @@ class C extends HTMLElement {
|
|
|
165
165
|
}
|
|
166
166
|
createRenderRoot() {
|
|
167
167
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
168
|
-
return
|
|
168
|
+
return ft(t, this.constructor.elementStyles), t;
|
|
169
169
|
}
|
|
170
170
|
connectedCallback() {
|
|
171
171
|
var t;
|
|
@@ -188,18 +188,18 @@ class C extends HTMLElement {
|
|
|
188
188
|
}
|
|
189
189
|
_$EC(t, e) {
|
|
190
190
|
var n;
|
|
191
|
-
const o = this.constructor.elementProperties.get(t),
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
this._$Em = t,
|
|
191
|
+
const o = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, o);
|
|
192
|
+
if (i !== void 0 && o.reflect === !0) {
|
|
193
|
+
const s = (((n = o.converter) == null ? void 0 : n.toAttribute) !== void 0 ? o.converter : H).toAttribute(e, o.type);
|
|
194
|
+
this._$Em = t, s == null ? this.removeAttribute(i) : this.setAttribute(i, s), this._$Em = null;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
_$AK(t, e) {
|
|
198
198
|
var n;
|
|
199
|
-
const o = this.constructor,
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
this._$Em =
|
|
199
|
+
const o = this.constructor, i = o._$Eh.get(t);
|
|
200
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
201
|
+
const s = o.getPropertyOptions(i), d = typeof s.converter == "function" ? { fromAttribute: s.converter } : ((n = s.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? s.converter : H;
|
|
202
|
+
this._$Em = i, this[i] = d.fromAttribute(e, s.type), this._$Em = null;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
requestUpdate(t, e, o) {
|
|
@@ -230,21 +230,21 @@ class C extends HTMLElement {
|
|
|
230
230
|
if (!this.isUpdatePending) return;
|
|
231
231
|
if (!this.hasUpdated) {
|
|
232
232
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
233
|
-
for (const [n,
|
|
233
|
+
for (const [n, s] of this._$Ep) this[n] = s;
|
|
234
234
|
this._$Ep = void 0;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
236
|
+
const i = this.constructor.elementProperties;
|
|
237
|
+
if (i.size > 0) for (const [n, s] of i) s.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], s);
|
|
238
238
|
}
|
|
239
239
|
let t = !1;
|
|
240
240
|
const e = this._$AL;
|
|
241
241
|
try {
|
|
242
|
-
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (o = this._$EO) == null || o.forEach((
|
|
242
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (o = this._$EO) == null || o.forEach((i) => {
|
|
243
243
|
var n;
|
|
244
|
-
return (n =
|
|
244
|
+
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
|
|
245
245
|
}), this.update(e)) : this._$EU();
|
|
246
|
-
} catch (
|
|
247
|
-
throw t = !1, this._$EU(),
|
|
246
|
+
} catch (i) {
|
|
247
|
+
throw t = !1, this._$EU(), i;
|
|
248
248
|
}
|
|
249
249
|
t && this._$AE(e);
|
|
250
250
|
}
|
|
@@ -253,8 +253,8 @@ class C extends HTMLElement {
|
|
|
253
253
|
_$AE(t) {
|
|
254
254
|
var e;
|
|
255
255
|
(e = this._$EO) == null || e.forEach((o) => {
|
|
256
|
-
var
|
|
257
|
-
return (
|
|
256
|
+
var i;
|
|
257
|
+
return (i = o.hostUpdated) == null ? void 0 : i.call(o);
|
|
258
258
|
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
259
259
|
}
|
|
260
260
|
_$EU() {
|
|
@@ -283,31 +283,31 @@ C.elementStyles = [], C.shadowRootOptions = { mode: "open" }, C[P("elementProper
|
|
|
283
283
|
* Copyright 2017 Google LLC
|
|
284
284
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
285
285
|
*/
|
|
286
|
-
const Et = { attribute: !0, type: String, converter:
|
|
287
|
-
const { kind: o, metadata:
|
|
288
|
-
let n = globalThis.litPropertyMetadata.get(
|
|
289
|
-
if (n === void 0 && globalThis.litPropertyMetadata.set(
|
|
290
|
-
const { name:
|
|
286
|
+
const Et = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: W }, St = (r = Et, t, e) => {
|
|
287
|
+
const { kind: o, metadata: i } = e;
|
|
288
|
+
let n = globalThis.litPropertyMetadata.get(i);
|
|
289
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), n.set(e.name, r), o === "accessor") {
|
|
290
|
+
const { name: s } = e;
|
|
291
291
|
return { set(d) {
|
|
292
292
|
const a = t.get.call(this);
|
|
293
|
-
t.set.call(this, d), this.requestUpdate(
|
|
293
|
+
t.set.call(this, d), this.requestUpdate(s, a, r);
|
|
294
294
|
}, init(d) {
|
|
295
|
-
return d !== void 0 && this.P(
|
|
295
|
+
return d !== void 0 && this.P(s, void 0, r), d;
|
|
296
296
|
} };
|
|
297
297
|
}
|
|
298
298
|
if (o === "setter") {
|
|
299
|
-
const { name:
|
|
299
|
+
const { name: s } = e;
|
|
300
300
|
return function(d) {
|
|
301
|
-
const a = this[
|
|
302
|
-
t.call(this, d), this.requestUpdate(
|
|
301
|
+
const a = this[s];
|
|
302
|
+
t.call(this, d), this.requestUpdate(s, a, r);
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
305
|
throw Error("Unsupported decorator location: " + o);
|
|
306
306
|
};
|
|
307
|
-
function
|
|
308
|
-
return (t, e) => typeof e == "object" ?
|
|
309
|
-
const
|
|
310
|
-
return
|
|
307
|
+
function c(r) {
|
|
308
|
+
return (t, e) => typeof e == "object" ? St(r, t, e) : ((o, i, n) => {
|
|
309
|
+
const s = i.hasOwnProperty(n);
|
|
310
|
+
return i.constructor.createProperty(n, s ? { ...o, wrapped: !0 } : o), s ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
311
311
|
})(r, t, e);
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
@@ -315,61 +315,61 @@ function u(r) {
|
|
|
315
315
|
* Copyright 2017 Google LLC
|
|
316
316
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
317
317
|
*/
|
|
318
|
-
function
|
|
319
|
-
return
|
|
318
|
+
function dt(r) {
|
|
319
|
+
return c({ ...r, state: !0, attribute: !1 });
|
|
320
320
|
}
|
|
321
321
|
/**
|
|
322
322
|
* @license
|
|
323
323
|
* Copyright 2017 Google LLC
|
|
324
324
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
325
325
|
*/
|
|
326
|
-
const z = globalThis, D = z.trustedTypes, X = D ? D.createPolicy("lit-html", { createHTML: (r) => r }) : void 0,
|
|
327
|
-
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g,
|
|
328
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g,
|
|
329
|
-
function
|
|
326
|
+
const z = globalThis, D = z.trustedTypes, X = D ? D.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, lt = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, ct = "?" + A, xt = `<${ct}>`, S = document, M = () => S.createComment(""), U = (r) => r === null || typeof r != "object" && typeof r != "function", Z = Array.isArray, Ct = (r) => Z(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", V = `[
|
|
327
|
+
\f\r]`, R = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, k = RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^
|
|
328
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, it = /"/g, ht = /^(?:script|style|textarea|title)$/i, B = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), E = S.createTreeWalker(S, 129);
|
|
329
|
+
function ut(r, t) {
|
|
330
330
|
if (!Z(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
331
331
|
return X !== void 0 ? X.createHTML(t) : t;
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const Rt = (r, t) => {
|
|
334
334
|
const e = r.length - 1, o = [];
|
|
335
|
-
let
|
|
335
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", s = R;
|
|
336
336
|
for (let d = 0; d < e; d++) {
|
|
337
337
|
const a = r[d];
|
|
338
|
-
let
|
|
339
|
-
for (; g < a.length && (
|
|
340
|
-
const $ =
|
|
341
|
-
n +=
|
|
338
|
+
let h, b, l = -1, g = 0;
|
|
339
|
+
for (; g < a.length && (s.lastIndex = g, b = s.exec(a), b !== null); ) g = s.lastIndex, s === R ? b[1] === "!--" ? s = tt : b[1] !== void 0 ? s = et : b[2] !== void 0 ? (ht.test(b[2]) && (i = RegExp("</" + b[2], "g")), s = k) : b[3] !== void 0 && (s = k) : s === k ? b[0] === ">" ? (s = i ?? R, l = -1) : b[1] === void 0 ? l = -2 : (l = s.lastIndex - b[2].length, h = b[1], s = b[3] === void 0 ? k : b[3] === '"' ? it : ot) : s === it || s === ot ? s = k : s === tt || s === et ? s = R : (s = k, i = void 0);
|
|
340
|
+
const $ = s === k && r[d + 1].startsWith("/>") ? " " : "";
|
|
341
|
+
n += s === R ? a + xt : l >= 0 ? (o.push(h), a.slice(0, l) + lt + a.slice(l) + A + $) : a + A + (l === -2 ? d : $);
|
|
342
342
|
}
|
|
343
|
-
return [
|
|
343
|
+
return [ut(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), o];
|
|
344
344
|
};
|
|
345
|
-
class
|
|
345
|
+
class T {
|
|
346
346
|
constructor({ strings: t, _$litType$: e }, o) {
|
|
347
|
-
let
|
|
347
|
+
let i;
|
|
348
348
|
this.parts = [];
|
|
349
|
-
let n = 0,
|
|
350
|
-
const d = t.length - 1, a = this.parts, [
|
|
351
|
-
if (this.el =
|
|
349
|
+
let n = 0, s = 0;
|
|
350
|
+
const d = t.length - 1, a = this.parts, [h, b] = Rt(t, e);
|
|
351
|
+
if (this.el = T.createElement(h, o), E.currentNode = this.el.content, e === 2 || e === 3) {
|
|
352
352
|
const l = this.el.content.firstChild;
|
|
353
353
|
l.replaceWith(...l.childNodes);
|
|
354
354
|
}
|
|
355
|
-
for (; (
|
|
356
|
-
if (
|
|
357
|
-
if (
|
|
358
|
-
const g = b[
|
|
359
|
-
a.push({ type: 1, index: n, name: q[2], strings: $, ctor: q[1] === "." ?
|
|
360
|
-
} else l.startsWith(A) && (a.push({ type: 6, index: n }),
|
|
361
|
-
if (
|
|
362
|
-
const l =
|
|
355
|
+
for (; (i = E.nextNode()) !== null && a.length < d; ) {
|
|
356
|
+
if (i.nodeType === 1) {
|
|
357
|
+
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(lt)) {
|
|
358
|
+
const g = b[s++], $ = i.getAttribute(l).split(A), q = /([.?@])?(.*)/.exec(g);
|
|
359
|
+
a.push({ type: 1, index: n, name: q[2], strings: $, ctor: q[1] === "." ? zt : q[1] === "?" ? Ut : q[1] === "@" ? Bt : L }), i.removeAttribute(l);
|
|
360
|
+
} else l.startsWith(A) && (a.push({ type: 6, index: n }), i.removeAttribute(l));
|
|
361
|
+
if (ht.test(i.tagName)) {
|
|
362
|
+
const l = i.textContent.split(A), g = l.length - 1;
|
|
363
363
|
if (g > 0) {
|
|
364
|
-
|
|
365
|
-
for (let $ = 0; $ < g; $++)
|
|
366
|
-
|
|
364
|
+
i.textContent = D ? D.emptyScript : "";
|
|
365
|
+
for (let $ = 0; $ < g; $++) i.append(l[$], M()), E.nextNode(), a.push({ type: 2, index: ++n });
|
|
366
|
+
i.append(l[g], M());
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
} else if (
|
|
369
|
+
} else if (i.nodeType === 8) if (i.data === ct) a.push({ type: 2, index: n });
|
|
370
370
|
else {
|
|
371
371
|
let l = -1;
|
|
372
|
-
for (; (l =
|
|
372
|
+
for (; (l = i.data.indexOf(A, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += A.length - 1;
|
|
373
373
|
}
|
|
374
374
|
n++;
|
|
375
375
|
}
|
|
@@ -380,13 +380,13 @@ class B {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
function x(r, t, e = r, o) {
|
|
383
|
-
var
|
|
384
|
-
if (t ===
|
|
385
|
-
let
|
|
383
|
+
var s, d;
|
|
384
|
+
if (t === B) return t;
|
|
385
|
+
let i = o !== void 0 ? (s = e._$Co) == null ? void 0 : s[o] : e._$Cl;
|
|
386
386
|
const n = U(t) ? void 0 : t._$litDirective$;
|
|
387
|
-
return (
|
|
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;
|
|
388
388
|
}
|
|
389
|
-
class
|
|
389
|
+
class Pt {
|
|
390
390
|
constructor(t, e) {
|
|
391
391
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
392
392
|
}
|
|
@@ -397,17 +397,17 @@ class Rt {
|
|
|
397
397
|
return this._$AM._$AU;
|
|
398
398
|
}
|
|
399
399
|
u(t) {
|
|
400
|
-
const { el: { content: e }, parts: o } = this._$AD,
|
|
401
|
-
|
|
402
|
-
let n =
|
|
400
|
+
const { el: { content: e }, parts: o } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? S).importNode(e, !0);
|
|
401
|
+
E.currentNode = i;
|
|
402
|
+
let n = E.nextNode(), s = 0, d = 0, a = o[0];
|
|
403
403
|
for (; a !== void 0; ) {
|
|
404
|
-
if (
|
|
405
|
-
let
|
|
406
|
-
a.type === 2 ?
|
|
404
|
+
if (s === a.index) {
|
|
405
|
+
let h;
|
|
406
|
+
a.type === 2 ? h = new I(n, n.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (h = new Tt(n, this, t)), this._$AV.push(h), a = o[++d];
|
|
407
407
|
}
|
|
408
|
-
|
|
408
|
+
s !== (a == null ? void 0 : a.index) && (n = E.nextNode(), s++);
|
|
409
409
|
}
|
|
410
|
-
return
|
|
410
|
+
return E.currentNode = S, i;
|
|
411
411
|
}
|
|
412
412
|
p(t) {
|
|
413
413
|
let e = 0;
|
|
@@ -419,8 +419,8 @@ class I {
|
|
|
419
419
|
var t;
|
|
420
420
|
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
421
421
|
}
|
|
422
|
-
constructor(t, e, o,
|
|
423
|
-
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = o, this.options =
|
|
422
|
+
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 = (i == null ? void 0 : i.isConnected) ?? !0;
|
|
424
424
|
}
|
|
425
425
|
get parentNode() {
|
|
426
426
|
let t = this._$AA.parentNode;
|
|
@@ -434,7 +434,7 @@ class I {
|
|
|
434
434
|
return this._$AB;
|
|
435
435
|
}
|
|
436
436
|
_$AI(t, e = this) {
|
|
437
|
-
t = x(this, t, e), U(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !==
|
|
437
|
+
t = x(this, t, e), U(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== B && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ct(t) ? this.k(t) : this._(t);
|
|
438
438
|
}
|
|
439
439
|
O(t) {
|
|
440
440
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -447,29 +447,29 @@ class I {
|
|
|
447
447
|
}
|
|
448
448
|
$(t) {
|
|
449
449
|
var n;
|
|
450
|
-
const { values: e, _$litType$: o } = t,
|
|
451
|
-
if (((n = this._$AH) == null ? void 0 : n._$AD) ===
|
|
450
|
+
const { values: e, _$litType$: o } = t, i = typeof o == "number" ? this._$AC(t) : (o.el === void 0 && (o.el = T.createElement(ut(o.h, o.h[0]), this.options)), o);
|
|
451
|
+
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
|
|
452
452
|
else {
|
|
453
|
-
const
|
|
454
|
-
|
|
453
|
+
const s = new Pt(i, this), d = s.u(this.options);
|
|
454
|
+
s.p(e), this.T(d), this._$AH = s;
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
_$AC(t) {
|
|
458
|
-
let e =
|
|
459
|
-
return e === void 0 &&
|
|
458
|
+
let e = st.get(t.strings);
|
|
459
|
+
return e === void 0 && st.set(t.strings, e = new T(t)), e;
|
|
460
460
|
}
|
|
461
461
|
k(t) {
|
|
462
462
|
Z(this._$AH) || (this._$AH = [], this._$AR());
|
|
463
463
|
const e = this._$AH;
|
|
464
|
-
let o,
|
|
465
|
-
for (const n of t)
|
|
466
|
-
|
|
464
|
+
let o, i = 0;
|
|
465
|
+
for (const n of t) i === e.length ? e.push(o = new I(this.O(M()), this.O(M()), this, this.options)) : o = e[i], o._$AI(n), i++;
|
|
466
|
+
i < e.length && (this._$AR(o && o._$AB.nextSibling, i), e.length = i);
|
|
467
467
|
}
|
|
468
468
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
469
469
|
var o;
|
|
470
470
|
for ((o = this._$AP) == null ? void 0 : o.call(this, !1, !0, e); t && t !== this._$AB; ) {
|
|
471
|
-
const
|
|
472
|
-
t.remove(), t =
|
|
471
|
+
const i = t.nextSibling;
|
|
472
|
+
t.remove(), t = i;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
setConnected(t) {
|
|
@@ -484,25 +484,25 @@ class L {
|
|
|
484
484
|
get _$AU() {
|
|
485
485
|
return this._$AM._$AU;
|
|
486
486
|
}
|
|
487
|
-
constructor(t, e, o,
|
|
488
|
-
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM =
|
|
487
|
+
constructor(t, e, o, i, n) {
|
|
488
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, o.length > 2 || o[0] !== "" || o[1] !== "" ? (this._$AH = Array(o.length - 1).fill(new String()), this.strings = o) : this._$AH = p;
|
|
489
489
|
}
|
|
490
|
-
_$AI(t, e = this, o,
|
|
490
|
+
_$AI(t, e = this, o, i) {
|
|
491
491
|
const n = this.strings;
|
|
492
|
-
let
|
|
493
|
-
if (n === void 0) t = x(this, t, e, 0),
|
|
492
|
+
let s = !1;
|
|
493
|
+
if (n === void 0) t = x(this, t, e, 0), s = !U(t) || t !== this._$AH && t !== B, s && (this._$AH = t);
|
|
494
494
|
else {
|
|
495
495
|
const d = t;
|
|
496
|
-
let a,
|
|
497
|
-
for (t = n[0], a = 0; a < n.length - 1; a++)
|
|
496
|
+
let a, h;
|
|
497
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) h = x(this, d[o + a], e, a), h === B && (h = this._$AH[a]), s || (s = !U(h) || h !== this._$AH[a]), h === p ? t = p : t !== p && (t += (h ?? "") + n[a + 1]), this._$AH[a] = h;
|
|
498
498
|
}
|
|
499
|
-
|
|
499
|
+
s && !i && this.j(t);
|
|
500
500
|
}
|
|
501
501
|
j(t) {
|
|
502
502
|
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
class
|
|
505
|
+
class zt extends L {
|
|
506
506
|
constructor() {
|
|
507
507
|
super(...arguments), this.type = 3;
|
|
508
508
|
}
|
|
@@ -510,7 +510,7 @@ class Pt extends L {
|
|
|
510
510
|
this.element[this.name] = t === p ? void 0 : t;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
class
|
|
513
|
+
class Ut extends L {
|
|
514
514
|
constructor() {
|
|
515
515
|
super(...arguments), this.type = 4;
|
|
516
516
|
}
|
|
@@ -518,14 +518,14 @@ class zt extends L {
|
|
|
518
518
|
this.element.toggleAttribute(this.name, !!t && t !== p);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
class
|
|
522
|
-
constructor(t, e, o,
|
|
523
|
-
super(t, e, o,
|
|
521
|
+
class Bt extends L {
|
|
522
|
+
constructor(t, e, o, i, n) {
|
|
523
|
+
super(t, e, o, i, n), this.type = 5;
|
|
524
524
|
}
|
|
525
525
|
_$AI(t, e = this) {
|
|
526
|
-
if ((t = x(this, t, e, 0) ?? p) ===
|
|
527
|
-
const o = this._$AH,
|
|
528
|
-
|
|
526
|
+
if ((t = x(this, t, e, 0) ?? p) === B) return;
|
|
527
|
+
const o = this._$AH, i = t === p && o !== p || t.capture !== o.capture || t.once !== o.once || t.passive !== o.passive, n = t !== p && (o === p || i);
|
|
528
|
+
i && this.element.removeEventListener(this.name, this, o), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
529
529
|
}
|
|
530
530
|
handleEvent(t) {
|
|
531
531
|
var e;
|
|
@@ -544,20 +544,20 @@ class Tt {
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
const G = z.litHtmlPolyfillSupport;
|
|
547
|
-
G == null || G(
|
|
547
|
+
G == null || G(T, I), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.2.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
550
550
|
* Copyright 2018 Google LLC
|
|
551
551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
552
552
|
*/
|
|
553
|
-
const
|
|
553
|
+
const rt = (r) => r ?? p, pt = bt`
|
|
554
554
|
:host {
|
|
555
555
|
/* Global Radiobutton Styles */
|
|
556
556
|
--_nys-radiobutton-size: var(--nys-size-400, 32px);
|
|
557
|
-
--_nys-radiobutton-radius: var(--nys-radius-md, 4px);
|
|
558
|
-
--_nys-radiobutton-width
|
|
559
|
-
--_nys-radiobutton-color
|
|
560
|
-
--_nys-radiobutton-width
|
|
557
|
+
--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);
|
|
558
|
+
--_nys-radiobutton-border-width: var(--nys-border-width-md, 2px);
|
|
559
|
+
--_nys-radiobutton-outline-color: var(--nys-color-focus, #004dd1);
|
|
560
|
+
--_nys-radiobutton-outline-width: var(--nys-border-width-md, 2px);
|
|
561
561
|
--_nys-radiobutton-outline-offset: var(--nys-space-2px, 2px);
|
|
562
562
|
/* space between radio and it's label */
|
|
563
563
|
--_nys-radiobutton-gap: var(--nys-space-150, 12px);
|
|
@@ -577,8 +577,8 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
577
577
|
)
|
|
578
578
|
);
|
|
579
579
|
--_nys-radiobutton-font-size: var(--nys-font-size-ui-md, 16px);
|
|
580
|
-
--_nys-radiobutton-font-weight
|
|
581
|
-
--_nys-radiobutton-font-weight
|
|
580
|
+
--_nys-radiobutton-font-weight--label: var(--nys-font-weight-regular, 400);
|
|
581
|
+
--_nys-radiobutton-font-weight--description: var(
|
|
582
582
|
--nys-font-weight-regular,
|
|
583
583
|
400
|
|
584
584
|
);
|
|
@@ -586,59 +586,46 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
586
586
|
|
|
587
587
|
/* Global Radio Button Colors */
|
|
588
588
|
--_nys-radiobutton-color: var(
|
|
589
|
-
--nys-color-ink,
|
|
590
|
-
var(--nys-color-neutral-900, #1b1b1b)
|
|
591
|
-
);
|
|
592
|
-
--_nys-radiobutton-color-text: var(
|
|
593
589
|
--nys-color-text,
|
|
594
590
|
var(--nys-color-neutral-900, #1b1b1b)
|
|
595
591
|
);
|
|
596
592
|
|
|
597
593
|
/* Default (Empty) */
|
|
598
|
-
--_nys-radiobutton-color
|
|
599
|
-
--_nys-radiobutton-color
|
|
594
|
+
--_nys-radiobutton-background-color: var(--nys-color-ink-reverse, #ffffff);
|
|
595
|
+
--_nys-radiobutton-border-color: var(--nys-color-neutral-600, #62666a);
|
|
600
596
|
/* Empty + Hovered */
|
|
601
|
-
--_nys-radiobutton-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
--_nys-radiobutton-pressed-color-bg: var(--nys-color-neutral-100, #d0d0ce);
|
|
605
|
-
--_nys-radiobutton-pressed-color-border: var(--nys-color-ink, #1b1b1b);
|
|
606
|
-
/* Checked */
|
|
607
|
-
--_nys-radiobutton-checked-color-bg: var(--nys-color-theme, #154973);
|
|
608
|
-
/* Checked + Hovered */
|
|
609
|
-
--_nys-radiobutton-checked-hover-color-bg: var(
|
|
610
|
-
--nys-color-theme-strong,
|
|
611
|
-
var(--nys-color-state-blue-800, #0e324f)
|
|
612
|
-
);
|
|
613
|
-
--_nys-radiobutton-checked-hover-color-border: var(
|
|
614
|
-
--nys-color-ink,
|
|
615
|
-
#1b1b1b
|
|
597
|
+
--_nys-radiobutton-background-color--hover: var(
|
|
598
|
+
--nys-color-neutral-50,
|
|
599
|
+
#ededed
|
|
616
600
|
);
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
601
|
+
--_nys-radiobutton-border-color--hover: var(--nys-color-ink, #1b1b1b);
|
|
602
|
+
/* Empty + Pressed */
|
|
603
|
+
--_nys-radiobutton-background-color--active: var(
|
|
604
|
+
--nys-color-neutral-100,
|
|
605
|
+
#d0d0ce
|
|
621
606
|
);
|
|
622
|
-
--_nys-radiobutton-
|
|
623
|
-
|
|
624
|
-
|
|
607
|
+
--_nys-radiobutton-border-color--active: var(--nys-color-ink, #1b1b1b);
|
|
608
|
+
/* Checked */
|
|
609
|
+
--_nys-radiobutton-background-color--checked: var(
|
|
610
|
+
--nys-color-theme,
|
|
611
|
+
#154973
|
|
625
612
|
);
|
|
626
613
|
/* Disabled */
|
|
627
|
-
--_nys-radiobutton-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var(--nys-color-neutral-200, #bec0c1)
|
|
614
|
+
--_nys-radiobutton-background-color--disabled: var(
|
|
615
|
+
--nys-color-ink-reverse,
|
|
616
|
+
#f0f0f0
|
|
631
617
|
);
|
|
632
|
-
--_nys-radiobutton-disabled-color-
|
|
618
|
+
--_nys-radiobutton-color--disabled: var(--nys-color-text-disabled, #bec0c1);
|
|
619
|
+
--_nys-radiobutton-border-color--disabled: var(
|
|
633
620
|
--nys-color-neutral-100,
|
|
634
621
|
#d0d0ce
|
|
635
622
|
);
|
|
636
623
|
/* Disabled Checked */
|
|
637
|
-
--_nys-radiobutton-
|
|
624
|
+
--_nys-radiobutton-background-color--checked--disabled: var(
|
|
638
625
|
--nys-color-neutral-100,
|
|
639
626
|
#d0d0ce
|
|
640
627
|
);
|
|
641
|
-
--_nys-radiobutton-
|
|
628
|
+
--_nys-radiobutton-border-color--checked--disabled: var(
|
|
642
629
|
--nys-color-neutral-100,
|
|
643
630
|
#d0d0ce
|
|
644
631
|
);
|
|
@@ -647,81 +634,87 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
647
634
|
/* Small Variant */
|
|
648
635
|
:host([size="sm"]) {
|
|
649
636
|
--_nys-radiobutton-size: var(--nys-size-300, 24px);
|
|
650
|
-
--_nys-radiobutton-radius: var(--nys-radius-sm, 2px);
|
|
637
|
+
--_nys-radiobutton-border-radius: var(--nys-radius-sm, 2px);
|
|
651
638
|
--_nys-radiogroup-gap: var(--nys-space-100, 8px);
|
|
652
639
|
--_nys-radiobutton-gap: var(--nys-space-100, 8px);
|
|
653
640
|
}
|
|
654
641
|
/* Medium Variant */
|
|
655
642
|
:host([size="md"]) {
|
|
656
643
|
--_nys-radiobutton-size: var(--nys-size-400, 32px);
|
|
657
|
-
--_nys-radiobutton-radius: var(--nys-radius-md, 4px);
|
|
644
|
+
--_nys-radiobutton-border-radius: var(--nys-radius-md, 4px);
|
|
658
645
|
--_nys-radiogroup-gap: var(--nys-space-200, 16px);
|
|
659
646
|
--_nys-radiobutton-gap: var(--nys-space-150, 12px);
|
|
660
647
|
}
|
|
661
648
|
|
|
662
649
|
/* Tile Variant */
|
|
663
650
|
:host([tile]) {
|
|
664
|
-
--_nys-radiobutton-font-weight
|
|
665
|
-
--_nys-radiobutton-
|
|
666
|
-
--_nys-radiobutton-
|
|
667
|
-
--_nys-radiobutton-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
651
|
+
--_nys-radiobutton-font-weight--label: var(--nys-font-weight-semibold, 600);
|
|
652
|
+
--_nys-radiobutton-border-width--tile: var(--nys-border-width-sm, 1px);
|
|
653
|
+
--_nys-radiobutton-border-radius--tile: var(--nys-radius-md, 4px);
|
|
654
|
+
--_nys-radiobutton-border-color--tile: var(
|
|
655
|
+
--nys-color-neutral-100,
|
|
656
|
+
#d0d0ce
|
|
657
|
+
);
|
|
658
|
+
--_nys-radiobutton-background-color--tile: var(
|
|
659
|
+
--nys-color-ink-reverse,
|
|
660
|
+
#ffffff
|
|
661
|
+
);
|
|
662
|
+
--_nys-radiobutton-padding--x--tile: var(--nys-space-250, 20px);
|
|
663
|
+
--_nys-radiobutton-padding--y--tile: var(--nys-space-200, 16px);
|
|
671
664
|
/* Hover */
|
|
672
|
-
--_nys-radiobutton-
|
|
665
|
+
--_nys-radiobutton-border-color--tile--hover: var(
|
|
673
666
|
--nys-color-neutral-700,
|
|
674
667
|
#4a4d4f
|
|
675
668
|
);
|
|
676
|
-
--_nys-radiobutton-
|
|
669
|
+
--_nys-radiobutton-background-color--tile--hover: var(
|
|
677
670
|
--nys-color-ink-reverse,
|
|
678
671
|
#ffffff
|
|
679
672
|
);
|
|
680
673
|
/* Pressed */
|
|
681
|
-
--_nys-radiobutton-
|
|
674
|
+
--_nys-radiobutton-border-color--tile--active: var(
|
|
682
675
|
--nys-color-neutral-900,
|
|
683
676
|
#1b1b1b
|
|
684
677
|
);
|
|
685
|
-
--_nys-radiobutton-
|
|
678
|
+
--_nys-radiobutton-background-color--tile--active: var(
|
|
686
679
|
--nys-color-ink-reverse,
|
|
687
680
|
#ffffff
|
|
688
681
|
);
|
|
689
682
|
/* Checked */
|
|
690
|
-
--_nys-radiobutton-
|
|
683
|
+
--_nys-radiobutton-border-color--tile--checked: var(
|
|
691
684
|
--nys-color-theme-mid,
|
|
692
685
|
#457aa5
|
|
693
686
|
);
|
|
694
|
-
--_nys-radiobutton-
|
|
687
|
+
--_nys-radiobutton-background-color--tile--checked: var(
|
|
695
688
|
--nys-color-theme-faint,
|
|
696
689
|
#f7fafd
|
|
697
690
|
);
|
|
698
691
|
/* Disabled */
|
|
699
|
-
--_nys-radiobutton-
|
|
692
|
+
--_nys-radiobutton-border-color--tile--disabled: var(
|
|
700
693
|
--nys-color-ink-reverse,
|
|
701
694
|
#f0f0f0
|
|
702
695
|
);
|
|
703
|
-
--_nys-radiobutton-
|
|
696
|
+
--_nys-radiobutton-background-color--tile--disabled: var(
|
|
704
697
|
--nys-color-neutral-100,
|
|
705
698
|
#d0d0ce
|
|
706
699
|
);
|
|
707
700
|
}
|
|
708
701
|
|
|
709
702
|
:host([tile][size="sm"]) {
|
|
710
|
-
--_nys-radiobutton-
|
|
711
|
-
--_nys-radiobutton-
|
|
703
|
+
--_nys-radiobutton-padding--x--tile: var(--nys-space-200, 16px);
|
|
704
|
+
--_nys-radiobutton-padding--y--tile: var(--nys-space-150, 12px);
|
|
712
705
|
}
|
|
713
706
|
|
|
714
707
|
:host([tile][showError]) {
|
|
715
|
-
--_nys-radiobutton-
|
|
716
|
-
--_nys-radiobutton-
|
|
708
|
+
--_nys-radiobutton-border-color--tile: var(--nys-color-danger, #b52c2c);
|
|
709
|
+
--_nys-radiobutton-border-color--tile--hover: var(
|
|
717
710
|
--nys-color-danger,
|
|
718
711
|
#b52c2c
|
|
719
712
|
);
|
|
720
|
-
--_nys-radiobutton-
|
|
713
|
+
--_nys-radiobutton-border-color--tile--active: var(
|
|
721
714
|
--nys-color-danger,
|
|
722
715
|
#b52c2c
|
|
723
716
|
);
|
|
724
|
-
--_nys-radiobutton-
|
|
717
|
+
--_nys-radiobutton-border-color--tile--checked: var(
|
|
725
718
|
--nys-color-danger,
|
|
726
719
|
#b52c2c
|
|
727
720
|
);
|
|
@@ -750,12 +743,12 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
750
743
|
line-height: var(--_nys-radiobutton-line-height);
|
|
751
744
|
|
|
752
745
|
/* Tile */
|
|
753
|
-
border-radius: var(--_nys-radiobutton-
|
|
754
|
-
border: var(--_nys-radiobutton-
|
|
755
|
-
var(--_nys-radiobutton-
|
|
756
|
-
background: var(--_nys-radiobutton-
|
|
757
|
-
padding: var(--_nys-radiobutton-
|
|
758
|
-
var(--_nys-radiobutton-
|
|
746
|
+
border-radius: var(--_nys-radiobutton-border-radius--tile);
|
|
747
|
+
border: var(--_nys-radiobutton-border-width--tile) solid
|
|
748
|
+
var(--_nys-radiobutton-border-color--tile);
|
|
749
|
+
background-color: var(--_nys-radiobutton-background-color--tile);
|
|
750
|
+
padding: var(--_nys-radiobutton-padding--y--tile)
|
|
751
|
+
var(--_nys-radiobutton-padding--x--tile);
|
|
759
752
|
}
|
|
760
753
|
|
|
761
754
|
.nys-radiobutton__radio {
|
|
@@ -766,9 +759,9 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
766
759
|
min-height: var(--_nys-radiobutton-size);
|
|
767
760
|
max-width: var(--_nys-radiobutton-size);
|
|
768
761
|
max-height: var(--_nys-radiobutton-size);
|
|
769
|
-
border: solid var(--_nys-radiobutton-width
|
|
770
|
-
var(--_nys-radiobutton-color
|
|
771
|
-
background-color: var(--_nys-radiobutton-color
|
|
762
|
+
border: solid var(--_nys-radiobutton-border-width)
|
|
763
|
+
var(--_nys-radiobutton-border-color);
|
|
764
|
+
background-color: var(--_nys-radiobutton-background-color);
|
|
772
765
|
border-radius: 100%;
|
|
773
766
|
background-repeat: no-repeat;
|
|
774
767
|
background-position: center;
|
|
@@ -788,14 +781,14 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
788
781
|
/* Checked */
|
|
789
782
|
input:not(:disabled):checked + .nys-radiobutton .nys-radiobutton__radio {
|
|
790
783
|
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>');
|
|
791
|
-
background-color: var(--_nys-radiobutton-
|
|
784
|
+
background-color: var(--_nys-radiobutton-background-color--checked);
|
|
792
785
|
}
|
|
793
786
|
:host([tile])
|
|
794
787
|
.nys-radiobutton:has(input:not(:disabled):checked)
|
|
795
788
|
+ .nys-radiobutton
|
|
796
789
|
.nys-radiobutton__radio {
|
|
797
|
-
border-color: var(--_nys-radiobutton-
|
|
798
|
-
background-color: var(--_nys-radiobutton-
|
|
790
|
+
border-color: var(--_nys-radiobutton-border-color--tile--checked);
|
|
791
|
+
background-color: var(--_nys-radiobutton-background-color--tile--checked);
|
|
799
792
|
}
|
|
800
793
|
:host([tile])
|
|
801
794
|
.nys-radiobutton:has(input:not(:disabled):checked:hover)
|
|
@@ -807,29 +800,36 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
807
800
|
/* Checked + Disabled */
|
|
808
801
|
input:disabled:checked + .nys-radiobutton .nys-radiobutton__radio {
|
|
809
802
|
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>');
|
|
810
|
-
border-color: var(--_nys-radiobutton-
|
|
811
|
-
background-color: var(
|
|
803
|
+
border-color: var(--_nys-radiobutton-border-color--checked--disabled);
|
|
804
|
+
background-color: var(
|
|
805
|
+
--_nys-radiobutton-background-color--checked--disabled
|
|
806
|
+
);
|
|
812
807
|
}
|
|
813
808
|
:host([tile])
|
|
814
809
|
.nys-radiobutton:has(input:disabled:checked)
|
|
815
810
|
+ .nys-radiobutton
|
|
816
811
|
.nys-radiobutton__radio {
|
|
817
|
-
border-color: var(--_nys-radiobutton-
|
|
818
|
-
background-color: var(--_nys-radiobutton-
|
|
812
|
+
border-color: var(--_nys-radiobutton-background-color--tile--disabled);
|
|
813
|
+
background-color: var(--_nys-radiobutton-border-color--tile--disabled);
|
|
819
814
|
}
|
|
820
815
|
|
|
821
816
|
/* Disabled */
|
|
817
|
+
input:disabled + .nys-radiobutton,
|
|
818
|
+
input:disabled + .nys-radiobutton * {
|
|
819
|
+
cursor: not-allowed;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
822
|
input:disabled + .nys-radiobutton .nys-radiobutton__radio {
|
|
823
|
-
background-color: var(--_nys-radiobutton-
|
|
824
|
-
border-color: var(--_nys-radiobutton-
|
|
823
|
+
background-color: var(--_nys-radiobutton-background-color--disabled);
|
|
824
|
+
border-color: var(--_nys-radiobutton-border-color--disabled);
|
|
825
825
|
cursor: not-allowed;
|
|
826
826
|
}
|
|
827
827
|
:host([tile])
|
|
828
828
|
.nys-radiobutton:has(input:disabled)
|
|
829
829
|
+ .nys-radiobutton
|
|
830
830
|
.nys-radiobutton__radio {
|
|
831
|
-
background-color: var(--_nys-radiobutton-
|
|
832
|
-
border-color: var(--_nys-radiobutton-
|
|
831
|
+
background-color: var(--_nys-radiobutton-background-color--disabled);
|
|
832
|
+
border-color: var(--_nys-radiobutton-border-color--disabled);
|
|
833
833
|
cursor: not-allowed;
|
|
834
834
|
}
|
|
835
835
|
|
|
@@ -837,8 +837,8 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
837
837
|
input:hover:not(:disabled):not(:checked)
|
|
838
838
|
+ .nys-radiobutton
|
|
839
839
|
.nys-radiobutton__radio {
|
|
840
|
-
border-color: var(--_nys-radiobutton-
|
|
841
|
-
background-color: var(--_nys-radiobutton-
|
|
840
|
+
border-color: var(--_nys-radiobutton-border-color--hover);
|
|
841
|
+
background-color: var(--_nys-radiobutton-background-color--hover);
|
|
842
842
|
}
|
|
843
843
|
:host([tile])
|
|
844
844
|
.nys-radiobutton:has(
|
|
@@ -846,18 +846,18 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
846
846
|
+ .nys-radiobutton
|
|
847
847
|
.nys-radiobutton__radio
|
|
848
848
|
) {
|
|
849
|
-
border-color: var(--_nys-radiobutton-
|
|
850
|
-
background-color: var(--_nys-radiobutton-
|
|
851
|
-
outline: solid var(--_nys-radiobutton-
|
|
852
|
-
var(--_nys-radiobutton-
|
|
849
|
+
border-color: var(--_nys-radiobutton-border-color--tile--hover);
|
|
850
|
+
background-color: var(--_nys-radiobutton-background-color--tile--hover);
|
|
851
|
+
outline: solid var(--_nys-radiobutton-border-width--tile)
|
|
852
|
+
var(--_nys-radiobutton-border-color--tile--hover);
|
|
853
853
|
}
|
|
854
854
|
|
|
855
855
|
/* Pressed - only allow pressed on unchecked */
|
|
856
856
|
input:active:not(:disabled):not(:checked)
|
|
857
857
|
+ .nys-radiobutton
|
|
858
858
|
.nys-radiobutton__radio {
|
|
859
|
-
border-color: var(--_nys-radiobutton-
|
|
860
|
-
background-color: var(--_nys-radiobutton-
|
|
859
|
+
border-color: var(--_nys-radiobutton-border-color--active);
|
|
860
|
+
background-color: var(--_nys-radiobutton-background-color--active);
|
|
861
861
|
}
|
|
862
862
|
:host([tile])
|
|
863
863
|
.nys-radiobutton:has(
|
|
@@ -865,17 +865,17 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
865
865
|
+ .nys-radiobutton
|
|
866
866
|
.nys-radiobutton__radio
|
|
867
867
|
) {
|
|
868
|
-
border-color: var(--_nys-radiobutton-
|
|
869
|
-
background-color: var(--_nys-radiobutton-
|
|
870
|
-
outline: solid var(--_nys-radiobutton-
|
|
871
|
-
var(--_nys-radiobutton-
|
|
868
|
+
border-color: var(--_nys-radiobutton-border-color--tile--active);
|
|
869
|
+
background-color: var(--_nys-radiobutton-background-color--tile--active);
|
|
870
|
+
outline: solid var(--_nys-radiobutton-border-width--tile)
|
|
871
|
+
var(--_nys-radiobutton-border-color--tile--active);
|
|
872
872
|
}
|
|
873
873
|
|
|
874
874
|
/* Focused */
|
|
875
875
|
:host:focus-visible,
|
|
876
876
|
:host(.active-focus) {
|
|
877
|
-
outline: solid var(--_nys-radiobutton-width
|
|
878
|
-
var(--_nys-radiobutton-color
|
|
877
|
+
outline: solid var(--_nys-radiobutton-outline-width)
|
|
878
|
+
var(--_nys-radiobutton-outline-color);
|
|
879
879
|
}
|
|
880
880
|
/* Radiobutton Label Holder */
|
|
881
881
|
.nys-radiobutton__text {
|
|
@@ -886,13 +886,13 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
886
886
|
|
|
887
887
|
/* Label styling */
|
|
888
888
|
.nys-radiobutton__label {
|
|
889
|
-
font-weight: var(--_nys-radiobutton-font-weight
|
|
890
|
-
color: var(--_nys-radiobutton-color
|
|
889
|
+
font-weight: var(--_nys-radiobutton-font-weight--label);
|
|
890
|
+
color: var(--_nys-radiobutton-color);
|
|
891
891
|
}
|
|
892
892
|
|
|
893
893
|
/* Description styling */
|
|
894
894
|
.nys-radiobutton__description {
|
|
895
|
-
font-weight: var(--_nys-radiobutton-font-weight
|
|
895
|
+
font-weight: var(--_nys-radiobutton-font-weight--description);
|
|
896
896
|
font-style: italic;
|
|
897
897
|
text-align: left;
|
|
898
898
|
}
|
|
@@ -909,7 +909,7 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
909
909
|
/* Disabled label */
|
|
910
910
|
input:disabled + span + .nys-radiobutton__text .nys-radiobutton__label,
|
|
911
911
|
input:disabled + span + .nys-radiobutton__text .nys-radiobutton__description {
|
|
912
|
-
color: var(--_nys-radiobutton-disabled
|
|
912
|
+
color: var(--_nys-radiobutton-color--disabled);
|
|
913
913
|
cursor: not-allowed;
|
|
914
914
|
}
|
|
915
915
|
|
|
@@ -929,17 +929,17 @@ const Bt = (r) => r ?? p, ut = pt`
|
|
|
929
929
|
border: 0;
|
|
930
930
|
}
|
|
931
931
|
`;
|
|
932
|
-
var qt = Object.defineProperty,
|
|
933
|
-
for (var
|
|
934
|
-
(
|
|
935
|
-
return o &&
|
|
932
|
+
var qt = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, _ = (r, t, e, o) => {
|
|
933
|
+
for (var i = o > 1 ? void 0 : o ? Ot(t, e) : t, n = r.length - 1, s; n >= 0; n--)
|
|
934
|
+
(s = r[n]) && (i = (o ? s(t, e, i) : s(i)) || i);
|
|
935
|
+
return o && i && qt(t, e, i), i;
|
|
936
936
|
};
|
|
937
|
-
let
|
|
937
|
+
let Ht = 0;
|
|
938
938
|
var m;
|
|
939
|
-
const y = (m = class extends
|
|
939
|
+
const y = (m = class extends nt {
|
|
940
940
|
// allows use of elementInternals' API
|
|
941
941
|
constructor() {
|
|
942
|
-
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this.selectedValue = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
|
|
942
|
+
super(), this.id = "", this.name = "", this.required = !1, this.optional = !1, this.showError = !1, this.errorMessage = "", this.label = "", this.description = "", this.tile = !1, this._tooltip = "", this.form = null, this.selectedValue = null, this._slottedDescriptionText = "", this._size = "md", this._internals = this.attachInternals();
|
|
943
943
|
}
|
|
944
944
|
get size() {
|
|
945
945
|
return this._size;
|
|
@@ -951,7 +951,7 @@ const y = (m = class extends rt {
|
|
|
951
951
|
}
|
|
952
952
|
// Generate a unique ID if one is not provided
|
|
953
953
|
connectedCallback() {
|
|
954
|
-
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${
|
|
954
|
+
super.connectedCallback(), this.id || (this.id = `nys-radiogroup-${Date.now()}-${Ht++}`), this.addEventListener("nys-change", this._handleRadioButtonChange), this.addEventListener("invalid", this._handleInvalid);
|
|
955
955
|
}
|
|
956
956
|
disconnectedCallback() {
|
|
957
957
|
super.disconnectedCallback(), this.removeEventListener("nys-change", this._handleRadioButtonChange), this.removeEventListener("invalid", this._handleInvalid);
|
|
@@ -960,7 +960,7 @@ const y = (m = class extends rt {
|
|
|
960
960
|
this._initializeCheckedRadioValue(), this._setValue(), this._setRadioButtonRequire(), this._updateRadioButtonsSize(), this._updateRadioButtonsTile(), this._updateRadioButtonsShowError(), this._getSlotDescriptionForAria(), await this.updateComplete, this._initializeChildAttributes(), this._updateGroupTabIndex();
|
|
961
961
|
}
|
|
962
962
|
updated(t) {
|
|
963
|
-
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("showError") && this._updateRadioButtonsShowError();
|
|
963
|
+
(t.has("required") || t.has("selectedValue")) && this._manageRequire(), t.has("size") && this._updateRadioButtonsSize(), t.has("tile") && this._updateRadioButtonsTile(), t.has("showError") && this._updateRadioButtonsShowError(), t.has("form") && this._updateRadioButtonsForm();
|
|
964
964
|
}
|
|
965
965
|
// This callback is automatically called when the parent form is reset.
|
|
966
966
|
formResetCallback() {
|
|
@@ -980,11 +980,12 @@ const y = (m = class extends rt {
|
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
async _manageRequire() {
|
|
983
|
-
const t = this.errorMessage || "Please select an option.",
|
|
983
|
+
const t = this.errorMessage || "Please select an option.", o = Array.from(this.querySelectorAll("nys-radiobutton"))[0];
|
|
984
984
|
o && (this.required && !this.selectedValue ? this._internals.setValidity(
|
|
985
985
|
{ valueMissing: !0 },
|
|
986
986
|
t,
|
|
987
987
|
o
|
|
988
|
+
// pass the custom element, not shadow input
|
|
988
989
|
) : (this.showError = !1, this._internals.setValidity({}, "", o)));
|
|
989
990
|
}
|
|
990
991
|
checkValidity() {
|
|
@@ -1011,10 +1012,10 @@ const y = (m = class extends rt {
|
|
|
1011
1012
|
"Enter"
|
|
1012
1013
|
].includes(t.key)) return;
|
|
1013
1014
|
t.preventDefault();
|
|
1014
|
-
const o = this._getAllRadios().filter((
|
|
1015
|
-
let
|
|
1016
|
-
|
|
1017
|
-
const d = o[
|
|
1015
|
+
const o = this._getAllRadios().filter((h) => !h.disabled), i = o.find((h) => h.checked) || o[0], n = t.key === " " || t.key === "Enter" ? 0 : ["ArrowUp", "ArrowLeft"].includes(t.key) ? -1 : 1;
|
|
1016
|
+
let s = o.indexOf(i) + n;
|
|
1017
|
+
s < 0 && (s = o.length - 1), s >= o.length && (s = 0);
|
|
1018
|
+
const d = o[s], a = await d.getInputElement();
|
|
1018
1019
|
a == null || a.click(), this._updateGroupTabIndex(), d.focus();
|
|
1019
1020
|
}
|
|
1020
1021
|
_updateGroupTabIndex() {
|
|
@@ -1046,22 +1047,27 @@ const y = (m = class extends rt {
|
|
|
1046
1047
|
this.showError ? e.setAttribute("showError", "") : e.removeAttribute("showError");
|
|
1047
1048
|
});
|
|
1048
1049
|
}
|
|
1050
|
+
_updateRadioButtonsForm() {
|
|
1051
|
+
this.querySelectorAll("nys-radiobutton").forEach((e) => {
|
|
1052
|
+
this.showError && this.form !== null ? e.setAttribute("form", this.form) : e.removeAttribute("form");
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1049
1055
|
// Get the slotted text contents so native VO can attempt to announce it within the legend in the fieldset
|
|
1050
1056
|
_getSlotDescriptionForAria() {
|
|
1051
1057
|
var o;
|
|
1052
1058
|
const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector(
|
|
1053
1059
|
'slot[name="description"]'
|
|
1054
1060
|
), e = (t == null ? void 0 : t.assignedNodes({ flatten: !0 })) || [];
|
|
1055
|
-
this._slottedDescriptionText = e.map((
|
|
1061
|
+
this._slottedDescriptionText = e.map((i) => {
|
|
1056
1062
|
var n;
|
|
1057
|
-
return (n =
|
|
1063
|
+
return (n = i.textContent) == null ? void 0 : n.trim();
|
|
1058
1064
|
}).filter(Boolean).join(", ");
|
|
1059
1065
|
}
|
|
1060
1066
|
/******************** Event Handlers ********************/
|
|
1061
1067
|
// Keeps radiogroup informed of the name and value of its current selected radiobutton at each change
|
|
1062
1068
|
_handleRadioButtonChange(t) {
|
|
1063
|
-
const e = t, { name: o, value:
|
|
1064
|
-
this.name = o, this.selectedValue =
|
|
1069
|
+
const e = t, { name: o, value: i } = e.detail;
|
|
1070
|
+
this.name = o, this.selectedValue = i, this._internals.setFormValue(this.selectedValue), this._updateGroupTabIndex();
|
|
1065
1071
|
}
|
|
1066
1072
|
async _handleInvalid(t) {
|
|
1067
1073
|
if (t.preventDefault(), this._internals.validity.valueMissing) {
|
|
@@ -1070,7 +1076,7 @@ const y = (m = class extends rt {
|
|
|
1070
1076
|
if (e) {
|
|
1071
1077
|
const o = this._internals.form;
|
|
1072
1078
|
o ? Array.from(o.elements).find(
|
|
1073
|
-
(
|
|
1079
|
+
(s) => typeof s.checkValidity == "function" && !s.checkValidity()
|
|
1074
1080
|
) === this && (e.focus(), e.classList.add("active-focus")) : (e.focus(), e.classList.add("active-focus"));
|
|
1075
1081
|
}
|
|
1076
1082
|
}
|
|
@@ -1082,6 +1088,7 @@ const y = (m = class extends rt {
|
|
|
1082
1088
|
label=${this.label}
|
|
1083
1089
|
description=${this.description}
|
|
1084
1090
|
flag=${this.required ? "required" : this.optional ? "optional" : ""}
|
|
1091
|
+
_tooltip=${this._tooltip}
|
|
1085
1092
|
>
|
|
1086
1093
|
<slot name="description" slot="description">${this.description}</slot>
|
|
1087
1094
|
</nys-label>
|
|
@@ -1100,61 +1107,67 @@ const y = (m = class extends rt {
|
|
|
1100
1107
|
></nys-errormessage>
|
|
1101
1108
|
</div>`;
|
|
1102
1109
|
}
|
|
1103
|
-
}, m.VALID_SIZES = ["sm", "md"], m.styles =
|
|
1110
|
+
}, m.VALID_SIZES = ["sm", "md"], m.styles = pt, m.formAssociated = !0, m);
|
|
1104
1111
|
_([
|
|
1105
|
-
|
|
1112
|
+
c({ type: String })
|
|
1106
1113
|
], y.prototype, "id", 2);
|
|
1107
1114
|
_([
|
|
1108
|
-
|
|
1115
|
+
c({ type: String, reflect: !0 })
|
|
1109
1116
|
], y.prototype, "name", 2);
|
|
1110
1117
|
_([
|
|
1111
|
-
|
|
1118
|
+
c({ type: Boolean, reflect: !0 })
|
|
1112
1119
|
], y.prototype, "required", 2);
|
|
1113
1120
|
_([
|
|
1114
|
-
|
|
1121
|
+
c({ type: Boolean, reflect: !0 })
|
|
1115
1122
|
], y.prototype, "optional", 2);
|
|
1116
1123
|
_([
|
|
1117
|
-
|
|
1124
|
+
c({ type: Boolean, reflect: !0 })
|
|
1118
1125
|
], y.prototype, "showError", 2);
|
|
1119
1126
|
_([
|
|
1120
|
-
|
|
1127
|
+
c({ type: String })
|
|
1121
1128
|
], y.prototype, "errorMessage", 2);
|
|
1122
1129
|
_([
|
|
1123
|
-
|
|
1130
|
+
c({ type: String })
|
|
1124
1131
|
], y.prototype, "label", 2);
|
|
1125
1132
|
_([
|
|
1126
|
-
|
|
1133
|
+
c({ type: String })
|
|
1127
1134
|
], y.prototype, "description", 2);
|
|
1128
1135
|
_([
|
|
1129
|
-
|
|
1136
|
+
c({ type: Boolean, reflect: !0 })
|
|
1130
1137
|
], y.prototype, "tile", 2);
|
|
1131
1138
|
_([
|
|
1132
|
-
|
|
1139
|
+
c({ type: String })
|
|
1140
|
+
], y.prototype, "_tooltip", 2);
|
|
1141
|
+
_([
|
|
1142
|
+
c({ type: String, reflect: !0 })
|
|
1143
|
+
], y.prototype, "form", 2);
|
|
1144
|
+
_([
|
|
1145
|
+
dt()
|
|
1133
1146
|
], y.prototype, "selectedValue", 2);
|
|
1134
1147
|
_([
|
|
1135
|
-
|
|
1148
|
+
dt()
|
|
1136
1149
|
], y.prototype, "_slottedDescriptionText", 2);
|
|
1137
1150
|
_([
|
|
1138
|
-
|
|
1151
|
+
c({ reflect: !0 })
|
|
1139
1152
|
], y.prototype, "size", 1);
|
|
1140
1153
|
let Dt = y;
|
|
1141
1154
|
customElements.get("nys-radiogroup") || customElements.define("nys-radiogroup", Dt);
|
|
1142
1155
|
var Mt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, v = (r, t, e, o) => {
|
|
1143
|
-
for (var
|
|
1144
|
-
(
|
|
1145
|
-
return o &&
|
|
1156
|
+
for (var i = o > 1 ? void 0 : o ? It(t, e) : t, n = r.length - 1, s; n >= 0; n--)
|
|
1157
|
+
(s = r[n]) && (i = (o ? s(t, e, i) : s(i)) || i);
|
|
1158
|
+
return o && i && Mt(t, e, i), i;
|
|
1146
1159
|
};
|
|
1147
1160
|
let Lt = 0;
|
|
1148
|
-
var
|
|
1149
|
-
const f = (
|
|
1161
|
+
var u;
|
|
1162
|
+
const f = (u = class extends nt {
|
|
1150
1163
|
constructor() {
|
|
1151
|
-
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;
|
|
1164
|
+
super(...arguments), this.checked = !1, this.disabled = !1, this.required = !1, this.label = "", this.description = "", this.id = "", this.name = "", this.value = "", this.form = null, this._size = "md", this.tile = !1;
|
|
1152
1165
|
}
|
|
1153
1166
|
get size() {
|
|
1154
1167
|
return this._size;
|
|
1155
1168
|
}
|
|
1156
1169
|
set size(t) {
|
|
1157
|
-
this._size =
|
|
1170
|
+
this._size = u.VALID_SIZES.includes(
|
|
1158
1171
|
t
|
|
1159
1172
|
) ? t : "md";
|
|
1160
1173
|
}
|
|
@@ -1169,13 +1182,13 @@ const f = (h = class extends rt {
|
|
|
1169
1182
|
/********************** Lifecycle updates **********************/
|
|
1170
1183
|
// Generate a unique ID if one is not provided
|
|
1171
1184
|
connectedCallback() {
|
|
1172
|
-
super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${Lt++}`), this.checked && (
|
|
1185
|
+
super.connectedCallback(), this.id || (this.id = `nys-radiobutton-${Date.now()}-${Lt++}`), this.checked && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur), this.addEventListener("click", this._handleChange);
|
|
1173
1186
|
}
|
|
1174
1187
|
disconnectedCallback() {
|
|
1175
1188
|
super.disconnectedCallback(), this.removeEventListener("focus", this._handleFocus), this.removeEventListener("blur", this._handleBlur);
|
|
1176
1189
|
}
|
|
1177
1190
|
updated(t) {
|
|
1178
|
-
t.has("checked") && this.checked &&
|
|
1191
|
+
t.has("checked") && this.checked && u.buttonGroup[this.name] !== this && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this);
|
|
1179
1192
|
}
|
|
1180
1193
|
/********************** Functions **********************/
|
|
1181
1194
|
// This helper function is called to perform the element's native validation.
|
|
@@ -1191,6 +1204,7 @@ const f = (h = class extends rt {
|
|
|
1191
1204
|
this.dispatchEvent(
|
|
1192
1205
|
new CustomEvent("nys-change", {
|
|
1193
1206
|
detail: {
|
|
1207
|
+
id: this.id,
|
|
1194
1208
|
checked: this.checked,
|
|
1195
1209
|
name: this.name,
|
|
1196
1210
|
value: this.value
|
|
@@ -1202,7 +1216,7 @@ const f = (h = class extends rt {
|
|
|
1202
1216
|
}
|
|
1203
1217
|
// Handle radiobutton change event & unselection of other options in group
|
|
1204
1218
|
_handleChange() {
|
|
1205
|
-
this.classList.remove("active-focus"), this.checked
|
|
1219
|
+
this.classList.remove("active-focus"), !this.checked && !this.disabled && (u.buttonGroup[this.name] && (u.buttonGroup[this.name].checked = !1, u.buttonGroup[this.name].requestUpdate()), u.buttonGroup[this.name] = this, this.checked = !0, this._emitChangeEvent());
|
|
1206
1220
|
}
|
|
1207
1221
|
// Handle focus event
|
|
1208
1222
|
_handleFocus() {
|
|
@@ -1225,23 +1239,22 @@ const f = (h = class extends rt {
|
|
|
1225
1239
|
<input
|
|
1226
1240
|
id="${this.id}"
|
|
1227
1241
|
type="radio"
|
|
1228
|
-
name="${
|
|
1242
|
+
name="${rt(this.name ? this.name : void 0)}"
|
|
1229
1243
|
.checked=${this.checked}
|
|
1230
1244
|
?disabled=${this.disabled}
|
|
1231
1245
|
.value=${this.value}
|
|
1232
1246
|
?required="${this.required}"
|
|
1247
|
+
form=${rt(this.form || void 0)}
|
|
1233
1248
|
@change="${this._handleChange}"
|
|
1234
1249
|
hidden
|
|
1235
1250
|
aria-hidden="true"
|
|
1236
1251
|
/>
|
|
1237
|
-
|
|
1238
1252
|
<label
|
|
1239
1253
|
class="nys-radiobutton"
|
|
1240
1254
|
for="${this.id}"
|
|
1241
1255
|
@click="${this._callInputHandling}"
|
|
1242
1256
|
>
|
|
1243
1257
|
<span class="nys-radiobutton__radio"></span>
|
|
1244
|
-
|
|
1245
1258
|
${this.label && j` <div class="nys-radiobutton__text">
|
|
1246
1259
|
<div class="nys-radiobutton__label">${this.label}</div>
|
|
1247
1260
|
<div class="nys-radiobutton__description">
|
|
@@ -1251,36 +1264,39 @@ const f = (h = class extends rt {
|
|
|
1251
1264
|
</label>
|
|
1252
1265
|
`;
|
|
1253
1266
|
}
|
|
1254
|
-
},
|
|
1267
|
+
}, u.VALID_SIZES = ["sm", "md"], u.buttonGroup = {}, u.styles = pt, u);
|
|
1255
1268
|
v([
|
|
1256
|
-
|
|
1269
|
+
c({ type: Boolean, reflect: !0 })
|
|
1257
1270
|
], f.prototype, "checked", 2);
|
|
1258
1271
|
v([
|
|
1259
|
-
|
|
1272
|
+
c({ type: Boolean, reflect: !0 })
|
|
1260
1273
|
], f.prototype, "disabled", 2);
|
|
1261
1274
|
v([
|
|
1262
|
-
|
|
1275
|
+
c({ type: Boolean, reflect: !0 })
|
|
1263
1276
|
], f.prototype, "required", 2);
|
|
1264
1277
|
v([
|
|
1265
|
-
|
|
1278
|
+
c({ type: String })
|
|
1266
1279
|
], f.prototype, "label", 2);
|
|
1267
1280
|
v([
|
|
1268
|
-
|
|
1281
|
+
c({ type: String })
|
|
1269
1282
|
], f.prototype, "description", 2);
|
|
1270
1283
|
v([
|
|
1271
|
-
|
|
1284
|
+
c({ type: String })
|
|
1272
1285
|
], f.prototype, "id", 2);
|
|
1273
1286
|
v([
|
|
1274
|
-
|
|
1287
|
+
c({ type: String, reflect: !0 })
|
|
1275
1288
|
], f.prototype, "name", 2);
|
|
1276
1289
|
v([
|
|
1277
|
-
|
|
1290
|
+
c({ type: String })
|
|
1278
1291
|
], f.prototype, "value", 2);
|
|
1279
1292
|
v([
|
|
1280
|
-
|
|
1293
|
+
c({ type: String, reflect: !0 })
|
|
1294
|
+
], f.prototype, "form", 2);
|
|
1295
|
+
v([
|
|
1296
|
+
c({ reflect: !0 })
|
|
1281
1297
|
], f.prototype, "size", 1);
|
|
1282
1298
|
v([
|
|
1283
|
-
|
|
1299
|
+
c({ type: Boolean, reflect: !0 })
|
|
1284
1300
|
], f.prototype, "tile", 2);
|
|
1285
1301
|
let Nt = f;
|
|
1286
1302
|
customElements.get("nys-radiobutton") || customElements.define("nys-radiobutton", Nt);
|