@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
70 lines (69 loc) • 2.19 kB
TypeScript
import { AdaptableObject } from '../AdaptableState/Common/AdaptableObject';
import { AdaptableFrameworkComponent } from '../agGrid/AdaptableFrameworkComponent';
import { AdaptableButton } from '../AdaptableState/Common/AdaptableButton';
import { ToolPanelState } from '../AdaptableState/ToolPanelState';
import { BaseContext, CustomRenderContext } from '../types';
/**
* Options related to managing the AdapTable ToolPanel Component
*/
export interface ToolPanelOptions {
/**
* Display the Tool Panels dropdown
*
* @defaultValue true
* @gridInfoItem
* @noCodeItem
*/
showToolPanelsDropdown?: boolean;
/**
* ToolPanel Buttons provided by Users which perform custom behaviour
*/
customButtons?: AdaptableButton<ToolPanelButtonContext>[];
/**
* ToolPanels provided by Users which contain custom content
*/
customToolPanels?: CustomToolPanel[];
}
/**
* Defines a Custom ToolPanel - provided by Users and contains custom content
*/
export interface CustomToolPanel extends AdaptableObject {
/**
* Name of Custom ToolPanel - should be unique
*/
name: string;
/**
* Title to display in Custom ToolPanel; if undefined, will default to `name` property
*/
title?: string;
/**
* Optional set of buttons to show in the ToolPanel
*/
buttons?: AdaptableButton<CustomToolPanelButtonContext>[];
/**
* Function to provide bespoke content when using AdapTable Vanilla
*/
render?: (customRenderContext: CustomRenderContext) => string | null;
/**
* Framework-specific (Angular, React or Vue) component to be rendered
*/
frameworkComponent?: AdaptableFrameworkComponent;
}
/**
* Context required by functions when using a ToolPanel Button
*/
export interface ToolPanelButtonContext extends BaseContext {
/**
* Current ToolPanel State
*/
toolPanelState: ToolPanelState;
}
/**
* Context used for Custom Tool Panels containing Buttons
*/
export interface CustomToolPanelButtonContext extends ToolPanelButtonContext {
/**
*The Custom ToolPanel which contains the button
*/
customToolPanel: CustomToolPanel;
}