@bigbinary/neeto-fields-frontend 1.1.12 → 1.1.14

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/README.md CHANGED
@@ -354,6 +354,14 @@ specific resource.
354
354
  field.
355
355
  13. `onMutationSuccess`: The callback function which is triggered on the success
356
356
  of mutation functions( create, update & delete).
357
+ 14. `blockNavigation`: Boolean value to specify whether to block the navigation
358
+ if we have unsaved field values entered in field inputs.
359
+ 15. `blockNavigationAlertProps`: Props to be passed to the Alert. It accepts the
360
+ following.
361
+ - `title`
362
+ - `message`
363
+ - `submitButtonLabel`
364
+ - `cancelButtonLabel`
357
365
 
358
366
  #### Usage:
359
367
 
@@ -366,6 +374,7 @@ const formRefs = useRef({});
366
374
  const queryClient = useQueryClient();
367
375
 
368
376
  <FieldValuesContainer
377
+ blockNavigation
369
378
  formRefs={formRefs}
370
379
  fieldValues={user.fieldValues} // We expect the user response from host's backend to send associated field_values with it.
371
380
  resourceId={user?.id}
@@ -374,6 +383,10 @@ const queryClient = useQueryClient();
374
383
  customComponents={{
375
384
  hostSpecificKindName: field => <HostSpecificInputFields />,
376
385
  }}
386
+ blockNavigationProps={{
387
+ title: "Changes not saved!",
388
+ message: "You've not saved the changes made.",
389
+ }}
377
390
  />;
378
391
  ```
379
392