import { LitElement } from "lit"; import type { TemplateResult } from "lit"; import "../button/index.js"; import "../data-table/index.js"; import "../overlay/index.js"; import "../popover/index.js"; import "../tooltip/index.js"; import "../icon/index.js"; import "../primitives/index.js"; import type { DataTableColumn, DataTableDensity, DataTableGroupSummary, DataTableRowHeader, DataTableSortChangeDetail, SortDirection, TableRow } from "../data-table/index.js"; export type DataGridColumn = DataTableColumn; export type { TableRow }; /** The whole layout as one value: what a saved view holds, and what the dirty dot compares against. */ export interface DataGridLayout { density: DataTableDensity; groupBy: string; sortKey: string; sortDirection: SortDirection; widths: Record; pinned: string[]; hidden: string[]; wrapped: string[]; } export interface DataGridView { id: string; name: string; layout: DataGridLayout; /** The built-in default view — it can be selected but not renamed or deleted. */ locked?: boolean; } export interface DataGridViewChangeDetail { view: DataGridView; dirty: boolean; } export interface DataGridSearchDetail { query: string; matches: number; } export interface DataGridLayoutChangeDetail { layout: DataGridLayout; } /** * @fires xm-data-grid-search - Fired when the search query changes (`detail.query`, `detail.matches`). * @fires xm-data-grid-layout-change - Fired when density, grouping, sort or any column state changes (`detail.layout`). * @fires xm-data-grid-view-change - Fired when the active view changes or its layout drifts (`detail.view`, `detail.dirty`). */ export declare class XmDataGrid extends LitElement { static styles: CSSStyleSheet[]; columns: DataGridColumn[]; rows: TableRow[]; loading: boolean; pageSize: number; maxHeight: string; totalsLabel: string; totals: boolean; /** Grow the columns to fill the frame when the declared widths leave room to spare. Full page turns this on for as long as it is open, so the grid uses the screen it took; set it to keep the same behaviour in the card. */ fitColumns: boolean; /** Stretch the frame to the host's full height instead of collapsing to the rows. A grid embedded in a flex column needs this to own its own scroll; full page turns it on regardless, for as long as it is open. */ fill: boolean; /** Server/controlled mode (ADR 0042): the consumer owns search, sort and paging. The grid stops filtering and reordering `rows`, hands them to the table verbatim, and reports search and sort as intents only. Use it when the rows are a page of a larger set, or a shape a local pass would damage — a flattened hierarchy loses its children to either. */ server: boolean; /** Result count behind `rows` in server mode: the empty state, the search count and the table's paging are all derived from it, never `rows.length`. */ totalItems: number; /** Make rows clickable — the table's `xm-data-table-row-click` is composed, so it surfaces on this element. */ rowClick: boolean; /** Column key whose value is a row's stable identity, handed to the table. */ rowKey: string; /** Marks a row as a group header that keeps its own cells, handed straight to the table — the group a consumer already owns, wearing the system's band. */ rowHeader: ((row: TableRow, index: number) => DataTableRowHeader | null) | null; /** Column keys the "group rows" menu offers. Empty hides the grouping pane. */ groupable: string[]; /** Column key rows start grouped by, and what the default view restores to. The user can change it from the setup panel or a column's own menu. */ groupBy: string; /** Column the rows start sorted by, and what the default view restores to. The grid owns sort the way it owns every other column capability: the table is driven from here, so a saved view is a snapshot of grid state. */ sort: DataTableSortChangeDetail | null; /** Aggregate line for a group's header row, handed straight to the table. */ groupSummary: ((rows: TableRow[], key: string) => DataTableGroupSummary) | null; emptyHeading: string; emptyText: string; searchPlaceholder: string; /** Drop the whole toolbar. Each cluster below can also be dropped on its own — the toolbar belongs to the grid, so what it carries is per instance. */ toolbar: boolean; noSearch: boolean; noViews: boolean; noGrouping: boolean; noColumns: boolean; noDensity: boolean; noFullPage: boolean; private _query; private _density; private _groupBy; private _sortKey; private _sortDirection; private _widths; private _pinned; private _hidden; private _wrapped; private _collapsed; private _full; private _setupOpen; private _setupPane; private _columnMenu; private _views; private _viewId; private _viewDraft; private _hasEmpty; private _scrollLocked; private _columnMenuAnchor; private _defaultLayout; private _layoutSeededFrom; connectedCallback(): void; disconnectedCallback(): void; updated(): void; willUpdate(changed: Map): void; private _layoutFromColumns; private _currentLayout; private _applyLayout; private _signature; private get _allViews(); private get _activeView(); private get _dirty(); private _emitLayout; private get _visibleColumns(); private get _matches(); private get _table(); render(): TemplateResult; private _renderToolbar; private _renderSearch; private _renderSetup; private get _setupPanes(); private _renderSetupPane; private _renderSetupRoot; private _renderViewsPane; private _renderGroupPane; private _renderDensityPane; private _renderColumnsPane; private _renderColumnMenuTrigger; private _renderColumnMenu; private _renderColumnPanel; private _toggleColumnMenu; private _onDocPointer; private _menuRow; private _renderDensity; private _renderFullPage; private _renderEmptyRegion; private _renderNoMatches; private _onSearch; private get _matchCount(); private _clearSearch; private _onSortChange; private _onResize; private _onGroupToggle; private _setSort; private _setPinned; private _setHidden; private _setWrapped; private _setGroupBy; private _setDensity; private _selectView; private _saveView; private _deleteView; private _onSetupClose; private _closeSetup; } declare global { interface HTMLElementTagNameMap { "xm-data-grid": XmDataGrid; } }