@kms-ngx-ui/presentational 20.0.2 → 20.0.3
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Pipe, NgModule, EventEmitter, Output, Input, Directive, HostListener, PLATFORM_ID, DOCUMENT, Inject, Injectable, input, VERSION, forwardRef, ViewChild, effect, HostBinding, output, computed, model, signal, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
|
+
import { Component, Pipe, NgModule, EventEmitter, Output, Input, Directive, HostListener, PLATFORM_ID, DOCUMENT, Inject, Injectable, input, VERSION, forwardRef, inject, Injector, ViewChild, effect, HostBinding, output, computed, model, signal, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, CurrencyPipe, isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
|
-
import { NG_VALUE_ACCESSOR, UntypedFormGroup, UntypedFormControl, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, NgControl, UntypedFormGroup, UntypedFormControl, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
7
|
import * as i1$2 from '@angular/material/checkbox';
|
|
8
8
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
9
|
import * as i1$6 from '@angular/material/radio';
|
|
@@ -1329,12 +1329,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
1329
1329
|
}] } });
|
|
1330
1330
|
|
|
1331
1331
|
class FormControlParentComponent extends FormParentComponent {
|
|
1332
|
+
get ngControl() {
|
|
1333
|
+
if (this._ngControl === undefined) {
|
|
1334
|
+
this._ngControl = this.injector.get(NgControl, null);
|
|
1335
|
+
}
|
|
1336
|
+
return this._ngControl;
|
|
1337
|
+
}
|
|
1332
1338
|
constructor(renderer) {
|
|
1333
1339
|
super();
|
|
1334
1340
|
this.renderer = renderer;
|
|
1335
1341
|
this.defaultDataOverride = ''; // when we have NO form around, get default via input to set it manually
|
|
1336
1342
|
this.onSelectItemEmitter = new EventEmitter();
|
|
1337
1343
|
this.internalValue = '';
|
|
1344
|
+
this.injector = inject(Injector);
|
|
1345
|
+
this._ngControl = undefined;
|
|
1338
1346
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1339
1347
|
this.onChange = () => { };
|
|
1340
1348
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
@@ -1345,6 +1353,11 @@ class FormControlParentComponent extends FormParentComponent {
|
|
|
1345
1353
|
ngOnInit() {
|
|
1346
1354
|
super.ngOnInit();
|
|
1347
1355
|
}
|
|
1356
|
+
ngDoCheck() {
|
|
1357
|
+
if (this.ngControl?.control?.touched) {
|
|
1358
|
+
this.form?.markAllAsTouched();
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1348
1361
|
change(value) {
|
|
1349
1362
|
this.onChange(value);
|
|
1350
1363
|
this.onTouched();
|