@firestitch/form 12.4.9 → 12.4.11

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.
@@ -9,6 +9,7 @@ export declare class FsButtonDirective implements OnInit, OnDestroy {
9
9
  private _cdRef;
10
10
  name: any;
11
11
  dirtySubmit: boolean;
12
+ form: FsFormDirective;
12
13
  transitionStyle: any;
13
14
  active: boolean;
14
15
  submit: boolean;
@@ -30,5 +31,5 @@ export declare class FsButtonDirective implements OnInit, OnDestroy {
30
31
  private _resetClass;
31
32
  private _getSvg;
32
33
  static ɵfac: i0.ɵɵFactoryDeclaration<FsButtonDirective, [{ optional: true; host: true; }, { optional: true; }, null, null]>;
33
- static ɵdir: i0.ɵɵDirectiveDeclaration<FsButtonDirective, "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", never, { "name": "name"; "dirtySubmit": "dirtySubmit"; }, {}, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FsButtonDirective, "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", never, { "name": "name"; "dirtySubmit": "dirtySubmit"; "form": "form"; }, {}, never>;
34
35
  }
@@ -1359,16 +1359,9 @@
1359
1359
  };
1360
1360
  FsControlDirective.prototype.ngAfterContentInit = function () {
1361
1361
  if (this._control) {
1362
- /*
1363
- Ensure that statusChanges has one subscription per control. Multiple can happen
1364
- when multiple fsForm validation directives are applied to the same element
1365
- */
1366
- if (!this._control.statusChangesSubscribe) {
1367
- this._control.statusChanges
1368
- .pipe(operators.takeUntil(this._destroy$))
1369
- .subscribe(this.render.bind(this));
1370
- this._control.statusChangesSubscribe = true;
1371
- }
1362
+ this._control.statusChanges
1363
+ .pipe(operators.takeUntil(this._destroy$))
1364
+ .subscribe(this.render.bind(this));
1372
1365
  }
1373
1366
  };
