UNPKG

systelab-components

Version:

systelab-components is a set of components that use wide accepted and adopted standard technologies like Angular and Bootstrap, as well as other popular libraries. Please read the ATTRIBUTION.md file for a complete list of dependencies.

93 lines (92 loc) 5.64 kB
import { ElementRef, EventEmitter, OnInit } from '@angular/core'; import { ColumnApi, GridOptions, IsFullWidthRowParams } from 'ag-grid-community'; import { GridContextMenuOption } from './contextmenu/grid-context-menu-option'; import { DialogService } from '../modal/dialog/dialog.service'; import { PreferencesService } from 'systelab-preferences'; import { I18nService } from 'systelab-translate'; import { GridContextMenuComponent, GridRowMenuActionHandler } from './contextmenu/grid-context-menu-component'; import { GridColumnsOptions } from './options/grid-column-options'; import { GridHeaderContextMenu, GridHeaderMenuActionHandler } from './contextmenu/grid-header-context-menu.component'; import * as i0 from "@angular/core"; export type rowSelectionType = 'single' | 'multiple'; export declare abstract class AbstractGrid<T> implements OnInit, GridRowMenuActionHandler, GridHeaderMenuActionHandler { protected preferencesService: PreferencesService; protected i18nService: I18nService; protected dialogService: DialogService; static readonly contextMenuColId = "contextMenu"; static readonly selectionColId = "selectCol"; gridOptions: GridOptions; overlayNoRowsTemplate: any; overlayLoadingTemplate: any; startCellEditorWithTab: boolean; headerMenu: Array<GridContextMenuOption<Object>>; menu: Array<GridContextMenuOption<T>>; preferenceName: string; multipleSelection: boolean; showChecks: boolean; headerCheckboxSelection: boolean; rowData: Array<T>; noRowsText: any; loadingText: any; removeSelectionOnOpenContextMenu: boolean; autoSizeColumnsToContent: boolean; action: EventEmitter<any>; clickRow: EventEmitter<any>; rowDragEnd: EventEmitter<any>; viewportChanged: EventEmitter<any>; rowSelected: EventEmitter<any>; hiddenElement: ElementRef; popupmenu: GridContextMenuComponent<T>; headerPopupMenu: GridHeaderContextMenu<Object>; protected firstSizeToFitExecuted: boolean; private calculatedGridState; private scrollTimeout; protected constructor(preferencesService: PreferencesService, i18nService: I18nService, dialogService: DialogService); ngOnInit(): void; protected getInitialGridOptions(): GridOptions; protected onCellEditingStarted(event: any): void; onModelUpdated(event: any): any; doGridReady(event: any): void; protected saveColumnsStateInPreferences(): void; protected loadColumnsStateFromPreferences(): void; private loadColumnsState; private setColumnWidthToFitContent; private getContextMenuColumnDef; private getCheckColumnDef; protected abstract getColumnDefs(): Array<any>; protected getColumnDefsWithOptions(): Array<any>; protected hideHeader(): boolean; protected getIsFullWidthRow(isFullWidthRowParams: IsFullWidthRowParams): boolean; getFullWidthCellRenderer(): any; protected getGridOptionsPreferencesPrefix(): string; executeContextMenuAction(elementId: string, actionId: string): void; isContextMenuOptionEnabled(elementId: string, actionId: string): boolean; executeHeaderContextMenuAction(elementId: string, actionId: string, headerData: any): void; isHeaderContextMenuOptionEnabled(elementId: string, actionId: string, headerData: any): boolean; protected isColResizeEnabled(): boolean; private suppressColumnSizeToFit; onRowSelected(event: any): void; protected getRowSelectionType(): rowSelectionType; getSelectedRows(): Array<T>; getSelectedRow(): T; selectRow(index: number): void; doClick(event: any): void; doColumnResized(event: any): void; doViewportChanged(): void; doGridSizeChanged(event: any): void; showOptions(canHideAllColumns?: boolean): void; protected getGridColumnOptions(columnApi: ColumnApi, columnDefs: Array<any>): GridColumnsOptions; protected applyGridColumnOptions(columnApi: ColumnApi, columnOptions: GridColumnsOptions): void; dotsClicked(rowIndex: number, data: T | Array<T>, event: MouseEvent): void; headerDotsClicked(headerData: Object, event: MouseEvent): void; protected existsAtLeastOneHeaderActionEnabled(data: Object | Array<Object>): boolean; protected existsAtLeastOneActionEnabled(data: T | Array<T> | Object | Array<Object>): boolean; private isMenuOptionEnabled; onRowDragEnd(event: any): void; protected getContextMenuColumnWidth(): number; protected getCheckColumnWidth(): number; private onBodyScroll; private doAutoSizeManagement; static ɵfac: i0.ɵɵFactoryDeclaration<AbstractGrid<any>, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractGrid<any>, never, never, { "headerMenu": { "alias": "headerMenu"; "required": false; }; "menu": { "alias": "menu"; "required": false; }; "preferenceName": { "alias": "preferenceName"; "required": false; }; "multipleSelection": { "alias": "multipleSelection"; "required": false; }; "showChecks": { "alias": "showChecks"; "required": false; }; "headerCheckboxSelection": { "alias": "headerCheckboxSelection"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "noRowsText": { "alias": "noRowsText"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "removeSelectionOnOpenContextMenu": { "alias": "removeSelectionOnOpenContextMenu"; "required": false; }; "autoSizeColumnsToContent": { "alias": "autoSizeColumnsToContent"; "required": false; }; }, { "action": "action"; "clickRow": "clickRow"; "rowDragEnd": "rowDragEnd"; "viewportChanged": "viewportChanged"; "rowSelected": "rowSelected"; }, never, never, false, never>; }