@seniorsistemas/angular-components 17.2.7 → 17.2.8

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.
@@ -63,9 +63,9 @@ var AccordionPanelComponent = /** @class */ (function () {
63
63
  this.cache = false;
64
64
  this.panelOpened = new EventEmitter();
65
65
  this.panelClosed = new EventEmitter();
66
- this._isOpen = false;
67
66
  this.isAnimating = false;
68
67
  this.isContentAnimationDisabled = true;
68
+ this._isOpen = false;
69
69
  }
70
70
  Object.defineProperty(AccordionPanelComponent.prototype, "isOpen", {
71
71
  get: function () {
@@ -77,9 +77,16 @@ var AccordionPanelComponent = /** @class */ (function () {
77
77
  enumerable: true,
78
78
  configurable: true
79
79
  });
80
- AccordionPanelComponent.prototype.ngOnInit = function () {
81
- if (this.switch) {
82
- this.switchState = this.switch.state;
80
+ AccordionPanelComponent.prototype.ngOnChanges = function (changes) {
81
+ if ("disabled" in changes) {
82
+ if (this.switchControl) {
83
+ changes["disabled"].currentValue
84
+ ? this.switchControl.disable({ emitEvent: false })
85
+ : this.switchControl.enable({ emitEvent: false });
86
+ }
87
+ }
88
+ if ("switch" in changes && "switchControl" in changes) {
89
+ throw new Error("You can't set switch and switchControl together.");
83
90
  }
84
91
  };
85
92
  AccordionPanelComponent.prototype.ngAfterViewInit = function () {
@@ -126,6 +133,9 @@ var AccordionPanelComponent = /** @class */ (function () {
126
133
  __decorate([
127
134
  Input()
128
135
  ], AccordionPanelComponent.prototype, "switch", void 0);
136
+ __decorate([
137
+ Input()
138
+ ], AccordionPanelComponent.prototype, "switchControl", void 0);
129
139
  __decorate([
130
140
  Input()
131
141
  ], AccordionPanelComponent.prototype, "validationMessage", void 0);
@@ -141,7 +151,7 @@ var AccordionPanelComponent = /** @class */ (function () {
141
151
  AccordionPanelComponent = __decorate([
142
152
  Component({
143
153
  selector: "s-accordion-panel",
144
- template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <s-switch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switchState\"\n (click)=\"$event.stopPropagation()\"\n (valueChanged)=\"switch.onChange($event)\">\n </s-switch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #panelContent>\n <ng-content></ng-content>\n</ng-template>",
154
+ template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <s-switch\n *ngIf=\"switchControl\"\n class=\"switch\"\n [formControl]=\"switchControl\"\n (click)=\"$event.stopPropagation()\">\n </s-switch>\n <s-switch\n *ngIf=\"!switchControl && switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switch.state\"\n (click)=\"$event.stopPropagation()\"\n (valueChanged)=\"switch.onChange($event)\">\n </s-switch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #panelContent>\n <ng-content></ng-content>\n</ng-template>",
145
155
  animations: [
146
156
  trigger("cachelessAnimation", [
147
157
  transition(":enter", [style$7({ height: "0" }), animate("200ms linear", style$7({ height: "*" }))]),
@@ -282,6 +292,9 @@ var SwitchComponent = /** @class */ (function () {
282
292
  if (this._onChange) {
283
293
  this._onChange(this.value);
284
294
  }
295
+ if (this._onTouched) {
296
+ this._onTouched(this.value);
297
+ }
285
298
  };
286
299
  var SwitchComponent_1;
287
300
  __decorate([
@@ -750,6 +763,7 @@ var AccordionModule = /** @class */ (function () {
750
763
  imports: [
751
764
  CommonModule,
752
765
  FormsModule,
766
+ ReactiveFormsModule,
753
767
  TooltipModule,
754
768
  SwitchModule,
755
769
  ],