@firestitch/form 12.4.4 → 12.4.5

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.
@@ -87,6 +87,7 @@ export declare class FsFormDirective implements OnInit, OnDestroy, AfterContentI
87
87
  addButton(button: FsButtonDirective): void;
88
88
  removeButton(button: FsButtonDirective): void;
89
89
  private _listenSubmit;
90
+ validate(): void;
90
91
  private _listenFormStatus;
91
92
  private _listenWindowClose;
92
93
  private _listenHotKeys;
@@ -110,7 +111,6 @@ export declare class FsFormDirective implements OnInit, OnDestroy, AfterContentI
110
111
  private _updateDirtySubmitButtons;
111
112
  private _broadcastSubmittingEvents;
112
113
  private _broadcasValidatingEvents;
113
- private _markControlsAsTouchedAndUpdateValidity;
114
114
  private _setupActiveSubmitButton;
115
115
  private _disableButtons;
116
116
  private _waitUntilStatusPending;
@@ -795,7 +795,7 @@
795
795
  }), operators.tap(function () { return _this._confirmed = false; }), operators.filter(function () {
796
796
  return [exports.FormStatus.Valid, exports.FormStatus.Invalid]
797
797
  .includes(_this._status$.getValue());
798
- }), operators.tap(function () { return _this._broadcasValidatingEvents(); }), operators.tap(function () { return _this._markControlsAsTouchedAndUpdateValidity(); }), operators.tap(function () { return _this._broadcastSubmittingEvents(); }), operators.switchMap(function (data) { return _this._waitUntilStatusPending()
798
+ }), operators.tap(function () { return _this._broadcasValidatingEvents(); }), operators.tap(function () { return _this.validate(); }), operators.tap(function () { return _this._broadcastSubmittingEvents(); }), operators.switchMap(function (data) { return _this._waitUntilStatusPending()
799
799
  .pipe(operators.mapTo(data)); }), operators.tap(function () { return _this._setupActiveSubmitButton(); }), operators.tap(function () { return _this._disableButtons(); }), operators.mergeMap(function (data) {
800
800
  if (_this.ngForm.status === 'INVALID') {
801
801
  return _this._formInvalidState$;
@@ -810,6 +810,14 @@
810
810
  }), operators.takeUntil(this._destroy$))
811
811
  .subscribe(function () { });
812
812
  };
813
+ FsFormDirective.prototype.validate = function () {
814
+ Object.values(this.ngForm.controls)
815
+ .forEach(function (control) {
816
+ control.markAsDirty();
817
+ control.markAsTouched();
818
+ control.updateValueAndValidity();
819
+ });
820
+ };
813
821
  FsFormDirective.prototype._listenFormStatus = function () {
814
822
  var _this = this;
815
823
  this._status$
@@ -1153,14 +1161,6 @@
1153
1161
  FsFormDirective.prototype._broadcasValidatingEvents = function () {
1154
1162
  this._status$.next(exports.FormStatus.Validating);
1155
1163
  };
1156
- FsFormDirective.prototype._markControlsAsTouchedAndUpdateValidity = function () {
1157
- Object.values(this.ngForm.controls)
1158
- .forEach(function (control) {
1159
- control.markAsDirty();
1160
- control.markAsTouched();
1161
- control.updateValueAndValidity();
1162
- });
1163
- };
1164
1164
  FsFormDirective.prototype._setupActiveSubmitButton = function () {
1165
1165
  this._activeSubmitButton = this._getActiveSubmitButton();
1166
1166
  this._resetButtons();