@momentum-design/components 0.133.1 → 0.133.3

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.
@@ -1068,17 +1068,17 @@
1068
1068
  @slotchange=${()=>this.handleFooterSlot(Ae.BUTTON,Vt.PRIMARY)}
1069
1069
  ></slot>
1070
1070
  </div>
1071
- </slot>`}}return h([Yt({slot:"footer-link"})],i.prototype,"footerLink",2),h([Yt({slot:"footer-button-primary"})],i.prototype,"footerButtonPrimary",2),h([Yt({slot:"footer-button-secondary"})],i.prototype,"footerButtonSecondary",2),i};var Be=[],Kf=1e3,Ix=3,bh=-2,yh=-1,ao=class{constructor(i){this.host=i,i.addController(this)}hostConnected(){}hostDisconnected(){this.remove([this.host])}get length(){return Be.length}pushHost(){var i,t;return this.has(this.host)?!1:(Be.push(this.host),(t=(i=this.host).onComponentStackChanged)==null||t.call(i,"added"),!0)}popHost(){return this.popItem(this.host)}popItem(i){if(!this.has(i))return;let t=Be.filter(l=>l.stackGroupName===i.stackGroupName),e=t.indexOf(i),o=[];for(let l=t.length-1;l>=e;l-=1){let c=t[l];(c===i||c.triggerID!==i.triggerID)&&o.push(c)}return this.remove(o),i}pop(){var t;let i=Be.pop();return(t=i==null?void 0:i.onComponentStackChanged)==null||t.call(i,"removed"),i}popUntil(i){let t=[];for(let e=Be.length-1;e>=0;e-=1){let o=Be[e],l=i(o,e);if(l===!1)break;l!=="skip"&&t.push(o)}return this.remove(t)}peek(){return Be.at(-1)}remove(i){var o,l;let t=i.filter(c=>Be.includes(c)),e=t.reduce((c,f)=>Math.min(c,Be.indexOf(f)),1/0);t.forEach(c=>{Be.splice(Be.indexOf(c),1)}),t.forEach(c=>{var f;(f=c==null?void 0:c.onComponentStackChanged)==null||f.call(c,"removed")});for(let c=e;c<Be.length;c+=1)(l=(o=Be[c]).onComponentStackChanged)==null||l.call(o,"moved");return t}has(i){return Be.includes(i)}getHostDepth(){return this.getElementDepth(this.host)}getElementDepth(i){return Be.indexOf(i)}getHostZIndex(){return this.getItemZIndex(this.host)}getItemZIndex(i){let t=this.getElementDepth(i);return t>=0?Kf+t*Ix:Kf}isHostOnTop(){return this.peek()===this.host}clear(){this.popUntil(()=>!0)}};var ql=n=>{class i extends n{constructor(){super(...arguments);this.isBackdropInvisible=!1;this.backdropElement=null;this.triggerElementCache=null}update(o){var l;if(super.update(o),o.has("zIndex")&&this.backdropElement){this.backdropElement.style.zIndex=`${this.zIndex+bh}`;let c=(l=this.triggerElementCache)==null?void 0:l.deref();c&&(c.style.zIndex=`${this.zIndex+yh}`)}}createBackdrop(o){let l=document.createElement("div");l.classList.add(`${o}-backdrop`);let c=document.createElement("style");c.textContent=`
1071
+ </slot>`}}return h([Yt({slot:"footer-link"})],i.prototype,"footerLink",2),h([Yt({slot:"footer-button-primary"})],i.prototype,"footerButtonPrimary",2),h([Yt({slot:"footer-button-secondary"})],i.prototype,"footerButtonSecondary",2),i};var Be=[],Kf=1e3,Ix=3,bh=-2,yh=-1,ao=class{constructor(i){this.host=i,i.addController(this)}hostConnected(){}hostDisconnected(){this.remove([this.host])}get length(){return Be.length}pushHost(){var i,t;return this.has(this.host)?!1:(Be.push(this.host),(t=(i=this.host).onComponentStackChanged)==null||t.call(i,"added"),!0)}popHost(){return this.popItem(this.host)}popItem(i){if(!this.has(i))return;let t=Be.filter(l=>l.stackGroupName===i.stackGroupName),e=t.indexOf(i),o=[];for(let l=t.length-1;l>=e;l-=1){let c=t[l];(c===i||c.triggerID!==i.triggerID)&&o.push(c)}return this.remove(o),i}pop(){var t;let i=Be.pop();return(t=i==null?void 0:i.onComponentStackChanged)==null||t.call(i,"removed"),i}popUntil(i){let t=[];for(let e=Be.length-1;e>=0;e-=1){let o=Be[e],l=i(o,e);if(l===!1)break;l!=="skip"&&t.push(o)}return this.remove(t)}peek(){return Be.at(-1)}remove(i){var o,l;let t=i.filter(c=>Be.includes(c)),e=t.reduce((c,f)=>Math.min(c,Be.indexOf(f)),1/0);t.forEach(c=>{Be.splice(Be.indexOf(c),1)}),t.forEach(c=>{var f;(f=c==null?void 0:c.onComponentStackChanged)==null||f.call(c,"removed")});for(let c=e;c<Be.length;c+=1)(l=(o=Be[c]).onComponentStackChanged)==null||l.call(o,"moved");return t}has(i){return Be.includes(i)}getHostDepth(){return this.getElementDepth(this.host)}getElementDepth(i){return Be.indexOf(i)}getHostZIndex(){return this.getItemZIndex(this.host)}getItemZIndex(i){let t=this.getElementDepth(i);return t>=0?Kf+t*Ix:Kf}isHostOnTop(){return this.peek()===this.host}clear(){this.popUntil(()=>!0)}};var ql=n=>{class i extends n{constructor(){super(...arguments);this.isBackdropInvisible=!1;this.backdropElement=null;this.triggerElementCache=null}update(o){var l;if(super.update(o),o.has("zIndex")&&this.backdropElement){this.backdropElement.style.zIndex=`${this.zIndex+bh}`;let c=(l=this.triggerElementCache)==null?void 0:l.deref();c&&(c.style.zIndex=`${this.zIndex+yh}`)}}createBackdrop(o){let l=document.createElement("div");l.classList.add(`${o}-backdrop`);let c=document.createElement("style"),f=this.isBackdropInvisible?"transparent":getComputedStyle(this).getPropertyValue("--mdc-backdrop-mixin-background-color")||"var(--mds-color-theme-common-overlays-secondary-normal)";c.textContent=`
1072
1072
  .${o}-backdrop {
1073
1073
  position: fixed;
1074
1074
  top: 0;
1075
1075
  left: 0;
1076
1076
  width: 100%;
1077
1077
  height: 100%;
1078
- background: ${this.isBackdropInvisible?"transparent":"var(--mds-color-theme-common-overlays-secondary-normal)"};
1078
+ background: ${f};
1079
1079
  z-index: ${this.zIndex+bh};
1080
1080
  }
1081
- `,l.appendChild(c);let y=document.getElementById(this.backdropAppendTo)||this.parentElement;y==null||y.appendChild(l),this.backdropElement=l}removeBackdrop(){this.backdropElement&&(this.backdropElement.remove(),this.backdropElement=null)}keepElementAboveBackdrop(o){o&&(this.triggerElementCache=new WeakRef(o),this.elementOriginalStyle={zIndex:o.style.zIndex,position:o.style.position},o.style.zIndex=`${this.zIndex+yh}`,["fixed","absolute"].includes(window.getComputedStyle(o).position)||(o.style.position="relative"))}moveElementBackAfterBackdropRemoval(o){!o||!this.elementOriginalStyle||(o.style.zIndex=this.elementOriginalStyle.zIndex,o.style.position=this.elementOriginalStyle.position,this.elementOriginalStyle=void 0,this.triggerElementCache=null)}}return i};var Xl=z.constructTagName("responsivesettingsprovider"),Fr={FORCE_FULLSCREEN_DIALOG:!1,POPOVER_POSITIONING:"float",MEDIA:"unknown"},Wf=["float","dialog"],Yf=["unknown","mobile","desktop","tablet"];var Zl=class{constructor(i={}){this.media=Fr.MEDIA;this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.popoverPositioning=Fr.POPOVER_POSITIONING;Object.assign(this,i)}};Zl.context=Xl;var Ql=Zl;var Gs=class extends Te{constructor(){super({context:Ql.context,initialValue:new Ql({media:Fr.MEDIA,popoverPositioning:Fr.POPOVER_POSITIONING,forceFullscreenDialog:Fr.FORCE_FULLSCREEN_DIALOG})});this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.privatePopoverPositioning=Fr.POPOVER_POSITIONING;this.privateMedia=Fr.MEDIA}static get Context(){return Ql.context}set popoverPositioning(t){Wf.includes(t)&&(this.privatePopoverPositioning=t)}get popoverPositioning(){return this.privatePopoverPositioning}set media(t){Yf.includes(t)&&(this.privateMedia=t)}get media(){return this.privateMedia}updateContext(){var t,e,o;(((t=this.context.value)==null?void 0:t.media)!==this.privateMedia||((e=this.context.value)==null?void 0:e.popoverPositioning)!==this.privatePopoverPositioning||((o=this.context.value)==null?void 0:o.forceFullscreenDialog)!==this.forceFullscreenDialog)&&(this.context.value.media=this.media,this.context.value.popoverPositioning=this.popoverPositioning,this.context.value.forceFullscreenDialog=this.forceFullscreenDialog,this.context.updateObservers())}};h([u({type:Boolean,attribute:"force-fullscreen-dialog",reflect:!0})],Gs.prototype,"forceFullscreenDialog",2),h([u({type:String,attribute:"popover-positioning",reflect:!0})],Gs.prototype,"popoverPositioning",1),h([u({type:String,attribute:"media",reflect:!0})],Gs.prototype,"media",1);var Eh=Gs;Eh.register(Xl);var Th=Eh;var jf=z.constructTagName("dialog"),xh={DEFAULT:"default",PROMOTIONAL:"promotional"},Sr={VISIBLE:!1,Z_INDEX:1e3,ROLE:tt.DIALOG,SIZE:"small",HEADER_TAG_NAME:mt.H2,DESCRIPTION_TAG_NAME:mt.P,CANCEL_ICON:"cancel-bold",VARIANT:xh.DEFAULT,DISABLE_ARIA_HAS_POPUP:!1,FOCUS_TRAP:!0,HIDE_BACKDROP:!1};var r1=[tt.DIALOG,tt.ALERTDIALOG];var no=class{static dispatchDialogEvent(i,t,e=!0){t.dispatchEvent(new CustomEvent(i,{detail:{show:t.visible},composed:!0,bubbles:e}))}static onShowDialog(i){this.dispatchDialogEvent("shown",i)}static onHideDialog(i){this.dispatchDialogEvent("hidden",i)}static onCloseDialog(i,t=!0){this.dispatchDialogEvent("close",i,t)}static onCreatedDialog(i){this.dispatchDialogEvent("created",i)}static onDestroyedDialog(i){this.dispatchDialogEvent("destroyed",i)}};var _x=B`
1081
+ `,l.appendChild(c);let A=document.getElementById(this.backdropAppendTo)||this.parentElement;A==null||A.appendChild(l),this.backdropElement=l}removeBackdrop(){this.backdropElement&&(this.backdropElement.remove(),this.backdropElement=null)}keepElementAboveBackdrop(o){o&&(this.triggerElementCache=new WeakRef(o),this.elementOriginalStyle={zIndex:o.style.zIndex,position:o.style.position},o.style.zIndex=`${this.zIndex+yh}`,["fixed","absolute"].includes(window.getComputedStyle(o).position)||(o.style.position="relative"))}moveElementBackAfterBackdropRemoval(o){!o||!this.elementOriginalStyle||(o.style.zIndex=this.elementOriginalStyle.zIndex,o.style.position=this.elementOriginalStyle.position,this.elementOriginalStyle=void 0,this.triggerElementCache=null)}}return i};var Xl=z.constructTagName("responsivesettingsprovider"),Fr={FORCE_FULLSCREEN_DIALOG:!1,POPOVER_POSITIONING:"float",MEDIA:"unknown"},Wf=["float","dialog"],Yf=["unknown","mobile","desktop","tablet"];var Zl=class{constructor(i={}){this.media=Fr.MEDIA;this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.popoverPositioning=Fr.POPOVER_POSITIONING;Object.assign(this,i)}};Zl.context=Xl;var Ql=Zl;var Gs=class extends Te{constructor(){super({context:Ql.context,initialValue:new Ql({media:Fr.MEDIA,popoverPositioning:Fr.POPOVER_POSITIONING,forceFullscreenDialog:Fr.FORCE_FULLSCREEN_DIALOG})});this.forceFullscreenDialog=Fr.FORCE_FULLSCREEN_DIALOG;this.privatePopoverPositioning=Fr.POPOVER_POSITIONING;this.privateMedia=Fr.MEDIA}static get Context(){return Ql.context}set popoverPositioning(t){Wf.includes(t)&&(this.privatePopoverPositioning=t)}get popoverPositioning(){return this.privatePopoverPositioning}set media(t){Yf.includes(t)&&(this.privateMedia=t)}get media(){return this.privateMedia}updateContext(){var t,e,o;(((t=this.context.value)==null?void 0:t.media)!==this.privateMedia||((e=this.context.value)==null?void 0:e.popoverPositioning)!==this.privatePopoverPositioning||((o=this.context.value)==null?void 0:o.forceFullscreenDialog)!==this.forceFullscreenDialog)&&(this.context.value.media=this.media,this.context.value.popoverPositioning=this.popoverPositioning,this.context.value.forceFullscreenDialog=this.forceFullscreenDialog,this.context.updateObservers())}};h([u({type:Boolean,attribute:"force-fullscreen-dialog",reflect:!0})],Gs.prototype,"forceFullscreenDialog",2),h([u({type:String,attribute:"popover-positioning",reflect:!0})],Gs.prototype,"popoverPositioning",1),h([u({type:String,attribute:"media",reflect:!0})],Gs.prototype,"media",1);var Eh=Gs;Eh.register(Xl);var Th=Eh;var jf=z.constructTagName("dialog"),xh={DEFAULT:"default",PROMOTIONAL:"promotional"},Sr={VISIBLE:!1,Z_INDEX:1e3,ROLE:tt.DIALOG,SIZE:"small",HEADER_TAG_NAME:mt.H2,DESCRIPTION_TAG_NAME:mt.P,CANCEL_ICON:"cancel-bold",VARIANT:xh.DEFAULT,DISABLE_ARIA_HAS_POPUP:!1,FOCUS_TRAP:!0,HIDE_BACKDROP:!1};var r1=[tt.DIALOG,tt.ALERTDIALOG];var no=class{static dispatchDialogEvent(i,t,e=!0){t.dispatchEvent(new CustomEvent(i,{detail:{show:t.visible},composed:!0,bubbles:e}))}static onShowDialog(i){this.dispatchDialogEvent("shown",i)}static onHideDialog(i){this.dispatchDialogEvent("hidden",i)}static onCloseDialog(i,t=!0){this.dispatchDialogEvent("close",i,t)}static onCreatedDialog(i){this.dispatchDialogEvent("created",i)}static onDestroyedDialog(i){this.dispatchDialogEvent("destroyed",i)}};var _x=B`
1082
1082
  :host {
1083
1083
  --mdc-dialog-primary-background-color: var(--mds-color-theme-background-solid-primary-normal);
1084
1084
  --mdc-dialog-border-color: var(--mds-color-theme-outline-secondary-normal);
@@ -1088,6 +1088,8 @@
1088
1088
  --mdc-dialog-width: 27rem; /* Default to small */
1089
1089
  --mdc-dialog-height: auto;
1090
1090
  --mdc-dialog-padding: 1.5rem;
1091
+ --mdc-dialog-backdrop-color: var(--mds-color-theme-common-overlays-secondary-normal);
1092
+ --mdc-backdrop-mixin-background-color: var(--mdc-dialog-backdrop-color);
1091
1093
 
1092
1094
  background-color: var(--mdc-dialog-primary-background-color);
1093
1095
  border: 0.0625rem solid var(--mdc-dialog-border-color);
@@ -2597,6 +2599,8 @@
2597
2599
  --mdc-popover-width: unset;
2598
2600
  --mdc-popover-max-width: max-content;
2599
2601
  --mdc-popover-max-height: auto;
2602
+ --mdc-popover-backdrop-color: var(--mds-color-theme-common-overlays-secondary-normal);
2603
+ --mdc-backdrop-mixin-background-color: var(--mdc-popover-backdrop-color);
2600
2604
 
2601
2605
  display: none;
2602
2606
  position: absolute;
@@ -6385,6 +6389,26 @@
6385
6389
  justify-content: var(--mdc-tab-content-justification);
6386
6390
  }
