@undermuz/react-json-form
Version:
Generate JSON-based forms with react
34 lines (31 loc) • 1.22 kB
TypeScript
import { T as TypeValueItem, c as TypeErrorItem, j as ISchemeItem, d as IJsonFormRef, D as DefType } from '../types-4491bbaa.js';
import * as react from 'react';
import { IErrors } from '@undermuz/use-form';
import { IUseTabs } from '../utils/useTabs.js';
import '@dnd-kit/core';
interface IArrayForm {
id?: string;
value: TypeValueItem[];
errors: TypeErrorItem[];
fillArrayDefault?: boolean;
viewType?: string;
primary?: boolean;
level: number;
defValue: TypeValueItem;
scheme: ISchemeItem[];
onChange: (v: TypeValueItem[]) => void;
onError: (v: TypeErrorItem[]) => void;
}
type IArrayFormParams = IUseTabs & IArrayForm & {
changeTab: (newValue: TypeValueItem, id: number | null) => void;
setTabErrors: (newErrors: IErrors, id: number) => void;
onRef?: ({ id, ref }: {
id: number;
ref: IJsonFormRef | null;
}) => void;
};
declare const ArrayFormContext: react.Context<IArrayFormParams>;
declare const ArrayForm: react.ForwardRefExoticComponent<{
children?: react.ReactNode;
} & IArrayForm & react.RefAttributes<IJsonFormRef<DefType>>>;
export { ArrayFormContext, IArrayForm, IArrayFormParams, ArrayForm as default };