@gusto/embedded-react-sdk 0.31.1-rc.1 → 0.32.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 +40 -0
- package/dist/components/Base/Base.js +46 -45
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -3
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.js +32 -19
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -5
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +25 -22
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +4 -3
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +7 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +32 -31
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -108
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +63 -69
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +29 -29
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +28 -27
- 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 +4 -3
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -12
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -12
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +26 -24
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +32 -31
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.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 +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +15 -14
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +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 +5 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +19 -19
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +15 -14
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +4 -3
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +54 -45
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +39 -17
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +1 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +27 -33
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -1
- package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +1 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +4 -3
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +4 -3
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +27 -25
- 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/PayrollBlocker/payrollHelpers.d.ts +1 -0
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +7 -8
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +19 -17
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +38 -36
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +20 -20
- 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 +4 -3
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/helpers/apiErrorToList.js +14 -8
- package/dist/helpers/apiErrorToList.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +21 -20
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/types/i18next.d.ts +4 -0
- package/docs/reference/endpoint-inventory.json +1706 -0
- package/package.json +13 -9
|
@@ -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
|
}
|
|
@@ -16,6 +16,7 @@ export interface PayrollSubmitResult {
|
|
|
16
16
|
* Returns blockers if found, otherwise throws the error for caller to handle
|
|
17
17
|
*/
|
|
18
18
|
export declare const payrollSubmitHandler: (payrollHandler: () => Promise<void>) => Promise<PayrollSubmitResult>;
|
|
19
|
+
export declare const isActionableBlocker: (key: string) => boolean;
|
|
19
20
|
export declare const hasActionableBlockers: (blockers: ApiPayrollBlocker[]) => boolean;
|
|
20
21
|
/**
|
|
21
22
|
* Get translation keys for a blocker - use these in components with useTranslation
|
|
@@ -12,7 +12,7 @@ function a(e) {
|
|
|
12
12
|
function i(e) {
|
|
13
13
|
return l(e) ? !e.errors || e.errors.length === 0 ? [] : e.errors.map((r) => ({ key: s(r.metadata) ? r.metadata.key : r.errorKey || "unknown", message: r.message })) : a(e) ? e.errors.filter((r) => r.category === "payroll_blocker").map((r) => ({ key: s(r.metadata) ? r.metadata.key : r.errorKey || "unknown", message: r.message })) : [];
|
|
14
14
|
}
|
|
15
|
-
const y = (e) => e instanceof t ? !0 : e instanceof n ? Array.isArray(e.errors) && e.errors.some((o) => o.category === "payroll_blocker") : !1,
|
|
15
|
+
const y = (e) => e instanceof t ? !0 : e instanceof n ? Array.isArray(e.errors) && e.errors.some((o) => o.category === "payroll_blocker") : !1, p = async (e) => {
|
|
16
16
|
try {
|
|
17
17
|
return await e(), { success: !0, blockers: [] };
|
|
18
18
|
} catch (o) {
|
|
@@ -20,10 +20,8 @@ const y = (e) => e instanceof t ? !0 : e instanceof n ? Array.isArray(e.errors)
|
|
|
20
20
|
return { success: !1, blockers: i(o) };
|
|
21
21
|
throw o;
|
|
22
22
|
}
|
|
23
|
-
}, u = ["pending_information_request", "pending_recovery_case"],
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
function m(e) {
|
|
23
|
+
}, u = ["pending_information_request", "pending_recovery_case"], k = (e) => u.includes(e), m = (e) => e.some((o) => k(o.key));
|
|
24
|
+
function g(e) {
|
|
27
25
|
return {
|
|
28
26
|
titleKey: `blockers.${e}.title`,
|
|
29
27
|
descriptionKey: `blockers.${e}.description`,
|
|
@@ -32,11 +30,12 @@ function m(e) {
|
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
32
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
g as getBlockerTranslationKeys,
|
|
34
|
+
m as hasActionableBlockers,
|
|
35
|
+
k as isActionableBlocker,
|
|
37
36
|
l as isPayrollBlockersError,
|
|
38
37
|
a as isUnprocessableEntityWithPayrollBlockers,
|
|
39
38
|
i as parsePayrollBlockersFromError,
|
|
40
|
-
|
|
39
|
+
p as payrollSubmitHandler
|
|
41
40
|
};
|
|
42
41
|
//# sourceMappingURL=payrollHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollHelpers.js","sources":["../../../../src/components/Payroll/PayrollBlocker/payrollHelpers.ts"],"sourcesContent":["import { PayrollBlockersError } from '@gusto/embedded-api/models/errors/payrollblockerserror'\nimport { UnprocessableEntityErrorObject1 } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject1'\n\nfunction hasMetadataKey(metadata: unknown): metadata is { key: string } {\n return (\n typeof metadata === 'object' &&\n metadata !== null &&\n 'key' in metadata &&\n typeof (metadata as { key: unknown }).key === 'string'\n )\n}\n\nexport interface ApiPayrollBlocker {\n key: string\n message?: string\n}\n\nexport function isPayrollBlockersError(error: unknown): error is PayrollBlockersError {\n return error instanceof PayrollBlockersError\n}\n\nexport function isUnprocessableEntityWithPayrollBlockers(\n error: unknown,\n): error is UnprocessableEntityErrorObject1 {\n return (\n error instanceof UnprocessableEntityErrorObject1 &&\n Array.isArray(error.errors) &&\n error.errors.some(err => err.category === 'payroll_blocker')\n )\n}\n\nexport function parsePayrollBlockersFromError(error: unknown): ApiPayrollBlocker[] {\n // Handle PayrollBlockersError (dedicated blocker error type)\n if (isPayrollBlockersError(error)) {\n if (!error.errors || error.errors.length === 0) {\n return []\n }\n\n const blockers = error.errors.map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n // Handle UnprocessableEntityErrorObject1 with payroll blockers\n if (isUnprocessableEntityWithPayrollBlockers(error)) {\n const blockers = error.errors\n .filter(err => err.category === 'payroll_blocker')\n .map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n return []\n}\n\ntype PayrollBlockerError = PayrollBlockersError | UnprocessableEntityErrorObject1\n\nconst hasPayrollBlockers = (error: unknown): error is PayrollBlockerError => {\n if (error instanceof PayrollBlockersError) {\n return true\n }\n if (error instanceof UnprocessableEntityErrorObject1) {\n return (\n Array.isArray(error.errors) && error.errors.some(err => err.category === 'payroll_blocker')\n )\n }\n return false\n}\n\nexport interface PayrollSubmitResult {\n success: boolean\n blockers: ApiPayrollBlocker[]\n}\n\n/**\n * Direct submit handler for payroll operations that handles payroll blockers\n * Returns blockers if found, otherwise throws the error for caller to handle\n */\nexport const payrollSubmitHandler = async (\n payrollHandler: () => Promise<void>,\n): Promise<PayrollSubmitResult> => {\n try {\n await payrollHandler()\n return { success: true, blockers: [] }\n } catch (error: unknown) {\n if (hasPayrollBlockers(error)) {\n const blockers = parsePayrollBlockersFromError(error)\n return { success: false, blockers }\n }\n\n // For non-payroll errors, re-throw\n throw error\n }\n}\n\nconst ACTIONABLE_BLOCKER_KEYS = ['pending_information_request', 'pending_recovery_case'] as const\n\nexport const
|
|
1
|
+
{"version":3,"file":"payrollHelpers.js","sources":["../../../../src/components/Payroll/PayrollBlocker/payrollHelpers.ts"],"sourcesContent":["import { PayrollBlockersError } from '@gusto/embedded-api/models/errors/payrollblockerserror'\nimport { UnprocessableEntityErrorObject1 } from '@gusto/embedded-api/models/errors/unprocessableentityerrorobject1'\n\nfunction hasMetadataKey(metadata: unknown): metadata is { key: string } {\n return (\n typeof metadata === 'object' &&\n metadata !== null &&\n 'key' in metadata &&\n typeof (metadata as { key: unknown }).key === 'string'\n )\n}\n\nexport interface ApiPayrollBlocker {\n key: string\n message?: string\n}\n\nexport function isPayrollBlockersError(error: unknown): error is PayrollBlockersError {\n return error instanceof PayrollBlockersError\n}\n\nexport function isUnprocessableEntityWithPayrollBlockers(\n error: unknown,\n): error is UnprocessableEntityErrorObject1 {\n return (\n error instanceof UnprocessableEntityErrorObject1 &&\n Array.isArray(error.errors) &&\n error.errors.some(err => err.category === 'payroll_blocker')\n )\n}\n\nexport function parsePayrollBlockersFromError(error: unknown): ApiPayrollBlocker[] {\n // Handle PayrollBlockersError (dedicated blocker error type)\n if (isPayrollBlockersError(error)) {\n if (!error.errors || error.errors.length === 0) {\n return []\n }\n\n const blockers = error.errors.map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n // Handle UnprocessableEntityErrorObject1 with payroll blockers\n if (isUnprocessableEntityWithPayrollBlockers(error)) {\n const blockers = error.errors\n .filter(err => err.category === 'payroll_blocker')\n .map(err => {\n const key = hasMetadataKey(err.metadata) ? err.metadata.key : err.errorKey || 'unknown'\n\n return { key, message: err.message }\n })\n\n return blockers\n }\n\n return []\n}\n\ntype PayrollBlockerError = PayrollBlockersError | UnprocessableEntityErrorObject1\n\nconst hasPayrollBlockers = (error: unknown): error is PayrollBlockerError => {\n if (error instanceof PayrollBlockersError) {\n return true\n }\n if (error instanceof UnprocessableEntityErrorObject1) {\n return (\n Array.isArray(error.errors) && error.errors.some(err => err.category === 'payroll_blocker')\n )\n }\n return false\n}\n\nexport interface PayrollSubmitResult {\n success: boolean\n blockers: ApiPayrollBlocker[]\n}\n\n/**\n * Direct submit handler for payroll operations that handles payroll blockers\n * Returns blockers if found, otherwise throws the error for caller to handle\n */\nexport const payrollSubmitHandler = async (\n payrollHandler: () => Promise<void>,\n): Promise<PayrollSubmitResult> => {\n try {\n await payrollHandler()\n return { success: true, blockers: [] }\n } catch (error: unknown) {\n if (hasPayrollBlockers(error)) {\n const blockers = parsePayrollBlockersFromError(error)\n return { success: false, blockers }\n }\n\n // For non-payroll errors, re-throw\n throw error\n }\n}\n\nconst ACTIONABLE_BLOCKER_KEYS = ['pending_information_request', 'pending_recovery_case'] as const\n\nexport const isActionableBlocker = (key: string) =>\n ACTIONABLE_BLOCKER_KEYS.includes(key as (typeof ACTIONABLE_BLOCKER_KEYS)[number])\n\nexport const hasActionableBlockers = (blockers: ApiPayrollBlocker[]) =>\n blockers.some(b => isActionableBlocker(b.key))\n\n/**\n * Get translation keys for a blocker - use these in components with useTranslation\n */\nexport function getBlockerTranslationKeys(key: string) {\n return {\n titleKey: `blockers.${key}.title`,\n descriptionKey: `blockers.${key}.description`,\n helpTextKey: `blockers.${key}.help`,\n defaultActionKey: `blockers.${key}.defaultAction`,\n }\n}\n"],"names":["hasMetadataKey","metadata","isPayrollBlockersError","error","PayrollBlockersError","isUnprocessableEntityWithPayrollBlockers","UnprocessableEntityErrorObject1","err","parsePayrollBlockersFromError","hasPayrollBlockers","payrollSubmitHandler","payrollHandler","ACTIONABLE_BLOCKER_KEYS","isActionableBlocker","key","hasActionableBlockers","blockers","b","getBlockerTranslationKeys"],"mappings":";;AAGA,SAASA,EAAeC,GAAgD;AACtE,SACE,OAAOA,KAAa,YACpBA,MAAa,QACb,SAASA,KACT,OAAQA,EAA8B,OAAQ;AAElD;AAOO,SAASC,EAAuBC,GAA+C;AACpF,SAAOA,aAAiBC;AAC1B;AAEO,SAASC,EACdF,GAC0C;AAC1C,SACEA,aAAiBG,KACjB,MAAM,QAAQH,EAAM,MAAM,KAC1BA,EAAM,OAAO,KAAK,CAAAI,MAAOA,EAAI,aAAa,iBAAiB;AAE/D;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AA,EAAA;AAErC;"}
|
|
@@ -9,16 +9,16 @@ import u from "./PayrollEditEmployeePresentation.module.scss.js";
|
|
|
9
9
|
import { TimeOffField as ne } from "./TimeOffField.js";
|
|
10
10
|
import { Flex as x } from "../../Common/Flex/Flex.js";
|
|
11
11
|
import { Grid as P } from "../../Common/Grid/Grid.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
12
|
+
import { RadioGroupField as re } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
13
|
+
import { TextInputField as ie } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
14
|
+
import { NumberInputField as G } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
15
|
+
import { useComponentContext as oe } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { useI18n as se } from "../../../i18n/I18n.js";
|
|
17
|
+
import { Form as ae } from "../../Common/Form/Form.js";
|
|
18
|
+
import { firstLastName as me, formatNumberAsCurrency as le } from "../../../helpers/formattedStrings.js";
|
|
19
|
+
import { getAdditionalEarningsCompensations as de, getReimbursementCompensation as ue, calculateGrossPay as k } from "../helpers.js";
|
|
20
|
+
import { HOURS_COMPENSATION_NAMES as w, EXCLUDED_ADDITIONAL_EARNINGS as ce, COMPENSATION_NAME_DOUBLE_OVERTIME as pe, COMPENSATION_NAME_OVERTIME as fe, COMPENSATION_NAME_REGULAR_HOURS as he, COMPENSATION_NAME_REIMBURSEMENT as Ce, COMPENSATION_NAME_CASH_TIPS as Ne, COMPENSATION_NAME_COMMISSION as Ee, COMPENSATION_NAME_CORRECTION_PAYMENT as ge, COMPENSATION_NAME_PAYCHECK_TIPS as be, COMPENSATION_NAME_BONUS as Me } from "../../../shared/constants.js";
|
|
21
|
+
import Oe from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
22
22
|
const Te = m.object({
|
|
23
23
|
hourlyCompensations: m.record(m.string(), m.record(m.string(), m.string().optional())),
|
|
24
24
|
timeOffCompensations: m.record(m.string(), m.string().optional()),
|
|
@@ -72,22 +72,22 @@ const Te = m.object({
|
|
|
72
72
|
withReimbursements: M = !0,
|
|
73
73
|
hasDirectDepositSetup: $ = !0
|
|
74
74
|
}) => {
|
|
75
|
-
const { Button: v, Heading: c, Text: B } =
|
|
76
|
-
|
|
77
|
-
const f = l.jobs?.find((e) => e.primary), O = f ? [f] : [], F = Z(null), p =
|
|
75
|
+
const { Button: v, Heading: c, Text: B } = oe(), { t } = ee("Payroll.PayrollEditEmployee");
|
|
76
|
+
se("Payroll.PayrollEditEmployee");
|
|
77
|
+
const f = l.jobs?.find((e) => e.primary), O = f ? [f] : [], F = Z(null), p = Oe({
|
|
78
78
|
ref: F
|
|
79
79
|
}).includes("small");
|
|
80
80
|
o?.hourlyCompensations?.forEach((e) => {
|
|
81
81
|
const n = l.jobs?.find((s) => s.uuid === e.jobUuid);
|
|
82
82
|
n && !O.find((s) => s.uuid === n.uuid) && O.push(n);
|
|
83
83
|
});
|
|
84
|
-
const A = (o?.paidTimeOff || []).filter((e) => e.name), _ =
|
|
84
|
+
const A = (o?.paidTimeOff || []).filter((e) => e.name), _ = de({
|
|
85
85
|
flsaStatus: f?.compensations?.[0]?.flsaStatus,
|
|
86
86
|
existingFixedCompensations: o?.fixedCompensations || [],
|
|
87
87
|
primaryJobUuid: f?.uuid,
|
|
88
88
|
fixedCompensationTypes: b,
|
|
89
|
-
excludedTypes:
|
|
90
|
-
}), N = M ?
|
|
89
|
+
excludedTypes: ce
|
|
90
|
+
}), N = M ? ue(
|
|
91
91
|
o?.fixedCompensations || [],
|
|
92
92
|
b,
|
|
93
93
|
f?.uuid
|
|
@@ -95,28 +95,28 @@ const Te = m.object({
|
|
|
95
95
|
(s) => s.jobUuid === e && s.name?.toLowerCase() === n.toLowerCase()
|
|
96
96
|
), q = (e) => {
|
|
97
97
|
switch (e) {
|
|
98
|
-
case
|
|
98
|
+
case he:
|
|
99
99
|
return t("compensationNames.regularHours");
|
|
100
|
-
case
|
|
100
|
+
case fe:
|
|
101
101
|
return t("compensationNames.overtime");
|
|
102
|
-
case
|
|
102
|
+
case pe:
|
|
103
103
|
return t("compensationNames.doubleOvertime");
|
|
104
104
|
default:
|
|
105
105
|
return e;
|
|
106
106
|
}
|
|
107
107
|
}, j = (e) => {
|
|
108
108
|
switch (e) {
|
|
109
|
-
case
|
|
109
|
+
case Me:
|
|
110
110
|
return t("fixedCompensationNames.bonus");
|
|
111
|
-
case
|
|
111
|
+
case be:
|
|
112
112
|
return t("fixedCompensationNames.paycheckTips");
|
|
113
|
-
case
|
|
113
|
+
case ge:
|
|
114
114
|
return t("fixedCompensationNames.correctionPayment");
|
|
115
|
-
case
|
|
115
|
+
case Ee:
|
|
116
116
|
return t("fixedCompensationNames.commission");
|
|
117
|
-
case
|
|
117
|
+
case Ne:
|
|
118
118
|
return t("fixedCompensationNames.cashTips");
|
|
119
|
-
case
|
|
119
|
+
case Ce:
|
|
120
120
|
return t("fixedCompensationNames.reimbursement");
|
|
121
121
|
default:
|
|
122
122
|
return e;
|
|
@@ -125,7 +125,7 @@ const Te = m.object({
|
|
|
125
125
|
hourlyCompensations: (() => {
|
|
126
126
|
const e = {};
|
|
127
127
|
return O.forEach((n) => {
|
|
128
|
-
|
|
128
|
+
w.forEach((s) => {
|
|
129
129
|
const h = R(n.uuid, s);
|
|
130
130
|
h && (e[n.uuid] || (e[n.uuid] = {}), e[n.uuid][h.name] = h.hours ? parseFloat(h.hours).toString() : "");
|
|
131
131
|
});
|
|
@@ -166,7 +166,7 @@ const Te = m.object({
|
|
|
166
166
|
(o?.paidTimeOff || []).filter((h) => h.name),
|
|
167
167
|
f?.uuid
|
|
168
168
|
);
|
|
169
|
-
return
|
|
169
|
+
return k(
|
|
170
170
|
s,
|
|
171
171
|
l,
|
|
172
172
|
i,
|
|
@@ -174,7 +174,7 @@ const Te = m.object({
|
|
|
174
174
|
C
|
|
175
175
|
);
|
|
176
176
|
} catch {
|
|
177
|
-
return o ?
|
|
177
|
+
return o ? k(
|
|
178
178
|
o,
|
|
179
179
|
l,
|
|
180
180
|
i,
|
|
@@ -190,7 +190,7 @@ const Te = m.object({
|
|
|
190
190
|
i,
|
|
191
191
|
d,
|
|
192
192
|
C
|
|
193
|
-
]), W =
|
|
193
|
+
]), W = me({
|
|
194
194
|
first_name: l.firstName,
|
|
195
195
|
last_name: l.lastName
|
|
196
196
|
}), Y = (e) => {
|
|
@@ -201,7 +201,7 @@ const Te = m.object({
|
|
|
201
201
|
f?.uuid
|
|
202
202
|
);
|
|
203
203
|
E(n);
|
|
204
|
-
}, L =
|
|
204
|
+
}, L = le(z || 0), U = /* @__PURE__ */ a(
|
|
205
205
|
x,
|
|
206
206
|
{
|
|
207
207
|
flexDirection: p ? "row" : "column",
|
|
@@ -240,19 +240,19 @@ const Te = m.object({
|
|
|
240
240
|
}
|
|
241
241
|
),
|
|
242
242
|
/* @__PURE__ */ a(Q, { ...I, children: [
|
|
243
|
-
/* @__PURE__ */ a(
|
|
243
|
+
/* @__PURE__ */ a(ae, { children: [
|
|
244
244
|
O.length > 0 && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
245
245
|
/* @__PURE__ */ r(c, { as: "h3", children: t("regularHoursTitle") }),
|
|
246
246
|
O.map((e) => /* @__PURE__ */ a(x, { flexDirection: "column", gap: 8, children: [
|
|
247
247
|
O.length > 1 && /* @__PURE__ */ r(c, { as: "h4", children: e.title }),
|
|
248
|
-
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children:
|
|
248
|
+
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: w.map((n) => {
|
|
249
249
|
const s = R(
|
|
250
250
|
e.uuid,
|
|
251
251
|
n
|
|
252
252
|
);
|
|
253
253
|
if (s)
|
|
254
254
|
return /* @__PURE__ */ r(
|
|
255
|
-
|
|
255
|
+
ie,
|
|
256
256
|
{
|
|
257
257
|
type: "number",
|
|
258
258
|
min: 0,
|
|
@@ -285,7 +285,7 @@ const Te = m.object({
|
|
|
285
285
|
gridTemplateColumns: { base: "1fr", small: [320, 320], large: [320, 320, 320] },
|
|
286
286
|
gap: 20,
|
|
287
287
|
children: _.map((e) => /* @__PURE__ */ r(
|
|
288
|
-
|
|
288
|
+
G,
|
|
289
289
|
{
|
|
290
290
|
format: "currency",
|
|
291
291
|
min: 0,
|
|
@@ -301,7 +301,7 @@ const Te = m.object({
|
|
|
301
301
|
N && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
302
302
|
/* @__PURE__ */ r(c, { as: "h4", children: t("reimbursementTitle") }),
|
|
303
303
|
/* @__PURE__ */ r(P, { gridTemplateColumns: { base: "1fr", small: [320, 320] }, gap: 20, children: /* @__PURE__ */ r(
|
|
304
|
-
|
|
304
|
+
G,
|
|
305
305
|
{
|
|
306
306
|
format: "currency",
|
|
307
307
|
min: 0,
|
|
@@ -314,7 +314,7 @@ const Te = m.object({
|
|
|
314
314
|
$ && /* @__PURE__ */ a("div", { className: u.fieldGroup, children: [
|
|
315
315
|
/* @__PURE__ */ r(c, { as: "h4", children: t("paymentMethodTitle") }),
|
|
316
316
|
/* @__PURE__ */ r(
|
|
317
|
-
|
|
317
|
+
re,
|
|
318
318
|
{
|
|
319
319
|
name: "paymentMethod",
|
|
320
320
|
isRequired: !0,
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { jsxs as u, jsx as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { useTranslation as
|
|
1
|
+
import { jsxs as u, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useId as p } from "react";
|
|
3
|
+
import { useFormContext as d, useWatch as f } from "react-hook-form";
|
|
4
|
+
import { useTranslation as c } from "react-i18next";
|
|
5
5
|
import { Flex as y } from "../../Common/Flex/Flex.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { TextInputField as
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../shared/constants.js";
|
|
8
|
+
import { TextInputField as x } from "../../Common/Fields/TextInputField/TextInputField.js";
|
|
9
|
+
import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { useI18n as B } from "../../../i18n/I18n.js";
|
|
9
11
|
const P = ({
|
|
10
12
|
accrualBalance: e,
|
|
11
13
|
accrualMethod: o,
|
|
12
14
|
hoursUsed: r,
|
|
13
15
|
id: t
|
|
14
16
|
}) => {
|
|
15
|
-
const { Text: n } =
|
|
17
|
+
const { Text: n } = h(), { t: i } = c("Payroll.PayrollEditEmployee");
|
|
16
18
|
if (o === "unlimited")
|
|
17
19
|
return null;
|
|
18
20
|
const a = parseFloat(e) - r;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
},
|
|
21
|
-
const { t: r } =
|
|
22
|
-
|
|
23
|
-
const { control: t } =
|
|
21
|
+
return /* @__PURE__ */ l(n, { size: "sm", variant: "supporting", "aria-live": "polite", "aria-atomic": !0, id: t, children: i("timeOffBalance.remaining", { balance: a.toFixed(1) }) });
|
|
22
|
+
}, U = ({ timeOff: e, employee: o }) => {
|
|
23
|
+
const { t: r } = c("Payroll.PayrollEditEmployee");
|
|
24
|
+
B("Payroll.PayrollEditEmployee");
|
|
25
|
+
const { control: t } = d(), n = p(), i = f({
|
|
24
26
|
control: t,
|
|
25
27
|
name: `timeOffCompensations.${e.name}`
|
|
26
28
|
});
|
|
27
29
|
if (!e.name)
|
|
28
30
|
return null;
|
|
29
|
-
const
|
|
31
|
+
const m = parseFloat(i || "0"), a = o.eligiblePaidTimeOff?.find((s) => s.name === e.name);
|
|
30
32
|
return /* @__PURE__ */ u(y, { flexDirection: "column", gap: 4, children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
+
/* @__PURE__ */ l(
|
|
34
|
+
x,
|
|
33
35
|
{
|
|
34
36
|
name: `timeOffCompensations.${e.name}`,
|
|
35
37
|
type: "number",
|
|
@@ -41,18 +43,18 @@ const P = ({
|
|
|
41
43
|
},
|
|
42
44
|
e.name
|
|
43
45
|
),
|
|
44
|
-
a?.accrualBalance && /* @__PURE__ */
|
|
46
|
+
a?.accrualBalance && /* @__PURE__ */ l(
|
|
45
47
|
P,
|
|
46
48
|
{
|
|
47
49
|
accrualBalance: a.accrualBalance,
|
|
48
50
|
accrualMethod: a.accrualMethod ?? void 0,
|
|
49
|
-
hoursUsed:
|
|
51
|
+
hoursUsed: m,
|
|
50
52
|
id: n
|
|
51
53
|
}
|
|
52
54
|
)
|
|
53
55
|
] });
|
|
54
56
|
};
|
|
55
57
|
export {
|
|
56
|
-
|
|
58
|
+
U as TimeOffField
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=TimeOffField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeOffField.js","sources":["../../../../src/components/Payroll/PayrollEditEmployee/TimeOffField.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { useWatch, useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollEmployeeCompensationsTypePaidTimeOff } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollEditEmployeeFormValues } from './PayrollEditEmployeePresentation'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface TimeOffFieldProps {\n timeOff: PayrollEmployeeCompensationsTypePaidTimeOff\n employee: Employee\n}\n\nconst TimeOffBalance = ({\n accrualBalance,\n accrualMethod,\n hoursUsed,\n id,\n}: {\n accrualBalance: string\n accrualMethod?: string\n hoursUsed: number\n id: string\n}) => {\n const { Text } = useComponentContext()\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n\n if (accrualMethod === 'unlimited') {\n return null\n }\n\n const currentBalance = parseFloat(accrualBalance)\n const remainingBalance = currentBalance - hoursUsed\n\n return (\n <Text size=\"sm\" variant=\"supporting\" aria-live=\"polite\" aria-atomic={true} id={id}>\n {t('timeOffBalance.remaining', { balance: remainingBalance.toFixed(1) })}\n </Text>\n )\n}\n\nexport const TimeOffField = ({ timeOff, employee }: TimeOffFieldProps) => {\n const { t } = useTranslation('Payroll.PayrollEditEmployee')\n useI18n('Payroll.PayrollEditEmployee')\n\n const { control } = useFormContext<PayrollEditEmployeeFormValues>()\n const id = useId()\n\n const watchedValue = useWatch({\n control,\n name: `timeOffCompensations.${timeOff.name}`,\n })\n\n if (!timeOff.name) {\n return null\n }\n\n const hoursUsed = parseFloat(watchedValue || '0')\n const eligiblePolicy = employee.eligiblePaidTimeOff?.find(policy => policy.name === timeOff.name)\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n <TextInputField\n key={timeOff.name}\n name={`timeOffCompensations.${timeOff.name}`}\n type=\"number\"\n min={0}\n adornmentEnd={t('hoursUnit')}\n isRequired\n label={timeOff.name}\n aria-describedby={id}\n />\n {eligiblePolicy?.accrualBalance && (\n <TimeOffBalance\n accrualBalance={eligiblePolicy.accrualBalance}\n accrualMethod={eligiblePolicy.accrualMethod ?? undefined}\n hoursUsed={hoursUsed}\n id={id}\n />\n )}\n </Flex>\n )\n}\n"],"names":["TimeOffBalance","accrualBalance","accrualMethod","hoursUsed","id","Text","useComponentContext","t","useTranslation","remainingBalance","jsx","TimeOffField","timeOff","employee","useI18n","control","useFormContext","useId","watchedValue","useWatch","eligiblePolicy","policy","jsxs","Flex","TextInputField"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAiB,CAAC;AAAA,EACtB,gBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AACF,MAKM;AACJ,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAA,GACX,EAAE,GAAAC,EAAA,IAAMC,EAAe,6BAA6B;AAE1D,MAAIN,MAAkB;AACpB,WAAO;AAIT,QAAMO,IADiB,WAAWR,CAAc,IACNE;AAE1C,SACE,gBAAAO,EAACL,KAAK,MAAK,MAAK,SAAQ,cAAa,aAAU,UAAS,eAAa,IAAM,IAAAD,GACxE,UAAAG,EAAE,4BAA4B,EAAE,SAASE,EAAiB,QAAQ,CAAC,EAAA,CAAG,GACzE;AAEJ,GAEaE,IAAe,CAAC,EAAE,SAAAC,GAAS,UAAAC,QAAkC;AACxE,QAAM,EAAE,GAAAN,EAAA,IAAMC,EAAe,6BAA6B;AAC1D,EAAAM,EAAQ,6BAA6B;AAErC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACdZ,IAAKa,EAAA,GAELC,IAAeC,EAAS;AAAA,IAC5B,SAAAJ;AAAA,IACA,MAAM,wBAAwBH,EAAQ,IAAI;AAAA,EAAA,CAC3C;AAED,MAAI,CAACA,EAAQ;AACX,WAAO;AAGT,QAAMT,IAAY,WAAWe,KAAgB,GAAG,GAC1CE,IAAiBP,EAAS,qBAAqB,KAAK,OAAUQ,EAAO,SAAST,EAAQ,IAAI;AAEhG,SACE,gBAAAU,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,IAAA,gBAAAb;AAAA,MAACc;AAAA,MAAA;AAAA,QAEC,MAAM,wBAAwBZ,EAAQ,IAAI;AAAA,QAC1C,MAAK;AAAA,QACL,KAAK;AAAA,QACL,cAAcL,EAAE,WAAW;AAAA,QAC3B,YAAU;AAAA,QACV,OAAOK,EAAQ;AAAA,QACf,oBAAkBR;AAAA,MAAA;AAAA,MAPbQ,EAAQ;AAAA,IAAA;AAAA,IASdQ,GAAgB,kBACf,gBAAAV;AAAA,MAACV;AAAA,MAAA;AAAA,QACC,gBAAgBoB,EAAe;AAAA,QAC/B,eAAeA,EAAe,iBAAiB;AAAA,QAC/C,WAAAjB;AAAA,QACA,IAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;"}
|
|
@@ -3,6 +3,8 @@ import { useTranslation as U } from "react-i18next";
|
|
|
3
3
|
import { getPayrollType as L, calculateTotalPayroll as N, canCancelPayroll as O } from "../helpers.js";
|
|
4
4
|
import j from "./PayrollHistoryPresentation.module.scss.js";
|
|
5
5
|
import { Flex as n } from "../../Common/Flex/Flex.js";
|
|
6
|
+
import "classnames";
|
|
7
|
+
import "../../../shared/constants.js";
|
|
6
8
|
import { HamburgerMenu as M } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
7
9
|
import { useComponentContext as V } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
10
|
import { formatNumberAsCurrency as q } from "../../../helpers/formattedStrings.js";
|
|
@@ -13,7 +15,7 @@ import $ from "../../../assets/icons/icon-file-outline.svg.js";
|
|
|
13
15
|
import B from "../../../assets/icons/icon-receipt-outline.svg.js";
|
|
14
16
|
import { PayrollStatusBadges as W } from "../PayrollStatusBadges/PayrollStatusBadges.js";
|
|
15
17
|
import { DataView as _ } from "../../Common/DataView/DataView.js";
|
|
16
|
-
const
|
|
18
|
+
const de = ({
|
|
17
19
|
payrollHistory: c,
|
|
18
20
|
wireInRequests: p,
|
|
19
21
|
selectedTimeFilter: y,
|
|
@@ -33,9 +35,9 @@ const me = ({
|
|
|
33
35
|
{ value: "6months", label: t("timeFilter.options.6months") },
|
|
34
36
|
{ value: "year", label: t("timeFilter.options.year") }
|
|
35
37
|
], w = (e) => {
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
38
|
+
const i = e.payrollDeadline;
|
|
39
|
+
if (!i) return "";
|
|
40
|
+
const a = new Date(i), u = "America/New_York", T = new Intl.DateTimeFormat("en-US", {
|
|
39
41
|
weekday: "short",
|
|
40
42
|
month: "short",
|
|
41
43
|
day: "numeric",
|
|
@@ -45,37 +47,37 @@ const me = ({
|
|
|
45
47
|
minute: "2-digit",
|
|
46
48
|
timeZoneName: "short",
|
|
47
49
|
timeZone: u
|
|
48
|
-
}), H = T.format(
|
|
49
|
-
return `${R.format(
|
|
50
|
+
}), H = T.format(a);
|
|
51
|
+
return `${R.format(a)} on ${H}`;
|
|
50
52
|
}, x = (e) => {
|
|
51
53
|
g(e);
|
|
52
54
|
}, k = () => {
|
|
53
55
|
o && D(o);
|
|
54
56
|
}, A = (e) => {
|
|
55
|
-
const
|
|
57
|
+
const i = e.payrollUuid || e.uuid, a = [
|
|
56
58
|
{
|
|
57
59
|
label: t("menu.viewSummary"),
|
|
58
60
|
icon: /* @__PURE__ */ r($, { "aria-hidden": !0 }),
|
|
59
61
|
onClick: () => {
|
|
60
|
-
f(
|
|
62
|
+
f(i, e.payPeriod?.startDate, e.payPeriod?.endDate);
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
{
|
|
64
66
|
label: t("menu.viewReceipt"),
|
|
65
67
|
icon: /* @__PURE__ */ r(B, { "aria-hidden": !0 }),
|
|
66
68
|
onClick: () => {
|
|
67
|
-
P(
|
|
69
|
+
P(i, e.payPeriod?.startDate, e.payPeriod?.endDate);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
];
|
|
71
|
-
return O(e) &&
|
|
73
|
+
return O(e) && a.push({
|
|
72
74
|
label: t("menu.cancelPayroll"),
|
|
73
75
|
icon: /* @__PURE__ */ r(Z, { "aria-hidden": !0 }),
|
|
74
76
|
onClick: () => {
|
|
75
77
|
x(e);
|
|
76
78
|
},
|
|
77
79
|
"data-destructive": "true"
|
|
78
|
-
}),
|
|
80
|
+
}), a;
|
|
79
81
|
};
|
|
80
82
|
return c.length === 0 ? /* @__PURE__ */ l(n, { flexDirection: "column", alignItems: "center", gap: 24, children: [
|
|
81
83
|
/* @__PURE__ */ r(d, { as: "h3", children: t("emptyState.title") }),
|
|
@@ -129,10 +131,10 @@ const me = ({
|
|
|
129
131
|
{
|
|
130
132
|
title: t("columns.status"),
|
|
131
133
|
render: (e) => {
|
|
132
|
-
const
|
|
133
|
-
(
|
|
134
|
+
const i = p.find(
|
|
135
|
+
(a) => a.paymentUuid === e.payrollUuid
|
|
134
136
|
);
|
|
135
|
-
return /* @__PURE__ */ r(W, { payroll: e, wireInRequest:
|
|
137
|
+
return /* @__PURE__ */ r(W, { payroll: e, wireInRequest: i });
|
|
136
138
|
}
|
|
137
139
|
},
|
|
138
140
|
{
|
|
@@ -171,6 +173,6 @@ const me = ({
|
|
|
171
173
|
] });
|
|
172
174
|
};
|
|
173
175
|
export {
|
|
174
|
-
|
|
176
|
+
de as PayrollHistoryPresentation
|
|
175
177
|
};
|
|
176
178
|
//# sourceMappingURL=PayrollHistoryPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll, canCancelPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void\n onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) =>\n dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => getPayrollType(item),\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => dateFormatter.formatShortWithYear(item.checkDate),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => formatNumberAsCurrency(calculateTotalPayroll(item)),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","formatDeadlineForDialog","item","deadline","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","canCancelPayroll","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAAuC;AACrC,QAAM,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAA;AAC1C,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAgBC,EAAA,GAEhBC,IAAoB;AAAA,IACxB,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,WAAW,OAAO,EAAE,4BAA4B,EAAA;AAAA,IACzD,EAAE,OAAO,QAAQ,OAAO,EAAE,yBAAyB,EAAA;AAAA,EAAE,GAGjDC,IAA0B,CAACC,MAA0B;AACzD,UAAMC,IAAWD,EAAK;AACtB,QAAI,CAACC,EAAU,QAAO;AAEtB,UAAMC,IAAe,IAAI,KAAKD,CAAQ,GAChCE,IAAW,oBAEXC,IAAY,IAAI,KAAK,eAAe,SAAS;AAAA,MACjD,SAAS;AAAA,MACT,OAAO;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AACtB,GAAA,EAAM,UAAA,EAAE,mBAAmB,EAAA,CAAE;AAAA,UAC7BL,EAAiB,mBAChB,gBAAA2B,EAACtB,GAAA,EACE,YAAE,yBAAyB;AAAA,YAC1B,UAAUS,EAAwBd,CAAgB;AAAA,UAAA,CACnD,EAAA,CACH;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollHistoryPresentation.js","sources":["../../../../src/components/Payroll/PayrollHistory/PayrollHistoryPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType, calculateTotalPayroll, canCancelPayroll } from '../helpers'\nimport type { TimeFilterOption } from './PayrollHistory'\nimport styles from './PayrollHistoryPresentation.module.scss'\nimport type { MenuItem } from '@/components/Common/UI/Menu/MenuTypes'\nimport { DataView, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport TrashcanIcon from '@/assets/icons/trashcan.svg?react'\nimport FileIcon from '@/assets/icons/icon-file-outline.svg?react'\nimport ReceiptIcon from '@/assets/icons/icon-receipt-outline.svg?react'\n\ninterface PayrollHistoryPresentationProps {\n payrollHistory: Payroll[]\n wireInRequests: WireInRequest[]\n selectedTimeFilter: TimeFilterOption\n onTimeFilterChange: (value: TimeFilterOption) => void\n onViewSummary: (payrollId: string, startDate?: string, endDate?: string) => void\n onViewReceipt: (payrollId: string, startDate?: string, endDate?: string) => void\n onCancelPayroll: (item: Payroll) => void\n cancelDialogItem: Payroll | null\n onCancelDialogOpen: (item: Payroll) => void\n onCancelDialogClose: () => void\n isLoading?: boolean\n}\n\nexport const PayrollHistoryPresentation = ({\n payrollHistory,\n wireInRequests,\n selectedTimeFilter,\n onTimeFilterChange,\n onViewSummary,\n onViewReceipt,\n onCancelPayroll,\n cancelDialogItem,\n onCancelDialogOpen,\n onCancelDialogClose,\n isLoading = false,\n}: PayrollHistoryPresentationProps) => {\n const { Heading, Text, Select, Dialog } = useComponentContext()\n useI18n('Payroll.PayrollHistory')\n const { t } = useTranslation('Payroll.PayrollHistory')\n const dateFormatter = useDateFormatter()\n\n const timeFilterOptions = [\n { value: '3months', label: t('timeFilter.options.3months') },\n { value: '6months', label: t('timeFilter.options.6months') },\n { value: 'year', label: t('timeFilter.options.year') },\n ]\n\n const formatDeadlineForDialog = (item: Payroll): string => {\n const deadline = item.payrollDeadline\n if (!deadline) return ''\n\n const deadlineDate = new Date(deadline)\n const timeZone = 'America/New_York'\n\n const formatter = new Intl.DateTimeFormat('en-US', {\n weekday: 'short',\n month: 'short',\n day: 'numeric',\n timeZone,\n })\n\n const timeFormatter = new Intl.DateTimeFormat('en-US', {\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short',\n timeZone,\n })\n\n const dateStr = formatter.format(deadlineDate)\n const timeStr = timeFormatter.format(deadlineDate)\n\n return `${timeStr} on ${dateStr}`\n }\n\n const handleCancelClick = (item: Payroll) => {\n onCancelDialogOpen(item)\n }\n\n const handleConfirmCancel = () => {\n if (cancelDialogItem) {\n onCancelPayroll(cancelDialogItem)\n }\n }\n\n const getMenuItems = (item: Payroll): MenuItem[] => {\n const payrollId = item.payrollUuid || item.uuid!\n const items: MenuItem[] = [\n {\n label: t('menu.viewSummary'),\n icon: <FileIcon aria-hidden />,\n onClick: () => {\n onViewSummary(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n {\n label: t('menu.viewReceipt'),\n icon: <ReceiptIcon aria-hidden />,\n onClick: () => {\n onViewReceipt(payrollId, item.payPeriod?.startDate, item.payPeriod?.endDate)\n },\n },\n ]\n\n if (canCancelPayroll(item)) {\n items.push({\n label: t('menu.cancelPayroll'),\n icon: <TrashcanIcon aria-hidden />,\n onClick: () => {\n handleCancelClick(item)\n },\n 'data-destructive': 'true',\n })\n }\n\n return items\n }\n\n if (payrollHistory.length === 0) {\n return (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <Heading as=\"h3\">{t('emptyState.title')}</Heading>\n <Text>{t('emptyState.description')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n <div className={styles.timeFilterContainer}>\n <Select\n value={selectedTimeFilter}\n onChange={(value: string) => {\n onTimeFilterChange(value as TimeFilterOption)\n }}\n options={timeFilterOptions}\n label={t('timeFilter.placeholder')}\n shouldVisuallyHideLabel\n isRequired\n />\n </div>\n </Flex>\n\n <DataView\n label={t('dataView.label')}\n columns={[\n {\n title: t('columns.payPeriod'),\n render: (item: Payroll) =>\n dateFormatter.formatPayPeriodRange(\n item.payPeriod?.startDate,\n item.payPeriod?.endDate,\n ),\n },\n {\n title: t('columns.type'),\n render: (item: Payroll) => getPayrollType(item),\n },\n {\n title: t('columns.payDate'),\n render: (item: Payroll) => dateFormatter.formatShortWithYear(item.checkDate),\n },\n {\n title: t('columns.status'),\n render: (item: Payroll) => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === item.payrollUuid,\n )\n return <PayrollStatusBadges payroll={item} wireInRequest={wireInRequest} />\n },\n },\n {\n title: t('columns.totalPayroll'),\n render: (item: Payroll) => formatNumberAsCurrency(calculateTotalPayroll(item)),\n },\n ]}\n data={payrollHistory}\n itemMenu={(item: Payroll) => <HamburgerMenu items={getMenuItems(item)} />}\n />\n\n <Dialog\n isOpen={!!cancelDialogItem}\n onClose={onCancelDialogClose}\n onPrimaryActionClick={handleConfirmCancel}\n isDestructive\n isPrimaryActionLoading={isLoading}\n primaryActionLabel={t('cancelDialog.primaryAction')}\n closeActionLabel={t('cancelDialog.secondaryAction')}\n title={\n cancelDialogItem\n ? t('cancelDialog.title', {\n payPeriod: dateFormatter.formatPayPeriodRange(\n cancelDialogItem.payPeriod?.startDate,\n cancelDialogItem.payPeriod?.endDate,\n ),\n })\n : ''\n }\n >\n {cancelDialogItem && (\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('cancelDialog.body')}</Text>\n {cancelDialogItem.payrollDeadline && (\n <Text>\n {t('cancelDialog.deadline', {\n deadline: formatDeadlineForDialog(cancelDialogItem),\n })}\n </Text>\n )}\n </Flex>\n )}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["PayrollHistoryPresentation","payrollHistory","wireInRequests","selectedTimeFilter","onTimeFilterChange","onViewSummary","onViewReceipt","onCancelPayroll","cancelDialogItem","onCancelDialogOpen","onCancelDialogClose","isLoading","Heading","Text","Select","Dialog","useComponentContext","useI18n","useTranslation","dateFormatter","useDateFormatter","timeFilterOptions","formatDeadlineForDialog","item","deadline","deadlineDate","timeZone","formatter","timeFormatter","dateStr","handleCancelClick","handleConfirmCancel","getMenuItems","payrollId","items","jsx","FileIcon","ReceiptIcon","canCancelPayroll","TrashcanIcon","Flex","jsxs","styles","value","DataView","getPayrollType","wireInRequest","wire","PayrollStatusBadges","formatNumberAsCurrency","calculateTotalPayroll","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA6B,CAAC;AAAA,EACzC,gBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,WAAAC,IAA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