ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
59 lines (58 loc) • 3.02 kB
TypeScript
import type { IComponent } from 'ag-stack';
import type { IAutoCompleteComponentParams } from './iAutoComplete';
import type { IColumnSelectionPanelParams } from './iColumnSelectionPanel';
import type { AgGridCommon } from './iCommon';
import type { FilterAction } from './iFilter';
export type ColumnToolPanelAction = 'apply' | 'cancel';
export interface BaseToolPanelParams<TData = any, TContext = any, TState = any> extends AgGridCommon<TData, TContext> {
/**
* The tool panel state to apply, if applicable. Provided from `initialState` in the grid options,
* and again with each `api.setState` restore that includes side bar state.
*/
initialState?: TState;
}
export interface IToolPanelParams<TData = any, TContext = any, TState = any> extends BaseToolPanelParams<TData, TContext, TState> {
/** If tool panel is saving and restoring state, this should be called after the state is updated */
onStateUpdated: () => void;
}
export interface IToolPanel<TData = any, TContext = any, TState = any> {
/**
* Called when `api.refreshToolPanel()` is called (with the current params).
* Also called when the `sideBar` grid option is updated, and when `api.setState` restores side bar
* state (with the updated params).
* When `sideBar` is updated or state is restored, if this method returns `true`,
* then the grid will take no further action.
* Otherwise, the tool panel will be destroyed and recreated.
*/
refresh(params: IToolPanelParams<TData, TContext, TState>): boolean | void;
/** If saving and restoring state, this should return the current state */
getState?(): TState;
}
export interface IToolPanelComp<TData = any, TContext = any, TState = any> extends IToolPanel<TData, TContext, TState>, IComponent<IToolPanelParams<TData, TContext, TState>> {
}
export interface IToolPanelColumnCompParams extends IColumnSelectionPanelParams, IAutoCompleteComponentParams {
/** Suppress Column Move */
suppressColumnMove?: boolean;
/** Suppress Row Groups section */
suppressRowGroups?: boolean;
/** Suppress Values section */
suppressValues?: boolean;
/** Suppress Column Labels (Pivot) section */
suppressPivots?: boolean;
/** Suppress Pivot Mode selection */
suppressPivotMode?: boolean;
/** Buttons to display at the bottom of the Columns Tool Panel. When 'apply' is included, changes are deferred until the apply button is clicked. */
buttons?: ColumnToolPanelAction[];
}
export interface IToolPanelFiltersCompParams extends IAutoCompleteComponentParams {
/** To suppress Expand / Collapse All */
suppressExpandAll: boolean;
/** To suppress the Filter Search */
suppressFilterSearch: boolean;
/** Suppress updating the layout of columns as they are rearranged in the grid */
suppressSyncLayoutWithGrid: boolean;
}
export interface IToolPanelNewFiltersCompParams {
/** Allows global buttons to be provided to the filter tool panel */
buttons?: FilterAction[];
}