scb-wc-test 0.1.344 → 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);
@@ -1,6 +1,6 @@
1
- import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"../scb-chevron/scb-chevron.js";import"../../vendor/vendor-material.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(i,o,s){try{customElements.get(i)||e(i,o,s)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,c=(t,e,i,o)=>{for(var s=o>1?void 0:o?g(e,i):e,l=t.length-1,a;l>=0;l--)(a=t[l])&&(s=(o?a(e,i,s):a(s))||s);return o&&s&&v(e,i,s),s};let r=class extends m{constructor(){super(...arguments),this.expanded=!1,this.label="",this.supportingText="",this.itemHref="#",this.noDivider=!1,this._unique=r._uid(),this._overflowVisibleTimer=null,this._slotHasContent=!1,this._trailingSlotHasContent=!1,this._onSlotChange=()=>{const t=this.renderRoot.querySelector("slot:not([name])"),e=!!t&&t.assignedElements({flatten:!0}).length>0;this._slotHasContent!==e&&(this._slotHasContent=e,this.requestUpdate()),!this._slotHasContent&&this.expanded&&(this.expanded=!1),this._applyInertByExpanded()},this._toggleAccordion=()=>{if(!this._slotHasContent)return;const t=!this.expanded;this.setExpanded(t)},this._onKeyDown=t=>{const e=this.closest("scb-toc"),o=Array.from(e?.querySelectorAll("scb-toc-item")||[]).map(n=>({host:n,label:n.renderRoot.querySelector(".toc-item-label")||null})).filter(n=>!!n.label),s=o.findIndex(n=>n.host===this);if(s<0)return;const a=t.currentTarget?.classList?.contains("toc-chevron-button")??!1;switch(t.key){case"Enter":case" ":if(!a)return;t.preventDefault(),this._toggleAccordion();break;case"ArrowDown":t.preventDefault(),s<o.length-1&&o[s+1].label.focus();break;case"ArrowUp":t.preventDefault(),s>0&&o[s-1].label.focus();break;case"Home":t.preventDefault(),o.length&&o[0].label.focus();break;case"End":t.preventDefault(),o.length&&o[o.length-1].label.focus();break}}}setExpanded(t){this.expanded!==t&&(this.expanded=t)}static _uid(){return globalThis.crypto?.randomUUID?.()??`${r._uidPrefix}-${++r._uidSeq}`}firstUpdated(){this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded()}updated(t){t.has("expanded")&&(this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded(),this.dispatchEvent(new CustomEvent("expanded-changed",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("expandedchanged",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),this._slotHasContent=Array.from(this.children).some(t=>{const e=t.getAttribute("slot");return e===null||e===""}),this._trailingSlotHasContent=Array.from(this.children).some(t=>t.getAttribute("slot")==="trailing"),!this._slotHasContent&&this.expanded&&(this.expanded=!1)}disconnectedCallback(){super.disconnectedCallback(),this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null)}_applyInertByExpanded(){const t=this.renderRoot.querySelector(".scb-toc-item-bottom");t&&(this.expanded?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_syncOverflowVisibilityByExpanded(){if(this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null),this.removeAttribute("data-expanded-settled"),!this.expanded)return;const t=this.renderRoot.querySelector(".scb-toc-item-bottom");if(!t){this.setAttribute("data-expanded-settled","");return}const e=this._getTransitionMs(t);if(e<=0){this.setAttribute("data-expanded-settled","");return}this._overflowVisibleTimer=window.setTimeout(()=>{this._overflowVisibleTimer=null,this.expanded&&this.setAttribute("data-expanded-settled","")},e)}_getTransitionMs(t){const e=getComputedStyle(t),i=e.transitionDuration.split(",").map(n=>n.trim()),o=e.transitionDelay.split(",").map(n=>n.trim()),s=n=>{const d=parseFloat(n);return Number.isFinite(d)?n.endsWith("ms")?d:n.endsWith("s")?d*1e3:d:0},l=Math.max(i.length,o.length);let a=0;for(let n=0;n<l;n+=1){const d=s(i[n]??i[i.length-1]??"0s"),b=s(o[n]??o[o.length-1]??"0s");a=Math.max(a,d+b)}return Math.ceil(a)}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const t=this.renderRoot.querySelector("slot:not([name])");if(!t)return[];const e=t.assignedElements({flatten:!0}),i=[],o=s=>{s instanceof HTMLElement&&s.matches("a,button,input,select,textarea,[tabindex]")&&i.push(s)};return e.forEach(s=>{o(s),s.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(l=>o(l))}),i}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(e=>{const i=e.getAttribute("tabindex");i!==null&&e.setAttribute("data-scb-prev-tabindex",i),e.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(e=>{const i=e.getAttribute("data-scb-prev-tabindex");i!==null?(e.setAttribute("tabindex",i),e.removeAttribute("data-scb-prev-tabindex")):e.removeAttribute("tabindex")})}render(){const t=`bottom-${this._unique}`,e=`toc-label-${this._unique}`,i=`toc-chevron-${this._unique}`;return u`
1
+ import{a as g,n as p,i as h,x as b,t as u}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"../scb-chevron/scb-chevron.js";import"../../vendor/vendor-material.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(s,i,o){try{customElements.get(s)||e(s,i,o)}catch(r){var c=String(r||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var o=i>1?void 0:i?y(e,s):e,c=t.length-1,r;c>=0;c--)(r=t[c])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&v(e,s,o),o};let n=class extends h{constructor(){super(...arguments),this.expanded=!1,this.size="medium",this.label="",this.supportingText="",this.itemHref="#",this.noDivider=!1,this._unique=n._uid(),this._overflowVisibleTimer=null,this._slotHasContent=!1,this._trailingSlotHasContent=!1,this._onSlotChange=()=>{const t=this.renderRoot.querySelector("slot:not([name])"),e=!!t&&t.assignedElements({flatten:!0}).length>0;this._slotHasContent!==e&&(this._slotHasContent=e,this.requestUpdate()),!this._slotHasContent&&this.expanded&&(this.expanded=!1),this._applyInertByExpanded()},this._toggleAccordion=()=>{if(!this._slotHasContent)return;const t=!this.expanded;this.setExpanded(t)},this._onKeyDown=t=>{const e=this.closest("scb-toc"),i=Array.from(e?.querySelectorAll("scb-toc-item")||[]).map(a=>({host:a,label:a.renderRoot.querySelector(".toc-item-label")||null})).filter(a=>!!a.label),o=i.findIndex(a=>a.host===this);if(o<0)return;const r=t.currentTarget?.classList?.contains("toc-chevron-button")??!1;switch(t.key){case"Enter":case" ":if(!r)return;t.preventDefault(),this._toggleAccordion();break;case"ArrowDown":t.preventDefault(),o<i.length-1&&i[o+1].label.focus();break;case"ArrowUp":t.preventDefault(),o>0&&i[o-1].label.focus();break;case"Home":t.preventDefault(),i.length&&i[0].label.focus();break;case"End":t.preventDefault(),i.length&&i[i.length-1].label.focus();break}}}setExpanded(t){this.expanded!==t&&(this.expanded=t)}static _uid(){return globalThis.crypto?.randomUUID?.()??`${n._uidPrefix}-${++n._uidSeq}`}firstUpdated(){this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded()}updated(t){t.has("expanded")&&(this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded(),this.dispatchEvent(new CustomEvent("expanded-changed",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("expandedchanged",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),this._slotHasContent=Array.from(this.children).some(t=>{const e=t.getAttribute("slot");return e===null||e===""}),this._trailingSlotHasContent=Array.from(this.children).some(t=>t.getAttribute("slot")==="trailing"),!this._slotHasContent&&this.expanded&&(this.expanded=!1)}disconnectedCallback(){super.disconnectedCallback(),this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null)}_applyInertByExpanded(){const t=this.renderRoot.querySelector(".scb-toc-item-bottom");t&&(this.expanded?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_syncOverflowVisibilityByExpanded(){if(this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null),this.removeAttribute("data-expanded-settled"),!this.expanded)return;const t=this.renderRoot.querySelector(".scb-toc-item-bottom");if(!t){this.setAttribute("data-expanded-settled","");return}const e=this._getTransitionMs(t);if(e<=0){this.setAttribute("data-expanded-settled","");return}this._overflowVisibleTimer=window.setTimeout(()=>{this._overflowVisibleTimer=null,this.expanded&&this.setAttribute("data-expanded-settled","")},e)}_getTransitionMs(t){const e=getComputedStyle(t),s=e.transitionDuration.split(",").map(a=>a.trim()),i=e.transitionDelay.split(",").map(a=>a.trim()),o=a=>{const d=parseFloat(a);return Number.isFinite(d)?a.endsWith("ms")?d:a.endsWith("s")?d*1e3:d:0},c=Math.max(s.length,i.length);let r=0;for(let a=0;a<c;a+=1){const d=o(s[a]??s[s.length-1]??"0s"),m=o(i[a]??i[i.length-1]??"0s");r=Math.max(r,d+m)}return Math.ceil(r)}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const t=this.renderRoot.querySelector("slot:not([name])");if(!t)return[];const e=t.assignedElements({flatten:!0}),s=[],i=o=>{o instanceof HTMLElement&&o.matches("a,button,input,select,textarea,[tabindex]")&&s.push(o)};return e.forEach(o=>{i(o),o.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(c=>i(c))}),s}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(e=>{const s=e.getAttribute("tabindex");s!==null&&e.setAttribute("data-scb-prev-tabindex",s),e.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(e=>{const s=e.getAttribute("data-scb-prev-tabindex");s!==null?(e.setAttribute("tabindex",s),e.removeAttribute("data-scb-prev-tabindex")):e.removeAttribute("tabindex")})}render(){const t=`bottom-${this._unique}`,e=`toc-label-${this._unique}`,s=`toc-chevron-${this._unique}`,i=this.supportingText.trim().length>0;return b`
2
2
  <div class="scb-toc-item" role="listitem">
