scb-wc-test 0.1.25 → 0.1.27
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-breadcrumb/scb-breadcrumb-item.js +3 -11
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +7 -6
- package/mvc/components/scb-card/scb-card.js +124 -104
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -14
- package/package.json +2 -2
- package/scb-breadcrumb/scb-breadcrumb-item.js +9 -17
- package/scb-breadcrumb/scb-breadcrumb.d.ts +3 -0
- package/scb-breadcrumb/scb-breadcrumb.js +34 -24
- package/scb-card/scb-card.d.ts +16 -0
- package/scb-card/scb-card.js +245 -170
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +2 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +49 -49
- package/scb-wc-test.bundle.js +274 -258
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import{n as l,t as p,i as b,a as
|
|
1
|
+
import{n as l,t as p,i as b,a as f,x as u}from"../../vendor/vendor.js";import"../scb-link/scb-link.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 t=customElements.define.bind(customElements);customElements.define=function(r,s,e){try{customElements.get(r)||t(r,s,e)}catch(n){var a=String(n||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var d=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(i,t,r,s)=>{for(var e=s>1?void 0:s?m(t,r):t,a=i.length-1,n;a>=0;a--)(n=i[a])&&(e=(s?n(t,r,e):n(e))||e);return s&&e&&d(t,r,e),e};let c=class extends b{constructor(){super(...arguments),this.label="",this.isCurrent=!1,this.href=""}static get styles(){return f`
|
|
2
2
|
.breadcrumb-separator {
|
|
3
|
-
margin: 0
|
|
3
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
4
4
|
color: var(--md-sys-color-on-surface);
|
|
5
5
|
}
|
|
6
|
-
.breadcrumb-link {
|
|
7
|
-
color: var(--md-sys-color-primary);
|
|
8
|
-
text-decoration-thickness: 1px;
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
.breadcrumb-link:hover {
|
|
12
|
-
text-decoration-thickness: 2px;
|
|
13
|
-
}
|
|
14
6
|
`}render(){switch(!0){case this.isCurrent:return u`<span class="breadcrumb-current">${this.label}</span>`;default:return u`
|
|
15
7
|
<scb-link href="${this.href}">${this.label}</scb-link>
|
|
16
8
|
<span class="breadcrumb-separator">/</span>
|
|
17
|
-
`}}};
|
|
9
|
+
`}}};o([l({type:String})],c.prototype,"label",2);o([l({type:Boolean,attribute:"is-current"})],c.prototype,"isCurrent",2);o([l({type:String,attribute:"item-href"})],c.prototype,"href",2);c=o([p("scb-breadcrumb-item")],c);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{n as d,t as
|
|
1
|
+
import{n as d,t as b,i as m,a as p,x as o}from"../../vendor/vendor.js";import"./scb-breadcrumb-item.js";import"../../vendor/vendor-material.js";import"../scb-link/scb-link.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(s,t,a){try{customElements.get(s)||r(s,t,a)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var u=Object.defineProperty,h=Object.getOwnPropertyDescriptor,c=(e,r,s,t)=>{for(var a=t>1?void 0:t?h(r,s):r,i=e.length-1,l;i>=0;i--)(l=e[i])&&(a=(t?l(r,s,a):l(a))||a);return t&&a&&u(r,s,a),a};let n=class extends m{constructor(){super(...arguments),this.showAll=!1}static get styles(){return p`
|
|
2
2
|
.scb-breadcrumb {
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
}
|
|
7
7
|
.breadcrumb-separator {
|
|
8
|
-
margin: 0
|
|
8
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
9
9
|
color: var(--md-sys-color-on-surface);
|
|
10
10
|
}
|
|
11
11
|
.collapsed > scb-breadcrumb-item {
|
|
@@ -13,7 +13,8 @@ import{n as d,t as m,i as p,a as b,x as o}from"../../vendor/vendor.js";import"./
|
|
|
13
13
|
}
|
|
14
14
|
.collapsed > scb-breadcrumb-item:nth-child(-n+3),
|
|
15
15
|
.collapsed > scb-breadcrumb-item:nth-last-child(-n+3) {
|
|
16
|
-
display:
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: anchor-center;
|
|
17
18
|
}
|
|
18
19
|
.ellipsis:focus {
|
|
19
20
|
outline: none;
|
|
@@ -51,9 +52,9 @@ import{n as d,t as m,i as p,a as b,x as o}from"../../vendor/vendor.js";import"./
|
|
|
51
52
|
transform: translateY(0);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
`}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");e&&(e.forEach((r,s)=>{r.classList.add("breadcrumb-animate"),r.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(r=>{r.classList.remove("breadcrumb-animate"),r.style.animationDelay=""})},600))}))}render(){let e=[];this.children.length||(e=Array.from(this.shadowRoot?this.shadowRoot.querySelectorAll("scb-breadcrumb-item"):[])),e.length||(e=Array.from(this.children).filter(s=>s.tagName.toLowerCase()==="scb-breadcrumb-item")),e.length>0&&e[e.length-1].setAttribute("is-current","true");const r=e.length>6&&!this.showAll;return o`
|
|
55
|
+
`}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");e&&(e.forEach((r,s)=>{r.classList.add("breadcrumb-animate"),r.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(r=>{r.classList.remove("breadcrumb-animate"),r.style.animationDelay=""})},600))}))}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>{this.requestUpdate()}),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}render(){let e=[];this.children.length||(e=Array.from(this.shadowRoot?this.shadowRoot.querySelectorAll("scb-breadcrumb-item"):[])),e.length||(e=Array.from(this.children).filter(s=>s.tagName.toLowerCase()==="scb-breadcrumb-item")),e.length>0&&e[e.length-1].setAttribute("is-current","true");const r=e.length>6&&!this.showAll;return o`
|
|
55
56
|
<div class="scb-breadcrumb ${r?"collapsed":"expanded"}">
|
|
56
|
-
${r?e.map((s,
|
|
57
|
+
${r?e.map((s,t)=>t===3?o`<span
|
|
57
58
|
class="ellipsis"
|
|
58
59
|
aria-label="Visa alla"
|
|
59
60
|
role="button"
|
|
@@ -62,4 +63,4 @@ import{n as d,t as m,i as p,a as b,x as o}from"../../vendor/vendor.js";import"./
|
|
|
62
63
|
@keydown=${a=>{(a.key==="Enter"||a.key===" ")&&this._onEllipsisClick()}}
|
|
63
64
|
><md-icon><md-focus-ring></md-focus-ring>more_horiz</md-icon></span><span class="breadcrumb-separator">/</span>${s}`:o`${s}`):e.map(s=>s)}
|
|
64
65
|
</div>
|
|
65
|
-
`}};c([d({type:Boolean})],n.prototype,"showAll",2);n=c([
|
|
66
|
+
`}};c([d({type:Boolean})],n.prototype,"showAll",2);n=c([b("scb-breadcrumb")],n);
|
|
@@ -1,108 +1,111 @@
|
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${this.
|
|
15
|
-
${
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import{_ as m}from"../../vendor/preload-helper.js";import{a as v,n as s,i as u,x as i,E as b,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-list/scb-list-item.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(l,r,o){try{customElements.get(l)||n(l,r,o)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y=Object.defineProperty,f=Object.getOwnPropertyDescriptor,e=(a,n,l,r)=>{for(var o=r>1?void 0:r?f(n,l):n,d=a.length-1,c;d>=0;d--)(c=a[d])&&(o=(r?c(n,l,o):c(o))||o);return r&&o&&y(n,l,o),o};let t=class extends u{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=a=>{const n=a.currentTarget.closest(".media");n&&n.classList.add("is-loaded")},this.__onKeyDown=a=>{(a.key==="Enter"||a.key===" ")&&this.cardHref&&(a.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=a=>{this.cardHref&&(a.target.closest("a")||window.open(this.cardHref,"_self"))}}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return i`
|
|
3
|
+
<div class="media">
|
|
4
|
+
<slot name="media">
|
|
5
|
+
<scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
|
|
6
|
+
</slot>
|
|
7
|
+
</div>
|
|
8
|
+
`;if(this.mediaHref||this.mediaSrcset){const n=this.mediaAspect?`aspect-ratio:${this.mediaAspect};`:"",l=this.mediaPlaceholder?"has-ph":"",r=this.mediaFit||"cover",o=this.mediaPosition||"center";return i`
|
|
9
|
+
<div class="media ${l}" style="${n}">
|
|
10
|
+
<!-- Tillåt egna <source>-element via slot om man vill använda <picture> -->
|
|
11
|
+
<slot name="media-sources"></slot>
|
|
12
|
+
<img
|
|
13
|
+
src="${this.mediaHref||""}"
|
|
14
|
+
srcset="${this.mediaSrcset||""}"
|
|
15
|
+
sizes="${this.mediaSizes||""}"
|
|
16
|
+
alt="${this.mediaAlt||""}"
|
|
17
|
+
loading="${this.mediaLoading}"
|
|
18
|
+
decoding="${this.mediaDecoding}"
|
|
19
|
+
fetchpriority="${this.mediaFetchPriority}"
|
|
20
|
+
style="object-fit:${r};object-position:${o};"
|
|
21
|
+
width="${this.mediaWidth||b}"
|
|
22
|
+
height="${this.mediaHeight||b}"
|
|
23
|
+
@load=${this.__onImgLoad}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
`}return null}render(){const a=this.variant?`${this.variant.toLowerCase()}`:"",n=this.type==="list"?"vertical":this.direction?this.direction.toLowerCase():"",l=this.cardHref?"clickable":"",r=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",o=(h=!1)=>h?i`<a class="title" href="${this.cardHref}" tabindex="0">${this.title}</a><md-icon>arrow_forward</md-icon>`:i`<span class="title">${this.title}</span>`,d=()=>this.__mediaTemplate(),c=this.cardHref?{role:"link",tabindex:"0","aria-label":this.title||"Kort"}:{role:"group",tabindex:"-1","aria-label":this.title||"Kort"},p=h=>i`
|
|
27
|
+
<div
|
|
28
|
+
class="scb-card ${a} ${n} ${l}"
|
|
29
|
+
@click=${this.cardHref?this.__handleHrefNavigation:null}
|
|
30
|
+
@keydown=${this.cardHref?this.__onKeyDown:null}
|
|
31
|
+
style="cursor:${this.cardHref?"pointer":"default"};"
|
|
32
|
+
...=${c}
|
|
33
|
+
>
|
|
34
|
+
${this.cardHref?i`<md-ripple></md-ripple>`:""}
|
|
35
|
+
${d()}
|
|
36
|
+
${h}
|
|
37
|
+
</div>
|
|
38
|
+
<md-focus-ring></md-focus-ring>
|
|
39
|
+
`;switch(this.type){case"standard":return p(i`
|
|
40
|
+
<div class="full-content">
|
|
41
|
+
<div class="top-content">
|
|
42
|
+
${this.title?i`<div class="header">${o(!!this.cardHref)}</div>`:""}
|
|
43
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
44
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
45
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
23
46
|
</div>
|
|
24
47
|
</div>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
<div class="content list">
|
|
37
|
-
<slot></slot>
|
|
38
|
-
</div>
|
|
48
|
+
`);case"list":return p(i`
|
|
49
|
+
<div class="full-content">
|
|
50
|
+
<div class="top-content">
|
|
51
|
+
${this.title?i`<div class="header"><span class="title">${this.title}</span></div>`:""}
|
|
52
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
53
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
54
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
55
|
+
</div>
|
|
56
|
+
<div class="content list">
|
|
57
|
+
<slot></slot>
|
|
39
58
|
</div>
|
|
40
59
|
</div>
|
|
41
|
-
|
|
42
|
-
<div class="
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<div class="social-metrics">
|
|
54
|
-
<span class="comments"><md-icon>mode_comment</md-icon> <span>${this.commentsText}: ${this.comments}</span></span>
|
|
55
|
-
<span class="likes"><md-icon>thumb_up</md-icon> <span>${this.likesText}: ${this.likes}</span></span>
|
|
56
|
-
</div>
|
|
60
|
+
`);case"social":return p(i`
|
|
61
|
+
<div class="full-content">
|
|
62
|
+
<div class="top-content">
|
|
63
|
+
${this.title?i`<div class="header">${o(!!this.cardHref)}</div>`:""}
|
|
64
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
65
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
66
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
67
|
+
</div>
|
|
68
|
+
<div class="content">
|
|
69
|
+
<div class="social-metrics">
|
|
70
|
+
<span class="comments"><md-icon>mode_comment</md-icon> <span>${this.commentsText}: ${this.comments}</span></span>
|
|
71
|
+
<span class="likes"><md-icon>thumb_up</md-icon> <span>${this.likesText}: ${this.likes}</span></span>
|
|
57
72
|
</div>
|
|
58
73
|
</div>
|
|
59
74
|
</div>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</div>
|
|
71
|
-
<div class="content links">
|
|
72
|
-
<slot></slot>
|
|
73
|
-
</div>
|
|
75
|
+
`);case"link":return p(i`
|
|
76
|
+
<div class="full-content">
|
|
77
|
+
<div class="top-content">
|
|
78
|
+
${this.title?i`<div class="header"><span class="title">${this.title}</span></div>`:""}
|
|
79
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
80
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
81
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
82
|
+
</div>
|
|
83
|
+
<div class="content links">
|
|
84
|
+
<slot></slot>
|
|
74
85
|
</div>
|
|
75
86
|
</div>
|
|
76
|
-
|
|
77
|
-
<div class="
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<div class="content actions">
|
|
87
|
-
<slot></slot>
|
|
88
|
-
</div>
|
|
87
|
+
`);case"action":return p(i`
|
|
88
|
+
<div class="full-content">
|
|
89
|
+
<div class="top-content">
|
|
90
|
+
${this.title?i`<div class="header"><span class="title">${this.title}</span></div>`:""}
|
|
91
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
92
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
93
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
94
|
+
</div>
|
|
95
|
+
<div class="content actions">
|
|
96
|
+
<slot></slot>
|
|
89
97
|
</div>
|
|
90
98
|
</div>
|
|
91
|
-
|
|
92
|
-
<div class="
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
${this.subLabel?t`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
99
|
-
${this.supportingText?t`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
100
|
-
${a?t`<div class="date">${a}</div>`:""}
|
|
101
|
-
</div>
|
|
99
|
+
`);default:return p(i`
|
|
100
|
+
<div class="full-content">
|
|
101
|
+
<div class="top-content">
|
|
102
|
+
${this.title?i`<div class="header">${o(!!this.cardHref)}</div>`:""}
|
|
103
|
+
${this.subLabel?i`<div class="sub-label">${this.subLabel}</div>`:""}
|
|
104
|
+
${this.supportingText?i`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
105
|
+
${r?i`<div class="date">${r}</div>`:""}
|
|
102
106
|
</div>
|
|
103
107
|
</div>
|
|
104
|
-
|
|
105
|
-
`}}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("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density"))}async firstUpdated(){if(i.__iconLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),i.__iconLoaded=!0),i.__rippleLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),i.__rippleLoaded=!0),this.cardHref){const e=this.renderRoot.querySelector(".scb-card");e&&e.addEventListener("click",l=>{l.target.closest("a")||(window.location.href=this.cardHref)})}}};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=h`
|
|
108
|
+
`)}}updated(a){super.updated(a),a.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),a.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),a.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),a.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),a.has("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.style.setProperty("--scb-card-media-fit",this.mediaFit||"cover"),this.style.setProperty("--scb-card-media-position",this.mediaPosition||"center")}async firstUpdated(){t.__iconLoaded||(await m(()=>import("../../vendor/vendor-material.js").then(a=>a.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),t.__rippleLoaded||(await m(()=>import("../../vendor/vendor-material.js").then(a=>a.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0)}};t.__iconLoaded=!1;t.__rippleLoaded=!1;t.styles=v`
|
|
106
109
|
:host {
|
|
107
110
|
display: block;
|
|
108
111
|
box-sizing: border-box;
|
|
@@ -190,9 +193,35 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as h,n as r,i as m,x
|
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
.media {
|
|
196
|
+
position: relative;
|
|
193
197
|
display: inline-flex;
|
|
194
198
|
flex: 0 0 auto;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
195
201
|
}
|
|
202
|
+
.media img {
|
|
203
|
+
display: block;
|
|
204
|
+
inline-size: 100%;
|
|
205
|
+
max-inline-size: 100%;
|
|
206
|
+
height: auto;
|
|
207
|
+
object-fit: var(--scb-card-media-fit, cover);
|
|
208
|
+
object-position: var(--scb-card-media-position, center);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* Skeleton-placeholder */
|
|
212
|
+
.media.has-ph::before {
|
|
213
|
+
content: '';
|
|
214
|
+
position: absolute;
|
|
215
|
+
inset: 0;
|
|
216
|
+
background:
|
|
217
|
+
linear-gradient(90deg,
|
|
218
|
+
rgba(0,0,0,.06) 25%,
|
|
219
|
+
rgba(0,0,0,.12) 37%,
|
|
220
|
+
rgba(0,0,0,.06) 63%);
|
|
221
|
+
animation: scb-card-shimmer 1.2s infinite linear;
|
|
222
|
+
}
|
|
223
|
+
.media.is-loaded::before { content: none; }
|
|
224
|
+
@keyframes scb-card-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
|
|
196
225
|
|
|
197
226
|
.full-content { padding: var(--spacing-7) var(--spacing-6); }
|
|
198
227
|
.top-content {
|
|
@@ -206,7 +235,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as h,n as r,i as m,x
|
|
|
206
235
|
font-size: var(--md-sys-typescale-headline-small-size);
|
|
207
236
|
font-weight: var(--weight-bold);
|
|
208
237
|
line-height: var(--md-sys-typescale-headline-small-line-height);
|
|
209
|
-
letter-spacing: var(--md-sys-typescale-headline-small-
|
|
238
|
+
letter-spacing: var(--md-sys-typescale-headline-small-tracking);
|
|
210
239
|
display: flex;
|
|
211
240
|
align-items: center;
|
|
212
241
|
justify-content: space-between;
|
|
@@ -242,16 +271,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as h,n as r,i as m,x
|
|
|
242
271
|
.date {
|
|
243
272
|
font-size: var(--md-sys-typescale-body-medium-size);
|
|
244
273
|
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
245
|
-
letter-spacing: var(--md-sys-typescale-body-medium-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.media img {
|
|
249
|
-
display: block;
|
|
250
|
-
border-radius: var(--md-sys-shape-corner-large);
|
|
251
|
-
inline-size: 100%;
|
|
252
|
-
max-inline-size: 100%;
|
|
253
|
-
height: auto;
|
|
254
|
-
object-fit: cover;
|
|
274
|
+
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
255
275
|
}
|
|
256
276
|
|
|
257
277
|
.media ::slotted(scb-avatar) {
|
|
@@ -278,7 +298,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as h,n as r,i as m,x
|
|
|
278
298
|
|
|
279
299
|
.scb-card.horizontal .media img {
|
|
280
300
|
margin: 0;
|
|
281
|
-
object-fit: cover;
|
|
301
|
+
object-fit: var(--scb-card-media-fit, cover);
|
|
282
302
|
aspect-ratio: var(--scb-card-horizontal-media-aspect);
|
|
283
303
|
flex: 0 1 var(--scb-card-horizontal-media-max);
|
|
284
304
|
min-inline-size: var(--scb-card-horizontal-media-min);
|
|
@@ -332,4 +352,4 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as h,n as r,i as m,x
|
|
|
332
352
|
.scb-card.filled .content.list ::slotted(scb-list) {
|
|
333
353
|
--scb-list-bg: var(--md-sys-color-surface-dim);
|
|
334
354
|
}
|
|
335
|
-
`;
|
|
355
|
+
`;e([s({type:String})],t.prototype,"type",2);e([s({type:String})],t.prototype,"variant",2);e([s({type:String})],t.prototype,"direction",2);e([s({type:String,attribute:"media-type"})],t.prototype,"mediaType",2);e([s({type:String,attribute:"media-href"})],t.prototype,"mediaHref",2);e([s({type:String,attribute:"media-alt"})],t.prototype,"mediaAlt",2);e([s({type:String,attribute:"media-srcset"})],t.prototype,"mediaSrcset",2);e([s({type:String,attribute:"media-sizes"})],t.prototype,"mediaSizes",2);e([s({type:String,attribute:"media-loading"})],t.prototype,"mediaLoading",2);e([s({type:String,attribute:"media-decoding"})],t.prototype,"mediaDecoding",2);e([s({type:String,attribute:"media-fetchpriority"})],t.prototype,"mediaFetchPriority",2);e([s({type:String,attribute:"media-fit"})],t.prototype,"mediaFit",2);e([s({type:String,attribute:"media-position"})],t.prototype,"mediaPosition",2);e([s({type:String,attribute:"media-width"})],t.prototype,"mediaWidth",2);e([s({type:String,attribute:"media-height"})],t.prototype,"mediaHeight",2);e([s({type:String,attribute:"media-aspect"})],t.prototype,"mediaAspect",2);e([s({type:Boolean,attribute:"media-placeholder"})],t.prototype,"mediaPlaceholder",2);e([s({type:String,attribute:"card-href"})],t.prototype,"cardHref",2);e([s({type:String})],t.prototype,"title",2);e([s({type:String,attribute:"sub-label"})],t.prototype,"subLabel",2);e([s({type:String,attribute:"supporting-text"})],t.prototype,"supportingText",2);e([s({type:Date,reflect:!0})],t.prototype,"date",2);e([s({type:String,attribute:"social-comments-text"})],t.prototype,"commentsText",2);e([s({type:Number,attribute:"social-comments",reflect:!0})],t.prototype,"comments",2);e([s({type:String,attribute:"social-likes-text"})],t.prototype,"likesText",2);e([s({type:Number,attribute:"social-likes",reflect:!0})],t.prototype,"likes",2);e([s({type:String,reflect:!0})],t.prototype,"sizing",2);e([s({type:String,reflect:!0})],t.prototype,"width",2);e([s({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",2);e([s({type:String,reflect:!0})],t.prototype,"height",2);e([s({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",2);t=e([g("scb-card")],t);
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import{a as d,n as
|
|
1
|
+
import{a as d,n as a,i as p,x as l,t as y}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(c){var h=String(c||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var u=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,r,n)=>{for(var o=n>1?void 0:n?g(t,r):t,h=e.length-1,c;h>=0;h--)(c=e[h])&&(o=(n?c(t,r,o):c(o))||o);return n&&o&&u(t,r,o),o};let i=class extends p{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"}
|
|
5
5
|
tabindex=${e?"0":"-1"}
|
|
6
|
-
aria-label=${this.subLabel||
|
|
6
|
+
aria-label=${this.subLabel||n}
|
|
7
|
+
@click=${e?this.__handleHrefNavigation:null}
|
|
8
|
+
@keydown=${e?this.__onKeyDown:null}
|
|
9
|
+
style="cursor:${e?"pointer":"default"};"
|
|
7
10
|
>
|
|
8
|
-
${e?
|
|
9
|
-
${this.icon?
|
|
11
|
+
${e?l`<md-ripple></md-ripple>`:""}
|
|
12
|
+
${this.icon?l`<md-icon>${this.icon}</md-icon>`:""}
|
|
10
13
|
|
|
11
|
-
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?
|
|
14
|
+
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?l`
|
|
12
15
|
<div class="keyfigure">
|
|
13
|
-
<span class="value">
|
|
14
|
-
${
|
|
16
|
+
<span class="value" aria-label="${n}">
|
|
17
|
+
${t}${r?l`<span class="unit" aria-hidden="true">\u00A0${r}</span>`:""}
|
|
15
18
|
</span>
|
|
16
|
-
${e?
|
|
19
|
+
${e?l`<md-icon>arrow_forward</md-icon>`:""}
|
|
17
20
|
</div>
|
|
18
21
|
`:""}
|
|
19
22
|
|
|
20
|
-
${this.subLabel?
|
|
23
|
+
${this.subLabel?l`
|
|
21
24
|
<div class="sub-label">
|
|
22
|
-
${e?
|
|
25
|
+
${e?l`<a href="${this.cardHref}" tabindex="-1">${this.subLabel}</a>`:this.subLabel}
|
|
23
26
|
</div>
|
|
24
27
|
`:""}
|
|
25
28
|
|
|
26
|
-
${this.supportingText?
|
|
29
|
+
${this.supportingText?l`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
27
30
|
</div>
|
|
28
31
|
|
|
29
32
|
<md-focus-ring></md-focus-ring>
|
|
30
|
-
`}__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(){
|
|
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`
|
|
31
34
|
:host {
|
|
32
35
|
display: block;
|
|
33
36
|
box-sizing: border-box;
|
|
@@ -97,7 +100,7 @@ import{a as d,n as r,i as p,x as a,t as y}from"../../vendor/vendor.js";import"..
|
|
|
97
100
|
letter-spacing: var(--md-sys-typescale-headline-large-tracking);
|
|
98
101
|
}
|
|
99
102
|
.keyfigure .value { white-space: nowrap; }
|
|
100
|
-
.keyfigure .unit { margin-inline-start: .25em; }
|
|
103
|
+
.keyfigure .unit { margin-inline-start: .25em; white-space: nowrap; }
|
|
101
104
|
|
|
102
105
|
.sub-label {
|
|
103
106
|
font-size: var(--md-sys-typescale-title-medium-size);
|
|
@@ -120,4 +123,4 @@ import{a as d,n as r,i as p,x as a,t as y}from"../../vendor/vendor.js";import"..
|
|
|
120
123
|
line-height: var(--md-sys-typescale-display-medium-line-height);
|
|
121
124
|
letter-spacing: var(--md-sys-typescale-display-medium-tracking);
|
|
122
125
|
}
|
|
123
|
-
`;s([
|
|
126
|
+
`;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})],i.prototype,"width",2);s([a({type:String,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String})],i.prototype,"height",2);s([a({type:String,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);i=s([y("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.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -273,5 +273,5 @@
|
|
|
273
273
|
},
|
|
274
274
|
"./mvc/*": "./mvc/*"
|
|
275
275
|
},
|
|
276
|
-
"buildHash": "
|
|
276
|
+
"buildHash": "76634EA48E454A3CAD4956F1E9591F79B83002232CD775FBE6B180BF39CF3F64"
|
|
277
277
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement as u, css as b, html as l } from "lit";
|
|
2
|
-
import { property as
|
|
2
|
+
import { property as c, customElement as m } from "lit/decorators.js";
|
|
3
3
|
import "../scb-link/scb-link.js";
|
|
4
|
-
var
|
|
5
|
-
for (var r = s > 1 ? void 0 : s ?
|
|
6
|
-
(i = p
|
|
7
|
-
return s && r &&
|
|
4
|
+
var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, a = (o, t, n, s) => {
|
|
5
|
+
for (var r = s > 1 ? void 0 : s ? h(t, n) : t, p = o.length - 1, i; p >= 0; p--)
|
|
6
|
+
(i = o[p]) && (r = (s ? i(t, n, r) : i(r)) || r);
|
|
7
|
+
return s && r && f(t, n, r), r;
|
|
8
8
|
};
|
|
9
9
|
let e = class extends u {
|
|
10
10
|
constructor() {
|
|
@@ -13,17 +13,9 @@ let e = class extends u {
|
|
|
13
13
|
static get styles() {
|
|
14
14
|
return b`
|
|
15
15
|
.breadcrumb-separator {
|
|
16
|
-
margin: 0
|
|
16
|
+
margin: var(--spacing-0) var(--spacing-3);
|
|
17
17
|
color: var(--md-sys-color-on-surface);
|
|
18
18
|
}
|
|
19
|
-
.breadcrumb-link {
|
|
20
|
-
color: var(--md-sys-color-primary);
|
|
21
|
-
text-decoration-thickness: 1px;
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
.breadcrumb-link:hover {
|
|
25
|
-
text-decoration-thickness: 2px;
|
|
26
|
-
}
|
|
27
19
|
`;
|
|
28
20
|
}
|
|
29
21
|
render() {
|
|
@@ -39,13 +31,13 @@ let e = class extends u {
|
|
|
39
31
|
}
|
|
40
32
|
};
|
|
41
33
|
a([
|
|
42
|
-
|
|
34
|
+
c({ type: String })
|
|
43
35
|
], e.prototype, "label", 2);
|
|
44
36
|
a([
|
|
45
|
-
|
|
37
|
+
c({ type: Boolean, attribute: "is-current" })
|
|
46
38
|
], e.prototype, "isCurrent", 2);
|
|
47
39
|
a([
|
|
48
|
-
|
|
40
|
+
c({ type: String, attribute: "item-href" })
|
|
49
41
|
], e.prototype, "href", 2);
|
|
50
42
|
e = a([
|
|
51
43
|
m("scb-breadcrumb-item")
|
|
@@ -3,6 +3,9 @@ export declare class SCBBreadcrumb extends LitElement {
|
|
|
3
3
|
showAll: boolean;
|
|
4
4
|
static get styles(): import('lit').CSSResult;
|
|
5
5
|
private _onEllipsisClick;
|
|
6
|
+
private _observer?;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
disconnectedCallback(): void;
|
|
6
9
|
render(): TemplateResult;
|
|
7
10
|
}
|
|
8
11
|
declare global {
|