@wix/headless-forms 0.0.27 → 0.0.28
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/cjs/dist/react/Form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type FormError } from '@wix/form-public';
|
|
2
|
+
import { type FormError, type UseFormProps } from '@wix/form-public';
|
|
3
3
|
import { type CheckboxGroupProps, type CheckboxProps, type PhoneInputProps, type DateInputProps, type DatePickerProps, type DateTimeInputProps, type DropdownProps, type FileUploadProps, type MultilineAddressProps, type NumberInputProps, type RadioGroupProps, type RatingInputProps, type RichTextProps, type SignatureProps, type SubmitButtonProps, type TagsProps, type TextAreaProps, type TextInputProps, type TimeInputProps, type ProductListProps, type FixedPaymentProps, type PaymentInputProps, type DonationProps, type AppointmentProps, type ImageChoiceProps, type LoginBarProps } from './types.js';
|
|
4
4
|
import { type FormServiceConfig } from '../services/form-service.js';
|
|
5
5
|
/**
|
|
@@ -13,6 +13,8 @@ export interface RootProps {
|
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
/** CSS classes to apply to the root element */
|
|
15
15
|
className?: string;
|
|
16
|
+
/** Ref to access form handle */
|
|
17
|
+
formRef?: React.Ref<UseFormProps['forwardedRef']>;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Root component that provides all necessary service contexts for a complete form experience.
|
package/cjs/dist/react/Form.js
CHANGED
|
@@ -129,8 +129,8 @@ var TestIds;
|
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
131
|
exports.Root = react_1.default.forwardRef((props, ref) => {
|
|
132
|
-
const { children, formServiceConfig, asChild, ...otherProps } = props;
|
|
133
|
-
return ((0, jsx_runtime_1.jsx)(Form_js_1.Root, { formServiceConfig: formServiceConfig, formRef:
|
|
132
|
+
const { children, formServiceConfig, asChild, formRef, ...otherProps } = props;
|
|
133
|
+
return ((0, jsx_runtime_1.jsx)(Form_js_1.Root, { formServiceConfig: formServiceConfig, formRef: formRef, children: (0, jsx_runtime_1.jsx)(RootContent, { asChild: asChild, ref: ref, ...otherProps, children: children }) }));
|
|
134
134
|
});
|
|
135
135
|
/**
|
|
136
136
|
* Internal component to handle the Root content with service access.
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { forms } from '@wix/forms';
|
|
3
3
|
import { SiteConfig } from '../../services/utils';
|
|
4
4
|
import { FormServiceConfig } from '../../services/form-service.js';
|
|
5
|
-
import { FormValues } from '../types.js';
|
|
5
|
+
import { FormValues, UseFormProps } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Hook to access the form ref from context
|
|
8
8
|
*/
|
|
9
|
-
export declare function useFormRef(): React.Ref<
|
|
9
|
+
export declare function useFormRef(): React.Ref<UseFormProps['forwardedRef']> | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Props for Root headless component
|
|
12
12
|
*/
|
package/dist/react/Form.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type FormError } from '@wix/form-public';
|
|
2
|
+
import { type FormError, type UseFormProps } from '@wix/form-public';
|
|
3
3
|
import { type CheckboxGroupProps, type CheckboxProps, type PhoneInputProps, type DateInputProps, type DatePickerProps, type DateTimeInputProps, type DropdownProps, type FileUploadProps, type MultilineAddressProps, type NumberInputProps, type RadioGroupProps, type RatingInputProps, type RichTextProps, type SignatureProps, type SubmitButtonProps, type TagsProps, type TextAreaProps, type TextInputProps, type TimeInputProps, type ProductListProps, type FixedPaymentProps, type PaymentInputProps, type DonationProps, type AppointmentProps, type ImageChoiceProps, type LoginBarProps } from './types.js';
|
|
4
4
|
import { type FormServiceConfig } from '../services/form-service.js';
|
|
5
5
|
/**
|
|
@@ -13,6 +13,8 @@ export interface RootProps {
|
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
/** CSS classes to apply to the root element */
|
|
15
15
|
className?: string;
|
|
16
|
+
/** Ref to access form handle */
|
|
17
|
+
formRef?: React.Ref<UseFormProps['forwardedRef']>;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Root component that provides all necessary service contexts for a complete form experience.
|
package/dist/react/Form.js
CHANGED
|
@@ -93,8 +93,8 @@ var TestIds;
|
|
|
93
93
|
* ```
|
|
94
94
|
*/
|
|
95
95
|
export const Root = React.forwardRef((props, ref) => {
|
|
96
|
-
const { children, formServiceConfig, asChild, ...otherProps } = props;
|
|
97
|
-
return (_jsx(CoreRoot, { formServiceConfig: formServiceConfig, formRef:
|
|
96
|
+
const { children, formServiceConfig, asChild, formRef, ...otherProps } = props;
|
|
97
|
+
return (_jsx(CoreRoot, { formServiceConfig: formServiceConfig, formRef: formRef, children: _jsx(RootContent, { asChild: asChild, ref: ref, ...otherProps, children: children }) }));
|
|
98
98
|
});
|
|
99
99
|
/**
|
|
100
100
|
* Internal component to handle the Root content with service access.
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { forms } from '@wix/forms';
|
|
3
3
|
import { SiteConfig } from '../../services/utils';
|
|
4
4
|
import { FormServiceConfig } from '../../services/form-service.js';
|
|
5
|
-
import { FormValues } from '../types.js';
|
|
5
|
+
import { FormValues, UseFormProps } from '../types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Hook to access the form ref from context
|
|
8
8
|
*/
|
|
9
|
-
export declare function useFormRef(): React.Ref<
|
|
9
|
+
export declare function useFormRef(): React.Ref<UseFormProps['forwardedRef']> | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Props for Root headless component
|
|
12
12
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-forms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"groupId": "com.wixpress.headless-components"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"falconPackageHash": "
|
|
63
|
+
"falconPackageHash": "09f37f9ebb57ee174194b7302cde16d0e2b77de0d85569a252c0f030"
|
|
64
64
|
}
|