3
- <div class="scb-toc-item-top">
3
+ <div class=${`scb-toc-item-top${i?"":" no-supporting-text"}`}>
4
4
  <div>
5
5
  <div class="toc-item-label-wrapper">
6
6
  <a
@@ -13,17 +13,17 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
13
13
  </a>
14
14
  <md-focus-ring for=${e} inward></md-focus-ring>
15
15
  </div>
16
- <div class="supporting-text">${this.supportingText}</div>
16
+ ${i?b`<div class="supporting-text">${this.supportingText}</div>`:""}
17
17
  </div>
18
18
 
19
- ${this._trailingSlotHasContent?u`
19
+ ${this._trailingSlotHasContent?b`
20
20
  <div class="toc-chevron-button-wrapper">
21
21
  <slot name="trailing"></slot>
22
22
  </div>
23
- `:this._slotHasContent?u`
23
+ `:this._slotHasContent?b`
24
24
  <div class="toc-chevron-button-wrapper">
25
25
  <button
26
- id=${i}
26
+ id=${s}
27
27
  class="toc-chevron-button"
28
28
  type="button"
29
29
  aria-label=${this.expanded?"Fäll ihop avsnitt":"Fäll ut avsnitt"}
@@ -34,7 +34,7 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
34
34
  >
35
35
  <md-ripple></md-ripple>
36
36
  <scb-chevron class="toc-chevron-icon" .open=${this.expanded}></scb-chevron>
37
- <md-focus-ring for=${i} inward></md-focus-ring>
37
+ <md-focus-ring for=${s} inward></md-focus-ring>
38
38
  </button>
39
39
  </div>
40
40
  `:""}
@@ -47,18 +47,97 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
47
47
  </div>
48
48
  </div>
49
49
 
50
- ${this.noDivider?"":u`<scb-divider></scb-divider>`}
50
+ ${this.noDivider?"":b`<scb-divider></scb-divider>`}
51
51
  </div>
52
- `}};r._uidPrefix=`uid-${Math.random().toString(36).slice(2)}`;r._uidSeq=0;r.styles=[h`
52
+ `}};n._uidPrefix=`uid-${Math.random().toString(36).slice(2)}`;n._uidSeq=0;n.styles=[g`
53
53
  :host {
54
54
  display: block;
55
55
  --scb-toc-transition-duration: var(--motion-duration-short, 150ms);
56
56
  --scb-toc-transition-easing: var(--motion-easing-emphasized-accelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)));
57
57
  --scb-toc-panel-padding-closed: var(--spacing-0, 0px);
58
+ --scb-toc-item-top-padding-y: var(--spacing-5, 16px);
59
+ --scb-toc-item-top-padding-x: var(--spacing-3, 8px);
60
+ --scb-toc-item-top-gap: var(--spacing-5, 16px);
61
+ --scb-toc-item-label-margin-bottom: var(--spacing-3, 8px);
62
+ --scb-toc-item-label-font-size: var(--md-sys-typescale-body-large-size);
63
+ --scb-toc-item-label-line-height: var(--md-sys-typescale-body-large-line-height);
64
+ --scb-toc-item-label-tracking: var(--md-sys-typescale-body-large-tracking);
65
+ --scb-toc-item-supporting-font-size: var(--md-sys-typescale-body-medium-size);
66
+ --scb-toc-item-supporting-line-height: var(--md-sys-typescale-body-medium-line-height);
67
+ --scb-toc-item-supporting-tracking: var(--md-sys-typescale-body-medium-tracking);
68
+ --scb-toc-item-panel-padding-right: var(--spacing-5, 16px);
69
+ --scb-toc-item-panel-padding-left: var(--spacing-9, 32px);
70
+ --scb-toc-item-panel-padding-open: var(--spacing-5, 16px);
71
+ --scb-toc-item-panel-font-size: var(--md-sys-typescale-body-medium-size);
72
+ --scb-toc-item-panel-line-height: var(--md-sys-typescale-body-medium-line-height);
73
+ --scb-toc-item-panel-tracking: var(--md-sys-typescale-body-medium-tracking);
74
+ --scb-toc-item-chevron-size: 40px;
75
+ --scb-toc-item-icon-size: var(--icon-size-medium, 24px);
58
76
  color: var(--md-sys-color-on-surface);
59
77
  font-family: var(--brand-font, 'Inter', sans-serif);
60
78
  }
61
79
 
80
+ :host([size='small']) {
81
+ --scb-toc-item-top-padding-y: var(--spacing-4, 12px);
82
+ --scb-toc-item-top-gap: var(--spacing-4, 12px);
83
+ --scb-toc-item-label-margin-bottom: var(--spacing-2, 4px);
84
+ --scb-toc-item-label-font-size: var(--md-sys-typescale-body-small-size);
85
+ --scb-toc-item-label-line-height: var(--md-sys-typescale-body-small-line-height);
86
+ --scb-toc-item-label-tracking: var(--md-sys-typescale-body-small-tracking);
87
+ --scb-toc-item-supporting-font-size: var(--md-sys-typescale-body-small-size);
88
+ --scb-toc-item-supporting-line-height: var(--md-sys-typescale-body-small-line-height);
89
+ --scb-toc-item-supporting-tracking: var(--md-sys-typescale-body-small-tracking);
90
+ --scb-toc-item-panel-padding-right: var(--spacing-4, 12px);
91
+ --scb-toc-item-panel-padding-left: var(--spacing-7, 24px);
92
+ --scb-toc-item-panel-padding-open: var(--spacing-4, 12px);
93
+ --scb-toc-item-panel-font-size: var(--md-sys-typescale-body-small-size);
94
+ --scb-toc-item-panel-line-height: var(--md-sys-typescale-body-small-line-height);
95
+ --scb-toc-item-panel-tracking: var(--md-sys-typescale-body-small-tracking);
96
+ --scb-toc-item-chevron-size: 36px;
97
+ --scb-toc-item-icon-size: var(--icon-size-small, 20px);
98
+ }
99
+
100
+ :host([size='extra-small']) {
101
+ --scb-toc-item-top-padding-y: var(--spacing-3, 8px);
102
+ --scb-toc-item-top-padding-x: var(--spacing-2, 4px);
103
+ --scb-toc-item-top-gap: var(--spacing-3, 8px);
104
+ --scb-toc-item-label-margin-bottom: var(--spacing-1, 2px);
105
+ --scb-toc-item-label-font-size: var(--md-sys-typescale-body-small-size);
106
+ --scb-toc-item-label-line-height: var(--md-sys-typescale-body-small-line-height);
107
+ --scb-toc-item-label-tracking: var(--md-sys-typescale-body-small-tracking);
108
+ --scb-toc-item-supporting-font-size: var(--md-sys-typescale-body-small-size);
109
+ --scb-toc-item-supporting-line-height: var(--md-sys-typescale-body-small-line-height);
110
+ --scb-toc-item-supporting-tracking: var(--md-sys-typescale-body-small-tracking);
111
+ --scb-toc-item-panel-padding-right: var(--spacing-3, 8px);
112
+ --scb-toc-item-panel-padding-left: var(--spacing-6, 20px);
113
+ --scb-toc-item-panel-padding-open: var(--spacing-3, 8px);
114
+ --scb-toc-item-panel-font-size: var(--md-sys-typescale-body-small-size);
115
+ --scb-toc-item-panel-line-height: var(--md-sys-typescale-body-small-line-height);
116
+ --scb-toc-item-panel-tracking: var(--md-sys-typescale-body-small-tracking);
117
+ --scb-toc-item-chevron-size: 32px;
118
+ --scb-toc-item-icon-size: var(--icon-size-small, 20px);
119
+ }
120
+
121
+ :host([size='large']) {
122
+ --scb-toc-item-top-padding-y: var(--spacing-6, 20px);
123
+ --scb-toc-item-top-gap: var(--spacing-6, 20px);
124
+ --scb-toc-item-label-margin-bottom: var(--spacing-4, 12px);
125
+ --scb-toc-item-label-font-size: var(--md-sys-typescale-title-small-size);
126
+ --scb-toc-item-label-line-height: var(--md-sys-typescale-title-small-line-height);
127
+ --scb-toc-item-label-tracking: var(--md-sys-typescale-title-small-tracking);
128
+ --scb-toc-item-supporting-font-size: var(--md-sys-typescale-body-large-size);
129
+ --scb-toc-item-supporting-line-height: var(--md-sys-typescale-body-large-line-height);
130
+ --scb-toc-item-supporting-tracking: var(--md-sys-typescale-body-large-tracking);
131
+ --scb-toc-item-panel-padding-right: var(--spacing-6, 20px);
132
+ --scb-toc-item-panel-padding-left: var(--spacing-10, 40px);
133
+ --scb-toc-item-panel-padding-open: var(--spacing-6, 20px);
134
+ --scb-toc-item-panel-font-size: var(--md-sys-typescale-body-large-size);
135
+ --scb-toc-item-panel-line-height: var(--md-sys-typescale-body-large-line-height);
136
+ --scb-toc-item-panel-tracking: var(--md-sys-typescale-body-large-tracking);
137
+ --scb-toc-item-chevron-size: 48px;
138
+ --scb-toc-item-icon-size: var(--icon-size-medium, 24px);
139
+ }
140
+
62
141
  :host([expanded]) {
63
142
  --scb-toc-transition-easing: var(
64
143
  --motion-easing-emphasized-decelerate,
@@ -67,10 +146,19 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
67
146
  }
68
147
 
69
148
  .scb-toc-item-top {
70
- padding: var(--spacing-5, 16px) var(--spacing-3, 8px);
149
+ padding: var(--scb-toc-item-top-padding-y) var(--scb-toc-item-top-padding-x);
71
150
  display: flex;
72
- gap: var(--spacing-5, 16px);
151
+ gap: var(--scb-toc-item-top-gap);
73
152
  flex-direction: row;
153
+ align-items: flex-start;
154
+ }
155
+
156
+ .scb-toc-item-top.no-supporting-text {
157
+ align-items: center;
158
+ }
159
+
160
+ .scb-toc-item-top.no-supporting-text .toc-item-label {
161
+ margin-bottom: 0;
74
162
  }
75
163
 
76
164
  .toc-item-label-wrapper {
@@ -83,14 +171,14 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
83
171
  display: block;
84
172
  width: fit-content;
85
173
  color: var(--md-sys-color-primary);
86
- font-size: var(--md-sys-typescale-body-large-size);
174
+ font-size: var(--scb-toc-item-label-font-size);
87
175
  font-weight: var(--weight-semibold);
88
- line-height: var(--md-sys-typescale-body-large-line-height);
89
- letter-spacing: var(--md-sys-typescale-body-large-tracking);
176
+ line-height: var(--scb-toc-item-label-line-height);
177
+ letter-spacing: var(--scb-toc-item-label-tracking);
90
178
  text-decoration: underline;
91
179
  text-decoration-thickness: 1px;
92
180
  text-underline-offset: 0.1578em;
93
- margin-bottom: var(--spacing-3, 8px);
181
+ margin-bottom: var(--scb-toc-item-label-margin-bottom);
94
182
  }
95
183
 
96
184
  .toc-item-label:hover {
@@ -111,9 +199,9 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
111
199
  }
112
200
 
113
201
  .supporting-text {
114
- font-size: var(--md-sys-typescale-body-medium-size);
115
- line-height: var(--md-sys-typescale-body-medium-line-height);
116
- letter-spacing: var(--md-sys-typescale-body-medium-tracking);
202
+ font-size: var(--scb-toc-item-supporting-font-size);
203
+ line-height: var(--scb-toc-item-supporting-line-height);
204
+ letter-spacing: var(--scb-toc-item-supporting-tracking);
117
205
  color: var(--md-sys-color-on-surface-variant);
118
206
  }
119
207
 
@@ -129,8 +217,8 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
129
217
  display: inline-flex;
130
218
  align-items: center;
131
219
  justify-content: center;
132
- inline-size: 40px;
133
- block-size: 40px;
220
+ inline-size: var(--scb-toc-item-chevron-size);
221
+ block-size: var(--scb-toc-item-chevron-size);
134
222
  padding: 0;
135
223
  border: 0;
136
224
  background: transparent;
@@ -157,7 +245,7 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
157
245
  }
158
246
 
159
247
  .toc-chevron-icon {
160
- --scb-chevron-size: var(--icon-size-medium, 24px);
248
+ --scb-chevron-size: var(--scb-toc-item-icon-size);
161
249
  --chevron-offset-down: 2.8px;
162
250
  --chevron-offset-up: -2.8px;
163
251
  }
@@ -177,18 +265,18 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
177
265
  opacity: 0;
178
266
  overflow: hidden;
179
267
  padding-top: var(--spacing-0, 0px);
180
- padding-right: var(--spacing-5, 16px);
268
+ padding-right: var(--scb-toc-item-panel-padding-right);
181
269
  padding-bottom: var(--scb-toc-panel-padding-closed);
182
- padding-left: var(--spacing-9, 32px);
183
- font-size: var(--md-sys-typescale-body-medium-size);
184
- line-height: var(--md-sys-typescale-body-medium-line-height); /* 150% */
185
- letter-spacing: var(--md-sys-typescale-body-medium-tracking);
270
+ padding-left: var(--scb-toc-item-panel-padding-left);
271
+ font-size: var(--scb-toc-item-panel-font-size);
272
+ line-height: var(--scb-toc-item-panel-line-height); /* 150% */
273
+ letter-spacing: var(--scb-toc-item-panel-tracking);
186
274
  }
187
275
 
188
276
  :host([expanded]) .scb-toc-item-bottom {
189
277
  grid-template-rows: 1fr;
190
278
  opacity: 1;
191
- padding-bottom: var(--spacing-5, 16px);
279
+ padding-bottom: var(--scb-toc-item-panel-padding-open);
192
280
  }
193
281
 
194
282
  .bottom-inner {
@@ -212,4 +300,4 @@ import{a as h,n as p,i as m,x as u,t as f}from"../../vendor/vendor.js";import"..
212
300
  display: none;
213
301
  }
214
302
  }
215
- `];c([p({type:Boolean,reflect:!0})],r.prototype,"expanded",2);c([p({type:String,reflect:!0})],r.prototype,"label",2);c([p({type:String,attribute:"supporting-text"})],r.prototype,"supportingText",2);c([p({type:String,attribute:"item-href"})],r.prototype,"itemHref",2);c([p({type:Boolean,attribute:"no-divider"})],r.prototype,"noDivider",2);r=c([f("scb-toc-item")],r);
303
+ `];l([p({type:Boolean,reflect:!0})],n.prototype,"expanded",2);l([p({type:String,reflect:!0})],n.prototype,"size",2);l([p({type:String,reflect:!0})],n.prototype,"label",2);l([p({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",2);l([p({type:String,attribute:"item-href"})],n.prototype,"itemHref",2);l([p({type:Boolean,attribute:"no-divider"})],n.prototype,"noDivider",2);n=l([u("scb-toc-item")],n);
@@ -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};