@momentum-design/components 0.85.10 → 0.86.0

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.
@@ -3368,20 +3368,20 @@
3368
3368
  :host::part(checkmark-icon) {
3369
3369
  --mdc-icon-fill-color: currentColor;
3370
3370
  }
3371
- `,ou=[Bb];var Go=class extends qe{constructor(){super();this.checked=!1;this.indicator=iu.INDICATOR;this.menuitemcheckboxHandleClick=e=>{e.stopPropagation(),!this.disabled&&(this.checked=!this.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))};this.addEventListener("click",this.menuitemcheckboxHandleClick)}connectedCallback(){super.connectedCallback(),this.role=lt.MENUITEMCHECKBOX}update(e){super.update(e),e.has("checked")&&(this.ariaChecked=`${this.checked}`)}staticCheckbox(){return this.indicator!==Zs.CHECKBOX?Y:O`
3372
- <mdc-staticcheckbox
3373
- slot="leading-controls"
3374
- ?checked="${this.checked}"
3375
- ?disabled="${this.disabled}"
3376
- ></mdc-staticcheckbox>
3377
- `}staticToggle(){return this.indicator!==Zs.TOGGLE?Y:O`
3378
- <mdc-statictoggle
3379
- slot="trailing-controls"
3380
- ?checked="${this.checked}"
3381
- ?disabled="${this.disabled}"
3382
- size="${Xs.COMPACT}"
3383
- ></mdc-statictoggle>
3384
- `}getCheckmarkIcon(){return this.checked&&this.indicator===Zs.CHECKMARK?O` <mdc-icon slot="trailing-controls" name="check-bold" part="checkmark-icon"></mdc-icon> `:Y}render(){return O`
3371
+ `,ou=[Bb];var Go=class extends qe{constructor(){super();this.checked=!1;this.indicator=iu.INDICATOR;this.handleMouseClick=e=>{e.stopPropagation(),!this.disabled&&(this.checked=!this.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))};this.addEventListener("click",this.handleMouseClick)}connectedCallback(){super.connectedCallback(),this.role=lt.MENUITEMCHECKBOX}update(e){super.update(e),e.has("checked")&&(this.ariaChecked=`${this.checked}`)}staticCheckbox(){return this.indicator===Zs.CHECKBOX?O`
3372
+ <mdc-staticcheckbox
3373
+ slot="leading-controls"
3374
+ ?checked="${this.checked}"
3375
+ ?disabled="${this.disabled}"
3376
+ ></mdc-staticcheckbox>
3377
+ `:Y}staticToggle(){return this.indicator===Zs.TOGGLE?O`
3378
+ <mdc-statictoggle
3379
+ slot="trailing-controls"
3380
+ ?checked="${this.checked}"
3381
+ ?disabled="${this.disabled}"
3382
+ size="${Xs.COMPACT}"
3383
+ ></mdc-statictoggle>
3384
+ `:Y}getCheckmarkIcon(){return this.checked&&this.indicator===Zs.CHECKMARK?O` <mdc-icon slot="trailing-controls" name="check-bold" part="checkmark-icon"></mdc-icon> `:Y}render(){return O`
3385
3385
  <div part="leading">
3386
3386
  ${this.staticCheckbox()}
3387
3387
  <slot name="leading-controls"></slot>
@@ -3403,13 +3403,13 @@
3403
3403
  :host::part(checkmark-icon) {
3404
3404
  --mdc-icon-fill-color: currentColor;
3405
3405
  }
