scb-wc 0.1.150 → 0.1.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -41
- package/all.js +5 -0
- package/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/icons.json +3 -1
- package/index.js +95 -90
- package/mvc/components/all.js +5 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
- package/mvc/components/scb-card/scb-card.js +2 -2
- package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +132 -0
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-header/scb-header.js +2 -2
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
- package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
- package/mvc/components/scb-list/scb-list-item.js +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-search/scb-search.js +1 -1
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +2 -2
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +28 -159
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/shared/lazy-focus-ring.js +2 -0
- package/mvc/components/shared/lazy-ripple.js +2 -0
- package/mvc/components/shared/scb-icon-svg.js +11 -0
- package/mvc/fonts/material-symbols-outlined/files/material-symbols-outlined-subset.woff2 +0 -0
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +1 -0
- package/scb-components/index.d.ts +104 -0
- package/scb-components/scb-chevron/scb-chevron.d.ts +11 -0
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +45 -0
- package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
- package/scb-components/shared/lazy-ripple.d.ts +9 -0
- package/scb-components/shared/scb-icon-svg.d.ts +3 -0
- package/scb-datepicker/scb-datepicker.js +1 -0
- package/scb-wc.bundle.js +906 -906
- package/scb-wc.d.ts +208 -198
- package/shared/scb-icon-svg.js +5 -2
- package/mvc/vendor/lazy-focus-ring.js +0 -2
- package/mvc/vendor/lazy-ripple.js +0 -2
- package/mvc/vendor/scb-icon-svg.js +0 -11
- package/scb-wc-public-entry/index.d.ts +0 -99
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../scb-drawer/scb-drawer.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-divider/scb-divider.js","../../vendor/assertClassBrand.js","../scb-menu/scb-menu.js","../scb-menu/scb-menu-item.js","../scb-chevron/scb-chevron.js","../scb-menu/scb-menu-section.js","../scb-menu/scb-sub-menu.js","../scb-search/scb-search.js","../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/ripple.js","../../vendor/attachable-controller.js","../../vendor/scb-header-drawer.internal.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-skeleton/scb-skeleton.js","../scb-grid/scb-grid.js","../scb-grid/scb-grid-item.js","../scb-grid/scb-stack.js","../scb-dropdown/scb-dropdown.js","../scb-options-menu/scb-options-menu.js","../scb-options-menu/scb-options-menu-item.js","../scb-options-menu/scb-options-sub-menu.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{f as A,g as w,h as R,m as N,p as d,v as m,y as O}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as S}from"../../vendor/preload-helper.js";import{t as l}from"../../vendor/decorate.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,r,i){try{customElements.get(t)||e(t,r,i)}catch(o){var s=String(o||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var z,E,B=0,I=[0,2,4,8,12,16,20,24,32,40,48,64,80,96,120],H=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-header-pre-upgrade]"))return;const b=document.createElement("style");b.setAttribute("data-scb-header-pre-upgrade",""),b.textContent=`
|
|
3
3
|
scb-header:not(:defined),
|
|
4
4
|
scb-header[data-upgrading] {
|
|
@@ -52,7 +52,7 @@ import{f as A,g as w,h as R,m as N,p as d,v as m,y as O}from"../../vendor/vendor
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
`,document.head.appendChild(b);const e=n=>{const p=String(n??"").trim();if(p){if(/^\d+$/.test(p)){const h=Math.max(0,Math.min(14,parseInt(p,10)));return`var(--spacing-${h}, ${I[h]}px)`}return p}},t=n=>{const p=String(n??"").trim();if(!p)return!1;try{const h=JSON.parse(p);return Array.isArray(h)&&h.length>0}catch{return!1}},r=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),i=n=>{for(const p of Array.from(n.children)){const h=p.tagName.toLowerCase();if(h==="scb-header-tab"||h==="scb-dropdown")return!0}return!1},s=n=>{i(n)||t(n.getAttribute("tabs"))||r(n.getAttribute("reserve-tabs"))||r(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const p=e(n.getAttribute("spacing")),h=e(n.getAttribute("spacing-top"))??p,v=e(n.getAttribute("spacing-bottom"))??p,f=e(n.getAttribute("padding-inline")),_=e(n.getAttribute("padding-inline-expanded"))??f;h?n.style.setProperty("--scb-header-spacing-block-start",h):n.style.removeProperty("--scb-header-spacing-block-start"),v?n.style.setProperty("--scb-header-spacing-block-end",v):n.style.removeProperty("--scb-header-spacing-block-end"),f?n.style.setProperty("--scb-header-padding-inline",f):n.style.removeProperty("--scb-header-padding-inline"),_?n.style.setProperty("--scb-header-padding-inline-expanded",_):n.style.removeProperty("--scb-header-padding-inline-expanded");const c=(n.getAttribute("logo-width")??"").trim();c?n.style.setProperty("--scb-header-pre-logo-w",c):n.style.removeProperty("--scb-header-pre-logo-w");const x=(n.getAttribute("logo-height")??"").trim();x?n.style.setProperty("--scb-header-pre-logo-img-h",x):n.style.removeProperty("--scb-header-pre-logo-img-h");const g=(n.getAttribute("search-height")??"").trim();g?n.style.setProperty("--scb-header-pre-control-size",g):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(s);const u=new MutationObserver(n=>{for(const p of n){if(p.type==="attributes"){const h=p.target;h instanceof HTMLElement&&h.tagName.toLowerCase()==="scb-header"&&s(h);continue}if(p.type==="childList"){const h=[...Array.from(p.addedNodes),...Array.from(p.removedNodes)];for(const v of h){if(!(v instanceof HTMLElement))continue;if(v.tagName.toLowerCase()==="scb-header"){s(v);continue}const f=v.closest?.("scb-header");f&&s(f)}}}});u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","padding-inline","padding-inline-expanded","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{u.disconnect()})};H();var L={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},T={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},W={fromAttribute:b=>b==="small"||b==="medium"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="medium"||e==="large"?e:null}},a=(z=class extends R{constructor(){super(),this.maxWidth="1440px",this.size="large",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.searchClearLabel="Rensa sökfält",this.searchCloseLabel="Stäng sök",this.menuButtonLabel="Meny",this.menuOpenLabel="Öppna meny",this.utilityNavigationLabel="Funktionslänkar",this.mainNavigationLabel="Huvudnavigering",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{t.stopPropagation();const r=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:r,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:r,bubbles:!0,composed:!0}));const i=r?.item,s=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",o=i?i.getAttribute("item-href")??i.getAttribute("href")??"":"";String(s||o||"").trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=t=>{t.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const r=Array.from(this.children),i=[],s=[],o=[];let u=-1,n=!1;const p=c=>({label:c.getAttribute("label")??"",href:c.getAttribute("href")??void 0,icon:c.getAttribute("icon")??void 0}),h=c=>{c.hasAttribute("role")&&c.removeAttribute("role"),c.hasAttribute("hidden")||c.setAttribute("hidden",""),c.getAttribute("aria-hidden")!=="true"&&c.setAttribute("aria-hidden","true")};for(const c of r){const x=c.tagName.toLowerCase();if(this._isDrawerCloseNode(c)){this._syncDrawerCloseNode(c);continue}if(x==="scb-header-tab"){h(c);const g=c.getAttribute("label")??"",y=c.getAttribute("href"),C=y&&y.trim()!==""?y:void 0;(c.hasAttribute("selected")||c.getAttribute("selected")==="true"||c.getAttribute("active")==="true"||c.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length),i.push({kind:"tab",label:g,href:C});continue}if(x==="scb-badge"){const g=c.querySelector("scb-dropdown");if(g){n=!0;const y=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length);const C=`scb-header-tab-${i.length}`;c.getAttribute("slot")!==C&&c.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),i.push({kind:"dropdown",slotName:C,label:y});continue}}if(x==="scb-dropdown"){n=!0;const g=c.getAttribute("label")??"";(c.hasAttribute("selected")||c.getAttribute("selected")==="true"||c.getAttribute("active")==="true"||c.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length);const y=`scb-header-tab-${i.length}`;c.getAttribute("slot")!==y&&c.setAttribute("slot",y),c.hasAttribute("as-tab")||c.setAttribute("as-tab",""),i.push({kind:"dropdown",slotName:y,label:g});continue}if(x==="scb-header-utility"){h(c),s.push({label:c.getAttribute("label")??"",href:c.getAttribute("href")??"#",target:c.getAttribute("target")??void 0});continue}if(x==="scb-header-menu-group"){h(c);const g={label:c.getAttribute("label")??"",icon:c.getAttribute("icon")??void 0,children:[]};c.querySelectorAll("scb-header-menu-item").forEach(y=>g.children.push(p(y))),o.push(g);continue}if(x==="scb-header-menu-item"){h(c),o.push(p(c));continue}c.hasAttribute("slot")||h(c)}const v=!this._sameNavItems(this._slotNavItems,i),f=!this._sameUtilityItems(this._slotUtils,s),_=!this._sameMenuNodes(this._slotMenu,o);v&&(this._slotNavItems=i),f&&(this._slotUtils=s),_&&(this._slotMenu=o),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&u>=0&&this.activeTab!==u&&(this.activeTab=u),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,r=this._logoGroup;if(!t||!r)return;const i=window.innerWidth,s=t.clientWidth,o=this._overflows(this._util),u=this._tabsOverflows(),n=i<this.BP_MD||o||u;this._collapsed?!n&&s>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=s+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&i>=this.BP_SM&&i<this.BP_MD&&this._searchWrap){const v=getComputedStyle(this._searchWrap),f=Math.max(this._num(v.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),_=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),c=this.showDrawer&&(this.alwaysShowMenuButton||i<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;p=r.getBoundingClientRect().width+_+f+_+c+8>s+.5}this._setHideSearch(p);let h=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||i<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const v=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),f=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+v+f;this._hideLogoText?h=!(s>=this._logoTextUnlockAt):_>s+.5&&(h=!0,this._logoTextUnlockAt=s+this._HYST)}else h=!1,this._logoTextUnlockAt=0;this._setHideLogoText(h)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const r=t.composedPath()[0];r instanceof HTMLElement&&r.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const r=t.currentTarget;if(!r)return;const i=r.tagName.toLowerCase()==="a";if(i&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const s=r.getAttribute("data-index"),o=s!=null?Number(s):0,u=this._getNavItems()[o];if(u?.kind==="dropdown")return;this.activeTab=o;const n=u?.kind==="tab"?u.href??"":"",p=new CustomEvent("tab-change",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0}),h=new CustomEvent("tabchange",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(p)&&this.dispatchEvent(h))&&i&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,i=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(i==null||!Number.isFinite(i))return;const s=this._getNavItems();i<0||i>=s.length||s[i]?.kind==="dropdown"&&(this.activeTab=i,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:i,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:i,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const r=t.key;if(r!=="ArrowLeft"&&r!=="ArrowRight"&&r!=="Home"&&r!=="End")return;const i=this._getNavItems();if(!i.length)return;const s=this._readTabIndexFromEvent(t);if(s==null)return;let o=Math.max(0,Math.min(i.length-1,s));r==="ArrowRight"?o=(o+1)%i.length:r==="ArrowLeft"?o=(o-1+i.length)%i.length:r==="Home"?o=0:r==="End"&&(o=i.length-1),t.preventDefault(),this._focusTabAtIndex(o)},this._onNativeSearchInput=t=>{const r=t.currentTarget;this._emitSearchInput(r?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const r=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(r?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const r=t.currentTarget?.closest("form")?.querySelector(".header-search-input");r&&(r.value=""),r?.focus()})};const e=++B;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",E.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",E.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(s=>s.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=s=>{const o=new MutationObserver(u=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(s,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const s=Array.from(this.children);for(const o of s){const u=o.tagName.toLowerCase();if((u==="scb-header-tab"||u==="scb-dropdown"||u==="scb-header-utility"||u==="scb-header-menu-item"||u==="scb-header-menu-group"||u==="scb-badge")&&t(o),u==="scb-badge"){const n=o,p=new MutationObserver(v=>{r(),this._scheduleHarvest()});this._slotWatchers.push(p),p.observe(n,{childList:!0});const h=n.querySelector("scb-dropdown");h&&t(h);continue}if(u==="scb-header-menu-group"){const n=o,p=new MutationObserver(h=>{r(),this._scheduleHarvest()});this._slotWatchers.push(p),p.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(h=>t(h))}}},i=new MutationObserver(s=>{let o=!1;for(const u of s)if(u.type==="childList"){o=!0;break}o&&r(),this._scheduleHarvest()});this._slotMo=i,i.observe(this,{childList:!0}),r()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.kind!==s.kind||i.label!==s.label)return!1;if(i.kind==="tab"&&s.kind==="tab"){if((i.href??"")!==(s.href??""))return!1}else if(i.kind==="dropdown"&&s.kind==="dropdown"&&i.slotName!==s.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.label!==s.label||i.href!==s.href||(i.target??"")!==(s.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.label!==s.label||(i.href??"")!==(s.href??"")||(i.icon??"")!==(s.icon??"")||!this._sameMenuNodes(i.children??[],s.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),r=e.getAttribute("slot");if(r==="drawer-close")return!0;if(r||t!=="scb-icon-button")return!1;const i=(e.getAttribute("icon")??"").trim().toLowerCase(),s=(e.getAttribute("aria-label")??"").trim().toLowerCase();return i==="close"||s.includes("stäng")||s.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const r=e.getBoundingClientRect();let i=r.left;for(const s of t){const o=s.getBoundingClientRect();o.width<=0||o.right>i&&(i=o.right)}return i-r.left>r.width+1}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("paddingInline")||e.has("paddingInlineExpanded"))&&this._applyPaddingInline(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("paddingInline")||e.has("paddingInlineExpanded")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t){if(/^\d+$/.test(t)){const r=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${r}, ${I[r]}px)`}return t}}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,r=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),r?this.style.setProperty("--scb-header-spacing-block-end",r):this.style.removeProperty("--scb-header-spacing-block-end")}_applyPaddingInline(){const e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty("--scb-header-padding-inline",e):this.style.removeProperty("--scb-header-padding-inline"),t?this.style.setProperty("--scb-header-padding-inline-expanded",t):this.style.removeProperty("--scb-header-padding-inline-expanded")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),r=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),r?this.style.setProperty("--scb-header-logo-img-aspect-ratio",r):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../../vendor/lazy-focus-ring.js").then(e=>e.i),__vite__mapDeps([0,1,2]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([3,4,5,6,7,8]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([9,8,4,5,6,7,10,2,11,12,13]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([14,4,2,5,15,1,6,16,17,0]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([18,5,6]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,8,4,2,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([20,8,4,2,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,4,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([22,8,4,5,6,23,24]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([23,8,4,5,6]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([25,4,5,15,1,6,19,8,2,11,26,27,16,17,7,0,28]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const r=this._getDropdownForSlot(e.slotName);if(!r)return;const i=String(t);r.getAttribute("data-index")!==i&&r.setAttribute("data-index",i),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const s=this.size,o=r;o?.size!==s&&(o.size=s),t===this.activeTab?r.getAttribute("aria-current")!=="page"&&r.setAttribute("aria-current","page"):r.hasAttribute("aria-current")&&r.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const i=r.getAttribute("data-index");if(i==null)continue;const s=Number(i);if(Number.isFinite(s))return s}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const r=e?`menu-trigger ${e}`:"menu-trigger",i=(this.menuButtonLabel??"").trim()||"Meny",s=(this.menuOpenLabel??"").trim()||i,o=this._menuExpanded?"true":"false";return t?m`
|
|
55
|
+
`,document.head.appendChild(b);const e=n=>{const p=String(n??"").trim();if(p){if(/^\d+$/.test(p)){const h=Math.max(0,Math.min(14,parseInt(p,10)));return`var(--spacing-${h}, ${I[h]}px)`}return p}},t=n=>{const p=String(n??"").trim();if(!p)return!1;try{const h=JSON.parse(p);return Array.isArray(h)&&h.length>0}catch{return!1}},r=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),i=n=>{for(const p of Array.from(n.children)){const h=p.tagName.toLowerCase();if(h==="scb-header-tab"||h==="scb-dropdown")return!0}return!1},s=n=>{i(n)||t(n.getAttribute("tabs"))||r(n.getAttribute("reserve-tabs"))||r(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const p=e(n.getAttribute("spacing")),h=e(n.getAttribute("spacing-top"))??p,v=e(n.getAttribute("spacing-bottom"))??p,f=e(n.getAttribute("padding-inline")),_=e(n.getAttribute("padding-inline-expanded"))??f;h?n.style.setProperty("--scb-header-spacing-block-start",h):n.style.removeProperty("--scb-header-spacing-block-start"),v?n.style.setProperty("--scb-header-spacing-block-end",v):n.style.removeProperty("--scb-header-spacing-block-end"),f?n.style.setProperty("--scb-header-padding-inline",f):n.style.removeProperty("--scb-header-padding-inline"),_?n.style.setProperty("--scb-header-padding-inline-expanded",_):n.style.removeProperty("--scb-header-padding-inline-expanded");const c=(n.getAttribute("logo-width")??"").trim();c?n.style.setProperty("--scb-header-pre-logo-w",c):n.style.removeProperty("--scb-header-pre-logo-w");const x=(n.getAttribute("logo-height")??"").trim();x?n.style.setProperty("--scb-header-pre-logo-img-h",x):n.style.removeProperty("--scb-header-pre-logo-img-h");const g=(n.getAttribute("search-height")??"").trim();g?n.style.setProperty("--scb-header-pre-control-size",g):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(s);const u=new MutationObserver(n=>{for(const p of n){if(p.type==="attributes"){const h=p.target;h instanceof HTMLElement&&h.tagName.toLowerCase()==="scb-header"&&s(h);continue}if(p.type==="childList"){const h=[...Array.from(p.addedNodes),...Array.from(p.removedNodes)];for(const v of h){if(!(v instanceof HTMLElement))continue;if(v.tagName.toLowerCase()==="scb-header"){s(v);continue}const f=v.closest?.("scb-header");f&&s(f)}}}});u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","padding-inline","padding-inline-expanded","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{u.disconnect()})};H();var L={fromAttribute:b=>b==null?!0:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>String(!!b)},T={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},W={fromAttribute:b=>b==="small"||b==="medium"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="medium"||e==="large"?e:null}},a=(z=class extends R{constructor(){super(),this.maxWidth="1440px",this.size="large",this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.searchClearLabel="Rensa sökfält",this.searchCloseLabel="Stäng sök",this.menuButtonLabel="Meny",this.menuOpenLabel="Öppna meny",this.utilityNavigationLabel="Funktionslänkar",this.mainNavigationLabel="Huvudnavigering",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{t.stopPropagation();const r=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:r,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:r,bubbles:!0,composed:!0}));const i=r?.item,s=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",o=i?i.getAttribute("item-href")??i.getAttribute("href")??"":"";String(s||o||"").trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=t=>{t.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const r=Array.from(this.children),i=[],s=[],o=[];let u=-1,n=!1;const p=c=>({label:c.getAttribute("label")??"",href:c.getAttribute("href")??void 0,icon:c.getAttribute("icon")??void 0}),h=c=>{c.hasAttribute("role")&&c.removeAttribute("role"),c.hasAttribute("hidden")||c.setAttribute("hidden",""),c.getAttribute("aria-hidden")!=="true"&&c.setAttribute("aria-hidden","true")};for(const c of r){const x=c.tagName.toLowerCase();if(this._isDrawerCloseNode(c)){this._syncDrawerCloseNode(c);continue}if(x==="scb-header-tab"){h(c);const g=c.getAttribute("label")??"",y=c.getAttribute("href"),C=y&&y.trim()!==""?y:void 0;(c.hasAttribute("selected")||c.getAttribute("selected")==="true"||c.getAttribute("active")==="true"||c.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length),i.push({kind:"tab",label:g,href:C});continue}if(x==="scb-badge"){const g=c.querySelector("scb-dropdown");if(g){n=!0;const y=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length);const C=`scb-header-tab-${i.length}`;c.getAttribute("slot")!==C&&c.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),i.push({kind:"dropdown",slotName:C,label:y});continue}}if(x==="scb-dropdown"){n=!0;const g=c.getAttribute("label")??"";(c.hasAttribute("selected")||c.getAttribute("selected")==="true"||c.getAttribute("active")==="true"||c.getAttribute("aria-current")==="page")&&u===-1&&(u=i.length);const y=`scb-header-tab-${i.length}`;c.getAttribute("slot")!==y&&c.setAttribute("slot",y),c.hasAttribute("as-tab")||c.setAttribute("as-tab",""),i.push({kind:"dropdown",slotName:y,label:g});continue}if(x==="scb-header-utility"){h(c),s.push({label:c.getAttribute("label")??"",href:c.getAttribute("href")??"#",target:c.getAttribute("target")??void 0});continue}if(x==="scb-header-menu-group"){h(c);const g={label:c.getAttribute("label")??"",icon:c.getAttribute("icon")??void 0,children:[]};c.querySelectorAll("scb-header-menu-item").forEach(y=>g.children.push(p(y))),o.push(g);continue}if(x==="scb-header-menu-item"){h(c),o.push(p(c));continue}c.hasAttribute("slot")||h(c)}const v=!this._sameNavItems(this._slotNavItems,i),f=!this._sameUtilityItems(this._slotUtils,s),_=!this._sameMenuNodes(this._slotMenu,o);v&&(this._slotNavItems=i),f&&(this._slotUtils=s),_&&(this._slotMenu=o),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&u>=0&&this.activeTab!==u&&(this.activeTab=u),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,r=this._logoGroup;if(!t||!r)return;const i=window.innerWidth,s=t.clientWidth,o=this._overflows(this._util),u=this._tabsOverflows(),n=i<this.BP_MD||o||u;this._collapsed?!n&&s>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=s+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&i>=this.BP_SM&&i<this.BP_MD&&this._searchWrap){const v=getComputedStyle(this._searchWrap),f=Math.max(this._num(v.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),_=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),c=this.showDrawer&&(this.alwaysShowMenuButton||i<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;p=r.getBoundingClientRect().width+_+f+_+c+8>s+.5}this._setHideSearch(p);let h=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||i<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const v=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),f=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+v+f;this._hideLogoText?h=!(s>=this._logoTextUnlockAt):_>s+.5&&(h=!0,this._logoTextUnlockAt=s+this._HYST)}else h=!1,this._logoTextUnlockAt=0;this._setHideLogoText(h)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const r=t.composedPath()[0];r instanceof HTMLElement&&r.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const r=t.currentTarget;if(!r)return;const i=r.tagName.toLowerCase()==="a";if(i&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const s=r.getAttribute("data-index"),o=s!=null?Number(s):0,u=this._getNavItems()[o];if(u?.kind==="dropdown")return;this.activeTab=o;const n=u?.kind==="tab"?u.href??"":"",p=new CustomEvent("tab-change",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0}),h=new CustomEvent("tabchange",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(p)&&this.dispatchEvent(h))&&i&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,i=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(i==null||!Number.isFinite(i))return;const s=this._getNavItems();i<0||i>=s.length||s[i]?.kind==="dropdown"&&(this.activeTab=i,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:i,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:i,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const r=t.key;if(r!=="ArrowLeft"&&r!=="ArrowRight"&&r!=="Home"&&r!=="End")return;const i=this._getNavItems();if(!i.length)return;const s=this._readTabIndexFromEvent(t);if(s==null)return;let o=Math.max(0,Math.min(i.length-1,s));r==="ArrowRight"?o=(o+1)%i.length:r==="ArrowLeft"?o=(o-1+i.length)%i.length:r==="Home"?o=0:r==="End"&&(o=i.length-1),t.preventDefault(),this._focusTabAtIndex(o)},this._onNativeSearchInput=t=>{const r=t.currentTarget;this._emitSearchInput(r?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const r=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(r?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const r=t.currentTarget?.closest("form")?.querySelector(".header-search-input");r&&(r.value=""),r?.focus()})};const e=++B;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",E.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",E.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(s=>s.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=s=>{const o=new MutationObserver(u=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(s,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const s=Array.from(this.children);for(const o of s){const u=o.tagName.toLowerCase();if((u==="scb-header-tab"||u==="scb-dropdown"||u==="scb-header-utility"||u==="scb-header-menu-item"||u==="scb-header-menu-group"||u==="scb-badge")&&t(o),u==="scb-badge"){const n=o,p=new MutationObserver(v=>{r(),this._scheduleHarvest()});this._slotWatchers.push(p),p.observe(n,{childList:!0});const h=n.querySelector("scb-dropdown");h&&t(h);continue}if(u==="scb-header-menu-group"){const n=o,p=new MutationObserver(h=>{r(),this._scheduleHarvest()});this._slotWatchers.push(p),p.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(h=>t(h))}}},i=new MutationObserver(s=>{let o=!1;for(const u of s)if(u.type==="childList"){o=!0;break}o&&r(),this._scheduleHarvest()});this._slotMo=i,i.observe(this,{childList:!0}),r()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.kind!==s.kind||i.label!==s.label)return!1;if(i.kind==="tab"&&s.kind==="tab"){if((i.href??"")!==(s.href??""))return!1}else if(i.kind==="dropdown"&&s.kind==="dropdown"&&i.slotName!==s.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.label!==s.label||i.href!==s.href||(i.target??"")!==(s.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){const i=e[r],s=t[r];if(!i||!s||i.label!==s.label||(i.href??"")!==(s.href??"")||(i.icon??"")!==(s.icon??"")||!this._sameMenuNodes(i.children??[],s.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),r=e.getAttribute("slot");if(r==="drawer-close")return!0;if(r||t!=="scb-icon-button")return!1;const i=(e.getAttribute("icon")??"").trim().toLowerCase(),s=(e.getAttribute("aria-label")??"").trim().toLowerCase();return i==="close"||s.includes("stäng")||s.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav;if(!e||!this._visible(e))return!1;const t=Array.from(e.querySelectorAll(".tab-wrap"));if(t.length===0)return!1;const r=e.getBoundingClientRect();let i=r.left;for(const s of t){const o=s.getBoundingClientRect();o.width<=0||o.right>i&&(i=o.right)}return i-r.left>r.width+1}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("paddingInline")||e.has("paddingInlineExpanded"))&&this._applyPaddingInline(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("paddingInline")||e.has("paddingInlineExpanded")||e.has("size"))&&this.updateComplete.then(()=>{this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t){if(/^\d+$/.test(t)){const r=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${r}, ${I[r]}px)`}return t}}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,r=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),r?this.style.setProperty("--scb-header-spacing-block-end",r):this.style.removeProperty("--scb-header-spacing-block-end")}_applyPaddingInline(){const e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty("--scb-header-padding-inline",e):this.style.removeProperty("--scb-header-padding-inline"),t?this.style.setProperty("--scb-header-padding-inline-expanded",t):this.style.removeProperty("--scb-header-padding-inline-expanded")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),r=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),r?this.style.setProperty("--scb-header-logo-img-aspect-ratio",r):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([2,3,4,5,6,7]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([8,7,3,4,5,6,9,1,10,11,12]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([13,3,1,4,14,15,5,16,17,0]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([18,4,5]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([20,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,3,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([22,7,3,4,5,23,24]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([23,7,3,4,5]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([25,3,4,14,15,5,19,7,1,10,26,27,16,17,6,0,28]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const r=this._getDropdownForSlot(e.slotName);if(!r)return;const i=String(t);r.getAttribute("data-index")!==i&&r.setAttribute("data-index",i),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const s=this.size,o=r;o?.size!==s&&(o.size=s),t===this.activeTab?r.getAttribute("aria-current")!=="page"&&r.setAttribute("aria-current","page"):r.hasAttribute("aria-current")&&r.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const r of t){if(!(r instanceof HTMLElement))continue;const i=r.getAttribute("data-index");if(i==null)continue;const s=Number(i);if(Number.isFinite(s))return s}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const r=e?`menu-trigger ${e}`:"menu-trigger",i=(this.menuButtonLabel??"").trim()||"Meny",s=(this.menuOpenLabel??"").trim()||i,o=this._menuExpanded?"true":"false";return t?m`
|
|
56
56
|
<button
|
|
57
57
|
type="button"
|
|
58
58
|
class=${`${r} header-icon-button`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";import{renderScbIcon as h}from"../shared/scb-icon-svg.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,r,i){try{customElements.get(t)||o(t,r,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var d,b;function u(){return b??(b=z(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),b}var l=(d=class extends v{constructor(...o){super(...o),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.__scrollLeft=()=>{this.doScrollBy(-this.getScrollStep())},this.__scrollRight=()=>{this.doScrollBy(this.getScrollStep())},this.updateScrollButtons=()=>{const t=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t){this._canScrollLeft=!1,this._canScrollRight=!1,this.toggleAttribute("data-scroll-left",!1),this.toggleAttribute("data-scroll-right",!1);return}const r=t.scrollLeft>0,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this._canScrollLeft=r,this._canScrollRight=i,this.toggleAttribute("data-scroll-left",r),this.toggleAttribute("data-scroll-right",i)},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.__onFocusIn=()=>{u().then(({ensureFocusRingReady:t})=>t())},this.__onLazyFocusRingKeydown=t=>{!(t instanceof KeyboardEvent)||t.key!=="Tab"||u().then(({ensureFocusRingOnTab:r})=>r(t))},this.handleScroll=()=>{const t=this.scrollerEl;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 r=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!r||t.deltaY===0)return;const i=r.scrollLeft,n=i>0,a=i+r.clientWidth<r.scrollWidth-1;!n&&!a||(r.scrollLeft+=t.deltaY,r.scrollLeft!==i&&t.preventDefault())}}getScrollStep(){const o=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");return o?Math.max(Math.round(o.clientWidth*.8),120):200}doScrollBy(o){this.scrollerEl?.scrollBy({left:o,behavior:"smooth"})}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.style.setProperty("--scb-horizontal-scroller-width",this.width)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.renderRoot.removeEventListener("focusin",this.__onFocusIn),this.renderRoot.removeEventListener("keydown",this.__onLazyFocusRingKeydown),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(o,t={}){this.dispatchEvent(new CustomEvent(o,{detail:t,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(o,t={}){if(this.dispatchCustomEvent(o,t),o.includes("-")){const r=o.replace(/-/g,"");this.dispatchCustomEvent(r,t)}}firstUpdated(){this.renderRoot.addEventListener("focusin",this.__onFocusIn),this.renderRoot.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot"),this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const o=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,this.updateScrollButtons()}))};requestAnimationFrame(()=>{this.updateScrollButtons()}),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{o()}),this.sizeObserver=new ResizeObserver(()=>{o()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),this.__applySpacing(),this.__applyInternalGap()}updated(o){o.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&this.__applySpacing(),(o.has("internalGap")||o.has("contentFlex"))&&this.__applyInternalGap()}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const o=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),r=this.mapSpacingToken(this.spacingBottom),i=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight),a=t??o,g=r??o;a?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",a):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),g?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",g):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"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")}__applyInternalGap(){const o=this.mapSpacingToken(this.internalGap);this.contentFlex&&o?this.style.setProperty("--scb-horizontal-scroller-internal-gap",o):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")}render(){const o=this.variant,t=this._canScrollLeft||this._canScrollRight;return o==="inline"?c`
|
|
3
3
|
<div class="scb-horizontal-scroller ${t?"canScroll":""}" tabindex="0">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
<md-focus-ring inward></md-focus-ring>
|
|
@@ -13,7 +13,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
13
13
|
aria-label=${this.leftScrollButtonLabel}
|
|
14
14
|
@click=${this.__scrollLeft}
|
|
15
15
|
>
|
|
16
|
-
${
|
|
16
|
+
${h("chevron_left","scroll-control-icon")}
|
|
17
17
|
<span>${this.leftScrollButtonLabel}</span>
|
|
18
18
|
</button>
|
|
19
19
|
`:""}
|
|
@@ -26,7 +26,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
26
26
|
@click=${this.__scrollRight}
|
|
27
27
|
>
|
|
28
28
|
<span>${this.rightScrollButtonLabel}</span>
|
|
29
|
-
${
|
|
29
|
+
${h("chevron_right","scroll-control-icon")}
|
|
30
30
|
</button>
|
|
31
31
|
`:""}
|
|
32
32
|
</div>
|
|
@@ -39,7 +39,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
39
39
|
aria-label=${this.leftScrollButtonLabel}
|
|
40
40
|
@click=${this.__scrollLeft}
|
|
41
41
|
>
|
|
42
|
-
${
|
|
42
|
+
${h("chevron_left","scroll-control-icon")}
|
|
43
43
|
</button>
|
|
44
44
|
`:""}
|
|
45
45
|
<div class="scroll-shadow-left"></div>
|
|
@@ -55,7 +55,7 @@ import{f,h as v,m,p as s,v as c,y}from"../../vendor/vendor.js";import"../../vend
|
|
|
55
55
|
aria-label=${this.rightScrollButtonLabel}
|
|
56
56
|
@click=${this.__scrollRight}
|
|
57
57
|
>
|
|
58
|
-
${
|
|
58
|
+
${h("chevron_right","scroll-control-icon")}
|
|
59
59
|
</button>
|
|
60
60
|
`:""}
|
|
61
61
|
`}},d.styles=y`:host{display:flex;position:relative;align-items:center;gap:var(--spacing-3);padding:0;overflow:hidden;margin-block-start:var(--scb-horizontal-scroller-spacing-block-start, 0);margin-block-end:var(--scb-horizontal-scroller-spacing-block-end, 0);margin-inline-start:var(--scb-horizontal-scroller-spacing-inline-start, 0);margin-inline-end:var(--scb-horizontal-scroller-spacing-inline-end, 0)}.scb-horizontal-scroller{overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none;width:100%}:host([data-scroll-left]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black 100%);mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black 100%)}:host([data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,black 0,black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%);mask-image:linear-gradient(to right,black 0,black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%)}:host([data-scroll-left][data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,black var(--scb-horizontal-scroller-edge-fade-size, 56px),black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),transparent 100%)}:host([show-scrollbar]) .scb-horizontal-scroller{scrollbar-width:auto}:host([content-flex]) .scb-horizontal-scroller{display:flex;flex-direction:row;flex:1 1 auto}.scb-horizontal-scroller::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:4px;width:10px}.scb-horizontal-scroller::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-horizontal-scroller::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}.scb-horizontal-scroller:focus,.scroll-control:focus,.scroll-text-button:focus{outline:0}md-focus-ring{border-radius:var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large))}:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{padding-bottom:var(--spacing-5)}slot{display:block;box-sizing:border-box;padding-block:var(--spacing-3);padding-inline:2px;min-width:var(--scb-horizontal-scroller-width, auto)}:host([content-flex]) .scb-horizontal-scroller slot{display:flex;gap:var(--scb-horizontal-scroller-internal-gap)}.scroll-button-left{left:0;position:absolute;z-index:3}.scroll-button-right{right:2px;position:absolute;z-index:3}.scroll-control,.scroll-text-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:0;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-weight:var(--weight-semibold, 600);cursor:pointer;appearance:none;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;border-radius:var(--radius-full, 1000px)}.scroll-control{inline-size:var(--scb-icon-button-container-size, 40px);block-size:var(--scb-icon-button-container-size, 40px);padding:0;overflow:hidden;background:var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff)));color:var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be)))}.scroll-text-button{position:relative;min-block-size:calc(var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)) + calc(var(--spacing-4, 12px) - var(--spacing-1, 2px)) + calc(var(--spacing-4, 12px) - var(--spacing-1, 2px)));gap:var(--spacing-3, 8px);padding-block:calc(var(--spacing-4, 12px) - var(--spacing-1, 2px));padding-inline:var(--spacing-5, 16px);background:0 0;color:var(--md-text-button-label-text-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));font-size:var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 16px));line-height:var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px));letter-spacing:var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, 0))}.scroll-control::before,.scroll-text-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.scroll-control:hover::before,.scroll-text-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.scroll-control:active::before,.scroll-text-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.scroll-control:focus-visible,.scroll-text-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));outline-offset:var(--spacing-1, 2px)}.scroll-control-icon{position:relative;display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.scroll-control-icon.scb-svg-icon{fill:currentColor;font:inherit}.scroll-shadow-left,.scroll-shadow-right{position:absolute;top:0;width:5px;bottom:0;pointer-events:none;background:0 0;box-shadow:none;transition:box-shadow .2s;z-index:2}.scroll-shadow-left{left:0}.scroll-shadow-right{right:0}:host([data-scroll-left]) .scroll-shadow-left{background:0 0;box-shadow:12px 0 30px color-mix(in srgb,currentColor 18%,transparent),4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([data-scroll-left]) .scroll-shadow-left::after,:host([data-scroll-right]) .scroll-shadow-right::after{content:"";position:absolute;inset-block:0}:host([data-scroll-right]) .scroll-shadow-right{background:0 0;box-shadow:-12px 0 30px color-mix(in srgb,currentColor 18%,transparent),-4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([variant='inline']){flex-direction:column;align-items:unset;padding:0}:host([variant='inline'][show-scrollbar]){gap:var(--spacing-5)}`,d);e([s({type:String,reflect:!0})],l.prototype,"variant",void 0);e([s({type:String,reflect:!0})],l.prototype,"width",void 0);e([s({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],l.prototype,"showScrollbar",void 0);e([s({type:String,reflect:!0,attribute:"right-scroll-button-label"})],l.prototype,"rightScrollButtonLabel",void 0);e([s({type:String,reflect:!0,attribute:"left-scroll-button-label"})],l.prototype,"leftScrollButtonLabel",void 0);e([s({type:String,reflect:!0})],l.prototype,"spacing",void 0);e([s({type:String,reflect:!0,attribute:"spacing-top"})],l.prototype,"spacingTop",void 0);e([s({type:String,reflect:!0,attribute:"spacing-bottom"})],l.prototype,"spacingBottom",void 0);e([s({type:String,reflect:!0,attribute:"spacing-left"})],l.prototype,"spacingLeft",void 0);e([s({type:String,reflect:!0,attribute:"spacing-right"})],l.prototype,"spacingRight",void 0);e([s({type:Boolean,reflect:!0,attribute:"content-flex"})],l.prototype,"contentFlex",void 0);e([s({type:String,reflect:!0,attribute:"internal-gap"})],l.prototype,"internalGap",void 0);e([f()],l.prototype,"_canScrollLeft",void 0);e([f()],l.prototype,"_canScrollRight",void 0);l=e([m("scb-horizontal-scroller")],l);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as s,h as y,m as z,p as r,v as d,y as R}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{t as n}from"../../vendor/decorate.js";import{n as x,t as f}from"../../vendor/assertClassBrand.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as s,h as y,m as z,p as r,v as d,y as R}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{t as n}from"../../vendor/decorate.js";import{n as x,t as f}from"../../vendor/assertClassBrand.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||e(t,i,a)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var u,b,h,v;function S(){return h??(h=_(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),h}function g(){return v??(v=_(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),v}var o=(u=new WeakSet,b=class extends y{constructor(...e){super(...e),x(this,u),this.icon="home",this.ariaLabel="",this.variant="standard",this.size="medium",this.shape="round",this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.href="",this.target="",this.rel="",this.__filledValue=!1,this.__focusRingReady=!1,this.__focusRingImportRequested=!1,this.__rippleReady=!1,this.__pendingRippleClick=!1,this.__ensureFocusRing=()=>{this.__focusRingReady||this.__focusRingImportRequested||(this.__focusRingImportRequested=!0,S().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__focusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveState())}))},this.__onFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureFocusRing()},this.__ensureRipple=(t,i=!1)=>{this.__rippleReady||this.disabled||(t&&(this.__pendingRippleEvent=t),i&&(this.__pendingRippleClick=!0),g().then(({ensureRippleReady:a})=>a()).then(()=>{this.disabled||(this.__rippleReady=!0,this.toggleAttribute("data-native-ripple-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__replayRippleState()))}))},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.toggle&&(this.selected=!this.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))),this.__ensureRipple(void 0,!0)}}get filled(){return this.__filledValue}set filled(e){const t=!!e,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("filled",i),this.requestUpdate("iconFilled",i))}get iconFilled(){return this.__filledValue}set iconFilled(e){const t=!!e,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("iconFilled",i),this.requestUpdate("filled",i))}firstUpdated(){f(u,this,m).call(this),this.__syncInteractiveState()}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&f(u,this,m).call(this),(this.__focusRingReady||this.__rippleReady)&&this.updateComplete.then(()=>this.__syncInteractiveState())}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}super.focus(e)}__getNativeControl(){return this.renderRoot.querySelector(".native-icon-button")}__syncInteractiveState(){const e=this.__getNativeControl(),t=this.renderRoot.querySelector("md-focus-ring");t&&e&&(t.control=e,t.visible=e.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&e&&(i.control=e)}async __replayRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__pendingRippleEvent,a=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await g();await c(e,t,i,a),this.__syncInteractiveState()}__effectiveLabel(){return(this.ariaLabel||this.getAttribute("aria-label")||"").trim()||this.__currentIcon()||s}__currentIcon(){return this.toggle?this.selected?this.toggleonicon:this.toggleofficon:this.icon}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__renderControl(e){const t=this.__effectiveLabel(),i=this.getAttribute("aria-controls")??s,a=this.getAttribute("aria-expanded")??s,c=this.toggle?String(this.selected):s,p=this.getAttribute("title")??s;return this.href?d`
|
|
3
3
|
<a
|
|
4
4
|
class="native-icon-button"
|
|
5
5
|
part="button"
|
|
@@ -10,7 +10,7 @@ import{g as s,h as y,m as z,p as r,v as d,y as R}from"../../vendor/vendor.js";im
|
|
|
10
10
|
aria-label=${t}
|
|
11
11
|
aria-controls=${i}
|
|
12
12
|
aria-expanded=${a}
|
|
13
|
-
aria-pressed=${
|
|
13
|
+
aria-pressed=${c}
|
|
14
14
|
aria-disabled=${this.disabled?"true":s}
|
|
15
15
|
tabindex=${this.disabled?"-1":s}
|
|
16
16
|
@click=${this.__onClick}
|
|
@@ -30,7 +30,7 @@ import{g as s,h as y,m as z,p as r,v as d,y as R}from"../../vendor/vendor.js";im
|
|
|
30
30
|
aria-label=${t}
|
|
31
31
|
aria-controls=${i}
|
|
32
32
|
aria-expanded=${a}
|
|
33
|
-
aria-pressed=${
|
|
33
|
+
aria-pressed=${c}
|
|
34
34
|
@click=${this.__onClick}
|
|
35
35
|
@focusin=${this.__onFocusIn}
|
|
36
36
|
@pointerenter=${this.__onPointerInteraction}
|
|
@@ -56,4 +56,4 @@ import{g as s,h as y,m as z,p as r,v as d,y as R}from"../../vendor/vendor.js";im
|
|
|
56
56
|
var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))
|
|
57
57
|
);color:var(--md-filled-tonal-icon-button-selected-icon-color,
|
|
58
58
|
var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be))
|
|
59
|
-
)}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, rgb(15 8 101 / 12%));color:var(--md-filled-icon-button-disabled-icon-color, rgb(15 8 101 / 38%))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, rgb(15 8 101 / 12%))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}`,b);function m(){const
|
|
59
|
+
)}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--md-sys-color-outline, var(--p-20, #0f0865)))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, rgb(15 8 101 / 12%));color:var(--md-filled-icon-button-disabled-icon-color, rgb(15 8 101 / 38%))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, rgb(15 8 101 / 38%));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, rgb(15 8 101 / 12%))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}`,b);function m(){const l=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??l,t=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-icon-button-spacing-block-start",e):this.style.removeProperty("--scb-icon-button-spacing-block-start"),t?this.style.setProperty("--scb-icon-button-spacing-block-end",t):this.style.removeProperty("--scb-icon-button-spacing-block-end"),i?this.style.setProperty("--scb-icon-button-spacing-inline-start",i):this.style.removeProperty("--scb-icon-button-spacing-inline-start"),a?this.style.setProperty("--scb-icon-button-spacing-inline-end",a):this.style.removeProperty("--scb-icon-button-spacing-inline-end")}n([r({type:String})],o.prototype,"icon",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"filled",null);n([r({type:Boolean,attribute:"icon-filled",reflect:!0})],o.prototype,"iconFilled",null);n([r({type:String,attribute:"aria-label"})],o.prototype,"ariaLabel",void 0);n([r({type:String,reflect:!0})],o.prototype,"variant",void 0);n([r({type:String,reflect:!0})],o.prototype,"size",void 0);n([r({type:String,reflect:!0})],o.prototype,"shape",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"toggle",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"selected",void 0);n([r({type:String})],o.prototype,"toggleofficon",void 0);n([r({type:String})],o.prototype,"toggleonicon",void 0);n([r({type:Boolean,reflect:!0})],o.prototype,"disabled",void 0);n([r({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);n([r({type:String})],o.prototype,"href",void 0);n([r({type:String})],o.prototype,"target",void 0);n([r({type:String})],o.prototype,"rel",void 0);o=n([z("scb-icon-button")],o);export{o as ScbIconButton};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{h as z,m as S,p as a,v as n,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js","../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/vendor-lit.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as z,m as S,p as a,v as n,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,r,o){try{customElements.get(i)||e(i,r,o)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var u,R={fromAttribute:c=>c??"",toAttribute:c=>typeof c!="string"||c.trim()===""?null:c},h,y,f;function $(){return h??(h=b(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),h}function k(){return y??(y=b(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),y}function E(){return f??(f=b(()=>import("../../vendor/icon.js").then(c=>c.t),__vite__mapDeps([3,4,5,6]),import.meta.url)),f}var t=(u=class extends z{constructor(...e){super(...e),this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.keyfigure=0,this.subtitle="",this.supportingText="",this.cardHref="",this.href="",this.icon="",this.size="large",this.unit="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.sizing="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onPointerInteraction=i=>{this.__ensureRipple(i)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,$().then(({ensureFocusRingReady:i})=>i()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=i=>{const r=this.__effectiveHref;(i.key==="Enter"||i.key===" ")&&r&&(i.preventDefault(),this.__navigate(r,i))},this.__handleHrefNavigation=i=>{const r=this.__effectiveHref;r&&((!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),!i.target.closest("a")&&this.__navigate(r,i))}}formatNumber(e){if(typeof e=="number")return e.toLocaleString("sv-SE").replace(/\u00A0/g," ");const i=Number(e);return Number.isNaN(i)?String(e):i.toLocaleString("sv-SE").replace(/\u00A0/g," ")}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing(),this.__ensureSlottedIconDeps()}get __effectiveHref(){return(this.cardHref||this.href||"").trim()}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__slottedText(e){return Array.from(this.querySelectorAll(`[slot="${e}"]`)).map(i=>i.textContent?.trim()??"").filter(Boolean).join(" ")}async __ensureSlottedIconDeps(){const e=this.querySelector('[slot="icon"]');e&&(e.localName==="md-icon"||e.querySelector?.("md-icon"))&&await E()}__ensureRipple(e){if(this.__effectiveHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,k().then(({ensureRippleReady:i})=>i()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){const e=this.renderRoot.querySelector("md-ripple"),i=this.renderRoot.querySelector(".scb-keyfigure-card"),r=this.__pendingRippleEvent,o=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:l}=await k();await l(e,i,r,o)}render(){const e=this.__effectiveHref,i=!!e,r=this.formatNumber(this.keyfigure),o=(this.unit||"").trim(),l=o?`${r} ${o}`:r,p=this.__hasSlottedContent("icon"),g=this.__hasSlottedContent("subtitle"),m=this.__hasSlottedContent("supporting-text"),d=g?this.__slottedText("subtitle"):this.subtitle,v=this.supportingText,_=g||!!d,x=m||!!v;return n`
|
|
3
3
|
<div
|
|
4
4
|
class="scb-keyfigure-card ${i?"clickable":""} ${this.size}"
|
|
5
5
|
role=${i?"link":"group"}
|
|
6
6
|
tabindex=${i?"0":"-1"}
|
|
7
|
-
aria-label=${d||
|
|
7
|
+
aria-label=${d||l}
|
|
8
8
|
@click=${i?this.__handleHrefNavigation:null}
|
|
9
9
|
@keydown=${i?this.__onKeyDown:null}
|
|
10
10
|
@focusin=${i?this.__ensureFocusRingOnFocusVisible:null}
|
|
@@ -16,8 +16,8 @@ import{h as z,m as S,p as a,v as n,y as w}from"../../vendor/vendor.js";import"..
|
|
|
16
16
|
|
|
17
17
|
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?n`
|
|
18
18
|
<div class="keyfigure">
|
|
19
|
-
<span class="value" aria-label="${
|
|
20
|
-
${r}${
|
|
19
|
+
<span class="value" aria-label="${l}">
|
|
20
|
+
${r}${o?n`<span class="unit" aria-hidden="true">\u00A0${o}</span>`:""}
|
|
21
21
|
</span>
|
|
22
22
|
${i?n`<span class="card-icon" aria-hidden="true">arrow_forward</span>`:""}
|
|
23
23
|
</div>
|
|
@@ -37,4 +37,4 @@ import{h as z,m as S,p as a,v as n,y as w}from"../../vendor/vendor.js";import"..
|
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
39
|
${i&&this.__focusRingLoaded?n`<md-focus-ring></md-focus-ring>`:""}
|
|
40
|
-
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");e&&(this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size"))}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}mapSpacingToken(e){if(!e)return;const i=String(e).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}__applySpacing(){const e=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??e,r=this.mapSpacingToken(this.spacingBottom)??e,l=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-keyfigure-card-spacing-block-start",i):this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"),r?this.style.setProperty("--scb-keyfigure-card-spacing-block-end",r):this.style.removeProperty("--scb-keyfigure-card-spacing-block-end"),l?this.style.setProperty("--scb-keyfigure-card-spacing-inline-start",l):this.style.removeProperty("--scb-keyfigure-card-spacing-inline-start"),c?this.style.setProperty("--scb-keyfigure-card-spacing-inline-end",c):this.style.removeProperty("--scb-keyfigure-card-spacing-inline-end")}__dispatchNavigateEvents(e,i){const r={href:e},l=new CustomEvent("card-navigate",{detail:r,bubbles:!0,composed:!0,cancelable:!0}),c=new CustomEvent("cardnavigate",{detail:r,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(l)&&this.dispatchEvent(c)}__navigate(e,i){this.__dispatchNavigateEvents(e,i)&&(window.location.href=e)}},u.styles=w`:host{display:block;box-sizing:border-box;position:relative;inline-size:100%;min-inline-size:0;padding:var(--scb-keyfigure-card-focus-ring-gap, 4px);margin-block-start:var(--scb-keyfigure-card-spacing-block-start, 0);margin-block-end:var(--scb-keyfigure-card-spacing-block-end, 0);margin-inline-start:var(--scb-keyfigure-card-spacing-inline-start, 0);margin-inline-end:var(--scb-keyfigure-card-spacing-inline-end, 0);--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-7, 24px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-6, 20px));--scb-keyfigure-card-gap:var(--spacing-4, 12px);--scb-keyfigure-card-keyfigure-gap:var(--spacing-3, 8px);--scb-keyfigure-card-value-size:var(--scb-typography-headline-large-size, var(--md-sys-typescale-headline-large-size, 28px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-large-line-height, var(--md-sys-typescale-headline-large-line-height, 34px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-large-tracking, var(--md-sys-typescale-headline-large-tracking, -0.6px));--scb-keyfigure-card-subtitle-size:var(--scb-typography-title-medium-size, var(--md-sys-typescale-title-medium-size, 18px));--scb-keyfigure-card-subtitle-line-height:var(--scb-typography-title-medium-line-height, var(--md-sys-typescale-title-medium-line-height, 26px));--scb-keyfigure-card-subtitle-letter-spacing:var(--scb-typography-title-medium-tracking, var(--md-sys-typescale-title-medium-tracking, -0.3px));--scb-keyfigure-card-supporting-size:var(--scb-typography-body-large-size, var(--md-sys-typescale-body-large-size, 18px));--scb-keyfigure-card-supporting-line-height:var(--scb-typography-body-large-line-height, var(--md-sys-typescale-body-large-line-height, 26px));--scb-keyfigure-card-supporting-letter-spacing:var(--scb-typography-body-large-tracking, var(--md-sys-typescale-body-large-tracking, -0.3px))}:host([size='medium']),:host([size='small']){--scb-keyfigure-card-keyfigure-gap:var(--spacing-2, 4px)}:host([size='medium']){--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-6, 20px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-5, 16px));--scb-keyfigure-card-gap:var(--spacing-3, 8px);--scb-keyfigure-card-value-size:var(--scb-typography-headline-small-size, var(--md-sys-typescale-headline-small-size, 24px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-small-line-height, var(--md-sys-typescale-headline-small-line-height, 30px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-small-tracking, var(--md-sys-typescale-headline-small-tracking, -0.6px))}:host([size='small']){--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-5, 16px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-4, 12px));--scb-keyfigure-card-gap:var(--spacing-2, 4px);--scb-keyfigure-card-value-size:var(--scb-typography-title-large-size, var(--md-sys-typescale-title-large-size, 20px));--scb-keyfigure-card-value-line-height:var(--scb-typography-title-large-line-height, var(--md-sys-typescale-title-large-line-height, 28px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-title-large-tracking, var(--md-sys-typescale-title-large-tracking, -0.3px))}:host([size='standard']){--scb-keyfigure-card-value-size:var(--scb-typography-headline-large-size, var(--md-sys-typescale-headline-large-size, 28px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-large-line-height, var(--md-sys-typescale-headline-large-line-height, 34px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-large-tracking, var(--md-sys-typescale-headline-large-tracking, -0.6px))}.scb-keyfigure-card,.scb-keyfigure-card .keyfigure,.scb-keyfigure-card .value{font-variant-numeric:proportional-nums!important;font-feature-settings:"tnum"0,"pnum"1}:host([sizing="stretch"]){inline-size:100%;block-size:100%;max-inline-size:none}:host([sizing="content-width"]){display:inline-block;inline-size:auto;block-size:auto}:host([sizing="content-width"]) .scb-keyfigure-card{inline-size:max-content}:host([sizing="content-height"]){inline-size:100%;block-size:auto;max-inline-size:none}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-keyfigure-card-focus-ring-radius, var(--md-sys-shape-corner-large, 16px))}.scb-keyfigure-card:focus-visible+md-focus-ring{display:block}.scb-keyfigure-card{color:var(--md-sys-color-on-surface, #0F0865);font-family:var(--brand-font, "Inter", sans-serif);display:flex;flex-direction:column;gap:var(--scb-keyfigure-card-gap);position:relative;border-radius:var(--md-sys-shape-corner-large, 16px);background:var(--md-sys-color-surface-dim, #F9F8EF);padding-block:var(--scb-keyfigure-card-padding-block);padding-inline:var(--scb-keyfigure-card-padding-inline);box-sizing:border-box;inline-size:100%;max-inline-size:100%;overflow:hidden}.scb-keyfigure-card:focus,.scb-keyfigure-card:focus-visible{outline:0}.keyfigure{display:flex;justify-content:space-between;align-items:center;gap:var(--scb-keyfigure-card-keyfigure-gap);font-size:var(--scb-keyfigure-card-value-size);font-weight:var(--weight-bold, 700);line-height:var(--scb-keyfigure-card-value-line-height);letter-spacing:var(--scb-keyfigure-card-value-letter-spacing)}.keyfigure .unit,.keyfigure .value{white-space:nowrap}.keyfigure .unit{margin-inline-start:.25em}.card-icon,.icon-slot{display:inline-flex;inline-size:fit-content}.card-icon{align-items:center;inline-size:1em;block-size:1em;overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.card-icon.scb-svg-icon{fill:currentColor;font:inherit}.sub-label{font-size:var(--scb-keyfigure-card-subtitle-size);font-weight:var(--weight-semibold, 600);line-height:var(--scb-keyfigure-card-subtitle-line-height);letter-spacing:var(--scb-keyfigure-card-subtitle-letter-spacing);white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:auto;overflow:visible;text-overflow:clip}.sub-label a{color:inherit;text-decoration:none}.sub-label ::slotted(*){color:inherit;font-family:var(--brand-font, "Inter", sans-serif)!important;font-size:var(--scb-keyfigure-card-subtitle-size)!important;font-weight:var(--weight-semibold, 600)!important;line-height:var(--scb-keyfigure-card-subtitle-line-height)!important;letter-spacing:var(--scb-keyfigure-card-subtitle-letter-spacing)!important;margin:0}.supporting-text{font-size:var(--scb-keyfigure-card-supporting-size);line-height:var(--scb-keyfigure-card-supporting-line-height);letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing);white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:auto;overflow:visible;text-overflow:clip}.supporting-text ::slotted(*){color:inherit;font-family:var(--brand-font, "Inter", sans-serif)!important;font-weight:var(--weight-regular, 400)!important;--scb-link-font-size:var(--scb-keyfigure-card-supporting-size);--scb-link-line-height:var(--scb-keyfigure-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing);margin:0}.supporting-text ::slotted(*),.supporting-text ::slotted(a){font-size:var(--scb-keyfigure-card-supporting-size)!important;line-height:var(--scb-keyfigure-card-supporting-line-height)!important;letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing)!important}.supporting-text ::slotted(scb-link){--scb-link-font-size:var(--scb-keyfigure-card-supporting-size);--scb-link-line-height:var(--scb-keyfigure-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing)}.scb-keyfigure-card.clickable{cursor:pointer}:host([size='large']){--scb-keyfigure-card-value-size:var(--scb-typography-display-medium-size, var(--md-sys-typescale-display-medium-size, 36px));--scb-keyfigure-card-value-line-height:var(--scb-typography-display-medium-line-height, var(--md-sys-typescale-display-medium-line-height, 42px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-display-medium-tracking, var(--md-sys-typescale-display-medium-tracking, -0.6px))}`,u);s([a({attribute:"keyfigure"})],t.prototype,"keyfigure",void 0);s([a({type:String,attribute:"subtitle"})],t.prototype,"subtitle",void 0);s([a({type:String,attribute:"supporting-text"})],t.prototype,"supportingText",void 0);s([a({type:String,attribute:"card-href"})],t.prototype,"cardHref",void 0);s([a({type:String,attribute:"href"})],t.prototype,"href",void 0);s([a({type:String})],t.prototype,"icon",void 0);s([a({type:String,reflect:!0})],t.prototype,"size",void 0);s([a({type:String})],t.prototype,"unit",void 0);s([a({type:String,reflect:!0})],t.prototype,"width",void 0);s([a({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",void 0);s([a({type:String,reflect:!0})],t.prototype,"height",void 0);s([a({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",void 0);s([a({type:String,reflect:!0,converter:R})],t.prototype,"sizing",void 0);s([a({type:String,reflect:!0})],t.prototype,"spacing",void 0);s([a({type:String,reflect:!0,attribute:"spacing-top"})],t.prototype,"spacingTop",void 0);s([a({type:String,reflect:!0,attribute:"spacing-bottom"})],t.prototype,"spacingBottom",void 0);s([a({type:String,reflect:!0,attribute:"spacing-left"})],t.prototype,"spacingLeft",void 0);s([a({type:String,reflect:!0,attribute:"spacing-right"})],t.prototype,"spacingRight",void 0);t=s([S("scb-keyfigure-card")],t);
|
|
40
|
+
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");e&&(this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size"))}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}mapSpacingToken(e){if(!e)return;const i=String(e).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}__applySpacing(){const e=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??e,r=this.mapSpacingToken(this.spacingBottom)??e,o=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-keyfigure-card-spacing-block-start",i):this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"),r?this.style.setProperty("--scb-keyfigure-card-spacing-block-end",r):this.style.removeProperty("--scb-keyfigure-card-spacing-block-end"),o?this.style.setProperty("--scb-keyfigure-card-spacing-inline-start",o):this.style.removeProperty("--scb-keyfigure-card-spacing-inline-start"),l?this.style.setProperty("--scb-keyfigure-card-spacing-inline-end",l):this.style.removeProperty("--scb-keyfigure-card-spacing-inline-end")}__dispatchNavigateEvents(e,i){const r={href:e},o=new CustomEvent("card-navigate",{detail:r,bubbles:!0,composed:!0,cancelable:!0}),l=new CustomEvent("cardnavigate",{detail:r,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(o)&&this.dispatchEvent(l)}__navigate(e,i){this.__dispatchNavigateEvents(e,i)&&(window.location.href=e)}},u.styles=w`:host{display:block;box-sizing:border-box;position:relative;inline-size:100%;min-inline-size:0;padding:var(--scb-keyfigure-card-focus-ring-gap, 4px);margin-block-start:var(--scb-keyfigure-card-spacing-block-start, 0);margin-block-end:var(--scb-keyfigure-card-spacing-block-end, 0);margin-inline-start:var(--scb-keyfigure-card-spacing-inline-start, 0);margin-inline-end:var(--scb-keyfigure-card-spacing-inline-end, 0);--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-7, 24px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-6, 20px));--scb-keyfigure-card-gap:var(--spacing-4, 12px);--scb-keyfigure-card-keyfigure-gap:var(--spacing-3, 8px);--scb-keyfigure-card-value-size:var(--scb-typography-headline-large-size, var(--md-sys-typescale-headline-large-size, 28px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-large-line-height, var(--md-sys-typescale-headline-large-line-height, 34px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-large-tracking, var(--md-sys-typescale-headline-large-tracking, -0.6px));--scb-keyfigure-card-subtitle-size:var(--scb-typography-title-medium-size, var(--md-sys-typescale-title-medium-size, 18px));--scb-keyfigure-card-subtitle-line-height:var(--scb-typography-title-medium-line-height, var(--md-sys-typescale-title-medium-line-height, 26px));--scb-keyfigure-card-subtitle-letter-spacing:var(--scb-typography-title-medium-tracking, var(--md-sys-typescale-title-medium-tracking, -0.3px));--scb-keyfigure-card-supporting-size:var(--scb-typography-body-large-size, var(--md-sys-typescale-body-large-size, 18px));--scb-keyfigure-card-supporting-line-height:var(--scb-typography-body-large-line-height, var(--md-sys-typescale-body-large-line-height, 26px));--scb-keyfigure-card-supporting-letter-spacing:var(--scb-typography-body-large-tracking, var(--md-sys-typescale-body-large-tracking, -0.3px))}:host([size='medium']),:host([size='small']){--scb-keyfigure-card-keyfigure-gap:var(--spacing-2, 4px)}:host([size='medium']){--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-6, 20px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-5, 16px));--scb-keyfigure-card-gap:var(--spacing-3, 8px);--scb-keyfigure-card-value-size:var(--scb-typography-headline-small-size, var(--md-sys-typescale-headline-small-size, 24px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-small-line-height, var(--md-sys-typescale-headline-small-line-height, 30px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-small-tracking, var(--md-sys-typescale-headline-small-tracking, -0.6px))}:host([size='small']){--scb-keyfigure-card-padding-block:var(--scb-keyfigure-card-padding, var(--spacing-5, 16px));--scb-keyfigure-card-padding-inline:var(--scb-keyfigure-card-padding, var(--spacing-4, 12px));--scb-keyfigure-card-gap:var(--spacing-2, 4px);--scb-keyfigure-card-value-size:var(--scb-typography-title-large-size, var(--md-sys-typescale-title-large-size, 20px));--scb-keyfigure-card-value-line-height:var(--scb-typography-title-large-line-height, var(--md-sys-typescale-title-large-line-height, 28px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-title-large-tracking, var(--md-sys-typescale-title-large-tracking, -0.3px))}:host([size='standard']){--scb-keyfigure-card-value-size:var(--scb-typography-headline-large-size, var(--md-sys-typescale-headline-large-size, 28px));--scb-keyfigure-card-value-line-height:var(--scb-typography-headline-large-line-height, var(--md-sys-typescale-headline-large-line-height, 34px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-headline-large-tracking, var(--md-sys-typescale-headline-large-tracking, -0.6px))}.scb-keyfigure-card,.scb-keyfigure-card .keyfigure,.scb-keyfigure-card .value{font-variant-numeric:proportional-nums!important;font-feature-settings:"tnum"0,"pnum"1}:host([sizing="stretch"]){inline-size:100%;block-size:100%;max-inline-size:none}:host([sizing="content-width"]){display:inline-block;inline-size:auto;block-size:auto}:host([sizing="content-width"]) .scb-keyfigure-card{inline-size:max-content}:host([sizing="content-height"]){inline-size:100%;block-size:auto;max-inline-size:none}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-keyfigure-card-focus-ring-radius, var(--md-sys-shape-corner-large, 16px))}.scb-keyfigure-card:focus-visible+md-focus-ring{display:block}.scb-keyfigure-card{color:var(--md-sys-color-on-surface, #0F0865);font-family:var(--brand-font, "Inter", sans-serif);display:flex;flex-direction:column;gap:var(--scb-keyfigure-card-gap);position:relative;border-radius:var(--md-sys-shape-corner-large, 16px);background:var(--md-sys-color-surface-dim, #F9F8EF);padding-block:var(--scb-keyfigure-card-padding-block);padding-inline:var(--scb-keyfigure-card-padding-inline);box-sizing:border-box;inline-size:100%;max-inline-size:100%;overflow:hidden}.scb-keyfigure-card:focus,.scb-keyfigure-card:focus-visible{outline:0}.keyfigure{display:flex;justify-content:space-between;align-items:center;gap:var(--scb-keyfigure-card-keyfigure-gap);font-size:var(--scb-keyfigure-card-value-size);font-weight:var(--weight-bold, 700);line-height:var(--scb-keyfigure-card-value-line-height);letter-spacing:var(--scb-keyfigure-card-value-letter-spacing)}.keyfigure .unit,.keyfigure .value{white-space:nowrap}.keyfigure .unit{margin-inline-start:.25em}.card-icon,.icon-slot{display:inline-flex;inline-size:fit-content}.card-icon{align-items:center;inline-size:1em;block-size:1em;overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.card-icon.scb-svg-icon{fill:currentColor;font:inherit}.sub-label{font-size:var(--scb-keyfigure-card-subtitle-size);font-weight:var(--weight-semibold, 600);line-height:var(--scb-keyfigure-card-subtitle-line-height);letter-spacing:var(--scb-keyfigure-card-subtitle-letter-spacing);white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:auto;overflow:visible;text-overflow:clip}.sub-label a{color:inherit;text-decoration:none}.sub-label ::slotted(*){color:inherit;font-family:var(--brand-font, "Inter", sans-serif)!important;font-size:var(--scb-keyfigure-card-subtitle-size)!important;font-weight:var(--weight-semibold, 600)!important;line-height:var(--scb-keyfigure-card-subtitle-line-height)!important;letter-spacing:var(--scb-keyfigure-card-subtitle-letter-spacing)!important;margin:0}.supporting-text{font-size:var(--scb-keyfigure-card-supporting-size);line-height:var(--scb-keyfigure-card-supporting-line-height);letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing);white-space:normal;word-break:normal;overflow-wrap:normal;hyphens:auto;overflow:visible;text-overflow:clip}.supporting-text ::slotted(*){color:inherit;font-family:var(--brand-font, "Inter", sans-serif)!important;font-weight:var(--weight-regular, 400)!important;--scb-link-font-size:var(--scb-keyfigure-card-supporting-size);--scb-link-line-height:var(--scb-keyfigure-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing);margin:0}.supporting-text ::slotted(*),.supporting-text ::slotted(a){font-size:var(--scb-keyfigure-card-supporting-size)!important;line-height:var(--scb-keyfigure-card-supporting-line-height)!important;letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing)!important}.supporting-text ::slotted(scb-link){--scb-link-font-size:var(--scb-keyfigure-card-supporting-size);--scb-link-line-height:var(--scb-keyfigure-card-supporting-line-height);--scb-link-letter-spacing:var(--scb-keyfigure-card-supporting-letter-spacing)}.scb-keyfigure-card.clickable{cursor:pointer}:host([size='large']){--scb-keyfigure-card-value-size:var(--scb-typography-display-medium-size, var(--md-sys-typescale-display-medium-size, 36px));--scb-keyfigure-card-value-line-height:var(--scb-typography-display-medium-line-height, var(--md-sys-typescale-display-medium-line-height, 42px));--scb-keyfigure-card-value-letter-spacing:var(--scb-typography-display-medium-tracking, var(--md-sys-typescale-display-medium-tracking, -0.6px))}`,u);s([a({attribute:"keyfigure"})],t.prototype,"keyfigure",void 0);s([a({type:String,attribute:"subtitle"})],t.prototype,"subtitle",void 0);s([a({type:String,attribute:"supporting-text"})],t.prototype,"supportingText",void 0);s([a({type:String,attribute:"card-href"})],t.prototype,"cardHref",void 0);s([a({type:String,attribute:"href"})],t.prototype,"href",void 0);s([a({type:String})],t.prototype,"icon",void 0);s([a({type:String,reflect:!0})],t.prototype,"size",void 0);s([a({type:String})],t.prototype,"unit",void 0);s([a({type:String,reflect:!0})],t.prototype,"width",void 0);s([a({type:String,reflect:!0,attribute:"max-width"})],t.prototype,"maxWidth",void 0);s([a({type:String,reflect:!0})],t.prototype,"height",void 0);s([a({type:String,reflect:!0,attribute:"max-height"})],t.prototype,"maxHeight",void 0);s([a({type:String,reflect:!0,converter:R})],t.prototype,"sizing",void 0);s([a({type:String,reflect:!0})],t.prototype,"spacing",void 0);s([a({type:String,reflect:!0,attribute:"spacing-top"})],t.prototype,"spacingTop",void 0);s([a({type:String,reflect:!0,attribute:"spacing-bottom"})],t.prototype,"spacingBottom",void 0);s([a({type:String,reflect:!0,attribute:"spacing-left"})],t.prototype,"spacingLeft",void 0);s([a({type:String,reflect:!0,attribute:"spacing-right"})],t.prototype,"spacingRight",void 0);t=s([S("scb-keyfigure-card")],t);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as n,h as f,m as w,p as a,v as o,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as g}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,r,l){try{customElements.get(t)||s(t,r,l)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var u,b,k="data-scb-list-managed-tabindex";function m(){return u??(u=g(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),u}function v(){return b??(b=g(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),b}var i=class extends f{constructor(...s){super(...s),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingCheckboxAriaLabel="",this.trailingSwitchLabel="",this.trailingSwitchAriaLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.size="",this.density=0,this.noDivider=!1,this.__managedTabindex=!1,this.__scbCheckboxLoaded=!1,this.__scbSwitchLoaded=!1,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__focusVisibleRaf=null,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".row"),l=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await v();await c(t,r,l,d)},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onFocusIn=()=>{this.__scheduleFocusVisibleSync()},this.__onFocusOut=()=>{this.__scheduleFocusVisibleSync()},this.__onPointerDown=()=>{this.toggleAttribute("data-focus-visible",!1)},this.__onLazyFocusRingKeydown=t=>{t.key==="Tab"&&m().then(({ensureFocusRingOnTab:r})=>r(t))},this.onRowClick=()=>{if(this.disabled||(this.type==="link"&&!this.disabled&&(!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.type==="link"&&(this.href||this.itemHref)))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),r=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),r){const l=!this.trailingSwitchSelected;r.selected=l,this.__setTrailingSwitchSelected(l,!0)}},this.__onTrailingSwitchChange=t=>{const r=t.detail?.selected,l=typeof r=="boolean"?r:t.currentTarget?.selected??!1;this.__setTrailingSwitchSelected(l,!0)},this.__onKeydown=t=>{if(!t.defaultPrevented&&!this.disabled&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const r=this.shadowRoot?.querySelector("a[href]");if(r){t.preventDefault(),r.click();return}}t.preventDefault(),this.onRowClick()}}}static get styles(){return x`:host{display:block;border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);margin-bottom:calc(var(--stroke-border, 1px)*-1);outline:0;position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font)}:host([hidden]){display:none}:host([no-divider]){--stroke-border:0px}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px))}:host([data-focus-visible]) md-focus-ring{display:block}.row{display:flex;align-items:center;gap:var(--spacing-5, 16px);padding-block:var(--spacing-7, 24px);padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-none, 0px);-webkit-tap-highlight-color:transparent;position:relative;overflow:hidden;cursor:default}:host([type="link"]) .row{cursor:pointer}:host([density="-2"]) .row,:host([size="medium"]) .row,:host-context([data-density="-2"]) .row,:host-context(scb-card[type="list"][size="medium"]) .row,:host-context(scb-list-card[size="medium"]) .row,:host-context(scb-list[size="medium"]) .row{padding-block:var(--spacing-5, 16px)}:host([density="-4"]) .row,:host([size="small"]) .row,:host-context([data-density="-4"]) .row,:host-context(scb-card[type="list"][size="small"]) .row,:host-context(scb-list-card[size="small"]) .row,:host-context(scb-list[size="small"]) .row{padding-block:var(--spacing-4, 12px)}:host([size="large"]) .row,:host-context([data-density="0"]) .row,:host-context(scb-card[type="list"][size="large"]) .row,:host-context(scb-list-card[size="large"]) .row,:host-context(scb-list[size="large"]) .row{padding-block:var(--spacing-7, 24px)}md-ripple{border-radius:inherit;inset:0;position:absolute;pointer-events:none}.material-icon{display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-icon.scb-svg-icon{fill:currentColor;font:inherit}.leading{align-self:center;display:grid;place-items:center}.img{width:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));height:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));object-fit:contain;border-radius:var(--radius-s, 8px);filter:var(--scb-list-leading-image-filter, none)}.texts{display:grid;gap:var(--spacing-1, 2px);min-inline-size:0}.overline{font-size:var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size));line-height:var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height));font-weight:var(--weight-regular);letter-spacing:var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking));color:var(--md-sys-color-on-surface-variant)}.label,.overline,.supporting-text{font-family:var(--brand-font)}.label{font-size:var(--scb-typography-title-large-size, var(--md-sys-typescale-title-large-size));line-height:var(--scb-typography-title-large-line-height, var(--md-sys-typescale-title-large-line-height));font-weight:var(--weight-semibold);letter-spacing:var(--scb-typography-title-large-tracking, var(--md-sys-typescale-title-large-tracking));color:var(--md-sys-color-on-surface)}.supporting-text{font-size:var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size));line-height:var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height));font-weight:var(--weight-regular);letter-spacing:var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking));color:var(--md-sys-color-on-surface-variant)}.label ::slotted(*),.supporting-text ::slotted(*){color:inherit!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;font-weight:inherit!important;letter-spacing:inherit!important;margin-block:0!important;margin-inline:0!important}.trailing{margin-left:auto;align-self:center;display:flex}.trailing.trailing-switch{justify-content:flex-end}.trailing scb-checkbox{margin-inline-end:var(--scb-list-trailing-checkbox-nudge)}:host([trailing-variant="checkbox"]) .row,:host([trailing-variant="switch"]) .row{cursor:pointer}:host([disabled]) .row{cursor:default}.link{text-decoration:none;color:inherit;display:flex;width:100%;gap:12px}`}async firstUpdated(){await this.__ensureDepsLoaded(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("focusout",this.__onFocusOut),this.addEventListener("pointerdown",this.__onPointerDown,!0),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.addEventListener("keydown",this.__onKeydown)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("focusout",this.__onFocusOut),this.removeEventListener("pointerdown",this.__onPointerDown,!0),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.removeEventListener("keydown",this.__onKeydown),this.__focusVisibleRaf!==null&&(cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=null),super.disconnectedCallback()}updated(s){super.updated(s),(s.has("leading")||s.has("leadingVariant")||s.has("trailing")||s.has("trailingVariant")||s.has("type")||s.has("target"))&&this.__ensureDepsLoaded()}async __ensureDepsLoaded(){this.trailing&&this.trailingVariant==="checkbox"&&!this.__scbCheckboxLoaded&&(await g(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19]),import.meta.url),this.__scbCheckboxLoaded=!0),this.trailing&&this.trailingVariant==="switch"&&!this.__scbSwitchLoaded&&(await g(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([20,5,7,8,9,1,10,11,12,13,14,15,16,17,18]),import.meta.url),this.__scbSwitchLoaded=!0)}__ensureRipple(s){if(!(this.type!=="link"||this.disabled)){if(s&&(this.__pendingRippleEvent=s),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,v().then(({ensureRippleReady:t})=>t()).then(()=>{this.disabled||(this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple()))}))}}__scheduleFocusVisibleSync(){this.__focusVisibleRaf!==null&&cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=requestAnimationFrame(()=>{this.__focusVisibleRaf=null;const s=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=this.matches(":focus-visible")||s instanceof HTMLElement&&s.matches(":focus-visible");this.toggleAttribute("data-focus-visible",t),t&&this.__ensureFocusRing()})}__ensureFocusRing(){this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,m().then(({ensureFocusRingReady:s})=>s()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}__setTrailingSwitchSelected(s,t){this.trailingSwitchSelected=s,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:s},bubbles:!0,composed:!0}))}render(){const s=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?o`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>`:n;case"avatar":return o`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js","../scb-checkbox/scb-checkbox.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateFieldGet2.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/md-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/icon.js","../../vendor/delegate.js","../../vendor/form-associated.js","../../vendor/redispatch-event.js","../../vendor/ripple.js","../../vendor/validator.js","../../vendor/checkbox-validator.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as n,h as f,m as w,p as a,v as o,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as p}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,r,l){try{customElements.get(t)||s(t,r,l)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var u,b,k="data-scb-list-managed-tabindex";function m(){return u??(u=p(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),u}function v(){return b??(b=p(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),b}var i=class extends f{constructor(...s){super(...s),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingCheckboxAriaLabel="",this.trailingSwitchLabel="",this.trailingSwitchAriaLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.size="",this.density=0,this.noDivider=!1,this.__managedTabindex=!1,this.__scbCheckboxLoaded=!1,this.__scbSwitchLoaded=!1,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__focusVisibleRaf=null,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".row"),l=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await v();await c(t,r,l,d)},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onFocusIn=()=>{this.__scheduleFocusVisibleSync()},this.__onFocusOut=()=>{this.__scheduleFocusVisibleSync()},this.__onPointerDown=()=>{this.toggleAttribute("data-focus-visible",!1)},this.__onLazyFocusRingKeydown=t=>{t.key==="Tab"&&m().then(({ensureFocusRingOnTab:r})=>r(t))},this.onRowClick=()=>{if(this.disabled||(this.type==="link"&&!this.disabled&&(!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.type==="link"&&(this.href||this.itemHref)))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),r=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),r){const l=!this.trailingSwitchSelected;r.selected=l,this.__setTrailingSwitchSelected(l,!0)}},this.__onTrailingSwitchChange=t=>{const r=t.detail?.selected,l=typeof r=="boolean"?r:t.currentTarget?.selected??!1;this.__setTrailingSwitchSelected(l,!0)},this.__onKeydown=t=>{if(!t.defaultPrevented&&!this.disabled&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const r=this.shadowRoot?.querySelector("a[href]");if(r){t.preventDefault(),r.click();return}}t.preventDefault(),this.onRowClick()}}}static get styles(){return x`:host{display:block;border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);margin-bottom:calc(var(--stroke-border, 1px)*-1);outline:0;position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font)}:host([hidden]){display:none}:host([no-divider]){--stroke-border:0px}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px))}:host([data-focus-visible]) md-focus-ring{display:block}.row{display:flex;align-items:center;gap:var(--spacing-5, 16px);padding-block:var(--spacing-7, 24px);padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-none, 0px);-webkit-tap-highlight-color:transparent;position:relative;overflow:hidden;cursor:default}:host([type="link"]) .row{cursor:pointer}:host([density="-2"]) .row,:host([size="medium"]) .row,:host-context([data-density="-2"]) .row,:host-context(scb-card[type="list"][size="medium"]) .row,:host-context(scb-list-card[size="medium"]) .row,:host-context(scb-list[size="medium"]) .row{padding-block:var(--spacing-5, 16px)}:host([density="-4"]) .row,:host([size="small"]) .row,:host-context([data-density="-4"]) .row,:host-context(scb-card[type="list"][size="small"]) .row,:host-context(scb-list-card[size="small"]) .row,:host-context(scb-list[size="small"]) .row{padding-block:var(--spacing-4, 12px)}:host([size="large"]) .row,:host-context([data-density="0"]) .row,:host-context(scb-card[type="list"][size="large"]) .row,:host-context(scb-list-card[size="large"]) .row,:host-context(scb-list[size="large"]) .row{padding-block:var(--spacing-7, 24px)}md-ripple{border-radius:inherit;inset:0;position:absolute;pointer-events:none}.material-icon{display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-icon.scb-svg-icon{fill:currentColor;font:inherit}.leading{align-self:center;display:grid;place-items:center}.img{width:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));height:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));object-fit:contain;border-radius:var(--radius-s, 8px);filter:var(--scb-list-leading-image-filter, none)}.texts{display:grid;gap:var(--spacing-1, 2px);min-inline-size:0}.overline{font-size:var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size));line-height:var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height));font-weight:var(--weight-regular);letter-spacing:var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking));color:var(--md-sys-color-on-surface-variant)}.label,.overline,.supporting-text{font-family:var(--brand-font)}.label{font-size:var(--scb-typography-title-large-size, var(--md-sys-typescale-title-large-size));line-height:var(--scb-typography-title-large-line-height, var(--md-sys-typescale-title-large-line-height));font-weight:var(--weight-semibold);letter-spacing:var(--scb-typography-title-large-tracking, var(--md-sys-typescale-title-large-tracking));color:var(--md-sys-color-on-surface)}.supporting-text{font-size:var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size));line-height:var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height));font-weight:var(--weight-regular);letter-spacing:var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking));color:var(--md-sys-color-on-surface-variant)}.label ::slotted(*),.supporting-text ::slotted(*){color:inherit!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;font-weight:inherit!important;letter-spacing:inherit!important;margin-block:0!important;margin-inline:0!important}.trailing{margin-left:auto;align-self:center;display:flex}.trailing.trailing-switch{justify-content:flex-end}.trailing scb-checkbox{margin-inline-end:var(--scb-list-trailing-checkbox-nudge)}:host([trailing-variant="checkbox"]) .row,:host([trailing-variant="switch"]) .row{cursor:pointer}:host([disabled]) .row{cursor:default}.link{text-decoration:none;color:inherit;display:flex;width:100%;gap:12px}`}async firstUpdated(){await this.__ensureDepsLoaded(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("focusout",this.__onFocusOut),this.addEventListener("pointerdown",this.__onPointerDown,!0),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.addEventListener("keydown",this.__onKeydown)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("focusout",this.__onFocusOut),this.removeEventListener("pointerdown",this.__onPointerDown,!0),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.removeEventListener("keydown",this.__onKeydown),this.__focusVisibleRaf!==null&&(cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=null),super.disconnectedCallback()}updated(s){super.updated(s),(s.has("leading")||s.has("leadingVariant")||s.has("trailing")||s.has("trailingVariant")||s.has("type")||s.has("target"))&&this.__ensureDepsLoaded()}async __ensureDepsLoaded(){this.trailing&&this.trailingVariant==="checkbox"&&!this.__scbCheckboxLoaded&&(await p(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),this.__scbCheckboxLoaded=!0),this.trailing&&this.trailingVariant==="switch"&&!this.__scbSwitchLoaded&&(await p(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([20,4,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),this.__scbSwitchLoaded=!0)}__ensureRipple(s){if(!(this.type!=="link"||this.disabled)){if(s&&(this.__pendingRippleEvent=s),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,v().then(({ensureRippleReady:t})=>t()).then(()=>{this.disabled||(this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple()))}))}}__scheduleFocusVisibleSync(){this.__focusVisibleRaf!==null&&cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=requestAnimationFrame(()=>{this.__focusVisibleRaf=null;const s=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=this.matches(":focus-visible")||s instanceof HTMLElement&&s.matches(":focus-visible");this.toggleAttribute("data-focus-visible",t),t&&this.__ensureFocusRing()})}__ensureFocusRing(){this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,m().then(({ensureFocusRingReady:s})=>s()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}__setTrailingSwitchSelected(s,t){this.trailingSwitchSelected=s,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:s},bubbles:!0,composed:!0}))}render(){const s=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?o`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>`:n;case"avatar":return o`
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<scb-avatar
|
|
5
5
|
label=${this.avatarLabel}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/ripple.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/md-focus-ring.js","../../vendor/icon.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f as _,g as h,h as g,m as f,p as a,v as c,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import"
|
|
2
|
+
import{f as _,g as h,h as g,m as f,p as a,v as c,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import"../scb-chevron/scb-chevron.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,d){try{customElements.get(t)||e(t,i,d)}catch(p){var o=String(p||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var u,l,b={fromAttribute:r=>r==null?!1:!/^(false|0|off|no)$/i.test(r),toAttribute:r=>r?"":null},n=(u=class extends g{constructor(...e){super(...e),this.label="",this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon="",this.itemHref="",this.hasChildren=!1,this.loading=!1,this.showSubmenuLabel="Visa undermeny för",this.hideSubmenuLabel="Dölj undermeny för",this.loadingLabel="Laddar…",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=t=>{t&&t.stopPropagation(),this.__isExpandable&&this.__setExpanded(!this.expanded)},this._onButtonClick=t=>{t.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=t=>{const i=this.__keyboardItems(),d=i.indexOf(this);switch(t.key){case"ArrowDown":{t.preventDefault();const o=i[d+1]||i[0];this.__focusMenuItem(o);break}case"ArrowUp":{t.preventDefault();const o=i[d-1]||i[i.length-1];this.__focusMenuItem(o);break}case"Home":{t.preventDefault();const o=i[0];this.__focusMenuItem(o);break}case"End":{t.preventDefault();const o=i[i.length-1];this.__focusMenuItem(o);break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}get __isExpandable(){return this.hasSlotContent||this.hasChildren}__submenuButtonLabel(){const e=this.expanded?this.hideSubmenuLabel:this.showSubmenuLabel;return this.label?`${e} ${this.label}`:e}async __ensureDepsLoaded(){l.__rippleLoaded||(await m(()=>import("../../vendor/ripple.js").then(e=>e.t),__vite__mapDeps([0,1,2,3,4]),import.meta.url),l.__rippleLoaded=!0),l.__focusRingLoaded||(await m(()=>import("../../vendor/md-focus-ring.js").then(e=>e.t),__vite__mapDeps([5,1,2,3,4]),import.meta.url),l.__focusRingLoaded=!0),this.leadingIcon&&!l.__iconLoaded&&(await m(()=>import("../../vendor/icon.js").then(e=>e.t),__vite__mapDeps([6,1,2,4]),import.meta.url),l.__iconLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.some(t=>t.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const t=e.target.assignedElements({flatten:!0});this.hasSlotContent=t.some(i=>i.tagName==="SCB-SUB-MENU")}__setExpanded(e){if(!this.__isExpandable)return;this.expanded=e;const t={item:this,expanded:e,hasChildren:this.hasChildren,hasSlotContent:this.hasSlotContent,loading:this.loading,lazy:this.hasChildren&&!this.hasSlotContent};this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbmenuexpand",{bubbles:!0,composed:!0,detail:t}))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}})),this.dispatchEvent(new CustomEvent("scbmenuselect",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded(),this.__applyInert()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),(e.has("hasSlotContent")&&this.hasSlotContent||e.has("hasChildren")&&this.hasChildren||e.has("loading")&&this.loading)&&this.__ensureDepsLoaded(),(e.has("expanded")||e.has("hasChildren")||e.has("loading"))&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.loading?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"),this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,t=!!this.itemHref,i=this.__isExpandable;return c`
|
|
3
3
|
<div class="scb-menu-item">
|
|
4
4
|
<div class="scb-menu-item-label" ?selected=${this.selected} ?no-highlight-selected=${this.noHighlightSelected}>
|
|
5
5
|
${t?c`
|