@saas-ui/forms 2.0.0-next.7 → 2.0.0-next.9
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -0
- package/dist/ajv/index.d.ts +3 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -40
- package/dist/index.mjs.map +1 -1
- package/dist/yup/index.d.ts +4 -3
- package/dist/zod/index.d.ts +4 -3
- package/package.json +2 -2
- package/src/form-context.tsx +3 -3
- package/src/form.tsx +7 -4
package/src/form.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react'
|
2
2
|
|
3
3
|
import { chakra, HTMLChakraProps, forwardRef } from '@chakra-ui/react'
|
4
|
-
import { cx, runIfFn } from '@chakra-ui/utils'
|
4
|
+
import { FocusableElement, cx, runIfFn } from '@chakra-ui/utils'
|
5
5
|
|
6
6
|
import {
|
7
7
|
useForm,
|
@@ -29,15 +29,18 @@ import { SubmitButton } from './submit-button'
|
|
29
29
|
import { DisplayIf, DisplayIfProps } from './display-if'
|
30
30
|
import { ArrayField, ArrayFieldProps } from './array-field'
|
31
31
|
import { ObjectField, ObjectFieldProps } from './object-field'
|
32
|
+
import { UseArrayFieldReturn } from './use-array-field'
|
32
33
|
|
33
34
|
export interface FormRenderContext<
|
34
35
|
TFieldValues extends FieldValues = FieldValues,
|
35
36
|
TContext extends object = object,
|
36
37
|
TFieldTypes = FieldProps<TFieldValues>
|
37
38
|
> extends UseFormReturn<TFieldValues, TContext> {
|
38
|
-
Field: React.FC<TFieldTypes
|
39
|
+
Field: React.FC<TFieldTypes & React.RefAttributes<FocusableElement>>
|
39
40
|
DisplayIf: React.FC<DisplayIfProps<TFieldValues>>
|
40
|
-
ArrayField: React.FC<
|
41
|
+
ArrayField: React.FC<
|
42
|
+
ArrayFieldProps<TFieldValues> & React.RefAttributes<UseArrayFieldReturn>
|
43
|
+
>
|
41
44
|
ObjectField: React.FC<ObjectFieldProps<TFieldValues>>
|
42
45
|
}
|
43
46
|
|
@@ -188,7 +191,7 @@ export const Form = forwardRef(
|
|
188
191
|
>
|
189
192
|
{runIfFn(_children, {
|
190
193
|
Field: DefaultField as any,
|
191
|
-
DisplayIf: DisplayIf,
|
194
|
+
DisplayIf: DisplayIf as any,
|
192
195
|
ArrayField: ArrayField as any,
|
193
196
|
ObjectField: ObjectField as any,
|
194
197
|
...methods,
|