scb-wc-test 0.1.345 → 0.1.346

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/all.js CHANGED
@@ -83,7 +83,11 @@ import './mvc/components/scb-textfield/scb-textfield.js';
83
83
  import './mvc/components/scb-toc/scb-toc-item.js';
84
84
  import './mvc/components/scb-toc/scb-toc.js';
85
85
  import './mvc/components/scb-tooltip/scb-tooltip.js';
86
+ import './mvc/components/scb-viz/scb-viz-actions-runtime.js';
87
+ import './mvc/components/scb-viz/scb-viz-print-runtime.js';
86
88
  import './mvc/components/scb-viz/scb-viz-series-differentiation-registry.js';
89
+ import './mvc/components/scb-viz/scb-viz-series-differentiation-runtime.js';
90
+ import './mvc/components/scb-viz/scb-viz-table-runtime.js';
87
91
  import './mvc/components/scb-viz/scb-viz.js';
88
92
  import './mvc/scb-blazor-bridge.js';
89
93
  import './mvc/vendor/preload-helper.js';
@@ -171,5 +175,9 @@ import './scb-textfield/scb-textfield.js';
171
175
  import './scb-toc/scb-toc-item.js';
172
176
  import './scb-toc/scb-toc.js';
173
177
  import './scb-tooltip/scb-tooltip.js';
178
+ import './scb-viz/scb-viz-actions-runtime.js';
179
+ import './scb-viz/scb-viz-print-runtime.js';
174
180
  import './scb-viz/scb-viz-series-differentiation-registry.js';
181
+ import './scb-viz/scb-viz-series-differentiation-runtime.js';
182
+ import './scb-viz/scb-viz-table-runtime.js';
175
183
  import './scb-viz/scb-viz.js';
package/index.d.ts CHANGED
@@ -79,5 +79,9 @@ export * from './scb-textfield/scb-textfield';
79
79
  export * from './scb-toc/scb-toc-item';
80
80
  export * from './scb-toc/scb-toc';
81
81
  export * from './scb-tooltip/scb-tooltip';
82
+ export * from './scb-viz/scb-viz-actions-runtime';
83
+ export * from './scb-viz/scb-viz-print-runtime';
82
84
  export * from './scb-viz/scb-viz-series-differentiation-registry';
85
+ export * from './scb-viz/scb-viz-series-differentiation-runtime';
86
+ export * from './scb-viz/scb-viz-table-runtime';
83
87
  export * from './scb-viz/scb-viz';
@@ -80,4 +80,8 @@ import './scb-toc/scb-toc.js';
80
80
  import './scb-toc/scb-toc-item.js';
81
81
  import './scb-tooltip/scb-tooltip.js';
82
82
  import './scb-viz/scb-viz.js';
83
+ import './scb-viz/scb-viz-actions-runtime.js';
84
+ import './scb-viz/scb-viz-print-runtime.js';
83
85
  import './scb-viz/scb-viz-series-differentiation-registry.js';
