@gusto/embedded-react-sdk 0.31.1 → 0.33.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 +67 -0
- package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
- package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
- package/dist/components/Base/Base.js +46 -45
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Base/useBase.d.ts +2 -3
- package/dist/components/Base/useBase.js.map +1 -1
- package/dist/components/Base/useBaseSubmit.js +32 -19
- package/dist/components/Base/useBaseSubmit.js.map +1 -1
- package/dist/components/Common/DataView/DataView.js +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
- package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBox.d.ts +2 -0
- package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +16 -0
- package/dist/components/Common/MultiSelectComboBox/index.d.ts +3 -0
- package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +4 -3
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Badge/Badge.js +39 -8
- package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
- package/dist/components/Common/UI/Badge/Badge.module.scss.js +8 -4
- package/dist/components/Common/UI/Badge/Badge.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +12 -0
- package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.d.ts +2 -0
- package/dist/components/Common/UI/Box/Box.js +13 -0
- package/dist/components/Common/UI/Box/Box.js.map +1 -0
- package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
- package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
- package/dist/components/Common/UI/Box/index.d.ts +2 -0
- package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/List/List.module.scss.js +1 -1
- package/dist/components/Common/UI/Modal/Modal.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
- 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 +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +2 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +2 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -5
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +2 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +2 -2
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +3 -2
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +2 -2
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +2 -2
- package/dist/components/Company/Industry/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +3 -2
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +3 -2
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +2 -2
- package/dist/components/Company/OnboardingOverview/Completed.js +11 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +38 -26
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +7 -6
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +2 -2
- package/dist/components/Company/PaySchedule/PaySchedule.js +24 -21
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +2 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +40 -46
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +2 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +2 -2
- package/dist/components/Company/index.js +20 -20
- package/dist/components/Contractor/Address/Address.js +6 -6
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +7 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +2 -2
- package/dist/components/Contractor/ContractorList/index.js +16 -15
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +11 -10
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +151 -116
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +4 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +55 -50
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +61 -66
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +21 -22
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +3 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +27 -27
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +2 -2
- package/dist/components/Contractor/Submit/Submit.js +20 -19
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +3 -2
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -2
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +7 -6
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/stateMachine.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +2 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +46 -41
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +2 -2
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +3 -2
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +6 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +2 -2
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
- package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +2 -2
- package/dist/components/Employee/Landing/Landing.js +50 -44
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +6 -5
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +3 -2
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +2 -2
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +8 -7
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +9 -8
- package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +2 -2
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
- package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +2 -2
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +7 -6
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +19 -19
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +2 -2
- package/dist/components/Employee/index.js +22 -22
- package/dist/components/Flow/Flow.js +8 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +1 -0
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
- package/dist/components/InformationRequests/InformationRequests.js +36 -43
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/InformationRequests/index.js +4 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +1 -0
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +46 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
- package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
- package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +37 -35
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +16 -24
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +30 -24
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/payrollHelpers.test.d.ts +1 -0
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +12 -8
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +42 -41
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +4 -3
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -35
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
- package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +16 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +19 -18
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +39 -36
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +18 -19
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +7 -6
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -3
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +22 -18
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -2
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
- package/dist/contexts/ThemeProvider/theme.js +1 -0
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/apiErrorToList.js +14 -8
- package/dist/helpers/apiErrorToList.js.map +1 -1
- package/dist/helpers/dateFormatting.js +61 -45
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.d.ts +1 -0
- package/dist/helpers/formattedStrings.js +21 -20
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
- package/dist/i18n/I18n.js +7 -7
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
- package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
- package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
- package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
- package/dist/i18n/en/Employee.Landing.json.js +7 -9
- package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
- package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
- package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
- package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
- package/dist/i18n/en/common.json.d.ts +4 -1
- package/dist/i18n/en/common.json.js +5 -5
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +6 -4
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +79 -2
- package/docs/reference/endpoint-inventory.json +1706 -0
- package/package.json +29 -13
- package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
- package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../Base';
|
|
2
2
|
export interface InformationRequestsFlowProps extends Omit<BaseComponentInterface<'InformationRequests'>, 'onEvent'> {
|
|
3
3
|
companyId: string;
|
|
4
|
-
filterByPayrollBlocking?: boolean;
|
|
5
4
|
/**
|
|
6
5
|
* When true (default), the submission success alert is rendered at the top of this component.
|
|
7
6
|
* Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.
|
|
@@ -9,4 +8,4 @@ export interface InformationRequestsFlowProps extends Omit<BaseComponentInterfac
|
|
|
9
8
|
withAlert?: boolean;
|
|
10
9
|
onEvent?: BaseComponentInterface['onEvent'];
|
|
11
10
|
}
|
|
12
|
-
export declare function InformationRequestsFlow({ companyId, dictionary,
|
|
11
|
+
export declare function InformationRequestsFlow({ companyId, dictionary, withAlert, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { useMachine as
|
|
4
|
-
import { useState as R, useCallback as p, useMemo as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { informationRequestsMachine as
|
|
7
|
-
import { BaseBoundaries as
|
|
1
|
+
import { jsx as t, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as v } from "robot3";
|
|
3
|
+
import { useMachine as L } from "react-robot";
|
|
4
|
+
import { useState as R, useCallback as p, useMemo as b, Suspense as Q } from "react";
|
|
5
|
+
import { useTranslation as U } from "react-i18next";
|
|
6
|
+
import { informationRequestsMachine as P } from "./informationRequestsStateMachine.js";
|
|
7
|
+
import { BaseBoundaries as g } from "../Base/Base.js";
|
|
8
8
|
import "../Base/useBase.js";
|
|
9
|
-
import { Flex as
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { Flex as j } from "../Common/Flex/Flex.js";
|
|
10
|
+
import "classnames";
|
|
11
|
+
import { useComponentContext as k } from "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import { FlowContext as B } from "../Flow/useFlow.js";
|
|
13
|
+
import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
|
|
13
14
|
import { informationRequestEvents as s } from "../../shared/constants.js";
|
|
14
|
-
import { InformationRequestList as
|
|
15
|
+
import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
|
|
15
16
|
const E = "informationRequestResponded";
|
|
16
17
|
function re({
|
|
17
18
|
companyId: r,
|
|
18
19
|
dictionary: I,
|
|
19
|
-
filterByPayrollBlocking: O = !1,
|
|
20
20
|
withAlert: a = !0,
|
|
21
|
-
onEvent:
|
|
21
|
+
onEvent: O = () => {
|
|
22
22
|
}
|
|
23
23
|
}) {
|
|
24
|
-
|
|
25
|
-
const { t: m } =
|
|
24
|
+
$("InformationRequests", I), w("InformationRequests");
|
|
25
|
+
const { t: m } = U("InformationRequests"), { Modal: M, LoadingSpinner: c, Alert: x, Text: h } = k(), [A, i] = R(!1), [C, f] = R({
|
|
26
26
|
nextAlertId: 0,
|
|
27
27
|
alerts: []
|
|
28
|
-
}),
|
|
28
|
+
}), F = p((e) => {
|
|
29
29
|
f((o) => ({
|
|
30
30
|
...o,
|
|
31
|
-
alerts: o.alerts.filter((
|
|
31
|
+
alerts: o.alerts.filter((q) => q.id !== e)
|
|
32
32
|
}));
|
|
33
|
-
}, []),
|
|
33
|
+
}, []), N = p(() => {
|
|
34
34
|
f((e) => ({
|
|
35
35
|
nextAlertId: e.nextAlertId + 1,
|
|
36
36
|
alerts: [{ id: e.nextAlertId }, ...e.alerts]
|
|
37
37
|
}));
|
|
38
|
-
}, []),
|
|
39
|
-
() =>
|
|
38
|
+
}, []), T = b(
|
|
39
|
+
() => v(
|
|
40
40
|
"list",
|
|
41
|
-
|
|
41
|
+
P,
|
|
42
42
|
() => ({
|
|
43
43
|
component: null,
|
|
44
44
|
companyId: r,
|
|
@@ -46,47 +46,40 @@ function re({
|
|
|
46
46
|
})
|
|
47
47
|
),
|
|
48
48
|
[r]
|
|
49
|
-
), [u,
|
|
49
|
+
), [u, _] = L(T);
|
|
50
50
|
function n(e, o) {
|
|
51
|
-
|
|
51
|
+
_({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && N(), O(e, o);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const S = () => {
|
|
54
54
|
i(!1);
|
|
55
55
|
}, l = u.context.component, d = l?.Footer || void 0;
|
|
56
56
|
return /* @__PURE__ */ t(
|
|
57
|
-
|
|
57
|
+
B.Provider,
|
|
58
58
|
{
|
|
59
59
|
value: {
|
|
60
60
|
...u.context,
|
|
61
61
|
onEvent: n
|
|
62
62
|
},
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
a &&
|
|
65
|
-
|
|
63
|
+
children: /* @__PURE__ */ D(j, { flexDirection: "column", gap: 32, children: [
|
|
64
|
+
a && C.alerts.map((e) => /* @__PURE__ */ t(
|
|
65
|
+
x,
|
|
66
66
|
{
|
|
67
67
|
status: "success",
|
|
68
68
|
label: m(`alerts.${E}.title`),
|
|
69
69
|
onDismiss: () => {
|
|
70
|
-
|
|
70
|
+
F(e.id);
|
|
71
71
|
},
|
|
72
|
-
children: /* @__PURE__ */ t(
|
|
72
|
+
children: /* @__PURE__ */ t(h, { children: m(`alerts.${E}.description`) })
|
|
73
73
|
},
|
|
74
74
|
e.id
|
|
75
75
|
)),
|
|
76
|
-
/* @__PURE__ */ t(
|
|
77
|
-
Y,
|
|
78
|
-
{
|
|
79
|
-
companyId: r,
|
|
80
|
-
filterByPayrollBlocking: O,
|
|
81
|
-
onEvent: n
|
|
82
|
-
}
|
|
83
|
-
) }),
|
|
76
|
+
/* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
|
|
84
77
|
/* @__PURE__ */ t(
|
|
85
|
-
|
|
78
|
+
M,
|
|
86
79
|
{
|
|
87
|
-
isOpen:
|
|
88
|
-
onClose:
|
|
89
|
-
footer: d && /* @__PURE__ */ t(
|
|
80
|
+
isOpen: A,
|
|
81
|
+
onClose: S,
|
|
82
|
+
footer: d && /* @__PURE__ */ t(g, { LoaderComponent: () => /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }),
|
|
90
83
|
children: l && /* @__PURE__ */ t(l, {})
|
|
91
84
|
}
|
|
92
85
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n
|
|
1
|
+
{"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={() => <LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKG,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAH,EAAc,CAAAI,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqBJ,EAAY,MAAM;AAC3C,IAAAF,EAAc,CAAAI,OAAS;AAAA,MACrB,aAAaA,EAAK,cAAc;AAAA,MAChC,QAAQ,CAAC,EAAE,IAAIA,EAAK,YAAA,GAAe,GAAGA,EAAK,MAAM;AAAA,IAAA,EACjD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqCC;AAAA,IACzC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA4C;AAAA,QAC1C,WAAW;AAAA,QACX,WAAA3B;AAA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EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EAAe,iBAAiB,MAAM,gBAAAN,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC/D,UAAA,gBAAA6B,EAACD,GAAA,EAAO,SAAST,GAAa,GAChC;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InformationRequestsFlow as t } from "./InformationRequests.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { InformationRequestForm as m } from "./InformationRequestForm/InformationRequestForm.js";
|
|
3
|
+
import { InformationRequestList as n } from "./InformationRequestList/InformationRequestList.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
m as InformationRequestForm,
|
|
6
|
+
n as InformationRequestList,
|
|
7
7
|
t as InformationRequestsFlow
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js
CHANGED
|
@@ -15,6 +15,7 @@ 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";
|
|
18
19
|
import "react";
|
|
19
20
|
import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
|
|
20
21
|
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,KAAK;AAAA,EACvD,UAA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B,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+BC,EAAE,OAAO;AAA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A;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,45 +1,47 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { usePayrollsGetSuspense as
|
|
4
|
-
import { PayrollExecutionFlow as
|
|
5
|
-
import { useFlow as
|
|
6
|
-
import { ensureRequired as
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { useMemo as m, Suspense as s } from "react";
|
|
3
|
+
import { usePayrollsGetSuspense as p } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
4
|
+
import { PayrollExecutionFlow as y } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
|
|
5
|
+
import { useFlow as l } from "../../Flow/useFlow.js";
|
|
6
|
+
import { ensureRequired as i } from "../../../helpers/ensureRequired.js";
|
|
7
|
+
import { OffCycleCreation as d } from "../OffCycleCreation/OffCycleCreation.js";
|
|
8
|
+
function h() {
|
|
9
|
+
const { companyId: o, onEvent: e } = l();
|
|
10
|
+
return /* @__PURE__ */ t(d, { companyId: i(o), onEvent: e });
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
const { companyId: o, payrollUuid: e, onEvent: n, breadcrumbs: r } =
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
}, [r]),
|
|
12
|
+
function w() {
|
|
13
|
+
const { companyId: o, payrollUuid: e, onEvent: n, breadcrumbs: r } = l(), c = m(() => {
|
|
14
|
+
const a = r?.createOffCyclePayroll?.[0];
|
|
15
|
+
return a ? [a] : void 0;
|
|
16
|
+
}, [r]), f = i(o), u = i(e);
|
|
15
17
|
return /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
16
|
-
|
|
18
|
+
C,
|
|
17
19
|
{
|
|
18
|
-
companyId:
|
|
20
|
+
companyId: f,
|
|
19
21
|
payrollId: u,
|
|
20
22
|
onEvent: n,
|
|
21
|
-
prefixBreadcrumbs:
|
|
23
|
+
prefixBreadcrumbs: c
|
|
22
24
|
}
|
|
23
25
|
) });
|
|
24
26
|
}
|
|
25
|
-
function
|
|
27
|
+
function C({
|
|
26
28
|
companyId: o,
|
|
27
29
|
payrollId: e,
|
|
28
30
|
...n
|
|
29
31
|
}) {
|
|
30
|
-
const { data: r } =
|
|
32
|
+
const { data: r } = p({ companyId: o, payrollId: e }), c = r.payrollShow?.payPeriod;
|
|
31
33
|
return /* @__PURE__ */ t(
|
|
32
|
-
|
|
34
|
+
y,
|
|
33
35
|
{
|
|
34
36
|
companyId: o,
|
|
35
37
|
payrollId: e,
|
|
36
|
-
initialPayPeriod:
|
|
38
|
+
initialPayPeriod: c,
|
|
37
39
|
...n
|
|
38
40
|
}
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
h as OffCycleCreationContextual,
|
|
45
|
+
w as OffCycleExecutionContextual
|
|
44
46
|
};
|
|
45
47
|
//# sourceMappingURL=OffCycleFlowComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { Suspense, useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\
|
|
1
|
+
{"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { Suspense, useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return <OffCycleCreation companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<OffCycleFlowContextInterface>()\n\n const prefixBreadcrumbs = useMemo(() => {\n const offCycleCreationBreadcrumb = breadcrumbs?.['createOffCyclePayroll']?.[0]\n return offCycleCreationBreadcrumb ? [offCycleCreationBreadcrumb] : undefined\n }, [breadcrumbs])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","onEvent","useFlow","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","breadcrumbs","prefixBreadcrumbs","useMemo","offCycleCreationBreadcrumb","resolvedCompanyId","resolvedPayrollId","Suspense","jsx","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;AAsBO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA;AAC/B,2BAAQC,GAAA,EAAiB,WAAWC,EAAeJ,CAAS,GAAG,SAAAC,GAAkB;AACnF;AAEO,SAASI,IAA8B;AAC5C,QAAM,EAAE,WAAAL,GAAW,aAAAM,GAAa,SAAAL,GAAS,aAAAM,EAAA,IAAgBL,EAAA,GAEnDM,IAAoBC,EAAQ,MAAM;AACtC,UAAMC,IAA6BH,GAAc,wBAA2B,CAAC;AAC7E,WAAOG,IAA6B,CAACA,CAA0B,IAAI;AAAA,EACrE,GAAG,CAACH,CAAW,CAAC,GAEVI,IAAoBP,EAAeJ,CAAS,GAC5CY,IAAoBR,EAAeE,CAAW;AAEpD,2BACGO,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,WAAWC;AAAA,MACX,SAAAX;AAAA,MACA,mBAAAO;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASO,EAA0B;AAAA,EACjC,WAAAf;AAAA,EACA,WAAAgB;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAnB,GAAW,WAAAgB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAJ;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAArB;AAAA,MACA,WAAAgB;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as v } from "react";
|
|
3
|
+
import { useForm as A, FormProvider as L } from "react-hook-form";
|
|
4
|
+
import { zodResolver as B } from "@hookform/resolvers/zod";
|
|
5
|
+
import { z as y } from "zod";
|
|
6
|
+
import { useTranslation as d } from "react-i18next";
|
|
7
|
+
import { usePayrollsCreateOffCycleMutation as T } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
|
|
8
|
+
import { OffCycleReason as p } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
|
|
9
|
+
import { RFCDate as u } from "@gusto/embedded-api/types/rfcdate";
|
|
10
|
+
import { createOffCyclePayPeriodDateFormSchema as V } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js";
|
|
11
|
+
import { useOffCyclePayPeriodDateValidation as I } from "../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
|
|
12
|
+
import { OffCycleCreationPresentation as U } from "./OffCycleCreationPresentation.js";
|
|
13
|
+
import { BaseComponent as j } from "../../Base/Base.js";
|
|
14
|
+
import { useBase as q } from "../../Base/useBase.js";
|
|
15
|
+
import { useComponentDictionary as x, useI18n as c } from "../../../i18n/I18n.js";
|
|
16
|
+
import { componentEvents as z } from "../../../shared/constants.js";
|
|
17
|
+
import { Form as N } from "../../Common/Form/Form.js";
|
|
18
|
+
import { OFF_CYCLE_REASON_DEFAULTS as D } from "../OffCycleReasonSelection/types.js";
|
|
19
|
+
const Y = {
|
|
20
|
+
bonus: p.Bonus,
|
|
21
|
+
correction: p.Correction
|
|
22
|
+
};
|
|
23
|
+
function me(n) {
|
|
24
|
+
return /* @__PURE__ */ t(j, { ...n, children: /* @__PURE__ */ t(H, { ...n }) });
|
|
25
|
+
}
|
|
26
|
+
function H({ dictionary: n, companyId: O, payrollType: i = "bonus" }) {
|
|
27
|
+
x("Payroll.OffCycleCreation", n), c("Payroll.OffCycleCreation"), c("Payroll.OffCycleReasonSelection"), c("Payroll.OffCyclePayPeriodDateForm"), c("Payroll.OffCycleDeductionsSetting");
|
|
28
|
+
const { t: P } = d("Payroll.OffCyclePayPeriodDateForm"), { t: h } = d("Payroll.OffCycleCreation"), { onEvent: k, baseSubmitHandler: R } = q(), { minCheckDate: F, today: E } = I(), { mutateAsync: S, isPending: b } = T(), w = (e) => P(e), o = A({
|
|
29
|
+
resolver: (e, a, r) => {
|
|
30
|
+
const l = e.reason, m = e.isCheckOnly, s = V(
|
|
31
|
+
w,
|
|
32
|
+
l === "correction" ? "correction" : i,
|
|
33
|
+
m ? E : F
|
|
34
|
+
), _ = y.object({ reason: y.enum(["bonus", "correction"]), skipRegularDeductions: y.boolean() }).and(s);
|
|
35
|
+
return B(_)(e, a, r);
|
|
36
|
+
},
|
|
37
|
+
defaultValues: {
|
|
38
|
+
reason: i,
|
|
39
|
+
isCheckOnly: !1,
|
|
40
|
+
startDate: null,
|
|
41
|
+
endDate: null,
|
|
42
|
+
checkDate: null,
|
|
43
|
+
skipRegularDeductions: D[i].skipDeductions
|
|
44
|
+
}
|
|
45
|
+
}), C = o.watch("reason");
|
|
46
|
+
v(() => {
|
|
47
|
+
o.setValue(
|
|
48
|
+
"skipRegularDeductions",
|
|
49
|
+
D[C].skipDeductions
|
|
50
|
+
);
|
|
51
|
+
}, [C, o]);
|
|
52
|
+
const g = async (e) => {
|
|
53
|
+
const a = e.reason, r = e.checkDate, l = e.isCheckOnly ? r : e.startDate, m = e.isCheckOnly ? r : e.endDate;
|
|
54
|
+
await R(e, async () => {
|
|
55
|
+
const f = await S({
|
|
56
|
+
request: {
|
|
57
|
+
companyId: O,
|
|
58
|
+
requestBody: {
|
|
59
|
+
offCycle: !0,
|
|
60
|
+
offCycleReason: Y[a],
|
|
61
|
+
startDate: new u(l),
|
|
62
|
+
endDate: new u(m),
|
|
63
|
+
checkDate: new u(r),
|
|
64
|
+
skipRegularDeductions: e.skipRegularDeductions,
|
|
65
|
+
isCheckOnlyPayroll: e.isCheckOnly
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}), s = f.payrollPrepared?.payrollUuid ?? f.payrollPrepared?.uuid;
|
|
69
|
+
if (!s)
|
|
70
|
+
throw new Error(h("errors.missingPayrollId"));
|
|
71
|
+
k(z.OFF_CYCLE_CREATED, { payrollUuid: s });
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ t(L, { ...o, children: /* @__PURE__ */ t(N, { onSubmit: o.handleSubmit(g), children: /* @__PURE__ */ t(U, { isPending: b }) }) });
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
me as OffCycleCreation
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=OffCycleCreation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport { OffCycleReason as ApiOffCycleReason } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation()\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const translateValidation = (key: string): string => t(key as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n )\n const schema = z\n .object({ reason: z.enum(['bonus', 'correction']), skipRegularDeductions: z.boolean() })\n .and(dateSchema)\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.isCheckOnly ? checkDate : data.startDate!\n const endDate = data.isCheckOnly ? checkDate : data.endDate!\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n },\n },\n })\n\n const payrollUuid = response.payrollPrepared?.payrollUuid ?? response.payrollPrepared?.uuid\n\n if (!payrollUuid) {\n throw new Error(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation isPending={isPending} />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","translateValidation","key","methods","useForm","values","context","options","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","zodResolver","OFF_CYCLE_REASON_DEFAULTS","watchedReason","useEffect","onSubmit","data","checkDate","startDate","endDate","response","RFCDate","payrollUuid","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAMA,IAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAEO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,aAAAC,IAAc,WAAkC;AACrF,EAAAC,EAAuB,4BAA4BH,CAAU,GAC7DI,EAAQ,0BAA0B,GAClCA,EAAQ,iCAAiC,GACzCA,EAAQ,mCAAmC,GAC3CA,E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cAAcC,IAAYD,EAAK;AAEpD,UAAM1B,EAAkB0B,GAAM,YAAY;AACxC,YAAMI,IAAW,MAAMzB,EAAsB;AAAA,QAC3C,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,UAAU;AAAA,YACV,gBAAgBR,EAAoB+B,CAAM;AAAA,YAC1C,WAAW,IAAIgB,EAAQH,CAAS;AAAA,YAChC,SAAS,IAAIG,EAAQF,CAAO;AAAA,YAC5B,WAAW,IAAIE,EAAQJ,CAAS;AAAA,YAChC,uBAAuBD,EAAK;AAAA,YAC5B,oBAAoBA,EAAK;AAAA,UAAA;AAAA,QAC3B;AAAA,MACF,CACD,GAEKM,IAAcF,EAAS,iBAAiB,eAAeA,EAAS,iBAAiB;AAEvF,UAAI,CAACE;AACH,cAAM,IAAI,MAAMlC,EAAU,yBAAyB,CAAC;AAGtD,MAAAC,EAAQkC,EAAgB,mBAAmB,EAAE,aAAAD,EAAA,CAAa;AAAA,IAC5D,CAAC;AAAA,EACH;AAEA,SACE,gBAAA5C,EAAC8C,GAAA,EAAc,GAAGxB,GAChB,4BAACyB,GAAA,EAAK,UAAUzB,EAAQ,aAAae,CAAQ,GAC3C,UAAA,gBAAArC,EAACgD,GAAA,EAA6B,WAAA9B,EAAA,CAAsB,GACtD,GACF;AAEJ;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as l } from "react-i18next";
|
|
3
|
+
import { OffCyclePayPeriodDateFormPresentation as u } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
|
|
4
|
+
import { useI18n as a } from "../../../i18n/I18n.js";
|
|
5
|
+
import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
6
|
+
import { Flex as o } from "../../Common/Flex/Flex.js";
|
|
7
|
+
import "classnames";
|
|
8
|
+
import "react";
|
|
9
|
+
import { OffCycleReasonSelectionPresentation as g } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
|
|
10
|
+
import { RadioGroupField as y } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
11
|
+
function j({ isPending: n }) {
|
|
12
|
+
a("Payroll.OffCycleCreation"), a("Payroll.OffCycleDeductionsSetting");
|
|
13
|
+
const { t: i } = l("Payroll.OffCycleCreation"), { t } = l("Payroll.OffCycleDeductionsSetting"), { Heading: c, Text: s, Button: p } = d(), f = [
|
|
14
|
+
{
|
|
15
|
+
value: !1,
|
|
16
|
+
label: t("options.include.label")
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: !0,
|
|
20
|
+
label: t("options.skip.label")
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
return /* @__PURE__ */ r(o, { flexDirection: "column", gap: 32, children: [
|
|
24
|
+
/* @__PURE__ */ r(o, { flexDirection: "column", gap: 4, children: [
|
|
25
|
+
/* @__PURE__ */ e(c, { as: "h2", children: i("pageTitle") }),
|
|
26
|
+
/* @__PURE__ */ e(s, { variant: "supporting", children: i("pageDescription") })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(u, {}) }),
|
|
29
|
+
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(g, { name: "reason" }) }),
|
|
30
|
+
/* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
|
|
31
|
+
y,
|
|
32
|
+
{
|
|
33
|
+
name: "skipRegularDeductions",
|
|
34
|
+
label: t("title"),
|
|
35
|
+
description: t("description"),
|
|
36
|
+
options: f,
|
|
37
|
+
convertValueToString: (m) => String(m)
|
|
38
|
+
}
|
|
39
|
+
) }),
|
|
40
|
+
/* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(p, { type: "submit", isLoading: n, isDisabled: n, children: i("continueCta") }) })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
j as OffCycleCreationPresentation
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=OffCycleCreationPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport type { OffCycleCreationPresentationProps } from './OffCycleCreationTypes'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({ isPending }: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { Heading, Text, Button } = useComponentContext()\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n {/* TODO: EmployeeSelection section — will compose EmployeeSelectionPresentation */}\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n {/* TODO: TaxWithholdingRates section — will compose TaxWithholdingRatesPresentation */}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","isPending","useI18n","t","useTranslation","tDeductions","Heading","Text","Button","useComponentContext","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","OffCycleReasonSelectionPresentation","RadioGroupField","value"],"mappings":";;;;;;;;;;AAQO,SAASA,EAA6B,EAAE,WAAAC,KAAgD;AAC7F,EAAAC,EAAQ,0BAA0B,GAClCA,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAEC,MAAmBD,EAAe,mCAAmC,GACvE,EAAE,SAAAE,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAoB;AAAA,IACxB;AAAA,MACE,OAAO;AAAA,MACP,OAAOL,EAAY,uBAAuB;AAAA,IAAA;AAAA,IAE5C;AAAA,MACE,OAAO;AAAA,MACP,OAAOA,EAAY,oBAAoB;AAAA,IAAA;AAAA,EACzC;AAGF,SACE,gBAAAM,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,GAChC,UAAA;AAAA,MAAA,gBAAAC,EAACP,GAAA,EAAQ,IAAG,MAAM,UAAAH,EAAE,WAAW,GAAE;AAAA,wBAChCI,GAAA,EAAK,SAAQ,cAAc,UAAAJ,EAAE,iBAAiB,EAAA,CAAE;AAAA,IAAA,GACnD;AAAA,IAEA,gBAAAU,EAACD,KAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC,EAACC,KAAsC,EAAA,CACzC;AAAA,IAEA,gBAAAD,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC,EAACE,GAAA,EAAoC,MAAK,SAAA,CAAS,EAAA,CACrD;AAAA,IAIA,gBAAAF,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC;AAAA,MAACG;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOX,EAAY,OAAO;AAAA,QAC1B,aAAaA,EAAY,aAAa;AAAA,QACtC,SAASK;AAAA,QACT,sBAAsB,CAAAO,MAAS,OAAOA,CAAK;AAAA,MAAA;AAAA,IAAA,GAE/C;AAAA,sBAICL,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACL,GAAA,EAAO,MAAK,UAAS,WAAWP,GAAW,YAAYA,GACrD,UAAAE,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OffCycleReason } from '../OffCycleReasonSelection';
|
|
2
|
+
import { OffCyclePayPeriodDateFormData, OffCyclePayrollDateType } from '../OffCyclePayPeriodDateForm';
|
|
3
|
+
import { BaseComponentInterface } from '../../Base/Base';
|
|
4
|
+
export interface OffCycleCreationProps extends BaseComponentInterface<'Payroll.OffCycleCreation'> {
|
|
5
|
+
companyId: string;
|
|
6
|
+
payrollType?: OffCyclePayrollDateType;
|
|
7
|
+
}
|
|
8
|
+
export interface OffCycleCreationFormData extends OffCyclePayPeriodDateFormData {
|
|
9
|
+
reason: OffCycleReason;
|
|
10
|
+
skipRegularDeductions: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface OffCycleCreationPresentationProps {
|
|
13
|
+
isPending?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { useTranslation as a } from "react-i18next";
|
|
4
|
+
import { useComponentDictionary as m, useI18n as f } from "../../../i18n/I18n.js";
|
|
5
|
+
import { componentEvents as d } from "../../../shared/constants.js";
|
|
6
|
+
import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
function S({
|
|
8
|
+
dictionary: o,
|
|
9
|
+
skipRegularDeductions: t,
|
|
10
|
+
onEvent: n
|
|
11
|
+
}) {
|
|
12
|
+
m("Payroll.OffCycleDeductionsSetting", o), f("Payroll.OffCycleDeductionsSetting");
|
|
13
|
+
const { t: e } = a("Payroll.OffCycleDeductionsSetting"), { RadioGroup: i } = C(), l = u(
|
|
14
|
+
() => [
|
|
15
|
+
{
|
|
16
|
+
value: "include",
|
|
17
|
+
label: e("options.include.label")
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "skip",
|
|
21
|
+
label: e("options.skip.label")
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
[e]
|
|
25
|
+
), s = (c) => {
|
|
26
|
+
n(d.OFF_CYCLE_DEDUCTIONS_CHANGE, {
|
|
27
|
+
skipRegularDeductions: c === "skip"
|
|
28
|
+
});
|
|
29
|
+
}, r = t ? "skip" : "include";
|
|
30
|
+
return /* @__PURE__ */ p(
|
|
31
|
+
i,
|
|
32
|
+
{
|
|
33
|
+
label: e("title"),
|
|
34
|
+
description: e("description"),
|
|
35
|
+
options: l,
|
|
36
|
+
value: r,
|
|
37
|
+
onChange: s
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
S as OffCycleDeductionsSetting
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=OffCycleDeductionsSetting.js.map
|