@jswork/react-ant-form-schema 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/react-ant-form-schema",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.esm.js",
6
6
  "types": "dist/main.d.ts",
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, Spin } from 'antd';
3
+ import { Form, FormProps } from 'antd';
4
4
  import NiceForm, { NiceFormMeta } from '@ebay/nice-form-react';
5
5
  import { deepMerge } from './utils';
6
6
 
@@ -29,48 +29,36 @@ export type ReactAntdFormSchemaProps = {
29
29
  */
30
30
  header?: ReactNode;
31
31
  /**
32
- * The footer content.
32
+ * The form actions className.
33
33
  */
34
- footer?: ReactNode;
35
- /**
36
- * The form content.
37
- */
38
- footerClassName?: string;
39
- /**
40
- * Form loading status.
41
- */
42
- loading?: boolean;
34
+ actionsClassName?: string;
43
35
  } & FormProps;
44
36
 
45
37
  const defaultProps = {
46
38
  className: '',
47
39
  header: null,
48
- footer: null,
49
- footerClassName: '',
50
- loading: false,
40
+ actionsClassName: '',
51
41
  };
52
42
 
53
43
  const ReactAntdFormSchema: FC<ReactAntdFormSchemaProps> = (props) => {
54
- const { className, meta, header, footer, children, loading, footerClassName, ...rest } = {
44
+ const { className, meta, header, children, actionsClassName, ...rest } = {
55
45
  ...defaultProps,
56
46
  ...props,
57
47
  };
58
- const footerNode = footer || (children as ReactNode);
48
+ const footerNode = children as ReactNode;
59
49
  const _meta = deepMerge(DEFAULT_META, meta);
60
50
  const _offset = _meta?.wrapperProps?.labelCol?.span || 4;
61
51
 
62
52
  return (
63
53
  <Form data-component={CLASS_NAME} className={cx(CLASS_NAME, className)} {...rest}>
64
- <Spin spinning={loading}>
65
- {header}
66
- <NiceForm meta={_meta} />
67
- <Form.Item
68
- wrapperCol={{ offset: _offset }}
69
- className={footerClassName}
70
- style={{ marginBottom: 0 }}>
71
- {footerNode}
72
- </Form.Item>
73
- </Spin>
54
+ {header}
55
+ <NiceForm meta={_meta} />
56
+ <Form.Item
57
+ wrapperCol={{ offset: _offset }}
58
+ className={actionsClassName}
59
+ style={{ marginBottom: 0 }}>
60
+ {footerNode}
61
+ </Form.Item>
74
62
  </Form>
75
63
  );
76
64
  };
package/src/main.tsx CHANGED
@@ -1,3 +1,5 @@
1
1
  import ReactAntdFormSchema from '.';
2
+ import { ReactAntdFormSchemaProps } from '.';
2
3
 
3
4
  export default ReactAntdFormSchema;
5
+ export type { ReactAntdFormSchemaProps };