@momentum-design/components 0.133.0 → 0.133.2

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.
@@ -6385,6 +6385,26 @@
6385
6385
  justify-content: var(--mdc-tab-content-justification);
6386
6386
  }
6387
6387
 
6388
+ :host::part(icon-container) {
6389
+ position: relative;
6390
+ }
6391
+
6392
+ :host([active])::part(regular-icon) {
6393
+ display: none;
6394
+ }
6395
+
6396
+ :host([active])::part(filled-icon) {
6397
+ display: block;
6398
+ }
6399
+
6400
+ :host::part(regular-icon) {
6401
+ display: block;
6402
+ }
6403
+
6404
+ :host::part(filled-icon) {
6405
+ display: none;
6406
+ }
6407
+
6388
6408
  :host::part(leading),
6389
6409
  :host::part(trailing) {
6390
6410
  display: flex;
@@ -6554,11 +6574,26 @@
6554
6574
  --mdc-tab-background-color: var(--mds-color-theme-button-secondary-active-normal);
6555
6575
  --mdc-tab-color: var(--mds-color-theme-text-primary-disabled);
6556
6576
  }
6557
- `,...yt()],Ty=DS;var Io=class extends le(Wd(ue)){constructor(){super(...arguments);this.active=pc.ACTIVE;this.variant=pc.VARIANT;this.handleTabActiveChange=t=>{let e=new CustomEvent("activechange",{detail:{tabId:this.tabId,active:t},bubbles:!0});this.dispatchEvent(e)}}connectedCallback(){super.connectedCallback(),this.role=tt.TAB,this.size=void 0,this.type=void 0,this.ariaStateKey="aria-selected",!this.tabId&&this.onerror&&this.onerror("tab id is required")}modifyIconName(t){this.iconName&&(t?(this.prevIconName=this.iconName,this.iconName=`${Ho(this.iconName)}-filled`):this.prevIconName&&(this.iconName=this.prevIconName))}setVariant(t){this.setAttribute("variant",Object.values(dm).includes(t)?t:pc.VARIANT)}setActive(t,e){super.setActive(t,e),this.modifyIconName(e)}executeAction(){this.handleTabActiveChange(this.active)}update(t){super.update(t),t.has("variant")&&this.setVariant(this.variant)}render(){return S`
6577
+ `,...yt()],Ty=DS;var Io=class extends le(Wd(ue)){constructor(){super(...arguments);this.active=pc.ACTIVE;this.variant=pc.VARIANT;this.handleTabActiveChange=t=>{let e=new CustomEvent("activechange",{detail:{tabId:this.tabId,active:t},bubbles:!0});this.dispatchEvent(e)}}connectedCallback(){super.connectedCallback(),this.role=tt.TAB,this.size=void 0,this.type=void 0,this.ariaStateKey="aria-selected",!this.tabId&&this.onerror&&this.onerror("tab id is required")}setVariant(t){this.setAttribute("variant",Object.values(dm).includes(t)?t:pc.VARIANT)}getFilledIconName(){return!this.iconName||this.iconName.endsWith("-filled")?void 0:`${Ho(this.iconName)}-filled`}executeAction(){this.handleTabActiveChange(this.active)}update(t){super.update(t),t.has("variant")&&this.setVariant(this.variant)}render(){return S`
6558
6578
  <div part="container">
6559
6579
  <div part="leading">
6560
6580
  <slot name="prefix">
6561
- ${this.iconName?S` <mdc-icon name="${this.iconName}" size="1" length-unit="rem" part="icon"></mdc-icon>`:K}
6581
+ ${this.iconName?S`
6582
+ <div part="icon-container">
6583
+ <mdc-icon
6584
+ name="${this.iconName}"
6585
+ size="1"
6586
+ length-unit="rem"
6587
+ part="regular-icon"
6588
+ ></mdc-icon>
6589
+ <mdc-icon
6590
+ name="${J(this.getFilledIconName())}"
6591
+ size="1"
6592
+ length-unit="rem"
6593
+ part="filled-icon"
6594
+ ></mdc-icon>
6595
+ </div>
6596
+ `:K}
6562
6597
  </slot>
