2025-01-20 17:36:07 +02:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<section [formGroup]="timeInputForm" class="flex gap-4">
|
2025-01-22 15:43:59 +02:00
|
|
|
<mat-form-field class="max-w-66% flex-full" subscriptSizing="dynamic">
|
2025-01-20 17:36:07 +02:00
|
|
|
<mat-label *ngIf="labelText">{{ labelText }}</mat-label>
|
|
|
|
|
<input type="number" min="0" step="1" matInput formControlName="time">
|
|
|
|
|
<div matSuffix>
|
|
|
|
|
<ng-content select="[matSuffix]"></ng-content>
|
|
|
|
|
</div>
|
2025-01-23 17:01:21 +02:00
|
|
|
<mat-hint *ngIf="subscriptSizing === 'fixed'"></mat-hint>
|
2025-01-20 17:36:07 +02:00
|
|
|
<mat-error *ngIf="timeInputForm.get('time').hasError('required') && requiredText">
|
|
|
|
|
{{ requiredText }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
<mat-error *ngIf="timeInputForm.get('time').hasError('min') && minErrorText">
|
|
|
|
|
{{ minErrorText }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
<mat-error *ngIf="timeInputForm.get('time').hasError('max') && maxErrorText">
|
|
|
|
|
{{ maxErrorText }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
2025-01-23 17:01:21 +02:00
|
|
|
<mat-form-field class="h-fit max-w-33% flex-full" [subscriptSizing]="subscriptSizing">
|
2025-01-20 17:36:07 +02:00
|
|
|
<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>
|