scb-wc-test 0.1.269 → 0.1.270
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mvc/components/scb-chip/scb-chip.js +15 -14
- package/package.json +2 -2
- package/scb-chip/scb-chip.js +60 -59
- package/scb-wc-test.bundle.js +12 -11
|
@@ -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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as
|
|
2
|
+
import{_ as h}from"../../vendor/preload-helper.js";import{a as v,n as a,i as _,x as p,t as f}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,l,o){try{customElements.get(r)||e(r,l,o)}catch(c){var n=String(c||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,b=t=>{throw TypeError(t)},i=(t,e,r,l)=>{for(var o=l>1?void 0:l?g(e,r):e,n=t.length-1,c;n>=0;n--)(c=t[n])&&(o=(l?c(e,r,o):c(o))||o);return l&&o&&y(e,r,o),o},S=(t,e,r)=>e.has(t)||b("Cannot "+r),E=(t,e,r)=>e.has(t)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),u=(t,e,r)=>(S(t,e,"access private method"),r),d,m;let s=class extends _{constructor(){super(),E(this,d),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="medium",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}updated(t){super.updated(t),(t.has("variant")||t.has("icon"))&&this.__ensureDepsLoaded(),t.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),t.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),t.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),t.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),t.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),t.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(t.has("selected")||t.has("disabled")||t.has("variant")||t.has("value")||t.has("name"))&&this._updateFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&u(this,d,m).call(this)}firstUpdated(){this.__ensureDepsLoaded(),u(this,d,m).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await h(()=>import("../../vendor/vendor-material.js").then(t=>t.e),__vite__mapDeps([0,1]),import.meta.url);break;case"filter":await h(()=>import("../../vendor/vendor-material.js").then(t=>t.g),__vite__mapDeps([0,1]),import.meta.url);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await h(()=>import("../../vendor/vendor-material.js").then(t=>t.h),__vite__mapDeps([0,1]),import.meta.url),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await h(()=>import("../../vendor/vendor-material.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const t=this._renderChip();return this._insideChipSet?t:p`<md-chip-set>${t}</md-chip-set>`}_renderChip(){const t=this.icon?p`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const e=this.target==="_blank"?"noopener noreferrer":void 0;return p`
|
|
3
3
|
<md-assist-chip
|
|
4
4
|
label=${this.label}
|
|
5
5
|
?disabled=${this.disabled}
|
|
@@ -11,7 +11,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as v,n as a,i as _,x
|
|
|
11
11
|
>
|
|
12
12
|
${t}
|
|
13
13
|
</md-assist-chip>
|
|
14
|
-
`}case"filter":return
|
|
14
|
+
`}case"filter":return p`
|
|
15
15
|
<md-filter-chip
|
|
16
16
|
label=${this.label}
|
|
17
17
|
?disabled=${this.disabled}
|
|
@@ -23,7 +23,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as v,n as a,i as _,x
|
|
|
23
23
|
>
|
|
24
24
|
${t}
|
|
25
25
|
</md-filter-chip>
|
|
26
|
-
`;default:return
|
|
26
|
+
`;default:return p``}}_toggleSelected(){this.selected=!this.selected,this.dispatchEvent(new CustomEvent("selected-changed",{detail:{selected:this.selected},bubbles:!0,composed:!0})),this._updateFormValue()}_onRemove(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove",{detail:{label:this.label},bubbles:!0,composed:!0}))}_forward(t){this.dispatchEvent(new CustomEvent(t.type,{detail:t.detail,bubbles:!0,composed:!0}))}_updateFormValue(){if(!this._internals)return;if(!(this.variant==="filter"&&this.selected&&!this.disabled&&!!this.name)){this._internals.setFormValue(null),this._internals.setValidity({});return}const e=this.value||this.label||"";this._internals.setFormValue(e,this.name),this._internals.setValidity({})}formDisabledCallback(t){this.disabled=t}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}};d=new WeakSet;m=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop),r=this.mapSpacingToken(this.spacingBottom),l=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight),n=e??t,c=r??t;n?this.style.setProperty("--scb-chip-spacing-block-start",n):this.style.removeProperty("--scb-chip-spacing-block-start"),c?this.style.setProperty("--scb-chip-spacing-block-end",c):this.style.removeProperty("--scb-chip-spacing-block-end"),l?this.style.setProperty("--scb-chip-spacing-inline-start",l):this.style.removeProperty("--scb-chip-spacing-inline-start"),o?this.style.setProperty("--scb-chip-spacing-inline-end",o):this.style.removeProperty("--scb-chip-spacing-inline-end")};s.formAssociated=!0;s.styles=v`
|
|
27
27
|
:host {
|
|
28
28
|
display: inline-block;
|
|
29
29
|
margin-block-start: var(--scb-chip-spacing-block-start, 0);
|
|
@@ -44,22 +44,23 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as v,n as a,i as _,x
|
|
|
44
44
|
Medium (default) är Material-standardvärdena. */
|
|
45
45
|
:host([size='small']) md-assist-chip,
|
|
46
46
|
:host([size='small']) md-filter-chip {
|
|
47
|
-
--md-assist-chip-
|
|
48
|
-
--md-filter-chip-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
48
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
49
|
+
}
|
|
50
|
+
:host([size='medium']) md-assist-chip,
|
|
51
|
+
:host([size='medium']) md-filter-chip {
|
|
52
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
53
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
:host([size='large']) md-assist-chip,
|
|
54
57
|
:host([size='large']) md-filter-chip {
|
|
55
|
-
--md-assist-chip-
|
|
56
|
-
--md-filter-chip-
|
|
57
|
-
--md-assist-chip-label-text-size: 0.9375rem;
|
|
58
|
-
--md-filter-chip-label-text-size: 0.9375rem;
|
|
58
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
59
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
/* md-icon {
|
|
62
63
|
color: var(--md-sys-color-on-surface);
|
|
63
64
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
64
|
-
}
|
|
65
|
-
`;
|
|
65
|
+
} */
|
|
66
|
+
`;i([a({type:String,reflect:!0})],s.prototype,"variant",2);i([a({type:String})],s.prototype,"label",2);i([a({type:String})],s.prototype,"icon",2);i([a({type:Boolean,reflect:!0})],s.prototype,"disabled",2);i([a({type:Boolean,reflect:!0})],s.prototype,"elevated",2);i([a({type:Boolean,reflect:!0})],s.prototype,"removable",2);i([a({type:Boolean,reflect:!0})],s.prototype,"selected",2);i([a({type:String})],s.prototype,"href",2);i([a({type:String})],s.prototype,"target",2);i([a({type:String})],s.prototype,"name",2);i([a({type:String})],s.prototype,"value",2);i([a({type:String,reflect:!0})],s.prototype,"spacing",2);i([a({type:String,reflect:!0,attribute:"spacing-top"})],s.prototype,"spacingTop",2);i([a({type:String,reflect:!0,attribute:"spacing-bottom"})],s.prototype,"spacingBottom",2);i([a({type:String,reflect:!0,attribute:"spacing-left"})],s.prototype,"spacingLeft",2);i([a({type:String,reflect:!0,attribute:"spacing-right"})],s.prototype,"spacingRight",2);i([a({type:String,reflect:!0})],s.prototype,"size",2);s=i([f("scb-chip")],s);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.270",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -386,5 +386,5 @@
|
|
|
386
386
|
},
|
|
387
387
|
"./mvc/*": "./mvc/*"
|
|
388
388
|
},
|
|
389
|
-
"buildHash": "
|
|
389
|
+
"buildHash": "6261C72A43D13B191B86401625DA55BACE6171FBE8020C3D0D407C639107FBF4"
|
|
390
390
|
}
|
package/scb-chip/scb-chip.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { css as b, LitElement as v, html as c } from "lit";
|
|
2
2
|
import { property as a, customElement as f } from "lit/decorators.js";
|
|
3
|
-
var
|
|
3
|
+
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, u = (t) => {
|
|
4
4
|
throw TypeError(t);
|
|
5
|
-
},
|
|
6
|
-
for (var o =
|
|
7
|
-
(p = t[
|
|
8
|
-
return
|
|
9
|
-
},
|
|
10
|
-
let
|
|
5
|
+
}, i = (t, e, r, l) => {
|
|
6
|
+
for (var o = l > 1 ? void 0 : l ? g(e, r) : e, n = t.length - 1, p; n >= 0; n--)
|
|
7
|
+
(p = t[n]) && (o = (l ? p(e, r, o) : p(o)) || o);
|
|
8
|
+
return l && o && y(e, r, o), o;
|
|
9
|
+
}, _ = (t, e, r) => e.has(t) || u("Cannot " + r), S = (t, e, r) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), m = (t, e, r) => (_(t, e, "access private method"), r), h, d;
|
|
10
|
+
let s = class extends v {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(), S(this, h), this.variant = "assist", this.label = "", this.icon = "", this.disabled = !1, this.elevated = !1, this.removable = !1, this.selected = !1, this.href = "", this.target = "", this.name = "", this.value = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.size = "", this._internals = null, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__chipSetLoaded = !1, this.__iconLoaded = !1, "attachInternals" in this && (this._internals = this.attachInternals());
|
|
12
|
+
super(), S(this, h), this.variant = "assist", this.label = "", this.icon = "", this.disabled = !1, this.elevated = !1, this.removable = !1, this.selected = !1, this.href = "", this.target = "", this.name = "", this.value = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this.size = "medium", this._internals = null, this.__loadedVariants = /* @__PURE__ */ new Set(), this.__chipSetLoaded = !1, this.__iconLoaded = !1, "attachInternals" in this && (this._internals = this.attachInternals());
|
|
13
13
|
}
|
|
14
14
|
// aria-disabled på host + bridge-vänliga *-changed-events
|
|
15
15
|
updated(t) {
|
|
@@ -164,11 +164,11 @@ let i = class extends v {
|
|
|
164
164
|
};
|
|
165
165
|
h = /* @__PURE__ */ new WeakSet();
|
|
166
166
|
d = function() {
|
|
167
|
-
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop), r = this.mapSpacingToken(this.spacingBottom),
|
|
168
|
-
|
|
167
|
+
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop), r = this.mapSpacingToken(this.spacingBottom), l = this.mapSpacingToken(this.spacingLeft), o = this.mapSpacingToken(this.spacingRight), n = e ?? t, p = r ?? t;
|
|
168
|
+
n ? this.style.setProperty("--scb-chip-spacing-block-start", n) : this.style.removeProperty("--scb-chip-spacing-block-start"), p ? this.style.setProperty("--scb-chip-spacing-block-end", p) : this.style.removeProperty("--scb-chip-spacing-block-end"), l ? this.style.setProperty("--scb-chip-spacing-inline-start", l) : this.style.removeProperty("--scb-chip-spacing-inline-start"), o ? this.style.setProperty("--scb-chip-spacing-inline-end", o) : this.style.removeProperty("--scb-chip-spacing-inline-end");
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
s.formAssociated = !0;
|
|
171
|
+
s.styles = b`
|
|
172
172
|
:host {
|
|
173
173
|
display: inline-block;
|
|
174
174
|
margin-block-start: var(--scb-chip-spacing-block-start, 0);
|
|
@@ -189,79 +189,80 @@ i.styles = b`
|
|
|
189
189
|
Medium (default) är Material-standardvärdena. */
|
|
190
190
|
:host([size='small']) md-assist-chip,
|
|
191
191
|
:host([size='small']) md-filter-chip {
|
|
192
|
-
--md-assist-chip-
|
|
193
|
-
--md-filter-chip-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
193
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
194
|
+
}
|
|
195
|
+
:host([size='medium']) md-assist-chip,
|
|
196
|
+
:host([size='medium']) md-filter-chip {
|
|
197
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
198
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
:host([size='large']) md-assist-chip,
|
|
199
202
|
:host([size='large']) md-filter-chip {
|
|
200
|
-
--md-assist-chip-
|
|
201
|
-
--md-filter-chip-
|
|
202
|
-
--md-assist-chip-label-text-size: 0.9375rem;
|
|
203
|
-
--md-filter-chip-label-text-size: 0.9375rem;
|
|
203
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
204
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
204
205
|
}
|
|
205
206
|
|
|
206
|
-
|
|
207
|
+
/* md-icon {
|
|
207
208
|
color: var(--md-sys-color-on-surface);
|
|
208
209
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
209
|
-
}
|
|
210
|
+
} */
|
|
210
211
|
`;
|
|
211
|
-
|
|
212
|
+
i([
|
|
212
213
|
a({ type: String, reflect: !0 })
|
|
213
|
-
],
|
|
214
|
-
|
|
214
|
+
], s.prototype, "variant", 2);
|
|
215
|
+
i([
|
|
215
216
|
a({ type: String })
|
|
216
|
-
],
|
|
217
|
-
|
|
217
|
+
], s.prototype, "label", 2);
|
|
218
|
+
i([
|
|
218
219
|
a({ type: String })
|
|
219
|
-
],
|
|
220
|
-
|
|
220
|
+
], s.prototype, "icon", 2);
|
|
221
|
+
i([
|
|
221
222
|
a({ type: Boolean, reflect: !0 })
|
|
222
|
-
],
|
|
223
|
-
|
|
223
|
+
], s.prototype, "disabled", 2);
|
|
224
|
+
i([
|
|
224
225
|
a({ type: Boolean, reflect: !0 })
|
|
225
|
-
],
|
|
226
|
-
|
|
226
|
+
], s.prototype, "elevated", 2);
|
|
227
|
+
i([
|
|
227
228
|
a({ type: Boolean, reflect: !0 })
|
|
228
|
-
],
|
|
229
|
-
|
|
229
|
+
], s.prototype, "removable", 2);
|
|
230
|
+
i([
|
|
230
231
|
a({ type: Boolean, reflect: !0 })
|
|
231
|
-
],
|
|
232
|
-
|
|
232
|
+
], s.prototype, "selected", 2);
|
|
233
|
+
i([
|
|
233
234
|
a({ type: String })
|
|
234
|
-
],
|
|
235
|
-
|
|
235
|
+
], s.prototype, "href", 2);
|
|
236
|
+
i([
|
|
236
237
|
a({ type: String })
|
|
237
|
-
],
|
|
238
|
-
|
|
238
|
+
], s.prototype, "target", 2);
|
|
239
|
+
i([
|
|
239
240
|
a({ type: String })
|
|
240
|
-
],
|
|
241
|
-
|
|
241
|
+
], s.prototype, "name", 2);
|
|
242
|
+
i([
|
|
242
243
|
a({ type: String })
|
|
243
|
-
],
|
|
244
|
-
|
|
244
|
+
], s.prototype, "value", 2);
|
|
245
|
+
i([
|
|
245
246
|
a({ type: String, reflect: !0 })
|
|
246
|
-
],
|
|
247
|
-
|
|
247
|
+
], s.prototype, "spacing", 2);
|
|
248
|
+
i([
|
|
248
249
|
a({ type: String, reflect: !0, attribute: "spacing-top" })
|
|
249
|
-
],
|
|
250
|
-
|
|
250
|
+
], s.prototype, "spacingTop", 2);
|
|
251
|
+
i([
|
|
251
252
|
a({ type: String, reflect: !0, attribute: "spacing-bottom" })
|
|
252
|
-
],
|
|
253
|
-
|
|
253
|
+
], s.prototype, "spacingBottom", 2);
|
|
254
|
+
i([
|
|
254
255
|
a({ type: String, reflect: !0, attribute: "spacing-left" })
|
|
255
|
-
],
|
|
256
|
-
|
|
256
|
+
], s.prototype, "spacingLeft", 2);
|
|
257
|
+
i([
|
|
257
258
|
a({ type: String, reflect: !0, attribute: "spacing-right" })
|
|
258
|
-
],
|
|
259
|
-
|
|
259
|
+
], s.prototype, "spacingRight", 2);
|
|
260
|
+
i([
|
|
260
261
|
a({ type: String, reflect: !0 })
|
|
261
|
-
],
|
|
262
|
-
|
|
262
|
+
], s.prototype, "size", 2);
|
|
263
|
+
s = i([
|
|
263
264
|
f("scb-chip")
|
|
264
|
-
],
|
|
265
|
+
], s);
|
|
265
266
|
export {
|
|
266
|
-
|
|
267
|
+
s as ScbChip
|
|
267
268
|
};
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -4725,7 +4725,7 @@
|
|
|
4725
4725
|
/* Ärver färg från container */
|
|
4726
4726
|
color: var(--scb-switch-label-color, inherit);
|
|
4727
4727
|
}
|
|
4728
|
-
`,dt([o({type:String})],Pe.prototype,"label",2),dt([o({type:String,reflect:!0,attribute:"aria-label"})],Pe.prototype,"ariaLabel",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"icons",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"selected",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"disabled",2),dt([o({type:Boolean,reflect:!0,attribute:"full-width"})],Pe.prototype,"fullWidth",2),dt([o({type:String,reflect:!0})],Pe.prototype,"spacing",2),dt([o({type:String,attribute:"spacing-top",reflect:!0})],Pe.prototype,"spacingTop",2),dt([o({type:String,attribute:"spacing-bottom",reflect:!0})],Pe.prototype,"spacingBottom",2),dt([o({type:String,attribute:"spacing-left",reflect:!0})],Pe.prototype,"spacingLeft",2),dt([o({type:String,attribute:"spacing-right",reflect:!0})],Pe.prototype,"spacingRight",2),dt([o({type:String})],Pe.prototype,"name",2),dt([o({type:String})],Pe.prototype,"value",2),Pe=dt([y("scb-switch")],Pe);const pm=Object.freeze(Object.defineProperty({__proto__:null,get ScbSwitch(){return Pe}},Symbol.toStringTag,{value:"Module"}));var hm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,up=t=>{throw TypeError(t)},Ie=(t,e,i,r)=>{for(var s=r>1?void 0:r?um(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&hm(e,i,s),s},bm=(t,e,i)=>e.has(t)||up("Cannot "+i),vm=(t,e,i)=>e.has(t)?up("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),bp=(t,e,i)=>(bm(t,e,"access private method"),i),wo,Pl;let ve=class extends _{constructor(){super(),vm(this,wo),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}updated(t){super.updated(t),(t.has("variant")||t.has("icon"))&&this.__ensureDepsLoaded(),t.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),t.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),t.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),t.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),t.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),t.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(t.has("selected")||t.has("disabled")||t.has("variant")||t.has("value")||t.has("name"))&&this._updateFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&bp(this,wo,Pl).call(this)}firstUpdated(){this.__ensureDepsLoaded(),bp(this,wo,Pl).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await Promise.resolve().then(()=>iu);break;case"filter":await Promise.resolve().then(()=>nu);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await Promise.resolve().then(()=>su),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>mi),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const t=this._renderChip();return this._insideChipSet?t:c`<md-chip-set>${t}</md-chip-set>`}_renderChip(){const t=this.icon?c`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const e=this.target==="_blank"?"noopener noreferrer":void 0;return c`
|
|
4728
|
+
`,dt([o({type:String})],Pe.prototype,"label",2),dt([o({type:String,reflect:!0,attribute:"aria-label"})],Pe.prototype,"ariaLabel",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"icons",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"selected",2),dt([o({type:Boolean,reflect:!0})],Pe.prototype,"disabled",2),dt([o({type:Boolean,reflect:!0,attribute:"full-width"})],Pe.prototype,"fullWidth",2),dt([o({type:String,reflect:!0})],Pe.prototype,"spacing",2),dt([o({type:String,attribute:"spacing-top",reflect:!0})],Pe.prototype,"spacingTop",2),dt([o({type:String,attribute:"spacing-bottom",reflect:!0})],Pe.prototype,"spacingBottom",2),dt([o({type:String,attribute:"spacing-left",reflect:!0})],Pe.prototype,"spacingLeft",2),dt([o({type:String,attribute:"spacing-right",reflect:!0})],Pe.prototype,"spacingRight",2),dt([o({type:String})],Pe.prototype,"name",2),dt([o({type:String})],Pe.prototype,"value",2),Pe=dt([y("scb-switch")],Pe);const pm=Object.freeze(Object.defineProperty({__proto__:null,get ScbSwitch(){return Pe}},Symbol.toStringTag,{value:"Module"}));var hm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,up=t=>{throw TypeError(t)},Ie=(t,e,i,r)=>{for(var s=r>1?void 0:r?um(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&hm(e,i,s),s},bm=(t,e,i)=>e.has(t)||up("Cannot "+i),vm=(t,e,i)=>e.has(t)?up("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),bp=(t,e,i)=>(bm(t,e,"access private method"),i),wo,Pl;let ve=class extends _{constructor(){super(),vm(this,wo),this.variant="assist",this.label="",this.icon="",this.disabled=!1,this.elevated=!1,this.removable=!1,this.selected=!1,this.href="",this.target="",this.name="",this.value="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="medium",this._internals=null,this.__loadedVariants=new Set,this.__chipSetLoaded=!1,this.__iconLoaded=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}updated(t){super.updated(t),(t.has("variant")||t.has("icon"))&&this.__ensureDepsLoaded(),t.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.dispatchEvent(new CustomEvent("disabled-changed",{detail:{disabled:this.disabled},bubbles:!0,composed:!0}))),t.has("variant")&&this.dispatchEvent(new CustomEvent("variant-changed",{detail:{variant:this.variant},bubbles:!0,composed:!0})),t.has("label")&&this.dispatchEvent(new CustomEvent("label-changed",{detail:{label:this.label},bubbles:!0,composed:!0})),t.has("elevated")&&this.dispatchEvent(new CustomEvent("elevated-changed",{detail:{elevated:this.elevated},bubbles:!0,composed:!0})),t.has("icon")&&this.dispatchEvent(new CustomEvent("icon-changed",{detail:{icon:this.icon},bubbles:!0,composed:!0})),t.has("size")&&this.dispatchEvent(new CustomEvent("size-changed",{detail:{size:this.size},bubbles:!0,composed:!0})),(t.has("selected")||t.has("disabled")||t.has("variant")||t.has("value")||t.has("name"))&&this._updateFormValue(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&bp(this,wo,Pl).call(this)}firstUpdated(){this.__ensureDepsLoaded(),bp(this,wo,Pl).call(this),this._updateFormValue()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"assist":await Promise.resolve().then(()=>iu);break;case"filter":await Promise.resolve().then(()=>nu);break}this.__loadedVariants.add(this.variant)}!this._insideChipSet&&!this.__chipSetLoaded&&(await Promise.resolve().then(()=>su),this.__chipSetLoaded=!0),this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>mi),this.__iconLoaded=!0)}get _insideChipSet(){return!!this.closest("md-chip-set")}render(){const t=this._renderChip();return this._insideChipSet?t:c`<md-chip-set>${t}</md-chip-set>`}_renderChip(){const t=this.icon?c`<md-icon slot="icon">${this.icon}</md-icon>`:null;switch(this.variant){case"assist":{const e=this.target==="_blank"?"noopener noreferrer":void 0;return c`
|
|
4729
4729
|
<md-assist-chip
|
|
4730
4730
|
label=${this.label}
|
|
4731
4731
|
?disabled=${this.disabled}
|
|
@@ -4770,24 +4770,25 @@
|
|
|
4770
4770
|
Medium (default) är Material-standardvärdena. */
|
|
4771
4771
|
:host([size='small']) md-assist-chip,
|
|
4772
4772
|
:host([size='small']) md-filter-chip {
|
|
4773
|
-
--md-assist-chip-
|
|
4774
|
-
--md-filter-chip-
|
|
4775
|
-
|
|
4776
|
-
|
|
4773
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
4774
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-small-size);
|
|
4775
|
+
}
|
|
4776
|
+
:host([size='medium']) md-assist-chip,
|
|
4777
|
+
:host([size='medium']) md-filter-chip {
|
|
4778
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
4779
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
|
|
4777
4780
|
}
|
|
4778
4781
|
|
|
4779
4782
|
:host([size='large']) md-assist-chip,
|
|
4780
4783
|
:host([size='large']) md-filter-chip {
|
|
4781
|
-
--md-assist-chip-
|
|
4782
|
-
--md-filter-chip-
|
|
4783
|
-
--md-assist-chip-label-text-size: 0.9375rem;
|
|
4784
|
-
--md-filter-chip-label-text-size: 0.9375rem;
|
|
4784
|
+
--md-assist-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
4785
|
+
--md-filter-chip-label-text-size: var(--md-sys-typescale-body-large-size);
|
|
4785
4786
|
}
|
|
4786
4787
|
|
|
4787
|
-
|
|
4788
|
+
/* md-icon {
|
|
4788
4789
|
color: var(--md-sys-color-on-surface);
|
|
4789
4790
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
4790
|
-
}
|
|
4791
|
+
} */
|
|
4791
4792
|
`,Ie([o({type:String,reflect:!0})],ve.prototype,"variant",2),Ie([o({type:String})],ve.prototype,"label",2),Ie([o({type:String})],ve.prototype,"icon",2),Ie([o({type:Boolean,reflect:!0})],ve.prototype,"disabled",2),Ie([o({type:Boolean,reflect:!0})],ve.prototype,"elevated",2),Ie([o({type:Boolean,reflect:!0})],ve.prototype,"removable",2),Ie([o({type:Boolean,reflect:!0})],ve.prototype,"selected",2),Ie([o({type:String})],ve.prototype,"href",2),Ie([o({type:String})],ve.prototype,"target",2),Ie([o({type:String})],ve.prototype,"name",2),Ie([o({type:String})],ve.prototype,"value",2),Ie([o({type:String,reflect:!0})],ve.prototype,"spacing",2),Ie([o({type:String,reflect:!0,attribute:"spacing-top"})],ve.prototype,"spacingTop",2),Ie([o({type:String,reflect:!0,attribute:"spacing-bottom"})],ve.prototype,"spacingBottom",2),Ie([o({type:String,reflect:!0,attribute:"spacing-left"})],ve.prototype,"spacingLeft",2),Ie([o({type:String,reflect:!0,attribute:"spacing-right"})],ve.prototype,"spacingRight",2),Ie([o({type:String,reflect:!0})],ve.prototype,"size",2),ve=Ie([y("scb-chip")],ve);var mm=Object.defineProperty,fm=Object.getOwnPropertyDescriptor,K=(t,e,i,r)=>{for(var s=r>1?void 0:r?fm(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&mm(e,i,s),s};let q=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=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.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,r,s;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(((s=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:s.assignedElements({flatten:!0}))??[]).forEach(a=>{const n=a.tagName;n==="SCB-TEXTFIELD"&&(a.value=""),n==="SCB-CHECKBOX"&&(a.checked=!1),n==="SCB-RADIO-BUTTON"&&(a.checked=!1),n==="SCB-SWITCH"&&(a.selected=!1),n==="SCB-CHIP"&&(a.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(s=>!s.hasAttribute("disabled"));if(!e.length)return;const i=e[0],r=e[e.length-1];t.shiftKey&&document.activeElement===i?(r.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===r&&(i.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"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 t=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(t===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(t)),this.style.setProperty("--z-dialog",String(t+1))}__applyMaxSize(){const t=(this.maxW??"").trim(),e=(this.maxH??"").trim();t?(this.style.setProperty("--scb-dialog-max-w",t),this.style.setProperty("--scb-dialog-width",`min(${t}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),e?this.style.setProperty("--scb-dialog-max-h",e):this.style.removeProperty("--scb-dialog-max-h")}updated(t){var e,i;if(t.has("zIndex")&&this.__applyZIndex(),(t.has("maxW")||t.has("maxH"))&&this.__applyMaxSize(),t.has("open")){const r=t.get("open");this.__updateTriggersExpanded(),this.open&&!r?this.updateComplete.then(()=>{var a,n,l;const s=(a=this.shadowRoot)==null?void 0:a.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');s?s.focus():(l=(n=this.shadowRoot)==null?void 0:n.querySelector(".container"))==null||l.focus()}):!this.open&&r&&((i=(e=this.__lastTriggerEl)==null?void 0:e.focus)==null||i.call(e)),this.__toggleScrollLock(this.open)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement,i=document.body;if(t){const r=window.innerWidth-e.clientWidth;e.style.overflow="hidden",i.style.paddingRight=r>0?`${r}px`:"";return}e.style.overflow="",i.style.paddingRight=""}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-dialog-spacing-block-start",e):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"),r?this.style.setProperty("--scb-dialog-spacing-inline-start",r):this.style.removeProperty("--scb-dialog-spacing-inline-start"),s?this.style.setProperty("--scb-dialog-spacing-inline-end",s):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}__getSlottedElements(){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("slot");if(!(t instanceof HTMLSlotElement))return[];const e=t.assignedElements({flatten:!0}),i=[];for(const s of e)i.push(s,...Array.from(s.querySelectorAll("*")));return i}__appendHiddenFormValue(t,e,i){const r=document.createElement("input");r.type="hidden",r.name=e,r.value=i,r.setAttribute("data-scb-dialog-generated","true"),t.append(r)}__clearGeneratedFormValues(t){t.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(e=>e.remove())}__syncSlottedFormValues(t){this.__clearGeneratedFormValues(t),this.__getSlottedElements().forEach(i=>{if(!(i instanceof HTMLElement))return;const r=(i.getAttribute("name")??"").trim();if(!(!r||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement){if(i.form===t)return;const a=(i.type||"").toLowerCase();if(a==="checkbox"||a==="radio"){i.checked&&this.__appendHiddenFormValue(t,r,i.value||"on");return}this.__appendHiddenFormValue(t,r,i.value??"");return}if(i instanceof HTMLTextAreaElement){if(i.form===t)return;this.__appendHiddenFormValue(t,r,i.value??"");return}if(i instanceof HTMLSelectElement){if(i.form===t)return;if(i.multiple){Array.from(i.selectedOptions).forEach(a=>{this.__appendHiddenFormValue(t,r,a.value)});return}this.__appendHiddenFormValue(t,r,i.value??"");return}switch(i.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(t,r,String(i.value??""));return;case"SCB-CHECKBOX":i.checked&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":i.checked&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-SWITCH":(i.selected||i.checked)&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-CHIP":i.selected&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;default:"value"in i&&this.__appendHiddenFormValue(t,r,String(i.value??""))}}})}__validateFormAndSlottedFields(t){const e=n=>n.disabled===!0||n.hasAttribute("disabled");let i=t.reportValidity(),r=null;const s=new Set;return this.__getSlottedElements().forEach(n=>{if(!(n instanceof HTMLElement)||s.has(n)||e(n))return;s.add(n);const l=n;if(typeof l.reportValidity=="function"){const d=!!l.reportValidity();!d&&!r&&(r=n),i=i&&d}}),!i&&r&&r.focus(),i}__slotIsEmpty(){var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const e=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return c`
|
|
4792
4793
|
<div class="header">
|
|
4793
4794
|
<div class="title">
|