scb-wc-test 0.1.276 → 0.1.278
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-card/scb-card.js +106 -57
- package/mvc/components/scb-viz/scb-viz.js +41 -23
- package/package.json +2 -2
- package/scb-card/scb-card.d.ts +6 -0
- package/scb-card/scb-card.js +145 -70
- package/scb-viz/scb-viz.d.ts +1 -0
- package/scb-viz/scb-viz.js +188 -167
- package/scb-wc-test.bundle.js +256 -189
|
@@ -1,11 +1,11 @@
|
|
|
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{_}from"../../vendor/preload-helper.js";import{a as
|
|
2
|
+
import{_ as S}from"../../vendor/preload-helper.js";import{a as E,n as a,i as L,x as r,E as m,t as C}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list-item.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(n,c,o){try{customElements.get(n)||e(n,c,o)}catch(h){var l=String(h||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var F=Object.defineProperty,H=Object.getOwnPropertyDescriptor,w=t=>{throw TypeError(t)},s=(t,e,n,c)=>{for(var o=c>1?void 0:c?H(e,n):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(o=(c?h(e,n,o):h(o))||o);return c&&o&&F(e,n,o),o},B=(t,e,n)=>e.has(t)||w("Cannot "+n),N=(t,e,n)=>e.has(t)?w("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),f=(t,e,n)=>(B(t,e,"access private method"),n),y,z,k;const d={fromAttribute:t=>t??"",toAttribute:t=>typeof t!="string"||t.trim()===""?null:t};let i=class extends L{constructor(){super(...arguments),N(this,y),this.__managedSocialAttributes=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="vertical",this.size="large",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.href="",this.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.commentsEnabled=!0,this.commentsHref="",this.likesText="",this.likesEnabled=!0,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=t=>{const e=t.currentTarget.closest(".media");e&&e.classList.add("is-loaded")},this.__onKeyDown=t=>{const e=this.__effectiveHref();(t.key==="Enter"||t.key===" ")&&e&&(t.preventDefault(),this.__navigate(e,t))},this.__handleHrefNavigation=t=>{const e=this.__effectiveHref();e&&(t.target.closest("a")||this.__navigate(e,t))}}attributeChangedCallback(t,e,n){this.__isSyncingManagedSocialAttributes&&this.__managedSocialAttributes.has(t)||super.attributeChangedCallback(t,e,n)}get likeButton(){return this.type!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:640,h:360};const n=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(n&&n.length===2){const o=Number(n[0]),l=Number(n[1]);if(o>0&&l>0)return{w:o,h:l}}const c=Number(e);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:640,h:360}}__noWrapText(t){return(t??"").replace(/ /g," ").replace(/-/g,"‑")}__dispatchLikeEvent(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent(t.replace("-",""),{bubbles:!0,composed:!0,detail:e}))}__dispatchSocialActionEvent(t,e){this.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:e}}))}__dispatchCardNavigate(t,e){const n={href:t,originalEvent:e},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const o=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});return this.dispatchEvent(o),!o.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return r`
|
|
3
3
|
<div class="media">
|
|
4
4
|
<slot name="media">
|
|
5
5
|
<scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
|
|
6
6
|
</slot>
|
|
7
7
|
</div>
|
|
8
|
-
`;if(this.mediaHref||this.mediaSrcset){let e=Number(this.mediaWidth)||0,n=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!e||!n){const
|
|
8
|
+
`;if(this.mediaHref||this.mediaSrcset){let e=Number(this.mediaWidth)||0,n=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!e||!n){const h=this.__calcAspectWH(c||"16/9");e||(e=h.w),n||(n=h.h)}const o=`aspect-ratio:${c||`${e}/${n}`};`,l=this.mediaPlaceholder?"has-ph":"";return r`
|
|
9
9
|
<div class="media ${l}" style="${o}">
|
|
10
10
|
<slot name="media-sources"></slot>
|
|
11
11
|
<img
|
|
@@ -21,27 +21,27 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
21
21
|
@load=${this.__onImgLoad}
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
|
-
`}return null}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}__syncStringAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="string"&&e.trim()!==""?this.setAttribute(t,e):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="number"&&Number.isFinite(e)?this.setAttribute(t,String(e)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{e?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.type==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.variant?`${this.variant.toLowerCase()}`:"",e=this.type==="list"||this.type==="container"?"vertical":this.direction?this.direction.toLowerCase():"vertical",n=this.__effectiveHref(),c=(this.type==="standard"||this.type==="social")&&!!n,o=c?"clickable":"",l=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",
|
|
24
|
+
`}return null}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}__syncStringAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="string"&&e.trim()!==""?this.setAttribute(t,e):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="number"&&Number.isFinite(e)?this.setAttribute(t,String(e)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{e?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.type==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.variant?`${this.variant.toLowerCase()}`:"",e=this.type==="list"||this.type==="container"?"vertical":this.direction?this.direction.toLowerCase():"vertical",n=this.__effectiveHref(),c=(this.type==="standard"||this.type==="social")&&!!n,o=c?"clickable":"",l=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",h=(g=!1)=>g?r`<a class="title" href="${n}" tabindex="-1"
|
|
25
25
|
>${this.title}</a
|
|
26
|
-
><md-icon>arrow_forward</md-icon>`:r`<span class="title">${this.title}</span>`,
|
|
26
|
+
><md-icon>arrow_forward</md-icon>`:r`<span class="title">${this.title}</span>`,T=()=>this.type==="container"?null:this.__mediaTemplate(),b=g=>r`
|
|
27
27
|
<div
|
|
28
28
|
class="scb-card ${t} ${e} ${o}"
|
|
29
29
|
@click=${c?this.__handleHrefNavigation:null}
|
|
30
30
|
@keydown=${c?this.__onKeyDown:null}
|
|
31
31
|
style="cursor:${c?"pointer":"default"};"
|
|
32
|
-
role=${c?"link"
|
|
33
|
-
tabindex=${c?"0"
|
|
32
|
+
role=${c?"link":m}
|
|
33
|
+
tabindex=${c?"0":m}
|
|
34
34
|
aria-label=${this.title||this.subtitle||"Kort"}
|
|
35
35
|
>
|
|
36
36
|
${c?r`<md-ripple></md-ripple>`:""}
|
|
37
|
-
${
|
|
38
|
-
${
|
|
37
|
+
${T()}
|
|
38
|
+
${g}
|
|
39
39
|
</div>
|
|
40
40
|
<md-focus-ring></md-focus-ring>
|
|
41
41
|
`;switch(this.type){case"standard":return b(r`
|
|
42
42
|
<div class="full-content">
|
|
43
43
|
<div class="top-content">
|
|
44
|
-
${this.title?r`<div class="header">${
|
|
44
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
45
45
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
46
46
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
47
47
|
${l?r`<div class="date">${l}</div>`:""}
|
|
@@ -59,29 +59,30 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
59
59
|
<slot></slot>
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
62
|
-
`);case"social":const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
`);case"social":const g=this.commentsHref,_=p=>{p.stopPropagation()},v=p=>{const u=this.renderRoot?.querySelector(".scb-card");u&&(p?u.classList.add("no-hover"):u.classList.remove("no-hover"))},P=this.commentsText?`${this.commentsText}: `:"",A=this.likesText?`${this.likesText}: `:"",x=p=>u=>{u.stopPropagation(),this.__dispatchSocialActionEvent(p,u)},$=this.likesEnabled?r`
|
|
63
|
+
<span
|
|
64
|
+
class="likes"
|
|
65
|
+
@mouseenter=${()=>v(!0)}
|
|
66
|
+
@mouseleave=${()=>v(!1)}
|
|
67
|
+
>
|
|
68
|
+
${this.likesInteractive?r`
|
|
69
|
+
<scb-icon-button
|
|
70
|
+
id="like-button"
|
|
71
|
+
variant="standard"
|
|
72
|
+
icon="thumb_up"
|
|
73
|
+
?icon-filled=${this.hasLiked}
|
|
74
|
+
aria-label="${this.likesText||"Gilla"}"
|
|
75
|
+
@click=${p=>{p.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes??0})}}
|
|
76
|
+
@keydown=${p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),p.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes??0}))}}
|
|
77
|
+
@hover=${p=>{p.preventDefault(),p.stopPropagation(),this.__dispatchLikeEvent("like-hover",{hasLiked:this.hasLiked,likes:this.likes??0})}}
|
|
78
|
+
></scb-icon-button>
|
|
79
|
+
`:r`<md-icon>thumb_up</md-icon>`}
|
|
80
|
+
<span class="social-text">${A}${this.likes??0}</span>
|
|
81
|
+
</span>
|
|
82
|
+
`:m;return b(r`
|
|
82
83
|
<div class="full-content">
|
|
83
84
|
<div class="top-content">
|
|
84
|
-
${this.title?r`<div class="header">${
|
|
85
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
85
86
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
86
87
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
87
88
|
${l?r`<div class="date">${l}</div>`:""}
|
|
@@ -93,31 +94,33 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
93
94
|
class="author social-text"
|
|
94
95
|
href="${this.authorHref||"#"}"
|
|
95
96
|
tabindex="0"
|
|
96
|
-
@click=${
|
|
97
|
-
@mouseenter=${()=>
|
|
98
|
-
@mouseleave=${()=>
|
|
97
|
+
@click=${_}
|
|
98
|
+
@mouseenter=${()=>v(!0)}
|
|
99
|
+
@mouseleave=${()=>v(!1)}
|
|
99
100
|
>${this.authorText}</a
|
|
100
101
|
>
|
|
101
102
|
`:""}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
${this.commentsEnabled?r`
|
|
104
|
+
<span
|
|
105
|
+
class="comments"
|
|
106
|
+
@mouseenter=${()=>v(!0)}
|
|
107
|
+
@mouseleave=${()=>v(!1)}
|
|
108
|
+
>
|
|
109
|
+
${g!==""?r`
|
|
110
|
+
<scb-icon-button
|
|
111
|
+
href="${g}"
|
|
112
|
+
tabindex="0"
|
|
113
|
+
@click=${_}
|
|
114
|
+
variant="standard"
|
|
115
|
+
icon="comment"
|
|
116
|
+
aria-label="Gå till kommentarer"
|
|
117
|
+
></scb-icon-button>
|
|
118
|
+
`:r`
|
|
119
|
+
<md-icon>comment</md-icon>
|
|
120
|
+
`}
|
|
121
|
+
<span class="social-text">${P}${this.comments??0}</span>
|
|
122
|
+
</span>
|
|
123
|
+
`:m}
|
|
121
124
|
${this.likesHoverContent?r`
|
|
122
125
|
<scb-tooltip
|
|
123
126
|
variant="rich"
|
|
@@ -126,9 +129,42 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
126
129
|
trigger="hover"
|
|
127
130
|
position="right"
|
|
128
131
|
>
|
|
129
|
-
${
|
|
132
|
+
${$}
|
|
130
133
|
</scb-tooltip>
|
|
131
|
-
|
|
134
|
+
`:$}
|
|
135
|
+
${this.replyEnabled?r`
|
|
136
|
+
<span class="social-action">
|
|
137
|
+
<scb-icon-button
|
|
138
|
+
variant="standard"
|
|
139
|
+
icon="reply"
|
|
140
|
+
aria-label="Svara"
|
|
141
|
+
@click=${x("reply")}
|
|
142
|
+
></scb-icon-button>
|
|
143
|
+
<span class="social-text">Svara</span>
|
|
144
|
+
</span>
|
|
145
|
+
`:m}
|
|
146
|
+
${this.editEnabled?r`
|
|
147
|
+
<span class="social-action">
|
|
148
|
+
<scb-icon-button
|
|
149
|
+
variant="standard"
|
|
150
|
+
icon="edit"
|
|
151
|
+
aria-label="Redigera"
|
|
152
|
+
@click=${x("edit")}
|
|
153
|
+
></scb-icon-button>
|
|
154
|
+
<span class="social-text">Redigera</span>
|
|
155
|
+
</span>
|
|
156
|
+
`:m}
|
|
157
|
+
${this.deleteEnabled?r`
|
|
158
|
+
<span class="social-action">
|
|
159
|
+
<scb-icon-button
|
|
160
|
+
variant="standard"
|
|
161
|
+
icon="delete"
|
|
162
|
+
aria-label="Ta bort"
|
|
163
|
+
@click=${x("delete")}
|
|
164
|
+
></scb-icon-button>
|
|
165
|
+
<span class="social-text">Ta bort</span>
|
|
166
|
+
</span>
|
|
167
|
+
`:m}
|
|
132
168
|
</div>
|
|
133
169
|
</div>
|
|
134
170
|
</div>
|
|
@@ -169,13 +205,13 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
169
205
|
`);default:return b(r`
|
|
170
206
|
<div class="full-content">
|
|
171
207
|
<div class="top-content">
|
|
172
|
-
${this.title?r`<div class="header">${
|
|
208
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
173
209
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
174
210
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
175
211
|
${l?r`<div class="date">${l}</div>`:""}
|
|
176
212
|
</div>
|
|
177
213
|
</div>
|
|
178
|
-
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&
|
|
214
|
+
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&f(this,y,z).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&f(this,y,k).call(this)}async firstUpdated(t){i.__iconLoaded||(await S(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),i.__iconLoaded=!0),i.__rippleLoaded||(await S(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),i.__rippleLoaded=!0),f(this,y,z).call(this),f(this,y,k).call(this),this.__syncSocialAttributes()}};y=new WeakSet;z=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,n=this.mapSpacingToken(this.spacingBottom)??t,c=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-card-spacing-block-start",e):this.style.removeProperty("--scb-card-spacing-block-start"),n?this.style.setProperty("--scb-card-spacing-block-end",n):this.style.removeProperty("--scb-card-spacing-block-end"),c?this.style.setProperty("--scb-card-spacing-inline-start",c):this.style.removeProperty("--scb-card-spacing-inline-start"),o?this.style.setProperty("--scb-card-spacing-inline-end",o):this.style.removeProperty("--scb-card-spacing-inline-end")};k=function(){const t=this.mapSpacingToken(this.innerPadding),e=this.mapSpacingToken(this.paddingTop)??t,n=this.mapSpacingToken(this.paddingBottom)??t,c=this.mapSpacingToken(this.paddingLeft)??t,o=this.mapSpacingToken(this.paddingRight)??t;e?this.style.setProperty("--scb-card-content-padding-block-start",e):this.style.removeProperty("--scb-card-content-padding-block-start"),n?this.style.setProperty("--scb-card-content-padding-block-end",n):this.style.removeProperty("--scb-card-content-padding-block-end"),c?this.style.setProperty("--scb-card-content-padding-inline-start",c):this.style.removeProperty("--scb-card-content-padding-inline-start"),o?this.style.setProperty("--scb-card-content-padding-inline-end",o):this.style.removeProperty("--scb-card-content-padding-inline-end")};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=E`
|
|
179
215
|
:host {
|
|
180
216
|
display: block;
|
|
181
217
|
box-sizing: border-box;
|
|
@@ -623,6 +659,19 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
623
659
|
gap: var(--spacing-2, 4px);
|
|
624
660
|
}
|
|
625
661
|
|
|
662
|
+
/* .social-actions {
|
|
663
|
+
display: flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
gap: var(--spacing-3, 8px);
|
|
666
|
+
flex-wrap: wrap;
|
|
667
|
+
} */
|
|
668
|
+
|
|
669
|
+
.social-action {
|
|
670
|
+
display: inline-flex;
|
|
671
|
+
align-items: center;
|
|
672
|
+
gap: var(--spacing-1, 2px);
|
|
673
|
+
}
|
|
674
|
+
|
|
626
675
|
.scb-card .content.list {
|
|
627
676
|
margin-top: var(--scb-card-size-list-offset);
|
|
628
677
|
}
|
|
@@ -652,4 +701,4 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
652
701
|
.scb-card.filled-alternative .content.list ::slotted(scb-list) {
|
|
653
702
|
--scb-list-bg: var(--md-sys-color-surface-container, #EEF3FF);
|
|
654
703
|
}
|
|
655
|
-
`;s([a({type:String,reflect:!0,converter:d})],i.prototype,"type",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"variant",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"direction",2);s([a({type:String,reflect:!0})],i.prototype,"size",2);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0,converter:d})],i.prototype,"cardHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"href",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"title",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0,converter:d})],i.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],i.prototype,"date",2);s([a({type:String,attribute:"social-comments-text"})],i.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments"})],i.prototype,"comments",2);s([a({type:String,attribute:"social-comments-href"})],i.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text"})],i.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes"})],i.prototype,"likes",2);s([a({type:String,attribute:"social-likes-hover-content"})],i.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked"})],i.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive"})],i.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author"})],i.prototype,"author",2);s([a({type:String,attribute:"social-author-text"})],i.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href"})],i.prototype,"authorHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"sizing",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width",converter:d})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height",converter:d})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0,converter:d})],i.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:d})],i.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0,converter:d})],i.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0,converter:d})],i.prototype,"spacingRight",2);s([a({type:String,attribute:"padding",reflect:!0,converter:d})],i.prototype,"innerPadding",2);s([a({type:String,attribute:"padding-top",reflect:!0,converter:d})],i.prototype,"paddingTop",2);s([a({type:String,attribute:"padding-bottom",reflect:!0,converter:d})],i.prototype,"paddingBottom",2);s([a({type:String,attribute:"padding-left",reflect:!0,converter:d})],i.prototype,"paddingLeft",2);s([a({type:String,attribute:"padding-right",reflect:!0,converter:d})],i.prototype,"paddingRight",2);i=s([
|
|
704
|
+
`;s([a({type:String,reflect:!0,converter:d})],i.prototype,"type",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"variant",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"direction",2);s([a({type:String,reflect:!0})],i.prototype,"size",2);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0,converter:d})],i.prototype,"cardHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"href",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"title",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0,converter:d})],i.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],i.prototype,"date",2);s([a({type:String,attribute:"social-comments-text"})],i.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments"})],i.prototype,"comments",2);s([a({type:Boolean,attribute:"social-comments-enabled"})],i.prototype,"commentsEnabled",2);s([a({type:String,attribute:"social-comments-href"})],i.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text"})],i.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes"})],i.prototype,"likes",2);s([a({type:Boolean,attribute:"social-likes-enabled"})],i.prototype,"likesEnabled",2);s([a({type:String,attribute:"social-likes-hover-content"})],i.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked"})],i.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive"})],i.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author"})],i.prototype,"author",2);s([a({type:String,attribute:"social-author-text"})],i.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href"})],i.prototype,"authorHref",2);s([a({type:Boolean,attribute:"social-reply-enabled"})],i.prototype,"replyEnabled",2);s([a({type:Boolean,attribute:"social-edit-enabled"})],i.prototype,"editEnabled",2);s([a({type:Boolean,attribute:"social-delete-enabled"})],i.prototype,"deleteEnabled",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"sizing",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width",converter:d})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height",converter:d})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0,converter:d})],i.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:d})],i.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0,converter:d})],i.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0,converter:d})],i.prototype,"spacingRight",2);s([a({type:String,attribute:"padding",reflect:!0,converter:d})],i.prototype,"innerPadding",2);s([a({type:String,attribute:"padding-top",reflect:!0,converter:d})],i.prototype,"paddingTop",2);s([a({type:String,attribute:"padding-bottom",reflect:!0,converter:d})],i.prototype,"paddingBottom",2);s([a({type:String,attribute:"padding-left",reflect:!0,converter:d})],i.prototype,"paddingLeft",2);s([a({type:String,attribute:"padding-right",reflect:!0,converter:d})],i.prototype,"paddingRight",2);i=s([C("scb-card")],i);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as W,n as
|
|
1
|
+
import{a as W,n as v,r as F,i as O,x as s,k as A,l as M,t as q}from"../../vendor/vendor.js";import"../scb-chip/scb-chip.js";import"../scb-segmented-button/scb-segmented-button.js";import"../scb-segmented-button/scb-segmented-item.js";import"../scb-accordion/scb-accordion.js";import"../scb-divider/scb-divider.js";import"../scb-horizontal-scroller/scb-horizontal-scroller.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.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(a,n,i){try{customElements.get(a)||e(a,n,i)}catch(p){var g=String(p||"");if(g.indexOf("already been used")===-1&&g.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var B=Object.defineProperty,G=Object.getOwnPropertyDescriptor,I=t=>{throw TypeError(t)},h=(t,e,a,n)=>{for(var i=n>1?void 0:n?G(e,a):e,g=t.length-1,p;g>=0;g--)(p=t[g])&&(i=(n?p(e,a,i):p(i))||i);return n&&i&&B(e,a,i),i},N=(t,e,a)=>e.has(t)||I("Cannot "+a),j=(t,e,a)=>e.has(t)?I("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),r=(t,e,a)=>(N(t,e,"access private method"),a),c,R,H,V,w,k,P,E,S,T,y,D;const L=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
2
2
|
viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
|
|
3
3
|
<style type="text/css">
|
|
4
4
|
.st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
|
|
@@ -113,19 +113,20 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
113
113
|
<path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
|
|
114
114
|
<path d="M701.8,24.4h5.8v26.3h0.1l11.2-14.1h7l-10,11.7l11.4,18.3H720l-7.7-14l-4.6,5.4v8.7h-5.8V24.4H701.8z"/>
|
|
115
115
|
</svg>
|
|
116
|
-
`;let
|
|
116
|
+
`;let o=class extends O{constructor(){super(...arguments),j(this,c),this.variant="Standard",this.selectedChip="Diagram",this.title="",this.subtitle="",this.description="",this.comment="",this.source="",this.footnote="",this.lang="sv",this.imageHref="",this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth="",this.containerMaxWidth="",this.contentHeight="",this._diagramReflowFrame=0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}get descriptionLabel(){return this.lang==="en"?"Description of the chart":"Beskrivning av diagrammet"}get moreAboutStatsLabel(){return this.lang==="en"?"More about the statistics":"Mer om statistiken"}get commentLabel(){return this.lang==="en"?"Comments":"Kommentar"}get sourceLabel(){return this.lang==="en"?"Source":"Källa"}get footnoteLabel(){return this.lang==="en"?"Footnotes":"Fotnot"}get officialStatisticsLabel(){return this.lang==="en"?"Official statistics of Sweden":"Sveriges officiella statistik"}get officialStatisticsTitle(){return this.lang==="en"?"Part of Official statistics of Sweden":"Tillhör Sveriges officiella statistik"}get officialStatisticsAlt(){return this.lang==="en"?"Read more about Official statistics of Sweden":"Läs mer om Sveriges officiella statistik"}_getImageAltText(){return[this.title,this.subtitle,this.description].map(e=>typeof e=="string"?e.trim():"").filter(Boolean).join(". ")||(this.lang==="en"?"Image figure":"Bildfigur")}firstUpdated(t){this._readTableDataFromSlot(),r(this,c,T).call(this),r(this,c,D).call(this),r(this,c,S).call(this),this._syncChipClass(),r(this,c,R).call(this),r(this,c,w).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&this._syncChipClass(),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&r(this,c,T).call(this),t.has("containerMaxWidth")&&r(this,c,D).call(this),t.has("variant")&&r(this,c,R).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("variant"))&&r(this,c,S).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight"))&&r(this,c,w).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,c,H).call(this),r(this,c,V).call(this)}_onTableSlotChange(t){const e=t.target;e&&this._readTableDataFromSlot(e)}_onDiagramSlotChange(){r(this,c,S).call(this),r(this,c,w).call(this)}_normalizeRenderableCell(t){return t&&typeof t=="object"&&"html"in t&&"text"in t?{html:typeof t.html=="string"?t.html:"",text:typeof t.text=="string"?t.text:""}:{html:"",text:t==null?"":String(t)}}_readTableDataFromSlot(t){const e=t||this.shadowRoot?.querySelector('slot[name="table"]');if(!e)return;const a=e.assignedElements({flatten:!0}),n=[];a.forEach(d=>{if(d.tagName==="TABLE"){n.push(d);return}d.querySelectorAll("table").forEach(b=>n.push(b))});const i=n[0];if(!i){this._slottedTableData=void 0;return}const g=[],p=[],l=[],m=d=>d?(d.textContent??"").replace(/\s+/g," ").trim():"",f=d=>d?{html:(d.innerHTML??"").trim(),text:m(d)}:{html:"",text:""},u=i.querySelector("thead tr");u&&Array.from(u.querySelectorAll("th, td")).forEach(b=>g.push(f(b)));const z=Array.from(i.querySelectorAll("tbody tr")),_=z.length>0?z:Array.from(i.querySelectorAll("tr")).filter(d=>d.closest("thead")===null);if(_.forEach(d=>{const b=Array.from(d.querySelectorAll("th, td"));if(b.length===0)return;const x=b[0].tagName==="TH"&&d.closest("thead")===null&&d.closest("tfoot")===null;l.push(x);const $=[];b.forEach(C=>$.push(f(C))),p.push($)}),!u&&p.length>0){const d=p[0],b=_[0],x=Array.from(b?.querySelectorAll("th, td")??[]);x.length>0&&x.every(C=>C.tagName==="TH")&&b?.closest("tbody")===null&&(g.splice(0,g.length,...d),p.shift(),l.shift())}this._slottedTableData={headers:g.length>0?g:void 0,rows:p,rowHeaderRows:l.length>0?l:void 0}}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(i=>i.length)),a=i=>{if(i==null)return!1;if(typeof i=="number")return!0;const g=String(i).replace(/[\u00A0\u202F\s]+/g,"").trim();return g?/^-?\d+(?:[.,]\d+)?$/.test(g):!1},n=[];for(let i=0;i<e;i+=1){if(i===0){n.push("left");continue}const g=t.rows.map(l=>this._normalizeRenderableCell(l[i]).text).filter(l=>l!==""&&l!==null&&l!==void 0),p=g.length>0&&g.every(a);n.push(p?"right":"left")}return n}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this.contentHeight?.trim()||""}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),a=Math.max(t.headers?.length??0,...t.rows.map(l=>l.length)),n=(t.headers??[]).map(l=>this._normalizeRenderableCell(l)),i=t.rows.map(l=>{const m=l.map(f=>this._normalizeRenderableCell(f));for(;m.length<a;)m.push({html:"",text:""});return m}),g=t.rowHeaderRows??[],p=[this.title,this.subtitle].map(l=>typeof l=="string"?l.trim():"").filter(Boolean).join(". ");return s`
|
|
117
117
|
<table class="scb-viz-table" part="table">
|
|
118
|
+
${p?s`<caption class="visually-hidden">${p}</caption>`:""}
|
|
118
119
|
${n.length>0?s`
|
|
119
120
|
<thead>
|
|
120
121
|
<tr>
|
|
121
|
-
${n.map((
|
|
122
|
+
${n.map((l,m)=>{const f=e[m]==="right"?"align-right":"align-left";return s`<th scope="col" class=${f}>${l.html?A(l.html):l.text}</th>`})}
|
|
122
123
|
</tr>
|
|
123
124
|
</thead>
|
|
124
125
|
`:""}
|
|
125
126
|
<tbody>
|
|
126
|
-
${i.map((
|
|
127
|
+
${i.map((l,m)=>{const f=g[m]===!0;return s`
|
|
127
128
|
<tr>
|
|
128
|
-
${
|
|
129
|
+
${l.map((u,z)=>{const _=e[z]==="right"?"align-right":"align-left",d=u.html?A(u.html):u.text;return z===0&&f?s`<th scope="row" class=${_}>${d}</th>`:s`<td class=${_}>${d}</td>`})}
|
|
129
130
|
</tr>
|
|
130
131
|
`})}
|
|
131
132
|
</tbody>
|
|
@@ -133,7 +134,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
133
134
|
`}render(){switch(this.variant){case"Table":return s`
|
|
134
135
|
<div part="container">
|
|
135
136
|
<div class="header">
|
|
136
|
-
${this.title?s` <div class="label">${this.title}</div> `:""}
|
|
137
|
+
${this.title?s` <div class="label" role="heading" aria-level="2">${this.title}</div> `:""}
|
|
137
138
|
${this.subtitle?s` <div class="sub-label">${this.subtitle}</div> `:""}
|
|
138
139
|
</div>
|
|
139
140
|
<div class="content">
|
|
@@ -149,7 +150,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
149
150
|
<div class="footer">
|
|
150
151
|
${this.description?s`
|
|
151
152
|
<div class="description section">
|
|
152
|
-
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
153
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.descriptionLabel}</div>
|
|
153
154
|
<div class="body-text">${this.description}</div>
|
|
154
155
|
</div>
|
|
155
156
|
`:""}
|
|
@@ -160,19 +161,19 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
160
161
|
<div class="more-about-stats-content">
|
|
161
162
|
${this.comment?s`
|
|
162
163
|
<div class="section">
|
|
163
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
164
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.commentLabel}</div>
|
|
164
165
|
<div class="body-text">${this.comment}</div>
|
|
165
166
|
</div>
|
|
166
167
|
`:""}
|
|
167
168
|
${this.source?s`
|
|
168
169
|
<div class="section">
|
|
169
|
-
<div class="secondary-label">${this.sourceLabel}</div>
|
|
170
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.sourceLabel}</div>
|
|
170
171
|
<div class="body-text">${this.source}</div>
|
|
171
172
|
</div>
|
|
172
173
|
`:""}
|
|
173
174
|
${this.footnote?s`
|
|
174
175
|
<div class="section">
|
|
175
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
176
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.footnoteLabel}</div>
|
|
176
177
|
<div class="body-text">${this.footnote}</div>
|
|
177
178
|
</div>
|
|
178
179
|
`:""}
|
|
@@ -205,19 +206,19 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
205
206
|
`;case"Image":return s`
|
|
206
207
|
<div part="container">
|
|
207
208
|
<div class="header">
|
|
208
|
-
${this.title?s` <div class="label">${this.title}</div> `:""}
|
|
209
|
+
${this.title?s` <div class="label" role="heading" aria-level="2">${this.title}</div> `:""}
|
|
209
210
|
${this.subtitle?s` <div class="sub-label">${this.subtitle}</div> `:""}
|
|
210
211
|
</div>
|
|
211
212
|
<div
|
|
212
213
|
class="content image-content"
|
|
213
214
|
style=${this._getResolvedContentMaxWidth()?`max-width: ${this._getResolvedContentMaxWidth()}; --scb-viz-content-max-width: ${this._getResolvedContentMaxWidth()};`:""}
|
|
214
215
|
>
|
|
215
|
-
<img src="${this.imageHref}" alt="
|
|
216
|
+
<img src="${this.imageHref}" alt="${this._getImageAltText()}" />
|
|
216
217
|
</div>
|
|
217
218
|
<div class="footer">
|
|
218
219
|
${this.description?s`
|
|
219
220
|
<div class="description section">
|
|
220
|
-
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
221
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.descriptionLabel}</div>
|
|
221
222
|
<div class="body-text">${this.description}</div>
|
|
222
223
|
</div>
|
|
223
224
|
`:""}
|
|
@@ -228,19 +229,19 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
228
229
|
<div class="more-about-stats-content">
|
|
229
230
|
${this.comment?s`
|
|
230
231
|
<div class="section">
|
|
231
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
232
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.commentLabel}</div>
|
|
232
233
|
<div class="body-text">${this.comment}</div>
|
|
233
234
|
</div>
|
|
234
235
|
`:""}
|
|
235
236
|
${this.source?s`
|
|
236
237
|
<div class="section">
|
|
237
|
-
<div class="secondary-label">${this.sourceLabel}</div>
|
|
238
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.sourceLabel}</div>
|
|
238
239
|
<div class="body-text">${this.source}</div>
|
|
239
240
|
</div>
|
|
240
241
|
`:""}
|
|
241
242
|
${this.footnote?s`
|
|
242
243
|
<div class="section">
|
|
243
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
244
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.footnoteLabel}</div>
|
|
244
245
|
<div class="body-text">${this.footnote}</div>
|
|
245
246
|
</div>
|
|
246
247
|
`:""}
|
|
@@ -273,7 +274,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
273
274
|
`;default:return s`
|
|
274
275
|
<div part="container">
|
|
275
276
|
<div class="header">
|
|
276
|
-
${this.title?s` <div class="label">${this.title}</div> `:""}
|
|
277
|
+
${this.title?s` <div class="label" role="heading" aria-level="2">${this.title}</div> `:""}
|
|
277
278
|
${this.subtitle?s` <div class="sub-label">${this.subtitle}</div> `:""}
|
|
278
279
|
</div>
|
|
279
280
|
${this.variant==="Standard"&&!this.disableToggle?s`
|
|
@@ -321,7 +322,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
321
322
|
<div class="footer">
|
|
322
323
|
${this.description?s`
|
|
323
324
|
<div class="description section">
|
|
324
|
-
<div class="secondary-label">${this.descriptionLabel}</div>
|
|
325
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.descriptionLabel}</div>
|
|
325
326
|
<div class="body-text">${this.description}</div>
|
|
326
327
|
</div>
|
|
327
328
|
`:""}
|
|
@@ -332,19 +333,19 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
332
333
|
<div class="more-about-stats-content">
|
|
333
334
|
${this.comment?s`
|
|
334
335
|
<div class="section">
|
|
335
|
-
<div class="secondary-label">${this.commentLabel}</div>
|
|
336
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.commentLabel}</div>
|
|
336
337
|
<div class="body-text">${this.comment}</div>
|
|
337
338
|
</div>
|
|
338
339
|
`:""}
|
|
339
340
|
${this.source?s`
|
|
340
341
|
<div class="section">
|
|
341
|
-
<div class="secondary-label">${this.sourceLabel}</div>
|
|
342
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.sourceLabel}</div>
|
|
342
343
|
<div class="body-text">${this.source}</div>
|
|
343
344
|
</div>
|
|
344
345
|
`:""}
|
|
345
346
|
${this.footnote?s`
|
|
346
347
|
<div class="section">
|
|
347
|
-
<div class="secondary-label">${this.footnoteLabel}</div>
|
|
348
|
+
<div class="secondary-label" role="heading" aria-level="3">${this.footnoteLabel}</div>
|
|
348
349
|
<div class="body-text">${this.footnote}</div>
|
|
349
350
|
</div>
|
|
350
351
|
`:""}
|
|
@@ -374,7 +375,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
374
375
|
></slot>
|
|
375
376
|
<slot></slot>
|
|
376
377
|
</div>
|
|
377
|
-
`}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}};c=new WeakSet;R=function(){if(
|
|
378
|
+
`}}_syncChipClass(){const t=this.variant==="Standard";this.classList.toggle("chip-diagram",t&&this.selectedChip==="Diagram"),this.classList.toggle("chip-table",t&&this.selectedChip==="Table")}_dispatchSelectedChipChanged(){const t={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent("selected-chip-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("selectedchipchanged",{detail:t,bubbles:!0,composed:!0}))}_onSegmentedChange(t){const e=t.detail?.value;this.selectedChip===e?this.selectedChip=null:this.selectedChip=e}};c=new WeakSet;R=function(){if(r(this,c,H).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{r(this,c,w).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(t))};H=function(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0};V=function(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)};w=function(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(r(this,c,V).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,r(this,c,E).call(this)})}))};k=function(t){const e=t?.getAttribute("data-highcharts-chart");if(!e)return;const a=Number.parseInt(e,10);return Number.isNaN(a)?void 0:a};P=function(t){for(const e of t){const a=r(this,c,k).call(this,e);if(a!==void 0)return a;const n=e.querySelector("[data-highcharts-chart]"),i=r(this,c,k).call(this,n);if(i!==void 0)return i}};E=function(){if(this.variant!=="Standard"||this.selectedChip!=="Diagram")return;const t=this.shadowRoot?.querySelector('slot[name="diagram"]');if(!t)return;const e=t.assignedElements({flatten:!0});if(e.length===0)return;const a=r(this,c,P).call(this,e);if(a===void 0)return;const i=window.Highcharts?.charts?.[a];i&&(i.setSize?.(null,null,!1),i.reflow?.())};S=function(){const t=this.variant==="Standard"?this._getResolvedDiagramHeight():"";this.variant==="Standard"?this.style.setProperty("--scb-viz-diagram-min-height",t||"420px"):this.style.removeProperty("--scb-viz-diagram-min-height"),t?(this.style.setProperty("--scb-viz-diagram-height",t),this.style.setProperty("--scb-viz-diagram-overflow","hidden")):(this.style.removeProperty("--scb-viz-diagram-height"),this.style.removeProperty("--scb-viz-diagram-overflow"))};T=function(){const t=r(this,c,y).call(this,this.spacing),e=r(this,c,y).call(this,this.spacingTop)??t,a=r(this,c,y).call(this,this.spacingBottom)??t,n=r(this,c,y).call(this,this.spacingLeft),i=r(this,c,y).call(this,this.spacingRight);e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),a?this.style.setProperty("--scb-viz-spacing-block-end",a):this.style.removeProperty("--scb-viz-spacing-block-end"),n?this.style.setProperty("--scb-viz-spacing-inline-start",n):this.style.removeProperty("--scb-viz-spacing-inline-start"),i?this.style.setProperty("--scb-viz-spacing-inline-end",i):this.style.removeProperty("--scb-viz-spacing-inline-end")};y=function(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=function(){const t=this.containerMaxWidth?.trim();t?this.style.setProperty("--scb-viz-container-max-width",t):this.style.removeProperty("--scb-viz-container-max-width")};o.styles=W`
|
|
378
379
|
:host {
|
|
379
380
|
display: block;
|
|
380
381
|
box-sizing: border-box;
|
|
@@ -449,6 +450,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
449
450
|
line-height: var(--_scb-viz-title-line-height);
|
|
450
451
|
letter-spacing: var(--_scb-viz-title-letter-spacing);
|
|
451
452
|
text-align: start;
|
|
453
|
+
margin: 0;
|
|
452
454
|
}
|
|
453
455
|
|
|
454
456
|
.sub-label {
|
|
@@ -458,6 +460,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
458
460
|
line-height: var(--_scb-viz-subtitle-line-height);
|
|
459
461
|
letter-spacing: var(--_scb-viz-subtitle-letter-spacing);
|
|
460
462
|
text-align: start;
|
|
463
|
+
margin: 0;
|
|
461
464
|
}
|
|
462
465
|
|
|
463
466
|
.secondary-label {
|
|
@@ -467,6 +470,7 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
467
470
|
line-height: var(--_scb-viz-section-title-line-height);
|
|
468
471
|
letter-spacing: var(--_scb-viz-section-title-letter-spacing);
|
|
469
472
|
text-align: start;
|
|
473
|
+
margin: 0;
|
|
470
474
|
}
|
|
471
475
|
|
|
472
476
|
.body-text {
|
|
@@ -479,6 +483,20 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
479
483
|
text-align: start;
|
|
480
484
|
}
|
|
481
485
|
|
|
486
|
+
.visually-hidden,
|
|
487
|
+
.highcharts-visually-hidden {
|
|
488
|
+
position: absolute !important;
|
|
489
|
+
width: 1px !important;
|
|
490
|
+
height: 1px !important;
|
|
491
|
+
padding: 0 !important;
|
|
492
|
+
margin: -1px !important;
|
|
493
|
+
overflow: hidden !important;
|
|
494
|
+
white-space: nowrap !important;
|
|
495
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
496
|
+
clip-path: inset(50%) !important;
|
|
497
|
+
border: 0 !important;
|
|
498
|
+
}
|
|
499
|
+
|
|
482
500
|
.section {
|
|
483
501
|
display: flex;
|
|
484
502
|
flex-direction: column;
|
|
@@ -673,4 +691,4 @@ import{a as W,n as d,r as F,i as O,k as A,x as s,l as M,t as q}from"../../vendor
|
|
|
673
691
|
text-align: right;
|
|
674
692
|
white-space: nowrap;
|
|
675
693
|
}
|
|
676
|
-
`;h([
|
|
694
|
+
`;h([v({type:String,reflect:!0})],o.prototype,"variant",2);h([v({type:String,reflect:!0,attribute:"selected-chip"})],o.prototype,"selectedChip",2);h([v({type:String,reflect:!0})],o.prototype,"title",2);h([v({type:String,reflect:!0})],o.prototype,"subtitle",2);h([v({type:String,reflect:!0})],o.prototype,"description",2);h([v({type:String,reflect:!0})],o.prototype,"comment",2);h([v({type:String,reflect:!0})],o.prototype,"source",2);h([v({type:String,reflect:!0})],o.prototype,"footnote",2);h([v({type:String,reflect:!0,attribute:"lang"})],o.prototype,"lang",2);h([v({type:String,reflect:!0,attribute:"image-href"})],o.prototype,"imageHref",2);h([v({type:Boolean,reflect:!0,attribute:"official-statistics"})],o.prototype,"officialStatistics",2);h([v({type:Boolean,reflect:!0,attribute:"disable-toggle"})],o.prototype,"disableToggle",2);h([v({type:String,attribute:"content-max-width"})],o.prototype,"contentMaxWidth",2);h([v({type:String,attribute:"container-max-width"})],o.prototype,"containerMaxWidth",2);h([v({type:String,attribute:"content-height"})],o.prototype,"contentHeight",2);h([v({attribute:!1})],o.prototype,"tableData",2);h([F()],o.prototype,"_slottedTableData",2);h([v({type:String,reflect:!0})],o.prototype,"spacing",2);h([v({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",2);h([v({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",2);h([v({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",2);h([v({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",2);o=h([q("scb-viz")],o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.278",
|
|
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": "590CE0DA3FA9E7D87F53BE632D868D3123AEAFBD04EBA8E1C0FA0E548AFF55A1"
|
|
390
390
|
}
|