scb-wc-test 0.1.348 → 0.1.349
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,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as w}from"../../vendor/preload-helper.js";import{n as s,t as
|
|
2
|
+
import{_ as w}from"../../vendor/preload-helper.js";import{n as s,t as T,i as W,a as z,E as n,x as l}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 i=customElements.define.bind(customElements);customElements.define=function(e,d,c){try{customElements.get(e)||i(e,d,c)}catch(h){var o=String(h||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var C=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=t=>{throw TypeError(t)},r=(t,i,e,d)=>{for(var c=d>1?void 0:d?D(i,e):i,o=t.length-1,h;o>=0;o--)(h=t[o])&&(c=(d?h(i,e,c):h(c))||c);return d&&c&&C(i,e,c),c},V=(t,i,e)=>i.has(t)||E("Cannot "+e),u=(t,i,e)=>(V(t,i,"read from private field"),e?e.call(t):i.get(t)),g=(t,i,e)=>i.has(t)?E("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),_=(t,i,e,d)=>(V(t,i,"write to private field"),i.set(t,e),e),f=(t,i,e)=>(V(t,i,"access private method"),e),y,b,m,v,S,x,k,$;let a=class extends W{constructor(){super(...arguments),g(this,v),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.trailingSwitchLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.density=0,this.noDivider=!1,g(this,y,!1),g(this,b,!1),g(this,m,!1),this.onRowClick=()=>{if(this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),i=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),i){const e=!this.trailingSwitchSelected;i.selected=e,f(this,v,x).call(this,e,!0)}},g(this,k,t=>{const i=t.detail?.selected,e=typeof i=="boolean"?i:t.currentTarget?.selected??!1;f(this,v,x).call(this,e,!0)}),g(this,$,t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const i=this.shadowRoot?.querySelector("a[href]");if(i){t.preventDefault(),i.click();return}}t.preventDefault(),this.onRowClick()}})}static get styles(){return z`
|
|
3
3
|
:host {
|
|
4
4
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
5
5
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
@@ -88,6 +88,9 @@ import{_ as w}from"../../vendor/preload-helper.js";import{n as s,t as L,i as T,a
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
.trailing { margin-left: auto; align-self: center; display: flex; }
|
|
91
|
+
.trailing.trailing-switch {
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
}
|
|
91
94
|
.trailing scb-checkbox { margin-inline-end: var(--scb-list-trailing-checkbox-nudge); }
|
|
92
95
|
|
|
93
96
|
:host([trailing-variant="checkbox"]) .row,
|
|
@@ -106,7 +109,7 @@ import{_ as w}from"../../vendor/preload-helper.js";import{n as s,t as L,i as T,a
|
|
|
106
109
|
width: 100%;
|
|
107
110
|
gap: 12px;
|
|
108
111
|
}
|
|
109
|
-
`}async firstUpdated(){await f(this,v,
|
|
112
|
+
`}async firstUpdated(){await f(this,v,S).call(this),this.addEventListener("keydown",u(this,$))}updated(t){super.updated(t),(t.has("leading")||t.has("leadingVariant")||t.has("trailing")||t.has("trailingVariant")||t.has("type")||t.has("target"))&&f(this,v,S).call(this)}render(){const t=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?l`<div class="leading"><md-icon>${this.leadingIcon}</md-icon></div>`:n;case"avatar":return l`
|
|
110
113
|
<div class="leading">
|
|
111
114
|
<scb-avatar
|
|
112
115
|
label=${this.avatarLabel}
|
|
@@ -117,34 +120,34 @@ import{_ as w}from"../../vendor/preload-helper.js";import{n as s,t as L,i as T,a
|
|
|
117
120
|
variant=${this.avatarVariant}
|
|
118
121
|
></scb-avatar>
|
|
119
122
|
</div>
|
|
120
|
-
`;case"image":return this.imgHrefImage?
|
|
123
|
+
`;case"image":return this.imgHrefImage?l`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>`:n;default:return n}})():n,i=this.href||this.itemHref||"",e=this.target==="_blank"?"open_in_new":"chevron_right",d=this.label?`Välj ${this.label}`:"Välj",c=this.label?`Växla ${this.label}`:"Växla";let o=n;if(this.trailing){if(this.trailingVariant==="icon"){const p=this.trailingIcon||(this.type==="link"?e:"");o=p?l`<div class="trailing"><md-icon>${p}</md-icon></div>`:n}else if(this.trailingVariant==="checkbox")o=l`
|
|
121
124
|
<div class="trailing">
|
|
122
125
|
<scb-checkbox
|
|
123
126
|
aria-label=${d}
|
|
124
127
|
@click=${p=>p.stopPropagation()}
|
|
125
128
|
></scb-checkbox>
|
|
126
|
-
</div
|
|
127
|
-
<div class="trailing">
|
|
129
|
+
</div>`;else if(this.trailingVariant==="switch"){const p=this.trailingSwitchWidth?`inline-size: ${this.trailingSwitchWidth}; min-inline-size: ${this.trailingSwitchWidth};`:n;o=l`
|
|
130
|
+
<div class="trailing trailing-switch" style=${p}>
|
|
128
131
|
<scb-switch
|
|
129
132
|
.selected=${this.trailingSwitchSelected}
|
|
130
|
-
label=${this.trailingSwitchLabel||
|
|
133
|
+
label=${this.trailingSwitchLabel||n}
|
|
131
134
|
aria-label=${c}
|
|
132
|
-
@click=${
|
|
133
|
-
@change=${u(this,
|
|
135
|
+
@click=${L=>L.stopPropagation()}
|
|
136
|
+
@change=${u(this,k)}
|
|
134
137
|
></scb-switch>
|
|
135
|
-
</div>`
|
|
138
|
+
</div>`}}else this.type==="link"&&(o=l`<div class="trailing"><md-icon>${e}</md-icon></div>`);const h=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":n,I=l`
|
|
136
139
|
${t}
|
|
137
140
|
<div class="texts">
|
|
138
|
-
${this.overline?
|
|
141
|
+
${this.overline?l`<div class="overline">${this.overline}</div>`:n}
|
|
139
142
|
<div class="label">${this.label}</div>
|
|
140
|
-
${this.supportingText?
|
|
143
|
+
${this.supportingText?l`<div class="supporting-text">${this.supportingText}</div>`:n}
|
|
141
144
|
</div>
|
|
142
|
-
${
|
|
143
|
-
`;return
|
|
145
|
+
${o}
|
|
146
|
+
`;return l`
|
|
144
147
|
<div class="row" @click=${this.onRowClick} ?inert=${this.disabled} aria-disabled=${this.disabled?"true":"false"}>
|
|
145
|
-
${this.type==="link"&&i?
|
|
146
|
-
${this.type==="link"?
|
|
148
|
+
${this.type==="link"&&i?l`<a class="link" href=${i} target=${this.target||n} rel=${h}>${I}</a>`:I}
|
|
149
|
+
${this.type==="link"?l`<md-ripple></md-ripple>`:n}
|
|
147
150
|
</div>
|
|
148
151
|
|
|
149
152
|
<md-focus-ring></md-focus-ring>
|
|
150
|
-
`}};y=new WeakMap;b=new WeakMap;m=new WeakMap;v=new WeakSet;
|
|
153
|
+
`}};y=new WeakMap;b=new WeakMap;m=new WeakMap;v=new WeakSet;S=async function(){const t=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||t)&&!u(this,y)&&(await w(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),_(this,y,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!u(this,b)&&(await w(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([2,1,0,3]),import.meta.url),_(this,b,!0)),this.trailing&&this.trailingVariant==="switch"&&!u(this,m)&&(await w(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([4,1,0]),import.meta.url),_(this,m,!0))};x=function(t,i){this.trailingSwitchSelected=t,i&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:t},bubbles:!0,composed:!0}))};k=new WeakMap;$=new WeakMap;r([s({type:String,reflect:!0,attribute:"type"})],a.prototype,"type",2);r([s({type:String})],a.prototype,"href",2);r([s({type:String,attribute:"item-href"})],a.prototype,"itemHref",2);r([s({type:String,attribute:"target"})],a.prototype,"target",2);r([s({type:Boolean,attribute:"disabled"})],a.prototype,"disabled",2);r([s({type:String,reflect:!0})],a.prototype,"label",2);r([s({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);r([s({type:String,attribute:"overline"})],a.prototype,"overline",2);r([s({type:Boolean})],a.prototype,"leading",2);r([s({type:String,attribute:"leading-variant",reflect:!0})],a.prototype,"leadingVariant",2);r([s({type:String,attribute:"leading-icon"})],a.prototype,"leadingIcon",2);r([s({type:String,attribute:"avatar-label"})],a.prototype,"avatarLabel",2);r([s({type:String,attribute:"avatar-alt"})],a.prototype,"avatarAlt",2);r([s({type:String,attribute:"avatar-variant"})],a.prototype,"avatarVariant",2);r([s({type:String,attribute:"avatar-src"})],a.prototype,"avatarSrc",2);r([s({type:String,reflect:!0,attribute:"img-href-image"})],a.prototype,"imgHrefImage",2);r([s({type:Boolean})],a.prototype,"trailing",2);r([s({type:String,attribute:"trailing-variant",reflect:!0})],a.prototype,"trailingVariant",2);r([s({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);r([s({type:String,attribute:"trailing-switch-label"})],a.prototype,"trailingSwitchLabel",2);r([s({type:String,attribute:"trailing-switch-width"})],a.prototype,"trailingSwitchWidth",2);r([s({type:Boolean,attribute:"trailing-switch-selected",reflect:!0})],a.prototype,"trailingSwitchSelected",2);r([s({type:Number,reflect:!0})],a.prototype,"density",2);r([s({type:Boolean,attribute:"no-divider",reflect:!0})],a.prototype,"noDivider",2);a=r([T("scb-list-item")],a);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.349",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -414,5 +414,5 @@
|
|
|
414
414
|
},
|
|
415
415
|
"./mvc/*": "./mvc/*"
|
|
416
416
|
},
|
|
417
|
-
"buildHash": "
|
|
417
|
+
"buildHash": "8ACAE0EACE17B5D625FC0363C8E877B27149AFEA5AF1F2FB99D400E6D8D40C09"
|
|
418
418
|
}
|
|
@@ -21,6 +21,7 @@ export declare class ScbListItem extends LitElement {
|
|
|
21
21
|
trailingVariant: '' | 'icon' | 'checkbox' | 'switch';
|
|
22
22
|
trailingIcon: string;
|
|
23
23
|
trailingSwitchLabel: string;
|
|
24
|
+
trailingSwitchWidth: string;
|
|
24
25
|
trailingSwitchSelected: boolean;
|
|
25
26
|
density: -4 | -2 | 0;
|
|
26
27
|
noDivider: boolean;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as s, customElement as
|
|
1
|
+
import { LitElement as W, css as z, nothing as o, html as c } from "lit";
|
|
2
|
+
import { property as s, customElement as C } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
4
4
|
import "@material/web/ripple/ripple.js";
|
|
5
5
|
var T = Object.defineProperty, H = Object.getOwnPropertyDescriptor, I = (t) => {
|
|
6
6
|
throw TypeError(t);
|
|
7
7
|
}, r = (t, i, e, l) => {
|
|
8
|
-
for (var n = l > 1 ? void 0 : l ? H(i, e) : i,
|
|
9
|
-
(v = t[
|
|
8
|
+
for (var n = l > 1 ? void 0 : l ? H(i, e) : i, h = t.length - 1, v; h >= 0; h--)
|
|
9
|
+
(v = t[h]) && (n = (l ? v(i, e, n) : v(n)) || n);
|
|
10
10
|
return l && n && T(i, e, n), n;
|
|
11
|
-
}, _ = (t, i, e) => i.has(t) || I("Cannot " + e), y = (t, i, e) => (_(t, i, "read from private field"), e ? e.call(t) : i.get(t)),
|
|
12
|
-
let a = class extends
|
|
11
|
+
}, _ = (t, i, e) => i.has(t) || I("Cannot " + e), y = (t, i, e) => (_(t, i, "read from private field"), e ? e.call(t) : i.get(t)), p = (t, i, e) => i.has(t) ? I("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), w = (t, i, e, l) => (_(t, i, "write to private field"), i.set(t, e), e), f = (t, i, e) => (_(t, i, "access private method"), e), u, b, m, g, S, k, x, $;
|
|
12
|
+
let a = class extends W {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments),
|
|
14
|
+
super(...arguments), p(this, g), 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.trailingSwitchLabel = "", this.trailingSwitchWidth = "", this.trailingSwitchSelected = !1, this.density = 0, this.noDivider = !1, p(this, u, !1), p(this, b, !1), p(this, m, !1), this.onRowClick = () => {
|
|
15
15
|
var e, l;
|
|
16
16
|
if (this.type === "link" && (this.href || this.itemHref)) return;
|
|
17
17
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("scb-checkbox"), i = (l = this.shadowRoot) == null ? void 0 : l.querySelector("scb-switch");
|
|
18
18
|
if (t && (t.checked = !t.checked), i) {
|
|
19
19
|
const n = !this.trailingSwitchSelected;
|
|
20
|
-
i.selected = n, f(this, g,
|
|
20
|
+
i.selected = n, f(this, g, k).call(this, n, !0);
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, p(this, x, (t) => {
|
|
23
23
|
var l, n;
|
|
24
24
|
const i = (l = t.detail) == null ? void 0 : l.selected, e = typeof i == "boolean" ? i : ((n = t.currentTarget) == null ? void 0 : n.selected) ?? !1;
|
|
25
|
-
f(this, g,
|
|
26
|
-
}),
|
|
25
|
+
f(this, g, k).call(this, e, !0);
|
|
26
|
+
}), p(this, $, (t) => {
|
|
27
27
|
var i;
|
|
28
28
|
if (!t.defaultPrevented && (t.key === "Enter" || t.key === " ")) {
|
|
29
29
|
if (this.type === "link") {
|
|
@@ -38,7 +38,7 @@ let a = class extends L {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
static get styles() {
|
|
41
|
-
return
|
|
41
|
+
return z`
|
|
42
42
|
:host {
|
|
43
43
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
44
44
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
@@ -127,6 +127,9 @@ let a = class extends L {
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
.trailing { margin-left: auto; align-self: center; display: flex; }
|
|
130
|
+
.trailing.trailing-switch {
|
|
131
|
+
justify-content: flex-end;
|
|
132
|
+
}
|
|
130
133
|
.trailing scb-checkbox { margin-inline-end: var(--scb-list-trailing-checkbox-nudge); }
|
|
131
134
|
|
|
132
135
|
:host([trailing-variant="checkbox"]) .row,
|
|
@@ -148,18 +151,18 @@ let a = class extends L {
|
|
|
148
151
|
`;
|
|
149
152
|
}
|
|
150
153
|
async firstUpdated() {
|
|
151
|
-
await f(this, g,
|
|
154
|
+
await f(this, g, S).call(this), this.addEventListener("keydown", y(this, $));
|
|
152
155
|
}
|
|
153
156
|
updated(t) {
|
|
154
|
-
super.updated(t), (t.has("leading") || t.has("leadingVariant") || t.has("trailing") || t.has("trailingVariant") || t.has("type") || t.has("target")) && f(this, g,
|
|
157
|
+
super.updated(t), (t.has("leading") || t.has("leadingVariant") || t.has("trailing") || t.has("trailingVariant") || t.has("type") || t.has("target")) && f(this, g, S).call(this);
|
|
155
158
|
}
|
|
156
159
|
render() {
|
|
157
160
|
const t = this.leading ? (() => {
|
|
158
161
|
switch (this.leadingVariant) {
|
|
159
162
|
case "icon":
|
|
160
|
-
return this.leadingIcon ?
|
|
163
|
+
return this.leadingIcon ? c`<div class="leading"><md-icon>${this.leadingIcon}</md-icon></div>` : o;
|
|
161
164
|
case "avatar":
|
|
162
|
-
return
|
|
165
|
+
return c`
|
|
163
166
|
<div class="leading">
|
|
164
167
|
<scb-avatar
|
|
165
168
|
label=${this.avatarLabel}
|
|
@@ -172,46 +175,51 @@ let a = class extends L {
|
|
|
172
175
|
</div>
|
|
173
176
|
`;
|
|
174
177
|
case "image":
|
|
175
|
-
return this.imgHrefImage ?
|
|
178
|
+
return this.imgHrefImage ? c`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>` : o;
|
|
176
179
|
default:
|
|
177
|
-
return
|
|
180
|
+
return o;
|
|
178
181
|
}
|
|
179
|
-
})() :
|
|
180
|
-
let
|
|
181
|
-
if (this.trailing)
|
|
182
|
+
})() : o, i = this.href || this.itemHref || "", e = this.target === "_blank" ? "open_in_new" : "chevron_right", l = this.label ? `Välj ${this.label}` : "Välj", n = this.label ? `Växla ${this.label}` : "Växla";
|
|
183
|
+
let h = o;
|
|
184
|
+
if (this.trailing) {
|
|
182
185
|
if (this.trailingVariant === "icon") {
|
|
183
186
|
const d = this.trailingIcon || (this.type === "link" ? e : "");
|
|
184
|
-
|
|
185
|
-
} else this.trailingVariant === "checkbox"
|
|
187
|
+
h = d ? c`<div class="trailing"><md-icon>${d}</md-icon></div>` : o;
|
|
188
|
+
} else if (this.trailingVariant === "checkbox")
|
|
189
|
+
h = c`
|
|
186
190
|
<div class="trailing">
|
|
187
191
|
<scb-checkbox
|
|
188
192
|
aria-label=${l}
|
|
189
193
|
@click=${(d) => d.stopPropagation()}
|
|
190
194
|
></scb-checkbox>
|
|
191
|
-
</div
|
|
192
|
-
|
|
195
|
+
</div>`;
|
|
196
|
+
else if (this.trailingVariant === "switch") {
|
|
197
|
+
const d = this.trailingSwitchWidth ? `inline-size: ${this.trailingSwitchWidth}; min-inline-size: ${this.trailingSwitchWidth};` : o;
|
|
198
|
+
h = c`
|
|
199
|
+
<div class="trailing trailing-switch" style=${d}>
|
|
193
200
|
<scb-switch
|
|
194
201
|
.selected=${this.trailingSwitchSelected}
|
|
195
|
-
label=${this.trailingSwitchLabel ||
|
|
202
|
+
label=${this.trailingSwitchLabel || o}
|
|
196
203
|
aria-label=${n}
|
|
197
|
-
@click=${(
|
|
198
|
-
@change=${y(this,
|
|
204
|
+
@click=${(L) => L.stopPropagation()}
|
|
205
|
+
@change=${y(this, x)}
|
|
199
206
|
></scb-switch>
|
|
200
|
-
</div
|
|
201
|
-
|
|
202
|
-
|
|
207
|
+
</div>`;
|
|
208
|
+
}
|
|
209
|
+
} else this.type === "link" && (h = c`<div class="trailing"><md-icon>${e}</md-icon></div>`);
|
|
210
|
+
const v = this.type === "link" && this.target === "_blank" ? "noopener noreferrer" : o, V = c`
|
|
203
211
|
${t}
|
|
204
212
|
<div class="texts">
|
|
205
|
-
${this.overline ?
|
|
213
|
+
${this.overline ? c`<div class="overline">${this.overline}</div>` : o}
|
|
206
214
|
<div class="label">${this.label}</div>
|
|
207
|
-
${this.supportingText ?
|
|
215
|
+
${this.supportingText ? c`<div class="supporting-text">${this.supportingText}</div>` : o}
|
|
208
216
|
</div>
|
|
209
|
-
${
|
|
217
|
+
${h}
|
|
210
218
|
`;
|
|
211
|
-
return
|
|
219
|
+
return c`
|
|
212
220
|
<div class="row" @click=${this.onRowClick} ?inert=${this.disabled} aria-disabled=${this.disabled ? "true" : "false"}>
|
|
213
|
-
${this.type === "link" && i ?
|
|
214
|
-
${this.type === "link" ?
|
|
221
|
+
${this.type === "link" && i ? c`<a class="link" href=${i} target=${this.target || o} rel=${v}>${V}</a>` : V}
|
|
222
|
+
${this.type === "link" ? c`<md-ripple></md-ripple>` : o}
|
|
215
223
|
</div>
|
|
216
224
|
|
|
217
225
|
<md-focus-ring></md-focus-ring>
|
|
@@ -222,18 +230,18 @@ u = /* @__PURE__ */ new WeakMap();
|
|
|
222
230
|
b = /* @__PURE__ */ new WeakMap();
|
|
223
231
|
m = /* @__PURE__ */ new WeakMap();
|
|
224
232
|
g = /* @__PURE__ */ new WeakSet();
|
|
225
|
-
|
|
233
|
+
S = async function() {
|
|
226
234
|
const t = this.type === "link" && (!this.trailing || this.trailingVariant === "icon");
|
|
227
235
|
(this.leading && this.leadingVariant === "icon" || this.trailing && this.trailingVariant === "icon" || t) && !y(this, u) && (await import("@material/web/icon/icon.js"), w(this, u, !0)), this.trailing && this.trailingVariant === "checkbox" && !y(this, b) && (await import("../scb-checkbox/scb-checkbox.js"), w(this, b, !0)), this.trailing && this.trailingVariant === "switch" && !y(this, m) && (await import("../scb-switch/scb-switch.js"), w(this, m, !0));
|
|
228
236
|
};
|
|
229
|
-
|
|
237
|
+
k = function(t, i) {
|
|
230
238
|
this.trailingSwitchSelected = t, i && this.dispatchEvent(new CustomEvent("trailing-switch-change", {
|
|
231
239
|
detail: { selected: t },
|
|
232
240
|
bubbles: !0,
|
|
233
241
|
composed: !0
|
|
234
242
|
}));
|
|
235
243
|
};
|
|
236
|
-
|
|
244
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
237
245
|
$ = /* @__PURE__ */ new WeakMap();
|
|
238
246
|
r([
|
|
239
247
|
s({ type: String, reflect: !0, attribute: "type" })
|
|
@@ -295,6 +303,9 @@ r([
|
|
|
295
303
|
r([
|
|
296
304
|
s({ type: String, attribute: "trailing-switch-label" })
|
|
297
305
|
], a.prototype, "trailingSwitchLabel", 2);
|
|
306
|
+
r([
|
|
307
|
+
s({ type: String, attribute: "trailing-switch-width" })
|
|
308
|
+
], a.prototype, "trailingSwitchWidth", 2);
|
|
298
309
|
r([
|
|
299
310
|
s({ type: Boolean, attribute: "trailing-switch-selected", reflect: !0 })
|
|
300
311
|
], a.prototype, "trailingSwitchSelected", 2);
|
|
@@ -305,7 +316,7 @@ r([
|
|
|
305
316
|
s({ type: Boolean, attribute: "no-divider", reflect: !0 })
|
|
306
317
|
], a.prototype, "noDivider", 2);
|
|
307
318
|
a = r([
|
|
308
|
-
|
|
319
|
+
C("scb-list-item")
|
|
309
320
|
], a);
|
|
310
321
|
export {
|
|
311
322
|
a as ScbListItem
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
* @license
|
|
91
91
|
* Copyright 2018 Google LLC
|
|
92
92
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
|
-
*/const
|
|
93
|
+
*/const le=Ur(class extends Ma{constructor(e){var t;if(super(e),e.type!==Ii.ATTRIBUTE||e.name!=="class"||((t=e.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var s,r;if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in t)t[a]&&!((s=this.nt)!=null&&s.has(a))&&this.st.add(a);return this.render(t)}const i=e.element.classList;for(const a of this.st)a in t||(i.remove(a),this.st.delete(a));for(const a in t){const o=!!t[a];o===this.st.has(a)||(r=this.nt)!=null&&r.has(a)||(o?(i.add(a),this.st.add(a)):(i.remove(a),this.st.delete(a)))}return At}});/**
|
|
94
94
|
* @license
|
|
95
95
|
* Copyright 2021 Google LLC
|
|
96
96
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
* @license
|
|
99
99
|
* Copyright 2022 Google LLC
|
|
100
100
|
* SPDX-License-Identifier: Apache-2.0
|
|
101
|
-
*/const gu=450,ad=225,yu=.2,_u=10,xu=75,wu=.35,ku="::after",Su="forwards";var Qe;(function(e){e[e.INACTIVE=0]="INACTIVE",e[e.TOUCH_DELAY=1]="TOUCH_DELAY",e[e.HOLDING=2]="HOLDING",e[e.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"})(Qe||(Qe={}));const $u=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],zu=150,Cn=window.matchMedia("(forced-colors: active)");class jr extends _{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=Qe.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new sd(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return c`<div class="surface ${
|
|
101
|
+
*/const gu=450,ad=225,yu=.2,_u=10,xu=75,wu=.35,ku="::after",Su="forwards";var Qe;(function(e){e[e.INACTIVE=0]="INACTIVE",e[e.TOUCH_DELAY=1]="TOUCH_DELAY",e[e.HOLDING=2]="HOLDING",e[e.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"})(Qe||(Qe={}));const $u=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],zu=150,Cn=window.matchMedia("(forced-colors: active)");class jr extends _{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=Qe.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new sd(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return c`<div class="surface ${le(t)}"></div>`}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==Qe.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state===Qe.HOLDING){this.state=Qe.WAITING_FOR_CLICK;return}if(this.state===Qe.TOUCH_DELAY){this.state=Qe.WAITING_FOR_CLICK,this.startPressAnimation(this.rippleStartEvent);return}}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t)){this.state=Qe.WAITING_FOR_CLICK,this.startPressAnimation(t);return}this.checkBoundsAfterContextMenu&&!this.inBounds(t)||(this.checkBoundsAfterContextMenu=!1,this.state=Qe.TOUCH_DELAY,await new Promise(i=>{setTimeout(i,zu)}),this.state===Qe.TOUCH_DELAY&&(this.state=Qe.HOLDING,this.startPressAnimation(t)))}}handleClick(){if(!this.disabled){if(this.state===Qe.WAITING_FOR_CLICK){this.endPressAnimation();return}this.state===Qe.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation())}}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:t,width:i}=this.getBoundingClientRect(),s=Math.max(t,i),r=Math.max(wu*s,xu),a=Math.floor(s*yu),l=Math.sqrt(i**2+t**2)+_u;this.initialSize=a,this.rippleScale=`${(l+r)/a}`,this.rippleSize=`${a}px`}getNormalizedPointerEventCoords(t){const{scrollX:i,scrollY:s}=window,{left:r,top:a}=this.getBoundingClientRect(),o=i+r,l=s+a,{pageX:d,pageY:p}=t;return{x:d-o,y:p-l}}getTranslationCoordinates(t){const{height:i,width:s}=this.getBoundingClientRect(),r={x:(s-this.initialSize)/2,y:(i-this.initialSize)/2};let a;return t instanceof PointerEvent?a=this.getNormalizedPointerEventCoords(t):a={x:s/2,y:i/2},a={x:a.x-this.initialSize/2,y:a.y-this.initialSize/2},{startPoint:a,endPoint:r}}startPressAnimation(t){var o;if(!this.mdRoot)return;this.pressed=!0,(o=this.growAnimation)==null||o.cancel(),this.determineRippleSize();const{startPoint:i,endPoint:s}=this.getTranslationCoordinates(t),r=`${i.x}px, ${i.y}px`,a=`${s.x}px, ${s.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${r}) scale(1)`,`translate(${a}) scale(${this.rippleScale})`]},{pseudoElement:ku,duration:gu,easing:si.STANDARD,fill:Su})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=Qe.INACTIVE;const t=this.growAnimation;let i=1/0;if(typeof(t==null?void 0:t.currentTime)=="number"?i=t.currentTime:t!=null&&t.currentTime&&(i=t.currentTime.to("ms").value),i>=ad){this.pressed=!1;return}await new Promise(s=>{setTimeout(s,ad-i)}),this.growAnimation===t&&(this.pressed=!1)}shouldReactToEvent(t){if(this.disabled||!t.isPrimary||this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if(t.type==="pointerenter"||t.type==="pointerleave")return!this.isTouch(t);const i=t.buttons===1;return this.isTouch(t)||i}inBounds({x:t,y:i}){const{top:s,left:r,bottom:a,right:o}=this.getBoundingClientRect();return t>=r&&t<=o&&i>=s&&i<=a}isTouch({pointerType:t}){return t==="touch"}async handleEvent(t){if(!(Cn!=null&&Cn.matches))switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t);break}}onControlChange(t,i){for(const s of $u)t==null||t.removeEventListener(s,this),i==null||i.addEventListener(s,this)}}h([n({type:Boolean,reflect:!0})],jr.prototype,"disabled",void 0),h([C()],jr.prototype,"hovered",void 0),h([C()],jr.prototype,"pressed",void 0),h([F(".surface")],jr.prototype,"mdRoot",void 0);/**
|
|
102
102
|
* @license
|
|
103
103
|
* Copyright 2024 Google LLC
|
|
104
104
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
* @license
|
|
264
264
|
* Copyright 2019 Google LLC
|
|
265
265
|
* SPDX-License-Identifier: Apache-2.0
|
|
266
|
-
*/const Hu=Yr(Ys(ns(_)));class ri extends Hu{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",t=>{!Kr(t)||!this.input||(this.focus(),Oa(this.input))})}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,i=this.prevChecked&&!this.prevIndeterminate,s=this.prevIndeterminate,r=this.checked&&!this.indeterminate,a=this.indeterminate,o=
|
|
266
|
+
*/const Hu=Yr(Ys(ns(_)));class ri extends Hu{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",t=>{!Kr(t)||!this.input||(this.focus(),Oa(this.input))})}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,i=this.prevChecked&&!this.prevIndeterminate,s=this.prevIndeterminate,r=this.checked&&!this.indeterminate,a=this.indeterminate,o=le({disabled:this.disabled,selected:r||a,unselected:!r&&!a,checked:r,indeterminate:a,"prev-unselected":t,"prev-checked":i,"prev-indeterminate":s,"prev-disabled":this.prevDisabled}),{ariaLabel:l,ariaInvalid:d}=this;return c`
|
|
267
267
|
<div class="container ${o}">
|
|
268
268
|
<input
|
|
269
269
|
type="checkbox"
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
* Copyright 2023 Google LLC
|
|
302
302
|
* SPDX-License-Identifier: Apache-2.0
|
|
303
303
|
*/class Di extends _{constructor(){super(...arguments),this.disabled=!1,this.alwaysFocusable=!1,this.label="",this.hasIcon=!1}get rippleDisabled(){return this.disabled}focus(t){this.disabled&&!this.alwaysFocusable||super.focus(t)}render(){return c`
|
|
304
|
-
<div class="container ${
|
|
304
|
+
<div class="container ${le(this.getContainerClasses())}">
|
|
305
305
|
${this.renderContainerContent()}
|
|
306
306
|
</div>
|
|
307
307
|
`}updated(t){t.has("disabled")&&t.get("disabled")!==void 0&&this.dispatchEvent(new Event("update-focus",{bubbles:!0}))}getContainerClasses(){return{disabled:this.disabled,"has-icon":this.hasIcon}}renderContainerContent(){return c`
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
`,{ariaLabel:a}=this;return c`
|
|
520
520
|
<div class="scrim"></div>
|
|
521
521
|
<dialog
|
|
522
|
-
class=${
|
|
522
|
+
class=${le(i)}
|
|
523
523
|
aria-label=${a||m}
|
|
524
524
|
aria-labelledby=${this.hasHeadline?"headline":m}
|
|
525
525
|
role=${this.type==="alert"?"alertdialog":m}
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
* SPDX-License-Identifier: Apache-2.0
|
|
571
571
|
*/class Xs extends _{constructor(){super(...arguments),this.size="medium",this.label="",this.lowered=!1}render(){const{ariaLabel:t}=this;return c`
|
|
572
572
|
<button
|
|
573
|
-
class="fab ${
|
|
573
|
+
class="fab ${le(this.getRenderClasses())}"
|
|
574
574
|
aria-label=${t||m}>
|
|
575
575
|
<md-elevation part="elevation"></md-elevation>
|
|
576
576
|
<md-focus-ring part="focus-ring"></md-focus-ring>
|
|
@@ -620,7 +620,7 @@
|
|
|
620
620
|
* Copyright 2021 Google LLC
|
|
621
621
|
* SPDX-License-Identifier: Apache-2.0
|
|
622
622
|
*/class ce extends _{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.noAsterisk=!1,this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const t=this.count??-1,i=this.max??-1;return t<0||i<=0?"":`${t} / ${i}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(t){t.has("disabled")&&t.get("disabled")!==void 0&&(this.disableTransitions=!0),this.disabled&&this.focused&&(t.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:t.get("focused"),wasPopulated:t.get("populated")}),super.update(t)}render(){var a,o,l;const t=this.renderLabel(!0),i=this.renderLabel(!1),s=(a=this.renderOutline)==null?void 0:a.call(this,t),r={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return c`
|
|
623
|
-
<div class="field ${
|
|
623
|
+
<div class="field ${le(r)}">
|
|
624
624
|
<div class="container-overflow">
|
|
625
625
|
${(o=this.renderBackground)==null?void 0:o.call(this)} ${(l=this.renderIndicator)==null?void 0:l.call(this)} ${s}
|
|
626
626
|
<div class="container">
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
name="aria-describedby"
|
|
649
649
|
@slotchange=${this.updateSlottedAriaDescribedBy}></slot>
|
|
650
650
|
`}updateSlottedAriaDescribedBy(){for(const t of this.slottedAriaDescribedBy)kn(c`${this.supportingOrErrorText} ${this.counterText}`,t),t.setAttribute("hidden","")}renderLabel(t){if(!this.label)return m;let i;t?i=this.focused||this.populated||this.isAnimating:i=!this.focused&&!this.populated&&!this.isAnimating;const s={hidden:!i,floating:t,resting:!t},r=`${this.label}${this.required&&!this.noAsterisk?"*":""}`;return c`
|
|
651
|
-
<span class="label ${
|
|
651
|
+
<span class="label ${le(s)}" aria-hidden=${!i}
|
|
652
652
|
>${r}</span
|
|
653
653
|
>
|
|
654
654
|
`}animateLabelIfNeeded({wasFocused:t,wasPopulated:i}){var a,o,l;if(!this.label)return;t??(t=this.focused),i??(i=this.populated);const s=t||i,r=this.focused||this.populated;s!==r&&(this.isAnimating=!0,(a=this.labelAnimation)==null||a.cancel(),this.labelAnimation=(o=this.floatingLabelEl)==null?void 0:o.animate(this.getLabelKeyframes(),{duration:150,easing:si.STANDARD}),(l=this.labelAnimation)==null||l.addEventListener("finish",()=>{this.isAnimating=!1}))}getLabelKeyframes(){const{floatingLabelEl:t,restingLabelEl:i}=this;if(!t||!i)return[];const{x:s,y:r,height:a}=t.getBoundingClientRect(),{x:o,y:l,height:d}=i.getBoundingClientRect(),p=t.scrollWidth,b=i.scrollWidth,u=b/p,f=o-s,v=l-r+Math.round((d-a*u)/2),x=`translateX(${f}px) translateY(${v}px) scale(${u})`,k="translateX(0) translateY(0) scale(1)",z=i.clientWidth,S=b>z?`${z/u}px`:"";return this.focused||this.populated?[{transform:x,width:S},{transform:k,width:S}]:[{transform:k,width:S},{transform:x,width:S}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}h([n({type:Boolean})],ce.prototype,"disabled",void 0),h([n({type:Boolean})],ce.prototype,"error",void 0),h([n({type:Boolean})],ce.prototype,"focused",void 0),h([n()],ce.prototype,"label",void 0),h([n({type:Boolean,attribute:"no-asterisk"})],ce.prototype,"noAsterisk",void 0),h([n({type:Boolean})],ce.prototype,"populated",void 0),h([n({type:Boolean})],ce.prototype,"required",void 0),h([n({type:Boolean})],ce.prototype,"resizable",void 0),h([n({attribute:"supporting-text"})],ce.prototype,"supportingText",void 0),h([n({attribute:"error-text"})],ce.prototype,"errorText",void 0),h([n({type:Number})],ce.prototype,"count",void 0),h([n({type:Number})],ce.prototype,"max",void 0),h([n({type:Boolean,attribute:"has-start"})],ce.prototype,"hasStart",void 0),h([n({type:Boolean,attribute:"has-end"})],ce.prototype,"hasEnd",void 0),h([Ge({slot:"aria-describedby"})],ce.prototype,"slottedAriaDescribedBy",void 0),h([C()],ce.prototype,"isAnimating",void 0),h([C()],ce.prototype,"refreshErrorAlert",void 0),h([C()],ce.prototype,"disableTransitions",void 0),h([F(".label.floating")],ce.prototype,"floatingLabelEl",void 0),h([F(".label.resting")],ce.prototype,"restingLabelEl",void 0),h([F(".container")],ce.prototype,"containerEl",void 0);/**
|
|
@@ -727,7 +727,7 @@
|
|
|
727
727
|
* Copyright 2018 Google LLC
|
|
728
728
|
* SPDX-License-Identifier: Apache-2.0
|
|
729
729
|
*/const mb=ns(_);class Re extends mb{constructor(){super(...arguments),this.disabled=!1,this.flipIconInRtl=!1,this.href="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.type="submit",this.value="",this.flipIcon=_d(this,this.flipIconInRtl)}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get form(){return this[Fe].form}get labels(){return this[Fe].labels}willUpdate(){this.href&&(this.disabled=!1)}render(){const t=this.href?mt`div`:mt`button`,{ariaLabel:i,ariaHasPopup:s,ariaExpanded:r}=this,a=i&&this.ariaLabelSelected,o=this.toggle?this.selected:m;let l=m;return this.href||(l=a&&this.selected?this.ariaLabelSelected:i),Zr`<${t}
|
|
730
|
-
class="icon-button ${
|
|
730
|
+
class="icon-button ${le(this.getRenderClasses())}"
|
|
731
731
|
id="button"
|
|
732
732
|
aria-label="${l||m}"
|
|
733
733
|
aria-haspopup="${!this.href&&s||m}"
|
|
@@ -868,7 +868,7 @@
|
|
|
868
868
|
aria-checked=${this.ariaChecked||m}
|
|
869
869
|
aria-expanded=${this.ariaExpanded||m}
|
|
870
870
|
aria-haspopup=${this.ariaHasPopup||m}
|
|
871
|
-
class="list-item ${
|
|
871
|
+
class="list-item ${le(this.getRenderClasses())}"
|
|
872
872
|
href=${this.href||m}
|
|
873
873
|
target=${a}
|
|
874
874
|
@focus=${this.onFocus}
|
|
@@ -919,7 +919,7 @@
|
|
|
919
919
|
* SPDX-License-Identifier: Apache-2.0
|
|
920
920
|
*/const Ld=200,Id=new Set([Be.ArrowDown,Be.ArrowUp,Be.Home,Be.End]),Fb=new Set([Be.ArrowLeft,Be.ArrowRight,...Id]);function Bb(e=document){var i;let t=e.activeElement;for(;t&&((i=t==null?void 0:t.shadowRoot)!=null&&i.activeElement);)t=t.shadowRoot.activeElement;return t}class xe extends _{get openDirection(){return this.menuCorner.split("-")[0]==="start"?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(t){this.currentAnchorElement=t,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.typeaheadDelay=Ld,this.anchorCorner=to.END_START,this.menuCorner=to.START_START,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=ai.FIRST_ITEM,this.noNavigationWrap=!1,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=vu(),this.listController=new Cd({isItem:t=>t.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>getComputedStyle(this).direction==="rtl",deactivateItem:t=>{t.selected=!1,t.tabIndex=-1},activateItem:t=>{t.selected=!0,t.tabIndex=0},isNavigableKey:t=>{if(!this.isSubmenu)return Fb.has(t);const s=getComputedStyle(this).direction==="rtl"?Be.ArrowLeft:Be.ArrowRight;return t===s?!0:Id.has(t)},wrapNavigation:()=>!this.noNavigationWrap}),this.lastFocusedElement=null,this.typeaheadController=new Ob(()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive})),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new Db(this,()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:this.positioning==="popover"?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&this.positioning!=="popover"?"move":"resize"})),this.onWindowResize=()=>{this.isRepositioning||this.positioning!=="document"&&this.positioning!=="fixed"&&this.positioning!=="popover"||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async t=>{const i=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(i))return;if(t.relatedTarget){if(el(t.relatedTarget,this)||this.pointerPath.length!==0&&el(t.relatedTarget,i))return}else if(this.pointerPath.includes(this))return;const s=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=s},this.onOpened=async()=>{this.lastFocusedElement=Bb();const t=this.items,i=Js(t);i&&this.defaultFocus!==ai.NONE&&(i.item.tabIndex=-1);let s=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):s=!!await this.animateOpen(),this.defaultFocus){case ai.FIRST_ITEM:const r=Za(t);r&&(r.tabIndex=0,r.focus(),await r.updateComplete);break;case ai.LAST_ITEM:const a=kd(t);a&&(a.tabIndex=0,a.focus(),await a.updateComplete);break;case ai.LIST_ROOT:this.focus();break;default:case ai.NONE:break}s||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{var t,i;this.open=!1,this.skipRestoreFocus||(i=(t=this.lastFocusedElement)==null?void 0:t.focus)==null||i.call(t),this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=t=>{this.pointerPath=t.composedPath()},this.onDocumentClick=t=>{if(!this.open)return;const i=t.composedPath();!this.stayOpenOnOutsideClick&&!i.includes(this)&&!i.includes(this.anchorElement)&&(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(t){if(t.has("open")){if(this.open){this.removeAttribute("aria-hidden");return}this.setAttribute("aria-hidden","true")}}update(t){t.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),t.has("positioning")&&this.positioning==="popover"&&!this.showPopover&&(this.positioning="fixed"),super.update(t)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}getBoundingClientRect(){return this.surfaceEl?this.surfaceEl.getBoundingClientRect():super.getBoundingClientRect()}getClientRects(){return this.surfaceEl?this.surfaceEl.getClientRects():super.getClientRects()}render(){return this.renderSurface()}renderSurface(){return c`
|
|
921
921
|
<div
|
|
922
|
-
class="menu ${
|
|
922
|
+
class="menu ${le(this.getSurfaceClasses())}"
|
|
923
923
|
style=${Ps(this.menuPositionController.surfaceStyles)}
|
|
924
924
|
popover=${this.positioning==="popover"?"manual":m}>
|
|
925
925
|
${this.renderElevation()}
|
|
@@ -971,7 +971,7 @@
|
|
|
971
971
|
aria-checked=${this.ariaChecked||m}
|
|
972
972
|
aria-expanded=${this.ariaExpanded||m}
|
|
973
973
|
aria-haspopup=${this.ariaHasPopup||m}
|
|
974
|
-
class="list-item ${
|
|
974
|
+
class="list-item ${le(this.getRenderClasses())}"
|
|
975
975
|
href=${this.href||m}
|
|
976
976
|
target=${r}
|
|
977
977
|
@click=${this.menuItemController.onClick}
|
|
@@ -1032,7 +1032,7 @@
|
|
|
1032
1032
|
* SPDX-License-Identifier: Apache-2.0
|
|
1033
1033
|
*/class Ls extends _{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:t}=this;return c`
|
|
1034
1034
|
<div
|
|
1035
|
-
class="progress ${
|
|
1035
|
+
class="progress ${le(this.getRenderClasses())}"
|
|
1036
1036
|
role="progressbar"
|
|
1037
1037
|
aria-label="${t||m}"
|
|
1038
1038
|
aria-valuemin="0"
|
|
@@ -1107,7 +1107,7 @@
|
|
|
1107
1107
|
* Copyright 2018 Google LLC
|
|
1108
1108
|
* SPDX-License-Identifier: Apache-2.0
|
|
1109
1109
|
*/var Fd;const nl=Symbol("checked");let Kb=0;const Gb=Yr(Ys(ns(Od(_))));class Qr extends Gb{get checked(){return this[nl]}set checked(t){const i=this.checked;i!==t&&(this[nl]=t,this.requestUpdate("checked",i),this.selectionController.handleCheckedChange())}constructor(){super(),this.maskId=`cutout${++Kb}`,this[Fd]=!1,this.required=!1,this.value="on",this.selectionController=new jb(this),this.addController(this.selectionController),this[Fe].role="radio",this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeydown.bind(this))}render(){const t={checked:this.checked};return c`
|
|
1110
|
-
<div class="container ${
|
|
1110
|
+
<div class="container ${le(t)}" aria-hidden="true">
|
|
1111
1111
|
<md-ripple
|
|
1112
1112
|
part="ripple"
|
|
1113
1113
|
.control=${this}
|
|
@@ -1162,7 +1162,7 @@
|
|
|
1162
1162
|
* SPDX-License-Identifier: Apache-2.0
|
|
1163
1163
|
*/var Nd;const ho=Symbol("value"),tm=Bd(Yr(Ys(ns(_))));class Q extends tm{get value(){return this[ho]}set value(t){this.lastUserSetValue=t,this.select(t)}get options(){var t;return((t=this.menu)==null?void 0:t.items)??[]}get selectedIndex(){const[t,i]=(this.getSelectedOptions()??[])[0]??[];return i??-1}set selectedIndex(t){this.lastUserSetSelectedIndex=t,this.selectIndex(t)}get selectedOptions(){return(this.getSelectedOptions()??[]).map(([t])=>t)}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=Ld,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[Nd]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=ai.NONE,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(t){const i=this.options.find(s=>s.value===t);i&&this.selectItem(i)}selectIndex(t){const i=this.options[t];i&&this.selectItem(i)}reset(){for(const t of this.options)t.selected=t.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}[(Nd=ho,oo)](t){var s;t==null||t.preventDefault();const i=this.getErrorText();this.nativeError=!!t,this.nativeErrorText=this.validationMessage,i===this.getErrorText()&&((s=this.field)==null||s.reannounceError())}update(t){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const i=this.getBoundingClientRect();this.selectWidth=i.width}this.prevOpen=this.open,super.update(t)}render(){return c`
|
|
1164
1164
|
<span
|
|
1165
|
-
class="select ${
|
|
1165
|
+
class="select ${le(this.getRenderClasses())}"
|
|
1166
1166
|
@focusout=${this.handleFocusout}>
|
|
1167
1167
|
${this.renderField()} ${this.renderMenu()}
|
|
1168
1168
|
</span>
|
|
@@ -1300,7 +1300,7 @@
|
|
|
1300
1300
|
aria-checked=${this.ariaChecked||m}
|
|
1301
1301
|
aria-expanded=${this.ariaExpanded||m}
|
|
1302
1302
|
aria-haspopup=${this.ariaHasPopup||m}
|
|
1303
|
-
class="list-item ${
|
|
1303
|
+
class="list-item ${le(this.getRenderClasses())}"
|
|
1304
1304
|
@click=${this.selectOptionController.onClick}
|
|
1305
1305
|
@keydown=${this.selectOptionController.onKeydown}
|
|
1306
1306
|
>${t}</li
|
|
@@ -1337,13 +1337,13 @@
|
|
|
1337
1337
|
* Copyright 2023 Google LLC
|
|
1338
1338
|
* SPDX-License-Identifier: Apache-2.0
|
|
1339
1339
|
*/const dm=Ys(ns(_));class Y extends dm{get nameStart(){return this.getAttribute("name-start")??this.name}set nameStart(t){this.setAttribute("name-start",t)}get nameEnd(){return this.getAttribute("name-end")??this.nameStart}set nameEnd(t){this.setAttribute("name-end",t)}get renderAriaLabelStart(){const{ariaLabel:t}=this;return this.ariaLabelStart||t&&`${t} start`||this.valueLabelStart||String(this.valueStart)}get renderAriaValueTextStart(){return this.ariaValueTextStart||this.valueLabelStart||String(this.valueStart)}get renderAriaLabelEnd(){const{ariaLabel:t}=this;return this.range?this.ariaLabelEnd||t&&`${t} end`||this.valueLabelEnd||String(this.valueEnd):t||this.valueLabel||String(this.value)}get renderAriaValueTextEnd(){if(this.range)return this.ariaValueTextEnd||this.valueLabelEnd||String(this.valueEnd);const{ariaValueText:t}=this;return t||this.valueLabel||String(this.value)}constructor(){super(),this.min=0,this.max=100,this.valueLabel="",this.valueLabelStart="",this.valueLabelEnd="",this.ariaLabelStart="",this.ariaValueTextStart="",this.ariaLabelEnd="",this.ariaValueTextEnd="",this.step=1,this.ticks=!1,this.labeled=!1,this.range=!1,this.handleStartHover=!1,this.handleEndHover=!1,this.startOnTop=!1,this.handlesOverlapping=!1,this.ripplePointerId=1,this.isRedispatchingEvent=!1,this.addEventListener("click",t=>{!Kr(t)||!this.inputEnd||(this.focus(),Oa(this.inputEnd))})}focus(){var t;(t=this.inputEnd)==null||t.focus()}willUpdate(t){var s,r;this.renderValueStart=t.has("valueStart")?this.valueStart:(s=this.inputStart)==null?void 0:s.valueAsNumber;const i=t.has("valueEnd")&&this.range||t.has("value");this.renderValueEnd=i?this.range?this.valueEnd:this.value:(r=this.inputEnd)==null?void 0:r.valueAsNumber,t.get("handleStartHover")!==void 0?this.toggleRippleHover(this.rippleStart,this.handleStartHover):t.get("handleEndHover")!==void 0&&this.toggleRippleHover(this.rippleEnd,this.handleEndHover)}updated(t){var i,s;if(this.range&&(this.renderValueStart=this.inputStart.valueAsNumber),this.renderValueEnd=this.inputEnd.valueAsNumber,this.range){const r=(this.max-this.min)/3;if(this.valueStart===void 0){this.inputStart.valueAsNumber=this.min+r;const a=this.inputStart.valueAsNumber;this.valueStart=this.renderValueStart=a}if(this.valueEnd===void 0){this.inputEnd.valueAsNumber=this.min+2*r;const a=this.inputEnd.valueAsNumber;this.valueEnd=this.renderValueEnd=a}}else this.value??(this.value=this.renderValueEnd);if(t.has("range")||t.has("renderValueStart")||t.has("renderValueEnd")||this.isUpdatePending){const r=(i=this.handleStart)==null?void 0:i.querySelector(".handleNub"),a=(s=this.handleEnd)==null?void 0:s.querySelector(".handleNub");this.handlesOverlapping=pm(r,a)}this.performUpdate()}render(){const t=this.step===0?1:this.step,i=Math.max(this.max-this.min,t),s=this.range?((this.renderValueStart??this.min)-this.min)/i:0,r=((this.renderValueEnd??this.min)-this.min)/i,a={"--_start-fraction":String(s),"--_end-fraction":String(r),"--_tick-count":String(i/t)},o={ranged:this.range},l=this.valueLabelStart||String(this.renderValueStart),d=(this.range?this.valueLabelEnd:this.valueLabel)||String(this.renderValueEnd),p={start:!0,value:this.renderValueStart,ariaLabel:this.renderAriaLabelStart,ariaValueText:this.renderAriaValueTextStart,ariaMin:this.min,ariaMax:this.valueEnd??this.max},b={start:!1,value:this.renderValueEnd,ariaLabel:this.renderAriaLabelEnd,ariaValueText:this.renderAriaValueTextEnd,ariaMin:this.range?this.valueStart??this.min:this.min,ariaMax:this.max},u={start:!0,hover:this.handleStartHover,label:l},f={start:!1,hover:this.handleEndHover,label:d},v={hover:this.handleStartHover||this.handleEndHover};return c` <div
|
|
1340
|
-
class="container ${
|
|
1340
|
+
class="container ${le(o)}"
|
|
1341
1341
|
style=${Ps(a)}>
|
|
1342
1342
|
${ul(this.range,()=>this.renderInput(p))}
|
|
1343
1343
|
${this.renderInput(b)} ${this.renderTrack()}
|
|
1344
1344
|
<div class="handleContainerPadded">
|
|
1345
1345
|
<div class="handleContainerBlock">
|
|
1346
|
-
<div class="handleContainer ${
|
|
1346
|
+
<div class="handleContainer ${le(v)}">
|
|
1347
1347
|
${ul(this.range,()=>this.renderHandle(u))}
|
|
1348
1348
|
${this.renderHandle(f)}
|
|
1349
1349
|
</div>
|
|
@@ -1355,7 +1355,7 @@
|
|
|
1355
1355
|
`}renderLabel(t){return c`<div class="label" aria-hidden="true">
|
|
1356
1356
|
<span class="labelContent" part="label">${t}</span>
|
|
1357
1357
|
</div>`}renderHandle({start:t,hover:i,label:s}){const r=!this.disabled&&t===this.startOnTop,a=!this.disabled&&this.handlesOverlapping,o=t?"start":"end";return c`<div
|
|
1358
|
-
class="handle ${
|
|
1358
|
+
class="handle ${le({[o]:!0,hover:i,onTop:r,isOverlapping:a})}">
|
|
1359
1359
|
<md-focus-ring part="focus-ring" for=${o}></md-focus-ring>
|
|
1360
1360
|
<md-ripple
|
|
1361
1361
|
for=${o}
|
|
@@ -1367,7 +1367,7 @@
|
|
|
1367
1367
|
${ul(this.labeled,()=>this.renderLabel(s))}
|
|
1368
1368
|
</div>`}renderInput({start:t,value:i,ariaLabel:s,ariaValueText:r,ariaMin:a,ariaMax:o}){const l=t?"start":"end";return c`<input
|
|
1369
1369
|
type="range"
|
|
1370
|
-
class="${
|
|
1370
|
+
class="${le({start:t,end:!t})}"
|
|
1371
1371
|
@focus=${this.handleFocus}
|
|
1372
1372
|
@pointerdown=${this.handleDown}
|
|
1373
1373
|
@pointerup=${this.handleUp}
|
|
@@ -1406,7 +1406,7 @@
|
|
|
1406
1406
|
* Copyright 2021 Google LLC
|
|
1407
1407
|
* SPDX-License-Identifier: Apache-2.0
|
|
1408
1408
|
*/const mm=Yr(Ys(ns(_)));class Fi extends mm{constructor(){super(),this.selected=!1,this.icons=!1,this.showOnlySelectedIcon=!1,this.required=!1,this.value="on",this.addEventListener("click",t=>{!Kr(t)||!this.input||(this.focus(),Oa(this.input))}),bm(this,"keydown"),this.addEventListener("keydown",t=>{um(t,()=>{t.defaultPrevented||t.key!=="Enter"||this.disabled||!this.input||this.input.click()})})}render(){return c`
|
|
1409
|
-
<div class="switch ${
|
|
1409
|
+
<div class="switch ${le(this.getRenderClasses())}">
|
|
1410
1410
|
<input
|
|
1411
1411
|
id="switch"
|
|
1412
1412
|
class="touch"
|
|
@@ -1426,7 +1426,7 @@
|
|
|
1426
1426
|
${this.renderTouchTarget()}
|
|
1427
1427
|
<span class="handle-container">
|
|
1428
1428
|
<md-ripple for="switch" ?disabled="${this.disabled}"></md-ripple>
|
|
1429
|
-
<span class="handle ${
|
|
1429
|
+
<span class="handle ${le(t)}">
|
|
1430
1430
|
${this.shouldShowIcons()?this.renderIcons():c``}
|
|
1431
1431
|
</span>
|
|
1432
1432
|
</span>
|
|
@@ -1470,7 +1470,7 @@
|
|
|
1470
1470
|
<md-elevation part="elevation"></md-elevation>
|
|
1471
1471
|
<md-ripple .control=${this}></md-ripple>
|
|
1472
1472
|
<div
|
|
1473
|
-
class="content ${
|
|
1473
|
+
class="content ${le(this.getContentClasses())}"
|
|
1474
1474
|
role="presentation">
|
|
1475
1475
|
<slot name="icon" @slotchange=${this.handleIconSlotChange}></slot>
|
|
1476
1476
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
@@ -1554,7 +1554,7 @@
|
|
|
1554
1554
|
* Copyright 2021 Google LLC
|
|
1555
1555
|
* SPDX-License-Identifier: Apache-2.0
|
|
1556
1556
|
*/const Am=Bd(Yr(Ys(ns(_))));class H extends Am{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(t){this.getInputOrTextarea().selectionDirection=t}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(t){this.getInputOrTextarea().selectionEnd=t}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(t){this.getInputOrTextarea().selectionStart=t}get valueAsNumber(){const t=this.getInput();return t?t.valueAsNumber:NaN}set valueAsNumber(t){const i=this.getInput();i&&(i.valueAsNumber=t,this.value=i.value)}get valueAsDate(){const t=this.getInput();return t?t.valueAsDate:null}set valueAsDate(t){const i=this.getInput();i&&(i.valueAsDate=t,this.value=i.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(...t){this.getInputOrTextarea().setRangeText(...t),this.value=this.getInputOrTextarea().value}setSelectionRange(t,i,s){this.getInputOrTextarea().setSelectionRange(t,i,s)}stepDown(t){const i=this.getInput();i&&(i.stepDown(t),this.value=i.value)}stepUp(t){const i=this.getInput();i&&(i.stepUp(t),this.value=i.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(t,i,s){t==="value"&&this.dirty||super.attributeChangedCallback(t,i,s)}render(){const t={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:this.type==="textarea","no-spinner":this.noSpinner};return c`
|
|
1557
|
-
<span class="text-field ${
|
|
1557
|
+
<span class="text-field ${le(t)}">
|
|
1558
1558
|
${this.renderField()}
|
|
1559
1559
|
</span>
|
|
1560
1560
|
`}updated(t){const i=this.getInputOrTextarea().value;this.value!==i&&(this.value=i)}renderField(){return Zr`<${this.fieldTag}
|
|
@@ -1641,7 +1641,7 @@
|
|
|
1641
1641
|
@select=${this.redispatchEvent} />
|
|
1642
1642
|
${l}
|
|
1643
1643
|
</div>
|
|
1644
|
-
`}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(t,i){return t?c`<span class="${
|
|
1644
|
+
`}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(t,i){return t?c`<span class="${le({suffix:i,prefix:!i})}">${t}</span>`:m}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){var t;this.focused=((t=this.inputOrTextarea)==null?void 0:t.matches(":focus"))??!1}handleInput(t){this.dirty=!0,this.value=t.target.value}redispatchEvent(t){ls(this,t)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return this.type==="textarea"?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[Ri](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(t){this.value=t}focus(){this.getInputOrTextarea().focus()}[Cs](){return new Tm(()=>({state:this,renderedControl:this.inputOrTextarea}))}[Es](){return this.inputOrTextarea}[oo](t){var s;t==null||t.preventDefault();const i=this.getErrorText();this.nativeError=!!t,this.nativeErrorText=this.validationMessage,i===this.getErrorText()&&((s=this.field)==null||s.reannounceError())}}bt(H),H.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},h([n({type:Boolean,reflect:!0})],H.prototype,"error",void 0),h([n({attribute:"error-text"})],H.prototype,"errorText",void 0),h([n()],H.prototype,"label",void 0),h([n({type:Boolean,attribute:"no-asterisk"})],H.prototype,"noAsterisk",void 0),h([n({type:Boolean,reflect:!0})],H.prototype,"required",void 0),h([n()],H.prototype,"value",void 0),h([n({attribute:"prefix-text"})],H.prototype,"prefixText",void 0),h([n({attribute:"suffix-text"})],H.prototype,"suffixText",void 0),h([n({type:Boolean,attribute:"has-leading-icon"})],H.prototype,"hasLeadingIcon",void 0),h([n({type:Boolean,attribute:"has-trailing-icon"})],H.prototype,"hasTrailingIcon",void 0),h([n({attribute:"supporting-text"})],H.prototype,"supportingText",void 0),h([n({attribute:"text-direction"})],H.prototype,"textDirection",void 0),h([n({type:Number})],H.prototype,"rows",void 0),h([n({type:Number})],H.prototype,"cols",void 0),h([n({reflect:!0})],H.prototype,"inputMode",void 0),h([n()],H.prototype,"max",void 0),h([n({type:Number})],H.prototype,"maxLength",void 0),h([n()],H.prototype,"min",void 0),h([n({type:Number})],H.prototype,"minLength",void 0),h([n({type:Boolean,attribute:"no-spinner"})],H.prototype,"noSpinner",void 0),h([n()],H.prototype,"pattern",void 0),h([n({reflect:!0,converter:Em})],H.prototype,"placeholder",void 0),h([n({type:Boolean,reflect:!0})],H.prototype,"readOnly",void 0),h([n({type:Boolean,reflect:!0})],H.prototype,"multiple",void 0),h([n()],H.prototype,"step",void 0),h([n({reflect:!0})],H.prototype,"type",void 0),h([n({reflect:!0})],H.prototype,"autocomplete",void 0),h([C()],H.prototype,"dirty",void 0),h([C()],H.prototype,"focused",void 0),h([C()],H.prototype,"nativeError",void 0),h([C()],H.prototype,"nativeErrorText",void 0),h([F(".input")],H.prototype,"inputOrTextarea",void 0),h([F(".field")],H.prototype,"field",void 0),h([Ge({slot:"leading-icon"})],H.prototype,"leadingIcons",void 0),h([Ge({slot:"trailing-icon"})],H.prototype,"trailingIcons",void 0);/**
|
|
1645
1645
|
* @license
|
|
1646
1646
|
* Copyright 2021 Google LLC
|
|
1647
1647
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -2476,7 +2476,7 @@
|
|
|
2476
2476
|
md-filled-tonal-icon-button::part(button) {
|
|
2477
2477
|
border-radius: var(--scb-icon-button-shape-radius) !important;
|
|
2478
2478
|
}
|
|
2479
|
-
`,ye([n({type:String})],de.prototype,"icon",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"filled",1),ye([n({type:Boolean,attribute:"icon-filled",reflect:!0})],de.prototype,"iconFilled",1),ye([n({type:String,attribute:"aria-label"})],de.prototype,"ariaLabel",2),ye([n({type:String})],de.prototype,"variant",2),ye([n({type:String,reflect:!0})],de.prototype,"size",2),ye([n({type:String,reflect:!0})],de.prototype,"shape",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"toggle",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"selected",2),ye([n({type:String})],de.prototype,"toggleofficon",2),ye([n({type:String})],de.prototype,"toggleonicon",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"disabled",2),ye([n({type:String,reflect:!0})],de.prototype,"spacing",2),ye([n({type:String,attribute:"spacing-top",reflect:!0})],de.prototype,"spacingTop",2),ye([n({type:String,attribute:"spacing-bottom",reflect:!0})],de.prototype,"spacingBottom",2),ye([n({type:String,attribute:"spacing-left",reflect:!0})],de.prototype,"spacingLeft",2),ye([n({type:String,attribute:"spacing-right",reflect:!0})],de.prototype,"spacingRight",2),ye([n({type:String})],de.prototype,"href",2),ye([n({type:String})],de.prototype,"target",2),ye([n({type:String})],de.prototype,"rel",2),de=ye([y("scb-icon-button")],de);var Xm=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,ap=e=>{throw TypeError(e)},
|
|
2479
|
+
`,ye([n({type:String})],de.prototype,"icon",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"filled",1),ye([n({type:Boolean,attribute:"icon-filled",reflect:!0})],de.prototype,"iconFilled",1),ye([n({type:String,attribute:"aria-label"})],de.prototype,"ariaLabel",2),ye([n({type:String})],de.prototype,"variant",2),ye([n({type:String,reflect:!0})],de.prototype,"size",2),ye([n({type:String,reflect:!0})],de.prototype,"shape",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"toggle",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"selected",2),ye([n({type:String})],de.prototype,"toggleofficon",2),ye([n({type:String})],de.prototype,"toggleonicon",2),ye([n({type:Boolean,reflect:!0})],de.prototype,"disabled",2),ye([n({type:String,reflect:!0})],de.prototype,"spacing",2),ye([n({type:String,attribute:"spacing-top",reflect:!0})],de.prototype,"spacingTop",2),ye([n({type:String,attribute:"spacing-bottom",reflect:!0})],de.prototype,"spacingBottom",2),ye([n({type:String,attribute:"spacing-left",reflect:!0})],de.prototype,"spacingLeft",2),ye([n({type:String,attribute:"spacing-right",reflect:!0})],de.prototype,"spacingRight",2),ye([n({type:String})],de.prototype,"href",2),ye([n({type:String})],de.prototype,"target",2),ye([n({type:String})],de.prototype,"rel",2),de=ye([y("scb-icon-button")],de);var Xm=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,ap=e=>{throw TypeError(e)},oe=(e,t,i,s)=>{for(var r=s>1?void 0:s?Jm(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Xm(t,i,r),r},kl=(e,t,i)=>t.has(e)||ap("Cannot "+i),aa=(e,t,i)=>(kl(e,t,"read from private field"),i?i.call(e):t.get(e)),tr=(e,t,i)=>t.has(e)?ap("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Sl=(e,t,i,s)=>(kl(e,t,"write to private field"),t.set(e,i),i),fo=(e,t,i)=>(kl(e,t,"access private method"),i),vo,go,yo,ir,$l,zl,Cl,El;let se=class extends _{constructor(){super(...arguments),tr(this,ir),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.trailingSwitchLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.density=0,this.noDivider=!1,tr(this,vo,!1),tr(this,go,!1),tr(this,yo,!1),this.onRowClick=()=>{var i,s;if(this.type==="link"&&(this.href||this.itemHref))return;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("scb-checkbox"),t=(s=this.shadowRoot)==null?void 0:s.querySelector("scb-switch");if(e&&(e.checked=!e.checked),t){const r=!this.trailingSwitchSelected;t.selected=r,fo(this,ir,zl).call(this,r,!0)}},tr(this,Cl,e=>{var s,r;const t=(s=e.detail)==null?void 0:s.selected,i=typeof t=="boolean"?t:((r=e.currentTarget)==null?void 0:r.selected)??!1;fo(this,ir,zl).call(this,i,!0)}),tr(this,El,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 g`
|
|
2480
2480
|
:host {
|
|
2481
2481
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
2482
2482
|
margin-bottom: calc(var(--stroke-border, 1px) * -1);
|
|
@@ -2565,6 +2565,9 @@
|
|
|
2565
2565
|
|
|
2566
2566
|
|
|
2567
2567
|
.trailing { margin-left: auto; align-self: center; display: flex; }
|
|
2568
|
+
.trailing.trailing-switch {
|
|
2569
|
+
justify-content: flex-end;
|
|
2570
|
+
}
|
|
2568
2571
|
.trailing scb-checkbox { margin-inline-end: var(--scb-list-trailing-checkbox-nudge); }
|
|
2569
2572
|
|
|
2570
2573
|
:host([trailing-variant="checkbox"]) .row,
|
|
@@ -2594,22 +2597,22 @@
|
|
|
2594
2597
|
variant=${this.avatarVariant}
|
|
2595
2598
|
></scb-avatar>
|
|
2596
2599
|
</div>
|
|
2597
|
-
`;case"image":return this.imgHrefImage?c`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>`:m;default:return m}})():m,t=this.href||this.itemHref||"",i=this.target==="_blank"?"open_in_new":"chevron_right",s=this.label?`Välj ${this.label}`:"Välj",r=this.label?`Växla ${this.label}`:"Växla";let a=m;if(this.trailing)if(this.trailingVariant==="icon"){const d=this.trailingIcon||(this.type==="link"?i:"");a=d?c`<div class="trailing"><md-icon>${d}</md-icon></div>`:m}else this.trailingVariant==="checkbox"
|
|
2600
|
+
`;case"image":return this.imgHrefImage?c`<div class="leading"><img class="img" part="leading-image" src="${this.imgHrefImage}" alt="" /></div>`:m;default:return m}})():m,t=this.href||this.itemHref||"",i=this.target==="_blank"?"open_in_new":"chevron_right",s=this.label?`Välj ${this.label}`:"Välj",r=this.label?`Växla ${this.label}`:"Växla";let a=m;if(this.trailing){if(this.trailingVariant==="icon"){const d=this.trailingIcon||(this.type==="link"?i:"");a=d?c`<div class="trailing"><md-icon>${d}</md-icon></div>`:m}else if(this.trailingVariant==="checkbox")a=c`
|
|
2598
2601
|
<div class="trailing">
|
|
2599
2602
|
<scb-checkbox
|
|
2600
2603
|
aria-label=${s}
|
|
2601
2604
|
@click=${d=>d.stopPropagation()}
|
|
2602
2605
|
></scb-checkbox>
|
|
2603
|
-
</div
|
|
2604
|
-
<div class="trailing">
|
|
2606
|
+
</div>`;else if(this.trailingVariant==="switch"){const d=this.trailingSwitchWidth?`inline-size: ${this.trailingSwitchWidth}; min-inline-size: ${this.trailingSwitchWidth};`:m;a=c`
|
|
2607
|
+
<div class="trailing trailing-switch" style=${d}>
|
|
2605
2608
|
<scb-switch
|
|
2606
2609
|
.selected=${this.trailingSwitchSelected}
|
|
2607
2610
|
label=${this.trailingSwitchLabel||m}
|
|
2608
2611
|
aria-label=${r}
|
|
2609
|
-
@click=${
|
|
2612
|
+
@click=${p=>p.stopPropagation()}
|
|
2610
2613
|
@change=${aa(this,Cl)}
|
|
2611
2614
|
></scb-switch>
|
|
2612
|
-
</div>`
|
|
2615
|
+
</div>`}}else this.type==="link"&&(a=c`<div class="trailing"><md-icon>${i}</md-icon></div>`);const o=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":m,l=c`
|
|
2613
2616
|
${e}
|
|
2614
2617
|
<div class="texts">
|
|
2615
2618
|
${this.overline?c`<div class="overline">${this.overline}</div>`:m}
|
|
@@ -2624,7 +2627,7 @@
|
|
|
2624
2627
|
</div>
|
|
2625
2628
|
|
|
2626
2629
|
<md-focus-ring></md-focus-ring>
|
|
2627
|
-
`}};vo=new WeakMap,go=new WeakMap,yo=new WeakMap,ir=new WeakSet,$l=async function(){const e=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||e)&&!aa(this,vo)&&(await Promise.resolve().then(()=>yi),Sl(this,vo,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!aa(this,go)&&(await Promise.resolve().then(()=>Wf),Sl(this,go,!0)),this.trailing&&this.trailingVariant==="switch"&&!aa(this,yo)&&(await Promise.resolve().then(()=>tv),Sl(this,yo,!0))},zl=function(e,t){this.trailingSwitchSelected=e,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:e},bubbles:!0,composed:!0}))},Cl=new WeakMap,El=new WeakMap,
|
|
2630
|
+
`}};vo=new WeakMap,go=new WeakMap,yo=new WeakMap,ir=new WeakSet,$l=async function(){const e=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||e)&&!aa(this,vo)&&(await Promise.resolve().then(()=>yi),Sl(this,vo,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!aa(this,go)&&(await Promise.resolve().then(()=>Wf),Sl(this,go,!0)),this.trailing&&this.trailingVariant==="switch"&&!aa(this,yo)&&(await Promise.resolve().then(()=>tv),Sl(this,yo,!0))},zl=function(e,t){this.trailingSwitchSelected=e,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:e},bubbles:!0,composed:!0}))},Cl=new WeakMap,El=new WeakMap,oe([n({type:String,reflect:!0,attribute:"type"})],se.prototype,"type",2),oe([n({type:String})],se.prototype,"href",2),oe([n({type:String,attribute:"item-href"})],se.prototype,"itemHref",2),oe([n({type:String,attribute:"target"})],se.prototype,"target",2),oe([n({type:Boolean,attribute:"disabled"})],se.prototype,"disabled",2),oe([n({type:String,reflect:!0})],se.prototype,"label",2),oe([n({type:String,attribute:"supporting-text"})],se.prototype,"supportingText",2),oe([n({type:String,attribute:"overline"})],se.prototype,"overline",2),oe([n({type:Boolean})],se.prototype,"leading",2),oe([n({type:String,attribute:"leading-variant",reflect:!0})],se.prototype,"leadingVariant",2),oe([n({type:String,attribute:"leading-icon"})],se.prototype,"leadingIcon",2),oe([n({type:String,attribute:"avatar-label"})],se.prototype,"avatarLabel",2),oe([n({type:String,attribute:"avatar-alt"})],se.prototype,"avatarAlt",2),oe([n({type:String,attribute:"avatar-variant"})],se.prototype,"avatarVariant",2),oe([n({type:String,attribute:"avatar-src"})],se.prototype,"avatarSrc",2),oe([n({type:String,reflect:!0,attribute:"img-href-image"})],se.prototype,"imgHrefImage",2),oe([n({type:Boolean})],se.prototype,"trailing",2),oe([n({type:String,attribute:"trailing-variant",reflect:!0})],se.prototype,"trailingVariant",2),oe([n({type:String,attribute:"trailing-icon"})],se.prototype,"trailingIcon",2),oe([n({type:String,attribute:"trailing-switch-label"})],se.prototype,"trailingSwitchLabel",2),oe([n({type:String,attribute:"trailing-switch-width"})],se.prototype,"trailingSwitchWidth",2),oe([n({type:Boolean,attribute:"trailing-switch-selected",reflect:!0})],se.prototype,"trailingSwitchSelected",2),oe([n({type:Number,reflect:!0})],se.prototype,"density",2),oe([n({type:Boolean,attribute:"no-divider",reflect:!0})],se.prototype,"noDivider",2),se=oe([y("scb-list-item")],se);var Zm=Object.defineProperty,Qm=Object.getOwnPropertyDescriptor,op=e=>{throw TypeError(e)},ps=(e,t,i,s)=>{for(var r=s>1?void 0:s?Qm(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Zm(t,i,r),r},np=(e,t,i)=>t.has(e)||op("Cannot "+i),ef=(e,t,i)=>(np(e,t,"read from private field"),t.get(e)),tf=(e,t,i)=>t.has(e)?op("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),sf=(e,t,i,s)=>(np(e,t,"write to private field"),t.set(e,i),i),_o;let wi=class extends _{constructor(){super(...arguments),tf(this,_o,!1),this.noDivider=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onSlotChange=()=>this._setupItems()}async firstUpdated(){ef(this,_o)||(await Promise.resolve().then(()=>Eb),sf(this,_o,!0)),this._setupItems(),this._applySpacing()}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this._applySpacing()}_getItems(){var t;return(((t=this._slotEl)==null?void 0:t.assignedElements({flatten:!0}))??[]).filter(i=>i instanceof HTMLElement)}_setupItems(){var i;this._getItems().forEach((s,r)=>{s.hasAttribute("role")||s.setAttribute("role","listitem"),s.setAttribute("tabindex",r===0?"0":"-1")});const t=(i=this.renderRoot)==null?void 0:i.querySelector("md-list");t&&!t.hasAttribute("data-kbd")&&(t.setAttribute("data-kbd","true"),t.addEventListener("keydown",s=>this._onKeyDown(s)))}_onKeyDown(e){const t=this._getItems();if(!t.length)return;const i=t.findIndex(r=>r.getAttribute("tabindex")==="0"),s=r=>{const a=(r%t.length+t.length)%t.length;t.forEach(l=>l.setAttribute("tabindex","-1"));const o=t[a];o.setAttribute("tabindex","0"),o.focus()};switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),s(i<0?0:i+1);break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),s(i<0?0:i-1);break;case"Home":e.preventDefault(),s(0);break;case"End":e.preventDefault(),s(t.length-1);break}}_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}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,i=this._mapSpacingToken(this.spacingBottom)??e,s=this._mapSpacingToken(this.spacingLeft),r=this._mapSpacingToken(this.spacingRight);t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),i?this.style.marginBlockEnd=i:this.style.removeProperty("margin-block-end"),s?this.style.marginInlineStart=s:this.style.removeProperty("margin-inline-start"),r?this.style.marginInlineEnd=r:this.style.removeProperty("margin-inline-end")}render(){return c`
|
|
2628
2631
|
<md-list role="list" @slotchange=${this._onSlotChange}>
|
|
2629
2632
|
<slot></slot>
|
|
2630
2633
|
</md-list>
|
|
@@ -4911,7 +4914,7 @@
|
|
|
4911
4914
|
color: var(--md-sys-color-on-surface);
|
|
4912
4915
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
4913
4916
|
} */
|
|
4914
|
-
`,Ee([n({type:String,reflect:!0})],ge.prototype,"variant",2),Ee([n({type:String})],ge.prototype,"label",2),Ee([n({type:String})],ge.prototype,"icon",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"disabled",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"elevated",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"removable",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"selected",2),Ee([n({type:Boolean,reflect:!0,attribute:"disable-toggle"})],ge.prototype,"disableToggle",2),Ee([n({type:String})],ge.prototype,"href",2),Ee([n({type:String})],ge.prototype,"target",2),Ee([n({type:String})],ge.prototype,"name",2),Ee([n({type:String})],ge.prototype,"value",2),Ee([n({type:String,reflect:!0})],ge.prototype,"spacing",2),Ee([n({type:String,reflect:!0,attribute:"spacing-top"})],ge.prototype,"spacingTop",2),Ee([n({type:String,reflect:!0,attribute:"spacing-bottom"})],ge.prototype,"spacingBottom",2),Ee([n({type:String,reflect:!0,attribute:"spacing-left"})],ge.prototype,"spacingLeft",2),Ee([n({type:String,reflect:!0,attribute:"spacing-right"})],ge.prototype,"spacingRight",2),Ee([n({type:String,reflect:!0})],ge.prototype,"size",2),ge=Ee([y("scb-chip")],ge);var ov=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,se=(e,t,i,s)=>{for(var r=s>1?void 0:s?nv(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&ov(t,i,r),r};let ee=class extends _{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=e=>{this.__getActionFromEvent(e)==="toggle"&&(this.__setOpen(!this.open),e.stopPropagation())},this.__onDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{var i,s,r;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("form");e instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(e),e.reset()),(((r=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"))==null?void 0:r.assignedElements({flatten:!0}))??[]).forEach(a=>{const o=a.tagName;o==="SCB-TEXTFIELD"&&(a.value=""),o==="SCB-CHECKBOX"&&(a.checked=!1),o==="SCB-RADIO-BUTTON"&&(a.checked=!1),o==="SCB-SWITCH"&&(a.selected=!1),o==="SCB-CHIP"&&(a.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("form");if(e instanceof HTMLFormElement){if(this.__syncSlottedFormValues(e),!this.__validateFormAndSlottedFields(e))return;e.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=e=>{if(!this.open||e.key!=="Tab")return;const t=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!t.length)return;const i=t[0],s=t[t.length-1];e.shiftKey&&document.activeElement===i?(s.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===s&&(i.focus(),e.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}__applyZIndex(){const e=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__applyMaxSize(){const e=(this.maxW??"").trim(),t=(this.maxH??"").trim();e?(this.style.setProperty("--scb-dialog-max-w",e),this.style.setProperty("--scb-dialog-width",`min(${e}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),t?this.style.setProperty("--scb-dialog-max-h",t):this.style.removeProperty("--scb-dialog-max-h")}updated(e){var t,i;if(e.has("zIndex")&&this.__applyZIndex(),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const s=e.get("open");this.__updateTriggersExpanded(),this.open&&!s?this.updateComplete.then(()=>{var a,o,l;const r=(a=this.shadowRoot)==null?void 0:a.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');r?r.focus():(l=(o=this.shadowRoot)==null?void 0:o.querySelector(".container"))==null||l.focus()}):!this.open&&s&&((i=(t=this.__lastTriggerEl)==null?void 0:t.focus)==null||i.call(t)),this.__toggleScrollLock(this.open)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute("aria-controls")&&e.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(e){if(this.inSb)return;const t=document.documentElement,i=document.body;if(e){const s=window.innerWidth-t.clientWidth;t.style.overflow="hidden",i.style.paddingRight=s>0?`${s}px`:"";return}t.style.overflow="",i.style.paddingRight=""}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}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,s=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),s?this.style.setProperty("--scb-dialog-spacing-inline-start",s):this.style.removeProperty("--scb-dialog-spacing-inline-start"),r?this.style.setProperty("--scb-dialog-spacing-inline-end",r):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(e){this.open=e,this.__fire(e?"open":"close")}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__getSlottedElements(){var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const r of t)i.push(r,...Array.from(r.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const s=document.createElement("input");s.type="hidden",s.name=t,s.value=i,s.setAttribute("data-scb-dialog-generated","true"),e.append(s)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(i=>{if(!(i instanceof HTMLElement))return;const s=(i.getAttribute("name")??"").trim();if(!(!s||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement){if(i.form===e)return;const a=(i.type||"").toLowerCase();if(a==="checkbox"||a==="radio"){i.checked&&this.__appendHiddenFormValue(e,s,i.value||"on");return}this.__appendHiddenFormValue(e,s,i.value??"");return}if(i instanceof HTMLTextAreaElement){if(i.form===e)return;this.__appendHiddenFormValue(e,s,i.value??"");return}if(i instanceof HTMLSelectElement){if(i.form===e)return;if(i.multiple){Array.from(i.selectedOptions).forEach(a=>{this.__appendHiddenFormValue(e,s,a.value)});return}this.__appendHiddenFormValue(e,s,i.value??"");return}switch(i.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(e,s,String(i.value??""));return;case"SCB-CHECKBOX":i.checked&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":i.checked&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-SWITCH":(i.selected||i.checked)&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-CHIP":i.selected&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;default:"value"in i&&this.__appendHiddenFormValue(e,s,String(i.value??""))}}})}__validateFormAndSlottedFields(e){const t=o=>o.disabled===!0||o.hasAttribute("disabled");let i=e.reportValidity(),s=null;const r=new Set;return this.__getSlottedElements().forEach(o=>{if(!(o instanceof HTMLElement)||r.has(o)||t(o))return;r.add(o);const l=o;if(o.tagName==="SCB-TEXTFIELD"&&l.error===!0){s||(s=o),i=!1;return}if(typeof l.reportValidity=="function"){const d=!!l.reportValidity();!d&&!s&&(s=o),i=i&&d}}),!i&&s&&s.focus(),i}__slotIsEmpty(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return c`
|
|
4917
|
+
`,Ee([n({type:String,reflect:!0})],ge.prototype,"variant",2),Ee([n({type:String})],ge.prototype,"label",2),Ee([n({type:String})],ge.prototype,"icon",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"disabled",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"elevated",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"removable",2),Ee([n({type:Boolean,reflect:!0})],ge.prototype,"selected",2),Ee([n({type:Boolean,reflect:!0,attribute:"disable-toggle"})],ge.prototype,"disableToggle",2),Ee([n({type:String})],ge.prototype,"href",2),Ee([n({type:String})],ge.prototype,"target",2),Ee([n({type:String})],ge.prototype,"name",2),Ee([n({type:String})],ge.prototype,"value",2),Ee([n({type:String,reflect:!0})],ge.prototype,"spacing",2),Ee([n({type:String,reflect:!0,attribute:"spacing-top"})],ge.prototype,"spacingTop",2),Ee([n({type:String,reflect:!0,attribute:"spacing-bottom"})],ge.prototype,"spacingBottom",2),Ee([n({type:String,reflect:!0,attribute:"spacing-left"})],ge.prototype,"spacingLeft",2),Ee([n({type:String,reflect:!0,attribute:"spacing-right"})],ge.prototype,"spacingRight",2),Ee([n({type:String,reflect:!0})],ge.prototype,"size",2),ge=Ee([y("scb-chip")],ge);var ov=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,re=(e,t,i,s)=>{for(var r=s>1?void 0:s?nv(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&ov(t,i,r),r};let ee=class extends _{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=e=>{this.__getActionFromEvent(e)==="toggle"&&(this.__setOpen(!this.open),e.stopPropagation())},this.__onDocumentKeydown=e=>{this.open&&e.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{var i,s,r;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("form");e instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(e),e.reset()),(((r=(s=this.shadowRoot)==null?void 0:s.querySelector("slot"))==null?void 0:r.assignedElements({flatten:!0}))??[]).forEach(a=>{const o=a.tagName;o==="SCB-TEXTFIELD"&&(a.value=""),o==="SCB-CHECKBOX"&&(a.checked=!1),o==="SCB-RADIO-BUTTON"&&(a.checked=!1),o==="SCB-SWITCH"&&(a.selected=!1),o==="SCB-CHIP"&&(a.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("form");if(e instanceof HTMLFormElement){if(this.__syncSlottedFormValues(e),!this.__validateFormAndSlottedFields(e))return;e.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=e=>{if(!this.open||e.key!=="Tab")return;const t=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!t.length)return;const i=t[0],s=t[t.length-1];e.shiftKey&&document.activeElement===i?(s.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===s&&(i.focus(),e.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}__applyZIndex(){const e=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__applyMaxSize(){const e=(this.maxW??"").trim(),t=(this.maxH??"").trim();e?(this.style.setProperty("--scb-dialog-max-w",e),this.style.setProperty("--scb-dialog-width",`min(${e}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),t?this.style.setProperty("--scb-dialog-max-h",t):this.style.removeProperty("--scb-dialog-max-h")}updated(e){var t,i;if(e.has("zIndex")&&this.__applyZIndex(),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const s=e.get("open");this.__updateTriggersExpanded(),this.open&&!s?this.updateComplete.then(()=>{var a,o,l;const r=(a=this.shadowRoot)==null?void 0:a.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');r?r.focus():(l=(o=this.shadowRoot)==null?void 0:o.querySelector(".container"))==null||l.focus()}):!this.open&&s&&((i=(t=this.__lastTriggerEl)==null?void 0:t.focus)==null||i.call(t)),this.__toggleScrollLock(this.open)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute("aria-controls")&&e.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(e){if(this.inSb)return;const t=document.documentElement,i=document.body;if(e){const s=window.innerWidth-t.clientWidth;t.style.overflow="hidden",i.style.paddingRight=s>0?`${s}px`:"";return}t.style.overflow="",i.style.paddingRight=""}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}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,s=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),s?this.style.setProperty("--scb-dialog-spacing-inline-start",s):this.style.removeProperty("--scb-dialog-spacing-inline-start"),r?this.style.setProperty("--scb-dialog-spacing-inline-end",r):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(e){this.open=e,this.__fire(e?"open":"close")}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__getSlottedElements(){var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const r of t)i.push(r,...Array.from(r.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const s=document.createElement("input");s.type="hidden",s.name=t,s.value=i,s.setAttribute("data-scb-dialog-generated","true"),e.append(s)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(i=>{if(!(i instanceof HTMLElement))return;const s=(i.getAttribute("name")??"").trim();if(!(!s||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement){if(i.form===e)return;const a=(i.type||"").toLowerCase();if(a==="checkbox"||a==="radio"){i.checked&&this.__appendHiddenFormValue(e,s,i.value||"on");return}this.__appendHiddenFormValue(e,s,i.value??"");return}if(i instanceof HTMLTextAreaElement){if(i.form===e)return;this.__appendHiddenFormValue(e,s,i.value??"");return}if(i instanceof HTMLSelectElement){if(i.form===e)return;if(i.multiple){Array.from(i.selectedOptions).forEach(a=>{this.__appendHiddenFormValue(e,s,a.value)});return}this.__appendHiddenFormValue(e,s,i.value??"");return}switch(i.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(e,s,String(i.value??""));return;case"SCB-CHECKBOX":i.checked&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":i.checked&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-SWITCH":(i.selected||i.checked)&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-CHIP":i.selected&&this.__appendHiddenFormValue(e,s,String(i.value??i.getAttribute("value")??"on"));return;default:"value"in i&&this.__appendHiddenFormValue(e,s,String(i.value??""))}}})}__validateFormAndSlottedFields(e){const t=o=>o.disabled===!0||o.hasAttribute("disabled");let i=e.reportValidity(),s=null;const r=new Set;return this.__getSlottedElements().forEach(o=>{if(!(o instanceof HTMLElement)||r.has(o)||t(o))return;r.add(o);const l=o;if(o.tagName==="SCB-TEXTFIELD"&&l.error===!0){s||(s=o),i=!1;return}if(typeof l.reportValidity=="function"){const d=!!l.reportValidity();!d&&!s&&(s=o),i=i&&d}}),!i&&s&&s.focus(),i}__slotIsEmpty(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return c`
|
|
4915
4918
|
<div class="header">
|
|
4916
4919
|
<div class="title">
|
|
4917
4920
|
${this.icon?c`<md-icon class="dialog-icon">${this.icon}</md-icon>`:m}
|
|
@@ -5175,7 +5178,7 @@
|
|
|
5175
5178
|
to { opacity: 0; }
|
|
5176
5179
|
}
|
|
5177
5180
|
|
|
5178
|
-
`,se([n({type:Boolean,reflect:!0})],ee.prototype,"open",2),se([n({type:String,attribute:"max-w",reflect:!0})],ee.prototype,"maxW",2),se([n({type:String,attribute:"max-h",reflect:!0})],ee.prototype,"maxH",2),se([n({type:Number,attribute:"z-index",reflect:!0})],ee.prototype,"zIndex",2),se([n({type:Boolean,attribute:!1})],ee.prototype,"inSb",2),se([n({type:Boolean,attribute:"scrim-close"})],ee.prototype,"scrimClose",2),se([n({type:String,reflect:!0})],ee.prototype,"spacing",2),se([n({type:String,attribute:"spacing-top",reflect:!0})],ee.prototype,"spacingTop",2),se([n({type:String,attribute:"spacing-bottom",reflect:!0})],ee.prototype,"spacingBottom",2),se([n({type:String,attribute:"spacing-left",reflect:!0})],ee.prototype,"spacingLeft",2),se([n({type:String,attribute:"spacing-right",reflect:!0})],ee.prototype,"spacingRight",2),se([n({type:String})],ee.prototype,"variant",2),se([n({type:String})],ee.prototype,"label",2),se([n({type:String})],ee.prototype,"icon",2),se([n({type:String,attribute:"supporting-text"})],ee.prototype,"supportingText",2),se([n({type:String,attribute:"ok-button"})],ee.prototype,"okButton",2),se([n({type:String,attribute:"cancel-button"})],ee.prototype,"cancelButton",2),se([n({type:String,attribute:"delete-button"})],ee.prototype,"deleteButton",2),se([n({type:String,attribute:"confirm-button"})],ee.prototype,"confirmButton",2),se([n({type:String,attribute:"deny-button"})],ee.prototype,"denyButton",2),se([n({type:String,attribute:"reset-button"})],ee.prototype,"resetButton",2),se([n({type:String,attribute:"submit-button"})],ee.prototype,"submitButton",2),se([n({type:String,attribute:"form-id"})],ee.prototype,"formId",2),se([n({type:String,attribute:"form-action"})],ee.prototype,"formAction",2),se([n({type:String,attribute:"form-method"})],ee.prototype,"formMethod",2),ee=se([y("scb-dialog")],ee);var lv=Object.defineProperty,cv=Object.getOwnPropertyDescriptor,Dp=e=>{throw TypeError(e)},wt=(e,t,i,s)=>{for(var r=s>1?void 0:s?cv(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&lv(t,i,r),r},dv=(e,t,i)=>t.has(e)||Dp("Cannot "+i),pv=(e,t,i)=>t.has(e)?Dp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Op=(e,t,i)=>(dv(e,t,"access private method"),i),No,Jl;let Ze=class extends _{constructor(){super(...arguments),pv(this,No),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{var d,p;const i=Array.from(((d=this.shadowRoot)==null?void 0:d.querySelectorAll(".calendar-day.has-event"))??[]),s=(p=this.shadowRoot)==null?void 0:p.activeElement,r=s&&i.includes(s)?s:document.activeElement,a=i.indexOf(r);if(a===-1)return;let o=a;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":o=a+1<i.length?a+1:a;break;case"ArrowLeft":o=a-1>=0?a-1:a;break;case"ArrowDown":o=a+l<i.length?a+l:a;break;case"ArrowUp":o=a-l>=0?a-l:a;break;default:return}o!==a&&(e.preventDefault(),i[o].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{var e;(e=this._lastActiveDay)==null||e.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(e){const t=(e??"")+"";t!==this.selectedDate&&(this.selectedDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="value"&&(this.value=i??"")}connectedCallback(){super.connectedCallback(),Op(this,No,Jl).call(this);const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}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}updated(e){var t;if((t=super.updated)==null||t.call(this,e),e.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&Op(this,No,Jl).call(this),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const i=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(i)&&!Number.isNaN(s)&&s>=1&&s<=12){const r=this._current.getFullYear(),a=this._current.getMonth()+1;(r!==i||a!==s)&&(this._current=new Date(i,s-1,1),this._dispatchMonthChange(i,s),this.requestUpdate())}}}_ensureEventsFromJson(){const e=(this.eventsJson??"").trim();if(!e){this._eventsFromJson=null,this._eventsJsonLast=e;return}if(!(this._eventsJsonLast===e&&this._eventsFromJson!==null)){this._eventsJsonLast=e;try{const t=JSON.parse(e);Array.isArray(t)?this._eventsFromJson=t:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(e){const t=e.title??"",i=e.description??"",s=e.href??"",r=e.startDate??e["start-date"]??e.start??e.date??"",a=e.endDate??e["end-date"]??e.end??"";return{title:t+"",description:i?i+"":void 0,href:s?s+"":void 0,start:r?r+"":void 0,end:a?a+"":void 0}}_toLocalEventDate(e,t){const i=(e??"").trim();if(!i)return null;if(!i.includes("T")){const r=i.split("-").map(d=>Number(d));if(r.length!==3||r.some(d=>Number.isNaN(d)))return null;const[a,o,l]=r;return t?new Date(a,o-1,l,23,59,59,999):new Date(a,o-1,l,0,0,0,0)}const s=new Date(i);return Number.isNaN(s.getTime())?null:s}_toDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(e){const t=new Map;for(const i of e){const s=this._normalizeEventInput(i),r=s.start||"",a=s.end||"";if(!(!r||!s.title))if(r&&a){const o=this._toLocalEventDate(r,!1),l=this._toLocalEventDate(a,!0);if(!o||!l)continue;if(l<o){const d=r.split("T")[0],p=t.get(d)||[];p.push({title:s.title,description:s.description,href:s.href,start:r,end:a}),t.set(d,p);continue}for(let d=new Date(o);d<=l;d.setDate(d.getDate()+1)){const p=this._toDateKey(d),b=t.get(p)||[];b.push({title:s.title,description:s.description,href:s.href,start:r,end:a}),t.set(p,b)}}else{const o=r.split("T")[0],l=t.get(o)||[];l.push({title:s.title,description:s.description,href:s.href,start:r}),t.set(o,l)}}return t}_buildEventMapFromChildren(){const e=Array.from(this.querySelectorAll("scb-calendar-event")),t=new Map;for(const i of e){const s=i,r=(s.startDate??s.date??"")+""||i.getAttribute("start-date")||i.getAttribute("date")||"",a=(s.endDate??"")+""||i.getAttribute("end-date")||"";if(r&&a){const o=this._toLocalEventDate(r,!1),l=this._toLocalEventDate(a,!0);if(!o||!l)continue;if(l<o){const d=r.split("T")[0],p=t.get(d)||[];p.push({title:i.title??"",description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r,end:a}),t.set(d,p);continue}for(let d=new Date(o);d<=l;d.setDate(d.getDate()+1)){const p=this._toDateKey(d),b=t.get(p)||[];b.push({title:i.title??"",description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r,end:a}),t.set(p,b)}}else if(r&&i.title){const o=r.split("T")[0],l=t.get(o)||[];l.push({title:i.title,description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r}),t.set(o,l)}}return t}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),i=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=i}finally{this._syncingDisplay=!1}e&&this._dispatchMonthChange(t,i)}_dispatchMonthChange(e,t){const i={displayYear:e,displayMonth:t};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:i})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:i}))}_dispatchSelect(e){const t={selectedDate:e};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:t}))}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const i=new Date(e,t,1).getDay();return i===0?6:i-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){var t;this._popupEvent=e,this.selectedDate=e.date,this._dispatchSelect(e.date),this._lastActiveDay=((t=this.shadowRoot)==null?void 0:t.activeElement)||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector("scb-dialog");i&&(document.activeElement&&(i.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.open=!0})}),i.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()+t),i}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const i=t%19,s=t%4,r=t%7,a=(19*i+24)%30,o=(2*s+4*r+6*a+5)%7;let l=22+a+o,d=0;l==57&&(l-=7),l==56&&a==28&&o==6&&i>10&&(l-=7),l>31?(l-=31,d=4):d=3;const p=new Date(t,d-1,l);return this._easterDateCalculated["Ar"+e]=p,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const i=e.getMonth()+1,s=e.getDate(),r=e.getFullYear(),a=this._easterDay(r),o=this.lang==="en",l=[["Nyårsdagen","New Year's Day",i===1&&s===1],["Trettondedag jul","Epiphany",i===1&&s===6],["Långfredag","Good Friday",+e==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+e==+a],["Annandag påsk","Easter Monday",+e==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(a,39)],["Pingstdagen","Pentecost",+e==+this._addDays(a,50)&&r<2005],["Första maj","May Day",i===5&&s===1],["Nationaldagen","National Day",i===6&&s===6&&r>=2005],["Midsommarafton","Midsummer's Eve",i===6&&s>=19&&s<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",i===6&&s>=20&&s<=26&&e.getDay()===6],["Julafton","Christmas Eve",i===12&&s===24],["Juldagen","Christmas Day",i===12&&s===25],["Annandag jul","Boxing Day",i===12&&s===26],["Alla helgons dag","All Saints' Day",i===10&&s>=31&&e.getDay()===6||i===11&&s<=6&&e.getDay()===6]];for(const d of l){const[p,b,u]=d;if(u)return o?b:p}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),i=this._daysInMonth(e,t),s=this._firstDayOfWeek(e,t),r=this._today,a=this.lang==="en",o=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let l=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const d=this._getEventInputs(),p=d?this._buildEventMapFromInputs(d):this._buildEventMapFromChildren(),b=[];let u=1;for(let f=0;f<6;f++){const v=[],x=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let k=u;for(let z=0;z<x.length;z++){const $=x[z];if(f===0&&$<s){if(!this.disableWeekend||$<5){const S=t===0?11:t-1,E=t===0?e-1:e,O=this._daysInMonth(E,S)-(s-$-1);v.push(c`
|
|
5181
|
+
`,re([n({type:Boolean,reflect:!0})],ee.prototype,"open",2),re([n({type:String,attribute:"max-w",reflect:!0})],ee.prototype,"maxW",2),re([n({type:String,attribute:"max-h",reflect:!0})],ee.prototype,"maxH",2),re([n({type:Number,attribute:"z-index",reflect:!0})],ee.prototype,"zIndex",2),re([n({type:Boolean,attribute:!1})],ee.prototype,"inSb",2),re([n({type:Boolean,attribute:"scrim-close"})],ee.prototype,"scrimClose",2),re([n({type:String,reflect:!0})],ee.prototype,"spacing",2),re([n({type:String,attribute:"spacing-top",reflect:!0})],ee.prototype,"spacingTop",2),re([n({type:String,attribute:"spacing-bottom",reflect:!0})],ee.prototype,"spacingBottom",2),re([n({type:String,attribute:"spacing-left",reflect:!0})],ee.prototype,"spacingLeft",2),re([n({type:String,attribute:"spacing-right",reflect:!0})],ee.prototype,"spacingRight",2),re([n({type:String})],ee.prototype,"variant",2),re([n({type:String})],ee.prototype,"label",2),re([n({type:String})],ee.prototype,"icon",2),re([n({type:String,attribute:"supporting-text"})],ee.prototype,"supportingText",2),re([n({type:String,attribute:"ok-button"})],ee.prototype,"okButton",2),re([n({type:String,attribute:"cancel-button"})],ee.prototype,"cancelButton",2),re([n({type:String,attribute:"delete-button"})],ee.prototype,"deleteButton",2),re([n({type:String,attribute:"confirm-button"})],ee.prototype,"confirmButton",2),re([n({type:String,attribute:"deny-button"})],ee.prototype,"denyButton",2),re([n({type:String,attribute:"reset-button"})],ee.prototype,"resetButton",2),re([n({type:String,attribute:"submit-button"})],ee.prototype,"submitButton",2),re([n({type:String,attribute:"form-id"})],ee.prototype,"formId",2),re([n({type:String,attribute:"form-action"})],ee.prototype,"formAction",2),re([n({type:String,attribute:"form-method"})],ee.prototype,"formMethod",2),ee=re([y("scb-dialog")],ee);var lv=Object.defineProperty,cv=Object.getOwnPropertyDescriptor,Dp=e=>{throw TypeError(e)},wt=(e,t,i,s)=>{for(var r=s>1?void 0:s?cv(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&lv(t,i,r),r},dv=(e,t,i)=>t.has(e)||Dp("Cannot "+i),pv=(e,t,i)=>t.has(e)?Dp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Op=(e,t,i)=>(dv(e,t,"access private method"),i),No,Jl;let Ze=class extends _{constructor(){super(...arguments),pv(this,No),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{var d,p;const i=Array.from(((d=this.shadowRoot)==null?void 0:d.querySelectorAll(".calendar-day.has-event"))??[]),s=(p=this.shadowRoot)==null?void 0:p.activeElement,r=s&&i.includes(s)?s:document.activeElement,a=i.indexOf(r);if(a===-1)return;let o=a;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":o=a+1<i.length?a+1:a;break;case"ArrowLeft":o=a-1>=0?a-1:a;break;case"ArrowDown":o=a+l<i.length?a+l:a;break;case"ArrowUp":o=a-l>=0?a-l:a;break;default:return}o!==a&&(e.preventDefault(),i[o].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{var e;(e=this._lastActiveDay)==null||e.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(e){const t=(e??"")+"";t!==this.selectedDate&&(this.selectedDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),e==="value"&&(this.value=i??"")}connectedCallback(){super.connectedCallback(),Op(this,No,Jl).call(this);const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}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}updated(e){var t;if((t=super.updated)==null||t.call(this,e),e.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&Op(this,No,Jl).call(this),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const i=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(i)&&!Number.isNaN(s)&&s>=1&&s<=12){const r=this._current.getFullYear(),a=this._current.getMonth()+1;(r!==i||a!==s)&&(this._current=new Date(i,s-1,1),this._dispatchMonthChange(i,s),this.requestUpdate())}}}_ensureEventsFromJson(){const e=(this.eventsJson??"").trim();if(!e){this._eventsFromJson=null,this._eventsJsonLast=e;return}if(!(this._eventsJsonLast===e&&this._eventsFromJson!==null)){this._eventsJsonLast=e;try{const t=JSON.parse(e);Array.isArray(t)?this._eventsFromJson=t:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(e){const t=e.title??"",i=e.description??"",s=e.href??"",r=e.startDate??e["start-date"]??e.start??e.date??"",a=e.endDate??e["end-date"]??e.end??"";return{title:t+"",description:i?i+"":void 0,href:s?s+"":void 0,start:r?r+"":void 0,end:a?a+"":void 0}}_toLocalEventDate(e,t){const i=(e??"").trim();if(!i)return null;if(!i.includes("T")){const r=i.split("-").map(d=>Number(d));if(r.length!==3||r.some(d=>Number.isNaN(d)))return null;const[a,o,l]=r;return t?new Date(a,o-1,l,23,59,59,999):new Date(a,o-1,l,0,0,0,0)}const s=new Date(i);return Number.isNaN(s.getTime())?null:s}_toDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(e){const t=new Map;for(const i of e){const s=this._normalizeEventInput(i),r=s.start||"",a=s.end||"";if(!(!r||!s.title))if(r&&a){const o=this._toLocalEventDate(r,!1),l=this._toLocalEventDate(a,!0);if(!o||!l)continue;if(l<o){const d=r.split("T")[0],p=t.get(d)||[];p.push({title:s.title,description:s.description,href:s.href,start:r,end:a}),t.set(d,p);continue}for(let d=new Date(o);d<=l;d.setDate(d.getDate()+1)){const p=this._toDateKey(d),b=t.get(p)||[];b.push({title:s.title,description:s.description,href:s.href,start:r,end:a}),t.set(p,b)}}else{const o=r.split("T")[0],l=t.get(o)||[];l.push({title:s.title,description:s.description,href:s.href,start:r}),t.set(o,l)}}return t}_buildEventMapFromChildren(){const e=Array.from(this.querySelectorAll("scb-calendar-event")),t=new Map;for(const i of e){const s=i,r=(s.startDate??s.date??"")+""||i.getAttribute("start-date")||i.getAttribute("date")||"",a=(s.endDate??"")+""||i.getAttribute("end-date")||"";if(r&&a){const o=this._toLocalEventDate(r,!1),l=this._toLocalEventDate(a,!0);if(!o||!l)continue;if(l<o){const d=r.split("T")[0],p=t.get(d)||[];p.push({title:i.title??"",description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r,end:a}),t.set(d,p);continue}for(let d=new Date(o);d<=l;d.setDate(d.getDate()+1)){const p=this._toDateKey(d),b=t.get(p)||[];b.push({title:i.title??"",description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r,end:a}),t.set(p,b)}}else if(r&&i.title){const o=r.split("T")[0],l=t.get(o)||[];l.push({title:i.title,description:i.description,href:s.href||i.getAttribute("href")||void 0,start:r}),t.set(o,l)}}return t}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),i=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=i}finally{this._syncingDisplay=!1}e&&this._dispatchMonthChange(t,i)}_dispatchMonthChange(e,t){const i={displayYear:e,displayMonth:t};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:i})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:i}))}_dispatchSelect(e){const t={selectedDate:e};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:t}))}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const i=new Date(e,t,1).getDay();return i===0?6:i-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){var t;this._popupEvent=e,this.selectedDate=e.date,this._dispatchSelect(e.date),this._lastActiveDay=((t=this.shadowRoot)==null?void 0:t.activeElement)||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{var s;const i=(s=this.shadowRoot)==null?void 0:s.querySelector("scb-dialog");i&&(document.activeElement&&(i.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.open=!0})}),i.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(e,t){const i=new Date(e.valueOf());return i.setDate(i.getDate()+t),i}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const i=t%19,s=t%4,r=t%7,a=(19*i+24)%30,o=(2*s+4*r+6*a+5)%7;let l=22+a+o,d=0;l==57&&(l-=7),l==56&&a==28&&o==6&&i>10&&(l-=7),l>31?(l-=31,d=4):d=3;const p=new Date(t,d-1,l);return this._easterDateCalculated["Ar"+e]=p,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const i=e.getMonth()+1,s=e.getDate(),r=e.getFullYear(),a=this._easterDay(r),o=this.lang==="en",l=[["Nyårsdagen","New Year's Day",i===1&&s===1],["Trettondedag jul","Epiphany",i===1&&s===6],["Långfredag","Good Friday",+e==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+e==+a],["Annandag påsk","Easter Monday",+e==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(a,39)],["Pingstdagen","Pentecost",+e==+this._addDays(a,50)&&r<2005],["Första maj","May Day",i===5&&s===1],["Nationaldagen","National Day",i===6&&s===6&&r>=2005],["Midsommarafton","Midsummer's Eve",i===6&&s>=19&&s<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",i===6&&s>=20&&s<=26&&e.getDay()===6],["Julafton","Christmas Eve",i===12&&s===24],["Juldagen","Christmas Day",i===12&&s===25],["Annandag jul","Boxing Day",i===12&&s===26],["Alla helgons dag","All Saints' Day",i===10&&s>=31&&e.getDay()===6||i===11&&s<=6&&e.getDay()===6]];for(const d of l){const[p,b,u]=d;if(u)return o?b:p}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),i=this._daysInMonth(e,t),s=this._firstDayOfWeek(e,t),r=this._today,a=this.lang==="en",o=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let l=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const d=this._getEventInputs(),p=d?this._buildEventMapFromInputs(d):this._buildEventMapFromChildren(),b=[];let u=1;for(let f=0;f<6;f++){const v=[],x=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let k=u;for(let z=0;z<x.length;z++){const $=x[z];if(f===0&&$<s){if(!this.disableWeekend||$<5){const S=t===0?11:t-1,E=t===0?e-1:e,O=this._daysInMonth(E,S)-(s-$-1);v.push(c`
|
|
5179
5182
|
<div class="calendar-day calendar-day--other">
|
|
5180
5183
|
<span class="calendar-day-number">${O}</span>
|
|
5181
5184
|
</div>
|
|
@@ -5342,7 +5345,7 @@
|
|
|
5342
5345
|
gap: var(--spacing-4);
|
|
5343
5346
|
}
|
|
5344
5347
|
|
|
5345
|
-
`,wt([n({type:String})],Ze.prototype,"lang",2),wt([n({type:Boolean,attribute:"disable-weekend"})],Ze.prototype,"disableWeekend",2),wt([n({type:Boolean,attribute:"public-holidays"})],Ze.prototype,"publicHolidays",2),wt([n({type:Number,attribute:"display-year",reflect:!0})],Ze.prototype,"displayYear",2),wt([n({type:Number,attribute:"display-month",reflect:!0})],Ze.prototype,"displayMonth",2),wt([n({type:String,attribute:"selected-date",reflect:!0})],Ze.prototype,"selectedDate",2),wt([n({attribute:!1})],Ze.prototype,"events",2),wt([n({type:String,attribute:"events-json"})],Ze.prototype,"eventsJson",2),wt([n({type:String,reflect:!0})],Ze.prototype,"spacing",2),wt([n({type:String,attribute:"spacing-top",reflect:!0})],Ze.prototype,"spacingTop",2),wt([n({type:String,attribute:"spacing-bottom",reflect:!0})],Ze.prototype,"spacingBottom",2),wt([n({type:String,attribute:"spacing-left",reflect:!0})],Ze.prototype,"spacingLeft",2),wt([n({type:String,attribute:"spacing-right",reflect:!0})],Ze.prototype,"spacingRight",2),Ze=wt([y("scb-calendar")],Ze);var hv=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,Fp=e=>{throw TypeError(e)},
|
|
5348
|
+
`,wt([n({type:String})],Ze.prototype,"lang",2),wt([n({type:Boolean,attribute:"disable-weekend"})],Ze.prototype,"disableWeekend",2),wt([n({type:Boolean,attribute:"public-holidays"})],Ze.prototype,"publicHolidays",2),wt([n({type:Number,attribute:"display-year",reflect:!0})],Ze.prototype,"displayYear",2),wt([n({type:Number,attribute:"display-month",reflect:!0})],Ze.prototype,"displayMonth",2),wt([n({type:String,attribute:"selected-date",reflect:!0})],Ze.prototype,"selectedDate",2),wt([n({attribute:!1})],Ze.prototype,"events",2),wt([n({type:String,attribute:"events-json"})],Ze.prototype,"eventsJson",2),wt([n({type:String,reflect:!0})],Ze.prototype,"spacing",2),wt([n({type:String,attribute:"spacing-top",reflect:!0})],Ze.prototype,"spacingTop",2),wt([n({type:String,attribute:"spacing-bottom",reflect:!0})],Ze.prototype,"spacingBottom",2),wt([n({type:String,attribute:"spacing-left",reflect:!0})],Ze.prototype,"spacingLeft",2),wt([n({type:String,attribute:"spacing-right",reflect:!0})],Ze.prototype,"spacingRight",2),Ze=wt([y("scb-calendar")],Ze);var hv=Object.defineProperty,uv=Object.getOwnPropertyDescriptor,Fp=e=>{throw TypeError(e)},ae=(e,t,i,s)=>{for(var r=s>1?void 0:s?uv(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&hv(t,i,r),r},bv=(e,t,i)=>t.has(e)||Fp("Cannot "+i),mv=(e,t,i)=>t.has(e)?Fp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Zl=(e,t,i)=>(bv(e,t,"access private method"),i),ba,Bp,Ql;let W=class extends _{constructor(){super(...arguments),mv(this,ba),this.variant="default",this.size="medium",this.date=null,this.direction="horizontal",this.title="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="stretch",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}async firstUpdated(){W.__iconLoaded||(await Promise.resolve().then(()=>yi),W.__iconLoaded=!0),W.__rippleLoaded||(await Promise.resolve().then(()=>Da),W.__rippleLoaded=!0),this.__applyInnerSizing(),Zl(this,ba,Ql).call(this)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",t=this.direction?`${this.direction.toLowerCase()}`:"",i=this.cardHref?"clickable":"",{day:s,month:r}=Zl(this,ba,Bp).call(this),a=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",o=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",l=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",d=`${a?`inline-size:${a};`:""}${o?`block-size:${o};`:""}${l?`aspect-ratio:${l};`:""}`;return c`
|
|
5346
5349
|
<div
|
|
5347
5350
|
class="calendar-card ${t} ${i} ${e}"
|
|
5348
5351
|
role="${this.cardHref?"link":"group"}"
|
|
@@ -5683,7 +5686,7 @@
|
|
|
5683
5686
|
overflow: visible;
|
|
5684
5687
|
text-overflow: clip;
|
|
5685
5688
|
}
|
|
5686
|
-
`,
|
|
5689
|
+
`,ae([n({type:String,reflect:!0})],W.prototype,"variant",2),ae([n({type:String,reflect:!0})],W.prototype,"size",2),ae([n({type:String,attribute:"date"})],W.prototype,"date",2),ae([n({type:String,reflect:!0})],W.prototype,"direction",2),ae([n({type:String,reflect:!0})],W.prototype,"title",2),ae([n({type:String,reflect:!0})],W.prototype,"subtitle",2),ae([n({type:String,attribute:"supporting-text",reflect:!0})],W.prototype,"supportingText",2),ae([n({type:String,attribute:"card-href"})],W.prototype,"cardHref",2),ae([n({type:String,attribute:"card-href-nav"})],W.prototype,"cardHrefNav",2),ae([n({type:Boolean,reflect:!0,attribute:"show-media"})],W.prototype,"showMedia",2),ae([n({type:String,attribute:"media-width"})],W.prototype,"mediaWidth",2),ae([n({type:String,attribute:"media-height"})],W.prototype,"mediaHeight",2),ae([n({type:String,attribute:"media-aspect"})],W.prototype,"mediaAspect",2),ae([n({type:String,reflect:!0})],W.prototype,"width",2),ae([n({type:String,reflect:!0,attribute:"max-width"})],W.prototype,"maxWidth",2),ae([n({type:String,attribute:"min-width"})],W.prototype,"minWidth",2),ae([n({type:String,reflect:!0})],W.prototype,"height",2),ae([n({type:String,reflect:!0,attribute:"max-height"})],W.prototype,"maxHeight",2),ae([n({type:String,attribute:"min-height"})],W.prototype,"minHeight",2),ae([n({type:String,reflect:!0})],W.prototype,"sizing",2),ae([n({type:String,reflect:!0})],W.prototype,"spacing",2),ae([n({type:String,attribute:"spacing-top",reflect:!0})],W.prototype,"spacingTop",2),ae([n({type:String,attribute:"spacing-bottom",reflect:!0})],W.prototype,"spacingBottom",2),ae([n({type:String,attribute:"spacing-left",reflect:!0})],W.prototype,"spacingLeft",2),ae([n({type:String,attribute:"spacing-right",reflect:!0})],W.prototype,"spacingRight",2),W=ae([y("scb-calendar-card")],W);/**
|
|
5687
5690
|
* @license
|
|
5688
5691
|
* Copyright 2017 Google LLC
|
|
5689
5692
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -10274,7 +10277,7 @@
|
|
|
10274
10277
|
color: var(--md-sys-color-on-secondary-container);
|
|
10275
10278
|
font-weight: 600;
|
|
10276
10279
|
}
|
|
10277
|
-
`,Dt([n({type:String})],lt.prototype,"label",2),Dt([n({type:String,attribute:"active-href"})],lt.prototype,"activeHref",2),Dt([n({type:Boolean,attribute:"activate-on-click"})],lt.prototype,"activateOnClick",2),Dt([n({type:Boolean,reflect:!0})],lt.prototype,"sticky",2),Dt([n({type:String,attribute:"sticky-top"})],lt.prototype,"stickyTop",2),Dt([n({type:Number,attribute:"sticky-z-index"})],lt.prototype,"stickyZIndex",2),Dt([n({type:String,attribute:"sticky-background"})],lt.prototype,"stickyBackground",2),Dt([n({type:String,reflect:!0})],lt.prototype,"spacing",2),Dt([n({type:String,attribute:"spacing-top",reflect:!0})],lt.prototype,"spacingTop",2),Dt([n({type:String,attribute:"spacing-bottom",reflect:!0})],lt.prototype,"spacingBottom",2),Dt([n({type:String,attribute:"spacing-left",reflect:!0})],lt.prototype,"spacingLeft",2),Dt([n({type:String,attribute:"spacing-right",reflect:!0})],lt.prototype,"spacingRight",2),lt=Dt([y("scb-nav")],lt);var jg=Object.defineProperty,Kg=Object.getOwnPropertyDescriptor,
|
|
10280
|
+
`,Dt([n({type:String})],lt.prototype,"label",2),Dt([n({type:String,attribute:"active-href"})],lt.prototype,"activeHref",2),Dt([n({type:Boolean,attribute:"activate-on-click"})],lt.prototype,"activateOnClick",2),Dt([n({type:Boolean,reflect:!0})],lt.prototype,"sticky",2),Dt([n({type:String,attribute:"sticky-top"})],lt.prototype,"stickyTop",2),Dt([n({type:Number,attribute:"sticky-z-index"})],lt.prototype,"stickyZIndex",2),Dt([n({type:String,attribute:"sticky-background"})],lt.prototype,"stickyBackground",2),Dt([n({type:String,reflect:!0})],lt.prototype,"spacing",2),Dt([n({type:String,attribute:"spacing-top",reflect:!0})],lt.prototype,"spacingTop",2),Dt([n({type:String,attribute:"spacing-bottom",reflect:!0})],lt.prototype,"spacingBottom",2),Dt([n({type:String,attribute:"spacing-left",reflect:!0})],lt.prototype,"spacingLeft",2),Dt([n({type:String,attribute:"spacing-right",reflect:!0})],lt.prototype,"spacingRight",2),lt=Dt([y("scb-nav")],lt);var jg=Object.defineProperty,Kg=Object.getOwnPropertyDescriptor,ne=(e,t,i,s)=>{for(var r=s>1?void 0:s?Kg(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&jg(t,i,r),r};let ie=class extends _{constructor(){super(...arguments),this.variant="success",this.direction="horizontal",this.size="large",this.title="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkHref="#",this.href="",this.showIcon=!1,this.showCloseButton=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._closeNotification=()=>{this.open=!1;const e=new CustomEvent("close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(e);const t=new CustomEvent("Close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t)}}_iconForVariant(){switch(this.variant){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}__resolveSpacingToken(e){const t=(e??"").trim();return t?/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t:""}__applySpacing(){const e=this.__resolveSpacingToken(this.spacingTop||this.spacing),t=this.__resolveSpacingToken(this.spacingBottom||this.spacing),i=this.__resolveSpacingToken(this.spacingLeft||this.spacing),s=this.__resolveSpacingToken(this.spacingRight||this.spacing);e?this.style.marginBlockStart=e:this.style.removeProperty("margin-block-start"),t?this.style.marginBlockEnd=t:this.style.removeProperty("margin-block-end"),i?this.style.marginInlineStart=i:this.style.removeProperty("margin-inline-start"),s?this.style.marginInlineEnd=s:this.style.removeProperty("margin-inline-end")}updated(e){super.updated(e),e.has("width")&&(this.width&&this.width.trim()!==""?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth&&this.maxWidth.trim()!==""?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height&&this.height.trim()!==""?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight&&this.maxHeight.trim()!==""?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}render(){const e=this.direction==="vertical"?"vertical":"horizontal",t=!!(this.title||this.subtitle),i=!!(this.supportingText&&!this.title&&!this.subtitle&&!this.linkText),s=this.variant==="success"?"--_icon-color: var(--md-sys-color-on-success-container, #007041);":this.variant==="error"?"--_icon-color: var(--md-sys-color-on-error-container, #942500);":this.variant==="warning"?"--_icon-color: var(--md-sys-color-on-warning-container, #6B5600);":"--_icon-color: var(--md-sys-color-on-info-container, #1E00BE);",r=this.linkHref&&this.linkHref!=="#"?this.linkHref:this.href||this.linkHref;return c`
|
|
10278
10281
|
<div class="notification" type=${this.variant} role="alert" aria-live="assertive" aria-atomic="true">
|
|
10279
10282
|
<div class="notification-main ${e}">
|
|
10280
10283
|
${this.showIcon?c`
|
|
@@ -10631,7 +10634,7 @@
|
|
|
10631
10634
|
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
10632
10635
|
}
|
|
10633
10636
|
}
|
|
10634
|
-
`],
|
|
10637
|
+
`],ne([n({type:String})],ie.prototype,"variant",2),ne([n({type:String,reflect:!0})],ie.prototype,"direction",2),ne([n({type:String,reflect:!0})],ie.prototype,"size",2),ne([n({type:String})],ie.prototype,"title",2),ne([n({type:String})],ie.prototype,"subtitle",2),ne([n({type:String,attribute:"supporting-text"})],ie.prototype,"supportingText",2),ne([n({type:Boolean,reflect:!0})],ie.prototype,"open",2),ne([n({type:String,attribute:"link-text"})],ie.prototype,"linkText",2),ne([n({type:String,attribute:"link-href"})],ie.prototype,"linkHref",2),ne([n({type:String})],ie.prototype,"href",2),ne([n({type:Boolean,attribute:"show-icon"})],ie.prototype,"showIcon",2),ne([n({type:Boolean,attribute:"show-close-button"})],ie.prototype,"showCloseButton",2),ne([n({type:String,reflect:!0})],ie.prototype,"sizing",2),ne([n({type:String,reflect:!0})],ie.prototype,"width",2),ne([n({type:String,reflect:!0,attribute:"max-width"})],ie.prototype,"maxWidth",2),ne([n({type:String,reflect:!0})],ie.prototype,"height",2),ne([n({type:String,reflect:!0,attribute:"max-height"})],ie.prototype,"maxHeight",2),ne([n({type:Boolean,reflect:!0,attribute:"full-height"})],ie.prototype,"fullHeight",2),ne([n({type:Boolean,reflect:!0,attribute:"full-width"})],ie.prototype,"fullWidth",2),ne([n({type:String})],ie.prototype,"spacing",2),ne([n({type:String,attribute:"spacing-top"})],ie.prototype,"spacingTop",2),ne([n({type:String,attribute:"spacing-bottom"})],ie.prototype,"spacingBottom",2),ne([n({type:String,attribute:"spacing-left"})],ie.prototype,"spacingLeft",2),ne([n({type:String,attribute:"spacing-right"})],ie.prototype,"spacingRight",2),ie=ne([y("scb-notification-card")],ie);var Gg=Object.defineProperty,Yg=Object.getOwnPropertyDescriptor,ct=(e,t,i,s)=>{for(var r=s>1?void 0:s?Yg(t,i):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Gg(t,i,r),r};let Ue=class extends _{constructor(){super(...arguments),this.variant="icon-text",this.page=1,this.totalPages=0,this.pagingHref="",this.baseUri="",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{this.isNarrow=window.innerWidth<=768}}_emitPageChange(e){const t={page:e};this.dispatchEvent(new CustomEvent("page-change",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("pagechange",{detail:t,bubbles:!0,composed:!0}))}_getPagingHref(e){if(!this.pagingHref)return;const t=(this.baseUri||"").trim(),i=t||window.location.href,s=new URL(i,window.location.href),a=this.pagingHref.trim().replace(/^[?&]/,"").split("=")[0];if(a)return s.searchParams.delete(a),s.searchParams.set(a,String(e)),/^https?:\/\//i.test(t)?s.toString():`${s.pathname}${s.search}${s.hash}`}_handlePageSelection(e,t){!this.pagingHref&&t&&t.preventDefault(),this.page=e,this._emitPageChange(e)}_prevPage(e){if(this.page<=1){!this.pagingHref&&e&&e.preventDefault();return}this._handlePageSelection(this.page-1,e)}_nextPage(e){if(this.page>=this.totalPages){!this.pagingHref&&e&&e.preventDefault();return}this._handlePageSelection(this.page+1,e)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize)}mapSpacingToken(e){if(e==null)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,s=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-pagination-spacing-block-start",t):this.style.removeProperty("--scb-pagination-spacing-block-start"),i?this.style.setProperty("--scb-pagination-spacing-block-end",i):this.style.removeProperty("--scb-pagination-spacing-block-end"),s?this.style.setProperty("--scb-pagination-spacing-inline-start",s):this.style.removeProperty("--scb-pagination-spacing-inline-start"),r?this.style.setProperty("--scb-pagination-spacing-inline-end",r):this.style.removeProperty("--scb-pagination-spacing-inline-end")}firstUpdated(){this.__applySpacing()}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const e=this.variant?`${this.variant.toLowerCase()}`:"",t=[],{page:i,totalPages:s}=this,r=window.innerWidth<=768,a=r?1:2,o=this._getPagingHref(Math.max(1,this.page-1)),l=this._getPagingHref(Math.min(this.totalPages,this.page+1)),d=this.pagingHref?this.variant==="icon"?c`<a
|
|
10635
10638
|
class="paging-action-link"
|
|
10636
10639
|
href=${o}
|
|
10637
10640
|
@click=${this._prevPage}
|