58 lines
2.2 KiB
HTML
58 lines
2.2 KiB
HTML
<!--
|
|
|
|
Copyright © 2016-2025 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.
|
|
|
|
-->
|
|
<section [formGroup]="timeInputForm" class="flex gap-4">
|
|
<mat-form-field [class]="{'number': inlineField, 'max-w-66%': !inlineField, 'flex-full': !inlineField}"
|
|
[appearance]="inlineField ? 'outline' : appearance"
|
|
[subscriptSizing]="inlineField ? 'dynamic' : subscriptSizing">
|
|
@if (labelText && !inlineField) {
|
|
<mat-label>{{ labelText }}</mat-label>
|
|
}
|
|
<input type="number" min="0" step="1" matInput formControlName="time" placeholder="{{ 'widget-config.set' | translate }}">
|
|
<div matSuffix>
|
|
<ng-content select="[matSuffix]"></ng-content>
|
|
</div>
|
|
@if (inlineField) {
|
|
<mat-icon matSuffix
|
|
matTooltipPosition="above"
|
|
matTooltipClass="tb-error-tooltip"
|
|
[matTooltip]="hasError"
|
|
*ngIf="hasError"
|
|
class="tb-error">
|
|
warning
|
|
</mat-icon>
|
|
} @else {
|
|
<mat-hint *ngIf="subscriptSizing === 'fixed'"></mat-hint>
|
|
<mat-error *ngIf="hasError">
|
|
{{ hasError }}
|
|
</mat-error>
|
|
}
|
|
</mat-form-field>
|
|
<mat-form-field [class.h-fit.max-w-33%.flex-full]="!inlineField"
|
|
[appearance]="inlineField ? 'outline' : appearance"
|
|
[subscriptSizing]="inlineField ? 'dynamic' : subscriptSizing">
|
|
@if (!inlineField) {
|
|
<mat-label translate>rule-node-config.units</mat-label>
|
|
}
|
|
<mat-select formControlName="timeUnit">
|
|
@for (timeUnit of timeUnits; track timeUnit) {
|
|
<mat-option [value]="timeUnit">{{ timeUnitTranslations.get(timeUnit) | translate }}</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</section>
|