keevo-components 1.8.453 → 1.8.454
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/esm2022/lib/api/services/component.service.mjs +19 -4
- package/fesm2022/keevo-components.mjs +18 -3
- package/fesm2022/keevo-components.mjs.map +1 -1
- package/lib/components/kv-table/kv-table.component.d.ts +1 -1
- package/lib/components/kv-table-expandable/kv-table-expandable.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlName, FormGroupDirective, NgControl } from '@angular/forms';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
// export class ComponentService {
|
|
5
|
+
// constructor(public readonly injector: Injector, public changeDetectorRef: ChangeDetectorRef) {}
|
|
6
|
+
// getFormControl(): FormControl<any> | undefined {
|
|
7
|
+
// const control = this.injector.get(NgControl)?.control;
|
|
8
|
+
// return control instanceof FormControl ? control : undefined;
|
|
9
|
+
// }
|
|
10
|
+
// }
|
|
4
11
|
export class ComponentService {
|
|
5
12
|
constructor(injector, changeDetectorRef) {
|
|
6
13
|
this.injector = injector;
|
|
7
14
|
this.changeDetectorRef = changeDetectorRef;
|
|
8
15
|
}
|
|
9
16
|
getFormControl() {
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
try {
|
|
18
|
+
const control = this.injector.get(NgControl);
|
|
19
|
+
if (control.constructor === FormControlName) {
|
|
20
|
+
return this.injector.get(FormGroupDirective).getControl(control);
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
catch (ex) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
12
27
|
}
|
|
13
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ComponentService, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
14
29
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ComponentService }); }
|
|
@@ -16,4 +31,4 @@ export class ComponentService {
|
|
|
16
31
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ComponentService, decorators: [{
|
|
17
32
|
type: Injectable
|
|
18
33
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i0.ChangeDetectorRef }] });
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9rZWV2by1jb21wb25lbnRzL3NyYy9saWIvYXBpL3NlcnZpY2VzL2NvbXBvbmVudC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxVQUFVLEVBRVgsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUVMLGVBQWUsRUFDZixrQkFBa0IsRUFDbEIsU0FBUyxFQUNWLE1BQU0sZ0JBQWdCLENBQUM7O0FBR3hCLGtDQUFrQztBQUVsQyxvR0FBb0c7QUFFcEcscURBQXFEO0FBQ3JELDZEQUE2RDtBQUM3RCxtRUFBbUU7QUFDbkUsTUFBTTtBQUNOLElBQUk7QUFDSixNQUFNLE9BQU8sZ0JBQWdCO0lBRTNCLFlBQTRCLFFBQWtCLEVBQVMsaUJBQW9DO1FBQS9ELGFBQVEsR0FBUixRQUFRLENBQVU7UUFBUyxzQkFBaUIsR0FBakIsaUJBQWlCLENBQW1CO0lBQUksQ0FBQztJQUVoRyxjQUFjO1FBQ1osSUFBSSxDQUFDO1lBQ0gsTUFBTSxPQUFPL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Jcbi8vICAgICBjb25zdCBjb250cm9sID0gdGhpcy5pbmplY3Rvci5nZXQoTmdDb250cm9sKT8uY29udHJvbDtcclxuLy8gICAgIHJldHVybiBjb250cm9sIGluc3RhbmNlb2YgRm9ybUNvbnRyb2wgPyBjb250cm9sIDogdW5kZWZpbmVkO1xyXG4vLyAgIH1cclxuLy8gfVxyXG5leHBvcnQgY2xhc3MgQ29tcG9uZW50U2VydmljZSB7XHJcblxyXG4gIGNvbnN0cnVjdG9yKHB1YmxpYyByZWFkb25seSBpbmplY3RvcjogSW5qZWN0b3IsIHB1YmxpYyBjaGFuZ2VEZXRlY3RvclJlZjogQ2hhbmdlRGV0ZWN0b3JSZWYpIHsgfVxyXG5cclxuICBnZXRGb3JtQ29udHJvbCgpOiBGb3JtQ29udHJvbDxhbnk+IHwgdW5kZWZpbmVkIHtcclxuICAgIHRyeSB7XHJcbiAgICAgIGNvbnN0IGNvbnRyb2wgPSB0aGlzLmluamVjdG9yLmdldChOZ0NvbnRyb2wpO1xyXG4gICAgICBpZiAoY29udHJvbC5jb25zdHJ1Y3RvciA9PT0gRm9ybUNvbnRyb2xOYW1lKSB7XHJcbiAgICAgICAgcmV0dXJuIHRoaXMuaW5qZWN0b3IuZ2V0KEZvcm1Hcm91cERpcmVjdGl2ZSkuZ2V0Q29udHJvbChjb250cm9sIGFzIEZvcm1Db250cm9sTmFtZSk7XHJcbiAgICAgIH1cclxuXHJcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XHJcbiAgICB9XHJcbiAgICBjYXRjaCAoZXgpIHtcclxuICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcclxuICAgIH1cclxuICB9XHJcbn0iXX0=
|
|
@@ -13,7 +13,7 @@ import { MenuModule } from 'primeng/menu';
|
|
|
13
13
|
import * as i2 from 'primeng/ripple';
|
|
14
14
|
import { RippleModule } from 'primeng/ripple';
|
|
15
15
|
import * as i2$1 from '@angular/forms';
|
|
16
|
-
import { FormGroup, NgControl,
|
|
16
|
+
import { FormGroup, NgControl, FormControlName, FormGroupDirective, NG_VALUE_ACCESSOR, Validators, FormsModule, ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
|
17
17
|
import { finalize, combineLatest, filter, Subject, debounceTime, of, BehaviorSubject, fromEvent, takeUntil, timer } from 'rxjs';
|
|
18
18
|
import * as i1$3 from 'primeng/dynamicdialog';
|
|
19
19
|
import { DynamicDialogModule, DialogService, DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';
|
|
@@ -1199,14 +1199,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
1199
1199
|
args: ['hasError']
|
|
1200
1200
|
}] } });
|
|
1201
1201
|
|
|
1202
|
+
// export class ComponentService {
|
|
1203
|
+
// constructor(public readonly injector: Injector, public changeDetectorRef: ChangeDetectorRef) {}
|
|
1204
|
+
// getFormControl(): FormControl<any> | undefined {
|
|
1205
|
+
// const control = this.injector.get(NgControl)?.control;
|
|
1206
|
+
// return control instanceof FormControl ? control : undefined;
|
|
1207
|
+
// }
|
|
1208
|
+
// }
|
|
1202
1209
|
class ComponentService {
|
|
1203
1210
|
constructor(injector, changeDetectorRef) {
|
|
1204
1211
|
this.injector = injector;
|
|
1205
1212
|
this.changeDetectorRef = changeDetectorRef;
|
|
1206
1213
|
}
|
|
1207
1214
|
getFormControl() {
|
|
1208
|
-
|
|
1209
|
-
|
|
1215
|
+
try {
|
|
1216
|
+
const control = this.injector.get(NgControl);
|
|
1217
|
+
if (control.constructor === FormControlName) {
|
|
1218
|
+
return this.injector.get(FormGroupDirective).getControl(control);
|
|
1219
|
+
}
|
|
1220
|
+
return undefined;
|
|
1221
|
+
}
|
|
1222
|
+
catch (ex) {
|
|
1223
|
+
return undefined;
|
|
1224
|
+
}
|
|
1210
1225
|
}
|
|
1211
1226
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ComponentService, deps: [{ token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1212
1227
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: ComponentService }); }
|