3406
- `,au=[Gb];var Ho=class extends qe{constructor(){super();this.checked=!1;this.indicator=su.INDICATOR;this.radioHandleClick=e=>{e.stopPropagation(),!(this.disabled||this.checked)&&(this.updateOtherRadiosCheckedState(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))};this.addEventListener("click",this.radioHandleClick)}connectedCallback(){super.connectedCallback(),this.role=lt.MENUITEMRADIO}getAllRadiosWithinSameGroup(){let e=this.closest(`${Gr}, ${Ft}`);return!e||!this.name?[]:Array.from(e.querySelectorAll(`${this.tagName}[name="${this.name}"]`))}updateOtherRadiosCheckedState(){this.getAllRadiosWithinSameGroup().forEach(s=>{s!==this&&(s.checked=!1)})}update(e){super.update(e),e.has("checked")&&(this.ariaChecked=`${this.checked}`,e.get("checked")===!1&&this.checked&&this.updateOtherRadiosCheckedState())}renderStaticRadio(){return this.indicator!==$n.RADIO?Y:O`
3407
- <mdc-staticradio
3408
- slot="leading-controls"
3409
- ?checked="${this.checked}"
3410
- ?disabled="${this.disabled}"
3411
- ></mdc-staticradio>
3412
- `}renderCheckmarkIcon(){return this.checked&&this.indicator===$n.CHECKMARK?O` <mdc-icon slot="trailing-controls" name="check-bold" part="checkmark-icon"></mdc-icon> `:Y}render(){return O`
3406
+ `,au=[Gb];var Ho=class extends qe{constructor(){super();this.checked=!1;this.indicator=su.INDICATOR;this.handleMouseClick=e=>{e.stopPropagation(),!(this.disabled||this.checked)&&(this.updateOtherRadiosCheckedState(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))};this.addEventListener("click",this.handleMouseClick)}connectedCallback(){super.connectedCallback(),this.role=lt.MENUITEMRADIO}getAllRadiosWithinSameGroup(){let e=this.closest(`${Gr}, ${Ft}`);return!e||!this.name?[]:Array.from(e.querySelectorAll(`${this.tagName}[name="${this.name}"]`))}updateOtherRadiosCheckedState(){this.getAllRadiosWithinSameGroup().forEach(s=>{s!==this&&s.removeAttribute("checked")})}update(e){super.update(e),e.has("checked")&&(this.ariaChecked=`${this.checked}`,e.get("checked")===!1&&this.checked&&this.updateOtherRadiosCheckedState())}renderStaticRadio(){return this.indicator===$n.RADIO?O`
3407
+ <mdc-staticradio
3408
+ slot="leading-controls"
3409
+ ?checked="${this.checked}"
3410
+ ?disabled="${this.disabled}"
3411
+ ></mdc-staticradio>
3412
+ `:Y}renderCheckmarkIcon(){return this.checked&&this.indicator===$n.CHECKMARK?O` <mdc-icon slot="trailing-controls" name="check-bold" part="checkmark-icon"></mdc-icon> `:Y}render(){return O`
3413
3413
  <div part="leading">
3414
3414
  ${this.renderStaticRadio()}
3415
3415
  <slot name="leading-controls"></slot>
@@ -3445,7 +3445,7 @@
3445
3445
  }
3446
3446
  `,du=[Yb];var jo=class extends q{constructor(){super(...arguments);this.ariaLabel=null;this.headerText=null}connectedCallback(){super.connectedCallback(),this.setAttribute("role",lt.GROUP)}update(e){super.update(e),(e.has("ariaLabel")||e.has("headerText"))&&(!this.ariaLabel||this.ariaLabel===e.get("headerText"))&&(this.ariaLabel=this.headerText||"")}renderLabel(){return this.headerText?O`<mdc-text part="header-text" type=${it.BODY_MIDSIZE_BOLD} tagname=${bt.DIV}>
3447
3447
  ${this.headerText}
