UNPKG

@reactjsonforms/antd-renderers

Version:

Ant Design Renderer Set for JSON Forms

61 lines (60 loc) 2.46 kB
import React, { Dispatch, ReducerAction } from 'react'; import { ComponentType } from 'enzyme'; import { ArrayTranslations, ControlElement, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonFormsUISchemaRegistryEntry, JsonSchema } from '@reactjsonforms/core'; interface OwnPropsOfExpandPanel { index: number; path: string; disabled?: boolean; collapsible?: any; uischema: ControlElement; schema: JsonSchema; expanded?: boolean; renderers?: JsonFormsRendererRegistryEntry[]; cells?: JsonFormsCellRendererRegistryEntry[]; uischemas?: JsonFormsUISchemaRegistryEntry[]; rootSchema: JsonSchema; enableMoveUp: boolean; enableMoveDown: boolean; config: any; childLabelProp?: string; isExpanded?: boolean; handleChange?(index: number): void; translations: ArrayTranslations; } interface StatePropsOfExpandPanel extends OwnPropsOfExpandPanel { key: React.Key; childLabel: string; childPath: string; enableMoveUp: boolean; enableMoveDown: boolean; } /** * Dispatch props of a table control */ export interface DispatchPropsOfExpandPanel { disabled?: boolean; collapsible?: any; removeItems(path: string, toDelete: number[]): (event: any) => void; moveUp(path: string, toMove: number): (event: any) => void; moveDown(path: string, toMove: number): (event: any) => void; [additionalProps: string]: any; } export interface ExpandPanelProps extends StatePropsOfExpandPanel, DispatchPropsOfExpandPanel { } /** * Maps state to dispatch properties of an expand pandel control. * * @param dispatch the store's dispatch method * @returns {DispatchPropsOfArrayControl} dispatch props of an expand panel control */ export declare const ctxDispatchToExpandPanelProps: (dispatch: Dispatch<ReducerAction<any>>) => DispatchPropsOfExpandPanel; /** * Map state to control props. * @param state the JSON Forms state * @param ownProps any own props * @returns {StatePropsOfControl} state props for a control */ export declare const withContextToExpandPanelProps: (Component: ComponentType<ExpandPanelProps>) => ComponentType<OwnPropsOfExpandPanel>; export declare const withJsonFormsExpandPanelProps: (Component: ComponentType<ExpandPanelProps>) => ComponentType<OwnPropsOfExpandPanel>; declare const _default: ComponentType<OwnPropsOfExpandPanel>; export default _default;