86
+ import './scb-viz/scb-viz-series-differentiation-runtime.js';
87
+ import './scb-viz/scb-viz-table-runtime.js';
@@ -1,4 +1,4 @@
1
- import{a as g,n,i as m,E as p,x as l,t as v}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-chevron/scb-chevron.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(o,a,s){try{customElements.get(o)||e(o,a,s)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var b=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(t,e,o,a)=>{for(var s=a>1?void 0:a?h(e,o):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(s=(a?d(e,o,s):d(s))||s);return a&&s&&b(e,o,s),s};let i=class extends m{constructor(){super(...arguments),this.open=!1,this.title="",this.content="",this.overline="",this.supportingText="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.imgHrefImage="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.density=0,this._unique=i._uid(),this._ignoreNextNativeTitleAttrChange=!1,this._onSummaryClick=t=>{t.preventDefault();const e=!this.open;this.closest("scb-accordion")?.onItemToggled?.(this,e),this.setOpen(e)},this._onToggle=t=>{const e=t.currentTarget;e.open||(e.open=!0),this._applyInertByOpen()}}static _uid(){return globalThis.crypto?.randomUUID?.()??`${i._uidPrefix}-${++i._uidSeq}`}static get observedAttributes(){const t=super.observedAttributes||[];return t.includes("title")?t:[...t,"title"]}attributeChangedCallback(t,e,o){if(t==="title"&&this._ignoreNextNativeTitleAttrChange){this._ignoreNextNativeTitleAttrChange=!1;return}super.attributeChangedCallback(t,e,o),t==="title"&&o!==null&&(this._ignoreNextNativeTitleAttrChange=!0,this.removeAttribute("title"))}firstUpdated(){this._applyInertByOpen()}_applyInertByOpen(){const t=this.renderRoot.querySelector(".scb-accordion-bottom");t&&(this.open?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false")):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true")))}_onKeyDown(t){const e=this.closest("scb-accordion"),a=Array.from(e?.querySelectorAll("scb-accordion-item")||[]).map(d=>d.renderRoot.querySelector("details")?.querySelector(".scb-accordion-top")||null).filter(d=>!!d),s=t.currentTarget,c=a.indexOf(s);switch(t.key){case"ArrowDown":t.preventDefault(),c<a.length-1&&a[c+1].focus();break;case"ArrowUp":t.preventDefault(),c>0&&a[c-1].focus();break;case"Home":t.preventDefault(),a.length&&a[0].focus();break;case"End":t.preventDefault(),a.length&&a[a.length-1].focus();break}}setOpen(t){this.open=!!t;const e=this.renderRoot.querySelector("details");e&&!e.open&&(e.open=!0),this._applyInertByOpen()}updated(t){if(t.has("open")){const e=this.renderRoot.querySelector("details");e&&!e.open&&(e.open=!0),this._applyInertByOpen(),this.dispatchEvent(new CustomEvent("open-changed",{detail:{open:this.open,title:this.title},bubbles:!0,composed:!0}))}}render(){const t=`bottom-${this._unique}`,e=`header-${this._unique}`,o=this.leading?this.leadingVariant==="image"&&this.imgHrefImage?l`<img part="leading-image" class="img" src="${this.imgHrefImage}" alt="" />`:this.leadingVariant==="avatar"?l`
1
+ import{a as g,n,i as v,E as p,x as l,t as b}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-chevron/scb-chevron.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(o,a,s){try{customElements.get(o)||e(o,a,s)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(t,e,o,a)=>{for(var s=a>1?void 0:a?h(e,o):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(s=(a?d(e,o,s):d(s))||s);return a&&s&&m(e,o,s),s};let i=class extends v{constructor(){super(...arguments),this.open=!1,this.title="",this.content="",this.overline="",this.supportingText="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.imgHrefImage="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.density=0,this._unique=i._uid(),this._ignoreNextNativeTitleAttrChange=!1,this._onSummaryClick=t=>{t.preventDefault();const e=!this.open;this.closest("scb-accordion")?.onItemToggled?.(this,e),this.setOpen(e)},this._onToggle=t=>{const e=t.currentTarget;e.open||(e.open=!0),this._applyInertByOpen()}}static _uid(){return globalThis.crypto?.randomUUID?.()??`${i._uidPrefix}-${++i._uidSeq}`}static get observedAttributes(){const t=super.observedAttributes||[];return t.includes("title")?t:[...t,"title"]}attributeChangedCallback(t,e,o){if(t==="title"&&this._ignoreNextNativeTitleAttrChange){this._ignoreNextNativeTitleAttrChange=!1;return}super.attributeChangedCallback(t,e,o),t==="title"&&o!==null&&(this._ignoreNextNativeTitleAttrChange=!0,this.removeAttribute("title"))}firstUpdated(){this._applyInertByOpen()}_applyInertByOpen(){const t=this.renderRoot.querySelector(".scb-accordion-bottom");t&&(this.open?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false")):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true")))}_onKeyDown(t){const e=this.closest("scb-accordion"),a=Array.from(e?.querySelectorAll("scb-accordion-item")||[]).map(d=>d.renderRoot.querySelector("details")?.querySelector(".scb-accordion-top")||null).filter(d=>!!d),s=t.currentTarget,c=a.indexOf(s);switch(t.key){case"ArrowDown":t.preventDefault(),c<a.length-1&&a[c+1].focus();break;case"ArrowUp":t.preventDefault(),c>0&&a[c-1].focus();break;case"Home":t.preventDefault(),a.length&&a[0].focus();break;case"End":t.preventDefault(),a.length&&a[a.length-1].focus();break}}setOpen(t){this.open=!!t;const e=this.renderRoot.querySelector("details");e&&!e.open&&(e.open=!0),this._applyInertByOpen()}updated(t){if(t.has("open")){const e=this.renderRoot.querySelector("details");e&&!e.open&&(e.open=!0),this._applyInertByOpen(),this.dispatchEvent(new CustomEvent("open-changed",{detail:{open:this.open,title:this.title},bubbles:!0,composed:!0}))}}render(){const t=`bottom-${this._unique}`,e=`header-${this._unique}`,o=this.leading?this.leadingVariant==="image"&&this.imgHrefImage?l`<img part="leading-image" class="img" src="${this.imgHrefImage}" alt="" />`:this.leadingVariant==="avatar"?l`
2
2
  <scb-avatar
3
3
  label=${this.avatarLabel}
4
4
  alt=${this.avatarAlt}
@@ -46,6 +46,7 @@ import{a as g,n,i as m,E as p,x as l,t as v}from"../../vendor/vendor.js";import"
46
46
  --scb-accordion-motion-duration: 0.3s;
47
47
  --scb-accordion-motion-easing: ease;
48
48
  --scb-accordion-panel-padding-closed: var(--spacing-0, 0px);
49
+ --scb-accordion-interaction-bleed: max(var(--stroke-focus-ring, 3px), var(--spacing-2, 4px));
49
50
 
50
51
  --scb-accordion-item-padding-inline: var(--spacing-5, 16px);
51
52
  --scb-accordion-item-padding-block: var(--spacing-7, 24px);
@@ -142,17 +143,21 @@ import{a as g,n,i as m,E as p,x as l,t as v}from"../../vendor/vendor.js";import"
142
143
  opacity var(--scb-accordion-motion-duration) var(--scb-accordion-motion-easing),
143
144
  padding var(--scb-accordion-motion-duration) var(--scb-accordion-motion-easing);
144
145
  padding-block: var(--scb-accordion-panel-padding-closed);
145
- padding-inline: var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px));
146
+ padding-inline: calc(var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px)) - var(--scb-accordion-interaction-bleed));
146
147
  }