3448
- </mdc-text> `:null}render(){return O`${this.renderLabel()}<slot></slot>`}};jo.styles=[...q.styles,...du],v([E({type:String,reflect:!0,attribute:"aria-label"})],jo.prototype,"ariaLabel",2),v([E({type:String,reflect:!0})],jo.prototype,"headerText",2);var Vc=jo;Vc.register(Gr);var qb=Vc;var zn=j.constructTagName("sidenavigation"),yr={FIXED_EXPANDED:"fixed-expanded",FIXED_COLLAPSED:"fixed-collapsed",FLEXIBLE:"flexible",HIDDEN:"hidden"},Qs={VARIANT:yr.FLEXIBLE};var Wo=j.constructTagName("navitem"),hu={DOT:Be.DOT,COUNTER:Be.COUNTER},pu={RIGHT_ARROW:"arrow-right-bold"},mu={MAX_COUNTER:99,TEXT_TYPE:it.BODY_MIDSIZE_REGULAR,TAG_NAME:bt.SPAN,SIZE:Ii[24],VARIANT:yr.FLEXIBLE};var Vn=class{constructor(o,e,s){this.variant=o,this.expanded=e,this.parentNavTooltipText=s}hasSiblingWithTriggerId(o){var n,h;let e=o==null?void 0:o.getAttribute("id");return e?Array.from((h=(n=o==null?void 0:o.parentElement)==null?void 0:n.children)!=null?h:[]).some(m=>m!==o&&m.tagName.toLowerCase()===Ft&&m.getAttribute("triggerid")===e):!1}getParentNavItems(o){if(!o)return[];let e=[],s=o;for(;s;){let n=s==null?void 0:s.closest(Ft);if(!n)break;let h=n.getAttribute("triggerid");if(!h)break;let m=document.getElementById(h);if(m&&m.tagName.toLowerCase()===Wo)e.push(m),s=m;else break}return e}setCurrentActiveNavItem(o){var h;let e=((h=this.currentActiveNavItem)==null?void 0:h.navId)===(o==null?void 0:o.navId),s=(o==null?void 0:o.disableAriaCurrent)||this.hasSiblingWithTriggerId(o);if(e||s||(this.currentActiveNavItem&&(this.currentActiveNavItem.removeAttribute("aria-current"),this.currentActiveNavItem.removeAttribute("active"),this.getParentNavItems(this.currentActiveNavItem).forEach(T=>{T.removeAttribute("tooltip-text"),T.removeAttribute("active")})),!o))return;this.currentActiveNavItem=o,o.setAttribute("aria-current","page"),o.setAttribute("active",""),this.getParentNavItems(o).forEach(m=>{m.setAttribute("tooltip-text",this.parentNavTooltipText||""),m.setAttribute("tooltip-placement",Ut.BOTTOM),m.setAttribute("active","")})}};Vn.context=zn;var Bn=Vn;var Kb=H`
3448
+ </mdc-text> `:null}render(){return O`${this.renderLabel()}<slot></slot>`}};jo.styles=[...q.styles,...du],v([E({type:String,reflect:!0,attribute:"aria-label"})],jo.prototype,"ariaLabel",2),v([E({type:String,reflect:!0,attribute:"header-text"})],jo.prototype,"headerText",2);var Vc=jo;Vc.register(Gr);var qb=Vc;var zn=j.constructTagName("sidenavigation"),yr={FIXED_EXPANDED:"fixed-expanded",FIXED_COLLAPSED:"fixed-collapsed",FLEXIBLE:"flexible",HIDDEN:"hidden"},Qs={VARIANT:yr.FLEXIBLE};var Wo=j.constructTagName("navitem"),hu={DOT:Be.DOT,COUNTER:Be.COUNTER},pu={RIGHT_ARROW:"arrow-right-bold"},mu={MAX_COUNTER:99,TEXT_TYPE:it.BODY_MIDSIZE_REGULAR,TAG_NAME:bt.SPAN,SIZE:Ii[24],VARIANT:yr.FLEXIBLE};var Vn=class{constructor(o,e,s){this.variant=o,this.expanded=e,this.parentNavTooltipText=s}hasSiblingWithTriggerId(o){var n,h;let e=o==null?void 0:o.getAttribute("id");return e?Array.from((h=(n=o==null?void 0:o.parentElement)==null?void 0:n.children)!=null?h:[]).some(m=>m!==o&&m.tagName.toLowerCase()===Ft&&m.getAttribute("triggerid")===e):!1}getParentNavItems(o){if(!o)return[];let e=[],s=o;for(;s;){let n=s==null?void 0:s.closest(Ft);if(!n)break;let h=n.getAttribute("triggerid");if(!h)break;let m=document.getElementById(h);if(m&&m.tagName.toLowerCase()===Wo)e.push(m),s=m;else break}return e}setCurrentActiveNavItem(o){var h;let e=((h=this.currentActiveNavItem)==null?void 0:h.navId)===(o==null?void 0:o.navId),s=(o==null?void 0:o.disableAriaCurrent)||this.hasSiblingWithTriggerId(o);if(e||s||(this.currentActiveNavItem&&(this.currentActiveNavItem.removeAttribute("aria-current"),this.currentActiveNavItem.removeAttribute("active"),this.getParentNavItems(this.currentActiveNavItem).forEach(T=>{T.removeAttribute("tooltip-text"),T.removeAttribute("active")})),!o))return;this.currentActiveNavItem=o,o.setAttribute("aria-current","page"),o.setAttribute("active",""),this.getParentNavItems(o).forEach(m=>{m.setAttribute("tooltip-text",this.parentNavTooltipText||""),m.setAttribute("tooltip-placement",Ut.BOTTOM),m.setAttribute("active","")})}};Vn.context=zn;var Bn=Vn;var Kb=H`
3449
3449
  :host {
3450
3450
  --mdc-sidenavigation-expanded-width: 15rem;
3451
3451
  --mdc-sidenavigation-collapsed-width: 4.5rem;
@@ -5039,7 +5039,7 @@
5039
5039
  position: relative;
5040
5040
  width: 100%;
5041
5041
  }
