@momentum-design/components 0.134.6 → 0.134.7
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
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
:host([size='20']) {
|
|
150
150
|
--mdc-button-height: 1.25rem;
|
|
151
151
|
}
|
|
152
|
-
`,...Et()],Tf=ax;var fr=class extends Mt(Nt(Ve(ri(te(X))))){constructor(){super();this.size=ja.SIZE;this.role=ja.ROLE;this.type=ja.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(t){super.update(t),t.has("disabled")&&this.setDisabled(this,this.disabled),t.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),t.has("active")&&(this.active!==void 0&&(this.ariaStateKey=this.ariaStateKey||ja.ARIA_STATE_KEY),this.setActive(this,this.active))}executeAction(){this.type===Rs.SUBMIT&&this.form&&this.form.requestSubmit(),this.type===Rs.RESET&&this.form&&this.form.reset()}setActive(t,e){this.ariaStateKey&&this.ariaStateKey.split(",").filter(l=>l.trim().startsWith("aria-")).forEach(l=>{e===!0?t.setAttribute(l.trim(),"true"):e===!1?t.setAttribute(l.trim(),"false"):t.removeAttribute(l.trim())})}setSoftDisabled(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}setDisabled(t,e){e?(t.setAttribute("aria-disabled","true"),this.prevTabindex=this.tabIndex,this.tabIndex=-1):(this.tabIndex===-1&&(this.tabIndex=this.prevTabindex),t.removeAttribute("aria-disabled"))}triggerClickEvent(){this.click()}handleBlur(){this.classList.contains("pressed")&&this.classList.remove("pressed")}handleKeyDown(t){let e=this.getActionForKeyEvent(t);(e===Y.ENTER||e===Y.SPACE)&&(this.classList.add("pressed"),e===Y.ENTER&&(this.triggerClickEvent(),this.keyDownEventHandled()),t.preventDefault())}handleKeyUp(t){let e=this.getActionForKeyEvent(t);if(e===Y.ENTER||e===Y.SPACE){let i=this.classList.contains("pressed");this.classList.remove("pressed"),e===Y.SPACE&&i&&this.triggerClickEvent()}}render(){return S` <slot></slot> `}};fr.formAssociated=!0,fr.styles=[...X.styles,...Tf],h([u({type:Boolean,reflect:!0})],fr.prototype,"active",2),h([u({type:Boolean,attribute:"soft-disabled",reflect:!0})],fr.prototype,"softDisabled",2),h([u({type:Number,reflect:!0})],fr.prototype,"size",2),h([u({type:String,reflect:!0})],fr.prototype,"role",2),h([u({type:String,reflect:!0})],fr.prototype,"ariaStateKey",2),h([u({reflect:!0})],fr.prototype,"type",2),h([u({type:String,reflect:!0})],fr.prototype,"name",2),h([u({type:String,reflect:!0})],fr.prototype,"value",2);var fe=fr;var Rl=a=>{class o extends a{get overflowElement(){return this}isWidthOverflowing(){let e=this.overflowElement;return e.scrollWidth>e.clientWidth}isHeightOverflowing(){
|
|
152
|
+
`,...Et()],Tf=ax;var fr=class extends Mt(Nt(Ve(ri(te(X))))){constructor(){super();this.size=ja.SIZE;this.role=ja.ROLE;this.type=ja.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(t){super.update(t),t.has("disabled")&&this.setDisabled(this,this.disabled),t.has("softDisabled")&&this.setSoftDisabled(this,this.softDisabled),t.has("active")&&(this.active!==void 0&&(this.ariaStateKey=this.ariaStateKey||ja.ARIA_STATE_KEY),this.setActive(this,this.active))}executeAction(){this.type===Rs.SUBMIT&&this.form&&this.form.requestSubmit(),this.type===Rs.RESET&&this.form&&this.form.reset()}setActive(t,e){this.ariaStateKey&&this.ariaStateKey.split(",").filter(l=>l.trim().startsWith("aria-")).forEach(l=>{e===!0?t.setAttribute(l.trim(),"true"):e===!1?t.setAttribute(l.trim(),"false"):t.removeAttribute(l.trim())})}setSoftDisabled(t,e){e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled")}setDisabled(t,e){e?(t.setAttribute("aria-disabled","true"),this.prevTabindex=this.tabIndex,this.tabIndex=-1):(this.tabIndex===-1&&(this.tabIndex=this.prevTabindex),t.removeAttribute("aria-disabled"))}triggerClickEvent(){this.click()}handleBlur(){this.classList.contains("pressed")&&this.classList.remove("pressed")}handleKeyDown(t){let e=this.getActionForKeyEvent(t);(e===Y.ENTER||e===Y.SPACE)&&(this.classList.add("pressed"),e===Y.ENTER&&(this.triggerClickEvent(),this.keyDownEventHandled()),t.preventDefault())}handleKeyUp(t){let e=this.getActionForKeyEvent(t);if(e===Y.ENTER||e===Y.SPACE){let i=this.classList.contains("pressed");this.classList.remove("pressed"),e===Y.SPACE&&i&&this.triggerClickEvent()}}render(){return S` <slot></slot> `}};fr.formAssociated=!0,fr.styles=[...X.styles,...Tf],h([u({type:Boolean,reflect:!0})],fr.prototype,"active",2),h([u({type:Boolean,attribute:"soft-disabled",reflect:!0})],fr.prototype,"softDisabled",2),h([u({type:Number,reflect:!0})],fr.prototype,"size",2),h([u({type:String,reflect:!0})],fr.prototype,"role",2),h([u({type:String,reflect:!0})],fr.prototype,"ariaStateKey",2),h([u({reflect:!0})],fr.prototype,"type",2),h([u({type:String,reflect:!0})],fr.prototype,"name",2),h([u({type:String,reflect:!0})],fr.prototype,"value",2);var fe=fr;var Rl=a=>{class o extends a{get overflowElement(){return this}isWidthOverflowing(){let e=this.overflowElement;return e.scrollWidth>e.clientWidth}isHeightOverflowing(){return this.scrollHeight>this.clientHeight}}return o};var nx=H`
|
|
153
153
|
:host {
|
|
154
154
|
--mdc-button-prefix-icon-size: 1rem;
|
|
155
155
|
--mdc-button-postfix-icon-size: 1rem;
|