@m3e/core 1.0.0 → 1.0.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/index.min.js CHANGED
@@ -314,7 +314,7 @@ const ci=e=>e??Gs,pi=Symbol("renderPseudoLink");function mi(e){return Ne(e,"down
314
314
  :host([disabled]) {
315
315
  color: color-mix(in srgb, var(--m3e-radio-disabled-icon-color, ${Zt.color.onSurface}) 38%, transparent);
316
316
  }
317
- `,dr=n([Ve("m3e-pseudo-radio")],dr);const cr=i(`var(--m3e-ripple-color, ${Zt.color.onSurface})`),pr=i(`var(--m3e-ripple-opacity, ${Zt.state.pressedStateLayerOpacity})`),mr=i(`var(--m3e-ripple-enter-duration, ${Zt.motion.duration.long4})`),ur=i(`var(--m3e-ripple-exit-duration, ${Zt.motion.duration.short2})`),vr=i("var(--m3e-ripple-scale-factor, 2.5)");var fr,yr,gr,br,xr,wr;let $r=class extends(Cs($i(o,"none"))){constructor(){super(...arguments),fr.add(this),yr.set(this,null),gr.set(this,new Me(this,{target:null,minPressedDuration:150,isPressedKey:e=>" "===e||!this.disableEnter&&"Enter"===e,callback:(e,{x:t,y:s})=>l(this,fr,"m",wr).call(this,e,t,s)})),this.disabled=!1,this.disableEnter=!1,this.centered=!1,this.unbounded=!1,this.radius=null,this.trigger=null}get visible(){return null!==l(this,yr,"f")}show(e,t,s=!1){l(this,fr,"m",br).call(this);const i=this.getBoundingClientRect();this.centered&&(e=i.left+i.width/2,t=i.top+i.height/2);let r=this.radius;if(!r||isNaN(r)){const s=Math.max(Math.abs(e-i.left),Math.abs(e-i.right)),a=Math.max(Math.abs(t-i.top),Math.abs(t-i.bottom));r=Math.sqrt(s*s+a*a)}const a=e-i.left,o=t-i.top;h(this,yr,document.createElement("div"),"f"),l(this,yr,"f").classList.add("ripple"),s&&l(this,yr,"f").classList.add("persistent"),l(this,yr,"f").style.left=a-r+"px",l(this,yr,"f").style.top=o-r+"px",l(this,yr,"f").style.width=2*r+"px",l(this,yr,"f").style.height=2*r+"px",l(this,yr,"f").addEventListener("animationend",()=>l(this,fr,"m",xr).call(this,s),{once:!0}),l(this,yr,"f").addEventListener("transitionend",()=>l(this,fr,"m",br).call(this),{once:!0}),this.shadowRoot?.appendChild(l(this,yr,"f"))}hide(){l(this,yr,"f")?.classList.add("exit")}attach(e){super.attach(e),l(this,gr,"f").observe(e)}detach(){this.control&&l(this,gr,"f").unobserve(this.control),super.detach()}connectedCallback(){this.ariaHidden="true",super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),l(this,fr,"m",br).call(this)}updated(e){super.updated(e),e.has("disabled")&&this.disabled&&this.hide()}};var kr;yr=new WeakMap,gr=new WeakMap,fr=new WeakSet,br=function(){l(this,yr,"f")?.remove(),h(this,yr,null,"f")},xr=function(e){e?l(this,yr,"f")?.classList.add("pressed"):this.hide()},wr=function(e,t,s){this.disabled||(e?this.show(t,s,!0):this.hide())},$r.styles=a`
317
+ `,dr=n([Ve("m3e-pseudo-radio")],dr);const cr=i(`var(--m3e-ripple-color, ${Zt.color.onSurface})`),pr=i(`var(--m3e-ripple-opacity, ${Zt.state.pressedStateLayerOpacity})`),mr=i(`var(--m3e-ripple-enter-duration, ${Zt.motion.duration.long4})`),ur=i(`var(--m3e-ripple-exit-duration, ${Zt.motion.duration.short2})`),vr=i("var(--m3e-ripple-scale-factor, 2.5)");var fr,yr,gr,br,xr,wr;let $r=class extends(Cs($i(o,"none"))){constructor(){super(...arguments),fr.add(this),yr.set(this,null),gr.set(this,new Me(this,{target:null,minPressedDuration:150,isPressedKey:e=>" "===e,callback:(e,{x:t,y:s})=>l(this,fr,"m",wr).call(this,e,t,s)})),this.disabled=!1,this.centered=!1,this.unbounded=!1,this.radius=null,this.trigger=null}get visible(){return null!==l(this,yr,"f")}show(e,t,s=!1){l(this,fr,"m",br).call(this);const i=this.getBoundingClientRect();this.centered&&(e=i.left+i.width/2,t=i.top+i.height/2);let r=this.radius;if(!r||isNaN(r)){const s=Math.max(Math.abs(e-i.left),Math.abs(e-i.right)),a=Math.max(Math.abs(t-i.top),Math.abs(t-i.bottom));r=Math.sqrt(s*s+a*a)}const a=e-i.left,o=t-i.top;h(this,yr,document.createElement("div"),"f"),l(this,yr,"f").classList.add("ripple"),s&&l(this,yr,"f").classList.add("persistent"),l(this,yr,"f").style.left=a-r+"px",l(this,yr,"f").style.top=o-r+"px",l(this,yr,"f").style.width=2*r+"px",l(this,yr,"f").style.height=2*r+"px",l(this,yr,"f").addEventListener("animationend",()=>l(this,fr,"m",xr).call(this,s),{once:!0}),l(this,yr,"f").addEventListener("transitionend",()=>l(this,fr,"m",br).call(this),{once:!0}),this.shadowRoot?.appendChild(l(this,yr,"f"))}hide(){l(this,yr,"f")?.classList.add("exit")}attach(e){super.attach(e),l(this,gr,"f").observe(e)}detach(){this.control&&l(this,gr,"f").unobserve(this.control),super.detach()}connectedCallback(){this.ariaHidden="true",super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),l(this,fr,"m",br).call(this)}updated(e){super.updated(e),e.has("disabled")&&this.disabled&&this.hide()}};var kr;yr=new WeakMap,gr=new WeakMap,fr=new WeakSet,br=function(){l(this,yr,"f")?.remove(),h(this,yr,null,"f")},xr=function(e){e?l(this,yr,"f")?.classList.add("pressed"):this.hide()},wr=function(e,t,s){this.disabled||(e?this.show(t,s,!0):this.hide())},$r.styles=a`
318
318
  :host {
319
319
  display: block;
320
320
  position: absolute;
@@ -381,7 +381,7 @@ const ci=e=>e??Gs,pi=Symbol("renderPseudoLink");function mi(e){return Ne(e,"down
381
381
  display: none;
382
382
  }
383
383
  }
384
- `,n([vt({type:Boolean,reflect:!0})],$r.prototype,"disabled",void 0),n([vt({attribute:"disable-enter",type:Boolean,reflect:!0})],$r.prototype,"disableEnter",void 0),n([vt({type:Boolean,reflect:!0})],$r.prototype,"centered",void 0),n([vt({type:Boolean,reflect:!0})],$r.prototype,"unbounded",void 0),n([vt({type:Number})],$r.prototype,"radius",void 0),n([vt()],$r.prototype,"trigger",void 0),$r=n([Ve("m3e-ripple")],$r);let _r=class extends o{constructor(){super(...arguments),kr.set(this,()=>this._updateScroll()),this.dividers="above-below",this.thin=!1}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",l(this,kr,"f"))}update(e){super.update(e),e.has("dividers")&&(this.removeEventListener("scroll",l(this,kr,"f")),"none"!==this.dividers&&this.addEventListener("scroll",l(this,kr,"f")))}render(){return r`<slot @slotchange="${this._updateScroll}"></slot>`}_updateScroll(){const e=("above"===this.dividers||"above-below"===this.dividers)&&this.scrollTop>0,t=("below"===this.dividers||"above-below"===this.dividers)&&this.scrollHeight-this.scrollTop-this.clientHeight>1;this.classList.toggle("-above",e),this.classList.toggle("-below",t)}};var Er,Sr;kr=new WeakMap,_r.styles=a`
384
+ `,n([vt({type:Boolean,reflect:!0})],$r.prototype,"disabled",void 0),n([vt({type:Boolean,reflect:!0})],$r.prototype,"centered",void 0),n([vt({type:Boolean,reflect:!0})],$r.prototype,"unbounded",void 0),n([vt({type:Number})],$r.prototype,"radius",void 0),n([vt()],$r.prototype,"trigger",void 0),$r=n([Ve("m3e-ripple")],$r);let _r=class extends o{constructor(){super(...arguments),kr.set(this,()=>this._updateScroll()),this.dividers="above-below",this.thin=!1}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",l(this,kr,"f"))}update(e){super.update(e),e.has("dividers")&&(this.removeEventListener("scroll",l(this,kr,"f")),"none"!==this.dividers&&this.addEventListener("scroll",l(this,kr,"f")))}render(){return r`<slot @slotchange="${this._updateScroll}"></slot>`}_updateScroll(){const e=("above"===this.dividers||"above-below"===this.dividers)&&this.scrollTop>0,t=("below"===this.dividers||"above-below"===this.dividers)&&this.scrollHeight-this.scrollTop-this.clientHeight>1;this.classList.toggle("-above",e),this.classList.toggle("-below",t)}};var Er,Sr;kr=new WeakMap,_r.styles=a`
385
385
  :host {
386
386
  display: block;
387
387
  overflow-y: auto;
@@ -467,7 +467,7 @@ const ci=e=>e??Gs,pi=Symbol("renderPseudoLink");function mi(e){return Ne(e,"down
467
467
  transition: none;
468
468
  }
469
469
  }
470
- `,n([function(e){return(t,s)=>{const{slot:i,selector:r}=e??{},a="slot"+(i?`[name=${i}]`:":not([name])");return ft(t,s,{get(){const t=this.renderRoot?.querySelector(a),s=t?.assignedElements(e)??[];return void 0===r?s:s.filter(e=>e.matches(r))}})}}({flatten:!0})],Ar.prototype,"_items",void 0),n([vt({attribute:"selected-index",type:Number,reflect:!0})],Ar.prototype,"selectedIndex",void 0),Ar=n([Ve("m3e-slide")],Ar);const Cr=i(`var(--m3e-state-layer-hover-color, ${Zt.color.onSurface})`),zr=i(`var(--m3e-state-layer-hover-opacity, ${Zt.state.hoverStateLayerOpacity})`),Lr=i(`var(--m3e-state-layer-focus-color, ${Zt.color.onSurface})`),Mr=i(`var(--m3e-state-layer-focus-opacity, ${Zt.state.focusStateLayerOpacity})`),Wr=i(`var(--m3e-state-layer-duration, ${Zt.motion.duration.medium1})`),Pr=i(`var(--m3e-state-layer-easing, ${Zt.motion.easing.standard})`);var Tr,Fr,Hr,Dr,Or;let Ur=class extends(Cs($i(o,"none"))){constructor(){super(...arguments),Tr.add(this),Fr.set(this,new Ae(this,{target:null,callback:e=>l(this,Tr,"m",Dr).call(this,e)})),Hr.set(this,new Se(this,{target:null,callback:e=>l(this,Tr,"m",Or).call(this,e)})),this.disabled=!1}show(e){this._layer?.classList.toggle(e,!0)}hide(e){this._layer?.classList.toggle(e,!1)}attach(e){super.attach(e),l(this,Fr,"f").observe(e),l(this,Hr,"f").observe(e)}detach(){this.control&&(l(this,Fr,"f").unobserve(this.control),l(this,Hr,"f").unobserve(this.control)),super.detach()}connectedCallback(){this.ariaHidden="true",super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.hide("hover"),this.hide("focused")}updated(e){super.updated(e),e.has("disabled")&&this.disabled&&(this.hide("hover"),this.hide("focused"))}render(){return r`<div class="layer"></div>`}};Fr=new WeakMap,Hr=new WeakMap,Tr=new WeakSet,Dr=function(e){this.disabled||(e?this.show("hover"):this.hide("hover"))},Or=function(e){this.disabled||(e?this.show("focused"):this.hide("focused"))},Ur.styles=a`
470
+ `,n([function(e){return(t,s)=>{const{slot:i,selector:r}=e??{},a="slot"+(i?`[name=${i}]`:":not([name])");return ft(t,s,{get(){const t=this.renderRoot?.querySelector(a),s=t?.assignedElements(e)??[];return void 0===r?s:s.filter(e=>e.matches(r))}})}}({flatten:!0})],Ar.prototype,"_items",void 0),n([vt({attribute:"selected-index",type:Number,reflect:!0})],Ar.prototype,"selectedIndex",void 0),Ar=n([Ve("m3e-slide")],Ar);const Cr=i(`var(--m3e-state-layer-hover-color, ${Zt.color.onSurface})`),zr=i(`var(--m3e-state-layer-hover-opacity, ${Zt.state.hoverStateLayerOpacity})`),Lr=i(`var(--m3e-state-layer-focus-color, ${Zt.color.onSurface})`),Mr=i(`var(--m3e-state-layer-focus-opacity, ${Zt.state.focusStateLayerOpacity})`),Wr=i(`var(--m3e-state-layer-duration, ${Zt.motion.duration.medium1})`),Pr=i(`var(--m3e-state-layer-easing, ${Zt.motion.easing.standard})`);var Tr,Fr,Hr,Dr,Or;let Ur=class extends(Cs($i(o,"none"))){constructor(){super(...arguments),Tr.add(this),Fr.set(this,new Ae(this,{target:null,callback:e=>l(this,Tr,"m",Dr).call(this,e)})),Hr.set(this,new Se(this,{target:null,callback:(e,t)=>l(this,Tr,"m",Or).call(this,e&&t)})),this.disabled=!1}show(e){this._layer?.classList.toggle(e,!0)}hide(e){this._layer?.classList.toggle(e,!1)}attach(e){super.attach(e),l(this,Fr,"f").observe(e),l(this,Hr,"f").observe(e)}detach(){this.control&&(l(this,Fr,"f").unobserve(this.control),l(this,Hr,"f").unobserve(this.control)),super.detach()}connectedCallback(){this.ariaHidden="true",super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.hide("hover"),this.hide("focused")}updated(e){super.updated(e),e.has("disabled")&&this.disabled&&(this.hide("hover"),this.hide("focused"))}render(){return r`<div class="layer"></div>`}};Fr=new WeakMap,Hr=new WeakMap,Tr=new WeakSet,Dr=function(e){this.disabled||(e?this.show("hover"):this.hide("hover"))},Or=function(e){this.disabled||(e?this.show("focused"):this.hide("focused"))},Ur.styles=a`
471
471
  :host {
472
472
  display: block;
473
473
  }