@maif/react-forms 1.3.1-rc.6 → 1.3.1-rc.7

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.
Files changed (2) hide show
  1. package/lib/index.d.ts +21 -12
  2. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import * as yup from 'yup';
4
4
  import { AnySchema, StringSchema, NumberSchema, ArraySchema, TestFunction } from 'yup';
5
5
  import Reference from 'yup/lib/Reference';
6
6
  import React$1 from 'react';
7
+ import { UseFormReturn } from 'react-hook-form';
7
8
 
8
9
  declare const type: {
9
10
  readonly string: "string";
@@ -410,22 +411,30 @@ interface Informations {
410
411
  index?: number;
411
412
  }
412
413
 
413
- declare const Form: React$1.ForwardRefExoticComponent<{
414
+ declare type FormProps = {
414
415
  schema: Schema;
415
- flow?: (string | FlowObject)[] | undefined;
416
- value?: object | undefined;
417
- inputWrapper?: ((props: object) => JSX.Element) | undefined;
416
+ flow?: Array<string | FlowObject>;
417
+ value?: object;
418
+ inputWrapper?: (props: object) => JSX.Element;
418
419
  onSubmit: (obj: {
419
420
  [x: string]: any;
420
421
  }) => void;
421
- onError?: (() => void) | undefined;
422
- footer?: ((props: {
422
+ onError?: () => void;
423
+ footer?: (props: {
423
424
  reset: () => void;
424
425
  valid: () => void;
425
- }) => JSX.Element) | undefined;
426
- style?: object | undefined;
427
- className?: string | undefined;
428
- options?: Option | undefined;
429
- } & React$1.RefAttributes<unknown>>;
426
+ }) => JSX.Element;
427
+ style?: object;
428
+ className?: string;
429
+ options?: Option;
430
+ };
431
+ interface FormRef {
432
+ handleSubmit: () => void;
433
+ trigger: () => void;
434
+ methods: UseFormReturn & {
435
+ data: () => any;
436
+ };
437
+ }
438
+ declare const Form: React$1.ForwardRefExoticComponent<FormProps & React$1.RefAttributes<FormRef>>;
430
439
 
431
- export { BooleanInput, CodeInput, Collapse, Form, Format, MarkdownInput, ObjectInput, SelectInput, SelectOption, SingleLineCode, Type, constraints_d as constraints, format, type };
440
+ export { BooleanInput, CodeInput, Collapse, Form, FormRef, Format, MarkdownInput, ObjectInput, SelectInput, SelectOption, SingleLineCode, Type, constraints_d as constraints, format, type };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maif/react-forms",
3
3
  "description": "Build react safe forms as fast as possible",
4
- "version": "1.3.1-rc.6",
4
+ "version": "1.3.1-rc.7",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "source": "src/index.ts",