147
148
  :host([open]) .scb-accordion-bottom {
148
149
  grid-template-rows: 1fr;
149
150
  opacity: 1;
150
- padding-top: var(--spacing-2, 4px);
151
- padding-right: var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px));
152
- padding-bottom: var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px));
153
- padding-left: var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px));
151
+ padding-top: max(var(--spacing-0, 0px), calc(var(--spacing-2, 4px) - var(--scb-accordion-interaction-bleed)));
152
+ padding-right: calc(var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px)) - var(--scb-accordion-interaction-bleed));
153
+ padding-bottom: calc(var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px)) - var(--scb-accordion-interaction-bleed));
154
+ padding-left: calc(var(--scb-accordion-item-padding-inline, var(--spacing-5, 16px)) - var(--scb-accordion-interaction-bleed));
155
+ }
156
+ .bottom-inner {
157
+ min-height: 0;
158
+ overflow: visible;
159
+ padding: var(--scb-accordion-interaction-bleed);
154
160
  }
155
- .bottom-inner { overflow: hidden; }
156
161
 
157
162
  .title {
158
163
  font-family: var(--brand-font);
@@ -203,4 +208,4 @@ import{a as g,n,i as m,E as p,x as l,t as v}from"../../vendor/vendor.js";import"
203
208
  @media (prefers-reduced-motion: reduce) {
204
209
  md-ripple { display: none; }
205
210
  }
206
- `];r([n({type:Boolean,reflect:!0})],i.prototype,"open",2);r([n({type:String})],i.prototype,"title",2);r([n({type:String})],i.prototype,"content",2);r([n({type:String,attribute:"overline"})],i.prototype,"overline",2);r([n({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);r([n({type:Boolean})],i.prototype,"leading",2);r([n({type:String,attribute:"leading-variant",reflect:!0})],i.prototype,"leadingVariant",2);r([n({type:String,attribute:"leading-icon"})],i.prototype,"leadingIcon",2);r([n({type:String,attribute:"img-href-image",reflect:!0})],i.prototype,"imgHrefImage",2);r([n({type:String,attribute:"avatar-label"})],i.prototype,"avatarLabel",2);r([n({type:String,attribute:"avatar-alt"})],i.prototype,"avatarAlt",2);r([n({type:String,attribute:"avatar-variant"})],i.prototype,"avatarVariant",2);r([n({type:String,attribute:"avatar-src"})],i.prototype,"avatarSrc",2);r([n({type:Number,reflect:!0})],i.prototype,"density",2);i=r([v("scb-accordion-item")],i);
211
+ `];r([n({type:Boolean,reflect:!0})],i.prototype,"open",2);r([n({type:String})],i.prototype,"title",2);r([n({type:String})],i.prototype,"content",2);r([n({type:String,attribute:"overline"})],i.prototype,"overline",2);r([n({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);r([n({type:Boolean})],i.prototype,"leading",2);r([n({type:String,attribute:"leading-variant",reflect:!0})],i.prototype,"leadingVariant",2);r([n({type:String,attribute:"leading-icon"})],i.prototype,"leadingIcon",2);r([n({type:String,attribute:"img-href-image",reflect:!0})],i.prototype,"imgHrefImage",2);r([n({type:String,attribute:"avatar-label"})],i.prototype,"avatarLabel",2);r([n({type:String,attribute:"avatar-alt"})],i.prototype,"avatarAlt",2);r([n({type:String,attribute:"avatar-variant"})],i.prototype,"avatarVariant",2);r([n({type:String,attribute:"avatar-src"})],i.prototype,"avatarSrc",2);r([n({type:Number,reflect:!0})],i.prototype,"density",2);i=r([b("scb-accordion-item")],i);
@@ -0,0 +1,2 @@
1
+ (function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(t,i,r){try{customElements.get(t)||n(t,i,r)}catch(a){var o=String(a||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();const b=e=>{const n=getComputedStyle(e).backgroundColor;return n&&n!=="rgba(0, 0, 0, 0)"?n:"#ffffff"};function w({lang:e,title:n}){const t=e==="en"?"visualization":"visualisering";return(n||t).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}function E(e,n){const t=n==="csv"?e.lang==="en"?"-table":"-tabell":"";return`${w(e)}${t}.${n}`}function m(e=document){return e}function p(e=document){const n=m(e);return n.fullscreenElement||n.webkitFullscreenElement||null}function y(e){return!!(e.requestFullscreen||e.webkitRequestFullscreen)}async function S(e,n=document){if(!y(e))return;const t=m(n),i=p(n);if(i===e){t.exitFullscreen?await t.exitFullscreen():t.webkitExitFullscreen&&await t.webkitExitFullscreen();return}i&&(t.exitFullscreen?await t.exitFullscreen():t.webkitExitFullscreen&&await t.webkitExitFullscreen()),e.requestFullscreen?await e.requestFullscreen():e.webkitRequestFullscreen&&await e.webkitRequestFullscreen()}async function C(e,n=document){const t=n.createElement("iframe");t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.right="0",t.style.bottom="0",t.style.width="0",t.style.height="0",t.style.border="0",t.style.visibility="hidden",n.body.appendChild(t);const i=()=>{t.remove()},r=t.contentDocument,o=t.contentWindow;if(!r||!o){i();return}r.open(),r.write(e),r.close();const a=Array.from(r.images||[]);await Promise.all(a.map(l=>l.complete?Promise.resolve():new Promise(s=>{l.addEventListener("load",()=>s(null),{once:!0}),l.addEventListener("error",()=>s(null),{once:!0})})));const c=()=>{o.removeEventListener("afterprint",c),i()};o.addEventListener("afterprint",c,{once:!0}),setTimeout(()=>{o.focus(),o.print(),setTimeout(i,1e3)},50)}async function z(e,n){e.setAttribute("data-scb-viz-force-light",""),await new Promise(t=>requestAnimationFrame(()=>t(null)));try{return await n()}finally{e.removeAttribute("data-scb-viz-force-light")}}function R(e,n){const t=n==="en"?",":";",i=o=>`"${String(o??"").replace(/\r?\n/g," ").replace(/"/g,'""')}"`,r=`\uFEFF${e.map(o=>o.map(i).join(t)).join(`\r
2
+ `)}`;return new Blob([r],{type:"text/csv;charset=utf-8;"})}async function k(e,n,t){const i=await f(e,n);return i?F(i,t==="jpeg"?"image/jpeg":"image/png",t==="jpeg"?.92:void 0):null}async function A(e,n,t){const i=await f(e,n);return i?i.toDataURL("image/png",void 0):null}function L(e,n,t=document){const i=URL.createObjectURL(e),r=t.createElement("a");r.href=i,r.download=n,t.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(i),0)}async function f(e,n){const t=b(n);if(e instanceof HTMLCanvasElement){const l=e.width||Math.round(e.getBoundingClientRect().width),s=e.height||Math.round(e.getBoundingClientRect().height);if(!l||!s)return null;const u=document.createElement("canvas");u.width=l,u.height=s;const d=u.getContext("2d");return d?(d.fillStyle=t,d.fillRect(0,0,l,s),d.drawImage(e,0,0,l,s),u):null}if(e instanceof HTMLImageElement){const l=e.naturalWidth||e.width,s=e.naturalHeight||e.height;return!l||!s?null:h(e.currentSrc||e.src,l,s,t)}const{width:i,height:r,serialized:o}=v(e);if(!i||!r||!o)return null;const a=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(a);try{return await h(c,i,r,t)}finally{URL.revokeObjectURL(c)}}function v(e){const n=e.cloneNode(!0),t=e.getBoundingClientRect(),i=e.viewBox?.baseVal,r=Math.round(i?.width||t.width||Number(e.getAttribute("width"))||0),o=Math.round(i?.height||t.height||Number(e.getAttribute("height"))||0);return n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),!n.getAttribute("width")&&r&&n.setAttribute("width",String(r)),!n.getAttribute("height")&&o&&n.setAttribute("height",String(o)),!n.getAttribute("viewBox")&&r&&o&&n.setAttribute("viewBox",`0 0 ${r} ${o}`),g(e,n),n.querySelectorAll(".highcharts-tooltip, .highcharts-contextmenu, .highcharts-a11y-proxy-container, .highcharts-a11y-dummy-point").forEach(a=>a.remove()),{width:r,height:o,serialized:new XMLSerializer().serializeToString(n)}}function g(e,n){const t=getComputedStyle(e);let i="";for(let a=0;a<t.length;a+=1){const c=t[a],l=t.getPropertyValue(c);l&&(i+=`${c}:${l};`)}i&&n.setAttribute("style",i);const r=Array.from(e.children),o=Array.from(n.children);for(let a=0;a<r.length;a+=1){const c=r[a],l=o[a];c&&l&&g(c,l)}}async function h(e,n,t,i){const r=Math.max(1,Math.min(2,window.devicePixelRatio||1)),o=Math.max(1,Math.round(n)),a=Math.max(1,Math.round(t)),c=document.createElement("canvas");c.width=Math.max(1,Math.round(o*r)),c.height=Math.max(1,Math.round(a*r));const l=c.getContext("2d");if(!l)return null;const s=await x(e);return s?(l.scale(r,r),l.fillStyle=i,l.fillRect(0,0,o,a),l.drawImage(s,0,0,o,a),c):null}function x(e){return new Promise(n=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>n(t),t.onerror=()=>n(null),t.src=e})}function F(e,n,t){return new Promise(i=>{e.toBlob(r=>i(r),n,t)})}export{R as a,E as b,k as c,L as d,A as e,p as g,y as i,C as o,z as r,S as t};
@@ -0,0 +1,98 @@
1
+ (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(i,s,a){try{customElements.get(i)||e(i,s,a)}catch(n){var r=String(n||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();function m(t,e){const i=t.headers.length?`<thead><tr>${t.headers.map((a,r)=>`<th scope="col" class="${t.alignments[r]==="right"?"align-right":"align-left"}"><span class="scb-viz-print-table-heading-text">${a.html||e(a.text)}</span></th>`).join("")}</tr></thead>`:"",s=`<tbody>${t.rows.map((a,r)=>{const n=t.rowHeaderRows[r]===!0;return`<tr>${a.map((l,c)=>{const o=t.alignments[c]==="right"?"align-right":"align-left",d=l.html||e(l.text);return c===0&&n?`<th scope="row" class="${o}">${d}</th>`:`<td class="${o}">${d}</td>`}).join("")}</tr>`}).join("")}</tbody>`;return`<table class="scb-viz-print-table">${i}${s}</table>`}function b(t){const e=[];if(t.description&&e.push(`
2
+ <section class="print-section">
3
+ <h2>${t.escapeHtml(t.descriptionLabel)}</h2>
4
+ <div class="body-text-rich">${t.renderRichTextHtml(t.description)}</div>
5
+ </section>
6
+ `),t.comment||t.source||t.footnote||t.officialStatistics){const i=[];t.comment&&i.push(`
7
+ <section class="print-section print-meta-section">
8
+ <h3>${t.escapeHtml(t.commentLabel)}</h3>
9
+ <div class="body-text-rich">${t.renderRichTextHtml(t.comment)}</div>
10
+ </section>
11
+ `),t.source&&i.push(`
12
+ <section class="print-section print-meta-section">
13
+ <h3>${t.escapeHtml(t.sourceLabel)}</h3>
14
+ <div>${t.escapeHtml(t.source)}</div>
15
+ </section>
16
+ `),t.footnote&&i.push(`
17
+ <section class="print-section print-meta-section">
18
+ <h3>${t.escapeHtml(t.footnoteLabel)}</h3>
19
+ <div class="body-text-rich">${t.renderRichTextHtml(t.footnote)}</div>
20
+ </section>
21
+ `),t.officialStatistics&&t.sosLogotypeSvg&&i.push(`
22
+ <div class="print-sos">${t.sosLogotypeSvg}</div>
23
+ `),e.push(`
24
+ <section class="print-section print-more-about-stats">
25
+ <h2>${t.escapeHtml(t.moreAboutStatsLabel)}</h2>
26
+ ${i.join("")}
27
+ </section>
28
+ `)}return e.join("")}function g(t){const e=t.escapeHtml;return`<!doctype html>
29
+ <html lang="${e(t.lang||"sv")}">
30
+ <head>
31
+ <meta charset="utf-8">
32
+ <meta name="viewport" content="width=device-width, initial-scale=1">
33
+ <title>${e(t.title||(t.lang==="en"?"Visualization":"Visualisering"))}</title>
34
+ <style>
35
+ :root { color-scheme: light; }
36
+ @page { margin: 16mm; }
37
+ * { box-sizing: border-box; }
38
+ html, body { margin: 0; padding: 0; background: #fff; }
39
+ body {
40
+ font-family: var(--brand-font, Inter, 'Segoe UI', Arial, sans-serif);
41
+ color: var(--md-sys-color-on-surface, #1f1f1f);
42
+ -webkit-print-color-adjust: exact;
43
+ print-color-adjust: exact;
44
+ }
45
+ .viz-print { width: 100%; }
46
+ .viz-header { max-width: 600px; margin-bottom: 24px; }
47
+ .viz-title { font-size: 1.75rem; font-weight: 600; line-height: 1.25; margin: 0; }
48
+ .viz-subtitle { font-size: 1rem; font-weight: 400; line-height: 1.5; margin: 0; }
49
+ .viz-content { width: 100%; }
50
+ .viz-chart-image, .viz-image { display: block; max-width: 100%; height: auto; }
51
+ .print-section { max-width: 600px; margin-top: 16px; }
52
+ .print-section h2, .print-section h3 { margin: 0 0 8px 0; font-size: 1rem; font-weight: 600; line-height: 1.5; }
53
+ .print-section h3 { margin-bottom: 4px; }
54
+ .print-more-about-stats { margin-top: 16px; }
55
+ .print-meta-section { margin-top: 0; margin-bottom: 16px; }
56
+ .print-sos { display: inline-flex; margin-top: 8px; color: inherit; }
57
+ .print-sos svg { height: 24px; width: auto; display: block; }
58
+ .scb-viz-print-table { border-collapse: collapse; width: max-content; max-width: 100%; font-size: 1rem; line-height: 1.5; }
59
+ .scb-viz-print-table th, .scb-viz-print-table td { border: 1px solid #c5c7d0; padding: 8px 12px; text-align: start; }
60
+ .scb-viz-print-table thead th {
61
+ font-weight: 700;
62
+ vertical-align: top;
63
+ }
64
+ .scb-viz-print-table-heading-text {
65
+ display: block;
66
+ max-inline-size: var(--scb-viz-table-header-max-width, 12rem);
67
+ min-inline-size: 0;
68
+ white-space: normal;
69
+ word-break: normal;
70
+ overflow-wrap: break-word;
71
+ hyphens: auto;
72
+ text-wrap: pretty;
73
+ }
74
+ .scb-viz-print-table tbody th {
75
+ font-weight: 400;
76
+ white-space: normal;
77
+ overflow-wrap: break-word;
78
+ word-break: normal;
79
+ hyphens: auto;
80
+ }
81
+ .scb-viz-print-table tbody tr:nth-child(odd) { background: #f5f5f5; }
82
+ .scb-viz-print-table tbody tr:nth-child(even) { background: #fff; }
83
+ .scb-viz-print-table .align-right { text-align: right; }
84
+ .scb-viz-print-table tbody td.align-right { white-space: nowrap; }
85
+ .scb-viz-print-table .align-left { text-align: left; }
86
+ </style>
87
+ </head>
88
+ <body>
89
+ <article class="viz-print">
90
+ <header class="viz-header">
91
+ ${t.title?`<h1 class="viz-title">${e(t.title)}</h1>`:""}
92
+ ${t.subtitle?`<div class="viz-subtitle">${e(t.subtitle)}</div>`:""}
93
+ </header>
94
+ <div class="viz-content">${t.contentHtml}</div>
95
+ ${t.footerHtml||""}
96
+ </article>
97
+ </body>
98
+ </html>`}export{g as a,m as b,b as c};
@@ -0,0 +1 @@
1
+ import{g as f,a as l}from"./scb-viz-series-differentiation-registry.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,i,n){try{customElements.get(r)||t(r,i,n)}catch(c){var s=String(c||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();function b(e){return f(e)}function z(e,t){let r="";const i=t&&t.options&&typeof t.options=="object"?t.options:{},n=t&&t.userOptions&&typeof t.userOptions=="object"?t.userOptions:{},s=e&&e.options&&typeof e.options=="object"?e.options:{},c=s.custom&&typeof s.custom=="object"?s.custom:{},o=e&&e.custom&&typeof e.custom=="object"?e.custom:{};return i.chart&&typeof i.chart.id=="string"?r=i.chart.id:n.chart&&typeof n.chart.id=="string"&&(r=n.chart.id),r=String(r||"").trim().toLowerCase(),r==="grouped-column"||r==="grouped-bar"||i.custom&&i.custom.scbVizGroupedClustered===!0||c.scbVizGroupedCategory===!0||c.scbVizGroupedCategoryLegend===!0||o.scbVizGroupedCategory===!0||o.scbVizGroupedCategoryLegend===!0||e&&e._scbVizGroupedCategoryLegendItem===!0?!0:p(e)}function p(e){return Array.isArray(e?.points)&&e.points.some(t=>{const r=t&&t.custom&&typeof t.custom=="object"?t.custom:{};return typeof r.scbVizGroup=="string"&&r.scbVizGroup.trim()})}function d(e){const r=[e?.colorIndex,e?.options?.colorIndex,e?.userOptions?.colorIndex,e?.series?.colorIndex,e?.series?.options?.colorIndex].find(i=>Number.isInteger(i));return Number.isInteger(r)?Number(r):null}function m(e){return!e||typeof e!="object"?{indexByKey:{},nextIndex:0}:((!e.scbVizGroupedSeriesDifferentiationStore||typeof e.scbVizGroupedSeriesDifferentiationStore!="object")&&(e.scbVizGroupedSeriesDifferentiationStore={indexByKey:{},nextIndex:0}),e.scbVizGroupedSeriesDifferentiationStore)}function g(e,t){const r=d(e);if(Number.isInteger(r))return`color:${r}`;const i=e?.custom&&typeof e.custom=="object"&&typeof e.custom.scbVizGroup=="string"?e.custom.scbVizGroup.trim():"";if(i)return`group:${i}`;const n=typeof e?.name=="string"?e.name.trim():"";if(n)return`name:${n}`;const s=typeof e?.series?.name=="string"?e.series.name.trim():"";return s?`series:${s}`:`fallback:${t}`}function S(e,t,r){const i=d(e);if(typeof i=="number"&&Number.isInteger(i))return i;const n=m(t),s=g(e,r);return Object.prototype.hasOwnProperty.call(n.indexByKey,s)||(n.indexByKey[s]=n.nextIndex,n.nextIndex+=1),n.indexByKey[s]}function V(e,t,r){const i=S(e,t,r);return{variantIndex:i,...b(i)}}function v(e){return e.getCurrentPrintableView()!=="diagram"||!e.chart?.series?.length||!e.isHighchartsStyledMode(e.chart)?!1:e.chart.series.some(t=>e.getSeriesDifferentiationGroup(t,e.chart)!==null)}function a(e){const t=e?.element??e;return t instanceof SVGElement?t:null}function A(e){return!!(e?.styledMode||e?.renderer?.styledMode||e?.options?.chart?.styledMode)}function h(e){if(e?.container instanceof SVGSVGElement)return e.container;const t=e?.renderTo?.querySelector("svg")??e?.container?.querySelector?.("svg");return t instanceof SVGSVGElement?t:null}function x(e,t){const r=a(e);return Array.from(r?.classList??[]).find(n=>/^highcharts-color-\d+$/.test(n))??`highcharts-color-${t}`}function G(e,t){const r=a(e);r&&(r.setAttribute("data-scb-viz-role",t.role),t.dashStyle?r.setAttribute("data-scb-viz-dash-style",t.dashStyle):r.removeAttribute("data-scb-viz-dash-style"),t.patternKind?r.setAttribute("data-scb-viz-pattern-kind",t.patternKind):r.removeAttribute("data-scb-viz-pattern-kind"))}function C(e){const t=a(e);t&&(t.removeAttribute("data-scb-viz-role"),t.removeAttribute("data-scb-viz-dash-style"),t.removeAttribute("data-scb-viz-pattern-kind"))}function I(e,t){const r=a(e);if(!r||!t)return;const i=Array.from(r.classList).find(n=>/^highcharts-color-\d+$/.test(n));i!==t&&(i&&(r.classList.remove(i),r.setAttribute("data-scb-viz-prev-color-class",i)),r.classList.add(t),r.setAttribute("data-scb-viz-added-color-class",t))}function D(e){const t=a(e);if(!t)return;const r=t.getAttribute("data-scb-viz-added-color-class"),i=t.getAttribute("data-scb-viz-prev-color-class");r&&(t.classList.remove(r),t.removeAttribute("data-scb-viz-added-color-class")),i&&(t.classList.add(i),t.removeAttribute("data-scb-viz-prev-color-class"))}function _(e){const t=[],r=[],i=a(e?.legendItem?.group),n=(s,c)=>{const o=a(c);!o||s.includes(o)||s.push(o)};if(n(t,e?.legendLine),n(t,e?.legendItem?.line),n(r,e?.legendSymbol),n(r,e?.legendItem?.symbol),n(r,e?.legendArea),n(r,e?.legendItem?.area),i){const s=i.querySelector(".highcharts-graph, .highcharts-legend-graph, line");s&&n(t,s),i.querySelectorAll("rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path").forEach(c=>{n(r,c)})}return{graphTargets:t,fillTargets:r.filter(s=>!t.includes(s))}}function E(e,t,r){const i=h(e);if(!i)return;const n="http://www.w3.org/2000/svg";let s=i.querySelector("defs");s instanceof SVGDefsElement||(s=document.createElementNS(n,"defs"),i.insertBefore(s,i.firstChild));const c=`scb-viz-pattern-${t}-${r}`;if(s.querySelector(`#${c}`))return;const o=document.createElementNS(n,"pattern");o.setAttribute("id",c),o.setAttribute("patternUnits","userSpaceOnUse"),o.setAttribute("width","10"),o.setAttribute("height","10"),o.classList.add(t);const u=document.createElementNS(n,"rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width","10"),u.setAttribute("height","10"),u.setAttribute("class","scb-viz-highcharts-pattern__background"),o.appendChild(u),l(o,n,r),s.appendChild(o)}export{V as a,A as b,h as c,x as d,G as e,C as f,b as g,I as h,z as i,D as j,_ as k,E as l,v as s,p as u};
@@ -0,0 +1 @@
1
+ (function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var l=customElements.define.bind(customElements);customElements.define=function(n,o,r){try{customElements.get(n)||l(n,o,r)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();function g(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)}}function b(t){if(!t)return;const l=t.assignedElements({flatten:!0}),n=[];l.forEach(e=>{if(e.tagName==="TABLE"){n.push(e);return}e.querySelectorAll("table").forEach(h=>n.push(h))});const o=n[0];if(!o)return;const r=[],s=[],i=[],c=e=>e?(e.textContent??"").replace(/\s+/g," ").trim():"",a=e=>e?{html:(e.innerHTML??"").trim(),text:c(e)}:{html:"",text:""},u=o.querySelector("thead tr");u&&Array.from(u.querySelectorAll("th, td")).forEach(e=>{r.push(a(e))});const d=Array.from(o.querySelectorAll("tbody tr")),m=d.length>0?d:Array.from(o.querySelectorAll("tr")).filter(e=>e.closest("thead")===null);if(m.forEach(e=>{const h=Array.from(e.querySelectorAll("th, td"));if(h.length===0)return;i.push(h[0].tagName==="TH"&&e.closest("thead")===null&&e.closest("tfoot")===null);const f=[];h.forEach(w=>f.push(a(w))),s.push(f)}),!u&&s.length>0){const e=s[0],h=m[0],f=Array.from(h?.querySelectorAll("th, td")??[]);f.length>0&&f.every(p=>p.tagName==="TH")&&h?.closest("tbody")===null&&(r.splice(0,r.length,...e),s.shift(),i.shift())}return{headers:r.length>0?r:void 0,rows:s,rowHeaderRows:i.length>0?i:void 0}}function y(t,l){const n=Math.max(t.headers?.length??0,...t.rows.map(r=>r.length)),o=[];for(let r=0;r<n;r+=1){if(r===0){o.push("left");continue}const s=t.rows.map(c=>g(c[r]).text).filter(c=>c!==""&&c!==null&&c!==void 0),i=s.length>0&&s.every(c=>l(c)!==null);o.push(i?"right":"left")}return o}function x(t,l){const n=l.normalizeCell??g,o=l.formatCell??(a=>n(a)),r=l.inferAlignments(t),s=Math.max(t.headers?.length??0,...t.rows.map(a=>a.length)),i=(t.headers??[]).map(a=>n(a)),c=t.rows.map(a=>{const u=a.map((d,m)=>o(d,m,r));for(;u.length<s;)u.push({html:"",text:""});return u});return{alignments:r,colCount:s,headers:i,rows:c,rowHeaderRows:t.rowHeaderRows??[]}}function S(t,l=g){const n=[];return t.headers?.length&&n.push(t.headers.map(o=>l(o).text)),t.rows.forEach(o=>{n.push(o.map(r=>l(r).text))}),n}export{x as b,S as c,y as i,g as n,b as r};