@gusto/embedded-react-sdk 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/dist/assets/icons/slash-circle.svg.js +10 -0
- package/dist/assets/icons/slash-circle.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +1 -1
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
- package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
- package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
- package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +35 -33
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -28
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +16 -15
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +24 -22
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +38 -19
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +26 -25
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +115 -99
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +157 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +40 -43
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -9
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -10
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -56
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +34 -32
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +137 -131
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +16 -15
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +85 -104
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +111 -45
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +136 -125
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +117 -110
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +73 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +46 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
- package/dist/components/Payroll/helpers.d.ts +12 -0
- package/dist/components/Payroll/helpers.js +129 -117
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +2 -0
- package/dist/components/Payroll/index.js +18 -14
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +1 -0
- package/dist/helpers/dateFormatting.js +1 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +23 -18
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/responsive.js +1 -1
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/i18n/I18n.js +3 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +5 -3
- package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +14 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +6 -0
- package/dist/i18n/en/common.json.js +4 -2
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/shared/constants.d.ts +25 -1
- package/dist/shared/constants.js +72 -55
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +120 -3
- package/package.json +31 -20
|
@@ -1,95 +1,100 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { useRef as
|
|
2
|
+
import { useForm as K, useWatch as X, FormProvider as Q } from "react-hook-form";
|
|
3
|
+
import { useRef as Z, useMemo as J } from "react";
|
|
4
4
|
import { PayrollEmployeeCompensationsTypePaymentMethod as S } from "@gusto/embedded-api/models/components/payrollemployeecompensationstype";
|
|
5
|
-
import { useTranslation as
|
|
5
|
+
import { useTranslation as ee } from "react-i18next";
|
|
6
6
|
import { z as m } from "zod";
|
|
7
|
-
import { zodResolver as
|
|
7
|
+
import { zodResolver as te } from "@hookform/resolvers/zod";
|
|
8
8
|
import u from "./PayrollEditEmployeePresentation.module.scss.js";
|
|
9
|
-
import { TimeOffField as
|
|
10
|
-
import { Flex as
|
|
9
|
+
import { TimeOffField as ne } from "./TimeOffField.js";
|
|
10
|
+
import { Flex as x } from "../../Common/Flex/Flex.js";
|
|
11
11
|
import { Grid as P } from "../../Common/Grid/Grid.js";
|
|
12
12
|
import "classnames";
|
|
13
|
-
import { RadioGroupField as ne } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
14
|
-
import { TextInputField as R } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
15
13
|
import { useComponentContext as re } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
14
|
import { useI18n as ie } from "../../../i18n/I18n.js";
|
|
17
|
-
import { Form as
|
|
18
|
-
import { firstLastName as
|
|
19
|
-
import { getAdditionalEarningsCompensations as me, getReimbursementCompensation as le, calculateGrossPay as
|
|
20
|
-
import { HOURS_COMPENSATION_NAMES as
|
|
15
|
+
import { Form as oe } from "../../Common/Form/Form.js";
|
|
16
|
+
import { firstLastName as se, formatNumberAsCurrency as ae } from "../../../helpers/formattedStrings.js";
|
|
17
|
+
import { getAdditionalEarningsCompensations as me, getReimbursementCompensation as le, calculateGrossPay as G } from "../helpers.js";
|
|
18
|
+
import { HOURS_COMPENSATION_NAMES as k, EXCLUDED_ADDITIONAL_EARNINGS as de, COMPENSATION_NAME_DOUBLE_OVERTIME as ue, COMPENSATION_NAME_OVERTIME as ce, COMPENSATION_NAME_REGULAR_HOURS as pe, COMPENSATION_NAME_REIMBURSEMENT as fe, COMPENSATION_NAME_CASH_TIPS as he, COMPENSATION_NAME_COMMISSION as Ce, COMPENSATION_NAME_CORRECTION_PAYMENT as Ne, COMPENSATION_NAME_PAYCHECK_TIPS as Ee, COMPENSATION_NAME_BONUS as ge } from "../../../shared/constants.js";
|
|
21
19
|
import { useContainerBreakpoints as be } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
22
|
-
|
|
20
|
+
import { TextInputField as Me } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
21
|
+
import { NumberInputField as w } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
22
|
+
import { RadioGroupField as Oe } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
23
|
+
const Te = m.object({
|
|
23
24
|
hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
|
|
24
25
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
25
|
-
fixedCompensations: m.record(m.string(), m.
|
|
26
|
+
fixedCompensations: m.record(m.string(), m.number().optional()),
|
|
26
27
|
paymentMethod: m.nativeEnum(S).optional()
|
|
27
|
-
}), H = (E,
|
|
28
|
+
}), H = (E, y, l, o) => {
|
|
28
29
|
const g = {
|
|
29
|
-
...
|
|
30
|
+
...y,
|
|
30
31
|
paymentMethod: E.paymentMethod
|
|
31
32
|
};
|
|
32
|
-
g.hourlyCompensations =
|
|
33
|
+
g.hourlyCompensations = y?.hourlyCompensations?.map(
|
|
33
34
|
(i) => {
|
|
34
|
-
const
|
|
35
|
-
return
|
|
35
|
+
const d = i.jobUuid && i.name ? E.hourlyCompensations[i.jobUuid]?.[i.name] : void 0;
|
|
36
|
+
return d ? {
|
|
36
37
|
...i,
|
|
37
|
-
hours:
|
|
38
|
+
hours: d
|
|
38
39
|
} : i;
|
|
39
40
|
}
|
|
40
|
-
), g.paidTimeOff =
|
|
41
|
+
), g.paidTimeOff = l.map((i) => ({
|
|
41
42
|
...i,
|
|
42
43
|
hours: E.timeOffCompensations[i.name]
|
|
43
44
|
}));
|
|
44
45
|
const b = [];
|
|
45
|
-
return Object.entries(E.fixedCompensations).forEach(([i,
|
|
46
|
-
const C =
|
|
47
|
-
(
|
|
46
|
+
return Object.entries(E.fixedCompensations).forEach(([i, d]) => {
|
|
47
|
+
const C = y?.fixedCompensations?.find(
|
|
48
|
+
(M) => M.name?.toLowerCase() === i.toLowerCase()
|
|
48
49
|
);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
if (d !== void 0) {
|
|
51
|
+
const M = d.toString();
|
|
52
|
+
C ? b.push({
|
|
53
|
+
name: C.name,
|
|
54
|
+
jobUuid: C.jobUuid,
|
|
55
|
+
amount: M
|
|
56
|
+
}) : d !== 0 && b.push({
|
|
57
|
+
name: i,
|
|
58
|
+
jobUuid: o,
|
|
59
|
+
amount: M
|
|
60
|
+
});
|
|
61
|
+
}
|
|
58
62
|
}), g.fixedCompensations = b, g;
|
|
59
|
-
},
|
|
63
|
+
}, We = ({
|
|
60
64
|
onSave: E,
|
|
61
|
-
onCancel:
|
|
62
|
-
employee:
|
|
63
|
-
employeeCompensation:
|
|
65
|
+
onCancel: y,
|
|
66
|
+
employee: l,
|
|
67
|
+
employeeCompensation: o,
|
|
64
68
|
isPending: g = !1,
|
|
65
69
|
fixedCompensationTypes: b,
|
|
66
70
|
payPeriodStartDate: i,
|
|
67
|
-
paySchedule:
|
|
71
|
+
paySchedule: d,
|
|
68
72
|
isOffCycle: C = !1,
|
|
69
|
-
withReimbursements:
|
|
73
|
+
withReimbursements: M = !0,
|
|
74
|
+
hasDirectDepositSetup: $ = !0
|
|
70
75
|
}) => {
|
|
71
|
-
const { Button: v, Heading: c, Text:
|
|
76
|
+
const { Button: v, Heading: c, Text: B } = re(), { t } = ee("Payroll.PayrollEditEmployee");
|
|
72
77
|
ie("Payroll.PayrollEditEmployee");
|
|
73
|
-
const f =
|
|
78
|
+
const f = l.jobs?.find((e) => e.primary), O = f ? [f] : [], F = Z(null), p = be({
|
|
74
79
|
ref: F
|
|
75
80
|
}).includes("small");
|
|
76
|
-
|
|
77
|
-
const n =
|
|
78
|
-
n && !
|
|
81
|
+
o?.hourlyCompensations?.forEach((e) => {
|
|
82
|
+
const n = l.jobs?.find((s) => s.uuid === e.jobUuid);
|
|
83
|
+
n && !O.find((s) => s.uuid === n.uuid) && O.push(n);
|
|
79
84
|
});
|
|
80
|
-
const
|
|
85
|
+
const A = (o?.paidTimeOff || []).filter((e) => e.name), _ = me({
|
|
81
86
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
82
|
-
existingFixedCompensations:
|
|
87
|
+
existingFixedCompensations: o?.fixedCompensations || [],
|
|
83
88
|
primaryJobUuid: f?.uuid,
|
|
84
89
|
fixedCompensationTypes: b,
|
|
85
90
|
excludedTypes: de
|
|
86
|
-
}), N =
|
|
87
|
-
|
|
91
|
+
}), N = M ? le(
|
|
92
|
+
o?.fixedCompensations || [],
|
|
88
93
|
b,
|
|
89
94
|
f?.uuid
|
|
90
|
-
) : null,
|
|
91
|
-
(
|
|
92
|
-
),
|
|
95
|
+
) : null, R = (e, n) => o?.hourlyCompensations?.find(
|
|
96
|
+
(s) => s.jobUuid === e && s.name?.toLowerCase() === n.toLowerCase()
|
|
97
|
+
), q = (e) => {
|
|
93
98
|
switch (e) {
|
|
94
99
|
case pe:
|
|
95
100
|
return t("compensationNames.regularHours");
|
|
@@ -100,7 +105,7 @@ const Me = m.object({
|
|
|
100
105
|
default:
|
|
101
106
|
return e;
|
|
102
107
|
}
|
|
103
|
-
},
|
|
108
|
+
}, j = (e) => {
|
|
104
109
|
switch (e) {
|
|
105
110
|
case ge:
|
|
106
111
|
return t("fixedCompensationNames.bonus");
|
|
@@ -117,99 +122,99 @@ const Me = m.object({
|
|
|
117
122
|
default:
|
|
118
123
|
return e;
|
|
119
124
|
}
|
|
120
|
-
},
|
|
125
|
+
}, V = {
|
|
121
126
|
hourlyCompensations: (() => {
|
|
122
127
|
const e = {};
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
const h =
|
|
128
|
+
return O.forEach((n) => {
|
|
129
|
+
k.forEach((s) => {
|
|
130
|
+
const h = R(n.uuid, s);
|
|
126
131
|
h && (e[n.uuid] || (e[n.uuid] = {}), e[n.uuid][h.name] = h.hours ? parseFloat(h.hours).toString() : "");
|
|
127
132
|
});
|
|
128
133
|
}), e;
|
|
129
134
|
})(),
|
|
130
135
|
timeOffCompensations: (() => {
|
|
131
136
|
const e = {};
|
|
132
|
-
return
|
|
137
|
+
return A.forEach((n) => {
|
|
133
138
|
e[n.name] = n.hours ? parseFloat(n.hours).toString() : "";
|
|
134
139
|
}), e;
|
|
135
140
|
})(),
|
|
136
141
|
fixedCompensations: (() => {
|
|
137
142
|
const e = {};
|
|
138
143
|
return _.forEach((n) => {
|
|
139
|
-
e[n.name] = n.amount ? n.amount :
|
|
140
|
-
}), N && (e[N.name] = N.amount ? N.amount :
|
|
144
|
+
e[n.name] = n.amount ? parseFloat(n.amount) : void 0;
|
|
145
|
+
}), N && (e[N.name] = N.amount ? parseFloat(N.amount) : void 0), e;
|
|
141
146
|
})(),
|
|
142
|
-
paymentMethod:
|
|
143
|
-
}, I =
|
|
144
|
-
resolver:
|
|
145
|
-
defaultValues:
|
|
146
|
-
}),
|
|
147
|
+
paymentMethod: o?.paymentMethod || S.DirectDeposit
|
|
148
|
+
}, I = K({
|
|
149
|
+
resolver: te(Te),
|
|
150
|
+
defaultValues: V
|
|
151
|
+
}), T = X({
|
|
147
152
|
control: I.control
|
|
148
|
-
}),
|
|
153
|
+
}), z = J(() => {
|
|
149
154
|
try {
|
|
150
155
|
const e = {};
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
T.hourlyCompensations && Object.entries(T.hourlyCompensations).forEach(([h, D]) => {
|
|
157
|
+
D && (e[h] = D);
|
|
153
158
|
});
|
|
154
159
|
const n = {
|
|
155
160
|
hourlyCompensations: e,
|
|
156
|
-
timeOffCompensations:
|
|
157
|
-
fixedCompensations:
|
|
158
|
-
paymentMethod:
|
|
159
|
-
},
|
|
161
|
+
timeOffCompensations: T.timeOffCompensations || {},
|
|
162
|
+
fixedCompensations: T.fixedCompensations || {},
|
|
163
|
+
paymentMethod: T.paymentMethod
|
|
164
|
+
}, s = H(
|
|
160
165
|
n,
|
|
161
|
-
|
|
162
|
-
(
|
|
166
|
+
o,
|
|
167
|
+
(o?.paidTimeOff || []).filter((h) => h.name),
|
|
163
168
|
f?.uuid
|
|
164
169
|
);
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
d,
|
|
168
|
-
i,
|
|
170
|
+
return G(
|
|
171
|
+
s,
|
|
169
172
|
l,
|
|
173
|
+
i,
|
|
174
|
+
d,
|
|
170
175
|
C
|
|
171
176
|
);
|
|
172
177
|
} catch {
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
d,
|
|
176
|
-
i,
|
|
178
|
+
return o ? G(
|
|
179
|
+
o,
|
|
177
180
|
l,
|
|
181
|
+
i,
|
|
182
|
+
d,
|
|
178
183
|
C
|
|
179
184
|
) : 0;
|
|
180
185
|
}
|
|
181
186
|
}, [
|
|
182
|
-
|
|
183
|
-
|
|
187
|
+
T,
|
|
188
|
+
o,
|
|
184
189
|
f?.uuid,
|
|
185
|
-
d,
|
|
186
|
-
i,
|
|
187
190
|
l,
|
|
191
|
+
i,
|
|
192
|
+
d,
|
|
188
193
|
C
|
|
189
|
-
]),
|
|
190
|
-
first_name:
|
|
191
|
-
last_name:
|
|
192
|
-
}),
|
|
194
|
+
]), W = se({
|
|
195
|
+
first_name: l.firstName,
|
|
196
|
+
last_name: l.lastName
|
|
197
|
+
}), Y = (e) => {
|
|
193
198
|
const n = H(
|
|
194
199
|
e,
|
|
195
|
-
|
|
196
|
-
|
|
200
|
+
o,
|
|
201
|
+
A,
|
|
197
202
|
f?.uuid
|
|
198
203
|
);
|
|
199
204
|
E(n);
|
|
200
|
-
},
|
|
201
|
-
|
|
205
|
+
}, L = ae(z || 0), U = /* @__PURE__ */ a(
|
|
206
|
+
x,
|
|
202
207
|
{
|
|
203
208
|
flexDirection: p ? "row" : "column",
|
|
204
209
|
justifyContent: p ? "flex-end" : "normal",
|
|
205
210
|
alignItems: p ? "flex-start" : "stretch",
|
|
206
211
|
gap: 12,
|
|
207
212
|
children: [
|
|
208
|
-
/* @__PURE__ */ r(v, { variant: "secondary", onClick:
|
|
213
|
+
/* @__PURE__ */ r(v, { variant: "secondary", onClick: y, title: t("cancelCta"), children: t("cancelCta") }),
|
|
209
214
|
/* @__PURE__ */ r(
|
|
210
215
|
v,
|
|
211
216
|
{
|
|
212
|
-
onClick: I.handleSubmit(
|
|
217
|
+
onClick: I.handleSubmit(Y),
|
|
213
218
|
title: t("saveCta"),
|
|
214
219
|
isLoading: g,
|
|
215
220
|
children: t("saveCta")
|
|
@@ -223,51 +228,52 @@ const Me = m.object({
|
|
|
223
228
|
"div",
|
|
224
229
|
{
|
|
225
230
|
className: `${u.headerSection} ${p ? "" : u.headerSectionSticky}`,
|
|
226
|
-
children: /* @__PURE__ */ a(
|
|
227
|
-
/* @__PURE__ */ a(
|
|
228
|
-
/* @__PURE__ */ r(c, { as: "h1", styledAs: p ? "h2" : "h4", children: t("pageTitle", { employeeName:
|
|
229
|
-
p ? /* @__PURE__ */ a(
|
|
230
|
-
/* @__PURE__ */ r(c, { as: "h2", styledAs: "h3", children:
|
|
231
|
-
/* @__PURE__ */ r(
|
|
232
|
-
] }) : /* @__PURE__ */ r(c, { as: "h2", styledAs: "h6", className: u.grossPayLabel, children: t("grossPayLabelMobile", { grossPay:
|
|
231
|
+
children: /* @__PURE__ */ a(x, { justifyContent: "space-between", children: [
|
|
232
|
+
/* @__PURE__ */ a(x, { flexDirection: "column", gap: p ? 8 : 2, children: [
|
|
233
|
+
/* @__PURE__ */ r(c, { as: "h1", styledAs: p ? "h2" : "h4", children: t("pageTitle", { employeeName: W }) }),
|
|
234
|
+
p ? /* @__PURE__ */ a(x, { flexDirection: "column", gap: 6, children: [
|
|
235
|
+
/* @__PURE__ */ r(c, { as: "h2", styledAs: "h3", children: L }),
|
|
236
|
+
/* @__PURE__ */ r(B, { className: u.grossPayLabel, children: t("grossPayLabel") })
|
|
237
|
+
] }) : /* @__PURE__ */ r(c, { as: "h2", styledAs: "h6", className: u.grossPayLabel, children: t("grossPayLabelMobile", { grossPay: L }) })
|
|
233
238
|
] }),
|
|
234
|
-
p &&
|
|
239
|
+
p && U
|
|
235
240
|
] })
|
|
236
241
|
}
|
|
237
242
|
),
|
|
238
|
-
/* @__PURE__ */ a(
|
|
239
|
-
/* @__PURE__ */ a(
|
|
240
|
-
|
|
243
|
+
/* @__PURE__ */ a(Q, { ...I, children: [
|
|
244
|
+
/* @__PURE__ */ a(oe, { children: [
|
|
245
|
+
O.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
241
246
|
/* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */ r(c, { as: "h4", children: e.title }),
|
|
244
|
-
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children:
|
|
245
|
-
const
|
|
247
|
+
O.map((e) => /* @__PURE__ */ a(x, { flexDirection: "column", gap: 8, children: [
|
|
248
|
+
O.length > 1 && /* @__PURE__ */ r(c, { as: "h4", children: e.title }),
|
|
249
|
+
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: k.map((n) => {
|
|
250
|
+
const s = R(
|
|
246
251
|
e.uuid,
|
|
247
252
|
n
|
|
248
253
|
);
|
|
249
|
-
if (
|
|
254
|
+
if (s)
|
|
250
255
|
return /* @__PURE__ */ r(
|
|
251
|
-
|
|
256
|
+
Me,
|
|
252
257
|
{
|
|
253
258
|
type: "number",
|
|
259
|
+
min: 0,
|
|
254
260
|
adornmentEnd: t("hoursUnit"),
|
|
255
261
|
isRequired: !0,
|
|
256
|
-
label:
|
|
257
|
-
name: `hourlyCompensations.${e.uuid}.${
|
|
262
|
+
label: q(n),
|
|
263
|
+
name: `hourlyCompensations.${e.uuid}.${s.name}`
|
|
258
264
|
},
|
|
259
265
|
n
|
|
260
266
|
);
|
|
261
267
|
}) })
|
|
262
268
|
] }, e.uuid))
|
|
263
269
|
] }),
|
|
264
|
-
|
|
270
|
+
A.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
265
271
|
/* @__PURE__ */ r(c, { as: "h4", children: t("timeOffTitle") }),
|
|
266
|
-
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children:
|
|
267
|
-
|
|
272
|
+
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: A.map((e) => /* @__PURE__ */ r(
|
|
273
|
+
ne,
|
|
268
274
|
{
|
|
269
275
|
timeOff: e,
|
|
270
|
-
employee:
|
|
276
|
+
employee: l
|
|
271
277
|
},
|
|
272
278
|
e.name
|
|
273
279
|
)) })
|
|
@@ -280,12 +286,12 @@ const Me = m.object({
|
|
|
280
286
|
gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
|
|
281
287
|
gap: 20,
|
|
282
288
|
children: _.map((e) => /* @__PURE__ */ r(
|
|
283
|
-
|
|
289
|
+
w,
|
|
284
290
|
{
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
format: "currency",
|
|
292
|
+
min: 0,
|
|
287
293
|
isRequired: !0,
|
|
288
|
-
label:
|
|
294
|
+
label: j(e.name),
|
|
289
295
|
name: `fixedCompensations.${e.name}`
|
|
290
296
|
},
|
|
291
297
|
e.name
|
|
@@ -296,20 +302,20 @@ const Me = m.object({
|
|
|
296
302
|
N && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
297
303
|
/* @__PURE__ */ r(c, { as: "h4", children: t("reimbursementTitle") }),
|
|
298
304
|
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ r(
|
|
299
|
-
|
|
305
|
+
w,
|
|
300
306
|
{
|
|
301
|
-
|
|
302
|
-
|
|
307
|
+
format: "currency",
|
|
308
|
+
min: 0,
|
|
303
309
|
isRequired: !0,
|
|
304
|
-
label:
|
|
310
|
+
label: j(N.name),
|
|
305
311
|
name: `fixedCompensations.${N.name}`
|
|
306
312
|
}
|
|
307
313
|
) })
|
|
308
314
|
] }),
|
|
309
|
-
/* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
315
|
+
$ && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
310
316
|
/* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
|
|
311
317
|
/* @__PURE__ */ r(
|
|
312
|
-
|
|
318
|
+
Oe,
|
|
313
319
|
{
|
|
314
320
|
name: "paymentMethod",
|
|
315
321
|
isRequired: !0,
|
|
@@ -329,12 +335,12 @@ const Me = m.object({
|
|
|
329
335
|
)
|
|
330
336
|
] })
|
|
331
337
|
] }),
|
|
332
|
-
!p &&
|
|
338
|
+
!p && U
|
|
333
339
|
] })
|
|
334
340
|
] });
|
|
335
341
|
};
|
|
336
342
|
export {
|
|
337
|
-
|
|
338
|
-
|
|
343
|
+
Te as PayrollEditEmployeeFormSchema,
|
|
344
|
+
We as PayrollEditEmployeePresentation
|
|
339
345
|
};
|
|
340
346
|
//# sourceMappingURL=PayrollEditEmployeePresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField } from './TimeOffField'\nimport { Flex, Grid, TextInputField, RadioGroupField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport {\n getAdditionalEarningsCompensations,\n getReimbursementCompensation,\n calculateGrossPay,\n} from '@/components/Payroll/helpers'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n isOffCycle?: boolean\n withReimbursements?: boolean\n}\n\nexport const PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), z.string().optional()),\n paymentMethod: z.nativeEnum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: Array<{ name?: string; hours?: string }>,\n primaryJobUuid?: string,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!],\n }\n })\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n if (formAmount) {\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: formAmount,\n })\n } else if (parseFloat(formAmount) !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: formAmount,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n return updatedCompensation\n}\n\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n isOffCycle = false,\n withReimbursements = true,\n}: PayrollEditEmployeeProps) => {\n const { Button, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const hourlyJobs = primaryJob ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n const reimbursement = withReimbursements\n ? getReimbursementCompensation(\n employeeCompensation?.fixedCompensations || [],\n fixedCompensationTypes,\n primaryJob?.uuid,\n )\n : null\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount ? fixedComp.amount : ''\n })\n\n if (reimbursement) {\n fixedCompensations[reimbursement.name!] = reimbursement.amount ? reimbursement.amount : ''\n }\n\n return fixedCompensations\n })(),\n\n paymentMethod:\n employeeCompensation?.paymentMethod ||\n PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n // Build form data, filtering out undefined nested objects\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n } catch {\n // Fallback to original compensation on error\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n <Heading as=\"h4\">{hourlyJob.title}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('timeOffTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('additionalEarningsTitle')}</Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <TextInputField\n key={fixedCompensation.name}\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n />\n ))}\n </Grid>\n </div>\n )}\n {reimbursement && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('reimbursementTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <TextInputField\n type=\"number\"\n adornmentStart=\"$\"\n isRequired\n label={getFixedCompensationLabel(reimbursement.name)}\n name={`fixedCompensations.${reimbursement.name}`}\n />\n </Grid>\n </div>\n )}\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('paymentMethodTitle')}</Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["PayrollEditEmployeeFormSchema","z","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","updatedCompensation","compensation","hours","timeOffEntry","updatedFixedCompensations","fixedCompensationName","formAmount","existingFixedCompensation","fixedCompensation","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","isOffCycle","withReimbursements","Button","Heading","Text","useComponentContext","useTranslation","useI18n","primaryJob","job","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","reimbursement","getReimbursementCompensation","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","COMPENSATION_NAME_REIMBURSEMENT","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","watchedFormData","useWatch","currentGrossPay","useMemo","jobId","compensations","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","data","formattedCurrentGrossPay","formatNumberAsCurrency","actions","jsxs","Flex","jsx","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqDO,MAAMA,KAAgCC,EAAE,OAAO;AAAA,EACpD,qBAAqBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAOA,EAA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UAC1C,gBAAA6D;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAO,EAAE,oBAAoB;AAAA,cAC7B,aAAa,EAAE,0BAA0B;AAAA,cACzC,SAAS;AAAA,gBACP;AAAA,kBACE,OAAO/F,EAA8C;AAAA,kBACrD,OAAO,EAAE,oCAAoC;AAAA,gBAAA;AAAA,gBAE/C;AAAA,kBACE,OAAOA,EAA8C;AAAA,kBACrD,OAAO,EAAE,4BAA4B;AAAA,gBAAA;AAAA,cACvC;AAAA,YACF;AAAA,UAAA;AAAA,QACF,EAAA,CACF;AAAA,MAAA,GACF;AAAA,MACC,CAACoC,KAAoBgD;AAAA,IAAA,EAAA,CACxB;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollEditEmployeePresentation.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.tsx"],"sourcesContent":["import { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useMemo, useRef } from 'react'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type {\n FixedCompensations,\n PayrollEmployeeCompensationsType,\n} from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport { PayrollEmployeeCompensationsTypePaymentMethod } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport styles from './PayrollEditEmployeePresentation.module.scss'\nimport { TimeOffField } from './TimeOffField'\nimport { Flex, Grid, TextInputField, RadioGroupField, NumberInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { formatNumberAsCurrency, firstLastName } from '@/helpers/formattedStrings'\nimport {\n getAdditionalEarningsCompensations,\n getReimbursementCompensation,\n calculateGrossPay,\n} from '@/components/Payroll/helpers'\nimport {\n COMPENSATION_NAME_DOUBLE_OVERTIME,\n COMPENSATION_NAME_OVERTIME,\n COMPENSATION_NAME_REGULAR_HOURS,\n HOURS_COMPENSATION_NAMES,\n EXCLUDED_ADDITIONAL_EARNINGS,\n COMPENSATION_NAME_REIMBURSEMENT,\n COMPENSATION_NAME_BONUS,\n COMPENSATION_NAME_PAYCHECK_TIPS,\n COMPENSATION_NAME_CORRECTION_PAYMENT,\n COMPENSATION_NAME_COMMISSION,\n COMPENSATION_NAME_CASH_TIPS,\n} from '@/shared/constants'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollEditEmployeeProps {\n onSave: (updatedCompensation: PayrollEmployeeCompensationsType) => void\n onCancel: () => void\n employee: Employee\n employeeCompensation?: PayrollEmployeeCompensationsType\n isPending?: boolean\n fixedCompensationTypes: PayrollFixedCompensationTypesType[]\n payPeriodStartDate?: string\n paySchedule?: PayScheduleObject\n isOffCycle?: boolean\n withReimbursements?: boolean\n hasDirectDepositSetup?: boolean\n}\n\nexport const PayrollEditEmployeeFormSchema = z.object({\n hourlyCompensations: z.record(z.string(), z.record(z.string(), z.string().optional())),\n timeOffCompensations: z.record(z.string(), z.string().optional()),\n fixedCompensations: z.record(z.string(), z.number().optional()),\n paymentMethod: z.nativeEnum(PayrollEmployeeCompensationsTypePaymentMethod).optional(),\n})\n\nexport type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>\n\nconst buildCompensationFromFormData = (\n formData: PayrollEditEmployeeFormValues,\n employeeCompensation: PayrollEmployeeCompensationsType | undefined,\n timeOff: Array<{ name?: string; hours?: string }>,\n primaryJobUuid?: string,\n): PayrollEmployeeCompensationsType => {\n const updatedCompensation = {\n ...employeeCompensation,\n paymentMethod: formData.paymentMethod,\n }\n\n updatedCompensation.hourlyCompensations = employeeCompensation?.hourlyCompensations?.map(\n compensation => {\n const hours =\n compensation.jobUuid && compensation.name\n ? formData.hourlyCompensations[compensation.jobUuid]?.[compensation.name]\n : undefined\n return hours\n ? {\n ...compensation,\n hours,\n }\n : compensation\n },\n )\n\n updatedCompensation.paidTimeOff = timeOff.map(timeOffEntry => {\n return {\n ...timeOffEntry,\n hours: formData.timeOffCompensations[timeOffEntry.name!],\n }\n })\n\n const updatedFixedCompensations: FixedCompensations[] = []\n\n Object.entries(formData.fixedCompensations).forEach(([fixedCompensationName, formAmount]) => {\n const existingFixedCompensation = employeeCompensation?.fixedCompensations?.find(\n fixedCompensation =>\n fixedCompensation.name?.toLowerCase() === fixedCompensationName.toLowerCase(),\n )\n\n if (formAmount !== undefined) {\n const amountAsString = formAmount.toString()\n if (existingFixedCompensation) {\n updatedFixedCompensations.push({\n name: existingFixedCompensation.name,\n jobUuid: existingFixedCompensation.jobUuid,\n amount: amountAsString,\n })\n } else if (formAmount !== 0) {\n updatedFixedCompensations.push({\n name: fixedCompensationName,\n jobUuid: primaryJobUuid,\n amount: amountAsString,\n })\n }\n }\n })\n\n updatedCompensation.fixedCompensations = updatedFixedCompensations\n\n return updatedCompensation\n}\n\nexport const PayrollEditEmployeePresentation = ({\n onSave,\n onCancel,\n employee,\n employeeCompensation,\n isPending = false,\n fixedCompensationTypes,\n payPeriodStartDate,\n paySchedule,\n isOffCycle = false,\n withReimbursements = true,\n hasDirectDepositSetup = true,\n}: PayrollEditEmployeeProps) => {\n const { Button, Heading, Text } = useComponentContext()\n\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const primaryJob = employee.jobs?.find(job => job.primary)\n const hourlyJobs = primaryJob ? [primaryJob] : []\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n const isSmallOrGreater = breakpoints.includes('small')\n\n employeeCompensation?.hourlyCompensations?.forEach(compensation => {\n const job = employee.jobs?.find(job => job.uuid === compensation.jobUuid)\n if (job && !hourlyJobs.find(hourlyJob => hourlyJob.uuid === job.uuid)) {\n hourlyJobs.push(job)\n }\n })\n\n const timeOff = (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name)\n\n const additionalEarnings = getAdditionalEarningsCompensations({\n flsaStatus: primaryJob?.compensations?.[0]?.flsaStatus,\n existingFixedCompensations: employeeCompensation?.fixedCompensations || [],\n primaryJobUuid: primaryJob?.uuid,\n fixedCompensationTypes,\n excludedTypes: EXCLUDED_ADDITIONAL_EARNINGS,\n })\n\n const reimbursement = withReimbursements\n ? getReimbursementCompensation(\n employeeCompensation?.fixedCompensations || [],\n fixedCompensationTypes,\n primaryJob?.uuid,\n )\n : null\n\n const findMatchingCompensation = (jobUuid: string, compensationName: string) => {\n return employeeCompensation?.hourlyCompensations?.find(\n compensation =>\n compensation.jobUuid === jobUuid &&\n compensation.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n }\n\n const getCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_REGULAR_HOURS:\n return t('compensationNames.regularHours')\n case COMPENSATION_NAME_OVERTIME:\n return t('compensationNames.overtime')\n case COMPENSATION_NAME_DOUBLE_OVERTIME:\n return t('compensationNames.doubleOvertime')\n default:\n return compensationName\n }\n }\n\n const getFixedCompensationLabel = (compensationName?: string) => {\n switch (compensationName) {\n case COMPENSATION_NAME_BONUS:\n return t('fixedCompensationNames.bonus')\n case COMPENSATION_NAME_PAYCHECK_TIPS:\n return t('fixedCompensationNames.paycheckTips')\n case COMPENSATION_NAME_CORRECTION_PAYMENT:\n return t('fixedCompensationNames.correctionPayment')\n case COMPENSATION_NAME_COMMISSION:\n return t('fixedCompensationNames.commission')\n case COMPENSATION_NAME_CASH_TIPS:\n return t('fixedCompensationNames.cashTips')\n case COMPENSATION_NAME_REIMBURSEMENT:\n return t('fixedCompensationNames.reimbursement')\n default:\n return compensationName\n }\n }\n\n const defaultValues = {\n hourlyCompensations: (() => {\n const hourlyCompensations: PayrollEditEmployeeFormValues['hourlyCompensations'] = {}\n\n hourlyJobs.forEach(hourlyJob => {\n HOURS_COMPENSATION_NAMES.forEach(compensationName => {\n const matchingCompensation = findMatchingCompensation(hourlyJob.uuid, compensationName)\n if (matchingCompensation) {\n if (!hourlyCompensations[hourlyJob.uuid]) {\n hourlyCompensations[hourlyJob.uuid] = {}\n }\n hourlyCompensations[hourlyJob.uuid]![matchingCompensation.name!] =\n matchingCompensation.hours ? parseFloat(matchingCompensation.hours).toString() : ''\n }\n })\n })\n\n return hourlyCompensations\n })(),\n\n timeOffCompensations: (() => {\n const timeOffCompensations: PayrollEditEmployeeFormValues['timeOffCompensations'] = {}\n\n timeOff.forEach(timeOffCompensation => {\n timeOffCompensations[timeOffCompensation.name!] = timeOffCompensation.hours\n ? parseFloat(timeOffCompensation.hours).toString()\n : ''\n })\n\n return timeOffCompensations\n })(),\n\n fixedCompensations: (() => {\n const fixedCompensations: PayrollEditEmployeeFormValues['fixedCompensations'] = {}\n\n additionalEarnings.forEach(fixedComp => {\n fixedCompensations[fixedComp.name!] = fixedComp.amount\n ? parseFloat(fixedComp.amount)\n : undefined\n })\n\n if (reimbursement) {\n fixedCompensations[reimbursement.name!] = reimbursement.amount\n ? parseFloat(reimbursement.amount)\n : undefined\n }\n\n return fixedCompensations\n })(),\n\n paymentMethod:\n employeeCompensation?.paymentMethod ||\n PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n }\n\n const formHandlers = useForm<PayrollEditEmployeeFormValues>({\n resolver: zodResolver(PayrollEditEmployeeFormSchema),\n defaultValues,\n })\n\n const watchedFormData = useWatch({\n control: formHandlers.control,\n })\n\n const currentGrossPay = useMemo(() => {\n try {\n // Build form data, filtering out undefined nested objects\n const hourlyCompensations: Record<string, Record<string, string | undefined>> = {}\n if (watchedFormData.hourlyCompensations) {\n Object.entries(watchedFormData.hourlyCompensations).forEach(([jobId, compensations]) => {\n if (compensations) {\n hourlyCompensations[jobId] = compensations\n }\n })\n }\n\n const formDataWithDefaults: PayrollEditEmployeeFormValues = {\n hourlyCompensations,\n timeOffCompensations: watchedFormData.timeOffCompensations || {},\n fixedCompensations: watchedFormData.fixedCompensations || {},\n paymentMethod: watchedFormData.paymentMethod,\n }\n\n const updatedCompensation = buildCompensationFromFormData(\n formDataWithDefaults,\n employeeCompensation,\n (employeeCompensation?.paidTimeOff || []).filter(entry => entry.name),\n primaryJob?.uuid,\n )\n\n return calculateGrossPay(\n updatedCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n } catch {\n // Fallback to original compensation on error\n return employeeCompensation\n ? calculateGrossPay(\n employeeCompensation,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n }\n }, [\n watchedFormData,\n employeeCompensation,\n primaryJob?.uuid,\n employee,\n payPeriodStartDate,\n paySchedule,\n isOffCycle,\n ])\n\n const employeeName = firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n })\n\n const onSubmit = (data: PayrollEditEmployeeFormValues) => {\n const updatedCompensation = buildCompensationFromFormData(\n data,\n employeeCompensation,\n timeOff,\n primaryJob?.uuid,\n )\n onSave(updatedCompensation)\n }\n\n const formattedCurrentGrossPay = formatNumberAsCurrency(currentGrossPay || 0)\n\n const actions = (\n <Flex\n flexDirection={isSmallOrGreater ? 'row' : 'column'}\n justifyContent={isSmallOrGreater ? 'flex-end' : 'normal'}\n alignItems={isSmallOrGreater ? 'flex-start' : 'stretch'}\n gap={12}\n >\n <Button variant=\"secondary\" onClick={onCancel} title={t('cancelCta')}>\n {t('cancelCta')}\n </Button>\n <Button\n onClick={formHandlers.handleSubmit(onSubmit)}\n title={t('saveCta')}\n isLoading={isPending}\n >\n {t('saveCta')}\n </Button>\n </Flex>\n )\n\n return (\n <div ref={containerRef} className={styles.container}>\n <div\n className={`${styles.headerSection} ${!isSmallOrGreater ? styles.headerSectionSticky : ''}`}\n >\n <Flex justifyContent=\"space-between\">\n <Flex flexDirection=\"column\" gap={isSmallOrGreater ? 8 : 2}>\n <Heading as=\"h1\" styledAs={isSmallOrGreater ? 'h2' : 'h4'}>\n {t('pageTitle', { employeeName })}\n </Heading>\n {isSmallOrGreater ? (\n <Flex flexDirection=\"column\" gap={6}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {formattedCurrentGrossPay}\n </Heading>\n <Text className={styles.grossPayLabel}>{t('grossPayLabel')}</Text>\n </Flex>\n ) : (\n <Heading as=\"h2\" styledAs=\"h6\" className={styles.grossPayLabel}>\n {t('grossPayLabelMobile', { grossPay: formattedCurrentGrossPay })}\n </Heading>\n )}\n </Flex>\n {isSmallOrGreater && actions}\n </Flex>\n </div>\n <FormProvider {...formHandlers}>\n <Form>\n {hourlyJobs.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h3\">{t('regularHoursTitle')}</Heading>\n {hourlyJobs.map(hourlyJob => (\n <Flex key={hourlyJob.uuid} flexDirection=\"column\" gap={8}>\n {hourlyJobs.length > 1 && <Heading as=\"h4\">{hourlyJob.title}</Heading>}\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {HOURS_COMPENSATION_NAMES.map(compensationName => {\n const employeeHourlyCompensation = findMatchingCompensation(\n hourlyJob.uuid,\n compensationName,\n )\n if (employeeHourlyCompensation) {\n return (\n <TextInputField\n key={compensationName}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={getCompensationLabel(compensationName)}\n name={`hourlyCompensations.${hourlyJob.uuid}.${employeeHourlyCompensation.name}`}\n />\n )\n }\n })}\n </Grid>\n </Flex>\n ))}\n </div>\n )}\n {timeOff.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('timeOffTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n {timeOff.map(timeOffEntry => (\n <TimeOffField\n key={timeOffEntry.name}\n timeOff={timeOffEntry}\n employee={employee}\n />\n ))}\n </Grid>\n </div>\n )}\n {additionalEarnings.length > 0 && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('additionalEarningsTitle')}</Heading>\n <Grid\n gridTemplateColumns={{ base: '1fr', small: [320, 320], large: [320, 320, 320] }}\n gap={20}\n >\n {additionalEarnings.map(fixedCompensation => (\n <NumberInputField\n key={fixedCompensation.name}\n format=\"currency\"\n min={0}\n isRequired\n label={getFixedCompensationLabel(fixedCompensation.name)}\n name={`fixedCompensations.${fixedCompensation.name}`}\n />\n ))}\n </Grid>\n </div>\n )}\n {reimbursement && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('reimbursementTitle')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [320, 320] }} gap={20}>\n <NumberInputField\n format=\"currency\"\n min={0}\n isRequired\n label={getFixedCompensationLabel(reimbursement.name)}\n name={`fixedCompensations.${reimbursement.name}`}\n />\n </Grid>\n </div>\n )}\n {hasDirectDepositSetup && (\n <div className={styles.fieldGroup}>\n <Heading as=\"h4\">{t('paymentMethodTitle')}</Heading>\n <RadioGroupField\n name=\"paymentMethod\"\n isRequired\n label={t('paymentMethodLabel')}\n description={t('paymentMethodDescription')}\n options={[\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.DirectDeposit,\n label: t('paymentMethodOptions.directDeposit'),\n },\n {\n value: PayrollEmployeeCompensationsTypePaymentMethod.Check,\n label: t('paymentMethodOptions.check'),\n },\n ]}\n />\n </div>\n )}\n </Form>\n {!isSmallOrGreater && actions}\n </FormProvider>\n </div>\n )\n}\n"],"names":["PayrollEditEmployeeFormSchema","z","PayrollEmployeeCompensationsTypePaymentMethod","buildCompensationFromFormData","formData","employeeCompensation","timeOff","primaryJobUuid","updatedCompensation","compensation","hours","timeOffEntry","updatedFixedCompensations","fixedCompensationName","formAmount","existingFixedCompensation","fixedCompensation","amountAsString","PayrollEditEmployeePresentation","onSave","onCancel","employee","isPending","fixedCompensationTypes","payPeriodStartDate","paySchedule","isOffCycle","withReimbursements","hasDirectDepositSetup","Button","Heading","Text","useComponentContext","useTranslation","useI18n","primaryJob","job","hourlyJobs","containerRef","useRef","isSmallOrGreater","useContainerBreakpoints","hourlyJob","entry","additionalEarnings","getAdditionalEarningsCompensations","EXCLUDED_ADDITIONAL_EARNINGS","reimbursement","getReimbursementCompensation","findMatchingCompensation","jobUuid","compensationName","getCompensationLabel","COMPENSATION_NAME_REGULAR_HOURS","COMPENSATION_NAME_OVERTIME","COMPENSATION_NAME_DOUBLE_OVERTIME","getFixedCompensationLabel","COMPENSATION_NAME_BONUS","COMPENSATION_NAME_PAYCHECK_TIPS","COMPENSATION_NAME_CORRECTION_PAYMENT","COMPENSATION_NAME_COMMISSION","COMPENSATION_NAME_CASH_TIPS","COMPENSATION_NAME_REIMBURSEMENT","defaultValues","hourlyCompensations","HOURS_COMPENSATION_NAMES","matchingCompensation","timeOffCompensations","timeOffCompensation","fixedCompensations","fixedComp","formHandlers","useForm","zodResolver","watchedFormData","useWatch","currentGrossPay","useMemo","jobId","compensations","formDataWithDefaults","calculateGrossPay","employeeName","firstLastName","onSubmit","data","formattedCurrentGrossPay","formatNumberAsCurrency","actions","jsxs","Flex","jsx","styles","FormProvider","Form","Grid","employeeHourlyCompensation","TextInputField","TimeOffField","NumberInputField","RadioGroupField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsDO,MAAMA,KAAgCC,EAAE,OAAO;AAAA,EACpD,qBAAqBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,SAAA,CAAU,CAAC;AAAA,EACrF,sBAAsBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAChE,oBAAoBA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,SAAS,UAAU;AAAA,EAC9D,eAAeA,EAAE,WAAWC,CAA6C,EAAE,SAAA;AAC7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