ngx-smz-ui 4.11.17 → 4.11.18
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/esm2020/lib/modules/smz-forms/features/form-submit/form-submit.component.mjs +32 -3
- package/fesm2015/ngx-smz-ui.mjs +30 -2
- package/fesm2015/ngx-smz-ui.mjs.map +1 -1
- package/fesm2020/ngx-smz-ui.mjs +30 -2
- package/fesm2020/ngx-smz-ui.mjs.map +1 -1
- package/lib/modules/smz-forms/features/form-submit/form-submit.component.d.ts +9 -1
- package/package.json +1 -1
|
@@ -3,9 +3,16 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
import * as i1 from "../../../smz-ui-block/smz-ui-block.service";
|
|
4
4
|
import * as i2 from "@angular/common";
|
|
5
5
|
import * as i3 from "primeng/button";
|
|
6
|
+
import * as i4 from "@angular/flex-layout/extended";
|
|
6
7
|
export class FormSubmitComponent {
|
|
7
8
|
constructor(uiBlockService) {
|
|
8
9
|
this.uiBlockService = uiBlockService;
|
|
10
|
+
this.unBlockOnSave = true;
|
|
11
|
+
this.useBlockUi = true;
|
|
12
|
+
this.resetStyleClass = 'p-button-rounded p-button-danger p-button-text';
|
|
13
|
+
this.resetIcon = 'pi pi-times';
|
|
14
|
+
this.saveStyleClass = 'p-button-rounded p-button-text';
|
|
15
|
+
this.saveIcon = 'pi pi-check';
|
|
9
16
|
this.save = new EventEmitter();
|
|
10
17
|
}
|
|
11
18
|
ngOnInit() { }
|
|
@@ -21,6 +28,9 @@ export class FormSubmitComponent {
|
|
|
21
28
|
setTimeout(() => {
|
|
22
29
|
this.hook = this.form.statusChanges.subscribe((event) => {
|
|
23
30
|
this.response = event;
|
|
31
|
+
if (!this.useBlockUi) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
24
34
|
if (event.hasUnsavedChanges) {
|
|
25
35
|
this.uiBlockService.blockAll();
|
|
26
36
|
}
|
|
@@ -37,6 +47,9 @@ export class FormSubmitComponent {
|
|
|
37
47
|
submitSave() {
|
|
38
48
|
setTimeout(() => {
|
|
39
49
|
this.save.emit(this.response?.data);
|
|
50
|
+
if (this.useBlockUi && this.unBlockOnSave) {
|
|
51
|
+
this.uiBlockService.unBlockAll();
|
|
52
|
+
}
|
|
40
53
|
}, 0);
|
|
41
54
|
}
|
|
42
55
|
cancel() {
|
|
@@ -47,13 +60,29 @@ export class FormSubmitComponent {
|
|
|
47
60
|
}
|
|
48
61
|
}
|
|
49
62
|
FormSubmitComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormSubmitComponent, deps: [{ token: i1.SmzUiBlockService }], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
FormSubmitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormSubmitComponent, selector: "smz-ui-form-submit", inputs: { form: "form" }, outputs: { save: "save" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" icon=\"
|
|
63
|
+
FormSubmitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormSubmitComponent, selector: "smz-ui-form-submit", inputs: { form: "form", unBlockOnSave: "unBlockOnSave", useBlockUi: "useBlockUi", resetLabel: "resetLabel", resetStyleClass: "resetStyleClass", resetIcon: "resetIcon", saveLabel: "saveLabel", saveStyleClass: "saveStyleClass", saveIcon: "saveIcon" }, outputs: { save: "save" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" [icon]=\"saveIcon\" [ngClass]=\"saveStyleClass\" [disabled]=\"!response.isValid || !response.hasUnsavedChanges\" (click)=\"submitSave()\" [label]=\"saveLabel\"></button>\r\n <button pButton pRipple type=\"button\" [icon]=\"resetIcon\" [ngClass]=\"resetStyleClass\" [disabled]=\"!response.hasUnsavedChanges\" (click)=\"cancel()\" [label]=\"resetLabel\"></button>\r\n </div>\r\n</ng-container>", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }] });
|
|
51
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormSubmitComponent, decorators: [{
|
|
52
65
|
type: Component,
|
|
53
|
-
args: [{ selector: 'smz-ui-form-submit', template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" icon=\"
|
|
66
|
+
args: [{ selector: 'smz-ui-form-submit', template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" [icon]=\"saveIcon\" [ngClass]=\"saveStyleClass\" [disabled]=\"!response.isValid || !response.hasUnsavedChanges\" (click)=\"submitSave()\" [label]=\"saveLabel\"></button>\r\n <button pButton pRipple type=\"button\" [icon]=\"resetIcon\" [ngClass]=\"resetStyleClass\" [disabled]=\"!response.hasUnsavedChanges\" (click)=\"cancel()\" [label]=\"resetLabel\"></button>\r\n </div>\r\n</ng-container>" }]
|
|
54
67
|
}], ctorParameters: function () { return [{ type: i1.SmzUiBlockService }]; }, propDecorators: { form: [{
|
|
55
68
|
type: Input
|
|
69
|
+
}], unBlockOnSave: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}], useBlockUi: [{
|
|
72
|
+
type: Input
|
|
73
|
+
}], resetLabel: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}], resetStyleClass: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], resetIcon: [{
|
|
78
|
+
type: Input
|
|
79
|
+
}], saveLabel: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], saveStyleClass: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], saveIcon: [{
|
|
84
|
+
type: Input
|
|
56
85
|
}], save: [{
|
|
57
86
|
type: Output
|
|
58
87
|
}] } });
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1zdWJtaXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNtei11aS9zcmMvbGliL21vZHVsZXMvc216LWZvcm1zL2ZlYXR1cmVzL2Zvcm0tc3VibWl0L2Zvcm0tc3VibWl0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zbXotdWkvc3JjL2xpYi9tb2R1bGVzL3Ntei1mb3Jtcy9mZWF0dXJlcy9mb3JtLXN1Ym1pdC9mb3JtLXN1Ym1pdC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFL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ngImpo
|
|
|
4892
4892
|
class FormSubmitComponent {
|
|
4893
4893
|
constructor(uiBlockService) {
|
|
4894
4894
|
this.uiBlockService = uiBlockService;
|
|
4895
|
+
this.unBlockOnSave = true;
|
|
4896
|
+
this.useBlockUi = true;
|
|
4897
|
+
this.resetStyleClass = 'p-button-rounded p-button-danger p-button-text';
|
|
4898
|
+
this.resetIcon = 'pi pi-times';
|
|
4899
|
+
this.saveStyleClass = 'p-button-rounded p-button-text';
|
|
4900
|
+
this.saveIcon = 'pi pi-check';
|
|
4895
4901
|
this.save = new EventEmitter();
|
|
4896
4902
|
}
|
|
4897
4903
|
ngOnInit() { }
|
|
@@ -4907,6 +4913,9 @@ class FormSubmitComponent {
|
|
|
4907
4913
|
setTimeout(() => {
|
|
4908
4914
|
this.hook = this.form.statusChanges.subscribe((event) => {
|
|
4909
4915
|
this.response = event;
|
|
4916
|
+
if (!this.useBlockUi) {
|
|
4917
|
+
return;
|
|
4918
|
+
}
|
|
4910
4919
|
if (event.hasUnsavedChanges) {
|
|
4911
4920
|
this.uiBlockService.blockAll();
|
|
4912
4921
|
}
|
|
@@ -4925,6 +4934,9 @@ class FormSubmitComponent {
|
|
|
4925
4934
|
setTimeout(() => {
|
|
4926
4935
|
var _a;
|
|
4927
4936
|
this.save.emit((_a = this.response) === null || _a === void 0 ? void 0 : _a.data);
|
|
4937
|
+
if (this.useBlockUi && this.unBlockOnSave) {
|
|
4938
|
+
this.uiBlockService.unBlockAll();
|
|
4939
|
+
}
|
|
4928
4940
|
}, 0);
|
|
4929
4941
|
}
|
|
4930
4942
|
cancel() {
|
|
@@ -4935,12 +4947,28 @@ class FormSubmitComponent {
|
|
|
4935
4947
|
}
|
|
4936
4948
|
}
|
|
4937
4949
|
FormSubmitComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormSubmitComponent, deps: [{ token: SmzUiBlockService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4938
|
-
FormSubmitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormSubmitComponent, selector: "smz-ui-form-submit", inputs: { form: "form" }, outputs: { save: "save" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" icon=\"
|
|
4950
|
+
FormSubmitComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormSubmitComponent, selector: "smz-ui-form-submit", inputs: { form: "form", unBlockOnSave: "unBlockOnSave", useBlockUi: "useBlockUi", resetLabel: "resetLabel", resetStyleClass: "resetStyleClass", resetIcon: "resetIcon", saveLabel: "saveLabel", saveStyleClass: "saveStyleClass", saveIcon: "saveIcon" }, outputs: { save: "save" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" [icon]=\"saveIcon\" [ngClass]=\"saveStyleClass\" [disabled]=\"!response.isValid || !response.hasUnsavedChanges\" (click)=\"submitSave()\" [label]=\"saveLabel\"></button>\r\n <button pButton pRipple type=\"button\" [icon]=\"resetIcon\" [ngClass]=\"resetStyleClass\" [disabled]=\"!response.hasUnsavedChanges\" (click)=\"cancel()\" [label]=\"resetLabel\"></button>\r\n </div>\r\n</ng-container>", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }] });
|
|
4939
4951
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormSubmitComponent, decorators: [{
|
|
4940
4952
|
type: Component,
|
|
4941
|
-
args: [{ selector: 'smz-ui-form-submit', template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" icon=\"
|
|
4953
|
+
args: [{ selector: 'smz-ui-form-submit', template: "<ng-container *ngIf=\"form != null && response != null\">\r\n <div class=\"grid grid-nogutter items-center justify-start gap-2\">\r\n <button pButton pRipple type=\"button\" [icon]=\"saveIcon\" [ngClass]=\"saveStyleClass\" [disabled]=\"!response.isValid || !response.hasUnsavedChanges\" (click)=\"submitSave()\" [label]=\"saveLabel\"></button>\r\n <button pButton pRipple type=\"button\" [icon]=\"resetIcon\" [ngClass]=\"resetStyleClass\" [disabled]=\"!response.hasUnsavedChanges\" (click)=\"cancel()\" [label]=\"resetLabel\"></button>\r\n </div>\r\n</ng-container>" }]
|
|
4942
4954
|
}], ctorParameters: function () { return [{ type: SmzUiBlockService }]; }, propDecorators: { form: [{
|
|
4943
4955
|
type: Input
|
|
4956
|
+
}], unBlockOnSave: [{
|
|
4957
|
+
type: Input
|
|
4958
|
+
}], useBlockUi: [{
|
|
4959
|
+
type: Input
|
|
4960
|
+
}], resetLabel: [{
|
|
4961
|
+
type: Input
|
|
4962
|
+
}], resetStyleClass: [{
|
|
4963
|
+
type: Input
|
|
4964
|
+
}], resetIcon: [{
|
|
4965
|
+
type: Input
|
|
4966
|
+
}], saveLabel: [{
|
|
4967
|
+
type: Input
|
|
4968
|
+
}], saveStyleClass: [{
|
|
4969
|
+
type: Input
|
|
4970
|
+
}], saveIcon: [{
|
|
4971
|
+
type: Input
|
|
4944
4972
|
}], save: [{
|
|
4945
4973
|
type: Output
|
|
4946
4974
|
}] } });
|