@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
103 lines • 4.81 kB
TypeScript
import { AfterViewInit, EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { SeverityType } from '@c8y/client';
import { AlertService, DateTimeContext } from '@c8y/ngx-components';
import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';
import { Observable } from 'rxjs';
import { AlarmsViewService } from './alarms-view.service';
import { AlarmCount, AlarmListFormFilters } from './alarms.model';
import { ActivatedRoute, Router } from '@angular/router';
import * as i0 from "@angular/core";
export declare class AlarmsFilterComponent implements OnInit, AfterViewInit, OnDestroy {
private formBuilder;
private alarmsViewService;
private alertService;
private router;
private activatedRoute;
readonly severitiesList: SeverityType[];
contextSourceId: number | string | null;
/**
* EventEmitter to notify when filters have been applied.
* Emits a `AlarmListFormFilters` object representing the filter criteria applied by the user.
*/
onFilterApplied: EventEmitter<AlarmListFormFilters>;
filtersDropdown: BsDropdownDirective;
formGroup: import("@angular/forms").FormGroup<{
CRITICAL?: import("@angular/forms").FormControl<boolean>;
MAJOR?: import("@angular/forms").FormControl<boolean>;
MINOR?: import("@angular/forms").FormControl<boolean>;
WARNING?: import("@angular/forms").FormControl<boolean>;
}>;
chips: SeverityType[];
isIndeterminate$: Observable<boolean>;
countLoading: boolean;
showCleared: boolean;
alarmCounts: AlarmCount;
selectedDates: DateTimeContext;
shouldDisableApplyButton$: Observable<boolean>;
isEachCheckboxSelected$: Observable<boolean>;
protected readonly SEVERITY_LABELS: {
readonly CRITICAL: "CRITICAL";
readonly MAJOR: "MAJOR";
readonly MINOR: "MINOR";
readonly WARNING: "WARNING";
};
protected readonly PRODUCT_EXPERIENCE_ALARMS: {
readonly EVENTS: {
readonly ALARMS: "Alarms";
};
readonly COMPONENTS: {
readonly ALARMS_FILTER: "alarms-filter";
readonly ALARMS_INTERVAL_REFRESH: "alarms-interval-refresh";
readonly ALARMS: "alarms";
readonly ALARMS_TYPE_FILTER: "alarms-type-filter";
readonly ALARM_DETAILS: "alarm-details";
};
readonly ACTIONS: {
readonly APPLY_FILTER: "applyFilter";
readonly REMOVE_CHIP_FILTER: "removeChipFilter";
readonly APPLY_TYPE_FILTER: "applyTypeFilter";
readonly CREATE_SMART_RULE: "createSmartRule";
readonly ACKNOWLEDGE_ALARM: "acknowledgeAlarm";
readonly REACTIVATE_ALARM: "reactivateAlarm";
readonly CLEAR_ALARM: "clearAlarm";
readonly RELOAD_AUDIT_LOGS: "reloadAuditLogs";
readonly USER_SPEND_TIME_ON_COMPONENT: "userSpendTimeOnComponent";
};
};
private isNoneCheckboxSelected$;
private severitiesTouched$;
private currentFormGroupValues;
private currentShowClearedValue;
private destroy$;
constructor(formBuilder: FormBuilder, alarmsViewService: AlarmsViewService, alertService: AlertService, router: Router, activatedRoute: ActivatedRoute);
ngOnInit(): void;
ngAfterViewInit(): void;
ngOnDestroy(): void;
allChanged(selected: boolean): void;
applyFilters(emit?: boolean, navigate?: boolean): void;
deselectChip(chip: SeverityType): void;
closeDropdown(): void;
resetForm(): void;
markSeveritiesAsTouched(): void;
/**
* Asynchronously fetches and updates the count of alarms for each severity level.
*
* @param showCleared - Whether to include cleared alarms in the count.
* Defaults to the current value of `this.currentShowClearedValue`.
* @returns A Promise that resolves when all alarm counts have been fetched,
* or rejects with an error if the operation fails.
* @throws Will throw an error if any of the alarm count fetching promises reject.
*/
updateAlarmsCount(showCleared?: boolean): Promise<void>;
private createFormValueWithChangesStream;
private trackCheckboxStateWithFormChanges;
private createAllSelectedStream;
private createIndeterminateStream;
private trackAllCheckboxesDisabled;
private createDisableApplyButtonStream;
private updateChipsAndDefaultValues;
static ɵfac: i0.ɵɵFactoryDeclaration<AlarmsFilterComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<AlarmsFilterComponent, "c8y-alarms-filter", never, { "contextSourceId": { "alias": "contextSourceId"; "required": false; }; }, { "onFilterApplied": "onFilterApplied"; }, never, never, true, never>;
}
//# sourceMappingURL=alarms-filter.component.d.ts.map