@seniorsistemas/angular-components 17.2.3 → 17.2.4

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,13 +1,12 @@
1
1
  import { __decorate, __spread, __assign, __values, __extends, __rest, __awaiter, __generator, __param, __read } from 'tslib';
2
2
  import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, HostBinding, Renderer2, Pipe, ViewEncapsulation, InjectionToken, Inject, TemplateRef, ViewContainerRef, ChangeDetectorRef, Optional, ContentChild } from '@angular/core';
3
3
  import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
4
+ import { Subject, of, from, throwError, forkJoin, ReplaySubject } from 'rxjs';
5
+ import { takeUntil, filter, tap, map, switchMap, catchError, delay, debounceTime, repeat, finalize, take } from 'rxjs/operators';
4
6
  import { CommonModule } from '@angular/common';
5
7
  import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormControl, FormGroup, NG_VALIDATORS, FormBuilder, Validators, FormArray, ControlContainer } from '@angular/forms';
6
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
8
  import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } from '@angular/router';
8
9
  import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
9
- import { Subject, of, from, throwError, forkJoin, ReplaySubject } from 'rxjs';
10
- import { takeUntil, filter, tap, map, switchMap, catchError, delay, debounceTime, repeat, finalize, take } from 'rxjs/operators';
11
10
  import { TieredMenu, TieredMenuModule as TieredMenuModule$1 } from 'primeng/tieredmenu';
12
11
  import { TooltipModule as TooltipModule$1 } from 'primeng/tooltip';
13
12
  import { DomHandler } from 'primeng/dom';
@@ -162,23 +161,24 @@ var AccordionPanelComponent = /** @class */ (function () {
162
161
  var AccordionComponent = /** @class */ (function () {
163
162
  function AccordionComponent() {
164
163
  this.multiple = false;
164
+ this._unsubscribe$ = new Subject();
165
165
  this._panels = [];
166
166
  }
167
167
  AccordionComponent.prototype.ngAfterContentInit = function () {
168
168
  this._panels = this.panelsComponents.toArray();
169
169
  this._openSubs = new Array(this._panels.length);
170
+ this._setBehavior(this.multiple);
170
171
  this._setupTabs();
171
172
  };
172
173
  AccordionComponent.prototype.ngOnChanges = function (changes) {
173
174
  if (changes.multiple) {
174
- if (changes.multiple.currentValue) {
175
- this._enableMultiplePanelBehavior();
176
- }
177
- else {
178
- this._enableSinglePanelBehavior();
179
- }
175
+ this._setBehavior(changes.multiple.currentValue);
180
176
  }
181
177
  };
178
+ AccordionComponent.prototype.ngOnDestroy = function () {
179
+ this._unsubscribe$.next();
180
+ this._unsubscribe$.complete();
181
+ };
182
182
  AccordionComponent.prototype._setupTabs = function () {
183
183
  var _a;
184
184
  if ((_a = this._panels) === null || _a === void 0 ? void 0 : _a.length) {
@@ -200,10 +200,20 @@ var AccordionComponent = /** @class */ (function () {
200
200
  }
201
201
  });
202
202
  };
203
+ AccordionComponent.prototype._setBehavior = function (multiple) {
204
+ if (multiple) {
205
+ this._enableMultiplePanelBehavior();
206
+ }
207
+ else {
208
+ this._enableSinglePanelBehavior();
209
+ }
210
+ };
203
211
  AccordionComponent.prototype._enableSinglePanelBehavior = function () {
204
212
  var _this = this;
205
213
  this._panels.forEach(function (panel, index) {
206
- _this._openSubs[index] = panel.panelOpened.subscribe(function () {
214
+ _this._openSubs[index] = panel.panelOpened
215
+ .pipe(takeUntil(_this._unsubscribe$))
216
+ .subscribe(function () {
207
217
  _this._closeOtherTabs(index);
208
218
  });
209
219
  });
@@ -739,7 +749,6 @@ var AccordionModule = /** @class */ (function () {
739
749
  imports: [
740
750
  CommonModule,
741
751
  FormsModule,
742
- BrowserAnimationsModule,
743
752
  TooltipModule,
744
753
  SwitchModule,
745
754
  ],
@@ -11782,10 +11791,7 @@ var SlidePanelModule = /** @class */ (function () {
11782
11791
  }
11783
11792
  SlidePanelModule = __decorate([
11784
11793
  NgModule({
11785
- imports: [
11786
- CommonModule,
11787
- BrowserAnimationsModule,
11788
- ],
11794
+ imports: [CommonModule],
11789
11795
  declarations: [SlidePanelComponent],
11790
11796
  exports: [SlidePanelComponent],
11791
11797
  })