@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
40 lines (39 loc) • 1.79 kB
TypeScript
import * as React from 'react';
import { CSSProperties } from 'react';
import { TextProps } from 'rebass';
export type OnePageWizardContextType<T> = {
data: T;
sections: (OnePageWizardSection<T> | '-')[];
setCurrentSection: (index: number) => void;
};
export declare const SummaryTag: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
export declare const SummaryText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
export declare const FormDescriptionText: React.FunctionComponent<React.PropsWithChildren<TextProps>>;
export declare const OnePageWizardContext: React.Context<OnePageWizardContextType<any>>;
export declare function useOnePageWizardContext<ENTITY>(): OnePageWizardContextType<ENTITY>;
export type OnePageWizardSection<ENTITY> = {
title: string;
details?: React.ReactNode;
isValid?: (data: ENTITY, context: OnePageWizardContextType<ENTITY>) => true | string;
isVisible?: (data: ENTITY, context: OnePageWizardContextType<ENTITY>) => boolean;
render: (data: ENTITY, index: number) => React.ReactNode;
renderSummary?: (data: ENTITY) => React.ReactNode;
};
export interface OnePageWizardProps<ENTITY> {
data: ENTITY;
name: string;
sections: (OnePageWizardSection<ENTITY> | '-')[];
currentIndex?: number;
defaultCurrentIndex?: number;
defaultCurrentSectionName?: string;
onSectionChange?: (index: number) => void;
onHide?: VoidFunction;
onFinish?: (data: ENTITY) => any;
children?: React.ReactNode;
style?: CSSProperties;
titleContainerStyle?: CSSProperties;
closeText?: React.ReactNode;
closeTooltip?: string;
finishText?: React.ReactNode;
}
export declare const OnePageWizard: <ENTITY extends unknown>(props: OnePageWizardProps<ENTITY>) => React.JSX.Element;