@firestitch/form 12.4.2 → 12.4.3
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/directives/form/form.directive.d.ts +2 -2
- package/bundles/firestitch-form.umd.js +6 -6
- package/bundles/firestitch-form.umd.js.map +1 -1
- package/esm2015/app/directives/form/form.directive.js +6 -6
- package/esm2015/app/helpers/confirm-unsaved.js +2 -2
- package/fesm2015/firestitch-form.js +6 -6
- package/fesm2015/firestitch-form.js.map +1 -1
- package/package.json +1 -1
|
@@ -58,7 +58,7 @@ export declare class FsFormDirective implements OnInit, OnDestroy, AfterContentI
|
|
|
58
58
|
private _activatedRouteConfig;
|
|
59
59
|
private _status$;
|
|
60
60
|
private _destroy$;
|
|
61
|
-
private
|
|
61
|
+
private _confirmed;
|
|
62
62
|
constructor(ngForm: NgForm, _form: FsForm, _element: ElementRef, _message: FsMessage, _prompt: FsPrompt, _ngZone: NgZone, _dialogRef: MatDialogRef<any>, _drawerRef: DrawerRef<any>, _route: ActivatedRoute);
|
|
63
63
|
get submitting(): boolean;
|
|
64
64
|
get validating(): boolean;
|
|
@@ -79,7 +79,7 @@ export declare class FsFormDirective implements OnInit, OnDestroy, AfterContentI
|
|
|
79
79
|
clear(): void;
|
|
80
80
|
dirty(): void;
|
|
81
81
|
triggerSubmit(options?: {
|
|
82
|
-
|
|
82
|
+
confirmed: boolean;
|
|
83
83
|
}): void;
|
|
84
84
|
triggerConfirm(): Observable<ConfirmResult>;
|
|
85
85
|
enable(): void;
|
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
observer.complete();
|
|
420
420
|
});
|
|
421
421
|
form.ngForm.control.markAsPristine();
|
|
422
|
-
form.triggerSubmit({
|
|
422
|
+
form.triggerSubmit({ confirmed: true });
|
|
423
423
|
}
|
|
424
424
|
}, function (error) {
|
|
425
425
|
observer.next(exports.ConfirmResult.Review);
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
this._snapshot = {};
|
|
616
616
|
this._status$ = new rxjs.BehaviorSubject(exports.FormStatus.Valid);
|
|
617
617
|
this._destroy$ = new rxjs.Subject();
|
|
618
|
-
this.
|
|
618
|
+
this._confirmed = false;
|
|
619
619
|
}
|
|
620
620
|
Object.defineProperty(FsFormDirective.prototype, "submitting", {
|
|
621
621
|
get: function () {
|
|
@@ -756,7 +756,7 @@
|
|
|
756
756
|
this._updateDirtySubmitButtons();
|
|
757
757
|
};
|
|
758
758
|
FsFormDirective.prototype.triggerSubmit = function (options) {
|
|
759
|
-
this.
|
|
759
|
+
this._confirmed = options === null || options === void 0 ? void 0 : options.confirmed;
|
|
760
760
|
this.ngForm.ngSubmit.emit();
|
|
761
761
|
};
|
|
762
762
|
FsFormDirective.prototype.triggerConfirm = function () {
|
|
@@ -791,8 +791,8 @@
|
|
|
791
791
|
.pipe(operators.tap(function (event) {
|
|
792
792
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
793
793
|
}), operators.map(function (event) {
|
|
794
|
-
return { event: event,
|
|
795
|
-
}), operators.tap(function () { return _this.
|
|
794
|
+
return { event: event, confirmed: _this._confirmed };
|
|
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
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()
|
|
@@ -801,7 +801,7 @@
|
|
|
801
801
|
return _this._formInvalidState$;
|
|
802
802
|
}
|
|
803
803
|
return _this._formValidState$
|
|
804
|
-
.pipe(operators.map(function (submitEvent) { return (Object.assign(Object.assign({}, submitEvent), {
|
|
804
|
+
.pipe(operators.map(function (submitEvent) { return (Object.assign(Object.assign({}, submitEvent), { confirmed: data.confirmed })); }));
|
|
805
805
|
}), operators.catchError(function (e, source$) {
|
|
806
806
|
_this._handleError(e);
|
|
807
807
|
return source$;
|