@npm-zenwork/tax-remittance-ui 0.14.2 → 0.14.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.
@@ -16,13 +16,17 @@ export declare const AMOUNT_FIELD_VALIDATION: {
16
16
  readonly errorMessage: "Payment amount must be a number greater than 0, can include up to 2 decimal places, and must not exceed 100,000,000 (one hundred million).";
17
17
  };
18
18
  /**
19
- * Subcategory amounts accept 0, mirroring EFTPS: a subcategory that doesn't
20
- * apply to the filing is entered as 0.00 rather than left blank. The
21
- * subcategory total must still equal the payment amount, which stays > 0.
19
+ * EFTPS takes no subcategory below $0.01, so 0.00 is not a way to say "this
20
+ * category does not apply" — the breakdown has to be a real split of the
21
+ * payment. At two decimal places a $0.01 floor is the same rule as "greater
22
+ * than zero"; it is written as the floor because that is how EFTPS states it.
23
+ *
24
+ * Kept separate from AMOUNT_FIELD_VALIDATION for the message alone: both reject
25
+ * 0, and the wording here is the business team's.
22
26
  */
23
27
  export declare const SUBCATEGORY_AMOUNT_FIELD_VALIDATION: {
24
28
  readonly regex: RegExp;
25
- readonly errorMessage: "Amount must be a number of 0 or more, can include up to 2 decimal places, and must not exceed 100,000,000 (one hundred million).";
29
+ readonly errorMessage: "Please enter a valid payment amount. The amount must be at least $0.01 and cannot exceed $100,000,000.00.";
26
30
  };
27
31
  export declare function isSubcategoryFieldsActive(taxFormType: string, taxTypeCode: string): boolean;
28
32
  export declare function isCt1SubcategoryFieldsActive(taxFormType: string, taxTypeCode: string): boolean;
@@ -16,11 +16,12 @@ interface EmbeddedContextValue {
16
16
  }
17
17
  interface EmbeddedContextProviderProps {
18
18
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
19
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
19
20
  enabledPayments?: PaymentType[];
20
21
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
21
22
  userName?: string;
22
23
  children: ReactNode;
23
24
  }
24
- export declare function EmbeddedContextProvider({ onOrganizationCreated, enabledPayments, onPaymentRequired, userName, children, }: EmbeddedContextProviderProps): import("react").JSX.Element;
25
+ export declare function EmbeddedContextProvider({ onOrganizationCreated, onEntitiesChanged, enabledPayments, onPaymentRequired, userName, children, }: EmbeddedContextProviderProps): import("react").JSX.Element;
25
26
  export declare function useEmbeddedContext(): EmbeddedContextValue;
26
27
  export {};
@@ -11,6 +11,8 @@ export interface EmbeddedWidgetBaseProps {
11
11
  theme?: TaxRemittanceTheme;
12
12
  onSessionExpired?: () => void;
13
13
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
14
+ /** Called whenever the entity list's contents change — created, edited, or status toggled. */
15
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
14
16
  onNavigate?: (routeKey: EmbeddedRouteKey, pathname: string) => void;
15
17
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
16
18
  /** Called whenever the widget's active entity changes, from either the host or the widget. */
@@ -34,4 +36,4 @@ export interface EmbeddedWidgetBaseProps {
34
36
  *
35
37
  * Children should be a <Routes> element with the widget-specific route tree.
36
38
  */
37
- export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, onPaymentRequired, onEntityChange, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
39
+ export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onEntitiesChanged, onNavigate, onPaymentRequired, onEntityChange, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
@@ -71,6 +71,17 @@ export interface TaxRemittanceEmbeddedProps {
71
71
  * Called immediately after a new organization/entity is created inside the widget.
72
72
  */
73
73
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
74
+ /**
75
+ * Called whenever the entity list's contents change inside the widget — an entity
76
+ * created, edited, or its status toggled Active/Inactive. Receives the full updated
77
+ * list.
78
+ *
79
+ * Use this if the host keeps its own copy of the entities (a header switcher backed
80
+ * by its own store, say). `onOrganizationCreated` only fires for entities that are
81
+ * new, so without this a host's copy goes stale after a status change until the page
82
+ * is reloaded.
83
+ */
84
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
74
85
  /**
75
86
  * Called every time the widget's internal route changes.
76
87
  * Use this to keep the host app's sidebar selection in sync with the widget.