@momentum-design/components 0.49.3 → 0.49.4

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.
@@ -236,7 +236,7 @@
236
236
  :host([size="20"]){
237
237
  height: var(--mdc-button-height-size-20);
238
238
  }
239
- `,...R()],Xs=Fl;var Ee=class extends ro(se(y)){constructor(){super();this.active=!1;this.softDisabled=!1;this.size=to.SIZE;this.role=to.ROLE;this.type=to.TYPE;this.prevTabindex=0;this.internals=this.attachInternals(),this.addEventListener("click",this.executeAction.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.addEventListener("keyup",this.handleKeyUp.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}get form(){return this.internals.form}update(e){super.update(e),e.has("disabled")&&this.setDisabled(this,this.disabled),e.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),e.has("active")&&this.setActive(this,this.active)}executeAction(){this.type===zt.SUBMIT&&this.form&&this.form.requestSubmit(),this.type===zt.RESET&&this.form&&this.form.reset()}setActive(e,r){r?e.setAttribute("aria-pressed","true"):e.removeAttribute("aria-pressed")}setSoftDisabled(e,r){r?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}setDisabled(e,r){r?(e.setAttribute("aria-disabled","true"),this.prevTabindex=this.tabIndex,this.tabIndex=-1):(this.tabIndex===-1&&(this.tabIndex=this.prevTabindex),e.removeAttribute("aria-disabled"))}triggerClickEvent(){let e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(e)}handleBlur(){this.classList.contains("pressed")&&this.classList.remove("pressed")}handleKeyDown(e){["Enter"," "].includes(e.key)&&(this.classList.add("pressed"),e.key==="Enter"&&this.triggerClickEvent())}handleKeyUp(e){["Enter"," "].includes(e.key)&&(this.classList.remove("pressed"),e.key===" "&&this.triggerClickEvent())}render(){return p`
239
+ `,...R()],Xs=Fl;var Ee=class extends ro(se(y)){constructor(){super();this.active=!1;this.softDisabled=!1;this.size=to.SIZE;this.role=to.ROLE;this.type=to.TYPE;this.prevTabindex=0;this.internals=this.attachInternals(),this.addEventListener("click",this.executeAction.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this)),this.addEventListener("keyup",this.handleKeyUp.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}get form(){return this.internals.form}update(e){super.update(e),e.has("disabled")&&this.setDisabled(this,this.disabled),e.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),e.has("active")&&this.setActive(this,this.active)}executeAction(){this.type===zt.SUBMIT&&this.form&&this.form.requestSubmit(),this.type===zt.RESET&&this.form&&this.form.reset()}setActive(e,r){r?e.setAttribute("aria-pressed","true"):e.removeAttribute("aria-pressed")}setSoftDisabled(e,r){r?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}setDisabled(e,r){r?(e.setAttribute("aria-disabled","true"),this.prevTabindex=this.tabIndex,this.tabIndex=-1):(this.tabIndex===-1&&(this.tabIndex=this.prevTabindex),e.removeAttribute("aria-disabled"))}triggerClickEvent(){let e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});this.dispatchEvent(e)}handleBlur(){this.classList.contains("pressed")&&this.classList.remove("pressed")}handleKeyDown(e){["Enter"," "].includes(e.key)&&(this.classList.add("pressed"),e.key==="Enter"&&this.triggerClickEvent(),e.key===" "&&e.preventDefault())}handleKeyUp(e){["Enter"," "].includes(e.key)&&(this.classList.remove("pressed"),e.key===" "&&this.triggerClickEvent())}render(){return p`
240
240
  <slot></slot>
241
241
  `}};Ee.formAssociated=!0,Ee.styles=[...y.styles,...Xs],l([c({type:Boolean,reflect:!0})],Ee.prototype,"active",2),l([c({type:Boolean,attribute:"soft-disabled"})],Ee.prototype,"softDisabled",2),l([c({type:Number,reflect:!0})],Ee.prototype,"size",2),l([c({type:String,reflect:!0})],Ee.prototype,"role",2),l([c({reflect:!0})],Ee.prototype,"type",2);var ae=Ee;var Vt=class extends ae{constructor(){super(...arguments);this.variant=Pt.VARIANT;this.label=""}connectedCallback(){super.connectedCallback(),this.disabled=void 0,this.softDisabled=void 0,this.active=void 0,this.size=Pt.SIZE,this.role=Pt.ROLE}render(){return p`
242
242
  <mdc-icon part="icon" name="${qs(this.variant)}" length-unit="rem" size="1"></mdc-icon>