@coding-form/form-engine 0.0.8 → 0.0.10

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.
@@ -26,13 +26,15 @@ const FormViewContent = (props)=>{
26
26
  review: review,
27
27
  onFinish: handleOnFinish,
28
28
  onBlur: handleOnBlur,
29
- children: props.children
29
+ children: props.children,
30
+ layout: props.layout
30
31
  }), subFormList && subFormList.map((item)=>/*#__PURE__*/ react.createElement(FormSubView, {
31
32
  Form: Form,
32
33
  formCode: item.code,
33
34
  review: review,
34
35
  onFinish: handleOnFinish,
35
- onBlur: handleOnBlur
36
+ onBlur: handleOnBlur,
37
+ layout: props.layout
36
38
  })), props.footer);
37
39
  };
38
40
  const FormView = (props)=>{
@@ -6,6 +6,7 @@ interface FormSubViewProps {
6
6
  onFinish: (values: any, formCode: string) => void;
7
7
  onBlur: (formCode: string) => void;
8
8
  children?: React.ReactNode;
9
+ layout?: 'horizontal' | 'vertical';
9
10
  }
10
11
  export declare const FormSubView: React.FC<FormSubViewProps>;
11
12
  export {};
@@ -24,6 +24,7 @@ const FormSubView = (props)=>{
24
24
  }, []);
25
25
  return /*#__PURE__*/ react.createElement(Form, {
26
26
  form: formTarget,
27
+ layout: props.layout,
27
28
  onBlur: ()=>{
28
29
  props.onBlur(props.formCode);
29
30
  },
@@ -11,7 +11,7 @@ export declare class FormInstance implements FormInstanceInterface {
11
11
  private initInstanceList;
12
12
  getFormControl(formCode?: string): FormControl | undefined;
13
13
  getProxyTarget(formCode?: string): any;
14
- getFieldValue(name: NamePath, formCode?: string): void;
14
+ getFieldValue(name: NamePath, formCode?: string): any;
15
15
  getFieldsValue(formCode?: string): any;
16
16
  resetFields(nameList?: NamePath[] | NamePath, formCode?: string): void;
17
17
  setFieldsValue(values: any, formCode?: string): void;
@@ -33,7 +33,7 @@ class FormInstance {
33
33
  return this.getFormControl(formCode)?.getProxyTarget();
34
34
  }
35
35
  getFieldValue(name, formCode) {
36
- this.getFormControl(formCode)?.getFieldValue(name);
36
+ return this.getFormControl(formCode)?.getFieldValue(name);
37
37
  }
38
38
  getFieldsValue(formCode) {
39
39
  return this.getFormControl(formCode)?.getFieldsValue();
@@ -8,7 +8,7 @@ export interface FormInstanceInterface {
8
8
  /** 获取表所有值 **/
9
9
  getFieldsValue: (formCode?: string) => any;
10
10
  /** 重置表单值 **/
11
- resetFields: (fields?: NamePath[] | NamePath, formCode?: string) => void;
11
+ resetFields: (fields?: NamePath[], formCode?: string) => void;
12
12
  /** 设置表单所有值 **/
13
13
  setFieldsValue: (values: any, formCode?: string) => void;
14
14
  /** 设置表单值 **/
@@ -68,6 +68,8 @@ export interface FormViewProps {
68
68
  meta: FormMeta;
69
69
  /** 表单操控对象 */
70
70
  form?: FormInstance;
71
+ /** 布局方向 **/
72
+ layout?: 'horizontal' | 'vertical';
71
73
  /** 表单提交数据 **/
72
74
  onFinish?: (values: any, formCode?: string) => void;
73
75
  /** 表单失去焦点事件 **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-form/form-engine",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "form-engine components",
5
5
  "keywords": [
6
6
  "coding-form",