@momentum-design/components 0.136.0 → 0.136.1
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
CHANGED
|
@@ -7502,7 +7502,7 @@
|
|
|
7502
7502
|
mdc-text::part(text) {
|
|
7503
7503
|
margin: 0;
|
|
7504
7504
|
}
|
|
7505
|
-
`,sE=[EI];var Re=class extends Ws(Q){constructor(){super(...arguments);this.variant=mr.VARIANT;this.headerTagName=mr.HEADER_TAG_NAME;this.ariaLabel=null;this.isDetailVisible=!1;this.hasDetailedSlot=!1;this.hasOverflowingHeaderText=!1;this.hasFooterButtons=""}closeToast(){let t=new CustomEvent("close",{bubbles:!0,composed:!0,detail:{id:this.id}});this.dispatchEvent(t)}updateDataExpanded(){this.isDetailVisible||!this.canRenderToggleButton()?this.setAttribute("data-expanded","true"):this.removeAttribute("data-expanded")}toggleDetailVisibility(){this.isDetailVisible=!this.isDetailVisible,this.updateDataExpanded()}updateDetailedSlotPresence(){var t,e;this.hasDetailedSlot=(e=(t=this.detailedElements)==null?void 0:t.some(i=>{var n;return(n=i.textContent)==null?void 0:n.trim()}))!=null?e:!1}updateFooterButtonsPresence(){var t,e,i,n;this.hasFooterButtons=((e=(t=this.footerButtonPrimary)==null?void 0:t.length)!=null?e:0)>0||((n=(i=this.footerButtonSecondary)==null?void 0:i.length)!=null?n:0)>0||this.shouldRenderToggleButton()?"has-footer-buttons":""}async firstUpdated(t){super.firstUpdated(t),this.updateDetailedSlotPresence(),this.updateDataExpanded()
|
|
7505
|
+
`,sE=[EI];var Re=class extends Ws(Q){constructor(){super(...arguments);this.variant=mr.VARIANT;this.headerTagName=mr.HEADER_TAG_NAME;this.ariaLabel=null;this.isDetailVisible=!1;this.hasDetailedSlot=!1;this.hasOverflowingHeaderText=!1;this.hasFooterButtons=""}closeToast(){let t=new CustomEvent("close",{bubbles:!0,composed:!0,detail:{id:this.id}});this.dispatchEvent(t)}updateDataExpanded(){this.isDetailVisible||!this.canRenderToggleButton()?this.setAttribute("data-expanded","true"):this.removeAttribute("data-expanded")}toggleDetailVisibility(){this.isDetailVisible=!this.isDetailVisible,this.updateDataExpanded()}updateDetailedSlotPresence(){var t,e;this.hasDetailedSlot=(e=(t=this.detailedElements)==null?void 0:t.some(i=>{var n;return(n=i.textContent)==null?void 0:n.trim()}))!=null?e:!1}updateFooterButtonsPresence(){var t,e,i,n;this.hasFooterButtons=((e=(t=this.footerButtonPrimary)==null?void 0:t.length)!=null?e:0)>0||((n=(i=this.footerButtonSecondary)==null?void 0:i.length)!=null?n:0)>0||this.shouldRenderToggleButton()?"has-footer-buttons":""}async firstUpdated(t){super.firstUpdated(t),this.updateDetailedSlotPresence(),this.updateDataExpanded()}async updated(t){(t.has("showMoreText")||t.has("showLessText"))&&this.updateDataExpanded(),t.has("headerText")&&(await this.updateComplete,Fl(this.headerTextElement)&&(this.hasOverflowingHeaderText=this.headerTextElement.isHeightOverflowing()))}renderIcon(t){return t?S`
|
|
7506
7506
|
<mdc-icon name="${t}" size="${mr.PREFIX_ICON_SIZE}" part="toast-prefix-icon"></mdc-icon>
|
|
7507
7507
|
`:K}canRenderToggleButton(){return!!(this.showMoreText&&this.showLessText)}shouldRenderToggleButton(){return this.canRenderToggleButton()&&(this.hasDetailedSlot||this.hasOverflowingHeaderText)}renderToggleDetailButton(){return this.shouldRenderToggleButton()?S`
|
|
7508
7508
|
<mdc-button
|