@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,15 +1,19 @@
1
1
  import { AnimationItem } from 'lottie-web';
2
2
  import { SulaLoaderSize } from './model/sula-loader.model';
3
3
  export declare class SulaLoader {
4
- el: HTMLElement;
4
+ el?: HTMLElement;
5
5
  /**
6
6
  * Tamanho predefinido (small, medium, large)
7
7
  */
8
8
  size: SulaLoaderSize;
9
- animationInstance: AnimationItem;
10
- containerRef: HTMLDivElement;
9
+ animationInstance: AnimationItem | null;
10
+ containerRef?: HTMLDivElement;
11
+ connectedCallback(): void;
11
12
  componentDidLoad(): void;
13
+ componentDidRender(): void;
12
14
  disconnectedCallback(): void;
15
+ private destroyAnimation;
16
+ private tryInitLottie;
13
17
  initLottie(): void;
14
18
  getDimensions(): {
15
19
  width: string;
@@ -21029,17 +21029,29 @@ const SulaLoader = class {
21029
21029
  /**
21030
21030
  * Tamanho predefinido (small, medium, large)
21031
21031
  */ this.size = SulaLoaderSize.Medium;
21032
+ this.animationInstance = null;
21033
+ }
21034
+ connectedCallback() {
21035
+ this.tryInitLottie();
21032
21036
  }
21033
21037
  componentDidLoad() {
21034
- this.initLottie();
21038
+ this.tryInitLottie();
21039
+ }
21040
+ componentDidRender() {
21041
+ this.tryInitLottie();
21035
21042
  }
21036
21043
  disconnectedCallback() {
21037
- if (this.animationInstance) {
21038
- this.animationInstance.destroy();
21044
+ this.destroyAnimation();
21045
+ }
21046
+ destroyAnimation() {
21047
+ if (!this.animationInstance) {
21048
+ return;
21039
21049
  }
21050
+ this.animationInstance.destroy();
21051
+ this.animationInstance = null;
21040
21052
  }
21041
- initLottie() {
21042
- if (!this.containerRef) return;
21053
+ tryInitLottie() {
21054
+ if (!this.containerRef || this.animationInstance) return;
21043
21055
  try {
21044
21056
  const e = loaderAnimation;
21045
21057
  this.animationInstance = lottie.loadAnimation({
@@ -21054,6 +21066,9 @@ const SulaLoader = class {
21054
21066
  console.error("Erro ao carregar animação Lottie:", e);
21055
21067
  }
21056
21068
  }
21069
+ initLottie() {
21070
+ this.tryInitLottie();
21071
+ }
21057
21072
  getDimensions() {
21058
21073
  const e = {
21059
21074
  small: "24px",
@@ -21068,9 +21083,9 @@ const SulaLoader = class {
21068
21083
  render() {
21069
21084
  const {width: e, height: t} = this.getDimensions();
21070
21085
  return h$1(Host, {
21071
- key: "abd6665256f4e7173603ccc791b20f884bf9e9b6"
21086
+ key: "4d73099f19f4e81ed2cd83ee1402e0f06f71f7ca"
21072
21087
  }, h$1("div", {
21073
- key: "41f9fb073388d7fc2a1585231fb8c257e5996847",
21088
+ key: "2593fe1c91bf4c7f167caa55fdc476d0a9d73841",
21074
21089
  ref: e => this.containerRef = e,
21075
21090
  style: {
21076
21091
  width: e,
@@ -25097,4 +25112,4 @@ SulaTooltip.style = sulaTooltipCss;
25097
25112
 
25098
25113
  export { SulaAvatar as sula_avatar, SulaBadge as sula_badge, SulaBreadcrumb as sula_breadcrumb, SulaButton as sula_button, SulaCheckbox as sula_checkbox, SulaChip as sula_chip, SulaDropdown as sula_dropdown, SulaIcon as sula_icon, SulaLoader as sula_loader, SulaMenuSelectList as sula_menu_select_list, SulaModal as sula_modal, SulaProgressBar as sula_progress_bar, SulaRadioButton as sula_radio_button, SulaSearchBar as sula_search_bar, SulaSegmentedControl as sula_segmented_control, SulaSwitch as sula_switch, SulaTable as sula_table, SulaTableBody as sula_table_body, SulaTableCell as sula_table_cell, SulaTableHeadCell as sula_table_head_cell, SulaTableHeader as sula_table_header, SulaTableRow as sula_table_row, SulaTag as sula_tag, SulaTextarea as sula_textarea, SulaTextfield as sula_textfield, SulaTiles as sula_tiles, SulaTimelineList as sula_timeline_list, SulaToggle as sula_toggle, SulaTooltip as sula_tooltip };
25099
25114
  //# sourceMappingURL=sula-avatar.sula-badge.sula-breadcrumb.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-modal.sula-progress-bar.sula-radio-button.sula-search-bar.sula-segmented-control.sula-switch.sula-table.sula-table-body.sula-table-cell.sula-table-head-cell.sula-table-header.sula-table-row.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.sula-toggle.sula-tooltip.entry.esm.js.map
25100
- //# sourceMappingURL=p-f62433bd.entry.js.map
25115
+ //# sourceMappingURL=p-342be8e3.entry.js.map