|
|
|
@ -1,27 +1,28 @@
|
|
|
|
|
import React, { useMemo } from 'react';
|
|
|
|
|
import {
|
|
|
|
|
MetaForm,
|
|
|
|
|
FastifyForm,
|
|
|
|
|
regField,
|
|
|
|
|
MetaFormContainerComponent,
|
|
|
|
|
FastifyFormContainerComponent,
|
|
|
|
|
regFormContainer,
|
|
|
|
|
} from 'meta-form';
|
|
|
|
|
} from 'react-fastify-form';
|
|
|
|
|
import { Form, Button } from 'antd';
|
|
|
|
|
|
|
|
|
|
import { MetaFormText } from './types/Text';
|
|
|
|
|
import { MetaFormTextArea } from './types/TextArea';
|
|
|
|
|
import { MetaFormPassword } from './types/Password';
|
|
|
|
|
import { MetaFormSelect } from './types/Select';
|
|
|
|
|
import { MetaFormCheckbox } from './types/Checkbox';
|
|
|
|
|
import { MetaFormCustom } from './types/Custom';
|
|
|
|
|
import { FastifyFormText } from './types/Text';
|
|
|
|
|
import { FastifyFormTextArea } from './types/TextArea';
|
|
|
|
|
import { FastifyFormPassword } from './types/Password';
|
|
|
|
|
import { FastifyFormSelect } from './types/Select';
|
|
|
|
|
import { FastifyFormCheckbox } from './types/Checkbox';
|
|
|
|
|
import { FastifyFormCustom } from './types/Custom';
|
|
|
|
|
|
|
|
|
|
regField('text', MetaFormText);
|
|
|
|
|
regField('textarea', MetaFormTextArea);
|
|
|
|
|
regField('password', MetaFormPassword);
|
|
|
|
|
regField('select', MetaFormSelect);
|
|
|
|
|
regField('checkbox', MetaFormCheckbox);
|
|
|
|
|
regField('custom', MetaFormCustom);
|
|
|
|
|
regField('text', FastifyFormText);
|
|
|
|
|
regField('textarea', FastifyFormTextArea);
|
|
|
|
|
regField('password', FastifyFormPassword);
|
|
|
|
|
regField('select', FastifyFormSelect);
|
|
|
|
|
regField('checkbox', FastifyFormCheckbox);
|
|
|
|
|
regField('custom', FastifyFormCustom);
|
|
|
|
|
|
|
|
|
|
const WebMetaFormContainer: MetaFormContainerComponent = React.memo((props) => {
|
|
|
|
|
const WebFastifyFormContainer: FastifyFormContainerComponent = React.memo(
|
|
|
|
|
(props) => {
|
|
|
|
|
const layout = props.layout;
|
|
|
|
|
const submitButtonRender = useMemo(() => {
|
|
|
|
|
return (
|
|
|
|
@ -63,9 +64,10 @@ const WebMetaFormContainer: MetaFormContainerComponent = React.memo((props) => {
|
|
|
|
|
{submitButtonRender}
|
|
|
|
|
</Form>
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
WebMetaFormContainer.displayName = 'WebMetaFormContainer';
|
|
|
|
|
regFormContainer(WebMetaFormContainer);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
WebFastifyFormContainer.displayName = 'WebFastifyFormContainer';
|
|
|
|
|
regFormContainer(WebFastifyFormContainer);
|
|
|
|
|
|
|
|
|
|
export const WebMetaForm = MetaForm;
|
|
|
|
|
WebMetaForm.displayName = 'WebMetaForm';
|
|
|
|
|
export const WebMetaForm = FastifyForm;
|
|
|
|
|
(WebMetaForm as any).displayName = 'WebMetaForm';
|
|
|
|
|