UNPKG

sdk-datagrid

Version:

Customizable (Angular) datagrid with data options for manipulation, and charts for visualization.

268 lines (267 loc) 14.9 kB
import { ElementRef, EventEmitter, TemplateRef, Type } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { SDKDataGridColumn } from './models/datagrid-column'; import { SDKDataGridOptions } from './models/datagrid-options'; import { SDKDataGridCustomFilter } from './models/datagrid-custom-filter'; import { SDKDataGridSettings } from './models/datagrid-settings'; import { SDKDataGridMessage } from './models/datagrid-message'; import * as i0 from "@angular/core"; export declare class SDKDatagridComponent { private route; /************************************************************************** * Input/Output Parameters for updating the Grid **************************************************************************/ updateGrid: boolean; updateGridChange: EventEmitter<boolean>; /************************************************************************** * Input/Output Parameters for editing a record **************************************************************************/ editRecordIndex: number | null | undefined; editRecordIndexChange: EventEmitter<number | null | undefined>; /************************************************************************** * Input/Output Parameters for dataset change **************************************************************************/ datasets: string[]; activeDataset: string; activeDatasetChange: EventEmitter<string>; /************************************************************************** * Input/Output Parameters for updating columns **************************************************************************/ columns: SDKDataGridColumn[]; columnHeaderStyle: string; columnsChange: EventEmitter<SDKDataGridColumn[]>; /************************************************************************** * Input Parameters for rows **************************************************************************/ detailTemplate: TemplateRef<any>; tooltipTemplate: TemplateRef<any>; /************************************************************************** * Input/Output Parameters for updating custom filters **************************************************************************/ customFilters: SDKDataGridCustomFilter[]; customFiltersChange: EventEmitter<SDKDataGridCustomFilter[]>; /************************************************************************** * Input/Output Parameters for exporting data **************************************************************************/ dataExport: any; dataExportChange: EventEmitter<any>; /************************************************************************** * Input/Output Parameters for settings data **************************************************************************/ settings: SDKDataGridSettings[]; clearSettingsCache: boolean; savedSettingsEvent: EventEmitter<SDKDataGridSettings[]>; clearSettingsCacheChange: EventEmitter<boolean>; /************************************************************************** * Required Output Parameters **************************************************************************/ loadDataEvent: EventEmitter<any>; /************************************************************************** * Optional Input/Output Parameters **************************************************************************/ name: string; title: string; titleStyle: string; options: SDKDataGridOptions | undefined; fontFamily: string; data: any; rowValues: number[]; defaultRows: number; rows: number | undefined; page: number | undefined; total: number | undefined; saveGridDataEvent: EventEmitter<any>; deleteGridDataEvent: EventEmitter<any>; selectedRowsChangedEvent: EventEmitter<any[]>; selectedRowActionEvent: EventEmitter<any>; /************************************************************************** * Addon Parameters (Option Icon/Modal Window) **************************************************************************/ optionAddons: Type<any>[]; windowAddons: Type<any>[]; /************************************************************************** * Processing Parameters **************************************************************************/ error: string; isDebug: boolean; /************************************************************************** * Component Variables **************************************************************************/ sdkdatagrid: ElementRef<any>; sdkdatagridcontent: ElementRef<any>; sdktooltip: ElementRef<any>; protected showGrid: boolean; protected editGrid: boolean; protected totalPages: Array<string>; protected deleteRecords: Array<number>; protected editRecords: boolean; /************************************************************************** * Component Variables based on Input parameters **************************************************************************/ protected _editRecordIndex: number | null | undefined; protected _datasets: string[]; protected _activeDataset: string; protected _selectedDataset: string; protected _name: string; protected _options: SDKDataGridOptions; protected _menuOptions: boolean; protected _data: any; protected _columns: SDKDataGridColumn[]; protected _customFilters: SDKDataGridCustomFilter[]; protected _settings: SDKDataGridSettings[]; protected _rows: number; protected _page: number; protected _selectedPage: string; protected _total: number; protected _isExporting: boolean; /************************************************************************** * Options Variables **************************************************************************/ protected optionTitle: string; protected dataMode: string; protected dataClass: string; protected columnBadge: string; protected filterBadge: string; protected sortBadge: string; protected formulaBadge: string; protected chartBadge: string; protected showReset: boolean; protected showNote: boolean; protected lockGrid: boolean; protected datasetTabs: any; protected activeDatasetTab: any; /************************************************************************** * Tooltip Variables **************************************************************************/ protected tooltipTimer: any; protected tooltipAutoCloseTimer: any; protected tooltipVisible: boolean; protected tooltipStyles: { [key: string]: string; }; protected recordIndex: any; protected recordData: any; /************************************************************************** * Addon Variables * - option(Inputs/Outputs): Used with the Addon icons. * - window(Inputs/Outputs): Used with the Addon modal. **************************************************************************/ optionInputs: {}; windowInputs: {}; optionOutputs: { showDataOptionsEvent: (event: any) => void; }; windowOutputs: { closeEvent: () => void; applyEvent: (event: any) => void; }; /************************************************************************** * Message Variable **************************************************************************/ protected showMessage: boolean; protected message: SDKDataGridMessage; /************************************************************************** * Private Variables **************************************************************************/ /************************************************************************** * Component Lifecycle Methods **************************************************************************/ constructor(route: ActivatedRoute); protected ngOnChanges(_args: any): void; /************************************************************************** * Change Methods **************************************************************************/ private showInputValues; private setGrid; private setDatasets; private setActiveDataset; private setName; private setOptions; private setColumns; private setCustomFilters; private setSettings; private setBadges; private setData; private setRows; private setPage; private setTotal; private setSelectedPage; private setEditRecordIndex; /************************************************************************** * Data Methods **************************************************************************/ protected loadData(action: string, rows: number, page: number): void; protected selectDataset(event: any): void; protected datasetChanged(event: any): void; protected saveData(): void; protected deleteData(): void; protected selectRecord(index: number): void; protected isRecordSelected(index: number): boolean; protected cancelEdit(): void; private hasDataChanged; private missingData; /************************************************************************** * Options Methods **************************************************************************/ protected showDataOptions(type: string): void; protected toggleDataMode(type: string, autoClose?: boolean): void; protected closeDataOptions(): void; protected resetAllOptions(): void; protected applyOptions(event: any): void; /************************************************************************** * Addon Methods **************************************************************************/ applyDataOptions(event: any): void; private setAddonInputs; /************************************************************************** * Settings Methods **************************************************************************/ protected applySettingsOptions(event: any): void; protected saveSettings(event: any, resetActive?: boolean): void; /************************************************************************** * Export Methods **************************************************************************/ protected applyExportOptions(event: any): void; private exportData; private adjustExportColumns; private convertToCSV; /************************************************************************** * Row Methods **************************************************************************/ protected takeAction(args: any): void; protected setTooltip(event: MouseEvent, index: any, record: any): void; protected showTooltip(event: MouseEvent, index: any, record: any): void; protected keepTooltipAlive(): void; protected hideTooltip(event: MouseEvent, index: any, record: any): void; private setTooltipPosition; /************************************************************************** * Expand/Collapse Rows **************************************************************************/ expandAll(): void; collapseAll(): void; toggleExpanded(rowItem: any): void; isFirstColumn(column: SDKDataGridColumn): boolean; private setExpandedForAll; /************************************************************************** * Column Methods **************************************************************************/ protected getColumnName(column: SDKDataGridColumn): string | undefined; protected getOriginalColumnName(column: SDKDataGridColumn): string; protected hasVisibleColumns(): SDKDataGridColumn[]; protected hasFormulas(): SDKDataGridColumn[]; protected isColumnObject(value: any): boolean; protected sortColumn(column: SDKDataGridColumn): void; /************************************************************************** * Page Methods **************************************************************************/ protected getRows(event: any): void; protected getPage(event: any): void; /************************************************************************** * Util Methods **************************************************************************/ private initializeColumn; private initializeCustomFilter; private showLog; static ɵfac: i0.ɵɵFactoryDeclaration<SDKDatagridComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SDKDatagridComponent, "sdk-datagrid", never, { "updateGrid": { "alias": "updateGrid"; "required": false; }; "editRecordIndex": { "alias": "editRecordIndex"; "required": false; }; "datasets": { "alias": "datasets"; "required": false; }; "activeDataset": { "alias": "activeDataset"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "columnHeaderStyle": { "alias": "columnHeaderStyle"; "required": false; }; "detailTemplate": { "alias": "detailTemplate"; "required": false; }; "tooltipTemplate": { "alias": "tooltipTemplate"; "required": false; }; "customFilters": { "alias": "customFilters"; "required": false; }; "dataExport": { "alias": "dataExport"; "required": false; }; "settings": { "alias": "settings"; "required": false; }; "clearSettingsCache": { "alias": "clearSettingsCache"; "required": false; }; "name": { "alias": "name"; "required": false; }; "title": { "alias": "title"; "required": false; }; "titleStyle": { "alias": "titleStyle"; "required": false; }; "options": { "alias": "options"; "required": false; }; "fontFamily": { "alias": "fontFamily"; "required": false; }; "data": { "alias": "data"; "required": false; }; "rowValues": { "alias": "rowValues"; "required": false; }; "defaultRows": { "alias": "defaultRows"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "page": { "alias": "page"; "required": false; }; "total": { "alias": "total"; "required": false; }; "optionAddons": { "alias": "optionAddons"; "required": false; }; "windowAddons": { "alias": "windowAddons"; "required": false; }; "error": { "alias": "error"; "required": false; }; "isDebug": { "alias": "isDebug"; "required": false; }; }, { "updateGridChange": "updateGridChange"; "editRecordIndexChange": "editRecordIndexChange"; "activeDatasetChange": "activeDatasetChange"; "columnsChange": "columnsChange"; "customFiltersChange": "customFiltersChange"; "dataExportChange": "dataExportChange"; "savedSettingsEvent": "savedSettingsEvent"; "clearSettingsCacheChange": "clearSettingsCacheChange"; "loadDataEvent": "loadDataEvent"; "saveGridDataEvent": "saveGridDataEvent"; "deleteGridDataEvent": "deleteGridDataEvent"; "selectedRowsChangedEvent": "selectedRowsChangedEvent"; "selectedRowActionEvent": "selectedRowActionEvent"; }, never, never, true, never>; }