@gusto/embedded-react-sdk 0.24.1 → 0.26.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 +118 -0
- package/dist/assets/icons/icon-file-jpg.svg.js +10 -0
- package/dist/assets/icons/icon-file-jpg.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-pdf.svg.js +10 -0
- package/dist/assets/icons/icon-file-pdf.svg.js.map +1 -0
- package/dist/assets/icons/icon-file-png.svg.js +10 -0
- package/dist/assets/icons/icon-file-png.svg.js.map +1 -0
- package/dist/assets/icons/icon-trashcan.svg.js +10 -0
- package/dist/assets/icons/icon-trashcan.svg.js.map +1 -0
- package/dist/assets/icons/slash-circle.svg.js +10 -0
- package/dist/assets/icons/slash-circle.svg.js.map +1 -0
- package/dist/components/Base/Base.d.ts +1 -1
- package/dist/components/Base/Base.js +12 -13
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
- package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
- package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
- package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
- package/dist/components/Common/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +10 -10
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
- package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +4 -4
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +150 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +36 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
- package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
- package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
- package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
- package/dist/components/Common/UI/List/List.module.scss.js +1 -1
- package/dist/components/Common/UI/Modal/Modal.js +41 -40
- package/dist/components/Common/UI/Modal/Modal.js.map +1 -1
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +4 -4
- package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
- package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +5 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +4 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -4
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +6 -7
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +2 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +7 -8
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +8 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +2 -3
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +31 -30
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -29
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +5 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -10
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +3 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +6 -7
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +7 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +24 -24
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -92
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +33 -32
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +25 -7
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +8 -0
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +58 -0
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +6 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js +18 -0
- package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +5 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +84 -52
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +4 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +32 -13
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +100 -53
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +115 -100
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +155 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +8 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +45 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +15 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +125 -0
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +3 -0
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +37 -28
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +5 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +61 -60
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
- package/dist/components/Contractor/Submit/Submit.js +19 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +12 -13
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +2 -3
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +22 -23
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -3
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +6 -7
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +55 -54
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +5 -6
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +32 -31
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibility.d.ts +3 -0
- package/dist/components/Employee/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +37 -0
- package/dist/components/Employee/EmploymentEligibility/index.d.ts +4 -0
- package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -5
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +2 -3
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +5 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +2 -3
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +5 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +4 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +8 -9
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +5 -4
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +5 -6
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +6 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +6 -7
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +5 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +7 -8
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +162 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +20 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +8 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +96 -0
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -0
- package/dist/components/InformationRequests/InformationRequests.js +68 -0
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/InformationRequests/index.d.ts +4 -0
- package/dist/components/InformationRequests/index.js +9 -0
- package/dist/components/InformationRequests/index.js.map +1 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +69 -59
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +61 -52
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +17 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +5 -13
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +102 -27
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +14 -14
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +6 -3
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +165 -156
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -146
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +45 -38
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +179 -97
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
- package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +86 -106
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -22
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +74 -47
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +159 -57
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +14 -17
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -132
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -96
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +7 -5
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +253 -250
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +2 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js +8 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +104 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +8 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +69 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
- package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
- package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +7 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +65 -0
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -0
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +12 -0
- package/dist/components/Payroll/helpers.js +129 -117
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +2 -1
- package/dist/components/Payroll/index.js +12 -10
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +5 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +44 -32
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
- package/dist/contexts/ThemeProvider/theme.js +5 -5
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +1 -0
- package/dist/helpers/dateFormatting.js +1 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +27 -21
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/helpers/responsive.js +1 -1
- package/dist/helpers/responsive.js.map +1 -1
- package/dist/i18n/I18n.js +9 -9
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +44 -36
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +58 -0
- package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js +28 -0
- package/dist/i18n/en/Employee.EmploymentEligibility.json.js.map +1 -0
- package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js +20 -0
- package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +1 -1
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +24 -20
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
- package/dist/i18n/en/Payroll.PayrollLanding.json.js +7 -3
- package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +18 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +10 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- package/dist/i18n/en/Payroll.WireInstructions.json.js +20 -16
- package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +5 -0
- package/dist/i18n/en/common.json.js +4 -2
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/shared/constants.d.ts +30 -0
- package/dist/shared/constants.js +73 -54
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +321 -3
- package/package.json +32 -21
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +0 -6
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +0 -32
- package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +0 -1
|
@@ -1,96 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useWireInRequestsListSuspense as
|
|
4
|
-
import { usePayrollsListSuspense as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { BaseComponent as
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as v } from "react-i18next";
|
|
3
|
+
import { useWireInRequestsListSuspense as M } from "@gusto/embedded-api/react-query/wireInRequestsList";
|
|
4
|
+
import { usePayrollsListSuspense as N } from "@gusto/embedded-api/react-query/payrollsList";
|
|
5
|
+
import { useState as Z, useEffect as _ } from "react";
|
|
6
|
+
import { BaseComponent as j } from "../../../Base/Base.js";
|
|
7
7
|
import "../../../Base/useBase.js";
|
|
8
|
-
import { useComponentContext as
|
|
9
|
-
import { useComponentDictionary as
|
|
8
|
+
import { useComponentContext as k } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { useComponentDictionary as E, useI18n as G } from "../../../../i18n/I18n.js";
|
|
10
10
|
import { Flex as g } from "../../../Common/Flex/Flex.js";
|
|
11
|
-
import { useDateFormatter as
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import { useDateFormatter as z } from "../../../../hooks/useDateFormatter.js";
|
|
12
|
+
import H from "../../../../hooks/useNumberFormatter.js";
|
|
13
|
+
function ie(i) {
|
|
14
|
+
return /* @__PURE__ */ n(j, { ...i, children: /* @__PURE__ */ n(J, { ...i, children: i.children }) });
|
|
14
15
|
}
|
|
15
|
-
const
|
|
16
|
+
const J = ({
|
|
16
17
|
wireInId: i,
|
|
17
18
|
companyId: u,
|
|
18
|
-
dictionary:
|
|
19
|
-
confirmationAlert:
|
|
20
|
-
onStartWireTransfer:
|
|
19
|
+
dictionary: D,
|
|
20
|
+
confirmationAlert: l,
|
|
21
|
+
onStartWireTransfer: C
|
|
21
22
|
}) => {
|
|
22
|
-
|
|
23
|
-
const { t: s } =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
const { data:
|
|
23
|
+
E("Payroll.ConfirmWireDetailsBanner", D), G("Payroll.ConfirmWireDetailsBanner");
|
|
24
|
+
const { t: s } = v("Payroll.ConfirmWireDetailsBanner"), { Alert: P, Banner: L, Button: R, UnorderedList: b, Text: c } = k(), q = z(), [w, d] = Z(!1), S = H("currency");
|
|
25
|
+
_(() => {
|
|
26
|
+
l && d(!1);
|
|
27
|
+
}, [l]);
|
|
28
|
+
const { data: B } = M({
|
|
28
29
|
companyUuid: u
|
|
29
|
-
}), { data:
|
|
30
|
+
}), { data: W } = N({
|
|
30
31
|
companyId: u,
|
|
31
32
|
processed: !0
|
|
32
|
-
}),
|
|
33
|
-
(
|
|
34
|
-
),
|
|
35
|
-
const
|
|
33
|
+
}), p = (B.wireInRequestList || []).filter(
|
|
34
|
+
(e) => e.status === "awaiting_funds"
|
|
35
|
+
), x = i ? p.filter((e) => e.uuid === i) : p, A = W.payrollList || [], r = x.map((e) => {
|
|
36
|
+
const t = A.find((o) => o.payrollUuid === e.paymentUuid), a = t?.payPeriod ? q.formatPayPeriodRange(t.payPeriod.startDate, t.payPeriod.endDate) : "";
|
|
36
37
|
return {
|
|
37
|
-
wireInRequest:
|
|
38
|
-
payroll:
|
|
39
|
-
payrollRange:
|
|
38
|
+
wireInRequest: e,
|
|
39
|
+
payroll: t,
|
|
40
|
+
payrollRange: a,
|
|
41
|
+
paymentType: e.paymentType,
|
|
42
|
+
requestedAmount: e.requestedAmount ?? ""
|
|
40
43
|
};
|
|
41
|
-
}), f =
|
|
42
|
-
if (!f && !
|
|
44
|
+
}), f = r.length > 0 && (r.length > 1 || r[0]?.wireInRequest), y = !w && l;
|
|
45
|
+
if (!f && !y)
|
|
43
46
|
return null;
|
|
44
|
-
const
|
|
45
|
-
const
|
|
47
|
+
const T = (e) => {
|
|
48
|
+
const t = new Date(e), o = t.toLocaleTimeString("en-US", {
|
|
46
49
|
hour: "numeric",
|
|
47
|
-
minute:
|
|
50
|
+
minute: t.getMinutes() === 0 ? void 0 : "2-digit",
|
|
48
51
|
hour12: !0,
|
|
49
52
|
timeZone: "America/Los_Angeles",
|
|
50
53
|
timeZoneName: "short"
|
|
51
|
-
}).replace(/\s?(AM|PM)/i, (
|
|
54
|
+
}).replace(/\s?(AM|PM)/i, (F) => F.trim().toLowerCase()), m = t.toLocaleDateString("en-US", {
|
|
52
55
|
month: "long",
|
|
53
56
|
day: "numeric",
|
|
54
57
|
year: "numeric",
|
|
55
58
|
timeZone: "America/Los_Angeles"
|
|
56
59
|
});
|
|
57
|
-
return { time:
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
if (i &&
|
|
62
|
-
const { time:
|
|
63
|
-
return s("banner.title", { time:
|
|
60
|
+
return { time: o, date: m };
|
|
61
|
+
}, I = () => {
|
|
62
|
+
const e = r.length === 1, { wireInRequest: t, payrollRange: a } = r[0] || {};
|
|
63
|
+
if (e) {
|
|
64
|
+
if (i && t?.wireInDeadline) {
|
|
65
|
+
const { time: o, date: m } = T(t.wireInDeadline);
|
|
66
|
+
return s("banner.title", { time: o, date: m });
|
|
64
67
|
}
|
|
65
|
-
return s("banner.titleWithPayroll", { payrollRange:
|
|
68
|
+
return s("banner.titleWithPayroll", { payrollRange: a });
|
|
66
69
|
}
|
|
67
|
-
return s("banner.titleMultiple", { count:
|
|
70
|
+
return s("banner.titleMultiple", { count: r.length });
|
|
71
|
+
}, U = () => {
|
|
72
|
+
if (r.length > 1)
|
|
73
|
+
return /* @__PURE__ */ n(
|
|
74
|
+
b,
|
|
75
|
+
{
|
|
76
|
+
items: r.map(
|
|
77
|
+
({ paymentType: e, payrollRange: t, requestedAmount: a }, o) => e === "Payroll" ? /* @__PURE__ */ n(c, { children: s("banner.requestLabelPayroll", { payrollRange: t }) }, o) : /* @__PURE__ */ n(c, { children: s("banner.requestLabelContractorPaymentGroup", {
|
|
78
|
+
requestedAmount: S(Number(a))
|
|
79
|
+
}) }, o)
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
);
|
|
68
83
|
};
|
|
69
84
|
return /* @__PURE__ */ h(g, { flexDirection: "column", gap: 16, children: [
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
y && /* @__PURE__ */ n(
|
|
86
|
+
P,
|
|
72
87
|
{
|
|
73
88
|
status: "success",
|
|
74
|
-
label:
|
|
89
|
+
label: l.title,
|
|
75
90
|
onDismiss: () => {
|
|
76
|
-
|
|
91
|
+
d(!0);
|
|
77
92
|
},
|
|
78
|
-
children:
|
|
93
|
+
children: l.content
|
|
79
94
|
}
|
|
80
95
|
),
|
|
81
|
-
f && /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
items: n.map(({ payrollRange: t }, e) => /* @__PURE__ */ r(S, { children: t }, e))
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */ r(C, { variant: "secondary", onClick: D, children: s("cta.startWireTransfer") })
|
|
96
|
+
f && /* @__PURE__ */ n(L, { status: "warning", title: I(), children: /* @__PURE__ */ h(g, { flexDirection: "column", gap: 16, alignItems: "flex-start", children: [
|
|
97
|
+
/* @__PURE__ */ n("div", { children: s("banner.description") }),
|
|
98
|
+
U(),
|
|
99
|
+
/* @__PURE__ */ n(R, { variant: "secondary", onClick: C, children: s("cta.startWireTransfer") })
|
|
90
100
|
] }) })
|
|
91
101
|
] });
|
|
92
102
|
};
|
|
93
103
|
export {
|
|
94
|
-
|
|
104
|
+
ie as ConfirmWireDetailsBanner
|
|
95
105
|
};
|
|
96
106
|
//# sourceMappingURL=ConfirmWireDetailsBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState<boolean>(false)\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {wireInRequestsWithPayrolls.length > 1 && (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(({ payrollRange }, index) => (\n <Text key={index}>{payrollRange}</Text>\n ))}\n />\n )}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","jsxs","Flex","index"],"mappings":";;;;;;;;;;;AAkBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAA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ACP,OAAON,EAAkB;AAAA,QACzB,WAAW,MAAM;AACf,UAAAe,EAAgC,EAAI;AAAA,QACtC;AAAA,QAEC,UAAAf,EAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGtB+B,KACC,gBAAArC,EAACa,GAAA,EAAO,QAAO,WAAU,OAAOgC,EAAA,GAC9B,UAAA,gBAAAE,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAhD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BsB,EAA2B,SAAS,KACnC,gBAAAhC;AAAA,QAACe;AAAA,QAAA;AAAA,UACC,OAAOiB,EAA2B,IAAI,CAAC,EAAE,cAAAI,EAAA,GAAgBa,MACvD,gBAAAjD,EAACgB,GAAA,EAAkB,UAAAoB,EAAA,GAARa,CAAqB,CACjC;AAAA,QAAA;AAAA,MAAA;AAAA,MAGL,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState<boolean>(false)\n const currencyFormatter = useNumberFormatter('currency')\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n const getBannerContent = () => {\n if (wireInRequestsWithPayrolls.length > 1) {\n return (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(\n ({ paymentType, payrollRange, requestedAmount }, index) =>\n paymentType === 'Payroll' ? (\n <Text key={index}>{t('banner.requestLabelPayroll', { payrollRange })}</Text>\n ) : (\n <Text key={index}>\n {t('banner.requestLabelContractorPaymentGroup', {\n requestedAmount: currencyFormatter(Number(requestedAmount)),\n })}\n </Text>\n ),\n )}\n />\n )\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {getBannerContent()}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","currencyFormatter","useNumberFormatter","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","getBannerContent","paymentType","requestedAmount","index","jsxs","Flex"],"mappings":";;;;;;;;;;;;AAmBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC;AACF,MAAqC;AACnC,EAAAC,EAAuB,oCAAoCH,CAAU,GACrEI,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,OAAAC,GAAO,QAA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iBa,EAAkB,OAAO4B,CAAe,CAAC;AAAA,YAAA,CAC3D,KAHQC,CAIX;AAAA,UAAA;AAAA,QAEN;AAAA,MAAA;AAAA,EAIR;AAEA,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAd,KACC,gBAAAxC;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,QAAO;AAAA,QACP,OAAON,EAAkB;AAAA,QACzB,WAAW,MAAM;AACf,UAAAe,EAAgC,EAAI;AAAA,QACtC;AAAA,QAEC,UAAAf,EAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGtBiC,KACC,gBAAAvC,EAACa,GAAA,EAAO,QAAO,WAAU,OAAOkC,EAAA,GAC9B,UAAA,gBAAAM,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAtD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BuC,EAAA;AAAA,MACD,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js
CHANGED
|
@@ -15,7 +15,6 @@ import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/
|
|
|
15
15
|
import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n.js";
|
|
16
16
|
import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
|
|
17
17
|
import { payrollWireEvents as N } from "../../../../shared/constants.js";
|
|
18
|
-
import "classnames";
|
|
19
18
|
import "react";
|
|
20
19
|
import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
|
|
21
20
|
import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EACnD,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,OAAA,EAAS,SAAA;AAAA,EACrB,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6B,CACjCC,OAEO;AAAA,EACL,YAAY,OAAOA,EAAK,UAAU;AAAA,EAClC,UAAUA,EAAK,SAAS,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KA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R,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
|
|
1
|
+
{"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+B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IAC/B,aAAaC,EAAA;AAAA,EAAgC,CAC9C,IAC8B;AAE/B,SACE,gBAAAhB,EAACC,GAAA,EAAK,KAAK,IAAI,gBAAe,gBAC5B,UAAA;AAAA,IAAA,gBAAAtC,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAzC,EAAQ2B,EAAkB,wBAAwB;AAAA,QACpD;AAAA,QACA,YAAYe;AAAA,QACZ,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as k } from "react";
|
|
3
3
|
import { useTranslation as v } from "react-i18next";
|
|
4
|
-
import { useWireInRequestsListSuspense as
|
|
5
|
-
import { usePayrollsListSuspense as
|
|
4
|
+
import { useWireInRequestsListSuspense as _ } from "@gusto/embedded-api/react-query/wireInRequestsList";
|
|
5
|
+
import { usePayrollsListSuspense as E } from "@gusto/embedded-api/react-query/payrollsList";
|
|
6
6
|
import u from "./WireInstructions.module.scss.js";
|
|
7
|
-
import { BaseComponent as
|
|
7
|
+
import { BaseComponent as O } from "../../../Base/Base.js";
|
|
8
8
|
import "../../../Base/useBase.js";
|
|
9
9
|
import { Flex as p } from "../../../Common/Flex/Flex.js";
|
|
10
10
|
import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
-
import { useComponentDictionary as
|
|
11
|
+
import { useComponentDictionary as U, useI18n as L } from "../../../../i18n/I18n.js";
|
|
12
12
|
import { payrollWireEvents as C } from "../../../../shared/constants.js";
|
|
13
13
|
import { useDateFormatter as w } from "../../../../hooks/useDateFormatter.js";
|
|
14
|
-
import
|
|
15
|
-
import { useFlow as
|
|
16
|
-
function
|
|
17
|
-
const { data:
|
|
14
|
+
import B from "../../../../hooks/useNumberFormatter.js";
|
|
15
|
+
import { useFlow as Y } from "../../../Flow/useFlow.js";
|
|
16
|
+
function q(n, a) {
|
|
17
|
+
const { data: o } = _({
|
|
18
18
|
companyUuid: n
|
|
19
|
-
}), { data: d } =
|
|
19
|
+
}), { data: d } = E({
|
|
20
20
|
companyId: n,
|
|
21
21
|
processed: !0
|
|
22
|
-
}), l = (
|
|
23
|
-
(
|
|
24
|
-
), r = l.find((
|
|
25
|
-
() => l.map((
|
|
26
|
-
const h = t.find((b) => b.payrollUuid ===
|
|
22
|
+
}), l = (o.wireInRequestList || []).filter(
|
|
23
|
+
(i) => i.status === "awaiting_funds"
|
|
24
|
+
), r = l.find((i) => i.uuid === a), t = d.payrollList || [], f = k(
|
|
25
|
+
() => l.map((i) => {
|
|
26
|
+
const h = t.find((b) => b.payrollUuid === i.paymentUuid);
|
|
27
27
|
return {
|
|
28
|
-
wireInRequest:
|
|
29
|
-
payroll: h
|
|
28
|
+
wireInRequest: i,
|
|
29
|
+
payroll: h,
|
|
30
|
+
paymentType: i.paymentType,
|
|
31
|
+
requestedAmount: i.requestedAmount ?? ""
|
|
30
32
|
};
|
|
31
33
|
}),
|
|
32
34
|
[l, t]
|
|
33
35
|
);
|
|
34
36
|
return {
|
|
35
|
-
selectedInstruction:
|
|
37
|
+
selectedInstruction: k(() => r ? {
|
|
36
38
|
id: r.uuid || "",
|
|
37
39
|
trackingCode: r.uniqueTrackingCode || "",
|
|
38
40
|
amount: parseFloat(r.requestedAmount || "0"),
|
|
@@ -47,55 +49,62 @@ function k(n, a) {
|
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
function c({ label: n, value: a }) {
|
|
50
|
-
const { Text:
|
|
52
|
+
const { Text: o } = g();
|
|
51
53
|
return /* @__PURE__ */ m(p, { flexDirection: "column", gap: 8, children: [
|
|
52
|
-
/* @__PURE__ */ e(
|
|
53
|
-
/* @__PURE__ */ e(
|
|
54
|
+
/* @__PURE__ */ e(o, { className: u.fieldLabel, children: n }),
|
|
55
|
+
/* @__PURE__ */ e(o, { className: u.fieldValue, children: a })
|
|
54
56
|
] });
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */ e(
|
|
58
|
+
function j(n) {
|
|
59
|
+
return /* @__PURE__ */ e(O, { ...n, children: /* @__PURE__ */ e(G, { ...n, children: n.children }) });
|
|
58
60
|
}
|
|
59
|
-
const
|
|
61
|
+
const G = ({
|
|
60
62
|
companyId: n,
|
|
61
63
|
wireInId: a,
|
|
62
|
-
selectedWireInId:
|
|
64
|
+
selectedWireInId: o,
|
|
63
65
|
dictionary: d,
|
|
64
66
|
onEvent: l,
|
|
65
67
|
modalContainerRef: r
|
|
66
68
|
}) => {
|
|
67
|
-
|
|
68
|
-
const { t } = v("Payroll.WireInstructions"), { Select: f, Card:
|
|
69
|
+
U("Payroll.WireInstructions", d), L("Payroll.WireInstructions");
|
|
70
|
+
const { t } = v("Payroll.WireInstructions"), { Select: f, Card: A, Text: i, UnorderedList: h, Heading: b, Alert: S } = g(), D = w(), P = B("currency"), { selectedInstruction: s, activeWireInRequestsWithPayrolls: y } = q(
|
|
69
71
|
n,
|
|
70
|
-
|
|
71
|
-
),
|
|
72
|
+
o
|
|
73
|
+
), T = !a && y.length > 1, x = (N) => {
|
|
72
74
|
l(C.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {
|
|
73
75
|
selectedWireInId: N
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
|
-
return
|
|
78
|
+
return y.length === 0 || o && !s ? /* @__PURE__ */ e(p, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(i, { children: t("messages.noInstructions") }) }) : /* @__PURE__ */ m(p, { flexDirection: "column", gap: 24, children: [
|
|
77
79
|
/* @__PURE__ */ m("div", { children: [
|
|
78
80
|
/* @__PURE__ */ e(b, { as: "h2", styledAs: "h3", children: t("title") }),
|
|
79
|
-
/* @__PURE__ */ e(
|
|
81
|
+
/* @__PURE__ */ e(i, { className: u.subtitle, children: t("subtitle") })
|
|
80
82
|
] }),
|
|
81
|
-
|
|
83
|
+
T && /* @__PURE__ */ e(
|
|
82
84
|
f,
|
|
83
85
|
{
|
|
84
86
|
isRequired: !0,
|
|
85
87
|
portalContainer: r?.current || void 0,
|
|
86
88
|
label: t("selectLabel"),
|
|
87
|
-
value:
|
|
88
|
-
options:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
value: o || "",
|
|
90
|
+
options: y.map(
|
|
91
|
+
({ wireInRequest: N, payroll: I, paymentType: R, requestedAmount: F }) => {
|
|
92
|
+
const W = I?.payPeriod ? D.formatPayPeriodRange(
|
|
93
|
+
I.payPeriod.startDate,
|
|
94
|
+
I.payPeriod.endDate
|
|
95
|
+
) : "";
|
|
96
|
+
return {
|
|
97
|
+
label: R === "Payroll" ? W ? t("selectLabelPayroll", { payrollRange: W }) : t("selectFallback") : R === "ContractorPaymentGroup" ? t("selectLabelContractorPaymentGroup", {
|
|
98
|
+
requestedAmount: P(Number(F))
|
|
99
|
+
}) : t("selectFallback"),
|
|
100
|
+
value: N.uuid || ""
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
onChange: x
|
|
96
105
|
}
|
|
97
106
|
),
|
|
98
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(S, { label: t("requirementsTitle"), disableScrollIntoView: !0, children: /* @__PURE__ */ e(
|
|
99
108
|
h,
|
|
100
109
|
{
|
|
101
110
|
className: u.requirementsList,
|
|
@@ -107,7 +116,7 @@ const B = ({
|
|
|
107
116
|
]
|
|
108
117
|
}
|
|
109
118
|
) }),
|
|
110
|
-
s && /* @__PURE__ */ e(p, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ m(
|
|
119
|
+
s && /* @__PURE__ */ e(p, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ m(A, { className: u.requirementsCard, children: [
|
|
111
120
|
/* @__PURE__ */ e(
|
|
112
121
|
c,
|
|
113
122
|
{
|
|
@@ -120,7 +129,7 @@ const B = ({
|
|
|
120
129
|
c,
|
|
121
130
|
{
|
|
122
131
|
label: t("fields.amount"),
|
|
123
|
-
value:
|
|
132
|
+
value: P(s.amount)
|
|
124
133
|
}
|
|
125
134
|
),
|
|
126
135
|
/* @__PURE__ */ e("hr", {}),
|
|
@@ -173,16 +182,16 @@ const B = ({
|
|
|
173
182
|
)
|
|
174
183
|
] }) })
|
|
175
184
|
] });
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
const { t: a } = v("Payroll.WireInstructions"), { Button:
|
|
185
|
+
}, M = ({ onEvent: n }) => {
|
|
186
|
+
L("Payroll.WireInstructions");
|
|
187
|
+
const { t: a } = v("Payroll.WireInstructions"), { Button: o } = g(), { companyId: d, selectedWireInId: l } = Y(), { selectedInstruction: r } = q(d, l), t = () => {
|
|
179
188
|
n(C.PAYROLL_WIRE_INSTRUCTIONS_DONE, {
|
|
180
189
|
selectedWireInId: l
|
|
181
190
|
});
|
|
182
191
|
};
|
|
183
192
|
return /* @__PURE__ */ m("div", { className: u.footer, children: [
|
|
184
193
|
/* @__PURE__ */ e(
|
|
185
|
-
|
|
194
|
+
o,
|
|
186
195
|
{
|
|
187
196
|
variant: "secondary",
|
|
188
197
|
onClick: () => {
|
|
@@ -191,12 +200,12 @@ const B = ({
|
|
|
191
200
|
children: a("cta.close")
|
|
192
201
|
}
|
|
193
202
|
),
|
|
194
|
-
/* @__PURE__ */ e(
|
|
203
|
+
/* @__PURE__ */ e(o, { variant: "primary", onClick: t, isDisabled: !r, children: a("cta.confirm") })
|
|
195
204
|
] });
|
|
196
205
|
};
|
|
197
|
-
|
|
206
|
+
j.Footer = M;
|
|
198
207
|
export {
|
|
199
|
-
|
|
200
|
-
|
|
208
|
+
G as Root,
|
|
209
|
+
j as WireInstructions
|
|
201
210
|
};
|
|
202
211
|
//# sourceMappingURL=WireInstructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WireInstructions.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport type { ConfirmWireDetailsContextInterface } from '../ConfirmWireDetailsComponents'\nimport styles from './WireInstructions.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n selectedWireInId?: string\n onEvent: OnEventType<EventType, unknown>\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\ninterface WireInstructionFieldProps {\n label: string\n value: string\n onCopy?: () => void\n copyAriaLabel?: string\n showCopiedMessage?: boolean\n copiedMessage?: string\n}\n\nfunction useWireInstructionsState(companyId: string, selectedWireInId?: string) {\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const wireInInformation = activeWireInRequests.find(r => r.uuid === selectedWireInId)\n\n const payrolls = payrollsData.payrollList || []\n\n const activeWireInRequestsWithPayrolls = useMemo(\n () =>\n activeWireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n return {\n wireInRequest,\n payroll,\n }\n }),\n [activeWireInRequests, payrolls],\n )\n\n const selectedInstruction = useMemo(() => {\n if (!wireInInformation) return null\n\n const instruction = {\n id: wireInInformation.uuid || '',\n trackingCode: wireInInformation.uniqueTrackingCode || '',\n amount: parseFloat(wireInInformation.requestedAmount || '0'),\n bankName: wireInInformation.originationBank || '',\n bankAddress: wireInInformation.originationBankAddress || '',\n recipientName: wireInInformation.recipientName || '',\n recipientAddress: wireInInformation.recipientAddress || '',\n recipientAccountNumber: wireInInformation.recipientAccountNumber || '',\n recipientRoutingNumber: wireInInformation.recipientRoutingNumber || '',\n }\n return instruction\n }, [wireInInformation])\n\n return {\n selectedInstruction,\n activeWireInRequestsWithPayrolls,\n }\n}\n\nfunction WireInstructionField({ label, value }: WireInstructionFieldProps) {\n const { Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Text className={styles.fieldLabel}>{label}</Text>\n <Text className={styles.fieldValue}>{value}</Text>\n </Flex>\n )\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n wireInId,\n selectedWireInId,\n dictionary,\n onEvent,\n modalContainerRef,\n}: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Select, Card, Text, UnorderedList, Heading, Alert } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const formatCurrency = useNumberFormatter('currency')\n\n const { selectedInstruction, activeWireInRequestsWithPayrolls } = useWireInstructionsState(\n companyId,\n selectedWireInId,\n )\n\n const shouldShowDropdown = !wireInId && activeWireInRequestsWithPayrolls.length > 1\n\n const handleWireInSelection = (updatedSelectedWireInId: string) => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {\n selectedWireInId: updatedSelectedWireInId,\n })\n }\n\n if (activeWireInRequestsWithPayrolls.length === 0 || (selectedWireInId && !selectedInstruction)) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Text>{t('messages.noInstructions')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <div>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text className={styles.subtitle}>{t('subtitle')}</Text>\n </div>\n\n {shouldShowDropdown && (\n <Select\n isRequired\n portalContainer={modalContainerRef?.current || undefined}\n label={t('selectLabel')}\n value={selectedWireInId || ''}\n options={activeWireInRequestsWithPayrolls.map(({ wireInRequest, payroll }) => ({\n label: payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(\n payroll.payPeriod.startDate,\n payroll.payPeriod.endDate,\n )\n : t('selectFallback'),\n value: wireInRequest.uuid || '',\n }))}\n onChange={handleWireInSelection}\n />\n )}\n\n <Alert label={t('requirementsTitle')} disableScrollIntoView>\n <UnorderedList\n className={styles.requirementsList}\n items={[\n t('requirements.trackingCode'),\n t('requirements.amountMatch'),\n t('requirements.usBank'),\n t('requirements.authorized'),\n ]}\n />\n </Alert>\n\n {selectedInstruction && (\n <Flex flexDirection=\"column\" gap={16}>\n <Card className={styles.requirementsCard}>\n <WireInstructionField\n label={t('fields.trackingCode')}\n value={selectedInstruction.trackingCode}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.amount')}\n value={formatCurrency(selectedInstruction.amount)}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankName')}\n value={selectedInstruction.bankName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankAddress')}\n value={selectedInstruction.bankAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientName')}\n value={selectedInstruction.recipientName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientAddress')}\n value={selectedInstruction.recipientAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.accountNumber')}\n value={selectedInstruction.recipientAccountNumber}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.routingNumber')}\n value={selectedInstruction.recipientRoutingNumber}\n />\n </Card>\n </Flex>\n )}\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n const { companyId, selectedWireInId } = useFlow<ConfirmWireDetailsContextInterface>()\n const { selectedInstruction } = useWireInstructionsState(companyId, selectedWireInId)\n\n const handleConfirm = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE, {\n selectedWireInId,\n })\n }\n\n return (\n <div className={styles.footer}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }}\n >\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm} isDisabled={!selectedInstruction}>\n {t('cta.confirm')}\n </Button>\n </div>\n )\n}\n\nWireInstructions.Footer = Footer\n"],"names":["useWireInstructionsState","companyId","selectedWireInId","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","r","wireInInformation","payrolls","activeWireInRequestsWithPayrolls","useMemo","wireInRequest","payroll","p","WireInstructionField","label","value","Text","useComponentContext","jsxs","Flex","jsx","styles","WireInstructions","props","BaseComponent","Root","wireInId","dictionary","onEvent","modalContainerRef","useComponentDictionary","useI18n","useTranslation","Select","Card","UnorderedList","Heading","Alert","dateFormatter","useDateFormatter","formatCurrency","useNumberFormatter","selectedInstruction","shouldShowDropdown","handleWireInSelection","updatedSelectedWireInId","payrollWireEvents","Footer","t","Button","useFlow","handleConfirm"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAASA,EAAyBC,GAAmBC,GAA2B;AAC9E,QAAM,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaH;AAAA,EAAA,CACd,GAEK,EAAE,MAAMI,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKM,KAAwBJ,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAK,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAoBF,EAAqB,KAAK,CAAAC,MAAKA,EAAE,SAASN,CAAgB,GAE9EQ,IAAWL,EAAa,eAAe,CAAA,GAEvCM,IAAmCC;AAAA,IACvC,MACEL,EAAqB,IAAI,CAAAM,MAAiB;AACxC,YAAMC,IAAUJ,EAAS,KAAK,OAAKK,EAAE,gBAAgBF,EAAc,WAAW;AAC9E,aAAO;AAAA,QACL,eAAAA;AAAA,QACA,SAAAC;AAAA,MAAA;AAAA,IAEJ,CAAC;AAAA,IACH,CAACP,GAAsBG,CAAQ;AAAA,EAAA;AAoBjC,SAAO;AAAA,IACL,qBAlB0BE,EAAQ,MAC7BH,IAEe;AAAA,MAClB,IAAIA,EAAkB,QAAQ;AAAA,MAC9B,cAAcA,EAAkB,sBAAsB;AAAA,MACtD,QAAQ,WAAWA,EAAkB,mBAAmB,GAAG;AAAA,MAC3D,UAAUA,EAAkB,mBAAmB;AAAA,MAC/C,aAAaA,EAAkB,0BAA0B;AAAA,MACzD,eAAeA,EAAkB,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ireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport type { ConfirmWireDetailsContextInterface } from '../ConfirmWireDetailsComponents'\nimport styles from './WireInstructions.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n selectedWireInId?: string\n onEvent: OnEventType<EventType, unknown>\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\ninterface WireInstructionFieldProps {\n label: string\n value: string\n onCopy?: () => void\n copyAriaLabel?: string\n showCopiedMessage?: boolean\n copiedMessage?: string\n}\n\nfunction useWireInstructionsState(companyId: string, selectedWireInId?: string) {\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const wireInInformation = activeWireInRequests.find(r => r.uuid === selectedWireInId)\n\n const payrolls = payrollsData.payrollList || []\n\n const activeWireInRequestsWithPayrolls = useMemo(\n () =>\n activeWireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n return {\n wireInRequest,\n payroll,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n }),\n [activeWireInRequests, payrolls],\n )\n\n const selectedInstruction = useMemo(() => {\n if (!wireInInformation) return null\n\n const instruction = {\n id: wireInInformation.uuid || '',\n trackingCode: wireInInformation.uniqueTrackingCode || '',\n amount: parseFloat(wireInInformation.requestedAmount || '0'),\n bankName: wireInInformation.originationBank || '',\n bankAddress: wireInInformation.originationBankAddress || '',\n recipientName: wireInInformation.recipientName || '',\n recipientAddress: wireInInformation.recipientAddress || '',\n recipientAccountNumber: wireInInformation.recipientAccountNumber || '',\n recipientRoutingNumber: wireInInformation.recipientRoutingNumber || '',\n }\n return instruction\n }, [wireInInformation])\n\n return {\n selectedInstruction,\n activeWireInRequestsWithPayrolls,\n }\n}\n\nfunction WireInstructionField({ label, value }: WireInstructionFieldProps) {\n const { Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Text className={styles.fieldLabel}>{label}</Text>\n <Text className={styles.fieldValue}>{value}</Text>\n </Flex>\n )\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n wireInId,\n selectedWireInId,\n dictionary,\n onEvent,\n modalContainerRef,\n}: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Select, Card, Text, UnorderedList, Heading, Alert } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const formatCurrency = useNumberFormatter('currency')\n\n const { selectedInstruction, activeWireInRequestsWithPayrolls } = useWireInstructionsState(\n companyId,\n selectedWireInId,\n )\n\n const shouldShowDropdown = !wireInId && activeWireInRequestsWithPayrolls.length > 1\n\n const handleWireInSelection = (updatedSelectedWireInId: string) => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {\n selectedWireInId: updatedSelectedWireInId,\n })\n }\n\n if (activeWireInRequestsWithPayrolls.length === 0 || (selectedWireInId && !selectedInstruction)) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Text>{t('messages.noInstructions')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <div>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text className={styles.subtitle}>{t('subtitle')}</Text>\n </div>\n\n {shouldShowDropdown && (\n <Select\n isRequired\n portalContainer={modalContainerRef?.current || undefined}\n label={t('selectLabel')}\n value={selectedWireInId || ''}\n options={activeWireInRequestsWithPayrolls.map(\n ({ wireInRequest, payroll, paymentType, requestedAmount }) => {\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(\n payroll.payPeriod.startDate,\n payroll.payPeriod.endDate,\n )\n : ''\n\n return {\n label:\n paymentType === 'Payroll'\n ? payrollRange\n ? t('selectLabelPayroll', { payrollRange })\n : t('selectFallback')\n : paymentType === 'ContractorPaymentGroup'\n ? t('selectLabelContractorPaymentGroup', {\n requestedAmount: formatCurrency(Number(requestedAmount)),\n })\n : t('selectFallback'),\n value: wireInRequest.uuid || '',\n }\n },\n )}\n onChange={handleWireInSelection}\n />\n )}\n <Alert label={t('requirementsTitle')} disableScrollIntoView>\n <UnorderedList\n className={styles.requirementsList}\n items={[\n t('requirements.trackingCode'),\n t('requirements.amountMatch'),\n t('requirements.usBank'),\n t('requirements.authorized'),\n ]}\n />\n </Alert>\n {selectedInstruction && (\n <Flex flexDirection=\"column\" gap={16}>\n <Card className={styles.requirementsCard}>\n <WireInstructionField\n label={t('fields.trackingCode')}\n value={selectedInstruction.trackingCode}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.amount')}\n value={formatCurrency(selectedInstruction.amount)}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankName')}\n value={selectedInstruction.bankName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankAddress')}\n value={selectedInstruction.bankAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientName')}\n value={selectedInstruction.recipientName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientAddress')}\n value={selectedInstruction.recipientAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.accountNumber')}\n value={selectedInstruction.recipientAccountNumber}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.routingNumber')}\n value={selectedInstruction.recipientRoutingNumber}\n />\n </Card>\n </Flex>\n )}\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n const { companyId, selectedWireInId } = useFlow<ConfirmWireDetailsContextInterface>()\n const { selectedInstruction } = useWireInstructionsState(companyId, selectedWireInId)\n\n const handleConfirm = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE, {\n selectedWireInId,\n })\n }\n\n return (\n <div className={styles.footer}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }}\n >\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm} isDisabled={!selectedInstruction}>\n {t('cta.confirm')}\n </Button>\n </div>\n )\n}\n\nWireInstructions.Footer = Footer\n"],"names":["useWireInstructionsState","companyId","selectedWireInId","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","r","wireInInformation","payrolls","activeWireInRequestsWithPayrolls","useMemo","wireInRequest","payroll","p","WireInstructionField","label","value","Text","useComponentContext","jsxs","Flex","jsx","styles","WireInstructions","props","BaseComponent","Root","wireInId","dictionary","onEvent","modalContainerRef","useComponentDictionary","useI18n","useTranslation","Select","Card","UnorderedList","Heading","Alert","dateFormatter","useDateFormatter","formatCurrency","useNumberFormatter","selectedInstruction","shouldShowDropdown","handleWireInSelection","updatedSelectedWireInId","payrollWireEvents","paymentType","requestedAmount","payrollRange","Footer","t","Button","useFlow","handleConfirm"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAASA,EAAyBC,GAAmBC,GAA2B;AAC9E,QAAM,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaH;AAAA,EAAA,CACd,GAEK,EAAE,MAAMI,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKM,KAAwBJ,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAK,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAoBF,EAAqB,KAAK,CAAAC,MAAKA,EAAE,SAASN,CAAgB,GAE9EQ,IAAWL,EAAa,eAAe,CAAA,GAEvCM,IAAmCC;AAAA,IACvC,MACEL,EAAqB,IAAI,CAAAM,MAAiB;AACxC,YAAMC,IAAUJ,EAAS,KAAK,OAAKK,EAAE,gBAAgBF,EAAc,WAAW;AAC9E,aAAO;AAAA,QACL,eAAAA;AAAA,QACA,SAAAC;AAAA,QACA,aAAaD,EAAc;AAAA,QAC3B,iBAAiBA,EAAc,mBAAmB;AAAA,MAAA;AAAA,IAEtD,CAAC;AAAA,IACH,CAACN,GAAsBG,CAAQ;AAAA,EAAA;AAoBjC,SAAO;AAAA,IACL,qBAlB0BE,EAAQ,MAC7BH,IAEe;AAAA,MAClB,IAAIA,EAAkB,QAAQ;AAAA,MAC9B,cAAcA,EAAkB,sBAAsB;AAAA,MACtD,QAAQ,WAAWA,EAAkB,mBAAmB,GAAG;AAAA,MAC3D,UAAUA,EAAkB,mBAAmB;AAAA,MAC/C,aAAaA,EAAkB,0BAA0B;AAAA,MACzD,eAAeA,EAAkB,iBAAiB;AAAA,MAClD,kBAAkBA,EAAkB,oBAAoB;AAAA,MACxD,wBAAwBA,EAAkB,0B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