UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

61 lines (60 loc) 1.64 kB
import { AdaptableButton } from './AdaptableButton'; import { BaseContext } from '../../types'; /** * Data which appears in an AdapTable Form */ export type AdaptableFormData = Record<string, any>; /** * Defines a form which appears dynamically; used by Alerts & Export Custom Destinations */ export interface AdaptableForm<T extends BaseContext> { /** * Title to appear in the Form */ title?: string; /** * Additional information to appear in the Form */ description?: string; /** * Collection of Dynamic Fields to display */ fields?: (AdaptableFormField | AdaptableFormField[])[]; /** * Buttons to include in the Form */ buttons?: AdaptableButton<T>[]; } /** * Defines a Field that appears in an Adaptable Form */ export interface AdaptableFormField { /** * Name of the Field */ name: string; /** * Label to display in the Field */ label: string; /** * Field Type: text, date, number, checkbox, select, textOutput */ fieldType: AdaptableFormFieldType; /** * Field Default Value - can be of type string, boolean, number */ defaultValue?: string | boolean | number; /** * Items to populate the Select input */ options?: { value: any; label: string; }[]; } /** * Types of Controls used in an AdapTable Form */ export type AdaptableFormFieldType = 'text' | 'select' | 'date' | 'number' | 'checkbox' | 'textOutput'; export declare function getDefaultAdaptableFormData<T extends BaseContext = BaseContext>(formDef?: AdaptableForm<T>): AdaptableFormData;