scb-wc-test 0.1.119 → 0.1.120
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import{n as l,t as I,i as k,a as w,x as h,E as i}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,a,s){try{customElements.get(r)||e(r,a,s)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var T=Object.defineProperty,B=Object.getOwnPropertyDescriptor,A=t=>{throw TypeError(t)},n=(t,e,r,a)=>{for(var s=a>1?void 0:a?B(e,r):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(s=(a?d(e,r,s):d(s))||s);return a&&s&&T(e,r,s),s},O=(t,e,r)=>e.has(t)||A("Cannot "+r),E=(t,e,r)=>e.has(t)?A("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),$=(t,e,r)=>(O(t,e,"access private method"),r),m,y;let o=class extends k{constructor(){super(...arguments),E(this,m),this.variant="filled",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing="",this.spacingTop="",this.spacingBottom=""}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(t){return t?.shadowRoot?.querySelector("button")??null}__syncAriaToInner(){const t=this.__getMdHost(),e=this.__getInnerNativeButton(t);if(!t||!e)return;const r=(this.getAttribute("aria-label")||"").trim(),a=(t.getAttribute("aria-label")||"").trim(),s=this.label.trim()===""?(this.icon||"").trim():"",c=r||a||s;c?e.setAttribute("aria-label",c):e.removeAttribute("aria-label");const d=this.getAttribute("aria-controls");d!==null?e.setAttribute("aria-controls",d):e.removeAttribute("aria-controls");const g=this.getAttribute("aria-expanded");g!==null?e.setAttribute("aria-expanded",g):e.removeAttribute("aria-expanded"),t.removeAttribute("aria-label"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(x=>{const u=this.__getMdHost(),p=this.__getInnerNativeButton(u);if(!(!u||!p)){for(const f of x){if(f.type!=="attributes"||!f.attributeName)continue;const b=f.attributeName,v=this.getAttribute(b);if(b==="aria-label"){const S=(u.getAttribute("aria-label")||"").trim(),_=(v||S||(this.label.trim()===""?(this.icon||"").trim():"")).trim();_?p.setAttribute("aria-label",_):p.removeAttribute("aria-label"),u.removeAttribute("aria-label")}else(b==="aria-controls"||b==="aria-expanded")&&(v===null?p.removeAttribute(b):p.setAttribute(b,v),b==="aria-expanded"&&this.removeAttribute("aria-expanded"))}u.removeAttribute("aria-label"),u.removeAttribute("aria-controls"),u.removeAttribute("aria-expanded")}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const t=this.closest("form");t&&(this.type==="submit"&&t.requestSubmit(),this.type==="reset"&&t.reset())}}),this.__syncAriaToInner(),$(this,m,y).call(this)}updated(t){t.has("variant")&&this.__syncAriaToInner(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&$(this,m,y).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}static get styles(){return w`
|
|
2
2
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
3
3
|
:host {
|
|
4
4
|
display: inline-flex;
|
|
@@ -7,6 +7,11 @@ import{n as s,t as I,i as k,a as T,x as h,E as i}from"../../vendor/vendor.js";im
|
|
|
7
7
|
margin-block-end: var(--scb-button-spacing-block-end, 0);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
:host([full-width]) {
|
|
11
|
+
display: flex;
|
|
12
|
+
inline-size: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
/* Låt inre md-knappar fylla hostens höjd */
|
|
11
16
|
md-filled-button,
|
|
12
17
|
md-outlined-button,
|
|
@@ -15,6 +20,14 @@ import{n as s,t as I,i as k,a as T,x as h,E as i}from"../../vendor/vendor.js";im
|
|
|
15
20
|
block-size: 100%;
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
:host([full-width]) md-filled-button,
|
|
24
|
+
:host([full-width]) md-outlined-button,
|
|
25
|
+
:host([full-width]) md-filled-tonal-button,
|
|
26
|
+
:host([full-width]) md-text-button {
|
|
27
|
+
inline-size: 100%;
|
|
28
|
+
flex: 1 1 auto;
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
/* Errorvarianter */
|
|
19
32
|
/*
|
|
20
33
|
md-filled-button[variant='error'],
|
|
@@ -119,4 +132,4 @@ import{n as s,t as I,i as k,a as T,x as h,E as i}from"../../vendor/vendor.js";im
|
|
|
119
132
|
${this.label}
|
|
120
133
|
${t&&this.trailingIcon?e:i}
|
|
121
134
|
</md-text-button>
|
|
122
|
-
`;default:return h``}}};m=new WeakSet;
|
|
135
|
+
`;default:return h``}}};m=new WeakSet;y=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,r=this.mapSpacingToken(this.spacingBottom)??t;e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),r?this.style.setProperty("--scb-button-spacing-block-end",r):this.style.removeProperty("--scb-button-spacing-block-end")};n([l({type:String,reflect:!0})],o.prototype,"variant",2);n([l({type:String,reflect:!0})],o.prototype,"type",2);n([l({type:String})],o.prototype,"label",2);n([l({type:Boolean,attribute:"trailing-icon"})],o.prototype,"trailingIcon",2);n([l({type:String})],o.prototype,"icon",2);n([l({type:Boolean,reflect:!0})],o.prototype,"disabled",2);n([l({type:Boolean,attribute:"full-width",reflect:!0})],o.prototype,"fullWidth",2);n([l({type:String})],o.prototype,"href",2);n([l({type:String})],o.prototype,"target",2);n([l({type:String})],o.prototype,"rel",2);n([l({type:String,reflect:!0})],o.prototype,"spacing",2);n([l({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",2);n([l({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",2);o=n([I("scb-button")],o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.120",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -353,5 +353,5 @@
|
|
|
353
353
|
},
|
|
354
354
|
"./mvc/*": "./mvc/*"
|
|
355
355
|
},
|
|
356
|
-
"buildHash": "
|
|
356
|
+
"buildHash": "0897A21AC399DEBBBDCA38AD987E4E012CB498B06670BDFBE404ECBFDEDDA489"
|
|
357
357
|
}
|
package/scb-button/scb-button.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { LitElement as k, css as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as k, css as w, html as h, nothing as r } from "lit";
|
|
2
|
+
import { property as a, customElement as B } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/button/filled-button.js";
|
|
4
4
|
import "@material/web/button/outlined-button.js";
|
|
5
5
|
import "@material/web/button/filled-tonal-button.js";
|
|
6
6
|
import "@material/web/button/text-button.js";
|
|
7
7
|
import "@material/web/icon/icon.js";
|
|
8
|
-
var
|
|
8
|
+
var T = Object.defineProperty, O = Object.getOwnPropertyDescriptor, x = (t) => {
|
|
9
9
|
throw TypeError(t);
|
|
10
|
-
},
|
|
11
|
-
for (var
|
|
12
|
-
(
|
|
13
|
-
return
|
|
14
|
-
}, L = (t, e, i) => e.has(t) || x("Cannot " + i), P = (t, e, i) => e.has(t) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), A = (t, e, i) => (L(t, e, "access private method"), i), m,
|
|
10
|
+
}, n = (t, e, i, s) => {
|
|
11
|
+
for (var l = s > 1 ? void 0 : s ? O(e, i) : e, u = t.length - 1, b; u >= 0; u--)
|
|
12
|
+
(b = t[u]) && (l = (s ? b(e, i, l) : b(l)) || l);
|
|
13
|
+
return s && l && T(e, i, l), l;
|
|
14
|
+
}, L = (t, e, i) => e.has(t) || x("Cannot " + i), P = (t, e, i) => e.has(t) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), A = (t, e, i) => (L(t, e, "access private method"), i), m, y;
|
|
15
15
|
let o = class extends k {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), P(this, m), this.variant = "filled", this.type = "button", this.label = "Button", this.trailingIcon = !1, this.icon = "", this.disabled = !1, this.href = "", this.target = "", this.rel = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
17
|
+
super(...arguments), P(this, m), this.variant = "filled", this.type = "button", this.label = "Button", this.trailingIcon = !1, this.icon = "", this.disabled = !1, this.fullWidth = !1, this.href = "", this.target = "", this.rel = "", this.spacing = "", this.spacingTop = "", this.spacingBottom = "";
|
|
18
18
|
}
|
|
19
19
|
// Hosta md-* elementet (värden flyttas därifrån in i dess shadow <button>)
|
|
20
20
|
__getMdHost() {
|
|
@@ -32,21 +32,21 @@ let o = class extends k {
|
|
|
32
32
|
var $;
|
|
33
33
|
const t = this.__getMdHost(), e = this.__getInnerNativeButton(t);
|
|
34
34
|
if (!t || !e) return;
|
|
35
|
-
const i = (this.getAttribute("aria-label") || "").trim(),
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const c = this.__getMdHost(),
|
|
42
|
-
if (!(!c || !
|
|
35
|
+
const i = (this.getAttribute("aria-label") || "").trim(), s = (t.getAttribute("aria-label") || "").trim(), l = this.label.trim() === "" ? (this.icon || "").trim() : "", u = i || s || l;
|
|
36
|
+
u ? e.setAttribute("aria-label", u) : e.removeAttribute("aria-label");
|
|
37
|
+
const b = this.getAttribute("aria-controls");
|
|
38
|
+
b !== null ? e.setAttribute("aria-controls", b) : e.removeAttribute("aria-controls");
|
|
39
|
+
const g = this.getAttribute("aria-expanded");
|
|
40
|
+
g !== null ? e.setAttribute("aria-expanded", g) : e.removeAttribute("aria-expanded"), t.removeAttribute("aria-label"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"), this.removeAttribute("aria-expanded"), ($ = this.__ariaObserver) == null || $.disconnect(), this.__ariaObserver = new MutationObserver((S) => {
|
|
41
|
+
const c = this.__getMdHost(), p = this.__getInnerNativeButton(c);
|
|
42
|
+
if (!(!c || !p)) {
|
|
43
43
|
for (const f of S) {
|
|
44
44
|
if (f.type !== "attributes" || !f.attributeName) continue;
|
|
45
45
|
const d = f.attributeName, v = this.getAttribute(d);
|
|
46
46
|
if (d === "aria-label") {
|
|
47
47
|
const I = (c.getAttribute("aria-label") || "").trim(), _ = (v || I || (this.label.trim() === "" ? (this.icon || "").trim() : "")).trim();
|
|
48
|
-
_ ?
|
|
49
|
-
} else (d === "aria-controls" || d === "aria-expanded") && (v === null ?
|
|
48
|
+
_ ? p.setAttribute("aria-label", _) : p.removeAttribute("aria-label"), c.removeAttribute("aria-label");
|
|
49
|
+
} else (d === "aria-controls" || d === "aria-expanded") && (v === null ? p.removeAttribute(d) : p.setAttribute(d, v), d === "aria-expanded" && this.removeAttribute("aria-expanded"));
|
|
50
50
|
}
|
|
51
51
|
c.removeAttribute("aria-label"), c.removeAttribute("aria-controls"), c.removeAttribute("aria-expanded");
|
|
52
52
|
}
|
|
@@ -62,11 +62,11 @@ let o = class extends k {
|
|
|
62
62
|
const t = this.closest("form");
|
|
63
63
|
t && (this.type === "submit" && t.requestSubmit(), this.type === "reset" && t.reset());
|
|
64
64
|
}
|
|
65
|
-
}), this.__syncAriaToInner(), A(this, m,
|
|
65
|
+
}), this.__syncAriaToInner(), A(this, m, y).call(this);
|
|
66
66
|
}
|
|
67
67
|
// Kör även när variant/icon/spacing ändras
|
|
68
68
|
updated(t) {
|
|
69
|
-
t.has("variant") && this.__syncAriaToInner(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && A(this, m,
|
|
69
|
+
t.has("variant") && this.__syncAriaToInner(), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom")) && A(this, m, y).call(this);
|
|
70
70
|
}
|
|
71
71
|
disconnectedCallback() {
|
|
72
72
|
var t;
|
|
@@ -79,7 +79,7 @@ let o = class extends k {
|
|
|
79
79
|
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
80
80
|
}
|
|
81
81
|
static get styles() {
|
|
82
|
-
return
|
|
82
|
+
return w`
|
|
83
83
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
84
84
|
:host {
|
|
85
85
|
display: inline-flex;
|
|
@@ -88,6 +88,11 @@ let o = class extends k {
|
|
|
88
88
|
margin-block-end: var(--scb-button-spacing-block-end, 0);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
:host([full-width]) {
|
|
92
|
+
display: flex;
|
|
93
|
+
inline-size: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
/* Låt inre md-knappar fylla hostens höjd */
|
|
92
97
|
md-filled-button,
|
|
93
98
|
md-outlined-button,
|
|
@@ -96,6 +101,14 @@ let o = class extends k {
|
|
|
96
101
|
block-size: 100%;
|
|
97
102
|
}
|
|
98
103
|
|
|
104
|
+
:host([full-width]) md-filled-button,
|
|
105
|
+
:host([full-width]) md-outlined-button,
|
|
106
|
+
:host([full-width]) md-filled-tonal-button,
|
|
107
|
+
:host([full-width]) md-text-button {
|
|
108
|
+
inline-size: 100%;
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
}
|
|
111
|
+
|
|
99
112
|
/* Errorvarianter */
|
|
100
113
|
/*
|
|
101
114
|
md-filled-button[variant='error'],
|
|
@@ -143,17 +156,17 @@ let o = class extends k {
|
|
|
143
156
|
`;
|
|
144
157
|
}
|
|
145
158
|
render() {
|
|
146
|
-
var
|
|
147
|
-
const t = !!((
|
|
159
|
+
var l;
|
|
160
|
+
const t = !!((l = this.icon) != null && l.trim()), e = t ? h`<md-icon slot="icon">${this.icon}</md-icon>` : r, i = r, s = this.label.trim() === "" ? this.icon : void 0;
|
|
148
161
|
switch (this.variant) {
|
|
149
162
|
case "filled":
|
|
150
|
-
return
|
|
163
|
+
return h`
|
|
151
164
|
<md-filled-button
|
|
152
165
|
type=${this.type}
|
|
153
166
|
variant=${i}
|
|
154
167
|
?trailing-icon=${this.trailingIcon}
|
|
155
168
|
?disabled=${this.disabled}
|
|
156
|
-
aria-label=${
|
|
169
|
+
aria-label=${s}
|
|
157
170
|
href=${this.href || r}
|
|
158
171
|
target=${this.target || r}
|
|
159
172
|
rel=${this.rel || r}
|
|
@@ -164,13 +177,13 @@ let o = class extends k {
|
|
|
164
177
|
</md-filled-button>
|
|
165
178
|
`;
|
|
166
179
|
case "outlined":
|
|
167
|
-
return
|
|
180
|
+
return h`
|
|
168
181
|
<md-outlined-button
|
|
169
182
|
type=${this.type}
|
|
170
183
|
variant=${i}
|
|
171
184
|
?trailing-icon=${this.trailingIcon}
|
|
172
185
|
?disabled=${this.disabled}
|
|
173
|
-
aria-label=${
|
|
186
|
+
aria-label=${s}
|
|
174
187
|
href=${this.href || r}
|
|
175
188
|
target=${this.target || r}
|
|
176
189
|
rel=${this.rel || r}
|
|
@@ -181,13 +194,13 @@ let o = class extends k {
|
|
|
181
194
|
</md-outlined-button>
|
|
182
195
|
`;
|
|
183
196
|
case "filled-tonal":
|
|
184
|
-
return
|
|
197
|
+
return h`
|
|
185
198
|
<md-filled-tonal-button
|
|
186
199
|
type=${this.type}
|
|
187
200
|
variant=${i}
|
|
188
201
|
?trailing-icon=${this.trailingIcon}
|
|
189
202
|
?disabled=${this.disabled}
|
|
190
|
-
aria-label=${
|
|
203
|
+
aria-label=${s}
|
|
191
204
|
href=${this.href || r}
|
|
192
205
|
target=${this.target || r}
|
|
193
206
|
rel=${this.rel || r}
|
|
@@ -198,13 +211,13 @@ let o = class extends k {
|
|
|
198
211
|
</md-filled-tonal-button>
|
|
199
212
|
`;
|
|
200
213
|
case "text":
|
|
201
|
-
return
|
|
214
|
+
return h`
|
|
202
215
|
<md-text-button
|
|
203
216
|
type=${this.type}
|
|
204
217
|
variant=${i}
|
|
205
218
|
?trailing-icon=${this.trailingIcon}
|
|
206
219
|
?disabled=${this.disabled}
|
|
207
|
-
aria-label=${
|
|
220
|
+
aria-label=${s}
|
|
208
221
|
href=${this.href || r}
|
|
209
222
|
target=${this.target || r}
|
|
210
223
|
rel=${this.rel || r}
|
|
@@ -215,52 +228,55 @@ let o = class extends k {
|
|
|
215
228
|
</md-text-button>
|
|
216
229
|
`;
|
|
217
230
|
default:
|
|
218
|
-
return
|
|
231
|
+
return h``;
|
|
219
232
|
}
|
|
220
233
|
}
|
|
221
234
|
};
|
|
222
235
|
m = /* @__PURE__ */ new WeakSet();
|
|
223
|
-
|
|
236
|
+
y = function() {
|
|
224
237
|
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, i = this.mapSpacingToken(this.spacingBottom) ?? t;
|
|
225
238
|
e ? this.style.setProperty("--scb-button-spacing-block-start", e) : this.style.removeProperty("--scb-button-spacing-block-start"), i ? this.style.setProperty("--scb-button-spacing-block-end", i) : this.style.removeProperty("--scb-button-spacing-block-end");
|
|
226
239
|
};
|
|
227
|
-
|
|
228
|
-
|
|
240
|
+
n([
|
|
241
|
+
a({ type: String, reflect: !0 })
|
|
229
242
|
], o.prototype, "variant", 2);
|
|
230
|
-
|
|
231
|
-
|
|
243
|
+
n([
|
|
244
|
+
a({ type: String, reflect: !0 })
|
|
232
245
|
], o.prototype, "type", 2);
|
|
233
|
-
|
|
234
|
-
|
|
246
|
+
n([
|
|
247
|
+
a({ type: String })
|
|
235
248
|
], o.prototype, "label", 2);
|
|
236
|
-
|
|
237
|
-
|
|
249
|
+
n([
|
|
250
|
+
a({ type: Boolean, attribute: "trailing-icon" })
|
|
238
251
|
], o.prototype, "trailingIcon", 2);
|
|
239
|
-
|
|
240
|
-
|
|
252
|
+
n([
|
|
253
|
+
a({ type: String })
|
|
241
254
|
], o.prototype, "icon", 2);
|
|
242
|
-
|
|
243
|
-
|
|
255
|
+
n([
|
|
256
|
+
a({ type: Boolean, reflect: !0 })
|
|
244
257
|
], o.prototype, "disabled", 2);
|
|
245
|
-
|
|
246
|
-
|
|
258
|
+
n([
|
|
259
|
+
a({ type: Boolean, attribute: "full-width", reflect: !0 })
|
|
260
|
+
], o.prototype, "fullWidth", 2);
|
|
261
|
+
n([
|
|
262
|
+
a({ type: String })
|
|
247
263
|
], o.prototype, "href", 2);
|
|
248
|
-
|
|
249
|
-
|
|
264
|
+
n([
|
|
265
|
+
a({ type: String })
|
|
250
266
|
], o.prototype, "target", 2);
|
|
251
|
-
|
|
252
|
-
|
|
267
|
+
n([
|
|
268
|
+
a({ type: String })
|
|
253
269
|
], o.prototype, "rel", 2);
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
n([
|
|
271
|
+
a({ type: String, reflect: !0 })
|
|
256
272
|
], o.prototype, "spacing", 2);
|
|
257
|
-
|
|
258
|
-
|
|
273
|
+
n([
|
|
274
|
+
a({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
259
275
|
], o.prototype, "spacingTop", 2);
|
|
260
|
-
|
|
261
|
-
|
|
276
|
+
n([
|
|
277
|
+
a({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
262
278
|
], o.prototype, "spacingBottom", 2);
|
|
263
|
-
o =
|
|
279
|
+
o = n([
|
|
264
280
|
B("scb-button")
|
|
265
281
|
], o);
|
|
266
282
|
export {
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -1281,7 +1281,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
1281
1281
|
* @license
|
|
1282
1282
|
* Copyright 2023 Google LLC
|
|
1283
1283
|
* SPDX-License-Identifier: Apache-2.0
|
|
1284
|
-
*/class
|
|
1284
|
+
*/class de extends y{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new Yd(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(e){this.selectOptionController.setTypeaheadText(e)}get displayText(){return this.selectOptionController.displayText}set displayText(e){this.selectOptionController.setDisplayText(e)}render(){return this.renderListItem(c`
|
|
1285
1285
|
<md-item>
|
|
1286
1286
|
<div slot="container">
|
|
1287
1287
|
${this.renderRipple()} ${this.renderFocusRing()}
|
|
@@ -1319,11 +1319,11 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
1319
1319
|
<slot
|
|
1320
1320
|
name="trailing-supporting-text"
|
|
1321
1321
|
slot="trailing-supporting-text"></slot>
|
|
1322
|
-
`}focus(){var e;(e=this.listItemRoot)==null||e.focus()}}ae(
|
|
1322
|
+
`}focus(){var e;(e=this.listItemRoot)==null||e.focus()}}ae(de),de.shadowRootOptions={...y.shadowRootOptions,delegatesFocus:!0},h([n({type:Boolean,reflect:!0})],de.prototype,"disabled",void 0),h([n({type:Boolean,attribute:"md-menu-item",reflect:!0})],de.prototype,"isMenuItem",void 0),h([n({type:Boolean})],de.prototype,"selected",void 0),h([n()],de.prototype,"value",void 0),h([C(".list-item")],de.prototype,"listItemRoot",void 0),h([Z({slot:"headline"})],de.prototype,"headlineElements",void 0),h([Z({slot:"supporting-text"})],de.prototype,"supportingTextElements",void 0),h([ko({slot:""})],de.prototype,"defaultElements",void 0),h([n({attribute:"typeahead-text"})],de.prototype,"typeaheadText",null),h([n({attribute:"display-text"})],de.prototype,"displayText",null);/**
|
|
1323
1323
|
* @license
|
|
1324
1324
|
* Copyright 2023 Google LLC
|
|
1325
1325
|
* SPDX-License-Identifier: Apache-2.0
|
|
1326
|
-
*/let ya=class extends
|
|
1326
|
+
*/let ya=class extends de{};ya.styles=[dn],ya=h([g("md-select-option")],ya);/**
|
|
1327
1327
|
* @license
|
|
1328
1328
|
* Copyright 2024 Google LLC
|
|
1329
1329
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -1881,7 +1881,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
1881
1881
|
margin-block-start: var(--scb-accordion-spacing-block-start, 0);
|
|
1882
1882
|
margin-block-end: var(--scb-accordion-spacing-block-end, 0);
|
|
1883
1883
|
}
|
|
1884
|
-
`,$i([n({type:Boolean,reflect:!0})],a.ScbAccordion.prototype,"detached",2),$i([n({type:String,reflect:!0})],a.ScbAccordion.prototype,"spacing",2),$i([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbAccordion.prototype,"spacingTop",2),$i([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbAccordion.prototype,"spacingBottom",2),a.ScbAccordion=$i([g("scb-accordion")],a.ScbAccordion);var Eh=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Tn=o=>{throw TypeError(o)},
|
|
1884
|
+
`,$i([n({type:Boolean,reflect:!0})],a.ScbAccordion.prototype,"detached",2),$i([n({type:String,reflect:!0})],a.ScbAccordion.prototype,"spacing",2),$i([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbAccordion.prototype,"spacingTop",2),$i([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbAccordion.prototype,"spacingBottom",2),a.ScbAccordion=$i([g("scb-accordion")],a.ScbAccordion);var Eh=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Tn=o=>{throw TypeError(o)},he=(o,e,t,i)=>{for(var r=i>1?void 0:i?Th(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&Eh(e,t,r),r},Ah=(o,e,t)=>e.has(o)||Tn("Cannot "+t),zh=(o,e,t)=>e.has(o)?Tn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),An=(o,e,t)=>(Ah(o,e,"access private method"),t),Dr,Ca;a.ScbIconButton=class extends y{constructor(){super(...arguments),zh(this,Dr),this.icon="home",this.tooltip="",this.ariaLabel="",this.variant="standard",this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.__loadedVariants=new Set,this.__iconLoaded=!1,this.__lastMdHost=null,this.__onInnerChange=()=>{const e=this.__getMdHost(),t=!!(e!=null&&e.selected);this.toggle&&(this.selected=t),this.dispatchEvent(new CustomEvent("change",{detail:{selected:t},bubbles:!0,composed:!0}))}}async firstUpdated(){await this.__ensureDepsLoaded(),await this.updateComplete,this.__attachChangeListener(),this.__syncTitleAndAria(),An(this,Dr,Ca).call(this)}updated(e){if(super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&An(this,Dr,Ca).call(this),e.has("variant")){this.__ensureDepsLoaded().then(()=>{queueMicrotask(()=>{this.__attachChangeListener(),this.__syncTitleAndAria()})});return}(e.has("toggle")||e.has("icon")||e.has("toggleofficon")||e.has("toggleonicon")||e.has("selected")||e.has("disabled")||e.has("tooltip")||e.has("ariaLabel"))&&queueMicrotask(()=>{this.__attachChangeListener(),this.__syncTitleAndAria()})}disconnectedCallback(){var e,t;(t=(e=this.__lastMdHost)==null?void 0:e.removeEventListener)==null||t.call(e,"change",this.__onInnerChange),this.__lastMdHost=null,super.disconnectedCallback()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"filled":await Promise.resolve().then(()=>rd);break;case"outlined":await Promise.resolve().then(()=>cd);break;case"filled-tonal":await Promise.resolve().then(()=>ad);break;default:await Promise.resolve().then(()=>nd);break}this.__loadedVariants.add(this.variant)}this.__iconLoaded||(await Promise.resolve().then(()=>Le),this.__iconLoaded=!0)}__getMdHost(){return this.renderRoot.querySelector("md-filled-icon-button, md-outlined-icon-button, md-filled-tonal-icon-button, md-icon-button")}__attachChangeListener(){var t,i;const e=this.__getMdHost();e&&e!==this.__lastMdHost&&((i=(t=this.__lastMdHost)==null?void 0:t.removeEventListener)==null||i.call(t,"change",this.__onInnerChange),e.addEventListener("change",this.__onInnerChange),this.__lastMdHost=e),this.toggle&&e&&"selected"in e&&(e.selected=this.selected)}__syncTitleAndAria(){const e=this.__getMdHost();if(!e)return;const t=(this.tooltip||this.getAttribute("title")||"").trim(),i=(this.ariaLabel||this.getAttribute("aria-label")||"").trim(),r=this.getAttribute("aria-controls"),s=this.getAttribute("aria-expanded");this.tooltip&&this.setAttribute("title",t);const l=i||t||this.icon.trim()||void 0;l?e.setAttribute("aria-label",l):e.removeAttribute("aria-label"),t?e.setAttribute("title",t):e.removeAttribute("title"),r!==null?e.setAttribute("aria-controls",r):e.removeAttribute("aria-controls"),s!==null?e.setAttribute("aria-expanded",s):e.removeAttribute("aria-expanded")}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__renderToggleIcons(){return c`
|
|
1885
1885
|
<md-icon aria-hidden="true">${this.toggleofficon}</md-icon>
|
|
1886
1886
|
<md-icon slot="selected" aria-hidden="true">${this.toggleonicon}</md-icon>
|
|
1887
1887
|
`}__renderSingleIcon(){return c`<md-icon aria-hidden="true">${this.icon}</md-icon>`}__renderMd(){const e=this.toggle?this.__renderToggleIcons():this.__renderSingleIcon();if(this.toggle)switch(this.variant){case"filled":return c`
|
|
@@ -1934,7 +1934,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
1934
1934
|
margin-block-start: var(--scb-icon-button-spacing-block-start, 0);
|
|
1935
1935
|
margin-block-end: var(--scb-icon-button-spacing-block-end, 0);
|
|
1936
1936
|
}
|
|
1937
|
-
`,
|
|
1937
|
+
`,he([n({type:String})],a.ScbIconButton.prototype,"icon",2),he([n({type:String})],a.ScbIconButton.prototype,"tooltip",2),he([n({type:String,attribute:"aria-label"})],a.ScbIconButton.prototype,"ariaLabel",2),he([n({type:String})],a.ScbIconButton.prototype,"variant",2),he([n({type:Boolean,reflect:!0})],a.ScbIconButton.prototype,"toggle",2),he([n({type:Boolean,reflect:!0})],a.ScbIconButton.prototype,"selected",2),he([n({type:String})],a.ScbIconButton.prototype,"toggleofficon",2),he([n({type:String})],a.ScbIconButton.prototype,"toggleonicon",2),he([n({type:Boolean,reflect:!0})],a.ScbIconButton.prototype,"disabled",2),he([n({type:String,reflect:!0})],a.ScbIconButton.prototype,"spacing",2),he([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbIconButton.prototype,"spacingTop",2),he([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbIconButton.prototype,"spacingBottom",2),a.ScbIconButton=he([g("scb-icon-button")],a.ScbIconButton);const Ih=Object.freeze(Object.defineProperty({__proto__:null,get ScbIconButton(){return a.ScbIconButton}},Symbol.toStringTag,{value:"Module"}));var Ph=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,zn=o=>{throw TypeError(o)},R=(o,e,t,i)=>{for(var r=i>1?void 0:i?Oh(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&Ph(e,t,r),r},Ea=(o,e,t)=>e.has(o)||zn("Cannot "+t),Br=(o,e,t)=>(Ea(o,e,"read from private field"),t?t.call(o):e.get(o)),Ci=(o,e,t)=>e.has(o)?zn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Ta=(o,e,t,i)=>(Ea(o,e,"write to private field"),e.set(o,t),t),In=(o,e,t)=>(Ea(o,e,"access private method"),t),Rr,Mr,Fr,Hr,Aa,za;a.ScbListItem=class extends y{constructor(){super(...arguments),Ci(this,Hr),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.density=0,this.noDivider=!1,Ci(this,Rr,!1),Ci(this,Mr,!1),Ci(this,Fr,!1),this.onRowClick=()=>{var i,r;if(this.type==="link"&&(this.href||this.itemHref))return;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("scb-checkbox"),t=(r=this.shadowRoot)==null?void 0:r.querySelector("scb-switch");e&&(e.checked=!e.checked),t&&(t.selected=!t.selected)},Ci(this,za,e=>{var t;if(!e.defaultPrevented&&(e.key==="Enter"||e.key===" ")){if(this.type==="link"){const i=(t=this.shadowRoot)==null?void 0:t.querySelector("a[href]");if(i){e.preventDefault(),i.click();return}}e.preventDefault(),this.onRowClick()}})}static get styles(){return m`
|
|
1938
1938
|
:host {
|
|
1939
1939
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
1940
1940
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
@@ -2373,7 +2373,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2373
2373
|
color: var(--md-sys-color-on-surface);
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
`,ct([n({type:String,attribute:"trailing-icon"})],a.ScbSearch.prototype,"trailingIcon",2),ct([n({type:String,attribute:"supporting-text"})],a.ScbSearch.prototype,"supportingText",2),ct([n({type:String})],a.ScbSearch.prototype,"value",2),ct([n({type:String,reflect:!0})],a.ScbSearch.prototype,"name",2),ct([n({type:Boolean,reflect:!0})],a.ScbSearch.prototype,"disabled",2),ct([n({type:String,reflect:!0})],a.ScbSearch.prototype,"size",2),ct([n({type:Boolean,attribute:"full-screen",reflect:!0})],a.ScbSearch.prototype,"fullScreen",2),a.ScbSearch=ct([g("scb-search")],a.ScbSearch);var Vh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Ln=o=>{throw TypeError(o)},
|
|
2376
|
+
`,ct([n({type:String,attribute:"trailing-icon"})],a.ScbSearch.prototype,"trailingIcon",2),ct([n({type:String,attribute:"supporting-text"})],a.ScbSearch.prototype,"supportingText",2),ct([n({type:String})],a.ScbSearch.prototype,"value",2),ct([n({type:String,reflect:!0})],a.ScbSearch.prototype,"name",2),ct([n({type:Boolean,reflect:!0})],a.ScbSearch.prototype,"disabled",2),ct([n({type:String,reflect:!0})],a.ScbSearch.prototype,"size",2),ct([n({type:Boolean,attribute:"full-screen",reflect:!0})],a.ScbSearch.prototype,"fullScreen",2),a.ScbSearch=ct([g("scb-search")],a.ScbSearch);var Vh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Ln=o=>{throw TypeError(o)},pe=(o,e,t,i)=>{for(var r=i>1?void 0:i?qh(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&Vh(e,t,r),r},Uh=(o,e,t)=>e.has(o)||Ln("Cannot "+t),Wh=(o,e,t)=>e.has(o)?Ln("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Dn=(o,e,t)=>(Uh(o,e,"access private method"),t),Vr,Ia;a.ScbAvatar=class extends y{constructor(){super(...arguments),Wh(this,Vr),this.src="",this.alt="",this.label="",this.size="medium",this.shape="circular",this.iconName="",this.variant="image",this.spacing="",this.spacingTop="",this.spacingBottom="",this._imgError=!1,this._hasIconSlot=!1,this._onImgLoad=()=>{this._imgError=!1,this.dispatchEvent(new CustomEvent("image-load",{bubbles:!0,composed:!0}))},this._onImgError=()=>{this._imgError=!0,this.dispatchEvent(new CustomEvent("image-error",{bubbles:!0,composed:!0}))},this._onIconSlotChange=e=>{const t=e.currentTarget;this._hasIconSlot=(t.assignedNodes({flatten:!0})||[]).length>0}}async firstUpdated(){this.variant==="icon"&&await Promise.resolve().then(()=>Le),Dn(this,Vr,Ia).call(this)}updated(e){super.updated(e),e.has("variant")&&this.variant==="icon"&&Promise.resolve().then(()=>Le),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&Dn(this,Vr,Ia).call(this)}_initials(){const e=(this.label||this.alt||"").trim();if(!e)return"?";const t=e.split(/\s+/).filter(Boolean);if(t.length===1)return t[0].slice(0,1).toUpperCase();const i=t[0].slice(0,1),r=t[t.length-1].slice(0,1);return(i+r).toUpperCase()}_ariaLabel(){const e=(this.label||this.alt||"").trim();return e||null}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}render(){const e=this._ariaLabel(),t=this.variant==="image"&&!!this.src&&!this._imgError,i=c`${u}
|
|
2377
2377
|
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
2378
2378
|
${this._hasIconSlot?u:this.iconName?c`<md-icon aria-hidden="true">${this.iconName}</md-icon>`:c`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
2379
2379
|
`,r=t?c`<img
|
|
@@ -2479,7 +2479,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2479
2479
|
outline-offset: 2px;
|
|
2480
2480
|
border-radius: var(--_radius);
|
|
2481
2481
|
}
|
|
2482
|
-
`,
|
|
2482
|
+
`,pe([n({type:String})],a.ScbAvatar.prototype,"src",2),pe([n({type:String})],a.ScbAvatar.prototype,"alt",2),pe([n({type:String})],a.ScbAvatar.prototype,"label",2),pe([n({type:String,reflect:!0})],a.ScbAvatar.prototype,"size",2),pe([n({type:String,reflect:!0})],a.ScbAvatar.prototype,"shape",2),pe([n({type:String,attribute:"icon-name",reflect:!0})],a.ScbAvatar.prototype,"iconName",2),pe([n({type:String,reflect:!0})],a.ScbAvatar.prototype,"variant",2),pe([n({type:String,reflect:!0})],a.ScbAvatar.prototype,"spacing",2),pe([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbAvatar.prototype,"spacingTop",2),pe([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbAvatar.prototype,"spacingBottom",2),pe([w()],a.ScbAvatar.prototype,"_imgError",2),pe([w()],a.ScbAvatar.prototype,"_hasIconSlot",2),a.ScbAvatar=pe([g("scb-avatar")],a.ScbAvatar);var jh=Object.defineProperty,Kh=Object.getOwnPropertyDescriptor,Ei=(o,e,t,i)=>{for(var r=i>1?void 0:i?Kh(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&jh(e,t,r),r};a.ScbAppBar=class extends y{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(r=>{r.tagName==="SCB-AVATAR"&&r.setAttribute("size","small")})}updated(e){e.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),e.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),e.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),e.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0}))}render(){switch(this.type){case"small-flexible":return c`
|
|
2483
2483
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
2484
2484
|
<div class="leading">
|
|
2485
2485
|
<slot name="leading"></slot>
|
|
@@ -2873,7 +2873,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2873
2873
|
<span class="breadcrumb-separator">/</span>
|
|
2874
2874
|
${i}`:c`${i}`):e.map(i=>i)}
|
|
2875
2875
|
</div>
|
|
2876
|
-
`}},Ur=new WeakSet,Oa=function(){const o=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??o,t=this.mapSpacingToken(this.spacingBottom)??o;e?this.style.setProperty("--scb-breadcrumb-spacing-block-start",e):this.style.removeProperty("--scb-breadcrumb-spacing-block-start"),t?this.style.setProperty("--scb-breadcrumb-spacing-block-end",t):this.style.removeProperty("--scb-breadcrumb-spacing-block-end")},Ai([n({type:Boolean,attribute:"show-all",reflect:!0})],a.SCBBreadcrumb.prototype,"showAll",2),Ai([n({type:String,reflect:!0})],a.SCBBreadcrumb.prototype,"spacing",2),Ai([n({type:String,attribute:"spacing-top",reflect:!0})],a.SCBBreadcrumb.prototype,"spacingTop",2),Ai([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.SCBBreadcrumb.prototype,"spacingBottom",2),a.SCBBreadcrumb=Ai([g("scb-breadcrumb")],a.SCBBreadcrumb);var np=Object.defineProperty,lp=Object.getOwnPropertyDescriptor,Fn=o=>{throw TypeError(o)},
|
|
2876
|
+
`}},Ur=new WeakSet,Oa=function(){const o=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??o,t=this.mapSpacingToken(this.spacingBottom)??o;e?this.style.setProperty("--scb-breadcrumb-spacing-block-start",e):this.style.removeProperty("--scb-breadcrumb-spacing-block-start"),t?this.style.setProperty("--scb-breadcrumb-spacing-block-end",t):this.style.removeProperty("--scb-breadcrumb-spacing-block-end")},Ai([n({type:Boolean,attribute:"show-all",reflect:!0})],a.SCBBreadcrumb.prototype,"showAll",2),Ai([n({type:String,reflect:!0})],a.SCBBreadcrumb.prototype,"spacing",2),Ai([n({type:String,attribute:"spacing-top",reflect:!0})],a.SCBBreadcrumb.prototype,"spacingTop",2),Ai([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.SCBBreadcrumb.prototype,"spacingBottom",2),a.SCBBreadcrumb=Ai([g("scb-breadcrumb")],a.SCBBreadcrumb);var np=Object.defineProperty,lp=Object.getOwnPropertyDescriptor,Fn=o=>{throw TypeError(o)},le=(o,e,t,i)=>{for(var r=i>1?void 0:i?lp(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&np(e,t,r),r},cp=(o,e,t)=>e.has(o)||Fn("Cannot "+t),dp=(o,e,t)=>e.has(o)?Fn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Hn=(o,e,t)=>(cp(o,e,"access private method"),t),Wr,La;a.ScbButton=class extends y{constructor(){super(...arguments),dp(this,Wr),this.variant="filled",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing="",this.spacingTop="",this.spacingBottom=""}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(e){var t;return((t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("button"))??null}__syncAriaToInner(){var v;const e=this.__getMdHost(),t=this.__getInnerNativeButton(e);if(!e||!t)return;const i=(this.getAttribute("aria-label")||"").trim(),r=(e.getAttribute("aria-label")||"").trim(),s=this.label.trim()===""?(this.icon||"").trim():"",l=i||r||s;l?t.setAttribute("aria-label",l):t.removeAttribute("aria-label");const d=this.getAttribute("aria-controls");d!==null?t.setAttribute("aria-controls",d):t.removeAttribute("aria-controls");const p=this.getAttribute("aria-expanded");p!==null?t.setAttribute("aria-expanded",p):t.removeAttribute("aria-expanded"),e.removeAttribute("aria-label"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),(v=this.__ariaObserver)==null||v.disconnect(),this.__ariaObserver=new MutationObserver(f=>{const b=this.__getMdHost(),_=this.__getInnerNativeButton(b);if(!(!b||!_)){for(const x of f){if(x.type!=="attributes"||!x.attributeName)continue;const S=x.attributeName,$=this.getAttribute(S);if(S==="aria-label"){const k=(b.getAttribute("aria-label")||"").trim(),T=($||k||(this.label.trim()===""?(this.icon||"").trim():"")).trim();T?_.setAttribute("aria-label",T):_.removeAttribute("aria-label"),b.removeAttribute("aria-label")}else(S==="aria-controls"||S==="aria-expanded")&&($===null?_.removeAttribute(S):_.setAttribute(S,$),S==="aria-expanded"&&this.removeAttribute("aria-expanded"))}b.removeAttribute("aria-label"),b.removeAttribute("aria-controls"),b.removeAttribute("aria-expanded")}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const e=this.closest("form");e&&(this.type==="submit"&&e.requestSubmit(),this.type==="reset"&&e.reset())}}),this.__syncAriaToInner(),Hn(this,Wr,La).call(this)}updated(e){e.has("variant")&&this.__syncAriaToInner(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&Hn(this,Wr,La).call(this)}disconnectedCallback(){var e;(e=this.__ariaObserver)==null||e.disconnect(),super.disconnectedCallback()}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}static get styles(){return m`
|
|
2877
2877
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
2878
2878
|
:host {
|
|
2879
2879
|
display: inline-flex;
|
|
@@ -2882,6 +2882,11 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2882
2882
|
margin-block-end: var(--scb-button-spacing-block-end, 0);
|
|
2883
2883
|
}
|
|
2884
2884
|
|
|
2885
|
+
:host([full-width]) {
|
|
2886
|
+
display: flex;
|
|
2887
|
+
inline-size: 100%;
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2885
2890
|
/* Låt inre md-knappar fylla hostens höjd */
|
|
2886
2891
|
md-filled-button,
|
|
2887
2892
|
md-outlined-button,
|
|
@@ -2890,6 +2895,14 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2890
2895
|
block-size: 100%;
|
|
2891
2896
|
}
|
|
2892
2897
|
|
|
2898
|
+
:host([full-width]) md-filled-button,
|
|
2899
|
+
:host([full-width]) md-outlined-button,
|
|
2900
|
+
:host([full-width]) md-filled-tonal-button,
|
|
2901
|
+
:host([full-width]) md-text-button {
|
|
2902
|
+
inline-size: 100%;
|
|
2903
|
+
flex: 1 1 auto;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2893
2906
|
/* Errorvarianter */
|
|
2894
2907
|
/*
|
|
2895
2908
|
md-filled-button[variant='error'],
|
|
@@ -2994,7 +3007,7 @@ var ScbWcTest=function(a){"use strict";var zl;function h(o,e,t,i){var r=argument
|
|
|
2994
3007
|
${this.label}
|
|
2995
3008
|
${e&&this.trailingIcon?t:u}
|
|
2996
3009
|
</md-text-button>
|
|
2997
|
-
`;default:return c``}}},Wr=new WeakSet,La=function(){const o=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??o,t=this.mapSpacingToken(this.spacingBottom)??o;e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),t?this.style.setProperty("--scb-button-spacing-block-end",t):this.style.removeProperty("--scb-button-spacing-block-end")},
|
|
3010
|
+
`;default:return c``}}},Wr=new WeakSet,La=function(){const o=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??o,t=this.mapSpacingToken(this.spacingBottom)??o;e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),t?this.style.setProperty("--scb-button-spacing-block-end",t):this.style.removeProperty("--scb-button-spacing-block-end")},le([n({type:String,reflect:!0})],a.ScbButton.prototype,"variant",2),le([n({type:String,reflect:!0})],a.ScbButton.prototype,"type",2),le([n({type:String})],a.ScbButton.prototype,"label",2),le([n({type:Boolean,attribute:"trailing-icon"})],a.ScbButton.prototype,"trailingIcon",2),le([n({type:String})],a.ScbButton.prototype,"icon",2),le([n({type:Boolean,reflect:!0})],a.ScbButton.prototype,"disabled",2),le([n({type:Boolean,attribute:"full-width",reflect:!0})],a.ScbButton.prototype,"fullWidth",2),le([n({type:String})],a.ScbButton.prototype,"href",2),le([n({type:String})],a.ScbButton.prototype,"target",2),le([n({type:String})],a.ScbButton.prototype,"rel",2),le([n({type:String,reflect:!0})],a.ScbButton.prototype,"spacing",2),le([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbButton.prototype,"spacingTop",2),le([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbButton.prototype,"spacingBottom",2),a.ScbButton=le([g("scb-button")],a.ScbButton);var hp=Object.defineProperty,pp=Object.getOwnPropertyDescriptor,jr=(o,e,t,i)=>{for(var r=i>1?void 0:i?pp(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&hp(e,t,r),r};a.ScbCalendarEvent=class extends y{constructor(){super(...arguments),this.title="",this.date="",this.description=""}render(){return c`
|
|
2998
3011
|
<div>
|
|
2999
3012
|
<h3>${this.title}</h3>
|
|
3000
3013
|
<p>${this.date}</p>
|
|
@@ -9019,7 +9032,7 @@ ${this.value}</textarea
|
|
|
9019
9032
|
gap: var(--spacing-3);
|
|
9020
9033
|
align-self: stretch;
|
|
9021
9034
|
}
|
|
9022
|
-
`,Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"variant",2),Fe([n({type:Boolean,reflect:!0})],a.ScbTooltip.prototype,"arrow",2),Fe([n({type:String,attribute:"supporting-text"})],a.ScbTooltip.prototype,"supportingtext",2),Fe([n({type:String})],a.ScbTooltip.prototype,"label",2),Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"trigger",2),Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"position",2),Fe([n({type:Boolean,reflect:!0})],a.ScbTooltip.prototype,"open",2),Fe([n({type:Number,reflect:!0})],a.ScbTooltip.prototype,"delay",2),Fe([n({type:Number,reflect:!0})],a.ScbTooltip.prototype,"offset",2),a.ScbTooltip=Fe([g("scb-tooltip")],a.ScbTooltip);var Yv=Object.defineProperty,Xv=Object.getOwnPropertyDescriptor,Al=o=>{throw TypeError(o)},
|
|
9035
|
+
`,Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"variant",2),Fe([n({type:Boolean,reflect:!0})],a.ScbTooltip.prototype,"arrow",2),Fe([n({type:String,attribute:"supporting-text"})],a.ScbTooltip.prototype,"supportingtext",2),Fe([n({type:String})],a.ScbTooltip.prototype,"label",2),Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"trigger",2),Fe([n({type:String,reflect:!0})],a.ScbTooltip.prototype,"position",2),Fe([n({type:Boolean,reflect:!0})],a.ScbTooltip.prototype,"open",2),Fe([n({type:Number,reflect:!0})],a.ScbTooltip.prototype,"delay",2),Fe([n({type:Number,reflect:!0})],a.ScbTooltip.prototype,"offset",2),a.ScbTooltip=Fe([g("scb-tooltip")],a.ScbTooltip);var Yv=Object.defineProperty,Xv=Object.getOwnPropertyDescriptor,Al=o=>{throw TypeError(o)},ce=(o,e,t,i)=>{for(var r=i>1?void 0:i?Xv(e,t):e,s=o.length-1,l;s>=0;s--)(l=o[s])&&(r=(i?l(e,t,r):l(r))||r);return i&&r&&Yv(e,t,r),r},Zv=(o,e,t)=>e.has(o)||Al("Cannot "+t),Jv=(o,e,t)=>e.has(o)?Al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Ki=(o,e,t)=>(Zv(o,e,"access private method"),t),Ft,us,fo;return a.ScbViz=class extends y{constructor(){super(...arguments),Jv(this,Ft),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.spacing="",this.spacingTop="",this.spacingBottom=""}get descriptionLabel(){return this.lang==="en"?"Description of the chart":"Beskrivning av diagrammet"}get moreAboutStatsLabel(){return this.lang==="en"?"More about the statistics":"Mer om statistiken"}get commentLabel(){return this.lang==="en"?"Comments":"Kommentar"}get sourceLabel(){return this.lang==="en"?"Source":"Källa"}get footnoteLabel(){return this.lang==="en"?"Footnotes":"Fotnot"}firstUpdated(e){var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector('slot[name="table"]');t&&(t.addEventListener("slotchange",()=>this._styleSlottedTable()),this._styleSlottedTable()),Ki(this,Ft,us).call(this)}updated(e){super.updated(e),this._styleSlottedTable(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&Ki(this,Ft,us).call(this)}_styleSlottedTable(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector('slot[name="table"]');if(!e)return;e.assignedElements({flatten:!0}).forEach(r=>{if(r.tagName==="TABLE"){const s=r;s.style.borderCollapse="collapse",s.style.width="100%",r.querySelectorAll("tbody tr:nth-child(odd)").forEach(l=>{l.style.background="var(--md-sys-color-surface-container)"}),r.querySelectorAll("th").forEach(l=>{const d=l;d.style.border="1px solid var(--md-sys-color-on-surface)",d.style.padding="8px"}),r.querySelectorAll("td").forEach(l=>{const d=l;d.style.border="1px solid var(--md-sys-color-on-surface)",d.style.padding="8px"}),r.querySelectorAll("tr").forEach(l=>{const d=Array.from(l.children).filter(p=>p.tagName==="TD"||p.tagName==="TH");d.length>0&&(d[0].style.borderLeft="none",d[d.length-1].style.borderRight="none")})}})}render(){switch(this.variant){case"Table":return c`
|
|
9023
9036
|
<div part="container">
|
|
9024
9037
|
<div class="header">
|
|
9025
9038
|
${this.title?c` <div class="label">${this.title}</div> `:""}
|
|
@@ -9324,4 +9337,4 @@ ${this.value}</textarea
|
|
|
9324
9337
|
:host([variant='Standard'].chip-diagram) slot[name='diagram'] {
|
|
9325
9338
|
display: block;
|
|
9326
9339
|
}
|
|
9327
|
-
`,
|
|
9340
|
+
`,ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"variant",2),ce([n({type:String})],a.ScbViz.prototype,"selectedChip",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"title",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"subtitle",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"description",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"comment",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"source",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"footnote",2),ce([n({type:String,reflect:!0,attribute:"lang"})],a.ScbViz.prototype,"lang",2),ce([n({type:String,reflect:!0,attribute:"image-href"})],a.ScbViz.prototype,"imageHref",2),ce([n({type:String,reflect:!0})],a.ScbViz.prototype,"spacing",2),ce([n({type:String,attribute:"spacing-top",reflect:!0})],a.ScbViz.prototype,"spacingTop",2),ce([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.ScbViz.prototype,"spacingBottom",2),a.ScbViz=ce([g("scb-viz")],a.ScbViz),a.ScbHeaderDrawerGroup=fl,a.ScbHeaderUtility=gl,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),a}({});
|