2023-09-12 15:07:33 +03:00
|
|
|
<!--
|
|
|
|
|
|
2023-10-19 17:30:02 +03:00
|
|
|
Copyright © 2016-2023 The Thingsboard Authors
|
2023-09-12 15:07:33 +03:00
|
|
|
|
2023-10-19 17:30:02 +03:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
2023-09-12 15:07:33 +03:00
|
|
|
|
2023-10-19 17:30:02 +03:00
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
2023-09-12 15:07:33 +03:00
|
|
|
|
2023-10-19 17:30:02 +03:00
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
2023-09-12 15:07:33 +03:00
|
|
|
|
|
|
|
|
-->
|
2023-10-20 15:09:40 +03:00
|
|
|
<mat-form-field [appearance]="appearance" [ngClass]="ngClass"
|
|
|
|
|
[subscriptSizing]="subscriptSizing" style="width: 100%">
|
|
|
|
|
<mat-label *ngIf="label">{{label}}</mat-label>
|
2023-09-12 15:07:33 +03:00
|
|
|
<input matInput #nameInput [formControl]="selectionFormControl"
|
2023-10-20 15:09:40 +03:00
|
|
|
[placeholder]="placeholderText"
|
2023-09-12 15:07:33 +03:00
|
|
|
(focusin)="onFocus()"
|
|
|
|
|
[matAutocomplete]="optionsAutocomplete">
|
2023-10-20 15:09:40 +03:00
|
|
|
<button *ngIf="selectionFormControl.value && !disabled"
|
2023-09-12 15:07:33 +03:00
|
|
|
type="button"
|
|
|
|
|
class="tb-icon-24"
|
|
|
|
|
matSuffix mat-icon-button aria-label="Clear"
|
|
|
|
|
(click)="clear()">
|
|
|
|
|
<mat-icon class="material-icons">close</mat-icon>
|
|
|
|
|
</button>
|
2023-10-20 15:09:40 +03:00
|
|
|
<mat-icon *ngIf="selectionFormControl.hasError('required') && !showInlineError"
|
|
|
|
|
matIconSuffix
|
|
|
|
|
[matTooltip]="errorText"
|
2023-09-12 15:07:33 +03:00
|
|
|
matTooltipPosition="above"
|
2023-10-20 15:09:40 +03:00
|
|
|
[matTooltipClass]="tooltipClass"
|
|
|
|
|
class="material-icons tb-suffix-show-always tb-error">
|
2023-09-12 15:07:33 +03:00
|
|
|
warning
|
|
|
|
|
</mat-icon>
|
2023-10-20 15:09:40 +03:00
|
|
|
<mat-error *ngIf="selectionFormControl.hasError('required') && showInlineError">
|
|
|
|
|
{{errorText}}
|
|
|
|
|
</mat-error>
|
2023-09-12 15:07:33 +03:00
|
|
|
<mat-autocomplete
|
|
|
|
|
#optionsAutocomplete="matAutocomplete"
|
|
|
|
|
class="tb-autocomplete tb-options-input-autocomplete"
|
|
|
|
|
panelWidth="fit-content">
|
2023-10-20 15:09:40 +03:00
|
|
|
<mat-option *ngFor="let option of filteredOptions$ | async" [value]="option">
|
2023-09-12 15:07:33 +03:00
|
|
|
<span class="tb-option-name" fxFlex [innerHTML]="option | highlight:searchText:true:'ig'"></span>
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-autocomplete>
|
|
|
|
|
</mat-form-field>
|