@firestitch/form 12.0.3 → 12.1.1

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 FsFormDialogActionsComponent implements OnInit, OnDestroy {
9
9
  save: boolean;
10
10
  create: boolean;
11
11
  close: boolean;
12
+ closeData: any;
12
13
  name: string;
13
14
  dirty: boolean;
14
15
  private _destroy$;
@@ -17,5 +18,5 @@ export declare class FsFormDialogActionsComponent implements OnInit, OnDestroy {
17
18
  closeClick(): void;
18
19
  ngOnDestroy(): void;
19
20
  static ɵfac: i0.ɵɵFactoryDeclaration<FsFormDialogActionsComponent, [{ optional: true; }, { optional: true; }, null]>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<FsFormDialogActionsComponent, "fs-form-dialog-actions", never, { "save": "save"; "create": "create"; "close": "close"; "name": "name"; }, {}, never, ["*"]>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<FsFormDialogActionsComponent, "fs-form-dialog-actions", never, { "save": "save"; "create": "create"; "close": "close"; "closeData": "closeData"; "name": "name"; }, {}, never, ["*"]>;
21
22
  }
@@ -66,6 +66,9 @@ export declare class FsFormDirective implements OnInit, OnDestroy, AfterContentI
66
66
  ngAfterContentInit(): void;
67
67
  ngOnDestroy(): void;
68
68
  createSnapshot(): void;
69
+ getSnapshot(): {
70
+ [key: string]: any;
71
+ };
69
72
  reset(): void;
70
73
  clear(): void;
71
74
  dirty(): void;
@@ -660,6 +660,9 @@
660
660
  FsFormDirective.prototype.createSnapshot = function () {
661
661
  this._snapshot = this.ngForm.value;
662
662
  };
663
+ FsFormDirective.prototype.getSnapshot = function () {
664
+ return this._snapshot || {};
665
+ };
663
666
  FsFormDirective.prototype.reset = function () {
664
667
  var _this = this;
665
668
  this.ngForm.resetForm();
@@ -2384,9 +2387,10 @@
2384
2387
  this._resetClass();
2385
2388
  };
2386
2389
  FsSubmitButtonDirective.prototype.ngOnDestroy = function () {
2390
+ var _a;
2387
2391
  this._destroy$.next();
2388
2392
  this._destroy$.complete();
2389
- this._form.removeSubmitButton(this);
2393
+ (_a = this._form) === null || _a === void 0 ? void 0 : _a.removeSubmitButton(this);
2390
2394
  };
2391
2395
  FsSubmitButtonDirective.prototype._disableShadowAnimation = function () {
2392
2396
  // .mat-elevation-z2 removes the click shadow animation
@@ -2473,6 +2477,7 @@
2473
2477
  this.save = true;
2474
2478
  this.create = false;
2475
2479
  this.close = false;
2480
+ this.closeData = null;
2476
2481
  this.dirty = false;
2477
2482
  this._destroy$ = new rxjs.Subject();
2478
2483
  }
@@ -2505,11 +2510,11 @@
2505
2510
  this._form.triggerConfirm()
2506
2511
  .pipe(operators.filter(function (confirmResult) { return (confirmResult !== exports.ConfirmResult.Review); }), operators.takeUntil(this._destroy$))
2507
2512
  .subscribe(function () {
2508
- _this._dialogRef.close(null);
2513
+ _this._dialogRef.close(_this.closeData);
2509
2514
  });
2510
2515
  }
2511
2516
  else {
2512
- this._dialogRef.close(null);
2517
+ this._dialogRef.close(this.closeData);
2513
2518
  }
2514
2519
  };
2515
2520
  FsFormDialogActionsComponent.prototype.ngOnDestroy = function () {
@@ -2519,7 +2524,7 @@
2519
2524
  return FsFormDialogActionsComponent;
2520
2525
  }());
2521
2526
  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 });
2522
- 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", name: "name" }, ngImport: i0__namespace, template: "<div class=\"buttons\">\r\n <ng-container *ngIf=\"save\">\r\n <button \r\n mat-button \r\n type=\"submit\"\r\n color=\"primary\" \r\n [name]=\"name\">\r\n {{create ? 'Create' : 'Save'}}\r\n </button>\r\n <button \r\n mat-button \r\n type=\"button\"\r\n [disabled]=\"close && !dirty && !create\"\r\n [matDialogClose]=\"null\">\r\n Cancel\r\n </button>\r\n </ng-container>\r\n\r\n <ng-content></ng-content>\r\n <div class=\"close\" *ngIf=\"close\">\r\n <button \r\n mat-button \r\n type=\"button\"\r\n [color]=\"dirty ? 'basic' : 'primary'\"\r\n (click)=\"closeClick()\">\r\n Close\r\n </button>\r\n </div>\r\n</div>", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons .close{display:flex;flex-grow:1;justify-content:flex-end}:host{display:flex;flex-grow:1}@media only screen and (max-width: 599px){.buttons{flex-direction:column}}\n"], components: [{ type: i1__namespace$1.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2527
+ 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", closeData: "closeData", name: "name" }, ngImport: i0__namespace, template: "<div class=\"buttons\">\r\n <ng-container *ngIf=\"save\">\r\n <button \r\n mat-button \r\n type=\"submit\"\r\n color=\"primary\" \r\n [name]=\"name\">\r\n {{create ? 'Create' : 'Save'}}\r\n </button>\r\n <button \r\n mat-button \r\n type=\"button\"\r\n [disabled]=\"close && !dirty && !create\"\r\n [matDialogClose]=\"null\">\r\n Cancel\r\n </button>\r\n </ng-container>\r\n\r\n <ng-content></ng-content>\r\n <div class=\"close\" *ngIf=\"close\">\r\n <button \r\n mat-button \r\n type=\"button\"\r\n [color]=\"dirty ? 'basic' : 'primary'\"\r\n (click)=\"closeClick()\">\r\n Close\r\n </button>\r\n </div>\r\n</div>", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons .close{display:flex;flex-grow:1;justify-content:flex-end}:host{display:flex;flex-grow:1}@media only screen and (max-width: 599px){.buttons{flex-direction:column}}\n"], components: [{ type: i1__namespace$1.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FsSubmitButtonDirective, selector: "button[type=\"submit\"]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
2523
2528
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormDialogActionsComponent, decorators: [{
2524
2529
  type: i0.Component,
2525
2530
  args: [{
@@ -2540,6 +2545,8 @@
2540
2545
  type: i0.Input
2541
2546
  }], close: [{
2542
2547
  type: i0.Input
2548
+ }], closeData: [{
2549
+ type: i0.Input
2543
2550
  }], name: [{
2544
2551
  type: i0.Input
2545
2552
  }] } });