@firestitch/form 12.1.0 → 12.2.0

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
  }
@@ -0,0 +1,13 @@
1
+ import { OnChanges } from '@angular/core';
2
+ import { FsControlDirective } from './control.directive';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * This directive required for cases when we have custom Control like <fs-phone-field> but without any of our validators applied
6
+ *
7
+ * This directive required for automatic validation messages
8
+ */
9
+ export declare class FsFormNoFsValidatorsDirective extends FsControlDirective implements OnChanges {
10
+ ngOnChanges(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<FsFormNoFsValidatorsDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FsFormNoFsValidatorsDirective, "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])", never, {}, {}, never>;
13
+ }
@@ -23,13 +23,14 @@ import * as i20 from "./directives/form-dialog-close.directive";
23
23
  import * as i21 from "./directives/submit-button.directive";
24
24
  import * as i22 from "./directives/validators/validate.directive";
25
25
  import * as i23 from "./components/form-dialog-actions/form-dialog-actions.component";
26
- import * as i24 from "@angular/common";
27
- import * as i25 from "@angular/forms";
28
- import * as i26 from "@angular/material/button";
29
- import * as i27 from "@angular/material/dialog";
26
+ import * as i24 from "./directives/validators/no-fs-validators.directive";
27
+ import * as i25 from "@angular/common";
28
+ import * as i26 from "@angular/forms";
29
+ import * as i27 from "@angular/material/button";
30
+ import * as i28 from "@angular/material/dialog";
30
31
  export declare class FsFormModule {
31
32
  static forRoot(): ModuleWithProviders<FsFormModule>;
32
33
  static ɵfac: i0.ɵɵFactoryDeclaration<FsFormModule, never>;
33
- static ɵmod: i0.ɵɵNgModuleDeclaration<FsFormModule, [typeof i1.FsFormDirective, typeof i2.FsControlDirective, typeof i3.FsFormRequiredDirective, typeof i4.FsFormMinDirective, typeof i5.FsFormMaxDirective, typeof i6.FsFormMinLengthDirective, typeof i7.FsFormMaxLengthDirective, typeof i8.FsFormEmailDirective, typeof i9.FsFormEmailsDirective, typeof i10.FsFormPhoneDirective, typeof i11.FsFormCompareDirective, typeof i12.FsFormIntegerDirective, typeof i13.FsFormNumericDirective, typeof i14.FsFormPatternDirective, typeof i15.FsFormFunctionDirective, typeof i16.FsFormDateRangeDirective, typeof i17.FsFormGreaterDirective, typeof i18.FsFormLesserDirective, typeof i19.FsFormUrlDirective, typeof i20.FsFormDialogCloseDirective, typeof i21.FsSubmitButtonDirective, typeof i22.FsFormValidateDirective, typeof i23.FsFormDialogActionsComponent], [typeof i24.CommonModule, typeof i25.FormsModule, typeof i26.MatButtonModule, typeof i27.MatDialogModule], [typeof i1.FsFormDirective, typeof i2.FsControlDirective, typeof i3.FsFormRequiredDirective, typeof i4.FsFormMinDirective, typeof i5.FsFormMaxDirective, typeof i6.FsFormMinLengthDirective, typeof i7.FsFormMaxLengthDirective, typeof i8.FsFormEmailDirective, typeof i9.FsFormEmailsDirective, typeof i10.FsFormPhoneDirective, typeof i11.FsFormCompareDirective, typeof i12.FsFormIntegerDirective, typeof i13.FsFormNumericDirective, typeof i14.FsFormPatternDirective, typeof i15.FsFormFunctionDirective, typeof i16.FsFormDateRangeDirective, typeof i17.FsFormGreaterDirective, typeof i18.FsFormLesserDirective, typeof i19.FsFormUrlDirective, typeof i20.FsFormDialogCloseDirective, typeof i21.FsSubmitButtonDirective, typeof i22.FsFormValidateDirective, typeof i23.FsFormDialogActionsComponent]>;
34
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FsFormModule, [typeof i1.FsFormDirective, typeof i2.FsControlDirective, typeof i3.FsFormRequiredDirective, typeof i4.FsFormMinDirective, typeof i5.FsFormMaxDirective, typeof i6.FsFormMinLengthDirective, typeof i7.FsFormMaxLengthDirective, typeof i8.FsFormEmailDirective, typeof i9.FsFormEmailsDirective, typeof i10.FsFormPhoneDirective, typeof i11.FsFormCompareDirective, typeof i12.FsFormIntegerDirective, typeof i13.FsFormNumericDirective, typeof i14.FsFormPatternDirective, typeof i15.FsFormFunctionDirective, typeof i16.FsFormDateRangeDirective, typeof i17.FsFormGreaterDirective, typeof i18.FsFormLesserDirective, typeof i19.FsFormUrlDirective, typeof i20.FsFormDialogCloseDirective, typeof i21.FsSubmitButtonDirective, typeof i22.FsFormValidateDirective, typeof i23.FsFormDialogActionsComponent, typeof i24.FsFormNoFsValidatorsDirective], [typeof i25.CommonModule, typeof i26.FormsModule, typeof i27.MatButtonModule, typeof i28.MatDialogModule], [typeof i1.FsFormDirective, typeof i2.FsControlDirective, typeof i3.FsFormRequiredDirective, typeof i4.FsFormMinDirective, typeof i5.FsFormMaxDirective, typeof i6.FsFormMinLengthDirective, typeof i7.FsFormMaxLengthDirective, typeof i8.FsFormEmailDirective, typeof i9.FsFormEmailsDirective, typeof i10.FsFormPhoneDirective, typeof i11.FsFormCompareDirective, typeof i12.FsFormIntegerDirective, typeof i13.FsFormNumericDirective, typeof i14.FsFormPatternDirective, typeof i15.FsFormFunctionDirective, typeof i16.FsFormDateRangeDirective, typeof i17.FsFormGreaterDirective, typeof i18.FsFormLesserDirective, typeof i19.FsFormUrlDirective, typeof i20.FsFormDialogCloseDirective, typeof i21.FsSubmitButtonDirective, typeof i22.FsFormValidateDirective, typeof i23.FsFormDialogActionsComponent, typeof i24.FsFormNoFsValidatorsDirective]>;
34
35
  static ɵinj: i0.ɵɵInjectorDeclaration<FsFormModule>;
35
36
  }
@@ -2477,6 +2477,7 @@
2477
2477
  this.save = true;
2478
2478
  this.create = false;
2479
2479
  this.close = false;
2480
+ this.closeData = null;
2480
2481
  this.dirty = false;
2481
2482
  this._destroy$ = new rxjs.Subject();
2482
2483
  }
