import { GridApi } from '@xh/hoist/kit/ag-grid'; import { ColumnState } from '@xh/hoist/cmp/grid'; import { HoistModel, HoistProps, LayoutProps, PlainObject, ReactionSpec, TestSupportProps } from '@xh/hoist/core'; import type { StoreRecord } from '@xh/hoist/data'; import type { RecordSet, RecordSetDelta } from '@xh/hoist/data/impl/RecordSet'; import type { ColDef, ColGroupDef, GetContextMenuItemsParams, GridOptions, GridReadyEvent, ProcessCellForExportParams } from '@xh/hoist/kit/ag-grid'; import { type MouseEvent } from 'react'; import { PartialDeep } from 'type-fest'; import './Grid.scss'; import { GridModel } from './GridModel'; export interface GridProps extends HoistProps, LayoutProps, TestSupportProps { /** * Options for ag-Grid's API. * * This constitutes an 'escape hatch' for applications that need to get to the underlying * ag-Grid API. It should be used with care. Settings made here might be overwritten and/or * interfere with the implementation of this component and its use of the ag-Grid API. * * Note that changes to these options after the component's initial render will be ignored. */ agOptions?: PartialDeep; /** * Callback when the grid has initialized. The component will call this with the ag-Grid * event after running its internal handler to associate the ag-Grid APIs with its model. */ onGridReady?: (e: GridReadyEvent) => void; } /** * The primary rich data grid component within the Hoist toolkit. * It is a highly managed wrapper around ag-Grid and is the main display component for GridModel. * * Applications should typically configure and interact with Grids via a GridModel, which provides * support for specifying the Grid's data Store, Column definitions, sorting and grouping state, * selection API, and more. * * For advanced ag-Grid use-cases that are not well supported by this component, note that the * {@link AgGrid} Hoist component provides much thinner and less opinionated wrapper around ag-Grid * while still retaining consistent styling and some additional conveniences. However a number of * core Hoist integrations and features will *not* be available with that thinner wrapper. * * @see {@link https://www.ag-grid.com/javascript-grid-reference-overview/|ag-Grid Docs} * @see GridModel */ export declare const Grid: import("react").FC>, grid: import("@xh/hoist/core").ElementFactory>; export declare class GridLocalModel extends HoistModel { xhImpl: boolean; private static EMPTY_SPACE_SELECTOR; private model; agOptions: GridOptions; viewRef: import("react").RefObject & import("react").RefCallback; private rowKeyNavSupport; private transactionMgr; private autosizedAsOfFilter; private autosizeScheduler; /** @returns true if any root-level records have children */ get isHierarchical(): boolean; get emptyText(): import("react").ReactNode; constructor(); onLinked(): void; private createDefaultAgOptions; getColumnDefs(): Array; getContextMenuItems: (params: GetContextMenuItemsParams) => (string | import("ag-grid-community").MenuItemDef)[]; dataReaction(): { track: () => (boolean | import("@xh/hoist/core").VSide | StoreRecord[] | RecordSet)[]; run: () => void; debounce: number; }; selectionReaction(): { track: () => (boolean | import("@xh/hoist/data").StoreRecordId[])[]; run: () => void; }; sortReaction(): { track: () => (GridApi | import("@xh/hoist/cmp/grid").GridSorter[])[]; run: ([agApi, sortBy]: [any, any]) => void; }; groupReaction(): { track: () => (string[] | GridApi)[]; run: ([agApi, groupBy]: [any, any]) => void; }; get calculatedRowHeight(): any; get calculatedGroupRowHeight(): any; defaultGetRowHeight: ({ node }: { node: any; }) => any; rowHeightReaction(): { track: () => any[]; run: () => void; debounce: number; }; get useScrollOptimization(): boolean; applyScrollOptimization(added?: StoreRecord[]): void; columnsReaction(): { track: () => (GridApi | import("@xh/hoist/cmp/grid").ColumnOrGroup[])[]; run: ([api]: [any]) => void; }; columnStateReaction(): ReactionSpec<[GridApi, ColumnState[]]>; sizingModeReaction(): { track: () => import("@xh/hoist/core").SizingMode; run: () => void; }; validationDisplayReaction(): { track: () => (boolean | import("@xh/hoist/data").StoreValidationMessagesMap)[]; run: () => void; debounce: number; }; modalReaction(): { track: () => any; run: () => void; debounce: number; }; dashContainerReaction(): { track: () => any; run: (elem: any) => void; debounce: number; }; updatePinnedSummaryRowData(): void; syncData(): void; syncSelection(): void; transactionIsEmpty(t: RecordSetDelta): boolean; transactionCouldChangeStructure(t: RecordSetDelta, prevRs: RecordSet): boolean; getDataPath: (record: any) => any; /** * Loads and filter changes autosize immediately - the visible dataset changed. Data updates * instead pace off autosize's own cost, so a streaming grid isn't re-measuring every tick. */ private noteManagedAutosizeTrigger; private autosizeManagedAsync; onSelectionChanged: import("lodash").DebouncedFunc<() => void>; onDragStopped: (ev: any) => void; onColumnResized: (ev: any) => void; onColumnRowGroupChanged: (ev: any) => void; onRowGroupOpened: () => void; onColumnPinned: (ev: any) => void; onColumnVisible: (ev: any) => void; groupSortComparator: ({ nodeA, nodeB }: { nodeA: any; nodeB: any; }) => number; doWithPreservedState({ filters }: PlainObject, fn: any): void; readFilterState(): import("ag-grid-community").FilterModel; writeFilterState(filterState: any): void; processCellForClipboard: ({ value, node, column }: ProcessCellForExportParams) => any; navigateToNextCell: (agParams: any) => import("ag-grid-community").CellPosition; onViewMouseDown: (evt: MouseEvent) => void; onCellMouseDown: (evt: any) => void; onKeyDown: (evt: any) => void; onRowClicked: (evt: any) => void; onRowDoubleClicked: (evt: any) => void; /** * When a `Grid` context menu is open at the same time as a BP `Overlay2` with `enforceFocus`, * the context menu will lose focus, causing menu items not to highlight on hover. Prevent this * by conditionally stopping the focus event from propagating. */ private static didAddFocusFixListener; static addFocusFixListener(): void; }