6563
6598
  ${this.text?S` <mdc-text
6564
6599
  type=${this.active?ot.BODY_MIDSIZE_BOLD:ot.BODY_MIDSIZE_MEDIUM}
@@ -7425,7 +7460,7 @@
7425
7460
  ::slotted(mdc-listitem) {
7426
7461
  position: relative;
7427
7462
  }
7428
- `],Yy=tI;var jy=z.constructTagName("virtualizedlist"),Srt=z.constructTagName("virtualizedwrapper"),jn={VIRTUALIZER_PROPS:{count:0,estimateSize:()=>0,getItemKey:n=>n},LOOP:"false",SCROLL_ANCHORING:!1,IS_AT_BOTTOM_THRESHOLD:16};var dr=class extends Wt(Pi){constructor(){super();this.virtualizerProps=jn.VIRTUALIZER_PROPS;this.loop=jn.LOOP;this.scrollAnchoring=jn.SCROLL_ANCHORING;this.observeSizeChanges=!1;this.revertList=!1;this.atBottomThreshold=jn.IS_AT_BOTTOM_THRESHOLD;this.virtualizer=null;this.virtualizedNavItems=null;this.virtualizerController=null;this.selectedIndex=this.initialFocus;this.selectedKey=null;this.firstIndex=0;this.firstKey=null;this.hiddenIndexes=[];this.atBottomValue="no";this.atBottomTimer=-1;this.lastScrollPosition=0;this.endOfScrollQueue=[];this.resizeObserver=null;this.handleElementFirstUpdateCompleted=t=>{var e,o;this.observeSizeChanges&&this.navItems.find(l=>l===t.target)!==void 0&&((o=(e=this.virtualizer)==null?void 0:e.measureElement)==null||o.call(e,t.target))};this.orientation=kn.VERTICAL,this.addEventListener("wheel",this.handleWheelEvent.bind(this)),this.addEventListener(Jt.FIRST_UPDATE_COMPLETED,this.handleElementFirstUpdateCompleted.bind(this))}get virtualItems(){var t,e;return(e=(t=this.virtualizer)==null?void 0:t.getVirtualItems())!=null?e:[]}get navItems(){var t,e,o,l;if(((t=this.virtualizedNavItems)==null?void 0:t.items)!==super.navItems){let c=(l=(o=(e=this.virtualizer)==null?void 0:e.options)==null?void 0:o.indexAttribute)!=null?l:"data-index";this.virtualizedNavItems=new xc(super.navItems,f=>Number(f.getAttribute(c)),()=>this.virtualizerProps.count)}return this.virtualizedNavItems}get atBottom(){return this.atBottomValue}set atBottom(t){(this.atBottomValue!==t||t==="yes"&&this.atBottomTimer===-1)&&(this.atBottomValue=t,t==="yes"?this.scrollToBottom():this.clearScrollToBottomTimer())}get totalListHeight(){var t,e;return(e=(t=this.virtualizer)==null?void 0:t.getTotalSize())!=null?e:0}connectedCallback(){this.virtualizerController=new Ec(this,{...this.virtualizerProps,horizontal:!1,getScrollElement:()=>this.scrollRef,onChange:this.onVListStateChangeHandler.bind(this),rangeExtractor:this.virtualizerRangeExtractor.bind(this)}),this.virtualizer=this.virtualizerController.getVirtualizer(),super.connectedCallback(),this.role=null,this.atBottom=this.revertList&&this.scrollAnchoring?"yes":"no",this.resizeObserver=new ResizeObserver(this.handleResizeObserverCallback.bind(this)),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.clearScrollToBottomTimer(),this.virtualizerController=null,this.virtualizer=null,this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}async update(t){super.update(t),t.has("orientation")&&this.orientation!==kn.VERTICAL&&(this.orientation=kn.VERTICAL),t.has("virtualizerProps")&&await this.handleVirtualizerPropsUpdate(t.get("virtualizerProps")),t.has("observeSizeChanges")&&this.navItems.forEach(e=>{var o,l;this.observeSizeChanges&&((l=(o=this.virtualizer)==null?void 0:o.measureElement)==null||l.call(o,e))}),t.has("scrollAnchoring")&&(this.scrollAnchoring?this.checkAtBottom():this.atBottom="no"),t.has("revertList")&&this.revertList&&this.scrollAnchoring&&(this.atBottom="yes"),t.has("atBottomThreshold")&&this.scrollAnchoring&&this.checkAtBottom()}async handleVirtualizerPropsUpdate(t){var l,c;let{virtualizer:e}=this;if(!e)return;let o=e.measurementsCache.slice();if(e.setOptions({...e.options,...this.virtualizerProps}),this.virtualizerProps.count!==(t==null?void 0:t.count)&&(this.emitChangeEvent(),this.syncUI()),this.scrollAnchoring&&o.length>0){let f=Math.abs(this.virtualizerProps.count-((l=t==null?void 0:t.count)!=null?l:0)),y=this.selectedIndex,A=this.firstKey,F=new Tc(y-f,y+f,{includeEnd:!0}),W=(c=Array.from(F).find(Z=>e.options.getItemKey(Z)===this.selectedKey))!=null?c:this.selectedIndex;if(this.setSelectedIndex(W),this.requestUpdate(),await this.updateComplete,this.atBottom==="yes"){this.scrollToBottom();return}if(this.focusWithin&&y!==this.selectedIndex||!this.focusWithin&&this.firstKey!==A){let Z=e.measurementsCache[this.selectedIndex].end-o[y].end;this.scrollRef.scrollTop+=Z}}}setInitialFocus(){setTimeout(async()=>{if(!this.virtualizer)return;let{scrollToIndex:t}=this.virtualizer;if(this.setSelectedIndex(this.initialFocus),this.selectedIndex>=this.navItems.length)return;t(this.selectedIndex,{align:"center"}),this.navItems.find(this.isElementSelected,this)&&this.resetTabIndexes(this.selectedIndex,!1)},0)}emitChangeEvent(){var e,o,l,c,f;(o=(e=this.virtualizerProps).onChange)==null||o.call(e,this.virtualizer,this.virtualizer.isScrolling);let t={virtualizer:this.virtualizer,virtualItems:(f=(c=(l=this.virtualizer)==null?void 0:l.getVirtualItems)==null?void 0:c.call(l))!=null?f:[]};this.dispatchEvent(new CustomEvent("virtualitemschange",{detail:t,bubbles:!1,cancelable:!1}))}virtualizerRangeExtractor(t){var y,A,F,W;let{navItems:e,virtualizerProps:o,virtualizer:l}=this,c=(A=(y=o.rangeExtractor)==null?void 0:y.call(o,t))!=null?A:Im(t);return this.hiddenIndexes.forEach(Q=>{let Z=e.at(Q);Z&&(Z.removeAttribute("data-virtualized-hidden"),Z.style.removeProperty("--mdc-virtualizedlist-hidden-top"))}),this.firstIndex=t.startIndex,this.firstKey=(W=(F=this.virtualizer)==null?void 0:F.options.getItemKey(this.firstIndex))!=null?W:null,this.hiddenIndexes.length=0,[this.selectedIndex-1,this.selectedIndex,this.selectedIndex+1].forEach(Q=>{var Z;c.includes(Q)||(Q<t.startIndex&&Q>=0&&(c.unshift(Q),this.hiddenIndexes.push(Q)),Q>t.endIndex&&Q<((Z=l==null?void 0:l.options.count)!=null?Z:0)&&(c.push(Q),this.hiddenIndexes.push(Q)))}),this.updateHiddenItemsPosition(t),c.sort((Q,Z)=>Q-Z),c}updateHiddenItemsPosition(t){let{navItems:e,virtualizerProps:o,virtualizer:l}=this;if(!l||o.count===0)return;let{measurementsCache:c}=l;this.hiddenIndexes.forEach(f=>{let y=e.at(f);if(y){let A=Math.max(t.startIndex-t.overscan,0),F=c[A],W=c[f];y.setAttribute("data-virtualized-hidden","true"),y.style.setProperty("--mdc-virtualizedlist-hidden-top",`${W.start-F.start}px`)}})}isElementSelected(t){var e;return((e=this.virtualizer)==null?void 0:e.indexFromElement(t))===this.selectedIndex}setSelectedIndex(t){if(this.virtualizer){let{count:e,getItemKey:o}=this.virtualizer.options;this.selectedIndex=Math.max(0,Math.min(e-1,t)),this.selectedKey=o(t)}}onElementStoreUpdate(t,e){if(e==="added"){let o=this.isElementSelected(t);t.tabIndex=o?0:-1,this.setAriaSetSize(t)}else e==="removed"&&t.tabIndex===0&&queueMicrotask(()=>{this.resetTabIndexes(this.selectedIndex,this.focusWithin)})}async onVListStateChangeHandler(t,e){this.syncUI(),await this.updateComplete,this.requestUpdate(),!e&&this.endOfScrollQueue.length>0&&(this.endOfScrollQueue.forEach(o=>o()),this.endOfScrollQueue.length=0),this.checkAtBottom(),this.emitChangeEvent()}onScrollHandler(t){let e=t.target;this.atBottom==="re-evaluate"||e.scrollTop<this.lastScrollPosition?this.atBottom="no":this.checkAtBottom(),this.lastScrollPosition=e.scrollTop}checkAtBottom(){let{clientHeight:t,scrollHeight:e,scrollTop:o}=this.scrollRef;this.scrollAnchoring&&this.virtualizer&&this.atBottom==="no"&&e>t-this.atBottomThreshold&&!this.virtualizer.isScrolling&&(this.atBottom=e-o<=t+this.atBottomThreshold?"yes":"no")}handleNavigationKeyDown(t){var o,l,c,f;switch(this.getActionForKeyEvent(t)){case q.HOME:{(l=(o=this.virtualizer)==null?void 0:o.scrollToIndex)==null||l.call(o,0,{align:"start"}),this.endOfScrollQueue.push(()=>this.resetTabIndexes(0));break}case q.END:{let y=this.virtualizerProps.count-1;(f=(c=this.virtualizer)==null?void 0:c.scrollToIndex)==null||f.call(c,y,{align:"end"}),this.endOfScrollQueue.push(()=>this.resetTabIndexes(y));break}case q.UP:{this.atBottom="re-evaluate";break}default:}super.handleNavigationKeyDown(t)}resetTabIndexes(t,e=!0){super.resetTabIndexes(t,e),this.setSelectedIndex(t)}resetTabIndexAndSetFocus(t,e,o=!0,l=o){if(this.navItems.find(y=>{var A;return((A=this.virtualizer)==null?void 0:A.indexFromElement(y))===t})===void 0)return this.scrollToIndex(t,{}),this.endOfScrollQueue.push(()=>{super.resetTabIndexAndSetFocus(t,e,o,l),this.setSelectedIndex(t)}),!0;let f=super.resetTabIndexAndSetFocus(t,e,o,l);return this.setSelectedIndex(t),f}setAriaSetSize(t){var e,o;t.setAttribute("aria-setsize",`${(o=(e=this.virtualizer)==null?void 0:e.options.count)!=null?o:-1}`)}scrollToBottom(){if(this.clearScrollToBottomTimer(),this.atBottom==="yes"&&this.scrollRef){let{clientHeight:t,scrollHeight:e,scrollTop:o}=this.scrollRef;this.totalListHeight>t&&(this.scrollRef.scrollTop+=e-t-o),this.atBottomTimer=requestAnimationFrame(this.scrollToBottom.bind(this))}}clearScrollToBottomTimer(){cancelAnimationFrame(this.atBottomTimer),this.atBottomTimer=-1}scrollToIndex(t,e){var o,l;(l=(o=this.virtualizer).scrollToIndex)==null||l.call(o,t,e),this.atBottom=this.scrollAnchoring&&t+1===this.virtualizerProps.count?"yes":"no"}syncUI(){var l;let t=this.virtualItems.find(({index:c})=>!this.hiddenIndexes.includes(c)),e=(l=t==null?void 0:t.start)!=null?l:0;window.getComputedStyle(this);let o=0;this.revertList&&this.scrollRef.clientHeight>=this.totalListHeight&&(o=this.scrollRef.clientHeight-this.totalListHeight),this.wrapperRef.style.height=`${this.totalListHeight}px`,this.containerRef.style.transform=`translateY(${o+e}px)`}handleWheelEvent(t){t.deltaY<0&&(this.atBottom="re-evaluate")}handleResizeObserverCallback(){requestAnimationFrame(()=>{this.revertList&&this.scrollRef.clientHeight>=this.totalListHeight&&this.syncUI()})}render(){var t;return S`
7463
+ `],Yy=tI;var jy=z.constructTagName("virtualizedlist"),Irt=z.constructTagName("virtualizedwrapper"),jn={VIRTUALIZER_PROPS:{count:0,estimateSize:()=>0,getItemKey:n=>n},LOOP:"false",SCROLL_ANCHORING:!1,IS_AT_BOTTOM_THRESHOLD:16};var dr=class extends Wt(Pi){constructor(){super();this.virtualizerProps=jn.VIRTUALIZER_PROPS;this.loop=jn.LOOP;this.scrollAnchoring=jn.SCROLL_ANCHORING;this.observeSizeChanges=!1;this.revertList=!1;this.atBottomThreshold=jn.IS_AT_BOTTOM_THRESHOLD;this.virtualizer=null;this.virtualizedNavItems=null;this.virtualizerController=null;this.selectedIndex=this.initialFocus;this.selectedKey=null;this.firstIndex=0;this.firstKey=null;this.hiddenIndexes=[];this.atBottomValue="no";this.atBottomTimer=-1;this.lastScrollPosition=0;this.endOfScrollQueue=[];this.resizeObserver=null;this.handleElementFirstUpdateCompleted=t=>{var e,o;this.observeSizeChanges&&this.navItems.find(l=>l===t.target)!==void 0&&((o=(e=this.virtualizer)==null?void 0:e.measureElement)==null||o.call(e,t.target))};this.orientation=kn.VERTICAL,this.addEventListener("wheel",this.handleWheelEvent.bind(this)),this.addEventListener(Jt.FIRST_UPDATE_COMPLETED,this.handleElementFirstUpdateCompleted.bind(this))}get virtualItems(){var t,e;return(e=(t=this.virtualizer)==null?void 0:t.getVirtualItems())!=null?e:[]}get navItems(){var t,e,o,l;if(((t=this.virtualizedNavItems)==null?void 0:t.items)!==super.navItems){let c=(l=(o=(e=this.virtualizer)==null?void 0:e.options)==null?void 0:o.indexAttribute)!=null?l:"data-index";this.virtualizedNavItems=new xc(super.navItems,f=>Number(f.getAttribute(c)),()=>this.virtualizerProps.count)}return this.virtualizedNavItems}get atBottom(){return this.atBottomValue}set atBottom(t){(this.atBottomValue!==t||t==="yes"&&this.atBottomTimer===-1)&&(this.atBottomValue=t,t==="yes"?this.scrollToBottom():this.clearScrollToBottomTimer())}get totalListHeight(){var t,e;return(e=(t=this.virtualizer)==null?void 0:t.getTotalSize())!=null?e:0}connectedCallback(){this.virtualizerController=new Ec(this,{...this.virtualizerProps,horizontal:!1,getScrollElement:()=>this.scrollRef,onChange:this.onVListStateChangeHandler.bind(this),rangeExtractor:this.virtualizerRangeExtractor.bind(this)}),this.virtualizer=this.virtualizerController.getVirtualizer(),super.connectedCallback(),this.role=null,this.atBottom=this.revertList&&this.scrollAnchoring?"yes":"no",this.resizeObserver=new ResizeObserver(this.handleResizeObserverCallback.bind(this)),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.clearScrollToBottomTimer(),this.virtualizerController=null,this.virtualizer=null,this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}async update(t){super.update(t),t.has("orientation")&&this.orientation!==kn.VERTICAL&&(this.orientation=kn.VERTICAL),t.has("virtualizerProps")&&await this.handleVirtualizerPropsUpdate(t.get("virtualizerProps")),t.has("observeSizeChanges")&&this.navItems.forEach(e=>{var o,l;this.observeSizeChanges&&((l=(o=this.virtualizer)==null?void 0:o.measureElement)==null||l.call(o,e))}),t.has("scrollAnchoring")&&(this.scrollAnchoring?this.checkAtBottom():this.atBottom="no"),t.has("revertList")&&this.revertList&&this.scrollAnchoring&&(this.atBottom="yes"),t.has("atBottomThreshold")&&this.scrollAnchoring&&this.checkAtBottom()}async handleVirtualizerPropsUpdate(t){var l,c;let{virtualizer:e}=this;if(!e)return;let o=e.measurementsCache.slice();if(e.setOptions({...e.options,...this.virtualizerProps}),this.virtualizerProps.count!==(t==null?void 0:t.count)&&(this.emitChangeEvent(),this.syncUI()),this.scrollAnchoring&&o.length>0){let f=Math.abs(this.virtualizerProps.count-((l=t==null?void 0:t.count)!=null?l:0)),y=this.selectedIndex,A=this.firstKey,F=new Tc(y-f,y+f,{includeEnd:!0}),W=(c=Array.from(F).find(Z=>e.options.getItemKey(Z)===this.selectedKey))!=null?c:this.selectedIndex;if(this.setSelectedIndex(W),this.requestUpdate(),await this.updateComplete,this.atBottom==="yes"){this.scrollToBottom();return}if(this.focusWithin&&y!==this.selectedIndex||!this.focusWithin&&this.firstKey!==A){let Z=e.measurementsCache[this.selectedIndex].end-o[y].end;this.scrollRef.scrollTop+=Z}}}setInitialFocus(){setTimeout(async()=>{if(!this.virtualizer)return;let{scrollToIndex:t}=this.virtualizer;if(this.setSelectedIndex(this.initialFocus),this.selectedIndex>=this.navItems.length)return;t(this.selectedIndex,{align:"center"}),this.navItems.find(this.isElementSelected,this)&&this.resetTabIndexes(this.selectedIndex,!1)},0)}emitChangeEvent(){var e,o,l,c,f;(o=(e=this.virtualizerProps).onChange)==null||o.call(e,this.virtualizer,this.virtualizer.isScrolling);let t={virtualizer:this.virtualizer,virtualItems:(f=(c=(l=this.virtualizer)==null?void 0:l.getVirtualItems)==null?void 0:c.call(l))!=null?f:[]};this.dispatchEvent(new CustomEvent("virtualitemschange",{detail:t,bubbles:!1,cancelable:!1}))}virtualizerRangeExtractor(t){var y,A,F,W;let{navItems:e,virtualizerProps:o,virtualizer:l}=this,c=(A=(y=o.rangeExtractor)==null?void 0:y.call(o,t))!=null?A:Im(t);return this.hiddenIndexes.forEach(Q=>{let Z=e.at(Q);Z&&(Z.removeAttribute("data-virtualized-hidden"),Z.style.removeProperty("--mdc-virtualizedlist-hidden-top"))}),this.firstIndex=t.startIndex,this.firstKey=(W=(F=this.virtualizer)==null?void 0:F.options.getItemKey(this.firstIndex))!=null?W:null,this.hiddenIndexes.length=0,[this.selectedIndex-1,this.selectedIndex,this.selectedIndex+1].forEach(Q=>{var Z;c.includes(Q)||(Q<t.startIndex&&Q>=0&&(c.unshift(Q),this.hiddenIndexes.push(Q)),Q>t.endIndex&&Q<((Z=l==null?void 0:l.options.count)!=null?Z:0)&&(c.push(Q),this.hiddenIndexes.push(Q)))}),this.updateHiddenItemsPosition(t),c.sort((Q,Z)=>Q-Z),c}updateHiddenItemsPosition(t){let{navItems:e,virtualizerProps:o,virtualizer:l}=this;if(!l||o.count===0)return;let{measurementsCache:c}=l;this.hiddenIndexes.forEach(f=>{let y=e.at(f);if(y){let A=Math.max(t.startIndex-t.overscan,0),F=c[A],W=c[f];y.setAttribute("data-virtualized-hidden","true"),y.style.setProperty("--mdc-virtualizedlist-hidden-top",`${W.start-F.start}px`)}})}isElementSelected(t){var e;return((e=this.virtualizer)==null?void 0:e.indexFromElement(t))===this.selectedIndex}setSelectedIndex(t){if(this.virtualizer){let{count:e,getItemKey:o}=this.virtualizer.options;this.selectedIndex=Math.max(0,Math.min(e-1,t)),this.selectedKey=o(t)}}onElementStoreUpdate(t,e){if(e==="added"){let o=this.isElementSelected(t);t.tabIndex=o?0:-1,this.setAriaSetSize(t)}else e==="removed"&&t.tabIndex===0&&queueMicrotask(()=>{this.resetTabIndexes(this.selectedIndex,this.focusWithin)})}async onVListStateChangeHandler(t,e){this.syncUI(),await this.updateComplete,this.requestUpdate(),!e&&this.endOfScrollQueue.length>0&&(this.endOfScrollQueue.forEach(o=>o()),this.endOfScrollQueue.length=0),this.checkAtBottom(),this.emitChangeEvent()}onScrollHandler(t){let e=t.target;this.atBottom==="re-evaluate"||e.scrollTop<this.lastScrollPosition?this.atBottom="no":this.checkAtBottom(),this.lastScrollPosition=e.scrollTop}checkAtBottom(){let{clientHeight:t,scrollHeight:e,scrollTop:o}=this.scrollRef;this.scrollAnchoring&&this.virtualizer&&this.atBottom==="no"&&e>t-this.atBottomThreshold&&!this.virtualizer.isScrolling&&(this.atBottom=e-o<=t+this.atBottomThreshold?"yes":"no")}handleNavigationKeyDown(t){var o,l,c,f;switch(this.getActionForKeyEvent(t)){case q.HOME:{(l=(o=this.virtualizer)==null?void 0:o.scrollToIndex)==null||l.call(o,0,{align:"start"}),this.endOfScrollQueue.push(()=>this.resetTabIndexes(0));break}case q.END:{let y=this.virtualizerProps.count-1;(f=(c=this.virtualizer)==null?void 0:c.scrollToIndex)==null||f.call(c,y,{align:"end"}),this.endOfScrollQueue.push(()=>this.resetTabIndexes(y));break}case q.UP:{this.atBottom="re-evaluate";break}default:}super.handleNavigationKeyDown(t)}resetTabIndexes(t,e=!0){super.resetTabIndexes(t,e),this.setSelectedIndex(t)}resetTabIndexAndSetFocus(t,e,o=!0,l=o){if(this.navItems.find(y=>{var A;return((A=this.virtualizer)==null?void 0:A.indexFromElement(y))===t})===void 0)return this.scrollToIndex(t,{}),this.endOfScrollQueue.push(()=>{super.resetTabIndexAndSetFocus(t,e,o,l),this.setSelectedIndex(t)}),!0;let f=super.resetTabIndexAndSetFocus(t,e,o,l);return this.setSelectedIndex(t),f}setAriaSetSize(t){var e,o;t.setAttribute("aria-setsize",`${(o=(e=this.virtualizer)==null?void 0:e.options.count)!=null?o:-1}`)}scrollToBottom(){if(this.clearScrollToBottomTimer(),this.atBottom==="yes"&&this.scrollRef){let{clientHeight:t,scrollHeight:e,scrollTop:o}=this.scrollRef;this.totalListHeight>t&&(this.scrollRef.scrollTop+=e-t-o),this.atBottomTimer=requestAnimationFrame(this.scrollToBottom.bind(this))}}clearScrollToBottomTimer(){cancelAnimationFrame(this.atBottomTimer),this.atBottomTimer=-1}scrollToIndex(t,e){var o,l;(l=(o=this.virtualizer).scrollToIndex)==null||l.call(o,t,e),this.atBottom=this.scrollAnchoring&&t+1===this.virtualizerProps.count?"yes":"no"}syncUI(){var l;let t=this.virtualItems.find(({index:c})=>!this.hiddenIndexes.includes(c)),e=(l=t==null?void 0:t.start)!=null?l:0;window.getComputedStyle(this);let o=0;this.revertList&&this.scrollRef.clientHeight>=this.totalListHeight&&(o=this.scrollRef.clientHeight-this.totalListHeight),this.wrapperRef.style.height=`${this.totalListHeight}px`,this.containerRef.style.transform=`translateY(${o+e}px)`}handleWheelEvent(t){t.deltaY<0&&(this.atBottom="re-evaluate")}handleResizeObserverCallback(){requestAnimationFrame(()=>{this.revertList&&this.scrollRef.clientHeight>=this.totalListHeight&&this.syncUI()})}render(){var t;return S`
7429
7464
  <slot name="list-header"></slot>
7430
7465
  <div part="scroll" tabindex="-1" @scroll="${this.onScrollHandler}">
7431
7466
  <div part="wrapper">
@@ -7543,7 +7578,7 @@
7543
7578
  --mdc-icon-fill-color: ButtonText;
7544
7579
  }
7545
7580
  }
7546
- `,Zy=[iI];var we=class extends Lt(wt(di(De(ce(Wt(To(Qt))))))){constructor(){super();this.lastCommittedValue="";this.placement=Mt.BOTTOM_START;this.boundary=Et.BOUNDARY;this.strategy=Et.STRATEGY;this.popoverZIndex=void 0;this.isOpen=!1;this.filteredValue="";this.initialSelectedOption=null;this.handleUpdateError=t=>{this.onerror&&this.onerror(t)};this.onStoreUpdate=(t,e,o,l)=>{switch(e){case"added":t.setAttribute("tabindex",o===0&&l.length===0?"0":"-1"),t.hasAttribute("selected")&&(this.navItems.forEach(c=>c.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"));break;case"removed":{let c=t;if(c&&(!this.isValidItem(c)||c.tabIndex!==0))return;let f=this.navItems.findIndex(A=>A===c);if(f===-1)return;let y=f+1;y>=this.navItems.length&&(y=f-1)}break;default:break}};this.handleModifiedEvent=t=>{if(this.controlType==="controlled"){this.updateHiddenOptions();return}let e=this.getFirstSelectedOption();switch(t.detail.change){case"selected":{if(t.target.hasAttribute("disabled"))return;e&&e.value!==this.value&&this.setSelectedValue(e,!1);break}case"unselected":{e&&this.setSelectedValue(e,!1);break}default:break}};this.addEventListener(Jt.MODIFIED,this.handleModifiedEvent),this.itemsStore=new wr(this,{isValidItem:this.isValidItem,onStoreUpdate:this.onStoreUpdate})}get navItems(){return this.itemsStore.items}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.inputElement&&(this.setInputValidity(),this.internals.setFormValue(this.inputElement.value))}).catch(this.handleUpdateError)}isValidItem(t){return t.matches(Lr)}openPopover(){this.isOpen=!0}closePopover(){this.isOpen=!1}compareOptionWithValue(t,e){return(t.getAttribute("label")||"").toLowerCase().startsWith(e==null?void 0:e.toLowerCase())}getFirstSelectedOption(){return this.navItems.find(t=>t.hasAttribute("selected"))}getVisibleOptions(t){return this.navItems.filter(e=>this.compareOptionWithValue(e,t))}focusComboboxBase(){this.disabled||this.updateComplete.then(()=>{var t;(t=this.visualCombobox)==null||t.focus({preventScroll:!0})}).catch(this.handleUpdateError)}handleTriggerClick(){this.disabled||(this.isOpen=!this.isOpen,this.focusComboboxBase())}setSelectedValue(t,e=!0,o=!1){let l=(t==null?void 0:t.getAttribute("label"))||"",c=(t==null?void 0:t.getAttribute("value"))||"";if(!(this.value===c&&this.filteredValue===l)){if(this.controlType==="controlled"&&!o){e&&(Co.onInputCombobox(this,t),Co.onChangeCombobox(this,t));return}this.filteredValue=l,this.value=c,this.lastCommittedValue=c,this.internals.setFormValue(this.value),this.updateHiddenOptions(),t&&this.updateSelectedOption(t),this.setInputValidity(),this.resetHelpText(),e&&!o&&t&&(Co.onInputCombobox(this,t),Co.onChangeCombobox(this,t))}}resetSelectedValue(){this.controlType!=="controlled"&&(this.value=""),this.internals.setFormValue(this.value),this.resetHelpText()}resetHelpText(){this.invalidCustomValueText&&this.helpText===this.invalidCustomValueText&&(this.helpText="",this.helpTextType=jt.DEFAULT)}attributeChangedCallback(t,e,o){if(super.attributeChangedCallback(t,e,o),t==="value"&&o!==""&&this.navItems.length){let l=this.getFirstSelectedOption(),c=this.navItems.find(y=>y.value===o),f=null;if(c)f=c;else if(this.placeholder)f=null;else if(l)f=l;else return;this.updateComplete.then(()=>{this.setSelectedValue(f,!1,!0)}).catch(this.handleUpdateError)}t==="validation-message"&&this.updateComplete.then(()=>{this.setInputValidity()}).catch(this.handleUpdateError)}async firstUpdated(t){await this.updateComplete,this.inputElement&&this.autoFocusOnMount&&(this.elementToAutoFocus=this.inputElement),super.firstUpdated(t);let e=this.getFirstSelectedOption();e&&this.controlType!=="controlled"?(this.initialSelectedOption=e,this.setSelectedValue(e)):this.value?this.updateValueBasedSelection():this.placeholder&&this.setInputValidity(),this.lastCommittedValue=this.value,this.navItems.forEach(o=>{o.setAttribute("tabindex","-1")})}updateValueBasedSelection(){let t=this.navItems.find(e=>e.value===this.value);t&&this.setSelectedValue(t,!1,!0)}updated(t){super.updated(t),(t.has("slottedListboxes")||t.has("isOpen"))&&(this.visualCombobox&&"ariaControlsElements"in this.visualCombobox&&(this.visualCombobox.ariaControlsElements=this.slottedListboxes),this.dropDownButton&&"ariaControlsElements"in this.dropDownButton&&(this.dropDownButton.ariaControlsElements=this.slottedListboxes)),(t.has("disabled")||t.has("readonly"))&&(this.disabled||this.readonly)&&this.closePopover(),t.has("value")&&this.updateValueBasedSelection()}setInputValidity(){var t,e;!this.value&&this.required?(this.validationMessage?(t=this.inputElement)==null||t.setCustomValidity(this.validationMessage):(e=this.inputElement)==null||e.setCustomValidity(""),this.setValidity()):this.internals.setValidity({})}formResetCallback(){var e;let t=this.initialSelectedOption||null;this.setSelectedValue(t,!1,!0),this.controlType!=="controlled"&&(this.filteredValue=(e=t==null?void 0:t.label)!=null?e:""),this.setInputValidity()}formStateRestoreCallback(t){let e=this.navItems.find(o=>o.value===t||o.label===t);this.setSelectedValue(e||null,!1,!0)}handleNativeInputFocus(){this.visualCombobox.focus()}resetFocusedOption(){this.navItems.filter(t=>t.hasAttribute("data-focused")).forEach(t=>this.updateOptionAttributes(t,!1))}updateSelectedOption(t){this.navItems.forEach(e=>{e.removeAttribute("selected")}),t==null||t.setAttribute("selected","")}updateOptionAttributes(t,e){t!==void 0&&(e?(t.setAttribute("data-focused",""),this.openTooltipIfExists(t)):(t.removeAttribute("data-focused"),this.closeTooltipIfExists(t)),t.setAttribute("aria-selected",e.toString()))}openTooltipIfExists(t){let e=t.getAttribute("id");if(!e)return;let o=this.querySelector(`mdc-tooltip[triggerid="${e}"]`);o==null||o.setAttribute("visible","")}closeTooltipIfExists(t){let e=t.getAttribute("id");if(!e)return;let o=this.querySelector(`mdc-tooltip[triggerid="${e}"][visible]`);o&&o.removeAttribute("visible")}handleBlurChange(){let t=this.getVisibleOptions(this.filteredValue),e=t.findIndex(l=>l.hasAttribute("data-focused"));if(e!==-1){this.setSelectedValue(t[e]),this.closePopover();return}let o=this.navItems.find(l=>(l.getAttribute("label")||"").toLowerCase()===this.filteredValue.toLowerCase());if(o){this.setSelectedValue(o),this.closePopover();return}if(this.filteredValue!=="")if(this.lastCommittedValue){let l=this.navItems.find(c=>c.value===this.lastCommittedValue);this.setSelectedValue(l)}else this.invalidCustomValueText&&!this.getFirstSelectedOption()&&(this.helpText=this.invalidCustomValueText,this.helpTextType=jt.ERROR,this.setInputValidity());else this.setSelectedValue(null);this.closePopover()}updateFocusAndScrollIntoView(t,e,o){var l;this.updateOptionAttributes(t[e],!1),this.updateOptionAttributes(t[o],!0),(l=t[o])==null||l.scrollIntoView({block:"nearest"})}handleInputKeydown(t){let e=this.getVisibleOptions(this.filteredValue).filter(c=>!c.hasAttribute("disabled")),o=e.findIndex(c=>c.hasAttribute("data-focused")),l=this.getKeyboardNavMode()===re.SPATIAL;switch(this.getActionForKeyEvent(t)){case q.DOWN:{if(!l)this.openPopover();else if(!this.isOpen)break;let c=e.length-1===o?0:o+1;this.updateFocusAndScrollIntoView(e,o,c),t.preventDefault(),this.keyDownEventHandled();break}case q.UP:{if(!l)this.openPopover();else if(!this.isOpen)break;let c=o===-1||o===0?e.length-1:o-1;this.updateFocusAndScrollIntoView(e,o,c),t.preventDefault(),this.keyDownEventHandled();break}case q.ENTER:{if(l&&!this.isOpen)this.openPopover();else{if(o===-1)return;this.setSelectedValue(e[o]),this.isOpen&&this.closePopover()}this.keyDownEventHandled();break}case q.ESCAPE:{o!==-1&&this.updateOptionAttributes(e[o],!1),e.length&&this.shouldDisplayPopover(e.length)||(this.resetSelectedValue(),this.controlType!=="controlled"&&(this.filteredValue="")),this.keyDownEventHandled();break}case q.TAB:{this.closePopover(),this.keyDownEventHandled();break}case q.HOME:case q.END:{this.resetFocusedOption(),this.keyDownEventHandled();break}default:break}}updateHiddenOptions(){let t=new Map,e=new Set;this.navItems.forEach(o=>{var f;let l=this.compareOptionWithValue(o,this.filteredValue);l?o.removeAttribute("data-hidden"):o.setAttribute("data-hidden","");let c=o.parentElement;if(c&&c.matches(Jd)){let y=c;e.add(y),l&&t.set(y,((f=t.get(y))!=null?f:0)+1)}}),e.forEach(o=>{var f;let l=((f=t.get(o))!=null?f:0)>0,c=o.nextElementSibling;l?(o.removeAttribute("data-hidden"),c&&c.matches(xn)&&c.removeAttribute("data-hidden")):(o.setAttribute("data-hidden",""),c&&c.matches(xn)&&c.setAttribute("data-hidden",""))})}handleInputChange(t){var e;t.preventDefault(),t.stopPropagation(),this.filteredValue=t.target.value,this.resetFocusedOption(),this.updateHiddenOptions(),(e=this.getFirstSelectedOption())==null||e.removeAttribute("selected"),this.isOpen===!1&&this.openPopover(),Co.onInputCombobox(this,{value:this.filteredValue})}handleOptionsClick(t){var o;t.preventDefault(),t.stopPropagation();let e=(o=t.target.closest(Lr))!=null?o:null;e&&!e.hasAttribute("disabled")&&(this.setSelectedValue(e),this.closePopover(),this.focusComboboxBase())}shouldDisplayPopover(t){return this.disabled||this.readonly?!1:t?this.isOpen:!!this.noResultText}renderNativeInput(){return S`
7581
+ `,Zy=[iI];var we=class extends Lt(wt(di(De(ce(Wt(To(Qt))))))){constructor(){super();this.lastCommittedValue="";this.placement=Mt.BOTTOM_START;this.boundary=Et.BOUNDARY;this.strategy=Et.STRATEGY;this.popoverZIndex=void 0;this.isOpen=!1;this.filteredValue="";this.initialSelectedOption=null;this.handleUpdateError=t=>{this.onerror&&this.onerror(t)};this.onStoreUpdate=(t,e,o,l)=>{switch(e){case"added":t.setAttribute("tabindex",o===0&&l.length===0?"0":"-1"),t.hasAttribute("selected")&&(this.navItems.forEach(c=>c.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"));break;case"removed":{let c=t;if(c&&(!this.isValidItem(c)||c.tabIndex!==0))return;let f=this.navItems.findIndex(A=>A===c);if(f===-1)return;let y=f+1;y>=this.navItems.length&&(y=f-1)}break;default:break}};this.handleModifiedEvent=t=>{if(this.controlType==="controlled"){this.updateHiddenOptions();return}let e=this.getFirstSelectedOption();switch(t.detail.change){case"selected":{if(t.target.hasAttribute("disabled"))return;e&&e.value!==this.value&&this.setSelectedValue(e,!1);break}case"unselected":{e&&this.setSelectedValue(e,!1);break}default:break}};this.addEventListener(Jt.MODIFIED,this.handleModifiedEvent),this.itemsStore=new wr(this,{isValidItem:this.isValidItem,onStoreUpdate:this.onStoreUpdate})}get navItems(){return this.itemsStore.items}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.inputElement&&(this.setInputValidity(),this.internals.setFormValue(this.inputElement.value))}).catch(this.handleUpdateError)}isValidItem(t){return t.matches(Lr)}openPopover(){this.isOpen=!0}closePopover(){this.isOpen=!1}compareOptionWithValue(t,e){return(t.getAttribute("label")||"").toLowerCase().startsWith(e==null?void 0:e.toLowerCase())}getFirstSelectedOption(){return this.navItems.find(t=>t.hasAttribute("selected"))}getVisibleOptions(t){return this.navItems.filter(e=>this.compareOptionWithValue(e,t))}focusComboboxBase(){this.disabled||this.updateComplete.then(()=>{var t;(t=this.visualCombobox)==null||t.focus({preventScroll:!0})}).catch(this.handleUpdateError)}handleTriggerClick(){this.disabled||(this.isOpen=!this.isOpen,this.focusComboboxBase())}setSelectedValue(t,e=!0,o=!1){let l=(t==null?void 0:t.getAttribute("label"))||"",c=(t==null?void 0:t.getAttribute("value"))||"";if(!(this.value===c&&this.filteredValue===l)){if(this.controlType==="controlled"&&!o){e&&(Co.onInputCombobox(this,t),Co.onChangeCombobox(this,t));return}this.filteredValue=l,this.value=c,this.lastCommittedValue=c,this.internals.setFormValue(this.value),this.updateHiddenOptions(),this.updateSelectedOption(t),this.resetFocusedOption(),this.setInputValidity(),this.resetHelpText(),e&&!o&&t&&(Co.onInputCombobox(this,t),Co.onChangeCombobox(this,t))}}resetSelectedValue(){this.controlType!=="controlled"&&(this.value=""),this.internals.setFormValue(this.value),this.resetHelpText()}resetHelpText(){this.invalidCustomValueText&&this.helpText===this.invalidCustomValueText&&(this.helpText="",this.helpTextType=jt.DEFAULT)}attributeChangedCallback(t,e,o){if(super.attributeChangedCallback(t,e,o),t==="value"&&this.navItems.length&&!(e===null&&o==="")){let l=null;if(o!==""){let c=this.getFirstSelectedOption(),f=this.navItems.find(y=>y.value===o);if(f)l=f;else if(c)l=c;else if(this.placeholder)l=null;else return}this.updateComplete.then(()=>{this.setSelectedValue(l,!1,!0)}).catch(this.handleUpdateError)}t==="validation-message"&&this.updateComplete.then(()=>{this.setInputValidity()}).catch(this.handleUpdateError)}async firstUpdated(t){await this.updateComplete,this.inputElement&&this.autoFocusOnMount&&(this.elementToAutoFocus=this.inputElement),super.firstUpdated(t);let e=this.getFirstSelectedOption();e&&this.controlType!=="controlled"?(this.initialSelectedOption=e,this.setSelectedValue(e)):this.value?this.updateValueBasedSelection():this.placeholder&&this.setInputValidity(),this.lastCommittedValue=this.value,this.navItems.forEach(o=>{o.setAttribute("tabindex","-1")})}updateValueBasedSelection(){let t=this.navItems.find(e=>e.value===this.value);t&&this.setSelectedValue(t,!1,!0)}updated(t){super.updated(t),(t.has("slottedListboxes")||t.has("isOpen"))&&(this.visualCombobox&&"ariaControlsElements"in this.visualCombobox&&(this.visualCombobox.ariaControlsElements=this.slottedListboxes),this.dropDownButton&&"ariaControlsElements"in this.dropDownButton&&(this.dropDownButton.ariaControlsElements=this.slottedListboxes)),(t.has("disabled")||t.has("readonly"))&&(this.disabled||this.readonly)&&this.closePopover(),t.has("value")&&this.updateValueBasedSelection()}setInputValidity(){var t,e;!this.value&&this.required?(this.validationMessage?(t=this.inputElement)==null||t.setCustomValidity(this.validationMessage):(e=this.inputElement)==null||e.setCustomValidity(""),this.setValidity()):this.internals.setValidity({})}formResetCallback(){var e;let t=this.initialSelectedOption||null;this.setSelectedValue(t,!1,!0),this.controlType!=="controlled"&&(this.filteredValue=(e=t==null?void 0:t.label)!=null?e:""),this.setInputValidity()}formStateRestoreCallback(t){let e=this.navItems.find(o=>o.value===t||o.label===t);this.setSelectedValue(e||null,!1,!0)}handleNativeInputFocus(){this.visualCombobox.focus()}resetFocusedOption(){this.navItems.filter(t=>t.hasAttribute("data-focused")).forEach(t=>this.updateOptionAttributes(t,!1))}updateSelectedOption(t){this.navItems.forEach(e=>{e.removeAttribute("selected")}),t==null||t.setAttribute("selected","")}updateOptionAttributes(t,e){t!==void 0&&(e?(t.setAttribute("data-focused",""),this.openTooltipIfExists(t)):(t.removeAttribute("data-focused"),this.closeTooltipIfExists(t)),t.setAttribute("aria-selected",e.toString()))}openTooltipIfExists(t){let e=t.getAttribute("id");if(!e)return;let o=this.querySelector(`mdc-tooltip[triggerid="${e}"]`);o==null||o.setAttribute("visible","")}closeTooltipIfExists(t){let e=t.getAttribute("id");if(!e)return;let o=this.querySelector(`mdc-tooltip[triggerid="${e}"][visible]`);o&&o.removeAttribute("visible")}handleBlurChange(){let t=this.getVisibleOptions(this.filteredValue),e=t.findIndex(l=>l.hasAttribute("data-focused"));if(e!==-1){this.setSelectedValue(t[e]),this.closePopover();return}let o=this.navItems.find(l=>(l.getAttribute("label")||"").toLowerCase()===this.filteredValue.toLowerCase());if(o){this.setSelectedValue(o),this.closePopover();return}if(this.filteredValue!=="")if(this.lastCommittedValue){let l=this.navItems.find(c=>c.value===this.lastCommittedValue);this.setSelectedValue(l)}else this.invalidCustomValueText&&!this.getFirstSelectedOption()&&(this.helpText=this.invalidCustomValueText,this.helpTextType=jt.ERROR,this.setInputValidity());else this.setSelectedValue(null);this.closePopover()}updateFocusAndScrollIntoView(t,e,o){var l;this.updateOptionAttributes(t[e],!1),this.updateOptionAttributes(t[o],!0),(l=t[o])==null||l.scrollIntoView({block:"nearest"})}handleInputKeydown(t){let e=this.getVisibleOptions(this.filteredValue).filter(c=>!c.hasAttribute("disabled")),o=e.findIndex(c=>c.hasAttribute("data-focused")),l=this.getKeyboardNavMode()===re.SPATIAL;switch(this.getActionForKeyEvent(t)){case q.DOWN:{if(!l)this.openPopover();else if(!this.isOpen)break;let c=e.length-1===o?0:o+1;this.updateFocusAndScrollIntoView(e,o,c),t.preventDefault(),this.keyDownEventHandled();break}case q.UP:{if(!l)this.openPopover();else if(!this.isOpen)break;let c=o===-1||o===0?e.length-1:o-1;this.updateFocusAndScrollIntoView(e,o,c),t.preventDefault(),this.keyDownEventHandled();break}case q.ENTER:{if(l&&!this.isOpen)this.openPopover();else{if(o===-1)return;this.setSelectedValue(e[o]),this.isOpen&&this.closePopover()}this.keyDownEventHandled();break}case q.ESCAPE:{o!==-1&&this.updateOptionAttributes(e[o],!1),e.length&&this.shouldDisplayPopover(e.length)||(this.resetSelectedValue(),this.controlType!=="controlled"&&(this.filteredValue="")),this.keyDownEventHandled();break}case q.TAB:{this.closePopover(),this.keyDownEventHandled();break}case q.HOME:case q.END:{this.resetFocusedOption(),this.keyDownEventHandled();break}default:break}}updateHiddenOptions(){let t=new Map,e=new Set;this.navItems.forEach(o=>{var f;let l=this.compareOptionWithValue(o,this.filteredValue);l?o.removeAttribute("data-hidden"):o.setAttribute("data-hidden","");let c=o.parentElement;if(c&&c.matches(Jd)){let y=c;e.add(y),l&&t.set(y,((f=t.get(y))!=null?f:0)+1)}}),e.forEach(o=>{var f;let l=((f=t.get(o))!=null?f:0)>0,c=o.nextElementSibling;l?(o.removeAttribute("data-hidden"),c&&c.matches(xn)&&c.removeAttribute("data-hidden")):(o.setAttribute("data-hidden",""),c&&c.matches(xn)&&c.setAttribute("data-hidden",""))})}handleInputChange(t){var e;t.preventDefault(),t.stopPropagation(),this.filteredValue=t.target.value,this.resetFocusedOption(),this.updateHiddenOptions(),(e=this.getFirstSelectedOption())==null||e.removeAttribute("selected"),this.isOpen===!1&&this.openPopover(),Co.onInputCombobox(this,{value:this.filteredValue})}handleOptionsClick(t){var o;t.preventDefault(),t.stopPropagation();let e=(o=t.target.closest(Lr))!=null?o:null;e&&!e.hasAttribute("disabled")&&(this.setSelectedValue(e),this.closePopover(),this.focusComboboxBase())}shouldDisplayPopover(t){return this.disabled||this.readonly?!1:t||this.noResultText?this.isOpen:!1}renderNativeInput(){return S`
7547
7582
  <input
7548
7583
  id="${this.inputId}"
7549
7584
  name="${this.name}"