scb-wc-test 0.1.42 → 0.1.44
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-calendar-card/scb-calendar-card.js +2 -4
- package/mvc/components/scb-header/scb-header.js +85 -116
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +10 -10
- package/package.json +2 -2
- package/scb-calendar-card/scb-calendar-card.js +6 -8
- package/scb-header/scb-header.d.ts +0 -4
- package/scb-header/scb-header.js +231 -265
- package/scb-keyfigure-card/scb-keyfigure-card.js +7 -7
- package/scb-wc-test.bundle.js +186 -219
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x as h,t as
|
|
2
|
+
import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x as h,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(n,o,a){try{customElements.get(n)||s(n,o,a)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,t=(i,s,n,o)=>{for(var a=o>1?void 0:o?v(s,n):s,l=i.length-1,d;l>=0;l--)(d=i[l])&&(a=(o?d(s,n,a):d(a))||a);return o&&a&&y(s,n,a),a};let e=class extends f{constructor(){super(...arguments),this.variant="default",this.direction="horizontal",this.title="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="stretch"}async firstUpdated(){e.__iconLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(i=>i.i),__vite__mapDeps([0,1]),import.meta.url),e.__iconLoaded=!0),e.__rippleLoaded||(await p(()=>import("../../vendor/vendor-material.js").then(i=>i.r),__vite__mapDeps([0,1]),import.meta.url),e.__rippleLoaded=!0),this.__applyInnerSizing()}render(){const i=this.variant?`${this.variant.toLowerCase()}`:"",s=this.direction?`${this.direction.toLowerCase()}`:"",n=this.cardHref?"clickable":"",o=1,a="Jan",l=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",d=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",c=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",m=`${l?`inline-size:${l};`:""}${d?`block-size:${d};`:""}${c?`aspect-ratio:${c};`:""}`;return h`
|
|
3
3
|
<div
|
|
4
4
|
class="calendar-card ${s} ${n} ${i}"
|
|
5
5
|
role="${this.cardHref?"link":"group"}"
|
|
@@ -121,8 +121,6 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
121
121
|
|
|
122
122
|
.media {
|
|
123
123
|
display: flex;
|
|
124
|
-
/* Bredd/höjd sätts i första hand av inline-style från mediaWidth/mediaHeight.
|
|
125
|
-
Dessa fungerar som fallbackvärden. */
|
|
126
124
|
width: var(--spacing-spacing-11, 64px);
|
|
127
125
|
min-width: var(--spacing-spacing-11, 64px);
|
|
128
126
|
max-width: var(--spacing-spacing-11, 64px);
|
|
@@ -227,4 +225,4 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as g,n as r,i as f,x
|
|
|
227
225
|
text-overflow: clip;
|
|
228
226
|
font-variant-numeric: tabular-nums;
|
|
229
227
|
}
|
|
230
|
-
`;t([r({type:String,reflect:!0})],e.prototype,"variant",2);t([r({type:String,reflect:!0})],e.prototype,"direction",2);t([r({type:String})],e.prototype,"title",2);t([r({type:String})],e.prototype,"subtitle",2);t([r({type:String,attribute:"supporting-text"})],e.prototype,"supportingText",2);t([r({type:String,attribute:"card-href"})],e.prototype,"cardHref",2);t([r({type:String,attribute:"card-href-nav"})],e.prototype,"cardHrefNav",2);t([r({type:Boolean,reflect:!0,attribute:"show-media"})],e.prototype,"showMedia",2);t([r({type:String,attribute:"media-width"})],e.prototype,"mediaWidth",2);t([r({type:String,attribute:"media-height"})],e.prototype,"mediaHeight",2);t([r({type:String,attribute:"media-aspect"})],e.prototype,"mediaAspect",2);t([r({type:String})],e.prototype,"width",2);t([r({type:String,attribute:"max-width"})],e.prototype,"maxWidth",2);t([r({type:String,attribute:"min-width"})],e.prototype,"minWidth",2);t([r({type:String})],e.prototype,"height",2);t([r({type:String,attribute:"max-height"})],e.prototype,"maxHeight",2);t([r({type:String,attribute:"min-height"})],e.prototype,"minHeight",2);t([r({type:String,reflect:!0})],e.prototype,"sizing",2);e=t([
|
|
228
|
+
`;t([r({type:String,reflect:!0})],e.prototype,"variant",2);t([r({type:String,reflect:!0})],e.prototype,"direction",2);t([r({type:String})],e.prototype,"title",2);t([r({type:String})],e.prototype,"subtitle",2);t([r({type:String,attribute:"supporting-text"})],e.prototype,"supportingText",2);t([r({type:String,attribute:"card-href"})],e.prototype,"cardHref",2);t([r({type:String,attribute:"card-href-nav"})],e.prototype,"cardHrefNav",2);t([r({type:Boolean,reflect:!0,attribute:"show-media"})],e.prototype,"showMedia",2);t([r({type:String,attribute:"media-width"})],e.prototype,"mediaWidth",2);t([r({type:String,attribute:"media-height"})],e.prototype,"mediaHeight",2);t([r({type:String,attribute:"media-aspect"})],e.prototype,"mediaAspect",2);t([r({type:String,reflect:!0})],e.prototype,"width",2);t([r({type:String,reflect:!0,attribute:"max-width"})],e.prototype,"maxWidth",2);t([r({type:String,attribute:"min-width"})],e.prototype,"minWidth",2);t([r({type:String,reflect:!0})],e.prototype,"height",2);t([r({type:String,reflect:!0,attribute:"max-height"})],e.prototype,"maxHeight",2);t([r({type:String,attribute:"min-height"})],e.prototype,"minHeight",2);t([r({type:String,reflect:!0})],e.prototype,"sizing",2);e=t([u("scb-calendar-card")],e);
|
|
@@ -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"
|
|
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`
|
|
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`
|
|
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?c`
|
|
10
10
|
<scb-sub-drawer label=${t.label}>
|
|
11
|
-
${t.children.map(a=>
|
|
11
|
+
${t.children.map(a=>c`
|
|
12
12
|
<scb-drawer-item
|
|
13
13
|
label=${a.label}
|
|
14
14
|
item-href=${a.href??""}
|
|
@@ -16,92 +16,77 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
16
16
|
></scb-drawer-item>
|
|
17
17
|
`)}
|
|
18
18
|
</scb-sub-drawer>
|
|
19
|
-
`:
|
|
19
|
+
`:d}
|
|
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()}`:
|
|
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 c`
|
|
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":d}
|
|
27
|
+
aria-label=${this.banner&&this.bannerLabel?this.bannerLabel:d}
|
|
28
28
|
>
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<div class="
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
<scb-grid cols-compact="4" cols-medium="8" cols-expanded="12" max-width=${this.maxWidth} gap="0">
|
|
30
|
+
<scb-grid-item col-span-compact="4" col-span-medium="8" col-span-expanded="12">
|
|
31
|
+
<div class="top-row">
|
|
32
|
+
<div class="logo-wrap">
|
|
33
|
+
<a class="logo-group" href=${this.logoHref} aria-label="Gå till startsidan">
|
|
34
|
+
${this._renderLogo()} <span class="logo-text">${this.logoText}</span>
|
|
35
|
+
</a>
|
|
36
|
+
<md-focus-ring></md-focus-ring>
|
|
37
|
+
</div>
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
<div class="actions">
|
|
40
|
+
<nav class="utility" aria-label="Funktionslänkar">
|
|
41
|
+
${t.map(o=>c`<scb-link .href=${o.href} .target=${o.target??void 0}>${o.label}</scb-link>`)}
|
|
42
|
+
</nav>
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@focusin=${()=>this.__ensureSearch()}
|
|
45
|
-
@pointerenter=${()=>this.__ensureSearch()}>
|
|
46
|
-
${o?n`
|
|
44
|
+
${this.showSearch?c`
|
|
45
|
+
<div class="search" style=${a} @focusin=${()=>this.__ensureSearch()} @pointerenter=${()=>this.__ensureSearch()}>
|
|
47
46
|
<scb-search
|
|
48
47
|
id=${this._searchId}
|
|
49
48
|
size="compact"
|
|
50
49
|
style=${a}
|
|
51
50
|
.supportingText=${this.searchPlaceholder??""}
|
|
52
51
|
></scb-search>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
<scb-button
|
|
53
|
+
variant="filled-tonal"
|
|
54
|
+
label="Sök"
|
|
55
|
+
@click=${this._onSearchClick}
|
|
56
|
+
></scb-button>
|
|
57
|
+
</div>
|
|
58
|
+
`:d}
|
|
59
|
+
</div>
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
${p?n`
|
|
61
|
+
${this.showDrawer?c`
|
|
63
62
|
<scb-icon-button
|
|
64
63
|
class="menu-trigger"
|
|
65
64
|
aria-label="Meny"
|
|
66
65
|
icon="menu"
|
|
67
66
|
variant="outlined"
|
|
68
|
-
aria-controls=${this._drawerMounted?this._drawerId:
|
|
67
|
+
aria-controls=${this._drawerMounted?this._drawerId:d}
|
|
69
68
|
aria-haspopup="dialog"
|
|
70
69
|
aria-expanded=${String(this._drawerExpanded)}
|
|
71
70
|
data-drawer-toggle=${this._drawerId}
|
|
72
71
|
title="Öppna meny"
|
|
73
|
-
@pointerenter=${()=>this.__ensureIconButton()}
|
|
74
|
-
@focusin=${()=>this.__ensureIconButton()}
|
|
75
72
|
@click=${this._onMenuClick}
|
|
76
73
|
></scb-icon-button>
|
|
77
|
-
`:
|
|
78
|
-
|
|
79
|
-
|
|
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>
|
|
74
|
+
`:d}
|
|
75
|
+
</div>
|
|
76
|
+
</scb-grid-item>
|
|
93
77
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
78
|
+
<scb-grid-item col-span-compact="4" col-span-medium="8" col-span-expanded="12">
|
|
79
|
+
<div class="tabs-inset" @pointerenter=${()=>this.__ensureTabs()} @focusin=${()=>this.__ensureTabs()}>
|
|
80
|
+
<scb-tabs aria-label="Huvudnavigering" .activeTabIndex=${this.activeTab} @change=${this._onTabsChange}>
|
|
81
|
+
${e.map((o,h)=>c`<scb-secondary-tab ?selected=${h===this.activeTab}>${o.label}</scb-secondary-tab>`)}
|
|
82
|
+
</scb-tabs>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="divider" role="presentation"></div>
|
|
85
|
+
</scb-grid-item>
|
|
86
|
+
</scb-grid>
|
|
102
87
|
</div>
|
|
103
88
|
|
|
104
|
-
${this.showDrawer&&this._drawerMounted?
|
|
89
|
+
${this.showDrawer&&this._drawerMounted?c`
|
|
105
90
|
<scb-drawer
|
|
106
91
|
id=${this._drawerId}
|
|
107
92
|
.label=${this.drawerLabel??""}
|
|
@@ -110,24 +95,20 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
110
95
|
@scb-drawer-select=${this._onDrawerSelect}
|
|
111
96
|
>
|
|
112
97
|
<div style="padding: var(--spacing-4, 12px);">
|
|
113
|
-
|
|
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
|
-
`}
|
|
98
|
+
<scb-search size="compact" .supportingText=${this.drawerSearchPlaceholder??""}></scb-search>
|
|
118
99
|
</div>
|
|
119
100
|
|
|
120
|
-
${this.drawerSectionLabel?
|
|
101
|
+
${this.drawerSectionLabel?c`<scb-drawer-section .label=${this.drawerSectionLabel}></scb-drawer-section>`:d}
|
|
121
102
|
|
|
122
103
|
${this._renderDrawerNodes(s)}
|
|
123
104
|
|
|
124
|
-
${this.includeUtilityInDrawer&&(t?.length??0)>0?
|
|
105
|
+
${this.includeUtilityInDrawer&&(t?.length??0)>0?c`
|
|
125
106
|
<scb-drawer-section label=''></scb-drawer-section>
|
|
126
|
-
${t.map(c
|
|
127
|
-
`:
|
|
107
|
+
${t.map(o=>c`<scb-drawer-item label=${o.label} item-href=${o.href}></scb-drawer-item>`)}
|
|
108
|
+
`:d}
|
|
128
109
|
</scb-drawer>
|
|
129
|
-
`:
|
|
130
|
-
`}_renderLogo(){return
|
|
110
|
+
`:d}
|
|
111
|
+
`}_renderLogo(){return c`
|
|
131
112
|
<svg class="logo" viewBox="0 0 48 54" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
132
113
|
<g clip-path="url(#clip0_scb_header)">
|
|
133
114
|
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"
|
|
@@ -151,16 +132,26 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
151
132
|
--scb-header-logo-h: calc(var(--scb-header-logo-w) * 1.125);
|
|
152
133
|
}
|
|
153
134
|
|
|
154
|
-
.container { max-width: var(--scb-header-max-width, 1440px); margin: 0 auto; padding-inline: var(--spacing-7,24px); }
|
|
155
135
|
.top-row { display:flex; align-items:center; gap:var(--spacing-7,24px); padding-block:var(--spacing-7,24px); min-width:0; }
|
|
156
136
|
|
|
157
137
|
.logo-wrap {
|
|
158
138
|
display:inline-block;
|
|
159
139
|
position:relative;
|
|
160
|
-
|
|
140
|
+
padding: var(--scb-header-logo-focus-ring-gap, 4px);
|
|
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;
|
|
161
149
|
}
|
|
162
|
-
.logo-
|
|
163
|
-
|
|
150
|
+
.logo-wrap:focus-within md-focus-ring { display:block; }
|
|
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; }
|
|
164
155
|
.logo-group svg {
|
|
165
156
|
width:var(--scb-header-logo-w);
|
|
166
157
|
height:var(--scb-header-logo-h);
|
|
@@ -183,11 +174,14 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
183
174
|
.actions{ display:flex; align-items:center; gap:var(--spacing-7,24px); margin-left:auto; width:100%; justify-content:flex-end; min-width:0; }
|
|
184
175
|
|
|
185
176
|
.utility{ display:none; flex-wrap:nowrap; align-items:center; gap:var(--spacing-5,16px); min-width:0; }
|
|
186
|
-
.utility
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
177
|
+
.utility scb-link{
|
|
178
|
+
font-family: var(--md-sys-typescale-body-medium-font, var(--brand-font)), sans-serif;
|
|
179
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
180
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
181
|
+
font-weight: var(--md-sys-typescale-body-medium-weight);
|
|
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;
|
|
191
185
|
}
|
|
192
186
|
@media (min-width:840px){ .utility{ display:flex; } }
|
|
193
187
|
:host([data-collapsed]) .utility{ display:none !important; }
|
|
@@ -196,17 +190,6 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
196
190
|
@media (max-width:839.98px){ .menu-trigger{ display:inline-flex; } }
|
|
197
191
|
:host([data-collapsed]) .menu-trigger{ display:inline-flex; }
|
|
198
192
|
|
|
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
|
-
|
|
210
193
|
.search{
|
|
211
194
|
display:none;
|
|
212
195
|
align-items:stretch;
|
|
@@ -215,27 +198,11 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
215
198
|
max-width: var(--scb-header-search-max);
|
|
216
199
|
min-width: var(--scb-header-search-min);
|
|
217
200
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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;
|
|
201
|
+
scb-search{ width:100%; }
|
|
202
|
+
.search scb-search{ flex:1 1 auto; width:auto; }
|
|
203
|
+
.search scb-button{
|
|
204
|
+
flex:0 0 auto;
|
|
205
|
+
--scb-button-block-size: var(--scb-search-height);
|
|
239
206
|
}
|
|
240
207
|
@media (min-width:600px){ .search{ display:flex; } }
|
|
241
208
|
@media (min-width:600px) and (max-width:839.98px){ :host([data-hide-search]) .search{ display:none !important; } }
|
|
@@ -247,7 +214,7 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
247
214
|
min-width: var(--scb-header-search-min);
|
|
248
215
|
}
|
|
249
216
|
|
|
250
|
-
.tabs-inset{ display:inline-block; width:fit-content; max-width:100%;
|
|
217
|
+
.tabs-inset{ display:inline-block; width:fit-content; max-width:100%; }
|
|
251
218
|
@media (max-width:839.98px){ .tabs-inset{ display:none; } }
|
|
252
219
|
scb-tabs, scb-tabs::part(divider){
|
|
253
220
|
--md-tabs-divider-color:transparent; --md-primary-tab-divider-color:transparent; --md-secondary-tab-divider-color:transparent;
|
|
@@ -295,5 +262,7 @@ import{_ as m}from"../../vendor/preload-helper.js";import{a as x,n as h,r as b,i
|
|
|
295
262
|
}
|
|
296
263
|
}
|
|
297
264
|
|
|
298
|
-
:host([data-hide-logo-text]) .logo-text {
|
|
299
|
-
|
|
265
|
+
:host([data-hide-logo-text]) .logo-text {
|
|
266
|
+
display: none;
|
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d,n as a,i as p,x as
|
|
1
|
+
import{a as d,n as a,i as p,x as o,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,n,l){try{customElements.get(r)||t(r,n,l)}catch(c){var h=String(c||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,r,n)=>{for(var l=n>1?void 0:n?g(t,r):t,h=e.length-1,c;h>=0;h--)(c=e[h])&&(l=(n?c(t,r,l):c(l))||l);return n&&l&&y(t,r,l),l};let i=class extends p{constructor(){super(...arguments),this.keyfigure=0,this.subLabel="",this.supportingText="",this.cardHref="",this.icon="",this.size="standard",this.unit="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.sizing="stretch",this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.location.href=this.cardHref)},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||(window.location.href=this.cardHref))}}formatNumber(e){if(typeof e=="number")return e.toLocaleString("sv-SE").replace(/\u00A0/g," ");const t=Number(e);return Number.isNaN(t)?String(e):t.toLocaleString("sv-SE").replace(/\u00A0/g," ")}render(){const e=!!this.cardHref,t=this.formatNumber(this.keyfigure),r=(this.unit||"").trim(),n=r?`${t} ${r}`:t;return o`
|
|
2
2
|
<div
|
|
3
3
|
class="scb-keyfigure-card ${e?"clickable":""} ${this.size}"
|
|
4
4
|
role=${e?"link":"group"}
|
|
@@ -8,25 +8,25 @@ import{a as d,n as a,i as p,x as l,t as u}from"../../vendor/vendor.js";import"..
|
|
|
8
8
|
@keydown=${e?this.__onKeyDown:null}
|
|
9
9
|
style="cursor:${e?"pointer":"default"};"
|
|
10
10
|
>
|
|
11
|
-
${e?
|
|
12
|
-
${this.icon?
|
|
11
|
+
${e?o`<md-ripple></md-ripple>`:""}
|
|
12
|
+
${this.icon?o`<md-icon>${this.icon}</md-icon>`:""}
|
|
13
13
|
|
|
14
|
-
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?
|
|
14
|
+
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?o`
|
|
15
15
|
<div class="keyfigure">
|
|
16
16
|
<span class="value" aria-label="${n}">
|
|
17
|
-
${t}${r?
|
|
17
|
+
${t}${r?o`<span class="unit" aria-hidden="true">\u00A0${r}</span>`:""}
|
|
18
18
|
</span>
|
|
19
|
-
${e?
|
|
19
|
+
${e?o`<md-icon>arrow_forward</md-icon>`:""}
|
|
20
20
|
</div>
|
|
21
21
|
`:""}
|
|
22
22
|
|
|
23
|
-
${this.subLabel?
|
|
23
|
+
${this.subLabel?o`
|
|
24
24
|
<div class="sub-label">
|
|
25
|
-
${e?
|
|
25
|
+
${e?o`<a href="${this.cardHref}" tabindex="-1">${this.subLabel}</a>`:this.subLabel}
|
|
26
26
|
</div>
|
|
27
27
|
`:""}
|
|
28
28
|
|
|
29
|
-
${this.supportingText?
|
|
29
|
+
${this.supportingText?o`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<md-focus-ring></md-focus-ring>
|
|
@@ -124,4 +124,4 @@ import{a as d,n as a,i as p,x as l,t as u}from"../../vendor/vendor.js";import"..
|
|
|
124
124
|
line-height: var(--md-sys-typescale-display-medium-line-height);
|
|
125
125
|
letter-spacing: var(--md-sys-typescale-display-medium-tracking);
|
|
126
126
|
}
|
|
127
|
-
`;s([a({attribute:"keyfigure"})],i.prototype,"keyfigure",2);s([a({type:String,attribute:"sub-label"})],i.prototype,"subLabel",2);s([a({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);s([a({type:String,attribute:"card-href"})],i.prototype,"cardHref",2);s([a({type:String})],i.prototype,"icon",2);s([a({type:String})],i.prototype,"size",2);s([a({type:String})],i.prototype,"unit",2);s([a({type:String})],i.prototype,"width",2);s([a({type:String,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String})],i.prototype,"height",2);s([a({type:String,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);i=s([u("scb-keyfigure-card")],i);
|
|
127
|
+
`;s([a({attribute:"keyfigure"})],i.prototype,"keyfigure",2);s([a({type:String,attribute:"sub-label"})],i.prototype,"subLabel",2);s([a({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);s([a({type:String,attribute:"card-href"})],i.prototype,"cardHref",2);s([a({type:String})],i.prototype,"icon",2);s([a({type:String})],i.prototype,"size",2);s([a({type:String})],i.prototype,"unit",2);s([a({type:String,reflect:!0})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);i=s([u("scb-keyfigure-card")],i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
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": "23260998818130D71FC61F8CDD3AF34F4435EAD73FD59570DDBDFA917913F2E7"
|
|
278
278
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { css as m, LitElement as g, html as d } from "lit";
|
|
2
2
|
import { property as r, customElement as f } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
4
|
-
var y = Object.defineProperty,
|
|
5
|
-
for (var a = n > 1 ? void 0 : n ?
|
|
4
|
+
var y = Object.defineProperty, u = Object.getOwnPropertyDescriptor, t = (i, s, h, n) => {
|
|
5
|
+
for (var a = n > 1 ? void 0 : n ? u(s, h) : s, o = i.length - 1, l; o >= 0; o--)
|
|
6
6
|
(l = i[o]) && (a = (n ? l(s, h, a) : l(a)) || a);
|
|
7
7
|
return n && a && y(s, h, a), a;
|
|
8
8
|
};
|
|
@@ -156,8 +156,6 @@ e.styles = m`
|
|
|
156
156
|
|
|
157
157
|
.media {
|
|
158
158
|
display: flex;
|
|
159
|
-
/* Bredd/höjd sätts i första hand av inline-style från mediaWidth/mediaHeight.
|
|
160
|
-
Dessa fungerar som fallbackvärden. */
|
|
161
159
|
width: var(--spacing-spacing-11, 64px);
|
|
162
160
|
min-width: var(--spacing-spacing-11, 64px);
|
|
163
161
|
max-width: var(--spacing-spacing-11, 64px);
|
|
@@ -297,19 +295,19 @@ t([
|
|
|
297
295
|
r({ type: String, attribute: "media-aspect" })
|
|
298
296
|
], e.prototype, "mediaAspect", 2);
|
|
299
297
|
t([
|
|
300
|
-
r({ type: String })
|
|
298
|
+
r({ type: String, reflect: !0 })
|
|
301
299
|
], e.prototype, "width", 2);
|
|
302
300
|
t([
|
|
303
|
-
r({ type: String, attribute: "max-width" })
|
|
301
|
+
r({ type: String, reflect: !0, attribute: "max-width" })
|
|
304
302
|
], e.prototype, "maxWidth", 2);
|
|
305
303
|
t([
|
|
306
304
|
r({ type: String, attribute: "min-width" })
|
|
307
305
|
], e.prototype, "minWidth", 2);
|
|
308
306
|
t([
|
|
309
|
-
r({ type: String })
|
|
307
|
+
r({ type: String, reflect: !0 })
|
|
310
308
|
], e.prototype, "height", 2);
|
|
311
309
|
t([
|
|
312
|
-
r({ type: String, attribute: "max-height" })
|
|
310
|
+
r({ type: String, reflect: !0, attribute: "max-height" })
|
|
313
311
|
], e.prototype, "maxHeight", 2);
|
|
314
312
|
t([
|
|
315
313
|
r({ type: String, attribute: "min-height" })
|
|
@@ -63,16 +63,12 @@ export declare class ScbHeader extends LitElement {
|
|
|
63
63
|
private __drawerLoaded;
|
|
64
64
|
private __tabsLoaded;
|
|
65
65
|
private __searchLoaded;
|
|
66
|
-
private __iconBtnLoaded;
|
|
67
66
|
private __ensureDrawerPromise?;
|
|
68
67
|
private __ensureTabsPromise?;
|
|
69
68
|
private __ensureSearchPromise?;
|
|
70
|
-
private __ensureIconBtnPromise?;
|
|
71
69
|
private __ensureDrawer;
|
|
72
70
|
private __ensureTabs;
|
|
73
71
|
private __ensureSearch;
|
|
74
|
-
private __ensureIconButton;
|
|
75
|
-
private _modulePreload;
|
|
76
72
|
static styles: import('lit').CSSResult;
|
|
77
73
|
private get _slotEl();
|
|
78
74
|
private get _top();
|