@gusto/embedded-react-sdk 0.33.0 → 0.34.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.d.ts +5 -0
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js +34 -0
- package/dist/components/Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js.map +1 -0
- package/dist/components/Common/Fields/MultiSelectComboBoxField/index.d.ts +2 -0
- package/dist/components/Common/SignatureForm/SignatureForm.d.ts +1 -7
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
- package/dist/components/Common/UI/Menu/Menu.js +2 -3
- package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +2 -0
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +127 -0
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -0
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +16 -0
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -0
- package/dist/components/Common/{MultiSelectComboBox → UI/MultiSelectComboBox}/MultiSelectComboBoxTypes.d.ts +6 -5
- package/dist/components/Common/index.d.ts +1 -0
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +16 -17
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Schema.d.ts +4 -30
- 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/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.d.ts +2 -26
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +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.d.ts +1 -7
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +6 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +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.d.ts +1 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- 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/SignatureForm.js +2 -2
- 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/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +4 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +7 -13
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- 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.d.ts +7 -20
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -6
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- 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/LocationsList.js +2 -2
- 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/Completed.js +3 -2
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +7 -18
- 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/StateTaxesForm.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/Address.js +2 -2
- package/dist/components/Contractor/Address/Form.js +7 -8
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.d.ts +1 -13
- 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 +17 -17
- package/dist/components/Contractor/ContractorList/useContractorList.js +4 -4
- package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.d.ts +5 -15
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +28 -28
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +7 -20
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +5 -6
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +3 -3
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +19 -67
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +12 -13
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +18 -17
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +27 -26
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +76 -44
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +7 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +3 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +28 -22
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +66 -54
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +3 -2
- 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.d.ts +54 -120
- package/dist/components/Contractor/Profile/useContractorProfile.js +50 -49
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +1 -1
- package/dist/components/Employee/Compensation/Edit.js +14 -14
- package/dist/components/Employee/Compensation/useCompensation.d.ts +17 -44
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +4 -22
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +62 -61
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +4 -22
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +36 -35
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +5 -27
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +48 -47
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +7 -26
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.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/EmploymentEligibility/EmploymentEligibilityPresentation.js +21 -20
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +5 -29
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +8 -8
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +9 -76
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +7 -7
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +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/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +1 -5
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- 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.d.ts +7 -33
- 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/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +5 -14
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +5 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +8 -8
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +12 -68
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +19 -17
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +17 -82
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +38 -33
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.d.ts +11 -66
- package/dist/components/Employee/Profile/HomeAddress.js +9 -10
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +15 -64
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +32 -29
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +2 -5
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +8 -37
- package/dist/components/Employee/Profile/SelfPersonalDetails.js +22 -19
- package/dist/components/Employee/Profile/SelfPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateForm.d.ts +1 -5
- 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.d.ts +7 -33
- package/dist/components/Employee/Taxes/FederalForm.js +7 -7
- package/dist/components/Employee/Taxes/StateForm.d.ts +1 -5
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +3 -2
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +4 -4
- package/dist/components/InformationRequests/InformationRequests.js +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +1 -11
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +6 -9
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +84 -56
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +57 -22
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +5 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +2 -22
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +38 -39
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +5 -5
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -12
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +66 -67
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +18 -17
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +3 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +3 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +2 -3
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +8 -7
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -6
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +27 -26
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +26 -25
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/apiVersionHook.d.ts +2 -0
- package/dist/contexts/ApiProvider/apiVersionHook.js +7 -0
- package/dist/contexts/ApiProvider/apiVersionHook.js.map +1 -0
- package/dist/contexts/ApiProvider/apiVersionHook.test.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +60 -58
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.js +23 -23
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/helpers/validations.d.ts +2 -2
- package/dist/i18n/I18n.js +15 -15
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +42 -40
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +9 -9
- package/dist/i18n/en/Payroll.EmployeeSelection.json.js +10 -0
- package/dist/i18n/en/Payroll.EmployeeSelection.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +10 -8
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +11 -1
- package/docs/reference/endpoint-inventory.json +4 -0
- package/package.json +11 -10
- package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBox.d.ts +0 -2
- /package/dist/components/Common/{MultiSelectComboBox → UI/MultiSelectComboBox}/index.d.ts +0 -0
|
@@ -10,19 +10,19 @@ import { getBlockerTranslationKeys as G } from "../payrollHelpers.js";
|
|
|
10
10
|
import v from "./PayrollBlockerList.module.scss.js";
|
|
11
11
|
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
12
|
import { FlexItem as j, Flex as a } from "../../../Common/Flex/Flex.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { recoveryCasesEvents as $, informationRequestEvents as H } from "../../../../shared/constants.js";
|
|
14
|
+
import { DataView as Q } from "../../../Common/DataView/DataView.js";
|
|
15
|
+
import { useDataView as Y } from "../../../Common/DataView/useDataView.js";
|
|
16
|
+
import { useComponentDictionary as z, useI18n as J } from "../../../../i18n/I18n.js";
|
|
17
|
+
import { RecoveryCases as W } from "../../RecoveryCases/RecoveryCases.js";
|
|
18
|
+
import { BaseComponent as X } from "../../../Base/Base.js";
|
|
18
19
|
import "../../../Base/useBase.js";
|
|
19
|
-
import { recoveryCasesEvents as W, informationRequestEvents as X } from "../../../../shared/constants.js";
|
|
20
20
|
import { InformationRequestsFlow as Z } from "../../../InformationRequests/InformationRequests.js";
|
|
21
21
|
function be(s) {
|
|
22
|
-
return /* @__PURE__ */ o(
|
|
22
|
+
return /* @__PURE__ */ o(X, { ...s, children: /* @__PURE__ */ o(ee, { ...s, children: s.children }) });
|
|
23
23
|
}
|
|
24
24
|
function ee({ className: s, companyId: n, dictionary: B, onEvent: u }) {
|
|
25
|
-
|
|
25
|
+
z("Payroll.PayrollBlocker", B), J("Payroll.PayrollBlocker");
|
|
26
26
|
const { t: r } = N("Payroll.PayrollBlocker"), { Button: D, Text: i, Heading: b, Alert: g } = M(), [x, f] = _({
|
|
27
27
|
id: 0,
|
|
28
28
|
alerts: []
|
|
@@ -38,7 +38,7 @@ function ee({ className: s, companyId: n, dictionary: B, onEvent: u }) {
|
|
|
38
38
|
}));
|
|
39
39
|
}, []), p = d(
|
|
40
40
|
(e, t) => {
|
|
41
|
-
e ===
|
|
41
|
+
e === $.RECOVERY_CASE_RESUBMIT_DONE && c("recoveryCaseResubmitted"), e === H.INFORMATION_REQUEST_FORM_DONE && c("informationRequestResponded"), u(e, t);
|
|
42
42
|
},
|
|
43
43
|
[u, c]
|
|
44
44
|
), { data: A } = O({
|
|
@@ -62,7 +62,7 @@ function ee({ className: s, companyId: n, dictionary: B, onEvent: u }) {
|
|
|
62
62
|
(e) => e.status !== "recovered"
|
|
63
63
|
), k = L.some(
|
|
64
64
|
(e) => e.status !== K.Approved
|
|
65
|
-
), P =
|
|
65
|
+
), P = Y({
|
|
66
66
|
data: y,
|
|
67
67
|
columns: [
|
|
68
68
|
{
|
|
@@ -96,9 +96,9 @@ function ee({ className: s, companyId: n, dictionary: B, onEvent: u }) {
|
|
|
96
96
|
)),
|
|
97
97
|
C && /* @__PURE__ */ m(a, { flexDirection: "column", gap: 20, children: [
|
|
98
98
|
/* @__PURE__ */ o(b, { as: "h2", styledAs: "h4", children: r("blockersListTitle") }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
99
|
+
/* @__PURE__ */ o(Q, { ...P, label: r("blockersListTitle") })
|
|
100
100
|
] }),
|
|
101
|
-
h && /* @__PURE__ */ o(
|
|
101
|
+
h && /* @__PURE__ */ o(W, { companyId: n, onEvent: p }),
|
|
102
102
|
k && /* @__PURE__ */ o(Z, { companyId: n, withAlert: !1, onEvent: p })
|
|
103
103
|
] }) }) : /* @__PURE__ */ o("div", { className: R(v.root, s), children: /* @__PURE__ */ o(i, { children: r("noBlockersMessage") }) });
|
|
104
104
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as o, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as A } from "react";
|
|
3
3
|
import { useTranslation as V, Trans as _ } from "react-i18next";
|
|
4
4
|
import { useFormatEmployeePayRate as z, getPayrollTypeLabel as K, getRegularHours as O, getOvertimeHours as W, formatHoursDisplay as w, getTotalPtoHours as X, getAdditionalEarnings as q, getReimbursements as J, calculateGrossPay as Q } from "../helpers.js";
|
|
@@ -7,18 +7,17 @@ import Z from "./PayrollConfigurationPresentation.module.scss.js";
|
|
|
7
7
|
import { useI18n as $ } from "../../../i18n/I18n.js";
|
|
8
8
|
import { Flex as u, FlexItem as y } from "../../Common/Flex/Flex.js";
|
|
9
9
|
import { Grid as ee } from "../../Common/Grid/Grid.js";
|
|
10
|
-
import "classnames";
|
|
11
10
|
import { HamburgerMenu as te } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
12
11
|
import { useComponentContext as re } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
12
|
+
import ne from "../../../assets/icons/pencil.svg.js";
|
|
13
|
+
import oe from "../../../assets/icons/x-circle.svg.js";
|
|
15
14
|
import le from "../../../assets/icons/plus-circle.svg.js";
|
|
16
15
|
import { formatNumberAsCurrency as h, firstLastName as ie } from "../../../helpers/formattedStrings.js";
|
|
17
16
|
import { useDateFormatter as ae } from "../../../hooks/useDateFormatter.js";
|
|
18
17
|
import se from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
19
|
-
import { PayrollLoading as
|
|
20
|
-
import { DataView as
|
|
21
|
-
const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate, l.endDate) : { startDate: "", endDate: "" },
|
|
18
|
+
import { PayrollLoading as ce } from "../../Common/PayrollLoading/PayrollLoading.js";
|
|
19
|
+
import { DataView as me } from "../../Common/DataView/DataView.js";
|
|
20
|
+
const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate, l.endDate) : { startDate: "", endDate: "" }, Ne = ({
|
|
22
21
|
employeeCompensations: l,
|
|
23
22
|
employeeDetails: p,
|
|
24
23
|
payPeriod: f,
|
|
@@ -30,7 +29,7 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
30
29
|
isOffCycle: D = !1,
|
|
31
30
|
offCycleReason: F,
|
|
32
31
|
alerts: C,
|
|
33
|
-
payrollAlert:
|
|
32
|
+
payrollAlert: c,
|
|
34
33
|
isPending: g,
|
|
35
34
|
isCalculating: i,
|
|
36
35
|
payrollBlockers: P = [],
|
|
@@ -40,12 +39,12 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
40
39
|
}) => {
|
|
41
40
|
const { Button: T, Heading: k, Text: d, Badge: U, Alert: j } = re();
|
|
42
41
|
$("Payroll.PayrollConfiguration");
|
|
43
|
-
const { t } = V("Payroll.PayrollConfiguration"), G = ae(), I = z(), v = A(null), a = se({ ref: v }).includes("small"),
|
|
44
|
-
const
|
|
45
|
-
return
|
|
42
|
+
const { t } = V("Payroll.PayrollConfiguration"), G = ae(), I = z(), v = A(null), a = se({ ref: v }).includes("small"), m = new Map(p.map((e) => [e.uuid, e])), L = (e) => {
|
|
43
|
+
const n = m.get(e);
|
|
44
|
+
return n ? ie({ first_name: n.firstName, last_name: n.lastName }) : null;
|
|
46
45
|
};
|
|
47
|
-
return /* @__PURE__ */ r("div", { ref: v, className: Z.container, children: /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ r("div", { ref: v, className: Z.container, children: /* @__PURE__ */ o(u, { flexDirection: "column", gap: 32, children: [
|
|
47
|
+
/* @__PURE__ */ o(
|
|
49
48
|
u,
|
|
50
49
|
{
|
|
51
50
|
flexDirection: a ? "row" : "column",
|
|
@@ -53,7 +52,7 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
53
52
|
alignItems: a ? "center" : "stretch",
|
|
54
53
|
gap: a ? 0 : 16,
|
|
55
54
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ o(y, { children: [
|
|
57
56
|
/* @__PURE__ */ r(k, { as: "h1", children: t("pageTitle") }),
|
|
58
57
|
f && /* @__PURE__ */ r(d, { variant: "supporting", children: /* @__PURE__ */ r(
|
|
59
58
|
_,
|
|
@@ -88,17 +87,17 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
88
87
|
]
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
(C ||
|
|
92
|
-
|
|
90
|
+
(C || c) && /* @__PURE__ */ o(ee, { gap: 16, gridTemplateColumns: "1fr", children: [
|
|
91
|
+
c && /* @__PURE__ */ r(j, { label: c.label, status: c.variant, children: c.content }),
|
|
93
92
|
C
|
|
94
93
|
] }),
|
|
95
94
|
g ? /* @__PURE__ */ r(
|
|
96
|
-
|
|
95
|
+
ce,
|
|
97
96
|
{
|
|
98
97
|
title: t(i ? "calculatingTitle" : "loadingTitle"),
|
|
99
98
|
description: t(i ? "calculatingDescription" : "loadingDescription")
|
|
100
99
|
}
|
|
101
|
-
) : /* @__PURE__ */
|
|
100
|
+
) : /* @__PURE__ */ o(S, { children: [
|
|
102
101
|
P.length > 0 && /* @__PURE__ */ r(
|
|
103
102
|
Y,
|
|
104
103
|
{
|
|
@@ -106,21 +105,21 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
106
105
|
onViewBlockersClick: R
|
|
107
106
|
}
|
|
108
107
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ o(u, { flexDirection: "column", gap: 20, children: [
|
|
109
|
+
/* @__PURE__ */ o(y, { children: [
|
|
111
110
|
/* @__PURE__ */ r(k, { as: "h3", children: t("hoursAndEarningsTitle") }),
|
|
112
111
|
/* @__PURE__ */ r(d, { variant: "supporting", children: t("hoursAndEarningsDescription") })
|
|
113
112
|
] }),
|
|
114
113
|
/* @__PURE__ */ r(
|
|
115
|
-
|
|
114
|
+
me,
|
|
116
115
|
{
|
|
117
116
|
label: t("employeeCompensationsTitle"),
|
|
118
117
|
columns: [
|
|
119
118
|
{
|
|
120
119
|
title: t("tableColumns.employees"),
|
|
121
120
|
render: (e) => {
|
|
122
|
-
const
|
|
123
|
-
return /* @__PURE__ */
|
|
121
|
+
const n = m.get(e.employeeUuid || ""), s = I(n);
|
|
122
|
+
return /* @__PURE__ */ o(u, { flexDirection: "column", gap: 0, children: [
|
|
124
123
|
L(e.employeeUuid || ""),
|
|
125
124
|
s && /* @__PURE__ */ r(d, { size: "xs", variant: "supporting", children: s }),
|
|
126
125
|
e.excluded && /* @__PURE__ */ r(U, { status: "warning", children: t("skippedBadge") })
|
|
@@ -130,39 +129,39 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
130
129
|
{
|
|
131
130
|
title: t("tableColumns.hours"),
|
|
132
131
|
render: (e) => {
|
|
133
|
-
const
|
|
134
|
-
return w(
|
|
132
|
+
const n = O(e), s = W(e);
|
|
133
|
+
return w(n + s);
|
|
135
134
|
}
|
|
136
135
|
},
|
|
137
136
|
{
|
|
138
137
|
title: t("tableColumns.timeOff"),
|
|
139
138
|
render: (e) => {
|
|
140
|
-
const
|
|
141
|
-
return w(
|
|
139
|
+
const n = X(e);
|
|
140
|
+
return w(n);
|
|
142
141
|
}
|
|
143
142
|
},
|
|
144
143
|
{
|
|
145
144
|
title: t("tableColumns.additionalEarnings"),
|
|
146
145
|
render: (e) => {
|
|
147
|
-
const
|
|
148
|
-
return h(
|
|
146
|
+
const n = q(e);
|
|
147
|
+
return h(n);
|
|
149
148
|
}
|
|
150
149
|
},
|
|
151
150
|
...B ? [
|
|
152
151
|
{
|
|
153
152
|
title: t("tableColumns.reimbursements"),
|
|
154
153
|
render: (e) => {
|
|
155
|
-
const
|
|
156
|
-
return h(
|
|
154
|
+
const n = J(e);
|
|
155
|
+
return h(n);
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
] : [],
|
|
160
159
|
{
|
|
161
160
|
title: t("tableColumns.totalPay"),
|
|
162
161
|
render: (e) => {
|
|
163
|
-
const
|
|
162
|
+
const n = m.get(e.employeeUuid || ""), s = n ? Q(
|
|
164
163
|
e,
|
|
165
|
-
|
|
164
|
+
n,
|
|
166
165
|
f?.startDate,
|
|
167
166
|
H,
|
|
168
167
|
D
|
|
@@ -178,17 +177,17 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
178
177
|
items: [
|
|
179
178
|
{
|
|
180
179
|
label: t("editMenu.edit"),
|
|
181
|
-
icon: /* @__PURE__ */ r(
|
|
180
|
+
icon: /* @__PURE__ */ r(ne, { "aria-hidden": !0 }),
|
|
182
181
|
onClick: () => {
|
|
183
|
-
const
|
|
184
|
-
|
|
182
|
+
const n = m.get(e.employeeUuid || "");
|
|
183
|
+
n && M(n);
|
|
185
184
|
}
|
|
186
185
|
},
|
|
187
186
|
{
|
|
188
187
|
label: t(e.excluded ? "editMenu.unskip" : "editMenu.skip"),
|
|
189
|
-
icon: e.excluded ? /* @__PURE__ */ r(le, { "aria-hidden": !0 }) : /* @__PURE__ */ r(
|
|
188
|
+
icon: e.excluded ? /* @__PURE__ */ r(le, { "aria-hidden": !0 }) : /* @__PURE__ */ r(oe, { "aria-hidden": !0 }),
|
|
190
189
|
onClick: () => {
|
|
191
|
-
|
|
190
|
+
m.get(e.employeeUuid || "") && E(e);
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
193
|
],
|
|
@@ -203,6 +202,6 @@ const ue = (l, p) => l?.startDate && l.endDate ? p.formatPayPeriod(l.startDate,
|
|
|
203
202
|
] }) });
|
|
204
203
|
};
|
|
205
204
|
export {
|
|
206
|
-
|
|
205
|
+
Ne as PayrollConfigurationPresentation
|
|
207
206
|
};
|
|
208
207
|
//# sourceMappingURL=PayrollConfigurationPresentation.js.map
|
package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollConfigurationPresentation.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useRef } from 'react'\nimport type { EmployeeCompensations } from '@gusto/embedded-api/models/components/payroll'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport {\n useFormatEmployeePayRate,\n getRegularHours,\n getOvertimeHours,\n getTotalPtoHours,\n getAdditionalEarnings,\n getReimbursements,\n formatHoursDisplay,\n calculateGrossPay,\n getPayrollTypeLabel,\n} from '../helpers'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport styles from './PayrollConfigurationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { DataView, Flex, FlexItem, Grid, PayrollLoading } from '@/components/Common'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport XCircle from '@/assets/icons/x-circle.svg?react'\nimport PlusCircle from '@/assets/icons/plus-circle.svg?react'\nimport { firstLastName, formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollConfigurationPresentationProps {\n employeeCompensations: EmployeeCompensations[]\n employeeDetails: Employee[]\n payPeriod?: PayrollPayPeriodType\n paySchedule?: PayScheduleObject\n onCalculatePayroll: () => void\n onEdit: (employee: Employee) => void\n onToggleExclude: (employeeCompensation: PayrollEmployeeCompensationsType) => void\n onViewBlockers: () => void\n isOffCycle?: boolean\n offCycleReason?: string | null\n alerts?: ReactNode\n payrollAlert?: {\n label: string\n content?: ReactNode\n variant: 'info' | 'warning'\n }\n isPending?: boolean\n isCalculating?: boolean\n payrollBlockers?: ApiPayrollBlocker[]\n pagination?: PaginationControlProps\n withReimbursements?: boolean\n isCalculateDisabled?: boolean\n}\n\nconst getPayrollConfigurationTitle = (\n payPeriod: PayrollPayPeriodType | undefined,\n dateFormatter: ReturnType<typeof useDateFormatter>,\n) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n return dateFormatter.formatPayPeriod(payPeriod.startDate, payPeriod.endDate)\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollConfigurationPresentation = ({\n employeeCompensations,\n employeeDetails,\n payPeriod,\n paySchedule,\n onEdit,\n onToggleExclude,\n onCalculatePayroll,\n onViewBlockers,\n isOffCycle = false,\n offCycleReason,\n alerts,\n payrollAlert,\n isPending,\n isCalculating,\n payrollBlockers = [],\n pagination,\n withReimbursements = true,\n isCalculateDisabled = false,\n}: PayrollConfigurationPresentationProps) => {\n const { Button, Heading, Text, Badge, Alert } = useComponentContext()\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const dateFormatter = useDateFormatter()\n const formatEmployeePayRate = useFormatEmployeePayRate()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeName = (employeeUuid: string) => {\n const employee = employeeMap.get(employeeUuid)\n return employee\n ? firstLastName({ first_name: employee.firstName, last_name: employee.lastName })\n : null\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={32}>\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'space-between' : 'normal'}\n alignItems={isDesktop ? 'center' : 'stretch'}\n gap={isDesktop ? 0 : 16}\n >\n <FlexItem>\n <Heading as=\"h1\">{t('pageTitle')}</Heading>\n {payPeriod && (\n <Text variant=\"supporting\">\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={{\n ...getPayrollConfigurationTitle(payPeriod, dateFormatter),\n payrollType: getPayrollTypeLabel({ offCycle: isOffCycle, offCycleReason }),\n }}\n />\n </Text>\n )}\n </FlexItem>\n <FlexItem flexGrow={isDesktop ? 0 : 0}>\n {isDesktop ? (\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isCalculateDisabled || isPending || isCalculating}\n >\n {isCalculating ? t('calculatingPayroll') : t('calculatePayroll')}\n </Button>\n ) : (\n <Flex flexDirection=\"column\" justifyContent=\"normal\" alignItems=\"stretch\" gap={12}>\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isCalculateDisabled || isPending || isCalculating}\n >\n {isCalculating ? t('calculatingPayroll') : t('calculatePayroll')}\n </Button>\n </Flex>\n )}\n </FlexItem>\n </Flex>\n\n {(alerts || payrollAlert) && (\n <Grid gap={16} gridTemplateColumns=\"1fr\">\n {payrollAlert && (\n <Alert label={payrollAlert.label} status={payrollAlert.variant}>\n {payrollAlert.content}\n </Alert>\n )}\n {alerts}\n </Grid>\n )}\n\n {isPending ? (\n <PayrollLoading\n title={isCalculating ? t('calculatingTitle') : t('loadingTitle')}\n description={isCalculating ? t('calculatingDescription') : t('loadingDescription')}\n />\n ) : (\n <>\n {payrollBlockers.length > 0 && (\n <PayrollBlockerAlerts\n blockers={payrollBlockers}\n onViewBlockersClick={onViewBlockers}\n />\n )}\n <Flex flexDirection=\"column\" gap={20}>\n <FlexItem>\n <Heading as=\"h3\">{t('hoursAndEarningsTitle')}</Heading>\n <Text variant=\"supporting\">{t('hoursAndEarningsDescription')}</Text>\n </FlexItem>\n\n <DataView\n label={t('employeeCompensationsTitle')}\n columns={[\n {\n title: t('tableColumns.employees'),\n render: (item: EmployeeCompensations) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const payRateDisplay = formatEmployeePayRate(employee)\n return (\n <Flex flexDirection=\"column\" gap={0}>\n {getEmployeeName(item.employeeUuid || '')}\n {payRateDisplay && (\n <Text size=\"xs\" variant=\"supporting\">\n {payRateDisplay}\n </Text>\n )}\n {item.excluded && <Badge status=\"warning\">{t('skippedBadge')}</Badge>}\n </Flex>\n )\n },\n },\n {\n title: t('tableColumns.hours'),\n render: (item: EmployeeCompensations) => {\n const hours = getRegularHours(item)\n const overtimeHours = getOvertimeHours(item)\n return formatHoursDisplay(hours + overtimeHours)\n },\n },\n {\n title: t('tableColumns.timeOff'),\n render: (item: EmployeeCompensations) => {\n const ptoHours = getTotalPtoHours(item)\n return formatHoursDisplay(ptoHours)\n },\n },\n {\n title: t('tableColumns.additionalEarnings'),\n render: (item: EmployeeCompensations) => {\n const earnings = getAdditionalEarnings(item)\n return formatNumberAsCurrency(earnings)\n },\n },\n ...(withReimbursements\n ? [\n {\n title: t('tableColumns.reimbursements'),\n render: (item: EmployeeCompensations) => {\n const reimbursements = getReimbursements(item)\n return formatNumberAsCurrency(reimbursements)\n },\n },\n ]\n : []),\n {\n title: t('tableColumns.totalPay'),\n render: (item: PayrollEmployeeCompensationsType) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const calculatedGrossPay = employee\n ? calculateGrossPay(\n item,\n employee,\n payPeriod?.startDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n return formatNumberAsCurrency(calculatedGrossPay)\n },\n },\n ]}\n data={employeeCompensations}\n itemMenu={(item: EmployeeCompensations) => (\n <HamburgerMenu\n items={[\n {\n label: t('editMenu.edit'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onEdit(employee)\n }\n },\n },\n {\n label: t(item.excluded ? 'editMenu.unskip' : 'editMenu.skip'),\n icon: item.excluded ? <PlusCircle aria-hidden /> : <XCircle aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onToggleExclude(item)\n }\n },\n },\n ]}\n triggerLabel={t('editMenu.edit')}\n />\n )}\n pagination={pagination}\n />\n </Flex>\n </>\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["getPayrollConfigurationTitle","payPeriod","dateFormatter","PayrollConfigurationPresentation","employeeCompensations","employeeDetails","paySchedule","onEdit","onToggleExclude","onCalculatePayroll","onViewBlockers","isOffCycle","offCycleReason","alerts","payrollAlert","isPending","isCalculating","payrollBlockers","pagination","withReimbursements","isCalculateDisabled","Button","Heading","Text","Badge","Alert","useComponentContext","useI18n","useTranslation","useDateFormatter","formatEmployeePayRate","useFormatEmployeePayRate","containerRef","useRef","isDesktop","useContainerBreakpoints","employeeMap","employee","getEmployeeName","employeeUuid","firstLastName","jsx","styles","jsxs","Flex","FlexItem","Trans","getPayrollTypeLabel","Grid","PayrollLoading","Fragment","PayrollBlockerAlerts","DataView","item","payRateDisplay","hours","getRegularHours","overtimeHours","getOvertimeHours","formatHoursDisplay","ptoHours","getTotalPtoHours","earnings","getAdditionalEarnings","formatNumberAsCurrency","reimbursements","getReimbursements","calculatedGrossPay","calculateGrossPay","HamburgerMenu","PencilSvg","PlusCircle","XCircle"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2DA,MAAMA,KAA+B,CACnCC,GACAC,MAEID,GAAW,aAAaA,EAAU,UAC7BC,EAAc,gBAAgBD,EAAU,WAAWA,EAAU,OAAO,IAEtE,EAAE,WAAW,IAAI,SAAS,GAAA,GAGtBE,KAAmC,CAAC;AAAA,EAC/C,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAJ;AAAA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YACN,UAAU,CAACiD,MACT,gBAAAZ;AAAA,cAAC4B;AAAA,cAAA;AAAA,gBACC,OAAO;AAAA,kBACL;AAAA,oBACE,OAAO,EAAE,eAAe;AAAA,oBACxB,MAAM,gBAAA5B,EAAC6B,IAAA,EAAU,eAAW,GAAA,CAAC;AAAA,oBAC7B,SAAS,MAAM;AACb,4BAAMjC,IAAWD,EAAY,IAAIiB,EAAK,gBAAgB,EAAE;AACxD,sBAAIhB,KACF9B,EAAO8B,CAAQ;AAAA,oBAEnB;AAAA,kBAAA;AAAA,kBAEF;AAAA,oBACE,OAAO,EAAEgB,EAAK,WAAW,oBAAoB,eAAe;AAAA,oBAC5D,MAAMA,EAAK,WAAW,gBAAAZ,EAAC8B,IAAA,EAAW,eAAW,GAAA,CAAC,IAAK,gBAAA9B,EAAC+B,IAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,oBACxE,SAAS,MAAM;AAEb,sBADiBpC,EAAY,IAAIiB,EAAK,gBAAgB,EAAE,KAEtD7C,EAAgB6C,CAAI;AAAA,oBAExB;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEF,cAAc,EAAE,eAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAGnC,YAAAnC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollConfigurationPresentation.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useRef } from 'react'\nimport type { EmployeeCompensations } from '@gusto/embedded-api/models/components/payroll'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport {\n useFormatEmployeePayRate,\n getRegularHours,\n getOvertimeHours,\n getTotalPtoHours,\n getAdditionalEarnings,\n getReimbursements,\n formatHoursDisplay,\n calculateGrossPay,\n getPayrollTypeLabel,\n} from '../helpers'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport styles from './PayrollConfigurationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { DataView, Flex, FlexItem, Grid, PayrollLoading } from '@/components/Common'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport XCircle from '@/assets/icons/x-circle.svg?react'\nimport PlusCircle from '@/assets/icons/plus-circle.svg?react'\nimport { firstLastName, formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollConfigurationPresentationProps {\n employeeCompensations: EmployeeCompensations[]\n employeeDetails: Employee[]\n payPeriod?: PayrollPayPeriodType\n paySchedule?: PayScheduleObject\n onCalculatePayroll: () => void\n onEdit: (employee: Employee) => void\n onToggleExclude: (employeeCompensation: PayrollEmployeeCompensationsType) => void\n onViewBlockers: () => void\n isOffCycle?: boolean\n offCycleReason?: string | null\n alerts?: ReactNode\n payrollAlert?: {\n label: string\n content?: ReactNode\n variant: 'info' | 'warning'\n }\n isPending?: boolean\n isCalculating?: boolean\n payrollBlockers?: ApiPayrollBlocker[]\n pagination?: PaginationControlProps\n withReimbursements?: boolean\n isCalculateDisabled?: boolean\n}\n\nconst getPayrollConfigurationTitle = (\n payPeriod: PayrollPayPeriodType | undefined,\n dateFormatter: ReturnType<typeof useDateFormatter>,\n) => {\n if (payPeriod?.startDate && payPeriod.endDate) {\n return dateFormatter.formatPayPeriod(payPeriod.startDate, payPeriod.endDate)\n }\n return { startDate: '', endDate: '' }\n}\n\nexport const PayrollConfigurationPresentation = ({\n employeeCompensations,\n employeeDetails,\n payPeriod,\n paySchedule,\n onEdit,\n onToggleExclude,\n onCalculatePayroll,\n onViewBlockers,\n isOffCycle = false,\n offCycleReason,\n alerts,\n payrollAlert,\n isPending,\n isCalculating,\n payrollBlockers = [],\n pagination,\n withReimbursements = true,\n isCalculateDisabled = false,\n}: PayrollConfigurationPresentationProps) => {\n const { Button, Heading, Text, Badge, Alert } = useComponentContext()\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const dateFormatter = useDateFormatter()\n const formatEmployeePayRate = useFormatEmployeePayRate()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n\n const employeeMap = new Map(employeeDetails.map(employee => [employee.uuid, employee]))\n\n const getEmployeeName = (employeeUuid: string) => {\n const employee = employeeMap.get(employeeUuid)\n return employee\n ? firstLastName({ first_name: employee.firstName, last_name: employee.lastName })\n : null\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={32}>\n <Flex\n flexDirection={isDesktop ? 'row' : 'column'}\n justifyContent={isDesktop ? 'space-between' : 'normal'}\n alignItems={isDesktop ? 'center' : 'stretch'}\n gap={isDesktop ? 0 : 16}\n >\n <FlexItem>\n <Heading as=\"h1\">{t('pageTitle')}</Heading>\n {payPeriod && (\n <Text variant=\"supporting\">\n <Trans\n i18nKey=\"description\"\n t={t}\n components={{ dateWrapper: <Text weight=\"bold\" as=\"span\" /> }}\n values={{\n ...getPayrollConfigurationTitle(payPeriod, dateFormatter),\n payrollType: getPayrollTypeLabel({ offCycle: isOffCycle, offCycleReason }),\n }}\n />\n </Text>\n )}\n </FlexItem>\n <FlexItem flexGrow={isDesktop ? 0 : 0}>\n {isDesktop ? (\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isCalculateDisabled || isPending || isCalculating}\n >\n {isCalculating ? t('calculatingPayroll') : t('calculatePayroll')}\n </Button>\n ) : (\n <Flex flexDirection=\"column\" justifyContent=\"normal\" alignItems=\"stretch\" gap={12}>\n <Button\n title={t('calculatePayrollTitle')}\n onClick={onCalculatePayroll}\n isDisabled={isCalculateDisabled || isPending || isCalculating}\n >\n {isCalculating ? t('calculatingPayroll') : t('calculatePayroll')}\n </Button>\n </Flex>\n )}\n </FlexItem>\n </Flex>\n\n {(alerts || payrollAlert) && (\n <Grid gap={16} gridTemplateColumns=\"1fr\">\n {payrollAlert && (\n <Alert label={payrollAlert.label} status={payrollAlert.variant}>\n {payrollAlert.content}\n </Alert>\n )}\n {alerts}\n </Grid>\n )}\n\n {isPending ? (\n <PayrollLoading\n title={isCalculating ? t('calculatingTitle') : t('loadingTitle')}\n description={isCalculating ? t('calculatingDescription') : t('loadingDescription')}\n />\n ) : (\n <>\n {payrollBlockers.length > 0 && (\n <PayrollBlockerAlerts\n blockers={payrollBlockers}\n onViewBlockersClick={onViewBlockers}\n />\n )}\n <Flex flexDirection=\"column\" gap={20}>\n <FlexItem>\n <Heading as=\"h3\">{t('hoursAndEarningsTitle')}</Heading>\n <Text variant=\"supporting\">{t('hoursAndEarningsDescription')}</Text>\n </FlexItem>\n\n <DataView\n label={t('employeeCompensationsTitle')}\n columns={[\n {\n title: t('tableColumns.employees'),\n render: (item: EmployeeCompensations) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const payRateDisplay = formatEmployeePayRate(employee)\n return (\n <Flex flexDirection=\"column\" gap={0}>\n {getEmployeeName(item.employeeUuid || '')}\n {payRateDisplay && (\n <Text size=\"xs\" variant=\"supporting\">\n {payRateDisplay}\n </Text>\n )}\n {item.excluded && <Badge status=\"warning\">{t('skippedBadge')}</Badge>}\n </Flex>\n )\n },\n },\n {\n title: t('tableColumns.hours'),\n render: (item: EmployeeCompensations) => {\n const hours = getRegularHours(item)\n const overtimeHours = getOvertimeHours(item)\n return formatHoursDisplay(hours + overtimeHours)\n },\n },\n {\n title: t('tableColumns.timeOff'),\n render: (item: EmployeeCompensations) => {\n const ptoHours = getTotalPtoHours(item)\n return formatHoursDisplay(ptoHours)\n },\n },\n {\n title: t('tableColumns.additionalEarnings'),\n render: (item: EmployeeCompensations) => {\n const earnings = getAdditionalEarnings(item)\n return formatNumberAsCurrency(earnings)\n },\n },\n ...(withReimbursements\n ? [\n {\n title: t('tableColumns.reimbursements'),\n render: (item: EmployeeCompensations) => {\n const reimbursements = getReimbursements(item)\n return formatNumberAsCurrency(reimbursements)\n },\n },\n ]\n : []),\n {\n title: t('tableColumns.totalPay'),\n render: (item: PayrollEmployeeCompensationsType) => {\n const employee = employeeMap.get(item.employeeUuid || '')\n const calculatedGrossPay = employee\n ? calculateGrossPay(\n item,\n employee,\n payPeriod?.startDate,\n paySchedule,\n isOffCycle,\n )\n : 0\n return formatNumberAsCurrency(calculatedGrossPay)\n },\n },\n ]}\n data={employeeCompensations}\n itemMenu={(item: EmployeeCompensations) => (\n <HamburgerMenu\n items={[\n {\n label: t('editMenu.edit'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onEdit(employee)\n }\n },\n },\n {\n label: t(item.excluded ? 'editMenu.unskip' : 'editMenu.skip'),\n icon: item.excluded ? <PlusCircle aria-hidden /> : <XCircle aria-hidden />,\n onClick: () => {\n const employee = employeeMap.get(item.employeeUuid || '')\n if (employee) {\n onToggleExclude(item)\n }\n },\n },\n ]}\n triggerLabel={t('editMenu.edit')}\n />\n )}\n pagination={pagination}\n />\n </Flex>\n </>\n )}\n </Flex>\n </div>\n )\n}\n"],"names":["getPayrollConfigurationTitle","payPeriod","dateFormatter","PayrollConfigurationPresentation","employeeCompensations","employeeDetails","paySchedule","onEdit","onToggleExclude","onCalculatePayroll","onViewBlockers","isOffCycle","offCycleReason","alerts","payrollAlert","isPending","isCalculating","payrollBlockers","pagination","withReimbursements","isCalculateDisabled","Button","Heading","Text","Badge","Alert","useComponentContext","useI18n","useTranslation","useDateFormatter","formatEmployeePayRate","useFormatEmployeePayRate","containerRef","useRef","isDesktop","useContainerBreakpoints","employeeMap","employee","getEmployeeName","employeeUuid","firstLastName","jsx","styles","jsxs","Flex","FlexItem","Trans","getPayrollTypeLabel","Grid","PayrollLoading","Fragment","PayrollBlockerAlerts","DataView","item","payRateDisplay","hours","getRegularHours","overtimeHours","getOvertimeHours","formatHoursDisplay","ptoHours","getTotalPtoHours","earnings","getAdditionalEarnings","formatNumberAsCurrency","reimbursements","getReimbursements","calculatedGrossPay","calculateGrossPay","HamburgerMenu","PencilSvg","PlusCircle","XCircle"],"mappings":";;;;;;;;;;;;;;;;;;;AA2DA,MAAMA,KAA+B,CACnCC,GACAC,MAEID,GAAW,aAAaA,EAAU,UAC7BC,EAAc,gBAAgBD,EAAU,WAAWA,EAAU,OAAO,IAEtE,EAAE,WAAW,IAAI,SAAS,GAAA,GAGtBE,KAAmC,CAAC;AAAA,EAC/C,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAJ;AAAA,EACA,aAAAK;AAAA,EACA,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,gBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC,IAAkB,CAAA;AAAA,EAClB,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,qBAAAC,IAAsB;AACxB,MAA6C;AAC3C,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,GAAO,OAAA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AAAA,oBAC5D,MAAMA,EAAK,WAAW,gBAAAZ,EAAC8B,IAAA,EAAW,eAAW,GAAA,CAAC,IAAK,gBAAA9B,EAAC+B,IAAA,EAAQ,eAAW,GAAA,CAAC;AAAA,oBACxE,SAAS,MAAM;AAEb,sBADiBpC,EAAY,IAAIiB,EAAK,gBAAgB,EAAE,KAEtD7C,EAAgB6C,CAAI;AAAA,oBAExB;AAAA,kBAAA;AAAA,gBACF;AAAA,gBAEF,cAAc,EAAE,eAAe;AAAA,cAAA;AAAA,YAAA;AAAA,YAGnC,YAAAnC;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
@@ -18,12 +18,12 @@ const v = ({
|
|
|
18
18
|
payrollId: a,
|
|
19
19
|
onEvent: m,
|
|
20
20
|
dictionary: c,
|
|
21
|
-
withReimbursements:
|
|
21
|
+
withReimbursements: u = !0
|
|
22
22
|
}) => {
|
|
23
23
|
M("Payroll.PayrollEditEmployee", c);
|
|
24
|
-
const { LoadingIndicator:
|
|
24
|
+
const { LoadingIndicator: y, baseSubmitHandler: d } = N(), { data: f } = O({ employeeId: e }), { data: P } = R({
|
|
25
25
|
employeeId: e
|
|
26
|
-
}), E = g(() => [e], []), { preparedPayroll: t, paySchedule: C, isLoading: L } = x({
|
|
26
|
+
}), E = g(() => [e], [e]), { preparedPayroll: t, paySchedule: C, isLoading: L } = x({
|
|
27
27
|
companyId: s,
|
|
28
28
|
payrollId: a,
|
|
29
29
|
employeeUuids: E
|
|
@@ -55,7 +55,7 @@ const v = ({
|
|
|
55
55
|
}, k = () => {
|
|
56
56
|
m(p.RUN_PAYROLL_EMPLOYEE_CANCELLED);
|
|
57
57
|
};
|
|
58
|
-
return L ? /* @__PURE__ */ r(
|
|
58
|
+
return L ? /* @__PURE__ */ r(y, {}) : /* @__PURE__ */ r(
|
|
59
59
|
B,
|
|
60
60
|
{
|
|
61
61
|
onSave: h,
|
|
@@ -67,7 +67,7 @@ const v = ({
|
|
|
67
67
|
payPeriodStartDate: t?.payPeriod?.startDate,
|
|
68
68
|
paySchedule: C,
|
|
69
69
|
isOffCycle: t?.offCycle,
|
|
70
|
-
withReimbursements:
|
|
70
|
+
withReimbursements: u,
|
|
71
71
|
hasDirectDepositSetup: b
|
|
72
72
|
}
|
|
73
73
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollEditEmployee.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.tsx"],"sourcesContent":["import { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeePaymentMethodsGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { useMemo } from 'react'\nimport { usePreparedPayrollData } from '../usePreparedPayrollData'\nimport { PayrollEditEmployeePresentation } from './PayrollEditEmployeePresentation'\nimport { componentEvents } from '@/shared/constants'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\nimport { useBase } from '@/components/Base/useBase'\n\ninterface PayrollEditEmployeeProps extends BaseComponentInterface<'Payroll.PayrollEditEmployee'> {\n employeeId: string\n companyId: string\n payrollId: string\n withReimbursements?: boolean\n}\n\nexport function PayrollEditEmployee(props: PayrollEditEmployeeProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n employeeId,\n companyId,\n payrollId,\n onEvent,\n dictionary,\n withReimbursements = true,\n}: PayrollEditEmployeeProps) => {\n useComponentDictionary('Payroll.PayrollEditEmployee', dictionary)\n\n const { LoadingIndicator, baseSubmitHandler } = useBase()\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const { data: bankAccountsList } = useEmployeePaymentMethodsGetBankAccountsSuspense({\n employeeId,\n })\n const memoizedEmployeeId = useMemo(() => [employeeId], [])\n const { preparedPayroll, paySchedule, isLoading } = usePreparedPayrollData({\n companyId,\n payrollId,\n employeeUuids: memoizedEmployeeId,\n })\n\n const { mutateAsync: updatePayroll, isPending } = usePayrollsUpdateMutation()\n\n const employee = employeeData.employee!\n const employeeCompensation = preparedPayroll?.employeeCompensations?.at(0)\n const bankAccounts = bankAccountsList.employeeBankAccountList || []\n const hasDirectDepositSetup = bankAccounts.length > 0\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onSave = async (updatedCompensation: PayrollEmployeeCompensationsType) => {\n const transformedCompensation = transformEmployeeCompensation(updatedCompensation)\n await baseSubmitHandler(null, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [transformedCompensation],\n },\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n employee,\n })\n })\n }\n\n const onCancel = () => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED)\n }\n\n if (isLoading) {\n return <LoadingIndicator />\n }\n\n return (\n <PayrollEditEmployeePresentation\n onSave={onSave}\n onCancel={onCancel}\n employee={employee}\n isPending={isPending}\n employeeCompensation={employeeCompensation}\n fixedCompensationTypes={preparedPayroll?.fixedCompensationTypes || []}\n payPeriodStartDate={preparedPayroll?.payPeriod?.startDate}\n paySchedule={paySchedule}\n isOffCycle={preparedPayroll?.offCycle}\n withReimbursements={withReimbursements}\n hasDirectDepositSetup={hasDirectDepositSetup}\n />\n )\n}\n"],"names":["PayrollEditEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","payrollId","onEvent","dictionary","withReimbursements","useComponentDictionary","LoadingIndicator","baseSubmitHandler","useBase","employeeData","useEmployeesGetSuspense","bankAccountsList","useEmployeePaymentMethodsGetBankAccountsSuspense","memoizedEmployeeId","useMemo","preparedPayroll","paySchedule","isLoading","usePreparedPayrollData","updatePayroll","isPending","usePayrollsUpdateMutation","employee","employeeCompensation","hasDirectDepositSetup","transformEmployeeCompensation","paymentMethod","reimbursements","compensation","onSave","updatedCompensation","transformedCompensation","result","componentEvents","onCancel","PayrollEditEmployeePresentation"],"mappings":";;;;;;;;;;;AAqBO,SAASA,EAAoBC,GAA0D;AAC5F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC;AAAA,EACnB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAgC;AAC9B,EAAAC,EAAuB,+BAA+BF,CAAU;AAEhE,QAAM,EAAE,kBAAAG,GAAkB,mBAAAC,EAAA,IAAsBC,EAAA,GAE1C,EAAE,MAAMC,EAAA,IAAiBC,EAAwB,EAAE,YAAAX,GAAY,GAC/D,EAAE,MAAMY,EAAA,IAAqBC,EAAiD;AAAA,IAClF,YAAAb;AAAA,EAAA,CACD,GACKc,IAAqBC,EAAQ,MAAM,CAACf,CAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"PayrollEditEmployee.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.tsx"],"sourcesContent":["import { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeePaymentMethodsGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { useMemo } from 'react'\nimport { usePreparedPayrollData } from '../usePreparedPayrollData'\nimport { PayrollEditEmployeePresentation } from './PayrollEditEmployeePresentation'\nimport { componentEvents } from '@/shared/constants'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useComponentDictionary } from '@/i18n'\nimport { useBase } from '@/components/Base/useBase'\n\ninterface PayrollEditEmployeeProps extends BaseComponentInterface<'Payroll.PayrollEditEmployee'> {\n employeeId: string\n companyId: string\n payrollId: string\n withReimbursements?: boolean\n}\n\nexport function PayrollEditEmployee(props: PayrollEditEmployeeProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n employeeId,\n companyId,\n payrollId,\n onEvent,\n dictionary,\n withReimbursements = true,\n}: PayrollEditEmployeeProps) => {\n useComponentDictionary('Payroll.PayrollEditEmployee', dictionary)\n\n const { LoadingIndicator, baseSubmitHandler } = useBase()\n\n const { data: employeeData } = useEmployeesGetSuspense({ employeeId })\n const { data: bankAccountsList } = useEmployeePaymentMethodsGetBankAccountsSuspense({\n employeeId,\n })\n const memoizedEmployeeId = useMemo(() => [employeeId], [employeeId])\n const { preparedPayroll, paySchedule, isLoading } = usePreparedPayrollData({\n companyId,\n payrollId,\n employeeUuids: memoizedEmployeeId,\n })\n\n const { mutateAsync: updatePayroll, isPending } = usePayrollsUpdateMutation()\n\n const employee = employeeData.employee!\n const employeeCompensation = preparedPayroll?.employeeCompensations?.at(0)\n const bankAccounts = bankAccountsList.employeeBankAccountList || []\n const hasDirectDepositSetup = bankAccounts.length > 0\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onSave = async (updatedCompensation: PayrollEmployeeCompensationsType) => {\n const transformedCompensation = transformEmployeeCompensation(updatedCompensation)\n await baseSubmitHandler(null, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [transformedCompensation],\n },\n },\n })\n\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n employee,\n })\n })\n }\n\n const onCancel = () => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED)\n }\n\n if (isLoading) {\n return <LoadingIndicator />\n }\n\n return (\n <PayrollEditEmployeePresentation\n onSave={onSave}\n onCancel={onCancel}\n employee={employee}\n isPending={isPending}\n employeeCompensation={employeeCompensation}\n fixedCompensationTypes={preparedPayroll?.fixedCompensationTypes || []}\n payPeriodStartDate={preparedPayroll?.payPeriod?.startDate}\n paySchedule={paySchedule}\n isOffCycle={preparedPayroll?.offCycle}\n withReimbursements={withReimbursements}\n hasDirectDepositSetup={hasDirectDepositSetup}\n />\n )\n}\n"],"names":["PayrollEditEmployee","props","jsx","BaseComponent","Root","employeeId","companyId","payrollId","onEvent","dictionary","withReimbursements","useComponentDictionary","LoadingIndicator","baseSubmitHandler","useBase","employeeData","useEmployeesGetSuspense","bankAccountsList","useEmployeePaymentMethodsGetBankAccountsSuspense","memoizedEmployeeId","useMemo","preparedPayroll","paySchedule","isLoading","usePreparedPayrollData","updatePayroll","isPending","usePayrollsUpdateMutation","employee","employeeCompensation","hasDirectDepositSetup","transformEmployeeCompensation","paymentMethod","reimbursements","compensation","onSave","updatedCompensation","transformedCompensation","result","componentEvents","onCancel","PayrollEditEmployeePresentation"],"mappings":";;;;;;;;;;;AAqBO,SAASA,EAAoBC,GAA0D;AAC5F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,IAAO,CAAC;AAAA,EACnB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAgC;AAC9B,EAAAC,EAAuB,+BAA+BF,CAAU;AAEhE,QAAM,EAAE,kBAAAG,GAAkB,mBAAAC,EAAA,IAAsBC,EAAA,GAE1C,EAAE,MAAMC,EAAA,IAAiBC,EAAwB,EAAE,YAAAX,GAAY,GAC/D,EAAE,MAAMY,EAAA,IAAqBC,EAAiD;AAAA,IAClF,YAAAb;AAAA,EAAA,CACD,GACKc,IAAqBC,EAAQ,MAAM,CAACf,CAAU,GAAG,CAACA,CAAU,CAAC,GAC7D,EAAE,iBAAAgB,GAAiB,aAAAC,GAAa,WAAAC,EAAA,IAAcC,EAAuB;AAAA,IACzE,WAAAlB;AAAA,IACA,WAAAC;AAAA,IACA,eAAeY;AAAA,EAAA,CAChB,GAEK,EAAE,aAAaM,GAAe,WAAAC,EAAA,IAAcC,EAAA,GAE5CC,IAAWb,EAAa,UACxBc,IAAuBR,GAAiB,uBAAuB,GAAG,CAAC,GAEnES,KADeb,EAAiB,2BAA2B,CAAA,GACtB,SAAS,GAE9Cc,IAAgC,CAAC;AAAA,IACrC,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,OAEI;AAAA,IACL,GAAGA;AAAA,IACH,GAAIF,KAAiBA,MAAkB,eAAe,EAAE,eAAAA,EAAA,IAAkB,CAAA;AAAA,IAC1E,MAAME,EAAa,QAAQ;AAAA,EAAA,IAIzBC,IAAS,OAAOC,MAA0D;AAC9E,UAAMC,IAA0BN,EAA8BK,CAAmB;AACjF,UAAMvB,EAAkB,MAAM,YAAY;AACxC,YAAMyB,IAAS,MAAMb,EAAc;AAAA,QACjC,SAAS;AAAA,UACP,WAAAnB;AAAA,UACA,WAAAC;AAAA,UACA,eAAe;AAAA,YACb,uBAAuB,CAAC8B,CAAuB;AAAA,UAAA;AAAA,QACjD;AAAA,MACF,CACD;AAED,MAAA7B,EAAQ+B,EAAgB,4BAA4B;AAAA,QAClD,iBAAiBD,EAAO;AAAA,QACxB,UAAAV;AAAA,MAAA,CACD;AAAA,IACH,CAAC;AAAA,EACH,GAEMY,IAAW,MAAM;AACrB,IAAAhC,EAAQ+B,EAAgB,8BAA8B;AAAA,EACxD;AAEA,SAAIhB,sBACMX,GAAA,EAAiB,IAIzB,gBAAAV;AAAA,IAACuC;AAAA,IAAA;AAAA,MACC,QAAAN;AAAA,MACA,UAAAK;AAAA,MACA,UAAAZ;AAAA,MACA,WAAAF;AAAA,MACA,sBAAAG;AAAA,MACA,wBAAwBR,GAAiB,0BAA0B,CAAA;AAAA,MACnE,oBAAoBA,GAAiB,WAAW;AAAA,MAChD,aAAAC;AAAA,MACA,YAAYD,GAAiB;AAAA,MAC7B,oBAAAX;AAAA,MACA,uBAAAoB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -20,22 +20,12 @@ export declare const PayrollEditEmployeeFormSchema: z.ZodObject<{
|
|
|
20
20
|
hourlyCompensations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
21
21
|
timeOffCompensations: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>;
|
|
22
22
|
fixedCompensations: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNumber>>;
|
|
23
|
-
paymentMethod: z.ZodOptional<z.
|
|
23
|
+
paymentMethod: z.ZodOptional<z.ZodEnum<{
|
|
24
24
|
readonly DirectDeposit: "Direct Deposit";
|
|
25
25
|
readonly Check: "Check";
|
|
26
26
|
readonly Historical: "Historical";
|
|
27
27
|
}>>;
|
|
28
|
-
},
|
|
29
|
-
fixedCompensations: Record<string, number | undefined>;
|
|
30
|
-
hourlyCompensations: Record<string, Record<string, string | undefined>>;
|
|
31
|
-
timeOffCompensations: Record<string, string | undefined>;
|
|
32
|
-
paymentMethod?: "Check" | "Direct Deposit" | "Historical" | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
fixedCompensations: Record<string, number | undefined>;
|
|
35
|
-
hourlyCompensations: Record<string, Record<string, string | undefined>>;
|
|
36
|
-
timeOffCompensations: Record<string, string | undefined>;
|
|
37
|
-
paymentMethod?: "Check" | "Direct Deposit" | "Historical" | undefined;
|
|
38
|
-
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
39
29
|
export type PayrollEditEmployeeFormValues = z.infer<typeof PayrollEditEmployeeFormSchema>;
|
|
40
30
|
export declare const PayrollEditEmployeePresentation: ({ onSave, onCancel, employee, employeeCompensation, isPending, fixedCompensationTypes, payPeriodStartDate, paySchedule, isOffCycle, withReimbursements, hasDirectDepositSetup, }: PayrollEditEmployeeProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
31
|
export {};
|