@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
58 lines (57 loc) • 1.95 kB
TypeScript
import * as React from 'react';
import { Reducer, ReactNode } from 'react';
import { GridOptions } from 'ag-grid-enterprise';
import { AdaptableOptions } from '../../types';
import { ConfigurationWizardProps } from './AdaptableConfigurationDialog/ConfigurationWizard';
export interface AdaptableWizardViewProps {
adaptableOptions?: Omit<AdaptableOptions, 'primaryKey'> & {
primaryKey?: string;
};
gridOptions?: GridOptions;
/**
* Default true.
*/
ddEnabled?: boolean;
/**
* When true the the configuration wizard will be shown.
* It will use the available information in adaptableOptions & gridOptions.
* This mode skips over interpreting data to figure-out columns.
*/
skipToWizard?: boolean;
onInit: (adaptableOptions: AdaptableOptions, gridOptions: GridOptions) => any;
fileContentsToJSON?: (str: string) => Promise<any> | any;
readFile?: (file: File) => Promise<any>;
fileAccept?: string;
helpText?: React.ReactNode;
loadingMessage?: ReactNode;
defaultActionMessage?: ReactNode;
dragOverActionMessage?: ReactNode;
fetchData?: () => Promise<Record<string, any>[]>;
showFetchDataWizard?: boolean;
startSections?: ConfigurationWizardProps['startSections'];
prepareData?: (data: any, file?: File) => {
columns: string[];
data: any[];
primaryKey?: string;
};
}
export declare const initialState: Partial<WizardState>;
export declare const reducer: Reducer<WizardState, any>;
interface WizardState {
dropped: boolean;
error: any;
adaptableOptions: AdaptableOptions;
gridOptions: GridOptions;
}
/**
* The wizard in a few modes:
*
* 1. Based on data:
* 1.1 Drag and drop a file
* 1.2 Fetch data from a url
*
* 2. Based on configuration:
* Provide a schema, on how the data looks like.
*/
export declare const Wizard: (props: AdaptableWizardViewProps) => React.JSX.Element;
export {};