@jswork/react-ant-form-schema 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +21 -21
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.d.mts +1 -5
- package/dist/main.d.ts +2 -4
- package/dist/main.esm.js +21 -21
- package/dist/main.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +10 -17
- package/src/main.tsx +2 -0
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames';
|
|
2
2
|
import React, { FC, ReactNode } from 'react';
|
|
3
|
-
import { Form, FormProps
|
|
3
|
+
import { Form, FormProps } from 'antd';
|
|
4
4
|
import NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';
|
|
5
5
|
import { deepMerge } from './utils';
|
|
6
6
|
|
|
@@ -36,10 +36,6 @@ export type ReactAntdFormSchemaProps = {
|
|
|
36
36
|
* The form content.
|
|
37
37
|
*/
|
|
38
38
|
footerClassName?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Form loading status.
|
|
41
|
-
*/
|
|
42
|
-
loading?: boolean;
|
|
43
39
|
} & FormProps;
|
|
44
40
|
|
|
45
41
|
const defaultProps = {
|
|
@@ -47,11 +43,10 @@ const defaultProps = {
|
|
|
47
43
|
header: null,
|
|
48
44
|
footer: null,
|
|
49
45
|
footerClassName: '',
|
|
50
|
-
loading: false,
|
|
51
46
|
};
|
|
52
47
|
|
|
53
48
|
const ReactAntdFormSchema: FC<ReactAntdFormSchemaProps> = (props) => {
|
|
54
|
-
const { className, meta, header, footer, children,
|
|
49
|
+
const { className, meta, header, footer, children, footerClassName, ...rest } = {
|
|
55
50
|
...defaultProps,
|
|
56
51
|
...props,
|
|
57
52
|
};
|
|
@@ -61,16 +56,14 @@ const ReactAntdFormSchema: FC<ReactAntdFormSchemaProps> = (props) => {
|
|
|
61
56
|
|
|
62
57
|
return (
|
|
63
58
|
<Form data-component={CLASS_NAME} className={cx(CLASS_NAME, className)} {...rest}>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</Form.Item>
|
|
73
|
-
</Spin>
|
|
59
|
+
{header}
|
|
60
|
+
<NiceForm meta={_meta} />
|
|
61
|
+
<Form.Item
|
|
62
|
+
wrapperCol={{ offset: _offset }}
|
|
63
|
+
className={footerClassName}
|
|
64
|
+
style={{ marginBottom: 0 }}>
|
|
65
|
+
{footerNode}
|
|
66
|
+
</Form.Item>
|
|
74
67
|
</Form>
|
|
75
68
|
);
|
|
76
69
|
};
|