UNPKG

gov-gui

Version:

Gov UI Component Library Typscript Build

58 lines (57 loc) 2.08 kB
import { EventEmitter } from '../../stencil-public-runtime'; import { AnimationProps } from '../../global/animation-helpers'; export declare class GovTable implements AnimationProps { /** JSON stringified array of headings, e.g. '["Name", "Age", "Country"]' */ headings: string; /** JSON stringified 2D array for the table data */ data: string; /** Number of rows per page */ rowsPerPage: number; /** * JSON stringified array of row action objects. * Each action object should have a `label` and an `action` identifier, e.g.: * `[{"label": "Edit", "action": "edit"}, {"label": "Delete", "action": "delete"}]` */ rowActions?: string; currentPage: number; parsedHeadings: string[]; parsedData: string[][]; filteredData: string[][]; internalRowsPerPage: number; parsedRowActions: { label: string; action: string; icon: string; }[]; animation?: string; animationDelay?: '2s' | '3s' | '4s' | '5s'; animationSpeed?: 'slow' | 'slower' | 'fast' | 'faster'; private allClasses; watchAnimations(): void; watchAnimationsDelay(): void; watchAnimationsSpeed(): void; /** Event emitted when a row action button is clicked. * The event detail includes the action identifier, the row data and the row index. */ rowActionClicked: EventEmitter<{ action: string; row: string[]; rowIndex: number; }>; componentWillLoad(): void; provideClass(): void; parseProps(headings: string, data: string): void; handleSearch(event: Event): void; handlePagination(event: CustomEvent<number>): void; get paginatedData(): string[][]; updateEntries(selected: number): void; downloadTable(): void; /** * Called when a row action button is clicked. * @param action The action identifier. * @param row The data for the row. * @param rowIndex The index of the row in the filtered data. */ handleRowAction(action: string, row: string[], rowIndex: number): void; render(): any; }