import React from 'react'; import { AxiosError } from 'axios'; import { UseFormRegister } from 'react-hook-form'; import { AutocompleteItem, CommonFieldProps, CustomFormFieldLayouts, ExtraSxCommonFieldProps, FieldsProps, FormFieldLayout, FormSaveActions, Id, Item, OptionsAC, ExtraValidators, FieldKey, FormWatchObject, FieldList, TField, PartialItem } from '../../@types'; import { FormActionsProps } from './FormActions'; interface FormProps extends Omit, 'fieldsLayout' | 'optionsAC'> { model: string; objId?: Id; defaults?: PartialItem; objTitleField?: FieldKey; /** Optional. If the dev wants to do something after saving. Gets the new Id */ onSave?: (currentId: Id, newId: Id | AxiosError, buttonType: FormSaveActions) => void; /** Optional. If the dev wants to do something after deleting item. Gets the item's Id */ onDelete?: (removedId: Id) => void; /** Optional. If the dev wants to do something after canceling the form editing. */ onCancel?: React.MouseEventHandler; navigate?: { (to: string): void; (delta: number): void; }; /** Optional. Exit function. If not provided and also no exitPath provided, * navigate(exitPath) or history.back() will be used. */ exit?: (newId?: Id) => void; saveAndContinue?: boolean; /** Optional. Path of the form. * Use {ID} to indicate where the objId is located (example: /your-path/{ID}/edit). * No {ID} means that the path ends with objId (example: /your-path/{ID}). * If not provided, the actual location will be considered, ending with {ID}: * actual-location-path/{ID} */ editPath?: string; /** Optional. Path for exit. If none is defined and no 'exit' function is provided, * windows.history.back() will be used. */ exitPath?: string; title?: string; labelSave?: string; labelSaveAndContinue?: string; labelSaveAndCreateNew?: string; labelCancel?: string; labelRemove?: string; fieldsLayout?: FormFieldLayout[]; customFieldFormLayouts?: CustomFormFieldLayouts; hiddenFields?: FieldList; register?: UseFormRegister>; optionsAC?: OptionsAC; setOptionsAC?: (x: OptionsAC) => void; isolatedGetAutoComplete?: (model: string) => Promise; fieldsProps?: FieldsProps; relatedEditable?: boolean; autoFocusField?: FieldKey; elevation?: number; CustomFormActions?: (props: FormActionsProps) => React.JSX.Element; extraValidators?: ExtraValidators; watchValues?: FieldList; onWatchChange?: (values: FormWatchObject) => void; reloadStateStamp?: number | string; } declare function Form({ model, objId, defaults, objTitleField, onSave, onDelete, onCancel, navigate, exit: customExit, saveAndContinue, editPath, exitPath, title, labelSave, labelSaveAndContinue, labelSaveAndCreateNew, labelCancel, labelRemove, multiline, fieldKey, labelKey, optionsAC, setOptionsAC, optionsModel, getOptionLabel, renderOption, onEditModel, options, isSemaphoric, label, decimalScale, fieldsLayout, customFieldFormLayouts, fieldsProps, hiddenFields, isolatedGetAutoComplete, relatedEditable, autoFocusField, elevation, CustomFormActions, extraValidators, sxRow, sxRowMultiple, sxSection, sxSectionTitle, watchValues, onWatchChange, reloadStateStamp, }: FormProps & Omit): React.JSX.Element; export default Form; //# sourceMappingURL=Form.d.ts.map