UNPKG

catreact

Version:

Catavolt Core React Components

95 lines (94 loc) 6.85 kB
/** * Created by rburson on 12/23/15. */ import * as React from 'react'; import { CvState, CvProps, CvContext, CvEvent, CvStateChangeResult } from './catreact-core'; import { ListContext, DetailsContext, FormContext, MapContext, PrintMarkupContext, GraphContext, CalendarContext, ImagePickerContext, GeoFixContext, GeoLocationContext, BarcodeScanContext } from 'catavolt-sdk'; import ReactElement = React.ReactElement; export interface CvFormState extends CvState { } export interface CvFormProps extends CvProps { /** * The sdk {FormContext} to use for this form panel. If not provided, the * {@link CvScopeContext} will be upwardly traversed to attempt to find a matching instance. */ formContext?: FormContext; /** * A function responsible for rendering the 'layout' of the entire form. It should accept the following params: * @param cvContext The current CvContext. The cvContext.scopeCtx.scopeObj will be the sdk {FormContext} * @param childComponents The array of child components to rendered by the Form */ formRenderer?: (cvContext: CvContext, childComponents: Array<ReactElement<any>>) => {}; /** * A function responsible for rendering a child component of sdk type {FormContext}. It should accept the following params: * @param formContext The sdk {FormContext} for this child Form * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ childFormComponentRenderer?: (formContext: FormContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {DetailsContext}. It should accept the following params: * @param detailsContext The sdk {DetailsContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ detailsComponentRenderer?: (detailsContext: DetailsContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {GraphContext}. It should accept the following params: * @param graphContext The sdk {GraphContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ graphComponentRenderer?: (graphContext: GraphContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {ListContext}. It should accept the following params: * @param listContext The sdk {ListContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ listComponentRenderer?: (listContext: ListContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {MapContext}. It should accept the following params: * @param mapContext The sdk {MapContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ mapComponentRenderer?: (mapContext: MapContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {PrintMarkupContext}. It should accept the following params: * @param printMarkupContext The sdk {PrintMarkupContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ printMarkupComponentRenderer?: (printMarkupContext: PrintMarkupContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {CalendarContext}. It should accept the following params: * @param calendarContext The sdk {CalendarContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ calendarComponentRenderer?: (calendarContext: CalendarContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {ImagePickerContext}. It should accept the following params: * @param imagePickerContext The sdk {ImagePickerContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ imagePickerComponentRenderer?: (imagePickerContext: ImagePickerContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {GeoFixContext}. It should accept the following params: * @param geoFixContext The sdk {GeoFixContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ geoFixComponentRenderer?: (geoFixContext: GeoFixContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {GeoLocationContext}. It should accept the following params: * @param geoLocationContext The sdk {GeoLocationContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ geoLocationComponentRenderer?: (geoLocationContext: GeoLocationContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * A function responsible for rendering a child component of sdk type {BarcodeScanContext}. It should accept the following params: * @param barcodeScanContext The sdk {BarcodeScanContext} for this child pane * @param stateChangeListener Any state change events should be broadcast (or passed through) to this listener */ barcodeScanComponentRenderer?: (barcodeScanContext: BarcodeScanContext, stateChangeListener: (event: CvEvent<CvStateChangeResult>) => void, index: number) => {}; /** * An array of {@link CvListener}s * Any state change events will broadcast to these listeners */ stateChangeListeners?: Array<(event: CvEvent<CvStateChangeResult>) => void>; } export declare var CvForm: React.ClassicComponentClass<CvFormProps>;