imng-kendo-data-entry 4.112.4 → 4.115.2
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/base-data-entry.component.mjs +29 -14
- package/esm2020/lib/data-entry-dialog.component.mjs +9 -5
- package/esm2020/lib/dialog-buttons.directive.mjs +3 -3
- package/esm2020/lib/imng-kendo-data-entry.module.mjs +4 -4
- package/fesm2015/imng-kendo-data-entry.mjs +44 -25
- package/fesm2015/imng-kendo-data-entry.mjs.map +1 -1
- package/fesm2020/imng-kendo-data-entry.mjs +43 -24
- package/fesm2020/imng-kendo-data-entry.mjs.map +1 -1
- package/lib/base-data-entry.component.d.ts +13 -4
- package/lib/data-entry-dialog.component.d.ts +4 -3
- package/package.json +2 -2
|
@@ -21,7 +21,8 @@ export class BaseDataEntryComponent {
|
|
|
21
21
|
this.facade = facade;
|
|
22
22
|
this.width = 800; //NOSONAR
|
|
23
23
|
this.height = 600; //NOSONAR
|
|
24
|
-
this.
|
|
24
|
+
this.MinLengthError = 'minlength';
|
|
25
|
+
this.RequiredError = 'required';
|
|
25
26
|
this.allSubscriptions = new Subscriptions();
|
|
26
27
|
this.addEditForm = new FormGroup({});
|
|
27
28
|
this._submitted$ = new BehaviorSubject(false);
|
|
@@ -31,13 +32,6 @@ export class BaseDataEntryComponent {
|
|
|
31
32
|
get submitted$() {
|
|
32
33
|
return this._submitted$.asObservable();
|
|
33
34
|
}
|
|
34
|
-
// convenience getter for easy access to form fields
|
|
35
|
-
formControl(controlName) {
|
|
36
|
-
return this.addEditForm?.controls[controlName];
|
|
37
|
-
}
|
|
38
|
-
formControlErrors(controlName) {
|
|
39
|
-
return this.addEditForm.controls[controlName].errors;
|
|
40
|
-
}
|
|
41
35
|
ngOnDestroy() {
|
|
42
36
|
this.allSubscriptions.unsubscribeAll();
|
|
43
37
|
}
|
|
@@ -52,20 +46,41 @@ export class BaseDataEntryComponent {
|
|
|
52
46
|
onSubmit() {
|
|
53
47
|
this._submitted$.next(true);
|
|
54
48
|
// stop here if form is invalid
|
|
55
|
-
if (this.
|
|
49
|
+
if (!this.addEditForm.valid) {
|
|
56
50
|
console.error('form validation errors.'); //NOSONAR
|
|
51
|
+
console.error(JSON.stringify(this.getFormErrors())); //NOSONAR
|
|
57
52
|
return;
|
|
58
53
|
}
|
|
59
54
|
this.save();
|
|
60
55
|
this.closeForm();
|
|
61
56
|
}
|
|
62
57
|
isDataInvalid() {
|
|
63
|
-
return this.addEditForm
|
|
58
|
+
return this.addEditForm.invalid;
|
|
59
|
+
}
|
|
60
|
+
// convenience getter for easy access to form fields
|
|
61
|
+
formControl(controlName) {
|
|
62
|
+
return this.addEditForm.controls[controlName];
|
|
63
|
+
}
|
|
64
|
+
formControlErrors(controlName) {
|
|
65
|
+
return this.formControl(controlName)?.errors;
|
|
66
|
+
}
|
|
67
|
+
formMinLengthError(controlName) {
|
|
68
|
+
return this.formControlErrors(controlName)?.[this.MinLengthError];
|
|
69
|
+
}
|
|
70
|
+
getFormErrors() {
|
|
71
|
+
const errors = [];
|
|
72
|
+
for (const control of Object.keys(this.addEditForm.controls)) {
|
|
73
|
+
const error = this.formControlErrors(control);
|
|
74
|
+
if (error) {
|
|
75
|
+
errors.push({ control, error });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return errors;
|
|
64
79
|
}
|
|
65
80
|
}
|
|
66
|
-
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
67
|
-
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
81
|
+
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, deps: [{ token: FACADE }], target: i0.ɵɵFactoryTarget.Directive });
|
|
82
|
+
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: BaseDataEntryComponent, inputs: { width: "width", height: "height" }, ngImport: i0 });
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, decorators: [{
|
|
69
84
|
type: Directive
|
|
70
85
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
71
86
|
type: Inject,
|
|
@@ -75,4 +90,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
75
90
|
}], height: [{
|
|
76
91
|
type: Input
|
|
77
92
|
}] } });
|
|
78
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
93
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS1kYXRhLWVudHJ5LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvaW1uZy1rZW5kby1kYXRhLWVudHJ5L3NyYy9saWIvYmFzZS1kYXRhLWVudHJ5LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULE1BQU0sRUFDTixjQUFjLEVBQ2QsS0FBSyxHQUVOLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBYyxlQUFlLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBcUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUU5RSxPQUFPLEVBQWdCLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDOztBQUU5RCxNQUFNLE1BQU0sR0FBRyxJQUFJLGNBQWMsQ0FDL0Isd0JBQXdCLENBQ3pCLENBQUM7QUFFRjs7Ozs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DialogComponent {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
38
|
-
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.
|
|
37
|
+
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
+
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: DataEntryDialogComponent, selector: "imng-data-entry-dialog[parentComponent]", inputs: { minWidth: "minWidth", width: "width", height: "height", autoFocusedElement: "autoFocusedElement", parentComponent: "parentComponent", saveButtonText: "saveButtonText" }, queries: [{ propertyName: "dialogBtnsTemplate", first: true, predicate: DialogButtonsDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `<kendo-dialog
|
|
39
39
|
[width]="width"
|
|
40
|
+
[minWidth]="minWidth ?? width"
|
|
40
41
|
[height]="height"
|
|
41
42
|
(close)="close()"
|
|
42
43
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -62,12 +63,13 @@ DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
|
|
|
62
63
|
{{ saveButtonText }}
|
|
63
64
|
</button>
|
|
64
65
|
</ng-template>`, isInline: true, components: [{ type: i1.DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }, { type: i1.DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { type: i1.DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, decorators: [{
|
|
66
67
|
type: Component,
|
|
67
68
|
args: [{
|
|
68
69
|
selector: 'imng-data-entry-dialog[parentComponent]',
|
|
69
70
|
template: `<kendo-dialog
|
|
70
71
|
[width]="width"
|
|
72
|
+
[minWidth]="minWidth ?? width"
|
|
71
73
|
[height]="height"
|
|
72
74
|
(close)="close()"
|
|
73
75
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -95,7 +97,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
95
97
|
</ng-template>`,
|
|
96
98
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
97
99
|
}]
|
|
98
|
-
}], propDecorators: {
|
|
100
|
+
}], propDecorators: { minWidth: [{
|
|
101
|
+
type: Input
|
|
102
|
+
}], width: [{
|
|
99
103
|
type: Input
|
|
100
104
|
}], height: [{
|
|
101
105
|
type: Input
|
|
@@ -109,4 +113,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
109
113
|
type: ContentChild,
|
|
110
114
|
args: [DialogButtonsDirective, { static: true, read: TemplateRef }]
|
|
111
115
|
}] } });
|
|
112
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
116
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YS1lbnRyeS1kaWFsb2cuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4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+IHRoaXMuc3VibWl0KCkgfSxcbiAgICB9O1xuICB9XG59XG4iXX0=
|
|
@@ -5,9 +5,9 @@ export class DialogButtonsDirective {
|
|
|
5
5
|
this.tpl = tpl;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
9
|
-
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
10
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
8
|
+
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
9
|
+
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: DialogButtonsDirective, selector: "[imngDialogBtns]", ngImport: i0 });
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, decorators: [{
|
|
11
11
|
type: Directive,
|
|
12
12
|
args: [{ selector: '[imngDialogBtns]' }]
|
|
13
13
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
@@ -6,10 +6,10 @@ import { DialogModule } from '@progress/kendo-angular-dialog';
|
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export class ImngDataEntryDialogModule {
|
|
8
8
|
}
|
|
9
|
-
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
10
|
-
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.
|
|
11
|
-
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.
|
|
12
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
9
|
+
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
10
|
+
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, declarations: [DataEntryDialogComponent, DialogButtonsDirective], imports: [CommonModule, DialogModule], exports: [DataEntryDialogComponent, DialogButtonsDirective] });
|
|
11
|
+
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, imports: [[CommonModule, DialogModule]] });
|
|
12
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, decorators: [{
|
|
13
13
|
type: NgModule,
|
|
14
14
|
args: [{
|
|
15
15
|
imports: [CommonModule, DialogModule],
|
|
@@ -14,9 +14,9 @@ class DialogButtonsDirective {
|
|
|
14
14
|
this.tpl = tpl;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
18
|
-
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
17
|
+
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
18
|
+
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: DialogButtonsDirective, selector: "[imngDialogBtns]", ngImport: i0 });
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, decorators: [{
|
|
20
20
|
type: Directive,
|
|
21
21
|
args: [{ selector: '[imngDialogBtns]' }]
|
|
22
22
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
@@ -54,9 +54,10 @@ class DataEntryDialogComponent {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
58
|
-
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.
|
|
57
|
+
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
58
|
+
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: DataEntryDialogComponent, selector: "imng-data-entry-dialog[parentComponent]", inputs: { minWidth: "minWidth", width: "width", height: "height", autoFocusedElement: "autoFocusedElement", parentComponent: "parentComponent", saveButtonText: "saveButtonText" }, queries: [{ propertyName: "dialogBtnsTemplate", first: true, predicate: DialogButtonsDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `<kendo-dialog
|
|
59
59
|
[width]="width"
|
|
60
|
+
[minWidth]="minWidth ?? width"
|
|
60
61
|
[height]="height"
|
|
61
62
|
(close)="close()"
|
|
62
63
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -82,12 +83,13 @@ DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
|
|
|
82
83
|
{{ saveButtonText }}
|
|
83
84
|
</button>
|
|
84
85
|
</ng-template>`, isInline: true, components: [{ type: i1.DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }, { type: i1.DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { type: i1.DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
85
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, decorators: [{
|
|
86
87
|
type: Component,
|
|
87
88
|
args: [{
|
|
88
89
|
selector: 'imng-data-entry-dialog[parentComponent]',
|
|
89
90
|
template: `<kendo-dialog
|
|
90
91
|
[width]="width"
|
|
92
|
+
[minWidth]="minWidth ?? width"
|
|
91
93
|
[height]="height"
|
|
92
94
|
(close)="close()"
|
|
93
95
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -115,7 +117,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
115
117
|
</ng-template>`,
|
|
116
118
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
117
119
|
}]
|
|
118
|
-
}], propDecorators: {
|
|
120
|
+
}], propDecorators: { minWidth: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], width: [{
|
|
119
123
|
type: Input
|
|
120
124
|
}], height: [{
|
|
121
125
|
type: Input
|
|
@@ -132,10 +136,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
132
136
|
|
|
133
137
|
class ImngDataEntryDialogModule {
|
|
134
138
|
}
|
|
135
|
-
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
136
|
-
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.
|
|
137
|
-
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
139
|
+
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
140
|
+
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, declarations: [DataEntryDialogComponent, DialogButtonsDirective], imports: [CommonModule, DialogModule], exports: [DataEntryDialogComponent, DialogButtonsDirective] });
|
|
141
|
+
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, imports: [[CommonModule, DialogModule]] });
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, decorators: [{
|
|
139
143
|
type: NgModule,
|
|
140
144
|
args: [{
|
|
141
145
|
imports: [CommonModule, DialogModule],
|
|
@@ -162,7 +166,8 @@ class BaseDataEntryComponent {
|
|
|
162
166
|
this.facade = facade;
|
|
163
167
|
this.width = 800; //NOSONAR
|
|
164
168
|
this.height = 600; //NOSONAR
|
|
165
|
-
this.
|
|
169
|
+
this.MinLengthError = 'minlength';
|
|
170
|
+
this.RequiredError = 'required';
|
|
166
171
|
this.allSubscriptions = new Subscriptions();
|
|
167
172
|
this.addEditForm = new FormGroup({});
|
|
168
173
|
this._submitted$ = new BehaviorSubject(false);
|
|
@@ -172,14 +177,6 @@ class BaseDataEntryComponent {
|
|
|
172
177
|
get submitted$() {
|
|
173
178
|
return this._submitted$.asObservable();
|
|
174
179
|
}
|
|
175
|
-
// convenience getter for easy access to form fields
|
|
176
|
-
formControl(controlName) {
|
|
177
|
-
var _a;
|
|
178
|
-
return (_a = this.addEditForm) === null || _a === void 0 ? void 0 : _a.controls[controlName];
|
|
179
|
-
}
|
|
180
|
-
formControlErrors(controlName) {
|
|
181
|
-
return this.addEditForm.controls[controlName].errors;
|
|
182
|
-
}
|
|
183
180
|
ngOnDestroy() {
|
|
184
181
|
this.allSubscriptions.unsubscribeAll();
|
|
185
182
|
}
|
|
@@ -194,21 +191,43 @@ class BaseDataEntryComponent {
|
|
|
194
191
|
onSubmit() {
|
|
195
192
|
this._submitted$.next(true);
|
|
196
193
|
// stop here if form is invalid
|
|
197
|
-
if (this.
|
|
194
|
+
if (!this.addEditForm.valid) {
|
|
198
195
|
console.error('form validation errors.'); //NOSONAR
|
|
196
|
+
console.error(JSON.stringify(this.getFormErrors())); //NOSONAR
|
|
199
197
|
return;
|
|
200
198
|
}
|
|
201
199
|
this.save();
|
|
202
200
|
this.closeForm();
|
|
203
201
|
}
|
|
204
202
|
isDataInvalid() {
|
|
203
|
+
return this.addEditForm.invalid;
|
|
204
|
+
}
|
|
205
|
+
// convenience getter for easy access to form fields
|
|
206
|
+
formControl(controlName) {
|
|
207
|
+
return this.addEditForm.controls[controlName];
|
|
208
|
+
}
|
|
209
|
+
formControlErrors(controlName) {
|
|
205
210
|
var _a;
|
|
206
|
-
return (_a = this.
|
|
211
|
+
return (_a = this.formControl(controlName)) === null || _a === void 0 ? void 0 : _a.errors;
|
|
212
|
+
}
|
|
213
|
+
formMinLengthError(controlName) {
|
|
214
|
+
var _a;
|
|
215
|
+
return (_a = this.formControlErrors(controlName)) === null || _a === void 0 ? void 0 : _a[this.MinLengthError];
|
|
216
|
+
}
|
|
217
|
+
getFormErrors() {
|
|
218
|
+
const errors = [];
|
|
219
|
+
for (const control of Object.keys(this.addEditForm.controls)) {
|
|
220
|
+
const error = this.formControlErrors(control);
|
|
221
|
+
if (error) {
|
|
222
|
+
errors.push({ control, error });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return errors;
|
|
207
226
|
}
|
|
208
227
|
}
|
|
209
|
-
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
210
|
-
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
228
|
+
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, deps: [{ token: FACADE }], target: i0.ɵɵFactoryTarget.Directive });
|
|
229
|
+
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: BaseDataEntryComponent, inputs: { width: "width", height: "height" }, ngImport: i0 });
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, decorators: [{
|
|
212
231
|
type: Directive
|
|
213
232
|
}], ctorParameters: function () {
|
|
214
233
|
return [{ type: undefined, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imng-kendo-data-entry.mjs","sources":["../../../../libs/imng-kendo-data-entry/src/lib/dialog-buttons.directive.ts","../../../../libs/imng-kendo-data-entry/src/lib/data-entry-dialog.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/imng-kendo-data-entry.module.ts","../../../../libs/imng-kendo-data-entry/src/lib/base-data-entry.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/reducer-collection-logic.ts","../../../../libs/imng-kendo-data-entry/src/lib/form-group-patcher.ts","../../../../libs/imng-kendo-data-entry/src/imng-kendo-data-entry.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({ selector: '[imngDialogBtns]' })\nexport class DialogButtonsDirective {\n constructor(public tpl: TemplateRef<unknown>) { }\n}\n","import {\n Component,\n OnInit,\n Input,\n ChangeDetectionStrategy,\n TemplateRef,\n ContentChild,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { BaseDataEntryComponent } from './base-data-entry.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\n\n@Component({\n selector: 'imng-data-entry-dialog[parentComponent]',\n template: `<kendo-dialog\n [width]=\"width\"\n [height]=\"height\"\n (close)=\"close()\"\n [autoFocusedElement]=\"autoFocusedElement || ''\"\n >\n <kendo-dialog-titlebar class=\"bg-primary\">{{\n dialogTitle\n }}</kendo-dialog-titlebar>\n <ng-content></ng-content>\n <kendo-dialog-actions>\n <ng-container\n *ngTemplateOutlet=\"\n dialogBtnsTemplate || defaultDialogActionsTpl;\n context: dialogActionBtnsCtx\n \"\n >\n </ng-container>\n </kendo-dialog-actions>\n </kendo-dialog>\n\n <ng-template #defaultDialogActionsTpl>\n <button kendoButton (click)=\"cancel()\" class=\"btn btn-secondary btn-sm\">Cancel</button>\n <button kendoButton (click)=\"submit()\" class=\"btn btn-primary btn-sm\">\n {{ saveButtonText }}\n </button>\n </ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataEntryDialogComponent implements OnInit {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n /**\n * https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/\n */\n @Input() public autoFocusedElement?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() public parentComponent?: BaseDataEntryComponent<any>; //NOSONAR\n @Input() public saveButtonText = 'Save';\n @ContentChild(DialogButtonsDirective, { static: true, read: TemplateRef })\n /**\n * Example Usage:\n * <imng-data-entry-dialog>\n * ......\n * <ng-template [imngDialogBtns] let-coreButtons>\n * <button id=\"btnCustom1\" class=\"k-button\" (click)=\"cancel()\">Close</button>\n * </ng-template>\n * </imng-data-entry-dialog>\n */\n public dialogBtnsTemplate?: TemplateRef<unknown>;\n public loading$?: Observable<boolean>;\n public addEditForm?: FormGroup;\n public submitted = false;\n public dialogTitle?: string;\n // eslint-disable-next-line @typescript-eslint/ban-types\n public component?: {};\n\n public ngOnInit(): void {\n if (!this.parentComponent) {\n throw new TypeError(`The input 'parentComponent' is required`);\n }\n this.dialogTitle = this.parentComponent.dialogTitle;\n this.loading$ = this.parentComponent.loading$;\n this.addEditForm = this.parentComponent.addEditForm;\n }\n\n public close(): void {\n this.parentComponent?.closeForm();\n }\n public cancel(): void {\n this.parentComponent?.onCancel();\n }\n public submit(): void {\n this.parentComponent?.onSubmit();\n }\n get dialogActionBtnsCtx(): object | null { //NOSONAR\n return {\n $implicit: { cancel: () => this.cancel(), submit: () => this.submit() },\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DataEntryDialogComponent } from './data-entry-dialog.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\nimport { DialogModule } from '@progress/kendo-angular-dialog';\n\n@NgModule({\n imports: [CommonModule, DialogModule],\n declarations: [DataEntryDialogComponent, DialogButtonsDirective],\n exports: [DataEntryDialogComponent, DialogButtonsDirective],\n})\nexport class ImngDataEntryDialogModule {}\n","import {\n Directive,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n} from '@angular/core';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { FormGroup, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { IBaseDataEntryFacade } from './data-entry-facade';\nimport { Subscribable, Subscriptions } from 'imng-ngrx-utils';\n\nconst FACADE = new InjectionToken<IBaseDataEntryFacade>(\n 'imng-data-entry-facade'\n);\n\n/**\n * The extending class has to implement the following properties on ngInit\n * dialogTitle: string - This will be the text displayed at the top of the modal title bar\n * props: enum - This is a helper property to make the html markup type safe\n *\n * Along with the requirements above, the extending class has to set values to the\n * following properties on ngInit\n * active$: Observable<boolean> - This typically would be assigned to the isNewActive$ or isEditActive on the facade\n * addEditForm: FormGroup - This will be created by your component\n *\n * @class BaseDataEntryComponent>\n */\n@Directive()\nexport abstract class BaseDataEntryComponent<\n FACADE extends IBaseDataEntryFacade\n > implements OnDestroy, Subscribable {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n public readonly RequiredError = \"Required\";\n public allSubscriptions = new Subscriptions();\n public abstract dialogTitle: string;\n public abstract props: unknown;\n public addEditForm: FormGroup = new FormGroup({});\n public loading$: Observable<boolean>;\n private readonly _submitted$: BehaviorSubject<boolean> = new BehaviorSubject(\n false as boolean\n );\n\n public get submitted$(): Observable<boolean> {\n return this._submitted$.asObservable();\n }\n // convenience getter for easy access to form fields\n public formControl(controlName: string): AbstractControl | undefined {\n return this.addEditForm?.controls[controlName];\n }\n public formControlErrors(controlName: string): ValidationErrors | null {\n return this.addEditForm.controls[controlName].errors;\n }\n constructor(@Inject(FACADE) public readonly facade: FACADE) {\n this.loading$ = this.facade.loading$;\n this.initForm();\n }\n\n public ngOnDestroy(): void {\n this.allSubscriptions.unsubscribeAll();\n }\n\n public closeForm(): void {\n this.initForm();\n this.facade.clearCurrentEntity();\n this._submitted$.next(false);\n }\n\n public onCancel(): void {\n this.closeForm();\n }\n\n public onSubmit(): void {\n this._submitted$.next(true);\n\n // stop here if form is invalid\n if (this.isDataInvalid()) {\n console.error('form validation errors.'); //NOSONAR\n return;\n }\n this.save();\n this.closeForm();\n }\n\n public isDataInvalid(): boolean | undefined {\n return this.addEditForm?.invalid;\n }\n\n public abstract initForm(): void;\n public abstract save(): void;\n}\n","import { ValueType } from 'imng-nrsrx-client-utils';\nexport function updateStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1, item);\n return items;\n}\n\nexport function removeStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1);\n return items;\n}\n\nexport function addStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n items.unshift(item);\n return items;\n}\n","import { FormGroup } from '@angular/forms';\nimport { take, tap, filter } from 'rxjs/operators';\nimport { Observable } from 'rxjs';\n\nexport const formGroupPatcher = <TEntity>(addEditForm: FormGroup) => (source: Observable<TEntity>) =>\n source.pipe(\n filter(t => !!t),\n take(1),\n tap(t => addEditForm.patchValue(t)),\n );\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAGa,sBAAsB,CAAA;AACjC,IAAA,WAAA,CAAmB,GAAyB,EAAA;AAAzB,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAsB;KAAK;;mHADtC,sBAAsB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;uGAAtB,sBAAsB,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,SAAS;mBAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAA;;;MC0C9B,wBAAwB,CAAA;AA/BrC,IAAA,WAAA,GAAA;AAgCkB,QAAA,IAAA,CAAA,KAAK,GAAoB,GAAG,CAA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AO,CAAC,IAAI,CAAC,CAAC;AACpB,IAAA,OAAO,KAAK,CAAC;AACf;;MCxBa,gBAAgB,GAAG,CAAU,WAAsB,KAAK,CAAC,MAA2B,KAC/F,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;ACRvC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"imng-kendo-data-entry.mjs","sources":["../../../../libs/imng-kendo-data-entry/src/lib/dialog-buttons.directive.ts","../../../../libs/imng-kendo-data-entry/src/lib/data-entry-dialog.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/imng-kendo-data-entry.module.ts","../../../../libs/imng-kendo-data-entry/src/lib/base-data-entry.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/reducer-collection-logic.ts","../../../../libs/imng-kendo-data-entry/src/lib/form-group-patcher.ts","../../../../libs/imng-kendo-data-entry/src/imng-kendo-data-entry.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({ selector: '[imngDialogBtns]' })\nexport class DialogButtonsDirective {\n constructor(public tpl: TemplateRef<unknown>) { }\n}\n","import {\n Component,\n OnInit,\n Input,\n ChangeDetectionStrategy,\n TemplateRef,\n ContentChild,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { BaseDataEntryComponent } from './base-data-entry.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\n\n@Component({\n selector: 'imng-data-entry-dialog[parentComponent]',\n template: `<kendo-dialog\n [width]=\"width\"\n [minWidth]=\"minWidth ?? width\"\n [height]=\"height\"\n (close)=\"close()\"\n [autoFocusedElement]=\"autoFocusedElement || ''\"\n >\n <kendo-dialog-titlebar class=\"bg-primary\">{{\n dialogTitle\n }}</kendo-dialog-titlebar>\n <ng-content></ng-content>\n <kendo-dialog-actions>\n <ng-container\n *ngTemplateOutlet=\"\n dialogBtnsTemplate || defaultDialogActionsTpl;\n context: dialogActionBtnsCtx\n \"\n >\n </ng-container>\n </kendo-dialog-actions>\n </kendo-dialog>\n\n <ng-template #defaultDialogActionsTpl>\n <button kendoButton (click)=\"cancel()\" class=\"btn btn-secondary btn-sm\">Cancel</button>\n <button kendoButton (click)=\"submit()\" class=\"btn btn-primary btn-sm\">\n {{ saveButtonText }}\n </button>\n </ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataEntryDialogComponent implements OnInit {\n @Input() public minWidth?: number; //NOSONAR\n @Input() public width = 800; //NOSONAR\n @Input() public height = 600; //NOSONAR\n /**\n * https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/\n */\n @Input() public autoFocusedElement?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() public parentComponent?: BaseDataEntryComponent<any>; //NOSONAR\n @Input() public saveButtonText = 'Save';\n @ContentChild(DialogButtonsDirective, { static: true, read: TemplateRef })\n /**\n * Example Usage:\n * <imng-data-entry-dialog>\n * ......\n * <ng-template [imngDialogBtns] let-coreButtons>\n * <button id=\"btnCustom1\" class=\"k-button\" (click)=\"cancel()\">Close</button>\n * </ng-template>\n * </imng-data-entry-dialog>\n */\n public dialogBtnsTemplate?: TemplateRef<unknown>;\n public loading$?: Observable<boolean>;\n public addEditForm?: FormGroup;\n public submitted = false;\n public dialogTitle?: string;\n // eslint-disable-next-line @typescript-eslint/ban-types\n public component?: {};\n\n public ngOnInit(): void {\n if (!this.parentComponent) {\n throw new TypeError(`The input 'parentComponent' is required`);\n }\n this.dialogTitle = this.parentComponent.dialogTitle;\n this.loading$ = this.parentComponent.loading$;\n this.addEditForm = this.parentComponent.addEditForm;\n }\n\n public close(): void {\n this.parentComponent?.closeForm();\n }\n public cancel(): void {\n this.parentComponent?.onCancel();\n }\n public submit(): void {\n this.parentComponent?.onSubmit();\n }\n get dialogActionBtnsCtx(): object | null { //NOSONAR\n return {\n $implicit: { cancel: () => this.cancel(), submit: () => this.submit() },\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DataEntryDialogComponent } from './data-entry-dialog.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\nimport { DialogModule } from '@progress/kendo-angular-dialog';\n\n@NgModule({\n imports: [CommonModule, DialogModule],\n declarations: [DataEntryDialogComponent, DialogButtonsDirective],\n exports: [DataEntryDialogComponent, DialogButtonsDirective],\n})\nexport class ImngDataEntryDialogModule {}\n","import {\n Directive,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n} from '@angular/core';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { FormGroup, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { IBaseDataEntryFacade } from './data-entry-facade';\nimport { Subscribable, Subscriptions } from 'imng-ngrx-utils';\n\nconst FACADE = new InjectionToken<IBaseDataEntryFacade>(\n 'imng-data-entry-facade'\n);\n\n/**\n * The extending class has to implement the following properties on ngInit\n * dialogTitle: string - This will be the text displayed at the top of the modal title bar\n * props: enum - This is a helper property to make the html markup type safe\n *\n * Along with the requirements above, the extending class has to set values to the\n * following properties on ngInit\n * active$: Observable<boolean> - This typically would be assigned to the isNewActive$ or isEditActive on the facade\n * addEditForm: FormGroup - This will be created by your component\n *\n * @class BaseDataEntryComponent>\n */\n@Directive()\nexport abstract class BaseDataEntryComponent<\n FACADE extends IBaseDataEntryFacade\n > implements OnDestroy, Subscribable {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n public readonly MinLengthError = 'minlength';\n public readonly RequiredError = 'required';\n public allSubscriptions = new Subscriptions();\n public abstract dialogTitle: string;\n public abstract props: unknown;\n public addEditForm: FormGroup = new FormGroup({});\n public loading$: Observable<boolean>;\n private readonly _submitted$: BehaviorSubject<boolean> = new BehaviorSubject(\n false as boolean\n );\n\n public get submitted$(): Observable<boolean> {\n return this._submitted$.asObservable();\n }\n constructor(@Inject(FACADE) public readonly facade: FACADE) {\n this.loading$ = this.facade.loading$;\n this.initForm();\n }\n\n public ngOnDestroy(): void {\n this.allSubscriptions.unsubscribeAll();\n }\n\n public closeForm(): void {\n this.initForm();\n this.facade.clearCurrentEntity();\n this._submitted$.next(false);\n }\n\n public onCancel(): void {\n this.closeForm();\n }\n\n public onSubmit(): void {\n this._submitted$.next(true);\n\n // stop here if form is invalid\n if (!this.addEditForm.valid) {\n console.error('form validation errors.'); //NOSONAR\n console.error(JSON.stringify(this.getFormErrors())); //NOSONAR\n return;\n }\n this.save();\n this.closeForm();\n }\n\n public isDataInvalid(): boolean {\n return this.addEditForm.invalid;\n }\n\n // convenience getter for easy access to form fields\n public formControl(controlName: string): AbstractControl {\n return this.addEditForm.controls[controlName];\n }\n public formControlErrors(controlName: string): ValidationErrors | null {\n return this.formControl(controlName)?.errors;\n }\n public formMinLengthError(controlName: string): { requiredLength: number, actualLength: number; } | null {\n return this.formControlErrors(controlName)?.[this.MinLengthError];\n }\n public getFormErrors(): { control: string, error: ValidationErrors; }[] {\n const errors: { control: string, error: ValidationErrors; }[] = [];\n for (const control of Object.keys(this.addEditForm.controls)) {\n const error = this.formControlErrors(control);\n if (error) {\n errors.push({ control, error });\n }\n }\n return errors;\n }\n\n public abstract initForm(): void;\n public abstract save(): void;\n}\n","import { ValueType } from 'imng-nrsrx-client-utils';\nexport function updateStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1, item);\n return items;\n}\n\nexport function removeStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1);\n return items;\n}\n\nexport function addStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n items.unshift(item);\n return items;\n}\n","import { FormGroup } from '@angular/forms';\nimport { take, tap, filter } from 'rxjs/operators';\nimport { Observable } from 'rxjs';\n\nexport const formGroupPatcher = <TEntity>(addEditForm: FormGroup) => (source: Observable<TEntity>) =>\n source.pipe(\n filter(t => !!t),\n take(1),\n tap(t => addEditForm.patchValue(t)),\n );\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAGa,sBAAsB,CAAA;AACjC,IAAA,WAAA,CAAmB,GAAyB,EAAA;AAAzB,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAsB;KAAK;;mHADtC,sBAAsB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;uGAAtB,sBAAsB,EAAA,QAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,SAAS;mBAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAA;;;MC2C9B,wBAAwB,CAAA;AAhCrC,IAAA,WAAA,GAAA;AAkCkB,QAAA,IAAA,CAAA,KAAK,GAAG,GAAG,CAAC;AACZ,QAAA,IAAA,CAAA,MAAM,GAAG,GAAG,CAAC;AAOb,QAAA,IAAc,CAAA,cAAA,GAAG,MAAM,CAAC;AAcjC,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;KA4B1B;IAvBQ,QAAQ,GAAA;AACb,QAAA,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;AACzB,YAAA,MAAM,IAAI,SAAS,CAAC,CAAA,uCAAA,CAAyC,CAAC,CAAC;AAChE,SAAA;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;QACpD,IAA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,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,IAAA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvB,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAEe,SAAA,sBAAsB,CACpC,UAAoB,EACpB,IAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpB,IAAA,OAAO,KAAK,CAAC;AACf;;MCxBa,gBAAgB,GAAG,CAAU,WAAsB,KAAK,CAAC,MAA2B,KAC/F,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;ACRvC;;AAEG;;;;"}
|
|
@@ -27,7 +27,8 @@ class BaseDataEntryComponent {
|
|
|
27
27
|
this.facade = facade;
|
|
28
28
|
this.width = 800; //NOSONAR
|
|
29
29
|
this.height = 600; //NOSONAR
|
|
30
|
-
this.
|
|
30
|
+
this.MinLengthError = 'minlength';
|
|
31
|
+
this.RequiredError = 'required';
|
|
31
32
|
this.allSubscriptions = new Subscriptions();
|
|
32
33
|
this.addEditForm = new FormGroup({});
|
|
33
34
|
this._submitted$ = new BehaviorSubject(false);
|
|
@@ -37,13 +38,6 @@ class BaseDataEntryComponent {
|
|
|
37
38
|
get submitted$() {
|
|
38
39
|
return this._submitted$.asObservable();
|
|
39
40
|
}
|
|
40
|
-
// convenience getter for easy access to form fields
|
|
41
|
-
formControl(controlName) {
|
|
42
|
-
return this.addEditForm?.controls[controlName];
|
|
43
|
-
}
|
|
44
|
-
formControlErrors(controlName) {
|
|
45
|
-
return this.addEditForm.controls[controlName].errors;
|
|
46
|
-
}
|
|
47
41
|
ngOnDestroy() {
|
|
48
42
|
this.allSubscriptions.unsubscribeAll();
|
|
49
43
|
}
|
|
@@ -58,20 +52,41 @@ class BaseDataEntryComponent {
|
|
|
58
52
|
onSubmit() {
|
|
59
53
|
this._submitted$.next(true);
|
|
60
54
|
// stop here if form is invalid
|
|
61
|
-
if (this.
|
|
55
|
+
if (!this.addEditForm.valid) {
|
|
62
56
|
console.error('form validation errors.'); //NOSONAR
|
|
57
|
+
console.error(JSON.stringify(this.getFormErrors())); //NOSONAR
|
|
63
58
|
return;
|
|
64
59
|
}
|
|
65
60
|
this.save();
|
|
66
61
|
this.closeForm();
|
|
67
62
|
}
|
|
68
63
|
isDataInvalid() {
|
|
69
|
-
return this.addEditForm
|
|
64
|
+
return this.addEditForm.invalid;
|
|
65
|
+
}
|
|
66
|
+
// convenience getter for easy access to form fields
|
|
67
|
+
formControl(controlName) {
|
|
68
|
+
return this.addEditForm.controls[controlName];
|
|
69
|
+
}
|
|
70
|
+
formControlErrors(controlName) {
|
|
71
|
+
return this.formControl(controlName)?.errors;
|
|
72
|
+
}
|
|
73
|
+
formMinLengthError(controlName) {
|
|
74
|
+
return this.formControlErrors(controlName)?.[this.MinLengthError];
|
|
75
|
+
}
|
|
76
|
+
getFormErrors() {
|
|
77
|
+
const errors = [];
|
|
78
|
+
for (const control of Object.keys(this.addEditForm.controls)) {
|
|
79
|
+
const error = this.formControlErrors(control);
|
|
80
|
+
if (error) {
|
|
81
|
+
errors.push({ control, error });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return errors;
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
|
-
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
73
|
-
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
87
|
+
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, deps: [{ token: FACADE }], target: i0.ɵɵFactoryTarget.Directive });
|
|
88
|
+
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: BaseDataEntryComponent, inputs: { width: "width", height: "height" }, ngImport: i0 });
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: BaseDataEntryComponent, decorators: [{
|
|
75
90
|
type: Directive
|
|
76
91
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
77
92
|
type: Inject,
|
|
@@ -87,9 +102,9 @@ class DialogButtonsDirective {
|
|
|
87
102
|
this.tpl = tpl;
|
|
88
103
|
}
|
|
89
104
|
}
|
|
90
|
-
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
91
|
-
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
105
|
+
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
106
|
+
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.4", type: DialogButtonsDirective, selector: "[imngDialogBtns]", ngImport: i0 });
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DialogButtonsDirective, decorators: [{
|
|
93
108
|
type: Directive,
|
|
94
109
|
args: [{ selector: '[imngDialogBtns]' }]
|
|
95
110
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
@@ -124,9 +139,10 @@ class DataEntryDialogComponent {
|
|
|
124
139
|
};
|
|
125
140
|
}
|
|
126
141
|
}
|
|
127
|
-
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
128
|
-
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.
|
|
142
|
+
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
143
|
+
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.4", type: DataEntryDialogComponent, selector: "imng-data-entry-dialog[parentComponent]", inputs: { minWidth: "minWidth", width: "width", height: "height", autoFocusedElement: "autoFocusedElement", parentComponent: "parentComponent", saveButtonText: "saveButtonText" }, queries: [{ propertyName: "dialogBtnsTemplate", first: true, predicate: DialogButtonsDirective, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `<kendo-dialog
|
|
129
144
|
[width]="width"
|
|
145
|
+
[minWidth]="minWidth ?? width"
|
|
130
146
|
[height]="height"
|
|
131
147
|
(close)="close()"
|
|
132
148
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -152,12 +168,13 @@ DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
|
|
|
152
168
|
{{ saveButtonText }}
|
|
153
169
|
</button>
|
|
154
170
|
</ng-template>`, isInline: true, components: [{ type: i1.DialogComponent, selector: "kendo-dialog", inputs: ["actions", "actionsLayout", "autoFocusedElement", "title", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"], outputs: ["action", "close"], exportAs: ["kendoDialog"] }, { type: i1.DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { type: i1.DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
155
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: DataEntryDialogComponent, decorators: [{
|
|
156
172
|
type: Component,
|
|
157
173
|
args: [{
|
|
158
174
|
selector: 'imng-data-entry-dialog[parentComponent]',
|
|
159
175
|
template: `<kendo-dialog
|
|
160
176
|
[width]="width"
|
|
177
|
+
[minWidth]="minWidth ?? width"
|
|
161
178
|
[height]="height"
|
|
162
179
|
(close)="close()"
|
|
163
180
|
[autoFocusedElement]="autoFocusedElement || ''"
|
|
@@ -185,7 +202,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
185
202
|
</ng-template>`,
|
|
186
203
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
187
204
|
}]
|
|
188
|
-
}], propDecorators: {
|
|
205
|
+
}], propDecorators: { minWidth: [{
|
|
206
|
+
type: Input
|
|
207
|
+
}], width: [{
|
|
189
208
|
type: Input
|
|
190
209
|
}], height: [{
|
|
191
210
|
type: Input
|
|
@@ -202,10 +221,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.3", ngImpor
|
|
|
202
221
|
|
|
203
222
|
class ImngDataEntryDialogModule {
|
|
204
223
|
}
|
|
205
|
-
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.
|
|
206
|
-
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.
|
|
207
|
-
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.
|
|
224
|
+
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
225
|
+
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, declarations: [DataEntryDialogComponent, DialogButtonsDirective], imports: [CommonModule, DialogModule], exports: [DataEntryDialogComponent, DialogButtonsDirective] });
|
|
226
|
+
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, imports: [[CommonModule, DialogModule]] });
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.4", ngImport: i0, type: ImngDataEntryDialogModule, decorators: [{
|
|
209
228
|
type: NgModule,
|
|
210
229
|
args: [{
|
|
211
230
|
imports: [CommonModule, DialogModule],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imng-kendo-data-entry.mjs","sources":["../../../../libs/imng-kendo-data-entry/src/lib/base-data-entry.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/dialog-buttons.directive.ts","../../../../libs/imng-kendo-data-entry/src/lib/data-entry-dialog.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/imng-kendo-data-entry.module.ts","../../../../libs/imng-kendo-data-entry/src/lib/reducer-collection-logic.ts","../../../../libs/imng-kendo-data-entry/src/lib/form-group-patcher.ts","../../../../libs/imng-kendo-data-entry/src/imng-kendo-data-entry.ts"],"sourcesContent":["import {\n Directive,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n} from '@angular/core';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { FormGroup, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { IBaseDataEntryFacade } from './data-entry-facade';\nimport { Subscribable, Subscriptions } from 'imng-ngrx-utils';\n\nconst FACADE = new InjectionToken<IBaseDataEntryFacade>(\n 'imng-data-entry-facade'\n);\n\n/**\n * The extending class has to implement the following properties on ngInit\n * dialogTitle: string - This will be the text displayed at the top of the modal title bar\n * props: enum - This is a helper property to make the html markup type safe\n *\n * Along with the requirements above, the extending class has to set values to the\n * following properties on ngInit\n * active$: Observable<boolean> - This typically would be assigned to the isNewActive$ or isEditActive on the facade\n * addEditForm: FormGroup - This will be created by your component\n *\n * @class BaseDataEntryComponent>\n */\n@Directive()\nexport abstract class BaseDataEntryComponent<\n FACADE extends IBaseDataEntryFacade\n > implements OnDestroy, Subscribable {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n public readonly RequiredError = \"Required\";\n public allSubscriptions = new Subscriptions();\n public abstract dialogTitle: string;\n public abstract props: unknown;\n public addEditForm: FormGroup = new FormGroup({});\n public loading$: Observable<boolean>;\n private readonly _submitted$: BehaviorSubject<boolean> = new BehaviorSubject(\n false as boolean\n );\n\n public get submitted$(): Observable<boolean> {\n return this._submitted$.asObservable();\n }\n // convenience getter for easy access to form fields\n public formControl(controlName: string): AbstractControl | undefined {\n return this.addEditForm?.controls[controlName];\n }\n public formControlErrors(controlName: string): ValidationErrors | null {\n return this.addEditForm.controls[controlName].errors;\n }\n constructor(@Inject(FACADE) public readonly facade: FACADE) {\n this.loading$ = this.facade.loading$;\n this.initForm();\n }\n\n public ngOnDestroy(): void {\n this.allSubscriptions.unsubscribeAll();\n }\n\n public closeForm(): void {\n this.initForm();\n this.facade.clearCurrentEntity();\n this._submitted$.next(false);\n }\n\n public onCancel(): void {\n this.closeForm();\n }\n\n public onSubmit(): void {\n this._submitted$.next(true);\n\n // stop here if form is invalid\n if (this.isDataInvalid()) {\n console.error('form validation errors.'); //NOSONAR\n return;\n }\n this.save();\n this.closeForm();\n }\n\n public isDataInvalid(): boolean | undefined {\n return this.addEditForm?.invalid;\n }\n\n public abstract initForm(): void;\n public abstract save(): void;\n}\n","import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({ selector: '[imngDialogBtns]' })\nexport class DialogButtonsDirective {\n constructor(public tpl: TemplateRef<unknown>) { }\n}\n","import {\n Component,\n OnInit,\n Input,\n ChangeDetectionStrategy,\n TemplateRef,\n ContentChild,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { BaseDataEntryComponent } from './base-data-entry.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\n\n@Component({\n selector: 'imng-data-entry-dialog[parentComponent]',\n template: `<kendo-dialog\n [width]=\"width\"\n [height]=\"height\"\n (close)=\"close()\"\n [autoFocusedElement]=\"autoFocusedElement || ''\"\n >\n <kendo-dialog-titlebar class=\"bg-primary\">{{\n dialogTitle\n }}</kendo-dialog-titlebar>\n <ng-content></ng-content>\n <kendo-dialog-actions>\n <ng-container\n *ngTemplateOutlet=\"\n dialogBtnsTemplate || defaultDialogActionsTpl;\n context: dialogActionBtnsCtx\n \"\n >\n </ng-container>\n </kendo-dialog-actions>\n </kendo-dialog>\n\n <ng-template #defaultDialogActionsTpl>\n <button kendoButton (click)=\"cancel()\" class=\"btn btn-secondary btn-sm\">Cancel</button>\n <button kendoButton (click)=\"submit()\" class=\"btn btn-primary btn-sm\">\n {{ saveButtonText }}\n </button>\n </ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataEntryDialogComponent implements OnInit {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n /**\n * https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/\n */\n @Input() public autoFocusedElement?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() public parentComponent?: BaseDataEntryComponent<any>; //NOSONAR\n @Input() public saveButtonText = 'Save';\n @ContentChild(DialogButtonsDirective, { static: true, read: TemplateRef })\n /**\n * Example Usage:\n * <imng-data-entry-dialog>\n * ......\n * <ng-template [imngDialogBtns] let-coreButtons>\n * <button id=\"btnCustom1\" class=\"k-button\" (click)=\"cancel()\">Close</button>\n * </ng-template>\n * </imng-data-entry-dialog>\n */\n public dialogBtnsTemplate?: TemplateRef<unknown>;\n public loading$?: Observable<boolean>;\n public addEditForm?: FormGroup;\n public submitted = false;\n public dialogTitle?: string;\n // eslint-disable-next-line @typescript-eslint/ban-types\n public component?: {};\n\n public ngOnInit(): void {\n if (!this.parentComponent) {\n throw new TypeError(`The input 'parentComponent' is required`);\n }\n this.dialogTitle = this.parentComponent.dialogTitle;\n this.loading$ = this.parentComponent.loading$;\n this.addEditForm = this.parentComponent.addEditForm;\n }\n\n public close(): void {\n this.parentComponent?.closeForm();\n }\n public cancel(): void {\n this.parentComponent?.onCancel();\n }\n public submit(): void {\n this.parentComponent?.onSubmit();\n }\n get dialogActionBtnsCtx(): object | null { //NOSONAR\n return {\n $implicit: { cancel: () => this.cancel(), submit: () => this.submit() },\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DataEntryDialogComponent } from './data-entry-dialog.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\nimport { DialogModule } from '@progress/kendo-angular-dialog';\n\n@NgModule({\n imports: [CommonModule, DialogModule],\n declarations: [DataEntryDialogComponent, DialogButtonsDirective],\n exports: [DataEntryDialogComponent, DialogButtonsDirective],\n})\nexport class ImngDataEntryDialogModule {}\n","import { ValueType } from 'imng-nrsrx-client-utils';\nexport function updateStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1, item);\n return items;\n}\n\nexport function removeStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1);\n return items;\n}\n\nexport function addStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n items.unshift(item);\n return items;\n}\n","import { FormGroup } from '@angular/forms';\nimport { take, tap, filter } from 'rxjs/operators';\nimport { Observable } from 'rxjs';\n\nexport const formGroupPatcher = <TEntity>(addEditForm: FormGroup) => (source: Observable<TEntity>) =>\n source.pipe(\n filter(t => !!t),\n take(1),\n tap(t => addEditForm.patchValue(t)),\n );\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAYA,MAAM,MAAM,GAAG,IAAI,cAAc,CAC/B,wBAAwB,CACzB,CAAC;AAEF;;;;;;;;;;;AAWG;MAEmB,sBAAsB,CAAA;AAyB1C,IAAA,WAAA,CAA4C,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;AAtB1C,QAAA,IAAA,CAAA,KAAK,GAAoB,GAAG,CAAC;AAC7B,QAAA,IAAA,CAAA,MAAM,GAAoB,GAAG,CAAC;QAC9B,IAAa,CAAA,aAAA,GAAG,UAAU,CAAC;AACpC,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,aAAa,EAAE,CAAC;AAGvC,QAAA,IAAA,CAAA,WAAW,GAAc,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC;AAEjC,QAAA,IAAA,CAAA,WAAW,GAA6B,IAAI,eAAe,CAC1E,KAAgB,CACjB,CAAC;QAaA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,QAAQ,EAAE,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G,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7B,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAEe,SAAA,yBAAyB,CACvC,UAAoB,EACpB,IAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,IAAA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvB,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAEe,SAAA,sBAAsB,CACpC,UAAoB,EACpB,IAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpB,IAAA,OAAO,KAAK,CAAC;AACf;;MCxBa,gBAAgB,GAAG,CAAU,WAAsB,KAAK,CAAC,MAA2B,KAC/F,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;ACRvC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"imng-kendo-data-entry.mjs","sources":["../../../../libs/imng-kendo-data-entry/src/lib/base-data-entry.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/dialog-buttons.directive.ts","../../../../libs/imng-kendo-data-entry/src/lib/data-entry-dialog.component.ts","../../../../libs/imng-kendo-data-entry/src/lib/imng-kendo-data-entry.module.ts","../../../../libs/imng-kendo-data-entry/src/lib/reducer-collection-logic.ts","../../../../libs/imng-kendo-data-entry/src/lib/form-group-patcher.ts","../../../../libs/imng-kendo-data-entry/src/imng-kendo-data-entry.ts"],"sourcesContent":["import {\n Directive,\n Inject,\n InjectionToken,\n Input,\n OnDestroy,\n} from '@angular/core';\nimport { Observable, BehaviorSubject } from 'rxjs';\nimport { FormGroup, AbstractControl, ValidationErrors } from '@angular/forms';\nimport { IBaseDataEntryFacade } from './data-entry-facade';\nimport { Subscribable, Subscriptions } from 'imng-ngrx-utils';\n\nconst FACADE = new InjectionToken<IBaseDataEntryFacade>(\n 'imng-data-entry-facade'\n);\n\n/**\n * The extending class has to implement the following properties on ngInit\n * dialogTitle: string - This will be the text displayed at the top of the modal title bar\n * props: enum - This is a helper property to make the html markup type safe\n *\n * Along with the requirements above, the extending class has to set values to the\n * following properties on ngInit\n * active$: Observable<boolean> - This typically would be assigned to the isNewActive$ or isEditActive on the facade\n * addEditForm: FormGroup - This will be created by your component\n *\n * @class BaseDataEntryComponent>\n */\n@Directive()\nexport abstract class BaseDataEntryComponent<\n FACADE extends IBaseDataEntryFacade\n > implements OnDestroy, Subscribable {\n @Input() public width: string | number = 800; //NOSONAR\n @Input() public height: string | number = 600; //NOSONAR\n public readonly MinLengthError = 'minlength';\n public readonly RequiredError = 'required';\n public allSubscriptions = new Subscriptions();\n public abstract dialogTitle: string;\n public abstract props: unknown;\n public addEditForm: FormGroup = new FormGroup({});\n public loading$: Observable<boolean>;\n private readonly _submitted$: BehaviorSubject<boolean> = new BehaviorSubject(\n false as boolean\n );\n\n public get submitted$(): Observable<boolean> {\n return this._submitted$.asObservable();\n }\n constructor(@Inject(FACADE) public readonly facade: FACADE) {\n this.loading$ = this.facade.loading$;\n this.initForm();\n }\n\n public ngOnDestroy(): void {\n this.allSubscriptions.unsubscribeAll();\n }\n\n public closeForm(): void {\n this.initForm();\n this.facade.clearCurrentEntity();\n this._submitted$.next(false);\n }\n\n public onCancel(): void {\n this.closeForm();\n }\n\n public onSubmit(): void {\n this._submitted$.next(true);\n\n // stop here if form is invalid\n if (!this.addEditForm.valid) {\n console.error('form validation errors.'); //NOSONAR\n console.error(JSON.stringify(this.getFormErrors())); //NOSONAR\n return;\n }\n this.save();\n this.closeForm();\n }\n\n public isDataInvalid(): boolean {\n return this.addEditForm.invalid;\n }\n\n // convenience getter for easy access to form fields\n public formControl(controlName: string): AbstractControl {\n return this.addEditForm.controls[controlName];\n }\n public formControlErrors(controlName: string): ValidationErrors | null {\n return this.formControl(controlName)?.errors;\n }\n public formMinLengthError(controlName: string): { requiredLength: number, actualLength: number; } | null {\n return this.formControlErrors(controlName)?.[this.MinLengthError];\n }\n public getFormErrors(): { control: string, error: ValidationErrors; }[] {\n const errors: { control: string, error: ValidationErrors; }[] = [];\n for (const control of Object.keys(this.addEditForm.controls)) {\n const error = this.formControlErrors(control);\n if (error) {\n errors.push({ control, error });\n }\n }\n return errors;\n }\n\n public abstract initForm(): void;\n public abstract save(): void;\n}\n","import { Directive, TemplateRef } from '@angular/core';\n\n@Directive({ selector: '[imngDialogBtns]' })\nexport class DialogButtonsDirective {\n constructor(public tpl: TemplateRef<unknown>) { }\n}\n","import {\n Component,\n OnInit,\n Input,\n ChangeDetectionStrategy,\n TemplateRef,\n ContentChild,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { FormGroup } from '@angular/forms';\nimport { BaseDataEntryComponent } from './base-data-entry.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\n\n@Component({\n selector: 'imng-data-entry-dialog[parentComponent]',\n template: `<kendo-dialog\n [width]=\"width\"\n [minWidth]=\"minWidth ?? width\"\n [height]=\"height\"\n (close)=\"close()\"\n [autoFocusedElement]=\"autoFocusedElement || ''\"\n >\n <kendo-dialog-titlebar class=\"bg-primary\">{{\n dialogTitle\n }}</kendo-dialog-titlebar>\n <ng-content></ng-content>\n <kendo-dialog-actions>\n <ng-container\n *ngTemplateOutlet=\"\n dialogBtnsTemplate || defaultDialogActionsTpl;\n context: dialogActionBtnsCtx\n \"\n >\n </ng-container>\n </kendo-dialog-actions>\n </kendo-dialog>\n\n <ng-template #defaultDialogActionsTpl>\n <button kendoButton (click)=\"cancel()\" class=\"btn btn-secondary btn-sm\">Cancel</button>\n <button kendoButton (click)=\"submit()\" class=\"btn btn-primary btn-sm\">\n {{ saveButtonText }}\n </button>\n </ng-template>`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataEntryDialogComponent implements OnInit {\n @Input() public minWidth?: number; //NOSONAR\n @Input() public width = 800; //NOSONAR\n @Input() public height = 600; //NOSONAR\n /**\n * https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/\n */\n @Input() public autoFocusedElement?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() public parentComponent?: BaseDataEntryComponent<any>; //NOSONAR\n @Input() public saveButtonText = 'Save';\n @ContentChild(DialogButtonsDirective, { static: true, read: TemplateRef })\n /**\n * Example Usage:\n * <imng-data-entry-dialog>\n * ......\n * <ng-template [imngDialogBtns] let-coreButtons>\n * <button id=\"btnCustom1\" class=\"k-button\" (click)=\"cancel()\">Close</button>\n * </ng-template>\n * </imng-data-entry-dialog>\n */\n public dialogBtnsTemplate?: TemplateRef<unknown>;\n public loading$?: Observable<boolean>;\n public addEditForm?: FormGroup;\n public submitted = false;\n public dialogTitle?: string;\n // eslint-disable-next-line @typescript-eslint/ban-types\n public component?: {};\n\n public ngOnInit(): void {\n if (!this.parentComponent) {\n throw new TypeError(`The input 'parentComponent' is required`);\n }\n this.dialogTitle = this.parentComponent.dialogTitle;\n this.loading$ = this.parentComponent.loading$;\n this.addEditForm = this.parentComponent.addEditForm;\n }\n\n public close(): void {\n this.parentComponent?.closeForm();\n }\n public cancel(): void {\n this.parentComponent?.onCancel();\n }\n public submit(): void {\n this.parentComponent?.onSubmit();\n }\n get dialogActionBtnsCtx(): object | null { //NOSONAR\n return {\n $implicit: { cancel: () => this.cancel(), submit: () => this.submit() },\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DataEntryDialogComponent } from './data-entry-dialog.component';\nimport { DialogButtonsDirective } from './dialog-buttons.directive';\nimport { DialogModule } from '@progress/kendo-angular-dialog';\n\n@NgModule({\n imports: [CommonModule, DialogModule],\n declarations: [DataEntryDialogComponent, DialogButtonsDirective],\n exports: [DataEntryDialogComponent, DialogButtonsDirective],\n})\nexport class ImngDataEntryDialogModule {}\n","import { ValueType } from 'imng-nrsrx-client-utils';\nexport function updateStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1, item);\n return items;\n}\n\nexport function removeStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n const index = collection.findIndex((val) => val.id === item.id);\n items.splice(index, 1);\n return items;\n}\n\nexport function addStateCollectionItem<Entity extends { id?: ValueType }>(\n collection: Entity[],\n item: Entity\n): Entity[] {\n const items = [...collection];\n items.unshift(item);\n return items;\n}\n","import { FormGroup } from '@angular/forms';\nimport { take, tap, filter } from 'rxjs/operators';\nimport { Observable } from 'rxjs';\n\nexport const formGroupPatcher = <TEntity>(addEditForm: FormGroup) => (source: Observable<TEntity>) =>\n source.pipe(\n filter(t => !!t),\n take(1),\n tap(t => addEditForm.patchValue(t)),\n );\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAYA,MAAM,MAAM,GAAG,IAAI,cAAc,CAC/B,wBAAwB,CACzB,CAAC;AAEF;;;;;;;;;;;AAWG;MAEmB,sBAAsB,CAAA;AAmB1C,IAAA,WAAA,CAA4C,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,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CAAC,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7B,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAEe,SAAA,yBAAyB,CACvC,UAAoB,EACpB,IAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,IAAA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACvB,IAAA,OAAO,KAAK,CAAC;AACf,CAAC;AAEe,SAAA,sBAAsB,CACpC,UAAoB,EACpB,IAAY,EAAA;AAEZ,IAAA,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;AAC9B,IAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpB,IAAA,OAAO,KAAK,CAAC;AACf;;MCxBa,gBAAgB,GAAG,CAAU,WAAsB,KAAK,CAAC,MAA2B,KAC/F,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAChB,IAAI,CAAC,CAAC,CAAC,EACP,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;;ACRvC;;AAEG;;;;"}
|
|
@@ -20,7 +20,8 @@ export declare abstract class BaseDataEntryComponent<FACADE extends IBaseDataEnt
|
|
|
20
20
|
readonly facade: FACADE;
|
|
21
21
|
width: string | number;
|
|
22
22
|
height: string | number;
|
|
23
|
-
readonly
|
|
23
|
+
readonly MinLengthError = "minlength";
|
|
24
|
+
readonly RequiredError = "required";
|
|
24
25
|
allSubscriptions: Subscriptions;
|
|
25
26
|
abstract dialogTitle: string;
|
|
26
27
|
abstract props: unknown;
|
|
@@ -28,14 +29,22 @@ export declare abstract class BaseDataEntryComponent<FACADE extends IBaseDataEnt
|
|
|
28
29
|
loading$: Observable<boolean>;
|
|
29
30
|
private readonly _submitted$;
|
|
30
31
|
get submitted$(): Observable<boolean>;
|
|
31
|
-
formControl(controlName: string): AbstractControl | undefined;
|
|
32
|
-
formControlErrors(controlName: string): ValidationErrors | null;
|
|
33
32
|
constructor(facade: FACADE);
|
|
34
33
|
ngOnDestroy(): void;
|
|
35
34
|
closeForm(): void;
|
|
36
35
|
onCancel(): void;
|
|
37
36
|
onSubmit(): void;
|
|
38
|
-
isDataInvalid(): boolean
|
|
37
|
+
isDataInvalid(): boolean;
|
|
38
|
+
formControl(controlName: string): AbstractControl;
|
|
39
|
+
formControlErrors(controlName: string): ValidationErrors | null;
|
|
40
|
+
formMinLengthError(controlName: string): {
|
|
41
|
+
requiredLength: number;
|
|
42
|
+
actualLength: number;
|
|
43
|
+
} | null;
|
|
44
|
+
getFormErrors(): {
|
|
45
|
+
control: string;
|
|
46
|
+
error: ValidationErrors;
|
|
47
|
+
}[];
|
|
39
48
|
abstract initForm(): void;
|
|
40
49
|
abstract save(): void;
|
|
41
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDataEntryComponent<any>, never>;
|
|
@@ -4,8 +4,9 @@ import { FormGroup } from '@angular/forms';
|
|
|
4
4
|
import { BaseDataEntryComponent } from './base-data-entry.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class DataEntryDialogComponent implements OnInit {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
minWidth?: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
9
10
|
/**
|
|
10
11
|
* https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/
|
|
11
12
|
*/
|
|
@@ -24,5 +25,5 @@ export declare class DataEntryDialogComponent implements OnInit {
|
|
|
24
25
|
submit(): void;
|
|
25
26
|
get dialogActionBtnsCtx(): object | null;
|
|
26
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataEntryDialogComponent, never>;
|
|
27
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DataEntryDialogComponent, "imng-data-entry-dialog[parentComponent]", never, { "width": "width"; "height": "height"; "autoFocusedElement": "autoFocusedElement"; "parentComponent": "parentComponent"; "saveButtonText": "saveButtonText"; }, {}, ["dialogBtnsTemplate"], ["*"]>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataEntryDialogComponent, "imng-data-entry-dialog[parentComponent]", never, { "minWidth": "minWidth"; "width": "width"; "height": "height"; "autoFocusedElement": "autoFocusedElement"; "parentComponent": "parentComponent"; "saveButtonText": "saveButtonText"; }, {}, ["dialogBtnsTemplate"], ["*"]>;
|
|
28
29
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imng-kendo-data-entry",
|
|
3
3
|
"description": "A library to make integrating Angular Kendo forms and NGRX a bit simpler.",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.115.2",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": ">=13.x",
|
|
7
7
|
"@angular/core": ">=13.x",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"imng-ngrx-utils": "*",
|
|
12
12
|
"imng-nrsrx-client-utils": "*",
|
|
13
13
|
"rxjs": "*",
|
|
14
|
-
"@angular/platform-browser": "^13.3.
|
|
14
|
+
"@angular/platform-browser": "^13.3.4"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "^2.3.0"
|