@bolttech/form-engine 3.0.0-beta.37 → 3.0.0-beta.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine",
3
- "version": "3.0.0-beta.37",
3
+ "version": "3.0.0-beta.38",
4
4
  "description": "A react adapter for bolttech form engine",
5
5
  "module": "./index.esm.js",
6
6
  "type": "module",
@@ -13,14 +13,18 @@ type TFieldWrapper = {
13
13
  * Represents the possible event properties for form fields callbacks.
14
14
  */
15
15
  type TEventProps = 'onChange' | 'onBlur' | 'onFocus' | 'onKeyDown' | 'onKeyUp' | 'onMount' | 'onApiResponse' | 'onClick';
16
+ /**
17
+ * Represents the content inside onData payload action.
18
+ */
19
+ type TFormData<T> = {
20
+ field: string;
21
+ data: TFormValues<T>;
22
+ };
16
23
  /**
17
24
  * Represents a mapping of event properties to their corresponding callback functions.
18
25
  */
19
26
  type TEventsCallbackProps = Partial<Record<TEventProps, ((payload: TFieldEvent) => void) | null | undefined>> & {
20
- onData?: (payload: {
21
- field: string;
22
- data: TFormValues<Record<string, unknown>>;
23
- }) => void;
24
- onSubmit?: (payload: TFormValues<Record<string, unknown>>) => void;
27
+ onData?: <T>(payload: TFormData<T>) => void;
28
+ onSubmit?: <T>(payload: TFormValues<T>) => void;
25
29
  };
26
30
  export { TFieldWrapper, TEventProps, TEventsCallbackProps };