@politiet/sheriff-web-components 2.1.0 → 2.1.2
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/react-wrappers/SDSDetailsWrapper.js +1 -1
- package/dist/react-wrappers/SDSDetailsWrapper.js.map +1 -1
- package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
- package/dist/sds-button/sds-button.styles.js +3 -2
- package/dist/sds-button/sds-button.styles.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.js +9 -4
- package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -1
- package/dist/sds-details/sds-details.styles.js +1 -1
- package/dist/sds-details/sds-details.styles.js.map +1 -1
- package/dist/sds-radio/sds-radio.styles.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.styles.js +9 -4
- package/dist/sds-radio/sds-radio.styles.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.js +1 -0
- package/dist/sds-textfield/sds-textfield.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.js +2 -1
- package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
- package/dist/sheriff-web-components.js +135 -2840
- package/package.json +1 -1
|
@@ -1,598 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t$4 = globalThis, e$7 = t$4.ShadowRoot && (void 0 === t$4.ShadyCSS || t$4.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$6 = /* @__PURE__ */ new WeakMap();
|
|
7
|
-
let n$3 = class n {
|
|
8
|
-
constructor(t2, e3, o2) {
|
|
9
|
-
if (this._$cssResult$ = true, o2 !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
|
-
this.cssText = t2, this.t = e3;
|
|
11
|
-
}
|
|
12
|
-
get styleSheet() {
|
|
13
|
-
let t2 = this.o;
|
|
14
|
-
const s2 = this.t;
|
|
15
|
-
if (e$7 && void 0 === t2) {
|
|
16
|
-
const e3 = void 0 !== s2 && 1 === s2.length;
|
|
17
|
-
e3 && (t2 = o$6.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e3 && o$6.set(s2, t2));
|
|
18
|
-
}
|
|
19
|
-
return t2;
|
|
20
|
-
}
|
|
21
|
-
toString() {
|
|
22
|
-
return this.cssText;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const r$4 = (t2) => new n$3("string" == typeof t2 ? t2 : t2 + "", void 0, s$2), i$4 = (t2, ...e3) => {
|
|
26
|
-
const o2 = 1 === t2.length ? t2[0] : e3.reduce((e4, s2, o3) => e4 + ((t3) => {
|
|
27
|
-
if (true === t3._$cssResult$) return t3.cssText;
|
|
28
|
-
if ("number" == typeof t3) return t3;
|
|
29
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
|
-
})(s2) + t2[o3 + 1], t2[0]);
|
|
31
|
-
return new n$3(o2, t2, s$2);
|
|
32
|
-
}, S$1 = (s2, o2) => {
|
|
33
|
-
if (e$7) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
|
|
34
|
-
else for (const e3 of o2) {
|
|
35
|
-
const o3 = document.createElement("style"), n3 = t$4.litNonce;
|
|
36
|
-
void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e3.cssText, s2.appendChild(o3);
|
|
37
|
-
}
|
|
38
|
-
}, c$2 = e$7 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
|
|
39
|
-
let e3 = "";
|
|
40
|
-
for (const s2 of t3.cssRules) e3 += s2.cssText;
|
|
41
|
-
return r$4(e3);
|
|
42
|
-
})(t2) : t2;
|
|
43
|
-
/**
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright 2017 Google LLC
|
|
46
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/
|
|
48
|
-
const { is: i$3, defineProperty: e$6, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$3, getOwnPropertySymbols: o$5, getPrototypeOf: n$2 } = Object, a$1 = globalThis, c$1 = a$1.trustedTypes, l$1 = c$1 ? c$1.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) {
|
|
49
|
-
switch (s2) {
|
|
50
|
-
case Boolean:
|
|
51
|
-
t2 = t2 ? l$1 : null;
|
|
52
|
-
break;
|
|
53
|
-
case Object:
|
|
54
|
-
case Array:
|
|
55
|
-
t2 = null == t2 ? t2 : JSON.stringify(t2);
|
|
56
|
-
}
|
|
57
|
-
return t2;
|
|
58
|
-
}, fromAttribute(t2, s2) {
|
|
59
|
-
let i3 = t2;
|
|
60
|
-
switch (s2) {
|
|
61
|
-
case Boolean:
|
|
62
|
-
i3 = null !== t2;
|
|
63
|
-
break;
|
|
64
|
-
case Number:
|
|
65
|
-
i3 = null === t2 ? null : Number(t2);
|
|
66
|
-
break;
|
|
67
|
-
case Object:
|
|
68
|
-
case Array:
|
|
69
|
-
try {
|
|
70
|
-
i3 = JSON.parse(t2);
|
|
71
|
-
} catch (t3) {
|
|
72
|
-
i3 = null;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return i3;
|
|
76
|
-
} }, f$1 = (t2, s2) => !i$3(t2, s2), b = { attribute: true, type: String, converter: u$1, reflect: false, useDefault: false, hasChanged: f$1 };
|
|
77
|
-
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
|
-
let y$1 = class y extends HTMLElement {
|
|
79
|
-
static addInitializer(t2) {
|
|
80
|
-
this._$Ei(), (this.l ??= []).push(t2);
|
|
81
|
-
}
|
|
82
|
-
static get observedAttributes() {
|
|
83
|
-
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
|
-
}
|
|
85
|
-
static createProperty(t2, s2 = b) {
|
|
86
|
-
if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) {
|
|
87
|
-
const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2);
|
|
88
|
-
void 0 !== h2 && e$6(this.prototype, t2, h2);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
static getPropertyDescriptor(t2, s2, i3) {
|
|
92
|
-
const { get: e3, set: r2 } = h$1(this.prototype, t2) ?? { get() {
|
|
93
|
-
return this[s2];
|
|
94
|
-
}, set(t3) {
|
|
95
|
-
this[s2] = t3;
|
|
96
|
-
} };
|
|
97
|
-
return { get: e3, set(s3) {
|
|
98
|
-
const h2 = e3?.call(this);
|
|
99
|
-
r2?.call(this, s3), this.requestUpdate(t2, h2, i3);
|
|
100
|
-
}, configurable: true, enumerable: true };
|
|
101
|
-
}
|
|
102
|
-
static getPropertyOptions(t2) {
|
|
103
|
-
return this.elementProperties.get(t2) ?? b;
|
|
104
|
-
}
|
|
105
|
-
static _$Ei() {
|
|
106
|
-
if (this.hasOwnProperty(d$1("elementProperties"))) return;
|
|
107
|
-
const t2 = n$2(this);
|
|
108
|
-
t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
|
|
109
|
-
}
|
|
110
|
-
static finalize() {
|
|
111
|
-
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
112
|
-
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
113
|
-
const t3 = this.properties, s2 = [...r$3(t3), ...o$5(t3)];
|
|
114
|
-
for (const i3 of s2) this.createProperty(i3, t3[i3]);
|
|
115
|
-
}
|
|
116
|
-
const t2 = this[Symbol.metadata];
|
|
117
|
-
if (null !== t2) {
|
|
118
|
-
const s2 = litPropertyMetadata.get(t2);
|
|
119
|
-
if (void 0 !== s2) for (const [t3, i3] of s2) this.elementProperties.set(t3, i3);
|
|
120
|
-
}
|
|
121
|
-
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [t3, s2] of this.elementProperties) {
|
|
123
|
-
const i3 = this._$Eu(t3, s2);
|
|
124
|
-
void 0 !== i3 && this._$Eh.set(i3, t3);
|
|
125
|
-
}
|
|
126
|
-
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
|
-
}
|
|
128
|
-
static finalizeStyles(s2) {
|
|
129
|
-
const i3 = [];
|
|
130
|
-
if (Array.isArray(s2)) {
|
|
131
|
-
const e3 = new Set(s2.flat(1 / 0).reverse());
|
|
132
|
-
for (const s3 of e3) i3.unshift(c$2(s3));
|
|
133
|
-
} else void 0 !== s2 && i3.push(c$2(s2));
|
|
134
|
-
return i3;
|
|
135
|
-
}
|
|
136
|
-
static _$Eu(t2, s2) {
|
|
137
|
-
const i3 = s2.attribute;
|
|
138
|
-
return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
|
|
139
|
-
}
|
|
140
|
-
constructor() {
|
|
141
|
-
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
142
|
-
}
|
|
143
|
-
_$Ev() {
|
|
144
|
-
this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
|
|
145
|
-
}
|
|
146
|
-
addController(t2) {
|
|
147
|
-
(this._$EO ??= /* @__PURE__ */ new Set()).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.();
|
|
148
|
-
}
|
|
149
|
-
removeController(t2) {
|
|
150
|
-
this._$EO?.delete(t2);
|
|
151
|
-
}
|
|
152
|
-
_$E_() {
|
|
153
|
-
const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties;
|
|
154
|
-
for (const i3 of s2.keys()) this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]);
|
|
155
|
-
t2.size > 0 && (this._$Ep = t2);
|
|
156
|
-
}
|
|
157
|
-
createRenderRoot() {
|
|
158
|
-
const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
-
return S$1(t2, this.constructor.elementStyles), t2;
|
|
160
|
-
}
|
|
161
|
-
connectedCallback() {
|
|
162
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
|
|
163
|
-
}
|
|
164
|
-
enableUpdating(t2) {
|
|
165
|
-
}
|
|
166
|
-
disconnectedCallback() {
|
|
167
|
-
this._$EO?.forEach((t2) => t2.hostDisconnected?.());
|
|
168
|
-
}
|
|
169
|
-
attributeChangedCallback(t2, s2, i3) {
|
|
170
|
-
this._$AK(t2, i3);
|
|
171
|
-
}
|
|
172
|
-
_$ET(t2, s2) {
|
|
173
|
-
const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3);
|
|
174
|
-
if (void 0 !== e3 && true === i3.reflect) {
|
|
175
|
-
const h2 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u$1).toAttribute(s2, i3.type);
|
|
176
|
-
this._$Em = t2, null == h2 ? this.removeAttribute(e3) : this.setAttribute(e3, h2), this._$Em = null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
_$AK(t2, s2) {
|
|
180
|
-
const i3 = this.constructor, e3 = i3._$Eh.get(t2);
|
|
181
|
-
if (void 0 !== e3 && this._$Em !== e3) {
|
|
182
|
-
const t3 = i3.getPropertyOptions(e3), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$1;
|
|
183
|
-
this._$Em = e3, this[e3] = h2.fromAttribute(s2, t3.type) ?? this._$Ej?.get(e3) ?? null, this._$Em = null;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
requestUpdate(t2, s2, i3) {
|
|
187
|
-
if (void 0 !== t2) {
|
|
188
|
-
const e3 = this.constructor, h2 = this[t2];
|
|
189
|
-
if (i3 ??= e3.getPropertyOptions(t2), !((i3.hasChanged ?? f$1)(h2, s2) || i3.useDefault && i3.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e3._$Eu(t2, i3)))) return;
|
|
190
|
-
this.C(t2, s2, i3);
|
|
191
|
-
}
|
|
192
|
-
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
193
|
-
}
|
|
194
|
-
C(t2, s2, { useDefault: i3, reflect: e3, wrapped: h2 }, r2) {
|
|
195
|
-
i3 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t2) && (this._$Ej.set(t2, r2 ?? s2 ?? this[t2]), true !== h2 || void 0 !== r2) || (this._$AL.has(t2) || (this.hasUpdated || i3 || (s2 = void 0), this._$AL.set(t2, s2)), true === e3 && this._$Em !== t2 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t2));
|
|
196
|
-
}
|
|
197
|
-
async _$EP() {
|
|
198
|
-
this.isUpdatePending = true;
|
|
199
|
-
try {
|
|
200
|
-
await this._$ES;
|
|
201
|
-
} catch (t3) {
|
|
202
|
-
Promise.reject(t3);
|
|
203
|
-
}
|
|
204
|
-
const t2 = this.scheduleUpdate();
|
|
205
|
-
return null != t2 && await t2, !this.isUpdatePending;
|
|
206
|
-
}
|
|
207
|
-
scheduleUpdate() {
|
|
208
|
-
return this.performUpdate();
|
|
209
|
-
}
|
|
210
|
-
performUpdate() {
|
|
211
|
-
if (!this.isUpdatePending) return;
|
|
212
|
-
if (!this.hasUpdated) {
|
|
213
|
-
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
214
|
-
for (const [t4, s3] of this._$Ep) this[t4] = s3;
|
|
215
|
-
this._$Ep = void 0;
|
|
216
|
-
}
|
|
217
|
-
const t3 = this.constructor.elementProperties;
|
|
218
|
-
if (t3.size > 0) for (const [s3, i3] of t3) {
|
|
219
|
-
const { wrapped: t4 } = i3, e3 = this[s3];
|
|
220
|
-
true !== t4 || this._$AL.has(s3) || void 0 === e3 || this.C(s3, void 0, i3, e3);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
let t2 = false;
|
|
224
|
-
const s2 = this._$AL;
|
|
225
|
-
try {
|
|
226
|
-
t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM();
|
|
227
|
-
} catch (s3) {
|
|
228
|
-
throw t2 = false, this._$EM(), s3;
|
|
229
|
-
}
|
|
230
|
-
t2 && this._$AE(s2);
|
|
231
|
-
}
|
|
232
|
-
willUpdate(t2) {
|
|
233
|
-
}
|
|
234
|
-
_$AE(t2) {
|
|
235
|
-
this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
|
|
236
|
-
}
|
|
237
|
-
_$EM() {
|
|
238
|
-
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
|
|
239
|
-
}
|
|
240
|
-
get updateComplete() {
|
|
241
|
-
return this.getUpdateComplete();
|
|
242
|
-
}
|
|
243
|
-
getUpdateComplete() {
|
|
244
|
-
return this._$ES;
|
|
245
|
-
}
|
|
246
|
-
shouldUpdate(t2) {
|
|
247
|
-
return true;
|
|
248
|
-
}
|
|
249
|
-
update(t2) {
|
|
250
|
-
this._$Eq &&= this._$Eq.forEach((t3) => this._$ET(t3, this[t3])), this._$EM();
|
|
251
|
-
}
|
|
252
|
-
updated(t2) {
|
|
253
|
-
}
|
|
254
|
-
firstUpdated(t2) {
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ??= []).push("2.1.0");
|
|
258
|
-
/**
|
|
259
|
-
* @license
|
|
260
|
-
* Copyright 2017 Google LLC
|
|
261
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
262
|
-
*/
|
|
263
|
-
const t$3 = globalThis, i$2 = t$3.trustedTypes, s$1 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$5 = "$lit$", h = `lit$${Math.random().toFixed(9).slice(2)}$`, o$4 = "?" + h, n$1 = `<${o$4}>`, r$2 = document, l = () => r$2.createComment(""), c = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
|
|
264
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x = y2(1), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r$2.createTreeWalker(r$2, 129);
|
|
265
|
-
function P(t2, i3) {
|
|
266
|
-
if (!a(t2) || !t2.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
267
|
-
return void 0 !== s$1 ? s$1.createHTML(i3) : i3;
|
|
268
|
-
}
|
|
269
|
-
const V = (t2, i3) => {
|
|
270
|
-
const s2 = t2.length - 1, o2 = [];
|
|
271
|
-
let r2, l2 = 2 === i3 ? "<svg>" : 3 === i3 ? "<math>" : "", c2 = f;
|
|
272
|
-
for (let i4 = 0; i4 < s2; i4++) {
|
|
273
|
-
const s3 = t2[i4];
|
|
274
|
-
let a2, u2, d2 = -1, y3 = 0;
|
|
275
|
-
for (; y3 < s3.length && (c2.lastIndex = y3, u2 = c2.exec(s3), null !== u2); ) y3 = c2.lastIndex, c2 === f ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m) : void 0 !== u2[3] && (c2 = m) : c2 === m ? ">" === u2[0] ? (c2 = r2 ?? f, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f : (c2 = m, r2 = void 0);
|
|
276
|
-
const x2 = c2 === m && t2[i4 + 1].startsWith("/>") ? " " : "";
|
|
277
|
-
l2 += c2 === f ? s3 + n$1 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$5 + s3.slice(d2) + h + x2) : s3 + h + (-2 === d2 ? i4 : x2);
|
|
278
|
-
}
|
|
279
|
-
return [P(t2, l2 + (t2[s2] || "<?>") + (2 === i3 ? "</svg>" : 3 === i3 ? "</math>" : "")), o2];
|
|
280
|
-
};
|
|
281
|
-
class N {
|
|
282
|
-
constructor({ strings: t2, _$litType$: s2 }, n3) {
|
|
283
|
-
let r2;
|
|
284
|
-
this.parts = [];
|
|
285
|
-
let c2 = 0, a2 = 0;
|
|
286
|
-
const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = V(t2, s2);
|
|
287
|
-
if (this.el = N.createElement(f2, n3), C.currentNode = this.el.content, 2 === s2 || 3 === s2) {
|
|
288
|
-
const t3 = this.el.content.firstChild;
|
|
289
|
-
t3.replaceWith(...t3.childNodes);
|
|
290
|
-
}
|
|
291
|
-
for (; null !== (r2 = C.nextNode()) && d2.length < u2; ) {
|
|
292
|
-
if (1 === r2.nodeType) {
|
|
293
|
-
if (r2.hasAttributes()) for (const t3 of r2.getAttributeNames()) if (t3.endsWith(e$5)) {
|
|
294
|
-
const i3 = v2[a2++], s3 = r2.getAttribute(t3).split(h), e3 = /([.?@])?(.*)/.exec(i3);
|
|
295
|
-
d2.push({ type: 1, index: c2, name: e3[2], strings: s3, ctor: "." === e3[1] ? H : "?" === e3[1] ? I : "@" === e3[1] ? L : k }), r2.removeAttribute(t3);
|
|
296
|
-
} else t3.startsWith(h) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3));
|
|
297
|
-
if ($.test(r2.tagName)) {
|
|
298
|
-
const t3 = r2.textContent.split(h), s3 = t3.length - 1;
|
|
299
|
-
if (s3 > 0) {
|
|
300
|
-
r2.textContent = i$2 ? i$2.emptyScript : "";
|
|
301
|
-
for (let i3 = 0; i3 < s3; i3++) r2.append(t3[i3], l()), C.nextNode(), d2.push({ type: 2, index: ++c2 });
|
|
302
|
-
r2.append(t3[s3], l());
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
} else if (8 === r2.nodeType) if (r2.data === o$4) d2.push({ type: 2, index: c2 });
|
|
306
|
-
else {
|
|
307
|
-
let t3 = -1;
|
|
308
|
-
for (; -1 !== (t3 = r2.data.indexOf(h, t3 + 1)); ) d2.push({ type: 7, index: c2 }), t3 += h.length - 1;
|
|
309
|
-
}
|
|
310
|
-
c2++;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
static createElement(t2, i3) {
|
|
314
|
-
const s2 = r$2.createElement("template");
|
|
315
|
-
return s2.innerHTML = t2, s2;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function S(t2, i3, s2 = t2, e3) {
|
|
319
|
-
if (i3 === T) return i3;
|
|
320
|
-
let h2 = void 0 !== e3 ? s2._$Co?.[e3] : s2._$Cl;
|
|
321
|
-
const o2 = c(i3) ? void 0 : i3._$litDirective$;
|
|
322
|
-
return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e3)), void 0 !== e3 ? (s2._$Co ??= [])[e3] = h2 : s2._$Cl = h2), void 0 !== h2 && (i3 = S(t2, h2._$AS(t2, i3.values), h2, e3)), i3;
|
|
323
|
-
}
|
|
324
|
-
class M {
|
|
325
|
-
constructor(t2, i3) {
|
|
326
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3;
|
|
327
|
-
}
|
|
328
|
-
get parentNode() {
|
|
329
|
-
return this._$AM.parentNode;
|
|
330
|
-
}
|
|
331
|
-
get _$AU() {
|
|
332
|
-
return this._$AM._$AU;
|
|
333
|
-
}
|
|
334
|
-
u(t2) {
|
|
335
|
-
const { el: { content: i3 }, parts: s2 } = this._$AD, e3 = (t2?.creationScope ?? r$2).importNode(i3, true);
|
|
336
|
-
C.currentNode = e3;
|
|
337
|
-
let h2 = C.nextNode(), o2 = 0, n3 = 0, l2 = s2[0];
|
|
338
|
-
for (; void 0 !== l2; ) {
|
|
339
|
-
if (o2 === l2.index) {
|
|
340
|
-
let i4;
|
|
341
|
-
2 === l2.type ? i4 = new R(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i4 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i4 = new z(h2, this, t2)), this._$AV.push(i4), l2 = s2[++n3];
|
|
342
|
-
}
|
|
343
|
-
o2 !== l2?.index && (h2 = C.nextNode(), o2++);
|
|
344
|
-
}
|
|
345
|
-
return C.currentNode = r$2, e3;
|
|
346
|
-
}
|
|
347
|
-
p(t2) {
|
|
348
|
-
let i3 = 0;
|
|
349
|
-
for (const s2 of this._$AV) void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
class R {
|
|
353
|
-
get _$AU() {
|
|
354
|
-
return this._$AM?._$AU ?? this._$Cv;
|
|
355
|
-
}
|
|
356
|
-
constructor(t2, i3, s2, e3) {
|
|
357
|
-
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e3, this._$Cv = e3?.isConnected ?? true;
|
|
358
|
-
}
|
|
359
|
-
get parentNode() {
|
|
360
|
-
let t2 = this._$AA.parentNode;
|
|
361
|
-
const i3 = this._$AM;
|
|
362
|
-
return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2;
|
|
363
|
-
}
|
|
364
|
-
get startNode() {
|
|
365
|
-
return this._$AA;
|
|
366
|
-
}
|
|
367
|
-
get endNode() {
|
|
368
|
-
return this._$AB;
|
|
369
|
-
}
|
|
370
|
-
_$AI(t2, i3 = this) {
|
|
371
|
-
t2 = S(this, t2, i3), c(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2);
|
|
372
|
-
}
|
|
373
|
-
O(t2) {
|
|
374
|
-
return this._$AA.parentNode.insertBefore(t2, this._$AB);
|
|
375
|
-
}
|
|
376
|
-
T(t2) {
|
|
377
|
-
this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
|
|
378
|
-
}
|
|
379
|
-
_(t2) {
|
|
380
|
-
this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$2.createTextNode(t2)), this._$AH = t2;
|
|
381
|
-
}
|
|
382
|
-
$(t2) {
|
|
383
|
-
const { values: i3, _$litType$: s2 } = t2, e3 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N.createElement(P(s2.h, s2.h[0]), this.options)), s2);
|
|
384
|
-
if (this._$AH?._$AD === e3) this._$AH.p(i3);
|
|
385
|
-
else {
|
|
386
|
-
const t3 = new M(e3, this), s3 = t3.u(this.options);
|
|
387
|
-
t3.p(i3), this.T(s3), this._$AH = t3;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
_$AC(t2) {
|
|
391
|
-
let i3 = A.get(t2.strings);
|
|
392
|
-
return void 0 === i3 && A.set(t2.strings, i3 = new N(t2)), i3;
|
|
393
|
-
}
|
|
394
|
-
k(t2) {
|
|
395
|
-
a(this._$AH) || (this._$AH = [], this._$AR());
|
|
396
|
-
const i3 = this._$AH;
|
|
397
|
-
let s2, e3 = 0;
|
|
398
|
-
for (const h2 of t2) e3 === i3.length ? i3.push(s2 = new R(this.O(l()), this.O(l()), this, this.options)) : s2 = i3[e3], s2._$AI(h2), e3++;
|
|
399
|
-
e3 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e3), i3.length = e3);
|
|
400
|
-
}
|
|
401
|
-
_$AR(t2 = this._$AA.nextSibling, i3) {
|
|
402
|
-
for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) {
|
|
403
|
-
const i4 = t2.nextSibling;
|
|
404
|
-
t2.remove(), t2 = i4;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
setConnected(t2) {
|
|
408
|
-
void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2));
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
class k {
|
|
412
|
-
get tagName() {
|
|
413
|
-
return this.element.tagName;
|
|
414
|
-
}
|
|
415
|
-
get _$AU() {
|
|
416
|
-
return this._$AM._$AU;
|
|
417
|
-
}
|
|
418
|
-
constructor(t2, i3, s2, e3, h2) {
|
|
419
|
-
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e3, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E;
|
|
420
|
-
}
|
|
421
|
-
_$AI(t2, i3 = this, s2, e3) {
|
|
422
|
-
const h2 = this.strings;
|
|
423
|
-
let o2 = false;
|
|
424
|
-
if (void 0 === h2) t2 = S(this, t2, i3, 0), o2 = !c(t2) || t2 !== this._$AH && t2 !== T, o2 && (this._$AH = t2);
|
|
425
|
-
else {
|
|
426
|
-
const e4 = t2;
|
|
427
|
-
let n3, r2;
|
|
428
|
-
for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++) r2 = S(this, e4[s2 + n3], i3, n3), r2 === T && (r2 = this._$AH[n3]), o2 ||= !c(r2) || r2 !== this._$AH[n3], r2 === E ? t2 = E : t2 !== E && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2;
|
|
429
|
-
}
|
|
430
|
-
o2 && !e3 && this.j(t2);
|
|
431
|
-
}
|
|
432
|
-
j(t2) {
|
|
433
|
-
t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
class H extends k {
|
|
437
|
-
constructor() {
|
|
438
|
-
super(...arguments), this.type = 3;
|
|
439
|
-
}
|
|
440
|
-
j(t2) {
|
|
441
|
-
this.element[this.name] = t2 === E ? void 0 : t2;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
class I extends k {
|
|
445
|
-
constructor() {
|
|
446
|
-
super(...arguments), this.type = 4;
|
|
447
|
-
}
|
|
448
|
-
j(t2) {
|
|
449
|
-
this.element.toggleAttribute(this.name, !!t2 && t2 !== E);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
class L extends k {
|
|
453
|
-
constructor(t2, i3, s2, e3, h2) {
|
|
454
|
-
super(t2, i3, s2, e3, h2), this.type = 5;
|
|
455
|
-
}
|
|
456
|
-
_$AI(t2, i3 = this) {
|
|
457
|
-
if ((t2 = S(this, t2, i3, 0) ?? E) === T) return;
|
|
458
|
-
const s2 = this._$AH, e3 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e3);
|
|
459
|
-
e3 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
|
|
460
|
-
}
|
|
461
|
-
handleEvent(t2) {
|
|
462
|
-
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
class z {
|
|
466
|
-
constructor(t2, i3, s2) {
|
|
467
|
-
this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2;
|
|
468
|
-
}
|
|
469
|
-
get _$AU() {
|
|
470
|
-
return this._$AM._$AU;
|
|
471
|
-
}
|
|
472
|
-
_$AI(t2) {
|
|
473
|
-
S(this, t2);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
const j = t$3.litHtmlPolyfillSupport;
|
|
477
|
-
j?.(N, R), (t$3.litHtmlVersions ??= []).push("3.3.0");
|
|
478
|
-
const B = (t2, i3, s2) => {
|
|
479
|
-
const e3 = s2?.renderBefore ?? i3;
|
|
480
|
-
let h2 = e3._$litPart$;
|
|
481
|
-
if (void 0 === h2) {
|
|
482
|
-
const t3 = s2?.renderBefore ?? null;
|
|
483
|
-
e3._$litPart$ = h2 = new R(i3.insertBefore(l(), t3), t3, void 0, s2 ?? {});
|
|
484
|
-
}
|
|
485
|
-
return h2._$AI(t2), h2;
|
|
486
|
-
};
|
|
487
|
-
/**
|
|
488
|
-
* @license
|
|
489
|
-
* Copyright 2017 Google LLC
|
|
490
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
491
|
-
*/
|
|
492
|
-
const s = globalThis;
|
|
493
|
-
let i$1 = class i extends y$1 {
|
|
494
|
-
constructor() {
|
|
495
|
-
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
496
|
-
}
|
|
497
|
-
createRenderRoot() {
|
|
498
|
-
const t2 = super.createRenderRoot();
|
|
499
|
-
return this.renderOptions.renderBefore ??= t2.firstChild, t2;
|
|
500
|
-
}
|
|
501
|
-
update(t2) {
|
|
502
|
-
const r2 = this.render();
|
|
503
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = B(r2, this.renderRoot, this.renderOptions);
|
|
504
|
-
}
|
|
505
|
-
connectedCallback() {
|
|
506
|
-
super.connectedCallback(), this._$Do?.setConnected(true);
|
|
507
|
-
}
|
|
508
|
-
disconnectedCallback() {
|
|
509
|
-
super.disconnectedCallback(), this._$Do?.setConnected(false);
|
|
510
|
-
}
|
|
511
|
-
render() {
|
|
512
|
-
return T;
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
i$1._$litElement$ = true, i$1["finalized"] = true, s.litElementHydrateSupport?.({ LitElement: i$1 });
|
|
516
|
-
const o$3 = s.litElementPolyfillSupport;
|
|
517
|
-
o$3?.({ LitElement: i$1 });
|
|
518
|
-
(s.litElementVersions ??= []).push("4.2.0");
|
|
519
|
-
/**
|
|
520
|
-
* @license
|
|
521
|
-
* Copyright 2017 Google LLC
|
|
522
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
523
|
-
*/
|
|
524
|
-
const t$2 = (t2) => (e3, o2) => {
|
|
525
|
-
void 0 !== o2 ? o2.addInitializer(() => {
|
|
526
|
-
customElements.define(t2, e3);
|
|
527
|
-
}) : customElements.define(t2, e3);
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* @license
|
|
531
|
-
* Copyright 2017 Google LLC
|
|
532
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
533
|
-
*/
|
|
534
|
-
const o$2 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$1 }, r$1 = (t2 = o$2, e3, r2) => {
|
|
535
|
-
const { kind: n3, metadata: i3 } = r2;
|
|
536
|
-
let s2 = globalThis.litPropertyMetadata.get(i3);
|
|
537
|
-
if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), "setter" === n3 && ((t2 = Object.create(t2)).wrapped = true), s2.set(r2.name, t2), "accessor" === n3) {
|
|
538
|
-
const { name: o2 } = r2;
|
|
539
|
-
return { set(r3) {
|
|
540
|
-
const n4 = e3.get.call(this);
|
|
541
|
-
e3.set.call(this, r3), this.requestUpdate(o2, n4, t2);
|
|
542
|
-
}, init(e4) {
|
|
543
|
-
return void 0 !== e4 && this.C(o2, void 0, t2, e4), e4;
|
|
544
|
-
} };
|
|
545
|
-
}
|
|
546
|
-
if ("setter" === n3) {
|
|
547
|
-
const { name: o2 } = r2;
|
|
548
|
-
return function(r3) {
|
|
549
|
-
const n4 = this[o2];
|
|
550
|
-
e3.call(this, r3), this.requestUpdate(o2, n4, t2);
|
|
551
|
-
};
|
|
552
|
-
}
|
|
553
|
-
throw Error("Unsupported decorator location: " + n3);
|
|
554
|
-
};
|
|
555
|
-
function n2(t2) {
|
|
556
|
-
return (e3, o2) => "object" == typeof o2 ? r$1(t2, e3, o2) : ((t3, e4, o3) => {
|
|
557
|
-
const r2 = e4.hasOwnProperty(o3);
|
|
558
|
-
return e4.constructor.createProperty(o3, t3), r2 ? Object.getOwnPropertyDescriptor(e4, o3) : void 0;
|
|
559
|
-
})(t2, e3, o2);
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* @license
|
|
563
|
-
* Copyright 2017 Google LLC
|
|
564
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
565
|
-
*/
|
|
566
|
-
function r(r2) {
|
|
567
|
-
return n2({ ...r2, state: true, attribute: false });
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* @license
|
|
571
|
-
* Copyright 2017 Google LLC
|
|
572
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
573
|
-
*/
|
|
574
|
-
const e$4 = (e3, t2, c2) => (c2.configurable = true, c2.enumerable = true, Reflect.decorate && "object" != typeof t2 && Object.defineProperty(e3, t2, c2), c2);
|
|
575
|
-
/**
|
|
576
|
-
* @license
|
|
577
|
-
* Copyright 2017 Google LLC
|
|
578
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
579
|
-
*/
|
|
580
|
-
function e$3(e3, r2) {
|
|
581
|
-
return (n3, s2, i3) => {
|
|
582
|
-
const o2 = (t2) => t2.renderRoot?.querySelector(e3) ?? null;
|
|
583
|
-
return e$4(n3, s2, { get() {
|
|
584
|
-
return o2(this);
|
|
585
|
-
} });
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
function guardedCustomElement(tagName) {
|
|
589
|
-
return (cls) => {
|
|
590
|
-
if (!customElements.get(tagName)) {
|
|
591
|
-
t$2(tagName)(cls);
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
const styles$h = i$4`
|
|
1
|
+
const t=globalThis,s=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol(),o=/* @__PURE__ */new WeakMap;let r=class{constructor(t,s,o){if(this._$cssResult$=!0,o!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&o.set(e,t))}return t}toString(){return this.cssText}};const a=(t,...s)=>{const o=1===t.length?t[0]:s.reduce(((s,e,o)=>s+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+t[o+1]),t[0]);return new r(o,t,e)},i=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let s="";for(const e of t.cssRules)s+=e.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,e))(s)})(t):t,{is:d,defineProperty:n,getOwnPropertyDescriptor:l,getOwnPropertyNames:c,getOwnPropertySymbols:h,getPrototypeOf:p}=Object,g=globalThis,v=g.trustedTypes,u=v?v.emptyScript:"",f=g.reactiveElementPolyfillSupport,b=(t,s)=>t,_={toAttribute(t,s){switch(s){case Boolean:t=t?u:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let e=t;switch(s){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(o){e=null}}return e}},x=(t,s)=>!d(t,s),m={attribute:!0,type:String,converter:_,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=/* @__PURE__ */new WeakMap;let y=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=m){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const e=Symbol(),o=this.getPropertyDescriptor(t,e,s);void 0!==o&&n(this.prototype,t,o)}}static getPropertyDescriptor(t,s,e){const{get:o,set:r}=l(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get:o,set(s){const a=o?.call(this);r?.call(this,s),this.requestUpdate(t,a,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??m}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,s=[...c(t),...h(t)];for(const e of s)this.createProperty(e,t[e])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,e]of s)this.elementProperties.set(t,e)}this._$Eh=/* @__PURE__ */new Map;for(const[s,e]of this.elementProperties){const t=this._$Eu(s,e);void 0!==t&&this._$Eh.set(t,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)s.unshift(i(t))}else void 0!==t&&s.push(i(t));return s}static _$Eu(t,s){const e=s.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=/* @__PURE__ */new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=/* @__PURE__ */new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=/* @__PURE__ */new Map,s=this.constructor.elementProperties;for(const e of s.keys())this.hasOwnProperty(e)&&(t.set(e,this[e]),delete this[e]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,o)=>{if(s)e.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of o){const o=document.createElement("style"),r=t.litNonce;void 0!==r&&o.setAttribute("nonce",r),o.textContent=s.cssText,e.appendChild(o)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,e){this._$AK(t,e)}_$ET(t,s){const e=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,e);if(void 0!==o&&!0===e.reflect){const r=(void 0!==e.converter?.toAttribute?e.converter:_).toAttribute(s,e.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,s){const e=this.constructor,o=e._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=e.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:_;this._$Em=o,this[o]=r.fromAttribute(s,t.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(t,s,e){if(void 0!==t){const o=this.constructor,r=this[t];if(e??=o.getPropertyOptions(t),!((e.hasChanged??x)(r,s)||e.useDefault&&e.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,e))))return;this.C(t,s,e)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,s,{useDefault:e,reflect:o,wrapped:r},a){e&&!(this._$Ej??=/* @__PURE__ */new Map).has(t)&&(this._$Ej.set(t,a??s??this[t]),!0!==r||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||e||(s=void 0),this._$AL.set(t,s)),!0===o&&this._$Em!==t&&(this._$Eq??=/* @__PURE__ */new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,e]of t){const{wrapped:t}=e,o=this[s];!0!==t||this._$AL.has(s)||void 0===o||this.C(s,void 0,e,o)}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=/* @__PURE__ */new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[b("elementProperties")]=/* @__PURE__ */new Map,y[b("finalized")]=/* @__PURE__ */new Map,f?.({ReactiveElement:y}),(g.reactiveElementVersions??=[]).push("2.1.0");const w=globalThis,k=w.trustedTypes,z=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,$="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,C="?"+S,E=`<${C}>`,A=document,q=()=>A.createComment(""),O=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,D="[ \t\n\f\r]",M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,R=/>/g,T=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),L=/'/g,B=/"/g,I=/^(?:script|style|textarea|title)$/i,j=(G=1,(t,...s)=>({_$litType$:G,strings:t,values:s})),N=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),F=/* @__PURE__ */new WeakMap,H=A.createTreeWalker(A,129);var G;function K(t,s){if(!P(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==z?z.createHTML(s):s}class W{constructor({strings:t,_$litType$:s},e){let o;this.parts=[];let r=0,a=0;const i=t.length-1,d=this.parts,[n,l]=((t,s)=>{const e=t.length-1,o=[];let r,a=2===s?"<svg>":3===s?"<math>":"",i=M;for(let d=0;d<e;d++){const s=t[d];let e,n,l=-1,c=0;for(;c<s.length&&(i.lastIndex=c,n=i.exec(s),null!==n);)c=i.lastIndex,i===M?"!--"===n[1]?i=V:void 0!==n[1]?i=R:void 0!==n[2]?(I.test(n[2])&&(r=RegExp("</"+n[2],"g")),i=T):void 0!==n[3]&&(i=T):i===T?">"===n[0]?(i=r??M,l=-1):void 0===n[1]?l=-2:(l=i.lastIndex-n[2].length,e=n[1],i=void 0===n[3]?T:'"'===n[3]?B:L):i===B||i===L?i=T:i===V||i===R?i=M:(i=T,r=void 0);const h=i===T&&t[d+1].startsWith("/>")?" ":"";a+=i===M?s+E:l>=0?(o.push(e),s.slice(0,l)+$+s.slice(l)+S+h):s+S+(-2===l?d:h)}return[K(t,a+(t[e]||"<?>")+(2===s?"</svg>":3===s?"</math>":"")),o]})(t,s);if(this.el=W.createElement(n,e),H.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=H.nextNode())&&d.length<i;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith($)){const s=l[a++],e=o.getAttribute(t).split(S),i=/([.?@])?(.*)/.exec(s);d.push({type:1,index:r,name:i[2],strings:e,ctor:"."===i[1]?J:"?"===i[1]?tt:"@"===i[1]?st:Y}),o.removeAttribute(t)}else t.startsWith(S)&&(d.push({type:6,index:r}),o.removeAttribute(t));if(I.test(o.tagName)){const t=o.textContent.split(S),s=t.length-1;if(s>0){o.textContent=k?k.emptyScript:"";for(let e=0;e<s;e++)o.append(t[e],q()),H.nextNode(),d.push({type:2,index:++r});o.append(t[s],q())}}}else if(8===o.nodeType)if(o.data===C)d.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(S,t+1));)d.push({type:7,index:r}),t+=S.length-1}r++}}static createElement(t,s){const e=A.createElement("template");return e.innerHTML=t,e}}function Z(t,s,e=t,o){if(s===N)return s;let r=void 0!==o?e._$Co?.[o]:e._$Cl;const a=O(s)?void 0:s._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),void 0===a?r=void 0:(r=new a(t),r._$AT(t,e,o)),void 0!==o?(e._$Co??=[])[o]=r:e._$Cl=r),void 0!==r&&(s=Z(t,r._$AS(t,s.values),r,o)),s}class Q{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:e}=this._$AD,o=(t?.creationScope??A).importNode(s,!0);H.currentNode=o;let r=H.nextNode(),a=0,i=0,d=e[0];for(;void 0!==d;){if(a===d.index){let s;2===d.type?s=new X(r,r.nextSibling,this,t):1===d.type?s=new d.ctor(r,d.name,d.strings,this,t):6===d.type&&(s=new et(r,this,t)),this._$AV.push(s),d=e[++i]}a!==d?.index&&(r=H.nextNode(),a++)}return H.currentNode=A,o}p(t){let s=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,s),s+=e.strings.length-2):e._$AI(t[s])),s++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,s,e,o){this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=e,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return void 0!==s&&11===t?.nodeType&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=Z(this,t,s),O(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==N&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>P(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==U&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=W.createElement(K(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===o)this._$AH.p(s);else{const t=new Q(o,this),e=t.u(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let s=F.get(t.strings);return void 0===s&&F.set(t.strings,s=new W(t)),s}k(t){P(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let e,o=0;for(const r of t)o===s.length?s.push(e=new X(this.O(q()),this.O(q()),this,this.options)):e=s[o],e._$AI(r),o++;o<s.length&&(this._$AR(e&&e._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Y{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,e,o,r){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=r,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=U}_$AI(t,s=this,e,o){const r=this.strings;let a=!1;if(void 0===r)t=Z(this,t,s,0),a=!O(t)||t!==this._$AH&&t!==N,a&&(this._$AH=t);else{const o=t;let i,d;for(t=r[0],i=0;i<r.length-1;i++)d=Z(this,o[e+i],s,i),d===N&&(d=this._$AH[i]),a||=!O(d)||d!==this._$AH[i],d===U?t=U:t!==U&&(t+=(d??"")+r[i+1]),this._$AH[i]=d}a&&!o&&this.j(t)}j(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class J extends Y{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===U?void 0:t}}class tt extends Y{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==U)}}class st extends Y{constructor(t,s,e,o,r){super(t,s,e,o,r),this.type=5}_$AI(t,s=this){if((t=Z(this,t,s,0)??U)===N)return;const e=this._$AH,o=t===U&&e!==U||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,r=t!==U&&(e===U||o);o&&this.element.removeEventListener(this.name,this,e),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class et{constructor(t,s,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const ot=w.litHtmlPolyfillSupport;ot?.(W,X),(w.litHtmlVersions??=[]).push("3.3.0");const rt=globalThis;let at=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,s,e)=>{const o=e?.renderBefore??s;let r=o._$litPart$;if(void 0===r){const t=e?.renderBefore??null;o._$litPart$=r=new X(s.insertBefore(q(),t),t,void 0,e??{})}return r._$AI(t),r})(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return N}};at._$litElement$=!0,at.finalized=!0,rt.litElementHydrateSupport?.({LitElement:at});const it=rt.litElementPolyfillSupport;it?.({LitElement:at}),(rt.litElementVersions??=[]).push("4.2.0");const dt={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:x},nt=(t=dt,s,e)=>{const{kind:o,metadata:r}=e;let a=globalThis.litPropertyMetadata.get(r);if(void 0===a&&globalThis.litPropertyMetadata.set(r,a=/* @__PURE__ */new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),a.set(e.name,t),"accessor"===o){const{name:o}=e;return{set(e){const r=s.get.call(this);s.set.call(this,e),this.requestUpdate(o,r,t)},init(s){return void 0!==s&&this.C(o,void 0,t,s),s}}}if("setter"===o){const{name:o}=e;return function(e){const r=this[o];s.call(this,e),this.requestUpdate(o,r,t)}}throw Error("Unsupported decorator location: "+o)};function lt(t){return(s,e)=>"object"==typeof e?nt(t,s,e):((t,s,e)=>{const o=s.hasOwnProperty(e);return s.constructor.createProperty(e,t),o?Object.getOwnPropertyDescriptor(s,e):void 0})(t,s,e)}function ct(t){return lt({...t,state:!0,attribute:!1})}function ht(t,s){return(s,e,o)=>((t,s,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&"object"!=typeof s&&Object.defineProperty(t,s,e),e))(s,e,{get(){return(s=>s.renderRoot?.querySelector(t)??null)(this)}})}function pt(t){return s=>{customElements.get(t)||(t=>(s,e)=>{void 0!==e?e.addInitializer((()=>{customElements.define(t,s)})):customElements.define(t,s)})(t)(s)}}const gt=a`
|
|
596
2
|
:host {
|
|
597
3
|
--_sds-alert-background-color: var(--sds-alert-background-color, var(--sds-color-alert-info-surface-tinted));
|
|
598
4
|
|
|
@@ -766,144 +172,7 @@ const styles$h = i$4`
|
|
|
766
172
|
margin: 0 !important;
|
|
767
173
|
max-width: var(--_sds-alert-max-line-width) !important;
|
|
768
174
|
}
|
|
769
|
-
|
|
770
|
-
/**
|
|
771
|
-
* @license
|
|
772
|
-
* Copyright 2018 Google LLC
|
|
773
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
774
|
-
*/
|
|
775
|
-
const o$1 = (o2) => o2 ?? E;
|
|
776
|
-
/**
|
|
777
|
-
* @license
|
|
778
|
-
* Copyright 2017 Google LLC
|
|
779
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
780
|
-
*/
|
|
781
|
-
const t$1 = { ATTRIBUTE: 1, CHILD: 2 }, e$2 = (t2) => (...e3) => ({ _$litDirective$: t2, values: e3 });
|
|
782
|
-
class i2 {
|
|
783
|
-
constructor(t2) {
|
|
784
|
-
}
|
|
785
|
-
get _$AU() {
|
|
786
|
-
return this._$AM._$AU;
|
|
787
|
-
}
|
|
788
|
-
_$AT(t2, e3, i3) {
|
|
789
|
-
this._$Ct = t2, this._$AM = e3, this._$Ci = i3;
|
|
790
|
-
}
|
|
791
|
-
_$AS(t2, e3) {
|
|
792
|
-
return this.update(t2, e3);
|
|
793
|
-
}
|
|
794
|
-
update(t2, e3) {
|
|
795
|
-
return this.render(...e3);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* @license
|
|
800
|
-
* Copyright 2017 Google LLC
|
|
801
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
802
|
-
*/
|
|
803
|
-
let e$1 = class e extends i2 {
|
|
804
|
-
constructor(i3) {
|
|
805
|
-
if (super(i3), this.it = E, i3.type !== t$1.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
806
|
-
}
|
|
807
|
-
render(r2) {
|
|
808
|
-
if (r2 === E || null == r2) return this._t = void 0, this.it = r2;
|
|
809
|
-
if (r2 === T) return r2;
|
|
810
|
-
if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
811
|
-
if (r2 === this.it) return this._t;
|
|
812
|
-
this.it = r2;
|
|
813
|
-
const s2 = [r2];
|
|
814
|
-
return s2.raw = s2, this._t = { _$litType$: this.constructor.resultType, strings: s2, values: [] };
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
e$1.directiveName = "unsafeHTML", e$1.resultType = 1;
|
|
818
|
-
/**
|
|
819
|
-
* @license
|
|
820
|
-
* Copyright 2017 Google LLC
|
|
821
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
822
|
-
*/
|
|
823
|
-
class t extends e$1 {
|
|
824
|
-
}
|
|
825
|
-
t.directiveName = "unsafeSVG", t.resultType = 2;
|
|
826
|
-
const o = e$2(t);
|
|
827
|
-
const SYSTEM_ICONS = [
|
|
828
|
-
"arrow_forward-material-outlined",
|
|
829
|
-
"check_circle-material-filled",
|
|
830
|
-
"close-material-outlined",
|
|
831
|
-
"dangerous-material-filled",
|
|
832
|
-
"InformationSquareFill-aksel-filled",
|
|
833
|
-
"lock-material-filled",
|
|
834
|
-
"search-material-filled",
|
|
835
|
-
"warning-material-filled",
|
|
836
|
-
"chevron_up-material-filled"
|
|
837
|
-
];
|
|
838
|
-
const isSystemIcon = (name) => {
|
|
839
|
-
return SYSTEM_ICONS.includes(name);
|
|
840
|
-
};
|
|
841
|
-
const systemIcons = {
|
|
842
|
-
"arrow_forward-material-outlined": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M662.82-440.39H145.87v-79.22h516.95L423.87-758.57 480-814.7 814.7-480 480-145.87l-56.13-55.56z"/></svg>`,
|
|
843
|
-
"check_circle-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="m419.87-289.52 289.22-289.22-57.31-56.87L419.87-403.7 304.96-518.61l-56.31 56.87zm60.21 223.65q-85.47 0-161.01-32.39-75.53-32.4-131.97-88.84T98.26-318.99q-32.39-75.46-32.39-160.93 0-86.47 32.39-162.01 32.4-75.53 88.75-131.5t131.85-88.62 161.01-32.65q86.52 0 162.12 32.61 75.61 32.6 131.53 88.5 55.93 55.89 88.55 131.45Q894.7-566.58 894.7-480q0 85.55-32.65 161.07-32.65 75.53-88.62 131.9T642.01-98.26q-75.46 32.39-161.93 32.39"/></svg>`,
|
|
844
|
-
"close-material-outlined": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M249-193.43 193.43-249l231-231-231-231L249-766.57l231 231 231-231L766.57-711l-231 231 231 231L711-193.43l-231-231z"/></svg>`,
|
|
845
|
-
"dangerous-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M324.35-105.87 105.87-324.35v-311.87L324.35-854.7h311.87L854.7-636.22v311.87L636.22-105.87zm34.91-206.87L480-433.48l120.74 120.74 47.09-46.52L526.52-480l121.31-120.74-47.09-47.09L480-526.52 359.26-647.83l-46.52 47.09L433.48-480 312.74-359.26z"/></svg>`,
|
|
846
|
-
"InformationSquareFill-aksel-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M3.25 4A.75.75 0 0 1 4 3.25h16a.75.75 0 0 1 .75.75v16a.75.75 0 0 1-.75.75H4a.75.75 0 0 1-.75-.75zM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0m-1.25 3a.75.75 0 0 1 .75-.75H12a.75.75 0 0 1 .75.75v4.75h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5h.75v-4h-.75a.75.75 0 0 1-.75-.75" clip-rule="evenodd"/></svg>`,
|
|
847
|
-
"lock-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M225.09-67q-32.68 0-55.95-23.27t-23.27-55.95v-423.82q0-32.91 23.27-56.35t55.95-23.44h58.69v-83.56q0-82.44 57.17-140.18 57.16-57.73 139.02-57.73t139.05 57.73q57.2 57.74 57.2 140.18v83.56h58.69q32.91 0 56.35 23.44t23.44 56.35v423.82q0 32.68-23.44 55.95T734.91-67zm255.08-214.13q31.83 0 54.33-22.03t22.5-52.97q0-30-22.67-54.5t-54.5-24.5-54.33 24.5-22.5 55 22.67 52.5 54.5 22M363-649.83h234v-83.43q0-49.96-33.79-84.11-33.8-34.15-82.96-34.15t-83.21 34.15Q363-783.22 363-733.26z"/></svg>`,
|
|
848
|
-
"search-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M795.43-105.17 529.04-371q-29.43 24.26-69.11 37.94-39.67 13.67-85.32 13.67-112.12 0-189.87-77.83Q107-475.04 107-585t77.83-187.78q77.82-77.83 188.28-77.83t187.78 77.83q77.33 77.82 77.33 187.93 0 43.98-13.15 83.13-13.16 39.15-39.46 73.59L853-162.74zM373.81-398.61q77.66 0 131.42-54.53Q559-507.67 559-585t-53.85-131.86-131.34-54.53q-78.33 0-132.96 54.53T186.22-585t54.55 131.86 133.04 54.53"/></svg>`,
|
|
849
|
-
"warning-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M27.56-112.65 480-894.7l452.44 782.05zm456.62-125.48q13.15 0 22.61-9.64 9.47-9.65 9.47-22.8t-9.64-22.33q-9.65-9.19-22.8-9.19t-22.61 9.36q-9.47 9.36-9.47 22.51t9.64 22.62q9.65 9.47 22.8 9.47M454-348h60v-219.48h-60z"/></svg>`,
|
|
850
|
-
"chevron_up-material-filled": `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 32 32"><path d="m16 11.5 8 8-1.867 1.867L16 15.233l-6.133 6.134L8 19.5z"/></svg>`
|
|
851
|
-
};
|
|
852
|
-
const loadLocalIcons = (name) => import(`@politiet/sheriff-icons/dist/assets/${name}.js`).then(({ default: svg }) => {
|
|
853
|
-
return svg;
|
|
854
|
-
}).catch((error) => {
|
|
855
|
-
console.log(error);
|
|
856
|
-
});
|
|
857
|
-
const loadCdnIcons = (name) => fetch(`https://cdn.jsdelivr.net/npm/@politiet/sheriff-icons/dist/assets/${name}.svg`).then((response) => {
|
|
858
|
-
if (!response.ok) {
|
|
859
|
-
throw new TypeError(`Sheriff: unknown icon: '${name}'`);
|
|
860
|
-
}
|
|
861
|
-
return response.text();
|
|
862
|
-
});
|
|
863
|
-
class SDSIconLoader {
|
|
864
|
-
constructor() {
|
|
865
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
866
|
-
this._loadLocal = false;
|
|
867
|
-
this._disableSystemIcons = false;
|
|
868
|
-
this.resolver = this._loadLocal ? loadLocalIcons : loadCdnIcons;
|
|
869
|
-
}
|
|
870
|
-
get loadLocal() {
|
|
871
|
-
return this._loadLocal;
|
|
872
|
-
}
|
|
873
|
-
set loadLocal(value) {
|
|
874
|
-
this._loadLocal = value;
|
|
875
|
-
this.resolver = value ? loadLocalIcons : loadCdnIcons;
|
|
876
|
-
}
|
|
877
|
-
set disableSystemIcons(value) {
|
|
878
|
-
this._disableSystemIcons = value;
|
|
879
|
-
}
|
|
880
|
-
resolve(name, onResolved) {
|
|
881
|
-
if (!this._disableSystemIcons && isSystemIcon(name)) {
|
|
882
|
-
onResolved(systemIcons[name]);
|
|
883
|
-
return;
|
|
884
|
-
}
|
|
885
|
-
let cached = this.cache.get(name);
|
|
886
|
-
if (typeof cached === "string") {
|
|
887
|
-
onResolved(cached);
|
|
888
|
-
return;
|
|
889
|
-
}
|
|
890
|
-
if (!cached) {
|
|
891
|
-
cached = this.resolver(name).catch(() => "").then((svg) => {
|
|
892
|
-
this.cache.set(name, svg);
|
|
893
|
-
return svg;
|
|
894
|
-
});
|
|
895
|
-
this.cache.set(name, cached);
|
|
896
|
-
}
|
|
897
|
-
cached.then(onResolved);
|
|
898
|
-
}
|
|
899
|
-
clear() {
|
|
900
|
-
this.cache.clear();
|
|
901
|
-
}
|
|
902
|
-
get currentLoader() {
|
|
903
|
-
return this.resolver;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
const styles$g = i$4`
|
|
175
|
+
`,vt=t=>t??U,ut=1,ft=2,bt=t=>(...s)=>({_$litDirective$:t,values:s});class _t{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,e){this._$Ct=t,this._$AM=s,this._$Ci=e}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}}let xt=class extends _t{constructor(t){if(super(t),this.it=U,t.type!==ft)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===U||null==t)return this._t=void 0,this.it=t;if(t===N)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const s=[t];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};xt.directiveName="unsafeHTML",xt.resultType=1;class mt extends xt{}mt.directiveName="unsafeSVG",mt.resultType=2;const yt=bt(mt),wt=["arrow_forward-material-outlined","check_circle-material-filled","close-material-outlined","dangerous-material-filled","InformationSquareFill-aksel-filled","lock-material-filled","search-material-filled","warning-material-filled","chevron_up-material-filled"],kt={"arrow_forward-material-outlined":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M662.82-440.39H145.87v-79.22h516.95L423.87-758.57 480-814.7 814.7-480 480-145.87l-56.13-55.56z"/></svg>',"check_circle-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="m419.87-289.52 289.22-289.22-57.31-56.87L419.87-403.7 304.96-518.61l-56.31 56.87zm60.21 223.65q-85.47 0-161.01-32.39-75.53-32.4-131.97-88.84T98.26-318.99q-32.39-75.46-32.39-160.93 0-86.47 32.39-162.01 32.4-75.53 88.75-131.5t131.85-88.62 161.01-32.65q86.52 0 162.12 32.61 75.61 32.6 131.53 88.5 55.93 55.89 88.55 131.45Q894.7-566.58 894.7-480q0 85.55-32.65 161.07-32.65 75.53-88.62 131.9T642.01-98.26q-75.46 32.39-161.93 32.39"/></svg>',"close-material-outlined":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M249-193.43 193.43-249l231-231-231-231L249-766.57l231 231 231-231L766.57-711l-231 231 231 231L711-193.43l-231-231z"/></svg>',"dangerous-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M324.35-105.87 105.87-324.35v-311.87L324.35-854.7h311.87L854.7-636.22v311.87L636.22-105.87zm34.91-206.87L480-433.48l120.74 120.74 47.09-46.52L526.52-480l121.31-120.74-47.09-47.09L480-526.52 359.26-647.83l-46.52 47.09L433.48-480 312.74-359.26z"/></svg>',"InformationSquareFill-aksel-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M3.25 4A.75.75 0 0 1 4 3.25h16a.75.75 0 0 1 .75.75v16a.75.75 0 0 1-.75.75H4a.75.75 0 0 1-.75-.75zM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0m-1.25 3a.75.75 0 0 1 .75-.75H12a.75.75 0 0 1 .75.75v4.75h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5h.75v-4h-.75a.75.75 0 0 1-.75-.75" clip-rule="evenodd"/></svg>',"lock-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M225.09-67q-32.68 0-55.95-23.27t-23.27-55.95v-423.82q0-32.91 23.27-56.35t55.95-23.44h58.69v-83.56q0-82.44 57.17-140.18 57.16-57.73 139.02-57.73t139.05 57.73q57.2 57.74 57.2 140.18v83.56h58.69q32.91 0 56.35 23.44t23.44 56.35v423.82q0 32.68-23.44 55.95T734.91-67zm255.08-214.13q31.83 0 54.33-22.03t22.5-52.97q0-30-22.67-54.5t-54.5-24.5-54.33 24.5-22.5 55 22.67 52.5 54.5 22M363-649.83h234v-83.43q0-49.96-33.79-84.11-33.8-34.15-82.96-34.15t-83.21 34.15Q363-783.22 363-733.26z"/></svg>',"search-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M795.43-105.17 529.04-371q-29.43 24.26-69.11 37.94-39.67 13.67-85.32 13.67-112.12 0-189.87-77.83Q107-475.04 107-585t77.83-187.78q77.82-77.83 188.28-77.83t187.78 77.83q77.33 77.82 77.33 187.93 0 43.98-13.15 83.13-13.16 39.15-39.46 73.59L853-162.74zM373.81-398.61q77.66 0 131.42-54.53Q559-507.67 559-585t-53.85-131.86-131.34-54.53q-78.33 0-132.96 54.53T186.22-585t54.55 131.86 133.04 54.53"/></svg>',"warning-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 -960 960 960"><path d="M27.56-112.65 480-894.7l452.44 782.05zm456.62-125.48q13.15 0 22.61-9.64 9.47-9.65 9.47-22.8t-9.64-22.33q-9.65-9.19-22.8-9.19t-22.61 9.36q-9.47 9.36-9.47 22.51t9.64 22.62q9.65 9.47 22.8 9.47M454-348h60v-219.48h-60z"/></svg>',"chevron_up-material-filled":'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 32 32"><path d="m16 11.5 8 8-1.867 1.867L16 15.233l-6.133 6.134L8 19.5z"/></svg>'},zt=t=>import(`@politiet/sheriff-icons/dist/assets/${t}.js`).then((({default:t})=>t)).catch((t=>{console.log(t)})),$t=t=>fetch(`https://cdn.jsdelivr.net/npm/@politiet/sheriff-icons/dist/assets/${t}.svg`).then((s=>{if(!s.ok)throw new TypeError(`Sheriff: unknown icon: '${t}'`);return s.text()}));const St=a`
|
|
907
176
|
:host {
|
|
908
177
|
--_sds-icon-size: var(--sds-icon-size, var(--sds-components-icon-md));
|
|
909
178
|
--_sds-icon-color: var(--sds-icon-color, var(--sds-color-text-subtle, var(--sds-color-neutral-text-subtle)));
|
|
@@ -935,108 +204,11 @@ const styles$g = i$4`
|
|
|
935
204
|
height: 100%;
|
|
936
205
|
overflow: hidden;
|
|
937
206
|
}
|
|
938
|
-
`;
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
942
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
943
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
944
|
-
if (decorator = decorators[i3])
|
|
945
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
946
|
-
if (kind && result) __defProp$h(target, key, result);
|
|
947
|
-
return result;
|
|
948
|
-
};
|
|
949
|
-
let SDSIcon = class extends i$1 {
|
|
950
|
-
constructor() {
|
|
951
|
-
super(...arguments);
|
|
952
|
-
this.name = "";
|
|
953
|
-
this.color = "";
|
|
954
|
-
this.label = "";
|
|
955
|
-
this.svg = "";
|
|
956
|
-
}
|
|
957
|
-
static setLoadLocal(loadLocal) {
|
|
958
|
-
this.iconLoader.loadLocal = loadLocal;
|
|
959
|
-
}
|
|
960
|
-
static registerResolver(resolver) {
|
|
961
|
-
this.iconLoader.resolver = resolver;
|
|
962
|
-
}
|
|
963
|
-
render() {
|
|
964
|
-
return x`
|
|
965
|
-
<div class="sds-icon" role="${o$1(this.label ? "img" : void 0)}" style="${o$1(this.color ? `color:${this.color}` : void 0)}" aria-label="${o$1(this.label)}">
|
|
966
|
-
${this.name ? x`<slot aria-hidden="true">${o(this.svg)}</slot>` : x`<slot aria-hidden="true"></slot>`}
|
|
207
|
+
`;var Ct=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,At=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Et(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Ct(s,e,a),a};let qt=class extends at{constructor(){super(...arguments),this.name="",this.color="",this.label="",this.svg=""}static setLoadLocal(t){this.iconLoader.loadLocal=t}static registerResolver(t){this.iconLoader.resolver=t}render(){return j`
|
|
208
|
+
<div class="sds-icon" role="${vt(this.label?"img":void 0)}" style="${vt(this.color?`color:${this.color}`:void 0)}" aria-label="${vt(this.label)}">
|
|
209
|
+
${this.name?j`<slot aria-hidden="true">${yt(this.svg)}</slot>`:j`<slot aria-hidden="true"></slot>`}
|
|
967
210
|
</div>
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
/**
|
|
971
|
-
* Wraps the icon loader's callback in a promise. Even if the loader
|
|
972
|
-
* calls the callback synchronously, awaiting the promise defers the
|
|
973
|
-
* property update to the next microtask.
|
|
974
|
-
*/
|
|
975
|
-
async fetchIcon() {
|
|
976
|
-
if (!this.name) {
|
|
977
|
-
this.svg = "";
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
980
|
-
const svg = await new Promise((resolve) => {
|
|
981
|
-
SDSIcon.iconLoader.resolve(this.name, resolve);
|
|
982
|
-
});
|
|
983
|
-
this.svg = svg;
|
|
984
|
-
}
|
|
985
|
-
updated(changedProperties) {
|
|
986
|
-
super.updated(changedProperties);
|
|
987
|
-
if (changedProperties.has("name") && this.name) {
|
|
988
|
-
void this.fetchIcon();
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
};
|
|
992
|
-
SDSIcon.styles = [styles$g];
|
|
993
|
-
SDSIcon.iconLoader = new SDSIconLoader();
|
|
994
|
-
__decorateClass$h([
|
|
995
|
-
n2({ type: String, reflect: true })
|
|
996
|
-
], SDSIcon.prototype, "name", 2);
|
|
997
|
-
__decorateClass$h([
|
|
998
|
-
n2({ type: String, reflect: true })
|
|
999
|
-
], SDSIcon.prototype, "size", 2);
|
|
1000
|
-
__decorateClass$h([
|
|
1001
|
-
n2({ type: String, reflect: true })
|
|
1002
|
-
], SDSIcon.prototype, "color", 2);
|
|
1003
|
-
__decorateClass$h([
|
|
1004
|
-
n2({ type: String, reflect: true })
|
|
1005
|
-
], SDSIcon.prototype, "label", 2);
|
|
1006
|
-
__decorateClass$h([
|
|
1007
|
-
r()
|
|
1008
|
-
], SDSIcon.prototype, "svg", 2);
|
|
1009
|
-
SDSIcon = __decorateClass$h([
|
|
1010
|
-
guardedCustomElement("sds-icon")
|
|
1011
|
-
], SDSIcon);
|
|
1012
|
-
/**
|
|
1013
|
-
* @license
|
|
1014
|
-
* Copyright 2018 Google LLC
|
|
1015
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1016
|
-
*/
|
|
1017
|
-
const e2 = e$2(class extends i2 {
|
|
1018
|
-
constructor(t2) {
|
|
1019
|
-
if (super(t2), t2.type !== t$1.ATTRIBUTE || "class" !== t2.name || t2.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
1020
|
-
}
|
|
1021
|
-
render(t2) {
|
|
1022
|
-
return " " + Object.keys(t2).filter((s2) => t2[s2]).join(" ") + " ";
|
|
1023
|
-
}
|
|
1024
|
-
update(s2, [i3]) {
|
|
1025
|
-
if (void 0 === this.st) {
|
|
1026
|
-
this.st = /* @__PURE__ */ new Set(), void 0 !== s2.strings && (this.nt = new Set(s2.strings.join(" ").split(/\s/).filter((t2) => "" !== t2)));
|
|
1027
|
-
for (const t2 in i3) i3[t2] && !this.nt?.has(t2) && this.st.add(t2);
|
|
1028
|
-
return this.render(i3);
|
|
1029
|
-
}
|
|
1030
|
-
const r2 = s2.element.classList;
|
|
1031
|
-
for (const t2 of this.st) t2 in i3 || (r2.remove(t2), this.st.delete(t2));
|
|
1032
|
-
for (const t2 in i3) {
|
|
1033
|
-
const s3 = !!i3[t2];
|
|
1034
|
-
s3 === this.st.has(t2) || this.nt?.has(t2) || (s3 ? (r2.add(t2), this.st.add(t2)) : (r2.remove(t2), this.st.delete(t2)));
|
|
1035
|
-
}
|
|
1036
|
-
return T;
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
const styles$f = i$4`
|
|
211
|
+
`}async fetchIcon(){if(!this.name)return void(this.svg="");const t=await new Promise((t=>{qt.iconLoader.resolve(this.name,t)}));this.svg=t}updated(t){super.updated(t),t.has("name")&&this.name&&this.fetchIcon()}};qt.styles=[St],qt.iconLoader=new class{constructor(){this.cache=/* @__PURE__ */new Map,this._loadLocal=!1,this._disableSystemIcons=!1,this.resolver=this._loadLocal?zt:$t}get loadLocal(){return this._loadLocal}set loadLocal(t){this._loadLocal=t,this.resolver=t?zt:$t}set disableSystemIcons(t){this._disableSystemIcons=t}resolve(t,s){if(!this._disableSystemIcons&&(t=>wt.includes(t))(t))return void s(kt[t]);let e=this.cache.get(t);"string"!=typeof e?(e||(e=this.resolver(t).catch((()=>"")).then((s=>(this.cache.set(t,s),s))),this.cache.set(t,e)),e.then(s)):s(e)}clear(){this.cache.clear()}get currentLoader(){return this.resolver}},At([lt({type:String,reflect:!0})],qt.prototype,"name",2),At([lt({type:String,reflect:!0})],qt.prototype,"size",2),At([lt({type:String,reflect:!0})],qt.prototype,"color",2),At([lt({type:String,reflect:!0})],qt.prototype,"label",2),At([ct()],qt.prototype,"svg",2),qt=At([pt("sds-icon")],qt);const Ot=bt(class extends _t{constructor(t){if(super(t),t.type!==ut||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(t,[s]){if(void 0===this.st){this.st=/* @__PURE__ */new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(s)}const e=t.element.classList;for(const o of this.st)o in s||(e.remove(o),this.st.delete(o));for(const o in s){const t=!!s[o];t===this.st.has(o)||this.nt?.has(o)||(t?(e.add(o),this.st.add(o)):(e.remove(o),this.st.delete(o)))}return N}}),Pt=a`
|
|
1040
212
|
:host {
|
|
1041
213
|
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));
|
|
1042
214
|
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));
|
|
@@ -1046,7 +218,7 @@ const styles$f = i$4`
|
|
|
1046
218
|
--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));
|
|
1047
219
|
--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));
|
|
1048
220
|
--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));
|
|
1049
|
-
--_sds-button-font-size: var(--sds-button-font-size, var(--sds-
|
|
221
|
+
--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-lg));
|
|
1050
222
|
--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));
|
|
1051
223
|
--_sds-button-gap: var(--sds-button-gap, var(--sds-spacing-3xs));
|
|
1052
224
|
--_sds-button-line-height: var(--sds-button-line-height, var(--sds-typography-body-md-desktop-line-height));
|
|
@@ -1169,6 +341,7 @@ const styles$f = i$4`
|
|
|
1169
341
|
--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));
|
|
1170
342
|
--_sds-button-padding-block: var(--sds-button-padding-block, var(--sds-spacing-4xs));
|
|
1171
343
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));
|
|
344
|
+
--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-md));
|
|
1172
345
|
|
|
1173
346
|
&:host([variant='tertiary']) {
|
|
1174
347
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);
|
|
@@ -1180,7 +353,7 @@ const styles$f = i$4`
|
|
|
1180
353
|
--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-sm));
|
|
1181
354
|
--_sds-button-padding-block: var(--sds-button-padding-block, 0);
|
|
1182
355
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));
|
|
1183
|
-
font-size:
|
|
356
|
+
--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-sm));
|
|
1184
357
|
|
|
1185
358
|
&:host([variant='tertiary']) {
|
|
1186
359
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);
|
|
@@ -1191,251 +364,39 @@ const styles$f = i$4`
|
|
|
1191
364
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);
|
|
1192
365
|
min-width: var(--_sds-button-min-height);
|
|
1193
366
|
}
|
|
1194
|
-
`;
|
|
1195
|
-
var __defProp$g = Object.defineProperty;
|
|
1196
|
-
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
1197
|
-
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
1198
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
1199
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
1200
|
-
if (decorator = decorators[i3])
|
|
1201
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1202
|
-
if (kind && result) __defProp$g(target, key, result);
|
|
1203
|
-
return result;
|
|
1204
|
-
};
|
|
1205
|
-
let SDSButton = class extends i$1 {
|
|
1206
|
-
constructor() {
|
|
1207
|
-
super();
|
|
1208
|
-
this.disabled = false;
|
|
1209
|
-
this.icon = false;
|
|
1210
|
-
this.loading = false;
|
|
1211
|
-
this.size = "lg";
|
|
1212
|
-
this.type = "button";
|
|
1213
|
-
this.value = "";
|
|
1214
|
-
this.variant = "primary";
|
|
1215
|
-
this._handleClick = (event) => {
|
|
1216
|
-
event.preventDefault();
|
|
1217
|
-
event.stopImmediatePropagation();
|
|
1218
|
-
if (!this.disabled) {
|
|
1219
|
-
switch (this.type) {
|
|
1220
|
-
case "submit": {
|
|
1221
|
-
const submitEvent = new CustomEvent("submit", {
|
|
1222
|
-
bubbles: true,
|
|
1223
|
-
composed: true,
|
|
1224
|
-
cancelable: true
|
|
1225
|
-
});
|
|
1226
|
-
const shouldSubmit = this.dispatchEvent(submitEvent);
|
|
1227
|
-
if (shouldSubmit) {
|
|
1228
|
-
if (this.form) {
|
|
1229
|
-
const root = this.getRootNode();
|
|
1230
|
-
const formElement = root.querySelector(`form#${this.form}`);
|
|
1231
|
-
formElement?.requestSubmit();
|
|
1232
|
-
} else if (this.internals.form) {
|
|
1233
|
-
this.internals.form.requestSubmit();
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
break;
|
|
1237
|
-
}
|
|
1238
|
-
case "reset": {
|
|
1239
|
-
const resetEvent = new CustomEvent("reset", {
|
|
1240
|
-
bubbles: true,
|
|
1241
|
-
composed: true,
|
|
1242
|
-
cancelable: true
|
|
1243
|
-
});
|
|
1244
|
-
const shouldReset = this.dispatchEvent(resetEvent);
|
|
1245
|
-
if (shouldReset) {
|
|
1246
|
-
if (this.form) {
|
|
1247
|
-
const root = this.getRootNode();
|
|
1248
|
-
const formElement = root.querySelector(`form#${this.form}`);
|
|
1249
|
-
formElement?.reset();
|
|
1250
|
-
} else if (this.internals.form) {
|
|
1251
|
-
this.internals.form.reset();
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
break;
|
|
1255
|
-
}
|
|
1256
|
-
default:
|
|
1257
|
-
this.dispatchEvent(
|
|
1258
|
-
new CustomEvent("click", {
|
|
1259
|
-
bubbles: true,
|
|
1260
|
-
composed: true
|
|
1261
|
-
})
|
|
1262
|
-
);
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
};
|
|
1266
|
-
this.internals = this.attachInternals();
|
|
1267
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
1268
|
-
}
|
|
1269
|
-
updated(changed) {
|
|
1270
|
-
if (changed.has("variant") && this.variant === "critical") {
|
|
1271
|
-
this.setAttribute("data-palette", "danger");
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
focus() {
|
|
1275
|
-
if (!this.disabled) this.shadowRoot?.querySelector("button")?.focus();
|
|
1276
|
-
}
|
|
1277
|
-
blur() {
|
|
1278
|
-
if (!this.disabled) this.shadowRoot?.querySelector("button")?.blur();
|
|
1279
|
-
}
|
|
1280
|
-
click() {
|
|
1281
|
-
if (!this.disabled) this.shadowRoot?.querySelector("button")?.click();
|
|
1282
|
-
}
|
|
1283
|
-
render() {
|
|
1284
|
-
const buttonClasses = {
|
|
1285
|
-
"sds-button": true,
|
|
1286
|
-
"sds-button--as-link": !!this.href
|
|
1287
|
-
};
|
|
1288
|
-
if (this.href) {
|
|
1289
|
-
return x` <a id="link" class="${e2(buttonClasses)}" href="${this.href}" target="${o$1(this.target)}">
|
|
367
|
+
`;var Dt=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Vt=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Mt(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Dt(s,e,a),a};let Rt=class extends at{constructor(){super(),this.disabled=!1,this.icon=!1,this.loading=!1,this.size="lg",this.type="button",this.value="",this.variant="primary",this._handleClick=t=>{if(t.preventDefault(),t.stopImmediatePropagation(),!this.disabled)switch(this.type){case"submit":{const t=new CustomEvent("submit",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t))if(this.form){const t=this.getRootNode().querySelector(`form#${this.form}`);t?.requestSubmit()}else this.internals.form&&this.internals.form.requestSubmit();break}case"reset":{const t=new CustomEvent("reset",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t))if(this.form){const t=this.getRootNode().querySelector(`form#${this.form}`);t?.reset()}else this.internals.form&&this.internals.form.reset();break}default:this.dispatchEvent(new CustomEvent("click",{bubbles:!0,composed:!0}))}},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}updated(t){t.has("variant")&&"critical"===this.variant&&this.setAttribute("data-palette","danger")}focus(){this.disabled||this.shadowRoot?.querySelector("button")?.focus()}blur(){this.disabled||this.shadowRoot?.querySelector("button")?.blur()}click(){this.disabled||this.shadowRoot?.querySelector("button")?.click()}render(){const t={"sds-button":!0,"sds-button--as-link":!!this.href};return this.href?j` <a id="link" class="${Ot(t)}" href="${this.href}" target="${vt(this.target)}">
|
|
1290
368
|
<slot name="before"></slot>
|
|
1291
369
|
<slot></slot>
|
|
1292
370
|
<slot name="after"></slot>
|
|
1293
|
-
</a
|
|
1294
|
-
}
|
|
1295
|
-
return x`
|
|
371
|
+
</a>`:j`
|
|
1296
372
|
<button
|
|
1297
373
|
id="control"
|
|
1298
|
-
form="${
|
|
1299
|
-
class="${
|
|
374
|
+
form="${vt(this.form)}"
|
|
375
|
+
class="${Ot(t)}"
|
|
1300
376
|
type="${this.type}"
|
|
1301
|
-
name="${
|
|
1302
|
-
value="${
|
|
377
|
+
name="${vt(this.name)}"
|
|
378
|
+
value="${vt(this.value)}"
|
|
1303
379
|
?disabled="${this.disabled}"
|
|
1304
380
|
@click="${this._handleClick}"
|
|
1305
381
|
>
|
|
1306
|
-
${this.loading
|
|
382
|
+
${this.loading?j`<sds-loader slot="before" ?contrast="${"primary"!==this.variant}"></sds-loader>`:U} ${this.loading?U:j`<slot name="before"></slot>`}
|
|
1307
383
|
<slot></slot>
|
|
1308
|
-
${this.loading
|
|
384
|
+
${this.loading?U:j`<slot name="after"></slot>`}
|
|
1309
385
|
</button>
|
|
1310
|
-
|
|
1311
|
-
}
|
|
1312
|
-
};
|
|
1313
|
-
SDSButton.styles = [styles$f];
|
|
1314
|
-
SDSButton.formAssociated = true;
|
|
1315
|
-
__decorateClass$g([
|
|
1316
|
-
n2({ type: Boolean, reflect: true })
|
|
1317
|
-
], SDSButton.prototype, "disabled", 2);
|
|
1318
|
-
__decorateClass$g([
|
|
1319
|
-
n2({ type: Boolean, reflect: true })
|
|
1320
|
-
], SDSButton.prototype, "icon", 2);
|
|
1321
|
-
__decorateClass$g([
|
|
1322
|
-
n2({ type: Boolean, reflect: true })
|
|
1323
|
-
], SDSButton.prototype, "loading", 2);
|
|
1324
|
-
__decorateClass$g([
|
|
1325
|
-
n2({ type: String, reflect: true })
|
|
1326
|
-
], SDSButton.prototype, "form", 2);
|
|
1327
|
-
__decorateClass$g([
|
|
1328
|
-
n2({ type: String, reflect: true })
|
|
1329
|
-
], SDSButton.prototype, "href", 2);
|
|
1330
|
-
__decorateClass$g([
|
|
1331
|
-
n2({ type: String, reflect: true })
|
|
1332
|
-
], SDSButton.prototype, "name", 2);
|
|
1333
|
-
__decorateClass$g([
|
|
1334
|
-
n2({ type: String, reflect: true })
|
|
1335
|
-
], SDSButton.prototype, "size", 2);
|
|
1336
|
-
__decorateClass$g([
|
|
1337
|
-
n2({ type: String, reflect: true })
|
|
1338
|
-
], SDSButton.prototype, "target", 2);
|
|
1339
|
-
__decorateClass$g([
|
|
1340
|
-
n2({ type: String, reflect: true })
|
|
1341
|
-
], SDSButton.prototype, "type", 2);
|
|
1342
|
-
__decorateClass$g([
|
|
1343
|
-
n2({ type: String, reflect: true })
|
|
1344
|
-
], SDSButton.prototype, "value", 2);
|
|
1345
|
-
__decorateClass$g([
|
|
1346
|
-
n2({ type: String, reflect: true })
|
|
1347
|
-
], SDSButton.prototype, "variant", 2);
|
|
1348
|
-
SDSButton = __decorateClass$g([
|
|
1349
|
-
guardedCustomElement("sds-button")
|
|
1350
|
-
], SDSButton);
|
|
1351
|
-
var __defProp$f = Object.defineProperty;
|
|
1352
|
-
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
1353
|
-
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
1354
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
1355
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
1356
|
-
if (decorator = decorators[i3])
|
|
1357
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1358
|
-
if (kind && result) __defProp$f(target, key, result);
|
|
1359
|
-
return result;
|
|
1360
|
-
};
|
|
1361
|
-
const alertIcons = {
|
|
1362
|
-
info: "InformationSquareFill-aksel-filled",
|
|
1363
|
-
success: "check_circle-material-filled",
|
|
1364
|
-
attention: "warning-material-filled",
|
|
1365
|
-
danger: "dangerous-material-filled"
|
|
1366
|
-
};
|
|
1367
|
-
let SDSAlert = class extends i$1 {
|
|
1368
|
-
constructor() {
|
|
1369
|
-
super(...arguments);
|
|
1370
|
-
this.variant = "primary";
|
|
1371
|
-
this.size = "md";
|
|
1372
|
-
this.palette = "info";
|
|
1373
|
-
this._remove = () => {
|
|
1374
|
-
this.dispatchEvent(
|
|
1375
|
-
new CustomEvent("sds-remove", {
|
|
1376
|
-
bubbles: true,
|
|
1377
|
-
composed: true
|
|
1378
|
-
})
|
|
1379
|
-
);
|
|
1380
|
-
};
|
|
1381
|
-
}
|
|
1382
|
-
render() {
|
|
1383
|
-
const iconSize = this.variant === "primary" ? "md" : this.size ?? "md";
|
|
1384
|
-
const iconName = alertIcons[this.palette] ?? alertIcons["info"];
|
|
1385
|
-
return x`<div class="sds-alert">
|
|
386
|
+
`}};Rt.styles=[Pt],Rt.formAssociated=!0,Vt([lt({type:Boolean,reflect:!0})],Rt.prototype,"disabled",2),Vt([lt({type:Boolean,reflect:!0})],Rt.prototype,"icon",2),Vt([lt({type:Boolean,reflect:!0})],Rt.prototype,"loading",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"form",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"href",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"name",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"size",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"target",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"type",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"value",2),Vt([lt({type:String,reflect:!0})],Rt.prototype,"variant",2),Rt=Vt([pt("sds-button")],Rt);var Tt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,Bt=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Lt(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Tt(s,e,a),a};const It={info:"InformationSquareFill-aksel-filled",success:"check_circle-material-filled",attention:"warning-material-filled",danger:"dangerous-material-filled"};let jt=class extends at{constructor(){super(...arguments),this.variant="primary",this.size="md",this.palette="info",this._remove=()=>{this.dispatchEvent(new CustomEvent("sds-remove",{bubbles:!0,composed:!0}))}}render(){const t="primary"===this.variant?"md":this.size??"md",s=It[this.palette]??It.info;return j`<div class="sds-alert">
|
|
1386
387
|
<div class="sds-alert__type">
|
|
1387
|
-
<sds-icon class="sds-alert__icon" name="${
|
|
388
|
+
<sds-icon class="sds-alert__icon" name="${s}" size="${t}"></sds-icon>
|
|
1388
389
|
</div>
|
|
1389
390
|
<div class="sds-alert__content">
|
|
1390
391
|
<slot name="title"></slot>
|
|
1391
392
|
<slot name="message"></slot>
|
|
1392
393
|
</div>
|
|
1393
|
-
${this.removableLabel
|
|
394
|
+
${this.removableLabel&&"primary"===this.variant?j`<div class="sds-alert__actions">
|
|
1394
395
|
<sds-button icon variant="tertiary" size="sm" @click=${this._remove} aria-label="${this.removableLabel}">
|
|
1395
396
|
<sds-icon name="close-material-outlined" size="sm"></sds-icon>
|
|
1396
397
|
</sds-button>
|
|
1397
|
-
</div
|
|
1398
|
-
</div
|
|
1399
|
-
}
|
|
1400
|
-
};
|
|
1401
|
-
SDSAlert.styles = [styles$h];
|
|
1402
|
-
__decorateClass$f([
|
|
1403
|
-
n2({ type: String, reflect: true })
|
|
1404
|
-
], SDSAlert.prototype, "variant", 2);
|
|
1405
|
-
__decorateClass$f([
|
|
1406
|
-
n2({ type: String, reflect: true })
|
|
1407
|
-
], SDSAlert.prototype, "size", 2);
|
|
1408
|
-
__decorateClass$f([
|
|
1409
|
-
n2({ type: String, attribute: "removable-label", reflect: true })
|
|
1410
|
-
], SDSAlert.prototype, "removableLabel", 2);
|
|
1411
|
-
__decorateClass$f([
|
|
1412
|
-
n2({ type: String, attribute: "data-palette", reflect: true })
|
|
1413
|
-
], SDSAlert.prototype, "palette", 2);
|
|
1414
|
-
SDSAlert = __decorateClass$f([
|
|
1415
|
-
guardedCustomElement("sds-alert")
|
|
1416
|
-
], SDSAlert);
|
|
1417
|
-
function validateSlotContent(slot, allowedTags, allowText, warningMessage) {
|
|
1418
|
-
const invalid = slot.assignedNodes({ flatten: true }).filter((node) => {
|
|
1419
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
1420
|
-
const text = node.textContent?.trim() ?? "";
|
|
1421
|
-
return text.length > 0;
|
|
1422
|
-
}
|
|
1423
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1424
|
-
const el = node;
|
|
1425
|
-
const tagName = el.tagName.toUpperCase();
|
|
1426
|
-
if (!allowedTags.includes(tagName)) {
|
|
1427
|
-
return true;
|
|
1428
|
-
}
|
|
1429
|
-
const hasNestedElements = Array.from(el.childNodes).some((child) => child.nodeType === Node.ELEMENT_NODE);
|
|
1430
|
-
return hasNestedElements;
|
|
1431
|
-
}
|
|
1432
|
-
return false;
|
|
1433
|
-
});
|
|
1434
|
-
if (invalid.length > 0) {
|
|
1435
|
-
console.warn(warningMessage, ...invalid);
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
const styles$e = i$4`
|
|
398
|
+
</div>`:U}
|
|
399
|
+
</div>`}};function Nt(t,s,e,o){const r=t.assignedNodes({flatten:!0}).filter((t=>{if(t.nodeType===Node.TEXT_NODE){return(t.textContent?.trim()??"").length>0}if(t.nodeType===Node.ELEMENT_NODE){const e=t,o=e.tagName.toUpperCase();if(!s.includes(o))return!0;return Array.from(e.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE))}return!1}));r.length>0&&console.warn(o,...r)}jt.styles=[gt],Bt([lt({type:String,reflect:!0})],jt.prototype,"variant",2),Bt([lt({type:String,reflect:!0})],jt.prototype,"size",2),Bt([lt({type:String,attribute:"removable-label",reflect:!0})],jt.prototype,"removableLabel",2),Bt([lt({type:String,attribute:"data-palette",reflect:!0})],jt.prototype,"palette",2),jt=Bt([pt("sds-alert")],jt);const Ut=a`
|
|
1439
400
|
:host {
|
|
1440
401
|
--_sds-card-background-color: var(--sds-card-background-color, var(--sds-color-surface-tinted, var(--sds-color-main-surface-tinted)));
|
|
1441
402
|
--_sds-card-border-radius: var(--sds-card-border-radius, var(--sds-radius-md));
|
|
@@ -1556,59 +517,11 @@ const styles$e = i$4`
|
|
|
1556
517
|
--_sds-card-text-line-height: var(--sds-card-text-line-height, var(--sds-typography-body-md-desktop-line-height));
|
|
1557
518
|
}
|
|
1558
519
|
}
|
|
1559
|
-
`;
|
|
1560
|
-
var __defProp$e = Object.defineProperty;
|
|
1561
|
-
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
1562
|
-
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
1563
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
1564
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
1565
|
-
if (decorator = decorators[i3])
|
|
1566
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1567
|
-
if (kind && result) __defProp$e(target, key, result);
|
|
1568
|
-
return result;
|
|
1569
|
-
};
|
|
1570
|
-
let SDSCard = class extends i$1 {
|
|
1571
|
-
firstUpdated() {
|
|
1572
|
-
const contentWarning = "[sds-card] text slot should only contain top-level <p> elements with no nested elements:";
|
|
1573
|
-
const headerWarning = "[sds-card] header slot should only contain one of <h2>–<h6> elements:";
|
|
1574
|
-
validateSlotContent(this.textSlot, ["P"], false, contentWarning);
|
|
1575
|
-
const headerNodes = this.headingSlot.assignedNodes({ flatten: true });
|
|
1576
|
-
if (headerNodes.length > 0) {
|
|
1577
|
-
validateSlotContent(this.headingSlot, ["H2", "H3", "H4", "H5", "H6"], false, headerWarning);
|
|
1578
|
-
}
|
|
1579
|
-
this.textSlot.addEventListener("slotchange", () => {
|
|
1580
|
-
validateSlotContent(this.textSlot, ["P"], false, contentWarning);
|
|
1581
|
-
});
|
|
1582
|
-
this.headingSlot.addEventListener("slotchange", () => {
|
|
1583
|
-
const nodes = this.headingSlot.assignedNodes({ flatten: true });
|
|
1584
|
-
if (nodes.length > 0) {
|
|
1585
|
-
validateSlotContent(this.headingSlot, ["H2", "H3", "H4", "H5", "H6"], false, headerWarning);
|
|
1586
|
-
}
|
|
1587
|
-
});
|
|
1588
|
-
}
|
|
1589
|
-
render() {
|
|
1590
|
-
const cardBody = x`
|
|
520
|
+
`;var Ft=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Gt=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Ht(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Ft(s,e,a),a};let Kt=class extends at{firstUpdated(){const t="[sds-card] text slot should only contain top-level <p> elements with no nested elements:",s="[sds-card] header slot should only contain one of <h2>–<h6> elements:";Nt(this.textSlot,["P"],0,t);this.headingSlot.assignedNodes({flatten:!0}).length>0&&Nt(this.headingSlot,["H2","H3","H4","H5","H6"],0,s),this.textSlot.addEventListener("slotchange",(()=>{Nt(this.textSlot,["P"],0,t)})),this.headingSlot.addEventListener("slotchange",(()=>{this.headingSlot.assignedNodes({flatten:!0}).length>0&&Nt(this.headingSlot,["H2","H3","H4","H5","H6"],0,s)}))}render(){const t=j`
|
|
1591
521
|
<slot name="heading" id="heading"></slot>
|
|
1592
522
|
<slot name="text" id="content"></slot>
|
|
1593
523
|
<sds-icon name="arrow_forward-material-outlined" size="md" class="sds-card__icon"></sds-icon>
|
|
1594
|
-
`;
|
|
1595
|
-
return x`<article class="sds-card">${this.link ? x`<a href="${this.link}" class="sds-card__content">${cardBody}</a>` : x`<div class="sds-card__content">${cardBody}</div>`}</article>`;
|
|
1596
|
-
}
|
|
1597
|
-
};
|
|
1598
|
-
SDSCard.styles = [styles$e];
|
|
1599
|
-
__decorateClass$e([
|
|
1600
|
-
n2({ type: String, reflect: true })
|
|
1601
|
-
], SDSCard.prototype, "link", 2);
|
|
1602
|
-
__decorateClass$e([
|
|
1603
|
-
e$3("slot#heading")
|
|
1604
|
-
], SDSCard.prototype, "headingSlot", 2);
|
|
1605
|
-
__decorateClass$e([
|
|
1606
|
-
e$3("slot#text")
|
|
1607
|
-
], SDSCard.prototype, "textSlot", 2);
|
|
1608
|
-
SDSCard = __decorateClass$e([
|
|
1609
|
-
guardedCustomElement("sds-card")
|
|
1610
|
-
], SDSCard);
|
|
1611
|
-
const styles$d = i$4`
|
|
524
|
+
`;return j`<article class="sds-card">${this.link?j`<a href="${this.link}" class="sds-card__content">${t}</a>`:j`<div class="sds-card__content">${t}</div>`}</article>`}};Kt.styles=[Ut],Gt([lt({type:String,reflect:!0})],Kt.prototype,"link",2),Gt([ht("slot#heading")],Kt.prototype,"headingSlot",2),Gt([ht("slot#text")],Kt.prototype,"textSlot",2),Kt=Gt([pt("sds-card")],Kt);const Wt=a`
|
|
1612
525
|
:host {
|
|
1613
526
|
--_sds-checkbox-block-gap: var(--sds-checkbox-block-gap, var(--sds-spacing-4xs));
|
|
1614
527
|
--_sds-checkbox-inline-gap: var(--sds-checkbox-inline-gap, var(--sds-spacing-3xs));
|
|
@@ -1640,6 +553,11 @@ const styles$d = i$4`
|
|
|
1640
553
|
|
|
1641
554
|
--_sds-checkbox-disabled-opacity: var(--sds-checkbox-disabled-opacity, var(--sds-color-states-disabled-opacity));
|
|
1642
555
|
|
|
556
|
+
--_sds-checkbox-grid-template-areas: var(--sds-checkbox-grid-template-area, 'input content');
|
|
557
|
+
--_sds-checkbox-label-grid-area: var(--sds-checkbox-label-grid-area, content);
|
|
558
|
+
--_sds-checkbox-input-grid-area: var(--sds-checkbox-input-grid-area, input);
|
|
559
|
+
--_sds-checkbox-help-text-grid-area: var(--sds-checkbox-help-text-grid-area, content);
|
|
560
|
+
|
|
1643
561
|
flex: 0 0 auto;
|
|
1644
562
|
}
|
|
1645
563
|
|
|
@@ -1648,7 +566,7 @@ const styles$d = i$4`
|
|
|
1648
566
|
display: grid;
|
|
1649
567
|
font-family: var(--_sds-checkbox-font-family);
|
|
1650
568
|
gap: var(--_sds-checkbox-block-gap) var(--_sds-checkbox-inline-gap);
|
|
1651
|
-
grid-template-areas:
|
|
569
|
+
grid-template-areas: var(--_sds-checkbox-grid-template-areas);
|
|
1652
570
|
grid-template-columns: auto 1fr;
|
|
1653
571
|
width: fit-content;
|
|
1654
572
|
|
|
@@ -1670,7 +588,7 @@ const styles$d = i$4`
|
|
|
1670
588
|
}
|
|
1671
589
|
|
|
1672
590
|
.sds-checkbox__label {
|
|
1673
|
-
grid-column:
|
|
591
|
+
grid-column: var(--_sds-checkbox-label-grid-area);
|
|
1674
592
|
align-self: center;
|
|
1675
593
|
cursor: pointer;
|
|
1676
594
|
color: var(--_sds-checkbox-label-text-color);
|
|
@@ -1682,7 +600,7 @@ const styles$d = i$4`
|
|
|
1682
600
|
}
|
|
1683
601
|
|
|
1684
602
|
.sds-checkbox__input {
|
|
1685
|
-
grid-column: input;
|
|
603
|
+
grid-column: var(--_sds-checkbox-input-grid-area);
|
|
1686
604
|
grid-row: 1;
|
|
1687
605
|
appearance: none;
|
|
1688
606
|
background-color: var(--_sds-checkbox-input-background-color);
|
|
@@ -1785,7 +703,7 @@ const styles$d = i$4`
|
|
|
1785
703
|
}
|
|
1786
704
|
|
|
1787
705
|
.sds-checkbox__help-text {
|
|
1788
|
-
grid-column:
|
|
706
|
+
grid-column: var(--_sds-checkbox-help-text-grid-area);
|
|
1789
707
|
margin: 0;
|
|
1790
708
|
color: var(--_sds-checkbox-help-text-color);
|
|
1791
709
|
font-size: var(--_sds-checkbox-help-text-font-size);
|
|
@@ -1825,154 +743,13 @@ const styles$d = i$4`
|
|
|
1825
743
|
margin-block-start: -1px;
|
|
1826
744
|
}
|
|
1827
745
|
}
|
|
1828
|
-
`;
|
|
1829
|
-
|
|
1830
|
-
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
1831
|
-
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
1832
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
1833
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
1834
|
-
if (decorator = decorators[i3])
|
|
1835
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1836
|
-
if (kind && result) __defProp$d(target, key, result);
|
|
1837
|
-
return result;
|
|
1838
|
-
};
|
|
1839
|
-
let SDSCheckbox = class extends i$1 {
|
|
1840
|
-
constructor() {
|
|
1841
|
-
super();
|
|
1842
|
-
this.checked = false;
|
|
1843
|
-
this.error = false;
|
|
1844
|
-
this.required = false;
|
|
1845
|
-
this.size = "md";
|
|
1846
|
-
this.readOnly = false;
|
|
1847
|
-
this._disabled = false;
|
|
1848
|
-
this._disabledIsAuthorControlled = false;
|
|
1849
|
-
this._settingDisabledFromParent = false;
|
|
1850
|
-
this._parentRequestDisabled = false;
|
|
1851
|
-
this._initialChecked = false;
|
|
1852
|
-
this._handleChange = (event) => {
|
|
1853
|
-
event.stopImmediatePropagation();
|
|
1854
|
-
if (this.disabled || this.readOnly) {
|
|
1855
|
-
event.target.checked = this.checked;
|
|
1856
|
-
event.preventDefault();
|
|
1857
|
-
return;
|
|
1858
|
-
}
|
|
1859
|
-
const elem = event.target;
|
|
1860
|
-
this.checked = elem.checked;
|
|
1861
|
-
this.internals.setFormValue(elem.checked ? elem.value : null);
|
|
1862
|
-
this._validate();
|
|
1863
|
-
this.dispatchEvent(new CustomEvent("change", { bubbles: true, composed: true }));
|
|
1864
|
-
};
|
|
1865
|
-
this._handleFocus = (event) => {
|
|
1866
|
-
event.stopImmediatePropagation();
|
|
1867
|
-
this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
|
|
1868
|
-
};
|
|
1869
|
-
this._handleBlur = (event) => {
|
|
1870
|
-
event.stopImmediatePropagation();
|
|
1871
|
-
this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
|
|
1872
|
-
};
|
|
1873
|
-
this.internals = this.attachInternals();
|
|
1874
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
1875
|
-
}
|
|
1876
|
-
get disabled() {
|
|
1877
|
-
return this._disabled;
|
|
1878
|
-
}
|
|
1879
|
-
set disabled(value) {
|
|
1880
|
-
const newVal = value ?? false;
|
|
1881
|
-
const oldVal = this._disabled;
|
|
1882
|
-
if (oldVal === newVal) return;
|
|
1883
|
-
this._disabled = newVal;
|
|
1884
|
-
this.requestUpdate("disabled", oldVal);
|
|
1885
|
-
if (!this._settingDisabledFromParent) {
|
|
1886
|
-
this._disabledIsAuthorControlled = newVal;
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
get parentRequestDisabled() {
|
|
1890
|
-
return this._parentRequestDisabled;
|
|
1891
|
-
}
|
|
1892
|
-
set parentRequestDisabled(value) {
|
|
1893
|
-
const newVal = value ?? false;
|
|
1894
|
-
const oldVal = this._parentRequestDisabled;
|
|
1895
|
-
if (oldVal === newVal) return;
|
|
1896
|
-
this._parentRequestDisabled = newVal;
|
|
1897
|
-
this.requestUpdate("parentRequestDisabled", oldVal);
|
|
1898
|
-
if (this._disabledIsAuthorControlled) return;
|
|
1899
|
-
this._settingDisabledFromParent = true;
|
|
1900
|
-
this.disabled = newVal;
|
|
1901
|
-
this._settingDisabledFromParent = false;
|
|
1902
|
-
}
|
|
1903
|
-
connectedCallback() {
|
|
1904
|
-
super.connectedCallback();
|
|
1905
|
-
this._initialChecked = this.checked;
|
|
1906
|
-
this.internals.role = "checkbox";
|
|
1907
|
-
if (this.checked) {
|
|
1908
|
-
this.internals.setFormValue(this.value ?? "on");
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
firstUpdated(_changedProperties) {
|
|
1912
|
-
super.firstUpdated(_changedProperties);
|
|
1913
|
-
if (this.control) {
|
|
1914
|
-
this.control.required = this.required;
|
|
1915
|
-
}
|
|
1916
|
-
this._validate();
|
|
1917
|
-
}
|
|
1918
|
-
formResetCallback() {
|
|
1919
|
-
this.checked = this._initialChecked;
|
|
1920
|
-
if (this.control) {
|
|
1921
|
-
this.control.checked = this._initialChecked;
|
|
1922
|
-
}
|
|
1923
|
-
const resetValue = this.checked ? this.value ?? "on" : null;
|
|
1924
|
-
this.internals.setFormValue(resetValue);
|
|
1925
|
-
this._validate();
|
|
1926
|
-
}
|
|
1927
|
-
_validate() {
|
|
1928
|
-
if (this.required && !this.checked) {
|
|
1929
|
-
this.internals.setValidity({ valueMissing: true }, this.control.validationMessage, this.control);
|
|
1930
|
-
} else {
|
|
1931
|
-
this.internals.setValidity({});
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1934
|
-
focus() {
|
|
1935
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
|
|
1936
|
-
}
|
|
1937
|
-
blur() {
|
|
1938
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
|
|
1939
|
-
}
|
|
1940
|
-
click() {
|
|
1941
|
-
if (!this.disabled && !this.readOnly) this.shadowRoot?.querySelector("input")?.click();
|
|
1942
|
-
}
|
|
1943
|
-
updated(changedProperties) {
|
|
1944
|
-
super.updated(changedProperties);
|
|
1945
|
-
if (changedProperties.has("required") && this.control) {
|
|
1946
|
-
this.control.required = this.required;
|
|
1947
|
-
}
|
|
1948
|
-
if (changedProperties.has("checked")) {
|
|
1949
|
-
this._validate();
|
|
1950
|
-
}
|
|
1951
|
-
if (!this._disabledIsAuthorControlled && this.disabled !== this._parentRequestDisabled) {
|
|
1952
|
-
this._settingDisabledFromParent = true;
|
|
1953
|
-
this.disabled = this._parentRequestDisabled ?? false;
|
|
1954
|
-
this._settingDisabledFromParent = false;
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
get type() {
|
|
1958
|
-
return "checkbox";
|
|
1959
|
-
}
|
|
1960
|
-
render() {
|
|
1961
|
-
const checkboxClasses = {
|
|
1962
|
-
"sds-checkbox": true,
|
|
1963
|
-
"sds-checkbox--error": Boolean(this.error)
|
|
1964
|
-
};
|
|
1965
|
-
const inputClasses = {
|
|
1966
|
-
"sds-checkbox__input": true,
|
|
1967
|
-
"sds-checkbox__input--error": Boolean(this.error)
|
|
1968
|
-
};
|
|
1969
|
-
return x`
|
|
1970
|
-
<div class="${e2(checkboxClasses)}">
|
|
746
|
+
`;var Zt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,Xt=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Qt(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Zt(s,e,a),a};let Yt=class extends at{constructor(){super(),this.checked=!1,this.error=!1,this.required=!1,this.size="md",this.readOnly=!1,this._disabled=!1,this._disabledIsAuthorControlled=!1,this._settingDisabledFromParent=!1,this._parentRequestDisabled=!1,this._initialChecked=!1,this._handleChange=t=>{if(t.stopImmediatePropagation(),this.disabled||this.readOnly)return t.target.checked=this.checked,void t.preventDefault();const s=t.target;this.checked=s.checked,this.internals.setFormValue(s.checked?s.value:null),this._validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0}))},this._handleFocus=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0}))},this._handleBlur=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}get disabled(){return this._disabled}set disabled(t){const s=t??!1,e=this._disabled;e!==s&&(this._disabled=s,this.requestUpdate("disabled",e),this._settingDisabledFromParent||(this._disabledIsAuthorControlled=s))}get parentRequestDisabled(){return this._parentRequestDisabled}set parentRequestDisabled(t){const s=t??!1,e=this._parentRequestDisabled;e!==s&&(this._parentRequestDisabled=s,this.requestUpdate("parentRequestDisabled",e),this._disabledIsAuthorControlled||(this._settingDisabledFromParent=!0,this.disabled=s,this._settingDisabledFromParent=!1))}connectedCallback(){super.connectedCallback(),this._initialChecked=this.checked,this.internals.role="checkbox",this.checked&&this.internals.setFormValue(this.value??"on")}firstUpdated(t){super.firstUpdated(t),this.control&&(this.control.required=this.required),this._validate()}formResetCallback(){this.checked=this._initialChecked,this.control&&(this.control.checked=this._initialChecked);const t=this.checked?this.value??"on":null;this.internals.setFormValue(t),this._validate()}_validate(){this.required&&!this.checked?this.internals.setValidity({valueMissing:!0},this.control.validationMessage,this.control):this.internals.setValidity({})}focus(){this.disabled||this.shadowRoot?.querySelector("input")?.focus()}blur(){this.disabled||this.shadowRoot?.querySelector("input")?.blur()}click(){this.disabled||this.readOnly||this.shadowRoot?.querySelector("input")?.click()}updated(t){super.updated(t),t.has("required")&&this.control&&(this.control.required=this.required),t.has("checked")&&this._validate(),this._disabledIsAuthorControlled||this.disabled===this._parentRequestDisabled||(this._settingDisabledFromParent=!0,this.disabled=this._parentRequestDisabled??!1,this._settingDisabledFromParent=!1)}get type(){return"checkbox"}render(){const t={"sds-checkbox":!0,"sds-checkbox--error":Boolean(this.error)},s={"sds-checkbox__input":!0,"sds-checkbox__input--error":Boolean(this.error)};return j`
|
|
747
|
+
<div class="${Ot(t)}">
|
|
1971
748
|
<input
|
|
1972
749
|
id="control"
|
|
1973
750
|
type="checkbox"
|
|
1974
|
-
name="${
|
|
1975
|
-
value="${
|
|
751
|
+
name="${vt(this.name)}"
|
|
752
|
+
value="${vt(this.value)}"
|
|
1976
753
|
.checked="${this.checked}"
|
|
1977
754
|
?checked="${this.checked}"
|
|
1978
755
|
?disabled="${this.disabled}"
|
|
@@ -1981,56 +758,12 @@ let SDSCheckbox = class extends i$1 {
|
|
|
1981
758
|
@change="${this._handleChange}"
|
|
1982
759
|
@focus="${this._handleFocus}"
|
|
1983
760
|
@blur="${this._handleBlur}"
|
|
1984
|
-
class="${
|
|
761
|
+
class="${Ot(s)}"
|
|
1985
762
|
/>
|
|
1986
|
-
${this.label
|
|
1987
|
-
${this.helpText
|
|
763
|
+
${this.label?j`<label for="control" class="sds-checkbox__label">${this.label}</label>`:U}
|
|
764
|
+
${this.helpText?j`<span class="sds-checkbox__help-text">${this.helpText}</span>`:U}
|
|
1988
765
|
</div>
|
|
1989
|
-
|
|
1990
|
-
}
|
|
1991
|
-
};
|
|
1992
|
-
SDSCheckbox.styles = [styles$d];
|
|
1993
|
-
SDSCheckbox.formAssociated = true;
|
|
1994
|
-
__decorateClass$d([
|
|
1995
|
-
n2({ type: String, reflect: true })
|
|
1996
|
-
], SDSCheckbox.prototype, "name", 2);
|
|
1997
|
-
__decorateClass$d([
|
|
1998
|
-
n2({ type: String, reflect: true })
|
|
1999
|
-
], SDSCheckbox.prototype, "label", 2);
|
|
2000
|
-
__decorateClass$d([
|
|
2001
|
-
n2({ type: String })
|
|
2002
|
-
], SDSCheckbox.prototype, "value", 2);
|
|
2003
|
-
__decorateClass$d([
|
|
2004
|
-
n2({ type: Boolean, reflect: true })
|
|
2005
|
-
], SDSCheckbox.prototype, "checked", 2);
|
|
2006
|
-
__decorateClass$d([
|
|
2007
|
-
n2({ type: Boolean, reflect: true })
|
|
2008
|
-
], SDSCheckbox.prototype, "disabled", 1);
|
|
2009
|
-
__decorateClass$d([
|
|
2010
|
-
n2({ type: Boolean, reflect: true })
|
|
2011
|
-
], SDSCheckbox.prototype, "error", 2);
|
|
2012
|
-
__decorateClass$d([
|
|
2013
|
-
n2({ type: Boolean, reflect: true })
|
|
2014
|
-
], SDSCheckbox.prototype, "required", 2);
|
|
2015
|
-
__decorateClass$d([
|
|
2016
|
-
n2({ type: String, reflect: true })
|
|
2017
|
-
], SDSCheckbox.prototype, "size", 2);
|
|
2018
|
-
__decorateClass$d([
|
|
2019
|
-
n2({ type: String, attribute: "help-text" })
|
|
2020
|
-
], SDSCheckbox.prototype, "helpText", 2);
|
|
2021
|
-
__decorateClass$d([
|
|
2022
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
2023
|
-
], SDSCheckbox.prototype, "readOnly", 2);
|
|
2024
|
-
__decorateClass$d([
|
|
2025
|
-
n2({ type: Boolean, attribute: false })
|
|
2026
|
-
], SDSCheckbox.prototype, "parentRequestDisabled", 1);
|
|
2027
|
-
__decorateClass$d([
|
|
2028
|
-
e$3("#control")
|
|
2029
|
-
], SDSCheckbox.prototype, "control", 2);
|
|
2030
|
-
SDSCheckbox = __decorateClass$d([
|
|
2031
|
-
guardedCustomElement("sds-checkbox")
|
|
2032
|
-
], SDSCheckbox);
|
|
2033
|
-
const styles$c = i$4`
|
|
766
|
+
`}};Yt.styles=[Wt],Yt.formAssociated=!0,Xt([lt({type:String,reflect:!0})],Yt.prototype,"name",2),Xt([lt({type:String,reflect:!0})],Yt.prototype,"label",2),Xt([lt({type:String})],Yt.prototype,"value",2),Xt([lt({type:Boolean,reflect:!0})],Yt.prototype,"checked",2),Xt([lt({type:Boolean,reflect:!0})],Yt.prototype,"disabled",1),Xt([lt({type:Boolean,reflect:!0})],Yt.prototype,"error",2),Xt([lt({type:Boolean,reflect:!0})],Yt.prototype,"required",2),Xt([lt({type:String,reflect:!0})],Yt.prototype,"size",2),Xt([lt({type:String,attribute:"help-text"})],Yt.prototype,"helpText",2),Xt([lt({type:Boolean,attribute:"readonly",reflect:!0})],Yt.prototype,"readOnly",2),Xt([lt({type:Boolean,attribute:!1})],Yt.prototype,"parentRequestDisabled",1),Xt([ht("#control")],Yt.prototype,"control",2),Yt=Xt([pt("sds-checkbox")],Yt);const Jt=a`
|
|
2034
767
|
:host {
|
|
2035
768
|
--_sds-checkbox-group-gap: var(--sds-checkbox-group-gap, var(--sds-spacing-xs));
|
|
2036
769
|
--_sds-checkbox-group-font-family: var(--sds-checkbox-group-font-family, var(--sds-typography-font-family-roboto));
|
|
@@ -2122,133 +855,16 @@ const styles$c = i$4`
|
|
|
2122
855
|
--_sds-checkbox-group-help-text-font-size: var(--sds-checkbox-group-help-text-font-size, var(--sds-components-font-size-content-lg));
|
|
2123
856
|
--_sds-checkbox-group-help-text-line-height: var(--sds-checkbox-group-help-text-line-height, var(--sds-components-line-height-squeezed-lg));
|
|
2124
857
|
}
|
|
2125
|
-
`;
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
2130
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
2131
|
-
if (decorator = decorators[i3])
|
|
2132
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2133
|
-
if (kind && result) __defProp$c(target, key, result);
|
|
2134
|
-
return result;
|
|
2135
|
-
};
|
|
2136
|
-
const updatableCheckboxProps = ["disabled", "errorMessage", "readOnly", "size"];
|
|
2137
|
-
let SDSCheckboxGroup = class extends i$1 {
|
|
2138
|
-
constructor() {
|
|
2139
|
-
super(...arguments);
|
|
2140
|
-
this.readOnly = false;
|
|
2141
|
-
this.disabled = false;
|
|
2142
|
-
this.size = "md";
|
|
2143
|
-
this._selectedValues = [];
|
|
2144
|
-
this._handleCheckboxChange = (event) => {
|
|
2145
|
-
const checkbox = event.target;
|
|
2146
|
-
const value = checkbox.value;
|
|
2147
|
-
const isChecked = checkbox.checked;
|
|
2148
|
-
this._selectedValues = isChecked ? [...this._selectedValues, value] : this._selectedValues.filter((v2) => v2 !== value);
|
|
2149
|
-
this.dispatchEvent(
|
|
2150
|
-
new CustomEvent("sds-update", {
|
|
2151
|
-
bubbles: true,
|
|
2152
|
-
composed: true
|
|
2153
|
-
})
|
|
2154
|
-
);
|
|
2155
|
-
};
|
|
2156
|
-
this._handleSlotChange = () => {
|
|
2157
|
-
this._updateChildProps([...updatableCheckboxProps]);
|
|
2158
|
-
};
|
|
2159
|
-
}
|
|
2160
|
-
_getChildCheckboxes() {
|
|
2161
|
-
return this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === "SDS-CHECKBOX") ?? [];
|
|
2162
|
-
}
|
|
2163
|
-
_updateChildProps(changedAttributes) {
|
|
2164
|
-
const checkboxes = this._getChildCheckboxes();
|
|
2165
|
-
for (const childCheckbox of checkboxes) {
|
|
2166
|
-
for (const attribute of changedAttributes) {
|
|
2167
|
-
switch (attribute) {
|
|
2168
|
-
case "readOnly":
|
|
2169
|
-
childCheckbox.readOnly = this.readOnly;
|
|
2170
|
-
break;
|
|
2171
|
-
case "disabled":
|
|
2172
|
-
childCheckbox.parentRequestDisabled = this.disabled;
|
|
2173
|
-
break;
|
|
2174
|
-
case "errorMessage":
|
|
2175
|
-
childCheckbox.error = Boolean(this.errorMessage);
|
|
2176
|
-
break;
|
|
2177
|
-
case "size":
|
|
2178
|
-
childCheckbox.size = this.size;
|
|
2179
|
-
break;
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
updated(changedProps) {
|
|
2185
|
-
super.updated(changedProps);
|
|
2186
|
-
const changedKeys = Array.from(changedProps.keys());
|
|
2187
|
-
if (changedKeys.includes("errorMessage") || changedKeys.includes("error-message")) {
|
|
2188
|
-
this._updateChildProps(["errorMessage"]);
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
attributeChangedCallback(name, _old, value) {
|
|
2192
|
-
super.attributeChangedCallback(name, _old, value);
|
|
2193
|
-
if (name === "readonly") {
|
|
2194
|
-
this._updateChildProps(["readOnly"]);
|
|
2195
|
-
return;
|
|
2196
|
-
}
|
|
2197
|
-
const property2 = name;
|
|
2198
|
-
if (updatableCheckboxProps.includes(property2)) {
|
|
2199
|
-
this._updateChildProps([property2]);
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
get value() {
|
|
2203
|
-
return { selectedValues: this._selectedValues };
|
|
2204
|
-
}
|
|
2205
|
-
render() {
|
|
2206
|
-
const groupClasses = {
|
|
2207
|
-
"sds-checkbox-group": true,
|
|
2208
|
-
"sds-checkbox-group--disabled": this.disabled,
|
|
2209
|
-
"sds-checkbox-group--error": Boolean(this.errorMessage)
|
|
2210
|
-
};
|
|
2211
|
-
return x`
|
|
2212
|
-
<fieldset class="${e2(groupClasses)}">
|
|
2213
|
-
${this.legend ? x`<legend class="sds-checkbox-group__legend">${this.readOnly ? x`<sds-icon name="lock-material-filled" size="md"></sds-icon>` : E}</sds-icon>${this.legend}</legend>` : E}
|
|
2214
|
-
${this.helpText ? x`<p class="sds-checkbox-group__help-text">${this.helpText}</p>` : E}
|
|
858
|
+
`;var ts=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,es=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?ss(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&ts(s,e,a),a};const os=["disabled","errorMessage","readOnly","size"];let rs=class extends at{constructor(){super(...arguments),this.readOnly=!1,this.disabled=!1,this.size="md",this._selectedValues=[],this._handleCheckboxChange=t=>{const s=t.target,e=s.value,o=s.checked;this._selectedValues=o?[...this._selectedValues,e]:this._selectedValues.filter((t=>t!==e)),this.dispatchEvent(new CustomEvent("sds-update",{bubbles:!0,composed:!0}))},this._handleSlotChange=()=>{this._updateChildProps([...os])}}_getChildCheckboxes(){return this._slotElement?.assignedElements({flatten:!0}).filter((t=>"SDS-CHECKBOX"===t.tagName))??[]}_updateChildProps(t){const s=this._getChildCheckboxes();for(const e of s)for(const s of t)switch(s){case"readOnly":e.readOnly=this.readOnly;break;case"disabled":e.parentRequestDisabled=this.disabled;break;case"errorMessage":e.error=Boolean(this.errorMessage);break;case"size":e.size=this.size}}updated(t){super.updated(t);const s=Array.from(t.keys());(s.includes("errorMessage")||s.includes("error-message"))&&this._updateChildProps(["errorMessage"])}attributeChangedCallback(t,s,e){if(super.attributeChangedCallback(t,s,e),"readonly"===t)return void this._updateChildProps(["readOnly"]);const o=t;os.includes(o)&&this._updateChildProps([o])}get value(){return{selectedValues:this._selectedValues}}render(){const t={"sds-checkbox-group":!0,"sds-checkbox-group--disabled":this.disabled,"sds-checkbox-group--error":Boolean(this.errorMessage)};return j`
|
|
859
|
+
<fieldset class="${Ot(t)}">
|
|
860
|
+
${this.legend?j`<legend class="sds-checkbox-group__legend">${this.readOnly?j`<sds-icon name="lock-material-filled" size="md"></sds-icon>`:U}</sds-icon>${this.legend}</legend>`:U}
|
|
861
|
+
${this.helpText?j`<p class="sds-checkbox-group__help-text">${this.helpText}</p>`:U}
|
|
2215
862
|
<div class="sds-checkbox-group__checkboxes" @change=${this._handleCheckboxChange}>
|
|
2216
863
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
2217
864
|
</div>
|
|
2218
|
-
${this.errorMessage
|
|
865
|
+
${this.errorMessage?j`<sds-alert variant="secondary" data-palette="danger"><p slot="message">${this.errorMessage}</p></sds-alert>`:U}
|
|
2219
866
|
</fieldset>
|
|
2220
|
-
|
|
2221
|
-
}
|
|
2222
|
-
};
|
|
2223
|
-
SDSCheckboxGroup.styles = [styles$c];
|
|
2224
|
-
__decorateClass$c([
|
|
2225
|
-
n2({ type: String, reflect: true })
|
|
2226
|
-
], SDSCheckboxGroup.prototype, "legend", 2);
|
|
2227
|
-
__decorateClass$c([
|
|
2228
|
-
n2({ type: String, attribute: "help-text", reflect: true })
|
|
2229
|
-
], SDSCheckboxGroup.prototype, "helpText", 2);
|
|
2230
|
-
__decorateClass$c([
|
|
2231
|
-
n2({ type: String, attribute: "error-message", reflect: true })
|
|
2232
|
-
], SDSCheckboxGroup.prototype, "errorMessage", 2);
|
|
2233
|
-
__decorateClass$c([
|
|
2234
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
2235
|
-
], SDSCheckboxGroup.prototype, "readOnly", 2);
|
|
2236
|
-
__decorateClass$c([
|
|
2237
|
-
n2({ type: Boolean, reflect: true })
|
|
2238
|
-
], SDSCheckboxGroup.prototype, "disabled", 2);
|
|
2239
|
-
__decorateClass$c([
|
|
2240
|
-
n2({ type: String, reflect: true })
|
|
2241
|
-
], SDSCheckboxGroup.prototype, "size", 2);
|
|
2242
|
-
__decorateClass$c([
|
|
2243
|
-
r()
|
|
2244
|
-
], SDSCheckboxGroup.prototype, "_selectedValues", 2);
|
|
2245
|
-
__decorateClass$c([
|
|
2246
|
-
e$3("slot")
|
|
2247
|
-
], SDSCheckboxGroup.prototype, "_slotElement", 2);
|
|
2248
|
-
SDSCheckboxGroup = __decorateClass$c([
|
|
2249
|
-
guardedCustomElement("sds-checkbox-group")
|
|
2250
|
-
], SDSCheckboxGroup);
|
|
2251
|
-
const styles$b = i$4`
|
|
867
|
+
`}};rs.styles=[Jt],es([lt({type:String,reflect:!0})],rs.prototype,"legend",2),es([lt({type:String,attribute:"help-text",reflect:!0})],rs.prototype,"helpText",2),es([lt({type:String,attribute:"error-message",reflect:!0})],rs.prototype,"errorMessage",2),es([lt({type:Boolean,attribute:"readonly",reflect:!0})],rs.prototype,"readOnly",2),es([lt({type:Boolean,reflect:!0})],rs.prototype,"disabled",2),es([lt({type:String,reflect:!0})],rs.prototype,"size",2),es([ct()],rs.prototype,"_selectedValues",2),es([ht("slot")],rs.prototype,"_slotElement",2),rs=es([pt("sds-checkbox-group")],rs);const as=a`
|
|
2252
868
|
:host {
|
|
2253
869
|
--_sds-chip-font-family: var(--sds-chip-font-family, var(--sds-typography-font-family-roboto));
|
|
2254
870
|
--_sds-chip-font-weight: var(--sds-chip-font-weight, var(--sds-typography-font-weight-regular));
|
|
@@ -2392,141 +1008,22 @@ const styles$b = i$4`
|
|
|
2392
1008
|
white-space: nowrap;
|
|
2393
1009
|
}
|
|
2394
1010
|
}
|
|
2395
|
-
`;
|
|
2396
|
-
var __defProp$b = Object.defineProperty;
|
|
2397
|
-
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
2398
|
-
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
2399
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
2400
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
2401
|
-
if (decorator = decorators[i3])
|
|
2402
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2403
|
-
if (kind && result) __defProp$b(target, key, result);
|
|
2404
|
-
return result;
|
|
2405
|
-
};
|
|
2406
|
-
let SDSChip = class extends i$1 {
|
|
2407
|
-
constructor() {
|
|
2408
|
-
super();
|
|
2409
|
-
this.variant = "selectable";
|
|
2410
|
-
this.size = "md";
|
|
2411
|
-
this.checked = false;
|
|
2412
|
-
this.disabled = false;
|
|
2413
|
-
this.readonly = false;
|
|
2414
|
-
this._initialChecked = false;
|
|
2415
|
-
this._toggle = (event) => {
|
|
2416
|
-
event.preventDefault();
|
|
2417
|
-
event.stopImmediatePropagation();
|
|
2418
|
-
if (this.disabled || this.readonly) return;
|
|
2419
|
-
this.checked = !this.checked;
|
|
2420
|
-
this.internals.setFormValue(this.checked ? this.value ?? "on" : null);
|
|
2421
|
-
this.dispatchEvent(
|
|
2422
|
-
new CustomEvent("change", {
|
|
2423
|
-
bubbles: true,
|
|
2424
|
-
composed: true
|
|
2425
|
-
})
|
|
2426
|
-
);
|
|
2427
|
-
};
|
|
2428
|
-
this._remove = () => {
|
|
2429
|
-
if (this.disabled || this.readonly) return;
|
|
2430
|
-
this.dispatchEvent(
|
|
2431
|
-
new CustomEvent("sds-remove", {
|
|
2432
|
-
bubbles: true,
|
|
2433
|
-
composed: true
|
|
2434
|
-
})
|
|
2435
|
-
);
|
|
2436
|
-
};
|
|
2437
|
-
this._keypress = (event) => {
|
|
2438
|
-
if (![" ", "Enter"].includes(event.key)) {
|
|
2439
|
-
return;
|
|
2440
|
-
}
|
|
2441
|
-
if (this.variant === "removable") {
|
|
2442
|
-
this._remove();
|
|
2443
|
-
} else {
|
|
2444
|
-
this._toggle(event);
|
|
2445
|
-
}
|
|
2446
|
-
};
|
|
2447
|
-
this.internals = this.attachInternals();
|
|
2448
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
2449
|
-
}
|
|
2450
|
-
connectedCallback() {
|
|
2451
|
-
super.connectedCallback();
|
|
2452
|
-
this._initialChecked = this.checked;
|
|
2453
|
-
this.internals.role = "checkbox";
|
|
2454
|
-
if (this.checked) {
|
|
2455
|
-
this.internals.setFormValue(this.value ?? null);
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
formResetCallback() {
|
|
2459
|
-
this.checked = this._initialChecked;
|
|
2460
|
-
this.internals.setFormValue(this.value ?? null);
|
|
2461
|
-
}
|
|
2462
|
-
focus() {
|
|
2463
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
|
|
2464
|
-
}
|
|
2465
|
-
blur() {
|
|
2466
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
|
|
2467
|
-
}
|
|
2468
|
-
click() {
|
|
2469
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.click();
|
|
2470
|
-
}
|
|
2471
|
-
render() {
|
|
2472
|
-
const isRemovableVariant = this.variant === "removable" && !this.readonly && !this.disabled;
|
|
2473
|
-
const chipClasses = {
|
|
2474
|
-
"sds-chip": true,
|
|
2475
|
-
"sds-chip--small": this.size === "small" || this.size === "sm",
|
|
2476
|
-
"sds-chip--large": this.size === "large" || this.size === "lg",
|
|
2477
|
-
"sds-chip--removable": isRemovableVariant
|
|
2478
|
-
};
|
|
2479
|
-
if (isRemovableVariant) {
|
|
2480
|
-
return x`<button class="${e2(chipClasses)}" @click=${this._remove} @keyup="${this._keypress}">
|
|
1011
|
+
`;var is=Object.defineProperty,ds=Object.getOwnPropertyDescriptor,ns=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?ds(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&is(s,e,a),a};let ls=class extends at{constructor(){super(),this.variant="selectable",this.size="md",this.checked=!1,this.disabled=!1,this.readonly=!1,this._initialChecked=!1,this._toggle=t=>{t.preventDefault(),t.stopImmediatePropagation(),this.disabled||this.readonly||(this.checked=!this.checked,this.internals.setFormValue(this.checked?this.value??"on":null),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0})))},this._remove=()=>{this.disabled||this.readonly||this.dispatchEvent(new CustomEvent("sds-remove",{bubbles:!0,composed:!0}))},this._keypress=t=>{[" ","Enter"].includes(t.key)&&("removable"===this.variant?this._remove():this._toggle(t))},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}connectedCallback(){super.connectedCallback(),this._initialChecked=this.checked,this.internals.role="checkbox",this.checked&&this.internals.setFormValue(this.value??null)}formResetCallback(){this.checked=this._initialChecked,this.internals.setFormValue(this.value??null)}focus(){this.disabled||this.shadowRoot?.querySelector("input")?.focus()}blur(){this.disabled||this.shadowRoot?.querySelector("input")?.blur()}click(){this.disabled||this.shadowRoot?.querySelector("input")?.click()}render(){const t="removable"===this.variant&&!this.readonly&&!this.disabled,s={"sds-chip":!0,"sds-chip--small":"small"===this.size||"sm"===this.size,"sds-chip--large":"large"===this.size||"lg"===this.size,"sds-chip--removable":t};return t?j`<button class="${Ot(s)}" @click=${this._remove} @keyup="${this._keypress}">
|
|
2481
1012
|
<slot></slot>
|
|
2482
1013
|
<sds-icon name="close-material-outlined" size="s"></sds-icon>
|
|
2483
|
-
</button
|
|
2484
|
-
}
|
|
2485
|
-
return x`<label class="${e2(chipClasses)}" @click="${this._toggle}" @keyup="${this._keypress}">
|
|
1014
|
+
</button>`:j`<label class="${Ot(s)}" @click="${this._toggle}" @keyup="${this._keypress}">
|
|
2486
1015
|
<input
|
|
2487
1016
|
id="control"
|
|
2488
1017
|
type="checkbox"
|
|
2489
|
-
name="${
|
|
2490
|
-
value="${
|
|
1018
|
+
name="${vt(this.name)}"
|
|
1019
|
+
value="${vt(this.value)}"
|
|
2491
1020
|
.checked="${this.checked}"
|
|
2492
1021
|
?checked="${this.checked}"
|
|
2493
1022
|
?disabled="${this.disabled}"
|
|
2494
1023
|
?readonly="${this.readonly}"
|
|
2495
1024
|
/>
|
|
2496
1025
|
<slot></slot>
|
|
2497
|
-
</label
|
|
2498
|
-
}
|
|
2499
|
-
};
|
|
2500
|
-
SDSChip.styles = [styles$b];
|
|
2501
|
-
SDSChip.formAssociated = true;
|
|
2502
|
-
__decorateClass$b([
|
|
2503
|
-
n2({ type: String, reflect: true })
|
|
2504
|
-
], SDSChip.prototype, "variant", 2);
|
|
2505
|
-
__decorateClass$b([
|
|
2506
|
-
n2({ type: String, reflect: true })
|
|
2507
|
-
], SDSChip.prototype, "size", 2);
|
|
2508
|
-
__decorateClass$b([
|
|
2509
|
-
n2({ type: Boolean, reflect: true })
|
|
2510
|
-
], SDSChip.prototype, "checked", 2);
|
|
2511
|
-
__decorateClass$b([
|
|
2512
|
-
n2({ type: String, reflect: true })
|
|
2513
|
-
], SDSChip.prototype, "name", 2);
|
|
2514
|
-
__decorateClass$b([
|
|
2515
|
-
n2({ type: String })
|
|
2516
|
-
], SDSChip.prototype, "value", 2);
|
|
2517
|
-
__decorateClass$b([
|
|
2518
|
-
n2({ type: Boolean, reflect: true })
|
|
2519
|
-
], SDSChip.prototype, "disabled", 2);
|
|
2520
|
-
__decorateClass$b([
|
|
2521
|
-
n2({ type: Boolean, reflect: true })
|
|
2522
|
-
], SDSChip.prototype, "readonly", 2);
|
|
2523
|
-
__decorateClass$b([
|
|
2524
|
-
e$3("#control")
|
|
2525
|
-
], SDSChip.prototype, "control", 2);
|
|
2526
|
-
SDSChip = __decorateClass$b([
|
|
2527
|
-
guardedCustomElement("sds-chip")
|
|
2528
|
-
], SDSChip);
|
|
2529
|
-
const styles$a = i$4`
|
|
1026
|
+
</label>`}};ls.styles=[as],ls.formAssociated=!0,ns([lt({type:String,reflect:!0})],ls.prototype,"variant",2),ns([lt({type:String,reflect:!0})],ls.prototype,"size",2),ns([lt({type:Boolean,reflect:!0})],ls.prototype,"checked",2),ns([lt({type:String,reflect:!0})],ls.prototype,"name",2),ns([lt({type:String})],ls.prototype,"value",2),ns([lt({type:Boolean,reflect:!0})],ls.prototype,"disabled",2),ns([lt({type:Boolean,reflect:!0})],ls.prototype,"readonly",2),ns([ht("#control")],ls.prototype,"control",2),ls=ns([pt("sds-chip")],ls);const cs=a`
|
|
2530
1027
|
:host {
|
|
2531
1028
|
--_sds-details-text-color: var(--sds-details-text-color, var(--sds-color-text-default, var(--sds-color-main-text-default)));
|
|
2532
1029
|
|
|
@@ -2627,7 +1124,7 @@ const styles$a = i$4`
|
|
|
2627
1124
|
transition: var(--_sds-details-icon-transition);
|
|
2628
1125
|
}
|
|
2629
1126
|
|
|
2630
|
-
.sds-details[open] sds-icon {
|
|
1127
|
+
.sds-details:not([open]) sds-icon {
|
|
2631
1128
|
transform: rotate(180deg);
|
|
2632
1129
|
}
|
|
2633
1130
|
|
|
@@ -2662,40 +1159,8 @@ const styles$a = i$4`
|
|
|
2662
1159
|
display: inline;
|
|
2663
1160
|
margin: 0;
|
|
2664
1161
|
}
|
|
2665
|
-
`;
|
|
2666
|
-
|
|
2667
|
-
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
2668
|
-
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
2669
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
2670
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
2671
|
-
if (decorator = decorators[i3])
|
|
2672
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2673
|
-
if (kind && result) __defProp$a(target, key, result);
|
|
2674
|
-
return result;
|
|
2675
|
-
};
|
|
2676
|
-
let SDSDetails = class extends i$1 {
|
|
2677
|
-
constructor() {
|
|
2678
|
-
super(...arguments);
|
|
2679
|
-
this.open = false;
|
|
2680
|
-
this.standalone = false;
|
|
2681
|
-
this.name = void 0;
|
|
2682
|
-
this._handleToggle = (event) => {
|
|
2683
|
-
const details = event.currentTarget;
|
|
2684
|
-
if (this.open !== details.open) {
|
|
2685
|
-
this.open = details.open;
|
|
2686
|
-
}
|
|
2687
|
-
this.dispatchEvent(
|
|
2688
|
-
new CustomEvent("sds-toggle", {
|
|
2689
|
-
detail: { open: details.open },
|
|
2690
|
-
bubbles: true,
|
|
2691
|
-
composed: true
|
|
2692
|
-
})
|
|
2693
|
-
);
|
|
2694
|
-
};
|
|
2695
|
-
}
|
|
2696
|
-
render() {
|
|
2697
|
-
return x`
|
|
2698
|
-
<details class="sds-details" .name="${this.name ?? ""}" ?data-standalone="${this.standalone}" ?open="${this.open}" @toggle="${this._handleToggle}">
|
|
1162
|
+
`;var hs=Object.defineProperty,ps=Object.getOwnPropertyDescriptor,gs=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?ps(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&hs(s,e,a),a};let vs=class extends at{constructor(){super(...arguments),this.open=!1,this.standalone=!1,this.name=void 0,this._handleToggle=t=>{const s=t.currentTarget;this.open!==s.open&&(this.open=s.open),this.dispatchEvent(new CustomEvent("sds-toggle",{detail:{open:s.open},bubbles:!0,composed:!0}))}}render(){return j`
|
|
1163
|
+
<details class="sds-details" .name="${this.name??""}" ?data-standalone="${this.standalone}" ?open="${this.open}" @toggle="${this._handleToggle}">
|
|
2699
1164
|
<summary class="sds-details__summary">
|
|
2700
1165
|
<sds-icon name="chevron_up-material-filled"></sds-icon>
|
|
2701
1166
|
<div class="sds-details__summary-content">
|
|
@@ -2706,23 +1171,7 @@ let SDSDetails = class extends i$1 {
|
|
|
2706
1171
|
<slot></slot>
|
|
2707
1172
|
</div>
|
|
2708
1173
|
</details>
|
|
2709
|
-
|
|
2710
|
-
}
|
|
2711
|
-
};
|
|
2712
|
-
SDSDetails.styles = [styles$a];
|
|
2713
|
-
__decorateClass$a([
|
|
2714
|
-
n2({ type: Boolean, reflect: true })
|
|
2715
|
-
], SDSDetails.prototype, "open", 2);
|
|
2716
|
-
__decorateClass$a([
|
|
2717
|
-
n2({ type: Boolean, reflect: true })
|
|
2718
|
-
], SDSDetails.prototype, "standalone", 2);
|
|
2719
|
-
__decorateClass$a([
|
|
2720
|
-
n2({ type: String, reflect: true })
|
|
2721
|
-
], SDSDetails.prototype, "name", 2);
|
|
2722
|
-
SDSDetails = __decorateClass$a([
|
|
2723
|
-
guardedCustomElement("sds-details")
|
|
2724
|
-
], SDSDetails);
|
|
2725
|
-
const styles$9 = i$4`
|
|
1174
|
+
`}};vs.styles=[cs],gs([lt({type:Boolean,reflect:!0})],vs.prototype,"open",2),gs([lt({type:Boolean,reflect:!0})],vs.prototype,"standalone",2),gs([lt({type:String,reflect:!0})],vs.prototype,"name",2),vs=gs([pt("sds-details")],vs);const us=a`
|
|
2726
1175
|
:host {
|
|
2727
1176
|
--_sds-heading-font-family: var(--sds-heading-font-family, var(--sds-typography-font-family-roboto));
|
|
2728
1177
|
--_sds-heading-text-color: var(--sds-heading-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));
|
|
@@ -2875,60 +1324,7 @@ const styles$9 = i$4`
|
|
|
2875
1324
|
--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xs-desktop-line-height));
|
|
2876
1325
|
}
|
|
2877
1326
|
}
|
|
2878
|
-
`;
|
|
2879
|
-
var __defProp$9 = Object.defineProperty;
|
|
2880
|
-
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
2881
|
-
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
2882
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
2883
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
2884
|
-
if (decorator = decorators[i3])
|
|
2885
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2886
|
-
if (kind && result) __defProp$9(target, key, result);
|
|
2887
|
-
return result;
|
|
2888
|
-
};
|
|
2889
|
-
let SDSHeading = class extends i$1 {
|
|
2890
|
-
constructor() {
|
|
2891
|
-
super(...arguments);
|
|
2892
|
-
this.level = "h1";
|
|
2893
|
-
}
|
|
2894
|
-
render() {
|
|
2895
|
-
const headingClasses = {
|
|
2896
|
-
"sds-heading": true,
|
|
2897
|
-
"sds-heading--xl": this.size === "xl",
|
|
2898
|
-
"sds-heading--lg": this.size === "l" || this.size === "lg",
|
|
2899
|
-
"sds-heading--md": this.size === "m" || this.size === "md",
|
|
2900
|
-
"sds-heading--sm": this.size === "s" || this.size === "sm",
|
|
2901
|
-
"sds-heading--xs": this.size === "xs"
|
|
2902
|
-
};
|
|
2903
|
-
switch (this.level?.toLowerCase()) {
|
|
2904
|
-
case "h1":
|
|
2905
|
-
return x`<h1 class=${e2(headingClasses)}><slot></slot></h1>`;
|
|
2906
|
-
case "h2":
|
|
2907
|
-
return x`<h2 class=${e2(headingClasses)}><slot></slot></h2>`;
|
|
2908
|
-
case "h3":
|
|
2909
|
-
return x`<h3 class=${e2(headingClasses)}><slot></slot></h3>`;
|
|
2910
|
-
case "h4":
|
|
2911
|
-
return x`<h4 class=${e2(headingClasses)}><slot></slot></h4>`;
|
|
2912
|
-
case "h5":
|
|
2913
|
-
return x`<h5 class=${e2(headingClasses)}><slot></slot></h5>`;
|
|
2914
|
-
case "h6":
|
|
2915
|
-
return x`<h6 class=${e2(headingClasses)}><slot></slot></h6>`;
|
|
2916
|
-
default:
|
|
2917
|
-
return x`<h1 class=${e2(headingClasses)}><slot></slot></h1>`;
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
};
|
|
2921
|
-
SDSHeading.styles = [styles$9];
|
|
2922
|
-
__decorateClass$9([
|
|
2923
|
-
n2({ type: String, reflect: true })
|
|
2924
|
-
], SDSHeading.prototype, "level", 2);
|
|
2925
|
-
__decorateClass$9([
|
|
2926
|
-
n2({ type: String, reflect: true })
|
|
2927
|
-
], SDSHeading.prototype, "size", 2);
|
|
2928
|
-
SDSHeading = __decorateClass$9([
|
|
2929
|
-
guardedCustomElement("sds-heading")
|
|
2930
|
-
], SDSHeading);
|
|
2931
|
-
const styles$8 = i$4`
|
|
1327
|
+
`;var fs=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,_s=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?bs(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&fs(s,e,a),a};let xs=class extends at{constructor(){super(...arguments),this.level="h1"}render(){const t={"sds-heading":!0,"sds-heading--xl":"xl"===this.size,"sds-heading--lg":"l"===this.size||"lg"===this.size,"sds-heading--md":"m"===this.size||"md"===this.size,"sds-heading--sm":"s"===this.size||"sm"===this.size,"sds-heading--xs":"xs"===this.size};switch(this.level?.toLowerCase()){case"h1":default:return j`<h1 class=${Ot(t)}><slot></slot></h1>`;case"h2":return j`<h2 class=${Ot(t)}><slot></slot></h2>`;case"h3":return j`<h3 class=${Ot(t)}><slot></slot></h3>`;case"h4":return j`<h4 class=${Ot(t)}><slot></slot></h4>`;case"h5":return j`<h5 class=${Ot(t)}><slot></slot></h5>`;case"h6":return j`<h6 class=${Ot(t)}><slot></slot></h6>`}}};xs.styles=[us],_s([lt({type:String,reflect:!0})],xs.prototype,"level",2),_s([lt({type:String,reflect:!0})],xs.prototype,"size",2),xs=_s([pt("sds-heading")],xs);const ms=a`
|
|
2932
1328
|
:host {
|
|
2933
1329
|
--_sds-loader-main-color: var(--sds-loader-main-color, var(--sds-color-action-contrast-default, var(--sds-color-main-action-contrast-default)));
|
|
2934
1330
|
--_sds-loader-secondary-color: var(--sds-loader-secondary-color, var(--sds-color-border-subtle, var(--sds-color-main-border-subtle)));
|
|
@@ -3004,41 +1400,10 @@ const styles$8 = i$4`
|
|
|
3004
1400
|
stroke-dashoffset: -120px;
|
|
3005
1401
|
}
|
|
3006
1402
|
}
|
|
3007
|
-
`;
|
|
3008
|
-
var __defProp$8 = Object.defineProperty;
|
|
3009
|
-
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
3010
|
-
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
3011
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
3012
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
3013
|
-
if (decorator = decorators[i3])
|
|
3014
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3015
|
-
if (kind && result) __defProp$8(target, key, result);
|
|
3016
|
-
return result;
|
|
3017
|
-
};
|
|
3018
|
-
let SDSLoader = class extends i$1 {
|
|
3019
|
-
constructor() {
|
|
3020
|
-
super(...arguments);
|
|
3021
|
-
this.size = "md";
|
|
3022
|
-
this.contrast = false;
|
|
3023
|
-
}
|
|
3024
|
-
render() {
|
|
3025
|
-
return x`<svg aria-label="Laster" class="sds-loader" role="img" viewBox="0 0 50 50">
|
|
1403
|
+
`;var ys=Object.defineProperty,ws=Object.getOwnPropertyDescriptor,ks=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?ws(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&ys(s,e,a),a};let zs=class extends at{constructor(){super(...arguments),this.size="md",this.contrast=!1}render(){return j`<svg aria-label="Laster" class="sds-loader" role="img" viewBox="0 0 50 50">
|
|
3026
1404
|
<circle class="sds-loader__background" cx="25" cy="25" r="20" fill="none" stroke-width="7"></circle>
|
|
3027
1405
|
<circle class="sds-loader__circle" cx="25" cy="25" r="20" fill="none" stroke-width="7"></circle>
|
|
3028
|
-
</svg
|
|
3029
|
-
}
|
|
3030
|
-
};
|
|
3031
|
-
SDSLoader.styles = [styles$8];
|
|
3032
|
-
__decorateClass$8([
|
|
3033
|
-
n2({ type: String, reflect: true })
|
|
3034
|
-
], SDSLoader.prototype, "size", 2);
|
|
3035
|
-
__decorateClass$8([
|
|
3036
|
-
n2({ type: Boolean, reflect: true })
|
|
3037
|
-
], SDSLoader.prototype, "contrast", 2);
|
|
3038
|
-
SDSLoader = __decorateClass$8([
|
|
3039
|
-
guardedCustomElement("sds-loader")
|
|
3040
|
-
], SDSLoader);
|
|
3041
|
-
const styles$7 = i$4`
|
|
1406
|
+
</svg>`}};zs.styles=[ms],ks([lt({type:String,reflect:!0})],zs.prototype,"size",2),ks([lt({type:Boolean,reflect:!0})],zs.prototype,"contrast",2),zs=ks([pt("sds-loader")],zs);const $s=a`
|
|
3042
1407
|
:host {
|
|
3043
1408
|
--_sds-notification-background-color: var(--sds-notification-background-color, var(--sds-color-alert-info-surface-tinted));
|
|
3044
1409
|
|
|
@@ -3175,83 +1540,20 @@ const styles$7 = i$4`
|
|
|
3175
1540
|
margin: 0 !important;
|
|
3176
1541
|
max-width: var(--_sds-notification-max-line-width) !important;
|
|
3177
1542
|
}
|
|
3178
|
-
`;
|
|
3179
|
-
var __defProp$7 = Object.defineProperty;
|
|
3180
|
-
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
3181
|
-
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
3182
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
3183
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
3184
|
-
if (decorator = decorators[i3])
|
|
3185
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3186
|
-
if (kind && result) __defProp$7(target, key, result);
|
|
3187
|
-
return result;
|
|
3188
|
-
};
|
|
3189
|
-
const notificationIcons = {
|
|
3190
|
-
info: "InformationSquareFill-aksel-filled",
|
|
3191
|
-
success: "check_circle-material-filled",
|
|
3192
|
-
attention: "warning-material-filled",
|
|
3193
|
-
warning: "warning-material-filled",
|
|
3194
|
-
danger: "dangerous-material-filled",
|
|
3195
|
-
critical: "dangerous-material-filled"
|
|
3196
|
-
// Deprecated
|
|
3197
|
-
};
|
|
3198
|
-
let hasWarnedAboutDeprecation = false;
|
|
3199
|
-
let SDSNotification = class extends i$1 {
|
|
3200
|
-
constructor() {
|
|
3201
|
-
super();
|
|
3202
|
-
this.variant = "info";
|
|
3203
|
-
this._remove = () => {
|
|
3204
|
-
this.dispatchEvent(
|
|
3205
|
-
new CustomEvent("sds-remove", {
|
|
3206
|
-
bubbles: true,
|
|
3207
|
-
composed: true
|
|
3208
|
-
})
|
|
3209
|
-
);
|
|
3210
|
-
};
|
|
3211
|
-
if (!hasWarnedAboutDeprecation) {
|
|
3212
|
-
hasWarnedAboutDeprecation = true;
|
|
3213
|
-
console.warn("[Sheriff] The Notification component is deprecated and will be removed in the next major release. Please migrate to the Alert component.");
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
updated(changed) {
|
|
3217
|
-
if (changed.has("variant") && this.variant === "critical") {
|
|
3218
|
-
this.variant = "danger";
|
|
3219
|
-
} else if (changed.has("variant") && this.variant === "warning") {
|
|
3220
|
-
this.variant = "attention";
|
|
3221
|
-
}
|
|
3222
|
-
}
|
|
3223
|
-
render() {
|
|
3224
|
-
const notificationClasses = {
|
|
3225
|
-
"sds-notification": true
|
|
3226
|
-
};
|
|
3227
|
-
const colorPalette = this.variant === "danger" || this.variant === "critical" ? "danger" : "accent";
|
|
3228
|
-
return x`<div class="${e2(notificationClasses)}">
|
|
1543
|
+
`;var Ss=Object.defineProperty,Cs=Object.getOwnPropertyDescriptor,Es=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Cs(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Ss(s,e,a),a};const As={info:"InformationSquareFill-aksel-filled",success:"check_circle-material-filled",attention:"warning-material-filled",warning:"warning-material-filled",danger:"dangerous-material-filled",critical:"dangerous-material-filled"};let qs=!1,Os=class extends at{constructor(){super(),this.variant="info",this._remove=()=>{this.dispatchEvent(new CustomEvent("sds-remove",{bubbles:!0,composed:!0}))},qs||(qs=!0,console.warn("[Sheriff] The Notification component is deprecated and will be removed in the next major release. Please migrate to the Alert component."))}updated(t){t.has("variant")&&"critical"===this.variant?this.variant="danger":t.has("variant")&&"warning"===this.variant&&(this.variant="attention")}render(){const t="danger"===this.variant||"critical"===this.variant?"danger":"accent";return j`<div class="${Ot({"sds-notification":!0})}">
|
|
3229
1544
|
<div class="sds-notification__type">
|
|
3230
|
-
<sds-icon class="sds-notification__icon" name="${
|
|
1545
|
+
<sds-icon class="sds-notification__icon" name="${As[this.variant]}" size="md"></sds-icon>
|
|
3231
1546
|
</div>
|
|
3232
1547
|
<div class="sds-notification__content">
|
|
3233
1548
|
<slot name="title"></slot>
|
|
3234
1549
|
<slot name="message"></slot>
|
|
3235
1550
|
</div>
|
|
3236
|
-
${this.removableLabel
|
|
3237
|
-
<sds-button icon variant="tertiary" color="${
|
|
1551
|
+
${this.removableLabel?j`<div class="sds-notification__actions">
|
|
1552
|
+
<sds-button icon variant="tertiary" color="${t}" size="sm" @click=${this._remove} aria-label="${this.removableLabel}">
|
|
3238
1553
|
<sds-icon name="close-material-outlined" size="sm"></sds-icon>
|
|
3239
1554
|
</sds-button>
|
|
3240
|
-
</div
|
|
3241
|
-
</div
|
|
3242
|
-
}
|
|
3243
|
-
};
|
|
3244
|
-
SDSNotification.styles = [styles$7];
|
|
3245
|
-
__decorateClass$7([
|
|
3246
|
-
n2({ type: String, reflect: true })
|
|
3247
|
-
], SDSNotification.prototype, "variant", 2);
|
|
3248
|
-
__decorateClass$7([
|
|
3249
|
-
n2({ type: String, attribute: "removable-label", reflect: true })
|
|
3250
|
-
], SDSNotification.prototype, "removableLabel", 2);
|
|
3251
|
-
SDSNotification = __decorateClass$7([
|
|
3252
|
-
guardedCustomElement("sds-notification")
|
|
3253
|
-
], SDSNotification);
|
|
3254
|
-
const styles$6 = i$4`
|
|
1555
|
+
</div>`:U}
|
|
1556
|
+
</div>`}};Os.styles=[$s],Es([lt({type:String,reflect:!0})],Os.prototype,"variant",2),Es([lt({type:String,attribute:"removable-label",reflect:!0})],Os.prototype,"removableLabel",2),Os=Es([pt("sds-notification")],Os);const Ps=a`
|
|
3255
1557
|
:host {
|
|
3256
1558
|
--_sds-radio-font-family: var(--sds-radio-font-family, var(--sds-typography-font-family-roboto));
|
|
3257
1559
|
--_sds-radio-disabled-opacity: var(--sds-radio-disabled-opacity, var(--sds-color-states-disabled-opacity));
|
|
@@ -3275,6 +1577,11 @@ const styles$6 = i$4`
|
|
|
3275
1577
|
--_sds-radio-input-dot-color: var(--sds-radio-input-dot-color, transparent);
|
|
3276
1578
|
--_sds-radio-input-dot-size: var(--sds-radio-input-dot-size, 4.5px);
|
|
3277
1579
|
|
|
1580
|
+
--_sds-radio-grid-template-areas: var(--sds-radio-grid-template-area, 'input content');
|
|
1581
|
+
--_sds-radio-label-grid-area: var(--sds-radio-label-grid-area, content);
|
|
1582
|
+
--_sds-radio-input-grid-area: var(--sds-radio-input-grid-area, input);
|
|
1583
|
+
--_sds-radio-help-text-grid-area: var(--sds-radio-help-text-grid-area, content);
|
|
1584
|
+
|
|
3278
1585
|
display: inline-flex;
|
|
3279
1586
|
flex: 0 0 auto;
|
|
3280
1587
|
}
|
|
@@ -3283,7 +1590,7 @@ const styles$6 = i$4`
|
|
|
3283
1590
|
display: grid;
|
|
3284
1591
|
font-family: var(--_sds-radio-font-family);
|
|
3285
1592
|
gap: var(--_sds-radio-block-gap) var(--_sds-radio-inline-gap);
|
|
3286
|
-
grid-template-areas:
|
|
1593
|
+
grid-template-areas: var(--_sds-radio-grid-template-areas);
|
|
3287
1594
|
grid-template-columns: auto 1fr;
|
|
3288
1595
|
width: fit-content;
|
|
3289
1596
|
|
|
@@ -3305,7 +1612,7 @@ const styles$6 = i$4`
|
|
|
3305
1612
|
}
|
|
3306
1613
|
|
|
3307
1614
|
.sds-radio__help-text {
|
|
3308
|
-
grid-column:
|
|
1615
|
+
grid-column: var(--_sds-radio-help-text-grid-area);
|
|
3309
1616
|
margin: 0;
|
|
3310
1617
|
color: var(--_sds-radio-help-text-color);
|
|
3311
1618
|
font-size: var(--_sds-radio-help-text-font-size);
|
|
@@ -3322,7 +1629,7 @@ const styles$6 = i$4`
|
|
|
3322
1629
|
font-weight: var(--_sds-radio-label-font-weight);
|
|
3323
1630
|
line-height: var(--_sds-radio-label-line-height);
|
|
3324
1631
|
|
|
3325
|
-
grid-column:
|
|
1632
|
+
grid-column: var(--_sds-radio-label-grid-area);
|
|
3326
1633
|
}
|
|
3327
1634
|
|
|
3328
1635
|
.sds-radio__input {
|
|
@@ -3339,7 +1646,7 @@ const styles$6 = i$4`
|
|
|
3339
1646
|
margin: 0;
|
|
3340
1647
|
position: relative;
|
|
3341
1648
|
|
|
3342
|
-
grid-column: input;
|
|
1649
|
+
grid-column: var(--_sds-radio-input-grid-area);
|
|
3343
1650
|
grid-row: 1;
|
|
3344
1651
|
|
|
3345
1652
|
&[readonly] {
|
|
@@ -3448,303 +1755,28 @@ const styles$6 = i$4`
|
|
|
3448
1755
|
margin-block-start: -1px;
|
|
3449
1756
|
}
|
|
3450
1757
|
}
|
|
3451
|
-
`;
|
|
3452
|
-
|
|
3453
|
-
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
3454
|
-
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
3455
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
3456
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
3457
|
-
if (decorator = decorators[i3])
|
|
3458
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3459
|
-
if (kind && result) __defProp$6(target, key, result);
|
|
3460
|
-
return result;
|
|
3461
|
-
};
|
|
3462
|
-
let SDSRadio = class extends i$1 {
|
|
3463
|
-
constructor() {
|
|
3464
|
-
super();
|
|
3465
|
-
this.required = false;
|
|
3466
|
-
this.label = "";
|
|
3467
|
-
this.hideLabel = false;
|
|
3468
|
-
this.value = "on";
|
|
3469
|
-
this.checked = false;
|
|
3470
|
-
this.error = false;
|
|
3471
|
-
this.readOnly = false;
|
|
3472
|
-
this.size = "md";
|
|
3473
|
-
this._disabled = false;
|
|
3474
|
-
this._disabledIsAuthorControlled = false;
|
|
3475
|
-
this._settingDisabledFromParent = false;
|
|
3476
|
-
this._parentRequestDisabled = false;
|
|
3477
|
-
this._initialChecked = false;
|
|
3478
|
-
this._handleKeydown = (event) => {
|
|
3479
|
-
if (!this.name || this.disabled || this.readOnly) return;
|
|
3480
|
-
const root = this.getRootNode();
|
|
3481
|
-
const radios = Array.from(root.querySelectorAll(`sds-radio[name="${this.name}"]`));
|
|
3482
|
-
const currentIndex = radios.indexOf(this);
|
|
3483
|
-
if (currentIndex === -1) return;
|
|
3484
|
-
let targetIndex = null;
|
|
3485
|
-
switch (event.key) {
|
|
3486
|
-
case "ArrowUp":
|
|
3487
|
-
case "ArrowLeft":
|
|
3488
|
-
targetIndex = currentIndex > 0 ? currentIndex - 1 : radios.length - 1;
|
|
3489
|
-
break;
|
|
3490
|
-
case "ArrowDown":
|
|
3491
|
-
case "ArrowRight":
|
|
3492
|
-
targetIndex = currentIndex < radios.length - 1 ? currentIndex + 1 : 0;
|
|
3493
|
-
break;
|
|
3494
|
-
default:
|
|
3495
|
-
return;
|
|
3496
|
-
}
|
|
3497
|
-
const targetRadio = radios[targetIndex];
|
|
3498
|
-
targetRadio?.focus();
|
|
3499
|
-
targetRadio?.click();
|
|
3500
|
-
event.preventDefault();
|
|
3501
|
-
};
|
|
3502
|
-
this._handleChange = (event) => {
|
|
3503
|
-
if (this.disabled || this.readOnly) {
|
|
3504
|
-
event.target.checked = this.checked ?? false;
|
|
3505
|
-
event.preventDefault();
|
|
3506
|
-
return;
|
|
3507
|
-
}
|
|
3508
|
-
const elem = event.target;
|
|
3509
|
-
this.checked = elem.checked;
|
|
3510
|
-
if (this.checked) {
|
|
3511
|
-
this._uncheckSiblings();
|
|
3512
|
-
}
|
|
3513
|
-
this._updateGroupValidation();
|
|
3514
|
-
this.dispatchEvent(new CustomEvent("change", { bubbles: true, composed: true }));
|
|
3515
|
-
};
|
|
3516
|
-
this._handleFocus = (event) => {
|
|
3517
|
-
event.stopImmediatePropagation();
|
|
3518
|
-
this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
|
|
3519
|
-
};
|
|
3520
|
-
this._handleBlur = (event) => {
|
|
3521
|
-
event.stopImmediatePropagation();
|
|
3522
|
-
this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
|
|
3523
|
-
};
|
|
3524
|
-
this.internals = this.attachInternals();
|
|
3525
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
3526
|
-
}
|
|
3527
|
-
/**
|
|
3528
|
-
* disabled:
|
|
3529
|
-
* - If set directly (prop/attr), this radio becomes "self-controlled"
|
|
3530
|
-
* and ignores parentRequestDisabled.
|
|
3531
|
-
* - If not self-controlled, this follows parentRequestDisabled (group/form).
|
|
3532
|
-
*/
|
|
3533
|
-
get disabled() {
|
|
3534
|
-
return this._disabled;
|
|
3535
|
-
}
|
|
3536
|
-
set disabled(value) {
|
|
3537
|
-
const newVal = value ?? false;
|
|
3538
|
-
const oldVal = this._disabled;
|
|
3539
|
-
if (oldVal === newVal) return;
|
|
3540
|
-
this._disabled = newVal;
|
|
3541
|
-
this.requestUpdate("disabled", oldVal);
|
|
3542
|
-
if (!this._settingDisabledFromParent) {
|
|
3543
|
-
this._disabledIsAuthorControlled = newVal;
|
|
3544
|
-
}
|
|
3545
|
-
}
|
|
3546
|
-
get parentRequestDisabled() {
|
|
3547
|
-
return this._parentRequestDisabled;
|
|
3548
|
-
}
|
|
3549
|
-
set parentRequestDisabled(value) {
|
|
3550
|
-
const newVal = value ?? false;
|
|
3551
|
-
const oldVal = this._parentRequestDisabled;
|
|
3552
|
-
if (oldVal === newVal) return;
|
|
3553
|
-
this._parentRequestDisabled = newVal;
|
|
3554
|
-
this.requestUpdate("parentRequestDisabled", oldVal);
|
|
3555
|
-
if (this._disabledIsAuthorControlled) return;
|
|
3556
|
-
this._settingDisabledFromParent = true;
|
|
3557
|
-
this.disabled = newVal;
|
|
3558
|
-
this._settingDisabledFromParent = false;
|
|
3559
|
-
}
|
|
3560
|
-
connectedCallback() {
|
|
3561
|
-
super.connectedCallback();
|
|
3562
|
-
this.internals.role = "radio";
|
|
3563
|
-
if (!this._initialChecked) {
|
|
3564
|
-
this._initialChecked = this.checked ?? false;
|
|
3565
|
-
}
|
|
3566
|
-
this.addEventListener("keydown", this._handleKeydown);
|
|
3567
|
-
}
|
|
3568
|
-
disconnectedCallback() {
|
|
3569
|
-
super.disconnectedCallback();
|
|
3570
|
-
this.removeEventListener("keydown", this._handleKeydown);
|
|
3571
|
-
}
|
|
3572
|
-
firstUpdated(_changedProperties) {
|
|
3573
|
-
super.firstUpdated(_changedProperties);
|
|
3574
|
-
this._updateGroupValidation();
|
|
3575
|
-
}
|
|
3576
|
-
updated(changedProperties) {
|
|
3577
|
-
super.updated(changedProperties);
|
|
3578
|
-
if (changedProperties.has("checked")) {
|
|
3579
|
-
if (this.checked) {
|
|
3580
|
-
this._uncheckSiblings();
|
|
3581
|
-
this.internals.setFormValue(this.value ?? null);
|
|
3582
|
-
} else {
|
|
3583
|
-
this.internals.setFormValue(null);
|
|
3584
|
-
}
|
|
3585
|
-
this._updateGroupValidation();
|
|
3586
|
-
}
|
|
3587
|
-
if (changedProperties.has("required") && this.control) {
|
|
3588
|
-
this.control.required = this.required ?? false;
|
|
3589
|
-
}
|
|
3590
|
-
if (!this._disabledIsAuthorControlled && this.disabled !== this._parentRequestDisabled) {
|
|
3591
|
-
this._settingDisabledFromParent = true;
|
|
3592
|
-
this.disabled = this._parentRequestDisabled ?? false;
|
|
3593
|
-
this._settingDisabledFromParent = false;
|
|
3594
|
-
}
|
|
3595
|
-
}
|
|
3596
|
-
_getGroupRadios() {
|
|
3597
|
-
if (!this.name) return [this];
|
|
3598
|
-
const root = this.getRootNode();
|
|
3599
|
-
const radioGroup = Array.from(root.querySelectorAll(`sds-radio[name="${this.name}"]`));
|
|
3600
|
-
return radioGroup;
|
|
3601
|
-
}
|
|
3602
|
-
_updateGroupValidation() {
|
|
3603
|
-
const group = this._getGroupRadios();
|
|
3604
|
-
const isAnyChecked = group.some((radio) => radio.checked);
|
|
3605
|
-
const isAnyRequired = group.some((radio) => radio.required);
|
|
3606
|
-
group.forEach((radio) => {
|
|
3607
|
-
if (!radio.control) return;
|
|
3608
|
-
if (isAnyRequired) {
|
|
3609
|
-
radio.internals.setValidity(isAnyChecked ? {} : { valueMissing: true }, isAnyChecked ? "" : radio.control.validationMessage, radio.control);
|
|
3610
|
-
} else {
|
|
3611
|
-
radio.internals.setValidity({});
|
|
3612
|
-
}
|
|
3613
|
-
});
|
|
3614
|
-
}
|
|
3615
|
-
formResetCallback() {
|
|
3616
|
-
this.checked = this._initialChecked;
|
|
3617
|
-
this.control.checked = this._initialChecked;
|
|
3618
|
-
this.internals.setFormValue(this.checked ? this.value ?? "on" : null);
|
|
3619
|
-
this._updateGroupValidation();
|
|
3620
|
-
}
|
|
3621
|
-
_uncheckSiblings() {
|
|
3622
|
-
if (!this.name) return;
|
|
3623
|
-
const radios = this._getGroupRadios();
|
|
3624
|
-
for (const radio of radios) {
|
|
3625
|
-
if (radio !== this && radio.checked) {
|
|
3626
|
-
radio.checked = false;
|
|
3627
|
-
radio.internals.setFormValue(null);
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
|
-
get form() {
|
|
3632
|
-
return this.internals.form;
|
|
3633
|
-
}
|
|
3634
|
-
get type() {
|
|
3635
|
-
return "radio";
|
|
3636
|
-
}
|
|
3637
|
-
get validity() {
|
|
3638
|
-
return this.internals.validity;
|
|
3639
|
-
}
|
|
3640
|
-
get validationMessage() {
|
|
3641
|
-
return this.internals.validationMessage;
|
|
3642
|
-
}
|
|
3643
|
-
get willValidate() {
|
|
3644
|
-
return this.internals.willValidate;
|
|
3645
|
-
}
|
|
3646
|
-
checkValidity() {
|
|
3647
|
-
return this.internals.checkValidity();
|
|
3648
|
-
}
|
|
3649
|
-
reportValidity() {
|
|
3650
|
-
return this.internals.reportValidity();
|
|
3651
|
-
}
|
|
3652
|
-
setCustomValidity(message) {
|
|
3653
|
-
this.internals.setValidity({ customError: !!message }, message);
|
|
3654
|
-
}
|
|
3655
|
-
formDisabledCallback(disabled) {
|
|
3656
|
-
this._settingDisabledFromParent = true;
|
|
3657
|
-
this.disabled = disabled;
|
|
3658
|
-
this._settingDisabledFromParent = false;
|
|
3659
|
-
if (this.control) this.control.disabled = disabled;
|
|
3660
|
-
}
|
|
3661
|
-
focus() {
|
|
3662
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.focus();
|
|
3663
|
-
}
|
|
3664
|
-
blur() {
|
|
3665
|
-
if (!this.disabled) this.shadowRoot?.querySelector("input")?.blur();
|
|
3666
|
-
}
|
|
3667
|
-
click() {
|
|
3668
|
-
if (!this.disabled && !this.readOnly) this.shadowRoot?.querySelector("input")?.click();
|
|
3669
|
-
}
|
|
3670
|
-
render() {
|
|
3671
|
-
const radioClasses = {
|
|
3672
|
-
"sds-radio": true,
|
|
3673
|
-
"sds-radio--error": Boolean(this.error)
|
|
3674
|
-
};
|
|
3675
|
-
const inputClasses = {
|
|
3676
|
-
"sds-radio__input": true,
|
|
3677
|
-
"sds-radio__input--error": Boolean(this.error)
|
|
3678
|
-
};
|
|
3679
|
-
return x`
|
|
3680
|
-
<div class="${e2(radioClasses)}">
|
|
1758
|
+
`;var Ds=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,Vs=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Ms(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Ds(s,e,a),a};let Rs=class extends at{constructor(){super(),this.required=!1,this.label="",this.hideLabel=!1,this.value="on",this.checked=!1,this.error=!1,this.readOnly=!1,this.size="md",this._disabled=!1,this._disabledIsAuthorControlled=!1,this._settingDisabledFromParent=!1,this._parentRequestDisabled=!1,this._initialChecked=!1,this._handleKeydown=t=>{if(!this.name||this.disabled||this.readOnly)return;const s=this.getRootNode(),e=Array.from(s.querySelectorAll(`sds-radio[name="${this.name}"]`)),o=e.indexOf(this);if(-1===o)return;let r=null;switch(t.key){case"ArrowUp":case"ArrowLeft":r=o>0?o-1:e.length-1;break;case"ArrowDown":case"ArrowRight":r=o<e.length-1?o+1:0;break;default:return}const a=e[r];a?.focus(),a?.click(),t.preventDefault()},this._handleChange=t=>{if(this.disabled||this.readOnly)return t.target.checked=this.checked??!1,void t.preventDefault();const s=t.target;this.checked=s.checked,this.checked&&this._uncheckSiblings(),this._updateGroupValidation(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0}))},this._handleFocus=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0}))},this._handleBlur=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}get disabled(){return this._disabled}set disabled(t){const s=t??!1,e=this._disabled;e!==s&&(this._disabled=s,this.requestUpdate("disabled",e),this._settingDisabledFromParent||(this._disabledIsAuthorControlled=s))}get parentRequestDisabled(){return this._parentRequestDisabled}set parentRequestDisabled(t){const s=t??!1,e=this._parentRequestDisabled;e!==s&&(this._parentRequestDisabled=s,this.requestUpdate("parentRequestDisabled",e),this._disabledIsAuthorControlled||(this._settingDisabledFromParent=!0,this.disabled=s,this._settingDisabledFromParent=!1))}connectedCallback(){super.connectedCallback(),this.internals.role="radio",this._initialChecked||(this._initialChecked=this.checked??!1),this.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown)}firstUpdated(t){super.firstUpdated(t),this._updateGroupValidation()}updated(t){super.updated(t),t.has("checked")&&(this.checked?(this._uncheckSiblings(),this.internals.setFormValue(this.value??null)):this.internals.setFormValue(null),this._updateGroupValidation()),t.has("required")&&this.control&&(this.control.required=this.required??!1),this._disabledIsAuthorControlled||this.disabled===this._parentRequestDisabled||(this._settingDisabledFromParent=!0,this.disabled=this._parentRequestDisabled??!1,this._settingDisabledFromParent=!1)}_getGroupRadios(){if(!this.name)return[this];const t=this.getRootNode();return Array.from(t.querySelectorAll(`sds-radio[name="${this.name}"]`))}_updateGroupValidation(){const t=this._getGroupRadios(),s=t.some((t=>t.checked)),e=t.some((t=>t.required));t.forEach((t=>{t.control&&(e?t.internals.setValidity(s?{}:{valueMissing:!0},s?"":t.control.validationMessage,t.control):t.internals.setValidity({}))}))}formResetCallback(){this.checked=this._initialChecked,this.control.checked=this._initialChecked,this.internals.setFormValue(this.checked?this.value??"on":null),this._updateGroupValidation()}_uncheckSiblings(){if(!this.name)return;const t=this._getGroupRadios();for(const s of t)s!==this&&s.checked&&(s.checked=!1,s.internals.setFormValue(null))}get form(){return this.internals.form}get type(){return"radio"}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}setCustomValidity(t){this.internals.setValidity({customError:!!t},t)}formDisabledCallback(t){this._settingDisabledFromParent=!0,this.disabled=t,this._settingDisabledFromParent=!1,this.control&&(this.control.disabled=t)}focus(){this.disabled||this.shadowRoot?.querySelector("input")?.focus()}blur(){this.disabled||this.shadowRoot?.querySelector("input")?.blur()}click(){this.disabled||this.readOnly||this.shadowRoot?.querySelector("input")?.click()}render(){const t={"sds-radio":!0,"sds-radio--error":Boolean(this.error)},s={"sds-radio__input":!0,"sds-radio__input--error":Boolean(this.error)};return j`
|
|
1759
|
+
<div class="${Ot(t)}">
|
|
3681
1760
|
<input
|
|
3682
1761
|
id="control"
|
|
3683
1762
|
type="radio"
|
|
3684
|
-
name="${
|
|
3685
|
-
value="${
|
|
3686
|
-
?checked="${this.checked
|
|
3687
|
-
.checked="${this.checked
|
|
3688
|
-
?disabled="${this.disabled
|
|
3689
|
-
.disabled="${this.disabled
|
|
1763
|
+
name="${vt(this.name)}"
|
|
1764
|
+
value="${vt(this.value)}"
|
|
1765
|
+
?checked="${this.checked??!1}"
|
|
1766
|
+
.checked="${this.checked??!1}"
|
|
1767
|
+
?disabled="${this.disabled??!1}"
|
|
1768
|
+
.disabled="${this.disabled??!1}"
|
|
3690
1769
|
?required="${this.required}"
|
|
3691
1770
|
?readonly="${this.readOnly}"
|
|
3692
1771
|
@change="${this._handleChange}"
|
|
3693
1772
|
@focus="${this._handleFocus}"
|
|
3694
1773
|
@blur="${this._handleBlur}"
|
|
3695
|
-
class="${
|
|
1774
|
+
class="${Ot(s)}"
|
|
3696
1775
|
/>
|
|
3697
|
-
${this.label
|
|
3698
|
-
${this.helpText
|
|
1776
|
+
${this.label?j`<label class="sds-radio__label" for="control">${this.label}</label>`:U}
|
|
1777
|
+
${this.helpText?j`<span class="sds-radio__help-text">${this.helpText}</span>`:U}
|
|
3699
1778
|
</div>
|
|
3700
|
-
|
|
3701
|
-
}
|
|
3702
|
-
};
|
|
3703
|
-
SDSRadio.styles = [styles$6];
|
|
3704
|
-
SDSRadio.formAssociated = true;
|
|
3705
|
-
__decorateClass$6([
|
|
3706
|
-
n2({ type: Boolean, reflect: true })
|
|
3707
|
-
], SDSRadio.prototype, "required", 2);
|
|
3708
|
-
__decorateClass$6([
|
|
3709
|
-
n2({ type: String, reflect: true })
|
|
3710
|
-
], SDSRadio.prototype, "label", 2);
|
|
3711
|
-
__decorateClass$6([
|
|
3712
|
-
n2({ type: Boolean, reflect: true, attribute: "hide-label" })
|
|
3713
|
-
], SDSRadio.prototype, "hideLabel", 2);
|
|
3714
|
-
__decorateClass$6([
|
|
3715
|
-
n2({ type: String, reflect: true })
|
|
3716
|
-
], SDSRadio.prototype, "name", 2);
|
|
3717
|
-
__decorateClass$6([
|
|
3718
|
-
n2({ type: String })
|
|
3719
|
-
], SDSRadio.prototype, "value", 2);
|
|
3720
|
-
__decorateClass$6([
|
|
3721
|
-
n2({ type: Boolean, reflect: true })
|
|
3722
|
-
], SDSRadio.prototype, "checked", 2);
|
|
3723
|
-
__decorateClass$6([
|
|
3724
|
-
n2({ type: Boolean, reflect: true })
|
|
3725
|
-
], SDSRadio.prototype, "error", 2);
|
|
3726
|
-
__decorateClass$6([
|
|
3727
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
3728
|
-
], SDSRadio.prototype, "readOnly", 2);
|
|
3729
|
-
__decorateClass$6([
|
|
3730
|
-
n2({ type: String, reflect: true })
|
|
3731
|
-
], SDSRadio.prototype, "size", 2);
|
|
3732
|
-
__decorateClass$6([
|
|
3733
|
-
n2({ type: String, attribute: "help-text" })
|
|
3734
|
-
], SDSRadio.prototype, "helpText", 2);
|
|
3735
|
-
__decorateClass$6([
|
|
3736
|
-
n2({ type: Boolean, reflect: true })
|
|
3737
|
-
], SDSRadio.prototype, "disabled", 1);
|
|
3738
|
-
__decorateClass$6([
|
|
3739
|
-
n2({ type: Boolean, attribute: false })
|
|
3740
|
-
], SDSRadio.prototype, "parentRequestDisabled", 1);
|
|
3741
|
-
__decorateClass$6([
|
|
3742
|
-
e$3("#control")
|
|
3743
|
-
], SDSRadio.prototype, "control", 2);
|
|
3744
|
-
SDSRadio = __decorateClass$6([
|
|
3745
|
-
guardedCustomElement("sds-radio")
|
|
3746
|
-
], SDSRadio);
|
|
3747
|
-
const styles$5 = i$4`
|
|
1779
|
+
`}};Rs.styles=[Ps],Rs.formAssociated=!0,Vs([lt({type:Boolean,reflect:!0})],Rs.prototype,"required",2),Vs([lt({type:String,reflect:!0})],Rs.prototype,"label",2),Vs([lt({type:Boolean,reflect:!0,attribute:"hide-label"})],Rs.prototype,"hideLabel",2),Vs([lt({type:String,reflect:!0})],Rs.prototype,"name",2),Vs([lt({type:String})],Rs.prototype,"value",2),Vs([lt({type:Boolean,reflect:!0})],Rs.prototype,"checked",2),Vs([lt({type:Boolean,reflect:!0})],Rs.prototype,"error",2),Vs([lt({type:Boolean,attribute:"readonly",reflect:!0})],Rs.prototype,"readOnly",2),Vs([lt({type:String,reflect:!0})],Rs.prototype,"size",2),Vs([lt({type:String,attribute:"help-text"})],Rs.prototype,"helpText",2),Vs([lt({type:Boolean,reflect:!0})],Rs.prototype,"disabled",1),Vs([lt({type:Boolean,attribute:!1})],Rs.prototype,"parentRequestDisabled",1),Vs([ht("#control")],Rs.prototype,"control",2),Rs=Vs([pt("sds-radio")],Rs);const Ts=a`
|
|
3748
1780
|
:host {
|
|
3749
1781
|
--_sds-radio-group-gap: var(--sds-radio-group-gap, var(--sds-spacing-xs));
|
|
3750
1782
|
--_sds-radio-group-row-gap: var(--sds-radio-group-row-gap, var(--sds-spacing-md));
|
|
@@ -3842,146 +1874,18 @@ const styles$5 = i$4`
|
|
|
3842
1874
|
--_sds-radio-group-help-text-font-size: var(--sds-radio-group-help-text-font-size, var(--sds-components-font-size-content-lg));
|
|
3843
1875
|
--_sds-radio-group-help-text-line-height: var(--sds-radio-group-help-text-line-height, var(--sds-components-line-height-squeezed-lg));
|
|
3844
1876
|
}
|
|
3845
|
-
`;
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
3851
|
-
if (decorator = decorators[i3])
|
|
3852
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3853
|
-
if (kind && result) __defProp$5(target, key, result);
|
|
3854
|
-
return result;
|
|
3855
|
-
};
|
|
3856
|
-
const updatableRadioProps = ["disabled", "errorMessage", "readOnly", "required", "size"];
|
|
3857
|
-
let SDSRadioGroup = class extends i$1 {
|
|
3858
|
-
constructor() {
|
|
3859
|
-
super(...arguments);
|
|
3860
|
-
this.readOnly = false;
|
|
3861
|
-
this.direction = "column";
|
|
3862
|
-
this.disabled = false;
|
|
3863
|
-
this.required = false;
|
|
3864
|
-
this.size = "md";
|
|
3865
|
-
this._selectedValue = null;
|
|
3866
|
-
this._handleRadioChange = (event) => {
|
|
3867
|
-
const target = event.composedPath().find((el) => el instanceof HTMLElement && el.tagName === "SDS-RADIO");
|
|
3868
|
-
if (target) {
|
|
3869
|
-
this._selectedValue = target.getAttribute("value") || null;
|
|
3870
|
-
this.dispatchEvent(new CustomEvent("sds-update", { bubbles: true, composed: true }));
|
|
3871
|
-
}
|
|
3872
|
-
};
|
|
3873
|
-
this._handleSlotChange = () => {
|
|
3874
|
-
this._updateChildProps([...updatableRadioProps]);
|
|
3875
|
-
};
|
|
3876
|
-
}
|
|
3877
|
-
_getChildRadios() {
|
|
3878
|
-
return this._slotElement?.assignedElements({ flatten: true }).filter((element) => element.tagName === "SDS-RADIO") ?? [];
|
|
3879
|
-
}
|
|
3880
|
-
_updateChildProps(changedAttributes) {
|
|
3881
|
-
const radios = this._getChildRadios();
|
|
3882
|
-
for (const childRadio of radios) {
|
|
3883
|
-
for (const attribute of changedAttributes) {
|
|
3884
|
-
switch (attribute) {
|
|
3885
|
-
case "readOnly":
|
|
3886
|
-
childRadio.readOnly = this.readOnly;
|
|
3887
|
-
break;
|
|
3888
|
-
case "disabled":
|
|
3889
|
-
childRadio.parentRequestDisabled = this.disabled;
|
|
3890
|
-
break;
|
|
3891
|
-
case "errorMessage":
|
|
3892
|
-
childRadio.error = Boolean(this.errorMessage);
|
|
3893
|
-
break;
|
|
3894
|
-
case "required":
|
|
3895
|
-
childRadio.required = this.required;
|
|
3896
|
-
break;
|
|
3897
|
-
case "size":
|
|
3898
|
-
childRadio.size = this.size;
|
|
3899
|
-
break;
|
|
3900
|
-
}
|
|
3901
|
-
}
|
|
3902
|
-
}
|
|
3903
|
-
}
|
|
3904
|
-
updated(changedProps) {
|
|
3905
|
-
super.updated(changedProps);
|
|
3906
|
-
const changedKeys = Array.from(changedProps.keys());
|
|
3907
|
-
if (changedKeys.includes("errorMessage") || changedKeys.includes("error-message")) {
|
|
3908
|
-
this._updateChildProps(["errorMessage"]);
|
|
3909
|
-
}
|
|
3910
|
-
}
|
|
3911
|
-
attributeChangedCallback(name, _old, value) {
|
|
3912
|
-
super.attributeChangedCallback(name, _old, value);
|
|
3913
|
-
if (name === "readonly") {
|
|
3914
|
-
this._updateChildProps(["readOnly"]);
|
|
3915
|
-
return;
|
|
3916
|
-
}
|
|
3917
|
-
const property2 = name;
|
|
3918
|
-
if (updatableRadioProps.includes(property2)) {
|
|
3919
|
-
this._updateChildProps([property2]);
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
3922
|
-
render() {
|
|
3923
|
-
const radioGroupClasses = {
|
|
3924
|
-
"sds-radio-group": true,
|
|
3925
|
-
"sds-radio-group--readonly": this.readOnly ?? false,
|
|
3926
|
-
"sds-radio-group--disabled": this.disabled ?? false
|
|
3927
|
-
};
|
|
3928
|
-
const radioClasses = {
|
|
3929
|
-
"sds-radio-group__radios": true,
|
|
3930
|
-
"sds-radio-group--column": this.direction === "column",
|
|
3931
|
-
"sds-radio-group--row": this.direction === "row"
|
|
3932
|
-
};
|
|
3933
|
-
return x`
|
|
3934
|
-
<fieldset class="${e2(radioGroupClasses)}">
|
|
3935
|
-
${this.legend ? x`<legend class="sds-radio-group__legend">${this.readOnly ? x`<sds-icon name="lock-material-filled" size="md"></sds-icon>` : E}${this.legend}</legend>` : E}
|
|
3936
|
-
${this.helpText ? x`<p class="sds-radio-group__help-text">${this.helpText}</p>` : E}
|
|
3937
|
-
<div class="${e2(radioClasses)}" @change=${this._handleRadioChange}>
|
|
1877
|
+
`;var Ls=Object.defineProperty,Bs=Object.getOwnPropertyDescriptor,Is=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Bs(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Ls(s,e,a),a};const js=["disabled","errorMessage","readOnly","required","size"];let Ns=class extends at{constructor(){super(...arguments),this.readOnly=!1,this.direction="column",this.disabled=!1,this.required=!1,this.size="md",this._selectedValue=null,this._handleRadioChange=t=>{const s=t.composedPath().find((t=>t instanceof HTMLElement&&"SDS-RADIO"===t.tagName));s&&(this._selectedValue=s.getAttribute("value")||null,this.dispatchEvent(new CustomEvent("sds-update",{bubbles:!0,composed:!0})))},this._handleSlotChange=()=>{this._updateChildProps([...js])}}_getChildRadios(){return this._slotElement?.assignedElements({flatten:!0}).filter((t=>"SDS-RADIO"===t.tagName))??[]}_updateChildProps(t){const s=this._getChildRadios();for(const e of s)for(const s of t)switch(s){case"readOnly":e.readOnly=this.readOnly;break;case"disabled":e.parentRequestDisabled=this.disabled;break;case"errorMessage":e.error=Boolean(this.errorMessage);break;case"required":e.required=this.required;break;case"size":e.size=this.size}}updated(t){super.updated(t);const s=Array.from(t.keys());(s.includes("errorMessage")||s.includes("error-message"))&&this._updateChildProps(["errorMessage"])}attributeChangedCallback(t,s,e){if(super.attributeChangedCallback(t,s,e),"readonly"===t)return void this._updateChildProps(["readOnly"]);const o=t;js.includes(o)&&this._updateChildProps([o])}render(){const t={"sds-radio-group":!0,"sds-radio-group--readonly":this.readOnly??!1,"sds-radio-group--disabled":this.disabled??!1},s={"sds-radio-group__radios":!0,"sds-radio-group--column":"column"===this.direction,"sds-radio-group--row":"row"===this.direction};return j`
|
|
1878
|
+
<fieldset class="${Ot(t)}">
|
|
1879
|
+
${this.legend?j`<legend class="sds-radio-group__legend">${this.readOnly?j`<sds-icon name="lock-material-filled" size="md"></sds-icon>`:U}${this.legend}</legend>`:U}
|
|
1880
|
+
${this.helpText?j`<p class="sds-radio-group__help-text">${this.helpText}</p>`:U}
|
|
1881
|
+
<div class="${Ot(s)}" @change=${this._handleRadioChange}>
|
|
3938
1882
|
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
3939
1883
|
</div>
|
|
3940
|
-
${this.errorMessage
|
|
1884
|
+
${this.errorMessage?j`<sds-alert variant="secondary" data-palette="danger">
|
|
3941
1885
|
<p slot="message">${this.errorMessage}</p>
|
|
3942
|
-
</sds-alert
|
|
1886
|
+
</sds-alert>`:U}
|
|
3943
1887
|
</fieldset>
|
|
3944
|
-
|
|
3945
|
-
}
|
|
3946
|
-
get value() {
|
|
3947
|
-
return { selectedValue: this._selectedValue };
|
|
3948
|
-
}
|
|
3949
|
-
};
|
|
3950
|
-
SDSRadioGroup.styles = [styles$5];
|
|
3951
|
-
__decorateClass$5([
|
|
3952
|
-
n2({ type: String })
|
|
3953
|
-
], SDSRadioGroup.prototype, "legend", 2);
|
|
3954
|
-
__decorateClass$5([
|
|
3955
|
-
n2({ type: String, attribute: "help-text" })
|
|
3956
|
-
], SDSRadioGroup.prototype, "helpText", 2);
|
|
3957
|
-
__decorateClass$5([
|
|
3958
|
-
n2({ type: String, attribute: "error-message" })
|
|
3959
|
-
], SDSRadioGroup.prototype, "errorMessage", 2);
|
|
3960
|
-
__decorateClass$5([
|
|
3961
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
3962
|
-
], SDSRadioGroup.prototype, "readOnly", 2);
|
|
3963
|
-
__decorateClass$5([
|
|
3964
|
-
n2({ type: String })
|
|
3965
|
-
], SDSRadioGroup.prototype, "direction", 2);
|
|
3966
|
-
__decorateClass$5([
|
|
3967
|
-
n2({ type: Boolean, reflect: true })
|
|
3968
|
-
], SDSRadioGroup.prototype, "disabled", 2);
|
|
3969
|
-
__decorateClass$5([
|
|
3970
|
-
n2({ type: Boolean, reflect: true })
|
|
3971
|
-
], SDSRadioGroup.prototype, "required", 2);
|
|
3972
|
-
__decorateClass$5([
|
|
3973
|
-
n2({ type: String, reflect: true })
|
|
3974
|
-
], SDSRadioGroup.prototype, "size", 2);
|
|
3975
|
-
__decorateClass$5([
|
|
3976
|
-
r()
|
|
3977
|
-
], SDSRadioGroup.prototype, "_selectedValue", 2);
|
|
3978
|
-
__decorateClass$5([
|
|
3979
|
-
e$3("slot")
|
|
3980
|
-
], SDSRadioGroup.prototype, "_slotElement", 2);
|
|
3981
|
-
SDSRadioGroup = __decorateClass$5([
|
|
3982
|
-
guardedCustomElement("sds-radio-group")
|
|
3983
|
-
], SDSRadioGroup);
|
|
3984
|
-
const styles$4 = i$4`
|
|
1888
|
+
`}get value(){return{selectedValue:this._selectedValue}}};Ns.styles=[Ts],Is([lt({type:String})],Ns.prototype,"legend",2),Is([lt({type:String,attribute:"help-text"})],Ns.prototype,"helpText",2),Is([lt({type:String,attribute:"error-message"})],Ns.prototype,"errorMessage",2),Is([lt({type:Boolean,attribute:"readonly",reflect:!0})],Ns.prototype,"readOnly",2),Is([lt({type:String})],Ns.prototype,"direction",2),Is([lt({type:Boolean,reflect:!0})],Ns.prototype,"disabled",2),Is([lt({type:Boolean,reflect:!0})],Ns.prototype,"required",2),Is([lt({type:String,reflect:!0})],Ns.prototype,"size",2),Is([ct()],Ns.prototype,"_selectedValue",2),Is([ht("slot")],Ns.prototype,"_slotElement",2),Ns=Is([pt("sds-radio-group")],Ns);const Us=a`
|
|
3985
1889
|
:host {
|
|
3986
1890
|
--_sds-switch-background-color: var(--sds-switch-background-color, var(--sds-color-surface-default, var(--sds-color-neutral-surface-default)));
|
|
3987
1891
|
--_sds-switch-text-color: var(--sds-switch-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));
|
|
@@ -4131,110 +2035,7 @@ const styles$4 = i$4`
|
|
|
4131
2035
|
.sds-switch__input:checked::before {
|
|
4132
2036
|
--_sds-switch-button-position: calc(var(--_sds-switch-width) - var(--_sds-switch-button-size) - var(--_sds-switch-button-gap) - var(--_sds-switch-border-width));
|
|
4133
2037
|
}
|
|
4134
|
-
`;
|
|
4135
|
-
var __defProp$4 = Object.defineProperty;
|
|
4136
|
-
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
4137
|
-
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
4138
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
4139
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
4140
|
-
if (decorator = decorators[i3])
|
|
4141
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4142
|
-
if (kind && result) __defProp$4(target, key, result);
|
|
4143
|
-
return result;
|
|
4144
|
-
};
|
|
4145
|
-
let SDSSwitch = class extends i$1 {
|
|
4146
|
-
constructor() {
|
|
4147
|
-
super();
|
|
4148
|
-
this.disabled = false;
|
|
4149
|
-
this.label = "";
|
|
4150
|
-
this.hideLabel = false;
|
|
4151
|
-
this.reverse = false;
|
|
4152
|
-
this.checked = false;
|
|
4153
|
-
this.readOnly = false;
|
|
4154
|
-
this.size = "md";
|
|
4155
|
-
this._initialChecked = false;
|
|
4156
|
-
this._handleChange = (event) => {
|
|
4157
|
-
event.stopImmediatePropagation();
|
|
4158
|
-
if (!this.disabled) {
|
|
4159
|
-
const elem = event.target;
|
|
4160
|
-
this.checked = elem.checked;
|
|
4161
|
-
this.internals.setFormValue(this.checked ? "on" : "off");
|
|
4162
|
-
this.dispatchEvent(
|
|
4163
|
-
new CustomEvent("change", {
|
|
4164
|
-
bubbles: true,
|
|
4165
|
-
composed: true
|
|
4166
|
-
})
|
|
4167
|
-
);
|
|
4168
|
-
}
|
|
4169
|
-
};
|
|
4170
|
-
this._handleFocus = (event) => {
|
|
4171
|
-
event.stopImmediatePropagation();
|
|
4172
|
-
if (!this.disabled) {
|
|
4173
|
-
this.dispatchEvent(
|
|
4174
|
-
new CustomEvent("focus", {
|
|
4175
|
-
bubbles: true,
|
|
4176
|
-
composed: true
|
|
4177
|
-
})
|
|
4178
|
-
);
|
|
4179
|
-
}
|
|
4180
|
-
};
|
|
4181
|
-
this._handleBlur = (event) => {
|
|
4182
|
-
event.stopImmediatePropagation();
|
|
4183
|
-
if (!this.disabled && !this.disabled) {
|
|
4184
|
-
this.dispatchEvent(
|
|
4185
|
-
new CustomEvent("blur", {
|
|
4186
|
-
bubbles: true,
|
|
4187
|
-
composed: true
|
|
4188
|
-
})
|
|
4189
|
-
);
|
|
4190
|
-
}
|
|
4191
|
-
};
|
|
4192
|
-
this.getIconSize = () => {
|
|
4193
|
-
switch (this.size) {
|
|
4194
|
-
case "sm":
|
|
4195
|
-
case "md":
|
|
4196
|
-
case "lg":
|
|
4197
|
-
return this.size;
|
|
4198
|
-
case "l":
|
|
4199
|
-
return "lg";
|
|
4200
|
-
case "s":
|
|
4201
|
-
return "sm";
|
|
4202
|
-
}
|
|
4203
|
-
};
|
|
4204
|
-
this.internals = this.attachInternals();
|
|
4205
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
4206
|
-
}
|
|
4207
|
-
connectedCallback() {
|
|
4208
|
-
super.connectedCallback();
|
|
4209
|
-
this._initialChecked = this.checked;
|
|
4210
|
-
this.internals.setFormValue(this.checked ? "on" : "off");
|
|
4211
|
-
}
|
|
4212
|
-
updated(changedProperties) {
|
|
4213
|
-
if (changedProperties.has("checked")) {
|
|
4214
|
-
this.control.checked = this.checked;
|
|
4215
|
-
this.internals.setFormValue(this.checked ? "on" : "off");
|
|
4216
|
-
}
|
|
4217
|
-
}
|
|
4218
|
-
formResetCallback() {
|
|
4219
|
-
this.checked = this._initialChecked;
|
|
4220
|
-
this.control.checked = this._initialChecked;
|
|
4221
|
-
this.internals.setFormValue(this._initialChecked ? "on" : "off");
|
|
4222
|
-
}
|
|
4223
|
-
formStateRestoreCallback(state) {
|
|
4224
|
-
this.checked = state;
|
|
4225
|
-
}
|
|
4226
|
-
get value() {
|
|
4227
|
-
return this.checked ? "on" : "off";
|
|
4228
|
-
}
|
|
4229
|
-
render() {
|
|
4230
|
-
const switchClasses = {
|
|
4231
|
-
"sds-switch": true
|
|
4232
|
-
};
|
|
4233
|
-
const labelClasses = {
|
|
4234
|
-
"sds-switch__label": true,
|
|
4235
|
-
"sds-switch__label--hidden": this.hideLabel
|
|
4236
|
-
};
|
|
4237
|
-
const inputTemplate = x`<input
|
|
2038
|
+
`;var Fs=Object.defineProperty,Hs=Object.getOwnPropertyDescriptor,Gs=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Hs(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Fs(s,e,a),a};let Ks=class extends at{constructor(){super(),this.disabled=!1,this.label="",this.hideLabel=!1,this.reverse=!1,this.checked=!1,this.readOnly=!1,this.size="md",this._initialChecked=!1,this._handleChange=t=>{if(t.stopImmediatePropagation(),!this.disabled){const s=t.target;this.checked=s.checked,this.internals.setFormValue(this.checked?"on":"off"),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0}))}},this._handleFocus=t=>{t.stopImmediatePropagation(),this.disabled||this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0}))},this._handleBlur=t=>{t.stopImmediatePropagation(),this.disabled||this.disabled||this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))},this.getIconSize=()=>{switch(this.size){case"sm":case"md":case"lg":return this.size;case"l":return"lg";case"s":return"sm"}},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}connectedCallback(){super.connectedCallback(),this._initialChecked=this.checked,this.internals.setFormValue(this.checked?"on":"off")}updated(t){t.has("checked")&&(this.control.checked=this.checked,this.internals.setFormValue(this.checked?"on":"off"))}formResetCallback(){this.checked=this._initialChecked,this.control.checked=this._initialChecked,this.internals.setFormValue(this._initialChecked?"on":"off")}formStateRestoreCallback(t){this.checked=t}get value(){return this.checked?"on":"off"}render(){const t={"sds-switch__label":!0,"sds-switch__label--hidden":this.hideLabel},s=j`<input
|
|
4238
2039
|
class="sds-switch__input"
|
|
4239
2040
|
id="control"
|
|
4240
2041
|
type="checkbox"
|
|
@@ -4243,49 +2044,11 @@ let SDSSwitch = class extends i$1 {
|
|
|
4243
2044
|
?disabled="${this.disabled}"
|
|
4244
2045
|
.checked="${this.checked}"
|
|
4245
2046
|
?checked="${this.checked}"
|
|
4246
|
-
name="${
|
|
2047
|
+
name="${vt(this.name)}"
|
|
4247
2048
|
@change="${this._handleChange}"
|
|
4248
2049
|
@focus="${this._handleFocus}"
|
|
4249
2050
|
@blur="${this._handleBlur}"
|
|
4250
|
-
|
|
4251
|
-
const iconTemplate = this.readOnly ? x`<sds-icon name="lock-material-filled" size="${this.getIconSize()}"></sds-icon>` : E;
|
|
4252
|
-
const labelTemplate = x`<label class="${e2(labelClasses)}" for="control">${iconTemplate}${this.label}</label>`;
|
|
4253
|
-
return x`<div class="${e2(switchClasses)}">${this.reverse ? [labelTemplate, inputTemplate] : [inputTemplate, labelTemplate]}</div>`;
|
|
4254
|
-
}
|
|
4255
|
-
};
|
|
4256
|
-
SDSSwitch.styles = [styles$4];
|
|
4257
|
-
SDSSwitch.formAssociated = true;
|
|
4258
|
-
__decorateClass$4([
|
|
4259
|
-
n2({ type: Boolean, reflect: true })
|
|
4260
|
-
], SDSSwitch.prototype, "disabled", 2);
|
|
4261
|
-
__decorateClass$4([
|
|
4262
|
-
n2({ type: String, reflect: true })
|
|
4263
|
-
], SDSSwitch.prototype, "label", 2);
|
|
4264
|
-
__decorateClass$4([
|
|
4265
|
-
n2({ type: Boolean, reflect: true, attribute: "hide-label" })
|
|
4266
|
-
], SDSSwitch.prototype, "hideLabel", 2);
|
|
4267
|
-
__decorateClass$4([
|
|
4268
|
-
n2({ type: String, reflect: true })
|
|
4269
|
-
], SDSSwitch.prototype, "name", 2);
|
|
4270
|
-
__decorateClass$4([
|
|
4271
|
-
n2({ type: Boolean, reflect: true })
|
|
4272
|
-
], SDSSwitch.prototype, "reverse", 2);
|
|
4273
|
-
__decorateClass$4([
|
|
4274
|
-
n2({ type: Boolean, reflect: true })
|
|
4275
|
-
], SDSSwitch.prototype, "checked", 2);
|
|
4276
|
-
__decorateClass$4([
|
|
4277
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
4278
|
-
], SDSSwitch.prototype, "readOnly", 2);
|
|
4279
|
-
__decorateClass$4([
|
|
4280
|
-
n2({ type: String, reflect: true })
|
|
4281
|
-
], SDSSwitch.prototype, "size", 2);
|
|
4282
|
-
__decorateClass$4([
|
|
4283
|
-
e$3("#control")
|
|
4284
|
-
], SDSSwitch.prototype, "control", 2);
|
|
4285
|
-
SDSSwitch = __decorateClass$4([
|
|
4286
|
-
guardedCustomElement("sds-switch")
|
|
4287
|
-
], SDSSwitch);
|
|
4288
|
-
const styles$3 = i$4`
|
|
2051
|
+
/>`,e=this.readOnly?j`<sds-icon name="lock-material-filled" size="${this.getIconSize()}"></sds-icon>`:U,o=j`<label class="${Ot(t)}" for="control">${e}${this.label}</label>`;return j`<div class="${Ot({"sds-switch":!0})}">${this.reverse?[o,s]:[s,o]}</div>`}};Ks.styles=[Us],Ks.formAssociated=!0,Gs([lt({type:Boolean,reflect:!0})],Ks.prototype,"disabled",2),Gs([lt({type:String,reflect:!0})],Ks.prototype,"label",2),Gs([lt({type:Boolean,reflect:!0,attribute:"hide-label"})],Ks.prototype,"hideLabel",2),Gs([lt({type:String,reflect:!0})],Ks.prototype,"name",2),Gs([lt({type:Boolean,reflect:!0})],Ks.prototype,"reverse",2),Gs([lt({type:Boolean,reflect:!0})],Ks.prototype,"checked",2),Gs([lt({type:Boolean,attribute:"readonly",reflect:!0})],Ks.prototype,"readOnly",2),Gs([lt({type:String,reflect:!0})],Ks.prototype,"size",2),Gs([ht("#control")],Ks.prototype,"control",2),Ks=Gs([pt("sds-switch")],Ks);const Ws=a`
|
|
4289
2052
|
:host {
|
|
4290
2053
|
--_sds-tag-background-color: var(--sds-tag-background-color, var(--sds-color-surface-tinted, var(--sds-color-neutral-surface-tinted)));
|
|
4291
2054
|
--_sds-tag-text-color: var(--sds-tag-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));
|
|
@@ -4346,39 +2109,9 @@ const styles$3 = i$4`
|
|
|
4346
2109
|
--_sds-tag-font-size: var(--sds-tag-font-size, var(--sds-components-font-size-content-lg));
|
|
4347
2110
|
--_sds-tag-line-height: var(--sds-tag-line-height, var(--sds-components-line-height-squeezed-lg));
|
|
4348
2111
|
}
|
|
4349
|
-
`;
|
|
4350
|
-
var __defProp$3 = Object.defineProperty;
|
|
4351
|
-
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
4352
|
-
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
4353
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
4354
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
4355
|
-
if (decorator = decorators[i3])
|
|
4356
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4357
|
-
if (kind && result) __defProp$3(target, key, result);
|
|
4358
|
-
return result;
|
|
4359
|
-
};
|
|
4360
|
-
let SDSTag = class extends i$1 {
|
|
4361
|
-
constructor() {
|
|
4362
|
-
super(...arguments);
|
|
4363
|
-
this.size = "md";
|
|
4364
|
-
}
|
|
4365
|
-
render() {
|
|
4366
|
-
const tagClasses = {
|
|
4367
|
-
"sds-tag": true
|
|
4368
|
-
};
|
|
4369
|
-
return x`<span class="${e2(tagClasses)}">
|
|
2112
|
+
`;var Zs=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,Xs=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?Qs(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&Zs(s,e,a),a};let Ys=class extends at{constructor(){super(...arguments),this.size="md"}render(){return j`<span class="${Ot({"sds-tag":!0})}">
|
|
4370
2113
|
<slot></slot>
|
|
4371
|
-
</span
|
|
4372
|
-
}
|
|
4373
|
-
};
|
|
4374
|
-
SDSTag.styles = [styles$3];
|
|
4375
|
-
__decorateClass$3([
|
|
4376
|
-
n2({ type: String, reflect: true })
|
|
4377
|
-
], SDSTag.prototype, "size", 2);
|
|
4378
|
-
SDSTag = __decorateClass$3([
|
|
4379
|
-
guardedCustomElement("sds-tag")
|
|
4380
|
-
], SDSTag);
|
|
4381
|
-
const styles$2 = i$4`
|
|
2114
|
+
</span>`}};Ys.styles=[Ws],Xs([lt({type:String,reflect:!0})],Ys.prototype,"size",2),Ys=Xs([pt("sds-tag")],Ys);const Js=a`
|
|
4382
2115
|
:host {
|
|
4383
2116
|
--_sds-text-font-family: var(--sds-text-font-family, var(--sds-typography-font-family-roboto));
|
|
4384
2117
|
--_sds-text-font-size: var(--sds-text-font-size, var(--sds-typography-body-md-mobile-font-size));
|
|
@@ -4653,42 +2386,7 @@ const styles$2 = i$4`
|
|
|
4653
2386
|
--_sds-text-line-height: var(--sds-text-line-height, var(--sds-typography-body-xl-desktop-line-height));
|
|
4654
2387
|
}
|
|
4655
2388
|
}
|
|
4656
|
-
`;
|
|
4657
|
-
var __defProp$2 = Object.defineProperty;
|
|
4658
|
-
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
4659
|
-
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
4660
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
4661
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
4662
|
-
if (decorator = decorators[i3])
|
|
4663
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4664
|
-
if (kind && result) __defProp$2(target, key, result);
|
|
4665
|
-
return result;
|
|
4666
|
-
};
|
|
4667
|
-
let SDSText = class extends i$1 {
|
|
4668
|
-
constructor() {
|
|
4669
|
-
super(...arguments);
|
|
4670
|
-
this.size = "md";
|
|
4671
|
-
this.strong = false;
|
|
4672
|
-
this.tall = false;
|
|
4673
|
-
}
|
|
4674
|
-
render() {
|
|
4675
|
-
return x`<p><slot></slot></p>`;
|
|
4676
|
-
}
|
|
4677
|
-
};
|
|
4678
|
-
SDSText.styles = [styles$2];
|
|
4679
|
-
__decorateClass$2([
|
|
4680
|
-
n2({ type: String, reflect: true })
|
|
4681
|
-
], SDSText.prototype, "size", 2);
|
|
4682
|
-
__decorateClass$2([
|
|
4683
|
-
n2({ type: Boolean, reflect: true })
|
|
4684
|
-
], SDSText.prototype, "strong", 2);
|
|
4685
|
-
__decorateClass$2([
|
|
4686
|
-
n2({ type: Boolean, reflect: true })
|
|
4687
|
-
], SDSText.prototype, "tall", 2);
|
|
4688
|
-
SDSText = __decorateClass$2([
|
|
4689
|
-
guardedCustomElement("sds-text")
|
|
4690
|
-
], SDSText);
|
|
4691
|
-
const styles$1 = i$4`
|
|
2389
|
+
`;var te=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ee=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?se(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&te(s,e,a),a};let oe=class extends at{constructor(){super(...arguments),this.size="md",this.strong=!1,this.tall=!1}render(){return j`<p><slot></slot></p>`}};oe.styles=[Js],ee([lt({type:String,reflect:!0})],oe.prototype,"size",2),ee([lt({type:Boolean,reflect:!0})],oe.prototype,"strong",2),ee([lt({type:Boolean,reflect:!0})],oe.prototype,"tall",2),oe=ee([pt("sds-text")],oe);const re=a`
|
|
4692
2390
|
:host {
|
|
4693
2391
|
--_sds-textfield-background-color: var(--sds-textfield-background-color, var(--sds-color-background-default, var(--sds-color-neutral-background-default)));
|
|
4694
2392
|
--_sds-textfield-text-color: var(--sds-textfield-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));
|
|
@@ -4740,6 +2438,8 @@ const styles$1 = i$4`
|
|
|
4740
2438
|
|
|
4741
2439
|
.sds-textfield__input-container {
|
|
4742
2440
|
position: relative;
|
|
2441
|
+
font-size: var(--_sds-textfield-font-size);
|
|
2442
|
+
max-width: var(--_sds-textfield-max-width);
|
|
4743
2443
|
}
|
|
4744
2444
|
|
|
4745
2445
|
.sds-textfield__input {
|
|
@@ -4754,7 +2454,6 @@ const styles$1 = i$4`
|
|
|
4754
2454
|
border-radius: var(--_sds-textfield-border-radius);
|
|
4755
2455
|
border: var(--_sds-textfield-border-width) solid var(--_sds-textfield-border-color);
|
|
4756
2456
|
background: var(--_sds-textfield-background-color);
|
|
4757
|
-
max-width: var(--_sds-textfield-max-width);
|
|
4758
2457
|
width: 100%;
|
|
4759
2458
|
|
|
4760
2459
|
&:hover {
|
|
@@ -4854,158 +2553,26 @@ const styles$1 = i$4`
|
|
|
4854
2553
|
--sds-icon-size: var(--sds-textfield-icon-size, var(--sds-components-icon-lg));
|
|
4855
2554
|
}
|
|
4856
2555
|
}
|
|
4857
|
-
`;
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
4862
|
-
for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
|
|
4863
|
-
if (decorator = decorators[i3])
|
|
4864
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4865
|
-
if (kind && result) __defProp$1(target, key, result);
|
|
4866
|
-
return result;
|
|
4867
|
-
};
|
|
4868
|
-
let SDSTextField = class extends i$1 {
|
|
4869
|
-
constructor() {
|
|
4870
|
-
super();
|
|
4871
|
-
this.type = "text";
|
|
4872
|
-
this.disabled = false;
|
|
4873
|
-
this.readOnly = false;
|
|
4874
|
-
this.required = false;
|
|
4875
|
-
this.size = "md";
|
|
4876
|
-
this.hasIcon = false;
|
|
4877
|
-
this._defaultValue = null;
|
|
4878
|
-
this.handleSlotChange = (e3) => {
|
|
4879
|
-
const slot = e3.target;
|
|
4880
|
-
this.hasIcon = slot.assignedNodes({ flatten: true }).length > 0;
|
|
4881
|
-
};
|
|
4882
|
-
this._handleInputChange = (event) => {
|
|
4883
|
-
event.stopImmediatePropagation();
|
|
4884
|
-
if (this.disabled || !(event.target instanceof HTMLInputElement)) {
|
|
4885
|
-
return;
|
|
4886
|
-
}
|
|
4887
|
-
this.value = event.target.value;
|
|
4888
|
-
this.internals.setFormValue(this.value === "" ? null : this.value);
|
|
4889
|
-
this.updateValidity();
|
|
4890
|
-
this.dispatchEvent(new CustomEvent(event.type, { bubbles: true, composed: true }));
|
|
4891
|
-
};
|
|
4892
|
-
this._handleSelect = (event) => {
|
|
4893
|
-
event.stopImmediatePropagation();
|
|
4894
|
-
if (!this.disabled) {
|
|
4895
|
-
this.dispatchEvent(new CustomEvent("select", { bubbles: true, composed: true }));
|
|
4896
|
-
}
|
|
4897
|
-
};
|
|
4898
|
-
this._handleFocus = (event) => {
|
|
4899
|
-
event.stopImmediatePropagation();
|
|
4900
|
-
this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
|
|
4901
|
-
};
|
|
4902
|
-
this._handleBlur = (event) => {
|
|
4903
|
-
event.stopImmediatePropagation();
|
|
4904
|
-
this.updateValidity();
|
|
4905
|
-
this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
|
|
4906
|
-
};
|
|
4907
|
-
this._handleKeyDown = (event) => {
|
|
4908
|
-
if (event.key !== "Enter") {
|
|
4909
|
-
return;
|
|
4910
|
-
}
|
|
4911
|
-
event.stopImmediatePropagation();
|
|
4912
|
-
const form = this.internals?.form;
|
|
4913
|
-
if (form?.requestSubmit) {
|
|
4914
|
-
form.requestSubmit();
|
|
4915
|
-
} else {
|
|
4916
|
-
form?.submit();
|
|
4917
|
-
}
|
|
4918
|
-
};
|
|
4919
|
-
this.internals = this.attachInternals();
|
|
4920
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
4921
|
-
}
|
|
4922
|
-
connectedCallback() {
|
|
4923
|
-
super.connectedCallback();
|
|
4924
|
-
this._defaultValue = this.value ?? null;
|
|
4925
|
-
this.internals.setFormValue(this._defaultValue);
|
|
4926
|
-
}
|
|
4927
|
-
updateValidity() {
|
|
4928
|
-
if (this.control.checkValidity()) {
|
|
4929
|
-
this.internals.setValidity({});
|
|
4930
|
-
} else {
|
|
4931
|
-
this.internals.setValidity({ customError: true }, this.control.validationMessage, this.control);
|
|
4932
|
-
}
|
|
4933
|
-
}
|
|
4934
|
-
formResetCallback() {
|
|
4935
|
-
this.internals.setFormValue(this._defaultValue);
|
|
4936
|
-
const newValue = this._defaultValue ?? "";
|
|
4937
|
-
this.control.value = newValue;
|
|
4938
|
-
this.value = newValue;
|
|
4939
|
-
this.updateValidity();
|
|
4940
|
-
}
|
|
4941
|
-
select() {
|
|
4942
|
-
if (!this.disabled) this.control.select();
|
|
4943
|
-
}
|
|
4944
|
-
focus() {
|
|
4945
|
-
if (!this.disabled) this.control.focus();
|
|
4946
|
-
}
|
|
4947
|
-
blur() {
|
|
4948
|
-
if (!this.disabled) this.control.blur();
|
|
4949
|
-
}
|
|
4950
|
-
click() {
|
|
4951
|
-
if (!this.disabled) this.control.click();
|
|
4952
|
-
}
|
|
4953
|
-
get selectionStart() {
|
|
4954
|
-
return this.control ? this.control.selectionStart : null;
|
|
4955
|
-
}
|
|
4956
|
-
set selectionStart(value) {
|
|
4957
|
-
if (this.control && value !== null) {
|
|
4958
|
-
this.control.selectionStart = value;
|
|
4959
|
-
}
|
|
4960
|
-
}
|
|
4961
|
-
get selectionEnd() {
|
|
4962
|
-
return this.control ? this.control.selectionEnd : null;
|
|
4963
|
-
}
|
|
4964
|
-
set selectionEnd(value) {
|
|
4965
|
-
if (this.control && value !== null) {
|
|
4966
|
-
this.control.selectionEnd = value;
|
|
4967
|
-
}
|
|
4968
|
-
}
|
|
4969
|
-
setSelectionRange(start, end, direction) {
|
|
4970
|
-
if (this.control) {
|
|
4971
|
-
this.control.setSelectionRange(start, end, direction);
|
|
4972
|
-
}
|
|
4973
|
-
}
|
|
4974
|
-
checkValidity() {
|
|
4975
|
-
return this.control.checkValidity();
|
|
4976
|
-
}
|
|
4977
|
-
reportValidity() {
|
|
4978
|
-
return this.control.reportValidity();
|
|
4979
|
-
}
|
|
4980
|
-
setCustomValidity(message) {
|
|
4981
|
-
this.control.setCustomValidity(message);
|
|
4982
|
-
this.updateValidity();
|
|
4983
|
-
}
|
|
4984
|
-
render() {
|
|
4985
|
-
const textfieldClasses = {
|
|
4986
|
-
"sds-textfield": true,
|
|
4987
|
-
"sds-textfield--error": Boolean(this.errorMessage),
|
|
4988
|
-
"sds-textfield--has-icon": this.hasIcon
|
|
4989
|
-
};
|
|
4990
|
-
return x`
|
|
4991
|
-
<div class="${e2(textfieldClasses)}">
|
|
4992
|
-
${this.label ? x`<label for="sds-textfield" class="sds-textfield__label">${this.readOnly ? x`<sds-icon name="lock-material-filled" size="m"></sds-icon>` : E}</sds-icon>${this.label}</label>` : E}
|
|
4993
|
-
${this.helpText ? x`<p class="sds-textfield__help-text">${this.helpText}</p>` : E}
|
|
2556
|
+
`;var ae=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,de=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?ie(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&ae(s,e,a),a};let ne=class extends at{constructor(){super(),this.type="text",this.disabled=!1,this.readOnly=!1,this.required=!1,this.size="md",this.hasIcon=!1,this._defaultValue=null,this.handleSlotChange=t=>{const s=t.target;this.hasIcon=s.assignedNodes({flatten:!0}).length>0},this._handleInputChange=t=>{t.stopImmediatePropagation(),!this.disabled&&t.target instanceof HTMLInputElement&&(this.value=t.target.value,this.internals.setFormValue(""===this.value?null:this.value),this.updateValidity(),this.dispatchEvent(new CustomEvent(t.type,{bubbles:!0,composed:!0})))},this._handleSelect=t=>{t.stopImmediatePropagation(),this.disabled||this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0}))},this._handleFocus=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0}))},this._handleBlur=t=>{t.stopImmediatePropagation(),this.updateValidity(),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))},this._handleKeyDown=t=>{if("Enter"!==t.key)return;t.stopImmediatePropagation();const s=this.internals?.form;s?.requestSubmit?s.requestSubmit():s?.submit()},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}connectedCallback(){super.connectedCallback(),this._defaultValue=this.value??null,this.internals.setFormValue(this._defaultValue)}updateValidity(){this.control.checkValidity()?this.internals.setValidity({}):this.internals.setValidity({customError:!0},this.control.validationMessage,this.control)}formResetCallback(){this.internals.setFormValue(this._defaultValue);const t=this._defaultValue??"";this.control.value=t,this.value=t,this.updateValidity()}select(){this.disabled||this.control.select()}focus(){this.disabled||this.control.focus()}blur(){this.disabled||this.control.blur()}click(){this.disabled||this.control.click()}get selectionStart(){return this.control?this.control.selectionStart:null}set selectionStart(t){this.control&&null!==t&&(this.control.selectionStart=t)}get selectionEnd(){return this.control?this.control.selectionEnd:null}set selectionEnd(t){this.control&&null!==t&&(this.control.selectionEnd=t)}setSelectionRange(t,s,e){this.control&&this.control.setSelectionRange(t,s,e)}checkValidity(){return this.control.checkValidity()}reportValidity(){return this.control.reportValidity()}setCustomValidity(t){this.control.setCustomValidity(t),this.updateValidity()}render(){const t={"sds-textfield":!0,"sds-textfield--error":Boolean(this.errorMessage),"sds-textfield--has-icon":this.hasIcon};return j`
|
|
2557
|
+
<div class="${Ot(t)}">
|
|
2558
|
+
${this.label?j`<label for="sds-textfield" class="sds-textfield__label">${this.readOnly?j`<sds-icon name="lock-material-filled" size="m"></sds-icon>`:U}</sds-icon>${this.label}</label>`:U}
|
|
2559
|
+
${this.helpText?j`<p class="sds-textfield__help-text">${this.helpText}</p>`:U}
|
|
4994
2560
|
<div class="sds-textfield__input-container">
|
|
4995
2561
|
<input
|
|
2562
|
+
part="input"
|
|
4996
2563
|
class="sds-textfield__input"
|
|
4997
|
-
type="${
|
|
2564
|
+
type="${vt(this.type)}"
|
|
4998
2565
|
id="sds-textfield"
|
|
4999
2566
|
?disabled="${this.disabled}"
|
|
5000
2567
|
?readonly="${this.readOnly}"
|
|
5001
|
-
placeholder="${
|
|
5002
|
-
.value="${this.value
|
|
5003
|
-
name="${
|
|
5004
|
-
autocomplete="${
|
|
2568
|
+
placeholder="${vt(this.placeholder)}"
|
|
2569
|
+
.value="${this.value??""}"
|
|
2570
|
+
name="${vt(this.name)}"
|
|
2571
|
+
autocomplete="${vt(this.autocomplete)}"
|
|
5005
2572
|
?required="${this.required}"
|
|
5006
|
-
pattern="${
|
|
5007
|
-
minlength="${
|
|
5008
|
-
maxlength="${
|
|
2573
|
+
pattern="${vt(this.pattern)}"
|
|
2574
|
+
minlength="${vt(this.minlength)}"
|
|
2575
|
+
maxlength="${vt(this.maxlength)}"
|
|
5009
2576
|
@input="${this._handleInputChange}"
|
|
5010
2577
|
@change="${this._handleInputChange}"
|
|
5011
2578
|
@select="${this._handleSelect}"
|
|
@@ -5015,68 +2582,9 @@ let SDSTextField = class extends i$1 {
|
|
|
5015
2582
|
/>
|
|
5016
2583
|
<slot name="after" @slotchange="${this.handleSlotChange}" aria-hidden="true"></slot>
|
|
5017
2584
|
</div>
|
|
5018
|
-
${this.errorMessage
|
|
2585
|
+
${this.errorMessage?j`<sds-alert variant="secondary" data-palette="danger"><p slot="message">${this.errorMessage}</p></sds-alert>`:U}
|
|
5019
2586
|
</div>
|
|
5020
|
-
|
|
5021
|
-
}
|
|
5022
|
-
};
|
|
5023
|
-
SDSTextField.styles = [styles$1];
|
|
5024
|
-
SDSTextField.formAssociated = true;
|
|
5025
|
-
__decorateClass$1([
|
|
5026
|
-
n2({ type: String, reflect: true })
|
|
5027
|
-
], SDSTextField.prototype, "type", 2);
|
|
5028
|
-
__decorateClass$1([
|
|
5029
|
-
n2({ type: String })
|
|
5030
|
-
], SDSTextField.prototype, "value", 2);
|
|
5031
|
-
__decorateClass$1([
|
|
5032
|
-
n2({ type: String, reflect: true })
|
|
5033
|
-
], SDSTextField.prototype, "name", 2);
|
|
5034
|
-
__decorateClass$1([
|
|
5035
|
-
n2({ type: String, reflect: true })
|
|
5036
|
-
], SDSTextField.prototype, "label", 2);
|
|
5037
|
-
__decorateClass$1([
|
|
5038
|
-
n2({ type: String, reflect: true })
|
|
5039
|
-
], SDSTextField.prototype, "placeholder", 2);
|
|
5040
|
-
__decorateClass$1([
|
|
5041
|
-
n2({ type: String, attribute: "help-text", reflect: true })
|
|
5042
|
-
], SDSTextField.prototype, "helpText", 2);
|
|
5043
|
-
__decorateClass$1([
|
|
5044
|
-
n2({ type: String, attribute: "error-message", reflect: true })
|
|
5045
|
-
], SDSTextField.prototype, "errorMessage", 2);
|
|
5046
|
-
__decorateClass$1([
|
|
5047
|
-
n2({ type: Boolean, reflect: true })
|
|
5048
|
-
], SDSTextField.prototype, "disabled", 2);
|
|
5049
|
-
__decorateClass$1([
|
|
5050
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
5051
|
-
], SDSTextField.prototype, "readOnly", 2);
|
|
5052
|
-
__decorateClass$1([
|
|
5053
|
-
n2({ type: String, reflect: true })
|
|
5054
|
-
], SDSTextField.prototype, "autocomplete", 2);
|
|
5055
|
-
__decorateClass$1([
|
|
5056
|
-
n2({ type: Boolean, reflect: true })
|
|
5057
|
-
], SDSTextField.prototype, "required", 2);
|
|
5058
|
-
__decorateClass$1([
|
|
5059
|
-
n2({ type: String, reflect: true })
|
|
5060
|
-
], SDSTextField.prototype, "pattern", 2);
|
|
5061
|
-
__decorateClass$1([
|
|
5062
|
-
n2({ type: Number, reflect: true })
|
|
5063
|
-
], SDSTextField.prototype, "minlength", 2);
|
|
5064
|
-
__decorateClass$1([
|
|
5065
|
-
n2({ type: Number, reflect: true })
|
|
5066
|
-
], SDSTextField.prototype, "maxlength", 2);
|
|
5067
|
-
__decorateClass$1([
|
|
5068
|
-
n2({ type: String, reflect: true })
|
|
5069
|
-
], SDSTextField.prototype, "size", 2);
|
|
5070
|
-
__decorateClass$1([
|
|
5071
|
-
r()
|
|
5072
|
-
], SDSTextField.prototype, "hasIcon", 2);
|
|
5073
|
-
__decorateClass$1([
|
|
5074
|
-
e$3("#sds-textfield")
|
|
5075
|
-
], SDSTextField.prototype, "control", 2);
|
|
5076
|
-
SDSTextField = __decorateClass$1([
|
|
5077
|
-
guardedCustomElement("sds-textfield")
|
|
5078
|
-
], SDSTextField);
|
|
5079
|
-
const styles = i$4`
|
|
2587
|
+
`}};ne.styles=[re],ne.formAssociated=!0,de([lt({type:String,reflect:!0})],ne.prototype,"type",2),de([lt({type:String})],ne.prototype,"value",2),de([lt({type:String,reflect:!0})],ne.prototype,"name",2),de([lt({type:String,reflect:!0})],ne.prototype,"label",2),de([lt({type:String,reflect:!0})],ne.prototype,"placeholder",2),de([lt({type:String,attribute:"help-text",reflect:!0})],ne.prototype,"helpText",2),de([lt({type:String,attribute:"error-message",reflect:!0})],ne.prototype,"errorMessage",2),de([lt({type:Boolean,reflect:!0})],ne.prototype,"disabled",2),de([lt({type:Boolean,attribute:"readonly",reflect:!0})],ne.prototype,"readOnly",2),de([lt({type:String,reflect:!0})],ne.prototype,"autocomplete",2),de([lt({type:Boolean,reflect:!0})],ne.prototype,"required",2),de([lt({type:String,reflect:!0})],ne.prototype,"pattern",2),de([lt({type:Number,reflect:!0})],ne.prototype,"minlength",2),de([lt({type:Number,reflect:!0})],ne.prototype,"maxlength",2),de([lt({type:String,reflect:!0})],ne.prototype,"size",2),de([ct()],ne.prototype,"hasIcon",2),de([ht("#sds-textfield")],ne.prototype,"control",2),ne=de([pt("sds-textfield")],ne);const le=a`
|
|
5080
2588
|
:host {
|
|
5081
2589
|
--_sds-textarea-background-color: var(--sds-textarea-background-color, var(--sds-color-background-default, var(--sds-color-neutral-background-default)));
|
|
5082
2590
|
--_sds-textarea-text-color: var(--sds-textarea-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));
|
|
@@ -5260,162 +2768,30 @@ const styles = i$4`
|
|
|
5260
2768
|
--_sds-textarea-counter-font-size: var(--sds-textarea-counter-font-size, var(--sds-components-font-size-content-lg));
|
|
5261
2769
|
--_sds-textarea-counter-line-height: var(--sds-textarea-counter-line-height, var(--sds-components-line-height-squeezed-lg));
|
|
5262
2770
|
}
|
|
5263
|
-
`;
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
if (kind && result) __defProp(target, key, result);
|
|
5272
|
-
return result;
|
|
5273
|
-
};
|
|
5274
|
-
let SDSTextArea = class extends i$1 {
|
|
5275
|
-
constructor() {
|
|
5276
|
-
super();
|
|
5277
|
-
this.disabled = false;
|
|
5278
|
-
this.readOnly = false;
|
|
5279
|
-
this.required = false;
|
|
5280
|
-
this.size = "md";
|
|
5281
|
-
this._defaultValue = null;
|
|
5282
|
-
this._handleInputChange = (event) => {
|
|
5283
|
-
event.stopImmediatePropagation();
|
|
5284
|
-
if (this.disabled || !(event.target instanceof HTMLTextAreaElement)) {
|
|
5285
|
-
return;
|
|
5286
|
-
}
|
|
5287
|
-
this.value = event.target.value;
|
|
5288
|
-
this.internals.setFormValue(this.value === "" ? null : this.value);
|
|
5289
|
-
this.updateValidity();
|
|
5290
|
-
this.dispatchEvent(new CustomEvent(event.type, { bubbles: true, composed: true }));
|
|
5291
|
-
};
|
|
5292
|
-
this._handleSelect = (event) => {
|
|
5293
|
-
event.stopImmediatePropagation();
|
|
5294
|
-
if (!this.disabled) {
|
|
5295
|
-
this.dispatchEvent(new CustomEvent("select", { bubbles: true, composed: true }));
|
|
5296
|
-
}
|
|
5297
|
-
};
|
|
5298
|
-
this._handleFocus = (event) => {
|
|
5299
|
-
event.stopImmediatePropagation();
|
|
5300
|
-
this.dispatchEvent(new CustomEvent("focus", { bubbles: true, composed: true }));
|
|
5301
|
-
};
|
|
5302
|
-
this._handleBlur = (event) => {
|
|
5303
|
-
event.stopImmediatePropagation();
|
|
5304
|
-
this.updateValidity();
|
|
5305
|
-
this.dispatchEvent(new CustomEvent("blur", { bubbles: true, composed: true }));
|
|
5306
|
-
};
|
|
5307
|
-
this.internals = this.attachInternals();
|
|
5308
|
-
this.attachShadow({ mode: "open", delegatesFocus: true });
|
|
5309
|
-
}
|
|
5310
|
-
connectedCallback() {
|
|
5311
|
-
super.connectedCallback();
|
|
5312
|
-
this._defaultValue = this.value ?? null;
|
|
5313
|
-
this.internals.setFormValue(this._defaultValue);
|
|
5314
|
-
}
|
|
5315
|
-
updateValidity() {
|
|
5316
|
-
if (this.control.checkValidity()) {
|
|
5317
|
-
this.internals.setValidity({});
|
|
5318
|
-
} else {
|
|
5319
|
-
this.internals.setValidity({ customError: true }, this.control.validationMessage, this.control);
|
|
5320
|
-
}
|
|
5321
|
-
}
|
|
5322
|
-
hasTypedTooManyCharacters() {
|
|
5323
|
-
if (!this.counter) {
|
|
5324
|
-
return false;
|
|
5325
|
-
}
|
|
5326
|
-
const currentLength = this.value?.length || 0;
|
|
5327
|
-
return currentLength > this.counter;
|
|
5328
|
-
}
|
|
5329
|
-
renderCharacterCounter() {
|
|
5330
|
-
if (this.counter === void 0) return E;
|
|
5331
|
-
const currentLength = this.value?.length || 0;
|
|
5332
|
-
if (this.hasTypedTooManyCharacters()) {
|
|
5333
|
-
return x`<sds-alert variant="secondary" data-palette="danger"
|
|
5334
|
-
><p class="sds-textarea__character-counter" slot="message">Du har ${currentLength - this.counter} tegn for mye</p></sds-alert
|
|
5335
|
-
>`;
|
|
5336
|
-
}
|
|
5337
|
-
return x`<p class="sds-textarea__character-counter">Du har ${this.counter - currentLength} tegn igjen</p>`;
|
|
5338
|
-
}
|
|
5339
|
-
formResetCallback() {
|
|
5340
|
-
this.internals.setFormValue(this._defaultValue);
|
|
5341
|
-
const newValue = this._defaultValue ?? "";
|
|
5342
|
-
this.control.value = newValue;
|
|
5343
|
-
this.value = newValue;
|
|
5344
|
-
this.updateValidity();
|
|
5345
|
-
}
|
|
5346
|
-
select() {
|
|
5347
|
-
if (!this.disabled) this.control.select();
|
|
5348
|
-
}
|
|
5349
|
-
type() {
|
|
5350
|
-
return "textarea";
|
|
5351
|
-
}
|
|
5352
|
-
focus() {
|
|
5353
|
-
if (!this.disabled) this.control.focus();
|
|
5354
|
-
}
|
|
5355
|
-
blur() {
|
|
5356
|
-
if (!this.disabled) this.control.blur();
|
|
5357
|
-
}
|
|
5358
|
-
click() {
|
|
5359
|
-
if (!this.disabled) this.control.click();
|
|
5360
|
-
}
|
|
5361
|
-
get selectionStart() {
|
|
5362
|
-
return this.control ? this.control.selectionStart : null;
|
|
5363
|
-
}
|
|
5364
|
-
set selectionStart(value) {
|
|
5365
|
-
if (this.control && value !== null) {
|
|
5366
|
-
this.control.selectionStart = value;
|
|
5367
|
-
}
|
|
5368
|
-
}
|
|
5369
|
-
get selectionEnd() {
|
|
5370
|
-
return this.control ? this.control.selectionEnd : null;
|
|
5371
|
-
}
|
|
5372
|
-
set selectionEnd(value) {
|
|
5373
|
-
if (this.control && value !== null) {
|
|
5374
|
-
this.control.selectionEnd = value;
|
|
5375
|
-
}
|
|
5376
|
-
}
|
|
5377
|
-
setSelectionRange(start, end, direction) {
|
|
5378
|
-
if (this.control) {
|
|
5379
|
-
this.control.setSelectionRange(start, end, direction);
|
|
5380
|
-
}
|
|
5381
|
-
}
|
|
5382
|
-
checkValidity() {
|
|
5383
|
-
return this.control.checkValidity();
|
|
5384
|
-
}
|
|
5385
|
-
reportValidity() {
|
|
5386
|
-
return this.control.reportValidity();
|
|
5387
|
-
}
|
|
5388
|
-
setCustomValidity(message) {
|
|
5389
|
-
this.control.setCustomValidity(message);
|
|
5390
|
-
this.updateValidity();
|
|
5391
|
-
}
|
|
5392
|
-
render() {
|
|
5393
|
-
const textareaClasses = {
|
|
5394
|
-
"sds-textarea": true,
|
|
5395
|
-
"sds-textarea--error": Boolean(this.errorMessage || this.hasTypedTooManyCharacters())
|
|
5396
|
-
};
|
|
5397
|
-
return x`
|
|
5398
|
-
<div class="${e2(textareaClasses)}">
|
|
5399
|
-
${this.label || this.helpText ? x`<div>
|
|
5400
|
-
${this.label ? x`<label for="sds-textarea" class="sds-textarea__label">${this.label}</label>` : E}
|
|
5401
|
-
${this.helpText ? x`<p class="sds-textarea__help-text">${this.helpText}</p>` : E}
|
|
5402
|
-
</div>` : E}
|
|
2771
|
+
`;var ce=Object.defineProperty,he=Object.getOwnPropertyDescriptor,pe=(t,s,e,o)=>{for(var r,a=o>1?void 0:o?he(s,e):s,i=t.length-1;i>=0;i--)(r=t[i])&&(a=(o?r(s,e,a):r(a))||a);return o&&a&&ce(s,e,a),a};let ge=class extends at{constructor(){super(),this.disabled=!1,this.readOnly=!1,this.required=!1,this.size="md",this._defaultValue=null,this._handleInputChange=t=>{t.stopImmediatePropagation(),!this.disabled&&t.target instanceof HTMLTextAreaElement&&(this.value=t.target.value,this.internals.setFormValue(""===this.value?null:this.value),this.updateValidity(),this.dispatchEvent(new CustomEvent(t.type,{bubbles:!0,composed:!0})))},this._handleSelect=t=>{t.stopImmediatePropagation(),this.disabled||this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0}))},this._handleFocus=t=>{t.stopImmediatePropagation(),this.dispatchEvent(new CustomEvent("focus",{bubbles:!0,composed:!0}))},this._handleBlur=t=>{t.stopImmediatePropagation(),this.updateValidity(),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))},this.internals=this.attachInternals(),this.attachShadow({mode:"open",delegatesFocus:!0})}connectedCallback(){super.connectedCallback(),this._defaultValue=this.value??null,this.internals.setFormValue(this._defaultValue)}updateValidity(){this.control.checkValidity()?this.internals.setValidity({}):this.internals.setValidity({customError:!0},this.control.validationMessage,this.control)}hasTypedTooManyCharacters(){if(!this.counter)return!1;return(this.value?.length||0)>this.counter}renderCharacterCounter(){if(void 0===this.counter)return U;const t=this.value?.length||0;return this.hasTypedTooManyCharacters()?j`<sds-alert variant="secondary" data-palette="danger"
|
|
2772
|
+
><p class="sds-textarea__character-counter" slot="message">Du har ${t-this.counter} tegn for mye</p></sds-alert
|
|
2773
|
+
>`:j`<p class="sds-textarea__character-counter">Du har ${this.counter-t} tegn igjen</p>`}formResetCallback(){this.internals.setFormValue(this._defaultValue);const t=this._defaultValue??"";this.control.value=t,this.value=t,this.updateValidity()}select(){this.disabled||this.control.select()}type(){return"textarea"}focus(){this.disabled||this.control.focus()}blur(){this.disabled||this.control.blur()}click(){this.disabled||this.control.click()}get selectionStart(){return this.control?this.control.selectionStart:null}set selectionStart(t){this.control&&null!==t&&(this.control.selectionStart=t)}get selectionEnd(){return this.control?this.control.selectionEnd:null}set selectionEnd(t){this.control&&null!==t&&(this.control.selectionEnd=t)}setSelectionRange(t,s,e){this.control&&this.control.setSelectionRange(t,s,e)}checkValidity(){return this.control.checkValidity()}reportValidity(){return this.control.reportValidity()}setCustomValidity(t){this.control.setCustomValidity(t),this.updateValidity()}render(){const t={"sds-textarea":!0,"sds-textarea--error":Boolean(this.errorMessage||this.hasTypedTooManyCharacters())};return j`
|
|
2774
|
+
<div class="${Ot(t)}">
|
|
2775
|
+
${this.label||this.helpText?j`<div>
|
|
2776
|
+
${this.label?j`<label for="sds-textarea" class="sds-textarea__label">${this.label}</label>`:U}
|
|
2777
|
+
${this.helpText?j`<p class="sds-textarea__help-text">${this.helpText}</p>`:U}
|
|
2778
|
+
</div>`:U}
|
|
5403
2779
|
<div class="sds-textarea__input-container">
|
|
5404
2780
|
<textarea
|
|
5405
2781
|
class="sds-textarea__input"
|
|
5406
2782
|
id="sds-textarea"
|
|
5407
2783
|
?disabled="${this.disabled}"
|
|
5408
2784
|
?readonly="${this.readOnly}"
|
|
5409
|
-
placeholder="${
|
|
5410
|
-
.value="${this.value
|
|
2785
|
+
placeholder="${vt(this.placeholder)}"
|
|
2786
|
+
.value="${this.value??""}"
|
|
5411
2787
|
.autocomplete="${this.autocomplete}"
|
|
5412
|
-
name="${
|
|
2788
|
+
name="${vt(this.name)}"
|
|
5413
2789
|
?required="${this.required}"
|
|
5414
|
-
rows="${
|
|
5415
|
-
cols="${
|
|
5416
|
-
wrap="${
|
|
5417
|
-
minlength="${
|
|
5418
|
-
maxlength="${
|
|
2790
|
+
rows="${vt(this.rows)}"
|
|
2791
|
+
cols="${vt(this.cols)}"
|
|
2792
|
+
wrap="${vt(this.wrap)}"
|
|
2793
|
+
minlength="${vt(this.minlength)}"
|
|
2794
|
+
maxlength="${vt(this.maxlength)}"
|
|
5419
2795
|
@input="${this._handleInputChange}"
|
|
5420
2796
|
@change="${this._handleInputChange}"
|
|
5421
2797
|
@select="${this._handleSelect}"
|
|
@@ -5423,87 +2799,6 @@ let SDSTextArea = class extends i$1 {
|
|
|
5423
2799
|
@blur="${this._handleBlur}"
|
|
5424
2800
|
></textarea>
|
|
5425
2801
|
</div>
|
|
5426
|
-
${this.errorMessage
|
|
2802
|
+
${this.errorMessage?j`<sds-alert variant="secondary" data-palette="danger"><p slot="message">${this.errorMessage}</p></sds-alert>`:U} ${this.renderCharacterCounter()}
|
|
5427
2803
|
</div>
|
|
5428
|
-
|
|
5429
|
-
}
|
|
5430
|
-
};
|
|
5431
|
-
SDSTextArea.styles = [styles];
|
|
5432
|
-
SDSTextArea.formAssociated = true;
|
|
5433
|
-
__decorateClass([
|
|
5434
|
-
n2({ type: String })
|
|
5435
|
-
], SDSTextArea.prototype, "value", 2);
|
|
5436
|
-
__decorateClass([
|
|
5437
|
-
n2({ type: String, reflect: true })
|
|
5438
|
-
], SDSTextArea.prototype, "name", 2);
|
|
5439
|
-
__decorateClass([
|
|
5440
|
-
n2({ type: String, reflect: true })
|
|
5441
|
-
], SDSTextArea.prototype, "label", 2);
|
|
5442
|
-
__decorateClass([
|
|
5443
|
-
n2({ type: String, reflect: true })
|
|
5444
|
-
], SDSTextArea.prototype, "placeholder", 2);
|
|
5445
|
-
__decorateClass([
|
|
5446
|
-
n2({ type: String, attribute: "help-text", reflect: true })
|
|
5447
|
-
], SDSTextArea.prototype, "helpText", 2);
|
|
5448
|
-
__decorateClass([
|
|
5449
|
-
n2({ type: String, attribute: "error-message", reflect: true })
|
|
5450
|
-
], SDSTextArea.prototype, "errorMessage", 2);
|
|
5451
|
-
__decorateClass([
|
|
5452
|
-
n2({ type: Boolean, reflect: true })
|
|
5453
|
-
], SDSTextArea.prototype, "disabled", 2);
|
|
5454
|
-
__decorateClass([
|
|
5455
|
-
n2({ type: Boolean, attribute: "readonly", reflect: true })
|
|
5456
|
-
], SDSTextArea.prototype, "readOnly", 2);
|
|
5457
|
-
__decorateClass([
|
|
5458
|
-
n2({ type: String, reflect: true })
|
|
5459
|
-
], SDSTextArea.prototype, "autocomplete", 2);
|
|
5460
|
-
__decorateClass([
|
|
5461
|
-
n2({ type: Boolean, reflect: true })
|
|
5462
|
-
], SDSTextArea.prototype, "required", 2);
|
|
5463
|
-
__decorateClass([
|
|
5464
|
-
n2({ type: Number, reflect: true })
|
|
5465
|
-
], SDSTextArea.prototype, "rows", 2);
|
|
5466
|
-
__decorateClass([
|
|
5467
|
-
n2({ type: Number, reflect: true })
|
|
5468
|
-
], SDSTextArea.prototype, "cols", 2);
|
|
5469
|
-
__decorateClass([
|
|
5470
|
-
n2({ type: String, reflect: true })
|
|
5471
|
-
], SDSTextArea.prototype, "wrap", 2);
|
|
5472
|
-
__decorateClass([
|
|
5473
|
-
n2({ type: Number, reflect: true })
|
|
5474
|
-
], SDSTextArea.prototype, "minlength", 2);
|
|
5475
|
-
__decorateClass([
|
|
5476
|
-
n2({ type: Number, reflect: true })
|
|
5477
|
-
], SDSTextArea.prototype, "maxlength", 2);
|
|
5478
|
-
__decorateClass([
|
|
5479
|
-
n2({ type: Number, reflect: true })
|
|
5480
|
-
], SDSTextArea.prototype, "counter", 2);
|
|
5481
|
-
__decorateClass([
|
|
5482
|
-
n2({ type: String, reflect: true })
|
|
5483
|
-
], SDSTextArea.prototype, "size", 2);
|
|
5484
|
-
__decorateClass([
|
|
5485
|
-
e$3("#sds-textarea")
|
|
5486
|
-
], SDSTextArea.prototype, "control", 2);
|
|
5487
|
-
SDSTextArea = __decorateClass([
|
|
5488
|
-
guardedCustomElement("sds-textarea")
|
|
5489
|
-
], SDSTextArea);
|
|
5490
|
-
export {
|
|
5491
|
-
SDSAlert,
|
|
5492
|
-
SDSButton,
|
|
5493
|
-
SDSCard,
|
|
5494
|
-
SDSCheckbox,
|
|
5495
|
-
SDSCheckboxGroup,
|
|
5496
|
-
SDSChip,
|
|
5497
|
-
SDSDetails,
|
|
5498
|
-
SDSHeading,
|
|
5499
|
-
SDSIcon,
|
|
5500
|
-
SDSLoader,
|
|
5501
|
-
SDSNotification,
|
|
5502
|
-
SDSRadio,
|
|
5503
|
-
SDSRadioGroup,
|
|
5504
|
-
SDSSwitch,
|
|
5505
|
-
SDSTag,
|
|
5506
|
-
SDSText,
|
|
5507
|
-
SDSTextArea,
|
|
5508
|
-
SDSTextField
|
|
5509
|
-
};
|
|
2804
|
+
`}};ge.styles=[le],ge.formAssociated=!0,pe([lt({type:String})],ge.prototype,"value",2),pe([lt({type:String,reflect:!0})],ge.prototype,"name",2),pe([lt({type:String,reflect:!0})],ge.prototype,"label",2),pe([lt({type:String,reflect:!0})],ge.prototype,"placeholder",2),pe([lt({type:String,attribute:"help-text",reflect:!0})],ge.prototype,"helpText",2),pe([lt({type:String,attribute:"error-message",reflect:!0})],ge.prototype,"errorMessage",2),pe([lt({type:Boolean,reflect:!0})],ge.prototype,"disabled",2),pe([lt({type:Boolean,attribute:"readonly",reflect:!0})],ge.prototype,"readOnly",2),pe([lt({type:String,reflect:!0})],ge.prototype,"autocomplete",2),pe([lt({type:Boolean,reflect:!0})],ge.prototype,"required",2),pe([lt({type:Number,reflect:!0})],ge.prototype,"rows",2),pe([lt({type:Number,reflect:!0})],ge.prototype,"cols",2),pe([lt({type:String,reflect:!0})],ge.prototype,"wrap",2),pe([lt({type:Number,reflect:!0})],ge.prototype,"minlength",2),pe([lt({type:Number,reflect:!0})],ge.prototype,"maxlength",2),pe([lt({type:Number,reflect:!0})],ge.prototype,"counter",2),pe([lt({type:String,reflect:!0})],ge.prototype,"size",2),pe([ht("#sds-textarea")],ge.prototype,"control",2),ge=pe([pt("sds-textarea")],ge);export{jt as SDSAlert,Rt as SDSButton,Kt as SDSCard,Yt as SDSCheckbox,rs as SDSCheckboxGroup,ls as SDSChip,vs as SDSDetails,xs as SDSHeading,qt as SDSIcon,zs as SDSLoader,Os as SDSNotification,Rs as SDSRadio,Ns as SDSRadioGroup,Ks as SDSSwitch,Ys as SDSTag,oe as SDSText,ge as SDSTextArea,ne as SDSTextField};
|