scb-wc-test 0.1.72 → 0.1.74
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-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-checkbox/scb-checkbox.js +1 -1
- package/mvc/components/scb-dialog/scb-dialog.js +2 -2
- package/mvc/components/scb-header/scb-header.js +16 -12
- package/mvc/components/scb-list/scb-list-item.js +2 -2
- package/package.json +2 -2
- package/scb-accordion/scb-accordion-item.js +1 -1
- package/scb-checkbox/scb-checkbox.js +1 -0
- package/scb-header/scb-header.d.ts +4 -0
- package/scb-header/scb-header.js +38 -7
- package/scb-wc-test.bundle.js +13 -9
|
@@ -26,7 +26,7 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as u,n as s,i as m,E
|
|
|
26
26
|
${this.supportingText?l`<div class="supporting-text">${this.supportingText}</div>`:p}
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
|
-
<md-icon class="chevron">
|
|
29
|
+
<md-icon class="chevron">expand_more</md-icon>
|
|
30
30
|
</summary>
|
|
31
31
|
|
|
32
32
|
<div id=${t} class="scb-accordion-bottom" role="region" aria-labelledby=${i}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p,n,i as h,E as d,x as b,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||i(e,s,a)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l=(t,i,e,s)=>{for(var a=s>1?void 0:s?f(i,e):i,r=t.length-1,o;r>=0;r--)(o=t[r])&&(a=(s?o(i,e,a):o(a))||a);return s&&a&&m(i,e,a),a};let c=class extends h{constructor(){super(...arguments),this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.label="",this.supportingText="",this.ariaLabel="",this._checkboxId=""}connectedCallback(){super.connectedCallback(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`}firstUpdated(){const t=this.shadowRoot?.querySelector("md-checkbox");t&&t.addEventListener("change",()=>{const e=t.checked;this.checked=e,this.dispatchEvent(new CustomEvent("change",{detail:{checked:e},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",e=>{if(this.disabled)return;if(!e.composedPath().some(r=>{const o=r;return o?.tagName?.toLowerCase?.()==="md-checkbox"||o?.classList?.contains("box-wrap")})){e.preventDefault();const r=this.shadowRoot.querySelector("md-checkbox");r&&(r.checked=!r.checked,r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria()}updated(t){super.updated(t),t.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(t.has("label")||t.has("supportingText")||t.has("ariaLabel"))&&this.__syncInnerAria()}__syncInnerAria(){const i=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!i)return;const e=i.querySelector('[role="checkbox"]')||i.querySelector('input[type="checkbox"]');if(!e)return;const s=!!this.label?.trim(),a=s?`${this._checkboxId}-label`:"",r=this.supportingText?`${this._checkboxId}-supporting-text`:"";s&&a?(e.setAttribute("aria-labelledby",a),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?e.setAttribute("aria-label",this.ariaLabel.trim()):e.removeAttribute("aria-label")),r?e.setAttribute("aria-describedby",r):e.removeAttribute("aria-describedby")}render(){const t=this.supportingText?`${this._checkboxId}-supporting-text`:void 0,i=!!this.label?.trim(),e=i?d:this.ariaLabel||d;return b`
|
|
1
|
+
import{a as p,n,i as h,E as d,x as b,t as u}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"./scb-checkbox-group.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||i(e,s,a)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l=(t,i,e,s)=>{for(var a=s>1?void 0:s?f(i,e):i,r=t.length-1,o;r>=0;r--)(o=t[r])&&(a=(s?o(i,e,a):o(a))||a);return s&&a&&m(i,e,a),a};let c=class extends h{constructor(){super(...arguments),this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.label="",this.supportingText="",this.ariaLabel="",this._checkboxId=""}connectedCallback(){super.connectedCallback(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`}firstUpdated(){const t=this.shadowRoot?.querySelector("md-checkbox");t&&t.addEventListener("change",()=>{const e=t.checked;this.checked=e,this.dispatchEvent(new CustomEvent("change",{detail:{checked:e},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",e=>{if(this.disabled)return;if(!e.composedPath().some(r=>{const o=r;return o?.tagName?.toLowerCase?.()==="md-checkbox"||o?.classList?.contains("box-wrap")})){e.preventDefault();const r=this.shadowRoot.querySelector("md-checkbox");r&&(r.checked=!r.checked,r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria()}updated(t){super.updated(t),t.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(t.has("label")||t.has("supportingText")||t.has("ariaLabel"))&&this.__syncInnerAria()}__syncInnerAria(){const i=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!i)return;const e=i.querySelector('[role="checkbox"]')||i.querySelector('input[type="checkbox"]');if(!e)return;const s=!!this.label?.trim(),a=s?`${this._checkboxId}-label`:"",r=this.supportingText?`${this._checkboxId}-supporting-text`:"";s&&a?(e.setAttribute("aria-labelledby",a),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?e.setAttribute("aria-label",this.ariaLabel.trim()):e.removeAttribute("aria-label")),r?e.setAttribute("aria-describedby",r):e.removeAttribute("aria-describedby")}render(){const t=this.supportingText?`${this._checkboxId}-supporting-text`:void 0,i=!!this.label?.trim(),e=i?d:this.ariaLabel||d;return b`
|
|
2
2
|
<label class="wrap">
|
|
3
3
|
<div class="box-wrap">
|
|
4
4
|
<md-checkbox
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-textfield/scb-textfield.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../../vendor/vendor-material.js","../scb-radio-button/scb-radio-button.js","../scb-switch/scb-switch.js","../scb-chip/scb-chip.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-tooltip/scb-tooltip.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as d}from"../../vendor/preload-helper.js";import{a as h,n,i as m,E as p,x as a,t as _}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(o,c,r){try{customElements.get(o)||e(o,c,r)}catch(u){var l=String(u||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,s=(t,e,o,c)=>{for(var r=c>1?void 0:c?f(e,o):e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(r=(c?u(e,o,r):u(r))||r);return c&&r&&b(e,o,r),r};let i=class extends m{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__slotDeps={"SCB-TEXTFIELD":()=>d(()=>import("../scb-textfield/scb-textfield.js"),__vite__mapDeps([0,1,2]),import.meta.url),"SCB-CHECKBOX":()=>d(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([3,2,4]),import.meta.url),"SCB-RADIO-BUTTON":()=>d(()=>import("../scb-radio-button/scb-radio-button.js"),__vite__mapDeps([
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-textfield/scb-textfield.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../../vendor/vendor-material.js","../scb-checkbox/scb-checkbox-group.js","../scb-radio-button/scb-radio-button.js","../scb-switch/scb-switch.js","../scb-chip/scb-chip.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-tooltip/scb-tooltip.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as d}from"../../vendor/preload-helper.js";import{a as h,n,i as m,E as p,x as a,t as _}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(o,c,r){try{customElements.get(o)||e(o,c,r)}catch(u){var l=String(u||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,s=(t,e,o,c)=>{for(var r=c>1?void 0:c?f(e,o):e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(r=(c?u(e,o,r):u(r))||r);return c&&r&&b(e,o,r),r};let i=class extends m{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__slotDeps={"SCB-TEXTFIELD":()=>d(()=>import("../scb-textfield/scb-textfield.js"),__vite__mapDeps([0,1,2]),import.meta.url),"SCB-CHECKBOX":()=>d(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([3,2,4,5]),import.meta.url),"SCB-RADIO-BUTTON":()=>d(()=>import("../scb-radio-button/scb-radio-button.js"),__vite__mapDeps([6,2,4]),import.meta.url),"SCB-SWITCH":()=>d(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([7,1,2]),import.meta.url),"SCB-CHIP":()=>d(()=>import("../scb-chip/scb-chip.js"),__vite__mapDeps([8,1,2]),import.meta.url)},this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{this.shadowRoot?.querySelector("form")?.reset(),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(e=>{const o=e.tagName;o==="SCB-TEXTFIELD"&&(e.value=""),o==="SCB-CHECKBOX"&&(e.checked=!1),o==="SCB-RADIO-BUTTON"&&(e.checked=!1),o==="SCB-SWITCH"&&(e.selected=!1),o==="SCB-CHIP"&&(e.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{this.shadowRoot?.querySelector("form")?.requestSubmit(),this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!e.length)return;const o=e[0],c=e[e.length-1];t.shiftKey&&document.activeElement===o?(c.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===c&&(o.focus(),t.preventDefault())}}async firstUpdated(){await d(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([9,1,2]),import.meta.url),await d(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([10,1,2,4,11,9]),import.meta.url),this.icon&&await d(()=>import("../../vendor/vendor-material.js").then(t=>t.i),__vite__mapDeps([4,2]),import.meta.url),await this.__ensureSlottedDeps()}async __ensureSlottedDeps(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=async o=>{const c=new Set(o.map(r=>r.tagName));for(const r of c){const l=this.__slotDeps[r];l&&await l()}};await e(t.assignedElements({flatten:!0})),t.addEventListener("slotchange",async()=>e(t.assignedElements({flatten:!0})))}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}updated(t){if(t.has("open")){const e=t.get("open");this.__updateTriggersExpanded(),this.open&&!e?this.updateComplete.then(()=>{this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')?.focus?.()}):!this.open&&e&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}t.has("icon")&&this.icon&&d(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([4,2]),import.meta.url)}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement;e.style.overflow=t?"hidden":""}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}__slotIsEmpty(){const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const e=this.variant==="form"||this.variant==="floating";return a`
|
|
3
3
|
<div class="header">
|
|
4
4
|
<div class="title">
|
|
5
5
|
${this.icon?a`<md-icon class="dialog-icon">${this.icon}</md-icon>`:p}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
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`
|
|
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(r,i,o){try{customElements.get(r)||t(r,i,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,$=Object.getOwnPropertyDescriptor,a=(e,t,r,i)=>{for(var o=i>1?void 0:i?$(t,r):t,h=e.length-1,n;h>=0;h--)(n=e[h])&&(o=(i?n(t,r,o):n(o))||o);return i&&o&&T(t,r,o),o};const v={fromAttribute:e=>e==null?!0:!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)};let s=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.searchText="",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}),r=[],i=[],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"){r.push({label:n.getAttribute("label")??"",href:n.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){i.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=r,this._slotUtils=i,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 r=window.innerWidth,i=e.clientWidth,o=this._overflows(this._util),h=this._overflows(this._tabsEl),n=r<this.BP_MD||o||h;this._collapsed?!n&&i>=this._unlockAtWidth&&this._setCollapsed(!1):n&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&r>=this.BP_SM&&r<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&&(r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+_+y+_+f+8>i+.5}this._setHideSearch(p);let b=!1;if(this.showDrawer&&(r<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=!(i>=this._logoTextUnlockAt):_>i+.5&&(b=!0,this._logoTextUnlockAt=i+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 s._nextFrame(),await s._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{const t=this._searchEl;if(t?.submit&&typeof t.submit=="function"){t.submit();return}const r=t?.value??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),t?.focus?.()},this._onTabsChange=e=>{const r=e?.detail?.activeTabIndex??e.target?.activeTabIndex??0;this.activeTab=r;const o=(this._slotTabs.length?this._slotTabs:this.tabs)[r]?.href??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:o},bubbles:!0,composed:!0}))},this._onSearchInput=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{this.searchText=e.detail?.value??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:e.detail?.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",s.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",s.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 r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}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,r=()=>this._ensureDrawerMounted();t?.addEventListener("pointerenter",r,{once:!0}),t?.addEventListener("focusin",r,{once:!0}),t?.addEventListener("touchstart",r,{once:!0,passive:!0});const i=o=>"requestIdleCallback"in window?window.requestIdleCallback(o,{timeout:1500}):setTimeout(o,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{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((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=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
|
-
${
|
|
9
|
+
${r?c`
|
|
10
10
|
<scb-sub-drawer label=${t.label}>
|
|
11
|
-
${t.children.map(
|
|
11
|
+
${t.children.map(i=>c`
|
|
12
12
|
<scb-drawer-item
|
|
13
|
-
label=${
|
|
14
|
-
item-href=${
|
|
15
|
-
leading-icon=${
|
|
13
|
+
label=${i.label}
|
|
14
|
+
item-href=${i.href??""}
|
|
15
|
+
leading-icon=${i.icon??""}
|
|
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,
|
|
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,r=this._slotMenu.length?this._slotMenu:this.menuData??[];this._syncFlags(t.length===0,!this.showSearch);const i=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
|
|
@@ -42,12 +42,16 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
42
42
|
</nav>
|
|
43
43
|
|
|
44
44
|
${this.showSearch?c`
|
|
45
|
-
<div class="search" style=${
|
|
45
|
+
<div class="search" style=${i} @focusin=${()=>this.__ensureSearch()} @pointerenter=${()=>this.__ensureSearch()}>
|
|
46
46
|
<scb-search
|
|
47
47
|
id=${this._searchId}
|
|
48
48
|
size="compact"
|
|
49
|
-
style=${
|
|
49
|
+
style=${i}
|
|
50
|
+
.value=${this.searchText}
|
|
50
51
|
.supportingText=${this.searchPlaceholder??""}
|
|
52
|
+
@scb-search-input=${this._onSearchInput}
|
|
53
|
+
@scb-search-submit=${this._onSearchSubmit}
|
|
54
|
+
@scb-search-clear=${this._onSearchClear}
|
|
51
55
|
></scb-search>
|
|
52
56
|
<scb-button
|
|
53
57
|
variant="filled-tonal"
|
|
@@ -100,7 +104,7 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
100
104
|
|
|
101
105
|
${this.drawerSectionLabel?c`<scb-drawer-section .label=${this.drawerSectionLabel}></scb-drawer-section>`:d}
|
|
102
106
|
|
|
103
|
-
${this._renderDrawerNodes(
|
|
107
|
+
${this._renderDrawerNodes(r)}
|
|
104
108
|
|
|
105
109
|
${this.includeUtilityInDrawer&&(t?.length??0)>0?c`
|
|
106
110
|
<scb-drawer-section label=''></scb-drawer-section>
|
|
@@ -120,7 +124,7 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
120
124
|
</g>
|
|
121
125
|
<defs><clipPath id="clip0_scb_header"><rect width="48" height="54" fill="white" /></clipPath></defs>
|
|
122
126
|
</svg>
|
|
123
|
-
`}};
|
|
127
|
+
`}};s._JSON_ARRAY={fromAttribute:e=>{if(e==null||e==="")return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute:e=>e==null?null:JSON.stringify(e)};s.BP_SM_DEFAULT=600;s.BP_MD_DEFAULT=840;s.styles=x`
|
|
124
128
|
:host {
|
|
125
129
|
display:block;
|
|
126
130
|
background: var(--scb-header-background, var(--md-sys-color-surface))
|
|
@@ -265,4 +269,4 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as x,n as l,r as u,i
|
|
|
265
269
|
:host([data-hide-logo-text]) .logo-text {
|
|
266
270
|
display: none;
|
|
267
271
|
}
|
|
268
|
-
`;
|
|
272
|
+
`;s._nextFrame=()=>new Promise(e=>requestAnimationFrame(()=>e()));a([l({type:String,attribute:"max-width"})],s.prototype,"maxWidth",2);a([l({type:String,attribute:"logo-text"})],s.prototype,"logoText",2);a([l({type:String,attribute:"logo-href"})],s.prototype,"logoHref",2);a([l({type:Boolean,reflect:!0})],s.prototype,"banner",2);a([l({type:String,attribute:"banner-label"})],s.prototype,"bannerLabel",2);a([l({attribute:"tabs",converter:s._JSON_ARRAY})],s.prototype,"tabs",2);a([l({type:Number,attribute:"active-tab"})],s.prototype,"activeTab",2);a([l({attribute:"utility-items",converter:s._JSON_ARRAY})],s.prototype,"utilityItems",2);a([l({type:String,attribute:"search-placeholder"})],s.prototype,"searchPlaceholder",2);a([l({type:String,attribute:"drawer-label"})],s.prototype,"drawerLabel",2);a([l({type:String,attribute:"drawer-sub-label"})],s.prototype,"drawerSubLabel",2);a([l({type:String,attribute:"drawer-section-label"})],s.prototype,"drawerSectionLabel",2);a([l({type:String,attribute:"drawer-search-placeholder"})],s.prototype,"drawerSearchPlaceholder",2);a([l({attribute:"menu-data",converter:s._JSON_ARRAY})],s.prototype,"menuData",2);a([l({attribute:"show-drawer",reflect:!0,converter:v})],s.prototype,"showDrawer",2);a([l({attribute:"show-search",reflect:!0,converter:v})],s.prototype,"showSearch",2);a([l({attribute:"include-utility-in-drawer",reflect:!0,converter:v})],s.prototype,"includeUtilityInDrawer",2);a([l({type:String,attribute:"search-max"})],s.prototype,"searchMax",2);a([l({type:String,attribute:"search-min"})],s.prototype,"searchMin",2);a([l({type:String,attribute:"search-height"})],s.prototype,"searchHeight",2);a([l({type:String,attribute:"search-text",reflect:!0})],s.prototype,"searchText",2);a([u()],s.prototype,"_drawerId",2);a([u()],s.prototype,"_drawerMounted",2);a([u()],s.prototype,"_drawerExpanded",2);a([u()],s.prototype,"_searchId",2);a([u()],s.prototype,"_slotTabs",2);a([u()],s.prototype,"_slotUtils",2);a([u()],s.prototype,"_slotMenu",2);a([u()],s.prototype,"_collapsed",2);a([u()],s.prototype,"_hideLogoText",2);s=a([C("scb-header")],s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../scb-switch/scb-switch.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-checkbox/scb-checkbox.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{_ as m}from"../../vendor/preload-helper.js";import{n as s,t as I,i as E,a as L,E as c,x as n}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,d,l){try{customElements.get(e)||i(e,d,l)}catch(p){var o=String(p||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var T=Object.defineProperty,P=Object.getOwnPropertyDescriptor,V=t=>{throw TypeError(t)},r=(t,i,e,d)=>{for(var l=d>1?void 0:d?P(i,e):i,o=t.length-1,p;o>=0;o--)(p=t[o])&&(l=(d?p(i,e,l):p(l))||l);return d&&l&&T(i,e,l),l},x=(t,i,e)=>i.has(t)||V("Cannot "+e),v=(t,i,e)=>(x(t,i,"read from private field"),e?e.call(t):i.get(t)),g=(t,i,e)=>i.has(t)?V("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),_=(t,i,e,d)=>(x(t,i,"write to private field"),i.set(t,e),e),$=(t,i,e)=>(x(t,i,"access private method"),e),f,y,b,u,w,k;let a=class extends E{constructor(){super(...arguments),g(this,u),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.density=0,this.noDivider=!1,g(this,f,!1),g(this,y,!1),g(this,b,!1),this.onRowClick=()=>{if(this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),i=this.shadowRoot?.querySelector("scb-switch");t&&(t.checked=!t.checked),i&&(i.selected=!i.selected)},g(this,k,t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const i=this.shadowRoot?.querySelector("a[href]");if(i){t.preventDefault(),i.click();return}}t.preventDefault(),this.onRowClick()}})}static get styles(){return L`
|
|
3
3
|
:host {
|
|
4
4
|
border-bottom: var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);
|
|
@@ -141,4 +141,4 @@ import{_ as m}from"../../vendor/preload-helper.js";import{n as s,t as I,i as E,a
|
|
|
141
141
|
</div>
|
|
142
142
|
|
|
143
143
|
<md-focus-ring></md-focus-ring>
|
|
144
|
-
`}};f=new WeakMap;y=new WeakMap;b=new WeakMap;u=new WeakSet;w=async function(){const t=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||t)&&!v(this,f)&&(await m(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),_(this,f,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!v(this,y)&&(await m(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([2,1,0]),import.meta.url),_(this,y,!0)),this.trailing&&this.trailingVariant==="switch"&&!v(this,b)&&(await m(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([
|
|
144
|
+
`}};f=new WeakMap;y=new WeakMap;b=new WeakMap;u=new WeakSet;w=async function(){const t=this.type==="link"&&(!this.trailing||this.trailingVariant==="icon");(this.leading&&this.leadingVariant==="icon"||this.trailing&&this.trailingVariant==="icon"||t)&&!v(this,f)&&(await m(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),_(this,f,!0)),this.trailing&&this.trailingVariant==="checkbox"&&!v(this,y)&&(await m(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([2,1,0,3]),import.meta.url),_(this,y,!0)),this.trailing&&this.trailingVariant==="switch"&&!v(this,b)&&(await m(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([4,5,1]),import.meta.url),_(this,b,!0))};k=new WeakMap;r([s({type:String,reflect:!0,attribute:"type"})],a.prototype,"type",2);r([s({type:String})],a.prototype,"href",2);r([s({type:String,attribute:"item-href"})],a.prototype,"itemHref",2);r([s({type:String,attribute:"target"})],a.prototype,"target",2);r([s({type:Boolean,attribute:"disabled"})],a.prototype,"disabled",2);r([s({type:String,reflect:!0})],a.prototype,"label",2);r([s({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);r([s({type:String,attribute:"overline"})],a.prototype,"overline",2);r([s({type:Boolean})],a.prototype,"leading",2);r([s({type:String,attribute:"leading-variant",reflect:!0})],a.prototype,"leadingVariant",2);r([s({type:String,attribute:"leading-icon"})],a.prototype,"leadingIcon",2);r([s({type:String,attribute:"avatar-label"})],a.prototype,"avatarLabel",2);r([s({type:String,attribute:"avatar-alt"})],a.prototype,"avatarAlt",2);r([s({type:String,attribute:"avatar-variant"})],a.prototype,"avatarVariant",2);r([s({type:String,attribute:"avatar-src"})],a.prototype,"avatarSrc",2);r([s({type:String,reflect:!0,attribute:"img-href-image"})],a.prototype,"imgHrefImage",2);r([s({type:Boolean})],a.prototype,"trailing",2);r([s({type:String,attribute:"trailing-variant",reflect:!0})],a.prototype,"trailingVariant",2);r([s({type:String,attribute:"trailing-icon"})],a.prototype,"trailingIcon",2);r([s({type:Number,reflect:!0})],a.prototype,"density",2);r([s({type:Boolean,attribute:"no-divider",reflect:!0})],a.prototype,"noDivider",2);a=r([I("scb-list-item")],a);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.74",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -296,5 +296,5 @@
|
|
|
296
296
|
},
|
|
297
297
|
"./mvc/*": "./mvc/*"
|
|
298
298
|
},
|
|
299
|
-
"buildHash": "
|
|
299
|
+
"buildHash": "922846D166359F8518F6DD94D36AC02417E5D65B100D6C150B1157F88436D2C7"
|
|
300
300
|
}
|
|
@@ -93,7 +93,7 @@ let e = class extends v {
|
|
|
93
93
|
${this.supportingText ? l`<div class="supporting-text">${this.supportingText}</div>` : p}
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
|
-
<md-icon class="chevron">
|
|
96
|
+
<md-icon class="chevron">expand_more</md-icon>
|
|
97
97
|
</summary>
|
|
98
98
|
|
|
99
99
|
<div id=${t} class="scb-accordion-bottom" role="region" aria-labelledby=${i}>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { css as x, LitElement as y, nothing as h, html as u } from "lit";
|
|
2
2
|
import { property as b, customElement as v } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/checkbox/checkbox.js";
|
|
4
|
+
import "./scb-checkbox-group.js";
|
|
4
5
|
var f = Object.defineProperty, k = Object.getOwnPropertyDescriptor, d = (e, i, t, s) => {
|
|
5
6
|
for (var r = s > 1 ? void 0 : s ? k(i, t) : i, l = e.length - 1, n; l >= 0; l--)
|
|
6
7
|
(n = e[l]) && (r = (s ? n(i, t, r) : n(r)) || r);
|
|
@@ -36,6 +36,7 @@ export declare class ScbHeader extends LitElement {
|
|
|
36
36
|
searchMax?: string;
|
|
37
37
|
searchMin?: string;
|
|
38
38
|
searchHeight?: string;
|
|
39
|
+
searchText: string;
|
|
39
40
|
private _drawerId;
|
|
40
41
|
private _drawerMounted;
|
|
41
42
|
private _drawerExpanded;
|
|
@@ -102,6 +103,9 @@ export declare class ScbHeader extends LitElement {
|
|
|
102
103
|
private _applyActiveToTabs;
|
|
103
104
|
private _renderDrawerNodes;
|
|
104
105
|
private _syncFlags;
|
|
106
|
+
private _onSearchInput;
|
|
107
|
+
private _onSearchSubmit;
|
|
108
|
+
private _onSearchClear;
|
|
105
109
|
render(): TemplateResult;
|
|
106
110
|
private _renderLogo;
|
|
107
111
|
}
|
package/scb-header/scb-header.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { css as C, LitElement as T, html as h, nothing as u } from "lit";
|
|
2
|
-
import { property as l, state as p, customElement as
|
|
2
|
+
import { property as l, state as p, customElement as $ } from "lit/decorators.js";
|
|
3
3
|
import "@material/web/focus/md-focus-ring.js";
|
|
4
4
|
import "../scb-grid/scb-grid-item.js";
|
|
5
5
|
import "../scb-grid/scb-grid.js";
|
|
6
6
|
import "../scb-link/scb-link.js";
|
|
7
7
|
import "../scb-icon-button/scb-icon-button.js";
|
|
8
8
|
import "../scb-button/scb-button.js";
|
|
9
|
-
var
|
|
9
|
+
var M = Object.defineProperty, A = Object.getOwnPropertyDescriptor, i = (e, t, r, a) => {
|
|
10
10
|
for (var o = a > 1 ? void 0 : a ? A(t, r) : t, c = e.length - 1, n; c >= 0; c--)
|
|
11
11
|
(n = e[c]) && (o = (a ? n(t, r, o) : n(o)) || o);
|
|
12
|
-
return a && o &&
|
|
12
|
+
return a && o && M(t, r, o), o;
|
|
13
13
|
};
|
|
14
14
|
const w = {
|
|
15
15
|
fromAttribute: (e) => e == null ? !0 : !/^(false|0|off|no)$/i.test(e),
|
|
@@ -17,7 +17,7 @@ const w = {
|
|
|
17
17
|
};
|
|
18
18
|
let s = class extends T {
|
|
19
19
|
constructor() {
|
|
20
|
-
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 = () => {
|
|
20
|
+
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.searchText = "", 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 = () => {
|
|
21
21
|
this._measureScheduled || (this._measureScheduled = !0, requestAnimationFrame(() => {
|
|
22
22
|
this._measureScheduled = !1, this._measure();
|
|
23
23
|
}));
|
|
@@ -98,8 +98,8 @@ let s = class extends T {
|
|
|
98
98
|
t.submit();
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const r = (t == null ? void 0 : t.value) ??
|
|
102
|
-
this.dispatchEvent(new CustomEvent("search-click", {
|
|
101
|
+
const r = (t == null ? void 0 : t.value) ?? "";
|
|
102
|
+
this.searchText = r, this.dispatchEvent(new CustomEvent("search-click", {
|
|
103
103
|
detail: { value: r },
|
|
104
104
|
bubbles: !0,
|
|
105
105
|
composed: !0
|
|
@@ -114,6 +114,30 @@ let s = class extends T {
|
|
|
114
114
|
bubbles: !0,
|
|
115
115
|
composed: !0
|
|
116
116
|
}));
|
|
117
|
+
}, this._onSearchInput = (e) => {
|
|
118
|
+
var t;
|
|
119
|
+
this.searchText = ((t = e.detail) == null ? void 0 : t.value) ?? "", this.dispatchEvent(new CustomEvent("search-input", {
|
|
120
|
+
detail: { value: this.searchText },
|
|
121
|
+
bubbles: !0,
|
|
122
|
+
composed: !0
|
|
123
|
+
})), this.dispatchEvent(new CustomEvent("search-text-change", {
|
|
124
|
+
detail: { value: this.searchText },
|
|
125
|
+
bubbles: !0,
|
|
126
|
+
composed: !0
|
|
127
|
+
}));
|
|
128
|
+
}, this._onSearchSubmit = (e) => {
|
|
129
|
+
var t, r;
|
|
130
|
+
this.searchText = ((t = e.detail) == null ? void 0 : t.value) ?? "", this.dispatchEvent(new CustomEvent("search-change", {
|
|
131
|
+
detail: { value: this.searchText, active: (r = e.detail) == null ? void 0 : r.active },
|
|
132
|
+
bubbles: !0,
|
|
133
|
+
composed: !0
|
|
134
|
+
}));
|
|
135
|
+
}, this._onSearchClear = () => {
|
|
136
|
+
this.searchText = "", this.dispatchEvent(new CustomEvent("search-text-change", {
|
|
137
|
+
detail: { value: "" },
|
|
138
|
+
bubbles: !0,
|
|
139
|
+
composed: !0
|
|
140
|
+
}));
|
|
117
141
|
};
|
|
118
142
|
}
|
|
119
143
|
get _HYST() {
|
|
@@ -324,7 +348,11 @@ let s = class extends T {
|
|
|
324
348
|
id=${this._searchId}
|
|
325
349
|
size="compact"
|
|
326
350
|
style=${a}
|
|
351
|
+
.value=${this.searchText}
|
|
327
352
|
.supportingText=${this.searchPlaceholder ?? ""}
|
|
353
|
+
@scb-search-input=${this._onSearchInput}
|
|
354
|
+
@scb-search-submit=${this._onSearchSubmit}
|
|
355
|
+
@scb-search-clear=${this._onSearchClear}
|
|
328
356
|
></scb-search>
|
|
329
357
|
<scb-button
|
|
330
358
|
variant="filled-tonal"
|
|
@@ -624,6 +652,9 @@ i([
|
|
|
624
652
|
i([
|
|
625
653
|
l({ type: String, attribute: "search-height" })
|
|
626
654
|
], s.prototype, "searchHeight", 2);
|
|
655
|
+
i([
|
|
656
|
+
l({ type: String, attribute: "search-text", reflect: !0 })
|
|
657
|
+
], s.prototype, "searchText", 2);
|
|
627
658
|
i([
|
|
628
659
|
p()
|
|
629
660
|
], s.prototype, "_drawerId", 2);
|
|
@@ -652,7 +683,7 @@ i([
|
|
|
652
683
|
p()
|
|
653
684
|
], s.prototype, "_hideLogoText", 2);
|
|
654
685
|
s = i([
|
|
655
|
-
|
|
686
|
+
$("scb-header")
|
|
656
687
|
], s);
|
|
657
688
|
export {
|
|
658
689
|
s as ScbHeader
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -555,7 +555,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
555
555
|
</div>
|
|
556
556
|
${r?i:u}
|
|
557
557
|
</dialog>
|
|
558
|
-
`}firstUpdated(){this.intersectionObserver=new IntersectionObserver(e=>{for(const t of e)this.handleAnchorIntersection(t)},{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent){this.nextClickIsFromContent=!1;return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(e){const t=e.target,{submitter:r}=e;t.method!=="dialog"||!r||this.close(r.getAttribute("value")??this.returnValue)}handleCancel(e){if(e.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const t=!Ne(this,e);e.preventDefault(),!t&&this.close()}handleClose(){var e;this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,(e=this.dialog)==null||e.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(e){e.key==="Escape"&&(this.escapePressedWithoutCancel=!0,setTimeout(()=>{this.escapePressedWithoutCancel=!1}))}async animateDialog(e){var
|
|
558
|
+
`}firstUpdated(){this.intersectionObserver=new IntersectionObserver(e=>{for(const t of e)this.handleAnchorIntersection(t)},{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent){this.nextClickIsFromContent=!1;return}this.dispatchEvent(new Event("cancel",{cancelable:!0}))&&this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(e){const t=e.target,{submitter:r}=e;t.method!=="dialog"||!r||this.close(r.getAttribute("value")??this.returnValue)}handleCancel(e){if(e.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const t=!Ne(this,e);e.preventDefault(),!t&&this.close()}handleClose(){var e;this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,(e=this.dialog)==null||e.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(e){e.key==="Escape"&&(this.escapePressedWithoutCancel=!0,setTimeout(()=>{this.escapePressedWithoutCancel=!1}))}async animateDialog(e){var z;if((z=this.cancelAnimations)==null||z.abort(),this.cancelAnimations=new AbortController,this.quick)return;const{dialog:t,scrim:r,container:i,headline:s,content:n,actions:h}=this;if(!t||!r||!i||!s||!n||!h)return;const{container:p,dialog:v,scrim:f,headline:m,content:_,actions:x}=e,S=[[t,v??[]],[r,f??[]],[i,p??[]],[s,m??[]],[n,_??[]],[h,x??[]]],C=[];for(const[T,O]of S)for(const se of O){const W=T.animate(...se);this.cancelAnimations.signal.addEventListener("abort",()=>{W.cancel()}),C.push(W)}await Promise.all(C.map(T=>T.finished.catch(()=>{})))}handleHeadlineChange(e){const t=e.target;this.hasHeadline=t.assignedElements().length>0}handleActionsChange(e){const t=e.target;this.hasActions=t.assignedElements().length>0}handleIconChange(e){const t=e.target;this.hasIcon=t.assignedElements().length>0}handleAnchorIntersection(e){const{target:t,isIntersecting:r}=e;t===this.topAnchor&&(this.isAtScrollTop=r),t===this.bottomAnchor&&(this.isAtScrollBottom=r)}getIsConnectedPromise(){return new Promise(e=>{this.isConnectedPromiseResolve=e})}handleFocusTrapFocus(e){var m;const[t,r]=this.getFirstAndLastFocusableChildren();if(!t||!r){(m=this.dialog)==null||m.focus();return}const i=e.target===this.firstFocusTrap,s=!i,n=e.relatedTarget===t,h=e.relatedTarget===r,p=!n&&!h;if(s&&h||i&&p){t.focus();return}if(i&&n||s&&p){r.focus();return}}getFirstAndLastFocusableChildren(){let e=null,t=null;for(this.treewalker.currentNode=this.treewalker.root;this.treewalker.nextNode();){const r=this.treewalker.currentNode;Un(r)&&(e||(e=r),t=r)}return[e,t]}}Z(R),d([l({type:Boolean})],R.prototype,"open",null),d([l({type:Boolean})],R.prototype,"quick",void 0),d([l({attribute:!1})],R.prototype,"returnValue",void 0),d([l()],R.prototype,"type",void 0),d([l({type:Boolean,attribute:"no-focus-trap"})],R.prototype,"noFocusTrap",void 0),d([k("dialog")],R.prototype,"dialog",void 0),d([k(".scrim")],R.prototype,"scrim",void 0),d([k(".container")],R.prototype,"container",void 0),d([k(".headline")],R.prototype,"headline",void 0),d([k(".content")],R.prototype,"content",void 0),d([k(".actions")],R.prototype,"actions",void 0),d([w()],R.prototype,"isAtScrollTop",void 0),d([w()],R.prototype,"isAtScrollBottom",void 0),d([k(".scroller")],R.prototype,"scroller",void 0),d([k(".top.anchor")],R.prototype,"topAnchor",void 0),d([k(".bottom.anchor")],R.prototype,"bottomAnchor",void 0),d([k(".focus-trap")],R.prototype,"firstFocusTrap",void 0),d([w()],R.prototype,"hasHeadline",void 0),d([w()],R.prototype,"hasActions",void 0),d([w()],R.prototype,"hasIcon",void 0);function Un(o){var s;const e=":is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])",t=":not(:disabled,[disabled])";return o.matches(e+t+':not([tabindex^="-"])')?!0:!o.localName.includes("-")||!o.matches(t)?!1:((s=o.shadowRoot)==null?void 0:s.delegatesFocus)??!1}/**
|
|
559
559
|
* @license
|
|
560
560
|
* Copyright 2024 Google LLC
|
|
561
561
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -651,7 +651,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
651
651
|
<span class="label ${L(r)}" aria-hidden=${!t}
|
|
652
652
|
>${i}</span
|
|
653
653
|
>
|
|
654
|
-
`}animateLabelIfNeeded({wasFocused:e,wasPopulated:t}){var s,n,h;if(!this.label)return;e??(e=this.focused),t??(t=this.populated);const r=e||t,i=this.focused||this.populated;r!==i&&(this.isAnimating=!0,(s=this.labelAnimation)==null||s.cancel(),this.labelAnimation=(n=this.floatingLabelEl)==null?void 0:n.animate(this.getLabelKeyframes(),{duration:150,easing:pe.STANDARD}),(h=this.labelAnimation)==null||h.addEventListener("finish",()=>{this.isAnimating=!1}))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:t}=this;if(!e||!t)return[];const{x:r,y:i,height:s}=e.getBoundingClientRect(),{x:n,y:h,height:p}=t.getBoundingClientRect(),v=e.scrollWidth,f=t.scrollWidth,m=f/v,_=n-r,x=h-i+Math.round((p-s*m)/2),S=`translateX(${_}px) translateY(${x}px) scale(${m})`,C="translateX(0) translateY(0) scale(1)",
|
|
654
|
+
`}animateLabelIfNeeded({wasFocused:e,wasPopulated:t}){var s,n,h;if(!this.label)return;e??(e=this.focused),t??(t=this.populated);const r=e||t,i=this.focused||this.populated;r!==i&&(this.isAnimating=!0,(s=this.labelAnimation)==null||s.cancel(),this.labelAnimation=(n=this.floatingLabelEl)==null?void 0:n.animate(this.getLabelKeyframes(),{duration:150,easing:pe.STANDARD}),(h=this.labelAnimation)==null||h.addEventListener("finish",()=>{this.isAnimating=!1}))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:t}=this;if(!e||!t)return[];const{x:r,y:i,height:s}=e.getBoundingClientRect(),{x:n,y:h,height:p}=t.getBoundingClientRect(),v=e.scrollWidth,f=t.scrollWidth,m=f/v,_=n-r,x=h-i+Math.round((p-s*m)/2),S=`translateX(${_}px) translateY(${x}px) scale(${m})`,C="translateX(0) translateY(0) scale(1)",z=t.clientWidth,O=f>z?`${z/m}px`:"";return this.focused||this.populated?[{transform:S,width:O},{transform:C,width:O}]:[{transform:C,width:O},{transform:S,width:O}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}d([l({type:Boolean})],D.prototype,"disabled",void 0),d([l({type:Boolean})],D.prototype,"error",void 0),d([l({type:Boolean})],D.prototype,"focused",void 0),d([l()],D.prototype,"label",void 0),d([l({type:Boolean,attribute:"no-asterisk"})],D.prototype,"noAsterisk",void 0),d([l({type:Boolean})],D.prototype,"populated",void 0),d([l({type:Boolean})],D.prototype,"required",void 0),d([l({type:Boolean})],D.prototype,"resizable",void 0),d([l({attribute:"supporting-text"})],D.prototype,"supportingText",void 0),d([l({attribute:"error-text"})],D.prototype,"errorText",void 0),d([l({type:Number})],D.prototype,"count",void 0),d([l({type:Number})],D.prototype,"max",void 0),d([l({type:Boolean,attribute:"has-start"})],D.prototype,"hasStart",void 0),d([l({type:Boolean,attribute:"has-end"})],D.prototype,"hasEnd",void 0),d([G({slot:"aria-describedby"})],D.prototype,"slottedAriaDescribedBy",void 0),d([w()],D.prototype,"isAnimating",void 0),d([w()],D.prototype,"refreshErrorAlert",void 0),d([w()],D.prototype,"disableTransitions",void 0),d([k(".label.floating")],D.prototype,"floatingLabelEl",void 0),d([k(".label.resting")],D.prototype,"restingLabelEl",void 0),d([k(".container")],D.prototype,"containerEl",void 0);/**
|
|
655
655
|
* @license
|
|
656
656
|
* Copyright 2021 Google LLC
|
|
657
657
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -798,7 +798,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
798
798
|
* @license
|
|
799
799
|
* Copyright 2023 Google LLC
|
|
800
800
|
* SPDX-License-Identifier: Apache-2.0
|
|
801
|
-
*/const j={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class Ca{constructor(e){this.handleKeydown=f=>{const m=f.key;if(f.defaultPrevented||!this.isNavigableKey(m))return;const _=this.items;if(!_.length)return;const x=gt(_,this.isActivatable);f.preventDefault();const S=this.isRtl(),C=S?j.ArrowRight:j.ArrowLeft,
|
|
801
|
+
*/const j={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class Ca{constructor(e){this.handleKeydown=f=>{const m=f.key;if(f.defaultPrevented||!this.isNavigableKey(m))return;const _=this.items;if(!_.length)return;const x=gt(_,this.isActivatable);f.preventDefault();const S=this.isRtl(),C=S?j.ArrowRight:j.ArrowLeft,z=S?j.ArrowLeft:j.ArrowRight;let T=null;switch(m){case j.ArrowDown:case z:T=Sa(_,x,this.isActivatable,this.wrapNavigation());break;case j.ArrowUp:case C:T=ka(_,x,this.isActivatable,this.wrapNavigation());break;case j.Home:T=_a(_,this.isActivatable);break;case j.End:T=xa(_,this.isActivatable);break}T&&x&&x.item!==T&&(x.item.tabIndex=-1)},this.onDeactivateItems=()=>{const f=this.items;for(const m of f)this.deactivateItem(m)},this.onRequestActivation=f=>{this.onDeactivateItems();const m=f.target;this.activateItem(m),m.focus()},this.onSlotchange=()=>{const f=this.items;let m=!1;for(const x of f){if(!x.disabled&&x.tabIndex>-1&&!m){m=!0,x.tabIndex=0;continue}x.tabIndex=-1}if(m)return;const _=Mr(f,this.isActivatable);_&&(_.tabIndex=0)};const{isItem:t,getPossibleItems:r,isRtl:i,deactivateItem:s,activateItem:n,isNavigableKey:h,isActivatable:p,wrapNavigation:v}=e;this.isItem=t,this.getPossibleItems=r,this.isRtl=i,this.deactivateItem=s,this.activateItem=n,this.isNavigableKey=h,this.isActivatable=p,this.wrapNavigation=v??(()=>!0)}get items(){const e=this.getPossibleItems(),t=[];for(const r of e){if(this.isItem(r)){t.push(r);continue}const s=r.item;s&&this.isItem(s)&&t.push(s)}return t}activateNextItem(){const e=this.items,t=gt(e,this.isActivatable);return t&&(t.item.tabIndex=-1),Sa(e,t,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const e=this.items,t=gt(e,this.isActivatable);return t&&(t.item.tabIndex=-1),ka(e,t,this.isActivatable,this.wrapNavigation())}}/**
|
|
802
802
|
* @license
|
|
803
803
|
* Copyright 2021 Google LLC
|
|
804
804
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -909,7 +909,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
909
909
|
* @license
|
|
910
910
|
* Copyright 2023 Google LLC
|
|
911
911
|
* SPDX-License-Identifier: Apache-2.0
|
|
912
|
-
*/const Nr={END_START:"end-start",START_START:"start-start",START_END:"start-end"};class kl{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:r,surfaceCorner:i,positioning:s,xOffset:n,yOffset:h,repositionStrategy:p}=this.getProperties(),v=r.toLowerCase().trim(),f=i.toLowerCase().trim();if(!e||!t)return;const m=window.innerWidth,_=window.innerHeight,x=document.createElement("div");x.style.opacity="0",x.style.position="fixed",x.style.display="block",x.style.inset="0",document.body.appendChild(x);const S=x.getBoundingClientRect();x.remove();const C=window.innerHeight-S.bottom,
|
|
912
|
+
*/const Nr={END_START:"end-start",START_START:"start-start",START_END:"start-end"};class kl{constructor(e,t){this.host=e,this.getProperties=t,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:e,anchorEl:t,anchorCorner:r,surfaceCorner:i,positioning:s,xOffset:n,yOffset:h,repositionStrategy:p}=this.getProperties(),v=r.toLowerCase().trim(),f=i.toLowerCase().trim();if(!e||!t)return;const m=window.innerWidth,_=window.innerHeight,x=document.createElement("div");x.style.opacity="0",x.style.position="fixed",x.style.display="block",x.style.inset="0",document.body.appendChild(x);const S=x.getBoundingClientRect();x.remove();const C=window.innerHeight-S.bottom,z=window.innerWidth-S.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,e.popover&&e.isConnected&&e.showPopover();const T=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),O=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),[se,W]=f.split("-"),[F,Ke]=v.split("-"),Ye=getComputedStyle(e).direction==="ltr";let{blockInset:De,blockOutOfBoundsCorrection:Xe,surfaceBlockProperty:mi}=this.calculateBlock({surfaceRect:T,anchorRect:O,anchorBlock:F,surfaceBlock:se,yOffset:h,positioning:s,windowInnerHeight:_,blockScrollbarHeight:C});if(Xe){const Bo=se==="start"?"end":"start",Mo=F==="start"?"end":"start",Re=this.calculateBlock({surfaceRect:T,anchorRect:O,anchorBlock:Mo,surfaceBlock:Bo,yOffset:h,positioning:s,windowInnerHeight:_,blockScrollbarHeight:C});Xe>Re.blockOutOfBoundsCorrection&&(De=Re.blockInset,Xe=Re.blockOutOfBoundsCorrection,mi=Re.surfaceBlockProperty)}let{inlineInset:Ze,inlineOutOfBoundsCorrection:Ot,surfaceInlineProperty:Cs}=this.calculateInline({surfaceRect:T,anchorRect:O,anchorInline:Ke,surfaceInline:W,xOffset:n,positioning:s,isLTR:Ye,windowInnerWidth:m,inlineScrollbarWidth:z});if(Ot){const Bo=W==="start"?"end":"start",Mo=Ke==="start"?"end":"start",Re=this.calculateInline({surfaceRect:T,anchorRect:O,anchorInline:Mo,surfaceInline:Bo,xOffset:n,positioning:s,isLTR:Ye,windowInnerWidth:m,inlineScrollbarWidth:z});Math.abs(Ot)>Math.abs(Re.inlineOutOfBoundsCorrection)&&(Ze=Re.inlineInset,Ot=Re.inlineOutOfBoundsCorrection,Cs=Re.surfaceInlineProperty)}p==="move"&&(De=De-Xe,Ze=Ze-Ot),this.surfaceStylesInternal={display:"block",opacity:"1",[mi]:`${De}px`,[Cs]:`${Ze}px`},p==="resize"&&(Xe&&(this.surfaceStylesInternal.height=`${T.height-Xe}px`),Ot&&(this.surfaceStylesInternal.width=`${T.width-Ot}px`)),this.host.requestUpdate()}calculateBlock(e){const{surfaceRect:t,anchorRect:r,anchorBlock:i,surfaceBlock:s,yOffset:n,positioning:h,windowInnerHeight:p,blockScrollbarHeight:v}=e,f=h==="fixed"||h==="document"?1:0,m=h==="document"?1:0,_=s==="start"?1:0,x=s==="end"?1:0,C=(i!==s?1:0)*r.height+n,z=_*r.top+x*(p-r.bottom-v),T=_*window.scrollY-x*window.scrollY,O=Math.abs(Math.min(0,p-z-C-t.height));return{blockInset:f*z+m*T+C,blockOutOfBoundsCorrection:O,surfaceBlockProperty:s==="start"?"inset-block-start":"inset-block-end"}}calculateInline(e){const{isLTR:t,surfaceInline:r,anchorInline:i,anchorRect:s,surfaceRect:n,xOffset:h,positioning:p,windowInnerWidth:v,inlineScrollbarWidth:f}=e,m=p==="fixed"||p==="document"?1:0,_=p==="document"?1:0,x=t?1:0,S=t?0:1,C=r==="start"?1:0,z=r==="end"?1:0,O=(i!==r?1:0)*s.width+h,se=C*s.left+z*(v-s.right-f),W=C*(v-s.right-f)+z*s.left,F=x*se+S*W,Ke=C*window.scrollX-z*window.scrollX,Ye=z*window.scrollX-C*window.scrollX,De=x*Ke+S*Ye,Xe=Math.abs(Math.min(0,v-F-O-n.width)),mi=m*F+O+_*De;let Ze=r==="start"?"inset-inline-start":"inset-inline-end";return(p==="document"||p==="fixed")&&(r==="start"&&t||r==="end"&&!t?Ze="left":Ze="right"),{inlineInset:mi,inlineOutOfBoundsCorrection:Xe,surfaceInlineProperty:Ze}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const e=this.getProperties();let t=!1;for(const[n,h]of Object.entries(e))if(t=t||h!==this.lastValues[n],t)break;const r=this.lastValues.isOpen!==e.isOpen,i=!!e.anchorEl,s=!!e.surfaceEl;t&&i&&s&&(this.lastValues.isOpen=e.isOpen,e.isOpen?(this.lastValues=e,await this.position(),e.onOpen()):r&&(await e.beforeClose(),this.close(),e.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const e=this.getProperties().surfaceEl;e!=null&&e.popover&&(e!=null&&e.isConnected)&&e.hidePopover()}}/**
|
|
913
913
|
* @license
|
|
914
914
|
* Copyright 2023 Google LLC
|
|
915
915
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -935,7 +935,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
935
935
|
@activate-typeahead=${this.handleActivateTypeahead}
|
|
936
936
|
@stay-open-on-focusout=${this.handleStayOpenOnFocusout}
|
|
937
937
|
@close-on-focusout=${this.handleCloseOnFocusout}
|
|
938
|
-
@slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return c`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:this.positioning==="fixed","has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&za(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const r=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const i=this.openCloseAnimationSignal.start(),s=e.offsetHeight,n=r==="UP",h=this.items,p=500,v=50,f=250,m=(p-f)/h.length,_=e.animate([{height:"0px"},{height:`${s}px`}],{duration:p,easing:pe.EMPHASIZED}),x=t.animate([{transform:n?`translateY(-${s}px)`:""},{transform:""}],{duration:p,easing:pe.EMPHASIZED}),S=e.animate([{opacity:0},{opacity:1}],v),C=[];for(let O=0;O<h.length;O++){const se=n?h.length-1-O:O,W=h[se],F=W.animate([{opacity:0},{opacity:1}],{duration:f,delay:m*O});W.classList.toggle("md-menu-hidden",!0),F.addEventListener("finish",()=>{W.classList.toggle("md-menu-hidden",!1)}),C.push([W,F])}let
|
|
938
|
+
@slotchange=${this.listController.onSlotchange}></slot>`}renderElevation(){return c`<md-elevation part="elevation"></md-elevation>`}getSurfaceClasses(){return{open:this.open,fixed:this.positioning==="fixed","has-overflow":this.hasOverflow}}captureKeydown(e){e.target===this&&!e.defaultPrevented&&za(e.code)&&(e.preventDefault(),this.close()),this.typeaheadController.onKeydown(e)}async animateOpen(){const e=this.surfaceEl,t=this.slotEl;if(!e||!t)return!0;const r=this.openDirection;this.dispatchEvent(new Event("opening")),e.classList.toggle("animating",!0);const i=this.openCloseAnimationSignal.start(),s=e.offsetHeight,n=r==="UP",h=this.items,p=500,v=50,f=250,m=(p-f)/h.length,_=e.animate([{height:"0px"},{height:`${s}px`}],{duration:p,easing:pe.EMPHASIZED}),x=t.animate([{transform:n?`translateY(-${s}px)`:""},{transform:""}],{duration:p,easing:pe.EMPHASIZED}),S=e.animate([{opacity:0},{opacity:1}],v),C=[];for(let O=0;O<h.length;O++){const se=n?h.length-1-O:O,W=h[se],F=W.animate([{opacity:0},{opacity:1}],{duration:f,delay:m*O});W.classList.toggle("md-menu-hidden",!0),F.addEventListener("finish",()=>{W.classList.toggle("md-menu-hidden",!1)}),C.push([W,F])}let z=O=>{};const T=new Promise(O=>{z=O});return i.addEventListener("abort",()=>{_.cancel(),x.cancel(),S.cancel(),C.forEach(([O,se])=>{O.classList.toggle("md-menu-hidden",!1),se.cancel()}),z(!0)}),_.addEventListener("finish",()=>{e.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),z(!1)}),await T}animateClose(){let e;const t=new Promise(F=>{e=F}),r=this.surfaceEl,i=this.slotEl;if(!r||!i)return e(!1),t;const n=this.openDirection==="UP";this.dispatchEvent(new Event("closing")),r.classList.toggle("animating",!0);const h=this.openCloseAnimationSignal.start(),p=r.offsetHeight,v=this.items,f=150,m=50,_=f-m,x=50,S=50,C=.35,z=(f-S-x)/v.length,T=r.animate([{height:`${p}px`},{height:`${p*C}px`}],{duration:f,easing:pe.EMPHASIZED_ACCELERATE}),O=i.animate([{transform:""},{transform:n?`translateY(-${p*(1-C)}px)`:""}],{duration:f,easing:pe.EMPHASIZED_ACCELERATE}),se=r.animate([{opacity:1},{opacity:0}],{duration:m,delay:_}),W=[];for(let F=0;F<v.length;F++){const Ke=n?F:v.length-1-F,Ye=v[Ke],De=Ye.animate([{opacity:1},{opacity:0}],{duration:x,delay:S+z*F});De.addEventListener("finish",()=>{Ye.classList.toggle("md-menu-hidden",!0)}),W.push([Ye,De])}return h.addEventListener("abort",()=>{T.cancel(),O.cancel(),se.cancel(),W.forEach(([F,Ke])=>{Ke.cancel(),F.classList.toggle("md-menu-hidden",!1)}),e(!1)}),T.addEventListener("finish",()=>{r.classList.toggle("animating",!1),W.forEach(([F])=>{F.classList.toggle("md-menu-hidden",!1)}),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),e(!0)}),t}handleKeydown(e){this.pointerPath=[],this.listController.handleKeydown(e)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(e){e.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(e){e.stopPropagation(),this.listController.onRequestActivation(e)}handleDeactivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(e){e.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(e){e.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1,this.slotItems.forEach(t=>{var r;(r=t.close)==null||r.call(t)})}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}d([k(".menu")],M.prototype,"surfaceEl",void 0),d([k("slot")],M.prototype,"slotEl",void 0),d([l()],M.prototype,"anchor",void 0),d([l()],M.prototype,"positioning",void 0),d([l({type:Boolean})],M.prototype,"quick",void 0),d([l({type:Boolean,attribute:"has-overflow"})],M.prototype,"hasOverflow",void 0),d([l({type:Boolean,reflect:!0})],M.prototype,"open",void 0),d([l({type:Number,attribute:"x-offset"})],M.prototype,"xOffset",void 0),d([l({type:Number,attribute:"y-offset"})],M.prototype,"yOffset",void 0),d([l({type:Number,attribute:"typeahead-delay"})],M.prototype,"typeaheadDelay",void 0),d([l({attribute:"anchor-corner"})],M.prototype,"anchorCorner",void 0),d([l({attribute:"menu-corner"})],M.prototype,"menuCorner",void 0),d([l({type:Boolean,attribute:"stay-open-on-outside-click"})],M.prototype,"stayOpenOnOutsideClick",void 0),d([l({type:Boolean,attribute:"stay-open-on-focusout"})],M.prototype,"stayOpenOnFocusout",void 0),d([l({type:Boolean,attribute:"skip-restore-focus"})],M.prototype,"skipRestoreFocus",void 0),d([l({attribute:"default-focus"})],M.prototype,"defaultFocus",void 0),d([l({type:Boolean,attribute:"no-navigation-wrap"})],M.prototype,"noNavigationWrap",void 0),d([G({flatten:!0})],M.prototype,"slotItems",void 0),d([w()],M.prototype,"typeaheadActive",void 0);/**
|
|
939
939
|
* @license
|
|
940
940
|
* Copyright 2024 Google LLC
|
|
941
941
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -1694,7 +1694,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
1694
1694
|
${this.supportingText?c`<div class="supporting-text">${this.supportingText}</div>`:u}
|
|
1695
1695
|
</div>
|
|
1696
1696
|
|
|
1697
|
-
<md-icon class="chevron">
|
|
1697
|
+
<md-icon class="chevron">expand_more</md-icon>
|
|
1698
1698
|
</summary>
|
|
1699
1699
|
|
|
1700
1700
|
<div id=${e} class="scb-accordion-bottom" role="region" aria-labelledby=${t}>
|
|
@@ -1839,7 +1839,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
1839
1839
|
<div class="scb-accordion" ?detached=${this.detached}>
|
|
1840
1840
|
<slot></slot>
|
|
1841
1841
|
</div>
|
|
1842
|
-
`}},Xa([l({type:Boolean,reflect:!0})],a.ScbAccordion.prototype,"detached",2),a.ScbAccordion=Xa([g("scb-accordion")],a.ScbAccordion);var Ec=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,ge=(o,e,t,r)=>{for(var i=r>1?void 0:r?Ac(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Ec(e,t,i),i};a.ScbButton=class extends y{constructor(){super(...arguments),this.variant="filled",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.disabled=!1,this.href="",this.target="",this.rel="",this.__loadedButtons=new Set,this.__iconLoaded=!1}async __ensureDepsLoaded(){if(!this.__loadedButtons.has(this.variant)){switch(this.variant){case"filled":await Promise.resolve().then(()=>yn);break;case"outlined":await Promise.resolve().then(()=>$n);break;case"filled-tonal":await Promise.resolve().then(()=>wn);break;case"text":await Promise.resolve().then(()=>An);break}this.__loadedButtons.add(this.variant)}this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>Y),this.__iconLoaded=!0)}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(e){var t;return((t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("button"))??null}__syncAriaToInner(){var v;const e=this.__getMdHost(),t=this.__getInnerNativeButton(e);if(!e||!t)return;const r=(this.getAttribute("aria-label")||"").trim(),i=(e.getAttribute("aria-label")||"").trim(),s=this.label.trim()===""?(this.icon||"").trim():"",n=r||i||s;n?t.setAttribute("aria-label",n):t.removeAttribute("aria-label");const h=this.getAttribute("aria-controls");h!==null?t.setAttribute("aria-controls",h):t.removeAttribute("aria-controls");const p=this.getAttribute("aria-expanded");p!==null?t.setAttribute("aria-expanded",p):t.removeAttribute("aria-expanded"),e.removeAttribute("aria-label"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),(v=this.__ariaObserver)==null||v.disconnect(),this.__ariaObserver=new MutationObserver(f=>{const m=this.__getMdHost(),_=this.__getInnerNativeButton(m);if(!(!m||!_)){for(const x of f){if(x.type!=="attributes"||!x.attributeName)continue;const S=x.attributeName,C=this.getAttribute(S);if(S==="aria-label"){const
|
|
1842
|
+
`}},Xa([l({type:Boolean,reflect:!0})],a.ScbAccordion.prototype,"detached",2),a.ScbAccordion=Xa([g("scb-accordion")],a.ScbAccordion);var Ec=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,ge=(o,e,t,r)=>{for(var i=r>1?void 0:r?Ac(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&Ec(e,t,i),i};a.ScbButton=class extends y{constructor(){super(...arguments),this.variant="filled",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.disabled=!1,this.href="",this.target="",this.rel="",this.__loadedButtons=new Set,this.__iconLoaded=!1}async __ensureDepsLoaded(){if(!this.__loadedButtons.has(this.variant)){switch(this.variant){case"filled":await Promise.resolve().then(()=>yn);break;case"outlined":await Promise.resolve().then(()=>$n);break;case"filled-tonal":await Promise.resolve().then(()=>wn);break;case"text":await Promise.resolve().then(()=>An);break}this.__loadedButtons.add(this.variant)}this.icon&&!this.__iconLoaded&&(await Promise.resolve().then(()=>Y),this.__iconLoaded=!0)}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(e){var t;return((t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("button"))??null}__syncAriaToInner(){var v;const e=this.__getMdHost(),t=this.__getInnerNativeButton(e);if(!e||!t)return;const r=(this.getAttribute("aria-label")||"").trim(),i=(e.getAttribute("aria-label")||"").trim(),s=this.label.trim()===""?(this.icon||"").trim():"",n=r||i||s;n?t.setAttribute("aria-label",n):t.removeAttribute("aria-label");const h=this.getAttribute("aria-controls");h!==null?t.setAttribute("aria-controls",h):t.removeAttribute("aria-controls");const p=this.getAttribute("aria-expanded");p!==null?t.setAttribute("aria-expanded",p):t.removeAttribute("aria-expanded"),e.removeAttribute("aria-label"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),(v=this.__ariaObserver)==null||v.disconnect(),this.__ariaObserver=new MutationObserver(f=>{const m=this.__getMdHost(),_=this.__getInnerNativeButton(m);if(!(!m||!_)){for(const x of f){if(x.type!=="attributes"||!x.attributeName)continue;const S=x.attributeName,C=this.getAttribute(S);if(S==="aria-label"){const z=(m.getAttribute("aria-label")||"").trim(),T=(C||z||(this.label.trim()===""?(this.icon||"").trim():"")).trim();T?_.setAttribute("aria-label",T):_.removeAttribute("aria-label"),m.removeAttribute("aria-label")}else(S==="aria-controls"||S==="aria-expanded")&&(C===null?_.removeAttribute(S):_.setAttribute(S,C),S==="aria-expanded"&&this.removeAttribute("aria-expanded"))}m.removeAttribute("aria-label"),m.removeAttribute("aria-controls"),m.removeAttribute("aria-expanded")}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const e=this.closest("form");e&&(this.type==="submit"&&e.requestSubmit(),this.type==="reset"&&e.reset())}}),this.__ensureDepsLoaded(),this.__syncAriaToInner()}updated(e){(e.has("variant")||e.has("icon")&&this.icon)&&this.__ensureDepsLoaded(),e.has("variant")&&this.__syncAriaToInner()}disconnectedCallback(){var e;(e=this.__ariaObserver)==null||e.disconnect(),super.disconnectedCallback()}static get styles(){return b`
|
|
1843
1843
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
1844
1844
|
:host {
|
|
1845
1845
|
display: inline-flex;
|
|
@@ -4845,7 +4845,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
4845
4845
|
:host([direction="row"]) ::slotted(*) {
|
|
4846
4846
|
flex: var(--scb-stack-item-flex, 0 0 auto);
|
|
4847
4847
|
}
|
|
4848
|
-
`,Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"direction",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"gap",2),Pe([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbStack.prototype,"rowGap",2),Pe([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbStack.prototype,"columnGap",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"align",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"justify",2),Pe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"wrap",2),Pe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"inline",2),a.ScbStack=Pe([g("scb-stack")],a.ScbStack);var th=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Oo=(o,e,t,r)=>{for(var i=r>1?void 0:r?rh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&th(e,t,i),i};a.ScbHeaderDrawerGroup=class extends y{constructor(){super(...arguments),this.label=""}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerGroup.styles=b`:host{display:none !important}`,Oo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"label",2),Oo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"icon",2),a.ScbHeaderDrawerGroup=Oo([g("scb-header-drawer-group")],a.ScbHeaderDrawerGroup);var ih=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,ci=(o,e,t,r)=>{for(var i=r>1?void 0:r?oh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ih(e,t,i),i};a.ScbHeaderDrawerItem=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerItem.styles=b`:host{display:none !important}`,ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"label",2),ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"href",2),ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"icon",2),a.ScbHeaderDrawerItem=ci([g("scb-header-drawer-item")],a.ScbHeaderDrawerItem);var ah=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,Po=(o,e,t,r)=>{for(var i=r>1?void 0:r?sh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ah(e,t,i),i};a.ScbHeaderTab=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderTab.styles=b`:host{display:none !important}`,Po([l({type:String})],a.ScbHeaderTab.prototype,"label",2),Po([l({type:String})],a.ScbHeaderTab.prototype,"href",2),a.ScbHeaderTab=Po([g("scb-header-tab")],a.ScbHeaderTab);var nh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,di=(o,e,t,r)=>{for(var i=r>1?void 0:r?lh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&nh(e,t,i),i};a.ScbHeaderUtility=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderUtility.styles=b`:host{display:none !important}`,di([l({type:String})],a.ScbHeaderUtility.prototype,"label",2),di([l({type:String})],a.ScbHeaderUtility.prototype,"href",2),di([l({type:String})],a.ScbHeaderUtility.prototype,"target",2),a.ScbHeaderUtility=di([g("scb-header-utility")],a.ScbHeaderUtility);var ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,T=(o,e,t,r)=>{for(var i=r>1?void 0:r?dh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ch(e,t,i),i};const Lo={fromAttribute:o=>o==null?!0:!/^(false|0|off|no)$/i.test(o),toAttribute:o=>String(!!o)};a.ScbHeader=class extends y{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}),r=[],i=[],s=[],n=h=>({label:h.getAttribute("label")??"",href:h.getAttribute("href")??void 0,icon:h.getAttribute("icon")??void 0});for(const h of t){const p=h.tagName.toLowerCase();if(p==="scb-header-tab"){r.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){i.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#",target:h.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const v={label:h.getAttribute("label")??"",icon:h.getAttribute("icon")??void 0,children:[]};h.querySelectorAll("scb-header-drawer-item").forEach(m=>v.children.push(n(m))),s.push(v);continue}p==="scb-header-drawer-item"&&s.push(n(h))}this._slotTabs=r,this._slotUtils=i,this._slotMenu=s,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{var m,_,x;const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,s=this._overflows(this._util),n=this._overflows(this._tabsEl),h=r<this.BP_MD||s||n;this._collapsed?!h&&i>=this._unlockAtWidth&&this._setCollapsed(!1):h&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const S=getComputedStyle(this._searchWrap),C=Math.max(this._num(S.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),I=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),z=this.showDrawer&&(r<this.BP_MD||this._collapsed)?((m=this._menuBtn)==null?void 0:m.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+I+C+I+z+8>i+.5}this._setHideSearch(p);let v=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const S=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),C=((_=this._menuBtn)==null?void 0:_.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48),I=(((x=this._logoGroup)==null?void 0:x.getBoundingClientRect().width)||0)+S+C;this._hideLogoText?v=!(i>=this._logoTextUnlockAt):I>i+.5&&(v=!0,this._logoTextUnlockAt=i+this._HYST)}else v=!1,this._logoTextUnlockAt=0;this._setHideLogoText(v)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await a.ScbHeader._nextFrame(),await a.ScbHeader._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{var i;const t=this._searchEl;if(t!=null&&t.submit&&typeof t.submit=="function"){t.submit();return}const r=(t==null?void 0:t.value)??void 0;this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),(i=t==null?void 0:t.focus)==null||i.call(t)},this._onTabsChange=e=>{var n,h,p;const t=e,r=((n=t==null?void 0:t.detail)==null?void 0:n.activeTabIndex)??((h=e.target)==null?void 0:h.activeTabIndex)??0;this.activeTab=r;const s=((p=(this._slotTabs.length?this._slotTabs:this.tabs)[r])==null?void 0:p.href)??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:s},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",a.ScbHeader.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",a.ScbHeader.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 Promise.resolve().then(()=>Td),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([Promise.resolve().then(()=>tp),Promise.resolve().then(()=>Jh)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await Promise.resolve().then(()=>Uc),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){var e;return((e=this.shadowRoot)==null?void 0:e.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(){var t;(t=this._slotMo)==null||t.disconnect();const e=new MutationObserver(r=>{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 r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}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,r=()=>this._ensureDrawerMounted();t==null||t.addEventListener("pointerenter",r,{once:!0}),t==null||t.addEventListener("focusin",r,{once:!0}),t==null||t.addEventListener("touchstart",r,{once:!0,passive:!0});const i=s=>"requestIdleCallback"in window?window.requestIdleCallback(s,{timeout:1500}):setTimeout(s,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{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(){var e,t;(e=this._ro)==null||e.disconnect(),(t=this._slotMo)==null||t.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){var t,r;const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),(t=e.show)==null||t.call(e),(r=e.openDrawer)==null||r.call(e),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((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
|
|
4848
|
+
`,Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"direction",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"gap",2),Pe([l({type:String,attribute:"row-gap",reflect:!0})],a.ScbStack.prototype,"rowGap",2),Pe([l({type:String,attribute:"column-gap",reflect:!0})],a.ScbStack.prototype,"columnGap",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"align",2),Pe([l({type:String,reflect:!0})],a.ScbStack.prototype,"justify",2),Pe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"wrap",2),Pe([l({type:Boolean,reflect:!0})],a.ScbStack.prototype,"inline",2),a.ScbStack=Pe([g("scb-stack")],a.ScbStack);var th=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Oo=(o,e,t,r)=>{for(var i=r>1?void 0:r?rh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&th(e,t,i),i};a.ScbHeaderDrawerGroup=class extends y{constructor(){super(...arguments),this.label=""}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerGroup.styles=b`:host{display:none !important}`,Oo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"label",2),Oo([l({type:String})],a.ScbHeaderDrawerGroup.prototype,"icon",2),a.ScbHeaderDrawerGroup=Oo([g("scb-header-drawer-group")],a.ScbHeaderDrawerGroup);var ih=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,ci=(o,e,t,r)=>{for(var i=r>1?void 0:r?oh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ih(e,t,i),i};a.ScbHeaderDrawerItem=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderDrawerItem.styles=b`:host{display:none !important}`,ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"label",2),ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"href",2),ci([l({type:String})],a.ScbHeaderDrawerItem.prototype,"icon",2),a.ScbHeaderDrawerItem=ci([g("scb-header-drawer-item")],a.ScbHeaderDrawerItem);var ah=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,Po=(o,e,t,r)=>{for(var i=r>1?void 0:r?sh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ah(e,t,i),i};a.ScbHeaderTab=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderTab.styles=b`:host{display:none !important}`,Po([l({type:String})],a.ScbHeaderTab.prototype,"label",2),Po([l({type:String})],a.ScbHeaderTab.prototype,"href",2),a.ScbHeaderTab=Po([g("scb-header-tab")],a.ScbHeaderTab);var nh=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,di=(o,e,t,r)=>{for(var i=r>1?void 0:r?lh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&nh(e,t,i),i};a.ScbHeaderUtility=class extends y{constructor(){super(...arguments),this.label="",this.href="#"}render(){return c`<slot></slot>`}},a.ScbHeaderUtility.styles=b`:host{display:none !important}`,di([l({type:String})],a.ScbHeaderUtility.prototype,"label",2),di([l({type:String})],a.ScbHeaderUtility.prototype,"href",2),di([l({type:String})],a.ScbHeaderUtility.prototype,"target",2),a.ScbHeaderUtility=di([g("scb-header-utility")],a.ScbHeaderUtility);var ch=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,I=(o,e,t,r)=>{for(var i=r>1?void 0:r?dh(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&ch(e,t,i),i};const Lo={fromAttribute:o=>o==null?!0:!/^(false|0|off|no)$/i.test(o),toAttribute:o=>String(!!o)};a.ScbHeader=class extends y{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.searchText="",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}),r=[],i=[],s=[],n=h=>({label:h.getAttribute("label")??"",href:h.getAttribute("href")??void 0,icon:h.getAttribute("icon")??void 0});for(const h of t){const p=h.tagName.toLowerCase();if(p==="scb-header-tab"){r.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#"});continue}if(p==="scb-header-utility"){i.push({label:h.getAttribute("label")??"",href:h.getAttribute("href")??"#",target:h.getAttribute("target")??void 0});continue}if(p==="scb-header-drawer-group"){const v={label:h.getAttribute("label")??"",icon:h.getAttribute("icon")??void 0,children:[]};h.querySelectorAll("scb-header-drawer-item").forEach(m=>v.children.push(n(m))),s.push(v);continue}p==="scb-header-drawer-item"&&s.push(n(h))}this._slotTabs=r,this._slotUtils=i,this._slotMenu=s,queueMicrotask(()=>{this.updateComplete.then(()=>{this._applyActiveToTabs(),this._scheduleMeasure()})})},this._measure=()=>{var m,_,x;const e=this._top,t=this._logoGroup;if(!e||!t)return;const r=window.innerWidth,i=e.clientWidth,s=this._overflows(this._util),n=this._overflows(this._tabsEl),h=r<this.BP_MD||s||n;this._collapsed?!h&&i>=this._unlockAtWidth&&this._setCollapsed(!1):h&&(this._unlockAtWidth=i+this._HYST,this._setCollapsed(!0));let p=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const S=getComputedStyle(this._searchWrap),C=Math.max(this._num(S.minWidth,this._tokenPx("--scb-header-search-min",320)),this._tokenPx("--scb-header-search-min",320)),z=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),T=this.showDrawer&&(r<this.BP_MD||this._collapsed)?((m=this._menuBtn)==null?void 0:m.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48):0;p=t.getBoundingClientRect().width+z+C+z+T+8>i+.5}this._setHideSearch(p);let v=!1;if(this.showDrawer&&(r<this.BP_MD||this._collapsed)&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const S=this._num(getComputedStyle(e).gap,this._tokenPx("--spacing-7",24)),C=((_=this._menuBtn)==null?void 0:_.getBoundingClientRect().width)||this._tokenPx("--icon-size-large",48),z=(((x=this._logoGroup)==null?void 0:x.getBoundingClientRect().width)||0)+S+C;this._hideLogoText?v=!(i>=this._logoTextUnlockAt):z>i+.5&&(v=!0,this._logoTextUnlockAt=i+this._HYST)}else v=!1,this._logoTextUnlockAt=0;this._setHideLogoText(v)},this._onMenuClick=async e=>{e.preventDefault(),e.stopPropagation(),this.showDrawer&&(this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),await this._ensureDrawerMounted(),await a.ScbHeader._nextFrame(),await a.ScbHeader._nextFrame(),this._openDrawerNow())},this._onSearchClick=e=>{var i;const t=this._searchEl;if(t!=null&&t.submit&&typeof t.submit=="function"){t.submit();return}const r=(t==null?void 0:t.value)??"";this.searchText=r,this.dispatchEvent(new CustomEvent("search-click",{detail:{value:r},bubbles:!0,composed:!0})),(i=t==null?void 0:t.focus)==null||i.call(t)},this._onTabsChange=e=>{var n,h,p;const t=e,r=((n=t==null?void 0:t.detail)==null?void 0:n.activeTabIndex)??((h=e.target)==null?void 0:h.activeTabIndex)??0;this.activeTab=r;const s=((p=(this._slotTabs.length?this._slotTabs:this.tabs)[r])==null?void 0:p.href)??"";this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:s},bubbles:!0,composed:!0}))},this._onSearchInput=e=>{var t;this.searchText=((t=e.detail)==null?void 0:t.value)??"",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0}))},this._onSearchSubmit=e=>{var t,r;this.searchText=((t=e.detail)==null?void 0:t.value)??"",this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:(r=e.detail)==null?void 0:r.active},bubbles:!0,composed:!0}))},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0}))}}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",a.ScbHeader.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",a.ScbHeader.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 Promise.resolve().then(()=>Td),this.__drawerLoaded=!0})()),this.__ensureDrawerPromise}async __ensureTabs(){if(!this.__tabsLoaded)return this.__ensureTabsPromise??(this.__ensureTabsPromise=(async()=>{await Promise.all([Promise.resolve().then(()=>tp),Promise.resolve().then(()=>Jh)]),this.__tabsLoaded=!0})()),this.__ensureTabsPromise}async __ensureSearch(){if(!this.__searchLoaded)return this.__ensureSearchPromise??(this.__ensureSearchPromise=(async()=>{await Promise.resolve().then(()=>Uc),this.__searchLoaded=!0})()),this.__ensureSearchPromise}get _slotEl(){var e;return((e=this.shadowRoot)==null?void 0:e.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(){var t;(t=this._slotMo)==null||t.disconnect();const e=new MutationObserver(r=>{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 r=Number.parseFloat(String(e??"").trim());return Number.isFinite(r)?r:t}_tokenPx(e,t){const r=getComputedStyle(this);return this._num(r.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}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,r=()=>this._ensureDrawerMounted();t==null||t.addEventListener("pointerenter",r,{once:!0}),t==null||t.addEventListener("focusin",r,{once:!0}),t==null||t.addEventListener("touchstart",r,{once:!0,passive:!0});const i=s=>"requestIdleCallback"in window?window.requestIdleCallback(s,{timeout:1500}):setTimeout(s,600);this.showDrawer&&i(()=>{this.__ensureDrawer()}),this._collapsed||i(()=>{this.__ensureTabs()}),this.showSearch&&i(()=>{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(){var e,t;(e=this._ro)==null||e.disconnect(),(t=this._slotMo)==null||t.disconnect(),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}async _ensureDrawerMounted(){this._drawerMounted||(await this.__ensureDrawer(),this._drawerMounted=!0,await this.updateComplete)}_openDrawerNow(){var t,r;const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0,e.setAttribute("open",""),(t=e.show)==null||t.call(e),(r=e.openDrawer)==null||r.call(e),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((r,i)=>{r.selected=i===this.activeTab})}_renderDrawerNodes(e){return!e||e.length===0?c``:c`${e.map(t=>{const r=Array.isArray(t.children)&&t.children.length>0;return c`
|
|
4849
4849
|
<scb-drawer-item
|
|
4850
4850
|
label=${t.label}
|
|
4851
4851
|
?selected=${!1}
|
|
@@ -4893,7 +4893,11 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
4893
4893
|
id=${this._searchId}
|
|
4894
4894
|
size="compact"
|
|
4895
4895
|
style=${i}
|
|
4896
|
+
.value=${this.searchText}
|
|
4896
4897
|
.supportingText=${this.searchPlaceholder??""}
|
|
4898
|
+
@scb-search-input=${this._onSearchInput}
|
|
4899
|
+
@scb-search-submit=${this._onSearchSubmit}
|
|
4900
|
+
@scb-search-clear=${this._onSearchClear}
|
|
4897
4901
|
></scb-search>
|
|
4898
4902
|
<scb-button
|
|
4899
4903
|
variant="filled-tonal"
|
|
@@ -5111,7 +5115,7 @@ var ScbWcTest=function(a){"use strict";var $s;function d(o,e,t,r){var i=argument
|
|
|
5111
5115
|
:host([data-hide-logo-text]) .logo-text {
|
|
5112
5116
|
display: none;
|
|
5113
5117
|
}
|
|
5114
|
-
`,a.ScbHeader._nextFrame=()=>new Promise(o=>requestAnimationFrame(()=>o())),
|
|
5118
|
+
`,a.ScbHeader._nextFrame=()=>new Promise(o=>requestAnimationFrame(()=>o())),I([l({type:String,attribute:"max-width"})],a.ScbHeader.prototype,"maxWidth",2),I([l({type:String,attribute:"logo-text"})],a.ScbHeader.prototype,"logoText",2),I([l({type:String,attribute:"logo-href"})],a.ScbHeader.prototype,"logoHref",2),I([l({type:Boolean,reflect:!0})],a.ScbHeader.prototype,"banner",2),I([l({type:String,attribute:"banner-label"})],a.ScbHeader.prototype,"bannerLabel",2),I([l({attribute:"tabs",converter:a.ScbHeader._JSON_ARRAY})],a.ScbHeader.prototype,"tabs",2),I([l({type:Number,attribute:"active-tab"})],a.ScbHeader.prototype,"activeTab",2),I([l({attribute:"utility-items",converter:a.ScbHeader._JSON_ARRAY})],a.ScbHeader.prototype,"utilityItems",2),I([l({type:String,attribute:"search-placeholder"})],a.ScbHeader.prototype,"searchPlaceholder",2),I([l({type:String,attribute:"drawer-label"})],a.ScbHeader.prototype,"drawerLabel",2),I([l({type:String,attribute:"drawer-sub-label"})],a.ScbHeader.prototype,"drawerSubLabel",2),I([l({type:String,attribute:"drawer-section-label"})],a.ScbHeader.prototype,"drawerSectionLabel",2),I([l({type:String,attribute:"drawer-search-placeholder"})],a.ScbHeader.prototype,"drawerSearchPlaceholder",2),I([l({attribute:"menu-data",converter:a.ScbHeader._JSON_ARRAY})],a.ScbHeader.prototype,"menuData",2),I([l({attribute:"show-drawer",reflect:!0,converter:Lo})],a.ScbHeader.prototype,"showDrawer",2),I([l({attribute:"show-search",reflect:!0,converter:Lo})],a.ScbHeader.prototype,"showSearch",2),I([l({attribute:"include-utility-in-drawer",reflect:!0,converter:Lo})],a.ScbHeader.prototype,"includeUtilityInDrawer",2),I([l({type:String,attribute:"search-max"})],a.ScbHeader.prototype,"searchMax",2),I([l({type:String,attribute:"search-min"})],a.ScbHeader.prototype,"searchMin",2),I([l({type:String,attribute:"search-height"})],a.ScbHeader.prototype,"searchHeight",2),I([l({type:String,attribute:"search-text",reflect:!0})],a.ScbHeader.prototype,"searchText",2),I([w()],a.ScbHeader.prototype,"_drawerId",2),I([w()],a.ScbHeader.prototype,"_drawerMounted",2),I([w()],a.ScbHeader.prototype,"_drawerExpanded",2),I([w()],a.ScbHeader.prototype,"_searchId",2),I([w()],a.ScbHeader.prototype,"_slotTabs",2),I([w()],a.ScbHeader.prototype,"_slotUtils",2),I([w()],a.ScbHeader.prototype,"_slotMenu",2),I([w()],a.ScbHeader.prototype,"_collapsed",2),I([w()],a.ScbHeader.prototype,"_hideLogoText",2),a.ScbHeader=I([g("scb-header")],a.ScbHeader);var hh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,At=(o,e,t,r)=>{for(var i=r>1?void 0:r?ph(e,t):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(r?n(e,t,i):n(i))||i);return r&&i&&hh(e,t,i),i};a.ScbHorizontalScroller=class extends y{constructor(){super(...arguments),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.updateScrollButtons=()=>{var r;this.requestUpdate();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".scb-horizontal-scroller");if(!e)return;e.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const t=e;t.scrollLeft+t.clientWidth<t.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.handleScroll=()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".scb-horizontal-scroller");e&&(this.updateScrollButtons(),this.dispatchCustomEvent("scb-scroll",{scrollLeft:e.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEvent("scb-scroll-start",{scrollLeft:e.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEvent("scb-scroll-end",{scrollLeft:e.scrollLeft})},120),e.scrollLeft>this.lastScrollLeft?this.dispatchCustomEvent("scb-scroll-right",{scrollLeft:e.scrollLeft}):e.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEvent("scb-scroll-left",{scrollLeft:e.scrollLeft}),this.lastScrollLeft=e.scrollLeft)}}doScrollBy(e){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector(".scb-horizontal-scroller");t&&t.scrollBy({left:e,behavior:"smooth"})}get canScrollLeft(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".scb-horizontal-scroller");return e?e.scrollLeft>0:!1}get canScrollRight(){var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".scb-horizontal-scroller");if(!e)return!1;const t=e;return t.scrollLeft+t.clientWidth<t.scrollWidth-1}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this.updateScrollButtons,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",this.updateScrollButtons,!0)}dispatchCustomEvent(e,t={}){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}firstUpdated(){var n,h,p,v;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".scb-horizontal-scroller"),t=(h=this.shadowRoot)==null?void 0:h.querySelector(".scroll-shadow-left"),r=(p=this.shadowRoot)==null?void 0:p.querySelector(".scroll-shadow-right"),i=(v=this.shadowRoot)==null?void 0:v.querySelector("slot");e&&(e.addEventListener("scroll",this.handleScroll),e.addEventListener("wheel",function(f){f.deltaY!==0&&(f.preventDefault(),e.scrollLeft+=f.deltaY)},{passive:!1}));const s=()=>{if(i&&t&&r){const f=i.getBoundingClientRect();t.style.height=`${f.height}px`,r.style.height=`${f.height}px`}};s(),i&&new ResizeObserver(s).observe(i),this.updateScrollButtons()}updated(e){var h,p,v,f;const t=(h=this.shadowRoot)==null?void 0:h.querySelector(".scroll-shadow-left"),r=(p=this.shadowRoot)==null?void 0:p.querySelector(".scroll-shadow-right"),i=(v=this.shadowRoot)==null?void 0:v.querySelector("slot"),s=(f=this.shadowRoot)==null?void 0:f.querySelector(".scb-horizontal-scroller");s&&(s.addEventListener("scroll",this.handleScroll),s.addEventListener("wheel",function(m){m.deltaY!==0&&(m.preventDefault(),s.scrollLeft+=m.deltaY)},{passive:!1})),e.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width);const n=()=>{if(i&&t&&r){const m=i.getBoundingClientRect();t.style.height=`${m.height}px`,r.style.height=`${m.height}px`}};n(),i&&new ResizeObserver(n).observe(i)}render(){switch(this.variant){case"inline":return c`
|
|
5115
5119
|
<div class="scb-horizontal-scroller" tabindex="0">
|
|
5116
5120
|
<div class="scroll-shadow-left"></div>
|
|
5117
5121
|
<slot></slot>
|