scb-wc 0.1.136 → 0.1.138
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/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-collapse/scb-collapse.js +54 -46
- package/mvc/components/scb-header/scb-header.js +19 -17
- package/mvc/components/scb-search/scb-search.js +3 -3
- package/mvc/components/scb-select/scb-select.js +2 -2
- package/package.json +2 -2
- package/scb-button/scb-button.js +10 -2
- package/scb-collapse/scb-collapse.js +157 -53
- package/scb-components/scb-button/scb-button.d.ts +2 -2
- package/scb-components/scb-collapse/scb-collapse.d.ts +9 -0
- package/scb-components/scb-search/scb-search.d.ts +1 -1
- package/scb-header/scb-header.js +29 -11
- package/scb-search/scb-search.js +20 -7
- package/scb-select/scb-select.js +3 -2
- package/scb-wc.bundle.js +1014 -910
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
import{f as A,g as w,h as R,m as N,p as
|
|
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 k}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,s){try{customElements.get(t)||e(t,r,s)}catch(o){var i=String(o||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var T,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] {
|
|
5
5
|
display: block;
|
|
@@ -52,7 +52,7 @@ import{f as A,g as w,h as R,m as N,p as c,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()),s=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},i=n=>{s(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,f=e(n.getAttribute("spacing-bottom"))??p,y=e(n.getAttribute("padding-inline")),_=e(n.getAttribute("padding-inline-expanded"))??y;h?n.style.setProperty("--scb-header-spacing-block-start",h):n.style.removeProperty("--scb-header-spacing-block-start"),f?n.style.setProperty("--scb-header-spacing-block-end",f):n.style.removeProperty("--scb-header-spacing-block-end"),y?n.style.setProperty("--scb-header-padding-inline",y):n.style.removeProperty("--scb-header-padding-inline"),_?n.style.setProperty("--scb-header-padding-inline-expanded",_):n.style.removeProperty("--scb-header-padding-inline-expanded");const d=(n.getAttribute("logo-width")??"").trim();d?n.style.setProperty("--scb-header-pre-logo-w",d):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(i);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"&&i(h);continue}if(p.type==="childList"){const h=[...Array.from(p.addedNodes),...Array.from(p.removedNodes)];for(const f of h){if(!(f instanceof HTMLElement))continue;if(f.tagName.toLowerCase()==="scb-header"){i(f);continue}const y=f.closest?.("scb-header");y&&i(y)}}}});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)},P={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},W={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},a=(T=class extends R{constructor(){super(),this.maxWidth="1440px",this.size="medium",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 s=r?.item,i=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",o=s?s.getAttribute("item-href")??s.getAttribute("href")??"":"";String(i||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),s=[],i=[],o=[];let u=-1,n=!1;const p=d=>({label:d.getAttribute("label")??"",href:d.getAttribute("href")??void 0,icon:d.getAttribute("icon")??void 0}),h=d=>{d.hasAttribute("role")&&d.removeAttribute("role"),d.hasAttribute("hidden")||d.setAttribute("hidden",""),d.getAttribute("aria-hidden")!=="true"&&d.setAttribute("aria-hidden","true")};for(const d of r){const x=d.tagName.toLowerCase();if(this._isDrawerCloseNode(d)){this._syncDrawerCloseNode(d);continue}if(x==="scb-header-tab"){h(d);const g=d.getAttribute("label")??"",v=d.getAttribute("href"),C=v&&v.trim()!==""?v:void 0;(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&u===-1&&(u=s.length),s.push({kind:"tab",label:g,href:C});continue}if(x==="scb-badge"){const g=d.querySelector("scb-dropdown");if(g){n=!0;const v=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&u===-1&&(u=s.length);const C=`scb-header-tab-${s.length}`;d.getAttribute("slot")!==C&&d.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:C,label:v});continue}}if(x==="scb-dropdown"){n=!0;const g=d.getAttribute("label")??"";(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&u===-1&&(u=s.length);const v=`scb-header-tab-${s.length}`;d.getAttribute("slot")!==v&&d.setAttribute("slot",v),d.hasAttribute("as-tab")||d.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:v,label:g});continue}if(x==="scb-header-utility"){h(d),i.push({label:d.getAttribute("label")??"",href:d.getAttribute("href")??"#",target:d.getAttribute("target")??void 0});continue}if(x==="scb-header-menu-group"){h(d);const g={label:d.getAttribute("label")??"",icon:d.getAttribute("icon")??void 0,children:[]};d.querySelectorAll("scb-header-menu-item").forEach(v=>g.children.push(p(v))),o.push(g);continue}if(x==="scb-header-menu-item"){h(d),o.push(p(d));continue}d.hasAttribute("slot")||h(d)}const f=!this._sameNavItems(this._slotNavItems,s),y=!this._sameUtilityItems(this._slotUtils,i),_=!this._sameMenuNodes(this._slotMenu,o);f&&(this._slotNavItems=s),y&&(this._slotUtils=i),_&&(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 s=window.innerWidth,i=t.clientWidth,o=this._overflows(this._util),u=this._tabsOverflows(),n=s<this.BP_MD||o||u;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const f=getComputedStyle(this._searchWrap),y=Math.max(this._num(f.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)),d=this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;p=r.getBoundingClientRect().width+_+y+_+d+8>i+.5}this._setHideSearch(p);let h=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const f=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+f+y;this._hideLogoText?h=!(i>=this._logoTextUnlockAt):_>i+.5&&(h=!0,this._logoTextUnlockAt=i+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 s=r.tagName.toLowerCase()==="a";if(s&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=r.getAttribute("data-index"),o=i!=null?Number(i):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))&&s&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,s=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(s==null||!Number.isFinite(s))return;const i=this._getNavItems();s<0||s>=i.length||i[s]?.kind==="dropdown"&&(this.activeTab=s,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:s,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 s=this._getNavItems();if(!s.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let o=Math.max(0,Math.min(s.length-1,i));r==="ArrowRight"?o=(o+1)%s.length:r==="ArrowLeft"?o=(o-1+s.length)%s.length:r==="Home"?o=0:r==="End"&&(o=s.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(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=i=>{const o=new MutationObserver(u=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(i,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const o of i){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(f=>{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))}}},s=new MutationObserver(i=>{let o=!1;for(const u of i)if(u.type==="childList"){o=!0;break}o&&r(),this._scheduleHarvest()});this._slotMo=s,s.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 s=e[r],i=t[r];if(!s||!i||s.kind!==i.kind||s.label!==i.label)return!1;if(s.kind==="tab"&&i.kind==="tab"){if((s.href??"")!==(i.href??""))return!1}else if(s.kind==="dropdown"&&i.kind==="dropdown"&&s.slotName!==i.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 s=e[r],i=t[r];if(!s||!i||s.label!==i.label||s.href!==i.href||(s.target??"")!==(i.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 s=e[r],i=t[r];if(!s||!i||s.label!==i.label||(s.href??"")!==(i.href??"")||(s.icon??"")!==(i.icon??"")||!this._sameMenuNodes(s.children??[],i.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 s=(e.getAttribute("icon")??"").trim().toLowerCase(),i=(e.getAttribute("aria-label")??"").trim().toLowerCase();return s==="close"||i.includes("stäng")||i.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 s=r.left;for(const i of t){const o=i.getBoundingClientRect();o.width<=0||o.right>s&&(s=o.right)}return s-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=k(()=>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([k(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([2,3,4,5,6,7]),import.meta.url),k(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([8,7,3,4,5,6,9,1,10,11,12]),import.meta.url),k(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([13,3,1,4,14,15,5,16,17,0]),import.meta.url),k(()=>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")?k(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?k(()=>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")?k(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,3,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?k(()=>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")?k(()=>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=k(()=>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 s=String(t);r.getAttribute("data-index")!==s&&r.setAttribute("data-index",s),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const i=this.size,o=r;o?.size!==i&&(o.size=i),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 s=r.getAttribute("data-index");if(s==null)continue;const i=Number(s);if(Number.isFinite(i))return i}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",s=(this.menuButtonLabel??"").trim()||"Meny",i=(this.menuOpenLabel??"").trim()||s,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()),s=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},i=n=>{s(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,f=e(n.getAttribute("spacing-bottom"))??p,y=e(n.getAttribute("padding-inline")),_=e(n.getAttribute("padding-inline-expanded"))??y;h?n.style.setProperty("--scb-header-spacing-block-start",h):n.style.removeProperty("--scb-header-spacing-block-start"),f?n.style.setProperty("--scb-header-spacing-block-end",f):n.style.removeProperty("--scb-header-spacing-block-end"),y?n.style.setProperty("--scb-header-padding-inline",y):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(i);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"&&i(h);continue}if(p.type==="childList"){const h=[...Array.from(p.addedNodes),...Array.from(p.removedNodes)];for(const f of h){if(!(f instanceof HTMLElement))continue;if(f.tagName.toLowerCase()==="scb-header"){i(f);continue}const y=f.closest?.("scb-header");y&&i(y)}}}});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)},z={fromAttribute:b=>b==null?!1:!/^(false|0|off|no)$/i.test(b),toAttribute:b=>b?"":null},W={fromAttribute:b=>b==="small"||b==="large"?b:"medium",toAttribute:b=>{const e=String(b??"");return e==="small"||e==="large"?e:null}},a=(T=class extends R{constructor(){super(),this.maxWidth="1440px",this.size="medium",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 s=r?.item,i=typeof r?.href=="string"?r.href:typeof r?.itemHref=="string"?r.itemHref:typeof r?.item_href=="string"?r.item_href:"",o=s?s.getAttribute("item-href")??s.getAttribute("href")??"":"";String(i||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),s=[],i=[],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")??"",v=c.getAttribute("href"),C=v&&v.trim()!==""?v:void 0;(c.hasAttribute("selected")||c.getAttribute("selected")==="true"||c.getAttribute("active")==="true"||c.getAttribute("aria-current")==="page")&&u===-1&&(u=s.length),s.push({kind:"tab",label:g,href:C});continue}if(x==="scb-badge"){const g=c.querySelector("scb-dropdown");if(g){n=!0;const v=g.getAttribute("label")??"";(g.hasAttribute("selected")||g.getAttribute("selected")==="true"||g.getAttribute("active")==="true"||g.getAttribute("aria-current")==="page")&&u===-1&&(u=s.length);const C=`scb-header-tab-${s.length}`;c.getAttribute("slot")!==C&&c.setAttribute("slot",C),g.hasAttribute("slot")&&g.removeAttribute("slot"),g.hasAttribute("as-tab")||g.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:C,label:v});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=s.length);const v=`scb-header-tab-${s.length}`;c.getAttribute("slot")!==v&&c.setAttribute("slot",v),c.hasAttribute("as-tab")||c.setAttribute("as-tab",""),s.push({kind:"dropdown",slotName:v,label:g});continue}if(x==="scb-header-utility"){h(c),i.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(v=>g.children.push(p(v))),o.push(g);continue}if(x==="scb-header-menu-item"){h(c),o.push(p(c));continue}c.hasAttribute("slot")||h(c)}const f=!this._sameNavItems(this._slotNavItems,s),y=!this._sameUtilityItems(this._slotUtils,i),_=!this._sameMenuNodes(this._slotMenu,o);f&&(this._slotNavItems=s),y&&(this._slotUtils=i),_&&(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 s=window.innerWidth,i=t.clientWidth,o=this._overflows(this._util),u=this._tabsOverflows(),n=s<this.BP_MD||o||u;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const f=getComputedStyle(this._searchWrap),y=Math.max(this._num(f.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||s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;p=r.getBoundingClientRect().width+_+y+_+c+8>i+.5}this._setHideSearch(p);let h=!1;if(this.showDrawer&&(this.alwaysShowMenuButton||s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const f=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+f+y;this._hideLogoText?h=!(i>=this._logoTextUnlockAt):_>i+.5&&(h=!0,this._logoTextUnlockAt=i+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 s=r.tagName.toLowerCase()==="a";if(s&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const i=r.getAttribute("data-index"),o=i!=null?Number(i):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))&&s&&t.preventDefault()},this._onDropdownTabActivate=t=>{const r=t.detail?.dataIndex,s=typeof r=="number"?r:typeof r=="string"?Number(r):this._readTabIndexFromEvent(t);if(s==null||!Number.isFinite(s))return;const i=this._getNavItems();s<0||s>=i.length||i[s]?.kind==="dropdown"&&(this.activeTab=s,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:s,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 s=this._getNavItems();if(!s.length)return;const i=this._readTabIndexFromEvent(t);if(i==null)return;let o=Math.max(0,Math.min(s.length-1,i));r==="ArrowRight"?o=(o+1)%s.length:r==="ArrowLeft"?o=(o-1+s.length)%s.length:r==="Home"?o=0:r==="End"&&(o=s.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(i=>i.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=i=>{const o=new MutationObserver(u=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(i,{attributes:!0,attributeFilter:e})},r=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const i=Array.from(this.children);for(const o of i){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(f=>{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))}}},s=new MutationObserver(i=>{let o=!1;for(const u of i)if(u.type==="childList"){o=!0;break}o&&r(),this._scheduleHarvest()});this._slotMo=s,s.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 s=e[r],i=t[r];if(!s||!i||s.kind!==i.kind||s.label!==i.label)return!1;if(s.kind==="tab"&&i.kind==="tab"){if((s.href??"")!==(i.href??""))return!1}else if(s.kind==="dropdown"&&i.kind==="dropdown"&&s.slotName!==i.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 s=e[r],i=t[r];if(!s||!i||s.label!==i.label||s.href!==i.href||(s.target??"")!==(i.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 s=e[r],i=t[r];if(!s||!i||s.label!==i.label||(s.href??"")!==(i.href??"")||(s.icon??"")!==(i.icon??"")||!this._sameMenuNodes(s.children??[],i.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 s=(e.getAttribute("icon")??"").trim().toLowerCase(),i=(e.getAttribute("aria-label")??"").trim().toLowerCase();return s==="close"||i.includes("stäng")||i.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 s=r.left;for(const i of t){const o=i.getBoundingClientRect();o.width<=0||o.right>s&&(s=o.right)}return s-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=k(()=>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([k(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([2,3,4,5,6,7]),import.meta.url),k(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([8,7,3,4,5,6,9,1,10,11,12]),import.meta.url),k(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([13,3,1,4,14,15,5,16,17,0]),import.meta.url),k(()=>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")?k(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([19,7,3,1,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?k(()=>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")?k(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([21,3,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?k(()=>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")?k(()=>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=k(()=>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 s=String(t);r.getAttribute("data-index")!==s&&r.setAttribute("data-index",s),r.hasAttribute("as-tab")||r.setAttribute("as-tab","");const i=this.size,o=r;o?.size!==i&&(o.size=i),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 s=r.getAttribute("data-index");if(s==null)continue;const i=Number(s);if(Number.isFinite(i))return i}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",s=(this.menuButtonLabel??"").trim()||"Meny",i=(this.menuOpenLabel??"").trim()||s,o=this._menuExpanded?"true":"false";return t?m`
|
|
56
56
|
<button
|
|
57
57
|
type="button"
|
|
58
58
|
class=${`${r} header-icon-button`}
|
|
@@ -118,7 +118,7 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
118
118
|
</button>
|
|
119
119
|
`:w}
|
|
120
120
|
</form>
|
|
121
|
-
`}render(){const e=this._getNavItems(),t=this._slotUtils.length?this._slotUtils:this.utilityItems,r=this._slotMenu.length?this._slotMenu:this.menuData??[],s=this.logoText||this.logotypeText,i=this.logoAlt||s||"Gå till startsidan",o=this.querySelector('[slot="drawer-menu"]')!==null,u=this.querySelector('[slot="drawer-close"]')!==null;this._syncFlags(t.length===0,!this.showSearch);const n=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:"",p=e.length>0||this.reserveTabs||this.layoutPending,h=(this.reserveTabs||this.layoutPending)&&(this.layoutPending||e.length===0),f=this._drawerRenderer,y=this.showDrawer&&this._drawerReady&&f,_=typeof window<"u"&&window.innerWidth>=this.BP_MD,
|
|
121
|
+
`}render(){const e=this._getNavItems(),t=this._slotUtils.length?this._slotUtils:this.utilityItems,r=this._slotMenu.length?this._slotMenu:this.menuData??[],s=this.logoText||this.logotypeText,i=this.logoAlt||s||"Gå till startsidan",o=this.querySelector('[slot="drawer-menu"]')!==null,u=this.querySelector('[slot="drawer-close"]')!==null;this._syncFlags(t.length===0,!this.showSearch);const n=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:"",p=e.length>0||this.reserveTabs||this.layoutPending,h=(this.reserveTabs||this.layoutPending)&&(this.layoutPending||e.length===0),f=this._drawerRenderer,y=this.showDrawer&&this._drawerReady&&f,_=typeof window<"u"&&window.innerWidth>=this.BP_MD,c=this.showDrawer&&(_?this.alwaysShowMenuButton||this._collapsed:!0),x=c&&!_,g=c&&_,v=(this.searchButtonLabel??"").trim()||"Sök",C=(this.searchCloseLabel??"").trim()||"Stäng sök",M=(this.utilityNavigationLabel??"").trim()||"Funktionslänkar",$=(this.mainNavigationLabel??"").trim()||"Huvudnavigering",D=this.showSearch&&!this._mobileSearchOpen;return m`
|
|
122
122
|
<slot
|
|
123
123
|
id="data-slot"
|
|
124
124
|
@slotchange=${()=>{this._harvest(),this._attachSlotObservers()}}
|
|
@@ -214,7 +214,7 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
214
214
|
@keydown=${this._onTabsKeydown}
|
|
215
215
|
@scb-dropdown-tab-activate=${this._onDropdownTabActivate}
|
|
216
216
|
>
|
|
217
|
-
${e.map((S,
|
|
217
|
+
${e.map((S,P)=>S.kind==="dropdown"?m`
|
|
218
218
|
<div class="tab-wrap">
|
|
219
219
|
<slot name=${S.slotName}></slot>
|
|
220
220
|
</div>
|
|
@@ -223,8 +223,8 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
223
223
|
<a
|
|
224
224
|
class="tab-link"
|
|
225
225
|
href=${S.href}
|
|
226
|
-
data-index=${
|
|
227
|
-
aria-current=${
|
|
226
|
+
data-index=${P}
|
|
227
|
+
aria-current=${P===this.activeTab?"page":"false"}
|
|
228
228
|
@click=${this._onTabClick}
|
|
229
229
|
>
|
|
230
230
|
${S.label}
|
|
@@ -236,8 +236,8 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
236
236
|
<button
|
|
237
237
|
type="button"
|
|
238
238
|
class="tab-link"
|
|
239
|
-
data-index=${
|
|
240
|
-
aria-current=${
|
|
239
|
+
data-index=${P}
|
|
240
|
+
aria-current=${P===this.activeTab?"page":"false"}
|
|
241
241
|
@click=${this._onTabClick}
|
|
242
242
|
>
|
|
243
243
|
${S.label}
|
|
@@ -291,7 +291,13 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
291
291
|
</clipPath>
|
|
292
292
|
</defs>
|
|
293
293
|
</svg>
|
|
294
|
-
`}},E=T,T._JSON_ARRAY={fromAttribute:b=>{if(b==null||b==="")return[];try{const e=JSON.parse(b);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute:b=>b==null?null:JSON.stringify(b)},T.BP_SM_DEFAULT=600,T.BP_MD_DEFAULT=840,T.styles=O`:host{display:block;margin-block-start:var(--scb-header-spacing-block-start, 0);margin-block-end:var(--scb-header-spacing-block-end, 0);background:var(--scb-header-background, transparent);color:var(--md-sys-color-on-surface, #1b1b1f);--scb-header-search-max:380px;--scb-header-search-min:250px;--scb-header-search-padding-x:var(--spacing-4, 12px);--scb-header-search-padding-y:var(--spacing-
|
|
294
|
+
`}},E=T,T._JSON_ARRAY={fromAttribute:b=>{if(b==null||b==="")return[];try{const e=JSON.parse(b);return Array.isArray(e)?e:[]}catch{return[]}},toAttribute:b=>b==null?null:JSON.stringify(b)},T.BP_SM_DEFAULT=600,T.BP_MD_DEFAULT=840,T.styles=O`:host{display:block;margin-block-start:var(--scb-header-spacing-block-start, 0);margin-block-end:var(--scb-header-spacing-block-end, 0);background:var(--scb-header-background, transparent);color:var(--md-sys-color-on-surface, #1b1b1f);--scb-header-search-max:380px;--scb-header-search-min:250px;--scb-header-search-padding-x:var(--spacing-4, 12px);--scb-header-search-padding-y:calc(var(--spacing-3, 8px) - var(--stroke-border, 1px));--scb-header-search-leading-size:var(--scale-10, 40px);--scb-header-search-icon-size:var(--icon-size-medium, 24px);--scb-header-search-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-header-search-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-header-search-button-padding-x:var(--spacing-5, 16px);--scb-header-search-button-font-size:var(--md-sys-typescale-label-small-size, 14px);--scb-header-search-button-line-height:var(--md-sys-typescale-label-small-line-height, 20px);--scb-header-search-button-font-weight:var(--md-sys-typescale-label-small-weight, 600);--scb-header-search-control-height:calc(
|
|
295
|
+
var(--scb-header-search-line-height) +
|
|
296
|
+
var(--scb-header-search-padding-y) +
|
|
297
|
+
var(--scb-header-search-padding-y) +
|
|
298
|
+
var(--stroke-border, 1px) +
|
|
299
|
+
var(--stroke-border, 1px)
|
|
300
|
+
);--scb-header-padding-inline:var(--spacing-0, 0px);--scb-header-padding-inline-expanded:var(--scb-header-padding-inline);--scb-header-logo-w:var(--icon-size-extra-extra-large, 48px);--scb-header-logo-h:calc(var(--scb-header-logo-w) * 1.125);--scb-header-logo-slot-w:var(--scb-header-logo-img-w, auto);--scb-header-logo-slot-h:var(--scb-header-logo-img-h, var(--scb-header-logo-h));--scb-header-logo-slot-aspect-ratio:var(--scb-header-logo-img-aspect-ratio, 48 / 54);--scb-header-logo-text-font-size:var(
|
|
295
301
|
--md-sys-typescale-body-medium-size,
|
|
296
302
|
1rem
|
|
297
303
|
);--scb-header-logo-text-line-height:var(
|
|
@@ -327,7 +333,7 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
327
333
|
);--scb-header-tab-line-height:var(
|
|
328
334
|
--md-sys-typescale-label-small-line-height,
|
|
329
335
|
1.25rem
|
|
330
|
-
);--scb-header-search-padding-x:var(--spacing-3, 8px);--scb-header-search-padding-y:var(--spacing-
|
|
336
|
+
);--scb-header-search-padding-x:var(--spacing-3, 8px);--scb-header-search-padding-y:calc(var(--spacing-2, 4px) + var(--stroke-border, 1px));--scb-header-search-leading-size:var(--scale-08, 32px);--scb-header-search-icon-size:var(--icon-size-small, 20px);--scb-header-search-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-header-search-line-height:var(--md-sys-typescale-body-small-line-height, 20px);--scb-header-search-button-padding-x:var(--spacing-4, 12px)}:host([size='large']){--scb-header-logo-text-font-size:var(
|
|
331
337
|
--md-sys-typescale-body-large-size,
|
|
332
338
|
1.125rem
|
|
333
339
|
);--scb-header-logo-text-line-height:var(
|
|
@@ -345,7 +351,7 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
345
351
|
);--scb-header-tab-line-height:var(
|
|
346
352
|
--md-sys-typescale-title-medium-line-height,
|
|
347
353
|
1.625rem
|
|
348
|
-
);--scb-header-search-padding-x:var(--spacing-5, 16px);--scb-header-search-padding-y:var(--spacing-5, 16px);--scb-header-search-leading-size:var(--scale-11, 48px);--scb-header-search-icon-size:var(--icon-size-medium, 24px);--scb-header-search-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-header-search-line-height:var(--md-sys-typescale-body-large-line-height, 26px)}.header-grid{box-sizing:border-box;inline-size:100%;max-inline-size:var(--scb-header-max-width, 1440px);margin-inline:auto;padding-inline:var(--scb-header-padding-inline)}@media (min-width:840px){.header-grid{padding-inline:var(--scb-header-padding-inline-expanded)}}.header-grid-item{min-inline-size:0}.top-row{display:flex;align-items:center;gap:var(--spacing-7, 24px);padding-block:var(--spacing-5, 16px);min-width:0;position:relative}.logo-wrap{display:inline-block;position:relative;border-radius:var(--scb-header-logo-focus-ring-radius,
|
|
354
|
+
);--scb-header-search-padding-x:var(--spacing-5, 16px);--scb-header-search-padding-y:calc(var(--spacing-5, 16px) - var(--spacing-1, 2px));--scb-header-search-leading-size:var(--scale-11, 48px);--scb-header-search-icon-size:var(--icon-size-medium, 24px);--scb-header-search-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-header-search-line-height:var(--md-sys-typescale-body-large-line-height, 26px);--scb-header-search-button-padding-x:var(--spacing-7, 24px);--scb-header-search-button-font-size:var(--md-sys-typescale-label-medium-size, 16px);--scb-header-search-button-line-height:var(--md-sys-typescale-label-medium-line-height, 24px);--scb-header-search-button-font-weight:var(--md-sys-typescale-label-medium-weight, 600)}.header-grid{box-sizing:border-box;inline-size:100%;max-inline-size:var(--scb-header-max-width, 1440px);margin-inline:auto;padding-inline:var(--scb-header-padding-inline)}@media (min-width:840px){.header-grid{padding-inline:var(--scb-header-padding-inline-expanded)}}.header-grid-item{min-inline-size:0}.top-row{display:flex;align-items:center;gap:var(--spacing-7, 24px);padding-block:var(--spacing-5, 16px);min-width:0;position:relative}.logo-wrap{display:inline-block;position:relative;border-radius:var(--scb-header-logo-focus-ring-radius,
|
|
349
355
|
var(--md-sys-shape-corner-small, 4px)
|
|
350
356
|
);margin-top:var(--spacing-2, 4px)}.logo-wrap md-focus-ring{position:absolute;inset:var(--spacing-neg-2, -4px);pointer-events:none;display:none;border-radius:inherit}.logo-group:focus-visible+md-focus-ring{display:block}.logo-group{display:inline-flex;align-items:center;gap:var(--spacing-5, 16px);text-decoration:none;color:inherit;flex-shrink:0;min-width:0}.logo-group:focus,.logo-group:focus-visible{outline:0}.logo-group img,.logo-group svg{width:var(--scb-header-logo-slot-w);height:var(--scb-header-logo-slot-h);aspect-ratio:var(--scb-header-logo-slot-aspect-ratio);display:block}.logo-group svg{color:var(--md-sys-color-on-surface)}.logo-group img{object-fit:contain}:host([logo-invert-dm]):host-context([theme='dark']) .logo-group img,:host([logo-invert-dm][theme='dark']) .logo-group img{filter:brightness(0) invert(1)}.logo-text{font-family:var(--brand-font, Inter),sans-serif;font-size:var(--scb-header-logo-text-font-size,
|
|
351
357
|
var(--md-sys-typescale-body-medium-size, 1rem)
|
|
@@ -354,15 +360,11 @@ import{f as A,g as w,h as R,m as N,p as c,v as m,y as O}from"../../vendor/vendor
|
|
|
354
360
|
);font-weight:var(--weight-regular, 400);letter-spacing:var(--md-sys-typescale-body-medium-tracking,
|
|
355
361
|
-0.009375rem
|
|
356
362
|
);color:var(--md-sys-color-on-surface, var(--p-20));white-space:nowrap}@media (max-width:360px){.logo-text{margin-right:calc(var(--spacing-9, 40px)*-1)}}.actions,.utility{align-items:center;min-width:0}.actions{display:flex;margin-left:auto;width:100%;gap:var(--spacing-3, 8px);justify-content:flex-end}.utility{display:none;flex-wrap:nowrap}@media (min-width:840px){.utility{display:flex}}:host([data-collapsed]) .utility,:host([layout-pending]) .utility{display:none!important}:host([data-layout-settling]) .actions,:host([layout-pending]) .actions{visibility:hidden}.menu-trigger{display:none;align-self:center;color:var(--md-sys-color-on-surface, #1b1b1f);--md-sys-color-primary:var(--md-sys-color-on-surface, #1b1b1f)}.menu-trigger--tabs-right{margin-left:auto}@media (max-width:839.98px){.menu-trigger{display:inline-flex}}@media (min-width:840px){:host([always-show-menu-button]) .menu-trigger,:host([data-collapsed]) .menu-trigger{display:inline-flex}}.header-search,.search{align-items:stretch;gap:var(--spacing-3, 8px)}.search{display:none;flex:0 1 var(--scb-header-search-max);max-width:var(--scb-header-search-max);min-width:var(--scb-header-search-min)}.header-search{display:flex;flex:1 1 auto;min-width:0}.header-search-field{position:relative;flex:1 1 auto;min-width:0}.header-search-input{box-sizing:border-box;inline-size:100%;min-block-size:var(--scb-search-height,
|
|
357
|
-
|
|
358
|
-
var(--scb-header-search-line-height) +
|
|
359
|
-
var(--scb-header-search-padding-y) +
|
|
360
|
-
var(--scb-header-search-padding-y)
|
|
361
|
-
)
|
|
363
|
+
var(--scb-header-search-control-height)
|
|
362
364
|
);padding-block:var(--scb-header-search-padding-y);padding-inline-start:calc(var(--scb-header-search-padding-x) + var(--scb-header-search-leading-size) + var(--spacing-2, 4px));padding-inline-end:calc(var(--scb-header-search-padding-x) + var(--scb-header-search-leading-size) + var(--spacing-2, 4px));border:var(--stroke-border, 1px) solid var(--md-sys-color-outline, #808080);border-radius:var(--radius-full, 1000px);background:0 0;color:var(--md-sys-color-on-surface, #1b1b1f);font-family:var(--md-sys-typescale-body-large-font, var(--brand-font, Inter), sans-serif);font-size:var(--scb-header-search-font-size);line-height:var(--scb-header-search-line-height);letter-spacing:0;-webkit-appearance:none;appearance:none}.header-search-input::placeholder{color:var(--md-sys-color-on-surface-variant, #1b1b1f);opacity:1}.header-search-input:hover{outline:var(--stroke-border, 1px) solid var(--md-sys-color-outline, #808080);outline-offset:0}.header-search-input:focus{outline:0}.header-search-input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}.header-search-clear,.header-search-icon{position:absolute;inset-block-start:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;inline-size:var(--scb-header-search-leading-size);block-size:var(--scb-header-search-leading-size);color:var(--md-sys-color-on-surface-variant, #1b1b1f)}.header-search-icon{inset-inline-start:var(--scb-header-search-padding-x);pointer-events:none}.header-search-clear{inset-inline-end:var(--scb-header-search-padding-x);border:0;border-radius:var(--radius-full, 1000px);padding:0;background:0 0;cursor:pointer}.header-search-clear[hidden]{display:none}.header-search-field md-focus-ring.input-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--radius-full, 1000px);z-index:4}:host([data-keyboard-focus]) .header-search-input:focus~md-focus-ring.input-ring{display:block}.search-submit{flex:0 0 auto}@media (min-width:600px){.search{display:flex}}.mobile-search-trigger{display:inline-flex;color:var(--md-sys-color-on-surface, #1b1b1f)}@media (min-width:600px){.mobile-search-trigger{display:none}}.mobile-search-panel{display:none;position:absolute;inset:0;z-index:2;align-items:center;gap:var(--spacing-3, 8px);padding-block:var(--spacing-5, 16px);background:var(--scb-header-background, transparent)}.mobile-search-panel .header-search{flex:1 1 auto;min-width:0}@media (max-width:599.98px){:host([data-mobile-search-open]) .mobile-search-panel{display:flex}:host([data-mobile-search-open]) .actions,:host([data-mobile-search-open]) .logo-wrap{visibility:hidden;pointer-events:none}}@media (min-width:600px) and (max-width:839.98px){:host([data-hide-search]) .search{display:none!important}}:host([data-collapsed]) .actions,:host([data-no-utility]) .actions{gap:var(--spacing-5, 16px)}:host([data-no-utility]) .search{flex:1 1 var(--scb-header-search-max);max-width:var(--scb-header-search-max);min-width:var(--scb-header-search-min)}.tabs-inset{display:inline-block;width:fit-content;max-width:100%}.tabs-row{display:flex;align-items:center;min-height:calc(var(--spacing-10, 40px));gap:var(--spacing-5, 16px)}.tabs-row--empty{min-height:0}.tabs-row .tabs-inset{flex:1 1 auto;min-width:0}@media (max-width:839.98px){.tabs-inset{display:none}.tabs-row{min-height:0}}.tabs-nav{display:inline-flex;flex-wrap:nowrap;gap:var(--spacing-6, 18px);min-height:calc(var(--spacing-10, 40px));position:relative}.tabs-nav,.tabs-nav--skeleton{align-items:center}.tab-skeleton{flex:0 0 auto;display:inline-block;block-size:16px;border-radius:var(--radius-full, 1000px);background:linear-gradient(90deg,var(--md-sys-color-surface-container-low, #f5f5f5),var(--md-sys-color-surface-container, #ebf8ff),var(--md-sys-color-surface-container-low, #f5f5f5))}.tab-link,.tab-wrap{position:relative;display:inline-flex;align-items:stretch}.tab-wrap md-focus-ring{position:absolute;inset-block:var(--spacing-1, 2px);inset-inline:var(--spacing-neg-2, -4px);pointer-events:none;display:none;border-radius:5px}.tab-link{align-items:center;justify-content:center;padding-block:var(--spacing-4, 12px);padding:0;border:0;background:0 0;text-decoration:none;cursor:pointer;font-family:var(--md-sys-typescale-title-small-font,
|
|
363
365
|
var(--brand-font, Inter)
|
|
364
366
|
);font-size:var(--scb-header-tab-font-size,
|
|
365
367
|
var(--md-sys-typescale-title-small-size, 1rem)
|
|
366
368
|
);line-height:var(--scb-header-tab-line-height,
|
|
367
369
|
var(--md-sys-typescale-title-small-line-height, 1.5rem)
|
|
368
|
-
);font-weight:var(--md-sys-typescale-title-small-weight, 500);letter-spacing:var(--md-sys-typescale-title-small-tracking, 0);color:var(--md-sys-color-on-surface);white-space:nowrap;border-radius:0;outline:0}.tab-link[aria-current=page]{color:var(--md-sys-color-primary)}.tab-link::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:999px 999px 0 0;background-color:transparent}.tab-link[aria-current=page]::after{background-color:var(--md-sys-color-primary)}.tab-link:focus-visible{outline:0}.header-icon-button:focus-visible md-focus-ring,.header-search-clear:focus-visible md-focus-ring,.header-text-button:focus-visible md-focus-ring,.search-submit:focus-visible md-focus-ring,.tab-link:focus-visible+md-focus-ring,.utility-link:focus-visible md-focus-ring{display:block}.header-text-button,.utility-link{position:relative}.header-icon-button,.header-text-button,.search-submit,.utility-link{border:0;font:inherit;letter-spacing:0;-webkit-tap-highlight-color:transparent}.search-submit{position:relative}.header-text-button,.search-submit,.utility-link{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-block-size:calc(var(--md-sys-typescale-label-small-line-height, 20px) + ((var(--spacing-4, 12px) - var(--spacing-1, 2px))*2));padding-block:calc(var(--spacing-4, 12px) - var(--spacing-1, 2px));padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-full, 1000px);color:var(--md-sys-color-primary, var(--p-40, #1f44ff));font-family:var(--md-sys-typescale-label-small-font, var(--brand-font, Inter), sans-serif);font-size:var(--md-sys-typescale-label-small-size, 14px);line-height:var(--md-sys-typescale-label-small-line-height, 20px);font-weight:var(--md-sys-typescale-label-small-weight, 600);text-decoration:none;background:0 0;cursor:pointer;white-space:nowrap}.header-text-button:hover,.utility-link:hover{background:color-mix(in srgb,var(--md-sys-color-primary, #1f44ff) 8%,transparent)}.search-submit{min-block-size:var(--scb-search-height, var(--scale-11, 48px));min-inline-size:var(--scale-12, 64px);color:var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be));background:var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))}.search-submit:hover{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #d6f1ff) 92%,var(--md-sys-color-on-secondary-container, #1e00be))}.header-icon-button{position:relative;display:inline-flex;align-items:center;justify-content:center;inline-size:calc(var(--icon-size-medium, 24px) + (var(--spacing-3, 12px)*2));block-size:calc(var(--icon-size-medium, 24px) + (var(--spacing-3, 12px)*2));padding:0;border-radius:var(--radius-full, 1000px);color:var(--md-sys-color-on-surface, #1b1b1f);background:0 0;cursor:pointer}.mobile-search-close,.mobile-search-trigger{color:var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be));background:var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))}@media (min-width:600px){.mobile-search-trigger.header-icon-button{display:none}}.header-icon-button:hover,.header-search-clear:hover{background:color-mix(in srgb,currentColor 8%,transparent)}.mobile-search-close:hover,.mobile-search-trigger:hover{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #d6f1ff) 92%,var(--md-sys-color-on-secondary-container, #1e00be))}.header-icon-button:focus,.header-icon-button:focus-visible,.header-search-clear:focus,.header-search-clear:focus-visible,.header-text-button:focus,.header-text-button:focus-visible,.search-submit:focus,.search-submit:focus-visible,.utility-link:focus,.utility-link:focus-visible{outline:0}.header-icon-button:focus-visible,.header-search-clear:focus-visible,.header-text-button:focus-visible,.search-submit:focus-visible,.utility-link:focus-visible{outline:0}.header-icon-button md-focus-ring,.header-search-clear md-focus-ring,.header-text-button md-focus-ring,.search-submit md-focus-ring,.utility-link md-focus-ring{position:absolute;inset:var(--spacing-neg-2, -4px);pointer-events:none;display:none;border-radius:inherit}.header-text-button{gap:var(--spacing-3, 8px)}.header-text-button .header-symbol{inline-size:var(--icon-size-small, 20px);font-size:var(--icon-size-small, 20px);line-height:var(--icon-size-small, 20px)}.header-symbol,.sr-only{overflow:hidden;white-space:nowrap}.header-symbol{display:inline-block;inline-size:1em;block-size:1em;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;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}.header-symbol.scb-svg-icon{fill:currentColor;font:inherit}.header-search-icon.header-symbol{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--scb-header-search-leading-size);font-size:var(--scb-header-search-icon-size)}.sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;clip:rect(0,0,0,0);border:0}.drawer-close{box-sizing:border-box;display:flex;justify-content:flex-end;padding-block-start:var(--spacing-4, 12px);padding-inline:var(--spacing-4, 12px);background:var(--md-sys-color-surface-container-lowest)}.drawer-close[hidden]{display:none}.drawer-close ::slotted(*){flex:0 0 auto}.divider{border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant, #e0e0e0);position:relative;z-index:0}:host([data-hide-logo-text]) .logo-text{display:none}`,T);l([c({type:String,attribute:"max-width"})],a.prototype,"maxWidth",void 0);l([c({type:String,attribute:"padding-inline",reflect:!0})],a.prototype,"paddingInline",void 0);l([c({type:String,attribute:"padding-inline-expanded",reflect:!0})],a.prototype,"paddingInlineExpanded",void 0);l([c({type:String,reflect:!0})],a.prototype,"spacing",void 0);l([c({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);l([c({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);l([c({type:String,reflect:!0,converter:W})],a.prototype,"size",void 0);l([c({type:String,attribute:"logo-text"})],a.prototype,"logoText",void 0);l([c({type:String,attribute:"logotype-text"})],a.prototype,"logotypeText",void 0);l([c({type:String,attribute:"logo-alt"})],a.prototype,"logoAlt",void 0);l([c({type:String,attribute:"logo-href"})],a.prototype,"logoHref",void 0);l([c({type:String,attribute:"logo-src"})],a.prototype,"logoSrc",void 0);l([c({type:String,attribute:"logo-width"})],a.prototype,"logoWidth",void 0);l([c({type:String,attribute:"logo-height"})],a.prototype,"logoHeight",void 0);l([c({type:String,attribute:"logo-aspect-ratio"})],a.prototype,"logoAspectRatio",void 0);l([c({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:P})],a.prototype,"logoInvertDm",void 0);l([c({type:Boolean,reflect:!0})],a.prototype,"banner",void 0);l([c({type:String,attribute:"banner-label"})],a.prototype,"bannerLabel",void 0);l([c({type:Array,attribute:"tabs",converter:a._JSON_ARRAY})],a.prototype,"tabs",void 0);l([c({type:Number,attribute:"active-tab",reflect:!0})],a.prototype,"activeTab",void 0);l([c({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:P})],a.prototype,"reserveTabs",void 0);l([c({type:Number,attribute:"reserve-tabs-count"})],a.prototype,"reserveTabsCount",void 0);l([c({type:String,attribute:"reserve-tabs-widths"})],a.prototype,"reserveTabsWidths",void 0);l([c({type:Boolean,attribute:"layout-pending",reflect:!0,converter:P})],a.prototype,"layoutPending",void 0);l([c({type:Array,attribute:"utility-items",converter:a._JSON_ARRAY})],a.prototype,"utilityItems",void 0);l([c({type:String,attribute:"search-placeholder"})],a.prototype,"searchPlaceholder",void 0);l([c({type:String,attribute:"search-button-label"})],a.prototype,"searchButtonLabel",void 0);l([c({type:String,attribute:"search-clear-label"})],a.prototype,"searchClearLabel",void 0);l([c({type:String,attribute:"search-close-label"})],a.prototype,"searchCloseLabel",void 0);l([c({type:String,attribute:"menu-label"})],a.prototype,"menuLabel",void 0);l([c({type:String,attribute:"menu-button-label"})],a.prototype,"menuButtonLabel",void 0);l([c({type:String,attribute:"menu-open-label"})],a.prototype,"menuOpenLabel",void 0);l([c({type:String,attribute:"menu-sub-label"})],a.prototype,"menuSubLabel",void 0);l([c({type:String,attribute:"menu-section-label"})],a.prototype,"menuSectionLabel",void 0);l([c({type:String,attribute:"menu-search-placeholder"})],a.prototype,"menuSearchPlaceholder",void 0);l([c({type:String,attribute:"utility-navigation-label"})],a.prototype,"utilityNavigationLabel",void 0);l([c({type:String,attribute:"main-navigation-label"})],a.prototype,"mainNavigationLabel",void 0);l([c({type:Array,attribute:"menu-data",converter:a._JSON_ARRAY})],a.prototype,"menuData",void 0);l([c({type:Boolean,attribute:"defer-drawer",reflect:!0,converter:P})],a.prototype,"deferDrawer",void 0);l([c({type:Boolean,attribute:"show-drawer",reflect:!0,converter:L})],a.prototype,"showDrawer",void 0);l([c({type:Boolean,attribute:"always-show-menu-button",reflect:!0,converter:P})],a.prototype,"alwaysShowMenuButton",void 0);l([c({type:Boolean,attribute:"show-search",reflect:!0,converter:L})],a.prototype,"showSearch",void 0);l([c({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:P})],a.prototype,"includeUtilityInMenu",void 0);l([c({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:L})],a.prototype,"drawerOverlay",void 0);l([c({type:String,attribute:"search-max"})],a.prototype,"searchMax",void 0);l([c({type:String,attribute:"search-min"})],a.prototype,"searchMin",void 0);l([c({type:String,attribute:"search-height"})],a.prototype,"searchHeight",void 0);l([c({type:String,attribute:"search-text",reflect:!0})],a.prototype,"searchText",void 0);l([A()],a.prototype,"_drawerId",void 0);l([A()],a.prototype,"_menuExpanded",void 0);l([A()],a.prototype,"_searchId",void 0);l([A()],a.prototype,"_drawerReady",void 0);l([A()],a.prototype,"_mobileSearchOpen",void 0);l([A()],a.prototype,"_slotNavItems",void 0);l([A()],a.prototype,"_slotUtils",void 0);l([A()],a.prototype,"_slotMenu",void 0);l([A()],a.prototype,"_collapsed",void 0);l([A()],a.prototype,"_hideLogoText",void 0);a=E=l([N("scb-header")],a);
|
|
370
|
+
);font-weight:var(--md-sys-typescale-title-small-weight, 500);letter-spacing:var(--md-sys-typescale-title-small-tracking, 0);color:var(--md-sys-color-on-surface);white-space:nowrap;border-radius:0;outline:0}.tab-link[aria-current=page]{color:var(--md-sys-color-primary)}.tab-link::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:999px 999px 0 0;background-color:transparent}.tab-link[aria-current=page]::after{background-color:var(--md-sys-color-primary)}.tab-link:focus-visible{outline:0}.header-icon-button:focus-visible md-focus-ring,.header-search-clear:focus-visible md-focus-ring,.header-text-button:focus-visible md-focus-ring,.search-submit:focus-visible md-focus-ring,.tab-link:focus-visible+md-focus-ring,.utility-link:focus-visible md-focus-ring{display:block}.header-text-button,.utility-link{position:relative}.header-icon-button,.header-text-button,.search-submit,.utility-link{border:0;font:inherit;letter-spacing:0;-webkit-tap-highlight-color:transparent}.search-submit{position:relative}.header-text-button,.search-submit,.utility-link{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-block-size:calc(var(--md-sys-typescale-label-small-line-height, 20px) + ((var(--spacing-4, 12px) - var(--spacing-1, 2px))*2));padding-block:calc(var(--spacing-4, 12px) - var(--spacing-1, 2px));padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-full, 1000px);color:var(--md-sys-color-primary, var(--p-40, #1f44ff));font-family:var(--md-sys-typescale-label-small-font, var(--brand-font, Inter), sans-serif);font-size:var(--md-sys-typescale-label-small-size, 14px);line-height:var(--md-sys-typescale-label-small-line-height, 20px);font-weight:var(--md-sys-typescale-label-small-weight, 600);text-decoration:none;background:0 0;cursor:pointer;white-space:nowrap}.header-text-button:hover,.utility-link:hover{background:color-mix(in srgb,var(--md-sys-color-primary, #1f44ff) 8%,transparent)}.search-submit{block-size:var(--scb-search-height, var(--scb-header-search-control-height));min-block-size:var(--scb-search-height, var(--scb-header-search-control-height));min-inline-size:64px;padding-block:0;padding-inline:var(--scb-header-search-button-padding-x);font-size:var(--scb-header-search-button-font-size);line-height:var(--scb-header-search-button-line-height);font-weight:var(--scb-header-search-button-font-weight);color:var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be));background:var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))}.search-submit:hover{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #d6f1ff) 92%,var(--md-sys-color-on-secondary-container, #1e00be))}.header-icon-button{position:relative;display:inline-flex;align-items:center;justify-content:center;inline-size:calc(var(--icon-size-medium, 24px) + (var(--spacing-3, 12px)*2));block-size:calc(var(--icon-size-medium, 24px) + (var(--spacing-3, 12px)*2));padding:0;border-radius:var(--radius-full, 1000px);color:var(--md-sys-color-on-surface, #1b1b1f);background:0 0;cursor:pointer}.mobile-search-close,.mobile-search-trigger{color:var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be));background:var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff))}@media (min-width:600px){.mobile-search-trigger.header-icon-button{display:none}}.header-icon-button:hover,.header-search-clear:hover{background:color-mix(in srgb,currentColor 8%,transparent)}.mobile-search-close:hover,.mobile-search-trigger:hover{background:color-mix(in srgb,var(--md-sys-color-secondary-container, #d6f1ff) 92%,var(--md-sys-color-on-secondary-container, #1e00be))}.header-icon-button:focus,.header-icon-button:focus-visible,.header-search-clear:focus,.header-search-clear:focus-visible,.header-text-button:focus,.header-text-button:focus-visible,.search-submit:focus,.search-submit:focus-visible,.utility-link:focus,.utility-link:focus-visible{outline:0}.header-icon-button:focus-visible,.header-search-clear:focus-visible,.header-text-button:focus-visible,.search-submit:focus-visible,.utility-link:focus-visible{outline:0}.header-icon-button md-focus-ring,.header-search-clear md-focus-ring,.header-text-button md-focus-ring,.search-submit md-focus-ring,.utility-link md-focus-ring{position:absolute;inset:var(--spacing-neg-2, -4px);pointer-events:none;display:none;border-radius:inherit}.header-text-button{gap:var(--spacing-3, 8px)}.header-text-button .header-symbol{inline-size:var(--icon-size-small, 20px);font-size:var(--icon-size-small, 20px);line-height:var(--icon-size-small, 20px)}.header-symbol,.sr-only{overflow:hidden;white-space:nowrap}.header-symbol{display:inline-block;inline-size:1em;block-size:1em;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;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}.header-symbol.scb-svg-icon{fill:currentColor;font:inherit}.header-search-icon.header-symbol{display:inline-flex;align-items:center;justify-content:center;inline-size:var(--scb-header-search-leading-size);font-size:var(--scb-header-search-icon-size)}.sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;clip:rect(0,0,0,0);border:0}.drawer-close{box-sizing:border-box;display:flex;justify-content:flex-end;padding-block-start:var(--spacing-4, 12px);padding-inline:var(--spacing-4, 12px);background:var(--md-sys-color-surface-container-lowest)}.drawer-close[hidden]{display:none}.drawer-close ::slotted(*){flex:0 0 auto}.divider{border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant, #e0e0e0);position:relative;z-index:0}:host([data-hide-logo-text]) .logo-text{display:none}`,T);l([d({type:String,attribute:"max-width"})],a.prototype,"maxWidth",void 0);l([d({type:String,attribute:"padding-inline",reflect:!0})],a.prototype,"paddingInline",void 0);l([d({type:String,attribute:"padding-inline-expanded",reflect:!0})],a.prototype,"paddingInlineExpanded",void 0);l([d({type:String,reflect:!0})],a.prototype,"spacing",void 0);l([d({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);l([d({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);l([d({type:String,reflect:!0,converter:W})],a.prototype,"size",void 0);l([d({type:String,attribute:"logo-text"})],a.prototype,"logoText",void 0);l([d({type:String,attribute:"logotype-text"})],a.prototype,"logotypeText",void 0);l([d({type:String,attribute:"logo-alt"})],a.prototype,"logoAlt",void 0);l([d({type:String,attribute:"logo-href"})],a.prototype,"logoHref",void 0);l([d({type:String,attribute:"logo-src"})],a.prototype,"logoSrc",void 0);l([d({type:String,attribute:"logo-width"})],a.prototype,"logoWidth",void 0);l([d({type:String,attribute:"logo-height"})],a.prototype,"logoHeight",void 0);l([d({type:String,attribute:"logo-aspect-ratio"})],a.prototype,"logoAspectRatio",void 0);l([d({type:Boolean,attribute:"logo-invert-dm",reflect:!0,converter:z})],a.prototype,"logoInvertDm",void 0);l([d({type:Boolean,reflect:!0})],a.prototype,"banner",void 0);l([d({type:String,attribute:"banner-label"})],a.prototype,"bannerLabel",void 0);l([d({type:Array,attribute:"tabs",converter:a._JSON_ARRAY})],a.prototype,"tabs",void 0);l([d({type:Number,attribute:"active-tab",reflect:!0})],a.prototype,"activeTab",void 0);l([d({type:Boolean,attribute:"reserve-tabs",reflect:!0,converter:z})],a.prototype,"reserveTabs",void 0);l([d({type:Number,attribute:"reserve-tabs-count"})],a.prototype,"reserveTabsCount",void 0);l([d({type:String,attribute:"reserve-tabs-widths"})],a.prototype,"reserveTabsWidths",void 0);l([d({type:Boolean,attribute:"layout-pending",reflect:!0,converter:z})],a.prototype,"layoutPending",void 0);l([d({type:Array,attribute:"utility-items",converter:a._JSON_ARRAY})],a.prototype,"utilityItems",void 0);l([d({type:String,attribute:"search-placeholder"})],a.prototype,"searchPlaceholder",void 0);l([d({type:String,attribute:"search-button-label"})],a.prototype,"searchButtonLabel",void 0);l([d({type:String,attribute:"search-clear-label"})],a.prototype,"searchClearLabel",void 0);l([d({type:String,attribute:"search-close-label"})],a.prototype,"searchCloseLabel",void 0);l([d({type:String,attribute:"menu-label"})],a.prototype,"menuLabel",void 0);l([d({type:String,attribute:"menu-button-label"})],a.prototype,"menuButtonLabel",void 0);l([d({type:String,attribute:"menu-open-label"})],a.prototype,"menuOpenLabel",void 0);l([d({type:String,attribute:"menu-sub-label"})],a.prototype,"menuSubLabel",void 0);l([d({type:String,attribute:"menu-section-label"})],a.prototype,"menuSectionLabel",void 0);l([d({type:String,attribute:"menu-search-placeholder"})],a.prototype,"menuSearchPlaceholder",void 0);l([d({type:String,attribute:"utility-navigation-label"})],a.prototype,"utilityNavigationLabel",void 0);l([d({type:String,attribute:"main-navigation-label"})],a.prototype,"mainNavigationLabel",void 0);l([d({type:Array,attribute:"menu-data",converter:a._JSON_ARRAY})],a.prototype,"menuData",void 0);l([d({type:Boolean,attribute:"defer-drawer",reflect:!0,converter:z})],a.prototype,"deferDrawer",void 0);l([d({type:Boolean,attribute:"show-drawer",reflect:!0,converter:L})],a.prototype,"showDrawer",void 0);l([d({type:Boolean,attribute:"always-show-menu-button",reflect:!0,converter:z})],a.prototype,"alwaysShowMenuButton",void 0);l([d({type:Boolean,attribute:"show-search",reflect:!0,converter:L})],a.prototype,"showSearch",void 0);l([d({type:Boolean,attribute:"include-utility-in-menu",reflect:!0,converter:z})],a.prototype,"includeUtilityInMenu",void 0);l([d({type:Boolean,attribute:"drawer-overlay",reflect:!0,converter:L})],a.prototype,"drawerOverlay",void 0);l([d({type:String,attribute:"search-max"})],a.prototype,"searchMax",void 0);l([d({type:String,attribute:"search-min"})],a.prototype,"searchMin",void 0);l([d({type:String,attribute:"search-height"})],a.prototype,"searchHeight",void 0);l([d({type:String,attribute:"search-text",reflect:!0})],a.prototype,"searchText",void 0);l([A()],a.prototype,"_drawerId",void 0);l([A()],a.prototype,"_menuExpanded",void 0);l([A()],a.prototype,"_searchId",void 0);l([A()],a.prototype,"_drawerReady",void 0);l([A()],a.prototype,"_mobileSearchOpen",void 0);l([A()],a.prototype,"_slotNavItems",void 0);l([A()],a.prototype,"_slotUtils",void 0);l([A()],a.prototype,"_slotMenu",void 0);l([A()],a.prototype,"_collapsed",void 0);l([A()],a.prototype,"_hideLogoText",void 0);a=E=l([N("scb-header")],a);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-list/scb-list-item.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f as x,g as h,h as S,m as w,p as o,v as c,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as
|
|
2
|
+
import{f as x,g as h,h as S,m as w,p as o,v as c,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as z}from"../../vendor/preload-helper.js";import{ensureFocusRingReady as A}from"../shared/lazy-focus-ring.js";import{t as n}from"../../vendor/decorate.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,r){try{customElements.get(e)||t(e,s,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var p,V=0,a=(p=class extends S{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=z(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const t=(this.value??"").trim().length>0;!this._inputFocused||!t||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.inputLabel="",this.clearLabel="Rensa sökfält",this.suggestionsLabel="Sökförslag",this.errorText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.error=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="large",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++V}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(A(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0),this._initialValue=this.value??"",this._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this._inputEl();t&&(t.value=this._initialValue),this._lastChangeValue=this._initialValue,this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this.error=!1,this._hasValidationBeenReported=!1,this._updateComboboxA11y(),this._syncValidity()},this._form.addEventListener("reset",this._formResetHandler,!0)),this._syncFormValue(),this._syncValidity()}disconnectedCallback(){const t=this._inputEl();t&&this._boundNativeKeydown&&t.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const t=this._inputEl();t&&(this._boundNativeKeydown=e=>this._handleKey(e),t.addEventListener("keydown",this._boundNativeKeydown,!0),t.disabled=this.disabled),this.applySpacing()}updated(t){if(super.updated(t),t.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),(t.has("value")||t.has("disabled"))&&this._syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required")||t.has("errorText"))&&this._syncValidity(),t.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const e=this._inputEl();e&&(e.disabled=this.disabled)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions&&this._listDepsLoaded,s=this.error?this._validationMessage||this.errorText||"Ogiltig sökning.":"",r=s?"search-supporting-text":void 0,i=this.inputLabel||this.supportingText||"Sök";return c`
|
|
3
3
|
<div class="ripple-wrapper">
|
|
4
4
|
<md-icon class="leading">${t?"arrow_back":"search"}</md-icon>
|
|
5
5
|
|
|
@@ -46,8 +46,8 @@ import{f as x,g as h,h as S,m as w,p as o,v as c,y as k}from"../../vendor/vendor
|
|
|
46
46
|
<md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
|
|
47
47
|
`:h}
|
|
48
48
|
${s?c`<span id="search-supporting-text" class="supporting-text">${s}</span>`:h}
|
|
49
|
-
`}formDisabledCallback(t){this.disabled=t,t&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?this.errorText||"Fyll i det här fältet.":""}_syncValidity(){const t=this._inputEl(),e=this.disabled?"":this._getValidationMessage(),s=this.error,r=this._validationMessage;if(t&&t.setCustomValidity(e),this._internals)if(e){const i=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(i,e,t??void 0)}else this._internals.setValidity({});this._validationMessage=e,this.error=this.disabled?!1:e?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!r,t&&t.setAttribute("aria-invalid",this.error?"true":"false"),this.toggleAttribute("aria-invalid",this.error),(s!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();const t=this._inputEl();return t?t.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=String(t??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this._dispatchSubmit(e)}focus(t){const e=this._inputEl();if(e){e.focus(t);return}this.updateComplete.then(()=>this._inputEl()?.focus(t))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(t){t.stopPropagation();const e=t.target;this.value=e.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const s={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:s,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(t){t.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}_handleKey(t){if(this.disabled||!this._inputEl())return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0,i=t.key,l=t.keyCode,b=i==="ArrowDown"||i==="Down"||l===40,g=i==="ArrowUp"||i==="Up"||l===38,v=i==="Home"||l===36,m=i==="End"||l===35,f=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(b){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,1);return}if(g){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,-1);return}if(v){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(m){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?e.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(f){if(!r){const d=this._internals?.form??this._form??this.closest("form");d?(t.preventDefault(),this.reportValidity()&&d.requestSubmit()):this.submit();return}t.preventDefault();const _=this._getActiveItem();if(_){const d=_.getAttribute("label")||"";this.value=d,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(_)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){t.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value="",this._activeIndex=-1,this._kbMode=!1;const t=this._inputEl();t&&(t.value="",t.focus()),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of s){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();e!==""&&l.includes(e)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_getActiveItem(){const t=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=t.length?null:t[this._activeIndex]??null}_moveActive(t,e){if(!t.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let s=this._activeIndex+e;this._activeIndex===-1?s=e>0?0:t.length-1:(s<0&&(s=0),s>=t.length&&(s=t.length-1)),this._activeIndex=s,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const t=this._getActiveItem();t&&t.scrollIntoView({block:"nearest"})}_itemPayload(t){return{label:t.getAttribute("label")||"",supportingText:t.getAttribute("supporting-text")||"",href:t.getAttribute("href")||"",type:t.getAttribute("type")||"",id:t.id||""}}_ensureListboxA11y(){const t=this._listEl();t&&(t.id||(t.id=this._listboxId),t.setAttribute("role","listbox"),t.setAttribute("aria-label",this.suggestionsLabel)),Array.from(this.querySelectorAll("scb-list-item")).forEach(e=>this._ensureOptionA11y(e))}_ensureOptionA11y(t){t.id||(t.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),t.setAttribute("role","option"),t.setAttribute("tabindex","-1")}_updateComboboxA11y(){const t=this._inputEl();if(!t)return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0;t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",this._listboxId),t.setAttribute("aria-expanded",String(r));const i=r?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const r=this.getBoundingClientRect(),i=t.getBoundingClientRect(),l=i.top-r.top,b=i.left-r.left,g=i.width,v=i.height;e.style.top=`${l}px`,e.style.left=`${b}px`,e.style.width=`${g}px`,e.style.height=`${v}px`,e.setAttribute("data-show","true")}_hideOptionRing(){const t=this._ringEl();t&&t.removeAttribute("data-show")}_onWindowResize(){const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}_attachListScrollListener(){const t=this._listEl();!t||this._listWithHandler===t||(this._detachListScrollListener(),t.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=t)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const t=this.value??"";t!==this._lastChangeValue&&(this._lastChangeValue=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(t){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-search-spacing-block-start",e):this.style.removeProperty("--scb-search-spacing-block-start"),s?this.style.setProperty("--scb-search-spacing-block-end",s):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const t=this.disabled?null:this.value;this._internals.setFormValue(t)}},p.formAssociated=!0,p.styles=k`:host{display:flex;flex-direction:column;position:relative;color:var(--md-sys-color-on-surface);-webkit-tap-highlight-color:transparent;margin-block-start:var(--scb-search-spacing-block-start, 0);margin-block-end:var(--scb-search-spacing-block-end, 0);margin-inline-start:var(--scb-search-spacing-inline-start, 0);margin-inline-end:var(--scb-search-spacing-inline-end, 0);--scb-search-radius:var(--radius-full, 1000px);--scb-search-open-radius:var(--radius-xl, 24px);--scb-search-height:calc(var(--scb-search-line-height) + var(--scb-search-padding-y) + var(--scb-search-padding-y));--scb-search-padding-x:var(--spacing-4, 12px);--scb-search-padding-y:var(--spacing-4, 12px);--scb-search-leading-size:var(--scale-10, 40px);--scb-search-trailing-size:var(--scale-10, 40px);--scb-search-gap:var(--spacing-2, 4px);letter-spacing:var(--md-sys-typescale-body-large-tracking, -0.3px);--scb-search-leading-gap:calc(
|
|
49
|
+
`}formDisabledCallback(t){this.disabled=t,t&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?this.errorText||"Fyll i det här fältet.":""}_syncValidity(){const t=this._inputEl(),e=this.disabled?"":this._getValidationMessage(),s=this.error,r=this._validationMessage;if(t&&t.setCustomValidity(e),this._internals)if(e){const i=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(i,e,t??void 0)}else this._internals.setValidity({});this._validationMessage=e,this.error=this.disabled?!1:e?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!r,t&&t.setAttribute("aria-invalid",this.error?"true":"false"),this.toggleAttribute("aria-invalid",this.error),(s!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();const t=this._inputEl();return t?t.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(t){this._customValidationMessage=String(t??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){const t=this._getActiveItem(),e={value:this.value};t&&(e.active=this._itemPayload(t)),this._dispatchSubmit(e)}focus(t){const e=this._inputEl();if(e){e.focus(t);return}this.updateComplete.then(()=>this._inputEl()?.focus(t))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(t){t.stopPropagation();const e=t.target;this.value=e.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const s={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:s,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(t){t.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}_handleKey(t){if(this.disabled||!this._inputEl())return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0,i=t.key,l=t.keyCode,b=i==="ArrowDown"||i==="Down"||l===40,g=i==="ArrowUp"||i==="Up"||l===38,v=i==="Home"||l===36,m=i==="End"||l===35,f=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(b){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,1);return}if(g){if(!r)return;t.preventDefault(),this._kbMode=!0,this._moveActive(e,-1);return}if(v){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(m){if(!r)return;t.preventDefault(),this._kbMode=!0,this._activeIndex=e.length?e.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(f){if(!r){const d=this._internals?.form??this._form??this.closest("form");d?(t.preventDefault(),this.reportValidity()&&d.requestSubmit()):this.submit();return}t.preventDefault();const _=this._getActiveItem();if(_){const d=_.getAttribute("label")||"";this.value=d,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(_)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){t.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value="",this._activeIndex=-1,this._kbMode=!1;const t=this._inputEl();t&&(t.value="",t.focus()),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(t){const e=(t??"").trim().toLowerCase(),s=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of s){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();e!==""&&l.includes(e)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(t=>!t.hasAttribute("hidden")&&t.style.display!=="none")}_getActiveItem(){const t=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=t.length?null:t[this._activeIndex]??null}_moveActive(t,e){if(!t.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let s=this._activeIndex+e;this._activeIndex===-1?s=e>0?0:t.length-1:(s<0&&(s=0),s>=t.length&&(s=t.length-1)),this._activeIndex=s,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const t=this._getActiveItem();t&&t.scrollIntoView({block:"nearest"})}_itemPayload(t){return{label:t.getAttribute("label")||"",supportingText:t.getAttribute("supporting-text")||"",href:t.getAttribute("href")||"",type:t.getAttribute("type")||"",id:t.id||""}}_ensureListboxA11y(){const t=this._listEl();t&&(t.id||(t.id=this._listboxId),t.setAttribute("role","listbox"),t.setAttribute("aria-label",this.suggestionsLabel)),Array.from(this.querySelectorAll("scb-list-item")).forEach(e=>this._ensureOptionA11y(e))}_ensureOptionA11y(t){t.id||(t.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),t.setAttribute("role","option"),t.setAttribute("tabindex","-1")}_updateComboboxA11y(){const t=this._inputEl();if(!t)return;const e=this._getVisibleItems(),s=(this.value??"").trim().length>0,r=this._inputFocused&&s&&e.length>0;t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-controls",this._listboxId),t.setAttribute("aria-expanded",String(r));const i=r?this._getActiveItem():null;i?.id?t.setAttribute("aria-activedescendant",i.id):t.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(t){const e=this._ringEl(),s=this._listEl();if(!e||!s)return;const r=this.getBoundingClientRect(),i=t.getBoundingClientRect(),l=i.top-r.top,b=i.left-r.left,g=i.width,v=i.height;e.style.top=`${l}px`,e.style.left=`${b}px`,e.style.width=`${g}px`,e.style.height=`${v}px`,e.setAttribute("data-show","true")}_hideOptionRing(){const t=this._ringEl();t&&t.removeAttribute("data-show")}_onWindowResize(){const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)}_attachListScrollListener(){const t=this._listEl();!t||this._listWithHandler===t||(this._detachListScrollListener(),t.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=t)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const t=this.value??"";t!==this._lastChangeValue&&(this._lastChangeValue=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(t){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-search-spacing-block-start",e):this.style.removeProperty("--scb-search-spacing-block-start"),s?this.style.setProperty("--scb-search-spacing-block-end",s):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const t=this.disabled?null:this.value;this._internals.setFormValue(t)}},p.formAssociated=!0,p.styles=k`:host{display:flex;flex-direction:column;position:relative;color:var(--md-sys-color-on-surface);-webkit-tap-highlight-color:transparent;margin-block-start:var(--scb-search-spacing-block-start, 0);margin-block-end:var(--scb-search-spacing-block-end, 0);margin-inline-start:var(--scb-search-spacing-inline-start, 0);margin-inline-end:var(--scb-search-spacing-inline-end, 0);--scb-search-radius:var(--radius-full, 1000px);--scb-search-open-radius:var(--radius-xl, 24px);--scb-search-height:calc(var(--scb-search-line-height) + var(--scb-search-padding-y) + var(--scb-search-padding-y));--scb-search-padding-x:var(--spacing-4, 12px);--scb-search-padding-y:calc(var(--spacing-4, 12px) - var(--stroke-border, 1px));--scb-search-leading-size:var(--scale-10, 40px);--scb-search-trailing-size:var(--scale-10, 40px);--scb-search-gap:var(--spacing-2, 4px);letter-spacing:var(--md-sys-typescale-body-large-tracking, -0.3px);--scb-search-leading-gap:calc(
|
|
50
50
|
var(--scb-search-padding-x) + var(--scb-search-leading-size) + var(--scb-search-gap)
|
|
51
51
|
);--scb-search-trailing-gap:calc(
|
|
52
52
|
var(--scb-search-padding-x) + var(--scb-search-trailing-size) + var(--scb-search-gap)
|
|
53
|
-
);--scb-search-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-search-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-search-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-search-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-search-supporting-tracking:var(--md-sys-typescale-body-medium-tracking, 0);--scb-search-icon-size:var(--icon-size-small, 20px)}:host([size='large']){--scb-search-padding-x:var(--spacing-5, 16px);--scb-search-padding-y:var(--spacing-5, 16px);--scb-search-leading-size:var(--scale-11, 48px);--scb-search-trailing-size:var(--scale-11, 48px);--scb-search-icon-size:var(--icon-size-medium, 24px);--scb-search-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-search-line-height:var(--md-sys-typescale-body-large-line-height, 26px);--scb-search-supporting-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-search-supporting-line-height:var(--md-sys-typescale-body-large-line-height, 26px);--scb-search-supporting-tracking:var(--md-sys-typescale-body-large-tracking, 0)}:host([size='small']){--scb-search-padding-x:var(--spacing-3, 8px);--scb-search-
|
|
53
|
+
);--scb-search-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-search-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-search-supporting-font-size:var(--md-sys-typescale-body-medium-size, 16px);--scb-search-supporting-line-height:var(--md-sys-typescale-body-medium-line-height, 24px);--scb-search-supporting-tracking:var(--md-sys-typescale-body-medium-tracking, 0);--scb-search-icon-size:var(--icon-size-small, 20px)}:host([size='large']){--scb-search-padding-x:var(--spacing-5, 16px);--scb-search-padding-y:calc(var(--spacing-5, 16px) - var(--spacing-1, 2px));--scb-search-leading-size:var(--scale-11, 48px);--scb-search-trailing-size:var(--scale-11, 48px);--scb-search-icon-size:var(--icon-size-medium, 24px);--scb-search-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-search-line-height:var(--md-sys-typescale-body-large-line-height, 26px);--scb-search-supporting-font-size:var(--md-sys-typescale-body-large-size, 18px);--scb-search-supporting-line-height:var(--md-sys-typescale-body-large-line-height, 26px);--scb-search-supporting-tracking:var(--md-sys-typescale-body-large-tracking, 0)}:host([size='extra-small']),:host([size='small']){--scb-search-padding-x:var(--spacing-3, 8px);--scb-search-leading-size:var(--scale-08, 32px);--scb-search-trailing-size:var(--scale-08, 32px);--scb-search-icon-size:var(--icon-size-small, 20px);--scb-search-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-search-line-height:var(--md-sys-typescale-body-small-line-height, 20px);--scb-search-supporting-font-size:var(--md-sys-typescale-body-small-size, 14px);--scb-search-supporting-line-height:var(--md-sys-typescale-body-small-line-height, 20px);--scb-search-supporting-tracking:var(--md-sys-typescale-body-small-tracking, 0)}:host([size='small']){--scb-search-padding-y:calc(var(--spacing-3, 8px) + var(--stroke-border, 1px))}:host([size='extra-small']){--scb-search-padding-y:calc(var(--spacing-2, 4px) + var(--stroke-border, 1px))}:host([disabled]){opacity:.38;cursor:default}.ripple-wrapper{position:relative;display:flex;align-items:center;width:100%}md-focus-ring.input-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-search-radius);z-index:4}.ripple-wrapper[data-kb-focus=true] md-focus-ring.input-ring{display:block}input.with-list~md-focus-ring.input-ring{border-radius:var(--scb-search-open-radius) var(--scb-search-open-radius)0 0}:host([full-screen]) md-focus-ring.input-ring{border-radius:var(--radius-none, 0px)!important}md-focus-ring.option-ring{position:absolute;display:none;pointer-events:none;z-index:11;border-radius:var(--md-sys-shape-corner-small, 8px)}md-focus-ring.option-ring[data-show=true]{display:block}.clear-btn,.leading,.trailing{position:absolute;top:50%;transform:translateY(-50%);align-items:center;justify-content:center;color:var(--md-sys-color-on-surface-variant)}.leading{left:var(--scb-search-padding-x);width:var(--scb-search-leading-size);height:var(--scb-search-leading-size);display:flex;pointer-events:none;z-index:2}.clear-btn md-icon,.leading md-icon,.trailing md-icon{--md-icon-size:var(--scb-search-icon-size);font-size:var(--scb-search-icon-size);line-height:1}.clear-btn,.trailing{right:var(--scb-search-padding-x);width:var(--scb-search-trailing-size);height:var(--scb-search-trailing-size);display:inline-flex;z-index:3}.trailing md-icon{pointer-events:none}.clear-btn{background:0 0;border:0;padding:0;cursor:pointer}.clear-btn[hidden]{display:none}.clear-btn:disabled{cursor:default}input[type=search]{padding:var(--scb-search-padding-y) var(--scb-search-trailing-gap) var(--scb-search-padding-y) var(--scb-search-leading-gap);min-height:var(--scb-search-height);width:100%;box-sizing:border-box;border:var(--stroke-border, 1px) solid var(--md-sys-color-outline);border-radius:var(--scb-search-radius);font-family:var(--md-sys-typescale-body-large-font, var(--brand-font, Inter), sans-serif);font-size:var(--scb-search-font-size);line-height:var(--scb-search-line-height);color:var(--md-sys-color-on-surface);background:0 0;position:relative;z-index:1}input[type=search]::placeholder{color:var(--md-sys-color-on-surface-variant);font-size:var(--scb-search-font-size);line-height:var(--scb-search-line-height)}input[type=search]:hover{outline:var(--md-sys-color-outline) auto var(--stroke-border, 1px)}input[type=search]:focus{outline:0}:host([error]) input[type=search]{border-color:var(--md-sys-color-error);padding-inline-end:var(--scb-search-trailing-gap)}:host([error]) input[type=search]:hover{outline-color:var(--md-sys-color-error)}.supporting-text{display:block;margin-block-start:var(--spacing-2, 4px);color:var(--md-sys-color-on-surface-variant);font-family:var(--brand-font, 'Inter', sans-serif);font-size:var(--scb-search-supporting-font-size);line-height:var(--scb-search-supporting-line-height);font-weight:var(--weight-regular, 400);letter-spacing:var(--scb-search-supporting-tracking)}:host([error]) .supporting-text{color:var(--md-sys-color-error)}.search-error-icon{position:absolute;right:var(--scb-search-padding-x);top:50%;transform:translateY(-50%);width:var(--scb-search-trailing-size);height:var(--scb-search-trailing-size);display:flex;align-items:center;justify-content:center;pointer-events:none;color:var(--md-sys-color-error);z-index:3}.search-error-icon md-icon{--md-icon-size:var(--scb-search-icon-size);font-size:var(--scb-search-icon-size);line-height:1}:host([error]) .clear-btn,:host([error]) .trailing{display:none}md-ripple{border-radius:var(--scb-search-radius);position:absolute;inset:0;z-index:2;pointer-events:none;--md-ripple-hover-color:transparent;--md-ripple-hover-opacity:0}input[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none;display:none}input.with-list,input.with-list~md-ripple{border-radius:var(--scb-search-open-radius) var(--scb-search-open-radius)0 0}scb-list.suggestion-list{--scb-list-container-padding-block:0px;position:absolute;top:100%;left:0;width:100%;z-index:10;background:var(--md-sys-color-surface-container-lowest);border:var(--stroke-border, 1px) solid var(--md-sys-color-outline);border-top:0;border-radius:0 0 var(--scb-search-open-radius) var(--scb-search-open-radius);overflow:auto;box-sizing:border-box;max-height:var(--scb-search-suggestions-max-h, 60vh)}:host([full-screen]) input.with-list,:host([full-screen]) input.with-list~md-ripple,:host([full-screen]) input[type=search]{border-radius:var(--radius-none, 0px)!important}:host([full-screen]) scb-list.suggestion-list{position:static;border:0;border-radius:0;background:0 0}.list-divider{display:none;height:var(--stroke-border, 1px);background:var(--md-sys-color-outline);width:100%}:host([full-screen]) .list-divider[aria-hidden=false]{display:block}@media (prefers-color-scheme:dark){:host{color:var(--md-sys-color-on-surface)}}`,p);n([o({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",void 0);n([o({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",void 0);n([o({type:String,attribute:"input-label"})],a.prototype,"inputLabel",void 0);n([o({type:String,attribute:"clear-label"})],a.prototype,"clearLabel",void 0);n([o({type:String,attribute:"suggestions-label"})],a.prototype,"suggestionsLabel",void 0);n([o({type:String,attribute:"error-text"})],a.prototype,"errorText",void 0);n([o({type:String})],a.prototype,"value",void 0);n([o({type:String,reflect:!0})],a.prototype,"name",void 0);n([o({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);n([o({type:Boolean,reflect:!0})],a.prototype,"required",void 0);n([o({type:Boolean,reflect:!0})],a.prototype,"error",void 0);n([o({type:Boolean,reflect:!0})],a.prototype,"autocomplete",void 0);n([o({type:String,reflect:!0})],a.prototype,"spacing",void 0);n([o({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);n([o({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);n([o({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);n([o({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);n([o({type:String,reflect:!0})],a.prototype,"size",void 0);n([o({type:Boolean,attribute:"full-screen",reflect:!0})],a.prototype,"fullScreen",void 0);n([x()],a.prototype,"_listDepsLoaded",void 0);a=n([w("scb-search")],a);export{a as ScbSearch};
|