1374
1367
  FsControlDirective.prototype.getMessageSelector = function () {
@@ -1437,6 +1430,10 @@
1437
1430
  */
1438
1431
  FsControlDirective.prototype.render = function () {
1439
1432
  var _a, _b;
1433
+ if (this._control.statusChangesSubscribe) {
1434
+ return;
1435
+ }
1436
+ this._control.statusChangesSubscribe = true;
1440
1437
  if (this.ngControl) {
1441
1438
  var renderer = this.renderer2;
1442
1439
  var wrapper = this.getWrapperElement();
@@ -2469,8 +2466,9 @@
2469
2466
  FsButtonDirective.prototype.ngOnInit = function () {
2470
2467
  var _this = this;
2471
2468
  this.submit = this._elementRef.nativeElement.getAttribute('type') === 'submit';
2472
- if (this._form) {
2473
- this._form.addButton(this);
2469
+ this.form = this.form || this._form;
2470
+ if (this.form) {
2471
+ this.form.addButton(this);
2474
2472
  if (this.submit) {
2475
2473
  rxjs.fromEvent(this.element, 'click')
2476
2474
  .pipe(operators.takeUntil(this._destroy$))
@@ -2478,8 +2476,8 @@
2478
2476
  _this.active = true;
2479
2477
  });
2480
2478
  if (this.dirtySubmit) {
2481
- if (this._form.dirtySubmitButton) {
2482
- if (!this._form.ngForm.dirty) {
2479
+ if (this.form.dirtySubmitButton) {
2480
+ if (!this.form.ngForm.dirty) {
2483
2481
  this.disable();
2484
2482
  }
2485
2483
  }
@@ -2557,7 +2555,7 @@
2557
2555
  var _a;
2558
2556
  this._destroy$.next();
2559
2557
  this._destroy$.complete();
2560
- (_a = this._form) === null || _a === void 0 ? void 0 : _a.removeButton(this);
2558
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.removeButton(this);
2561
2559
  };
2562
2560
  FsButtonDirective.prototype._disableShadowAnimation = function () {
2563
2561
  // .mat-elevation-z2 removes the click shadow animation
@@ -2580,7 +2578,7 @@
2580
2578
  return FsButtonDirective;
2581
2579
  }());
2582
2580
  FsButtonDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsButtonDirective, deps: [{ token: i1__namespace$2.MatButton, host: true, optional: true }, { token: FsFormDirective, optional: true }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
2583
- FsButtonDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: { name: "name", dirtySubmit: "dirtySubmit" }, host: { properties: { "style.transition": "this.transitionStyle" } }, ngImport: i0__namespace });
2581
+ FsButtonDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: { name: "name", dirtySubmit: "dirtySubmit", form: "form" }, host: { properties: { "style.transition": "this.transitionStyle" } }, ngImport: i0__namespace });
2584
2582
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsButtonDirective, decorators: [{
2585
2583
  type: i0.Directive,
2586
2584
  args: [{
@@ -2598,6 +2596,8 @@
2598
2596
  type: i0.Input
2599
2597
  }], dirtySubmit: [{
2600
2598
  type: i0.Input
2599
+ }], form: [{
2600
+ type: i0.Input
2601
2601
  }], transitionStyle: [{
2602
2602
  type: i0.HostBinding,
2603
2603
  args: ['style.transition']
@@ -2699,7 +2699,7 @@
2699
2699
  return FsFormDialogActionsComponent;
2700
2700
  }());
2701
2701
  FsFormDialogActionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormDialogActionsComponent, deps: [{ token: FsFormDirective, optional: true }, { token: i2__namespace$1.MatDialogRef, optional: true }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2702
- FsFormDialogActionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: { save: "save", create: "create", close: "close", done: "done", closeData: "closeData", name: "name" }, ngImport: i0__namespace, template: "<div class=\"buttons\" [ngClass]=\"{ 'save-create': save || create }\">\n <ng-container *ngIf=\"save\">\n <button\n mat-button\n type=\"submit\"\n color=\"primary\"\n [name]=\"name\">\n {{create ? 'Create' : 'Save'}}\n </button>\n <button\n mat-button\n type=\"button\"\n [disabled]=\"close && !dirty && !create\"\n [matDialogClose]=\"null\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"done\">\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [matDialogClose]=\"null\">\n Done\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"save || create\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n\n <div class=\"close\" *ngIf=\"close\">\n <button\n mat-button\n type=\"button\"\n [color]=\"dirty ? 'basic' : 'primary'\"\n (click)=\"closeClick()\">\n Close\n </button>\n </div>\n\n <ng-container *ngIf=\"!(save || create)\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n</div>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons.save-create .close{display:flex;flex-grow:1;justify-content:flex-end}@media only screen and (max-width: 599px){.buttons{flex-direction:column}}\n"], components: [{ type: i1__namespace$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2702
+ FsFormDialogActionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: { save: "save", create: "create", close: "close", done: "done", closeData: "closeData", name: "name" }, ngImport: i0__namespace, template: "<div class=\"buttons\" [ngClass]=\"{ 'save-create': save || create }\">\n <ng-container *ngIf=\"save\">\n <button\n mat-button\n type=\"submit\"\n color=\"primary\"\n [name]=\"name\">\n {{create ? 'Create' : 'Save'}}\n </button>\n <button\n mat-button\n type=\"button\"\n [disabled]=\"close && !dirty && !create\"\n [matDialogClose]=\"null\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"done\">\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [matDialogClose]=\"null\">\n Done\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"save || create\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n\n <div class=\"close\" *ngIf=\"close\">\n <button\n mat-button\n type=\"button\"\n [color]=\"dirty ? 'basic' : 'primary'\"\n (click)=\"closeClick()\">\n Close\n </button>\n </div>\n\n <ng-container *ngIf=\"!(save || create)\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n</div>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons.save-create .close{display:flex;flex-grow:1;justify-content:flex-end}@media only screen and (max-width: 599px){.buttons{flex-direction:column}}\n"], components: [{ type: i1__namespace$2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i4__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i2__namespace$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2703
2703
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormDialogActionsComponent, decorators: [{
2704
2704
  type: i0.Component,
2705
2705
  args: [{