widgets/implementations/linear-gauge/linear-gauge-widget-config/linear-gauge-widget-config.component.ts
OnInit
OnBeforeSave
selector | c8y-linear-gauge-widget-config |
standalone | true |
imports |
DatapointSelectorModule
ReactiveFormsModule
CoreModule
|
templateUrl | ./linear-gauge-widget-config.component.html |
Properties |
Methods |
Inputs |
constructor(formBuilder: FormBuilder, form: NgForm, widgetConfig: WidgetConfigComponent)
|
||||||||||||
Parameters :
|
config |
Type : literal type
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
onBeforeSave | ||||
onBeforeSave(config?)
|
||||
Parameters :
Returns :
boolean | Promise | Observable
|
datapointSelectionConfig |
Type : Partial<DatapointSelectorModalOptions>
|
Default value : {}
|
defaultFormOptions |
Type : Partial<DatapointAttributesFormConfig>
|
Default value : {
showRedRange: true,
showYellowRange: true,
showRange: true,
showTarget: true
}
|
formGroup |
Type : ReturnType<>
|
<div class="p-l-24 p-r-24">
<form
class="no-card-context"
[formGroup]="formGroup"
>
<div class="row">
<div class="col-md-6">
<c8y-datapoint-selection-list
class="bg-inherit p-t-8 d-block"
name="datapoints"
[defaultFormOptions]="defaultFormOptions"
[config]="datapointSelectionConfig"
[minActiveCount]="1"
[maxActiveCount]="1"
formControlName="datapoints"
></c8y-datapoint-selection-list>
</div>
<div class="col-md-6">
<c8y-form-group class="p-t-8">
<label translate>Decimal places</label>
<input
class="form-control"
name="fractionSize"
type="number"
formControlName="fractionSize"
step="1"
/>
<c8y-messages [show]="formGroup.controls.fractionSize.errors"></c8y-messages>
</c8y-form-group>
</div>
</div>
</form>
</div>