UNPKG

@pagamio/frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

15 lines (14 loc) 742 B
import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect } from 'react'; import FormEngine from './FormEngine'; import { setupInputRegistry } from './registry'; const FormEngineForm = ({ fieldDefinitions, initialValues = {}, layout = 'vertical', isNotTrigger, showCancelButton, onFormSubmit = () => { }, onFormCancel = () => { }, }) => { const handleSubmit = async (dto) => { onFormSubmit(dto); }; useEffect(() => { setupInputRegistry(); }, []); return (_jsx(FormEngine, { fields: fieldDefinitions, onSubmit: handleSubmit, layout: layout, initialValues: initialValues, isNotTrigger: isNotTrigger, showCancelButton: showCancelButton, onCancel: onFormCancel })); }; export default FormEngineForm;