scb-wc-test 0.1.276 → 0.1.277

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- 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/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(r){var v=String(r||"");if(v.indexOf("already been used")===-1&&v.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var G=Object.defineProperty,B=Object.getOwnPropertyDescriptor,I=t=>{throw TypeError(t)},h=(t,e,a,n)=>{for(var i=n>1?void 0:n?B(e,a):e,v=t.length-1,r;v>=0;v--)(r=t[v])&&(i=(n?r(e,a,i):r(i))||i);return n&&i&&G(e,a,i),i},N=(t,e,a)=>e.has(t)||I("Cannot "+a),K=(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),o=(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"
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 l=class extends O{constructor(){super(...arguments),K(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"}firstUpdated(t){this._readTableDataFromSlot(),o(this,c,T).call(this),o(this,c,D).call(this),o(this,c,S).call(this),this._syncChipClass(),o(this,c,R).call(this),o(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"))&&o(this,c,T).call(this),t.has("containerMaxWidth")&&o(this,c,D).call(this),t.has("variant")&&o(this,c,R).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("variant"))&&o(this,c,S).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight"))&&o(this,c,w).call(this)}disconnectedCallback(){super.disconnectedCallback(),o(this,c,H).call(this),o(this,c,V).call(this)}_onTableSlotChange(t){const e=t.target;e&&this._readTableDataFromSlot(e)}_onDiagramSlotChange(){o(this,c,S).call(this),o(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(b=>{if(b.tagName==="TABLE"){n.push(b);return}b.querySelectorAll("table").forEach(p=>n.push(p))});const i=n[0];if(!i){this._slottedTableData=void 0;return}const v=[],r=[],g=[],f=b=>b?(b.textContent??"").replace(/\s+/g," ").trim():"",m=b=>b?{html:(b.innerHTML??"").trim(),text:f(b)}:{html:"",text:""},u=i.querySelector("thead tr");u&&Array.from(u.querySelectorAll("th, td")).forEach(p=>v.push(m(p)));const z=Array.from(i.querySelectorAll("tbody tr")),_=z.length>0?z:Array.from(i.querySelectorAll("tr")).filter(b=>b.closest("thead")===null);if(_.forEach(b=>{const p=Array.from(b.querySelectorAll("th, td"));if(p.length===0)return;const x=p[0].tagName==="TH"&&b.closest("thead")===null&&b.closest("tfoot")===null;g.push(x);const $=[];p.forEach(C=>$.push(m(C))),r.push($)}),!u&&r.length>0){const b=r[0],p=_[0],x=Array.from(p?.querySelectorAll("th, td")??[]);x.length>0&&x.every(C=>C.tagName==="TH")&&p?.closest("tbody")===null&&(v.splice(0,v.length,...b),r.shift(),g.shift())}this._slottedTableData={headers:v.length>0?v:void 0,rows:r,rowHeaderRows:g.length>0?g: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 v=String(i).replace(/[\u00A0\u202F\s]+/g,"").trim();return v?/^-?\d+(?:[.,]\d+)?$/.test(v):!1},n=[];for(let i=0;i<e;i+=1){if(i===0){n.push("left");continue}const v=t.rows.map(g=>this._normalizeRenderableCell(g[i]).text).filter(g=>g!==""&&g!==null&&g!==void 0),r=v.length>0&&v.every(a);n.push(r?"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(r=>r.length)),n=(t.headers??[]).map(r=>this._normalizeRenderableCell(r)),i=t.rows.map(r=>{const g=r.map(f=>this._normalizeRenderableCell(f));for(;g.length<a;)g.push({html:"",text:""});return g}),v=t.rowHeaderRows??[];return s`
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((r,g)=>{const f=e[g]==="right"?"align-right":"align-left";return s`<th scope="col" class=${f}>${r.html?A(r.html):r.text}</th>`})}
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((r,g)=>{const f=v[g]===!0;return s`
127
+ ${i.map((l,m)=>{const f=g[m]===!0;return s`
127
128
  <tr>
128
- ${r.map((m,u)=>{const z=e[u]==="right"?"align-right":"align-left",_=m.html?A(m.html):m.text;return u===0&&f?s`<th scope="row" class=${z}>${_}</th>`:s`<td class=${z}>${_}</td>`})}
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="Image figure" />
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(o(this,c,H).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{o(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"||(o(this,c,V).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,o(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=o(this,c,k).call(this,e);if(a!==void 0)return a;const n=e.querySelector("[data-highcharts-chart]"),i=o(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=o(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=o(this,c,y).call(this,this.spacing),e=o(this,c,y).call(this,this.spacingTop)??t,a=o(this,c,y).call(this,this.spacingBottom)??t,n=o(this,c,y).call(this,this.spacingLeft),i=o(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")};l.styles=W`
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([d({type:String,reflect:!0})],l.prototype,"variant",2);h([d({type:String,reflect:!0,attribute:"selected-chip"})],l.prototype,"selectedChip",2);h([d({type:String,reflect:!0})],l.prototype,"title",2);h([d({type:String,reflect:!0})],l.prototype,"subtitle",2);h([d({type:String,reflect:!0})],l.prototype,"description",2);h([d({type:String,reflect:!0})],l.prototype,"comment",2);h([d({type:String,reflect:!0})],l.prototype,"source",2);h([d({type:String,reflect:!0})],l.prototype,"footnote",2);h([d({type:String,reflect:!0,attribute:"lang"})],l.prototype,"lang",2);h([d({type:String,reflect:!0,attribute:"image-href"})],l.prototype,"imageHref",2);h([d({type:Boolean,reflect:!0,attribute:"official-statistics"})],l.prototype,"officialStatistics",2);h([d({type:Boolean,reflect:!0,attribute:"disable-toggle"})],l.prototype,"disableToggle",2);h([d({type:String,attribute:"content-max-width"})],l.prototype,"contentMaxWidth",2);h([d({type:String,attribute:"container-max-width"})],l.prototype,"containerMaxWidth",2);h([d({type:String,attribute:"content-height"})],l.prototype,"contentHeight",2);h([d({attribute:!1})],l.prototype,"tableData",2);h([F()],l.prototype,"_slottedTableData",2);h([d({type:String,reflect:!0})],l.prototype,"spacing",2);h([d({type:String,attribute:"spacing-top",reflect:!0})],l.prototype,"spacingTop",2);h([d({type:String,attribute:"spacing-bottom",reflect:!0})],l.prototype,"spacingBottom",2);h([d({type:String,attribute:"spacing-left",reflect:!0})],l.prototype,"spacingLeft",2);h([d({type:String,attribute:"spacing-right",reflect:!0})],l.prototype,"spacingRight",2);l=h([q("scb-viz")],l);
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.276",
3
+ "version": "0.1.277",
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": "CEEA007ACB08B1B04F1FA873E1CA94CD02A33181EECB10470C8D72A70877BA25"
389
+ "buildHash": "87C0B0B589D46C20B9BA91A407D131202A56B91B7D85E2C73F9C4425B5E52576"
390
390
  }
@@ -49,6 +49,7 @@ export declare class ScbViz extends LitElement {
49
49
  get officialStatisticsLabel(): "Official statistics of Sweden" | "Sveriges officiella statistik";
50
50
  get officialStatisticsTitle(): "Part of Official statistics of Sweden" | "Tillhör Sveriges officiella statistik";
51
51
  get officialStatisticsAlt(): "Read more about Official statistics of Sweden" | "Läs mer om Sveriges officiella statistik";
52
+ private _getImageAltText;
52
53
  static styles: import('lit').CSSResult;
53
54
  protected firstUpdated(_changed: PropertyValues): void;
54
55
  protected updated(changed: PropertyValues): void;