@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
102 lines (101 loc) • 3.02 kB
TypeScript
import { AdaptableFrameworkComponent, AdaptableIcon } from '../../types';
import { AdaptableSettingsPanel } from '../AdaptableState/Common/Types';
import { CustomRenderContext } from '../agGrid/AdaptableFrameworkComponent';
/**
* Options for managing the AdapTable Settings Panel
*/
export interface SettingsPanelOptions {
/**
* Title for the Settings Panel
*
* @defaultValue 'Settings Panel'
* @gridInfoItem
*/
title?: string;
/**
* Icon shown in top left of Settings Panel: Can be `ConfigurationIcon`, `ApplicationIcon` or custom Icon
* @defaultValue `ConfigurationIcon`
*/
icon?: 'ConfigurationIcon' | 'ApplicationIcon' | AdaptableIcon;
/**
* Whether to show Icons for each Module in the Setting Panel
* @defaultValue true
* @gridInfoItem
*/
showModuleIcons?: boolean;
/**
* Whether a Settings Panel button should always be displayed in `ModuleButtons` area of Dashboard
* @defaultValue false
* @gridInfoItem
* @noCodeItem
*/
alwaysShowInDashboard?: boolean;
/**
* Whether a Settings Panel button should always be displayed in `ModuleButtons` area of ToolPanel
* @defaultValue false
* @gridInfoItem
* @noCodeItem
*/
alwaysShowInToolPanel?: boolean;
/**
* Ordered items to display at side of Settings Panel
*
* @defaultValue all available AdapTable modules
*/
navigation?: {
items?: (AdaptableSettingsPanel | string | '-')[];
};
/**
* Initial position of Settings Panel window
*
* @defaultValue Middle of Screen
*/
position?: {
x: number;
y: number;
};
/**
* Initial size of Settings Panel
*
* @defaultValue Computed based on size of screen
*/
size?: {
width: number;
height: number;
};
/**
* Whether Settings Panel is 'window' (i.e. movable, resizable, no backdrop) or 'modal' (centre of screen with backdrop)
*
* @defaultValue 'window'
*/
popupType?: PopupType;
/**
* Custom Settings Panels provided by developers at design-time
*/
customSettingsPanels?: CustomSettingsPanel[];
}
/**
* Definition of a Custom Panel to add to the Adaptable Settings Panel
*/
export interface CustomSettingsPanel {
/**
* Appears in Settings Panel Navigation and must be included in settingsPanelOptions.navigation for it to be displayed (by default added to the end)
*/
name: string;
/**
* Icon rendered inside settings-panel name, inside the navigation
*/
icon?: AdaptableIcon;
/**
* Function to provide bespoke content when NOT using a Framework wrapper
*/
render?: (customRenderContext: CustomRenderContext) => string | null;
/**
* Framework-specific (Angular, React or Vue) component to be rendered
*/
frameworkComponent?: AdaptableFrameworkComponent;
}
/**
* Type of Popup
*/
export type PopupType = 'modal' | 'window';