scb-wc-test 0.1.184 → 0.1.185

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.
@@ -1,8 +1,8 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
2
- import{_ as u}from"../../vendor/preload-helper.js";import{a as p,n as l,r as b,i as h,E as m,x as d,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,s,o){try{customElements.get(i)||t(i,s,o)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,a=(e,t,i,s)=>{for(var o=s>1?void 0:s?g(t,i):t,r=e.length-1,c;r>=0;r--)(c=e[r])&&(o=(s?c(t,i,o):c(o))||o);return s&&o&&f(t,i,o),o};let n=class extends h{constructor(){super(...arguments),this.label="",this.selected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const t=Array.from(this.parentElement?.querySelectorAll("scb-menu-item")||[]),i=t.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(t[i+1]||t[0]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(t[i-1]||t[t.length-1]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"Home":{e.preventDefault(),t[0].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"End":{e.preventDefault(),t[t.length-1].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){n.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),n.__rippleLoaded=!0),n.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),n.__focusRingLoaded=!0),this.leadingIcon&&!n.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),n.__iconLoaded=!0),this.hasSlotContent&&!n.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),n.__iconButtonLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.length>0&&e.every(t=>t.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(s=>s.tagName==="SCB-SUB-MENU")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,t=!!this.itemHref,i=this.hasSlotContent;return d`
2
+ import{_ as u}from"../../vendor/preload-helper.js";import{a as h,n as l,r as p,i as b,E as m,x as d,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(i,s,o){try{customElements.get(i)||n(i,s,o)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,a=(e,n,i,s)=>{for(var o=s>1?void 0:s?f(n,i):n,r=e.length-1,c;r>=0;r--)(c=e[r])&&(o=(s?c(n,i,o):c(o))||o);return s&&o&&g(n,i,o),o};let t=class extends b{constructor(){super(...arguments),this.label="",this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const n=Array.from(this.parentElement?.querySelectorAll("scb-menu-item")||[]),i=n.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(n[i+1]||n[0]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(n[i-1]||n[n.length-1]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"Home":{e.preventDefault(),n[0].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}case"End":{e.preventDefault(),n[n.length-1].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){t.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),t.__rippleLoaded=!0),t.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),t.__focusRingLoaded=!0),this.leadingIcon&&!t.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),t.__iconLoaded=!0),this.hasSlotContent&&!t.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),t.__iconButtonLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.length>0&&e.every(n=>n.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(s=>s.tagName==="SCB-SUB-MENU")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,n=!!this.itemHref,i=this.hasSlotContent;return d`
3
3
  <div class="scb-menu-item">
4
- <div class="scb-menu-item-label" ?selected=${this.selected}>
5
- ${t?d`
4
+ <div class="scb-menu-item-label" ?selected=${this.selected} ?no-highlight-selected=${this.noHighlightSelected}>
5
+ ${n?d`
6
6
  <a
7
7
  id=${this.__focusId}
8
8
  class="scb-menu-label-text"
@@ -59,7 +59,7 @@ import{_ as u}from"../../vendor/preload-helper.js";import{a as p,n as l,r as b,i
59
59
  </div>
60
60
  </div>
61
61
  </div>
62
- `}};n.__rippleLoaded=!1;n.__iconLoaded=!1;n.__iconButtonLoaded=!1;n.__focusRingLoaded=!1;n.styles=p`
62
+ `}};t.__rippleLoaded=!1;t.__iconLoaded=!1;t.__iconButtonLoaded=!1;t.__focusRingLoaded=!1;t.styles=h`
63
63
  :host {
64
64
  /* Animationtokens */
65
65
  --scb-menu-sub-transition-duration: var(--scb-motion-duration-quick, 150ms);
@@ -137,8 +137,8 @@ import{_ as u}from"../../vendor/preload-helper.js";import{a as p,n as l,r as b,i
137
137
  --md-ripple-focus-opacity: 0;
138
138
  }
139
139
 
140
- .scb-menu-item-label[selected] .scb-menu-click,
141
- :host([selected]) .scb-menu-click {
140
+ .scb-menu-item-label[selected]:not([no-highlight-selected]) .scb-menu-click,
141
+ :host([selected]):not([no-highlight-selected]) .scb-menu-click {
142
142
  color: var(--md-sys-color-on-secondary-container);
143
143
  background: var(--md-sys-color-secondary-container);
144
144
  font-weight: 600;
@@ -189,4 +189,4 @@ import{_ as u}from"../../vendor/preload-helper.js";import{a as p,n as l,r as b,i
189
189
  transition: none;
190
190
  }
191
191
  }
192
- `;a([l({type:String})],n.prototype,"label",2);a([l({type:Boolean,reflect:!0})],n.prototype,"selected",2);a([l({type:String,attribute:"leading-icon"})],n.prototype,"leadingIcon",2);a([l({type:String,attribute:"item-href"})],n.prototype,"itemHref",2);a([b()],n.prototype,"hasSlotContent",2);a([l({type:Boolean,reflect:!0})],n.prototype,"expanded",2);n=a([_("scb-menu-item")],n);
192
+ `;a([l({type:String})],t.prototype,"label",2);a([l({type:Boolean,reflect:!0})],t.prototype,"selected",2);a([l({type:Boolean,attribute:"no-highlight-selected",reflect:!0})],t.prototype,"noHighlightSelected",2);a([l({type:String,attribute:"leading-icon"})],t.prototype,"leadingIcon",2);a([l({type:String,attribute:"item-href"})],t.prototype,"itemHref",2);a([p()],t.prototype,"hasSlotContent",2);a([l({type:Boolean,reflect:!0})],t.prototype,"expanded",2);t=a([_("scb-menu-item")],t);
@@ -1,8 +1,8 @@
1
- import{a as u,n as c,i as h,E as v,x as b,t as y}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"./scb-menu-item.js";import"./scb-menu-section.js";import"./scb-sub-menu.js";import"../../vendor/preload-helper.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,i){try{customElements.get(s)||t(s,a,i)}catch(o){var l=String(o||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,m=e=>{throw TypeError(e)},r=(e,t,s,a)=>{for(var i=a>1?void 0:a?_(t,s):t,l=e.length-1,o;l>=0;l--)(o=e[l])&&(i=(a?o(t,s,i):o(i))||i);return a&&i&&f(t,s,i),i},S=(e,t,s)=>t.has(e)||m("Cannot "+s),k=(e,t,s)=>t.has(e)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),g=(e,t,s)=>(S(e,t,"access private method"),s),p,d;let n=class extends h{constructor(){super(...arguments),k(this,p),this.label="",this.subLabel="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onGlobalSelect=e=>{const t=e;this.querySelectorAll("scb-menu-item").forEach(a=>a.selected=!1),this.contains(t.detail.item)&&(t.detail.item.selected=!0)}}render(){return b`
1
+ import{a as m,n as l,i as u,E as v,x as g,t as y}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";import"./scb-menu-item.js";import"./scb-menu-section.js";import"./scb-sub-menu.js";import"../../vendor/preload-helper.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,i,a){try{customElements.get(s)||t(s,i,a)}catch(o){var c=String(o||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,b=e=>{throw TypeError(e)},r=(e,t,s,i)=>{for(var a=i>1?void 0:i?_(t,s):t,c=e.length-1,o;c>=0;c--)(o=e[c])&&(a=(i?o(t,s,a):o(a))||a);return i&&a&&f(t,s,a),a},S=(e,t,s)=>t.has(e)||b("Cannot "+s),k=(e,t,s)=>t.has(e)?b("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),h=(e,t,s)=>(S(e,t,"access private method"),s),p,d;let n=class extends u{constructor(){super(...arguments),k(this,p),this.label="",this.subLabel="",this.noHighlightSelected=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onGlobalSelect=e=>{const t=e;this.querySelectorAll("scb-menu-item").forEach(i=>{i.selected=!1,this.noHighlightSelected?i.setAttribute("no-highlight-selected",""):i.removeAttribute("no-highlight-selected")}),this.contains(t.detail.item)&&(t.detail.item.selected=!0)}}render(){return g`
2
2
  <nav
3
3
  aria-label="${this.label}"
4
4
  >
5
- ${this.label?b`
5
+ ${this.label?g`
6
6
  <div class="scb-menu-label-wrapper">
7
7
  <div class="scb-menu-label">${this.label}</div>
8
8
  <div class="scb-menu-sublabel">
@@ -15,7 +15,7 @@ import{a as u,n as c,i as h,E as v,x as b,t as y}from"../../vendor/vendor.js";im
15
15
  <slot></slot>
16
16
  </div>
17
17
  </nav>
18
- `}firstUpdated(e){super.firstUpdated(e),g(this,p,d).call(this)}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&g(this,p,d).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-menu-select",this._onGlobalSelect)}disconnectedCallback(){window.removeEventListener("scb-menu-select",this._onGlobalSelect),super.disconnectedCallback()}};p=new WeakSet;d=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,s=this.mapSpacingToken(this.spacingBottom)??e,a=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-menu-spacing-block-start",t):this.style.removeProperty("--scb-menu-spacing-block-start"),s?this.style.setProperty("--scb-menu-spacing-block-end",s):this.style.removeProperty("--scb-menu-spacing-block-end"),a?this.style.setProperty("--scb-menu-spacing-inline-start",a):this.style.removeProperty("--scb-menu-spacing-inline-start"),i?this.style.setProperty("--scb-menu-spacing-inline-end",i):this.style.removeProperty("--scb-menu-spacing-inline-end")};n.styles=u`
18
+ `}firstUpdated(e){super.firstUpdated(e),h(this,p,d).call(this)}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&h(this,p,d).call(this)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-menu-select",this._onGlobalSelect)}disconnectedCallback(){window.removeEventListener("scb-menu-select",this._onGlobalSelect),super.disconnectedCallback()}};p=new WeakSet;d=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,s=this.mapSpacingToken(this.spacingBottom)??e,i=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-menu-spacing-block-start",t):this.style.removeProperty("--scb-menu-spacing-block-start"),s?this.style.setProperty("--scb-menu-spacing-block-end",s):this.style.removeProperty("--scb-menu-spacing-block-end"),i?this.style.setProperty("--scb-menu-spacing-inline-start",i):this.style.removeProperty("--scb-menu-spacing-inline-start"),a?this.style.setProperty("--scb-menu-spacing-inline-end",a):this.style.removeProperty("--scb-menu-spacing-inline-end")};n.styles=m`
19
19
  :host {
20
20
  display: block;
21
21
  color: var(--md-sys-color-on-surface);
@@ -71,4 +71,4 @@ import{a as u,n as c,i as h,E as v,x as b,t as y}from"../../vendor/vendor.js";im
71
71
  .panel {
72
72
  contain: layout paint style;
73
73
  }
74
- `;r([c({type:String})],n.prototype,"label",2);r([c({type:String,attribute:"sub-label"})],n.prototype,"subLabel",2);r([c({type:String,reflect:!0})],n.prototype,"spacing",2);r([c({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",2);r([c({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",2);r([c({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",2);r([c({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",2);n=r([y("scb-menu")],n);
74
+ `;r([l({type:String})],n.prototype,"label",2);r([l({type:String,attribute:"sub-label"})],n.prototype,"subLabel",2);r([l({type:Boolean,attribute:"no-highlight-selected"})],n.prototype,"noHighlightSelected",2);r([l({type:String,reflect:!0})],n.prototype,"spacing",2);r([l({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",2);r([l({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",2);r([l({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",2);r([l({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",2);n=r([y("scb-menu")],n);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc-test",
3
- "version": "0.1.184",
3
+ "version": "0.1.185",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -377,5 +377,5 @@
377
377
  },
378
378
  "./mvc/*": "./mvc/*"
379
379
  },
380
- "buildHash": "B7C0A9290575B2141F31FE0C027435E83DDD05EB5B1A6CCB34272E0D93454925"
380
+ "buildHash": "81DE5A95C215E6F60B6BFDC8C1E0F98E65B00058CECB9CD31123A2B3B0C8DFFF"
381
381
  }
@@ -4,6 +4,7 @@ export declare class ScbMenuItem extends LitElement {
4
4
  label: string;
5
5
  /** Markerad/vald state. */
6
6
  selected: boolean;
7
+ noHighlightSelected: boolean;
7
8
  /** Ikonnamn före label (Material icon glyph). */
8
9
  leadingIcon: string;
9
10
  /** Om satt blir item en länk (<a>) istället för knapp. */
@@ -1,5 +1,5 @@
1
1
  import { css as _, LitElement as v, nothing as m, html as d } from "lit";
2
- import { property as l, state as x, customElement as y } from "lit/decorators.js";
2
+ import { property as l, state as y, customElement as x } from "lit/decorators.js";
3
3
  var S = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (e, n, i, s) => {
4
4
  for (var o = s > 1 ? void 0 : s ? w(n, i) : n, r = e.length - 1, c; r >= 0; r--)
5
5
  (c = e[r]) && (o = (s ? c(n, i, o) : c(o)) || o);
@@ -7,14 +7,14 @@ var S = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (e, n, i
7
7
  };
8
8
  let t = class extends v {
9
9
  constructor() {
10
- super(...arguments), this.label = "", this.selected = !1, this.leadingIcon = "", this.itemHref = "", this.hasSlotContent = !1, this.expanded = !1, this.__submenuId = `sub-${Math.random().toString(36).slice(2)}`, this.__focusId = `f-${Math.random().toString(36).slice(2)}`, this._toggleExpand = (e) => {
10
+ super(...arguments), this.label = "", this.selected = !1, this.noHighlightSelected = !1, this.leadingIcon = "", this.itemHref = "", this.hasSlotContent = !1, this.expanded = !1, this.__submenuId = `sub-${Math.random().toString(36).slice(2)}`, this.__focusId = `f-${Math.random().toString(36).slice(2)}`, this._toggleExpand = (e) => {
11
11
  e && e.stopPropagation(), this.hasSlotContent && this.__setExpanded(!this.expanded);
12
12
  }, this._onButtonClick = (e) => {
13
13
  e.stopPropagation(), this._dispatchSelect(), this._toggleExpand();
14
14
  }, this._onLinkClick = () => {
15
15
  this._dispatchSelect();
16
16
  }, this._onKeyDown = (e) => {
17
- var s, o, r, c, p, b, h, g, f;
17
+ var s, o, r, c, h, p, b, g, f;
18
18
  const n = Array.from(
19
19
  ((s = this.parentElement) == null ? void 0 : s.querySelectorAll("scb-menu-item")) || []
20
20
  ), i = n.indexOf(this);
@@ -26,15 +26,15 @@ let t = class extends v {
26
26
  break;
27
27
  }
28
28
  case "ArrowUp": {
29
- e.preventDefault(), (p = (c = (n[i - 1] || n[n.length - 1]).shadowRoot) == null ? void 0 : c.querySelector(
29
+ e.preventDefault(), (h = (c = (n[i - 1] || n[n.length - 1]).shadowRoot) == null ? void 0 : c.querySelector(
30
30
  ".scb-menu-label-text"
31
- )) == null || p.focus();
31
+ )) == null || h.focus();
32
32
  break;
33
33
  }
34
34
  case "Home": {
35
- e.preventDefault(), (h = (b = n[0].shadowRoot) == null ? void 0 : b.querySelector(
35
+ e.preventDefault(), (b = (p = n[0].shadowRoot) == null ? void 0 : p.querySelector(
36
36
  ".scb-menu-label-text"
37
- )) == null || h.focus();
37
+ )) == null || b.focus();
38
38
  break;
39
39
  }
40
40
  case "End": {
@@ -101,7 +101,7 @@ let t = class extends v {
101
101
  const e = !!this.leadingIcon, n = !!this.itemHref, i = this.hasSlotContent;
102
102
  return d`
103
103
  <div class="scb-menu-item">
104
- <div class="scb-menu-item-label" ?selected=${this.selected}>
104
+ <div class="scb-menu-item-label" ?selected=${this.selected} ?no-highlight-selected=${this.noHighlightSelected}>
105
105
  ${n ? d`
106
106
  <a
107
107
  id=${this.__focusId}
@@ -246,8 +246,8 @@ t.styles = _`
246
246
  --md-ripple-focus-opacity: 0;
247
247
  }
248
248
 
249
- .scb-menu-item-label[selected] .scb-menu-click,
250
- :host([selected]) .scb-menu-click {
249
+ .scb-menu-item-label[selected]:not([no-highlight-selected]) .scb-menu-click,
250
+ :host([selected]):not([no-highlight-selected]) .scb-menu-click {
251
251
  color: var(--md-sys-color-on-secondary-container);
252
252
  background: var(--md-sys-color-secondary-container);
253
253
  font-weight: 600;
@@ -305,6 +305,9 @@ a([
305
305
  a([
306
306
  l({ type: Boolean, reflect: !0 })
307
307
  ], t.prototype, "selected", 2);
308
+ a([
309
+ l({ type: Boolean, attribute: "no-highlight-selected", reflect: !0 })
310
+ ], t.prototype, "noHighlightSelected", 2);
308
311
  a([
309
312
  l({ type: String, attribute: "leading-icon" })
310
313
  ], t.prototype, "leadingIcon", 2);
@@ -312,13 +315,13 @@ a([
312
315
  l({ type: String, attribute: "item-href" })
313
316
  ], t.prototype, "itemHref", 2);
314
317
  a([
315
- x()
318
+ y()
316
319
  ], t.prototype, "hasSlotContent", 2);
317
320
  a([
318
321
  l({ type: Boolean, reflect: !0 })
319
322
  ], t.prototype, "expanded", 2);
320
323
  t = a([
321
- y("scb-menu-item")
324
+ x("scb-menu-item")
322
325
  ], t);
323
326
  export {
324
327
  t as ScbMenuItem
@@ -3,6 +3,7 @@ export declare class ScbMenu extends LitElement {
3
3
  #private;
4
4
  label: string;
5
5
  subLabel: string;
6
+ noHighlightSelected: boolean;
6
7
  spacing: undefined;
7
8
  spacingTop: undefined;
8
9
  spacingBottom: undefined;
@@ -1,29 +1,31 @@
1
- import { css as h, LitElement as u, nothing as v, html as b } from "lit";
2
- import { property as c, customElement as y } from "lit/decorators.js";
1
+ import { css as m, LitElement as u, nothing as v, html as h } from "lit";
2
+ import { property as l, customElement as y } from "lit/decorators.js";
3
3
  import "../scb-divider/scb-divider.js";
4
4
  import "./scb-menu-item.js";
5
5
  import "./scb-menu-section.js";
6
6
  import "./scb-sub-menu.js";
7
7
  var f = Object.defineProperty, S = Object.getOwnPropertyDescriptor, d = (e) => {
8
8
  throw TypeError(e);
9
- }, r = (e, t, s, n) => {
10
- for (var i = n > 1 ? void 0 : n ? S(t, s) : t, o = e.length - 1, p; o >= 0; o--)
11
- (p = e[o]) && (i = (n ? p(t, s, i) : p(i)) || i);
12
- return n && i && f(t, s, i), i;
13
- }, k = (e, t, s) => t.has(e) || d("Cannot " + s), _ = (e, t, s) => t.has(e) ? d("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), m = (e, t, s) => (k(e, t, "access private method"), s), l, g;
9
+ }, r = (e, t, s, i) => {
10
+ for (var n = i > 1 ? void 0 : i ? S(t, s) : t, o = e.length - 1, p; o >= 0; o--)
11
+ (p = e[o]) && (n = (i ? p(t, s, n) : p(n)) || n);
12
+ return i && n && f(t, s, n), n;
13
+ }, k = (e, t, s) => t.has(e) || d("Cannot " + s), _ = (e, t, s) => t.has(e) ? d("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), b = (e, t, s) => (k(e, t, "access private method"), s), c, g;
14
14
  let a = class extends u {
15
15
  constructor() {
16
- super(...arguments), _(this, l), this.label = "", this.subLabel = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._onGlobalSelect = (e) => {
16
+ super(...arguments), _(this, c), this.label = "", this.subLabel = "", this.noHighlightSelected = !0, this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._onGlobalSelect = (e) => {
17
17
  const t = e;
18
- this.querySelectorAll("scb-menu-item").forEach((n) => n.selected = !1), this.contains(t.detail.item) && (t.detail.item.selected = !0);
18
+ this.querySelectorAll("scb-menu-item").forEach((i) => {
19
+ i.selected = !1, this.noHighlightSelected ? i.setAttribute("no-highlight-selected", "") : i.removeAttribute("no-highlight-selected");
20
+ }), this.contains(t.detail.item) && (t.detail.item.selected = !0);
19
21
  };
20
22
  }
21
23
  render() {
22
- return b`
24
+ return h`
23
25
  <nav
24
26
  aria-label="${this.label}"
25
27
  >
26
- ${this.label ? b`
28
+ ${this.label ? h`
27
29
  <div class="scb-menu-label-wrapper">
28
30
  <div class="scb-menu-label">${this.label}</div>
29
31
  <div class="scb-menu-sublabel">
@@ -39,10 +41,10 @@ let a = class extends u {
39
41
  `;
40
42
  }
41
43
  firstUpdated(e) {
42
- super.firstUpdated(e), m(this, l, g).call(this);
44
+ super.firstUpdated(e), b(this, c, g).call(this);
43
45
  }
44
46
  updated(e) {
45
- super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && m(this, l, g).call(this);
47
+ super.updated(e), (e.has("spacing") || e.has("spacingTop") || e.has("spacingBottom") || e.has("spacingLeft") || e.has("spacingRight")) && b(this, c, g).call(this);
46
48
  }
47
49
  mapSpacingToken(e) {
48
50
  if (!e) return;
@@ -63,12 +65,12 @@ let a = class extends u {
63
65
  ), super.disconnectedCallback();
64
66
  }
65
67
  };
66
- l = /* @__PURE__ */ new WeakSet();
68
+ c = /* @__PURE__ */ new WeakSet();
67
69
  g = function() {
68
- const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, s = this.mapSpacingToken(this.spacingBottom) ?? e, n = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight);
69
- t ? this.style.setProperty("--scb-menu-spacing-block-start", t) : this.style.removeProperty("--scb-menu-spacing-block-start"), s ? this.style.setProperty("--scb-menu-spacing-block-end", s) : this.style.removeProperty("--scb-menu-spacing-block-end"), n ? this.style.setProperty("--scb-menu-spacing-inline-start", n) : this.style.removeProperty("--scb-menu-spacing-inline-start"), i ? this.style.setProperty("--scb-menu-spacing-inline-end", i) : this.style.removeProperty("--scb-menu-spacing-inline-end");
70
+ const e = this.mapSpacingToken(this.spacing), t = this.mapSpacingToken(this.spacingTop) ?? e, s = this.mapSpacingToken(this.spacingBottom) ?? e, i = this.mapSpacingToken(this.spacingLeft), n = this.mapSpacingToken(this.spacingRight);
71
+ t ? this.style.setProperty("--scb-menu-spacing-block-start", t) : this.style.removeProperty("--scb-menu-spacing-block-start"), s ? this.style.setProperty("--scb-menu-spacing-block-end", s) : this.style.removeProperty("--scb-menu-spacing-block-end"), i ? this.style.setProperty("--scb-menu-spacing-inline-start", i) : this.style.removeProperty("--scb-menu-spacing-inline-start"), n ? this.style.setProperty("--scb-menu-spacing-inline-end", n) : this.style.removeProperty("--scb-menu-spacing-inline-end");
70
72
  };
71
- a.styles = h`
73
+ a.styles = m`
72
74
  :host {
73
75
  display: block;
74
76
  color: var(--md-sys-color-on-surface);
@@ -126,25 +128,28 @@ a.styles = h`
126
128
  }
127
129
  `;
128
130
  r([
129
- c({ type: String })
131
+ l({ type: String })
130
132
  ], a.prototype, "label", 2);
131
133
  r([
132
- c({ type: String, attribute: "sub-label" })
134
+ l({ type: String, attribute: "sub-label" })
133
135
  ], a.prototype, "subLabel", 2);
134
136
  r([
135
- c({ type: String, reflect: !0 })
137
+ l({ type: Boolean, attribute: "no-highlight-selected" })
138
+ ], a.prototype, "noHighlightSelected", 2);
139
+ r([
140
+ l({ type: String, reflect: !0 })
136
141
  ], a.prototype, "spacing", 2);
137
142
  r([
138
- c({ type: String, attribute: "spacing-top", reflect: !0 })
143
+ l({ type: String, attribute: "spacing-top", reflect: !0 })
139
144
  ], a.prototype, "spacingTop", 2);
140
145
  r([
141
- c({ type: String, attribute: "spacing-bottom", reflect: !0 })
146
+ l({ type: String, attribute: "spacing-bottom", reflect: !0 })
142
147
  ], a.prototype, "spacingBottom", 2);
143
148
  r([
144
- c({ type: String, attribute: "spacing-left", reflect: !0 })
149
+ l({ type: String, attribute: "spacing-left", reflect: !0 })
145
150
  ], a.prototype, "spacingLeft", 2);
146
151
  r([
147
- c({ type: String, attribute: "spacing-right", reflect: !0 })
152
+ l({ type: String, attribute: "spacing-right", reflect: !0 })
148
153
  ], a.prototype, "spacingRight", 2);
149
154
  a = r([
150
155
  y("scb-menu")