import React, { PureComponent, type ReactElement, type ReactNode, type RefObject } from 'react'; import { type DashboardPanelProps, type PanelComponent } from '@deephaven/dashboard'; import { type IrisGridType, IrisGridModel, type ColumnName, type PendingDataMap, type InputFilter, type ReadonlyAdvancedFilterMap, type AggregationSettings, type AdvancedSettingsType, type UIRollupConfig, type UIRow, type ReadonlyQuickFilterMap, type FilterMap, type QuickFilter, type AdvancedFilter, type SidebarFormattingRule, type IrisGridState, type ChartBuilderSettings, type DehydratedIrisGridState, type DehydratedIrisGridPanelState, type ColumnHeaderGroup, type IrisGridContextMenuData, type PartitionConfig, type IrisGridViewProps, type TableOptionsTransform, type IrisGridModelTransform } from '@deephaven/iris-grid'; import { type RowDataMap, type FormattingRule, type SortDescriptor } from '@deephaven/jsapi-utils'; import { type User, type WorkspaceSettings } from '@deephaven/redux'; import { type CancelablePromise, type EventT } from '@deephaven/utils'; import { type ResolvableContextAction } from '@deephaven/components'; import type { dh } from '@deephaven/jsapi-types'; import { type GridState, type ModelIndex, type ModelSizeMap, type MoveOperation, type Selection } from '@deephaven/grid'; import type { TablePluginComponent, TablePluginElement } from '@deephaven/plugin'; import './IrisGridPanel.scss'; import { type Link, type LinkColumn, type LinkPointOptions } from '../linker/LinkerUtils'; import { type WidgetPanelDescriptor } from './WidgetPanelTypes'; type ModelQueueFunction = (model: IrisGridModel) => void; type ModelQueue = ModelQueueFunction[]; export interface PanelState { gridState: { isStuckToBottom: boolean; isStuckToRight: boolean; movedColumns: readonly { from: string | ModelIndex | [string, string] | [ModelIndex, ModelIndex]; to: string | ModelIndex; }[]; movedRows: readonly MoveOperation[]; }; irisGridState: DehydratedIrisGridState; irisGridPanelState: DehydratedIrisGridPanelState; pluginState: unknown; } type LoadedPanelState = PanelState & { irisGridPanelState: PanelState['irisGridPanelState'] & { partitions?: (string | null)[]; partition?: string | null; }; }; export interface OwnProps extends DashboardPanelProps { children?: ReactNode; panelState?: LoadedPanelState | null; makeModel: () => IrisGridModel | Promise; onStateChange?: (irisGridState: IrisGridState, gridState: GridState) => void; onPanelStateUpdate?: (panelState: PanelState) => void; /** Override the default worker used by IrisGrid to download CSVs. */ getDownloadWorker?: () => Promise; /** Load a plugin defined by the table */ loadPlugin: (pluginName: string) => TablePluginComponent; /** * View-concern overrides (theme, renderer, mouse handlers, metric * calculator) forwarded as a single bag to `IrisGrid`. Lets IrisGrid-aware * middleware contribute presentation without this panel knowing each * concern by name. Threaded down the middleware chain. */ irisGridProps?: Partial; /** * Transform applied to the built-in Table Options items before they are * rendered. Forwarded to `IrisGrid#transformTableOptions`. Threaded down * the middleware chain by IrisGrid-aware plugins. */ transformTableOptions?: TableOptionsTransform; /** * Called with the resolved `IrisGridModel` once it is initialized, so * middleware can subscribe to model events (e.g. to recompute a * `transformTableOptions` snapshot). */ onModelChanged?: (model: IrisGridModel) => void; /** * Transform applied to the model built by `makeModel` before it is handed * to `IrisGrid`. Lets IrisGrid-aware middleware wrap the host-built model * (e.g. in a proxy) without taking over model construction. Applied when * the model is (re)built, so it must be referentially stable. */ transformModel?: IrisGridModelTransform; } interface StateProps { inputFilters: InputFilter[]; links: Link[]; columnSelectionValidator?: (panel: PanelComponent, tableColumn: LinkColumn, options: LinkPointOptions) => boolean; user: User; settings: WorkspaceSettings; } interface IrisGridPanelState { error: unknown; isDisconnected: boolean; isLoaded: boolean; isLoading: boolean; isModelReady: boolean; model?: IrisGridModel; isStuckToBottom: boolean; isStuckToRight: boolean; conditionalFormats: readonly SidebarFormattingRule[]; selectDistinctColumns: readonly ColumnName[]; advancedFilters: ReadonlyAdvancedFilterMap; aggregationSettings: AggregationSettings; advancedSettings: Map; customColumns: readonly ColumnName[]; customColumnFormatMap: Map; columnAlignmentMap: Map; isFilterBarShown: boolean; quickFilters: ReadonlyQuickFilterMap; sorts: readonly SortDescriptor[]; userColumnWidths: ModelSizeMap; userColumnWidthsByName: ReadonlyMap; userRowHeights: ModelSizeMap; reverse: boolean; movedColumns: readonly MoveOperation[]; movedRows: readonly MoveOperation[]; isSelectingPartition: boolean; partitions: (string | null)[]; partitionConfig?: PartitionConfig; rollupConfig?: UIRollupConfig; showSearchBar: boolean; searchValue: string; selectedSearchColumns?: readonly string[]; invertSearchColumns: boolean; Plugin?: TablePluginComponent; pluginFilters: readonly dh.FilterCondition[]; pluginFetchColumns: readonly string[]; modelQueue: ModelQueue; pendingDataMap?: PendingDataMap; frozenColumns?: readonly ColumnName[]; columnHeaderGroups?: readonly ColumnHeaderGroup[]; gridSelection: Selection | null; panelState?: PanelState | null; irisGridStateOverrides: Partial; gridStateOverrides: Partial; } export type IrisGridPanelProps = OwnProps & StateProps; export declare class IrisGridPanel extends PureComponent { static defaultProps: { onStateChange: () => void; onPanelStateUpdate: () => void; }; static displayName: string; static COMPONENT: string; constructor(props: IrisGridPanelProps); componentDidMount(): void; componentDidUpdate(prevProps: IrisGridPanelProps, prevState: IrisGridPanelState): void; componentWillUnmount(): void; irisGrid: RefObject; pluginRef: RefObject; modelPromise?: CancelablePromise; irisGridState?: IrisGridState; gridState?: GridState; pluginState: unknown; private irisGridUtils; private gridStateDehydrator; private irisGridStateDehydrator; getTableName(): string; getGridInputFilters: (columns: readonly dh.Column[], inputFilters: readonly InputFilter[]) => InputFilter[]; getAlwaysFetchColumns: (dashboardLinks: readonly Link[], pluginFetchColumns: readonly string[]) => string[]; getPluginContent: (Plugin: TablePluginComponent | undefined, model: IrisGridModel | undefined, pluginState: unknown, gridSel: Selection | null) => import("react/jsx-runtime").JSX.Element | null; getDehydratedIrisGridPanelState: (model: IrisGridModel, isSelectingPartition: boolean, partitions: (string | null)[], advancedSettings: Map) => DehydratedIrisGridPanelState; getCachedPanelState: (irisGridPanelState: PanelState["irisGridPanelState"], irisGridState: PanelState["irisGridState"], gridState: PanelState["gridState"], pluginState: PanelState["pluginState"]) => PanelState; getWidgetPanelDescriptor: (metadata: IrisGridPanelProps["metadata"], description?: string) => WidgetPanelDescriptor; initModel(): void; handleLoadSuccess(modelParam: IrisGridModel): void; initModelQueue(modelParam: IrisGridModel, modelQueue: ModelQueue): void; handleAdvancedSettingsChange(key: AdvancedSettingsType, value: boolean): void; handlePluginFilter(filters: InputFilter[]): void; handlePluginFetchColumns(pluginFetchColumns: string[]): void; handleContextMenu(data: IrisGridContextMenuData): ResolvableContextAction[]; isColumnSelectionValid(tableColumn: dh.Column | null): boolean; handleGridStateChange(irisGridState: IrisGridState, gridState: GridState): void; handleGridSelectionChange(selection: Selection): void; handlePluginStateChange(pluginState: unknown): void; handleColumnsChanged(event: EventT): void; handleTableChanged(event: EventT): void; /** * Create a chart with the specified settings * @param settings The settings from the chart builder * @param settings.type The settings from the chart builder * @param settings.series The names of the series * @param model The IrisGridModel object */ handleCreateChart(settings: ChartBuilderSettings, model: IrisGridModel): void; handleColumnSelected(column: dh.Column): void; handleDataSelected(row: ModelIndex, dataMap: RowDataMap): void; handleShow(): void; handleTabClicked(): void; handleError(error: unknown): void; handleDisconnect(): void; handleReconnect(): void; handleLoadError(error: unknown): void; modelInitialized(model: IrisGridModel): void; handleClearAllFilters(): void; /** * Called when a user clicks the "Reset" button for an error message on the LoadingOverlay. */ handleErrorAction(): void; sendColumnsChange(columns: readonly dh.Column[]): void; startModelListening(model: IrisGridModel): void; stopModelListening(model: IrisGridModel): void; getCoordinateForColumn(columnName: ColumnName): [number, number] | null; setFilterMap(filterMap: FilterMap): void; setAdvancedFilterMap(filterMap: ReadonlyAdvancedFilterMap): void; setFilters({ quickFilters, advancedFilters, }: { quickFilters: { name: ColumnName; filter: QuickFilter; }[]; advancedFilters: { name: ColumnName; filter: AdvancedFilter; }[]; }): void; setStateOverrides(overrides: { irisGridState: Partial; gridState: Partial; }): void; unsetFilterValue(): void; loadPanelState(model: IrisGridModel): void; savePanelState: import("lodash").DebouncedFunc<() => void>; updateGrid(): void; render(): ReactElement; } declare const ConnectedIrisGridPanel: import("react-redux").ConnectedComponent & OwnProps & StateProps, "glEventHub" | "children" | "glContainer" | "metadata" | "makeModel" | "localDashboardId" | "panelState" | "getDownloadWorker" | "loadPlugin" | "irisGridProps" | "transformTableOptions" | "onModelChanged" | "transformModel" | keyof StateProps | keyof React.ClassAttributes> & { onStateChange?: ((irisGridState: IrisGridState, gridState: GridState) => void) | undefined; onPanelStateUpdate?: ((panelState: PanelState) => void) | undefined; } & {}, "user" | "settings" | "inputFilters" | "links" | "columnSelectionValidator"> & OwnProps>; export default ConnectedIrisGridPanel; //# sourceMappingURL=IrisGridPanel.d.ts.map