scb-wc-test 0.1.41 → 0.1.42
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-header/scb-header.js +116 -85
- package/package.json +2 -2
- package/scb-header/scb-header.d.ts +4 -0
- package/scb-header/scb-header.js +265 -231
- package/scb-wc-test.bundle.js +215 -184
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-drawer/scb-drawer.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../scb-divider/scb-divider.js","../scb-tabs/scb-tabs.js","../../vendor/vendor-material.js","../scb-tabs/scb-primary-tab.js","../scb-tabs/scb-secondary-tab.js","../scb-search/scb-search.js","../scb-list/scb-list.js","../scb-list/scb-list-item.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i as S,x as c,E as d,t as C}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-grid/scb-grid-item.js";import"../scb-grid/scb-grid.js";import"../scb-link/scb-link.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,a,o){try{customElements.get(s)||t(s,a,o)}catch(n){var h=String(n||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var T=Object.defineProperty,A=Object.getOwnPropertyDescriptor,i=(e,t,s,a)=>{for(var o=a>1?void 0:a?A(t,s):t,h=e.length-1,n;h>=0;h--)(n=e[h])&&(o=(a?n(t,s,o):n(o))||o);return a&&o&&T(t,s,o),o};const w={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)};let r=class extends S{constructor(){super(...arguments),this.maxWidth="1440px",this.logoText="",this.logoHref="/",this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this._drawerId="main-drawer",this._drawerMounted=!1,this._drawerExpanded=!1,this._searchId="header-search",this._slotTabs=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this.__drawerLoaded=!1,this.__tabsLoaded=!1,this.__searchLoaded=!1,this._harvest=()=>{const e=this._slotEl;if(!e)return;const t=e.assignedElements({flatten:!0}),s=[],a=[],o=[],h=n=>({label:n.getAttribute("label")??"",href:n.getAttribute("href")??void 0,icon:n.getAttribute("icon")??void 0});for(const n of t){const p=n.tagName.toLowerCase();if(p==="scb-header-tab"){s.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){a.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#",target:n.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const b={label:n.getAttribute("label")??"",icon:n.getAttribute("icon")??void 0,children:[]};n.querySelectorAll("scb-header-drawer-item").forEach(m=>b.children.push(h(m))),o.push(b);continue}p==="scb-header-drawer-item"&&o.push(h(n))}this._slotTabs=s,this._slotUtils=a,this._slotMenu=o,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const s=window.innerWidth,a=e.clientWidth,o=this._overflows(this._util),h=this._overflows(this._tabsEl),n=s<this.BP_MD||o||h;this._collapsed?!n&&a>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=a+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const m=getComputedStyle(this._searchWrap),y=Math.max(this._num(m.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),_=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+_+y+_+f+8>a+.5}this._setHideSearch(p);let b=!1;if(this.showDrawer&&(s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const m=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),y=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),_=(this._logoGroup?.getBoundingClientRect().width||0)+m+y;this._hideLogoText?b=!(a>=this._logoTextUnlockAt):_>a+.5&&(b=!0,this._logoTextUnlockAt=a+this._HYST)}else b=!1,this._logoTextUnlockAt=0;this._setHideLogoText(b)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await r._nextFrame(),await r._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const s=t?.value??void 0;this.dispatchEvent(new CustomEvent("search-click",{detail:{value:s},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabsChange=e=>{const s=e?.detail?.activeTabIndex??e.target?.activeTabIndex??0;this.activeTab=s;const o=(this._slotTabs.length?this._slotTabs:this.tabs)[s]?.href??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:o},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",r.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",r.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}async __ensureDrawer(){if(!this.__drawerLoaded)return this.__ensureDrawerPromise??(this.__ensureDrawerPromise=(async()=>{await g(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([g(()=>import("../scb-tabs/scb-tabs.js"),__vite__mapDeps([4,5,2,6,1,7]),import.meta.url),g(()=>import("../scb-tabs/scb-secondary-tab.js"),__vite__mapDeps([7,1,5,2]),import.meta.url)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await g(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([8,2,9,1,10,5]),import.meta.url),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){return this.shadowRoot?.querySelector("slot#data-slot")??null}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _tabsEl(){return this.renderRoot.querySelector("scb-tabs")}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 _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target"]})}_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"))}_num(e,t){const s=Number.parseFloat(String(e??"").trim());return Number.isFinite(s)?s:t}_tokenPx(e,t){const s=getComputedStyle(this);return this._num(s.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}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()});const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0});const t=this._menuBtn,s=()=>this._ensureDrawerMounted();t?.addEventListener("pointerenter",s,{once:!0}),t?.addEventListener("focusin",s,{once:!0}),t?.addEventListener("touchstart",s,{once:!0,passive:!0});const a=o=>"requestIdleCallback"in window?window.requestIdleCallback(o,{timeout:1500}):setTimeout(o,600);this.showDrawer&&a(()=>{this.__ensureDrawer()}),this._collapsed||a(()=>{this.__ensureTabs()}),this.showSearch&&a(()=>{this.__ensureSearch()})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),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("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("activeTab")||e.has("_slotTabs")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin"))&&this.updateComplete.then(()=>{this._scheduleMeasure(),this._applyActiveToTabs()}),e.has("showSearch")&&this.showSearch&&!this.__searchLoaded&&this.__ensureSearch()}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_applyActiveToTabs(){const e=this._tabsEl;if(!e)return;e.activeTabIndex=this.activeTab,e.querySelectorAll("scb-secondary-tab").forEach((s,a)=>{s.selected=a===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const s=Array.isArray(t.children)&&t.children.length>0;return c`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-drawer/scb-drawer.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../scb-divider/scb-divider.js","../scb-tabs/scb-tabs.js","../../vendor/vendor-material.js","../scb-tabs/scb-primary-tab.js","../scb-tabs/scb-secondary-tab.js","../scb-search/scb-search.js","../scb-list/scb-list.js","../scb-list/scb-list-item.js","../scb-icon-button/scb-icon-button.js","../scb-tooltip/scb-tooltip.js","../scb-button/scb-button.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i as S,x as n,E as u,t as C}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,a,l){try{customElements.get(s)||t(s,a,l)}catch(o){var d=String(o||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(e,t,s,a)=>{for(var l=a>1?void 0:a?k(t,s):t,d=e.length-1,o;d>=0;d--)(o=e[d])&&(l=(a?o(t,s,l):o(l))||l);return a&&l&&$(t,s,l),l};const w={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)};let r=class extends S{constructor(){super(...arguments),this.maxWidth="1440px",this.logoText="",this.logoHref="/",this.banner=!1,this.tabs=[],this.activeTab=0,this.utilityItems=[],this.showDrawer=!0,this.showSearch=!0,this.includeUtilityInDrawer=!1,this._drawerId="main-drawer",this._drawerMounted=!1,this._drawerExpanded=!1,this._searchId="header-search",this._slotTabs=[],this._slotUtils=[],this._slotMenu=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{this._scheduleMeasure()},this._onDrawerSelect=e=>{this.dispatchEvent(new CustomEvent("drawer-select",{detail:e.detail,bubbles:!0,composed:!0})),this._closeDrawerNow()},this._collapsed=!1,this._unlockAtWidth=0,this._hideLogoText=!1,this._logoTextUnlockAt=0,this._harvestPending=!1,this.__drawerLoaded=!1,this.__tabsLoaded=!1,this.__searchLoaded=!1,this.__iconBtnLoaded=!1,this._harvest=()=>{const e=this._slotEl;if(!e)return;const t=e.assignedElements({flatten:!0}),s=[],a=[],l=[],d=o=>({label:o.getAttribute("label")??"",href:o.getAttribute("href")??void 0,icon:o.getAttribute("icon")??void 0});for(const o of t){const p=o.tagName.toLowerCase();if(p==="scb-header-tab"){s.push({label:o.getAttribute("label")??"",href:o.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){a.push({label:o.getAttribute("label")??"",href:o.getAttribute("href")??"#",target:o.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const c={label:o.getAttribute("label")??"",icon:o.getAttribute("icon")??void 0,children:[]};o.querySelectorAll("scb-header-drawer-item").forEach(_=>c.children.push(d(_))),l.push(c);continue}p==="scb-header-drawer-item"&&l.push(d(o))}this._slotTabs=s,this._slotUtils=a,this._slotMenu=l,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{const e=this._top,t=this._logoGroup;if(!e||!t)return;const s=window.innerWidth,a=e.clientWidth,l=this._overflows(this._util),d=this._overflows(this._tabsEl),o=s<this.BP_MD||l||d;this._collapsed?!o&&a>=this._unlockAtWidth&&this._setCollapsed(!1):o&&(this._unlockAtWidth=a+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&s>=this.BP_SM&&s<this.BP_MD&&this._searchWrap){const _=getComputedStyle(this._searchWrap),v=Math.max(this._num(_.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),g=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(s<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+g+v+g+f+8>a+.5}this._setHideSearch(p);let c=!1;if(this.showDrawer&&(s<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const _=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),v=this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48),g=(this._logoGroup?.getBoundingClientRect().width||0)+_+v;this._hideLogoText?c=!(a>=this._logoTextUnlockAt):g>a+.5&&(c=!0,this._logoTextUnlockAt=a+this._HYST)}else c=!1,this._logoTextUnlockAt=0;this._setHideLogoText(c)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this.__ensureIconButton(),await this._ensureDrawerMounted(),await r._nextFrame(),await r._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl,s=t?.value??void 0;this.dispatchEvent(new CustomEvent("search-click",{detail:{value:s},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabsChange=e=>{const s=e?.detail?.activeTabIndex??e.target?.activeTabIndex??0;this.activeTab=s;const l=(this._slotTabs.length?this._slotTabs:this.tabs)[s]?.href??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:s,href:l},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",r.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",r.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}async __ensureDrawer(){if(!this.__drawerLoaded)return this.__ensureDrawerPromise??(this.__ensureDrawerPromise=(async()=>{await m(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([m(()=>import("../scb-tabs/scb-tabs.js"),__vite__mapDeps([4,5,2,6,1,7]),import.meta.url),m(()=>import("../scb-tabs/scb-secondary-tab.js"),__vite__mapDeps([7,1,5,2]),import.meta.url)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await m(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([8,2,9,1,10,5]),import.meta.url),this.__searchLoaded=!0})()),this.__ensureSearchPromise}async __ensureIconButton(){if(!this.__iconBtnLoaded)return this.__ensureIconBtnPromise??(this.__ensureIconBtnPromise=(async()=>{await m(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([11,1,2,5,12,13]),import.meta.url),this.__iconBtnLoaded=!0,this.requestUpdate()})()),this.__ensureIconBtnPromise}_modulePreload(e){const t=document.createElement("link");t.rel="modulepreload",t.href=e,document.head.appendChild(t)}get _slotEl(){return this.shadowRoot?.querySelector("slot#data-slot")??null}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _tabsEl(){return this.renderRoot.querySelector("scb-tabs")}get _logoGroup(){return this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _searchEl(){return this.renderRoot.querySelector(`#${this._searchId}`)}_attachSlotObservers(){this._slotMo?.disconnect();const e=new MutationObserver(t=>{this._scheduleHarvest()});this._slotMo=e,e.observe(this,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["label","href","icon","target"]})}_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"))}_num(e,t){const s=Number.parseFloat(String(e??"").trim());return Number.isFinite(s)?s:t}_tokenPx(e,t){const s=getComputedStyle(this);return this._num(s.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}firstUpdated(){this.updateComplete.then(()=>{this._harvest(),this._attachSlotObservers()}),this.style.setProperty("--scb-header-max-width",this.maxWidth);const e=this._top;e&&(this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(e)),window.addEventListener("resize",this._onWindowResize,{passive:!0});const t=this._menuBtn,s=()=>this._ensureDrawerMounted();t?.addEventListener("pointerenter",s,{once:!0}),t?.addEventListener("focusin",s,{once:!0}),t?.addEventListener("touchstart",s,{once:!0,passive:!0});const a=l=>"requestIdleCallback"in window?window.requestIdleCallback(l,{timeout:1500}):setTimeout(l,600);this.showDrawer&&a(()=>{this.__ensureDrawer(),this._modulePreload("../scb-drawer/scb-drawer.js")}),this._collapsed||a(()=>{this.__ensureTabs(),this._modulePreload("../scb-tabs/scb-tabs.js"),this._modulePreload("../scb-tabs/scb-secondary-tab.js")}),this.showSearch&&a(()=>{this.__ensureSearch(),this._modulePreload("../scb-search/scb-search.js")}),this.showDrawer&&a(()=>{this.__ensureIconButton(),this._modulePreload("../scb-icon-button/scb-icon-button.js")})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"480px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"320px"),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("utilityItems")||e.has("tabs")||e.has("logoText")||e.has("activeTab")||e.has("_slotTabs")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("showSearch")||e.has("searchMax")||e.has("searchMin"))&&this.updateComplete.then(()=>{this._scheduleMeasure(),this._applyActiveToTabs()}),e.has("showSearch")&&this.showSearch&&!this.__searchLoaded&&this.__ensureSearch()}disconnectedCallback(){this._ro?.disconnect(),this._slotMo?.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),e.show?.(),e.openDrawer?.(),this._drawerExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})))}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1),this._drawerExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0}))}_syncMenuBtnAria(){const e=this.renderRoot.querySelector(".menu-trigger");e&&e.setAttribute("aria-expanded",String(this._drawerExpanded))}_applyActiveToTabs(){const e=this._tabsEl;if(!e)return;e.activeTabIndex=this.activeTab,e.querySelectorAll("scb-secondary-tab").forEach((s,a)=>{s.selected=a===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?n``:n`${e.map(t=>{const s=Array.isArray(t.children)&&t.children.length>0;return n`
|
|
3
3
|
<scb-drawer-item
|
|
4
4
|
label=${t.label}
|
|
5
5
|
?selected=${!1}
|
|
6
6
|
leading-icon=${t.icon??""}
|
|
7
7
|
item-href=${t.href??""}
|
|
8
8
|
>
|
|
9
|
-
${s?
|
|
9
|
+
${s?n`
|
|
10
10
|
<scb-sub-drawer label=${t.label}>
|
|
11
|
-
${t.children.map(a=>
|
|
11
|
+
${t.children.map(a=>n`
|
|
12
12
|
<scb-drawer-item
|
|
13
13
|
label=${a.label}
|
|
14
14
|
item-href=${a.href??""}
|
|
@@ -16,77 +16,92 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
16
16
|
></scb-drawer-item>
|
|
17
17
|
`)}
|
|
18
18
|
</scb-sub-drawer>
|
|
19
|
-
`:
|
|
19
|
+
`:u}
|
|
20
20
|
</scb-drawer-item>
|
|
21
|
-
`})}`}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}render(){const e=this._slotTabs.length?this._slotTabs:this.tabs,t=this._slotUtils.length?this._slotUtils:this.utilityItems,s=this._slotMenu.length?this._slotMenu:this.menuData??[];this._syncFlags(t.length===0,!this.showSearch);const a=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:d;return
|
|
21
|
+
`})}`}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}render(){const e=this._slotTabs.length?this._slotTabs:this.tabs,t=this._slotUtils.length?this._slotUtils:this.utilityItems,s=this._slotMenu.length?this._slotMenu:this.menuData??[];this._syncFlags(t.length===0,!this.showSearch);const a=this.searchHeight&&this.searchHeight.trim()?`--scb-search-height:${this.searchHeight.trim()}`:u,l=!!customElements.get("scb-link"),d=!!customElements.get("scb-button"),o=!!customElements.get("scb-search"),p=this.__iconBtnLoaded||!!customElements.get("scb-icon-button");return n`
|
|
22
22
|
<slot id="data-slot" @slotchange=${()=>{this._harvest(),this._attachSlotObservers()}} hidden></slot>
|
|
23
23
|
|
|
24
24
|
<div
|
|
25
25
|
class="header-landmark"
|
|
26
|
-
role=${this.banner?"banner":
|
|
27
|
-
aria-label=${this.banner&&this.bannerLabel?this.bannerLabel:
|
|
26
|
+
role=${this.banner?"banner":u}
|
|
27
|
+
aria-label=${this.banner&&this.bannerLabel?this.bannerLabel:u}
|
|
28
28
|
>
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<div class="
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<md-focus-ring></md-focus-ring>
|
|
37
|
-
</div>
|
|
29
|
+
<div class="container">
|
|
30
|
+
<div class="top-row">
|
|
31
|
+
<div class="logo-wrap">
|
|
32
|
+
<a class="logo-group" href=${this.logoHref} aria-label="Gå till startsidan">
|
|
33
|
+
${this._renderLogo()} <span class="logo-text">${this.logoText}</span>
|
|
34
|
+
</a>
|
|
35
|
+
</div>
|
|
38
36
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
<div class="actions">
|
|
38
|
+
<nav class="utility" aria-label="Funktionslänkar">
|
|
39
|
+
${t.map(c=>l?n`<scb-link .href=${c.href} .target=${c.target??void 0}>${c.label}</scb-link>`:n`<a class="link-fallback" href=${c.href} target=${c.target??u} rel=${c.target==="_blank"?"noopener noreferrer":u}>${c.label}</a>`)}
|
|
40
|
+
</nav>
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
${this.showSearch?n`
|
|
43
|
+
<div class="search" style=${a}
|
|
44
|
+
@focusin=${()=>this.__ensureSearch()}
|
|
45
|
+
@pointerenter=${()=>this.__ensureSearch()}>
|
|
46
|
+
${o?n`
|
|
46
47
|
<scb-search
|
|
47
48
|
id=${this._searchId}
|
|
48
49
|
size="compact"
|
|
49
50
|
style=${a}
|
|
50
51
|
.supportingText=${this.searchPlaceholder??""}
|
|
51
52
|
></scb-search>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</div>
|
|
53
|
+
`:n`
|
|
54
|
+
<input id=${this._searchId} class="search-input" type="search" placeholder=${this.searchPlaceholder??"Sök"} />
|
|
55
|
+
`}
|
|
56
|
+
${d?n`<scb-button variant="filled-tonal" label="Sök" @click=${this._onSearchClick}></scb-button>`:n`<button class="btn-fallback" type="button" @click=${this._onSearchClick}>Sök</button>`}
|
|
57
|
+
</div>
|
|
58
|
+
`:u}
|
|
59
|
+
</div>
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
${this.showDrawer?n`
|
|
62
|
+
${p?n`
|
|
62
63
|
<scb-icon-button
|
|
63
64
|
class="menu-trigger"
|
|
64
65
|
aria-label="Meny"
|
|
65
66
|
icon="menu"
|
|
66
67
|
variant="outlined"
|
|
67
|
-
aria-controls=${this._drawerMounted?this._drawerId:
|
|
68
|
+
aria-controls=${this._drawerMounted?this._drawerId:u}
|
|
68
69
|
aria-haspopup="dialog"
|
|
69
70
|
aria-expanded=${String(this._drawerExpanded)}
|
|
70
71
|
data-drawer-toggle=${this._drawerId}
|
|
71
72
|
title="Öppna meny"
|
|
73
|
+
@pointerenter=${()=>this.__ensureIconButton()}
|
|
74
|
+
@focusin=${()=>this.__ensureIconButton()}
|
|
72
75
|
@click=${this._onMenuClick}
|
|
73
76
|
></scb-icon-button>
|
|
74
|
-
`:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
`:n`
|
|
78
|
+
<button class="menu-btn-fallback menu-trigger"
|
|
79
|
+
aria-label="Meny"
|
|
80
|
+
aria-controls=${this._drawerMounted?this._drawerId:u}
|
|
81
|
+
aria-haspopup="dialog"
|
|
82
|
+
aria-expanded=${String(this._drawerExpanded)}
|
|
83
|
+
title="Öppna meny"
|
|
84
|
+
@pointerenter=${()=>this.__ensureIconButton()}
|
|
85
|
+
@focusin=${()=>this.__ensureIconButton()}
|
|
86
|
+
@click=${this._onMenuClick}>
|
|
87
|
+
☰
|
|
88
|
+
</button>
|
|
89
|
+
`}
|
|
90
|
+
`:u}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
77
93
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</scb-grid>
|
|
94
|
+
<div class="container">
|
|
95
|
+
<div class="tabs-inset" @pointerenter=${()=>this.__ensureTabs()} @focusin=${()=>this.__ensureTabs()}>
|
|
96
|
+
<scb-tabs aria-label="Huvudnavigering" .activeTabIndex=${this.activeTab} @change=${this._onTabsChange}>
|
|
97
|
+
${e.map((c,y)=>n`<scb-secondary-tab ?selected=${y===this.activeTab}>${c.label}</scb-secondary-tab>`)}
|
|
98
|
+
</scb-tabs>
|
|
99
|
+
</div>
|
|
100
|
+
<div class="divider" role="presentation"></div>
|
|
101
|
+
</div>
|
|
87
102
|
</div>
|
|
88
103
|
|
|
89
|
-
${this.showDrawer&&this._drawerMounted?
|
|
104
|
+
${this.showDrawer&&this._drawerMounted?n`
|
|
90
105
|
<scb-drawer
|
|
91
106
|
id=${this._drawerId}
|
|
92
107
|
.label=${this.drawerLabel??""}
|
|
@@ -95,20 +110,24 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
95
110
|
@scb-drawer-select=${this._onDrawerSelect}
|
|
96
111
|
>
|
|
97
112
|
<div style="padding: var(--spacing-4, 12px);">
|
|
98
|
-
|
|
113
|
+
${customElements.get("scb-search")?n`
|
|
114
|
+
<scb-search size="compact" .supportingText=${this.drawerSearchPlaceholder??""}></scb-search>
|
|
115
|
+
`:n`
|
|
116
|
+
<input class="search-input" type="search" placeholder=${this.drawerSearchPlaceholder??"Sök"} />
|
|
117
|
+
`}
|
|
99
118
|
</div>
|
|
100
119
|
|
|
101
|
-
${this.drawerSectionLabel?
|
|
120
|
+
${this.drawerSectionLabel?n`<scb-drawer-section .label=${this.drawerSectionLabel}></scb-drawer-section>`:u}
|
|
102
121
|
|
|
103
122
|
${this._renderDrawerNodes(s)}
|
|
104
123
|
|
|
105
|
-
${this.includeUtilityInDrawer&&(t?.length??0)>0?
|
|
124
|
+
${this.includeUtilityInDrawer&&(t?.length??0)>0?n`
|
|
106
125
|
<scb-drawer-section label=''></scb-drawer-section>
|
|
107
|
-
${t.map(
|
|
108
|
-
`:
|
|
126
|
+
${t.map(c=>n`<scb-drawer-item label=${c.label} item-href=${c.href}></scb-drawer-item>`)}
|
|
127
|
+
`:u}
|
|
109
128
|
</scb-drawer>
|
|
110
|
-
`:
|
|
111
|
-
`}_renderLogo(){return
|
|
129
|
+
`:u}
|
|
130
|
+
`}_renderLogo(){return n`
|
|
112
131
|
<svg class="logo" viewBox="0 0 48 54" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
113
132
|
<g clip-path="url(#clip0_scb_header)">
|
|
114
133
|
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"
|
|
@@ -132,26 +151,16 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
132
151
|
--scb-header-logo-h: calc(var(--scb-header-logo-w) * 1.125);
|
|
133
152
|
}
|
|
134
153
|
|
|
154
|
+
.container { max-width: var(--scb-header-max-width, 1440px); margin: 0 auto; padding-inline: var(--spacing-7,24px); }
|
|
135
155
|
.top-row { display:flex; align-items:center; gap:var(--spacing-7,24px); padding-block:var(--spacing-7,24px); min-width:0; }
|
|
136
156
|
|
|
137
157
|
.logo-wrap {
|
|
138
158
|
display:inline-block;
|
|
139
159
|
position:relative;
|
|
140
|
-
|
|
141
|
-
border-radius: var(--scb-header-logo-focus-ring-radius, var(--md-sys-shape-corner-small, 4px));
|
|
142
|
-
}
|
|
143
|
-
.logo-wrap md-focus-ring {
|
|
144
|
-
position:absolute;
|
|
145
|
-
inset:0;
|
|
146
|
-
pointer-events:none;
|
|
147
|
-
display:none;
|
|
148
|
-
border-radius: inherit;
|
|
160
|
+
border-radius: var(--md-sys-shape-corner-small, 4px);
|
|
149
161
|
}
|
|
150
|
-
.logo-
|
|
151
|
-
|
|
152
|
-
.logo-group { display:inline-flex; align-items:center; gap:var(--spacing-5,16px); text-decoration:none; color:inherit; flex-shrink:0; min-width:0; }
|
|
153
|
-
.logo-group:focus,
|
|
154
|
-
.logo-group:focus-visible { outline: none; }
|
|
162
|
+
.logo-group { display:inline-flex; align-items:center; gap:var(--spacing-5,16px); text-decoration:none; color:inherit; flex-shrink:0; min-width:0; outline: none; }
|
|
163
|
+
.logo-group:focus-visible { outline: var(--stroke-focus-ring, 3px) solid var(--md-focus-ring-color, color-mix(in oklab, currentColor 30%, transparent)); outline-offset: 3px; border-radius: var(--md-sys-shape-corner-small, 4px); }
|
|
155
164
|
.logo-group svg {
|
|
156
165
|
width:var(--scb-header-logo-w);
|
|
157
166
|
height:var(--scb-header-logo-h);
|
|
@@ -174,14 +183,11 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
174
183
|
.actions{ display:flex; align-items:center; gap:var(--spacing-7,24px); margin-left:auto; width:100%; justify-content:flex-end; min-width:0; }
|
|
175
184
|
|
|
176
185
|
.utility{ display:none; flex-wrap:nowrap; align-items:center; gap:var(--spacing-5,16px); min-width:0; }
|
|
177
|
-
.utility
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
183
|
-
--scb-link-color: var(--md-sys-color-primary);
|
|
184
|
-
--scb-link-white-space: nowrap;
|
|
186
|
+
.utility a.link-fallback{
|
|
187
|
+
text-decoration: none;
|
|
188
|
+
color: var(--md-sys-color-primary);
|
|
189
|
+
font: inherit;
|
|
190
|
+
white-space: nowrap;
|
|
185
191
|
}
|
|
186
192
|
@media (min-width:840px){ .utility{ display:flex; } }
|
|
187
193
|
:host([data-collapsed]) .utility{ display:none !important; }
|
|
@@ -190,6 +196,17 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
190
196
|
@media (max-width:839.98px){ .menu-trigger{ display:inline-flex; } }
|
|
191
197
|
:host([data-collapsed]) .menu-trigger{ display:inline-flex; }
|
|
192
198
|
|
|
199
|
+
.menu-btn-fallback{
|
|
200
|
+
display:inline-flex; align-items:center; justify-content:center;
|
|
201
|
+
padding: 8px; border-radius: var(--md-sys-shape-corner-small, 4px);
|
|
202
|
+
border: 1px solid var(--md-sys-color-outline-variant, #e0e0e0);
|
|
203
|
+
background: var(--md-sys-color-surface);
|
|
204
|
+
color: var(--md-sys-color-on-surface);
|
|
205
|
+
min-width: 40px; min-height: 40px;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
}
|
|
208
|
+
.menu-btn-fallback:focus-visible { outline: var(--stroke-focus-ring, 3px) solid var(--md-focus-ring-color, color-mix(in oklab, currentColor 30%, transparent)); outline-offset: 2px; }
|
|
209
|
+
|
|
193
210
|
.search{
|
|
194
211
|
display:none;
|
|
195
212
|
align-items:stretch;
|
|
@@ -198,11 +215,27 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
198
215
|
max-width: var(--scb-header-search-max);
|
|
199
216
|
min-width: var(--scb-header-search-min);
|
|
200
217
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
218
|
+
.search-input{
|
|
219
|
+
appearance: none;
|
|
220
|
+
border: 1px solid var(--md-sys-color-outline-variant, #e0e0e0);
|
|
221
|
+
background: var(--md-sys-color-surface);
|
|
222
|
+
color: var(--md-sys-color-on-surface);
|
|
223
|
+
padding: 0 var(--spacing-4, 12px);
|
|
224
|
+
border-radius: var(--md-sys-shape-corner-large, 16px);
|
|
225
|
+
height: var(--scb-search-height, 36px);
|
|
226
|
+
width: 100%;
|
|
227
|
+
font: inherit;
|
|
228
|
+
}
|
|
229
|
+
.search button, .btn-fallback {
|
|
230
|
+
border: 1px solid transparent;
|
|
231
|
+
background: color-mix(in oklab, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface));
|
|
232
|
+
color: var(--md-sys-color-primary);
|
|
233
|
+
padding: 0 var(--spacing-5, 16px);
|
|
234
|
+
border-radius: var(--md-sys-shape-corner-large, 16px);
|
|
235
|
+
height: var(--scb-search-height, 36px);
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
font: inherit;
|
|
238
|
+
white-space: nowrap;
|
|
206
239
|
}
|
|
207
240
|
@media (min-width:600px){ .search{ display:flex; } }
|
|
208
241
|
@media (min-width:600px) and (max-width:839.98px){ :host([data-hide-search]) .search{ display:none !important; } }
|
|
@@ -214,7 +247,7 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
214
247
|
min-width: var(--scb-header-search-min);
|
|
215
248
|
}
|
|
216
249
|
|
|
217
|
-
.tabs-inset{ display:inline-block; width:fit-content; max-width:100%; }
|
|
250
|
+
.tabs-inset{ display:inline-block; width:fit-content; max-width:100%; content-visibility: auto; contain-intrinsic-size: 44px 320px; }
|
|
218
251
|
@media (max-width:839.98px){ .tabs-inset{ display:none; } }
|
|
219
252
|
scb-tabs, scb-tabs::part(divider){
|
|
220
253
|
--md-tabs-divider-color:transparent; --md-primary-tab-divider-color:transparent; --md-secondary-tab-divider-color:transparent;
|
|
@@ -262,7 +295,5 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
262
295
|
}
|
|
263
296
|
}
|
|
264
297
|
|
|
265
|
-
:host([data-hide-logo-text]) .logo-text {
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
`;r._nextFrame=()=>new Promise(e=>requestAnimationFrame(()=>e()));i([l({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);i([l({type:String,attribute:"logo-text"})],r.prototype,"logoText",2);i([l({type:String,attribute:"logo-href"})],r.prototype,"logoHref",2);i([l({type:Boolean,reflect:!0})],r.prototype,"banner",2);i([l({type:String,attribute:"banner-label"})],r.prototype,"bannerLabel",2);i([l({attribute:"tabs",converter:r._JSON_ARRAY})],r.prototype,"tabs",2);i([l({type:Number,attribute:"active-tab"})],r.prototype,"activeTab",2);i([l({attribute:"utility-items",converter:r._JSON_ARRAY})],r.prototype,"utilityItems",2);i([l({type:String,attribute:"search-placeholder"})],r.prototype,"searchPlaceholder",2);i([l({type:String,attribute:"drawer-label"})],r.prototype,"drawerLabel",2);i([l({type:String,attribute:"drawer-sub-label"})],r.prototype,"drawerSubLabel",2);i([l({type:String,attribute:"drawer-section-label"})],r.prototype,"drawerSectionLabel",2);i([l({type:String,attribute:"drawer-search-placeholder"})],r.prototype,"drawerSearchPlaceholder",2);i([l({attribute:"menu-data",converter:r._JSON_ARRAY})],r.prototype,"menuData",2);i([l({attribute:"show-drawer",reflect:!0,converter:w})],r.prototype,"showDrawer",2);i([l({attribute:"show-search",reflect:!0,converter:w})],r.prototype,"showSearch",2);i([l({attribute:"include-utility-in-drawer",reflect:!0,converter:w})],r.prototype,"includeUtilityInDrawer",2);i([l({type:String,attribute:"search-max"})],r.prototype,"searchMax",2);i([l({type:String,attribute:"search-min"})],r.prototype,"searchMin",2);i([l({type:String,attribute:"search-height"})],r.prototype,"searchHeight",2);i([u()],r.prototype,"_drawerId",2);i([u()],r.prototype,"_drawerMounted",2);i([u()],r.prototype,"_drawerExpanded",2);i([u()],r.prototype,"_searchId",2);i([u()],r.prototype,"_slotTabs",2);i([u()],r.prototype,"_slotUtils",2);i([u()],r.prototype,"_slotMenu",2);i([u()],r.prototype,"_collapsed",2);i([u()],r.prototype,"_hideLogoText",2);r=i([C("scb-header")],r);
|
|
298
|
+
:host([data-hide-logo-text]) .logo-text { display: none; }
|
|
299
|
+
`;r._nextFrame=()=>new Promise(e=>requestAnimationFrame(()=>e()));i([h({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);i([h({type:String,attribute:"logo-text"})],r.prototype,"logoText",2);i([h({type:String,attribute:"logo-href"})],r.prototype,"logoHref",2);i([h({type:Boolean,reflect:!0})],r.prototype,"banner",2);i([h({type:String,attribute:"banner-label"})],r.prototype,"bannerLabel",2);i([h({attribute:"tabs",converter:r._JSON_ARRAY})],r.prototype,"tabs",2);i([h({type:Number,attribute:"active-tab"})],r.prototype,"activeTab",2);i([h({attribute:"utility-items",converter:r._JSON_ARRAY})],r.prototype,"utilityItems",2);i([h({type:String,attribute:"search-placeholder"})],r.prototype,"searchPlaceholder",2);i([h({type:String,attribute:"drawer-label"})],r.prototype,"drawerLabel",2);i([h({type:String,attribute:"drawer-sub-label"})],r.prototype,"drawerSubLabel",2);i([h({type:String,attribute:"drawer-section-label"})],r.prototype,"drawerSectionLabel",2);i([h({type:String,attribute:"drawer-search-placeholder"})],r.prototype,"drawerSearchPlaceholder",2);i([h({attribute:"menu-data",converter:r._JSON_ARRAY})],r.prototype,"menuData",2);i([h({attribute:"show-drawer",reflect:!0,converter:w})],r.prototype,"showDrawer",2);i([h({attribute:"show-search",reflect:!0,converter:w})],r.prototype,"showSearch",2);i([h({attribute:"include-utility-in-drawer",reflect:!0,converter:w})],r.prototype,"includeUtilityInDrawer",2);i([h({type:String,attribute:"search-max"})],r.prototype,"searchMax",2);i([h({type:String,attribute:"search-min"})],r.prototype,"searchMin",2);i([h({type:String,attribute:"search-height"})],r.prototype,"searchHeight",2);i([b()],r.prototype,"_drawerId",2);i([b()],r.prototype,"_drawerMounted",2);i([b()],r.prototype,"_drawerExpanded",2);i([b()],r.prototype,"_searchId",2);i([b()],r.prototype,"_slotTabs",2);i([b()],r.prototype,"_slotUtils",2);i([b()],r.prototype,"_slotMenu",2);i([b()],r.prototype,"_collapsed",2);i([b()],r.prototype,"_hideLogoText",2);r=i([C("scb-header")],r);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -274,5 +274,5 @@
|
|
|
274
274
|
},
|
|
275
275
|
"./mvc/*": "./mvc/*"
|
|
276
276
|
},
|
|
277
|
-
"buildHash": "
|
|
277
|
+
"buildHash": "61CE6023504C9627C982ABAD5BEC302881F87A9153C3CD325E49817852FB4CE6"
|
|
278
278
|
}
|
|
@@ -63,12 +63,16 @@ export declare class ScbHeader extends LitElement {
|
|
|
63
63
|
private __drawerLoaded;
|
|
64
64
|
private __tabsLoaded;
|
|
65
65
|
private __searchLoaded;
|
|
66
|
+
private __iconBtnLoaded;
|
|
66
67
|
private __ensureDrawerPromise?;
|
|
67
68
|
private __ensureTabsPromise?;
|
|
68
69
|
private __ensureSearchPromise?;
|
|
70
|
+
private __ensureIconBtnPromise?;
|
|
69
71
|
private __ensureDrawer;
|
|
70
72
|
private __ensureTabs;
|
|
71
73
|
private __ensureSearch;
|
|
74
|
+
private __ensureIconButton;
|
|
75
|
+
private _modulePreload;
|
|
72
76
|
static styles: import('lit').CSSResult;
|
|
73
77
|
private get _slotEl();
|
|
74
78
|
private get _top();
|