@momentum-design/components 0.75.0 → 0.75.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.
@@ -510,7 +510,7 @@
510
510
  :host svg{
511
511
  display: block;
512
512
  }
513
- `],zh=mv;var $h=j.constructTagName("animation"),Ba={NAME:void 0,AUTO_PLAY:!0,LOOP:"true"};var Sr=class extends Y{constructor(){super(...arguments);this.name=Ba.NAME;this.loop=Ba.LOOP;this.autoplay=Ba.AUTO_PLAY;this.ariaLabel=null;this.ariaLabelledBy=null;this.containerRef=za();this.onCompleteHandler=()=>{let e=new CustomEvent("complete",{detail:{name:this.name},bubbles:!0});this.dispatchEvent(e)}}get animation(){return this.lottieInstance}getLoopValue(){return this.loop==="true"?!0:this.loop==="false"?!1:this.loop?Number(this.loop):!0}onLoadSuccessHandler(e){this.lottieInstance&&(this.lottieInstance.removeEventListener("complete",this.onCompleteHandler),this.lottieInstance.destroy()),this.containerRef.value&&(this.lottieInstance=Vh.default.loadAnimation({container:this.containerRef.value,renderer:"svg",loop:this.getLoopValue(),autoplay:this.autoplay,animationData:e,name:this.name}),this.lottieInstance.addEventListener("complete",this.onCompleteHandler)),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,cancelable:!0,detail:{name:this.name}}))}onLoadFailHandler(e){let s=new CustomEvent("error",{bubbles:!0,cancelable:!0,detail:{error:e}});this.dispatchEvent(s)}getAnimationData(){this.name&&Al[this.name]?import(`@momentum-design/animations/dist${Al[this.name].replace(/^\./,"")}`).then(s=>this.onLoadSuccessHandler(s.default)).catch(s=>this.onLoadFailHandler(s)):this.onLoadFailHandler(new Error(`Invalid animation name: ${this.name}`))}updated(e){super.updated(e),(e.has("name")||e.has("loop")||e.has("autoplay"))&&this.getAnimationData(),(e.has("ariaLabel")||e.has("ariaLabelledBy"))&&(this.role=this.ariaLabel||this.ariaLabelledBy?"img":null)}render(){return D`<div aria-hidden="true" ${$a(this.containerRef)}></div>`}};Sr.styles=[...Y.styles,...zh],b([A({type:String,reflect:!0})],Sr.prototype,"name",2),b([A({type:String,reflect:!0})],Sr.prototype,"loop",2),b([A({type:Boolean,reflect:!0})],Sr.prototype,"autoplay",2),b([A({type:String,attribute:"aria-label"})],Sr.prototype,"ariaLabel",2),b([A({type:String,attribute:"aria-labelledby"})],Sr.prototype,"ariaLabelledBy",2);var _l=Sr;_l.register($h);var pv=_l;var uv=W`
513
+ `],zh=mv;var $h=j.constructTagName("animation"),Ba={NAME:void 0,AUTO_PLAY:!0,LOOP:"true"};var Sr=class extends Y{constructor(){super(...arguments);this.name=Ba.NAME;this.loop=Ba.LOOP;this.autoplay=Ba.AUTO_PLAY;this.ariaLabel=null;this.ariaLabelledBy=null;this.containerRef=za();this.onCompleteHandler=()=>{let e=new CustomEvent("complete",{detail:{name:this.name},bubbles:!0});this.dispatchEvent(e)}}get animation(){return this.lottieInstance}getLoopValue(){return this.loop==="true"?!0:this.loop==="false"?!1:this.loop?Number(this.loop):!0}onLoadSuccessHandler(e){this.lottieInstance&&(this.lottieInstance.removeEventListener("complete",this.onCompleteHandler),this.lottieInstance.destroy()),this.containerRef.value&&(this.lottieInstance=Vh.default.loadAnimation({container:this.containerRef.value,renderer:"svg",loop:this.getLoopValue(),autoplay:this.autoplay,animationData:e,name:this.name}),this.lottieInstance.addEventListener("complete",this.onCompleteHandler)),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,cancelable:!0,detail:{name:this.name}}))}onLoadFailHandler(e){let s=new CustomEvent("error",{bubbles:!0,cancelable:!0,detail:{error:e}});this.dispatchEvent(s)}getAnimationData(){this.name&&Al[this.name]?import(`@momentum-design/animations/dist/lottie${Al[this.name].replace(/^\.\/lottie/,"")}`).then(s=>this.onLoadSuccessHandler(s.default)).catch(s=>this.onLoadFailHandler(s)):this.onLoadFailHandler(new Error(`Invalid animation name: ${this.name}`))}updated(e){super.updated(e),(e.has("name")||e.has("loop")||e.has("autoplay"))&&this.getAnimationData(),(e.has("ariaLabel")||e.has("ariaLabelledBy"))&&(this.role=this.ariaLabel||this.ariaLabelledBy?"img":null)}render(){return D`<div aria-hidden="true" ${$a(this.containerRef)}></div>`}};Sr.styles=[...Y.styles,...zh],b([A({type:String,reflect:!0})],Sr.prototype,"name",2),b([A({type:String,reflect:!0})],Sr.prototype,"loop",2),b([A({type:Boolean,reflect:!0})],Sr.prototype,"autoplay",2),b([A({type:String,attribute:"aria-label"})],Sr.prototype,"ariaLabel",2),b([A({type:String,attribute:"aria-labelledby"})],Sr.prototype,"ariaLabelledBy",2);var _l=Sr;_l.register($h);var pv=_l;var uv=W`
514
514
  :host {
515
515
  --mdc-appheader-height: 4rem;
516
516
  }