imng-kendo-data-entry 4.62.1 → 4.102.13
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/README.md +1 -1
- package/{esm2015/imng-kendo-data-entry.js → esm2020/imng-kendo-data-entry.mjs} +0 -0
- package/{esm2015/index.js → esm2020/index.mjs} +2 -2
- package/esm2020/lib/base-data-entry.component.mjs +75 -0
- package/{esm2015/lib/data-delete-facade.js → esm2020/lib/data-delete-facade.mjs} +0 -0
- package/esm2020/lib/data-entry-dialog.component.mjs +112 -0
- package/{esm2015/lib/data-entry-facade.js → esm2020/lib/data-entry-facade.mjs} +0 -0
- package/{esm2015/lib/dialog-buttons.directive.js → esm2020/lib/dialog-buttons.directive.mjs} +4 -4
- package/{esm2015/lib/form-group-patcher.js → esm2020/lib/form-group-patcher.mjs} +0 -0
- package/esm2020/lib/imng-kendo-data-entry.module.mjs +20 -0
- package/esm2020/lib/reducer-collection-logic.mjs +18 -0
- package/esm2020/testing/data-delete-facade-http-tests.mjs +13 -0
- package/{esm2015/testing/data-delete-mock.facade.js → esm2020/testing/data-delete-mock.facade.mjs} +0 -0
- package/esm2020/testing/data-entry-facade-http-tests.mjs +24 -0
- package/esm2020/testing/data-entry-facade-tests.mjs +43 -0
- package/esm2020/testing/data-entry-mock.facade.mjs +36 -0
- package/{esm2015/testing/imng-kendo-data-entry-testing.js → esm2020/testing/imng-kendo-data-entry-testing.mjs} +2 -2
- package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
- package/{esm2015/testing/mock-data-entry-dialog.component.js → esm2020/testing/mock-data-entry-dialog.component.mjs} +0 -0
- package/{esm2015/testing/test-trigger-event-helpers.js → esm2020/testing/test-trigger-event-helpers.mjs} +0 -0
- package/fesm2015/{imng-kendo-data-entry-testing.js → imng-kendo-data-entry-testing.mjs} +10 -6
- package/fesm2015/imng-kendo-data-entry-testing.mjs.map +1 -0
- package/fesm2015/imng-kendo-data-entry.mjs +247 -0
- package/fesm2015/imng-kendo-data-entry.mjs.map +1 -0
- package/fesm2020/imng-kendo-data-entry-testing.mjs +159 -0
- package/fesm2020/imng-kendo-data-entry-testing.mjs.map +1 -0
- package/{fesm2015/imng-kendo-data-entry.js → fesm2020/imng-kendo-data-entry.mjs} +66 -31
- package/fesm2020/imng-kendo-data-entry.mjs.map +1 -0
- package/imng-kendo-data-entry.d.ts +0 -1
- package/index.d.ts +1 -2
- package/lib/base-data-entry.component.d.ts +5 -6
- package/lib/data-delete-facade.d.ts +0 -1
- package/lib/data-entry-dialog.component.d.ts +8 -9
- package/lib/data-entry-facade.d.ts +0 -1
- package/lib/dialog-buttons.directive.d.ts +0 -1
- package/lib/form-group-patcher.d.ts +0 -1
- package/lib/{data-entry.module.d.ts → imng-kendo-data-entry.module.d.ts} +0 -1
- package/lib/reducer-collection-logic.d.ts +0 -1
- package/package.json +44 -17
- package/testing/README.md +3 -0
- package/testing/data-delete-facade-http-tests.d.ts +0 -1
- package/testing/data-delete-mock.facade.d.ts +1 -2
- package/testing/data-entry-facade-http-tests.d.ts +0 -1
- package/testing/data-entry-facade-tests.d.ts +2 -3
- package/testing/data-entry-mock.facade.d.ts +4 -5
- package/testing/imng-kendo-data-entry-testing.d.ts +1 -2
- package/testing/index.d.ts +0 -1
- package/testing/mock-data-entry-dialog.component.d.ts +1 -2
- package/testing/package.json +5 -5
- package/testing/test-trigger-event-helpers.d.ts +0 -1
- package/bundles/imng-kendo-data-entry-testing.umd.js +0 -561
- package/bundles/imng-kendo-data-entry-testing.umd.js.map +0 -1
- package/bundles/imng-kendo-data-entry.umd.js +0 -544
- package/bundles/imng-kendo-data-entry.umd.js.map +0 -1
- package/esm2015/lib/base-data-entry.component.js +0 -73
- package/esm2015/lib/data-entry-dialog.component.js +0 -79
- package/esm2015/lib/data-entry.module.js +0 -20
- package/esm2015/lib/reducer-collection-logic.js +0 -18
- package/esm2015/testing/data-delete-facade-http-tests.js +0 -16
- package/esm2015/testing/data-entry-facade-http-tests.js +0 -29
- package/esm2015/testing/data-entry-facade-tests.js +0 -52
- package/esm2015/testing/data-entry-mock.facade.js +0 -32
- package/esm2015/testing/public_api.js +0 -2
- package/fesm2015/imng-kendo-data-entry-testing.js.map +0 -1
- package/fesm2015/imng-kendo-data-entry.js.map +0 -1
- package/imng-kendo-data-entry.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/lib/base-data-entry.component.d.ts.map +0 -1
- package/lib/data-delete-facade.d.ts.map +0 -1
- package/lib/data-entry-dialog.component.d.ts.map +0 -1
- package/lib/data-entry-facade.d.ts.map +0 -1
- package/lib/data-entry.module.d.ts.map +0 -1
- package/lib/dialog-buttons.directive.d.ts.map +0 -1
- package/lib/form-group-patcher.d.ts.map +0 -1
- package/lib/reducer-collection-logic.d.ts.map +0 -1
- package/testing/data-delete-facade-http-tests.d.ts.map +0 -1
- package/testing/data-delete-mock.facade.d.ts.map +0 -1
- package/testing/data-entry-facade-http-tests.d.ts.map +0 -1
- package/testing/data-entry-facade-tests.d.ts.map +0 -1
- package/testing/data-entry-mock.facade.d.ts.map +0 -1
- package/testing/imng-kendo-data-entry-testing.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/mock-data-entry-dialog.component.d.ts.map +0 -1
- package/testing/public_api.d.ts +0 -2
- package/testing/public_api.d.ts.map +0 -1
- package/testing/test-trigger-event-helpers.d.ts.map +0 -1
|
@@ -24,6 +24,8 @@ const FACADE = new InjectionToken('imng-data-entry-facade');
|
|
|
24
24
|
class BaseDataEntryComponent {
|
|
25
25
|
constructor(facade) {
|
|
26
26
|
this.facade = facade;
|
|
27
|
+
this.width = 800; //NOSONAR
|
|
28
|
+
this.height = 600; //NOSONAR
|
|
27
29
|
this.allSubscriptions = new Subscriptions();
|
|
28
30
|
this._submitted$ = new BehaviorSubject(false);
|
|
29
31
|
this.loading$ = this.facade.loading$;
|
|
@@ -34,10 +36,10 @@ class BaseDataEntryComponent {
|
|
|
34
36
|
}
|
|
35
37
|
// convenience getter for easy access to form fields
|
|
36
38
|
formControl(controlName) {
|
|
37
|
-
return this.addEditForm
|
|
39
|
+
return this.addEditForm?.controls[controlName];
|
|
38
40
|
}
|
|
39
41
|
formControlErrors(controlName) {
|
|
40
|
-
return this.addEditForm
|
|
42
|
+
return this.addEditForm?.controls[controlName].errors || undefined;
|
|
41
43
|
}
|
|
42
44
|
ngOnDestroy() {
|
|
43
45
|
this.allSubscriptions.unsubscribeAll();
|
|
@@ -54,19 +56,19 @@ class BaseDataEntryComponent {
|
|
|
54
56
|
this._submitted$.next(true);
|
|
55
57
|
// stop here if form is invalid
|
|
56
58
|
if (this.isDataInvalid()) {
|
|
57
|
-
console.
|
|
59
|
+
console.error('form validation errors.'); //NOSONAR
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
60
62
|
this.save();
|
|
61
63
|
this.closeForm();
|
|
62
64
|
}
|
|
63
65
|
isDataInvalid() {
|
|
64
|
-
return this.addEditForm
|
|
66
|
+
return this.addEditForm?.invalid;
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
|
-
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
68
|
-
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
69
|
+
BaseDataEntryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: BaseDataEntryComponent, deps: [{ token: FACADE }], target: i0.ɵɵFactoryTarget.Directive });
|
|
70
|
+
BaseDataEntryComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: BaseDataEntryComponent, inputs: { width: "width", height: "height" }, ngImport: i0 });
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: BaseDataEntryComponent, decorators: [{
|
|
70
72
|
type: Directive
|
|
71
73
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
72
74
|
type: Inject,
|
|
@@ -82,16 +84,19 @@ class DialogButtonsDirective {
|
|
|
82
84
|
this.tpl = tpl;
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
86
|
-
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
87
|
+
DialogButtonsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DialogButtonsDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
88
|
+
DialogButtonsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.2", type: DialogButtonsDirective, selector: "[imngDialogBtns]", ngImport: i0 });
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DialogButtonsDirective, decorators: [{
|
|
88
90
|
type: Directive,
|
|
89
91
|
args: [{ selector: '[imngDialogBtns]' }]
|
|
90
92
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
91
93
|
|
|
92
94
|
class DataEntryDialogComponent {
|
|
93
95
|
constructor() {
|
|
96
|
+
this.width = 800; //NOSONAR
|
|
97
|
+
this.height = 600; //NOSONAR
|
|
94
98
|
this.saveButtonText = 'Save';
|
|
99
|
+
this.submitted = false;
|
|
95
100
|
}
|
|
96
101
|
ngOnInit() {
|
|
97
102
|
if (!this.parentComponent) {
|
|
@@ -102,48 +107,78 @@ class DataEntryDialogComponent {
|
|
|
102
107
|
this.addEditForm = this.parentComponent.addEditForm;
|
|
103
108
|
}
|
|
104
109
|
close() {
|
|
105
|
-
this.parentComponent
|
|
110
|
+
this.parentComponent?.closeForm();
|
|
106
111
|
}
|
|
107
112
|
cancel() {
|
|
108
|
-
this.parentComponent
|
|
113
|
+
this.parentComponent?.onCancel();
|
|
109
114
|
}
|
|
110
115
|
submit() {
|
|
111
|
-
this.parentComponent
|
|
116
|
+
this.parentComponent?.onSubmit();
|
|
112
117
|
}
|
|
113
118
|
get dialogActionBtnsCtx() {
|
|
114
|
-
return {
|
|
119
|
+
return {
|
|
120
|
+
$implicit: { cancel: () => this.cancel(), submit: () => this.submit() },
|
|
121
|
+
};
|
|
115
122
|
}
|
|
116
123
|
}
|
|
117
|
-
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
118
|
-
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "
|
|
119
|
-
|
|
124
|
+
DataEntryDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DataEntryDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
125
|
+
DataEntryDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: DataEntryDialogComponent, selector: "imng-data-entry-dialog[parentComponent]", inputs: { 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
|
|
126
|
+
[width]="width"
|
|
127
|
+
[height]="height"
|
|
128
|
+
(close)="close()"
|
|
129
|
+
[autoFocusedElement]="autoFocusedElement || ''"
|
|
130
|
+
>
|
|
131
|
+
<kendo-dialog-titlebar class="bg-primary">{{
|
|
132
|
+
dialogTitle
|
|
133
|
+
}}</kendo-dialog-titlebar>
|
|
120
134
|
<ng-content></ng-content>
|
|
121
135
|
<kendo-dialog-actions>
|
|
122
|
-
<ng-container
|
|
136
|
+
<ng-container
|
|
137
|
+
*ngTemplateOutlet="
|
|
138
|
+
dialogBtnsTemplate || defaultDialogActionsTpl;
|
|
139
|
+
context: dialogActionBtnsCtx
|
|
140
|
+
"
|
|
141
|
+
>
|
|
123
142
|
</ng-container>
|
|
124
143
|
</kendo-dialog-actions>
|
|
125
144
|
</kendo-dialog>
|
|
126
145
|
|
|
127
146
|
<ng-template #defaultDialogActionsTpl>
|
|
128
147
|
<button id="btnCancel" class="k-button" (click)="cancel()">Cancel</button>
|
|
129
|
-
<button id="btnSave" class="k-button k-primary" (click)="submit()">
|
|
148
|
+
<button id="btnSave" class="k-button k-primary" (click)="submit()">
|
|
149
|
+
{{ saveButtonText }}
|
|
150
|
+
</button>
|
|
130
151
|
</ng-template>`, isInline: true, components: [{ type: i1.DialogComponent, selector: "kendo-dialog", inputs: ["actionsLayout", "actions", "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: ["layout", "actions"], outputs: ["action"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: DataEntryDialogComponent, decorators: [{
|
|
132
153
|
type: Component,
|
|
133
154
|
args: [{
|
|
134
155
|
selector: 'imng-data-entry-dialog[parentComponent]',
|
|
135
|
-
template: `<kendo-dialog
|
|
136
|
-
|
|
156
|
+
template: `<kendo-dialog
|
|
157
|
+
[width]="width"
|
|
158
|
+
[height]="height"
|
|
159
|
+
(close)="close()"
|
|
160
|
+
[autoFocusedElement]="autoFocusedElement || ''"
|
|
161
|
+
>
|
|
162
|
+
<kendo-dialog-titlebar class="bg-primary">{{
|
|
163
|
+
dialogTitle
|
|
164
|
+
}}</kendo-dialog-titlebar>
|
|
137
165
|
<ng-content></ng-content>
|
|
138
166
|
<kendo-dialog-actions>
|
|
139
|
-
<ng-container
|
|
167
|
+
<ng-container
|
|
168
|
+
*ngTemplateOutlet="
|
|
169
|
+
dialogBtnsTemplate || defaultDialogActionsTpl;
|
|
170
|
+
context: dialogActionBtnsCtx
|
|
171
|
+
"
|
|
172
|
+
>
|
|
140
173
|
</ng-container>
|
|
141
174
|
</kendo-dialog-actions>
|
|
142
175
|
</kendo-dialog>
|
|
143
176
|
|
|
144
177
|
<ng-template #defaultDialogActionsTpl>
|
|
145
178
|
<button id="btnCancel" class="k-button" (click)="cancel()">Cancel</button>
|
|
146
|
-
<button id="btnSave" class="k-button k-primary" (click)="submit()">
|
|
179
|
+
<button id="btnSave" class="k-button k-primary" (click)="submit()">
|
|
180
|
+
{{ saveButtonText }}
|
|
181
|
+
</button>
|
|
147
182
|
</ng-template>`,
|
|
148
183
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
149
184
|
}]
|
|
@@ -164,10 +199,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImpo
|
|
|
164
199
|
|
|
165
200
|
class ImngDataEntryDialogModule {
|
|
166
201
|
}
|
|
167
|
-
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
168
|
-
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
169
|
-
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
202
|
+
ImngDataEntryDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ImngDataEntryDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
203
|
+
ImngDataEntryDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ImngDataEntryDialogModule, declarations: [DataEntryDialogComponent, DialogButtonsDirective], imports: [CommonModule, DialogModule], exports: [DataEntryDialogComponent, DialogButtonsDirective] });
|
|
204
|
+
ImngDataEntryDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ImngDataEntryDialogModule, imports: [[CommonModule, DialogModule]] });
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: ImngDataEntryDialogModule, decorators: [{
|
|
171
206
|
type: NgModule,
|
|
172
207
|
args: [{
|
|
173
208
|
imports: [CommonModule, DialogModule],
|
|
@@ -178,13 +213,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.11", ngImpo
|
|
|
178
213
|
|
|
179
214
|
function updateStateCollectionItem(collection, item) {
|
|
180
215
|
const items = [...collection];
|
|
181
|
-
const index = collection.
|
|
216
|
+
const index = collection.findIndex((val) => val.id === item.id);
|
|
182
217
|
items.splice(index, 1, item);
|
|
183
218
|
return items;
|
|
184
219
|
}
|
|
185
220
|
function removeStateCollectionItem(collection, item) {
|
|
186
221
|
const items = [...collection];
|
|
187
|
-
const index = collection.
|
|
222
|
+
const index = collection.findIndex((val) => val.id === item.id);
|
|
188
223
|
items.splice(index, 1);
|
|
189
224
|
return items;
|
|
190
225
|
}
|
|
@@ -201,4 +236,4 @@ const formGroupPatcher = (addEditForm) => (source) => source.pipe(filter(t => !!
|
|
|
201
236
|
*/
|
|
202
237
|
|
|
203
238
|
export { BaseDataEntryComponent, DataEntryDialogComponent, DialogButtonsDirective, ImngDataEntryDialogModule, addStateCollectionItem, formGroupPatcher, removeStateCollectionItem, updateStateCollectionItem };
|
|
204
|
-
//# sourceMappingURL=imng-kendo-data-entry.
|
|
239
|
+
//# sourceMappingURL=imng-kendo-data-entry.mjs.map
|
|
@@ -0,0 +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\n public allSubscriptions = new Subscriptions();\n public abstract dialogTitle: string;\n public abstract props: unknown;\n public addEditForm?: 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 | undefined {\n return this.addEditForm?.controls[controlName].errors || undefined;\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 id=\"btnCancel\" class=\"k-button\" (click)=\"cancel()\">Cancel</button>\n <button id=\"btnSave\" class=\"k-button k-primary\" (click)=\"submit()\">\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,IA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AAgB,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;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './lib/data-entry.module';
|
|
1
|
+
export * from './lib/imng-kendo-data-entry.module';
|
|
2
2
|
export * from './lib/data-entry-dialog.component';
|
|
3
3
|
export * from './lib/base-data-entry.component';
|
|
4
4
|
export * from './lib/data-entry-facade';
|
|
@@ -6,4 +6,3 @@ export * from './lib/data-delete-facade';
|
|
|
6
6
|
export * from './lib/reducer-collection-logic';
|
|
7
7
|
export * from './lib/form-group-patcher';
|
|
8
8
|
export * from './lib/dialog-buttons.directive';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -22,22 +22,21 @@ export declare abstract class BaseDataEntryComponent<FACADE extends IBaseDataEnt
|
|
|
22
22
|
height: string | number;
|
|
23
23
|
allSubscriptions: Subscriptions;
|
|
24
24
|
abstract dialogTitle: string;
|
|
25
|
-
abstract props:
|
|
26
|
-
addEditForm
|
|
25
|
+
abstract props: unknown;
|
|
26
|
+
addEditForm?: FormGroup;
|
|
27
27
|
loading$: Observable<boolean>;
|
|
28
28
|
private readonly _submitted$;
|
|
29
29
|
get submitted$(): Observable<boolean>;
|
|
30
|
-
formControl(controlName: string): AbstractControl;
|
|
31
|
-
formControlErrors(controlName: string): ValidationErrors;
|
|
30
|
+
formControl(controlName: string): AbstractControl | undefined;
|
|
31
|
+
formControlErrors(controlName: string): ValidationErrors | undefined;
|
|
32
32
|
constructor(facade: FACADE);
|
|
33
33
|
ngOnDestroy(): void;
|
|
34
34
|
closeForm(): void;
|
|
35
35
|
onCancel(): void;
|
|
36
36
|
onSubmit(): void;
|
|
37
|
-
isDataInvalid(): boolean;
|
|
37
|
+
isDataInvalid(): boolean | undefined;
|
|
38
38
|
abstract initForm(): void;
|
|
39
39
|
abstract save(): void;
|
|
40
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseDataEntryComponent<any>, never>;
|
|
41
41
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseDataEntryComponent<any>, never, never, { "width": "width"; "height": "height"; }, {}, never>;
|
|
42
42
|
}
|
|
43
|
-
//# sourceMappingURL=base-data-entry.component.d.ts.map
|
|
@@ -9,21 +9,20 @@ export declare class DataEntryDialogComponent implements OnInit {
|
|
|
9
9
|
/**
|
|
10
10
|
* https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/initial-focus/
|
|
11
11
|
*/
|
|
12
|
-
autoFocusedElement
|
|
13
|
-
parentComponent
|
|
12
|
+
autoFocusedElement?: string;
|
|
13
|
+
parentComponent?: BaseDataEntryComponent<any>;
|
|
14
14
|
saveButtonText: string;
|
|
15
|
-
dialogBtnsTemplate
|
|
16
|
-
loading
|
|
17
|
-
addEditForm
|
|
15
|
+
dialogBtnsTemplate?: TemplateRef<unknown>;
|
|
16
|
+
loading$?: Observable<boolean>;
|
|
17
|
+
addEditForm?: FormGroup;
|
|
18
18
|
submitted: boolean;
|
|
19
|
-
dialogTitle
|
|
20
|
-
component
|
|
19
|
+
dialogTitle?: string;
|
|
20
|
+
component?: {};
|
|
21
21
|
ngOnInit(): void;
|
|
22
22
|
close(): void;
|
|
23
23
|
cancel(): void;
|
|
24
24
|
submit(): void;
|
|
25
|
-
get dialogActionBtnsCtx():
|
|
25
|
+
get dialogActionBtnsCtx(): object | null;
|
|
26
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataEntryDialogComponent, never>;
|
|
27
27
|
static ɵcmp: i0.ɵɵComponentDeclaration<DataEntryDialogComponent, "imng-data-entry-dialog[parentComponent]", never, { "width": "width"; "height": "height"; "autoFocusedElement": "autoFocusedElement"; "parentComponent": "parentComponent"; "saveButtonText": "saveButtonText"; }, {}, ["dialogBtnsTemplate"], ["*"]>;
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=data-entry-dialog.component.d.ts.map
|
|
@@ -6,4 +6,3 @@ export declare class DialogButtonsDirective {
|
|
|
6
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogButtonsDirective, never>;
|
|
7
7
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DialogButtonsDirective, "[imngDialogBtns]", never, {}, {}, never>;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=dialog-buttons.directive.d.ts.map
|
|
@@ -8,4 +8,3 @@ export declare class ImngDataEntryDialogModule {
|
|
|
8
8
|
static ɵmod: i0.ɵɵNgModuleDeclaration<ImngDataEntryDialogModule, [typeof i1.DataEntryDialogComponent, typeof i2.DialogButtonsDirective], [typeof i3.CommonModule, typeof i4.DialogModule], [typeof i1.DataEntryDialogComponent, typeof i2.DialogButtonsDirective]>;
|
|
9
9
|
static ɵinj: i0.ɵɵInjectorDeclaration<ImngDataEntryDialogModule>;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=data-entry.module.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imng-kendo-data-entry",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"description": "A library to make integrating Angular Kendo forms and NGRX a bit simpler.",
|
|
4
|
+
"version": "4.102.13",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": ">=
|
|
7
|
-
"@angular/core": ">=
|
|
8
|
-
"@angular/forms": ">=
|
|
9
|
-
"@
|
|
10
|
-
"@ngrx/store": ">=12.x",
|
|
11
|
-
"@nrwl/angular": ">=12.x",
|
|
6
|
+
"@angular/common": ">=13.x",
|
|
7
|
+
"@angular/core": ">=13.x",
|
|
8
|
+
"@angular/forms": ">=13.x",
|
|
9
|
+
"@ngrx/store": ">=13.x",
|
|
12
10
|
"@progress/kendo-angular-dialog": ">=5.x",
|
|
13
|
-
"imng-nrsrx-client-utils": "*",
|
|
14
11
|
"imng-ngrx-utils": "*",
|
|
15
|
-
"
|
|
12
|
+
"imng-nrsrx-client-utils": "*",
|
|
13
|
+
"rxjs": "*",
|
|
14
|
+
"@angular/platform-browser": "13.3.2"
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"tslib": "
|
|
17
|
+
"tslib": "^2.3.0"
|
|
19
18
|
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"Angular",
|
|
21
|
+
"Kendo",
|
|
22
|
+
"Forms",
|
|
23
|
+
"NGRX"
|
|
24
|
+
],
|
|
25
|
+
"license": "MIT",
|
|
20
26
|
"repository": {
|
|
21
27
|
"type": "git",
|
|
22
28
|
"url": "https://github.com/ikemtz/AngularMonoRepo.git"
|
|
@@ -27,11 +33,32 @@
|
|
|
27
33
|
"name": "Isaac Martinez <@ikemtz>",
|
|
28
34
|
"url": "https://github.com/ikemtz"
|
|
29
35
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"fesm2015": "fesm2015/imng-kendo-data-entry.
|
|
36
|
+
"module": "fesm2015/imng-kendo-data-entry.mjs",
|
|
37
|
+
"es2020": "fesm2020/imng-kendo-data-entry.mjs",
|
|
38
|
+
"esm2020": "esm2020/imng-kendo-data-entry.mjs",
|
|
39
|
+
"fesm2020": "fesm2020/imng-kendo-data-entry.mjs",
|
|
40
|
+
"fesm2015": "fesm2015/imng-kendo-data-entry.mjs",
|
|
35
41
|
"typings": "imng-kendo-data-entry.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": {
|
|
44
|
+
"default": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
".": {
|
|
47
|
+
"types": "./imng-kendo-data-entry.d.ts",
|
|
48
|
+
"esm2020": "./esm2020/imng-kendo-data-entry.mjs",
|
|
49
|
+
"es2020": "./fesm2020/imng-kendo-data-entry.mjs",
|
|
50
|
+
"es2015": "./fesm2015/imng-kendo-data-entry.mjs",
|
|
51
|
+
"node": "./fesm2015/imng-kendo-data-entry.mjs",
|
|
52
|
+
"default": "./fesm2020/imng-kendo-data-entry.mjs"
|
|
53
|
+
},
|
|
54
|
+
"./testing": {
|
|
55
|
+
"types": "./testing/imng-kendo-data-entry-testing.d.ts",
|
|
56
|
+
"esm2020": "./esm2020/testing/imng-kendo-data-entry-testing.mjs",
|
|
57
|
+
"es2020": "./fesm2020/imng-kendo-data-entry-testing.mjs",
|
|
58
|
+
"es2015": "./fesm2015/imng-kendo-data-entry-testing.mjs",
|
|
59
|
+
"node": "./fesm2015/imng-kendo-data-entry-testing.mjs",
|
|
60
|
+
"default": "./fesm2020/imng-kendo-data-entry-testing.mjs"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
36
63
|
"sideEffects": false
|
|
37
|
-
}
|
|
64
|
+
}
|
|
@@ -2,4 +2,3 @@ import { HttpClient } from '@angular/common/http';
|
|
|
2
2
|
export declare function testDeleteCurrentEntity<TFacade extends {
|
|
3
3
|
deleteExistingEntity(entity: unknown): void;
|
|
4
4
|
}>(facade: TFacade, httpClient: HttpClient): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=data-delete-facade-http-tests.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="jest" />
|
|
2
2
|
import { IDataDeleteFacade } from 'imng-kendo-data-entry';
|
|
3
3
|
export declare class DataDeleteMockFacade implements IDataDeleteFacade<any> {
|
|
4
4
|
deleteExistingEntity: jest.Mock<any, any>;
|
|
5
5
|
}
|
|
6
6
|
export declare function createDataDeleteMockFacade(mockFacade?: IDataDeleteFacade<object> | any): IDataDeleteFacade<object>;
|
|
7
|
-
//# sourceMappingURL=data-delete-mock.facade.d.ts.map
|
|
@@ -5,4 +5,3 @@ export declare function testSaveCurrentEntity<TFacade extends {
|
|
|
5
5
|
export declare function testUpdateCurrentEntity<TFacade extends {
|
|
6
6
|
updateExistingEntity(entity: unknown): void;
|
|
7
7
|
}>(facade: TFacade, httpClient: HttpClient): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=data-entry-facade-http-tests.d.ts.map
|
|
@@ -3,9 +3,8 @@ export declare function testAddSetAndClearCurrentEntity<TFacade extends Testable
|
|
|
3
3
|
export declare function testEditSetAndClearCurrentEntity<TFacade extends TestableFacade>(facade: TFacade): Promise<void>;
|
|
4
4
|
export interface TestableFacade {
|
|
5
5
|
currentEntity$: Observable<unknown>;
|
|
6
|
-
isEditActive$: Observable<boolean>;
|
|
7
|
-
isNewActive$: Observable<boolean>;
|
|
6
|
+
isEditActive$: Observable<boolean | null>;
|
|
7
|
+
isNewActive$: Observable<boolean | null>;
|
|
8
8
|
setCurrentEntity(entity: unknown, parentEntity?: unknown): void;
|
|
9
9
|
clearCurrentEntity(): void;
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=data-entry-facade-tests.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="jest" />
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { IDataEntryFacade } from 'imng-kendo-data-entry';
|
|
4
|
-
export declare class DataEntryMockFacade implements IDataEntryFacade<
|
|
4
|
+
export declare class DataEntryMockFacade implements IDataEntryFacade<unknown> {
|
|
5
5
|
loading$: Observable<boolean>;
|
|
6
|
-
currentEntity$: Observable<
|
|
6
|
+
currentEntity$: Observable<unknown>;
|
|
7
7
|
isEditActive$: Observable<boolean>;
|
|
8
8
|
isNewActive$: Observable<boolean>;
|
|
9
9
|
setCurrentEntity: jest.Mock<any, any>;
|
|
@@ -11,5 +11,4 @@ export declare class DataEntryMockFacade implements IDataEntryFacade<object> {
|
|
|
11
11
|
saveNewEntity: jest.Mock<any, any>;
|
|
12
12
|
updateExistingEntity: jest.Mock<any, any>;
|
|
13
13
|
}
|
|
14
|
-
export declare function createDataEntryMockFacade(mockFacade?: IDataEntryFacade<
|
|
15
|
-
//# sourceMappingURL=data-entry-mock.facade.d.ts.map
|
|
14
|
+
export declare function createDataEntryMockFacade(mockFacade?: IDataEntryFacade<unknown> | any): IDataEntryFacade<unknown>;
|
package/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="jest" />
|
|
2
2
|
import { BaseDataEntryComponent } from 'imng-kendo-data-entry';
|
|
3
3
|
import { DataEntryMockFacade } from './data-entry-mock.facade';
|
|
4
4
|
export declare class MockDataEntryComponent extends BaseDataEntryComponent<DataEntryMockFacade> {
|
|
@@ -7,4 +7,3 @@ export declare class MockDataEntryComponent extends BaseDataEntryComponent<DataE
|
|
|
7
7
|
initForm: jest.Mock<any, any>;
|
|
8
8
|
save: () => jest.Mock<any, any>;
|
|
9
9
|
}
|
|
10
|
-
//# sourceMappingURL=mock-data-entry-dialog.component.d.ts.map
|
package/testing/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"fesm2015": "../fesm2015/imng-kendo-data-entry-testing.
|
|
2
|
+
"module": "../fesm2015/imng-kendo-data-entry-testing.mjs",
|
|
3
|
+
"es2020": "../fesm2020/imng-kendo-data-entry-testing.mjs",
|
|
4
|
+
"esm2020": "../esm2020/testing/imng-kendo-data-entry-testing.mjs",
|
|
5
|
+
"fesm2020": "../fesm2020/imng-kendo-data-entry-testing.mjs",
|
|
6
|
+
"fesm2015": "../fesm2015/imng-kendo-data-entry-testing.mjs",
|
|
7
7
|
"typings": "imng-kendo-data-entry-testing.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"name": "imng-kendo-data-entry/testing"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ComponentFixture } from '@angular/core/testing';
|
|
2
2
|
export declare function triggerSaveClickEvent<TComponent>(fixture: ComponentFixture<TComponent>): void;
|
|
3
3
|
export declare function triggerCancelClickEvent<TComponent>(fixture: ComponentFixture<TComponent>): void;
|
|
4
|
-
//# sourceMappingURL=test-trigger-event-helpers.d.ts.map
|