@mcurros2/microm 1.1.440-0 → 1.1.441-0

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/dist/index.d.ts CHANGED
@@ -340,6 +340,9 @@ export type ValidatorConfigurationParms = {
340
340
  };
341
341
  export type ValidatorConfiguration = Partial<Record<keyof typeof CommonValidators, ValidatorConfigurationParms>>;
342
342
  export type NavigationProtectionMode = 'save' | 'confirm' | 'allways' | 'disabled';
343
+ export type NavigationProtection = Partial<Record<FormMode, NavigationProtectionMode>> & {
344
+ default: NavigationProtectionMode;
345
+ };
343
346
  export const ModalsManagerDefaultProps: {
344
347
  closeLabel: string;
345
348
  fullscreenLabel: string;
@@ -585,7 +588,7 @@ export interface EntityFormModalProps {
585
588
  entityConstructor: (client: MicroMClient) => Entity<EntityDefinition>;
586
589
  initialFormMode?: FormMode;
587
590
  getDataOnInit?: boolean;
588
- navigationProtection?: NavigationProtectionMode;
591
+ navigationProtection?: NavigationProtection;
589
592
  openState: boolean;
590
593
  setOpenState: (open: boolean) => void;
591
594
  onModalClosed?: () => void;
@@ -1308,7 +1311,7 @@ export interface FormOptions<T extends Entity<EntityDefinition>> extends Omit<En
1308
1311
  getDataOnInit?: boolean;
1309
1312
  onSaved?: (status: OperationStatus<DBStatusResult>) => void;
1310
1313
  onCancel?: () => void;
1311
- navigationProtection?: NavigationProtectionMode;
1314
+ navigationProtection?: NavigationProtection;
1312
1315
  validateForm?: ValidateFormCallback;
1313
1316
  }
1314
1317
  export type useStateReturnType<T> = [T, React.Dispatch<React.SetStateAction<T>>];
@@ -2469,7 +2472,7 @@ export interface OpenFormProps {
2469
2472
  title?: string;
2470
2473
  element?: HTMLElement;
2471
2474
  getDataOnInit?: boolean;
2472
- navigationProtection?: NavigationProtectionMode;
2475
+ navigationProtection?: NavigationProtection;
2473
2476
  onModalSaved?: (new_status: OperationStatus<DBStatusResult | null>) => void;
2474
2477
  onModalCancelled?: () => void;
2475
2478
  onModalClosed?: () => void;