import { ChangeDetectorRef, OnDestroy } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; import { IEntity } from '../../common/models/entity'; import { GenericService } from '../../http/services/generic.service'; import { VdDynamicTableComponent } from '../../table/components/dynamic-table/dynamic-table.component'; import { TableColumn } from '../../table/models/table-column'; import { TableMenuItem } from '../../table/models/table-menu-item'; import { TableDataSource } from '../../table/table.data-source'; import { BaseComponent } from './base.component'; import * as i0 from "@angular/core"; /** * A base list component for components with pagination support */ export declare abstract class GenericListComponent> extends BaseComponent implements OnDestroy { service: TService; protected route: ActivatedRoute; protected changeDetectorRef: ChangeDetectorRef; classType?: { new (): TEntity; }; /** * List title */ subtitle: string; /** * A reference to MdPaginator element */ paginator: MatPaginator; /** * A reference to MdSort attribute */ sort: MatSort; /** * Page size options */ pageSizeOptions: Array; /** * The navigations to includes */ includes: Array; /** * @property projection * @description Specifies the projection(s) to apply when fetching data. * Can be a single string or an array of strings. * @type {string | string[]} */ projection: string | string[]; /** * The navigations to includes */ excludedColumns: Array; /** * Get params */ query: any; /** * Data-table datasource */ dataSource: TableDataSource | null; /** * Current sort column */ sortActive: string; /** * Current sort direction */ sortDirection: string; /** * An instance of the class to create the table for */ classInstance: any; /** * columns: TableColumn[] */ columns: (TableColumn | string)[]; /** * A reference to MdSort attribute */ dynamicTable: VdDynamicTableComponent; /** * The type of the dialog for creation */ addDialogType: any; /** * Shows the column 'Checkbox' */ selectable: boolean; /** * If true, show the button 'Add' */ addable: boolean; /** * If true, show the menu 'Edit' */ editable: boolean; /** * If true, show the menu 'Delete' */ deletable: boolean; /** * If true, show the menu 'Download' */ downloadable: boolean; /** * If true, show the menu 'Duplicate' */ duplicable: boolean; /** * rowNgClass: Function */ rowNgClass: Function; /** * rowClick: Function */ rowClick: Function; /** * editRoute: Function */ onEdit: (x: TEntity, ctx: any) => any; /** * detailsTemplate: Function */ detailsTemplate: string; /** * Toolbar menu items */ toolbarMenuItems: TableMenuItem[]; /** * Table row menu items */ rowMenuItems: TableMenuItem[]; /** * DataLoaded event subscription */ protected dataLoadedSubscription: Subscription; /** * Constructor * @param service */ constructor(service: TService, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef, classType?: { new (): TEntity; }); /** * Lifecycle hook that is called after data-bound properties * of a directive are initialized. */ ngOnInit(): void; /** * Connects a collection viewer (such as a data-table) to the data source. * @param staticFieldFilters */ connect(staticFieldFilters?: any): void; /** * Reloads items */ loadList(resetSelection?: boolean): void; /** * Search * @param filter */ search(filter: string): void; /** * Navigates to the add page. */ add(): void; /** * Navigates to the edit page. * @param item The id of the item */ edit(item: TEntity, context?: any): void; /** * Patches the entity * Patches the entity * @param id The ID of the entity * @param fields The fields to patch * @param value The (optional) value to change * @param includes Includes some navigations */ patch(id: number, fields: Array, value: any, includes: any): void; /** * Patches the entity * @param id The ID of the entity * @param fields The fields to patch * @param value The (optional) value to change * @param includes Includes some navigations * @param successCallback A callback function to e called on success */ protected _patch(id: number, fields: Array, value: any, includes: any, successCallback?: Function): void; /** * Deletes an item from the database. */ deleteItem(item: TEntity): void; /** * Deletes an item from the database. */ deleteItems(): void; /** * Toggles a property * @param item * @param property */ toggle(item: TEntity, property?: string): void; /** * Uploads tarnsfers csv files * @param file The file to upload * @param reload If true, reload items */ upload(file: File, reload?: boolean): void; /** * Downloads a document * @param item */ download(item: TEntity, path?: string): void; /** * Duplicates a record * @param item */ duplicate(item: TEntity): void; /** * This informs the table how to uniquely identify rows to * track how the data changes with each update. * @param index * @param item */ trackById(_: number, item: any): any; /** * Includes some navigations * @param inc */ protected include(...inc: string[]): void; /** * Add toolbar menu items */ protected addToolbarMenuItems(): void; /** * Add row menu items */ protected addRowMenuItems(): void; /** * Check if the item is selectable */ protected canSelectItem(entity: TEntity): boolean; /** * Check if the item is deletable */ protected canDeleteItem(entity: TEntity): boolean; /** * Check if the item is editable */ protected canEditItem(entity: TEntity): boolean; /** * Check if the item is downloadable */ protected canDownloadItem(entity: TEntity): boolean; /** * Check if the item is duplicable */ protected canDuplicateItem(entity: TEntity): boolean; /** * Returns NgClass object for select column */ protected selectRowNgClass(_: TEntity): any; /** * Check if the there any selected row * @returns */ protected hasSelectedRows(): boolean; /** * Checks if the user can perform multiple operations (Like 'delete selected'). * @param action * @returns */ protected canExecuteMultipleOperations(action?: Function): boolean; /** * Responds to user-initiated events * @param event */ handleKeyboardEvent(event: KeyboardEvent): void; /** * A callback used for any custom cleanup that needs to occur * when the instance is destroyed. */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, never, never, {}, {}, never>; }