@momentum-design/components 0.95.4 → 0.95.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +4 -4
- package/dist/browser/index.js.map +2 -2
- package/dist/components/listitem/listitem.component.d.ts +2 -3
- package/dist/components/listitem/listitem.component.js +4 -5
- package/dist/custom-elements.json +1304 -1304
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
@@ -3198,11 +3198,11 @@
|
|
3198
3198
|
display: flex;
|
3199
3199
|
flex-direction: row;
|
3200
3200
|
}
|
3201
|
-
`,Zm=[Hb,..._t()];var Jm=()=>`listitem-tooltip-popover-${je()}`,Qm=()=>`listitem-tooltip-triggerid-${je()}`;var io=class{static dispatchListItemEvent(i,e){e.dispatchEvent(new Event(i,{composed:!0,bubbles:!0}))}static onDisableListItem(i){this.dispatchListItemEvent("disabled",i)}static onEnableListItem(i){this.dispatchListItemEvent("enabled",i)}static onCreatedListItem(i){setTimeout(()=>this.dispatchListItemEvent("created",i),0)}static onDestroyedListItem(i){this.dispatchListItemEvent("destroyed",i)}};var be=class extends $t(gr(q)){constructor(){super();this.variant=Sc.VARIANT;this.tooltipPlacement=Sc.TOOLTIP_PLACEMENT;this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("focusin",this.displayTooltipForLongText),this.addEventListener("mouseenter",this.displayTooltipForLongText),this.addEventListener("focusout",this.hideTooltipOnLeave),this.addEventListener("mouseout",this.hideTooltipOnLeave),this.addEventListener("click",this.handleClick)}connectedCallback(){super.connectedCallback(),this.role=this.role||st.LISTITEM,this.id=this.id||Qm(),io.onCreatedListItem(this)}disconnectedCallback(){super.disconnectedCallback(),io.onDestroyedListItem(this)}handleKeyDown(e){(e.key===dt.ENTER||e.key===dt.SPACE)&&(this.triggerClickEvent(),e.preventDefault())}triggerClickEvent(){let e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(e)}handleClick(){this.hideTooltipOnLeave()}displayTooltipForLongText(){var s,n;if(!this.tooltipText)return;this.hideTooltipOnLeave();let e=document.createElement(Zs);e.id=Jm(),e.textContent=this.tooltipText,e.setAttribute("triggerid",this.id),e.setAttribute("placement",this.tooltipPlacement),e.setAttribute("visible",""),e.setAttribute("show-arrow",""),(s=this.parentElement)!=null&&s.hasAttribute("slot")&&e.setAttribute("slot",this.parentElement.getAttribute("slot")||""),(n=this.parentElement)==null||n.after(e)}hideTooltipOnLeave(){let e=document.querySelector(`${Zs}[triggerid="${this.id}"]`);e&&e.remove()}getText(e,s,n){return
|
3201
|
+
`,Zm=[Hb,..._t()];var Jm=()=>`listitem-tooltip-popover-${je()}`,Qm=()=>`listitem-tooltip-triggerid-${je()}`;var io=class{static dispatchListItemEvent(i,e){e.dispatchEvent(new Event(i,{composed:!0,bubbles:!0}))}static onDisableListItem(i){this.dispatchListItemEvent("disabled",i)}static onEnableListItem(i){this.dispatchListItemEvent("enabled",i)}static onCreatedListItem(i){setTimeout(()=>this.dispatchListItemEvent("created",i),0)}static onDestroyedListItem(i){this.dispatchListItemEvent("destroyed",i)}};var be=class extends $t(gr(q)){constructor(){super();this.variant=Sc.VARIANT;this.tooltipPlacement=Sc.TOOLTIP_PLACEMENT;this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("focusin",this.displayTooltipForLongText),this.addEventListener("mouseenter",this.displayTooltipForLongText),this.addEventListener("focusout",this.hideTooltipOnLeave),this.addEventListener("mouseout",this.hideTooltipOnLeave),this.addEventListener("click",this.handleClick)}connectedCallback(){super.connectedCallback(),this.role=this.role||st.LISTITEM,this.id=this.id||Qm(),io.onCreatedListItem(this)}disconnectedCallback(){super.disconnectedCallback(),io.onDestroyedListItem(this)}handleKeyDown(e){(e.key===dt.ENTER||e.key===dt.SPACE)&&(this.triggerClickEvent(),e.preventDefault())}triggerClickEvent(){let e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(e)}handleClick(){this.hideTooltipOnLeave()}displayTooltipForLongText(){var s,n;if(!this.tooltipText)return;this.hideTooltipOnLeave();let e=document.createElement(Zs);e.id=Jm(),e.textContent=this.tooltipText,e.setAttribute("triggerid",this.id),e.setAttribute("placement",this.tooltipPlacement),e.setAttribute("visible",""),e.setAttribute("show-arrow",""),(s=this.parentElement)!=null&&s.hasAttribute("slot")&&e.setAttribute("slot",this.parentElement.getAttribute("slot")||""),(n=this.parentElement)==null||n.after(e)}hideTooltipOnLeave(){let e=document.querySelector(`${Zs}[triggerid="${this.id}"]`);e&&e.remove()}getText(e,s,n){return M`
|
3202
3202
|
<slot name="${e}">
|
3203
|
-
|
3203
|
+
${n?M`<mdc-text part="${e}" type="${s}" tagname="${yt.SPAN}">${n}</mdc-text>`:Y}
|
3204
3204
|
</slot>
|
3205
|
-
|
3205
|
+
`}disableSlottedChildren(e=!1){[...this.leadingControlsSlot,...this.trailingControlsSlot].forEach(s=>{e?(s.setAttribute("disabled",""),io.onDisableListItem(this)):(s.removeAttribute("disabled"),io.onEnableListItem(this))}),this.setAttribute("aria-disabled",`${e}`)}update(e){super.update(e),e.has("disabled")&&(this.tabIndex=this.disabled?-1:0,this.disableSlottedChildren(this.disabled)),e.has("softDisabled")&&this.disableSlottedChildren(this.softDisabled)}renderTrailingControls(){return M`<slot
|
3206
3206
|
name="trailing-controls"
|
3207
3207
|
@click=${this.stopEventPropagation}
|
3208
3208
|
@keyup=${this.stopEventPropagation}
|
@@ -5147,7 +5147,7 @@
|
|
5147
5147
|
position: relative;
|
5148
5148
|
width: 100%;
|
5149
5149
|
}
|
5150
|
-
`],gf=Jy;var bf=j.constructTagName("virtualizedlist"),
|
5150
|
+
`],gf=Jy;var bf=j.constructTagName("virtualizedlist"),V3=j.constructTagName("virtualizedwrapper"),yf={VIRTUALIZER_PROPS:{count:0,estimateSize:()=>0}};var mo=class extends q{constructor(){super();this.virtualizerProps=yf.VIRTUALIZER_PROPS;this.scrollElementRef=en();this.virtualItems=[];this.virtualizerController=null,this.virtualizer=null,this.setlistdata=null,this.onscroll=null}update(e){super.update(e),e.get("virtualizerProps")&&this.setVirtualizerOptions()}firstUpdated(e){super.firstUpdated(e),this.setVirtualizerOptions()}setVirtualizerOptions(){var e;(e=this.virtualizer)==null||e.setOptions({...this.virtualizer.options,...this.virtualizerProps}),this.requestUpdate()}connectedCallback(){var e;this.virtualizerController=new il(this,{count:this.virtualizerProps.count,estimateSize:(e=this.virtualizerProps)==null?void 0:e.estimateSize,getScrollElement:()=>this.scrollElementRef.value||null,...this.virtualizerProps}),super.connectedCallback()}getVirtualizedListWrapper(e){var T,N;this.virtualizer=e.getVirtualizer();let{getTotalSize:s,getVirtualItems:n,measureElement:h}=this.virtualizer,u=n();if(u!==this.virtualItems){this.virtualItems=u;let $=n(),W={position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${(N=(T=$[0])==null?void 0:T.start)!=null?N:0}px)`};this.setlistdata&&this.setlistdata({virtualItems:$,measureElement:h,listStyle:W})}return M`<div part="container" style="height: ${s()}px;">
|
5151
5151
|
<slot></slot>
|
5152
5152
|
</div>`}render(){return M`<div ${rn(this.scrollElementRef)} part="scroll" @scroll=${this.onscroll&&this.onscroll}>
|
5153
5153
|
${this.virtualizerController?this.getVirtualizedListWrapper(this.virtualizerController):M``}
|