@@ -2509,11 +2510,11 @@
2509
2510
  this._form.triggerConfirm()
2510
2511
  .pipe(operators.filter(function (confirmResult) { return (confirmResult !== exports.ConfirmResult.Review); }), operators.takeUntil(this._destroy$))
2511
2512
  .subscribe(function () {
2512
- _this._dialogRef.close(null);
2513
+ _this._dialogRef.close(_this.closeData);
2513
2514
  });
2514
2515
  }
2515
2516
  else {
2516
- this._dialogRef.close(null);
2517
+ this._dialogRef.close(this.closeData);
2517
2518
  }
2518
2519
  };
2519
2520
  FsFormDialogActionsComponent.prototype.ngOnDestroy = function () {
@@ -2523,7 +2524,7 @@
2523
2524
  return FsFormDialogActionsComponent;
2524
2525
  }());
2525
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 });
2526
- 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 });
2527
2528
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormDialogActionsComponent, decorators: [{
2528
2529
  type: i0.Component,
2529
2530
  args: [{
@@ -2544,10 +2545,60 @@
2544
2545
  type: i0.Input
2545
2546
  }], close: [{
2546
2547
  type: i0.Input
2548
+ }], closeData: [{
2549
+ type: i0.Input
2547
2550
  }], name: [{
2548
2551
  type: i0.Input
2549
2552
  }] } });
2550
2553
 