5042
- `],af=$y;var nf=j.constructTagName("virtualizedlist"),R5=j.constructTagName("virtualizedwrapper"),lf={VIRTUALIZER_PROPS:{count:0,estimateSize:()=>0}};var ro=class extends q{constructor(){super();this.virtualizerProps=lf.VIRTUALIZER_PROPS;this.scrollElementRef=Ya();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 rl(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,L;this.virtualizer=e.getVirtualizer();let{getTotalSize:s,getVirtualItems:n,measureElement:h}=this.virtualizer,m=n();if(m!==this.virtualItems){this.virtualItems=m;let $=n(),W={position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${(L=(T=$[0])==null?void 0:T.start)!=null?L:0}px)`};this.setlistdata&&this.setlistdata({virtualItems:$,measureElement:h,listStyle:W})}return O`<div part="container" style="height: ${s()}px;">
5042
+ `],af=$y;var nf=j.constructTagName("virtualizedlist"),O5=j.constructTagName("virtualizedwrapper"),lf={VIRTUALIZER_PROPS:{count:0,estimateSize:()=>0}};var ro=class extends q{constructor(){super();this.virtualizerProps=lf.VIRTUALIZER_PROPS;this.scrollElementRef=Ya();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 rl(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,L;this.virtualizer=e.getVirtualizer();let{getTotalSize:s,getVirtualItems:n,measureElement:h}=this.virtualizer,m=n();if(m!==this.virtualItems){this.virtualItems=m;let $=n(),W={position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${(L=(T=$[0])==null?void 0:T.start)!=null?L:0}px)`};this.setlistdata&&this.setlistdata({virtualItems:$,measureElement:h,listStyle:W})}return O`<div part="container" style="height: ${s()}px;">
5043
5043
  <slot></slot>
5044
5044
  </div>`}render(){return O`<div ${qa(this.scrollElementRef)} part="scroll" @scroll=${this.onscroll&&this.onscroll}>
5045
5045
  ${this.virtualizerController?this.getVirtualizedListWrapper(this.virtualizerController):O``}