@undermuz/react-json-form
Version:
Generate JSON-based forms with react
37 lines (34 loc) • 1.2 kB
TypeScript
import { j as ISchemeItem, G as IChildFormsSetRef, T as TypeValueItem, F as FieldTests, d as IJsonFormRef, D as DefType } from '../types-4491bbaa.js';
import * as react from 'react';
import { IValues, IErrors } from '@undermuz/use-form';
type IFlatFormParams = {
scheme: ISchemeItem[];
isFormPrimary: boolean;
level: number;
isShow?: boolean;
isLoading?: boolean;
onFormsRef?: IChildFormsSetRef;
};
type IFlatFormFieldsParams = {
scheme: ISchemeItem[];
isFormPrimary: boolean;
level: number;
onFormsRef?: IChildFormsSetRef;
};
type FlatFormProps = {
id: string;
isLoading?: boolean;
isShow?: boolean;
primary?: boolean;
level: number;
scheme: ISchemeItem[];
value: TypeValueItem;
tests?: FieldTests;
onChange: (v: IValues) => void;
onError: (v: IErrors) => void;
};
declare const FlatFormContext: react.Context<IFlatFormParams>;
declare const FlatForm: react.ForwardRefExoticComponent<{
children?: react.ReactNode;
} & FlatFormProps & react.RefAttributes<IJsonFormRef<DefType>>>;
export { FlatFormContext, FlatFormProps, IFlatFormFieldsParams, IFlatFormParams, FlatForm as default };