44 lines
1.8 KiB
HTML
44 lines
1.8 KiB
HTML
|
|
<!--
|
||
|
|
|
||
|
|
Copyright © 2016-2024 The Thingsboard Authors
|
||
|
|
|
||
|
|
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
|
||
|
|
|
||
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
|
|
||
|
|
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.
|
||
|
|
|
||
|
|
-->
|
||
|
|
<mat-form-field [formGroup]="mathFunctionForm" class="mat-block">
|
||
|
|
<mat-label translate>tb.rulenode.functions-field-input</mat-label>
|
||
|
|
<input [required]="required"
|
||
|
|
(focusin)="onFocus()"
|
||
|
|
type="text"
|
||
|
|
#operationInput matInput
|
||
|
|
formControlName="operation"
|
||
|
|
[matAutocomplete]="auto">
|
||
|
|
<button *ngIf="mathFunctionForm.get('operation').value"
|
||
|
|
type="button"
|
||
|
|
matSuffix mat-icon-button aria-label="Clear"
|
||
|
|
(click)="clear()">
|
||
|
|
<mat-icon class="material-icons">close</mat-icon>
|
||
|
|
</button>
|
||
|
|
<mat-autocomplete #auto="matAutocomplete" class="tb-autocomplete" [displayWith]="mathFunctionDisplayFn">
|
||
|
|
<mat-option *ngFor="let option of filteredOptions | async" [value]="option.value">
|
||
|
|
<span [innerHTML]="option.value + ' | ' + option.name | highlight:searchText"></span>
|
||
|
|
<small style="display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||
|
|
{{ option.description }}
|
||
|
|
</small>
|
||
|
|
</mat-option>
|
||
|
|
<mat-option *ngIf="!(filteredOptions | async)?.length" [value]="null">
|
||
|
|
<span translate>tb.rulenode.no-option-found</span>
|
||
|
|
</mat-option>
|
||
|
|
</mat-autocomplete>
|
||
|
|
</mat-form-field>
|