@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.
- package/app/components/form-dialog-actions/form-dialog-actions.component.d.ts +5 -3
- package/bundles/firestitch-form.umd.js +17 -9
- package/bundles/firestitch-form.umd.js.map +1 -1
- package/bundles/firestitch-form.umd.min.js +1 -1
- package/bundles/firestitch-form.umd.min.js.map +1 -1
- package/esm2015/app/components/form-dialog-actions/form-dialog-actions.component.js +18 -5
- package/esm2015/app/directives/form/form.directive.js +3 -2
- package/esm5/app/components/form-dialog-actions/form-dialog-actions.component.js +19 -10
- package/esm5/app/directives/form/form.directive.js +3 -2
- package/fesm2015/firestitch-form.js +16 -4
- package/fesm2015/firestitch-form.js.map +1 -1
- package/fesm5/firestitch-form.js +17 -9
- package/fesm5/firestitch-form.js.map +1 -1
- package/firestitch-form.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/firestitch-form.js
CHANGED
|
@@ -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)
|
|
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.
|
|
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
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
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 }
|