2554
+ /**
2555
+ * This directive required for cases when we have custom Control like <fs-phone-field> but without any of our validators applied
2556
+ *
2557
+ * This directive required for automatic validation messages
2558
+ */
2559
+ var FsFormNoFsValidatorsDirective = /** @class */ (function (_super) {
2560
+ __extends(FsFormNoFsValidatorsDirective, _super);
2561
+ function FsFormNoFsValidatorsDirective() {
2562
+ return _super !== null && _super.apply(this, arguments) || this;
2563
+ }
2564
+ FsFormNoFsValidatorsDirective.prototype.ngOnChanges = function () {
2565
+ this._control.updateValueAndValidity();
2566
+ };
2567
+ return FsFormNoFsValidatorsDirective;
2568
+ }(FsControlDirective));
2569
+ FsFormNoFsValidatorsDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormNoFsValidatorsDirective, deps: null, target: i0__namespace.ɵɵFactoryTarget.Directive });
2570
+ FsFormNoFsValidatorsDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])", providers: [
2571
+ VALIDATE_MESSAGE_PROVIDER
2572
+ ], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace });
2573
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormNoFsValidatorsDirective, decorators: [{
2574
+ type: i0.Directive,
2575
+ args: [{
2576
+ selector: '[ngModel]' +
2577
+ ':not([required])' +
2578
+ ':not([fsFormRequired])' +
2579
+ ':not([fsFormCompare])' +
2580
+ ':not([fsFormDateRange])' +
2581
+ ':not([fsFormEmail])' +
2582
+ ':not([fsFormEmails])' +
2583
+ ':not([fsFormFunction])' +
2584
+ ':not([fsFormGreater])' +
2585
+ ':not([fsFormInteger])' +
2586
+ ':not([fsFormLesser])' +
2587
+ ':not([fsFormMax])' +
2588
+ ':not([fsFormMaxLength])' +
2589
+ ':not([fsFormMin])' +
2590
+ ':not([fsFormMinLength])' +
2591
+ ':not([fsFormNumeric])' +
2592
+ ':not([fsFormPattern])' +
2593
+ ':not([fsFormPhone])' +
2594
+ ':not([fsFormUrl])' +
2595
+ ':not([validate])',
2596
+ providers: [
2597
+ VALIDATE_MESSAGE_PROVIDER
2598
+ ],
2599
+ }]
2600
+ }] });
2601
+
2551
2602
  var FsFormModule = /** @class */ (function () {
2552
2603
  function FsFormModule() {
2553
2604
  }
@@ -2587,7 +2638,8 @@
2587
2638
  FsFormDialogCloseDirective,
2588
2639
  FsSubmitButtonDirective,
2589
2640
  FsFormValidateDirective,
2590
- FsFormDialogActionsComponent], imports: [i4.CommonModule,
2641
+ FsFormDialogActionsComponent,
2642
+ FsFormNoFsValidatorsDirective], imports: [i4.CommonModule,
2591
2643
  i1.FormsModule,
2592
2644
  i1$1.MatButtonModule,
2593
2645
  i2$1.MatDialogModule], exports: [FsFormDirective,
@@ -2612,7 +2664,8 @@
2612
2664
  FsFormDialogCloseDirective,
2613
2665
  FsSubmitButtonDirective,
2614
2666
  FsFormValidateDirective,
2615
- FsFormDialogActionsComponent] });
2667
+ FsFormDialogActionsComponent,
2668
+ FsFormNoFsValidatorsDirective] });
2616
2669
  FsFormModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormModule, providers: [
2617
2670
  {
2618
2671
  provide: core.ErrorStateMatcher,
@@ -2657,6 +2710,7 @@
2657
2710
  FsSubmitButtonDirective,
2658
2711
  FsFormValidateDirective,
2659
2712
  FsFormDialogActionsComponent,
2713
+ FsFormNoFsValidatorsDirective
2660
2714
  ],
2661
2715
  exports: [
2662
2716
  FsFormDirective,
@@ -2682,6 +2736,7 @@
2682
2736
  FsSubmitButtonDirective,
2683
2737
  FsFormValidateDirective,
2684
2738
  FsFormDialogActionsComponent,
2739
+ FsFormNoFsValidatorsDirective,
2685
2740
  ],
2686
2741
  providers: [
2687
2742
  {
@@ -2749,6 +2804,7 @@
2749
2804
  exports.FsFormMinDirective = FsFormMinDirective;
2750
2805
  exports.FsFormMinLengthDirective = FsFormMinLengthDirective;
2751
2806
  exports.FsFormModule = FsFormModule;
2807
+ exports.FsFormNoFsValidatorsDirective = FsFormNoFsValidatorsDirective;
2752
2808
  exports.FsFormNumericDirective = FsFormNumericDirective;
2753
2809
  exports.FsFormPatternDirective = FsFormPatternDirective;
2754
2810
  exports.FsFormPhoneDirective = FsFormPhoneDirective;