@gusto/embedded-react-sdk 0.45.0 → 0.46.2
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 +64 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +51 -50
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +1 -0
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +8 -1
- package/dist/components/Common/DataView/useDataView.js +20 -17
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +23 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +20 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +22 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +85 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +6 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +212 -187
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +86 -68
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +8 -4
- package/dist/components/Employee/Dashboard/DashboardComponents.js +147 -93
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +304 -264
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +10 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
- package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +152 -142
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +53 -55
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +20 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
- package/dist/components/Employee/exports/employeeManagement.js +18 -16
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/index.d.ts +2 -0
- package/dist/components/Employee/index.js +32 -30
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/FlowHeader.js +34 -31
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +12 -0
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +68 -56
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +21 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +4 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +20 -18
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +45 -11
- package/docs/reference/endpoint-inventory.json +24 -8
- package/package.json +1 -1
|
@@ -1,137 +1,191 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { Dashboard as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsxs as f, Fragment as E, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as p } from "react-i18next";
|
|
3
|
+
import { Dashboard as I } from "./Dashboard.js";
|
|
4
|
+
import { getPendingCompensationChanges as y } from "./getPendingCompensationChanges.js";
|
|
5
|
+
import { HomeAddress as b } from "../HomeAddress/management/HomeAddress.js";
|
|
6
|
+
import { WorkAddress as A } from "../WorkAddress/management/WorkAddress.js";
|
|
7
|
+
import { FederalTaxes as D } from "../FederalTaxes/management/FederalTaxes.js";
|
|
7
8
|
import { StateTaxes as x } from "../StateTaxes/management/StateTaxes.js";
|
|
8
|
-
import { Profile as
|
|
9
|
+
import { Profile as g } from "../Profile/management/Profile.js";
|
|
9
10
|
import { BankForm as v } from "../PaymentMethod/onboarding/BankForm.js";
|
|
10
|
-
import { SplitView as
|
|
11
|
-
import { DocumentManager as
|
|
12
|
-
import { DeductionsForm as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { SplitView as h } from "../PaymentMethod/onboarding/SplitView.js";
|
|
12
|
+
import { DocumentManager as L } from "../Documents/management/DocumentManager.js";
|
|
13
|
+
import { DeductionsForm as P } from "../Deductions/DeductionsForm/DeductionsForm.js";
|
|
14
|
+
import { EditPendingCompensation as T } from "../Compensation/management/EditPendingCompensation/EditPendingCompensation.js";
|
|
15
|
+
import { AddAnotherJob as F } from "../Compensation/management/AddAnotherJob/AddAnotherJob.js";
|
|
16
|
+
import { useDeductionsList as w } from "../Deductions/shared/useDeductionsList.js";
|
|
17
|
+
import { EditCompensation as N } from "../Compensation/onboarding/EditCompensation/EditCompensation.js";
|
|
18
|
+
import { useFlow as d } from "../../Flow/useFlow.js";
|
|
19
|
+
import { useComponentContext as S } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
20
|
+
import { BaseComponent as c, BaseLayout as u } from "../../Base/Base.js";
|
|
17
21
|
import "../../Base/useBase.js";
|
|
18
|
-
import { ensureRequired as
|
|
19
|
-
import { useI18n as
|
|
20
|
-
import { componentEvents as
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
import { ensureRequired as t } from "../../../helpers/ensureRequired.js";
|
|
23
|
+
import { useI18n as C } from "../../../i18n/I18n.js";
|
|
24
|
+
import { componentEvents as m } from "../../../shared/constants.js";
|
|
25
|
+
import { EditCompensation as k } from "../Compensation/management/EditCompensation/EditCompensation.js";
|
|
26
|
+
function de() {
|
|
27
|
+
C("Employee.Dashboard");
|
|
28
|
+
const { t: e } = p("Employee.Dashboard"), { employeeId: o, onEvent: r, successAlert: i, selectedTab: s } = d(), a = S(), l = {
|
|
24
29
|
bankAccountAdded: e("alerts.bankAccountAdded"),
|
|
25
30
|
bankAccountDeleted: e("alerts.bankAccountDeleted"),
|
|
26
31
|
splitUpdated: e("alerts.splitUpdated"),
|
|
27
32
|
deductionAdded: e("alerts.deductionAdded"),
|
|
28
33
|
deductionUpdated: e("alerts.deductionUpdated"),
|
|
29
|
-
deductionDeleted: e("alerts.deductionDeleted")
|
|
34
|
+
deductionDeleted: e("alerts.deductionDeleted"),
|
|
35
|
+
jobAdded: e("alerts.jobAdded")
|
|
30
36
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
return /* @__PURE__ */ f(E, { children: [
|
|
38
|
+
i && /* @__PURE__ */ n(
|
|
39
|
+
a.Alert,
|
|
34
40
|
{
|
|
35
41
|
status: "success",
|
|
36
|
-
label:
|
|
42
|
+
label: l[i],
|
|
37
43
|
onDismiss: () => {
|
|
38
|
-
|
|
44
|
+
r(m.EMPLOYEE_DISMISS, null);
|
|
39
45
|
},
|
|
40
46
|
disableScrollIntoView: !0
|
|
41
47
|
}
|
|
42
48
|
),
|
|
43
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ n(
|
|
50
|
+
I,
|
|
51
|
+
{
|
|
52
|
+
employeeId: t(o),
|
|
53
|
+
onEvent: r,
|
|
54
|
+
selectedTab: s
|
|
55
|
+
}
|
|
56
|
+
)
|
|
44
57
|
] });
|
|
45
58
|
}
|
|
46
|
-
function
|
|
47
|
-
const { employeeId: e, onEvent: o } =
|
|
48
|
-
return /* @__PURE__ */
|
|
59
|
+
function ie() {
|
|
60
|
+
const { employeeId: e, onEvent: o } = d();
|
|
61
|
+
return /* @__PURE__ */ n(b, { employeeId: t(e), onEvent: o });
|
|
49
62
|
}
|
|
50
|
-
function
|
|
51
|
-
const { employeeId: e, onEvent: o } =
|
|
52
|
-
return /* @__PURE__ */
|
|
63
|
+
function me() {
|
|
64
|
+
const { employeeId: e, onEvent: o } = d();
|
|
65
|
+
return /* @__PURE__ */ n(A, { employeeId: t(e), onEvent: o });
|
|
53
66
|
}
|
|
54
|
-
function
|
|
55
|
-
const { employeeId: e, onEvent: o } =
|
|
56
|
-
return /* @__PURE__ */
|
|
67
|
+
function se() {
|
|
68
|
+
const { employeeId: e, onEvent: o } = d();
|
|
69
|
+
return /* @__PURE__ */ n(D, { employeeId: t(e), onEvent: o });
|
|
57
70
|
}
|
|
58
|
-
function
|
|
59
|
-
const { employeeId: e, onEvent: o } =
|
|
60
|
-
return /* @__PURE__ */
|
|
71
|
+
function ae() {
|
|
72
|
+
const { employeeId: e, onEvent: o } = d();
|
|
73
|
+
return /* @__PURE__ */ n(x, { employeeId: t(e), onEvent: o });
|
|
61
74
|
}
|
|
62
|
-
function
|
|
63
|
-
const { employeeId: e, onEvent: o } =
|
|
64
|
-
return /* @__PURE__ */
|
|
75
|
+
function le() {
|
|
76
|
+
const { employeeId: e, onEvent: o } = d();
|
|
77
|
+
return /* @__PURE__ */ n(g, { employeeId: t(e), onEvent: o });
|
|
65
78
|
}
|
|
66
|
-
function
|
|
67
|
-
const { employeeId: e, onEvent: o } =
|
|
68
|
-
return /* @__PURE__ */
|
|
79
|
+
function ue() {
|
|
80
|
+
const { employeeId: e, onEvent: o } = d();
|
|
81
|
+
return /* @__PURE__ */ n(c, { onEvent: o, children: /* @__PURE__ */ n(v, { employeeId: t(e), onEvent: o }) });
|
|
69
82
|
}
|
|
70
|
-
function
|
|
71
|
-
const { employeeId: e, onEvent: o } =
|
|
72
|
-
return /* @__PURE__ */
|
|
83
|
+
function pe() {
|
|
84
|
+
const { employeeId: e, onEvent: o } = d();
|
|
85
|
+
return /* @__PURE__ */ n(c, { onEvent: o, children: /* @__PURE__ */ n(h, { employeeId: t(e), onEvent: o }) });
|
|
73
86
|
}
|
|
74
|
-
function
|
|
75
|
-
const { employeeId: e, formId: o, onEvent:
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
87
|
+
function ce() {
|
|
88
|
+
const { employeeId: e, formId: o, onEvent: r } = d();
|
|
89
|
+
return /* @__PURE__ */ n(
|
|
90
|
+
L,
|
|
78
91
|
{
|
|
79
|
-
employeeId:
|
|
80
|
-
formId:
|
|
81
|
-
onEvent:
|
|
92
|
+
employeeId: t(e),
|
|
93
|
+
formId: t(o),
|
|
94
|
+
onEvent: r
|
|
82
95
|
}
|
|
83
96
|
);
|
|
84
97
|
}
|
|
85
|
-
function
|
|
86
|
-
const { employeeId: e, editingDeductionId: o, onEvent:
|
|
87
|
-
if (
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
98
|
+
function Ce() {
|
|
99
|
+
const { employeeId: e, editingDeductionId: o, onEvent: r } = d(), i = w({ employeeId: t(e) });
|
|
100
|
+
if (i.isLoading)
|
|
101
|
+
return /* @__PURE__ */ n(u, { isLoading: !0, error: i.errorHandling.errors });
|
|
102
|
+
const s = o ? i.data.deductions.find((a) => a.uuid === o) ?? null : null;
|
|
103
|
+
return /* @__PURE__ */ n(u, { error: i.errorHandling.errors, children: /* @__PURE__ */ n(
|
|
104
|
+
P,
|
|
92
105
|
{
|
|
93
|
-
employeeId:
|
|
94
|
-
deduction:
|
|
95
|
-
onSaved: (a,
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
employeeId: t(e),
|
|
107
|
+
deduction: s,
|
|
108
|
+
onSaved: (a, l) => {
|
|
109
|
+
r(
|
|
110
|
+
l === "create" ? m.EMPLOYEE_DEDUCTION_CREATED : m.EMPLOYEE_DEDUCTION_UPDATED,
|
|
98
111
|
a
|
|
99
112
|
);
|
|
100
113
|
},
|
|
101
114
|
onCancel: () => {
|
|
102
|
-
|
|
115
|
+
r(m.CANCEL);
|
|
103
116
|
}
|
|
104
117
|
}
|
|
105
118
|
) });
|
|
106
119
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
const { t: e } =
|
|
110
|
-
return /* @__PURE__ */
|
|
120
|
+
function fe() {
|
|
121
|
+
C("Employee.Dashboard");
|
|
122
|
+
const { t: e } = p("Employee.Dashboard"), { employeeId: o, onEvent: r } = d();
|
|
123
|
+
return /* @__PURE__ */ n(
|
|
124
|
+
N,
|
|
125
|
+
{
|
|
126
|
+
employeeId: t(o),
|
|
127
|
+
title: e("compensationFlow.addJobTitle"),
|
|
128
|
+
submitCtaLabel: e("compensationFlow.saveCta"),
|
|
129
|
+
onEvent: r,
|
|
130
|
+
onCancel: () => {
|
|
131
|
+
r(m.CANCEL);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
);
|
|
111
135
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
136
|
+
function Ee() {
|
|
137
|
+
const { employeeId: e, currentJob: o, onEvent: r } = d(), s = y(o ? [o] : [])[0];
|
|
138
|
+
return s ? /* @__PURE__ */ n(
|
|
139
|
+
T,
|
|
140
|
+
{
|
|
141
|
+
employeeId: t(e),
|
|
142
|
+
jobId: t(o?.uuid),
|
|
143
|
+
compensationId: s.compensationUuid,
|
|
144
|
+
isNewJob: s.isNewJob,
|
|
145
|
+
isPrimaryJob: o?.primary ?? !1,
|
|
146
|
+
onEvent: r,
|
|
147
|
+
onCancel: () => {
|
|
148
|
+
r(m.CANCEL, null);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
) : /* @__PURE__ */ n(
|
|
152
|
+
k,
|
|
153
|
+
{
|
|
154
|
+
employeeId: t(e),
|
|
155
|
+
jobId: t(o?.uuid),
|
|
156
|
+
onEvent: r,
|
|
157
|
+
onCancel: () => {
|
|
158
|
+
r(m.CANCEL, null);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
);
|
|
116
162
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
163
|
+
function Ie() {
|
|
164
|
+
const { employeeId: e, onEvent: o } = d();
|
|
165
|
+
return /* @__PURE__ */ n(
|
|
166
|
+
F,
|
|
167
|
+
{
|
|
168
|
+
employeeId: t(e),
|
|
169
|
+
onEvent: o,
|
|
170
|
+
onCancel: () => {
|
|
171
|
+
o(m.CANCEL);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
);
|
|
121
175
|
}
|
|
122
176
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
177
|
+
Ie as AddAnotherJobContextual,
|
|
178
|
+
fe as AddJobContextual,
|
|
179
|
+
de as DashboardViewContextual,
|
|
180
|
+
Ce as DeductionFormContextual,
|
|
181
|
+
ce as DocumentManagerContextual,
|
|
182
|
+
Ee as EditCompensationContextual,
|
|
183
|
+
se as FederalTaxesContextual,
|
|
184
|
+
ie as HomeAddressContextual,
|
|
185
|
+
ue as PaymentBankFormContextual,
|
|
186
|
+
pe as PaymentSplitViewContextual,
|
|
187
|
+
le as ProfileContextual,
|
|
188
|
+
ae as StateTaxesContextual,
|
|
189
|
+
me as WorkAddressContextual
|
|
136
190
|
};
|
|
137
191
|
//# sourceMappingURL=DashboardComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardComponents.js","sources":["../../../../src/components/Employee/Dashboard/DashboardComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport { Dashboard } from './Dashboard'\nimport { HomeAddress } from '@/components/Employee/HomeAddress/management/HomeAddress'\nimport { WorkAddress } from '@/components/Employee/WorkAddress/management/WorkAddress'\nimport { FederalTaxes } from '@/components/Employee/FederalTaxes/management/FederalTaxes'\nimport { StateTaxes } from '@/components/Employee/StateTaxes/management/StateTaxes'\nimport { Profile } from '@/components/Employee/Profile/management/Profile'\nimport { BankForm } from '@/components/Employee/PaymentMethod/onboarding/BankForm'\nimport { SplitView } from '@/components/Employee/PaymentMethod/onboarding/SplitView'\nimport { DocumentManager } from '@/components/Employee/Documents/management/DocumentManager'\nimport { DeductionsForm } from '@/components/Employee/Deductions/DeductionsForm/DeductionsForm'\nimport { useDeductionsList } from '@/components/Employee/Deductions/shared'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport type DashboardSuccessAlert =\n | 'bankAccountAdded'\n | 'bankAccountDeleted'\n | 'splitUpdated'\n | 'deductionAdded'\n | 'deductionUpdated'\n | 'deductionDeleted'\n\nexport interface DashboardContextInterface extends FlowContextInterface {\n employeeId: string\n formId?: string\n currentJob?: Job | null\n successAlert?: DashboardSuccessAlert | null\n /** Set by the EMPLOYEE_DEDUCTION_EDIT transition; consumed by\n * DeductionFormContextual to pre-populate the form. */\n editingDeductionId?: string\n}\n\nexport function DashboardViewContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const { employeeId, onEvent, successAlert } = useFlow<DashboardContextInterface>()\n const Components = useComponentContext()\n\n const alertLabels: Record<DashboardSuccessAlert, string> = {\n bankAccountAdded: t('alerts.bankAccountAdded'),\n bankAccountDeleted: t('alerts.bankAccountDeleted'),\n splitUpdated: t('alerts.splitUpdated'),\n deductionAdded: t('alerts.deductionAdded'),\n deductionUpdated: t('alerts.deductionUpdated'),\n deductionDeleted: t('alerts.deductionDeleted'),\n }\n\n return (\n <>\n {successAlert && (\n <Components.Alert\n status=\"success\"\n label={alertLabels[successAlert]}\n onDismiss={() => {\n onEvent(componentEvents.EMPLOYEE_DISMISS, null)\n }}\n disableScrollIntoView\n />\n )}\n <Dashboard employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </>\n )\n}\n\nexport function HomeAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <HomeAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function WorkAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <WorkAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function FederalTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <FederalTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function StateTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <StateTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function ProfileContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <Profile employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function PaymentBankFormContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <BankForm employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function PaymentSplitViewContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <SplitView employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function DocumentManagerContextual() {\n const { employeeId, formId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <DocumentManager\n employeeId={ensureRequired(employeeId)}\n formId={ensureRequired(formId)}\n onEvent={onEvent}\n />\n )\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, editingDeductionId, onEvent } = useFlow<DashboardContextInterface>()\n // The same list query the form hooks use internally — React Query dedupes,\n // so this just looks up the loaded row to pre-populate edit mode.\n const list = useDeductionsList({ employeeId: ensureRequired(employeeId) })\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={ensureRequired(employeeId)}\n deduction={deduction}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_DEDUCTION_CREATED\n : componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n </BaseLayout>\n )\n}\n\nexport function AddJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addJobTitle')}</Components.Heading>\n}\n\nexport function EditCompensationPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.editTitle')}</Components.Heading>\n}\n\nexport function AddAnotherJobPlaceholderContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n return <Components.Heading as=\"h2\">{t('compensationFlow.addAnotherJobTitle')}</Components.Heading>\n}\n"],"names":["DashboardViewContextual","useI18n","t","useTranslation","employeeId","onEvent","successAlert","useFlow","Components","useComponentContext","alertLabels","jsxs","Fragment","jsx","componentEvents","Dashboard","ensureRequired","HomeAddressContextual","HomeAddress","WorkAddressContextual","WorkAddress","FederalTaxesContextual","FederalTaxes","StateTaxesContextual","StateTaxes","ProfileContextual","Profile","PaymentBankFormContextual","BaseComponent","BankForm","PaymentSplitViewContextual","SplitView","DocumentManagerContextual","formId","DocumentManager","DeductionFormContextual","editingDeductionId","list","useDeductionsList","BaseLayout","deduction","d","DeductionsForm","saved","mode","AddJobPlaceholderContextual","EditCompensationPlaceholderContextual","AddAnotherJobPlaceholderContextual"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsCO,SAASA,IAA0B;AACxC,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3C,EAAE,YAAAC,GAAY,SAAAC,GAAS,cAAAC,EAAA,IAAiBC,EAAA,GACxCC,IAAaC,EAAA,GAEbC,IAAqD;AAAA,IACzD,kBAAkBR,EAAE,yBAAyB;AAAA,IAC7C,oBAAoBA,EAAE,2BAA2B;AAAA,IACjD,cAAcA,EAAE,qBAAqB;AAAA,IACrC,gBAAgBA,EAAE,uBAAuB;AAAA,IACzC,kBAAkBA,EAAE,yBAAyB;AAAA,IAC7C,kBAAkBA,EAAE,yBAAyB;AAAA,EAAA;AAG/C,SACE,gBAAAS,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAN,KACC,gBAAAO;AAAA,MAACL,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOE,EAAYJ,CAAY;AAAA,QAC/B,WAAW,MAAM;AACf,UAAAD,EAAQS,EAAgB,kBAAkB,IAAI;AAAA,QAChD;AAAA,QACA,uBAAqB;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGxBC,GAAA,EAAU,YAAYC,EAAeZ,CAAU,GAAG,SAAAC,EAAA,CAAkB;AAAA,EAAA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E,8BAA8B,GAAE;AACxE;AAEO,SAAS4C,KAAwC;AACtD,EAAA7C,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CK,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,EAAE,4BAA4B,GAAE;AACtE;AAEO,SAAS6C,KAAqC;AACnD,EAAA9C,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CK,IAAaC,EAAA;AACnB,SAAO,gBAAAI,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,EAAE,qCAAqC,GAAE;AAC/E;"}
|
|
1
|
+
{"version":3,"file":"DashboardComponents.js","sources":["../../../../src/components/Employee/Dashboard/DashboardComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport { Dashboard, type DashboardTab } from './Dashboard'\nimport { getPendingCompensationChanges } from './getPendingCompensationChanges'\nimport { HomeAddress } from '@/components/Employee/HomeAddress/management/HomeAddress'\nimport { WorkAddress } from '@/components/Employee/WorkAddress/management/WorkAddress'\nimport { FederalTaxes } from '@/components/Employee/FederalTaxes/management/FederalTaxes'\nimport { StateTaxes } from '@/components/Employee/StateTaxes/management/StateTaxes'\nimport { Profile } from '@/components/Employee/Profile/management/Profile'\nimport { BankForm } from '@/components/Employee/PaymentMethod/onboarding/BankForm'\nimport { SplitView } from '@/components/Employee/PaymentMethod/onboarding/SplitView'\nimport { DocumentManager } from '@/components/Employee/Documents/management/DocumentManager'\nimport { DeductionsForm } from '@/components/Employee/Deductions/DeductionsForm/DeductionsForm'\nimport {\n ManagementEditCompensation,\n ManagementEditPendingCompensation,\n} from '@/components/Employee/Compensation/management'\nimport { useDeductionsList } from '@/components/Employee/Deductions/shared'\nimport { AddAnotherJob } from '@/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob'\nimport { EditCompensation } from '@/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { BaseComponent, BaseLayout } from '@/components/Base'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport type DashboardSuccessAlert =\n | 'bankAccountAdded'\n | 'bankAccountDeleted'\n | 'splitUpdated'\n | 'deductionAdded'\n | 'deductionUpdated'\n | 'deductionDeleted'\n | 'jobAdded'\n\nexport interface DashboardContextInterface extends FlowContextInterface {\n employeeId: string\n formId?: string\n currentJob?: Job | null\n successAlert?: DashboardSuccessAlert | null\n /** Set by the EMPLOYEE_DEDUCTION_EDIT transition; consumed by\n * DeductionFormContextual to pre-populate the form. */\n editingDeductionId?: string\n /** Persists the active Dashboard tab across sub-flows so Cancel/Back\n * returns to the originating tab instead of resetting to basic details. */\n selectedTab?: DashboardTab\n}\n\nexport function DashboardViewContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const { employeeId, onEvent, successAlert, selectedTab } = useFlow<DashboardContextInterface>()\n const Components = useComponentContext()\n\n const alertLabels: Record<DashboardSuccessAlert, string> = {\n bankAccountAdded: t('alerts.bankAccountAdded'),\n bankAccountDeleted: t('alerts.bankAccountDeleted'),\n splitUpdated: t('alerts.splitUpdated'),\n deductionAdded: t('alerts.deductionAdded'),\n deductionUpdated: t('alerts.deductionUpdated'),\n deductionDeleted: t('alerts.deductionDeleted'),\n jobAdded: t('alerts.jobAdded'),\n }\n\n return (\n <>\n {successAlert && (\n <Components.Alert\n status=\"success\"\n label={alertLabels[successAlert]}\n onDismiss={() => {\n onEvent(componentEvents.EMPLOYEE_DISMISS, null)\n }}\n disableScrollIntoView\n />\n )}\n <Dashboard\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n selectedTab={selectedTab}\n />\n </>\n )\n}\n\nexport function HomeAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <HomeAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function WorkAddressContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <WorkAddress employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function FederalTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <FederalTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function StateTaxesContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <StateTaxes employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function ProfileContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return <Profile employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n}\n\nexport function PaymentBankFormContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <BankForm employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function PaymentSplitViewContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <BaseComponent onEvent={onEvent}>\n <SplitView employeeId={ensureRequired(employeeId)} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nexport function DocumentManagerContextual() {\n const { employeeId, formId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <DocumentManager\n employeeId={ensureRequired(employeeId)}\n formId={ensureRequired(formId)}\n onEvent={onEvent}\n />\n )\n}\n\nexport function DeductionFormContextual() {\n const { employeeId, editingDeductionId, onEvent } = useFlow<DashboardContextInterface>()\n // The same list query the form hooks use internally — React Query dedupes,\n // so this just looks up the loaded row to pre-populate edit mode.\n const list = useDeductionsList({ employeeId: ensureRequired(employeeId) })\n\n if (list.isLoading) {\n return <BaseLayout isLoading error={list.errorHandling.errors} />\n }\n\n const deduction = editingDeductionId\n ? (list.data.deductions.find(d => d.uuid === editingDeductionId) ?? null)\n : null\n\n return (\n <BaseLayout error={list.errorHandling.errors}>\n <DeductionsForm\n employeeId={ensureRequired(employeeId)}\n deduction={deduction}\n onSaved={(saved, mode) => {\n onEvent(\n mode === 'create'\n ? componentEvents.EMPLOYEE_DEDUCTION_CREATED\n : componentEvents.EMPLOYEE_DEDUCTION_UPDATED,\n saved,\n )\n }}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n </BaseLayout>\n )\n}\n\nexport function AddJobContextual() {\n useI18n('Employee.Dashboard')\n const { t } = useTranslation('Employee.Dashboard')\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <EditCompensation\n employeeId={ensureRequired(employeeId)}\n title={t('compensationFlow.addJobTitle')}\n submitCtaLabel={t('compensationFlow.saveCta')}\n onEvent={onEvent}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n )\n}\n\nexport function EditCompensationContextual() {\n const { employeeId, currentJob, onEvent } = useFlow<DashboardContextInterface>()\n\n // Use getPendingCompensationChanges to find the nearest pending comp — the\n // API does not guarantee ordering of job.compensations, so we rely on the\n // same sorted helper that drives the card display (ascending by effectiveDate).\n const pendingChanges = getPendingCompensationChanges(currentJob ? [currentJob] : [])\n const nearestPending = pendingChanges[0]\n\n if (nearestPending) {\n return (\n <ManagementEditPendingCompensation\n employeeId={ensureRequired(employeeId)}\n jobId={ensureRequired(currentJob?.uuid)}\n compensationId={nearestPending.compensationUuid}\n isNewJob={nearestPending.isNewJob}\n isPrimaryJob={currentJob?.primary ?? false}\n onEvent={onEvent}\n onCancel={() => {\n onEvent(componentEvents.CANCEL, null)\n }}\n />\n )\n }\n\n return (\n <ManagementEditCompensation\n employeeId={ensureRequired(employeeId)}\n jobId={ensureRequired(currentJob?.uuid)}\n onEvent={onEvent}\n onCancel={() => {\n onEvent(componentEvents.CANCEL, null)\n }}\n />\n )\n}\n\nexport function AddAnotherJobContextual() {\n const { employeeId, onEvent } = useFlow<DashboardContextInterface>()\n return (\n <AddAnotherJob\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n onCancel={() => {\n onEvent(componentEvents.CANCEL)\n }}\n />\n )\n}\n"],"names":["DashboardViewContextual","useI18n","t","useTranslation","employeeId","onEvent","successAlert","selectedTab","useFlow","Components","useComponentContext","alertLabels","jsxs","Fragment","jsx","componentEvents","Dashboard","ensureRequired","HomeAddressContextual","HomeAddress","WorkAddressContextual","WorkAddress","FederalTaxesContextual","FederalTaxes","StateTaxesContextual","StateTaxes","ProfileContextual","Profile","PaymentBankFormContextual","BaseComponent","BankForm","PaymentSplitViewContextual","SplitView","DocumentManagerContextual","formId","DocumentManager","DeductionFormContextual","editingDeductionId","list","useDeductionsList","BaseLayout","deduction","d","DeductionsForm","saved","mode","AddJobContextual","EditCompensation","EditCompensationContextual","currentJob","nearestPending","getPendingCompensationChanges","ManagementEditPendingCompensation","ManagementEditCompensation","AddAnotherJobContextual","AddAnotherJob"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiDO,SAASA,KAA0B;AACxC,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3C,EAAE,YAAAC,GAAY,SAAAC,GAAS,cAAAC,GAAc,aAAAC,EAAA,IAAgBC,EAAA,GACrDC,IAAaC,EAAA,GAEbC,IAAqD;AAAA,IACzD,kBAAkBT,EAAE,yBAAyB;AAAA,IAC7C,oBAAoBA,EAAE,2BAA2B;AAAA,IACjD,cAAcA,EAAE,qBAAqB;AAAA,IACrC,gBAAgBA,EAAE,uBAAuB;AAAA,IACzC,kBAAkBA,EAAE,yBAAyB;AAAA,IAC7C,kBAAkBA,EAAE,yBAAyB;AAAA,IAC7C,UAAUA,EAAE,iBAAiB;AAAA,EAAA;AAG/B,SACE,gBAAAU,EAAAC,GAAA,EACG,UAAA;AAAA,IAAA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AM;AACd,QAAAA,EAAQU,EAAgB,QAAQ,IAAI;AAAA,MACtC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASuC,KAA0B;AACxC,QAAM,EAAE,YAAAlD,GAAY,SAAAC,EAAA,IAAYG,EAAA;AAChC,SACE,gBAAAM;AAAA,IAACyC;AAAA,IAAA;AAAA,MACC,YAAYtC,EAAeb,CAAU;AAAA,MACrC,SAAAC;AAAA,MACA,UAAU,MAAM;AACd,QAAAA,EAAQU,EAAgB,MAAM;AAAA,MAChC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as
|
|
2
|
+
import { useTranslation as c } from "react-i18next";
|
|
3
3
|
import { Flex as m } from "../../Common/Flex/Flex.js";
|
|
4
|
-
import { useComponentContext as
|
|
4
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
5
|
import "classnames";
|
|
6
6
|
import "../../../shared/constants.js";
|
|
7
|
-
import { Loading as
|
|
8
|
-
import { EmptyData as
|
|
9
|
-
import { BaseLayout as
|
|
7
|
+
import { Loading as l } from "../../Common/Loading/Loading.js";
|
|
8
|
+
import { EmptyData as f } from "../../Common/EmptyData/EmptyData.js";
|
|
9
|
+
import { BaseLayout as p } from "../../Base/Base.js";
|
|
10
10
|
import { useEmployeeForms as g } from "./hooks/useEmployeeForms.js";
|
|
11
11
|
import { useDataView as y } from "../../Common/DataView/useDataView.js";
|
|
12
12
|
import { DataView as h } from "../../Common/DataView/DataView.js";
|
|
13
13
|
function v({ employeeId: i, onViewForm: s }) {
|
|
14
14
|
const n = g({ employeeId: i });
|
|
15
|
-
return
|
|
15
|
+
return /* @__PURE__ */ e(p, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(
|
|
16
|
+
D,
|
|
17
|
+
{
|
|
18
|
+
forms: n.data.formList,
|
|
19
|
+
isLoading: n.status.isFormsLoading,
|
|
20
|
+
onViewForm: s
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
16
23
|
}
|
|
17
24
|
function D({ forms: i = [], isLoading: s = !1, onViewForm: n }) {
|
|
18
|
-
const { t } =
|
|
25
|
+
const { t } = c("Employee.Dashboard"), o = d(), a = [
|
|
19
26
|
{
|
|
20
27
|
key: "title",
|
|
21
28
|
title: t("documents.columns.title"),
|
|
@@ -36,19 +43,19 @@ function D({ forms: i = [], isLoading: s = !1, onViewForm: n }) {
|
|
|
36
43
|
title: t("documents.columns.requiresSigning"),
|
|
37
44
|
render: (r) => r.requiresSigning ? /* @__PURE__ */ e(o.Badge, { status: "warning", children: t("documents.signingStatus.notSigned") }) : /* @__PURE__ */ e(o.Badge, { status: "success", children: t("documents.signingStatus.signed") })
|
|
38
45
|
}
|
|
39
|
-
],
|
|
46
|
+
], u = y({
|
|
40
47
|
data: i,
|
|
41
|
-
columns:
|
|
48
|
+
columns: a,
|
|
42
49
|
itemMenu: (r) => /* @__PURE__ */ e(o.Button, { variant: "secondary", onClick: () => n?.(r.uuid), children: t("documents.viewCta") }),
|
|
43
50
|
emptyState: () => /* @__PURE__ */ e(
|
|
44
|
-
|
|
51
|
+
f,
|
|
45
52
|
{
|
|
46
53
|
title: t("documents.emptyState.title"),
|
|
47
54
|
description: t("documents.emptyState.description")
|
|
48
55
|
}
|
|
49
56
|
)
|
|
50
57
|
});
|
|
51
|
-
return
|
|
58
|
+
return /* @__PURE__ */ e(m, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(o.Box, { header: /* @__PURE__ */ e(o.BoxHeader, { title: t("documents.title") }), children: /* @__PURE__ */ e(m, { flexDirection: "column", gap: 16, children: s ? /* @__PURE__ */ e(l, {}) : /* @__PURE__ */ e(h, { label: t("documents.listLabel"), ...u }) }) }) });
|
|
52
59
|
}
|
|
53
60
|
export {
|
|
54
61
|
D as DocumentsView,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentsView.js","sources":["../../../../src/components/Employee/Dashboard/DocumentsView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useEmployeeForms } from './hooks'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseLayout } from '@/components/Base/Base'\n\nexport interface DocumentsViewProps {\n forms?: Form[]\n isLoading?: boolean\n onViewForm?: (formUuid: string) => void\n}\n\nexport interface DocumentsViewWithDataProps {\n employeeId: string\n onViewForm?: (formUuid: string) => void\n}\n\n/**\n * Tab-mounted container for the Documents tab. Owns the\n * `useEmployeeForms` fetch so the request only fires when the user\n * actually opens this tab (or whatever the parent chooses to mount).\n * The presentational `DocumentsView` stays pure for testing/stories.\n */\nexport function DocumentsViewWithData({ employeeId, onViewForm }: DocumentsViewWithDataProps) {\n const forms = useEmployeeForms({ employeeId })\n\n
|
|
1
|
+
{"version":3,"file":"DocumentsView.js","sources":["../../../../src/components/Employee/Dashboard/DocumentsView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { useEmployeeForms } from './hooks'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { DataView, useDataView, EmptyData, Loading } from '@/components/Common'\nimport { BaseLayout } from '@/components/Base/Base'\n\nexport interface DocumentsViewProps {\n forms?: Form[]\n isLoading?: boolean\n onViewForm?: (formUuid: string) => void\n}\n\nexport interface DocumentsViewWithDataProps {\n employeeId: string\n onViewForm?: (formUuid: string) => void\n}\n\n/**\n * Tab-mounted container for the Documents tab. Owns the\n * `useEmployeeForms` fetch so the request only fires when the user\n * actually opens this tab (or whatever the parent chooses to mount).\n * The presentational `DocumentsView` stays pure for testing/stories.\n */\nexport function DocumentsViewWithData({ employeeId, onViewForm }: DocumentsViewWithDataProps) {\n const forms = useEmployeeForms({ employeeId })\n\n return (\n <BaseLayout error={forms.errorHandling.errors}>\n <DocumentsView\n forms={forms.data.formList}\n isLoading={forms.status.isFormsLoading}\n onViewForm={onViewForm}\n />\n </BaseLayout>\n )\n}\n\nexport function DocumentsView({ forms = [], isLoading = false, onViewForm }: DocumentsViewProps) {\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n\n const formsColumns = [\n {\n key: 'title',\n title: t('documents.columns.title'),\n render: (form: Form) => form.title || '-',\n },\n {\n key: 'year',\n title: t('documents.columns.year'),\n render: (form: Form) => {\n if (form.year) return String(form.year)\n return '-'\n },\n },\n {\n key: 'status',\n title: t('documents.columns.status'),\n render: (form: Form) => {\n if (form.draft) return t('documents.status.draft')\n return t('documents.status.final')\n },\n },\n {\n key: 'requiresSigning',\n title: t('documents.columns.requiresSigning'),\n render: (form: Form) => {\n if (form.requiresSigning) {\n return (\n <Components.Badge status=\"warning\">\n {t('documents.signingStatus.notSigned')}\n </Components.Badge>\n )\n }\n return (\n <Components.Badge status=\"success\">\n {t('documents.signingStatus.signed')}\n </Components.Badge>\n )\n },\n },\n ]\n\n const formsDataView = useDataView({\n data: forms,\n columns: formsColumns,\n itemMenu: (form: Form) => (\n <Components.Button variant=\"secondary\" onClick={() => onViewForm?.(form.uuid)}>\n {t('documents.viewCta')}\n </Components.Button>\n ),\n emptyState: () => (\n <EmptyData\n title={t('documents.emptyState.title')}\n description={t('documents.emptyState.description')}\n />\n ),\n })\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Components.Box header={<Components.BoxHeader title={t('documents.title')} />}>\n <Flex flexDirection=\"column\" gap={16}>\n {isLoading ? (\n <Loading />\n ) : (\n <DataView label={t('documents.listLabel')} {...formsDataView} />\n )}\n </Flex>\n </Components.Box>\n </Flex>\n )\n}\n"],"names":["DocumentsViewWithData","employeeId","onViewForm","forms","useEmployeeForms","jsx","BaseLayout","DocumentsView","isLoading","useTranslation","Components","use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