@iress-oss/ids-components 6.0.0-alpha.3 → 6.0.0-alpha.4

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.
@@ -1,11 +1,9 @@
1
1
  import { Ref } from 'react';
2
2
  import { FieldValues } from 'react-hook-form';
3
- import { FormRef, HookFormExports } from './HookForm/HookForm';
3
+ import { FormRef } from './HookForm/HookForm';
4
4
  import { LongFormProps } from './components/LongForm';
5
5
  import { ShortFormProps } from './components/ShortForm';
6
6
  export type IressFormProps<T extends FieldValues, TContext = object> = LongFormProps<T, TContext> | ShortFormProps<T, TContext>;
7
- declare const ForwardedForm: <T extends FieldValues>(props: IressFormProps<T> & {
7
+ export declare const IressForm: <T extends FieldValues>(props: IressFormProps<T> & {
8
8
  ref?: Ref<FormRef<T>>;
9
9
  }) => React.ReactElement;
10
- export declare const IressForm: typeof ForwardedForm & HookFormExports;
11
- export {};
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode, Ref } from 'react';
2
- import { DefaultValues, FieldValues, SubmitErrorHandler, useFieldArray, useForm, useFormContext, UseFormProps, UseFormReturn, useWatch } from 'react-hook-form';
2
+ import { DefaultValues, FieldValues, SubmitErrorHandler, UseFormProps, UseFormReturn } from 'react-hook-form';
3
3
  import { IressStyledProps } from '../../../types';
4
4
  export interface IressHookFormProps<T extends FieldValues, TContext = object> extends Omit<IressStyledProps<'form'>, 'defaultChecked' | 'defaultValue' | 'onSubmit' | 'onError'> {
5
5
  /**
@@ -137,38 +137,6 @@ export interface FormPatternProps<T extends FieldValues, TContext = object> exte
137
137
  */
138
138
  values?: UseFormProps<T, TContext>['values'];
139
139
  }
140
- /**
141
- * This interface allows us to expose the methods from `react-hook-form` that are used in `IressHookForm`.
142
- * This is used by consumers with more complex forms that need to access the form methods directly, and ensure it is using the same version of `react-hook-form` as `IressHookForm` and `IressForm`.
143
- */
144
- export interface HookFormExports {
145
- /**
146
- * Allows you to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc.
147
- * This is useful when you have a form with a list of items that can be added or removed dynamically, such as a list of addresses or phone numbers.
148
- * @see https://react-hook-form.com/docs/usefieldarray
149
- */
150
- useFieldArray: typeof useFieldArray;
151
- /**
152
- * Allows you to use the methods from `react-hook-form` in a nested component of `IressForm`.
153
- * This is useful when you want more control over the form, such as submitting it programmatically or resetting it, without having to set a ref.
154
- * @see https://react-hook-form.com/docs/useform
155
- */
156
- useForm: typeof useForm;
157
- /**
158
- * Allows you to use the form context from `react-hook-form` in a nested component of `IressForm`.
159
- * This is useful when you need to access the form context in a component that is not a direct child of `IressForm`.
160
- * @see https://react-hook-form.com/docs/useformcontext
161
- */
162
- useFormContext: typeof useFormContext;
163
- /**
164
- * Allows you watch changes to other form fields in an IressForm.
165
- * This is useful when you need to conditionally render fields based on the value of another field.
166
- * @see https://react-hook-form.com/docs/usewatch
167
- */
168
- useWatch: typeof useWatch;
169
- }
170
- declare const ForwardedHookForm: <T extends FieldValues, TContext = object>(props: IressHookFormProps<T, TContext> & {
140
+ export declare const IressHookForm: <T extends FieldValues, TContext = object>(props: IressHookFormProps<T, TContext> & {
171
141
  ref?: Ref<FormRef<T>>;
172
142
  }) => ReactElement;
173
- export declare const IressHookForm: typeof ForwardedHookForm & HookFormExports;
174
- export {};