scb-wc-test 0.1.283 → 0.1.284

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 g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";(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(s,r,e){try{customElements.get(s)||l(s,r,e)}catch(n){var a=String(n||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var m=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=t=>{throw TypeError(t)},i=(t,l,s,r)=>{for(var e=r>1?void 0:r?y(l,s):l,a=t.length-1,n;a>=0;a--)(n=t[a])&&(e=(r?n(l,s,e):n(e))||e);return r&&e&&m(l,s,e),e},w=(t,l,s)=>l.has(t)||b("Cannot "+s),z=(t,l,s)=>l.has(t)?b("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(t):l.set(t,s),p=(t,l,s)=>(w(t,l,"access private method"),s),d,u,f;let o=class extends v{constructor(){super(...arguments),z(this,d),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap="",this.updateScrollButtons=()=>{this.requestUpdate();const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return;t.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const l=t;l.scrollLeft+l.clientWidth<l.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.handleScroll=()=>{const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");t&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)},this.handleWheel=t=>{const l=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!l||t.deltaY===0)return;const s=l.scrollLeft,r=s>0,e=s+l.clientWidth<l.scrollWidth-1;!r&&!e||(l.scrollLeft+=t.deltaY,l.scrollLeft!==s&&t.preventDefault())}}doScrollBy(t){const l=this.shadowRoot?.querySelector(".scb-horizontal-scroller");l&&l.scrollBy({left:t,behavior:"smooth"})}get canScrollLeft(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");return t?t.scrollLeft>0:!1}get canScrollRight(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return!1;const l=t;return l.scrollLeft+l.clientWidth<l.scrollWidth-1}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this.updateScrollButtons,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",this.updateScrollButtons,!0),this.scrollerEl&&(this.scrollerEl.removeEventListener("scroll",this.handleScroll),this.scrollerEl.removeEventListener("wheel",this.handleWheel)),this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null),this.resizeRaf!==null&&(cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollerEl=null,this.slotEl=null}dispatchCustomEvent(t,l={}){this.dispatchEvent(new CustomEvent(t,{detail:l,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(t,l={}){if(this.dispatchCustomEvent(t,l),t.includes("-")){const s=t.replace(/-/g,"");this.dispatchCustomEvent(s,l)}}firstUpdated(){this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot");const t=this.shadowRoot?.querySelector(".scroll-shadow-left"),l=this.shadowRoot?.querySelector(".scroll-shadow-right");this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const s=()=>{if(this.slotEl&&t&&l){const a=this.slotEl.getBoundingClientRect();t.style.height=`${a.height}px`,l.style.height=`${a.height}px`}},r=()=>{s(),this.updateScrollButtons()},e=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,r()}))};r(),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{e()}),this.sizeObserver=new ResizeObserver(()=>{e()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),this.updateComplete.then(()=>{r()}),p(this,d,u).call(this),p(this,d,f).call(this)}updated(t){t.has("width")&&(this.style.setProperty("--scb-horizontal-scroller-width",this.width),this.updateScrollButtons()),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&p(this,d,u).call(this),(t.has("internalGap")||t.has("contentFlex"))&&p(this,d,f).call(this),(t.has("variant")||t.has("showScrollbar")||t.has("rightScrollButtonLabel")||t.has("leftScrollButtonLabel"))&&this.updateScrollButtons()}mapSpacingToken(t){if(!t)return;const l=String(t).trim();if(l)return/^\d+$/.test(l)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(l,10)))})`:l}render(){const t=this.variant,l=!!(this.canScrollLeft||this.canScrollRight);switch(t){case"inline":return h`
1
+ import{a as v,n as a,r as b,i as S,x as h,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";(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(s,i,r){try{customElements.get(s)||l(s,i,r)}catch(n){var c=String(n||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var y=Object.defineProperty,w=Object.getOwnPropertyDescriptor,g=t=>{throw TypeError(t)},o=(t,l,s,i)=>{for(var r=i>1?void 0:i?w(l,s):l,c=t.length-1,n;c>=0;c--)(n=t[c])&&(r=(i?n(l,s,r):n(r))||r);return i&&r&&y(l,s,r),r},z=(t,l,s)=>l.has(t)||g("Cannot "+s),_=(t,l,s)=>l.has(t)?g("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(t):l.set(t,s),p=(t,l,s)=>(z(t,l,"access private method"),s),d,f,u;let e=class extends S{constructor(){super(...arguments),_(this,d),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap="",this._canScrollLeft=!1,this._canScrollRight=!1,this.updateScrollButtons=()=>{const t=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t){this._canScrollLeft&&(this._canScrollLeft=!1),this._canScrollRight&&(this._canScrollRight=!1),this.removeAttribute("data-scroll-left"),this.removeAttribute("data-scroll-right");return}const l=t.scrollLeft>0,s=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this._canScrollLeft!==l&&(this._canScrollLeft=l),this._canScrollRight!==s&&(this._canScrollRight=s),l?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left"),s?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.handleScroll=()=>{const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");t&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)},this.handleWheel=t=>{const l=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!l||t.deltaY===0)return;const s=l.scrollLeft,i=s>0,r=s+l.clientWidth<l.scrollWidth-1;!i&&!r||(l.scrollLeft+=t.deltaY,l.scrollLeft!==s&&t.preventDefault())}}doScrollBy(t){const l=this.shadowRoot?.querySelector(".scb-horizontal-scroller");l&&l.scrollBy({left:t,behavior:"smooth"})}connectedCallback(){super.connectedCallback(),this.style.setProperty("--scb-horizontal-scroller-width",this.width)}disconnectedCallback(){super.disconnectedCallback(),this.scrollerEl&&(this.scrollerEl.removeEventListener("scroll",this.handleScroll),this.scrollerEl.removeEventListener("wheel",this.handleWheel)),this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null),this.resizeRaf!==null&&(cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollerEl=null,this.slotEl=null}dispatchCustomEvent(t,l={}){this.dispatchEvent(new CustomEvent(t,{detail:l,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(t,l={}){if(this.dispatchCustomEvent(t,l),t.includes("-")){const s=t.replace(/-/g,"");this.dispatchCustomEvent(s,l)}}firstUpdated(){this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot");const t=this.shadowRoot?.querySelector(".scroll-shadow-left"),l=this.shadowRoot?.querySelector(".scroll-shadow-right");this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const s=()=>{if(this.slotEl&&t&&l){const c=this.slotEl.getBoundingClientRect();t.style.height=`${c.height}px`,l.style.height=`${c.height}px`}},i=()=>{s(),this.updateScrollButtons()},r=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,i()}))};requestAnimationFrame(()=>{i()}),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{r()}),this.sizeObserver=new ResizeObserver(()=>{r()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),p(this,d,f).call(this),p(this,d,u).call(this)}updated(t){t.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&p(this,d,f).call(this),(t.has("internalGap")||t.has("contentFlex"))&&p(this,d,u).call(this)}mapSpacingToken(t){if(!t)return;const l=String(t).trim();if(l)return/^\d+$/.test(l)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(l,10)))})`:l}render(){const t=this.variant,l=this._canScrollLeft||this._canScrollRight;switch(t){case"inline":return h`
2
2
  <div class="scb-horizontal-scroller ${l?"canScroll":""}" tabindex="0">
3
3
  ${this.variant!="inline"?h`<div class="scroll-shadow-left"></div>`:""}
4
4
  <slot></slot>
@@ -7,7 +7,7 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
7
7
  </div>
8
8
  ${l?h`
9
9
  <div class="scroll-buttons">
10
- ${this.canScrollLeft?h`
10
+ ${this._canScrollLeft?h`
11
11
  <scb-button
12
12
  class="scroll-button-left"
13
13
  variant="text"
@@ -18,7 +18,7 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
18
18
  ></scb-button>
19
19
  `:""}
20
20
 
21
- ${this.canScrollRight?h`
21
+ ${this._canScrollRight?h`
22
22
  <scb-button
23
23
  class="scroll-button-right"
24
24
  variant="text"
@@ -32,7 +32,7 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
32
32
  </div>
33
33
  `:""}
34
34
  `;default:return h`
35
- ${this.canScrollLeft?h`
35
+ ${this._canScrollLeft?h`
36
36
  <scb-icon-button
37
37
  class="scroll-button-left"
38
38
  icon="chevron_left"
@@ -47,7 +47,7 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
47
47
  <md-focus-ring inward></md-focus-ring>
48
48
  </div>
49
49
  <div class="scroll-shadow-right"></div>
50
- ${this.canScrollRight?h`
50
+ ${this._canScrollRight?h`
51
51
  <scb-icon-button
52
52
  class="scroll-button-right"
53
53
  icon="chevron_right"
@@ -56,7 +56,7 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
56
56
  @click="${()=>this.doScrollBy(100)}"
57
57
  ></scb-icon-button>
58
58
  `:""}
59
- `}}};d=new WeakSet;u=function(){const t=this.mapSpacingToken(this.spacing),l=this.mapSpacingToken(this.spacingTop),s=this.mapSpacingToken(this.spacingBottom),r=this.mapSpacingToken(this.spacingLeft),e=this.mapSpacingToken(this.spacingRight),a=l??t,n=s??t;a?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",a):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"),r?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start",r):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"),e?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",e):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")};f=function(){const t=this.mapSpacingToken(this.internalGap);this.contentFlex&&t?this.style.setProperty("--scb-horizontal-scroller-internal-gap",t):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")};o.styles=g`
59
+ `}}};d=new WeakSet;f=function(){const t=this.mapSpacingToken(this.spacing),l=this.mapSpacingToken(this.spacingTop),s=this.mapSpacingToken(this.spacingBottom),i=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight),c=l??t,n=s??t;c?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",c):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"),i?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start",i):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"),r?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",r):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")};u=function(){const t=this.mapSpacingToken(this.internalGap);this.contentFlex&&t?this.style.setProperty("--scb-horizontal-scroller-internal-gap",t):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")};e.styles=v`
60
60
  :host {
61
61
  display: flex;
62
62
  position: relative;
@@ -192,4 +192,4 @@ import{a as g,n as c,i as v,x as h,t as S}from"../../vendor/vendor.js";import"..
192
192
  :host([variant='inline'][show-scrollbar]) {
193
193
  gap: var(--spacing-5);
194
194
  }
195
- `;i([c({type:String,reflect:!0})],o.prototype,"variant",2);i([c({type:String,reflect:!0})],o.prototype,"width",2);i([c({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],o.prototype,"showScrollbar",2);i([c({type:String,reflect:!0,attribute:"right-scroll-button-label"})],o.prototype,"rightScrollButtonLabel",2);i([c({type:String,reflect:!0,attribute:"left-scroll-button-label"})],o.prototype,"leftScrollButtonLabel",2);i([c({type:String,reflect:!0})],o.prototype,"spacing",2);i([c({type:String,reflect:!0,attribute:"spacing-top"})],o.prototype,"spacingTop",2);i([c({type:String,reflect:!0,attribute:"spacing-bottom"})],o.prototype,"spacingBottom",2);i([c({type:String,reflect:!0,attribute:"spacing-left"})],o.prototype,"spacingLeft",2);i([c({type:String,reflect:!0,attribute:"spacing-right"})],o.prototype,"spacingRight",2);i([c({type:Boolean,reflect:!0,attribute:"content-flex"})],o.prototype,"contentFlex",2);i([c({type:String,reflect:!0,attribute:"internal-gap"})],o.prototype,"internalGap",2);o=i([S("scb-horizontal-scroller")],o);
195
+ `;o([a({type:String,reflect:!0})],e.prototype,"variant",2);o([a({type:String,reflect:!0})],e.prototype,"width",2);o([a({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],e.prototype,"showScrollbar",2);o([a({type:String,reflect:!0,attribute:"right-scroll-button-label"})],e.prototype,"rightScrollButtonLabel",2);o([a({type:String,reflect:!0,attribute:"left-scroll-button-label"})],e.prototype,"leftScrollButtonLabel",2);o([a({type:String,reflect:!0})],e.prototype,"spacing",2);o([a({type:String,reflect:!0,attribute:"spacing-top"})],e.prototype,"spacingTop",2);o([a({type:String,reflect:!0,attribute:"spacing-bottom"})],e.prototype,"spacingBottom",2);o([a({type:String,reflect:!0,attribute:"spacing-left"})],e.prototype,"spacingLeft",2);o([a({type:String,reflect:!0,attribute:"spacing-right"})],e.prototype,"spacingRight",2);o([a({type:Boolean,reflect:!0,attribute:"content-flex"})],e.prototype,"contentFlex",2);o([a({type:String,reflect:!0,attribute:"internal-gap"})],e.prototype,"internalGap",2);o([b()],e.prototype,"_canScrollLeft",2);o([b()],e.prototype,"_canScrollRight",2);e=o([m("scb-horizontal-scroller")],e);
@@ -1,4 +1,4 @@
1
- import{a as b,n as l,i as h,x as u,t as d}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.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(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,r=(t,e,s,i)=>{for(var o=i>1?void 0:i?m(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(o=(i?c(e,s,o):c(o))||o);return i&&o&&p(e,s,o),o};let n=class extends h{constructor(){super(...arguments),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this.href="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),s=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),s!==this.openLeft&&(this.openLeft=s);const i=e?t:null;i!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=i,i&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(i,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this._effectiveHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const s=t.relatedTarget;(!s||!e.contains(s))&&(e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0})))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let e=this.nextElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.nextElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowUp"){t.preventDefault();let e=this.previousElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.previousElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowRight"){t.preventDefault();const e=this.nextElementSibling;e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&(e.hasAttribute("open")||(this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{const s=e.querySelector("scb-options-menu-item");s&&s.shadowRoot?.querySelector("li")?.focus()},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const e=this.nextElementSibling;if(e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&e.hasAttribute("open")){this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}));return}const s=this.closest("scb-options-sub-menu");if(s){const i=s.previousElementSibling;i&&i.tagName==="SCB-OPTIONS-MENU-ITEM"&&i.shadowRoot?.querySelector("li")?.focus()}return}}}get _effectiveHref(){return this.itemHref||this.href}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const t=this.parentElement;t&&this._subMenuChildObserver.observe(t,{childList:!0})}disconnectedCallback(){this._subMenuChildObserver?.disconnect(),this._subMenuAttrObserver?.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return u`
1
+ import{a as b,n as l,i as h,x as u,t as p}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.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,s,o){try{customElements.get(i)||e(i,s,o)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var d=Object.defineProperty,m=Object.getOwnPropertyDescriptor,r=(t,e,i,s)=>{for(var o=s>1?void 0:s?m(e,i):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(o=(s?c(e,i,o):c(o))||o);return s&&o&&d(e,i,o),o};let n=class extends h{constructor(){super(...arguments),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this.href="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),i=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),i!==this.openLeft&&(this.openLeft=i);const s=e?t:null;s!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=s,s&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(s,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this._effectiveHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const i=t.relatedTarget;(!i||!e.contains(i))&&(e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0})))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let e=this.nextElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.nextElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowUp"){t.preventDefault();let e=this.previousElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.previousElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowRight"){t.preventDefault();const e=this.nextElementSibling;e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&(e.hasAttribute("open")||(this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{const i=e.querySelector("scb-options-menu-item");i&&i.shadowRoot?.querySelector("li")?.focus()},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const e=this.nextElementSibling;if(e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&e.hasAttribute("open")){this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}));return}const i=this.closest("scb-options-sub-menu");if(i){const s=i.previousElementSibling;s&&s.tagName==="SCB-OPTIONS-MENU-ITEM"&&s.shadowRoot?.querySelector("li")?.focus()}return}}}get _effectiveHref(){return this.itemHref||this.href}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const t=this.parentElement;t&&this._subMenuChildObserver.observe(t,{childList:!0})}disconnectedCallback(){this._subMenuChildObserver?.disconnect(),this._subMenuAttrObserver?.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return u`
2
2
  ${this.divider?u`<scb-divider></scb-divider>`:""}
3
3
  <li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} role="menuitem" tabindex="0">
4
4
 
@@ -16,25 +16,25 @@ import{a as b,n as l,i as h,x as u,t as d}from"../../vendor/vendor.js";import"..
16
16
  <md-ripple></md-ripple>
17
17
  `}
18
18
  </li>
19
- `}_navigateToHref(t){const e=this._effectiveHref;if(!e)return;const s={href:e},i=!this.dispatchEvent(new CustomEvent("item-navigate",{detail:s,bubbles:!0,composed:!0,cancelable:!0}))||!this.dispatchEvent(new CustomEvent("itemnavigate",{detail:s,bubbles:!0,composed:!0,cancelable:!0}));t.preventDefault(),t.stopPropagation(),i||(window.location.href=e)}_toggleSubMenu(){const t=this.nextElementSibling;t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&(this.classList.toggle("open-submenu"),t.hasAttribute("open")?(t.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}))):(t.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))))}};n.styles=b`
19
+ `}_navigateToHref(t){const e=this._effectiveHref;if(!e)return;const i={href:e},s=!this.dispatchEvent(new CustomEvent("item-navigate",{detail:i,bubbles:!0,composed:!0,cancelable:!0}))||!this.dispatchEvent(new CustomEvent("itemnavigate",{detail:i,bubbles:!0,composed:!0,cancelable:!0}));t.preventDefault(),t.stopPropagation(),s||(window.location.href=e)}_toggleSubMenu(){const t=this.nextElementSibling;t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&(this.classList.toggle("open-submenu"),t.hasAttribute("open")?(t.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}))):(t.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))))}};n.styles=b`
20
20
  :host {
21
21
  display: block;
22
22
  }
23
23
  :host li{
24
24
  position: relative;
25
25
  list-style: none;
26
- padding: var(--spacing-3) var(--spacing-5);
26
+ padding: var(--scb-options-menu-item-padding-block, var(--spacing-3, 8px)) var(--scb-options-menu-item-padding-inline, var(--spacing-5, 16px));
27
27
  cursor: pointer;
28
- min-height: 56px;
28
+ min-height: var(--scb-options-menu-item-min-height, 56px);
29
29
  display: flex;
30
- gap: var(--spacing-4);
30
+ gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
31
31
  align-items: center;
32
32
 
33
33
  }
34
34
  :host li .label {
35
- font-size: var(--md-sys-typescale-body-large-size);
36
- line-height: var(--md-sys-typescale-body-large-line-height);
37
- letter-spacing: var(--md-sys-typescale-body-large-tracking);
35
+ font-size: var(--scb-options-menu-label-font-size, var(--md-sys-typescale-body-large-size));
36
+ line-height: var(--scb-options-menu-label-line-height, var(--md-sys-typescale-body-large-line-height));
37
+ letter-spacing: var(--scb-options-menu-label-letter-spacing, var(--md-sys-typescale-body-large-tracking));
38
38
  }
39
39
  :host li md-focus-ring {
40
40
  border-radius: var(--md-sys-shape-corner-small);
@@ -43,15 +43,19 @@ import{a as b,n as l,i as h,x as u,t as d}from"../../vendor/vendor.js";import"..
43
43
  pointer-events: none;
44
44
  z-index: 1;
45
45
  }
46
+ :host li md-icon {
47
+ --md-icon-size: var(--scb-options-menu-icon-size, 24px);
48
+ }
46
49
  :host li md-icon.ti {
47
50
  margin-left: auto;
48
51
  }
49
52
  :host li a {
50
53
  display: flex;
51
- gap: var(--spacing-4);
54
+ gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
52
55
  align-items: center;
53
56
  color: var(--md-sys-color-on-surface);
54
57
  text-decoration: none;
58
+ width: 100%;
55
59
  }
56
60
  :host(.open-submenu) li {
57
61
  background: var(--md-sys-color-secondary-container);
@@ -59,4 +63,4 @@ import{a as b,n as l,i as h,x as u,t as d}from"../../vendor/vendor.js";import"..
59
63
  :host li:focus {
60
64
  outline: none;
61
65
  }
62
- `;r([l({type:String})],n.prototype,"label",2);r([l({type:Boolean})],n.prototype,"hasSubMenu",2);r([l({type:Boolean})],n.prototype,"openLeft",2);r([l({type:Boolean})],n.prototype,"divider",2);r([l({type:String,attribute:"leading-icon"})],n.prototype,"leadingIcon",2);r([l({type:String,attribute:"trailing-icon"})],n.prototype,"trailingIcon",2);r([l({type:String,attribute:"item-href"})],n.prototype,"itemHref",2);r([l({type:String})],n.prototype,"href",2);n=r([d("scb-options-menu-item")],n);
66
+ `;r([l({type:String})],n.prototype,"label",2);r([l({type:Boolean})],n.prototype,"hasSubMenu",2);r([l({type:Boolean})],n.prototype,"openLeft",2);r([l({type:Boolean})],n.prototype,"divider",2);r([l({type:String,attribute:"leading-icon"})],n.prototype,"leadingIcon",2);r([l({type:String,attribute:"trailing-icon"})],n.prototype,"trailingIcon",2);r([l({type:String,attribute:"item-href"})],n.prototype,"itemHref",2);r([l({type:String})],n.prototype,"href",2);n=r([p("scb-options-menu-item")],n);
@@ -1,11 +1,11 @@
1
- import{a as f,n as c,i as b,x as v,t as y}from"../../vendor/vendor.js";import"./scb-options-menu-item.js";import"./scb-options-sub-menu.js";import"../scb-divider/scb-divider.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 i=customElements.define.bind(customElements);customElements.define=function(e,s,n){try{customElements.get(e)||i(e,s,n)}catch(o){var a=String(o||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var E=Object.defineProperty,w=Object.getOwnPropertyDescriptor,p=(t,i,e,s)=>{for(var n=s>1?void 0:s?w(i,e):i,a=t.length-1,o;a>=0;a--)(o=t[a])&&(n=(s?o(i,e,n):o(n))||n);return s&&n&&E(i,e,n),n};let r=class extends b{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=t=>{const i=this.__getActionFromEvent(t);if(i){i==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),i==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),i==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}firstUpdated(){this.__applySpacing()}render(){return v`
1
+ import{a as _,n as c,i as f,x as y,t as v}from"../../vendor/vendor.js";import"./scb-options-menu-item.js";import"./scb-options-sub-menu.js";import"../scb-divider/scb-divider.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 i=customElements.define.bind(customElements);customElements.define=function(e,s,n){try{customElements.get(e)||i(e,s,n)}catch(o){var p=String(o||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var x=Object.defineProperty,E=Object.getOwnPropertyDescriptor,a=(t,i,e,s)=>{for(var n=s>1?void 0:s?E(i,e):i,p=t.length-1,o;p>=0;p--)(o=t[p])&&(n=(s?o(i,e,n):o(n))||n);return s&&n&&x(i,e,n),n};let r=class extends f{constructor(){super(...arguments),this.open=!1,this.size="large",this.inSb=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=t=>{const i=this.__getActionFromEvent(t);if(i){i==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),i==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),i==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}firstUpdated(){this.__applySpacing()}render(){return y`
2
2
  <div
3
3
  role="menu"
4
4
  class="scb-options-menu-panel${this.open?" open":""}"
5
5
  >
6
6
  <slot></slot>
7
7
  </div>
8
- `}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(t){this.open=t}__getActionFromEvent(t){if(!this.id)return null;const i=t.composedPath();for(const e of i)if(e instanceof Element){if(e.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=e,"open";if(e.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=e,"close";if(e.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}isClickInScbMenu(t){return t.composedPath().some(e=>e instanceof Element&&(e.tagName==="SCB-OPTIONS-MENU"||e.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(t){t.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const t=this.__lastTriggerEl,i=this.shadowRoot?.querySelector(".scb-options-menu-panel");i&&requestAnimationFrame(()=>{if(!this.open)return;const e=t.getBoundingClientRect(),s=i.getBoundingClientRect(),n=window.innerWidth,a=window.innerHeight,o=8,h=4;let l=e.left,u=e.bottom+h;const g=s.width,d=s.height;l+g>n-o&&(l=Math.max(o,n-o-g)),l<o&&(l=o);let m="top";if(u+d>a-o){const _=e.top-h-d;_>=o&&(u=_,m="bottom")}this.style.position="fixed",this.style.left=`${Math.round(l)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",m)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const t=String(this.open),i=s=>{s.getAttribute("aria-controls")===this.id&&s.setAttribute("aria-expanded",t)};this.__lastTriggerEl&&i(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(i)}__applySpacing(){const t=this.__mapSpacingToken(this.spacing),i=this.__mapSpacingToken(this.spacingTop)??t,e=this.__mapSpacingToken(this.spacingBottom)??t,s=this.__mapSpacingToken(this.spacingLeft),n=this.__mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-options-menu-spacing-block-start",i):this.style.removeProperty("--scb-options-menu-spacing-block-start"),e?this.style.setProperty("--scb-options-menu-spacing-block-end",e):this.style.removeProperty("--scb-options-menu-spacing-block-end"),s?this.style.setProperty("--scb-options-menu-spacing-inline-start",s):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),n?this.style.setProperty("--scb-options-menu-spacing-inline-end",n):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}};r.styles=f`
8
+ `}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(t){this.open=t}__getActionFromEvent(t){if(!this.id)return null;const i=t.composedPath();for(const e of i)if(e instanceof Element){if(e.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=e,"open";if(e.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=e,"close";if(e.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}isClickInScbMenu(t){return t.composedPath().some(e=>e instanceof Element&&(e.tagName==="SCB-OPTIONS-MENU"||e.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(t){t.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const t=this.__lastTriggerEl,i=this.shadowRoot?.querySelector(".scb-options-menu-panel");i&&requestAnimationFrame(()=>{if(!this.open)return;const e=t.getBoundingClientRect(),s=i.getBoundingClientRect(),n=window.innerWidth,p=window.innerHeight,o=8,g=4;let l=e.left,u=e.bottom+g;const m=s.width,h=s.height;l+m>n-o&&(l=Math.max(o,n-o-m)),l<o&&(l=o);let d="top";if(u+h>p-o){const b=e.top-g-h;b>=o&&(u=b,d="bottom")}this.style.position="fixed",this.style.left=`${Math.round(l)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",d)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const t=String(this.open),i=s=>{s.getAttribute("aria-controls")===this.id&&s.setAttribute("aria-expanded",t)};this.__lastTriggerEl&&i(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(i)}__applySpacing(){const t=this.__mapSpacingToken(this.spacing),i=this.__mapSpacingToken(this.spacingTop)??t,e=this.__mapSpacingToken(this.spacingBottom)??t,s=this.__mapSpacingToken(this.spacingLeft),n=this.__mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-options-menu-spacing-block-start",i):this.style.removeProperty("--scb-options-menu-spacing-block-start"),e?this.style.setProperty("--scb-options-menu-spacing-block-end",e):this.style.removeProperty("--scb-options-menu-spacing-block-end"),s?this.style.setProperty("--scb-options-menu-spacing-inline-start",s):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),n?this.style.setProperty("--scb-options-menu-spacing-inline-end",n):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}};r.styles=_`
9
9
  :host {
10
10
  position: absolute;
11
11
  display: block;
@@ -13,6 +13,16 @@ import{a as f,n as c,i as b,x as v,t as y}from"../../vendor/vendor.js";import"./
13
13
  font-family: var(--brand-font);
14
14
  --scb-options-menu-max-width: 300px;
15
15
  --scb-options-menu-max-height: 600px;
16
+ --scb-options-menu-panel-padding-block: var(--spacing-3, 8px);
17
+ --scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
18
+ --scb-options-menu-item-padding-block: var(--spacing-3, 8px);
19
+ --scb-options-menu-item-gap: var(--spacing-4, 12px);
20
+ --scb-options-menu-item-min-height: 56px;
21
+ --scb-options-menu-label-font-size: var(--md-sys-typescale-body-large-size);
22
+ --scb-options-menu-label-line-height: var(--md-sys-typescale-body-large-line-height);
23
+ --scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-large-tracking);
24
+ --scb-options-menu-icon-size: 24px;
25
+ --scb-options-sub-menu-offset-top: -44px;
16
26
  z-index: 1000;
17
27
 
18
28
  margin-block-start: var(--scb-options-menu-spacing-block-start, 0);
@@ -20,8 +30,35 @@ import{a as f,n as c,i as b,x as v,t as y}from"../../vendor/vendor.js";import"./
20
30
  margin-inline-start: var(--scb-options-menu-spacing-inline-start, 0);
21
31
  margin-inline-end: var(--scb-options-menu-spacing-inline-end, 0);
22
32
  }
33
+
34
+ :host([size='medium']) {
35
+ --scb-options-menu-panel-padding-block: var(--spacing-2, 4px);
36
+ --scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
37
+ --scb-options-menu-item-padding-block: var(--spacing-2, 4px);
38
+ --scb-options-menu-item-gap: var(--spacing-3, 8px);
39
+ --scb-options-menu-item-min-height: 48px;
40
+ --scb-options-menu-label-font-size: var(--md-sys-typescale-body-medium-size);
41
+ --scb-options-menu-label-line-height: var(--md-sys-typescale-body-medium-line-height);
42
+ --scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-medium-tracking);
43
+ --scb-options-menu-icon-size: 20px;
44
+ --scb-options-sub-menu-offset-top: -40px;
45
+ }
46
+
47
+ :host([size='small']) {
48
+ --scb-options-menu-panel-padding-block: var(--spacing-1, 2px);
49
+ --scb-options-menu-item-padding-inline: var(--spacing-4, 12px);
50
+ --scb-options-menu-item-padding-block: var(--spacing-2, 4px);
51
+ --scb-options-menu-item-gap: var(--spacing-3, 8px);
52
+ --scb-options-menu-item-min-height: 40px;
53
+ --scb-options-menu-label-font-size: var(--md-sys-typescale-body-small-size);
54
+ --scb-options-menu-label-line-height: var(--md-sys-typescale-body-small-line-height);
55
+ --scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-small-tracking);
56
+ --scb-options-menu-icon-size: 18px;
57
+ --scb-options-sub-menu-offset-top: -32px;
58
+ }
59
+
23
60
  :host > .scb-options-menu-panel {
24
- padding: var(--spacing-3) 0;
61
+ padding: var(--scb-options-menu-panel-padding-block) 0;
25
62
  color: var(--md-sys-color-on-surface);
26
63
  border-radius: var(--md-sys-shape-corner-extra-small);
27
64
  background: var(--md-sys-color-surface, #FFF);
@@ -48,4 +85,4 @@ import{a as f,n as c,i as b,x as v,t as y}from"../../vendor/vendor.js";import"./
48
85
  opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
49
86
  transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
50
87
  }
51
- `;p([c({type:Boolean,reflect:!0})],r.prototype,"open",2);p([c({type:Boolean,attribute:!1})],r.prototype,"inSb",2);p([c({type:String,reflect:!0})],r.prototype,"spacing",2);p([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);p([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);p([c({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",2);p([c({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",2);r=p([y("scb-options-menu")],r);
88
+ `;a([c({type:Boolean,reflect:!0})],r.prototype,"open",2);a([c({type:String,reflect:!0})],r.prototype,"size",2);a([c({type:Boolean,attribute:!1})],r.prototype,"inSb",2);a([c({type:String,reflect:!0})],r.prototype,"spacing",2);a([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);a([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);a([c({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",2);a([c({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",2);r=a([v("scb-options-menu")],r);
@@ -1,8 +1,8 @@
1
- import{a,n as p,i as d,x as l,t as b}from"../../vendor/vendor.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(i,n,s){try{customElements.get(i)||t(i,n,s)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var m=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h=(e,t,i,n)=>{for(var s=n>1?void 0:n?c(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&m(t,i,s),s};let u=class extends d{constructor(){super(...arguments),this.open=!1,this._show=()=>{this.setAttribute("open",""),this.open=!0},this._hide=e=>{this.removeAttribute("open"),this.open=!1,e&&e.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("show-submenu",this._show),this.addEventListener("showsubmenu",this._show),this.addEventListener("hide-submenu",this._hide),this.addEventListener("hidesubmenu",this._hide)}disconnectedCallback(){this.removeEventListener("show-submenu",this._show),this.removeEventListener("showsubmenu",this._show),this.removeEventListener("hide-submenu",this._hide),this.removeEventListener("hidesubmenu",this._hide),super.disconnectedCallback()}firstUpdated(){let e=0,t=this.parentElement;for(;t;)t.tagName==="SCB-OPTIONS-SUB-MENU"&&e++,t=t.parentElement;e%2===1?this.setAttribute("open-left",""):this.removeAttribute("open-left")}render(){return l`
1
+ import{a as h,n as p,i as d,x as l,t as b}from"../../vendor/vendor.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(n,i,s){try{customElements.get(n)||t(n,i,s)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c=Object.defineProperty,m=Object.getOwnPropertyDescriptor,u=(e,t,n,i)=>{for(var s=i>1?void 0:i?m(t,n):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(i?r(t,n,s):r(s))||s);return i&&s&&c(t,n,s),s};let a=class extends d{constructor(){super(...arguments),this.open=!1,this._show=()=>{this.setAttribute("open",""),this.open=!0},this._hide=e=>{this.removeAttribute("open"),this.open=!1,e&&e.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("show-submenu",this._show),this.addEventListener("showsubmenu",this._show),this.addEventListener("hide-submenu",this._hide),this.addEventListener("hidesubmenu",this._hide)}disconnectedCallback(){this.removeEventListener("show-submenu",this._show),this.removeEventListener("showsubmenu",this._show),this.removeEventListener("hide-submenu",this._hide),this.removeEventListener("hidesubmenu",this._hide),super.disconnectedCallback()}firstUpdated(){let e=0,t=this.parentElement;for(;t;)t.tagName==="SCB-OPTIONS-SUB-MENU"&&e++,t=t.parentElement;e%2===1?this.setAttribute("open-left",""):this.removeAttribute("open-left")}render(){return l`
2
2
  <div role="menu" class="submenu${this.open?" open":""}">
3
3
  <slot></slot>
4
4
  </div>
5
- `}};u.styles=a`
5
+ `}};a.styles=h`
6
6
  :host {
7
7
  display: block;
8
8
  position: relative;
@@ -16,8 +16,9 @@ import{a,n as p,i as d,x as l,t as b}from"../../vendor/vendor.js";(function(){tr
16
16
  display: none;
17
17
  position: absolute;
18
18
  left: 100%;
19
- top: -44px;
19
+ top: var(--scb-options-sub-menu-offset-top, -44px);
20
20
  z-index: 100;
21
+ padding: var(--scb-options-menu-panel-padding-block, var(--spacing-3, 8px)) 0;
21
22
  border-radius: var(--md-sys-shape-corner-extra-small);
22
23
  background: var(--md-sys-color-surface, #FFF);
23
24
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.20), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14);
@@ -30,4 +31,4 @@ import{a,n as p,i as d,x as l,t as b}from"../../vendor/vendor.js";(function(){tr
30
31
  .submenu.open {
31
32
  display: block;
32
33
  }
33
- `;h([p({type:Boolean,reflect:!0})],u.prototype,"open",2);u=h([b("scb-options-sub-menu")],u);
34
+ `;u([p({type:Boolean,reflect:!0})],a.prototype,"open",2);a=u([b("scb-options-sub-menu")],a);
@@ -1,4 +1,4 @@
1
- import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}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"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-button/scb-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(i,a,s){try{customElements.get(i)||e(i,a,s)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var et=Object.defineProperty,it=Object.getOwnPropertyDescriptor,O=t=>{throw TypeError(t)},g=(t,e,i,a)=>{for(var s=a>1?void 0:a?it(e,i):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(s=(a?l(e,i,s):l(s))||s);return a&&s&&et(e,i,s),s},st=(t,e,i)=>e.has(t)||O("Cannot "+i),at=(t,e,i)=>e.has(t)?O("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),o=(t,e,i)=>(st(t,e,"access private method"),i),r,$,D,T,z,L,B,q,S,k,W,j,N,A,G,H,U,P,I,J,K,X,R,y,E;const nt=`<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 Z,n as b,r as tt,i as et,x as h,k as B,l as it,t as st}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"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-accordion/scb-accordion-item.js";import"../scb-button/scb-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(i,n,s){try{customElements.get(i)||e(i,n,s)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var at=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,q=t=>{throw TypeError(t)},g=(t,e,i,n)=>{for(var s=n>1?void 0:n?nt(e,i):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(s=(n?l(e,i,s):l(s))||s);return n&&s&&at(e,i,s),s},rt=(t,e,i)=>e.has(t)||q("Cannot "+i),ot=(t,e,i)=>e.has(t)?q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),r=(t,e,i)=>(rt(t,e,"access private method"),i),a,$,H,P,z,L,N,W,k,I,R,S,A,j,G,U,E,J,V,K,F,O,X,Y,Q,D,y,T;const lt=`<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,7 +113,7 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
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 d=class extends Q{constructor(){super(...arguments),at(this,r),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.toggleHeightMode="stable",this._actionsMenuOpen=!1,this._diagramReflowFrame=0,this._printCleanup=null,this._printInstanceId="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentPointerDown=t=>{!this._actionsMenuOpen||t.composedPath().includes(this)||this._closeActionsMenu()},this._onDocumentKeyDown=t=>{this._actionsMenuOpen&&t.key==="Escape"&&(t.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=()=>{this._closeActionsMenu(),o(this,r,X).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await o(this,r,k).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await o(this,r,k).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),o(this,r,W).call(this))}}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"}get actionsMenuLabel(){return this.lang==="en"?"Open menu":"Öppna meny"}get printLabel(){return this.lang==="en"?"Print":"Skriv ut"}get downloadPngLabel(){return this.lang==="en"?"Download PNG":"Ladda ner PNG"}get downloadJpgLabel(){return this.lang==="en"?"Download JPG":"Ladda ner JPG"}get downloadCsvLabel(){return this.lang==="en"?"Download CSV":"Ladda ner CSV"}_getImageAltText(){return[this.title,this.subtitle,this.description].map(e=>typeof e=="string"?e.trim():"").filter(Boolean).join(". ")||(this.lang==="en"?"Image figure":"Bildfigur")}connectedCallback(){super.connectedCallback(),o(this,r,I).call(this),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown)}firstUpdated(t){this._readTableDataFromSlot(),o(this,r,R).call(this),o(this,r,E).call(this),o(this,r,S).call(this),this._syncChipClass(),o(this,r,$).call(this),o(this,r,z).call(this)}updated(t){super.updated(t),(t.has("selectedChip")||t.has("variant"))&&(this._syncChipClass(),this._closeActionsMenu()),t.has("selectedChip")&&this._dispatchSelectedChipChanged(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&o(this,r,R).call(this),t.has("containerMaxWidth")&&o(this,r,E).call(this),t.has("variant")&&o(this,r,$).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&o(this,r,S).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode"))&&o(this,r,z).call(this)}disconnectedCallback(){this._printCleanup?.(),this._printCleanup=null,super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),o(this,r,D).call(this),o(this,r,T).call(this)}_onTableSlotChange(t){const e=t.target;e&&(this._readTableDataFromSlot(e),this.requestUpdate())}_onDiagramSlotChange(){o(this,r,S).call(this),o(this,r,z).call(this),this.requestUpdate()}_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 i=e.assignedElements({flatten:!0}),a=[];i.forEach(v=>{if(v.tagName==="TABLE"){a.push(v);return}v.querySelectorAll("table").forEach(u=>a.push(u))});const s=a[0];if(!s){this._slottedTableData=void 0;return}const c=[],l=[],n=[],p=v=>v?(v.textContent??"").replace(/\s+/g," ").trim():"",m=v=>v?{html:(v.innerHTML??"").trim(),text:p(v)}:{html:"",text:""},f=s.querySelector("thead tr");f&&Array.from(f.querySelectorAll("th, td")).forEach(u=>c.push(m(u)));const _=Array.from(s.querySelectorAll("tbody tr")),w=_.length>0?_:Array.from(s.querySelectorAll("tr")).filter(v=>v.closest("thead")===null);if(w.forEach(v=>{const u=Array.from(v.querySelectorAll("th, td"));if(u.length===0)return;const x=u[0].tagName==="TH"&&v.closest("thead")===null&&v.closest("tfoot")===null;n.push(x);const C=[];u.forEach(M=>C.push(m(M))),l.push(C)}),!f&&l.length>0){const v=l[0],u=w[0],x=Array.from(u?.querySelectorAll("th, td")??[]);x.length>0&&x.every(M=>M.tagName==="TH")&&u?.closest("tbody")===null&&(c.splice(0,c.length,...v),l.shift(),n.shift())}this._slottedTableData={headers:c.length>0?c:void 0,rows:l,rowHeaderRows:n.length>0?n:void 0}}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(s=>s.length)),i=s=>{if(s==null)return!1;if(typeof s=="number")return!0;const c=String(s).replace(/[\u00A0\u202F\s]+/g,"").trim();return c?/^-?\d+(?:[.,]\d+)?$/.test(c):!1},a=[];for(let s=0;s<e;s+=1){if(s===0){a.push("left");continue}const c=t.rows.map(n=>this._normalizeRenderableCell(n[s]).text).filter(n=>n!==""&&n!==null&&n!==void 0),l=c.length>0&&c.every(i);a.push(l?"right":"left")}return a}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this.contentHeight?.trim()||""}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"420px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getExportBaseFileName(){const t=this.lang==="en"?"visualization":"visualisering";return(this.title||t).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}_buildExportFileName(t){const e=t==="csv"?this.lang==="en"?"-table":"-tabell":"";return`${this._getExportBaseFileName()}${e}.${t}`}_renderActions(){const t=this._canExportRaster(),e=this._canExportCsv(),i=this.variant==="Standard"||this.variant==="Image",a=this.variant==="Standard"||this.variant==="Table";return h`
116
+ `;let d=class extends et{constructor(){super(...arguments),ot(this,a),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.toggleHeightMode="stable",this._tableSlotSyncFrame=0,this._actionsMenuOpen=!1,this._diagramReflowFrame=0,this._printCleanup=null,this._printInstanceId="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentPointerDown=t=>{if(!this._actionsMenuOpen)return;const e=t.composedPath(),i=this.shadowRoot?.querySelector(".actions-menu");i&&e.includes(i)||this._closeActionsMenu()},this._onDocumentKeyDown=t=>{this._actionsMenuOpen&&t.key==="Escape"&&(t.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=()=>{this._closeActionsMenu(),r(this,a,Q).call(this)},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await r(this,a,A).call(this,"png"))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await r(this,a,A).call(this,"jpeg"))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),r(this,a,j).call(this))}}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"}get actionsMenuLabel(){return this.lang==="en"?"Open menu":"Öppna meny"}get printLabel(){return this.lang==="en"?"Print":"Skriv ut"}get downloadPngLabel(){return this.lang==="en"?"Download PNG":"Ladda ner PNG"}get downloadJpgLabel(){return this.lang==="en"?"Download JPG":"Ladda ner JPG"}get downloadCsvLabel(){return this.lang==="en"?"Download CSV":"Ladda ner CSV"}_getImageAltText(){return[this.title,this.subtitle,this.description].map(e=>typeof e=="string"?e.trim():"").filter(Boolean).join(". ")||(this.lang==="en"?"Image figure":"Bildfigur")}connectedCallback(){super.connectedCallback(),r(this,a,O).call(this),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown)}firstUpdated(t){r(this,a,k).call(this),r(this,a,D).call(this),r(this,a,T).call(this),r(this,a,S).call(this),this._syncChipClass(),r(this,a,$).call(this),r(this,a,z).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,a,D).call(this),t.has("containerMaxWidth")&&r(this,a,T).call(this),t.has("variant")&&r(this,a,$).call(this),(t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode")||t.has("variant"))&&r(this,a,S).call(this),(t.has("selectedChip")||t.has("variant")||t.has("contentMaxWidth")||t.has("contentHeight")||t.has("toggleHeightMode"))&&r(this,a,z).call(this)}disconnectedCallback(){this._printCleanup?.(),this._printCleanup=null,super.disconnectedCallback(),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown),r(this,a,H).call(this),r(this,a,P).call(this),r(this,a,I).call(this)}_onTableSlotChange(t){const e=t.target;e&&r(this,a,k).call(this,e)}_onDiagramSlotChange(){r(this,a,S).call(this),r(this,a,z).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!1;const i=e.assignedElements({flatten:!0}),n=[];i.forEach(v=>{if(v.tagName==="TABLE"){n.push(v);return}v.querySelectorAll("table").forEach(u=>n.push(u))});const s=n[0];if(!s)return r(this,a,R).call(this,void 0);const c=[],l=[],o=[],p=v=>v?(v.textContent??"").replace(/\s+/g," ").trim():"",m=v=>v?{html:(v.innerHTML??"").trim(),text:p(v)}:{html:"",text:""},f=s.querySelector("thead tr");f&&Array.from(f.querySelectorAll("th, td")).forEach(u=>c.push(m(u)));const _=Array.from(s.querySelectorAll("tbody tr")),w=_.length>0?_:Array.from(s.querySelectorAll("tr")).filter(v=>v.closest("thead")===null);if(w.forEach(v=>{const u=Array.from(v.querySelectorAll("th, td"));if(u.length===0)return;const x=u[0].tagName==="TH"&&v.closest("thead")===null&&v.closest("tfoot")===null;o.push(x);const C=[];u.forEach(M=>C.push(m(M))),l.push(C)}),!f&&l.length>0){const v=l[0],u=w[0],x=Array.from(u?.querySelectorAll("th, td")??[]);x.length>0&&x.every(M=>M.tagName==="TH")&&u?.closest("tbody")===null&&(c.splice(0,c.length,...v),l.shift(),o.shift())}return r(this,a,R).call(this,{headers:c.length>0?c:void 0,rows:l,rowHeaderRows:o.length>0?o:void 0})}_inferTableAlignments(t){const e=Math.max(t.headers?.length??0,...t.rows.map(s=>s.length)),i=s=>{if(s==null)return!1;if(typeof s=="number")return!0;const c=String(s).replace(/[\u00A0\u202F\s]+/g,"").trim();return c?/^-?\d+(?:[.,]\d+)?$/.test(c):!1},n=[];for(let s=0;s<e;s+=1){if(s===0){n.push("left");continue}const c=t.rows.map(o=>this._normalizeRenderableCell(o[s]).text).filter(o=>o!==""&&o!==null&&o!==void 0),l=c.length>0&&c.every(i);n.push(l?"right":"left")}return n}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||""}_getResolvedDiagramHeight(){return this.contentHeight?.trim()||""}_getResolvedToggleHeightMode(){return this.toggleHeightMode==="auto"?"auto":"stable"}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||"420px"}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getDiagramAssignedElements(){const t=this.shadowRoot?.querySelector('slot[name="diagram"]');return t?t.assignedElements({flatten:!0}):[]}_findExportableVisualElement(t){for(const e of t){if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e;const i=e.querySelector("svg, canvas, img");if(i instanceof SVGSVGElement||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement)return i}return null}_getExportableVisualElement(){if(this.variant==="Table")return null;if(this.variant==="Image"){const t=this.shadowRoot?.querySelector(".image-content img");return t instanceof HTMLImageElement?t:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getExportBaseFileName(){const t=this.lang==="en"?"visualization":"visualisering";return(this.title||t).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||t}_buildExportFileName(t){const e=t==="csv"?this.lang==="en"?"-table":"-tabell":"";return`${this._getExportBaseFileName()}${e}.${t}`}_renderActions(){const t=this._canExportRaster(),e=this._canExportCsv(),i=this.variant==="Standard"||this.variant==="Image",n=this.variant==="Standard"||this.variant==="Table";return h`
117
117
  <div class="actions-row">
118
118
  ${this.variant==="Standard"&&!this.disableToggle?h`
119
119
  <div class="flipp-wrapper">
@@ -190,7 +190,7 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
190
190
  </button>
191
191
  </li>
192
192
  `:""}
193
- ${a?h`
193
+ ${n?h`
194
194
  <li>
195
195
  <button
196
196
  type="button"
@@ -208,20 +208,20 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
208
208
  </div>
209
209
  </div>
210
210
  </div>
211
- `}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(n=>n.length)),a=(t.headers??[]).map(n=>this._normalizeRenderableCell(n)),s=t.rows.map(n=>{const p=n.map(m=>this._normalizeRenderableCell(m));for(;p.length<i;)p.push({html:"",text:""});return p}),c=t.rowHeaderRows??[],l=[this.title,this.subtitle].map(n=>typeof n=="string"?n.trim():"").filter(Boolean).join(". ");return h`
211
+ `}_renderTable(){const t=this.tableData??this._slottedTableData;if(!t||!t.rows||t.rows.length===0)return null;const e=this._inferTableAlignments(t),i=Math.max(t.headers?.length??0,...t.rows.map(o=>o.length)),n=(t.headers??[]).map(o=>this._normalizeRenderableCell(o)),s=t.rows.map(o=>{const p=o.map(m=>this._normalizeRenderableCell(m));for(;p.length<i;)p.push({html:"",text:""});return p}),c=t.rowHeaderRows??[],l=[this.title,this.subtitle].map(o=>typeof o=="string"?o.trim():"").filter(Boolean).join(". ");return h`
212
212
  <table class="scb-viz-table" part="table">
213
213
  ${l?h`<caption class="visually-hidden">${l}</caption>`:""}
214
- ${a.length>0?h`
214
+ ${n.length>0?h`
215
215
  <thead>
216
216
  <tr>
217
- ${a.map((n,p)=>{const m=e[p]==="right"?"align-right":"align-left";return h`<th scope="col" class=${m}>${n.html?V(n.html):n.text}</th>`})}
217
+ ${n.map((o,p)=>{const m=e[p]==="right"?"align-right":"align-left";return h`<th scope="col" class=${m}>${o.html?B(o.html):o.text}</th>`})}
218
218
  </tr>
219
219
  </thead>
220
220
  `:""}
221
221
  <tbody>
222
- ${s.map((n,p)=>{const m=c[p]===!0;return h`
222
+ ${s.map((o,p)=>{const m=c[p]===!0;return h`
223
223
  <tr>
224
- ${n.map((f,_)=>{const w=e[_]==="right"?"align-right":"align-left",v=f.html?V(f.html):f.text;return _===0&&m?h`<th scope="row" class=${w}>${v}</th>`:h`<td class=${w}>${v}</td>`})}
224
+ ${o.map((f,_)=>{const w=e[_]==="right"?"align-right":"align-left",v=f.html?B(f.html):f.text;return _===0&&m?h`<th scope="row" class=${w}>${v}</th>`:h`<td class=${w}>${v}</td>`})}
225
225
  </tr>
226
226
  `})}
227
227
  </tbody>
@@ -256,7 +256,7 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
256
256
  aria-label="${this.officialStatisticsAlt}"
257
257
  >
258
258
  <span class="sos-logotype-small" aria-hidden="true">
259
- ${Z(nt)}
259
+ ${it(lt)}
260
260
  </span>
261
261
  </a>
262
262
  `:""}
@@ -386,8 +386,8 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
386
386
  ></slot>
387
387
  <slot></slot>
388
388
  </div>
389
- `}}_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}_toggleActionsMenu(t){t.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){this.shadowRoot?.querySelector(".actions-menu scb-icon-button")?.focus()}_focusFirstMenuItem(){this.shadowRoot?.querySelector(".actions-menu-item")?.focus()}};r=new WeakSet;$=function(){if(o(this,r,D).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{o(this,r,z).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(t))};D=function(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0};T=function(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)};z=function(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(o(this,r,T).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,o(this,r,q).call(this)})}))};L=function(t){const e=t?.getAttribute("data-highcharts-chart");if(!e)return;const i=Number.parseInt(e,10);return Number.isNaN(i)?void 0:i};B=function(t){for(const e of t){const i=o(this,r,L).call(this,e);if(i!==void 0)return i;const a=e.querySelector("[data-highcharts-chart]"),s=o(this,r,L).call(this,a);if(s!==void 0)return s}};q=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 i=o(this,r,B).call(this,e);if(i===void 0)return;const s=window.Highcharts?.charts?.[i];s&&(s.setSize?.(null,null,!1),s.reflow?.())};S=function(){const t=this.variant==="Standard"?this._getResolvedDiagramHeight():"",e=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";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")),e?this.style.setProperty("--scb-viz-standard-content-height",e):this.style.removeProperty("--scb-viz-standard-content-height")};k=async function(t){const e=this._getExportableVisualElement();if(!e)return;const i=await o(this,r,j).call(this,e,t);i&&o(this,r,P).call(this,i,this._buildExportFileName(t==="jpeg"?"jpg":"png"))};W=function(){const t=this._getResolvedTableData();if(!t?.rows?.length)return;const e=this.lang==="en"?",":";",i=[];t.headers?.length&&i.push(t.headers.map(l=>this._normalizeRenderableCell(l).text)),t.rows.forEach(l=>{i.push(l.map(n=>this._normalizeRenderableCell(n).text))});const a=l=>`"${String(l??"").replace(/\r?\n/g," ").replace(/"/g,'""')}"`,s=`\uFEFF${i.map(l=>l.map(a).join(e)).join(`\r
390
- `)}`,c=new Blob([s],{type:"text/csv;charset=utf-8;"});o(this,r,P).call(this,c,this._buildExportFileName("csv"))};j=async function(t,e){if(t instanceof HTMLCanvasElement)return o(this,r,H).call(this,t,e==="jpeg"?"image/jpeg":"image/png");if(t instanceof HTMLImageElement){const n=t.naturalWidth||t.width,p=t.naturalHeight||t.height;return!n||!p?null:o(this,r,A).call(this,t.src,n,p,e)}const{width:i,height:a,serialized:s}=o(this,r,N).call(this,t);if(!i||!a||!s)return null;const c=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(c);try{return await o(this,r,A).call(this,l,i,a,e)}finally{URL.revokeObjectURL(l)}};N=function(t){const e=t.cloneNode(!0),i=t.getBoundingClientRect(),a=t.viewBox?.baseVal,s=Math.round(a?.width||i.width||Number(t.getAttribute("width"))||0),c=Math.round(a?.height||i.height||Number(t.getAttribute("height"))||0);return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),!e.getAttribute("width")&&s&&e.setAttribute("width",String(s)),!e.getAttribute("height")&&c&&e.setAttribute("height",String(c)),!e.getAttribute("viewBox")&&s&&c&&e.setAttribute("viewBox",`0 0 ${s} ${c}`),{width:s,height:c,serialized:new XMLSerializer().serializeToString(e)}};A=async function(t,e,i,a){const s=Math.max(1,Math.min(2,window.devicePixelRatio||1)),c=Math.max(1,Math.round(e)),l=Math.max(1,Math.round(i)),n=document.createElement("canvas");n.width=Math.max(1,Math.round(c*s)),n.height=Math.max(1,Math.round(l*s));const p=n.getContext("2d");if(!p)return null;const m=await o(this,r,G).call(this,t);return m?(p.scale(s,s),p.fillStyle=o(this,r,U).call(this),p.fillRect(0,0,c,l),p.drawImage(m,0,0,c,l),o(this,r,H).call(this,n,a==="jpeg"?"image/jpeg":"image/png",a==="jpeg"?.92:void 0)):null};G=function(t){return new Promise(e=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>e(i),i.onerror=()=>e(null),i.src=t})};H=function(t,e,i){return new Promise(a=>{t.toBlob(s=>a(s),e,i)})};U=function(){const t=this.shadowRoot?.querySelector(".viz-container"),e=getComputedStyle(t??this).backgroundColor;return e&&e!=="rgba(0, 0, 0, 0)"?e:"#ffffff"};P=function(t,e){const i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(i),0)};I=function(){this._printInstanceId||(d._printInstanceCounter+=1,this._printInstanceId=`scb-viz-print-${d._printInstanceCounter}`),this.setAttribute("data-scb-viz-print-id",this._printInstanceId)};J=function(){this.style.setProperty("--scb-viz-print-scale","1");const t=this.shadowRoot?.querySelector(".viz-container");if(!t)return;const e=1040,i=t.scrollHeight;if(!i||i<=e){this.style.setProperty("--scb-viz-print-scale","1");return}const a=Math.max(.72,Math.min(1,e/i));this.style.setProperty("--scb-viz-print-scale",a.toFixed(3))};K=function(){o(this,r,I).call(this);const t=[],e=document.documentElement.getAttribute("style"),i=document.body.getAttribute("style"),a=window.scrollX,s=window.scrollY,c=n=>{t.some(p=>p.element===n)||(t.push({element:n,style:n.getAttribute("style")}),n.style.setProperty("display","none","important"))};let l=this;for(;l.parentElement;){const n=l.parentElement;Array.from(n.children).forEach(p=>{p!==l&&p instanceof HTMLElement&&c(p)}),l=n}return document.documentElement.setAttribute("data-scb-viz-print-mode","single"),this.setAttribute("data-scb-viz-print-target",""),this.setAttribute("data-scb-viz-print-preview",""),document.documentElement.style.setProperty("background","#fff"),document.body.style.setProperty("background","#fff"),document.body.style.setProperty("margin","0"),this.offsetHeight,o(this,r,J).call(this),()=>{t.forEach(({element:n,style:p})=>{p===null?n.removeAttribute("style"):n.setAttribute("style",p)}),e===null?document.documentElement.removeAttribute("style"):document.documentElement.setAttribute("style",e),i===null?document.body.removeAttribute("style"):document.body.setAttribute("style",i),document.documentElement.removeAttribute("data-scb-viz-print-mode"),this.removeAttribute("data-scb-viz-print-target"),this.removeAttribute("data-scb-viz-print-preview"),this.style.removeProperty("--scb-viz-print-scale"),window.scrollTo(a,s)}};X=function(){this._printCleanup?.();const t=o(this,r,K).call(this);this._printCleanup=t;const e=()=>{window.removeEventListener("afterprint",e),this._printCleanup===t&&(t(),this._printCleanup=null)};window.addEventListener("afterprint",e,{once:!0}),window.print()};R=function(){const t=o(this,r,y).call(this,this.spacing),e=o(this,r,y).call(this,this.spacingTop)??t,i=o(this,r,y).call(this,this.spacingBottom)??t,a=o(this,r,y).call(this,this.spacingLeft),s=o(this,r,y).call(this,this.spacingRight);e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),i?this.style.setProperty("--scb-viz-spacing-block-end",i):this.style.removeProperty("--scb-viz-spacing-block-end"),a?this.style.setProperty("--scb-viz-spacing-inline-start",a):this.style.removeProperty("--scb-viz-spacing-inline-start"),s?this.style.setProperty("--scb-viz-spacing-inline-end",s):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};E=function(){const t=this.containerMaxWidth?.trim();t?this.style.setProperty("--scb-viz-container-max-width",t):this.style.removeProperty("--scb-viz-container-max-width")};d._printInstanceCounter=0;d.styles=Y`
389
+ `}}_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}_toggleActionsMenu(t){t.stopPropagation(),this._actionsMenuOpen=!this._actionsMenuOpen,this._actionsMenuOpen&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){this.shadowRoot?.querySelector(".actions-menu scb-icon-button")?.focus()}_focusFirstMenuItem(){this.shadowRoot?.querySelector(".actions-menu-item")?.focus()}};a=new WeakSet;$=function(){if(r(this,a,H).call(this),typeof ResizeObserver>"u")return;const t=this.shadowRoot?.querySelector(".diagram-content");t&&(this._diagramResizeObserver=new ResizeObserver(()=>{r(this,a,z).call(this)}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(t))};H=function(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0};P=function(){this._diagramReflowFrame&&(cancelAnimationFrame(this._diagramReflowFrame),this._diagramReflowFrame=0)};z=function(){this.variant!=="Standard"||this.selectedChip!=="Diagram"||(r(this,a,P).call(this),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,r(this,a,W).call(this)})}))};L=function(t){const e=t?.getAttribute("data-highcharts-chart");if(!e)return;const i=Number.parseInt(e,10);return Number.isNaN(i)?void 0:i};N=function(t){for(const e of t){const i=r(this,a,L).call(this,e);if(i!==void 0)return i;const n=e.querySelector("[data-highcharts-chart]"),s=r(this,a,L).call(this,n);if(s!==void 0)return s}};W=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 i=r(this,a,N).call(this,e);if(i===void 0)return;const s=window.Highcharts?.charts?.[i];s&&(s.setSize?.(null,null,!1),s.reflow?.())};k=function(t){r(this,a,I).call(this),this._tableSlotSyncFrame=requestAnimationFrame(()=>{this._tableSlotSyncFrame=0,this._readTableDataFromSlot(t)&&this.requestUpdate()})};I=function(){this._tableSlotSyncFrame&&(cancelAnimationFrame(this._tableSlotSyncFrame),this._tableSlotSyncFrame=0)};R=function(t){const e=this._slottedTableData,i=e?JSON.stringify(e):"",n=t?JSON.stringify(t):"";return i===n?!1:(this._slottedTableData=t,!0)};S=function(){const t=this.variant==="Standard"?this._getResolvedDiagramHeight():"",e=this.variant==="Standard"&&this._getResolvedToggleHeightMode()==="stable"?this._getResolvedStandardContentHeight():"";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")),e?this.style.setProperty("--scb-viz-standard-content-height",e):this.style.removeProperty("--scb-viz-standard-content-height")};A=async function(t){const e=this._getExportableVisualElement();if(!e)return;const i=await r(this,a,G).call(this,e,t);i&&r(this,a,F).call(this,i,this._buildExportFileName(t==="jpeg"?"jpg":"png"))};j=function(){const t=this._getResolvedTableData();if(!t?.rows?.length)return;const e=this.lang==="en"?",":";",i=[];t.headers?.length&&i.push(t.headers.map(l=>this._normalizeRenderableCell(l).text)),t.rows.forEach(l=>{i.push(l.map(o=>this._normalizeRenderableCell(o).text))});const n=l=>`"${String(l??"").replace(/\r?\n/g," ").replace(/"/g,'""')}"`,s=`\uFEFF${i.map(l=>l.map(n).join(e)).join(`\r
390
+ `)}`,c=new Blob([s],{type:"text/csv;charset=utf-8;"});r(this,a,F).call(this,c,this._buildExportFileName("csv"))};G=async function(t,e){if(t instanceof HTMLCanvasElement)return r(this,a,V).call(this,t,e==="jpeg"?"image/jpeg":"image/png");if(t instanceof HTMLImageElement){const o=t.naturalWidth||t.width,p=t.naturalHeight||t.height;return!o||!p?null:r(this,a,E).call(this,t.src,o,p,e)}const{width:i,height:n,serialized:s}=r(this,a,U).call(this,t);if(!i||!n||!s)return null;const c=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(c);try{return await r(this,a,E).call(this,l,i,n,e)}finally{URL.revokeObjectURL(l)}};U=function(t){const e=t.cloneNode(!0),i=t.getBoundingClientRect(),n=t.viewBox?.baseVal,s=Math.round(n?.width||i.width||Number(t.getAttribute("width"))||0),c=Math.round(n?.height||i.height||Number(t.getAttribute("height"))||0);return e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),!e.getAttribute("width")&&s&&e.setAttribute("width",String(s)),!e.getAttribute("height")&&c&&e.setAttribute("height",String(c)),!e.getAttribute("viewBox")&&s&&c&&e.setAttribute("viewBox",`0 0 ${s} ${c}`),{width:s,height:c,serialized:new XMLSerializer().serializeToString(e)}};E=async function(t,e,i,n){const s=Math.max(1,Math.min(2,window.devicePixelRatio||1)),c=Math.max(1,Math.round(e)),l=Math.max(1,Math.round(i)),o=document.createElement("canvas");o.width=Math.max(1,Math.round(c*s)),o.height=Math.max(1,Math.round(l*s));const p=o.getContext("2d");if(!p)return null;const m=await r(this,a,J).call(this,t);return m?(p.scale(s,s),p.fillStyle=r(this,a,K).call(this),p.fillRect(0,0,c,l),p.drawImage(m,0,0,c,l),r(this,a,V).call(this,o,n==="jpeg"?"image/jpeg":"image/png",n==="jpeg"?.92:void 0)):null};J=function(t){return new Promise(e=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>e(i),i.onerror=()=>e(null),i.src=t})};V=function(t,e,i){return new Promise(n=>{t.toBlob(s=>n(s),e,i)})};K=function(){const t=this.shadowRoot?.querySelector(".viz-container"),e=getComputedStyle(t??this).backgroundColor;return e&&e!=="rgba(0, 0, 0, 0)"?e:"#ffffff"};F=function(t,e){const i=URL.createObjectURL(t),n=document.createElement("a");n.href=i,n.download=e,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(i),0)};O=function(){this._printInstanceId||(d._printInstanceCounter+=1,this._printInstanceId=`scb-viz-print-${d._printInstanceCounter}`),this.setAttribute("data-scb-viz-print-id",this._printInstanceId)};X=function(){this.style.setProperty("--scb-viz-print-scale","1");const t=this.shadowRoot?.querySelector(".viz-container");if(!t)return;const e=1040,i=t.scrollHeight;if(!i||i<=e){this.style.setProperty("--scb-viz-print-scale","1");return}const n=Math.max(.72,Math.min(1,e/i));this.style.setProperty("--scb-viz-print-scale",n.toFixed(3))};Y=function(){r(this,a,O).call(this);const t=[],e=document.documentElement.getAttribute("style"),i=document.body.getAttribute("style"),n=window.scrollX,s=window.scrollY,c=o=>{t.some(p=>p.element===o)||(t.push({element:o,style:o.getAttribute("style")}),o.style.setProperty("display","none","important"))};let l=this;for(;l.parentElement;){const o=l.parentElement;Array.from(o.children).forEach(p=>{p!==l&&p instanceof HTMLElement&&c(p)}),l=o}return document.documentElement.setAttribute("data-scb-viz-print-mode","single"),this.setAttribute("data-scb-viz-print-target",""),this.setAttribute("data-scb-viz-print-preview",""),document.documentElement.style.setProperty("background","#fff"),document.body.style.setProperty("background","#fff"),document.body.style.setProperty("margin","0"),this.offsetHeight,r(this,a,X).call(this),()=>{t.forEach(({element:o,style:p})=>{p===null?o.removeAttribute("style"):o.setAttribute("style",p)}),e===null?document.documentElement.removeAttribute("style"):document.documentElement.setAttribute("style",e),i===null?document.body.removeAttribute("style"):document.body.setAttribute("style",i),document.documentElement.removeAttribute("data-scb-viz-print-mode"),this.removeAttribute("data-scb-viz-print-target"),this.removeAttribute("data-scb-viz-print-preview"),this.style.removeProperty("--scb-viz-print-scale"),window.scrollTo(n,s)}};Q=function(){this._printCleanup?.();const t=r(this,a,Y).call(this);this._printCleanup=t;const e=()=>{window.removeEventListener("afterprint",e),this._printCleanup===t&&(t(),this._printCleanup=null)};window.addEventListener("afterprint",e,{once:!0}),window.print()};D=function(){const t=r(this,a,y).call(this,this.spacing),e=r(this,a,y).call(this,this.spacingTop)??t,i=r(this,a,y).call(this,this.spacingBottom)??t,n=r(this,a,y).call(this,this.spacingLeft),s=r(this,a,y).call(this,this.spacingRight);e?this.style.setProperty("--scb-viz-spacing-block-start",e):this.style.removeProperty("--scb-viz-spacing-block-start"),i?this.style.setProperty("--scb-viz-spacing-block-end",i):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"),s?this.style.setProperty("--scb-viz-spacing-inline-end",s):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};T=function(){const t=this.containerMaxWidth?.trim();t?this.style.setProperty("--scb-viz-container-max-width",t):this.style.removeProperty("--scb-viz-container-max-width")};d._printInstanceCounter=0;d.styles=Z`
391
391
  :host {
392
392
  display: block;
393
393
  box-sizing: border-box;
@@ -1012,4 +1012,4 @@ import{a as Y,n as b,r as F,i as Q,x as h,k as V,l as Z,t as tt}from"../../vendo
1012
1012
  width: calc(100% / var(--scb-viz-print-scale, 1));
1013
1013
  }
1014
1014
  }
1015
- `;g([b({type:String,reflect:!0})],d.prototype,"variant",2);g([b({type:String,reflect:!0,attribute:"selected-chip"})],d.prototype,"selectedChip",2);g([b({type:String,reflect:!0})],d.prototype,"title",2);g([b({type:String,reflect:!0})],d.prototype,"subtitle",2);g([b({type:String,reflect:!0})],d.prototype,"description",2);g([b({type:String,reflect:!0})],d.prototype,"comment",2);g([b({type:String,reflect:!0})],d.prototype,"source",2);g([b({type:String,reflect:!0})],d.prototype,"footnote",2);g([b({type:String,reflect:!0,attribute:"lang"})],d.prototype,"lang",2);g([b({type:String,reflect:!0,attribute:"image-href"})],d.prototype,"imageHref",2);g([b({type:Boolean,reflect:!0,attribute:"official-statistics"})],d.prototype,"officialStatistics",2);g([b({type:Boolean,reflect:!0,attribute:"disable-toggle"})],d.prototype,"disableToggle",2);g([b({type:String,attribute:"content-max-width"})],d.prototype,"contentMaxWidth",2);g([b({type:String,attribute:"container-max-width"})],d.prototype,"containerMaxWidth",2);g([b({type:String,attribute:"content-height"})],d.prototype,"contentHeight",2);g([b({type:String,reflect:!0,attribute:"toggle-height-mode"})],d.prototype,"toggleHeightMode",2);g([b({attribute:!1})],d.prototype,"tableData",2);g([F()],d.prototype,"_slottedTableData",2);g([F()],d.prototype,"_actionsMenuOpen",2);g([b({type:String,reflect:!0})],d.prototype,"spacing",2);g([b({type:String,attribute:"spacing-top",reflect:!0})],d.prototype,"spacingTop",2);g([b({type:String,attribute:"spacing-bottom",reflect:!0})],d.prototype,"spacingBottom",2);g([b({type:String,attribute:"spacing-left",reflect:!0})],d.prototype,"spacingLeft",2);g([b({type:String,attribute:"spacing-right",reflect:!0})],d.prototype,"spacingRight",2);d=g([tt("scb-viz")],d);
1015
+ `;g([b({type:String,reflect:!0})],d.prototype,"variant",2);g([b({type:String,reflect:!0,attribute:"selected-chip"})],d.prototype,"selectedChip",2);g([b({type:String,reflect:!0})],d.prototype,"title",2);g([b({type:String,reflect:!0})],d.prototype,"subtitle",2);g([b({type:String,reflect:!0})],d.prototype,"description",2);g([b({type:String,reflect:!0})],d.prototype,"comment",2);g([b({type:String,reflect:!0})],d.prototype,"source",2);g([b({type:String,reflect:!0})],d.prototype,"footnote",2);g([b({type:String,reflect:!0,attribute:"lang"})],d.prototype,"lang",2);g([b({type:String,reflect:!0,attribute:"image-href"})],d.prototype,"imageHref",2);g([b({type:Boolean,reflect:!0,attribute:"official-statistics"})],d.prototype,"officialStatistics",2);g([b({type:Boolean,reflect:!0,attribute:"disable-toggle"})],d.prototype,"disableToggle",2);g([b({type:String,attribute:"content-max-width"})],d.prototype,"contentMaxWidth",2);g([b({type:String,attribute:"container-max-width"})],d.prototype,"containerMaxWidth",2);g([b({type:String,attribute:"content-height"})],d.prototype,"contentHeight",2);g([b({type:String,reflect:!0,attribute:"toggle-height-mode"})],d.prototype,"toggleHeightMode",2);g([b({attribute:!1})],d.prototype,"tableData",2);g([tt()],d.prototype,"_actionsMenuOpen",2);g([b({type:String,reflect:!0})],d.prototype,"spacing",2);g([b({type:String,attribute:"spacing-top",reflect:!0})],d.prototype,"spacingTop",2);g([b({type:String,attribute:"spacing-bottom",reflect:!0})],d.prototype,"spacingBottom",2);g([b({type:String,attribute:"spacing-left",reflect:!0})],d.prototype,"spacingLeft",2);g([b({type:String,attribute:"spacing-right",reflect:!0})],d.prototype,"spacingRight",2);d=g([st("scb-viz")],d);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.283",
3
+ "version": "0.1.284",
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": "FA863A7845456A470809A081667F6AD76E058044BE284AA0617E3F3A61C58448"
389
+ "buildHash": "04C7A1822968200F73FCBC37D10E3445C1ADEC3783086E1CC09F7402129BF941"
390
390
  }
@@ -21,10 +21,10 @@ export declare class ScbHorizontalScroller extends LitElement {
21
21
  contentFlex: boolean;
22
22
  /** Avstånd mellan slottade element när content-flex är aktivt. */
23
23
  internalGap: string;
24
+ private _canScrollLeft;
25
+ private _canScrollRight;
24
26
  static styles: import('lit').CSSResult;
25
27
  private doScrollBy;
26
- private get canScrollLeft();
27
- private get canScrollRight();
28
28
  private updateScrollButtons;
29
29
  connectedCallback(): void;
30
30
  disconnectedCallback(): void;