@gusto/embedded-react-sdk 0.48.0 → 0.48.1
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/CHANGELOG.md +11 -0
- package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -12
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -10
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +8 -7
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.js +8 -8
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +5 -3
- package/dist/components/Common/UI/Card/Card.module.scss.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +13 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -17
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -17
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -19
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +6 -7
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -17
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -17
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -26
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -20
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +6 -8
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -17
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -17
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -18
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +5 -4
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -17
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -17
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -19
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +2 -3
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.js +39 -48
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/Compensation.js +2 -3
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js +8 -9
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js +2 -3
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +2 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +2 -3
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
- package/dist/components/Employee/Deductions/management/Deductions.js +2 -3
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js +2 -3
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +2 -2
- package/dist/components/Employee/Documents/management/Documents.js +2 -3
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -17
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +11 -12
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +16 -16
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +3 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +2 -2
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js +9 -10
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +2 -3
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +8 -9
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +13 -14
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +2 -3
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +6 -7
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/management/Profile.js +11 -12
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +12 -13
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +10 -11
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +2 -3
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.js +11 -12
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +6 -6
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js +9 -10
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +6 -7
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +2 -3
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +2 -3
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +10 -10
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +6 -7
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +7 -8
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +7 -8
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +16 -17
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +8 -8
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +25 -34
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +6 -7
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +6 -7
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +2 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +10 -10
- package/dist/components/Payroll/usePreparedPayrollData.js +22 -33
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +2 -3
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +2 -3
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +2 -3
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +0 -1
- package/dist/i18n/en/common.json.js +2 -2
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js +1 -1
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js.map +1 -1
- package/dist/partner-hook-utils/composeErrorHandler.js +3 -1
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +0 -1
- package/package.json +19 -7
- package/dist/assets/icons/magnifyingGlass.png.js +0 -5
- package/dist/assets/icons/magnifyingGlass.png.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SelectHookField as t } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
3
|
+
import { DatePickerHookField as i } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
|
|
4
4
|
function c(e) {
|
|
5
|
-
return /* @__PURE__ */ o(
|
|
5
|
+
return /* @__PURE__ */ o(t, { ...e, name: "locationUuid" });
|
|
6
6
|
}
|
|
7
7
|
function m(e) {
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
8
|
+
return /* @__PURE__ */ o(i, { ...e, name: "effectiveDate" });
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
11
|
m as EffectiveDateField,
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { createMachine as n } from "robot3";
|
|
3
|
+
import { useMemo as r } from "react";
|
|
4
4
|
import { StateTaxesCardContextual as i } from "./StateTaxesComponents.js";
|
|
5
|
-
import { stateTaxesStateMachine as
|
|
6
|
-
import { Flow as
|
|
5
|
+
import { stateTaxesStateMachine as s } from "./stateTaxesStateMachine.js";
|
|
6
|
+
import { Flow as p } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as c } from "../../../Base/Base.js";
|
|
8
|
-
import "../../../Base/useBase.js";
|
|
9
8
|
import { useComponentDictionary as f, useI18n as x } from "../../../../i18n/I18n.js";
|
|
10
9
|
function u({ employeeId: e, onEvent: t }) {
|
|
11
10
|
x("Employee.Management.StateTaxes");
|
|
12
|
-
const o =
|
|
13
|
-
() =>
|
|
11
|
+
const o = r(
|
|
12
|
+
() => n("card", s, (m) => ({
|
|
14
13
|
...m,
|
|
15
14
|
component: i,
|
|
16
15
|
employeeId: e
|
|
17
16
|
})),
|
|
18
17
|
[e]
|
|
19
18
|
);
|
|
20
|
-
return /* @__PURE__ */ a(
|
|
19
|
+
return /* @__PURE__ */ a(p, { machine: o, onEvent: t });
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function C({
|
|
23
22
|
dictionary: e,
|
|
24
23
|
FallbackComponent: t,
|
|
25
24
|
...o
|
|
@@ -34,6 +33,6 @@ function E({
|
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
C as StateTaxes
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=StateTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxes.js","sources":["../../../../../src/components/Employee/StateTaxes/management/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { StateTaxesCardContextual, type StateTaxesContextInterface } from './StateTaxesComponents'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link StateTaxes}.\n *\n * @public\n */\nexport interface StateTaxesProps extends CommonComponentInterface<'Employee.Management.StateTaxes'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction StateTaxesFlow({ employeeId, onEvent }: StateTaxesProps) {\n useI18n('Employee.Management.StateTaxes')\n\n const machine = useMemo(\n () =>\n createMachine('card', stateTaxesStateMachine, (ctx: StateTaxesContextInterface) => ({\n ...ctx,\n component: StateTaxesCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone state-tax management flow for a given employee. Renders the\n * read-only summary card and the edit form, switching between them as the\n * partner-emitted events from {@link StateTaxesCard} and {@link StateTaxesEditForm}\n * drive the internal state machine.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/stateTaxes/editRequested` | Edit button on the summary card was clicked | `{ employeeId: string }` |\n * | `employee/management/stateTaxes/editCancelled` | Cancel button on the edit form was clicked | — |\n * | `employee/management/stateTaxes/updated` | Edit form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxes({\n dictionary,\n FallbackComponent,\n ...props\n}: StateTaxesProps & BaseComponentInterface<'Employee.Management.StateTaxes'>) {\n useComponentDictionary('Employee.Management.StateTaxes', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.StateTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <StateTaxesFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["StateTaxesFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","stateTaxesStateMachine","ctx","StateTaxesCardContextual","jsx","Flow","StateTaxes","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StateTaxes.js","sources":["../../../../../src/components/Employee/StateTaxes/management/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { StateTaxesCardContextual, type StateTaxesContextInterface } from './StateTaxesComponents'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link StateTaxes}.\n *\n * @public\n */\nexport interface StateTaxesProps extends CommonComponentInterface<'Employee.Management.StateTaxes'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction StateTaxesFlow({ employeeId, onEvent }: StateTaxesProps) {\n useI18n('Employee.Management.StateTaxes')\n\n const machine = useMemo(\n () =>\n createMachine('card', stateTaxesStateMachine, (ctx: StateTaxesContextInterface) => ({\n ...ctx,\n component: StateTaxesCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone state-tax management flow for a given employee. Renders the\n * read-only summary card and the edit form, switching between them as the\n * partner-emitted events from {@link StateTaxesCard} and {@link StateTaxesEditForm}\n * drive the internal state machine.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/stateTaxes/editRequested` | Edit button on the summary card was clicked | `{ employeeId: string }` |\n * | `employee/management/stateTaxes/editCancelled` | Cancel button on the edit form was clicked | — |\n * | `employee/management/stateTaxes/updated` | Edit form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxes({\n dictionary,\n FallbackComponent,\n ...props\n}: StateTaxesProps & BaseComponentInterface<'Employee.Management.StateTaxes'>) {\n useComponentDictionary('Employee.Management.StateTaxes', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.StateTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <StateTaxesFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["StateTaxesFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","stateTaxesStateMachine","ctx","StateTaxesCardContextual","jsx","Flow","StateTaxes","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;AA2BA,SAASA,EAAe,EAAE,YAAAC,GAAY,SAAAC,KAA4B;AAChE,EAAAC,EAAQ,gCAAgC;AAExC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAwB,CAACC,OAAqC;AAAA,MAClF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IAAA,EACA;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAmBO,SAASU,EAAW;AAAA,EACzB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAA+E;AAC7E,SAAAC,EAAuB,kCAAkCH,CAAU,GAEjE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAgB,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGjC;"}
|
|
@@ -3,14 +3,13 @@ import { useTranslation as l } from "react-i18next";
|
|
|
3
3
|
import { EmployeeStateTaxesView as S } from "../shared/EmployeeStateTaxesView.js";
|
|
4
4
|
import { useManagementStateTaxesViewDictionary as d } from "./useViewDictionary.js";
|
|
5
5
|
import { BaseBoundaries as x, BaseLayout as y } from "../../../Base/Base.js";
|
|
6
|
-
import "../../../Base/useBase.js";
|
|
7
6
|
import { ActionsLayout as f } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
7
|
import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
8
|
import "react";
|
|
10
9
|
import { useI18n as A, useComponentDictionary as M } from "../../../../i18n/I18n.js";
|
|
11
10
|
import { componentEvents as m } from "../../../../shared/constants.js";
|
|
12
11
|
import { useEmployeeStateTaxesForm as C } from "../shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js";
|
|
13
|
-
function
|
|
12
|
+
function G({
|
|
14
13
|
FallbackComponent: o,
|
|
15
14
|
...n
|
|
16
15
|
}) {
|
|
@@ -30,10 +29,10 @@ function L({
|
|
|
30
29
|
onEvent: a
|
|
31
30
|
}) {
|
|
32
31
|
A("Employee.Management.StateTaxes"), M("Employee.Management.StateTaxes", c);
|
|
33
|
-
const { t: r } = l("Employee.Management.StateTaxes"), i = g(), e = C({ employeeId: o }),
|
|
32
|
+
const { t: r } = l("Employee.Management.StateTaxes"), i = g(), e = C({ employeeId: o }), E = d();
|
|
34
33
|
if (e.isLoading)
|
|
35
34
|
return /* @__PURE__ */ t(y, { isLoading: !0, error: e.errorHandling.errors });
|
|
36
|
-
const
|
|
35
|
+
const p = async () => {
|
|
37
36
|
const s = await e.actions.onSubmit();
|
|
38
37
|
s && a(m.EMPLOYEE_MANAGEMENT_STATE_TAXES_UPDATED, {
|
|
39
38
|
employeeStateTaxesList: s.data
|
|
@@ -45,17 +44,17 @@ function L({
|
|
|
45
44
|
S,
|
|
46
45
|
{
|
|
47
46
|
stateTaxes: e,
|
|
48
|
-
onSubmit:
|
|
47
|
+
onSubmit: p,
|
|
49
48
|
actions: /* @__PURE__ */ T(f, { children: [
|
|
50
49
|
/* @__PURE__ */ t(i.Button, { variant: "secondary", onClick: u, children: r("cancelCta") }),
|
|
51
50
|
/* @__PURE__ */ t(i.Button, { type: "submit", isLoading: e.status.isPending, children: r("saveCta") })
|
|
52
51
|
] }),
|
|
53
52
|
className: n,
|
|
54
|
-
dictionary:
|
|
53
|
+
dictionary: E
|
|
55
54
|
}
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
57
|
export {
|
|
59
|
-
|
|
58
|
+
G as StateTaxesEditForm
|
|
60
59
|
};
|
|
61
60
|
//# sourceMappingURL=StateTaxesEditForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesEditForm.js","sources":["../../../../../src/components/Employee/StateTaxes/management/StateTaxesEditForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { EmployeeStateTaxesView, useEmployeeStateTaxesForm } from '../shared'\nimport { useManagementStateTaxesViewDictionary } from './useViewDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Props for {@link StateTaxesEditForm}.\n *\n * @public\n */\nexport type StateTaxesEditFormProps = Omit<\n CommonComponentInterface<'Employee.Management.StateTaxes'>,\n 'children'\n> & {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when the form is submitted or cancelled. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone edit screen for the state-tax management flow. Renders the shared\n * state-tax form against the `Employee.Management.StateTaxes` namespace and\n * emits scoped management events on submit and cancel, so partner copy\n * overrides on the management namespace do not leak into the onboarding flow.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/stateTaxes/updated` | Form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/management/stateTaxes/editCancelled` | Cancel button was clicked | — |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxesEditForm({\n FallbackComponent,\n ...props\n}: StateTaxesEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.StateTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <StateTaxesEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction StateTaxesEditFormRoot({\n employeeId,\n className,\n dictionary,\n onEvent,\n}: StateTaxesEditFormProps) {\n useI18n('Employee.Management.StateTaxes')\n useComponentDictionary('Employee.Management.StateTaxes', dictionary)\n const { t } = useTranslation('Employee.Management.StateTaxes')\n const Components = useComponentContext()\n\n const stateTaxes = useEmployeeStateTaxesForm({ employeeId })\n const managementStateTaxesDictionary = useManagementStateTaxesViewDictionary()\n\n if (stateTaxes.isLoading) {\n return <BaseLayout isLoading error={stateTaxes.errorHandling.errors} />\n }\n\n const handleSubmit = async () => {\n const result = await stateTaxes.actions.onSubmit()\n if (!result) return\n\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_STATE_TAXES_UPDATED, {\n employeeStateTaxesList: result.data,\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_STATE_TAXES_EDIT_CANCELLED)\n }\n\n return (\n <EmployeeStateTaxesView\n stateTaxes={stateTaxes}\n onSubmit={handleSubmit}\n actions={\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={stateTaxes.status.isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n }\n className={className}\n dictionary={managementStateTaxesDictionary}\n />\n )\n}\n"],"names":["StateTaxesEditForm","FallbackComponent","props","jsx","BaseBoundaries","StateTaxesEditFormRoot","employeeId","className","dictionary","onEvent","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","stateTaxes","useEmployeeStateTaxesForm","managementStateTaxesDictionary","useManagementStateTaxesViewDictionary","BaseLayout","handleSubmit","result","componentEvents","handleCancel","EmployeeStateTaxesView","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StateTaxesEditForm.js","sources":["../../../../../src/components/Employee/StateTaxes/management/StateTaxesEditForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { EmployeeStateTaxesView, useEmployeeStateTaxesForm } from '../shared'\nimport { useManagementStateTaxesViewDictionary } from './useViewDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Props for {@link StateTaxesEditForm}.\n *\n * @public\n */\nexport type StateTaxesEditFormProps = Omit<\n CommonComponentInterface<'Employee.Management.StateTaxes'>,\n 'children'\n> & {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired when the form is submitted or cancelled. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Standalone edit screen for the state-tax management flow. Renders the shared\n * state-tax form against the `Employee.Management.StateTaxes` namespace and\n * emits scoped management events on submit and cancel, so partner copy\n * overrides on the management namespace do not leak into the onboarding flow.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/stateTaxes/updated` | Form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/management/stateTaxes/editCancelled` | Cancel button was clicked | — |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxesEditForm({\n FallbackComponent,\n ...props\n}: StateTaxesEditFormProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.StateTaxes\"\n FallbackComponent={FallbackComponent}\n >\n <StateTaxesEditFormRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction StateTaxesEditFormRoot({\n employeeId,\n className,\n dictionary,\n onEvent,\n}: StateTaxesEditFormProps) {\n useI18n('Employee.Management.StateTaxes')\n useComponentDictionary('Employee.Management.StateTaxes', dictionary)\n const { t } = useTranslation('Employee.Management.StateTaxes')\n const Components = useComponentContext()\n\n const stateTaxes = useEmployeeStateTaxesForm({ employeeId })\n const managementStateTaxesDictionary = useManagementStateTaxesViewDictionary()\n\n if (stateTaxes.isLoading) {\n return <BaseLayout isLoading error={stateTaxes.errorHandling.errors} />\n }\n\n const handleSubmit = async () => {\n const result = await stateTaxes.actions.onSubmit()\n if (!result) return\n\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_STATE_TAXES_UPDATED, {\n employeeStateTaxesList: result.data,\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_MANAGEMENT_STATE_TAXES_EDIT_CANCELLED)\n }\n\n return (\n <EmployeeStateTaxesView\n stateTaxes={stateTaxes}\n onSubmit={handleSubmit}\n actions={\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={stateTaxes.status.isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n }\n className={className}\n dictionary={managementStateTaxesDictionary}\n />\n )\n}\n"],"names":["StateTaxesEditForm","FallbackComponent","props","jsx","BaseBoundaries","StateTaxesEditFormRoot","employeeId","className","dictionary","onEvent","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","stateTaxes","useEmployeeStateTaxesForm","managementStateTaxesDictionary","useManagementStateTaxesViewDictionary","BaseLayout","handleSubmit","result","componentEvents","handleCancel","EmployeeStateTaxesView","ActionsLayout"],"mappings":";;;;;;;;;;;AA6CO,SAASA,EAAmB;AAAA,EACjC,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAgF;AAC9E,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAE,EAACE,GAAA,EAAwB,GAAGH,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGzC;AAEA,SAASG,EAAuB;AAAA,EAC9B,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AACF,GAA4B;AAC1B,EAAAC,EAAQ,gCAAgC,GACxCC,EAAuB,kCAAkCH,CAAU;AACnE,QAAM,EAAE,GAAAI,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA,GAEbC,IAAaC,EAA0B,EAAE,YAAAX,GAAY,GACrDY,IAAiCC,EAAA;AAEvC,MAAIH,EAAW;AACb,6BAAQI,GAAA,EAAW,WAAS,IAAC,OAAOJ,EAAW,cAAc,QAAQ;AAGvE,QAAMK,IAAe,YAAY;AAC/B,UAAMC,IAAS,MAAMN,EAAW,QAAQ,SAAA;AACxC,IAAKM,KAELb,EAAQc,EAAgB,yCAAyC;AAAA,MAC/D,wBAAwBD,EAAO;AAAA,IAAA,CAChC;AAAA,EACH,GAEME,IAAe,MAAM;AACzB,IAAAf,EAAQc,EAAgB,8CAA8C;AAAA,EACxE;AAEA,SACE,gBAAApB;AAAA,IAACsB;AAAA,IAAA;AAAA,MACC,YAAAT;AAAA,MACA,UAAUK;AAAA,MACV,2BACGK,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAvB,EAACW,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASU,GAC7C,UAAAZ,EAAE,WAAW,EAAA,CAChB;AAAA,QACA,gBAAAT,EAACW,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAW,OAAO,WAC3D,UAAAJ,EAAE,SAAS,EAAA,CACd;AAAA,MAAA,GACF;AAAA,MAEF,WAAAL;AAAA,MACA,YAAYW;AAAA,IAAA;AAAA,EAAA;AAGlB;"}
|
|
@@ -3,14 +3,13 @@ import { useTranslation as p } from "react-i18next";
|
|
|
3
3
|
import { EmployeeStateTaxesView as c } from "../shared/EmployeeStateTaxesView.js";
|
|
4
4
|
import { useOnboardingStateTaxesViewDictionary as T } from "./useViewDictionary.js";
|
|
5
5
|
import { BaseBoundaries as S, BaseLayout as E } from "../../../Base/Base.js";
|
|
6
|
-
import "../../../Base/useBase.js";
|
|
7
6
|
import { ActionsLayout as d } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
7
|
import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
8
|
import "react";
|
|
10
9
|
import { useI18n as l, useComponentDictionary as x } from "../../../../i18n/I18n.js";
|
|
11
10
|
import { componentEvents as s } from "../../../../shared/constants.js";
|
|
12
11
|
import { useEmployeeStateTaxesForm as y } from "../shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js";
|
|
13
|
-
function
|
|
12
|
+
function V({
|
|
14
13
|
FallbackComponent: e,
|
|
15
14
|
...o
|
|
16
15
|
}) {
|
|
@@ -46,6 +45,6 @@ function g({ isPending: e }) {
|
|
|
46
45
|
return /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: e, children: o("submitCta") }) });
|
|
47
46
|
}
|
|
48
47
|
export {
|
|
49
|
-
|
|
48
|
+
V as StateTaxes
|
|
50
49
|
};
|
|
51
50
|
//# sourceMappingURL=StateTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxes.js","sources":["../../../../../src/components/Employee/StateTaxes/onboarding/StateTaxes.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { EmployeeStateTaxesView, useEmployeeStateTaxesForm } from '../shared'\nimport { useOnboardingStateTaxesViewDictionary } from './useViewDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Props for {@link StateTaxes}.\n *\n * @public\n */\nexport type StateTaxesProps = Omit<CommonComponentInterface<'Employee.StateTaxes'>, 'children'> & {\n /** The associated employee identifier. */\n employeeId: string\n /** Render admin-only questions and submit them. Defaults to `false`. */\n isAdmin?: boolean\n /** Event handler fired when the form is submitted successfully. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Onboarding step that collects an employee's per-state tax withholding\n * answers. The set of fields is driven by the API response for each state\n * on record.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/stateTaxes/updated` | Form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/stateTaxes/done` | Onboarding step has finished — emitted immediately after `updated` | — |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxes({\n FallbackComponent,\n ...props\n}: StateTaxesProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries componentName=\"Employee.StateTaxes\" FallbackComponent={FallbackComponent}>\n <StateTaxesRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction StateTaxesRoot({\n employeeId,\n className,\n dictionary,\n onEvent,\n isAdmin = false,\n}: StateTaxesProps) {\n useI18n('Employee.StateTaxes')\n useComponentDictionary('Employee.StateTaxes', dictionary)\n\n const stateTaxes = useEmployeeStateTaxesForm({ employeeId, isAdmin })\n const onboardingStateTaxesDictionary = useOnboardingStateTaxesViewDictionary()\n\n if (stateTaxes.isLoading) {\n return <BaseLayout isLoading error={stateTaxes.errorHandling.errors} />\n }\n\n const handleSubmit = async () => {\n const result = await stateTaxes.actions.onSubmit()\n if (!result) return\n\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_UPDATED, {\n employeeStateTaxesList: result.data,\n })\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_DONE)\n }\n\n return (\n <EmployeeStateTaxesView\n stateTaxes={stateTaxes}\n onSubmit={handleSubmit}\n actions={<ContinueAction isPending={stateTaxes.status.isPending} />}\n className={className}\n dictionary={onboardingStateTaxesDictionary}\n />\n )\n}\n\nfunction ContinueAction({ isPending }: { isPending: boolean }) {\n const { t } = useTranslation('Employee.StateTaxes')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["StateTaxes","FallbackComponent","props","jsx","BaseBoundaries","StateTaxesRoot","employeeId","className","dictionary","onEvent","isAdmin","useI18n","useComponentDictionary","stateTaxes","useEmployeeStateTaxesForm","onboardingStateTaxesDictionary","useOnboardingStateTaxesViewDictionary","BaseLayout","EmployeeStateTaxesView","result","componentEvents","ContinueAction","isPending","t","useTranslation","Components","useComponentContext","ActionsLayout"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StateTaxes.js","sources":["../../../../../src/components/Employee/StateTaxes/onboarding/StateTaxes.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { EmployeeStateTaxesView, useEmployeeStateTaxesForm } from '../shared'\nimport { useOnboardingStateTaxesViewDictionary } from './useViewDictionary'\nimport {\n BaseBoundaries,\n BaseLayout,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Props for {@link StateTaxes}.\n *\n * @public\n */\nexport type StateTaxesProps = Omit<CommonComponentInterface<'Employee.StateTaxes'>, 'children'> & {\n /** The associated employee identifier. */\n employeeId: string\n /** Render admin-only questions and submit them. Defaults to `false`. */\n isAdmin?: boolean\n /** Event handler fired when the form is submitted successfully. */\n onEvent: BaseComponentInterface['onEvent']\n}\n\n/**\n * Onboarding step that collects an employee's per-state tax withholding\n * answers. The set of fields is driven by the API response for each state\n * on record.\n *\n * @remarks\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/stateTaxes/updated` | Form was submitted successfully | `{ employeeStateTaxesList: EmployeeStateTaxesList[] }` |\n * | `employee/stateTaxes/done` | Onboarding step has finished — emitted immediately after `updated` | — |\n *\n * @param props - The component props.\n * @public\n */\nexport function StateTaxes({\n FallbackComponent,\n ...props\n}: StateTaxesProps & Pick<BaseComponentInterface, 'FallbackComponent'>) {\n return (\n <BaseBoundaries componentName=\"Employee.StateTaxes\" FallbackComponent={FallbackComponent}>\n <StateTaxesRoot {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction StateTaxesRoot({\n employeeId,\n className,\n dictionary,\n onEvent,\n isAdmin = false,\n}: StateTaxesProps) {\n useI18n('Employee.StateTaxes')\n useComponentDictionary('Employee.StateTaxes', dictionary)\n\n const stateTaxes = useEmployeeStateTaxesForm({ employeeId, isAdmin })\n const onboardingStateTaxesDictionary = useOnboardingStateTaxesViewDictionary()\n\n if (stateTaxes.isLoading) {\n return <BaseLayout isLoading error={stateTaxes.errorHandling.errors} />\n }\n\n const handleSubmit = async () => {\n const result = await stateTaxes.actions.onSubmit()\n if (!result) return\n\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_UPDATED, {\n employeeStateTaxesList: result.data,\n })\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_DONE)\n }\n\n return (\n <EmployeeStateTaxesView\n stateTaxes={stateTaxes}\n onSubmit={handleSubmit}\n actions={<ContinueAction isPending={stateTaxes.status.isPending} />}\n className={className}\n dictionary={onboardingStateTaxesDictionary}\n />\n )\n}\n\nfunction ContinueAction({ isPending }: { isPending: boolean }) {\n const { t } = useTranslation('Employee.StateTaxes')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["StateTaxes","FallbackComponent","props","jsx","BaseBoundaries","StateTaxesRoot","employeeId","className","dictionary","onEvent","isAdmin","useI18n","useComponentDictionary","stateTaxes","useEmployeeStateTaxesForm","onboardingStateTaxesDictionary","useOnboardingStateTaxesViewDictionary","BaseLayout","EmployeeStateTaxesView","result","componentEvents","ContinueAction","isPending","t","useTranslation","Components","useComponentContext","ActionsLayout"],"mappings":";;;;;;;;;;;AA2CO,SAASA,EAAW;AAAA,EACzB,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAwE;AACtE,SACE,gBAAAC,EAACC,KAAe,eAAc,uBAAsB,mBAAAH,GAClD,UAAA,gBAAAE,EAACE,GAAA,EAAgB,GAAGH,EAAA,CAAO,EAAA,CAC7B;AAEJ;AAEA,SAASG,EAAe;AAAA,EACtB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,GAAoB;AAClB,EAAAC,EAAQ,qBAAqB,GAC7BC,EAAuB,uBAAuBJ,CAAU;AAExD,QAAMK,IAAaC,EAA0B,EAAE,YAAAR,GAAY,SAAAI,GAAS,GAC9DK,IAAiCC,EAAA;AAEvC,SAAIH,EAAW,8BACLI,GAAA,EAAW,WAAS,IAAC,OAAOJ,EAAW,cAAc,QAAQ,IAcrE,gBAAAV;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,YAAAL;AAAA,MACA,UAbiB,YAAY;AAC/B,cAAMM,IAAS,MAAMN,EAAW,QAAQ,SAAA;AACxC,QAAKM,MAELV,EAAQW,EAAgB,8BAA8B;AAAA,UACpD,wBAAwBD,EAAO;AAAA,QAAA,CAChC,GACDV,EAAQW,EAAgB,yBAAyB;AAAA,MACnD;AAAA,MAMI,SAAS,gBAAAjB,EAACkB,GAAA,EAAe,WAAWR,EAAW,OAAO,WAAW;AAAA,MACjE,WAAAN;AAAA,MACA,YAAYQ;AAAA,IAAA;AAAA,EAAA;AAGlB;AAEA,SAASM,EAAe,EAAE,WAAAC,KAAqC;AAC7D,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,SACE,gBAAAvB,EAACwB,GAAA,EACC,UAAA,gBAAAxB,EAACsB,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWH,GACzC,UAAAC,EAAE,WAAW,GAChB,GACF;AAEJ;"}
|
|
@@ -4,12 +4,11 @@ import { useTranslation as i } from "react-i18next";
|
|
|
4
4
|
import T from "classnames";
|
|
5
5
|
import C from "./EmployeeStateTaxesView.module.scss.js";
|
|
6
6
|
import { BaseLayout as S } from "../../../Base/Base.js";
|
|
7
|
-
import "../../../Base/useBase.js";
|
|
8
7
|
import { Form as w } from "../../../Common/Form/Form.js";
|
|
9
8
|
import { SDKFormProvider as E } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
10
9
|
import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { useI18n as H, useComponentDictionary as V } from "../../../../i18n/I18n.js";
|
|
12
|
-
function
|
|
11
|
+
function L({
|
|
13
12
|
stateTaxes: o,
|
|
14
13
|
onSubmit: a,
|
|
15
14
|
actions: l,
|
|
@@ -32,6 +31,6 @@ function P({
|
|
|
32
31
|
] }) }) }) });
|
|
33
32
|
}
|
|
34
33
|
export {
|
|
35
|
-
|
|
34
|
+
L as EmployeeStateTaxesView
|
|
36
35
|
};
|
|
37
36
|
//# sourceMappingURL=EmployeeStateTaxesView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmployeeStateTaxesView.js","sources":["../../../../../src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { type useEmployeeStateTaxesForm } from './useEmployeeStateTaxesForm'\nimport styles from './EmployeeStateTaxesView.module.scss'\nimport { BaseLayout } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\ntype ReadyEmployeeStateTaxesForm = Extract<\n ReturnType<typeof useEmployeeStateTaxesForm>,\n { isLoading: false }\n>\n\n/**\n * Override surface for {@link EmployeeStateTaxesView}'s default copy. Each\n * consuming flow (onboarding, management) builds a resolved dictionary from\n * its own translation namespace via a dedicated `use*StateTaxesViewDictionary`\n * hook and passes it here, so partner overrides on the flow's namespace flow\n * into the shared view text at render time.\n *\n * The underlying `Employee.StateTaxesView` namespace is an implementation\n * detail of the shared view — consumers shouldn't reference it directly.\n *\n * @internal\n */\nexport type StateTaxesViewDictionary = ResourceDictionary<'Employee.StateTaxesView'>\n\n/** @internal */\nexport interface EmployeeStateTaxesViewProps {\n stateTaxes: ReadyEmployeeStateTaxesForm\n onSubmit: () => void | Promise<void>\n actions: ReactNode\n alert?: ReactNode\n className?: string\n /**\n * Per-flow translation override for this shared view. Consumers build the\n * value inside a flow-local `use*StateTaxesViewDictionary` hook that\n * resolves the view's keys against the flow's own namespace, so partner\n * overrides on the flow's `dictionary` prop propagate into the view.\n */\n dictionary?: StateTaxesViewDictionary\n}\n\n/** @internal */\nexport function EmployeeStateTaxesView({\n stateTaxes,\n onSubmit,\n actions,\n alert,\n className,\n dictionary,\n}: EmployeeStateTaxesViewProps) {\n useI18n('Employee.StateTaxesView')\n useComponentDictionary('Employee.StateTaxesView', dictionary)\n\n const { t } = useTranslation('Employee.StateTaxesView')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n const groups = stateTaxes.form.Fields\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={stateTaxes.errorHandling.errors}>\n <SDKFormProvider formHookResult={stateTaxes}>\n <Form onSubmit={onSubmit}>\n {alert}\n\n {groups.length === 0 ? (\n <Components.Text>{t('noWithholding')}</Components.Text>\n ) : (\n groups.map(group => {\n const stateName = tCommon(`statesHash.${group.state}`, group.state)\n return (\n <Fragment key={group.state}>\n <Components.Heading as=\"h2\">\n {t('stateTaxesTitle', { state: stateName })}\n </Components.Heading>\n\n {group.questions.map(({ questionId, Field }) => {\n return <Field key={questionId} />\n })}\n </Fragment>\n )\n })\n )}\n\n {actions}\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EmployeeStateTaxesView","stateTaxes","onSubmit","actions","alert","className","dictionary","useI18n","useComponentDictionary","t","useTranslation","tCommon","Components","useComponentContext","groups","jsx","classNames","styles","BaseLayout","SDKFormProvider","jsxs","Form","group","stateName","Fragment","questionId","Field"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmployeeStateTaxesView.js","sources":["../../../../../src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { type useEmployeeStateTaxesForm } from './useEmployeeStateTaxesForm'\nimport styles from './EmployeeStateTaxesView.module.scss'\nimport { BaseLayout } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\ntype ReadyEmployeeStateTaxesForm = Extract<\n ReturnType<typeof useEmployeeStateTaxesForm>,\n { isLoading: false }\n>\n\n/**\n * Override surface for {@link EmployeeStateTaxesView}'s default copy. Each\n * consuming flow (onboarding, management) builds a resolved dictionary from\n * its own translation namespace via a dedicated `use*StateTaxesViewDictionary`\n * hook and passes it here, so partner overrides on the flow's namespace flow\n * into the shared view text at render time.\n *\n * The underlying `Employee.StateTaxesView` namespace is an implementation\n * detail of the shared view — consumers shouldn't reference it directly.\n *\n * @internal\n */\nexport type StateTaxesViewDictionary = ResourceDictionary<'Employee.StateTaxesView'>\n\n/** @internal */\nexport interface EmployeeStateTaxesViewProps {\n stateTaxes: ReadyEmployeeStateTaxesForm\n onSubmit: () => void | Promise<void>\n actions: ReactNode\n alert?: ReactNode\n className?: string\n /**\n * Per-flow translation override for this shared view. Consumers build the\n * value inside a flow-local `use*StateTaxesViewDictionary` hook that\n * resolves the view's keys against the flow's own namespace, so partner\n * overrides on the flow's `dictionary` prop propagate into the view.\n */\n dictionary?: StateTaxesViewDictionary\n}\n\n/** @internal */\nexport function EmployeeStateTaxesView({\n stateTaxes,\n onSubmit,\n actions,\n alert,\n className,\n dictionary,\n}: EmployeeStateTaxesViewProps) {\n useI18n('Employee.StateTaxesView')\n useComponentDictionary('Employee.StateTaxesView', dictionary)\n\n const { t } = useTranslation('Employee.StateTaxesView')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n const groups = stateTaxes.form.Fields\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={stateTaxes.errorHandling.errors}>\n <SDKFormProvider formHookResult={stateTaxes}>\n <Form onSubmit={onSubmit}>\n {alert}\n\n {groups.length === 0 ? (\n <Components.Text>{t('noWithholding')}</Components.Text>\n ) : (\n groups.map(group => {\n const stateName = tCommon(`statesHash.${group.state}`, group.state)\n return (\n <Fragment key={group.state}>\n <Components.Heading as=\"h2\">\n {t('stateTaxesTitle', { state: stateName })}\n </Components.Heading>\n\n {group.questions.map(({ questionId, Field }) => {\n return <Field key={questionId} />\n })}\n </Fragment>\n )\n })\n )}\n\n {actions}\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EmployeeStateTaxesView","stateTaxes","onSubmit","actions","alert","className","dictionary","useI18n","useComponentDictionary","t","useTranslation","tCommon","Components","useComponentContext","groups","jsx","classNames","styles","BaseLayout","SDKFormProvider","jsxs","Form","group","stateName","Fragment","questionId","Field"],"mappings":";;;;;;;;;;AAgDO,SAASA,EAAuB;AAAA,EACrC,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AACF,GAAgC;AAC9B,EAAAC,EAAQ,yBAAyB,GACjCC,EAAuB,2BAA2BF,CAAU;AAE5D,QAAM,EAAE,GAAAG,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,GAAGC,MAAYD,EAAe,QAAQ,GACxCE,IAAaC,EAAA,GACbC,IAASb,EAAW,KAAK;AAE/B,SACE,gBAAAc,EAAC,aAAQ,WAAWC,EAAWC,EAAO,WAAWZ,CAAS,GACxD,UAAA,gBAAAU,EAACG,GAAA,EAAW,OAAOjB,EAAW,cAAc,QAC1C,UAAA,gBAAAc,EAACI,GAAA,EAAgB,gBAAgBlB,GAC/B,UAAA,gBAAAmB,EAACC,KAAK,UAAAnB,GACH,UAAA;AAAA,IAAAE;AAAA,IAEAU,EAAO,WAAW,IACjB,gBAAAC,EAACH,EAAW,MAAX,EAAiB,UAAAH,EAAE,eAAe,EAAA,CAAE,IAErCK,EAAO,IAAI,CAAAQ,MAAS;AAClB,YAAMC,IAAYZ,EAAQ,cAAcW,EAAM,KAAK,IAAIA,EAAM,KAAK;AAClE,+BACGE,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACH,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAH,EAAE,mBAAmB,EAAE,OAAOc,EAAA,CAAW,EAAA,CAC5C;AAAA,QAECD,EAAM,UAAU,IAAI,CAAC,EAAE,YAAAG,GAAY,OAAAC,QAC3B,gBAAAX,EAACW,OAAWD,CAAY,CAChC;AAAA,MAAA,EAAA,GAPYH,EAAM,KAQrB;AAAA,IAEJ,CAAC;AAAA,IAGFnB;AAAA,EAAA,GACH,EAAA,CACF,GACF,GACF;AAEJ;"}
|
package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
3
|
import { EmployeeStateTaxesErrorCodes as s } from "./employeeStateTaxesSchema.js";
|
|
4
|
-
import {
|
|
4
|
+
import { TextInputHookField as d } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
5
|
+
import { SelectHookField as c } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
5
6
|
import { NumberInputHookField as r } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
6
|
-
import {
|
|
7
|
-
import { RadioGroupHookField as
|
|
8
|
-
import { SelectHookField as u } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
7
|
+
import { DatePickerHookField as m } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
|
|
8
|
+
import { RadioGroupHookField as u } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
9
9
|
function f() {
|
|
10
10
|
const { t: o } = l("Employee.StateTaxesView");
|
|
11
11
|
return { [s.REQUIRED]: o("validations.required") };
|
|
@@ -26,21 +26,21 @@ function h({ meta: o, ...e }) {
|
|
|
26
26
|
placeholder: e.placeholder,
|
|
27
27
|
FieldComponent: e.FieldComponent
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ i(
|
|
29
|
+
return /* @__PURE__ */ i(c, { ...t });
|
|
30
30
|
}
|
|
31
31
|
function P({ meta: o, ...e }) {
|
|
32
32
|
const t = {
|
|
33
33
|
...a(o, e),
|
|
34
34
|
FieldComponent: e.FieldComponent
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */ i(
|
|
36
|
+
return /* @__PURE__ */ i(u, { ...t });
|
|
37
37
|
}
|
|
38
38
|
function H({ meta: o, ...e }) {
|
|
39
39
|
const t = {
|
|
40
40
|
...a(o, e),
|
|
41
41
|
placeholder: e.placeholder
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ i(
|
|
43
|
+
return /* @__PURE__ */ i(d, { ...t });
|
|
44
44
|
}
|
|
45
45
|
function R({ meta: o, ...e }) {
|
|
46
46
|
const t = {
|
|
@@ -63,7 +63,7 @@ function D({ meta: o, ...e }) {
|
|
|
63
63
|
...a(o, e),
|
|
64
64
|
FieldComponent: e.FieldComponent
|
|
65
65
|
};
|
|
66
|
-
return /* @__PURE__ */ i(
|
|
66
|
+
return /* @__PURE__ */ i(m, { ...t });
|
|
67
67
|
}
|
|
68
68
|
export {
|
|
69
69
|
v as CurrencyStateTaxField,
|
package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js
CHANGED
|
@@ -5,12 +5,12 @@ import { useForm as D, FormProvider as g } from "react-hook-form";
|
|
|
5
5
|
import { zodResolver as E } from "@hookform/resolvers/zod";
|
|
6
6
|
import { Flex as a } from "../../../Common/Flex/Flex.js";
|
|
7
7
|
import { ActionsLayout as R } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
8
|
-
import {
|
|
8
|
+
import { DatePickerField as x } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
9
|
+
import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
10
|
import "react";
|
|
10
|
-
import { Form as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { RadioGroupField as
|
|
13
|
-
import { DatePickerField as T } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
11
|
+
import { Form as W } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { useI18n as q } from "../../../../i18n/I18n.js";
|
|
13
|
+
import { RadioGroupField as T } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
14
14
|
const k = t.object({
|
|
15
15
|
lastDayOfWork: t.date({ error: "validation.lastDayRequired" }),
|
|
16
16
|
payrollOption: t.enum(["dismissalPayroll", "regularPayroll", "anotherWay"], {
|
|
@@ -24,8 +24,8 @@ function J({
|
|
|
24
24
|
onCancel: y,
|
|
25
25
|
isLoading: s
|
|
26
26
|
}) {
|
|
27
|
-
const { Alert: u, Heading: f, Text: p, Button: m } =
|
|
28
|
-
|
|
27
|
+
const { Alert: u, Heading: f, Text: p, Button: m } = F();
|
|
28
|
+
q("Employee.Terminations.TerminateEmployee");
|
|
29
29
|
const { t: o } = v("Employee.Terminations.TerminateEmployee"), O = (P) => P.runTerminationPayroll === !0 ? "dismissalPayroll" : "regularPayroll", h = {
|
|
30
30
|
lastDayOfWork: l?.effectiveDate ? new Date(l.effectiveDate) : void 0,
|
|
31
31
|
payrollOption: l ? O(l) : "dismissalPayroll"
|
|
@@ -49,14 +49,14 @@ function J({
|
|
|
49
49
|
description: o("form.payrollOption.options.anotherWay.description")
|
|
50
50
|
}
|
|
51
51
|
];
|
|
52
|
-
return /* @__PURE__ */ r(g, { ...i, children: /* @__PURE__ */ r(
|
|
52
|
+
return /* @__PURE__ */ r(g, { ...i, children: /* @__PURE__ */ r(W, { onSubmit: i.handleSubmit(d), children: /* @__PURE__ */ e(a, { flexDirection: "column", gap: 24, children: [
|
|
53
53
|
/* @__PURE__ */ e(a, { flexDirection: "column", gap: 4, children: [
|
|
54
54
|
/* @__PURE__ */ r(f, { as: "h2", children: o("title", { employeeName: n }) }),
|
|
55
55
|
/* @__PURE__ */ r(p, { variant: "supporting", children: o("subtitle") })
|
|
56
56
|
] }),
|
|
57
57
|
/* @__PURE__ */ e(a, { flexDirection: "column", gap: 24, children: [
|
|
58
58
|
/* @__PURE__ */ r(
|
|
59
|
-
|
|
59
|
+
x,
|
|
60
60
|
{
|
|
61
61
|
name: "lastDayOfWork",
|
|
62
62
|
label: o("form.lastDayOfEmployment.label"),
|
|
@@ -66,7 +66,7 @@ function J({
|
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
68
|
/* @__PURE__ */ r(
|
|
69
|
-
|
|
69
|
+
T,
|
|
70
70
|
{
|
|
71
71
|
name: "payrollOption",
|
|
72
72
|
label: o("form.payrollOption.label"),
|
|
@@ -2,24 +2,23 @@ import { jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { createMachine as t } from "robot3";
|
|
3
3
|
import { useMemo as s } from "react";
|
|
4
4
|
import { WorkAddressCardContextual as a } from "./WorkAddressComponents.js";
|
|
5
|
-
import { workAddressStateMachine as
|
|
6
|
-
import { Flow as
|
|
5
|
+
import { workAddressStateMachine as d } from "./workAddressStateMachine.js";
|
|
6
|
+
import { Flow as i } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as p } from "../../../Base/Base.js";
|
|
8
|
-
import "../../../Base/useBase.js";
|
|
9
8
|
import { useComponentDictionary as c, useI18n as f } from "../../../../i18n/I18n.js";
|
|
10
9
|
function u({ employeeId: o, onEvent: r }) {
|
|
11
10
|
f("Employee.Management.WorkAddress");
|
|
12
11
|
const e = s(
|
|
13
|
-
() => t("card",
|
|
12
|
+
() => t("card", d, (n) => ({
|
|
14
13
|
...n,
|
|
15
14
|
component: a,
|
|
16
15
|
employeeId: o
|
|
17
16
|
})),
|
|
18
17
|
[o]
|
|
19
18
|
);
|
|
20
|
-
return /* @__PURE__ */ m(
|
|
19
|
+
return /* @__PURE__ */ m(i, { machine: e, onEvent: r });
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function x({
|
|
23
22
|
dictionary: o,
|
|
24
23
|
FallbackComponent: r,
|
|
25
24
|
...e
|
|
@@ -34,6 +33,6 @@ function y({
|
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
x as WorkAddress
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=WorkAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddress.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n WorkAddressCardContextual,\n type WorkAddressContextInterface,\n} from './WorkAddressComponents'\nimport { workAddressStateMachine } from './workAddressStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link WorkAddress}.\n *\n * @public\n */\nexport interface WorkAddressProps extends CommonComponentInterface<'Employee.Management.WorkAddress'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction WorkAddressFlow({ employeeId, onEvent }: WorkAddressProps) {\n useI18n('Employee.Management.WorkAddress')\n\n const machine = useMemo(\n () =>\n createMachine('card', workAddressStateMachine, (ctx: WorkAddressContextInterface) => ({\n ...ctx,\n component: WorkAddressCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee work address management flow.\n *\n * @remarks\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/workAddress/editRequested` | Manage button on the work address card clicked | `{ employeeId: string }` |\n * | `employee/management/workAddress/editCancelled` | User backed out of the edit form | — |\n * | `employee/management/workAddress/created` | A new work address was created | {@link EmployeeWorkAddress} |\n * | `employee/management/workAddress/updated` | An existing work address was updated | {@link EmployeeWorkAddress} |\n * | `employee/management/workAddress/deleted` | A work address was deleted | {@link EmployeeWorkAddress} |\n *\n * @public\n */\nexport function WorkAddress({\n dictionary,\n FallbackComponent,\n ...props\n}: WorkAddressProps & BaseComponentInterface<'Employee.Management.WorkAddress'>) {\n useComponentDictionary('Employee.Management.WorkAddress', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.WorkAddress\"\n FallbackComponent={FallbackComponent}\n >\n <WorkAddressFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","workAddressStateMachine","ctx","WorkAddressCardContextual","jsx","Flow","WorkAddress","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkAddress.js","sources":["../../../../../src/components/Employee/WorkAddress/management/WorkAddress.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport {\n WorkAddressCardContextual,\n type WorkAddressContextInterface,\n} from './WorkAddressComponents'\nimport { workAddressStateMachine } from './workAddressStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link WorkAddress}.\n *\n * @public\n */\nexport interface WorkAddressProps extends CommonComponentInterface<'Employee.Management.WorkAddress'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction WorkAddressFlow({ employeeId, onEvent }: WorkAddressProps) {\n useI18n('Employee.Management.WorkAddress')\n\n const machine = useMemo(\n () =>\n createMachine('card', workAddressStateMachine, (ctx: WorkAddressContextInterface) => ({\n ...ctx,\n component: WorkAddressCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee work address management flow.\n *\n * @remarks\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/workAddress/editRequested` | Manage button on the work address card clicked | `{ employeeId: string }` |\n * | `employee/management/workAddress/editCancelled` | User backed out of the edit form | — |\n * | `employee/management/workAddress/created` | A new work address was created | {@link EmployeeWorkAddress} |\n * | `employee/management/workAddress/updated` | An existing work address was updated | {@link EmployeeWorkAddress} |\n * | `employee/management/workAddress/deleted` | A work address was deleted | {@link EmployeeWorkAddress} |\n *\n * @public\n */\nexport function WorkAddress({\n dictionary,\n FallbackComponent,\n ...props\n}: WorkAddressProps & BaseComponentInterface<'Employee.Management.WorkAddress'>) {\n useComponentDictionary('Employee.Management.WorkAddress', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.WorkAddress\"\n FallbackComponent={FallbackComponent}\n >\n <WorkAddressFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["WorkAddressFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","workAddressStateMachine","ctx","WorkAddressCardContextual","jsx","Flow","WorkAddress","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;AA8BA,SAASA,EAAgB,EAAE,YAAAC,GAAY,SAAAC,KAA6B;AAClE,EAAAC,EAAQ,iCAAiC;AAEzC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAyB,CAACC,OAAsC;AAAA,MACpF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IAAA,EACA;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAgBO,SAASU,EAAY;AAAA,EAC1B,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAAiF;AAC/E,SAAAC,EAAuB,mCAAmCH,CAAU,GAElE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAiB,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGlC;"}
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js
CHANGED
|
@@ -3,7 +3,6 @@ import { useTranslation as b } from "react-i18next";
|
|
|
3
3
|
import { useInformationRequestsGetInformationRequestsSuspense as P } from "@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsGetInformationRequests";
|
|
4
4
|
import { InformationRequestStatus as r, InformationRequestType as i } from "@gusto/embedded-api-v-2025-11-15/models/components/informationrequest";
|
|
5
5
|
import { BaseComponent as w } from "../../Base/Base.js";
|
|
6
|
-
import "../../Base/useBase.js";
|
|
7
6
|
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
7
|
import { useComponentDictionary as S, useI18n as T } from "../../../i18n/I18n.js";
|
|
9
8
|
import { DataView as D } from "../../Common/DataView/DataView.js";
|
|
@@ -12,12 +11,12 @@ import { FlexItem as E, Flex as u } from "../../Common/Flex/Flex.js";
|
|
|
12
11
|
import { EmptyData as v } from "../../Common/EmptyData/EmptyData.js";
|
|
13
12
|
import "react";
|
|
14
13
|
import { informationRequestEvents as B } from "../../../shared/constants.js";
|
|
15
|
-
function
|
|
14
|
+
function J(o) {
|
|
16
15
|
return /* @__PURE__ */ n(w, { ...o, children: /* @__PURE__ */ n(C, { ...o, children: o.children }) });
|
|
17
16
|
}
|
|
18
17
|
function C({ companyId: o, dictionary: d, onEvent: f }) {
|
|
19
18
|
S("InformationRequests.InformationRequestList", d), T("InformationRequests.InformationRequestList");
|
|
20
|
-
const { t } = b("InformationRequests.InformationRequestList"), { Heading: y, Text:
|
|
19
|
+
const { t } = b("InformationRequests.InformationRequestList"), { Heading: y, Text: l, Button: R, Badge: m } = x(), { data: g } = P({
|
|
21
20
|
companyUuid: o
|
|
22
21
|
}), c = (g.informationRequests ?? []).filter(
|
|
23
22
|
(e) => e.status !== r.Approved
|
|
@@ -50,7 +49,7 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
|
|
|
50
49
|
{
|
|
51
50
|
key: "type",
|
|
52
51
|
title: t("columns.type"),
|
|
53
|
-
render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(
|
|
52
|
+
render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(l, { weight: "medium", children: h(e.type) }) })
|
|
54
53
|
},
|
|
55
54
|
{
|
|
56
55
|
key: "status",
|
|
@@ -58,8 +57,8 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
|
|
|
58
57
|
render: (e) => {
|
|
59
58
|
const s = q(e.status), p = e.blockingPayroll;
|
|
60
59
|
return !s && !p ? null : /* @__PURE__ */ a(u, { gap: 8, alignItems: "center", children: [
|
|
61
|
-
s && /* @__PURE__ */ n(
|
|
62
|
-
p && /* @__PURE__ */ n(
|
|
60
|
+
s && /* @__PURE__ */ n(m, { status: s.badgeStatus, children: s.label }),
|
|
61
|
+
p && /* @__PURE__ */ n(m, { status: "error", children: t("status.payrollBlocking") })
|
|
63
62
|
] });
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -80,12 +79,12 @@ function C({ companyId: o, dictionary: d, onEvent: f }) {
|
|
|
80
79
|
return /* @__PURE__ */ a(u, { flexDirection: "column", gap: 20, children: [
|
|
81
80
|
/* @__PURE__ */ a(u, { flexDirection: "column", gap: 2, children: [
|
|
82
81
|
/* @__PURE__ */ n(y, { as: "h2", styledAs: "h4", children: t("title") }),
|
|
83
|
-
c.length > 0 && /* @__PURE__ */ n(
|
|
82
|
+
c.length > 0 && /* @__PURE__ */ n(l, { children: t("description") })
|
|
84
83
|
] }),
|
|
85
84
|
/* @__PURE__ */ n(D, { ...I, label: t("title") })
|
|
86
85
|
] });
|
|
87
86
|
}
|
|
88
87
|
export {
|
|
89
|
-
|
|
88
|
+
J as InformationRequestList
|
|
90
89
|
};
|
|
91
90
|
//# sourceMappingURL=InformationRequestList.js.map
|
package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { EmptyData, Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequests = data.informationRequests ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')} />\n ),\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n {visibleRequests.length > 0 && <Text>{t('description')}</Text>}\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","useInformationRequestsGetInformationRequestsSuspense","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","EmptyData","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;AAqBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,KAAwC;AAC7E,EAAAC,EAAuB,8CAA8CF,CAAU,GAC/EG,EAAQ,4CAA4C;AACpD,QAAM,EAAE,EAAA,IAAMC,EAAe,4CAA4C,GACnE,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,EAAA,IAAUC,EAAA,GAEnC,EAAE,MAAAC,EAAA,IAASC,EAAqD;AAAA,IACpE,aAAaZ;AAAA,EAAA,CACd,GAIKa,KAFsBF,EAAK,uBAAuB,CAAA,GAEZ;AAAA,IAC1C,CAAAG,MAAWA,EAAQ,WAAWC,EAAyB;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAA6C;AACjE,YAAQA,GAAA;AAAA,MACN,KAAKC,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,yBAAyB;AAAA,MACpC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,sBAAsB;AAAA,MACjC,KAAKA,EAAuB;AAC1B,eAAO,EAAE,oBAAoB;AAAA,MAC/B;AACE,eAAO,EAAE,eAAe;AAAA,IAAA;AAAA,EAE9B,GAEMC,IAAmB,CAACC,MAAwD;AAChF,YAAQA,GAAA;AAAA,MACN,KAAKL,EAAyB;AAC5B,eAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,aAAa,OAAA;AAAA,MACvD,KAAKA,EAAyB;AAC5B,eAAO,EAAE,OAAO,EAAE,oBAAoB,GAAG,aAAa,UAAA;AAAA,MACxD;AACE,eAAO;AAAA,IAAA;AAAA,EAEb,GAEMM,IAAgBC,EAAY;AAAA,IAChC,MAAMT;AAAA,IACN,YAAY,MACV,gBAAAhB,EAAC0B,GAAA,EAAU,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE,uBAAuB,EAAA,CAAG;AAAA,IAEnF,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,cAAc;AAAA,QACvB,QAAQ,CAAAT,MACN,gBAAAjB,EAAC2B,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAA3B,EAACU,GAAA,EAAK,QAAO,UAAU,UAAAS,EAAaF,EAAQ,IAAI,GAAE,EAAA,CACpD;AAAA,MAAA;AAAA,MAGJ;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAAA,MAAW;AACjB,gBAAMW,IAAgBN,EAAiBL,EAAQ,MAAM,GAC/CY,IAA2BZ,EAAQ;AAEzC,iBAAI,CAACW,KAAiB,CAACC,IACd,OAIP,gBAAAC,EAACC,GAAA,EAAK,KAAK,GAAG,YAAW,UACtB,UAAA;AAAA,YAAAH,uBACEhB,GAAA,EAAM,QAAQgB,EAAc,aAAc,YAAc,OAAM;AAAA,YAEhEC,KACC,gBAAA7B,EAACY,GAAA,EAAM,QAAO,SAAS,UAAA,EAAE,wBAAwB,EAAA,CAAE;AAAA,UAAA,GAEvD;AAAA,QAEJ;AAAA,MAAA;AAAA,IACF;AAAA,IAEF,UAAU,CAAAK,MACkBA,EAAQ,WAAWC,EAAyB,kBAKpE,gBAAAlB;AAAA,MAACW;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAN,EAAQ2B,EAAyB,6BAA6B;AAAA,YAC5D,WAAWf,EAAQ;AAAA,UAAA,CACpB;AAAA,QACH;AAAA,QAEC,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA,IAXX;AAAA,EAcX,CACD;AAED,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAA/B,EAACS,KAAQ,IAAG,MAAK,UAAS,MACvB,UAAA,EAAE,OAAO,GACZ;AAAA,MACCO,EAAgB,SAAS,uBAAMN,GAAA,EAAM,UAAA,EAAE,aAAa,EAAA,CAAE;AAAA,IAAA,GACzD;AAAA,sBAECuB,GAAA,EAAU,GAAGT,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import { createMachine as b } from "robot3";
|
|
3
3
|
import { useMachine as L } from "react-robot";
|
|
4
|
-
import { useState as R, useCallback as
|
|
4
|
+
import { useState as R, useCallback as E, useMemo as Q, Suspense as p } from "react";
|
|
5
5
|
import { useTranslation as U } from "react-i18next";
|
|
6
6
|
import { informationRequestsMachine as k } from "./informationRequestsStateMachine.js";
|
|
7
7
|
import { BaseBoundaries as P } from "../Base/Base.js";
|
|
8
|
-
import "../Base/useBase.js";
|
|
9
8
|
import { Flex as g } from "../Common/Flex/Flex.js";
|
|
10
9
|
import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
10
|
import { FlowContext as B } from "../Flow/useFlow.js";
|
|
@@ -13,7 +12,7 @@ import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
|
|
|
13
12
|
import { informationRequestEvents as s } from "../../shared/constants.js";
|
|
14
13
|
import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
|
|
15
14
|
const I = "informationRequestResponded";
|
|
16
|
-
function
|
|
15
|
+
function ne({
|
|
17
16
|
companyId: r,
|
|
18
17
|
dictionary: O,
|
|
19
18
|
withAlert: a = !0,
|
|
@@ -24,12 +23,12 @@ function se({
|
|
|
24
23
|
const { t: m } = U("InformationRequests"), { Modal: h, LoadingSpinner: c, Alert: x, Text: A } = j(), [F, i] = R(!1), [N, f] = R({
|
|
25
24
|
nextAlertId: 0,
|
|
26
25
|
alerts: []
|
|
27
|
-
}), T =
|
|
26
|
+
}), T = E((e) => {
|
|
28
27
|
f((o) => ({
|
|
29
28
|
...o,
|
|
30
29
|
alerts: o.alerts.filter((D) => D.id !== e)
|
|
31
30
|
}));
|
|
32
|
-
}, []), _ =
|
|
31
|
+
}, []), _ = E(() => {
|
|
33
32
|
f((e) => ({
|
|
34
33
|
nextAlertId: e.nextAlertId + 1,
|
|
35
34
|
alerts: [{ id: e.nextAlertId }, ...e.alerts]
|
|
@@ -72,13 +71,13 @@ function se({
|
|
|
72
71
|
},
|
|
73
72
|
e.id
|
|
74
73
|
)),
|
|
75
|
-
/* @__PURE__ */ t(
|
|
74
|
+
/* @__PURE__ */ t(p, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
|
|
76
75
|
/* @__PURE__ */ t(
|
|
77
76
|
h,
|
|
78
77
|
{
|
|
79
78
|
isOpen: F,
|
|
80
79
|
onClose: q,
|
|
81
|
-
footer: d && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(
|
|
80
|
+
footer: d && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(p, { fallback: /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }) }),
|
|
82
81
|
children: l && /* @__PURE__ */ t(l, {})
|
|
83
82
|
}
|
|
84
83
|
)
|
|
@@ -87,6 +86,6 @@ function se({
|
|
|
87
86
|
);
|
|
88
87
|
}
|
|
89
88
|
export {
|
|
90
|
-
|
|
89
|
+
ne as InformationRequestsFlow
|
|
91
90
|
};
|
|
92
91
|
//# sourceMappingURL=InformationRequests.js.map
|