@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
165 lines (164 loc) • 5.38 kB
TypeScript
import { DashboardState, DashboardTab } from '../AdaptableState/DashboardState';
import { AdaptableDashboardToolbar, AdaptableDashboardToolbars, AdaptableModuleButtons } from '../AdaptableState/Common/Types';
import { AdaptableButton } from '../AdaptableState/Common/AdaptableButton';
import { CustomToolbar, DashboardButtonContext } from '../AdaptableOptions/DashboardOptions';
/**
* Functions relating to the AdapTable Dashboard.
*/
export interface DashboardApi {
/**
* Retrieves Dashboard section from Adaptable State
*/
getDashboardState(): DashboardState;
/**
* Retrieves all Custom Toolbars
*/
getCustomToolbars(): CustomToolbar[];
/**
* Retrieves all Custom Buttons
*/
getCustomDashboardButtons(): AdaptableButton<DashboardButtonContext>[];
/**
* Retrieves first Custom Button with given Label
* @param buttonLabel the label of the Custom Button to retrieve
*/
getCustomDashboardButtonByLabel(buttonLabel: string): AdaptableButton<DashboardButtonContext> | undefined;
/**
* Sets which Module Buttons are visible
* @param moduleButtons buttons to show
*/
setModuleButtons(moduleButtons: AdaptableModuleButtons): void;
/**
* Sets title of Dashboard Header
*/
setDashboardTitle(title: string): void;
/**
* Returns the HTML Element for the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function.
* @param customToolbarName the name of the Custom Toolbar
*
*/
getCustomToolbarHTMLElement(customToolbarName: string): HTMLElement | null;
/**
* Renders the given HTML string in the given Custom Toolbar. This should only be used in Vanilla AdapTable for toolbars created via a `render` function!
* @param customToolbarName name of Custom Toolbar hosting content
* @param htmlContent HTML string to render
*
*/
setCustomToolbarHTMLContent(customToolbarName: string, htmlContent: string): void;
/**
* Returns Custom Toolbar with the given name
* @param customToolbarName the name of the Custom Toolbar
*/
getCustomToolbarByName(customToolbarName: string): CustomToolbar;
/**
* Collapses Dashboard so only Dashboard Header is visible (and not Toolbars' contents)
*/
collapseDashboard(): void;
/**
* Expands Dashboard so Toolbars in Active Tab are fully visible
*/
expandDashboard(): void;
/**
* Refreshes entire Dashboard, including Toolbars and Buttons; particularly relevant for AdapTable built-in elements, as framework components are dependent on the framework specific change detection mechanisms
*/
refreshDashboard(): void;
/**
* Floats Dashboard so only Dashboard Header is visible (in reduced size); can be dragged to a new location
*/
floatDashboard(): void;
/**
* Docks Dashboard so it 'snaps back' into its customary position above the grid
*/
dockDashboard(): void;
/**
* Hides the Dashboard so cannot be seen
*/
hideDashboard(): void;
/**
* Makes the Dashboard visible
*/
showDashboard(): void;
/**
* Returns current Active Tab index (if there is one)
*/
getActiveTabIndex(): number | undefined;
/**
* Returns current Active Tab (if there is one)
*/
getActiveTab(): DashboardTab | undefined;
/**
* Sets Active Tab in Dashboard
*
* @param tabIndex the tab index to set
*/
setActiveTabIndex(tabIndex: number): void;
/**
* Sets Active Tab in Dashboard
* @param tabName name of tab to set
*/
setActiveTab(tabName: string): void;
/**
* Retrieves all Toolbars in Active Tab
*/
getCurrentToolbars(): AdaptableDashboardToolbars | string[];
/**
* Checks if a given Toolbar is visible
* @param toolbar toolbar to check visibility for
*/
isToolbarVisible(toolbar: AdaptableDashboardToolbar | string): boolean;
/**
* Opens Settings Panel with Dashboard section selected and visible
*/
openDashboardSettingsPanel(): void;
/**
* Retrieves the Tab from State that matches inputted name
* @param tabName the tab to check
*/
getTabByName(tabName: string): DashboardTab;
/**
* Is Dashboard Collapsed
*/
isDashboardCollapsed(): boolean;
/**
* Is Dashboard Expanded
*/
isDashboardExpanded(): boolean;
/**
* Is Dashboard Floating
*/
isDashboardFloating(): boolean;
/**
* Is Dashboard Docked
*/
isDashboardDocked(): boolean;
/**
* Is Dashboard Hidden
*/
isDashboardHidden(): boolean;
/**
* Is Dashboard Visible
*/
isDashboardVisible(): boolean;
/**
* Updates the Tabs in the Dashboard
* @param Tabs
*/
setTabs(Tabs: DashboardTab[]): void;
/**
* Retrieves the Tabs in the Dashboard
*/
getTabs(): DashboardTab[];
/**
* Retrieves the Module Buttons in the Dashboard
*/
getModuleButtons(): AdaptableModuleButtons;
/**
* Sets pinned toolbars
* @param toolbars
*/
setPinnedToolbars(toolbars: AdaptableDashboardToolbars | string[]): void;
/**
* Retrieves pinned toolbars
*/
getPinnedToolbars(): AdaptableDashboardToolbars | string[];
}