@firestitch/form 12.4.3 → 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.
- package/app/components/form-dialog-actions/form-dialog-actions.component.d.ts +2 -1
- package/app/directives/form/form.directive.d.ts +1 -1
- package/bundles/firestitch-form.umd.js +13 -10
- package/bundles/firestitch-form.umd.js.map +1 -1
- package/esm2015/app/components/form-dialog-actions/form-dialog-actions.component.js +5 -2
- package/esm2015/app/directives/form/form.directive.js +10 -10
- package/fesm2015/firestitch-form.js +13 -10
- package/fesm2015/firestitch-form.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export declare class FsFormDialogActionsComponent implements OnInit, OnDestroy {
|
|
|
9
9
|
save: boolean;
|
|
10
10
|
create: boolean;
|
|
11
11
|
close: boolean;
|
|
12
|
+
done: boolean;
|
|
12
13
|
closeData: any;
|
|
13
14
|
name: string;
|
|
14
15
|
dirty: boolean;
|
|
@@ -18,5 +19,5 @@ export declare class FsFormDialogActionsComponent implements OnInit, OnDestroy {
|
|
|
18
19
|
closeClick(): void;
|
|
19
20
|
ngOnDestroy(): void;
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<FsFormDialogActionsComponent, [{ optional: true; }, { optional: true; }, null]>;
|
|
21
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FsFormDialogActionsComponent, "fs-form-dialog-actions", never, { "save": "save"; "create": "create"; "close": "close"; "closeData": "closeData"; "name": "name"; }, {}, never, ["*"]>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FsFormDialogActionsComponent, "fs-form-dialog-actions", never, { "save": "save"; "create": "create"; "close": "close"; "done": "done"; "closeData": "closeData"; "name": "name"; }, {}, never, ["*"]>;
|
|
22
23
|
}
|
|
@@ -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.
|
|
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();
|
|
@@ -2641,6 +2641,7 @@
|
|
|
2641
2641
|
this.save = true;
|
|
2642
2642
|
this.create = false;
|
|
2643
2643
|
this.close = false;
|
|
2644
|
+
this.done = false;
|
|
2644
2645
|
this.closeData = null;
|
|
2645
2646
|
this.dirty = false;
|
|
2646
2647
|
this._destroy$ = new rxjs.Subject();
|
|
@@ -2688,7 +2689,7 @@
|
|
|
2688
2689
|
return FsFormDialogActionsComponent;
|
|
2689
2690
|
}());
|
|
2690
2691
|
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 });
|
|
2691
|
-
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\" [ngClass]=\"{ 'save-create': save || create }\">\n <ng-container *ngIf=\"save\">\n <button\n mat-button\n type=\"submit\"\n color=\"primary\"\n [name]=\"name\">\n {{create ? 'Create' : 'Save'}}\n </button>\n <button\n mat-button\n type=\"button\"\n [disabled]=\"close && !dirty && !create\"\n [matDialogClose]=\"null\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"save || create\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n\n <div class=\"close\" *ngIf=\"close\">\n <button\n mat-button\n type=\"button\"\n [color]=\"dirty ? 'basic' : 'primary'\"\n (click)=\"closeClick()\">\n Close\n </button>\n </div>\n\n <ng-container *ngIf=\"!(save || create)\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n</div>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons.save-create .close{display:flex;flex-grow:1;justify-content:flex-end}
|
|
2692
|
+
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", done: "done", closeData: "closeData", name: "name" }, ngImport: i0__namespace, template: "<div class=\"buttons\" [ngClass]=\"{ 'save-create': save || create }\">\n <ng-container *ngIf=\"save\">\n <button\n mat-button\n type=\"submit\"\n color=\"primary\"\n [name]=\"name\">\n {{create ? 'Create' : 'Save'}}\n </button>\n <button\n mat-button\n type=\"button\"\n [disabled]=\"close && !dirty && !create\"\n [matDialogClose]=\"null\">\n Cancel\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"done\">\n <button\n mat-button\n type=\"button\"\n color=\"primary\"\n [matDialogClose]=\"null\">\n Done\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"save || create\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n\n <div class=\"close\" *ngIf=\"close\">\n <button\n mat-button\n type=\"button\"\n [color]=\"dirty ? 'basic' : 'primary'\"\n (click)=\"closeClick()\">\n Close\n </button>\n </div>\n\n <ng-container *ngIf=\"!(save || create)\">\n <ng-template [ngTemplateOutlet]=\"content\"></ng-template>\n </ng-container>\n</div>\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n", styles: [".buttons{display:flex;flex-grow:1;align-items:center}.buttons.save-create .close{display:flex;flex-grow:1;justify-content:flex-end}@media only screen and (max-width: 599px){.buttons{flex-direction:column}}\n"], components: [{ type: i1__namespace$2.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.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit"] }, { type: i2__namespace$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["type", "mat-dialog-close", "aria-label", "matDialogClose"], exportAs: ["matDialogClose"] }, { type: i4__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2692
2693
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsFormDialogActionsComponent, decorators: [{
|
|
2693
2694
|
type: i0.Component,
|
|
2694
2695
|
args: [{
|
|
@@ -2709,6 +2710,8 @@
|
|
|
2709
2710
|
type: i0.Input
|
|
2710
2711
|
}], close: [{
|
|
2711
2712
|
type: i0.Input
|
|
2713
|
+
}], done: [{
|
|
2714
|
+
type: i0.Input
|
|
2712
2715
|
}], closeData: [{
|
|
2713
2716
|
type: i0.Input
|
|
2714
2717
|
}], name: [{
|