@jasperoosthoek/react-toolbox 0.9.3 → 0.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jasperoosthoek/react-toolbox",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "author": "jasperoosthoek",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -91,11 +91,11 @@ export type FormModalProviderProps<
91
91
  K extends IncludeData<T>
92
92
  > = {
93
93
  formFields: T;
94
- initialState: InitialState<T> | K;
94
+ initialState?: InitialState<T> | K;
95
95
  includeData?: K;
96
- onSave?: (state: ({ [key in keyof T]: FormValue }), callback?: () => void) => void;
97
- onCreate?: (state: ({ [key in keyof T]: FormValue }), callback?: () => void) => void;
98
- onUpdate?: (state: ({ [key in keyof T]: FormValue }), callback?: () => void) => void;
96
+ onSave?: any;
97
+ onCreate?: any;
98
+ onUpdate?: any;
99
99
  validate?: Validate;
100
100
  createModalTitle?: ModalTitle;
101
101
  editModalTitle?: ModalTitle;
@@ -193,7 +193,7 @@ export const FormModalProvider: React.FC<FormModalProviderProps<T, K>> = ({
193
193
  {createModalActive && (onCreate || onSave) && (
194
194
  <FormProvider
195
195
  formFields={formFields}
196
- initialState={initialState as InitialState<T>}
196
+ initialState={(initialState || {}) as InitialState<T>}
197
197
  onSubmit={handleCreateSubmit}
198
198
  validate={validate}
199
199
  loading={loading}