import { GdsElement } from '../../gds-element'; import * as Types from './table.types'; import type { Variant } from '../card/card.types'; /** * @element gds-table * @status beta * * @summary A data table component with async data loading, pagination, sorting, filtering, and customizable cell rendering. * * @slot `header-lead` - Content displayed at the start of the table header (after search). * @slot `header-trail` - Content displayed at the end of the table header (before settings). * @slot `footer` - Content displayed in the table footer area (before pagination). * @slot `error` - Custom error state content when data loading fails. * @slot `empty` - Custom empty state content when no data is available. * @slot `no-results` - Custom no results content when search returns empty. * * @event gds-page-change - Fired when the active page changes. Detail: `{ page: number }` * @event gds-rows-change - Fired when the rows per page value changes. Detail: `{ rows: number }` * @event gds-sort-change - Fired when sorting changes. Detail: `{ sortColumn: string, sortDirection: 'asc' | 'desc' }` * @event gds-table-data-loaded - Fired when data is successfully loaded. Detail: `{ rows: T[], total: number, page: number, rowsPerPage: number, searchQuery: string, sortColumn?: string, sortDirection?: 'asc' | 'desc' }` * @event gds-table-data-error - Fired when data loading fails. * @event gds-table-selection - Fired when row selection changes. */ export declare class GdsTable extends GdsElement { #private; static styles: (import("lit").CSSResult | import("lit").CSSResult[])[]; /** * The main headline text displayed at the top of the table. */ headline?: string; /** * The HTML tag to use for the headline (e.g., 'h1', 'h2', etc.). */ headlineTag: string; /** * A brief description or summary displayed below the headline. */ summary?: string; /** * The accessible label for the search input field. */ searchLabel?: string; /** * Configurable options for rows per page. * Accepts: number array (e.g., `[5, 10, 20, 50, 100]`) */ options: number[]; /** * Current page number in pagination. */ page: number; /** * Number of rows displayed per page. */ rows: number; /** * Defines table column structure. * Accepts: array of column configurations with keys, labels, etc. */ columns: Types.Column[]; /** * Asynchronous data provider function. * Accepts: function that returns Promise with rows and total count */ data: (request: Types.Request) => Promise>; /** * Controls row density. * Accepts: `comfortable`, `compact`, `spacious` */ density: Types.Density; /** * Enables row selection functionality. */ selectable: boolean; /** * Disables select all checkbox in header. */ disableSelectAll: boolean; /** * Transforms table layout for mobile screens. */ responsive: boolean; /** * Removes table header and footer. */ plain: boolean; /** * Adds search input for data filtering. */ searchable: boolean; /** * Enables column visibility settings. */ settings: boolean; /** * Applies alternating row background colors. */ striped: boolean; /** * Defines row-level actions. * Accepts: action configuration or custom rendering function */ actions?: Types.Actions | ((row: T, index: number) => any); /** * Disables data caching mechanism. */ nocache: boolean; /** * Configures a table footer row (``) at the bottom of the table. * The footer row provides slot insertion points for each visible column, * letting consumers render any aggregation (sum, average, count, etc.). * * Use `tfoot.label` to optionally show a label in the first cell (omitted by default). * Use `tfoot.sticky` to pin the footer to the bottom of the scroll area. * * Slot naming convention: `tfoot:{columnKey}` * * Accepts: `{ label?: string, sticky?: boolean }` or omit to disable. */ tfoot?: Types.Tfoot; /** * Key to trigger data reloading when changed. Setting this to a new value * forces the table to clear the cache and request new data from the data provider. * * The value can be any string that is not equal to the previous value. */ dataLoadKey?: string; /** * Style Expression Property that controls the height property. * Supports space tokens and all valid CSS width values. * * Sets the height of the table content area and enables vertical scrolling * with a sticky header that remains visible. */ height?: string; /** * Sets the visual variant of the table container card. * Forwards to the underlying `gds-card` component. */ variant: Omit; private _isMobile; private _handleMobile; private _view; private _loaded; private _loading; private _rowsState; private _total; private _selected; private _error; private _onDataChange; /** * Syncs the external `page` property to internal view state and reloads data. * Without this, setting `.page` from outside (e.g. via attribute or binding) * would update the Lit property but not trigger a data fetch. */ private _onPageChange; /** * Syncs the external `rows` property to internal view state and reloads data. * Resets to page 1 since changing page size invalidates the current position. */ private _onRowsChange; private _onColumnsChange; connectedCallback(): void; render(): any; /** * Public API * Clear all selections */ clearSelection(): void; /** * Select all rows */ selectAll(): void; /** * Select specific rows by indices */ setSelection(indices: number[]): void; /** * Get selected row data */ getSelection(): { indices: number[]; data: T[]; }; }