taro-form-react 0.1.9 → 0.2.1

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.
@@ -0,0 +1,9 @@
1
+ import type { NamePath } from "@/types";
2
+ export type FormSyncProps = {
3
+ source: NamePath;
4
+ target: NamePath;
5
+ } | {
6
+ fields: NamePath[];
7
+ };
8
+ declare const FormSync: React.FC<FormSyncProps>;
9
+ export default FormSync;
@@ -3,6 +3,7 @@ import FormItem from "./components/Item";
3
3
  import FormKeep from "./components/Keep";
4
4
  import FormLabel from "./components/Label";
5
5
  import FormProvider from "./components/Provider";
6
+ import FormSync from "./components/Sync";
6
7
  import type { Field, FormContextProps, FormProviderConfiguration } from "./context/FormContext";
7
8
  export type FormActions = Pick<FormContextProps, "setFieldValue" | "getFieldValue" | "getFieldsValue" | "getFieldsFormattedValue" | "setFields" | "getFields" | "resetFields" | "setFieldError" | "getFieldError" | "validateFields" | "isFieldsTouched"> & {
8
9
  submit: () => Promise<Record<string, any> | undefined>;
@@ -28,6 +29,7 @@ interface FormComponent extends React.ForwardRefExoticComponent<FormProps & Reac
28
29
  Provider: typeof FormProvider;
29
30
  Label: typeof FormLabel;
30
31
  Keep: typeof FormKeep;
32
+ Sync: typeof FormSync;
31
33
  }
32
34
  declare const Form: FormComponent;
33
35
  export default Form;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "taro-form-react",
3
3
  "description": "A form component for Taro 3.x based on React",
4
- "version": "0.1.9",
4
+ "version": "0.2.1",
5
5
  "browser": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "main": "dist/index.js",