import { ChangeDetectorRef, OnInit, SimpleChanges, TemplateRef, EventEmitter, QueryList, OnChanges, OnDestroy } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { DatatableComponent } from '@swimlane/ngx-datatable'; import { PopoverDirective } from 'ngx-bootstrap/popover'; import { Subject } from 'rxjs'; import { NgxDatatableColumn } from '../../classes/ngxDatatableColumn'; import { SortingAndFilteringParamsBuilder } from '../../classes/sortingFilteringUtils/sortingFilteringUtils'; import { TableFilter } from '../../interfaces/tableFilter'; import { TreeNode } from '../../interfaces/treeNode'; import { LocalStorageService } from '../../services/localStorageService/localStorage.service'; import { ColumnSetting } from '../../services/localStorageService/localStorageItems'; import { DialogModalComponent } from '../dialog-modal/dialog-modal.component'; import * as i0 from "@angular/core"; export declare class NgxDatatableComponent implements OnInit, OnChanges, OnDestroy { private detector; private translateSvc; protected localStorageSvc: LocalStorageService; /** ID of the table */ id: string; /** Array of columns */ columns: NgxDatatableColumn[]; /** Number of total results (this is mandatory, if not provided, the table will render no rows) */ count: number; /** True if server-side paging, false if client-side */ externalPaging: boolean; /** True if server-side sorting, false if client-side */ externalSorting: boolean; /** number of results to request per page (page size) */ limit: number; /** Height in pixels of each row, can be 'auto' */ rowHeight: any; /** result data returned from api */ rows: any[]; /** 'cell' single select, 'checkbox' multi select */ selectionType: string; /** True if checkboxes and radio buttons should be disabled */ disableSelections: boolean; /** Array of objects to designate the initial sort order. Example: [{ prop:'name', dir:'desc' }] */ sorts: { prop: string; dir: string; }[]; /** Function that calls to return data for the table */ fetchDataFn: Function; /** Column field that designates uniqueness */ rowIdentifier: string; /** Additional template to be used in mobile view, besides the cell templates defined for each column */ additionalMobileTemplate: TemplateRef; /** Boolean indicating if the table should have a footer section or not */ isFooterVisible: boolean; /** Boolean indicating if the table should have a selected number of elements or not - in case we don't have checkboxes for selecting items, this parameter should be false */ isSelectedVisible: boolean; /** Object indicating if the row expansion should be available even in desktop view (not only mobile) and the template which should be rendered */ rowExpansion: { enabled: boolean | undefined; template: TemplateRef | undefined; }; /** Builder to be used to change the sortField and sortMode on external sorting and used to fetch data at onPage */ sortingAndFilteringBuilder: SortingAndFilteringParamsBuilder; /** Property based on which the inherited card loading indicator will be displayed */ loadingIndicator: boolean; /** Can see effect when changing language in servers page (if this is not undefined or true the firmware column would not resize and would appear cut out) */ forceTableResizeOnRowsChange: boolean; /** Programatically set this property to false if the request for fetching the rows will be done in the parent component of the ngx-datatable and the table itself will not fetch the initial data*/ isFirstFetchActivated: boolean; /**Boolean indicating whether the table should save its sort and pagination settings in local storage */ saveTableSettingsInLocalStorage: boolean; /**Boolean indicating whether the table should save its column settings in session storage */ saveColumnSettingsInSessionStorage: boolean; /** Actions to be displayed on right-click on rows. They have the format used in the table-toolbar **/ /** Manually set the number of selected rows when the selected array is not accurate */ setSelectionNumber: number; /** True if not add export button, false if add export button */ notExport: boolean; /** * Condition for adding class to specific row * * return { * 'age-is-ten': row.age % 10 === 0 * }; */ rowClass: Function; /** If all rows should be included */ allRowsOption: boolean; /** Percentage of loaded data inside table */ loadedPercentage: number; isRowDisabled: Function; /** disables the table */ disabled: boolean; /** The ngx-tree-table component extends the ngx-datatable component and in order to inherit all the inputs and outputs * it must not have any inputs but we don't use rows as the data structure for the tree table but a list of tree nodes */ tree: TreeNode[]; /** * Boolean indicating if the tree structure should be static, if this is true then the tree is build using one request and no request is performed at row click */ staticTree: boolean; treeChange: EventEmitter; /** The function to be used when fetching all data */ exportFetchDataFunction: Function; /** The source of the table, to be translated. E.g. 'HDR_SERVERS' */ source: string; /** Function to be called with data array arg in order to modify the data at export all before exporting. So this is the step between getting the data from the backend and exporting the data (maybe some properties need to be added from UI for example) */ formatDataFunc: Function; /** * Policy wizard tree - static tree, no need for fetching data at export all * Job details tree - backend tree with only one root - get by id with childrenLevels=-1 in order to get all data * Apply and activate devices - backend array converted to a tree in UI - GET requests are paginated - need to pass a format function which is the function that converts from the backend structure to a tree UI structure * Repository management - multi root tree paginated on the UI - we get all roots and the children at request (get all means roots and there is no way to add childrenLevels param to this request so we need to perform nrOfRoots requests with childrenLevels=-1 for getting all data) * * treeFetchDataMethod = 'id' for repo management * treeFetchDataMethod = 'all' for apply and activate devices * treeFetchDataMethod = 'id' for job details * treeFetchDataMethod unused for static trees (trees built in the UI) like policy wizard */ treeFetchDataMethod: 'id' | 'all'; tableToolbarActions: any[]; isTableToolbarHidden: boolean; activeFilters: TableFilter[]; tableToolbarFilteringConfig: TableFilter[]; /** * Custom Table toolbar icons configuration for filters */ tableToolbarIconsClassConfig: object; table: DatatableComponent; toggleModal: DialogModalComponent; pop: QueryList; /** Outputs on all rows selection, feeds in row array */ allRowsCheck: EventEmitter; /** Outputs on row selection, feeds in row array */ rowSelected: EventEmitter; /** Outputs on row deselection, feeds in row array */ rowDeselected: EventEmitter; /** Outputs on click of a row */ rowClick: EventEmitter; /** Outputs on right-click of a row */ /** Page selection from the heading checkbox */ headerSelection: EventEmitter; loadingIndicatorChange: EventEmitter; removeFilters: EventEmitter; /** Two way binding */ rowsChange: EventEmitter; toggleModalButtons: any; allSelected: boolean; deselected: any[]; selected: any[]; selectAllOnPage: any[]; storedId: any; mobileView: boolean; rowsOnPage: number[]; offset: number; sortField: string; sortMode: 'asc' | 'desc'; indexOfFirstDisplayedCol: number; currentRadioCheckedValue: boolean; /** Boolean indicating if a filter was applied in order not to save pagination settings in local storage * The filtering settings are not yet saved in local storage so if the builder gets updated * on setPage or onSort with the filter settings there will be no way to remove the filter (because it's not saved anywhere) */ filterWasApplied: boolean; initialSortingAndFilteringBuilder: SortingAndFilteringParamsBuilder; /** Used to comunicate with the table toolbar child component. This can be changed to send a string value between components in order to determine which function to call */ tableToolbarEventsSubject: Subject; cdr: ChangeDetectorRef; defaultFooterHeight: any; defaultRowHeight: any; defaultSelectionType: any; defaultSortType: any; constructor(detector: ChangeDetectorRef, translateSvc: TranslateService, localStorageSvc: LocalStorageService); ngOnChanges(changes: SimpleChanges): void; ngOnInit(): void; ngOnDestroy(): void; getEmptyMessage(): string; addExportAction(): void; /** * Returns the rows collection, it can be the tree or the simple array of rows in case of simple datatable */ getRows(): any[]; /** * Scenario: the user selects a manager which gives him 5 pages results and clicks the last page * then he selects another manager which has only one page of results but the offset for that table is 5 * he will see no data in the table but will see data in the graph, we must reset the offset. * This also happens when the user removes an LXCA from the Resource Managers page. */ checkForIncorrectResultBasedOnOffset(): void; initializeToggleColumnsModalButtons(): void; fetchDataBasedOnSessionStorageSettings(): void; initializePaginationDataBasedOnSessionStorage(): void; closeModal(): void; onResize(evt: any): void; clickedRow(evt: any): void; checkState(btn: any, row: any): void; onCheckboxSelect(btn: any, row: any): void; onSelect(evt: any): void; setGlobalSelectionCheckboxState(): void; reordered(evt: any): void; toggleExpandRow(row: any): void; setPage(pageInfo: any): void; setRowsPerPage(nrOfRows: any): void; /** * Method used to apply a filter - to fetch data based on a new sorting and filtering builder * @param newSortingAndFilteringBuilder */ applyFilter(newSortingAndFilteringBuilder: SortingAndFilteringParamsBuilder, sortField?: string, sortMode?: 'asc' | 'desc', limit?: number, saveActiveFiltersBeforeFetching?: boolean): void; /** Notify the table toolbar component to remove all applied filters * This is necessary for the events table because the filters are not saved anywhere so there is no way to reconfigure them and apply them and on tab change the sorting and filtering builder is re-initialized so * a filter is marked as applied and it appears in the UI but it does not reflect in the sorting and filtering builder */ removeTableToolbarFilters(): void; rowIdentity(row: any): any; getIdFunc(): (row: any) => any; togglePageSelection(event: any): void; findRow(arr: any, obj: any): number | false; removeFromDeselectedArray(): void; addToDeselectedArray(): void; selectPage(event: any): void; clearPage(event: any): void; selectAll(event: any): void; clearAll(event: any): void; popOverShown(): void; toggleDisplay(col: NgxDatatableColumn): void; onSort(event: any): void; setIndexOfFirstDisplayedCol(): void; showDataErrorMessage(): void; refresh(): void; setSelectedItems(selectedItems: any[]): void; resetSelection(): void; removeAllFilters(): void; callTableToolbarFunction(functionName: 'removeAllFilters' | 'applyLastActiveFilterFromSessionStorage' | 'saveActiveFilterInSessionStorage' | 'resetActiveFilterInSessionStorage'): void; saveCurrentPaginationSettingsInLocalStorage(): void; initializeColumnSettingsInSessionStorage(): void; createColumnSettingsBasedOnCurrentData(): ColumnSetting[]; applySessionStorageColumnSettings(): void; initializePaginationInfoInSessionStorage(): void; applySessionStoragePaginationSettings(): void; listProp(arr: any[]): string[]; /** * Method returning true if any filters must be applied by the table toolbar component BEFORE fetching data * So we need to know if there any filters must be applied when arriving on the page, before fetching the data * */ private areActiveFiltersPending; toggleSorting(value: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }