@splpi/estore-shared-components 7.0.4 → 7.0.5

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.mts CHANGED
@@ -98,6 +98,8 @@ interface IParsedAddress {
98
98
  }
99
99
 
100
100
  interface LifePlanApplication2Props {
101
+ /** Saved address, shown when the user comes back to this form. */
102
+ initialData?: IAddress;
101
103
  onAddressUpdate?: (address: IAddress) => void;
102
104
  /**
103
105
  * Optional address parser from the host app (e.g. GeoApifyService.parseAddress).
@@ -105,7 +107,7 @@ interface LifePlanApplication2Props {
105
107
  */
106
108
  parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
107
109
  }
108
- declare const LifePlanApplication2: ({ onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
110
+ declare const LifePlanApplication2: ({ initialData, onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
109
111
 
110
112
  interface LifePlanApplication3Props {
111
113
  initialData?: IEmployment;
@@ -125,7 +127,7 @@ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, on
125
127
  openSectionKey?: number;
126
128
  onValidChange?: (valid: boolean) => void;
127
129
  parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
128
- }) => react_jsx_runtime.JSX.Element;
130
+ }) => react_jsx_runtime.JSX.Element | null;
129
131
 
130
132
  interface CartItem {
131
133
  planDesc: string;
@@ -388,8 +390,27 @@ interface ReusableProfileProps {
388
390
  }
389
391
  declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
390
392
 
393
+ declare const LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
394
+ /** Fired on `window` every time the saved application data changes. */
395
+ declare const APPLICATION_DATA_CHANGE_EVENT = "lifeplan-application:change";
391
396
  declare const createEmptyApplicationData: () => IApplicationData;
397
+ /** Reads the saved application data, or null if nothing is saved yet. */
398
+ declare const loadApplicationData: (storageKey?: string) => IApplicationData | null;
399
+ /** Replaces the whole saved application data. */
400
+ declare const saveApplicationData: (data: IApplicationData, storageKey?: string) => void;
401
+ /**
402
+ * Saves only the given sections and keeps the rest as-is,
403
+ * so one form step never wipes another step's data.
404
+ */
405
+ declare const updateApplicationData: (patch: Partial<IApplicationData>, storageKey?: string) => IApplicationData;
406
+ /** Removes the saved application data (e.g. after a successful payment). */
407
+ declare const clearApplicationData: (storageKey?: string) => void;
408
+ /** @deprecated Kept for older code. Data now lives in sessionStorage; use `loadApplicationData`. */
392
409
  declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
410
+ /** @deprecated Kept for older code. Data now lives in sessionStorage; use `saveApplicationData`. */
393
411
  declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
394
412
 
395
- export { APIError, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationDataToLocalStorage, saveOcrResult, useOcr };
413
+ /** Returns the saved application data and re-renders whenever it changes. */
414
+ declare function useApplicationData(storageKey?: string): IApplicationData | null;
415
+
416
+ export { APIError, APPLICATION_DATA_CHANGE_EVENT, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LIFE_PLAN_APPLICATION_KEY, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearApplicationData, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationData, saveApplicationDataToLocalStorage, saveOcrResult, updateApplicationData, useApplicationData, useOcr };
package/dist/index.d.ts CHANGED
@@ -98,6 +98,8 @@ interface IParsedAddress {
98
98
  }
99
99
 
100
100
  interface LifePlanApplication2Props {
101
+ /** Saved address, shown when the user comes back to this form. */
102
+ initialData?: IAddress;
101
103
  onAddressUpdate?: (address: IAddress) => void;
102
104
  /**
103
105
  * Optional address parser from the host app (e.g. GeoApifyService.parseAddress).
@@ -105,7 +107,7 @@ interface LifePlanApplication2Props {
105
107
  */
106
108
  parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
107
109
  }
108
- declare const LifePlanApplication2: ({ onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
110
+ declare const LifePlanApplication2: ({ initialData, onAddressUpdate, parseAddress, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
109
111
 
110
112
  interface LifePlanApplication3Props {
111
113
  initialData?: IEmployment;
@@ -125,7 +127,7 @@ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, on
125
127
  openSectionKey?: number;
126
128
  onValidChange?: (valid: boolean) => void;
127
129
  parseAddress?: (addressLine: string) => Promise<IParsedAddress>;
128
- }) => react_jsx_runtime.JSX.Element;
130
+ }) => react_jsx_runtime.JSX.Element | null;
129
131
 
130
132
  interface CartItem {
131
133
  planDesc: string;
@@ -388,8 +390,27 @@ interface ReusableProfileProps {
388
390
  }
389
391
  declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
390
392
 
393
+ declare const LIFE_PLAN_APPLICATION_KEY = "LifePlanApplication";
394
+ /** Fired on `window` every time the saved application data changes. */
395
+ declare const APPLICATION_DATA_CHANGE_EVENT = "lifeplan-application:change";
391
396
  declare const createEmptyApplicationData: () => IApplicationData;
397
+ /** Reads the saved application data, or null if nothing is saved yet. */
398
+ declare const loadApplicationData: (storageKey?: string) => IApplicationData | null;
399
+ /** Replaces the whole saved application data. */
400
+ declare const saveApplicationData: (data: IApplicationData, storageKey?: string) => void;
401
+ /**
402
+ * Saves only the given sections and keeps the rest as-is,
403
+ * so one form step never wipes another step's data.
404
+ */
405
+ declare const updateApplicationData: (patch: Partial<IApplicationData>, storageKey?: string) => IApplicationData;
406
+ /** Removes the saved application data (e.g. after a successful payment). */
407
+ declare const clearApplicationData: (storageKey?: string) => void;
408
+ /** @deprecated Kept for older code. Data now lives in sessionStorage; use `loadApplicationData`. */
392
409
  declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
410
+ /** @deprecated Kept for older code. Data now lives in sessionStorage; use `saveApplicationData`. */
393
411
  declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
394
412
 
395
- export { APIError, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationDataToLocalStorage, saveOcrResult, useOcr };
413
+ /** Returns the saved application data and re-renders whenever it changes. */
414
+ declare function useApplicationData(storageKey?: string): IApplicationData | null;
415
+
416
+ export { APIError, APPLICATION_DATA_CHANGE_EVENT, Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, type DocumentStatus, type DocumentTypeConfig, DocumentUploadCard, GeoApifyService, GetStarted, type GetStartedNotifyType, type GetStartedProps, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type ICheckoutItem, type ICheckoutResult, type IEmployment, type IHealthDeclaration, type INewSalesCheckoutItem, type INewSalesCheckoutRequest, type INewSalesCheckoutResult, type IOcrValue, type IParsedAddress, type IPersonalInfo, type ITransactionData, LIFE_PLAN_APPLICATION_KEY, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type NewSalesCheckoutItem, type NewSalesCheckoutRequest, NotifyInstall, OCR_STORAGE_KEY, type OcrDocType, type OcrSection, OcrService, type OcrSource, PayMongoService, type ProfileUser, type ReusableProfileProps, type ScanIdFn, SharedLifePlanApplication, type SharedLifePlanApplicationProps, ReusableProfile as UserProfile, api, apiClient, clearApplicationData, clearOcrResult, configureApi, createEmptyApplicationData, loadApplicationData, loadApplicationDataFromLocalStorage, markOcrApplied, readOcrResult, saveApplicationData, saveApplicationDataToLocalStorage, saveOcrResult, updateApplicationData, useApplicationData, useOcr };