import React, { type ChangeEvent, Component, type CSSProperties, type ReactElement, type ReactNode } from 'react'; import memoize from 'memoizee'; import { Tooltip, type ContextAction, type ResolvableContextAction } from '@deephaven/components'; import { Grid, type GridMetrics, type GridMouseHandler, GridRange, type GridRangeIndex, type KeyHandler, type ModelIndex, type ModelSizeMap, type MoveOperation, type VisibleIndex, type GridState, type BoundedAxisRange } from '@deephaven/grid'; import type { dh as DhType } from '@deephaven/jsapi-types'; import { Formatter, TableUtils, type FormattingRule, type ReverseType, type RowDataMap, type SortDirection, type DateTimeColumnFormatterOptions, type TableColumnFormat, type Settings, type SortDescriptor } from '@deephaven/jsapi-utils'; import { Pending, type EventT } from '@deephaven/utils'; import { type TypeValue as FilterTypeValue } from '@deephaven/filters'; import { type FormattingRule as SidebarFormattingRule } from './sidebar/conditional-formatting/ConditionalFormattingUtils'; import { type CopyOperation } from './IrisGridCopyHandler'; import FilterInputField from './FilterInputField'; import IrisGridMetricCalculator, { type IrisGridMetricState } from './IrisGridMetricCalculator'; import IrisGridRenderer from './IrisGridRenderer'; import { type IrisGridThemeType } from './IrisGridTheme'; import './IrisGrid.scss'; import { TableSaver, DownloadServiceWorkerUtils, type TableOptionsTransform } from './sidebar'; import { IrisGridContext } from './IrisGridContextProvider'; import IrisGridModel from './IrisGridModel'; import CrossColumnSearch from './CrossColumnSearch'; import { type PartitionConfig, type PartitionedGridModel } from './PartitionedGridModel'; import AdvancedSettingsType from './sidebar/AdvancedSettingsType'; import { type AdvancedSettingsMenuCallback } from './sidebar/AdvancedSettingsMenu'; import { type GotoRowElement } from './GotoRow'; import { type Aggregation, type AggregationSettings } from './sidebar/aggregations/Aggregations'; import { type ChartBuilderSettings } from './sidebar/ChartBuilder'; import type AggregationOperation from './sidebar/aggregations/AggregationOperation'; import { type UIRollupConfig } from './sidebar/RollupRows'; import { type Action, type AdvancedFilterOptions, type ColumnName, type InputFilter, type IrisGridStateOverride, type IrisGridViewState, type OperationMap, type OptionItem, type PendingDataErrorMap, type PendingDataMap, type QuickFilterMap, type ReadonlyAdvancedFilterMap, type ReadonlyAggregationMap, type ReadonlyQuickFilterMap, type UITotalsTableConfig } from './CommonTypes'; import type ColumnHeaderGroup from './ColumnHeaderGroup'; export type FilterData = { operator?: FilterTypeValue; text: string; value: unknown; startColumnIndex: number; }; export type FilterMap = Map; export interface IrisGridContextMenuData { model: IrisGridModel; value: unknown; valueText: string | null; column: DhType.Column; rowIndex: GridRangeIndex; columnIndex: GridRangeIndex; modelRow?: GridRangeIndex; modelColumn: GridRangeIndex; } export type MouseHandlersProp = readonly (GridMouseHandler | ((irisGrid: IrisGrid) => GridMouseHandler))[]; export type GetMetricCalculatorType = (...args: ConstructorParameters) => IrisGridMetricCalculator; export interface IrisGridProps { children?: React.ReactNode; advancedFilters: ReadonlyAdvancedFilterMap; advancedSettings: ReadonlyMap; alwaysFetchColumns: readonly ColumnName[]; isFilterBarShown: boolean; applyInputFiltersOnInit: boolean; conditionalFormats: readonly SidebarFormattingRule[]; customColumnFormatMap: ReadonlyMap; columnAlignmentMap: ReadonlyMap; model: IrisGridModel; movedColumns: readonly MoveOperation[]; movedRows: readonly MoveOperation[]; inputFilters: readonly InputFilter[]; customFilters: readonly DhType.FilterCondition[]; onCreateChart: (settings: ChartBuilderSettings, model: IrisGridModel) => void; onColumnSelected: (column: DhType.Column) => void; onError: (error: unknown) => void; onDataSelected: (index: ModelIndex, map: RowDataMap) => void; onStateChange: (irisGridState: IrisGridState, gridState: GridState) => void; onAdvancedSettingsChange: AdvancedSettingsMenuCallback; /** * Pure transform over the default Table Options menu list. Receives * the built-in items (already filtered by model availability) and * returns the items to actually render. Use it to add, hide, * relabel, reorder, or replace entries. * * Items returned with a `configPage` are rendered by the * `default` case of the page switch and isolated inside a small * error boundary; items without a `configPage` MUST have a `type` * matching an existing `OptionType` enum value, otherwise the * existing case arms can't render them. * * Called inside memoization; the function should be referentially * stable and side-effect-free. A throwing transform is logged once * and treated as identity for that render. */ transformTableOptions?: TableOptionsTransform; /** @deprecated use `partitionConfig` instead */ partitions?: (string | null)[]; partitionConfig?: PartitionConfig; sorts: readonly SortDescriptor[]; isSortsControlled: boolean; onSortsChange?: (sorts: readonly SortDescriptor[]) => void; /** @deprecated use `reverse` instead */ reverseType?: ReverseType; reverse: boolean; quickFilters: ReadonlyQuickFilterMap | null; isQuickFiltersControlled: boolean; onQuickFiltersChange?: (quickFilters: ReadonlyQuickFilterMap) => void; customColumns: readonly ColumnName[]; selectDistinctColumns: readonly ColumnName[]; settings?: Settings; /** * @deprecated Pass `userColumnWidthsByName` instead. The by-index map is * lossy across model swaps because column indices change when the model * is replaced (e.g. when applying or removing a rollup). Kept for * back-compat with consumers that have not migrated. */ userColumnWidths: ReadonlyMap; /** * Map of user-set column widths keyed by column name. Source of truth * for hidden/manually-sized columns across model swaps and persistence * boundaries. Takes precedence over `userColumnWidths` when both are * provided. */ userColumnWidthsByName?: ReadonlyMap; userRowHeights: ReadonlyMap; onSelectionChanged: (gridRanges: readonly GridRange[]) => void; rollupConfig?: UIRollupConfig; aggregationSettings: AggregationSettings; isSelectingColumn: boolean; isSelectingPartition: boolean; isStuckToBottom: boolean; isStuckToRight: boolean; columnSelectionValidator?: (value: DhType.Column | null) => boolean; columnAllowedCursor: string; columnNotAllowedCursor: string; copyCursor: string; name: string; onlyFetchVisibleColumns: boolean; showSearchBar: boolean; searchValue: string; selectedSearchColumns?: readonly ColumnName[]; invertSearchColumns: boolean; onContextMenu: (data: IrisGridContextMenuData) => readonly ResolvableContextAction[]; pendingDataMap?: PendingDataMap; getDownloadWorker: () => Promise; canCopy: boolean; canDownloadCsv: boolean; frozenColumns: readonly ColumnName[]; theme?: Partial & Record; canToggleSearch: boolean; columnHeaderGroups?: readonly ColumnHeaderGroup[]; keyHandlers: readonly KeyHandler[]; mouseHandlers: MouseHandlersProp; renderer?: IrisGridRenderer; density?: 'compact' | 'regular' | 'spacious'; getMetricCalculator: GetMetricCalculatorType; } /** * The subset of `IrisGridProps` that overrides how the grid presents its * model: theme, canvas renderer, extra mouse handlers, and the metric * calculator factory. Hosts that render `` on behalf of a plugin * (e.g. `GridWidgetPlugin`) accept this as a single passthrough bag so they * don't need to know each view concern by name, and plugins build it from * their own hooks. Kept as a `Pick` (not `Partial`) so it can * never clobber structural props like `model` or `ref`. */ export type IrisGridViewProps = Pick; export interface IrisGridState { isFilterBarShown: boolean; isSelectingPartition: boolean; focusedFilterBarColumn: number | null; metricCalculator: IrisGridMetricCalculator; metrics?: GridMetrics; partitionConfig?: PartitionConfig; quickFilters: ReadonlyQuickFilterMap; advancedFilters: ReadonlyAdvancedFilterMap; shownAdvancedFilter: number | null; maximizedAdvancedFilter: number | null; hoverAdvancedFilter: number | null; sorts: readonly SortDescriptor[]; reverse: boolean; customColumns: readonly ColumnName[]; selectDistinctColumns: readonly ColumnName[]; selectedRanges: readonly GridRange[]; copyOperation: CopyOperation | null; loadingText: string | null; loadingScrimProgress: number | null; loadingSpinnerShown: boolean; loadingCancelShown: boolean; loadingBlocksGrid: boolean; movedColumns: readonly MoveOperation[]; movedRows: readonly MoveOperation[]; shownColumnTooltip: number | null; formatter: Formatter; isMenuShown: boolean; customColumnFormatMap: Map; columnAlignmentMap: Map; conditionalFormats: readonly SidebarFormattingRule[]; conditionalFormatEditIndex: number | null; conditionalFormatPreview?: SidebarFormattingRule; conditionalFormatError: string | null; hoverSelectColumn: GridRangeIndex; isTableDownloading: boolean; isReady: boolean; tableDownloadStatus: string; tableDownloadProgress: number; tableDownloadEstimatedTime: number | null; showSearchBar: boolean; searchFilter?: DhType.FilterCondition; searchValue: string; selectedSearchColumns: readonly ColumnName[]; invertSearchColumns: boolean; rollupConfig?: UIRollupConfig; rollupSelectedColumns: readonly ColumnName[]; aggregationSettings: AggregationSettings; selectedAggregation: Aggregation | null; openOptions: readonly OptionItem[]; pendingRowCount: number; pendingDataMap: PendingDataMap; pendingDataErrors: PendingDataErrorMap; pendingSavePromise: Promise | null; pendingSaveError: string | null; toastMessage: JSX.Element | null; frozenColumns: readonly ColumnName[]; showOverflowModal: boolean; showNoPastePermissionModal: boolean; noPastePermissionError: string; overflowText: string; overflowButtonTooltipProps: CSSProperties | null; expandCellTooltipProps: CSSProperties | null; expandTooltipDisplayValue: string; hoverTooltipProps: CSSProperties | null; hoverDisplayValue: ReactNode; gotoRow: string; gotoRowError: string; gotoValueError: string; isGotoShown: boolean; gotoValueSelectedColumnName: ColumnName; gotoValueSelectedFilter: FilterTypeValue; gotoValueManuallyChanged: boolean; gotoValue: string; columnHeaderGroups: readonly ColumnHeaderGroup[]; } declare class IrisGrid extends Component { static contextType: React.Context<{ theme: import("./IrisGridContextProvider").IrisGridThemeContextValue | null; density: "compact" | "regular" | "spacious"; cellInputRendererRegistry: import("@deephaven/grid").CellInputRendererRegistry; }>; context: React.ContextType; static minDebounce: number; static maxDebounce: number; static loadingSpinnerDelay: number; static defaultProps: { advancedFilters: ReadonlyMap; advancedSettings: ReadonlyMap; alwaysFetchColumns: readonly never[]; conditionalFormats: readonly never[]; customColumnFormatMap: ReadonlyMap; columnAlignmentMap: ReadonlyMap; isFilterBarShown: false; applyInputFiltersOnInit: false; movedColumns: readonly never[]; movedRows: readonly never[]; inputFilters: readonly never[]; customFilters: readonly never[]; onCreateChart: undefined; onColumnSelected: () => void; onDataSelected: () => void; onError: () => void; onStateChange: () => void; onAdvancedSettingsChange: () => void; partitions: undefined; partitionConfig: undefined; quickFilters: ReadonlyMap; isQuickFiltersControlled: false; onQuickFiltersChange: undefined; selectDistinctColumns: readonly never[]; sorts: readonly never[]; isSortsControlled: false; onSortsChange: undefined; reverse: false; customColumns: readonly never[]; aggregationSettings: Readonly<{ aggregations: readonly never[]; showOnTop: false; }>; rollupConfig: undefined; userColumnWidths: ReadonlyMap; userColumnWidthsByName: undefined; userRowHeights: ReadonlyMap; onSelectionChanged: () => void; isSelectingColumn: false; isSelectingPartition: false; isStuckToBottom: false; isStuckToRight: false; columnAllowedCursor: string; columnNotAllowedCursor: string; copyCursor: string; name: string; onlyFetchVisibleColumns: true; showSearchBar: false; searchValue: string; invertSearchColumns: true; onContextMenu: () => readonly ResolvableContextAction[]; pendingDataMap: ReadonlyMap; getDownloadWorker: typeof DownloadServiceWorkerUtils.getServiceWorker; settings: { timeZone: string; defaultDateTimeFormat: string; showTimeZone: false; showTSeparator: true; truncateNumbersWithPound: false; showEmptyStrings: true; showNullStrings: true; showExtraGroupColumn: true; formatter: readonly never[]; }; canCopy: true; canDownloadCsv: true; frozenColumns: undefined; density: undefined; canToggleSearch: true; mouseHandlers: readonly never[]; keyHandlers: readonly never[]; getMetricCalculator: (options?: import("./IrisGridMetricCalculator").IrisGridMetricCalculatorOptions | undefined) => IrisGridMetricCalculator; }; constructor(props: IrisGridProps); componentDidMount(): void; componentDidUpdate(prevProps: IrisGridProps, prevState: IrisGridState): void; componentWillUnmount(): void; grid: Grid | null; lastFocusedFilterBarColumn?: number; lastLoadedConfig: Pick | null; tooltip?: Tooltip; pending: Pending; globalColumnFormats?: readonly FormattingRule[]; dateTimeFormatterOptions?: DateTimeColumnFormatterOptions; decimalFormatOptions: { defaultFormatString?: string; }; integerFormatOptions: { defaultFormatString?: string; }; truncateNumbersWithPound: boolean; showEmptyStrings: boolean; showNullStrings: boolean; showExtraGroupColumn: boolean; loadingScrimStartTime?: number; loadingScrimFinishTime?: number; animationFrame?: number; loadingTimer?: ReturnType; tableSaver: TableSaver | null; crossColumnRef: React.RefObject; isAnimating: boolean; filterInputRef: React.RefObject; gotoRowRef: React.RefObject; isCopying: boolean; toggleFilterBarAction: Action; toggleSearchBarAction: Action; toggleGotoRowAction: Action; discardAction: Action; commitAction: Action; contextActions: ContextAction[]; tableUtils: TableUtils; keyHandlers: readonly KeyHandler[]; mouseHandlers: MouseHandlersProp; /** * The metric calculator factory most recently used to instantiate the * calculator currently stored in state. Used by `maybeRebuildMetricCalculator` * (called from `componentDidUpdate` when the `getMetricCalculator` prop * changes) to detect when a different factory is supplied and rebuild. */ lastMetricCalculatorFactory?: GetMetricCalculatorType; slideTransitionRef: React.RefObject; bottomTransitionRef: React.RefObject; get gridWrapper(): HTMLDivElement | null; getAdvancedMenuOpenedHandler: ((column: ModelIndex) => () => void) & memoize.Memoized<(column: ModelIndex) => () => void>; getAdvancedMenuToggleMaximizeHandler: ((column: ModelIndex) => () => void) & memoize.Memoized<(column: ModelIndex) => () => void>; getCachedAdvancedFilterMenuActions: ((model: IrisGridModel, column: DhType.Column, advancedFilterOptions: AdvancedFilterOptions | undefined, sortDirection: SortDirection | undefined, formatter: Formatter, isMaximized: boolean, onToggleMaximize: () => void) => import("react/jsx-runtime").JSX.Element) & memoize.Memoized<(model: IrisGridModel, column: DhType.Column, advancedFilterOptions: AdvancedFilterOptions | undefined, sortDirection: SortDirection | undefined, formatter: Formatter, isMaximized: boolean, onToggleMaximize: () => void) => import("react/jsx-runtime").JSX.Element>; getCachedOptionItems: ((isChartBuilderAvailable: boolean, isCustomColumnsAvailable: boolean, isFormatColumnsAvailable: boolean, isOrganizeColumnsAvailable: boolean, isRollupAvailable: boolean, isTotalsAvailable: boolean, isSelectDistinctAvailable: boolean, isExportAvailable: boolean, toggleFilterBarAction: Action, toggleSearchBarAction: Action, toggleGotoRowAction: Action, isFilterBarShown: boolean, showSearchBar: boolean, canDownloadCsv: boolean, canToggleSearch: boolean, showGotoRow: boolean, hasAdvancedSettings: boolean) => readonly OptionItem[]) & memoize.Memoized<(isChartBuilderAvailable: boolean, isCustomColumnsAvailable: boolean, isFormatColumnsAvailable: boolean, isOrganizeColumnsAvailable: boolean, isRollupAvailable: boolean, isTotalsAvailable: boolean, isSelectDistinctAvailable: boolean, isExportAvailable: boolean, toggleFilterBarAction: Action, toggleSearchBarAction: Action, toggleGotoRowAction: Action, isFilterBarShown: boolean, showSearchBar: boolean, canDownloadCsv: boolean, canToggleSearch: boolean, showGotoRow: boolean, hasAdvancedSettings: boolean) => readonly OptionItem[]>; /** * Apply the `transformTableOptions` transform (if any) to the * default option list. * Catches exceptions so a buggy plugin can't break the grid, and collapses * duplicate `type` entries (last writer wins) before sorting by `order`. */ getCachedTransformedOptionItems: ((items: readonly OptionItem[], transformTableOptions: IrisGridProps["transformTableOptions"]) => readonly OptionItem[]) & memoize.Memoized<(items: readonly OptionItem[], transformTableOptions: IrisGridProps["transformTableOptions"]) => readonly OptionItem[]>; getCachedHiddenColumns: ((metricCalculator: IrisGridMetricCalculator, userColumnWidths: ModelSizeMap) => readonly ModelIndex[]) & memoize.Memoized<(metricCalculator: IrisGridMetricCalculator, userColumnWidths: ModelSizeMap) => readonly ModelIndex[]>; getCachedHiddenColumnNames: ((hiddenColumns: readonly ModelIndex[], columns: readonly DhType.Column[]) => readonly ColumnName[]) & memoize.Memoized<(hiddenColumns: readonly ModelIndex[], columns: readonly DhType.Column[]) => readonly ColumnName[]>; getCachedViewState: ((hiddenColumns: readonly ColumnName[]) => IrisGridViewState) & memoize.Memoized<(hiddenColumns: readonly ColumnName[]) => IrisGridViewState>; getAggregationMap: ((columns: readonly DhType.Column[], aggregations: readonly Aggregation[]) => ReadonlyAggregationMap) & memoize.Memoized<(columns: readonly DhType.Column[], aggregations: readonly Aggregation[]) => ReadonlyAggregationMap>; getOperationMap: ((columns: readonly DhType.Column[], aggregations: readonly Aggregation[]) => OperationMap) & memoize.Memoized<(columns: readonly DhType.Column[], aggregations: readonly Aggregation[]) => OperationMap>; getOperationOrder: ((aggregations: readonly Aggregation[]) => AggregationOperation[]) & memoize.Memoized<(aggregations: readonly Aggregation[]) => AggregationOperation[]>; getCachedFormatColumns: ((dh: typeof DhType, columns: readonly DhType.Column[], rules: readonly SidebarFormattingRule[]) => DhType.CustomColumn[]) & memoize.Memoized<(dh: typeof DhType, columns: readonly DhType.Column[], rules: readonly SidebarFormattingRule[]) => DhType.CustomColumn[]>; /** * Builds formatColumns array based on the provided formatting rules with optional preview * @param columns Array of columns * @param rulesParam Array of formatting rules * @param preview Optional temporary formatting rule for previewing live changes * @param editIndex Index in the rulesParam array to replace with the preview, null if preview not applicable * @returns Format columns array */ getCachedPreviewFormatColumns: ((dh: typeof DhType, columns: readonly DhType.Column[], rulesParam: readonly SidebarFormattingRule[], preview?: SidebarFormattingRule, editIndex?: number) => DhType.CustomColumn[]) & memoize.Memoized<(dh: typeof DhType, columns: readonly DhType.Column[], rulesParam: readonly SidebarFormattingRule[], preview?: SidebarFormattingRule, editIndex?: number) => DhType.CustomColumn[]>; getModelRollupConfig: ((originalColumns: readonly DhType.Column[], config: UIRollupConfig | undefined, aggregationSettings: AggregationSettings) => DhType.RollupConfig | null) & memoize.Memoized<(originalColumns: readonly DhType.Column[], config: UIRollupConfig | undefined, aggregationSettings: AggregationSettings) => DhType.RollupConfig | null>; getModelTotalsConfig: ((columns: readonly DhType.Column[], config: UIRollupConfig | undefined, aggregationSettings: AggregationSettings) => UITotalsTableConfig | null) & memoize.Memoized<(columns: readonly DhType.Column[], config: UIRollupConfig | undefined, aggregationSettings: AggregationSettings) => UITotalsTableConfig | null>; getCachedStateOverride: ((model: IrisGridModel, theme: IrisGridThemeType, hoverSelectColumn: GridRangeIndex, isFilterBarShown: boolean, isSelectingColumn: boolean, loadingScrimProgress: number | null, quickFilters: ReadonlyQuickFilterMap, advancedFilters: ReadonlyAdvancedFilterMap, sorts: readonly SortDescriptor[], reverse: boolean, rollupConfig: UIRollupConfig | undefined, isMenuShown: boolean) => IrisGridStateOverride) & memoize.Memoized<(model: IrisGridModel, theme: IrisGridThemeType, hoverSelectColumn: GridRangeIndex, isFilterBarShown: boolean, isSelectingColumn: boolean, loadingScrimProgress: number | null, quickFilters: ReadonlyQuickFilterMap, advancedFilters: ReadonlyAdvancedFilterMap, sorts: readonly SortDescriptor[], reverse: boolean, rollupConfig: UIRollupConfig | undefined, isMenuShown: boolean) => IrisGridStateOverride>; getCachedFilter: ((customFilters: readonly DhType.FilterCondition[], quickFilters: ReadonlyQuickFilterMap, advancedFilters: ReadonlyAdvancedFilterMap, searchFilter: DhType.FilterCondition | undefined) => DhType.FilterCondition[]) & memoize.Memoized<(customFilters: readonly DhType.FilterCondition[], quickFilters: ReadonlyQuickFilterMap, advancedFilters: ReadonlyAdvancedFilterMap, searchFilter: DhType.FilterCondition | undefined) => DhType.FilterCondition[]>; getCachedTheme: ((contextTheme: IrisGridThemeType | null, theme: Partial | undefined, isEditable: boolean, floatingRowCount: number, density: "compact" | "regular" | "spacious") => IrisGridThemeType) & memoize.Memoized<(contextTheme: IrisGridThemeType | null, theme: Partial | undefined, isEditable: boolean, floatingRowCount: number, density: "compact" | "regular" | "spacious") => IrisGridThemeType>; getCachedKeyHandlers: ((keyHandlers: readonly KeyHandler[]) => KeyHandler[]) & memoize.Memoized<(keyHandlers: readonly KeyHandler[]) => KeyHandler[]>; getKeyHandlers(): readonly KeyHandler[]; getMetricState(): IrisGridMetricState | undefined; getCachedMouseHandlers: ((mouseHandlersProp: MouseHandlersProp) => readonly GridMouseHandler[]) & memoize.Memoized<(mouseHandlersProp: MouseHandlersProp) => readonly GridMouseHandler[]>; getCachedRenderer: ((rendererProp?: IrisGridRenderer) => IrisGridRenderer) & memoize.Memoized<(rendererProp?: IrisGridRenderer) => IrisGridRenderer>; get renderer(): IrisGridRenderer; getMouseHandlers(): readonly GridMouseHandler[]; getValueForCell(columnIndex: GridRangeIndex, rowIndex: GridRangeIndex, rawValue?: boolean): string | unknown; /** * Get the model column index for the provided visible index * @param columnIndex Visible column index * @returns Model column index, or null if not found */ getModelColumn(columnIndex: GridRangeIndex): ModelIndex | null | undefined; getModelRow(rowIndex: GridRangeIndex): ModelIndex | null | undefined; getTheme(): IrisGridThemeType; getVisibleColumn(modelIndex: ModelIndex): VisibleIndex; makeQuickFilter(column: DhType.Column, text: string, timeZone: string): DhType.FilterCondition | null; /** * Applies the provided input filters as quick filters, * and clears any existing quickFilters or advancedFilters on that column * @param inputFilters Array of input filters to apply * @param replaceExisting If true, new filters will replace the existing ones, instead of merging * @returns True if any filters were changed as a result of this operation */ applyInputFilters(inputFilters: InputFilter[], replaceExisting?: boolean): boolean; /** * Applies a quick filter * @param modelIndex The index in the model of the column to set * @param value The string value to set to the quick filter * @param quickFilters The quick filters map * @returns True if the filters have changed because this quick filter was applied */ applyQuickFilter(modelIndex: ModelIndex, value: string | null, quickFilters: QuickFilterMap): boolean; setAdvancedFilterMap(advancedFilters: ReadonlyAdvancedFilterMap): void; setAdvancedFilter(modelIndex: ModelIndex, filter: DhType.FilterCondition | null, options: AdvancedFilterOptions): void; /** * Sets a quick filter against the provided column * @param modelIndex The index in the model for the column this filter is applied to * @param filter A filter to apply to the column, or null if there was an error * @param text The original text the filter was created with */ setQuickFilter(modelIndex: ModelIndex, filter: DhType.FilterCondition | null, text: string): void; /** * Set grid filters based on the filter map * @param filterMap Filter map */ setFilterMap(filterMap: FilterMap): void; removeColumnFilter(modelRange: ModelIndex | BoundedAxisRange): void; removeQuickFilter(modelColumn: ModelIndex): void; clearAllFilters(): void; clearAllAggregations(): void; clearCrossColumSearch(): void; clearGridInputField(): void; /** * Rebuilds all the current filters. Necessary if something like the time zone has changed. */ rebuildFilters(): void; setFilters({ quickFilters, advancedFilters, }: Pick): void; updateFormatterSettings(settings?: Settings, forceUpdate?: boolean): void; getAlwaysFetchColumns: ((alwaysFetchColumns: readonly ColumnName[], columns: readonly DhType.Column[], movedColumns: readonly MoveOperation[], floatingLeftColumnCount: number, floatingRightColumnCount: number, draggingRange?: BoundedAxisRange) => readonly ColumnName[]) & memoize.Memoized<(alwaysFetchColumns: readonly ColumnName[], columns: readonly DhType.Column[], movedColumns: readonly MoveOperation[], floatingLeftColumnCount: number, floatingRightColumnCount: number, draggingRange?: BoundedAxisRange) => readonly ColumnName[]>; updateFormatter(updatedFormats: { customColumnFormatMap?: Map; }, forceUpdate?: boolean): void; initFormatter(): void; initState(): void; loadTableState(): void; loadPartitionsTable(model: PartitionedGridModel): Promise; /** * Initialize the partition config to the default partition. */ initializePartitionConfig(model: PartitionedGridModel): Promise; /** * Selects a partition key from the table based on the provided row index. * * @param rowIndex The index of the row from which the partition will be selected. * @returns A promise that resolves when the partition key has been successfully selected. */ selectPartitionKeyFromTable(rowIndex: GridRangeIndex): void; copyCell(columnIndex: GridRangeIndex, rowIndex: GridRangeIndex, rawValue?: boolean): void; copyColumnHeader(columnIndex: GridRangeIndex, columnDepth?: number): void; /** * Copy the provided ranges to the clipboard * @paramranges The ranges to copy * @param includeHeaders Include the headers or not * @param formatValues Whether to format values or not * @param error Error message if one occurred */ copyRanges(ranges: readonly GridRange[], includeHeaders?: boolean, formatValues?: boolean, error?: string): void; startLoading(loadingText: string, { resetRanges, loadingCancelShown, loadingBlocksGrid, }?: { resetRanges?: boolean | undefined; loadingCancelShown?: boolean | undefined; loadingBlocksGrid?: boolean | undefined; }): void; stopLoading(): void; /** * Rolls back the table state to the last known safe state, or if that's not available then clears all sorts/filters/custom columns. */ rollback(): void; /** * Check if we can rollback the current state to a safe state. * @returns true if there's a previously known safe state or if some of the current state isn't empty. */ canRollback(): boolean; startListening(model: IrisGridModel): void; stopListening(model: IrisGridModel): void; focus(): void; focusFilterBar(column: VisibleIndex): void; hideColumnByVisibleIndex(columnVisibleIndex: VisibleIndex): void; freezeColumnByColumnName(columnName: ColumnName): void; unFreezeColumnByColumnName(columnName: ColumnName): void; /** * Updates the entire list of frozen columns. * Used by VisibilityOrderingBuilder. * @param frozenColumns The new list of frozen columns */ handleFrozenColumnsChanged(frozenColumns: readonly ColumnName[]): void; toggleExpandColumn(modelIndex: ModelIndex, expandDescendants?: boolean): void; expandAllColumns(): void; collapseAllColumns(): void; handleColumnVisibilityChanged(modelIndexes: readonly ModelIndex[], isVisible: boolean): void; handleColumnVisibilityReset(): void; handleCrossColumnSearch(searchValue: string, selectedSearchColumns: readonly ColumnName[], invertSearchColumns: boolean): void; updateSearchFilter: import("lodash").DebouncedFunc<(searchValue: string, selectedSearchColumns: readonly ColumnName[], columns: readonly DhType.Column[], invertSearchColumns: boolean) => void>; handleAnimationLoop(): void; handleAnimationStart(): void; handleAnimationEnd(): void; handlePartitionChange(partitionConfig: PartitionConfig): void; handleTableLoadError(error: unknown): void; handleViewportUpdated(): void; showViewportLoading: import("lodash").DebouncedFunc<() => void>; showAllColumns(): void; /** * Updates grid metrics after model columns have changed * to keep Grid and IrisGrid metrics in sync since metrics are stored in both places. */ updateMetrics(): void; toggleSort(columnIndex: VisibleIndex, addToExisting: boolean): void; updateSorts(sorts: readonly SortDescriptor[]): void; requestSortsChange(sorts: readonly SortDescriptor[]): void; updateQuickFilters(quickFilters: ReadonlyQuickFilterMap | null): void; requestQuickFiltersChange(quickFilters: ReadonlyQuickFilterMap): void; sortColumn(modelColumn: ModelIndex, direction?: SortDirection, isAbs?: boolean, addToExisting?: boolean): void; reverse(reverse: boolean): void; isReversible(): boolean; toggleFilterBar(focusIndex?: number | undefined): void; isTableSearchAvailable(): boolean; toggleSearchBar(): void; toggleGotoRow(row?: string, value?: string, columnName?: string): void; commitPending(): Promise; discardPending(): Promise; /** * Select the passed in column and notify listener * @param column The column in this table to link */ selectColumn(column: DhType.Column): void; /** * Get the row data map for a given row and notifies the listener */ selectData(columnIndex: ModelIndex, rowIndex: ModelIndex): void; /** * Get the data map for the given row * @param rowIndex Row to get the data map for * @returns Data map for the row */ getRowDataMap(rowIndex: ModelIndex): RowDataMap; handleAdvancedFilterChange(column: DhType.Column, filter: DhType.FilterCondition | null, options: AdvancedFilterOptions): void; handleAdvancedFilterSortChange(column: DhType.Column, direction: SortDirection, addToExisting?: boolean): void; handleAdvancedFilterDone(): void; handleAdvancedFilterToggleMaximize(column: GridRangeIndex): void; handleAdvancedMenuOpened(column: GridRangeIndex): void; handleGotoRowOpened(): void; handleGotoRowClosed(): void; handleAdvancedMenuClosed(columnIndex: number): void; handleCancel(): void; handleChartChange(): void; handleChartCreate(settings: ChartBuilderSettings): void; handleGridError(error?: Error): void; handleFilterBarChange(value: string): void; handleFilterBarDone(setGridFocus?: boolean, defocusInput?: boolean): void; handleFilterBarTab(backward: boolean): void; handleFormatSelection(modelIndex: ModelIndex, selectedFormat: TableColumnFormat | null): void; handleColumnAlignmentChange(modelIndex: ModelIndex, alignment: CanvasTextAlign | null): void; handleMenu(e: React.MouseEvent): void; handleMenuClose(): void; handleMenuBack(): void; handleMenuSelect(option: OptionItem): void; handleRequestFailed(event: EventT): void; /** * Raise the loading scrim in response to a model-driven `PENDING` event. The * model is the start signal, mirroring how `UPDATED`/`COLUMNS_CHANGED` are * already the model-driven stop signal. Idempotent: the first message within * a commit wins (the `loadingScrimStartTime == null` guard collapses multiple * pending operations into a single scrim). */ handlePending(event: EventT): void; /** * Clear the loading scrim in response to a model-driven `PENDING_CLEARED` * event. Only needed for operations that do not naturally end in * `UPDATED`/`COLUMNS_CHANGED`/`REQUEST_FAILED`. * * The current contract assumes a single outstanding model-driven operation: * `handlePending` collapses concurrent `PENDING` events into one scrim, so * this clears unconditionally. That is consistent with the existing scrim, * which any model stop signal already clears regardless of what else is in * flight. Ref-counting overlapping operations is intentionally deferred to * the planned migration that routes the built-in `startLoading` calls * through `PENDING`/`PENDING_CLEARED`; only once every raise/clear goes * through this pair can a depth counter stay balanced (a counter added now * would desync against the direct `startLoading` callers). */ handlePendingCleared(): void; handleUpdate(): void; handleTableChanged(): void; /** * Handle an inner-model swap on a proxy model (`SCHEMA_CHANGED`). The previous * model's `movedColumns` reference indices that may not exist in the new * model (e.g. a pivot exposes a different column set), so reset them to the * new model's initial order. The metric calculator is rebuilt separately when * the `getMetricCalculator` prop changes (see `componentDidUpdate`); a calc * whose seed `movedColumns` are now stale self-heals because `getMetrics` * reconciles against the grid's current `movedColumns` at draw time. */ handleSchemaChanged(): void; handleViewChanged(metrics?: GridMetrics): void; handleSelectionChanged(selectedRanges?: readonly GridRange[]): void; handleMovedColumnsChanged(movedColumns: readonly MoveOperation[], onChangeApplied?: () => void): void; handleHeaderGroupsChanged(columnHeaderGroups: readonly (DhType.ColumnGroup | ColumnHeaderGroup)[]): void; handleTooltipRef(tooltip: Tooltip): void; handleConditionalFormatsChange(conditionalFormats: readonly SidebarFormattingRule[]): void; handleConditionalFormatCreate(): void; handleConditionalFormatEdit(index: number): void; handleConditionalFormatEditorUpdate: import("lodash").DebouncedFunc<(conditionalFormatPreview?: SidebarFormattingRule) => void>; handleConditionalFormatEditorSave(config: SidebarFormattingRule): void; handleConditionalFormatEditorCancel(): void; handleUpdateCustomColumns(customColumns: readonly string[]): void; handleCustomColumnsChanged(): void; /** * Rebuild the metric calculator when the `getMetricCalculator` prop swaps for * a different factory (e.g. entering or leaving a pivot, where the * pivot-builder middleware flips the prop). The renderer and mouse handlers * are recomputed via their memoized getters on the next render and do not * need explicit handling here. * * User column-widths / row-heights from the previous calculator are not * carried over: a factory swap means the column set has effectively changed, * so the stored sizes wouldn't map to anything meaningful. * * Moved columns are NOT reset here — that is owned by `handleSchemaChanged` * (the `SCHEMA_CHANGED` event) so that a plain prop swap against the same * model preserves the user's layout. The new calculator is seeded with the * current moved columns; `getMetrics` reconciles against the grid's live * `movedColumns` at draw time, so a later reset stays consistent. */ maybeRebuildMetricCalculator(): void; handlePendingCommitClicked(): Promise; handlePendingDiscardClicked(): Promise; handlePendingDataUpdated(): void; handleResizeColumn(modelIndex: number): void; handleResizeAllColumns(): void; /** * User added, removed, or changed the order of aggregations, or position * @param aggregationSettings The new aggregation settings * @param added The aggregations that were added * @param removed The aggregations that were removed */ handleAggregationsChange(aggregationSettings: AggregationSettings, added?: AggregationOperation[], removed?: AggregationOperation[]): void; /** * A specific aggregation has been modified * @param aggregation The new aggregation */ handleAggregationChange(aggregation: Aggregation): void; /** * An aggregations has been selected for editing * @param aggregation The aggregation to edit */ handleAggregationEdit(aggregation: Aggregation): void; handleRollupChange(rollupConfig: UIRollupConfig): void; handleSelectDistinctChanged(columnNames: readonly ColumnName[]): void; handleDownloadTableStart(): void; handleDownloadTable(fileName: string, frozenTable: DhType.Table, tableSubscription: DhType.TableViewportSubscription, snapshotRanges: readonly GridRange[], modelRanges: readonly GridRange[], includeColumnHeaders: boolean, useUnformattedValues: boolean): void; /** * Aggregation editing has completed. Need to filter out any aggregations that have no columns selected */ removeEmptyAggregations(): void; seekRow(inputString: string, isBackwards?: boolean): Promise; handleCancelDownloadTable(): void; handleDownloadProgressUpdate: import("lodash").DebouncedFuncLeading<(tableDownloadProgress: number, tableDownloadEstimatedTime: number | null) => void>; handleDownloadCompleted(): void; handleDownloadCanceled(): void; /** * Delete the specified ranges from the table. * @param ranges The ranges to delete */ deleteRanges(ranges: readonly GridRange[]): void; resetColumnSelection(): void; resetGridViewState(forceUpdate?: boolean): void; sendStateChange(): void; handleOverflowClose(): void; handleOpenNoPastePermissionModal(errorMessage: string): void; handleCloseNoPastePermissionModal(): void; getColumnBoundingRect(): DOMRect; getOverflowButtonTooltip: ((overflowButtonTooltipProps: CSSProperties) => ReactNode) & memoize.Memoized<(overflowButtonTooltipProps: CSSProperties) => ReactNode>; getExpandCellTooltip: ((expandCellTooltipProps: CSSProperties) => ReactNode) & memoize.Memoized<(expandCellTooltipProps: CSSProperties) => ReactNode>; getHoverTooltip: ((hoverTooltipProps: CSSProperties) => ReactNode) & memoize.Memoized<(hoverTooltipProps: CSSProperties) => ReactNode>; handleGotoRowSelectedRowNumberSubmit(): void; focusRowInGrid(rowNumber: string): void; handleGotoRowSelectedRowNumberChanged(event: ChangeEvent): void; getColumnTooltip(visibleIndex: VisibleIndex, metrics: GridMetrics, model: IrisGridModel): ReactNode; handleGotoValueSelectedColumnNameChanged(columnName: ColumnName): void; handleGotoValueSelectedFilterChanged(value: FilterTypeValue): void; handleGotoValueChanged: (input: string) => void; debouncedSeekRow: import("lodash").DebouncedFunc<(input: string) => void>; handleGotoValueSubmitted(isBackwards?: boolean): void; /** * Render the input field for the focused filter * @param metrics Grid metrics * @param metricCalculator Metric calculator * @param focusedFilterBarColumn Column index for the focused filter * @param quickFilters Quick filters map * @param advancedFilters Advanced filters map * @returns The filter input field element or null if not applicable */ getFilterBarInput(metrics: GridMetrics | undefined, metricCalculator: IrisGridMetricCalculator, focusedFilterBarColumn: VisibleIndex | null, quickFilters: ReadonlyQuickFilterMap, advancedFilters: ReadonlyAdvancedFilterMap): ReactElement | null; render(): ReactElement | null; } export default IrisGrid; //# sourceMappingURL=IrisGrid.d.ts.map