6387
6391
 
6392
+ :host::part(icon-container) {
6393
+ position: relative;
6394
+ }
6395
+
6396
+ :host([active])::part(regular-icon) {
6397
+ display: none;
6398
+ }
6399
+
6400
+ :host([active])::part(filled-icon) {
6401
+ display: block;
6402
+ }
6403
+
6404
+ :host::part(regular-icon) {
6405
+ display: block;
6406
+ }
6407
+
6408
+ :host::part(filled-icon) {
6409
+ display: none;
6410
+ }
6411
+
6388
6412
  :host::part(leading),
6389
6413
  :host::part(trailing) {
6390
6414
  display: flex;
@@ -6554,11 +6578,26 @@
6554
6578
  --mdc-tab-background-color: var(--mds-color-theme-button-secondary-active-normal);
6555
6579
  --mdc-tab-color: var(--mds-color-theme-text-primary-disabled);
6556
6580
  }
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`
6581
+ `,...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
6582
  <div part="container">
6559
6583
  <div part="leading">
6560
6584
  <slot name="prefix">
6561
- ${this.iconName?S` <mdc-icon name="${this.iconName}" size="1" length-unit="rem" part="icon"></mdc-icon>`:K}
6585
+ ${this.iconName?S`
6586
+ <div part="icon-container">
6587
+ <mdc-icon
6588
+ name="${this.iconName}"
6589
+ size="1"
6590
+ length-unit="rem"
6591
+ part="regular-icon"
6592
+ ></mdc-icon>
6593
+ <mdc-icon
6594
+ name="${J(this.getFilledIconName())}"
6595
+ size="1"
6596
+ length-unit="rem"
6597
+ part="filled-icon"
6598
+ ></mdc-icon>
6599
+ </div>
6600
+ `:K}
6562
6601
  </slot>
6563
6602
  ${this.text?S` <mdc-text
6564
6603
  type=${this.active?ot.BODY_MIDSIZE_BOLD:ot.BODY_MIDSIZE_MEDIUM}
@@ -7425,7 +7464,7 @@
7425
7464
  ::slotted(mdc-listitem) {
7426
7465
  position: relative;
7427
7466
  }
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`
7467
+ `],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
7468
  <slot name="list-header"></slot>
7430
7469
  <div part="scroll" tabindex="-1" @scroll="${this.onScrollHandler}">
7431
7470
  <div part="wrapper">