import * as i0 from '@angular/core'; import { OnInit, OnDestroy, TemplateRef, EventEmitter } from '@angular/core'; import { IIdentified, QueriesUtil } from '@c8y/client'; import { ColumnConfig, IconConfigItem, ComputedConfig, AssetColumnOperationType, CustomColumn, CustomColumnType, DisplayOptions, WidgetDisplaySettings, BaseColumn, WidgetSettings, AssetTableExtendedColumn, ServerSideDataCallback, DataSourceModifier, ServerSideDataResult, Column, Pagination } from '@c8y/ngx-components'; import { BehaviorSubject } from 'rxjs'; import { AssetPropertyType } from '@c8y/ngx-components/asset-properties'; import { WidgetConfigService } from '@c8y/ngx-components/context-dashboard'; import { IManagedObject } from 'packages/client/lib'; import { CdkDragDrop } from '@angular/cdk/drag-drop'; import { BsDropdownDirective } from 'ngx-bootstrap/dropdown'; declare class DefaultAssetTableGridColumn extends CustomColumnExtended { constructor(initialColumnConfig?: CustomColumnConfigExtended); } declare class OperationAssetTableGridColumn extends BaseColumnExtended { constructor(initialColumnConfig?: ColumnConfigExtended); } interface AssetTableWidgetConfig { columnSortOrders?: Record; columns?: DefaultAssetTableGridColumn[]; configurableColumnsEnabled?: boolean; device?: IIdentified; displayOptions?: Partial; displaySettings?: WidgetDisplaySettings; filterPredicate?: Record; isAutoRefreshEnabled?: boolean; operationColumns?: OperationAssetTableGridColumn[]; refreshInterval?: number; options?: any; refreshOption?: AssetTableRefreshOption; includeDescendants?: boolean; selectedProperties?: AssetPropertyType[]; showAsLink?: boolean; showStatusIcon?: boolean; showIconAndValue?: boolean; settings?: WidgetSettings; title?: string; columnOrder?: AssetTableExtendedColumn[]; isDeviceAssetSelected?: boolean; widgetInstanceGlobalAutoRefreshContext?: boolean; widgetInstanceGlobalTimeContext?: boolean; } type AssetTableRefreshOption = 'interval' | 'global-interval'; type AssetColumnType = 'alarm' | 'date' | 'icon' | 'computed' | 'default' | 'operation'; declare class BaseColumnExtended extends BaseColumn { iconConfig?: Array; isLink?: boolean; command?: object; isOperation?: boolean; operationType?: AssetColumnOperationType; computedConfig?: ComputedConfig; showIconAndValue?: boolean; buttonLabel?: string; type?: AssetColumnType; } declare class CustomColumnExtended extends CustomColumn { iconConfig?: Array; isLink?: boolean; command?: object; isOperation?: boolean; operationType?: AssetColumnOperationType; computedConfig?: ComputedConfig; showIconAndValue?: boolean; columnOrder?: []; } interface ColumnConfigExtended extends ColumnConfig { /** Column header title */ header?: string; /** The path in a row item to read the cell value from. */ path?: string; /** * Icon configuration for the column when renderType is 'icon'. */ iconConfig?: Array; /** Configuration for computed column */ computedConfig?: ComputedConfig; /** Whether the column is a link. */ isLink?: boolean; /** The column operationType. E.g. 'maintenance' */ operationType?: AssetColumnOperationType; /** Command to be executed */ command?: any; /** Whether to show both icon and value in the cell */ showIconAndValue?: boolean; /** Button label for operation columns */ buttonLabel?: string; /** e.g. 'Restart Device', 'Firmware Update', 'Send Command' */ operation?: string; } interface CustomColumnConfigExtended extends ColumnConfigExtended { /** JSON path to the managed object property to be displayed */ path: string; /** Column header title */ header: string; /** Flag to identify custom columns */ custom: boolean; /** Column type of the custom column*/ type: CustomColumnType; } declare class AssetTableWidgetConfigComponent implements OnInit, OnDestroy { set previewMapSet(template: TemplateRef); readonly GLOBAL_INTERVAL_OPTION: AssetTableRefreshOption; readonly REFRESH_INTERVAL_IN_MILLISECONDS: number[]; title: "Asset Table"; columns: AssetTableExtendedColumn[]; selectedAssets: AssetPropertyType[]; serverSideDataCallback: ServerSideDataCallback; refresh: EventEmitter; formGroup: ReturnType; /** * Current isLoading state. Based on it next countdown cycle is being started. */ isLoading$: BehaviorSubject; refreshOption: AssetTableRefreshOption; config: AssetTableWidgetConfig; protected queriesUtil: QueriesUtil; private destroy$; private readonly formBuilder; private readonly assetTableService; private readonly widgetGlobalAutoRefresh; private readonly alertService; private readonly widgetConfigService; private readonly contextDashboardService; constructor(); ngOnInit(): void; ngOnDestroy(): void; /** * This method loads data when data grid requests it (e.g. on initial load or on column settings change). * It gets the object with current data grid setup and is supposed to return: * full response, list of items, paging object, the number of items in the filtered subset, the number of all items. */ onDataSourceModifier(dataSourceModifier: DataSourceModifier): Promise; updateSelectedAssets(): Promise; updateRefreshOption(): void; private getColumns; private handleGlobalRefreshLoading; private updateConfigBasedOnRefreshOption; private updateFormDisabledState; private setupGridHeaderFilterDependency; private initializeForm; private createForm; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class AssetTableWidgetViewComponent implements OnInit, OnDestroy { config: AssetTableWidgetConfig; /** * Current isLoading state. Based on it next countdown cycle is being started. */ isLoading$: BehaviorSubject; selectedAssets: any[]; columns: Column[]; refresh: EventEmitter; serverSideDataCallback: ServerSideDataCallback; pagination: Pagination; private destroy$; private readonly widgetGlobalAutoRefresh; private readonly assetTableService; private readonly alertService; constructor(); ngOnInit(): void; ngOnDestroy(): void; /** * This method loads data when data grid requests it (e.g. on initial load or on column settings change). * It gets the object with current data grid setup and is supposed to return: * full response, list of items, paging object, the number of items in the filtered subset, the number of all items. */ onDataSourceModifier(dataSourceModifier: DataSourceModifier): Promise; updateSelectedAssets(): void; private handleGlobalRefreshLoading; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class AssetTablePropertiesSelectorComponent implements OnInit { asset: IManagedObject; widgetConfigService: WidgetConfigService; selectedProperties: AssetPropertyType[]; extraProperties: AssetPropertyType[]; private readonly inventoryService; ngOnInit(): Promise; selectProperties(selectedProperties: AssetPropertyType[]): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class AssetTableGridSettingsComponent implements OnInit, OnDestroy { columns: AssetTableExtendedColumn[]; selectedProperties: AssetPropertyType[]; operationColumns: ColumnConfigExtended[]; text: string; existingColumnFilter: { [key: string]: any; }; hasMaintenanceColumn: boolean; customHeaderNames: Record; customLabel: "(custom`column`)"; private readonly widgetConfigService; private readonly assetTableService; private readonly modalService; private readonly destroy$; ngOnInit(): void; ngOnDestroy(): void; applyColumnType(type: AssetColumnType, column: AssetTableExtendedColumn): Promise; onColumnDrop(event: CdkDragDrop): void; toggleColumnVisibility(column: AssetTableExtendedColumn): void; applyFilter(column: AssetTableExtendedColumn, dropdown: BsDropdownDirective): void; resetFilter(column: AssetTableExtendedColumn, dropdown: BsDropdownDirective): void; isColumnFiltered(column: AssetTableExtendedColumn): boolean; updateColumnNames(column: AssetTableExtendedColumn): void; changeSortOrder(column: AssetTableExtendedColumn): void; onCreateOperation(): Promise; onToggleMaintenanceMode(): Promise; editOperationColumn(column: AssetTableExtendedColumn): Promise; deleteColumn(column: AssetTableExtendedColumn): void; trackByColumnName(_index: number, column: AssetTableExtendedColumn): string; private applyCustomHeaderNames; private operationModal; private getColumns; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { AssetTableGridSettingsComponent, AssetTablePropertiesSelectorComponent, AssetTableWidgetConfigComponent, AssetTableWidgetViewComponent }; //# sourceMappingURL=index.d.ts.map