@gusto/embedded-react-sdk 0.26.0 → 0.27.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 +70 -0
- package/dist/assets/icons/plus-circle.svg.js +5 -5
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +13 -12
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +23 -23
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
- package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
- package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
- package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +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/Common/UI/Alert/Alert.module.scss.js +9 -9
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
- package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
- package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
- package/dist/components/Common/UI/Table/Table.js +1 -1
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
- package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- 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 +4 -3
- 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 +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.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/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 +4 -3
- 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 +4 -3
- 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 +4 -3
- 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 +6 -5
- 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 +7 -6
- 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 +4 -3
- 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 +8 -7
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- 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 +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- 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 +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
- 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 +6 -5
- 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 +4 -3
- 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 +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- 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 +6 -5
- 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/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +9 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
- 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/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
- 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 +4 -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/ContractorProfileForm.module.scss.js +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- 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.d.ts +3 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
- 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.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.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 +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.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 +4 -3
- 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/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +11 -10
- 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 +6 -5
- 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/AdminPersonalDetails.module.scss.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/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/useTaxes.js +4 -3
- 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/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +38 -36
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
- package/dist/components/InformationRequests/InformationRequests.js +78 -45
- 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/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
- package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
- package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
- 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 +26 -24
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
- 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/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
- 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/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +12 -8
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- 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/contexts/ThemeProvider/theme.d.ts +8 -3
- package/dist/contexts/ThemeProvider/theme.js +29 -24
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +3 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +157 -161
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +12 -10
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.json.js +8 -0
- package/dist/i18n/en/InformationRequests.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +10 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +51 -3
- package/package.json +11 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n withReimbursements?: boolean\n}\n\nexport const PayrollReceiptsPresentation = ({\n receiptData,\n withReimbursements = true,\n}: PayrollReceiptsPresentationProps) => {\n const { Heading, Text } = useComponentContext()\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n ...(withReimbursements\n ? [\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n ]\n : []),\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <div className={styles.receiptDetailsTable}>\n <DataView\n label={t('receipt.detailsLabel')}\n variant=\"minimal\"\n breakAt=\"small\"\n breakpoints={{\n base: '0rem',\n small: '22rem',\n }}\n columns={[\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\" variant=\"supporting\">\n {item.label}\n </Text>\n ),\n },\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\">{item.value}</Text>\n ),\n },\n ]}\n data={receiptDetailsConfig}\n />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => <Text>{item.label}</Text>,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) => (\n <Text>{formatNumberAsCurrency(item.amount)}</Text>\n ),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => <Text>{tax.name}</Text>,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(tax.amount || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => {\n const footerValues = [\n <Flex flexDirection=\"column\" gap={4} key=\"totals\">\n <Text weight=\"semibold\">{t('breakdown.totals')}</Text>\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>,\n <Text key=\"spacer\">{'\\u00A0'}</Text>,\n <Text weight=\"semibold\" key=\"childSupport\">\n {formatNumberAsCurrency(getTotalChildSupport())}\n </Text>,\n ...(withReimbursements\n ? [\n <Text weight=\"semibold\" key=\"reimbursements\">\n {formatNumberAsCurrency(getTotalReimbursements())}\n </Text>,\n ]\n : []),\n <Text weight=\"semibold\" key=\"taxes\">\n {formatNumberAsCurrency(getTotalTaxes())}\n </Text>,\n <Text weight=\"semibold\" key=\"netPay\">\n {formatNumberAsCurrency(getTotalNetPay())}\n </Text>,\n ]\n\n const footerContent = footerValues.reduce<Record<string, React.ReactNode>>(\n (acc, value, index) => {\n acc[`column-${index}`] = value\n return acc\n },\n {},\n )\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{getEmployeeFullName(employee)}</Text>\n ),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{employee.paymentMethod || 'N/A'}</Text>\n ),\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0'))}\n </Text>\n ),\n },\n ...(withReimbursements\n ? [\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0'))}\n </Text>\n ),\n },\n ]\n : []),\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.totalTax || '0'))}</Text>\n ),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.netPay || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => footerContent}\n />\n </Flex>\n )\n }\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","withReimbursements","Heading","Text","useComponentContext","useI18n","t","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","DataView","item","renderBreakdownSection","DataTable","renderTaxBreakdown","tax","renderEmployeeBreakdown","footerContent","acc","value","index","employee"],"mappings":";;;;;;;;;;;;;AAqBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAwC;AACtC,QAAM,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA;AAC1B,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAW,CADGC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GAGx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,UAEtE;AAAA,UAEF,MAAMxC,EAAY,yBAAyB,CAAA;AAAA,UAC3C,QAAQ,MAAMoC;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GACF;AAAA,EAEJ;AAEA,SACE,gBAAAd,EAAC,OAAA,EAAI,WAAWE,EAAO,WAAW,KAAKhB,GACrC,UAAA,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAL,EAAA;AAAA,IACAU,EAAA;AAAA,IACAE,EAAA;AAAA,IACAE,EAAA;AAAA,EAAwB,EAAA,CAC3B,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PayrollReceiptsPresentation.js","sources":["../../../../src/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.tsx"],"sourcesContent":["import { useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport type {\n PayrollReceipt,\n Taxes as TaxBreakdownItem,\n PayrollReceiptEmployeeCompensations as EmployeeBreakdownItem,\n} from '@gusto/embedded-api/models/components/payrollreceipt'\nimport styles from './PayrollReceiptsPresentation.module.scss'\nimport { DataView, DataTable, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\nimport { useI18n } from '@/i18n'\nimport { useContainerBreakpoints } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport ReceiptCheck from '@/assets/icons/receipt-check.svg?react'\n\ninterface PayrollReceiptsPresentationProps {\n receiptData: PayrollReceipt\n withReimbursements?: boolean\n}\n\nexport const PayrollReceiptsPresentation = ({\n receiptData,\n withReimbursements = true,\n}: PayrollReceiptsPresentationProps) => {\n const { Heading, Text } = useComponentContext()\n useI18n('Payroll.PayrollReceipts')\n const { t } = useTranslation('Payroll.PayrollReceipts')\n\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isMobile = !breakpoints.includes('small')\n\n // Helper to get employee full name\n const getEmployeeFullName = (emp: EmployeeBreakdownItem) =>\n `${emp.employeeFirstName || ''} ${emp.employeeLastName || ''}`.trim()\n\n const getTotalChildSupport = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.childSupportGarnishment || '0'),\n 0,\n )\n\n const getTotalReimbursements = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalReimbursement || '0'),\n 0,\n )\n\n const getTotalNetPay = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.netPay || '0'),\n 0,\n )\n\n const getTotalTaxes = () =>\n (receiptData.employeeCompensations || []).reduce(\n (sum, emp) => sum + parseFloat(emp.totalTax || '0'),\n 0,\n )\n\n const breakdownData = [\n {\n label: t('breakdown.directDeposits'),\n amount: parseFloat(receiptData.totals?.netPayDebit || '0'),\n },\n ...(withReimbursements\n ? [\n {\n label: t('breakdown.reimbursements'),\n amount: parseFloat(receiptData.totals?.reimbursementDebit || '0'),\n },\n ]\n : []),\n {\n label: t('breakdown.garnishments'),\n amount: parseFloat(receiptData.totals?.childSupportDebit || '0'),\n },\n { label: t('breakdown.taxes'), amount: parseFloat(receiptData.totals?.taxDebit || '0') },\n ]\n\n const receiptDetailsConfig = [\n {\n label: t('receipt.receiptId'),\n value: receiptData.payrollUuid || '',\n },\n {\n label: t('receipt.from'),\n value: receiptData.nameOfSender || '',\n },\n {\n label: t('receipt.to'),\n value: receiptData.nameOfRecipient || 'Payroll Recipients',\n },\n {\n label: t('receipt.debitDate'),\n value: receiptData.debitDate || '',\n },\n ]\n\n const renderReceiptHeader = () => (\n <div className={classNames(styles.receiptHeader, isMobile && styles.receiptHeaderMobile)}>\n <Flex flexDirection=\"column\" gap={24}>\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={16}>\n <div className={styles.receiptIcon}>\n <ReceiptCheck className={styles.checkmarkIcon} />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={8}>\n <Text size=\"sm\" variant=\"supporting\">\n {t('receipt.totalLabel')}\n </Text>\n <Heading as=\"h1\" styledAs=\"h2\" className={styles.totalAmount}>\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Heading>\n </Flex>\n </Flex>\n\n <div className={styles.receiptDetailsTable}>\n <DataView\n label={t('receipt.detailsLabel')}\n variant=\"minimal\"\n breakAt=\"small\"\n breakpoints={{\n base: '0rem',\n small: '22rem',\n }}\n columns={[\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\" variant=\"supporting\">\n {item.label}\n </Text>\n ),\n },\n {\n title: '',\n render: (item: { label: string; value: string }) => (\n <Text size=\"sm\">{item.value}</Text>\n ),\n },\n ]}\n data={receiptDetailsConfig}\n />\n </div>\n\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={12}>\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.disclaimer, isMobile && styles.textMobile)}\n >\n {receiptData.recipientNotice}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.companyInfo, isMobile && styles.textMobile)}\n >\n {receiptData.license}\n </Text>\n\n <Text\n size=\"sm\"\n variant=\"supporting\"\n className={classNames(styles.address, isMobile && styles.textMobile)}\n >\n {receiptData.licensee &&\n `${receiptData.licensee.address || ''}, ${receiptData.licensee.city || ''}, ${receiptData.licensee.state || ''} ${receiptData.licensee.postalCode || ''}`}\n </Text>\n </Flex>\n </Flex>\n </div>\n )\n\n const renderBreakdownSection = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.debitedLabel')}\n columns={[\n {\n title: t('sections.debitedLabel'),\n render: (item: { label: string; amount: number }) => <Text>{item.label}</Text>,\n },\n {\n title: t('breakdown.amount'),\n render: (item: { label: string; amount: number }) => (\n <Text>{formatNumberAsCurrency(item.amount)}</Text>\n ),\n },\n ]}\n data={breakdownData}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.companyDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderTaxBreakdown = () => (\n <Flex flexDirection=\"column\" gap={16}>\n <DataTable\n label={t('sections.taxLabel')}\n columns={[\n {\n title: t('sections.taxLabel'),\n render: (tax: TaxBreakdownItem) => <Text>{tax.name}</Text>,\n },\n {\n title: t('tax.amount'),\n render: (tax: TaxBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(tax.amount || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.taxes || []}\n footer={() => ({\n 'column-0': <Text weight=\"semibold\">{t('breakdown.totals')}</Text>,\n 'column-1': (\n <Text weight=\"semibold\">\n {formatNumberAsCurrency(parseFloat(receiptData.totals?.taxDebit || '0'))}\n </Text>\n ),\n })}\n />\n </Flex>\n )\n\n const renderEmployeeBreakdown = () => {\n const footerValues = [\n <Flex flexDirection=\"column\" gap={4} key=\"totals\">\n <Text weight=\"semibold\">{t('breakdown.totals')}</Text>\n <Text size=\"sm\" variant=\"supporting\">\n {t('employee.totalEmployees', {\n count: receiptData.employeeCompensations?.length || 0,\n })}\n </Text>\n </Flex>,\n <Text key=\"spacer\">{'\\u00A0'}</Text>,\n <Text weight=\"semibold\" key=\"childSupport\">\n {formatNumberAsCurrency(getTotalChildSupport())}\n </Text>,\n ...(withReimbursements\n ? [\n <Text weight=\"semibold\" key=\"reimbursements\">\n {formatNumberAsCurrency(getTotalReimbursements())}\n </Text>,\n ]\n : []),\n <Text weight=\"semibold\" key=\"taxes\">\n {formatNumberAsCurrency(getTotalTaxes())}\n </Text>,\n <Text weight=\"semibold\" key=\"netPay\">\n {formatNumberAsCurrency(getTotalNetPay())}\n </Text>,\n ]\n\n const footerContent = footerValues.reduce<Record<string, React.ReactNode>>(\n (acc, value, index) => {\n acc[`column-${index}`] = value\n return acc\n },\n {},\n )\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {isMobile && <Heading as=\"h2\">{t('sections.employeesLabel')}</Heading>}\n <DataView\n label={t('sections.employeesLabel')}\n columns={[\n {\n title: t('employee.name'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{getEmployeeFullName(employee)}</Text>\n ),\n },\n {\n title: t('employee.paymentMethod'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{employee.paymentMethod || 'N/A'}</Text>\n ),\n },\n {\n title: t('employee.childSupport'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.childSupportGarnishment || '0'))}\n </Text>\n ),\n },\n ...(withReimbursements\n ? [\n {\n title: t('employee.reimbursement'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>\n {formatNumberAsCurrency(parseFloat(employee.totalReimbursement || '0'))}\n </Text>\n ),\n },\n ]\n : []),\n {\n title: t('employee.totalTaxes'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.totalTax || '0'))}</Text>\n ),\n },\n {\n title: t('employee.netPay'),\n render: (employee: EmployeeBreakdownItem) => (\n <Text>{formatNumberAsCurrency(parseFloat(employee.netPay || '0'))}</Text>\n ),\n },\n ]}\n data={receiptData.employeeCompensations || []}\n footer={() => footerContent}\n />\n </Flex>\n )\n }\n\n return (\n <div className={styles.container} ref={containerRef}>\n <Flex flexDirection=\"column\" gap={24}>\n {renderReceiptHeader()}\n {renderBreakdownSection()}\n {renderTaxBreakdown()}\n {renderEmployeeBreakdown()}\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollReceiptsPresentation","receiptData","withReimbursements","Heading","Text","useComponentContext","useI18n","t","useTranslation","containerRef","useRef","isMobile","useContainerBreakpoints","getEmployeeFullName","emp","getTotalChildSupport","sum","getTotalReimbursements","getTotalNetPay","getTotalTaxes","breakdownData","receiptDetailsConfig","renderReceiptHeader","jsx","classNames","styles","jsxs","Flex","ReceiptCheck","formatNumberAsCurrency","DataView","item","renderBreakdownSection","DataTable","renderTaxBreakdown","tax","renderEmployeeBreakdown","footerContent","acc","value","index","employee"],"mappings":";;;;;;;;;;;;;;AAqBO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAwC;AACtC,QAAM,EAAE,SAAAC,GAAS,MAAAC,EAAA,IAASC,EAAA;AAC1B,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAEhDC,IAAeC,EAAuB,IAAI,GAE1CC,IAAW,CADGC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GAGxCI,IAAsB,CAACC,MAC3B,GAAGA,EAAI,qBAAqB,EAAE,IAAIA,EAAI,oBAAoB,EAAE,GAAG,KAAA,GAE3DC,IAAuB,OAC1Bd,EAAY,yBAAyB,CAAA,GAAI;AAAA,IACxC,CAACe,GAAKF,MAAQE,IAAM,WAAWF,EAAI,2BAA2B,GAAG;AAAA,IACjE;AAAA,EAAA,GAGEG,IAAyB,OAC5BhB,EAAY,yBAAyB,CAAA,GAAI;AAAA,IACxC,CAACe,GAAKF,MAAQE,IAAM,WAAWF,EAAI,sBAAsB,GAAG;AAAA,IAC5D;AAAA,EAAA,GAGEI,IAAiB,OACpBjB,EAAY,yBAAyB,CAAA,GAAI;AAAA,IACxC,CAACe,GAAKF,MAAQE,IAAM,WAAWF,EAAI,UAAU,GAAG;AAAA,IAChD;AAAA,EAAA,GAGEK,IAAgB,OACnBlB,EAAY,yBAAyB,CAAA,GAAI;AAAA,IACxC,CAACe,GAAKF,MAAQE,IAAM,WAAWF,EAAI,YAAY,GAAG;AAAA,IAClD;AAAA,EAAA,GAGEM,IAAgB;AAAA,IACpB;AAAA,MACE,OAAOb,EAAE,0BAA0B;AAAA,MACnC,QAAQ,WAAWN,EAAY,QAAQ,eAAe,GAAG;AAAA,IAAA;AAAA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B,EAAuB,WAAWY,EAAS,sBAAsB,GAAG,CAAC,EAAA,CACxE;AAAA,cAAA;AAAA,YAEJ,IAEF,CAAA;AAAA,YACJ;AAAA,cACE,OAAOlC,EAAE,qBAAqB;AAAA,cAC9B,QAAQ,CAACkC,MACP,gBAAAlB,EAACnB,GAAA,EAAM,UAAAyB,EAAuB,WAAWY,EAAS,YAAY,GAAG,CAAC,EAAA,CAAE;AAAA,YAAA;AAAA,YAGxE;AAAA,cACE,OAAOlC,EAAE,iBAAiB;AAAA,cAC1B,QAAQ,CAACkC,MACP,gBAAAlB,EAACnB,GAAA,EAAM,UAAAyB,EAAuB,WAAWY,EAAS,UAAU,GAAG,CAAC,EAAA,CAAE;AAAA,YAAA;AAAA,UAEtE;AAAA,UAEF,MAAMxC,EAAY,yBAAyB,CAAA;AAAA,UAC3C,QAAQ,MAAMoC;AAAA,QAAA;AAAA,MAAA;AAAA,IAChB,GACF;AAAA,EAEJ;AAEA,SACE,gBAAAd,EAAC,OAAA,EAAI,WAAWE,EAAO,WAAW,KAAKhB,GACrC,UAAA,gBAAAiB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAL,EAAA;AAAA,IACAU,EAAA;AAAA,IACAE,EAAA;AAAA,IACAE,EAAA;AAAA,EAAwB,EAAA,CAC3B,EAAA,CACF;AAEJ;"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_container_1dad2_1", t = "_receiptHeader_1dad2_10", c = "_receiptIcon_1dad2_21", a = "_checkmarkIcon_1dad2_32", o = "_totalAmount_1dad2_38", d = "_receiptDetailsTable_1dad2_43", n = "_disclaimer_1dad2_67", _ = "_companyInfo_1dad2_72", r = "_address_1dad2_76", i = "_receiptHeaderMobile_1dad2_89", s = "_textMobile_1dad2_100", l = {
|
|
2
2
|
container: e,
|
|
3
3
|
receiptHeader: t,
|
|
4
4
|
receiptIcon: c,
|
|
5
|
-
checkmarkIcon:
|
|
6
|
-
totalAmount:
|
|
7
|
-
receiptDetailsTable:
|
|
8
|
-
disclaimer:
|
|
9
|
-
companyInfo:
|
|
10
|
-
address:
|
|
11
|
-
receiptHeaderMobile:
|
|
12
|
-
textMobile:
|
|
5
|
+
checkmarkIcon: a,
|
|
6
|
+
totalAmount: o,
|
|
7
|
+
receiptDetailsTable: d,
|
|
8
|
+
disclaimer: n,
|
|
9
|
+
companyInfo: _,
|
|
10
|
+
address: r,
|
|
11
|
+
receiptHeaderMobile: i,
|
|
12
|
+
textMobile: s
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
r as address,
|
|
16
|
+
a as checkmarkIcon,
|
|
17
|
+
_ as companyInfo,
|
|
18
18
|
e as container,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
l as default,
|
|
20
|
+
n as disclaimer,
|
|
21
|
+
d as receiptDetailsTable,
|
|
22
22
|
t as receiptHeader,
|
|
23
|
-
|
|
23
|
+
i as receiptHeaderMobile,
|
|
24
24
|
c as receiptIcon,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
s as textMobile,
|
|
26
|
+
o as totalAmount
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=PayrollReceiptsPresentation.module.scss.js.map
|
|
@@ -3,4 +3,7 @@ export interface RecoveryCasesProps {
|
|
|
3
3
|
companyId: string;
|
|
4
4
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
interface RecoveryCasesInternalProps extends Omit<BaseComponentInterface, 'onEvent'>, RecoveryCasesProps {
|
|
7
|
+
}
|
|
8
|
+
export declare function RecoveryCases({ onEvent, ...props }: RecoveryCasesInternalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMachine as
|
|
1
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as R } from "robot3";
|
|
3
|
+
import { useMachine as M } from "react-robot";
|
|
4
4
|
import { useState as d, useMemo as h } from "react";
|
|
5
5
|
import { recoveryCasesMachine as O } from "./recoveryCasesStateMachine.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { BaseComponent as _ } from "../../Base/Base.js";
|
|
7
|
+
import "../../Base/useBase.js";
|
|
8
|
+
import { useComponentContext as x } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { FlowContext as S } from "../../Flow/useFlow.js";
|
|
8
10
|
import { recoveryCasesEvents as c } from "../../../shared/constants.js";
|
|
9
|
-
import { RecoveryCasesList as
|
|
10
|
-
function
|
|
11
|
+
import { RecoveryCasesList as A } from "./RecoveryCasesList/RecoveryCasesList.js";
|
|
12
|
+
function P({ onEvent: o = () => {
|
|
13
|
+
}, ...t }) {
|
|
14
|
+
return /* @__PURE__ */ e(_, { ...t, onEvent: o, children: /* @__PURE__ */ e(V, { ...t, onEvent: o }) });
|
|
15
|
+
}
|
|
16
|
+
function V({ companyId: o, onEvent: t = () => {
|
|
11
17
|
} }) {
|
|
12
|
-
const { Modal:
|
|
13
|
-
() =>
|
|
18
|
+
const { Modal: l } = x(), [E, s] = d(!1), f = h(
|
|
19
|
+
() => R(
|
|
14
20
|
"list",
|
|
15
21
|
O,
|
|
16
22
|
() => ({
|
|
17
23
|
component: null,
|
|
18
|
-
companyId:
|
|
19
|
-
onEvent:
|
|
24
|
+
companyId: o,
|
|
25
|
+
onEvent: r
|
|
20
26
|
})
|
|
21
27
|
),
|
|
22
|
-
[
|
|
23
|
-
), [
|
|
24
|
-
function
|
|
25
|
-
|
|
28
|
+
[o]
|
|
29
|
+
), [m, u] = M(f);
|
|
30
|
+
function r(n, C) {
|
|
31
|
+
u({ type: n, payload: C }), n === c.RECOVERY_CASE_RESOLVE && s(!0), (n === c.RECOVERY_CASE_RESUBMIT_CANCEL || n === c.RECOVERY_CASE_RESUBMIT_DONE) && s(!1), t(n, C);
|
|
26
32
|
}
|
|
27
33
|
const p = () => {
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
34
|
+
s(!1);
|
|
35
|
+
}, i = m.context.component, a = i?.Footer || void 0;
|
|
36
|
+
return /* @__PURE__ */ v(
|
|
37
|
+
S.Provider,
|
|
32
38
|
{
|
|
33
39
|
value: {
|
|
34
|
-
...
|
|
35
|
-
onEvent:
|
|
40
|
+
...m.context,
|
|
41
|
+
onEvent: r
|
|
36
42
|
},
|
|
37
43
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
44
|
+
/* @__PURE__ */ e(A, { companyId: o, onEvent: r }),
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
l,
|
|
41
47
|
{
|
|
42
|
-
isOpen:
|
|
48
|
+
isOpen: E,
|
|
43
49
|
onClose: p,
|
|
44
|
-
footer:
|
|
45
|
-
children:
|
|
50
|
+
footer: a && /* @__PURE__ */ e(a, { onEvent: r }),
|
|
51
|
+
children: i && /* @__PURE__ */ e(i, {})
|
|
46
52
|
}
|
|
47
53
|
)
|
|
48
54
|
]
|
|
@@ -50,6 +56,6 @@ function T({ companyId: t, onEvent: a = () => {
|
|
|
50
56
|
);
|
|
51
57
|
}
|
|
52
58
|
export {
|
|
53
|
-
|
|
59
|
+
P as RecoveryCases
|
|
54
60
|
};
|
|
55
61
|
//# sourceMappingURL=RecoveryCases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nexport interface RecoveryCasesProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCases({ companyId, onEvent = () => {} }:
|
|
1
|
+
{"version":3,"file":"RecoveryCases.js","sources":["../../../../src/components/Payroll/RecoveryCases/RecoveryCases.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { RecoveryCasesList } from './RecoveryCasesList'\nimport { recoveryCasesMachine } from './recoveryCasesStateMachine'\nimport { type RecoveryCasesContextInterface } from './RecoveryCasesComponents'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nexport interface RecoveryCasesProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\ninterface RecoveryCasesInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, RecoveryCasesProps {}\n\nexport function RecoveryCases({ onEvent = () => {}, ...props }: RecoveryCasesInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, onEvent = () => {} }: RecoveryCasesInternalProps) {\n const { Modal } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const recoveryCasesMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n recoveryCasesMachine,\n (): RecoveryCasesContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(recoveryCasesMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown): void {\n send({ type, payload: data })\n\n if (type === recoveryCasesEvents.RECOVERY_CASE_RESOLVE) {\n setIsModalOpen(true)\n }\n\n if (\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL ||\n type === recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <RecoveryCasesList companyId={companyId} onEvent={handleEvent} />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={Footer && <Footer onEvent={handleEvent} />}\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["RecoveryCases","onEvent","props","jsx","BaseComponent","Root","companyId","Modal","useComponentContext","isModalOpen","setIsModalOpen","useState","recoveryCasesMachineInstance","useMemo","createMachine","recoveryCasesMachine","handleEvent","current","send","useMachine","type","data","recoveryCasesEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","RecoveryCasesList"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAc,EAAE,SAAAC,IAAU,MAAM;AAAC,GAAG,GAAGC,KAAqC;AAC1F,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,SAAAL,IAAU,MAAM;AAAC,KAAiC;AAC3E,QAAM,EAAE,OAAAM,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAA+BC;AAAA,IACnC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAAsC;AAAA,QACpC,WAAW;AAAA,QACX,WAAAT;AAAA,QACA,SAASU;AAAA,MAAA;AAAA,IACX;AAAA,IAEJ,CAACV,CAAS;AAAA,EAAA,GAEN,CAACW,GAASC,CAAI,IAAIC,EAAWP,CAA4B;AAE/D,WAASI,EAAYI,GAAiBC,GAAsB;AAC1D,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAoB,yBAC/BZ,EAAe,EAAI,IAInBU,MAASE,EAAoB,iCAC7BF,MAASE,EAAoB,gCAE7BZ,EAAe,EAAK,GAGtBT,EAAQmB,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAAmB,MAAM;AAC7B,IAAAb,EAAe,EAAK;AAAA,EACtB,GAEMc,IAAmBP,EAAQ,QAAQ,WACnCQ,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAb,EAACyB,GAAA,EAAkB,WAAAtB,GAAsB,SAASU,EAAA,CAAa;AAAA,QAC/D,gBAAAb;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,QAAQE;AAAA,YACR,SAASc;AAAA,YACT,QAAQE,KAAU,gBAAAtB,EAACsB,GAAA,EAAO,SAAST,GAAa;AAAA,YAE/C,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
|
-
import {
|
|
4
|
-
import { useRecoveryCaseErrorCode as
|
|
5
|
-
import
|
|
6
|
-
import { BaseComponent as
|
|
3
|
+
import { useRecoveryCasesGetSuspense as v } from "@gusto/embedded-api/react-query/recoveryCasesGet";
|
|
4
|
+
import { useRecoveryCaseErrorCode as h } from "../useRecoveryCaseErrorCode.js";
|
|
5
|
+
import g from "./RecoveryCasesList.module.scss.js";
|
|
6
|
+
import { BaseComponent as R } from "../../../Base/Base.js";
|
|
7
7
|
import "../../../Base/useBase.js";
|
|
8
8
|
import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
-
import { useComponentDictionary as
|
|
10
|
-
import { DataView as
|
|
11
|
-
import { useDataView as
|
|
12
|
-
import { FlexItem as
|
|
9
|
+
import { useComponentDictionary as L, useI18n as u } from "../../../../i18n/I18n.js";
|
|
10
|
+
import { DataView as b } from "../../../Common/DataView/DataView.js";
|
|
11
|
+
import { useDataView as E } from "../../../Common/DataView/useDataView.js";
|
|
12
|
+
import { FlexItem as x, Flex as d } from "../../../Common/Flex/Flex.js";
|
|
13
|
+
import "classnames";
|
|
14
|
+
import { recoveryCasesEvents as D } from "../../../../shared/constants.js";
|
|
13
15
|
import "react";
|
|
14
|
-
import { recoveryCasesEvents as P } from "../../../../shared/constants.js";
|
|
15
16
|
import { formatNumberAsCurrency as y } from "../../../../helpers/formattedStrings.js";
|
|
16
17
|
function z(t) {
|
|
17
|
-
return /* @__PURE__ */ e(
|
|
18
|
+
return /* @__PURE__ */ e(R, { ...t, children: /* @__PURE__ */ e(w, { ...t, children: t.children }) });
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function P(t) {
|
|
20
21
|
return t === "open" ? "info" : "warning";
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function A({ errorCode: t }) {
|
|
23
24
|
u("Payroll.RecoveryCasesList");
|
|
24
|
-
const { t: n } = l("Payroll.RecoveryCasesList"), { Text: s } = c(), { title: r, subtitle: i } =
|
|
25
|
+
const { t: n } = l("Payroll.RecoveryCasesList"), { Text: s } = c(), { title: r, subtitle: i } = h(t);
|
|
25
26
|
return !r && !i ? /* @__PURE__ */ e("span", { "aria-label": n("labels.noLatestErrorCodeAriaLabel"), "aria-live": "polite", children: n("labels.noLatestErrorCode") }) : /* @__PURE__ */ m(d, { flexDirection: "column", gap: 4, children: [
|
|
26
27
|
r && /* @__PURE__ */ e(s, { weight: "semibold", children: r }),
|
|
27
28
|
i && /* @__PURE__ */ e(s, { children: i })
|
|
28
29
|
] });
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function S({ status: t }) {
|
|
31
32
|
u("Payroll.RecoveryCasesList");
|
|
32
33
|
const { t: n } = l("Payroll.RecoveryCasesList"), { Badge: s } = c();
|
|
33
34
|
if (!t)
|
|
34
35
|
return null;
|
|
35
|
-
const r =
|
|
36
|
+
const r = P(t), i = n(`status.${t}`);
|
|
36
37
|
return /* @__PURE__ */ e(s, { status: r, children: i });
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function k({
|
|
39
40
|
recoveryCase: t,
|
|
40
41
|
onEvent: n
|
|
41
42
|
}) {
|
|
@@ -46,7 +47,7 @@ function O({
|
|
|
46
47
|
{
|
|
47
48
|
variant: "secondary",
|
|
48
49
|
onClick: () => {
|
|
49
|
-
n(
|
|
50
|
+
n(D.RECOVERY_CASE_RESOLVE, {
|
|
50
51
|
recoveryCaseId: t.uuid
|
|
51
52
|
});
|
|
52
53
|
},
|
|
@@ -54,18 +55,17 @@ function O({
|
|
|
54
55
|
}
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
const { t: r } = l("Payroll.RecoveryCasesList"), { Heading: i, Text: a } = c(), { data: C
|
|
58
|
+
function w({ companyId: t, dictionary: n, onEvent: s }) {
|
|
59
|
+
L("Payroll.RecoveryCasesList", n), u("Payroll.RecoveryCasesList");
|
|
60
|
+
const { t: r } = l("Payroll.RecoveryCasesList"), { Heading: i, Text: a } = c(), { data: C } = v({
|
|
60
61
|
companyUuid: t
|
|
61
|
-
}),
|
|
62
|
-
data:
|
|
63
|
-
isFetching: f,
|
|
62
|
+
}), f = (C.recoveryCaseList ?? []).filter((o) => o.status !== "recovered"), p = E({
|
|
63
|
+
data: f,
|
|
64
64
|
columns: [
|
|
65
65
|
{
|
|
66
66
|
key: "originalDebitDate",
|
|
67
67
|
title: r("columns.originalDebitDate"),
|
|
68
|
-
render: (o) => /* @__PURE__ */ e(
|
|
68
|
+
render: (o) => /* @__PURE__ */ e(x, { flexGrow: 1, children: /* @__PURE__ */ e(a, { children: o.originalDebitDate ?? "-" }) })
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
key: "totalAmount",
|
|
@@ -80,22 +80,22 @@ function S({ companyId: t, dictionary: n, onEvent: s }) {
|
|
|
80
80
|
{
|
|
81
81
|
key: "latestErrorCode",
|
|
82
82
|
title: r("columns.latestErrorCode"),
|
|
83
|
-
render: (o) => /* @__PURE__ */ e(
|
|
83
|
+
render: (o) => /* @__PURE__ */ e(A, { errorCode: o.latestErrorCode })
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
key: "status",
|
|
87
87
|
title: r("columns.status"),
|
|
88
|
-
render: (o) => /* @__PURE__ */ e(
|
|
88
|
+
render: (o) => /* @__PURE__ */ e(S, { status: o.status })
|
|
89
89
|
}
|
|
90
90
|
],
|
|
91
|
-
itemMenu: (o) => /* @__PURE__ */ e(
|
|
91
|
+
itemMenu: (o) => /* @__PURE__ */ e(k, { recoveryCase: o, onEvent: s })
|
|
92
92
|
});
|
|
93
|
-
return /* @__PURE__ */ e("div", { className:
|
|
93
|
+
return /* @__PURE__ */ e("div", { className: g.root, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 20, children: [
|
|
94
94
|
/* @__PURE__ */ m(d, { flexDirection: "column", gap: 2, children: [
|
|
95
95
|
/* @__PURE__ */ e(i, { as: "h2", styledAs: "h4", children: r("title") }),
|
|
96
96
|
/* @__PURE__ */ e(a, { children: r("description") })
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ e(
|
|
98
|
+
/* @__PURE__ */ e(b, { ...p, label: r("title") })
|
|
99
99
|
] }) });
|
|
100
100
|
}
|
|
101
101
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api/models/components/recoverycase'\nimport {
|
|
1
|
+
{"version":3,"file":"RecoveryCasesList.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type {\n RecoveryCase,\n RecoveryCaseStatus,\n} from '@gusto/embedded-api/models/components/recoverycase'\nimport { useRecoveryCasesGetSuspense } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport styles from './RecoveryCasesList.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { recoveryCasesEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\nimport { formatNumberAsCurrency } from '@/helpers/formattedStrings'\n\ninterface RecoveryCasesListProps extends BaseComponentInterface<'Payroll.RecoveryCasesList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function RecoveryCasesList(props: RecoveryCasesListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction getStatusBadgeStatus(status: RecoveryCaseStatus | undefined): BadgeProps['status'] {\n if (status === 'open') {\n return 'info'\n }\n return 'warning'\n}\n\nfunction ErrorCodeCell({ errorCode }: { errorCode: string | null | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Text } = useComponentContext()\n const { title, subtitle } = useRecoveryCaseErrorCode(errorCode)\n\n if (!title && !subtitle) {\n return (\n <span aria-label={t('labels.noLatestErrorCodeAriaLabel')} aria-live=\"polite\">\n {t('labels.noLatestErrorCode')}\n </span>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={4}>\n {title && <Text weight=\"semibold\">{title}</Text>}\n {subtitle && <Text>{subtitle}</Text>}\n </Flex>\n )\n}\n\nfunction StatusCell({ status }: { status: RecoveryCaseStatus | undefined }) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Badge } = useComponentContext()\n\n if (!status) {\n return null\n }\n\n const badgeStatus = getStatusBadgeStatus(status)\n const statusLabel = t(`status.${status}`)\n\n return <Badge status={badgeStatus}>{statusLabel}</Badge>\n}\n\nfunction ResolveButton({\n recoveryCase,\n onEvent,\n}: {\n recoveryCase: RecoveryCase\n onEvent: BaseComponentInterface['onEvent']\n}) {\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Button } = useComponentContext()\n\n if (recoveryCase.status !== 'open') {\n return null\n }\n\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESOLVE, {\n recoveryCaseId: recoveryCase.uuid,\n })\n }}\n >\n {t('cta.resolve')}\n </Button>\n )\n}\n\nfunction Root({ companyId, dictionary, onEvent }: RecoveryCasesListProps) {\n useComponentDictionary('Payroll.RecoveryCasesList', dictionary)\n useI18n('Payroll.RecoveryCasesList')\n const { t } = useTranslation('Payroll.RecoveryCasesList')\n const { Heading, Text } = useComponentContext()\n\n const { data } = useRecoveryCasesGetSuspense({\n companyUuid: companyId,\n })\n\n const recoveryCases = (data.recoveryCaseList ?? []).filter(rc => rc.status !== 'recovered')\n\n const dataViewProps = useDataView({\n data: recoveryCases,\n columns: [\n {\n key: 'originalDebitDate',\n title: t('columns.originalDebitDate'),\n render: recoveryCase => (\n <FlexItem flexGrow={1}>\n <Text>{recoveryCase.originalDebitDate ?? '-'}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'totalAmount',\n title: t('columns.totalAmount'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.eventTotalAmount\n ? formatNumberAsCurrency(parseFloat(recoveryCase.eventTotalAmount))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'amountOutstanding',\n title: t('columns.amountOutstanding'),\n render: recoveryCase => (\n <Text>\n {recoveryCase.amountOutstanding\n ? formatNumberAsCurrency(parseFloat(recoveryCase.amountOutstanding))\n : '-'}\n </Text>\n ),\n },\n {\n key: 'latestErrorCode',\n title: t('columns.latestErrorCode'),\n render: recoveryCase => <ErrorCodeCell errorCode={recoveryCase.latestErrorCode} />,\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: recoveryCase => <StatusCell status={recoveryCase.status} />,\n },\n ],\n itemMenu: recoveryCase => <ResolveButton recoveryCase={recoveryCase} onEvent={onEvent} />,\n })\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n </div>\n )\n}\n"],"names":["RecoveryCasesList","props","jsx","BaseComponent","Root","getStatusBadgeStatus","status","ErrorCodeCell","errorCode","useI18n","t","useTranslation","Text","useComponentContext","title","subtitle","useRecoveryCaseErrorCode","jsxs","Flex","StatusCell","Badge","badgeStatus","statusLabel","ResolveButton","recoveryCase","onEvent","Button","recoveryCasesEvents","companyId","dictionary","useComponentDictionary","Heading","data","useRecoveryCasesGetSuspense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|
package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js
CHANGED
|
@@ -7,48 +7,49 @@ import { useRecoveryCaseErrorCode as x } from "../useRecoveryCaseErrorCode.js";
|
|
|
7
7
|
import { BaseComponent as D } from "../../../Base/Base.js";
|
|
8
8
|
import { useBase as B } from "../../../Base/useBase.js";
|
|
9
9
|
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
10
|
-
import
|
|
10
|
+
import "classnames";
|
|
11
|
+
import { recoveryCasesEvents as C } from "../../../../shared/constants.js";
|
|
12
|
+
import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
13
|
import "react";
|
|
12
14
|
import { Form as F } from "../../../Common/Form/Form.js";
|
|
13
15
|
import { useFlow as A } from "../../../Flow/useFlow.js";
|
|
14
16
|
import { useComponentDictionary as I, useI18n as O } from "../../../../i18n/I18n.js";
|
|
15
|
-
import { recoveryCasesEvents as y } from "../../../../shared/constants.js";
|
|
16
17
|
const R = "gusto-sdk-recovery-cases-resubmit-form";
|
|
17
18
|
function T(e) {
|
|
18
19
|
return /* @__PURE__ */ t(D, { ...e, children: /* @__PURE__ */ t(U, { ...e, children: e.children }) });
|
|
19
20
|
}
|
|
20
21
|
function U({ dictionary: e, recoveryCaseId: o }) {
|
|
21
22
|
I("Payroll.RecoveryCasesResubmit", e);
|
|
22
|
-
const { Heading: r, Text:
|
|
23
|
-
companyUuid:
|
|
24
|
-
}), v =
|
|
23
|
+
const { Heading: r, Text: s } = y(), { onEvent: n, baseSubmitHandler: a } = B(), { companyId: p } = A(), { data: f } = S({
|
|
24
|
+
companyUuid: p
|
|
25
|
+
}), v = f?.recoveryCaseList?.find((i) => i.uuid === o), { title: c, subtitle: m, description: u } = x(
|
|
25
26
|
v?.latestErrorCode ?? void 0
|
|
26
|
-
), E = _(), b = async (
|
|
27
|
-
|
|
27
|
+
), E = _(), b = async (i) => {
|
|
28
|
+
i.preventDefault(), await a({}, async () => {
|
|
28
29
|
await E.mutateAsync({
|
|
29
30
|
request: {
|
|
30
31
|
recoveryCaseUuid: o
|
|
31
32
|
}
|
|
32
|
-
}), n(
|
|
33
|
+
}), n(C.RECOVERY_CASE_RESUBMIT_DONE, {
|
|
33
34
|
recoveryCaseId: o
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
38
|
return /* @__PURE__ */ l(d, { flexDirection: "column", gap: 16, children: [
|
|
38
39
|
c && /* @__PURE__ */ t(r, { as: "h2", children: c }),
|
|
39
|
-
m && /* @__PURE__ */ t(
|
|
40
|
+
m && /* @__PURE__ */ t(s, { children: m }),
|
|
40
41
|
u.length > 0 && u,
|
|
41
42
|
/* @__PURE__ */ t(F, { id: R, onSubmit: b, "aria-hidden": "true" })
|
|
42
43
|
] });
|
|
43
44
|
}
|
|
44
45
|
const P = ({ onEvent: e }) => {
|
|
45
46
|
O("Payroll.RecoveryCasesResubmit");
|
|
46
|
-
const { t: o } = h("Payroll.RecoveryCasesResubmit"), { Button: r } =
|
|
47
|
+
const { t: o } = h("Payroll.RecoveryCasesResubmit"), { Button: r } = y(), n = g({
|
|
47
48
|
mutationKey: M()
|
|
48
49
|
}) > 0;
|
|
49
50
|
return /* @__PURE__ */ l(d, { justifyContent: "flex-end", gap: 12, children: [
|
|
50
51
|
/* @__PURE__ */ t(r, { variant: "secondary", onClick: () => {
|
|
51
|
-
e(
|
|
52
|
+
e(C.RECOVERY_CASE_RESUBMIT_CANCEL);
|
|
52
53
|
}, isDisabled: n, children: o("cta.cancel") }),
|
|
53
54
|
/* @__PURE__ */ t(
|
|
54
55
|
r,
|
package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCaseList?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RecoveryCasesResubmit.js","sources":["../../../../../src/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useRecoveryCasesRedebitMutation,\n mutationKeyRecoveryCasesRedebit,\n} from '@gusto/embedded-api/react-query/recoveryCasesRedebit'\nimport { useRecoveryCasesGet } from '@gusto/embedded-api/react-query/recoveryCasesGet'\nimport type { RecoveryCasesContextInterface } from '../RecoveryCasesComponents'\nimport { useRecoveryCaseErrorCode } from '../useRecoveryCaseErrorCode'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { recoveryCasesEvents, type EventType } from '@/shared/constants'\n\nconst RECOVERY_CASES_RESUBMIT_FORM_ID = 'gusto-sdk-recovery-cases-resubmit-form'\n\ninterface RecoveryCasesResubmitProps extends BaseComponentInterface<'Payroll.RecoveryCasesResubmit'> {\n recoveryCaseId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function RecoveryCasesResubmit(props: RecoveryCasesResubmitProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, recoveryCaseId }: RecoveryCasesResubmitProps) {\n useComponentDictionary('Payroll.RecoveryCasesResubmit', dictionary)\n const { Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n const { companyId } = useFlow<RecoveryCasesContextInterface>()\n\n const { data: recoveryCasesData } = useRecoveryCasesGet({\n companyUuid: companyId,\n })\n\n const recoveryCase = recoveryCasesData?.recoveryCaseList?.find(rc => rc.uuid === recoveryCaseId)\n\n const { title, subtitle, description } = useRecoveryCaseErrorCode(\n recoveryCase?.latestErrorCode ?? undefined,\n )\n\n const redebitMutation = useRecoveryCasesRedebitMutation()\n\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n await baseSubmitHandler({}, async () => {\n await redebitMutation.mutateAsync({\n request: {\n recoveryCaseUuid: recoveryCaseId,\n },\n })\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, {\n recoveryCaseId,\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {title && <Heading as=\"h2\">{title}</Heading>}\n {subtitle && <Text>{subtitle}</Text>}\n {description.length > 0 && description}\n {/*\n This empty form is used to connect the Footer's submit button to the submission logic\n via the form attribute. This is semantically incorrect and hidden from assistive tech.\n */}\n <Form id={RECOVERY_CASES_RESUBMIT_FORM_ID} onSubmit={onSubmit} aria-hidden=\"true\">\n {/* Empty form - submission triggered by footer button via form attribute */}\n </Form>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Button } = useComponentContext()\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyRecoveryCasesRedebit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_CANCEL)\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={RECOVERY_CASES_RESUBMIT_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.resubmit')}\n </Button>\n </Flex>\n )\n}\n\nRecoveryCasesResubmit.Footer = Footer\n"],"names":["RECOVERY_CASES_RESUBMIT_FORM_ID","RecoveryCasesResubmit","props","jsx","BaseComponent","Root","dictionary","recoveryCaseId","useComponentDictionary","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","companyId","useFlow","recoveryCasesData","useRecoveryCasesGet","recoveryCase","rc","title","subtitle","description","useRecoveryCaseErrorCode","redebitMutation","useRecoveryCasesRedebitMutation","onSubmit","e","recoveryCasesEvents","jsxs","Flex","Form","Footer","useI18n","t","useTranslation","Button","isPending","useIsMutating","mutationKeyRecoveryCasesRedebit"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAMA,IAAkC;AAOjC,SAASC,EAAsBC,GAAmC;AACvE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,gBAAAC,KAA8C;AACxE,EAAAC,EAAuB,iCAAiCF,CAAU;AAClE,QAAM,EAAE,SAAAG,GAAS,MAAAC,EAAA,IAASC,EAAA,GACpB,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAEhB,EAAE,MAAMC,EAAA,IAAsBC,EAAoB;AAAA,IACtD,aAAaH;AAAA,EAAA,CACd,GAEKI,IAAeF,GAAmB,kBAAkB,KAAK,CAAAG,MAAMA,EAAG,SAASb,CAAc,GAEzF,EAAE,OAAAc,GAAO,UAAAC,GAAU,aAAAC,EAAA,IAAgBC;AAAA,IACvCL,GAAc,mBAAmB;AAAA,EAAA,GAG7BM,IAAkBC,EAAA,GAElBC,IAAW,OAAOC,MAAwC;AAC9D,IAAAA,EAAE,e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AAA,EACnB,GACF;AAEJ;AAEArC,EAAsB,SAASgC;"}
|
|
@@ -2,6 +2,8 @@ import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as a, Trans as c } from "react-i18next";
|
|
3
3
|
import p from "./RecoveryCaseErrorCode.module.scss.js";
|
|
4
4
|
import { Flex as C } from "../../Common/Flex/Flex.js";
|
|
5
|
+
import "classnames";
|
|
6
|
+
import "../../../shared/constants.js";
|
|
5
7
|
import { useComponentContext as R } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
8
|
import "react";
|
|
7
9
|
import { useI18n as f } from "../../../i18n/I18n.js";
|
|
@@ -19,7 +21,7 @@ function h(s) {
|
|
|
19
21
|
return "bankError";
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
function
|
|
24
|
+
function T(s) {
|
|
23
25
|
f("Payroll.RecoveryCasesResubmit");
|
|
24
26
|
const { t: r } = a("Payroll.RecoveryCasesResubmit"), { Text: o } = R();
|
|
25
27
|
if (!s)
|
|
@@ -60,6 +62,6 @@ function g(s) {
|
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
64
|
export {
|
|
63
|
-
|
|
65
|
+
T as useRecoveryCaseErrorCode
|
|
64
66
|
};
|
|
65
67
|
//# sourceMappingURL=useRecoveryCaseErrorCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface RecoveryCaseErrorCodeContent {\n title: string | null\n subtitle: string | null\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRecoveryCaseErrorCode.js","sources":["../../../../src/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport styles from './RecoveryCaseErrorCode.module.scss'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport interface RecoveryCaseErrorCodeContent {\n title: string | null\n subtitle: string | null\n description: ReactNode[]\n}\n\ntype ErrorCodeKey = 'R01' | 'R02' | 'R16' | 'R29' | 'bankError'\n\nfunction getErrorCodeKey(errorCode: string | null | undefined): ErrorCodeKey {\n switch (errorCode) {\n case 'R01':\n return 'R01'\n case 'R02':\n return 'R02'\n case 'R16':\n return 'R16'\n case 'R29':\n return 'R29'\n default:\n return 'bankError'\n }\n}\n\nexport function useRecoveryCaseErrorCode(\n errorCode: string | null | undefined,\n): RecoveryCaseErrorCodeContent {\n useI18n('Payroll.RecoveryCasesResubmit')\n const { t } = useTranslation('Payroll.RecoveryCasesResubmit')\n const { Text } = useComponentContext()\n\n if (!errorCode) {\n return {\n title: null,\n subtitle: null,\n description: [],\n }\n }\n\n const errorCodeKey = getErrorCodeKey(errorCode)\n\n const transComponents = {\n medium: <Text as=\"span\" weight=\"medium\" />,\n }\n\n const description: ReactNode[] = [\n <Text key=\"body\">\n <Trans t={t} i18nKey={`errorCodes.${errorCodeKey}.body`} components={transComponents} />\n </Text>,\n ]\n\n if (errorCodeKey === 'R29') {\n const achCodes = Object.values(t('errorCodes.R29.achCodes', { returnObjects: true }))\n description.push(\n <Flex key=\"instruction\" flexDirection=\"column\" gap={16}>\n <Text>{t('errorCodes.R29.listDescription')}</Text>\n <ul className={styles.compactList}>\n {achCodes.map((code, index) => (\n <li key={index}>{code}</li>\n ))}\n </ul>\n <Text>\n <Trans t={t} i18nKey=\"errorCodes.R29.instruction\" components={transComponents} />\n </Text>\n </Flex>,\n )\n } else {\n const instruction = t(`errorCodes.${errorCodeKey}.instruction`)\n if (instruction) {\n description.push(\n <Text key=\"instruction\">\n <Trans\n t={t}\n i18nKey={`errorCodes.${errorCodeKey}.instruction`}\n components={transComponents}\n />\n </Text>,\n )\n }\n }\n\n return {\n title: t(`errorCodes.${errorCodeKey}.title`),\n subtitle: t(`errorCodes.${errorCodeKey}.subtitle`),\n description,\n }\n}\n"],"names":["getErrorCodeKey","errorCode","useRecoveryCaseErrorCode","useI18n","t","useTranslation","Text","useComponentContext","errorCodeKey","transComponents","jsx","description","Trans","achCodes","jsxs","Flex","styles","code","index"],"mappings":";;;;;;;;;AAeA,SAASA,EAAgBC,GAAoD;AAC3E,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAEO,SAASC,EACdD,GAC8B;AAC9B,EAAAE,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,MAAAC,EAAA,IAASC,EAAA;AAEjB,MAAI,CAACN;AACH,WAAO;AAAA,MACL,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa,CAAA;AAAA,IAAC;AAIlB,QAAMO,IAAeR,EAAgBC,CAAS,GAExCQ,IAAkB;AAAA,IACtB,QAAQ,gBAAAC,EAACJ,GAAA,EAAK,IAAG,QAAO,QAAO,SAAA,CAAS;AAAA,EAAA,GAGpCK,IAA2B;AAAA,IAC/B,gBAAAD,EAACJ,GAAA,EACC,UAAA,gBAAAI,EAACE,GAAA,EAAM,GAAAR,GAAM,SAAS,cAAcI,CAAY,SAAS,YAAYC,EAAA,CAAiB,EAAA,GAD9E,MAEV;AAAA,EAAA;AAGF,MAAID,MAAiB,OAAO;AAC1B,UAAMK,IAAW,OAAO,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