import * as i1 from '@c8y/ngx-components'; import { CellRendererContext, BaseColumn, ColumnConfig, FilteringFormRendererContext, ServerSideDataResult, BuiltInActionType, FilteringModifier, ExtensionFactory, DataGridService, AlertService, ModalService, UserPreferencesService, InventorySearchService, Column, Pagination, BulkActionControl, HeaderActionControl, GridConfig, ProductExperienceEventSource, LoadMoreMode, ActionControl, ServerSideDataCallback, DataGridComponent, ProductExperienceEvent, DataSourceModifier, FilteringActionType } from '@c8y/ngx-components'; import * as _c8y_client from '@c8y/client'; import { IManagedObject, InventoryService, UserService } from '@c8y/client'; import { TranslateService } from '@ngx-translate/core'; import * as i0 from '@angular/core'; import { OnInit, ElementRef, OnDestroy, EventEmitter } from '@angular/core'; import { SupportedIcons } from '@c8y/ngx-components/icon-selector/icons'; import { Observable } from 'rxjs'; import * as i2 from '@c8y/ngx-components/assets-navigator'; import * as i3 from 'ngx-bootstrap/popover'; import * as i4 from '@angular/router'; /** * Service contains logic extracted from the device-grid service to avoid circular dependency MTM-40239. */ declare class ColumnUtilService { protected translateService: TranslateService; constructor(translateService: TranslateService); getAlarmsHref(device: IManagedObject): string; getHref(groupOrDevice: IManagedObject, prefix?: string): string; getParentsNames(device: IManagedObject, featuredParentId?: string | number): string; getModel(device: IManagedObject): string; getProperName(device: IManagedObject): string; getSerialNumber(device: IManagedObject): string; private getHardware; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class AlarmsCellRendererComponent { context: CellRendererContext; columnUtilService: ColumnUtilService; readonly linkAriaLabel: "See alarms for device \"{{ name }}\""; constructor(context: CellRendererContext, columnUtilService: ColumnUtilService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class AlarmsDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class AlarmsHeaderCellRendererComponent { context: CellRendererContext; constructor(context: CellRendererContext); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class GroupCellRendererComponent { context: CellRendererContext; columnUtilService: ColumnUtilService; constructor(context: CellRendererContext, columnUtilService: ColumnUtilService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class GroupDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class GroupFilteringFormRendererComponent implements OnInit { context: FilteringFormRendererContext; assetSelector: ElementRef; model: any; preselected: string[]; initialSelection: string[]; isApplyDisabled: boolean; constructor(context: FilteringFormRendererContext); onEnterKeyUp(event: KeyboardEvent): void; onEscapeKeyDown(event: KeyboardEvent): void; ngOnInit(): void; ngAfterViewInit(): void; applyFilter(): void; resetFilter(): void; selectionChanged(nodes: any): void; private isSelectionChanged; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ImeiDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class ModelCellRendererComponent { context: CellRendererContext; columnUtilService: ColumnUtilService; constructor(context: CellRendererContext, columnUtilService: ColumnUtilService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ModelDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class NameCellRendererComponent { context: CellRendererContext; columnUtilService: ColumnUtilService; constructor(context: CellRendererContext, columnUtilService: ColumnUtilService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NameDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class RegistrationDateCellRendererComponent { context: CellRendererContext; constructor(context: CellRendererContext); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class RegistrationDateDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); protected formatDate(dateToFormat: string): string; } declare class SerialNumberCellRendererComponent { context: CellRendererContext; columnUtilService: ColumnUtilService; constructor(context: CellRendererContext, columnUtilService: ColumnUtilService); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SerialNumberDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class DeviceStatusCellRendererComponent { context: CellRendererContext; constructor(context: CellRendererContext); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class StatusDeviceGridColumn extends BaseColumn { constructor(); } declare class SystemIdDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class TypeDeviceGridColumn extends BaseColumn { constructor(initialColumnConfig?: ColumnConfig); } declare class IconDeviceGridColumnComponent { icon: SupportedIcons; constructor(context: CellRendererContext); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class IconDeviceGridColumn extends BaseColumn { iconRetriever?: (context: CellRendererContext) => SupportedIcons; constructor(options?: Partial, iconRetriever?: (context: CellRendererContext) => SupportedIcons); } type DataCallback = (serverSideDataResult: ServerSideDataResult) => ServerSideDataResult; interface FilterConfig { columnName: string; filteringModifier: FilteringModifier; } declare const enum DeviceGridActionType { Delete = "DELETE" } declare const enum DeviceGridBulkActionType { } /** * Defines an action hook for the device grid. * * @interface DeviceGridActionHook * @member {BuiltInActionType} type of the action * @member {boolean} refreshAfterActionDone refreshs the device grid after the action execution * @member {(mo: IManagedObject) => boolean} deviceMatches resolves the object of the row and needs to return true for an element that you want to execute your action on * ```typescript * { * ... * deviceMatches: (device: IManagedObject) => device?.type === 'my_custom_type' * } * ``` * @member {(mo: IManagedObject) => Observable | Promise | unknown} onAction is called for a matching device. It resolves the object of the row. * ```typescript * { * ... * onAction: (device: IManagedObject) => this.myService.triggerCustomAction(device) * } * ``` * * @deprecated Use `ActionControlHook` instead. */ interface DeviceGridActionHook { type: BuiltInActionType | string; text?: string; icon?: string; showOnHover?: boolean; refreshAfterActionDone: boolean; deviceMatches: (mo: IManagedObject) => boolean; onAction: (mo: IManagedObject) => Observable | Promise | unknown; } /** * @deprecated Use `ActionControlFactory` instead. */ type DeviceGridExtensionFactory = ExtensionFactory; declare class DeviceGridService extends DataGridService { protected inventoryService: InventoryService; protected userService: UserService; protected translateService: TranslateService; protected alertService: AlertService; protected modal: ModalService; protected columnUtilService: ColumnUtilService; protected userPreferencesService: UserPreferencesService; protected searchService: InventorySearchService; protected GRID_CONFIG_DEFAULT_STORAGE_KEY: string; constructor(inventoryService: InventoryService, userService: UserService, translateService: TranslateService, alertService: AlertService, modal: ModalService, columnUtilService: ColumnUtilService, userPreferencesService: UserPreferencesService, searchService: InventorySearchService); getDefaultColumns(): Column[]; getChildDeviceGridColumns(): Column[]; getDefaultPagination(): Pagination; getInfiniteScrollPagination(): Pagination; getDefaultBulkActionControls(): BulkActionControl[]; getDefaultHeaderActionControls(): HeaderActionControl[]; getProperName(device: IManagedObject): string; getModel(device: IManagedObject): string; getSerialNumber(device: IManagedObject): string; getParentsNames(device: IManagedObject, featuredParentId?: string | number): string; getHref(groupOrDevice: IManagedObject, prefix?: string): string; getAlarmsHref(device: IManagedObject): string; delete(device: IManagedObject): Promise; getData(columns: Column[], pagination: Pagination, query?: any, withChildren?: boolean, text?: any): Promise<_c8y_client.IResultList>; getChildDeviceData(columns: Column[], pagination: Pagination, query: any, withChildren: boolean, id: string): Promise<_c8y_client.IResultList>; getCount(columns: Column[], pagination: Pagination, query?: any, text?: string): Promise; getCountChildDevices(columns: Column[], pagination: Pagination, query: any, id: string): Promise; getTotalChildDevices(query: any, id: string): Promise; getTotal(query?: any): Promise; getDeviceQueryString(columns: Column[], query: any, text: string, isWildcardSearchEnabled: boolean): string; clearConfig(key?: string): void; getConfig$(key?: string): Observable; saveConfig$(config: GridConfig, key?: string): Observable; private getDevicesFilters; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class DeviceGridComponent implements OnDestroy, ProductExperienceEventSource { deviceGridService: DeviceGridService; /** Optional callback function that allows to modify server side data result before it's rendered. */ dataCallback: DataCallback; /** Takes an event emitter. When an event is emitted, the grid will be reloaded. */ refresh: EventEmitter; /** The title for the data grid, it's displayed in the grid's header. */ title: string; /** The label for load more button. */ loadMoreItemsLabel: "Load more devices"; /** The label for loading indicator. */ loadingItemsLabel: string; /** * @deprecated * * Internal use only: used to define user preferences key under which 'All devices' column config is stored. */ legacyConfigKey: string; /** * @deprecated * * Internal use only: used to define user preferences key under which 'All devices' filter/sorting config is stored. */ legacyFilterKey: string; /** The list of columns to be displayed in the grid. If not given, it defaults to standard columns. */ columns: Column[]; /** Pagination settings, e.g. allows for setting current page or page size. If not given, defaults to standard settings. */ set _pagination(value: Pagination); infiniteScroll: LoadMoreMode; /** Sets load more mode. */ set _infiniteScroll(infiniteScroll: LoadMoreMode); /** Sets action controls (actions available for individual items). If not given, it defaults to standard actions. */ set _actionControls(value: ActionControl[]); /** Determines whether items can be selected by clicking a checkbox in the first column. */ selectable: boolean; /** Restricts selection to a single row only. Selection column displays radio button instead of checkboxes */ singleSelection: boolean; /** Sets the base query which is appended to the request for data. */ baseQuery: object; /** Sets bulk action controls (actions available for items selected by user). If not given, it defaults to standard bulk actions. */ set _bulkActionControls(value: BulkActionControl[]); /** Sets header action controls (actions available from the grid header). If not given, it defaults to empty list of actions. */ set _headerActionControls(value: HeaderActionControl[]); childDeviceGrid: boolean; parentDeviceId: string; /** Sets the withChildren query which is appended to the request. */ withChildren: boolean; /** * Enables the search for devices where any device propery is matched agains the search term. * Enabled by default. This input does not take effect if the childDeviceGrid input is set to true */ showSearch: boolean; /** * Sets the class name used for active rows (last clicked). * Set empty string to disable appending active class to grid rows. */ activeClassName: string; /** Emits an event when columns configuration changes. */ onColumnsChange: EventEmitter; onFilterChange: EventEmitter; onDeviceQueryStringChange: EventEmitter; /** Emits an event when items selection changes. The array contains ids of selected items. */ itemsSelect: EventEmitter; actionControls: ActionControl[]; appliedFilters: FilterConfig[]; pagination: Pagination; bulkActionControls: BulkActionControl[]; headerActionControls: HeaderActionControl[]; serverSideDataCallback: ServerSideDataCallback; dataGrid: DataGridComponent; productExperienceEvent: ProductExperienceEvent; noResultsMessage: "No matching devices."; noDataMessage: "No devices to display."; noResultsSubtitle: "Refine your search terms"; private destroyed$; constructor(deviceGridService: DeviceGridService); ngOnDestroy(): void; trackByName(_index: any, column: Column): string; onDataSourceModifier(dataSourceModifier: DataSourceModifier): Promise; updateFiltering(columnNames: string[], action: { type: FilteringActionType; payload?: { filteringModifier: FilteringModifier; }; }): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class DeviceGridModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { AlarmsCellRendererComponent, AlarmsDeviceGridColumn, AlarmsHeaderCellRendererComponent, ColumnUtilService, DeviceGridActionType, DeviceGridBulkActionType, DeviceGridComponent, DeviceGridModule, DeviceGridService, DeviceStatusCellRendererComponent, GroupCellRendererComponent, GroupDeviceGridColumn, GroupFilteringFormRendererComponent, IconDeviceGridColumn, IconDeviceGridColumnComponent, ImeiDeviceGridColumn, ModelCellRendererComponent, ModelDeviceGridColumn, NameCellRendererComponent, NameDeviceGridColumn, RegistrationDateCellRendererComponent, RegistrationDateDeviceGridColumn, SerialNumberCellRendererComponent, SerialNumberDeviceGridColumn, StatusDeviceGridColumn, SystemIdDeviceGridColumn, TypeDeviceGridColumn }; export type { DataCallback, DeviceGridActionHook, DeviceGridExtensionFactory, FilterConfig }; //# sourceMappingURL=index.d.ts.map