|
|
|
@ -33,8 +33,8 @@ import { DeviceProfileService } from '@core/http/device-profile.service'; |
|
|
|
import { Direction } from '@shared/models/page/sort-order'; |
|
|
|
import { isDefined, isDefinedAndNotNull, isObject, isString } from '@core/utils'; |
|
|
|
import { PageLink } from '@shared/models/page/page-link'; |
|
|
|
import { TruncatePipe } from '@shared/pipe/truncate.pipe'; |
|
|
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; |
|
|
|
import { MatAutocompleteTrigger } from '@angular/material/autocomplete'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'tb-profile-lwm2m-object-list', |
|
|
|
@ -79,13 +79,12 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V |
|
|
|
@Output() |
|
|
|
removeList = new EventEmitter<any>(); |
|
|
|
|
|
|
|
@ViewChild('objectInput') objectInput: ElementRef<HTMLInputElement>; |
|
|
|
@ViewChild('objectInput', {static: true}) objectInput: ElementRef<HTMLInputElement>; |
|
|
|
@ViewChild('objectInput', {static: true, read: MatAutocompleteTrigger}) matAutocompleteTrigger: MatAutocompleteTrigger; |
|
|
|
|
|
|
|
private propagateChange = (v: any) => { |
|
|
|
} |
|
|
|
private propagateChange: (value: any) => void = () => {}; |
|
|
|
|
|
|
|
constructor(public truncate: TruncatePipe, |
|
|
|
private deviceProfileService: DeviceProfileService, |
|
|
|
constructor(private deviceProfileService: DeviceProfileService, |
|
|
|
private fb: UntypedFormBuilder) { |
|
|
|
this.lwm2mListFormGroup = this.fb.group({ |
|
|
|
objectsList: [this.objectsList], |
|
|
|
@ -113,7 +112,7 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V |
|
|
|
this.propagateChange = fn; |
|
|
|
} |
|
|
|
|
|
|
|
registerOnTouched(fn: any): void { |
|
|
|
registerOnTouched(_fn: any): void { |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
@ -140,6 +139,9 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V |
|
|
|
if (isDefined(this.objectInput)) { |
|
|
|
this.clear('', false); |
|
|
|
} |
|
|
|
if (this.matAutocompleteTrigger.panelOpen) { |
|
|
|
this.matAutocompleteTrigger.closePanel(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.lwm2mListFormGroup.enable({emitEvent: false}); |
|
|
|
} |
|
|
|
|