@firestitch/form 9.6.4 → 9.6.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.
@@ -831,7 +831,8 @@ var FsFormDirective = /** @class */ (function () {
831
831
  this._form.broadcast('submit', this.ngForm);
832
832
  };
833
833
  FsFormDirective.prototype._markControlsAsTouchedAndUpdateValidity = function () {
834
- Object.values(this.ngForm.controls).forEach(function (control) {
834
+ Object.values(this.ngForm.controls)
835
+ .forEach(function (control) {
835
836
  control.markAsDirty();
836
837
  control.markAsTouched();
837
838
  control.updateValueAndValidity();
@@ -2170,21 +2171,28 @@ var FsFormDialogActionsComponent = /** @class */ (function () {
2170
2171
  this._form = _form;
2171
2172
  this._cdRef = _cdRef;
2172
2173
  this.create = false;
2174
+ this.dirty = false;
2175
+ this._destroy$ = new Subject();
2173
2176
  }
2174
2177
  FsFormDialogActionsComponent.prototype.ngOnInit = function () {
2175
2178
  var _this = this;
2176
- this._form.ngForm.statusChanges
2179
+ this._form.ngForm.valueChanges
2180
+ .pipe(filter(function () { return (!_this.dirty); }), takeUntil(this._destroy$))
2177
2181
  .subscribe(function () {
2182
+ _this.dirty = _this._form.ngForm.dirty;
2183
+ _this._cdRef.markForCheck();
2184
+ });
2185
+ this._form.submitted
2186
+ .pipe(takeUntil(this._destroy$))
2187
+ .subscribe(function () {
2188
+ _this.dirty = false;
2178
2189
  _this._cdRef.markForCheck();
2179
2190
  });
2180
2191
  };
2181
- Object.defineProperty(FsFormDialogActionsComponent.prototype, "dirty", {
2182
- get: function () {
2183
- return this._form.ngForm.dirty;
2184
- },
2185
- enumerable: true,
2186
- configurable: true
2187
- });
2192
+ FsFormDialogActionsComponent.prototype.ngOnDestroy = function () {
2193
+ this._destroy$.next();
2194
+ this._destroy$.complete();
2195
+ };
2188
2196
  FsFormDialogActionsComponent.ctorParameters = function () { return [
2189
2197
  { type: FsFormDirective, decorators: [{ type: Optional }] },
2190
2198
  { type: ChangeDetectorRef }