@sula-tech/webcomponents 0.17.4 → 0.17.5

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.
@@ -1,4 +1,4 @@
1
- import { S as SulaButton$1, d as defineCustomElement$1 } from './p-DGCOlK4x.js';
1
+ import { S as SulaButton$1, d as defineCustomElement$1 } from './p-Ds1BVj4V.js';
2
2
 
3
3
  const SulaButton = SulaButton$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { S as SulaLoader$1, d as defineCustomElement$1 } from './p-fwcKhm5l.js';
1
+ import { S as SulaLoader$1, d as defineCustomElement$1 } from './p-zE24jlFe.js';
2
2
 
3
3
  const SulaLoader = SulaLoader$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
2
- import { d as defineCustomElement$4, a as SulaButtonAppearance } from './p-DGCOlK4x.js';
2
+ import { d as defineCustomElement$4, a as SulaButtonAppearance } from './p-Ds1BVj4V.js';
3
3
  import { d as defineCustomElement$3 } from './p-fgs5TBQ7.js';
4
- import { d as defineCustomElement$2 } from './p-fwcKhm5l.js';
4
+ import { d as defineCustomElement$2 } from './p-zE24jlFe.js';
5
5
 
6
6
  var SulaModalType;
7
7
  (function (SulaModalType) {
@@ -27784,17 +27784,29 @@ const SulaLoader = class {
27784
27784
  * Tamanho predefinido (small, medium, large)
27785
27785
  */
27786
27786
  this.size = SulaLoaderSize.Medium;
27787
+ this.animationInstance = null;
27788
+ }
27789
+ connectedCallback() {
27790
+ this.tryInitLottie();
27787
27791
  }
27788
27792
  componentDidLoad() {
27789
- this.initLottie();
27793
+ this.tryInitLottie();
27794
+ }
27795
+ componentDidRender() {
27796
+ this.tryInitLottie();
27790
27797
  }
27791
27798
  disconnectedCallback() {
27792
- if (this.animationInstance) {
27793
- this.animationInstance.destroy();
27799
+ this.destroyAnimation();
27800
+ }
27801
+ destroyAnimation() {
27802
+ if (!this.animationInstance) {
27803
+ return;
27794
27804
  }
27805
+ this.animationInstance.destroy();
27806
+ this.animationInstance = null;
27795
27807
  }
27796
- initLottie() {
27797
- if (!this.containerRef)
27808
+ tryInitLottie() {
27809
+ if (!this.containerRef || this.animationInstance)
27798
27810
  return;
27799
27811
  try {
27800
27812
  const animationData = loaderAnimation;
@@ -27811,6 +27823,9 @@ const SulaLoader = class {
27811
27823
  console.error('Erro ao carregar animação Lottie:', error);
27812
27824
  }
27813
27825
  }
27826
+ initLottie() {
27827
+ this.tryInitLottie();
27828
+ }
27814
27829
  getDimensions() {
27815
27830
  const sizes = {
27816
27831
  small: '24px',
@@ -27821,7 +27836,7 @@ const SulaLoader = class {
27821
27836
  }
27822
27837
  render() {
27823
27838
  const { width, height } = this.getDimensions();
27824
- return (h$1(Host, { key: 'abd6665256f4e7173603ccc791b20f884bf9e9b6' }, h$1("div", { key: '41f9fb073388d7fc2a1585231fb8c257e5996847', ref: el => (this.containerRef = el), style: {
27839
+ return (h$1(Host, { key: '4d73099f19f4e81ed2cd83ee1402e0f06f71f7ca' }, h$1("div", { key: '2593fe1c91bf4c7f167caa55fdc476d0a9d73841', ref: el => (this.containerRef = el), style: {
27825
27840
  width: width,
27826
27841
  height: height,
27827
27842
  } })));