alarm-event-selector/alarm-event-selection-list/alarm-event-selection-list.component.ts
ControlValueAccessor
Validator
OnInit
OnDestroy
providers |
{
provide: NG_VALUE_ACCESSOR, multi: true, useExisting: forwardRef(() => AlarmEventSelectionListComponent)
}
{
provide: NG_VALIDATORS, useExisting: forwardRef(() => AlarmEventSelectionListComponent), multi: true
}
|
selector | c8y-alarm-event-selection-list |
templateUrl | ./alarm-event-selection-list.component.html |
Properties |
Methods |
Inputs |
constructor(alarmEventModalService: AlarmEventSelectorModalService, alarmEventSelectService: AlarmEventSelectorService, formBuilder: FormBuilder, widgetComponent: WidgetConfigComponent)
|
|||||||||||||||
Parameters :
|
activeToggleAsSwitch |
Type : boolean
|
Default value : true
|
addButtonLabel |
Type : string
|
canDragAndDrop |
Type : boolean
|
Default value : true
|
canEdit |
Type : boolean
|
Default value : true
|
canRemove |
Type : boolean
|
Default value : true
|
config |
Type : Partial<AlarmEventSelectorModalOptions>
|
Default value : {}
|
The configuration for the alarms-events selector modal. |
hideSource |
Type : boolean
|
Default value : false
|
inline |
Type : boolean
|
Default value : false
|
omitProperties |
Type : OmitSelectorProperties
|
Default value : { color: false, label: false }
|
timelineType |
Type : TimelineType
|
Default value : 'ALARM'
|
title |
Type : string
|
add |
add()
|
Returns :
void
|
drop | ||||||
drop(event: CdkDragDrop<AlarmOrEvent[]>)
|
||||||
Parameters :
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
onItemRemoved | ||||||
onItemRemoved(index: number)
|
||||||
Parameters :
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Parameters :
Returns :
void
|
validate | ||||||
validate(_control: AbstractControl)
|
||||||
Parameters :
Returns :
ValidationErrors
|
writeValue | ||||||
writeValue(val: AlarmOrEvent[])
|
||||||
Parameters :
Returns :
void
|
emptyState |
Type : EmptyStateComponent
|
Decorators :
@ContentChild(EmptyStateComponent)
|
formArray |
Type : FormArray
|
timelineTypeTexts |
Type : TimelineTypeTexts
|
<div
class="card-header separator sticky-top bg-component"
*ngIf="inline"
>
<span class="card-title h4">{{ title | translate }}</span>
</div>
<c8y-list-group
class="flex-grow ff-scroll-fix cdk-droplist"
cdkDropList
(cdkDropListDropped)="drop($event)"
[cdkDropListDisabled]="formArray.controls?.length < 2"
>
<div
class="p-t-8"
*ngIf="!formArray.controls?.length"
>
<ng-content select="c8y-ui-empty-state"></ng-content>
<c8y-ui-empty-state
class="p-t-8"
[icon]="timelineTypeTexts.emptyStateIcon"
[title]="timelineTypeTexts.emptyStateTitle | translate"
[subtitle]="timelineTypeTexts.emptyStateSubtitle | translate"
*ngIf="!emptyState"
[horizontal]="true"
></c8y-ui-empty-state>
</div>
<div
*ngFor="let itemForm of formArray.controls; let index = index"
[formGroup]="itemForm"
>
<c8y-alarm-event-selector-list-item
class="d-block"
cdkDrag
[cdkDragDisabled]="!canDragAndDrop"
formControlName="details"
[showAddRemoveButton]="false"
[optionToRemove]="canRemove"
[showActiveToggle]="true"
[timelineType]="timelineType"
[allowItemEdit]="canEdit"
[hideSource]="hideSource"
[displayAsSwitch]="activeToggleAsSwitch"
[omitProperties]="omitProperties"
(removed)="onItemRemoved(index)"
>
<c8y-li-drag-handle
title="{{ 'Click and drag to reorder' | translate }}"
cdkDragHandle
*ngIf="canDragAndDrop"
>
<i c8yIcon="drag-reorder"></i>
</c8y-li-drag-handle>
</c8y-alarm-event-selector-list-item>
</div>
</c8y-list-group>
<div class="card-footer bg-inherit separator-bottom">
<button
class="btn btn-default btn-sm"
[title]="addButtonLabel | translate"
type="button"
[ngClass]="{ 'btn-block': inline }"
(click)="add()"
>
<i
c8yIcon="plus-circle"
*ngIf="canDragAndDrop"
></i>
{{ addButtonLabel | translate }}
</button>
</div>