@maif/react-forms 1.3.1-rc.4 → 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.
- package/lib/index.d.ts +23 -14
- 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";
|
|
@@ -58,7 +59,7 @@ declare const test: (name: string, message: string | undefined, test: TestFuncti
|
|
|
58
59
|
declare const when: (ref: string, test: TestFunction<any, object>, then?: Constraint[], otherwise?: Constraint[]) => (r: AnySchema, key: string, dependencies: any[]) => yup.AnySchema<any, any, any>;
|
|
59
60
|
declare const oneOf: (arrayOfValues: any[], message?: string) => (r: AnySchema) => yup.AnySchema<any, any, any>;
|
|
60
61
|
declare const blacklist: (arrayOfValues: any[], message?: string) => (r: AnySchema) => yup.AnySchema<any, any, any>;
|
|
61
|
-
declare const ref: (ref: string) => Reference<
|
|
62
|
+
declare const ref: <T>(ref: string) => Reference<T>;
|
|
62
63
|
declare const jsonConstraints: Record<string, any>;
|
|
63
64
|
declare type TConstraintType = keyof typeof jsonConstraints;
|
|
64
65
|
|
|
@@ -400,7 +401,7 @@ interface SchemaEntry {
|
|
|
400
401
|
interface FlowObject {
|
|
401
402
|
label: string;
|
|
402
403
|
flow: Flow;
|
|
403
|
-
|
|
404
|
+
collapsed: boolean;
|
|
404
405
|
}
|
|
405
406
|
declare type Flow = Array<string | FlowObject>;
|
|
406
407
|
interface Informations {
|
|
@@ -410,22 +411,30 @@ interface Informations {
|
|
|
410
411
|
index?: number;
|
|
411
412
|
}
|
|
412
413
|
|
|
413
|
-
declare
|
|
414
|
+
declare type FormProps = {
|
|
414
415
|
schema: Schema;
|
|
415
|
-
flow?:
|
|
416
|
-
value?: object
|
|
417
|
-
inputWrapper?: (
|
|
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?: (
|
|
422
|
-
footer?: (
|
|
422
|
+
onError?: () => void;
|
|
423
|
+
footer?: (props: {
|
|
423
424
|
reset: () => void;
|
|
424
425
|
valid: () => void;
|
|
425
|
-
}) => JSX.Element
|
|
426
|
-
style?: object
|
|
427
|
-
className?: string
|
|
428
|
-
options?: Option
|
|
429
|
-
}
|
|
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 };
|