scb-wc-test 0.1.53 → 0.1.54
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-calendar-card/scb-calendar-card.js +15 -7
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +20 -10
- package/package.json +2 -2
- package/scb-calendar-card/scb-calendar-card.js +9 -1
- package/scb-keyfigure-card/scb-keyfigure-card.js +34 -24
- package/scb-wc-test.bundle.js +19 -1
|
@@ -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 p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x as
|
|
2
|
+
import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x as c,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(n,o,a){try{customElements.get(n)||s(n,o,a)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,t=(i,s,n,o)=>{for(var a=o>1?void 0:o?v(s,n):s,l=i.length-1,d;l>=0;l--)(d=i[l])&&(a=(o?d(s,n,a):d(a))||a);return o&&a&&y(s,n,a),a};let e=class extends f{constructor(){super(...arguments),this.variant="default",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"}async firstUpdated(){e.__iconLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(i=>i.i),__vite__mapDeps([0,1]),import.meta.url),e.__iconLoaded=!0),e.__rippleLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(i=>i.r),__vite__mapDeps([0,1]),import.meta.url),e.__rippleLoaded=!0),this.__applyInnerSizing()}render(){const i=this.variant?`${this.variant.toLowerCase()}`:"",s=this.direction?`${this.direction.toLowerCase()}`:"",n=this.cardHref?"clickable":"",o=1,a="Jan",l=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",d=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",h=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",m=`${l?`inline-size:${l};`:""}${d?`block-size:${d};`:""}${h?`aspect-ratio:${h};`:""}`;return c`
|
|
3
3
|
<div
|
|
4
4
|
class="calendar-card ${s} ${n} ${i}"
|
|
5
5
|
role="${this.cardHref?"link":"group"}"
|
|
@@ -9,8 +9,8 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
9
9
|
@keydown=${this.cardHref?this._onKeyDown:null}
|
|
10
10
|
style="cursor: ${this.cardHref?"pointer":"default"};"
|
|
11
11
|
>
|
|
12
|
-
${this.cardHref?
|
|
13
|
-
${this.showMedia?
|
|
12
|
+
${this.cardHref?c`<md-ripple></md-ripple>`:""}
|
|
13
|
+
${this.showMedia?c`
|
|
14
14
|
<div class="media" style="${m}" aria-label="Datum: ${o} ${a}">
|
|
15
15
|
<div class="day">${o}</div>
|
|
16
16
|
<div class="month">${a}</div>
|
|
@@ -19,10 +19,10 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
19
19
|
<div class="container">
|
|
20
20
|
<div class="header-container">
|
|
21
21
|
<div class="header">${this.title}</div>
|
|
22
|
-
${this.cardHref?
|
|
22
|
+
${this.cardHref?c`<md-icon>arrow_forward</md-icon>`:""}
|
|
23
23
|
</div>
|
|
24
|
-
${this.subtitle?
|
|
25
|
-
${this.supportingText?
|
|
24
|
+
${this.subtitle?c`<div class="subtitle">${this.subtitle}</div>`:""}
|
|
25
|
+
${this.supportingText?c`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
28
|
<md-focus-ring></md-focus-ring>
|
|
@@ -88,6 +88,15 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
88
88
|
max-inline-size: 100%;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/* Lås standard till proportionella siffror i kortet */
|
|
92
|
+
.calendar-card,
|
|
93
|
+
.calendar-card .header,
|
|
94
|
+
.calendar-card .subtitle,
|
|
95
|
+
.calendar-card .supporting-text {
|
|
96
|
+
font-variant-numeric: proportional-nums;
|
|
97
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
91
100
|
.calendar-card:focus,
|
|
92
101
|
.calendar-card:focus-visible { outline: none; }
|
|
93
102
|
|
|
@@ -223,6 +232,5 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
223
232
|
|
|
224
233
|
overflow: visible;
|
|
225
234
|
text-overflow: clip;
|
|
226
|
-
font-variant-numeric: tabular-nums;
|
|
227
235
|
}
|
|
228
236
|
`;t([r({type:String,reflect:!0})],e.prototype,"variant",2);t([r({type:String,reflect:!0})],e.prototype,"direction",2);t([r({type:String})],e.prototype,"title",2);t([r({type:String})],e.prototype,"subtitle",2);t([r({type:String,attribute:"supporting-text"})],e.prototype,"supportingText",2);t([r({type:String,attribute:"card-href"})],e.prototype,"cardHref",2);t([r({type:String,attribute:"card-href-nav"})],e.prototype,"cardHrefNav",2);t([r({type:Boolean,reflect:!0,attribute:"show-media"})],e.prototype,"showMedia",2);t([r({type:String,attribute:"media-width"})],e.prototype,"mediaWidth",2);t([r({type:String,attribute:"media-height"})],e.prototype,"mediaHeight",2);t([r({type:String,attribute:"media-aspect"})],e.prototype,"mediaAspect",2);t([r({type:String,reflect:!0})],e.prototype,"width",2);t([r({type:String,reflect:!0,attribute:"max-width"})],e.prototype,"maxWidth",2);t([r({type:String,attribute:"min-width"})],e.prototype,"minWidth",2);t([r({type:String,reflect:!0})],e.prototype,"height",2);t([r({type:String,reflect:!0,attribute:"max-height"})],e.prototype,"maxHeight",2);t([r({type:String,attribute:"min-height"})],e.prototype,"minHeight",2);t([r({type:String,reflect:!0})],e.prototype,"sizing",2);e=t([u("scb-calendar-card")],e);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d,n as a,i as
|
|
1
|
+
import{a as d,n as a,i as u,x as l,t as p}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,n,o){try{customElements.get(r)||t(r,n,o)}catch(h){var c=String(h||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,r,n)=>{for(var o=n>1?void 0:n?g(t,r):t,c=e.length-1,h;c>=0;c--)(h=e[c])&&(o=(n?h(t,r,o):h(o))||o);return n&&o&&y(t,r,o),o};let i=class extends u{constructor(){super(...arguments),this.keyfigure=0,this.subLabel="",this.supportingText="",this.cardHref="",this.icon="",this.size="standard",this.unit="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.sizing="stretch",this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.location.href=this.cardHref)},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||(window.location.href=this.cardHref))}}formatNumber(e){if(typeof e=="number")return e.toLocaleString("sv-SE").replace(/\u00A0/g," ");const t=Number(e);return Number.isNaN(t)?String(e):t.toLocaleString("sv-SE").replace(/\u00A0/g," ")}render(){const e=!!this.cardHref,t=this.formatNumber(this.keyfigure),r=(this.unit||"").trim(),n=r?`${t} ${r}`:t;return l`
|
|
2
2
|
<div
|
|
3
3
|
class="scb-keyfigure-card ${e?"clickable":""} ${this.size}"
|
|
4
4
|
role=${e?"link":"group"}
|
|
@@ -8,29 +8,30 @@ import{a as d,n as a,i as p,x as o,t as u}from"../../vendor/vendor.js";import"..
|
|
|
8
8
|
@keydown=${e?this.__onKeyDown:null}
|
|
9
9
|
style="cursor:${e?"pointer":"default"};"
|
|
10
10
|
>
|
|
11
|
-
${e?
|
|
12
|
-
${this.icon?
|
|
11
|
+
${e?l`<md-ripple></md-ripple>`:""}
|
|
12
|
+
${this.icon?l`<md-icon>${this.icon}</md-icon>`:""}
|
|
13
13
|
|
|
14
|
-
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?
|
|
14
|
+
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?l`
|
|
15
15
|
<div class="keyfigure">
|
|
16
16
|
<span class="value" aria-label="${n}">
|
|
17
|
-
${t}${r?
|
|
17
|
+
${t}${r?l`<span class="unit" aria-hidden="true">\u00A0${r}</span>`:""}
|
|
18
18
|
</span>
|
|
19
|
-
${e?
|
|
19
|
+
${e?l`<md-icon>arrow_forward</md-icon>`:""}
|
|
20
20
|
</div>
|
|
21
21
|
`:""}
|
|
22
22
|
|
|
23
|
-
${this.subLabel?
|
|
23
|
+
${this.subLabel?l`
|
|
24
24
|
<div class="sub-label">
|
|
25
|
-
${e?
|
|
25
|
+
${e?l`<a href="${this.cardHref}" tabindex="-1">${this.subLabel}</a>`:this.subLabel}
|
|
26
26
|
</div>
|
|
27
27
|
`:""}
|
|
28
28
|
|
|
29
|
-
${this.supportingText?
|
|
29
|
+
${this.supportingText?l`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<md-focus-ring></md-focus-ring>
|
|
33
33
|
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing()}firstUpdated(){this.__applyInnerSizing()}};i.styles=d`
|
|
34
|
+
|
|
34
35
|
:host {
|
|
35
36
|
display: block;
|
|
36
37
|
box-sizing: border-box;
|
|
@@ -40,6 +41,15 @@ import{a as d,n as a,i as p,x as o,t as u}from"../../vendor/vendor.js";import"..
|
|
|
40
41
|
padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
/* Ska vi ha tabulära eller inte? */
|
|
45
|
+
.scb-keyfigure-card,
|
|
46
|
+
.scb-keyfigure-card .keyfigure,
|
|
47
|
+
.scb-keyfigure-card .value {
|
|
48
|
+
font-variant-numeric: proportional-nums !important;
|
|
49
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
43
53
|
:host([sizing="stretch"]) {
|
|
44
54
|
inline-size: 100%;
|
|
45
55
|
block-size: 100%;
|
|
@@ -124,4 +134,4 @@ import{a as d,n as a,i as p,x as o,t as u}from"../../vendor/vendor.js";import"..
|
|
|
124
134
|
line-height: var(--md-sys-typescale-display-medium-line-height);
|
|
125
135
|
letter-spacing: var(--md-sys-typescale-display-medium-tracking);
|
|
126
136
|
}
|
|
127
|
-
`;s([a({attribute:"keyfigure"})],i.prototype,"keyfigure",2);s([a({type:String,attribute:"sub-label"})],i.prototype,"subLabel",2);s([a({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);s([a({type:String,attribute:"card-href"})],i.prototype,"cardHref",2);s([a({type:String})],i.prototype,"icon",2);s([a({type:String})],i.prototype,"size",2);s([a({type:String})],i.prototype,"unit",2);s([a({type:String,reflect:!0})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);i=s([
|
|
137
|
+
`;s([a({attribute:"keyfigure"})],i.prototype,"keyfigure",2);s([a({type:String,attribute:"sub-label"})],i.prototype,"subLabel",2);s([a({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);s([a({type:String,attribute:"card-href"})],i.prototype,"cardHref",2);s([a({type:String})],i.prototype,"icon",2);s([a({type:String})],i.prototype,"size",2);s([a({type:String})],i.prototype,"unit",2);s([a({type:String,reflect:!0})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);i=s([p("scb-keyfigure-card")],i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.54",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -278,5 +278,5 @@
|
|
|
278
278
|
},
|
|
279
279
|
"./mvc/*": "./mvc/*"
|
|
280
280
|
},
|
|
281
|
-
"buildHash": "
|
|
281
|
+
"buildHash": "EC0AF9D18867B05B30D091D7EF9AB03D65337938FA6DBD440BA55348D4D5946D"
|
|
282
282
|
}
|
|
@@ -123,6 +123,15 @@ e.styles = m`
|
|
|
123
123
|
max-inline-size: 100%;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/* Lås standard till proportionella siffror i kortet */
|
|
127
|
+
.calendar-card,
|
|
128
|
+
.calendar-card .header,
|
|
129
|
+
.calendar-card .subtitle,
|
|
130
|
+
.calendar-card .supporting-text {
|
|
131
|
+
font-variant-numeric: proportional-nums;
|
|
132
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
126
135
|
.calendar-card:focus,
|
|
127
136
|
.calendar-card:focus-visible { outline: none; }
|
|
128
137
|
|
|
@@ -258,7 +267,6 @@ e.styles = m`
|
|
|
258
267
|
|
|
259
268
|
overflow: visible;
|
|
260
269
|
text-overflow: clip;
|
|
261
|
-
font-variant-numeric: tabular-nums;
|
|
262
270
|
}
|
|
263
271
|
`;
|
|
264
272
|
t([
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { css as p, LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { css as p, LitElement as u, html as a } from "lit";
|
|
2
|
+
import { property as s, customElement as d } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/icon/icon.js";
|
|
4
4
|
import "@material/web/ripple/ripple.js";
|
|
5
5
|
import "@material/web/focus/md-focus-ring.js";
|
|
6
|
-
var
|
|
7
|
-
for (var l = o > 1 ? void 0 : o ? g(
|
|
8
|
-
(c = e[h]) && (l = (o ? c(
|
|
9
|
-
return o && l &&
|
|
6
|
+
var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, t = (e, r, n, o) => {
|
|
7
|
+
for (var l = o > 1 ? void 0 : o ? g(r, n) : r, h = e.length - 1, c; h >= 0; h--)
|
|
8
|
+
(c = e[h]) && (l = (o ? c(r, n, l) : c(l)) || l);
|
|
9
|
+
return o && l && y(r, n, l), l;
|
|
10
10
|
};
|
|
11
|
-
let i = class extends
|
|
11
|
+
let i = class extends u {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments), this.keyfigure = 0, this.subLabel = "", this.supportingText = "", this.cardHref = "", this.icon = "", this.size = "standard", this.unit = "", this.width = "", this.maxWidth = "", this.height = "", this.maxHeight = "", this.sizing = "stretch", this.__onKeyDown = (e) => {
|
|
14
14
|
(e.key === "Enter" || e.key === " ") && this.cardHref && (e.preventDefault(), window.location.href = this.cardHref);
|
|
@@ -19,11 +19,11 @@ let i = class extends d {
|
|
|
19
19
|
formatNumber(e) {
|
|
20
20
|
if (typeof e == "number")
|
|
21
21
|
return e.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
22
|
-
const
|
|
23
|
-
return Number.isNaN(
|
|
22
|
+
const r = Number(e);
|
|
23
|
+
return Number.isNaN(r) ? String(e) : r.toLocaleString("sv-SE").replace(/\u00A0/g, " ");
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
const e = !!this.cardHref,
|
|
26
|
+
const e = !!this.cardHref, r = this.formatNumber(this.keyfigure), n = (this.unit || "").trim(), o = n ? `${r} ${n}` : r;
|
|
27
27
|
return a`
|
|
28
28
|
<div
|
|
29
29
|
class="scb-keyfigure-card ${e ? "clickable" : ""} ${this.size}"
|
|
@@ -40,7 +40,7 @@ let i = class extends d {
|
|
|
40
40
|
${this.keyfigure !== void 0 && this.keyfigure !== null && this.keyfigure !== "" ? a`
|
|
41
41
|
<div class="keyfigure">
|
|
42
42
|
<span class="value" aria-label="${o}">
|
|
43
|
-
${
|
|
43
|
+
${r}${n ? a`<span class="unit" aria-hidden="true">\u00A0${n}</span>` : ""}
|
|
44
44
|
</span>
|
|
45
45
|
${e ? a`<md-icon>arrow_forward</md-icon>` : ""}
|
|
46
46
|
</div>
|
|
@@ -71,6 +71,7 @@ let i = class extends d {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
i.styles = p`
|
|
74
|
+
|
|
74
75
|
:host {
|
|
75
76
|
display: block;
|
|
76
77
|
box-sizing: border-box;
|
|
@@ -80,6 +81,15 @@ i.styles = p`
|
|
|
80
81
|
padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
/* Ska vi ha tabulära eller inte? */
|
|
85
|
+
.scb-keyfigure-card,
|
|
86
|
+
.scb-keyfigure-card .keyfigure,
|
|
87
|
+
.scb-keyfigure-card .value {
|
|
88
|
+
font-variant-numeric: proportional-nums !important;
|
|
89
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
83
93
|
:host([sizing="stretch"]) {
|
|
84
94
|
inline-size: 100%;
|
|
85
95
|
block-size: 100%;
|
|
@@ -166,43 +176,43 @@ i.styles = p`
|
|
|
166
176
|
}
|
|
167
177
|
`;
|
|
168
178
|
t([
|
|
169
|
-
|
|
179
|
+
s({ attribute: "keyfigure" })
|
|
170
180
|
], i.prototype, "keyfigure", 2);
|
|
171
181
|
t([
|
|
172
|
-
|
|
182
|
+
s({ type: String, attribute: "sub-label" })
|
|
173
183
|
], i.prototype, "subLabel", 2);
|
|
174
184
|
t([
|
|
175
|
-
|
|
185
|
+
s({ type: String, attribute: "supporting-text" })
|
|
176
186
|
], i.prototype, "supportingText", 2);
|
|
177
187
|
t([
|
|
178
|
-
|
|
188
|
+
s({ type: String, attribute: "card-href" })
|
|
179
189
|
], i.prototype, "cardHref", 2);
|
|
180
190
|
t([
|
|
181
|
-
|
|
191
|
+
s({ type: String })
|
|
182
192
|
], i.prototype, "icon", 2);
|
|
183
193
|
t([
|
|
184
|
-
|
|
194
|
+
s({ type: String })
|
|
185
195
|
], i.prototype, "size", 2);
|
|
186
196
|
t([
|
|
187
|
-
|
|
197
|
+
s({ type: String })
|
|
188
198
|
], i.prototype, "unit", 2);
|
|
189
199
|
t([
|
|
190
|
-
|
|
200
|
+
s({ type: String, reflect: !0 })
|
|
191
201
|
], i.prototype, "width", 2);
|
|
192
202
|
t([
|
|
193
|
-
|
|
203
|
+
s({ type: String, reflect: !0, attribute: "max-width" })
|
|
194
204
|
], i.prototype, "maxWidth", 2);
|
|
195
205
|
t([
|
|
196
|
-
|
|
206
|
+
s({ type: String, reflect: !0 })
|
|
197
207
|
], i.prototype, "height", 2);
|
|
198
208
|
t([
|
|
199
|
-
|
|
209
|
+
s({ type: String, reflect: !0, attribute: "max-height" })
|
|
200
210
|
], i.prototype, "maxHeight", 2);
|
|
201
211
|
t([
|
|
202
|
-
|
|
212
|
+
s({ type: String, reflect: !0 })
|
|
203
213
|
], i.prototype, "sizing", 2);
|
|
204
214
|
i = t([
|
|
205
|
-
|
|
215
|
+
d("scb-keyfigure-card")
|
|
206
216
|
], i);
|
|
207
217
|
export {
|
|
208
218
|
i as ScbKeyFigureCard
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -3089,6 +3089,15 @@ var ScbWcTest=function(a){"use strict";var xs;function d(o,e,t,r){var i=argument
|
|
|
3089
3089
|
max-inline-size: 100%;
|
|
3090
3090
|
}
|
|
3091
3091
|
|
|
3092
|
+
/* Lås standard till proportionella siffror i kortet */
|
|
3093
|
+
.calendar-card,
|
|
3094
|
+
.calendar-card .header,
|
|
3095
|
+
.calendar-card .subtitle,
|
|
3096
|
+
.calendar-card .supporting-text {
|
|
3097
|
+
font-variant-numeric: proportional-nums;
|
|
3098
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3092
3101
|
.calendar-card:focus,
|
|
3093
3102
|
.calendar-card:focus-visible { outline: none; }
|
|
3094
3103
|
|
|
@@ -3224,7 +3233,6 @@ var ScbWcTest=function(a){"use strict";var xs;function d(o,e,t,r){var i=argument
|
|
|
3224
3233
|
|
|
3225
3234
|
overflow: visible;
|
|
3226
3235
|
text-overflow: clip;
|
|
3227
|
-
font-variant-numeric: tabular-nums;
|
|
3228
3236
|
}
|
|
3229
3237
|
`,H([l({type:String,reflect:!0})],a.ScbCalendarCard.prototype,"variant",2),H([l({type:String,reflect:!0})],a.ScbCalendarCard.prototype,"direction",2),H([l({type:String})],a.ScbCalendarCard.prototype,"title",2),H([l({type:String})],a.ScbCalendarCard.prototype,"subtitle",2),H([l({type:String,attribute:"supporting-text"})],a.ScbCalendarCard.prototype,"supportingText",2),H([l({type:String,attribute:"card-href"})],a.ScbCalendarCard.prototype,"cardHref",2),H([l({type:String,attribute:"card-href-nav"})],a.ScbCalendarCard.prototype,"cardHrefNav",2),H([l({type:Boolean,reflect:!0,attribute:"show-media"})],a.ScbCalendarCard.prototype,"showMedia",2),H([l({type:String,attribute:"media-width"})],a.ScbCalendarCard.prototype,"mediaWidth",2),H([l({type:String,attribute:"media-height"})],a.ScbCalendarCard.prototype,"mediaHeight",2),H([l({type:String,attribute:"media-aspect"})],a.ScbCalendarCard.prototype,"mediaAspect",2),H([l({type:String,reflect:!0})],a.ScbCalendarCard.prototype,"width",2),H([l({type:String,reflect:!0,attribute:"max-width"})],a.ScbCalendarCard.prototype,"maxWidth",2),H([l({type:String,attribute:"min-width"})],a.ScbCalendarCard.prototype,"minWidth",2),H([l({type:String,reflect:!0})],a.ScbCalendarCard.prototype,"height",2),H([l({type:String,reflect:!0,attribute:"max-height"})],a.ScbCalendarCard.prototype,"maxHeight",2),H([l({type:String,attribute:"min-height"})],a.ScbCalendarCard.prototype,"minHeight",2),H([l({type:String,reflect:!0})],a.ScbCalendarCard.prototype,"sizing",2),a.ScbCalendarCard=H([g("scb-calendar-card")],a.ScbCalendarCard);var rd=Object.defineProperty,id=Object.getOwnPropertyDescriptor,E=(o,e,t,r)=>{for(var i=r>1?void 0:r?id(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&rd(e,t,i),i};a.ScbCard=class extends y{constructor(){super(...arguments),this.type="",this.variant="",this.direction="",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.title="",this.subLabel="",this.supportingText="",this.commentsText="",this.comments=0,this.likesText="",this.likes=0,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.__onImgLoad=e=>{const t=e.currentTarget.closest(".media");t&&t.classList.add("is-loaded")},this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||window.open(this.cardHref,"_self"))}}__calcAspectWH(e){const t=(e||"").trim();if(!t)return{w:640,h:360};const r=t.includes("/")?t.split("/"):t.includes(":")?t.split(":"):t.includes("x")?t.split("x"):null;if(r&&r.length===2){const s=Number(r[0]),n=Number(r[1]);if(s>0&&n>0)return{w:s,h:n}}const i=Number(t);return isFinite(i)&&i>0?{w:1e3,h:Math.round(1e3/i)}:{w:640,h:360}}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return c`
|
|
3230
3238
|
<div class="media">
|
|
@@ -5181,6 +5189,7 @@ var ScbWcTest=function(a){"use strict";var xs;function d(o,e,t,r){var i=argument
|
|
|
5181
5189
|
|
|
5182
5190
|
<md-focus-ring></md-focus-ring>
|
|
5183
5191
|
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing()}firstUpdated(){this.__applyInnerSizing()}},a.ScbKeyFigureCard.styles=b`
|
|
5192
|
+
|
|
5184
5193
|
:host {
|
|
5185
5194
|
display: block;
|
|
5186
5195
|
box-sizing: border-box;
|
|
@@ -5190,6 +5199,15 @@ var ScbWcTest=function(a){"use strict";var xs;function d(o,e,t,r){var i=argument
|
|
|
5190
5199
|
padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
|
|
5191
5200
|
}
|
|
5192
5201
|
|
|
5202
|
+
/* Ska vi ha tabulära eller inte? */
|
|
5203
|
+
.scb-keyfigure-card,
|
|
5204
|
+
.scb-keyfigure-card .keyfigure,
|
|
5205
|
+
.scb-keyfigure-card .value {
|
|
5206
|
+
font-variant-numeric: proportional-nums !important;
|
|
5207
|
+
font-feature-settings: "tnum" 0, "pnum" 1;
|
|
5208
|
+
}
|
|
5209
|
+
|
|
5210
|
+
|
|
5193
5211
|
:host([sizing="stretch"]) {
|
|
5194
5212
|
inline-size: 100%;
|
|
5195
5213
|
block-size: 100%;
|