@gusto/embedded-react-sdk 0.24.1 → 0.25.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 +69 -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.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 +12 -11
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
- package/dist/components/Common/UI/FileInput/FileInput.js +151 -0
- package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +34 -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/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 +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
- package/dist/components/Company/FederalTaxes/Form.js +3 -2
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +35 -33
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +30 -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 +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
- package/dist/components/Company/PaySchedule/_parts/Head.js +9 -8
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +12 -11
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +2 -2
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +31 -30
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +61 -59
- package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +34 -31
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +29 -10
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +3 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +33 -31
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +2 -0
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +25 -19
- package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +1 -0
- package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +86 -56
- 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 +116 -99
- 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 +157 -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/PaymentsList/PaymentsListPresentation.js +46 -48
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +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 +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +58 -56
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +3 -2
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +34 -32
- 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 +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +8 -8
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +3 -2
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js +142 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +18 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestForm/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.d.ts +7 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js +88 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestList/index.d.ts +2 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.d.ts +6 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js +55 -0
- package/dist/components/Payroll/InformationRequests/InformationRequests.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.d.ts +19 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js +20 -0
- package/dist/components/Payroll/InformationRequests/InformationRequestsComponents.js.map +1 -0
- package/dist/components/Payroll/InformationRequests/index.d.ts +3 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js +47 -0
- package/dist/components/Payroll/InformationRequests/informationRequestsStateMachine.js.map +1 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +7 -6
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +3 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.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 +5 -2
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +107 -99
- 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 -145
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +14 -12
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
- package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +174 -106
- 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 +84 -102
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +24 -20
- package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +2 -0
- package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +51 -46
- 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 +111 -45
- package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -125
- 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 +117 -110
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -2
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +282 -278
- 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.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/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 +73 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +10 -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 +46 -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/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 -0
- package/dist/components/Payroll/index.js +18 -14
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +43 -31
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- 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/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 +23 -18
- 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 +3 -3
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +36 -32
- 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.PaymentsList.json.js +14 -14
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestForm.json.js.map +1 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js +18 -0
- package/dist/i18n/en/Payroll.InformationRequestList.json.js.map +1 -0
- 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 +5 -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 +14 -0
- package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +8 -0
- package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
- 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/shared/constants.d.ts +24 -0
- package/dist/shared/constants.js +70 -54
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +119 -3
- package/package.json +31 -20
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
import { OnEventType } from '../../../Base/useBase';
|
|
3
|
+
import { EventType } from '../../../../shared/constants';
|
|
4
|
+
interface InformationRequestFormProps extends BaseComponentInterface<'Payroll.InformationRequestForm'> {
|
|
5
|
+
companyId: string;
|
|
6
|
+
requestId: string;
|
|
7
|
+
onEvent: OnEventType<EventType, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare function InformationRequestForm(props: InformationRequestFormProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace InformationRequestForm {
|
|
11
|
+
var Footer: ({ onEvent }: {
|
|
12
|
+
onEvent: OnEventType<EventType, unknown>;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/dist/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as x } from "react-i18next";
|
|
3
|
+
import { useForm as Q, FormProvider as k } from "react-hook-form";
|
|
4
|
+
import { zodResolver as L } from "@hookform/resolvers/zod";
|
|
5
|
+
import { z as m } from "zod";
|
|
6
|
+
import { useIsMutating as B } from "@tanstack/react-query";
|
|
7
|
+
import { useInformationRequestsGetInformationRequestsSuspense as j } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
8
|
+
import { useInformationRequestsSubmitMutation as z, mutationKeyInformationRequestsSubmit as H } from "@gusto/embedded-api/react-query/informationRequestsSubmit";
|
|
9
|
+
import { ResponseType as p } from "@gusto/embedded-api/models/components/informationrequest";
|
|
10
|
+
import { ResponseType as b } from "@gusto/embedded-api/models/operations/submitinformationrequest";
|
|
11
|
+
import s from "./InformationRequestForm.module.scss.js";
|
|
12
|
+
import { BaseComponent as K } from "../../../Base/Base.js";
|
|
13
|
+
import { useBase as V } from "../../../Base/useBase.js";
|
|
14
|
+
import { Flex as v } from "../../../Common/Flex/Flex.js";
|
|
15
|
+
import "classnames";
|
|
16
|
+
import { informationRequestEvents as U } from "../../../../shared/constants.js";
|
|
17
|
+
import { ActionsLayout as W } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
18
|
+
import { useComponentContext as N } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
|
+
import "react";
|
|
20
|
+
import { FileInputField as G } from "../../../Common/Fields/FileInputField/FileInputField.js";
|
|
21
|
+
import { Form as Y } from "../../../Common/Form/Form.js";
|
|
22
|
+
import { useComponentDictionary as $, useI18n as E } from "../../../../i18n/I18n.js";
|
|
23
|
+
import { TextInputField as J } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
24
|
+
const A = "gusto-sdk-information-request-form", X = ["image/jpeg", "image/png", "application/pdf"], Z = m.record(
|
|
25
|
+
m.string(),
|
|
26
|
+
m.union([m.string().min(1), m.instanceof(File)])
|
|
27
|
+
);
|
|
28
|
+
function ee(n) {
|
|
29
|
+
return /* @__PURE__ */ o(K, { ...n, children: /* @__PURE__ */ o(te, { ...n, children: n.children }) });
|
|
30
|
+
}
|
|
31
|
+
const oe = (n) => new Promise((r, i) => {
|
|
32
|
+
const t = new FileReader();
|
|
33
|
+
t.onload = () => {
|
|
34
|
+
r(t.result);
|
|
35
|
+
}, t.onerror = i, t.readAsDataURL(n);
|
|
36
|
+
});
|
|
37
|
+
function te({ companyId: n, requestId: r, dictionary: i }) {
|
|
38
|
+
$("Payroll.InformationRequestForm", i), E("Payroll.InformationRequestForm");
|
|
39
|
+
const { t } = x("Payroll.InformationRequestForm"), { Alert: u, Heading: T, Text: q } = N(), { onEvent: D, baseSubmitHandler: M } = V(), { data: P } = j({
|
|
40
|
+
companyUuid: n
|
|
41
|
+
}), F = P.informationRequestList?.find((e) => e.uuid === r), I = F?.requiredQuestions ?? [], S = F?.blockingPayroll ?? !1, { mutateAsync: C } = z(), R = {}, y = [];
|
|
42
|
+
I.forEach((e) => {
|
|
43
|
+
!e.questionUuid || !e.responseType || (e.responseType === p.Text ? (y.push(e.questionUuid), R[e.questionUuid] = "") : e.responseType === p.Document && (y.push(e.questionUuid), R[e.questionUuid] = void 0));
|
|
44
|
+
});
|
|
45
|
+
const g = Q({
|
|
46
|
+
resolver: L(Z),
|
|
47
|
+
defaultValues: R
|
|
48
|
+
}), w = async (e) => {
|
|
49
|
+
await M(e, async () => {
|
|
50
|
+
const d = (await Promise.all(
|
|
51
|
+
y.map(async (a) => {
|
|
52
|
+
const l = e[a];
|
|
53
|
+
if (typeof l == "string")
|
|
54
|
+
return {
|
|
55
|
+
questionUuid: a,
|
|
56
|
+
responseType: b.Text,
|
|
57
|
+
textResponse: l
|
|
58
|
+
};
|
|
59
|
+
if (l instanceof File) {
|
|
60
|
+
const O = await oe(l);
|
|
61
|
+
return {
|
|
62
|
+
questionUuid: a,
|
|
63
|
+
responseType: b.Document,
|
|
64
|
+
fileResponse: O,
|
|
65
|
+
fileName: l.name
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
})
|
|
70
|
+
)).filter((a) => a !== null), h = await C({
|
|
71
|
+
request: {
|
|
72
|
+
informationRequestUuid: r,
|
|
73
|
+
requestBody: {
|
|
74
|
+
requiredQuestions: d
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
D(U.INFORMATION_REQUEST_FORM_DONE, h.informationRequest);
|
|
79
|
+
});
|
|
80
|
+
}, _ = (e) => {
|
|
81
|
+
if (!e.questionUuid || !e.responseType) return null;
|
|
82
|
+
const c = e.questionUuid, d = e.responseType === p.Document, h = e.responseType === p.Text;
|
|
83
|
+
return /* @__PURE__ */ f("div", { className: s.questionCard, children: [
|
|
84
|
+
/* @__PURE__ */ f("div", { className: s.questionDescription, children: [
|
|
85
|
+
/* @__PURE__ */ o(q, { weight: "medium", children: t(d ? "questionTypes.document" : "questionTypes.answer") }),
|
|
86
|
+
/* @__PURE__ */ o(q, { children: e.questionText })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ o("hr", { className: s.divider }),
|
|
89
|
+
h && /* @__PURE__ */ o("div", { className: s.textInputWrapper, children: /* @__PURE__ */ o(
|
|
90
|
+
J,
|
|
91
|
+
{
|
|
92
|
+
name: c,
|
|
93
|
+
label: t("fields.textAnswer.label"),
|
|
94
|
+
placeholder: t("fields.textAnswer.placeholder"),
|
|
95
|
+
isRequired: !0,
|
|
96
|
+
errorMessage: t("validation.required")
|
|
97
|
+
}
|
|
98
|
+
) }),
|
|
99
|
+
d && /* @__PURE__ */ o("div", { className: s.fileInputWrapper, children: /* @__PURE__ */ o(
|
|
100
|
+
G,
|
|
101
|
+
{
|
|
102
|
+
name: c,
|
|
103
|
+
label: t("fields.fileUpload.label"),
|
|
104
|
+
accept: X,
|
|
105
|
+
isRequired: !0,
|
|
106
|
+
errorMessage: t("validation.required")
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] }, c);
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ o("div", { className: s.root, children: /* @__PURE__ */ f(v, { flexDirection: "column", gap: 16, children: [
|
|
112
|
+
/* @__PURE__ */ o(T, { as: "h2", children: t("title") }),
|
|
113
|
+
S && /* @__PURE__ */ o(u, { status: "error", label: t("blockingAlert.title"), disableScrollIntoView: !0, children: t("blockingAlert.description") }),
|
|
114
|
+
/* @__PURE__ */ o(k, { ...g, children: /* @__PURE__ */ o(Y, { id: A, onSubmit: g.handleSubmit(w), children: /* @__PURE__ */ o(v, { flexDirection: "column", gap: 16, children: I.map(_) }) }) })
|
|
115
|
+
] }) });
|
|
116
|
+
}
|
|
117
|
+
const ne = ({ onEvent: n }) => {
|
|
118
|
+
E("Payroll.InformationRequestForm");
|
|
119
|
+
const { t: r } = x("Payroll.InformationRequestForm"), { Button: i } = N(), u = B({
|
|
120
|
+
mutationKey: H()
|
|
121
|
+
}) > 0;
|
|
122
|
+
return /* @__PURE__ */ f(W, { children: [
|
|
123
|
+
/* @__PURE__ */ o(i, { variant: "secondary", onClick: () => {
|
|
124
|
+
n(U.INFORMATION_REQUEST_FORM_CANCEL);
|
|
125
|
+
}, isDisabled: u, children: r("cta.cancel") }),
|
|
126
|
+
/* @__PURE__ */ o(
|
|
127
|
+
i,
|
|
128
|
+
{
|
|
129
|
+
variant: "primary",
|
|
130
|
+
type: "submit",
|
|
131
|
+
form: A,
|
|
132
|
+
isLoading: u,
|
|
133
|
+
children: r("cta.submit")
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] });
|
|
137
|
+
};
|
|
138
|
+
ee.Footer = ne;
|
|
139
|
+
export {
|
|
140
|
+
ee as InformationRequestForm
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=InformationRequestForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationRequestForm.js","sources":["../../../../../src/components/Payroll/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ActionsLayout, Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\ninterface InformationRequestFormProps extends BaseComponentInterface<'Payroll.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('Payroll.InformationRequestForm', dictionary)\n useI18n('Payroll.InformationRequestForm')\n const { t } = useTranslation('Payroll.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (!question.questionUuid || !question.responseType) return\n\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n if (!question.questionUuid || !question.responseType) return null\n\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>{question.questionText}</Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.InformationRequestForm')\n const { t } = useTranslation('Payroll.InformationRequestForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n return (\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </ActionsLayout>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","companyId","requestId","dictionary","useComponentDictionary","useI18n","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","question","ResponseType","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","TextInputField","FileInputField","Flex","FormProvider","Form","Footer","t","Button","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAA8B,sCAC9BC,IAAsB,CAAC,cAAc,aAAa,iBAAiB,GAEnEC,IAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACj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B,GAChB,UAAA,gBAAAjC,EAACuD,KAAK,IAAI7D,GAA6B,UAAUuC,EAAY,aAAaG,CAAQ,GAChF,UAAA,gBAAApC,EAACqD,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,YAAkB,IAAIR,CAAc,EAAA,CACvC,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;AAEA,MAAMW,KAAS,CAAC,EAAE,SAAAtC,QAA4D;AAC5E,EAAAN,EAAQ,gCAAgC;AACxC,QAAM,EAAE,GAAA6C,EAAA,IAAM5C,EAAe,gCAAgC,GACvD,EAAE,QAAA6C,EAAA,IAAWzC,EAAA,GAIb0C,IAHaC,EAAc;AAAA,IAC/B,aAAaC,EAAA;AAAA,EAAqC,CACnD,IAC8B;AAM/B,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAA9D,EAAC0D,GAAA,EAAO,SAAQ,aAAY,SANX,MAAM;AACzB,MAAAxC,EAAQ0B,EAAyB,+BAA+B;AAAA,IAClE,GAIuD,YAAYe,GAC5D,UAAAF,EAAE,YAAY,EAAA,CACjB;AAAA,IACA,gBAAAzD;AAAA,MAAC0D;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMhE;AAAA,QACN,WAAWiE;AAAA,QAEV,YAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EACjB,GACF;AAEJ;AAEA7D,GAAuB,SAAS0D;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const t = "_root_11yro_1", r = "_questionCard_11yro_5", o = "_questionDescription_11yro_15", e = "_textInputWrapper_11yro_22", n = "_fileInputWrapper_11yro_26", p = "_divider_11yro_31", i = {
|
|
2
|
+
root: t,
|
|
3
|
+
questionCard: r,
|
|
4
|
+
questionDescription: o,
|
|
5
|
+
textInputWrapper: e,
|
|
6
|
+
fileInputWrapper: n,
|
|
7
|
+
divider: p
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as default,
|
|
11
|
+
p as divider,
|
|
12
|
+
n as fileInputWrapper,
|
|
13
|
+
r as questionCard,
|
|
14
|
+
o as questionDescription,
|
|
15
|
+
t as root,
|
|
16
|
+
e as textInputWrapper
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=InformationRequestForm.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationRequestForm.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
interface InformationRequestListProps extends BaseComponentInterface<'Payroll.InformationRequestList'> {
|
|
3
|
+
companyId: string;
|
|
4
|
+
onEvent: BaseComponentInterface['onEvent'];
|
|
5
|
+
}
|
|
6
|
+
export declare function InformationRequestList(props: InformationRequestListProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
package/dist/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as n, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as I } from "react-i18next";
|
|
3
|
+
import { useInformationRequestsGetInformationRequests as b } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
|
|
4
|
+
import { InformationRequestStatus as s, InformationRequestType as i } from "@gusto/embedded-api/models/components/informationrequest";
|
|
5
|
+
import { BaseComponent as w } from "../../../Base/Base.js";
|
|
6
|
+
import "../../../Base/useBase.js";
|
|
7
|
+
import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
8
|
+
import { useComponentDictionary as S, useI18n as v } from "../../../../i18n/I18n.js";
|
|
9
|
+
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
10
|
+
import { useDataView as D } from "../../../Common/DataView/useDataView.js";
|
|
11
|
+
import { FlexItem as E, Flex as a } from "../../../Common/Flex/Flex.js";
|
|
12
|
+
import "classnames";
|
|
13
|
+
import { informationRequestEvents as L } from "../../../../shared/constants.js";
|
|
14
|
+
import "react";
|
|
15
|
+
function J(o) {
|
|
16
|
+
return /* @__PURE__ */ n(w, { ...o, children: /* @__PURE__ */ n(T, { ...o, children: o.children }) });
|
|
17
|
+
}
|
|
18
|
+
function T({ companyId: o, dictionary: m, onEvent: c }) {
|
|
19
|
+
S("Payroll.InformationRequestList", m), v("Payroll.InformationRequestList");
|
|
20
|
+
const { t } = I("Payroll.InformationRequestList"), { Heading: p, Text: u, Button: d, Badge: f } = x(), { data: y, isFetching: R } = b({
|
|
21
|
+
companyUuid: o
|
|
22
|
+
}), g = (y?.informationRequestList ?? []).filter(
|
|
23
|
+
(e) => e.blockingPayroll && e.status !== s.Approved
|
|
24
|
+
), h = (e) => {
|
|
25
|
+
switch (e) {
|
|
26
|
+
case i.CompanyOnboarding:
|
|
27
|
+
return t("types.companyOnboarding");
|
|
28
|
+
case i.AccountProtection:
|
|
29
|
+
return t("types.accountProtection");
|
|
30
|
+
case i.PaymentRequest:
|
|
31
|
+
return t("types.paymentRequest");
|
|
32
|
+
case i.PaymentError:
|
|
33
|
+
return t("types.paymentError");
|
|
34
|
+
default:
|
|
35
|
+
return t("types.unknown");
|
|
36
|
+
}
|
|
37
|
+
}, P = (e) => {
|
|
38
|
+
switch (e) {
|
|
39
|
+
case s.PendingResponse:
|
|
40
|
+
return { label: t("status.incomplete"), badgeStatus: "info" };
|
|
41
|
+
case s.PendingReview:
|
|
42
|
+
return { label: t("status.underReview"), badgeStatus: "warning" };
|
|
43
|
+
default:
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}, q = D({
|
|
47
|
+
data: g,
|
|
48
|
+
isFetching: R,
|
|
49
|
+
columns: [
|
|
50
|
+
{
|
|
51
|
+
key: "type",
|
|
52
|
+
title: t("columns.type"),
|
|
53
|
+
render: (e) => /* @__PURE__ */ n(E, { flexGrow: 1, children: /* @__PURE__ */ n(u, { weight: "medium", children: h(e.type) }) })
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "status",
|
|
57
|
+
title: t("columns.status"),
|
|
58
|
+
render: (e) => {
|
|
59
|
+
const r = P(e.status);
|
|
60
|
+
return r ? /* @__PURE__ */ n(a, { gap: 8, alignItems: "center", children: /* @__PURE__ */ n(f, { status: r.badgeStatus, children: r.label }) }) : null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
itemMenu: (e) => e.status === s.PendingResponse ? /* @__PURE__ */ n(
|
|
65
|
+
d,
|
|
66
|
+
{
|
|
67
|
+
variant: "secondary",
|
|
68
|
+
onClick: () => {
|
|
69
|
+
c(L.INFORMATION_REQUEST_RESPOND, {
|
|
70
|
+
requestId: e.uuid
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
children: t("cta.respond")
|
|
74
|
+
}
|
|
75
|
+
) : null
|
|
76
|
+
});
|
|
77
|
+
return /* @__PURE__ */ l(a, { flexDirection: "column", gap: 20, children: [
|
|
78
|
+
/* @__PURE__ */ l(a, { flexDirection: "column", gap: 2, children: [
|
|
79
|
+
/* @__PURE__ */ n(p, { as: "h2", styledAs: "h3", children: t("title") }),
|
|
80
|
+
/* @__PURE__ */ n(u, { children: t("description") })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ n(C, { ...q, label: t("title") })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
J as InformationRequestList
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=InformationRequestList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationRequestList.js","sources":["../../../../../src/components/Payroll/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequests } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'Payroll.InformationRequestList'> {\n companyId: string\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({ companyId, dictionary, onEvent }: InformationRequestListProps) {\n useComponentDictionary('Payroll.InformationRequestList', dictionary)\n useI18n('Payroll.InformationRequestList')\n const { t } = useTranslation('Payroll.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data, isFetching } = useInformationRequestsGetInformationRequests({\n companyUuid: companyId,\n })\n\n const informationRequests = data?.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(\n request => request.blockingPayroll && request.status !== InformationRequestStatus.Approved,\n )\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n isFetching,\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n if (!statusMapping) {\n return null\n }\n return (\n <Flex gap={8} alignItems=\"center\">\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","isFetching","useInformationRequestsGetInformationRequests","visibleRequests","request","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","FlexItem","statusMapping","Flex","informationRequestEvents","jsxs","DataView"],"mappings":";;;;;;;;;;;;;;AAqBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EA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
import { BaseComponentInterface } from '../../Base';
|
|
2
|
+
export interface InformationRequestsProps {
|
|
3
|
+
companyId: string;
|
|
4
|
+
onEvent?: BaseComponentInterface['onEvent'];
|
|
5
|
+
}
|
|
6
|
+
export declare function InformationRequests({ companyId, onEvent }: InformationRequestsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as O, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as p } from "robot3";
|
|
3
|
+
import { useMachine as d } from "react-robot";
|
|
4
|
+
import { useState as v, useMemo as C } from "react";
|
|
5
|
+
import { informationRequestsMachine as N } from "./informationRequestsStateMachine.js";
|
|
6
|
+
import { useComponentContext as h } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
|
+
import { FlowContext as F } from "../../Flow/useFlow.js";
|
|
8
|
+
import { informationRequestEvents as i } from "../../../shared/constants.js";
|
|
9
|
+
import { InformationRequestList as I } from "./InformationRequestList/InformationRequestList.js";
|
|
10
|
+
function D({ companyId: t, onEvent: c = () => {
|
|
11
|
+
} }) {
|
|
12
|
+
const { Modal: l } = h(), [u, r] = v(!1), E = C(
|
|
13
|
+
() => p(
|
|
14
|
+
"list",
|
|
15
|
+
N,
|
|
16
|
+
() => ({
|
|
17
|
+
component: null,
|
|
18
|
+
companyId: t,
|
|
19
|
+
onEvent: n
|
|
20
|
+
})
|
|
21
|
+
),
|
|
22
|
+
[t]
|
|
23
|
+
), [m, M] = d(E);
|
|
24
|
+
function n(o, a) {
|
|
25
|
+
M({ type: o, payload: a }), o === i.INFORMATION_REQUEST_RESPOND && r(!0), (o === i.INFORMATION_REQUEST_FORM_CANCEL || o === i.INFORMATION_REQUEST_FORM_DONE) && r(!1), c(o, a);
|
|
26
|
+
}
|
|
27
|
+
const R = () => {
|
|
28
|
+
r(!1);
|
|
29
|
+
}, s = m.context.component, f = s?.Footer || void 0;
|
|
30
|
+
return /* @__PURE__ */ O(
|
|
31
|
+
F.Provider,
|
|
32
|
+
{
|
|
33
|
+
value: {
|
|
34
|
+
...m.context,
|
|
35
|
+
onEvent: n
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ e(I, { companyId: t, onEvent: n }),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
l,
|
|
41
|
+
{
|
|
42
|
+
isOpen: u,
|
|
43
|
+
onClose: R,
|
|
44
|
+
footer: f && /* @__PURE__ */ e(f, { onEvent: n }),
|
|
45
|
+
children: s && /* @__PURE__ */ e(s, {})
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
D as InformationRequests
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=InformationRequests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationRequests.js","sources":["../../../../src/components/Payroll/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\nexport interface InformationRequestsProps {\n companyId: string\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequests({ companyId, onEvent = () => {} }: InformationRequestsProps) {\n const { Modal } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\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 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 <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={Footer && <Footer onEvent={handleEvent} />}\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["InformationRequests","companyId","onEvent","Modal","useComponentContext","isModalOpen","setIsModalOpen","useState","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","jsx","InformationRequestList"],"mappings":";;;;;;;;;AAgBO,SAASA,EAAoB,EAAE,WAAAC,GAAW,SAAAC,IAAU,MAAM;AAAC,KAA+B;AAC/F,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA,GACZ,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAE9CC,IAAqCC;AAAA,IACzC,MACEC;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA4C;AAAA,QAC1C,WAAW;AAAA,QACX,WAAAV;AAAA,QACA,SAASW;AAAA,MAAA;AAAA,IACX;AAAA,IAEJ,CAACX,CAAS;AAAA,EAAA,GAEN,CAACY,GAASC,CAAI,IAAIC,EAAWP,CAAkC;AAErE,WAASI,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EAAA,CAAM,GAExBD,MAASE,EAAyB,+BACpCZ,EAAe,EAAI,IAInBU,MAASE,EAAyB,mCAClCF,MAASE,EAAyB,kCAElCZ,EAAe,EAAK,GAGtBJ,EAAQc,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAAmB,MAAM;AAC7B,IAAAb,EAAe,EAAK;AAAA,EACtB,GAEMc,IAAmBP,EAAQ,QAAQ,WACnCQ,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGV,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAY,EAACC,GAAA,EAAuB,WAAAxB,GAAsB,SAASW,EAAA,CAAa;AAAA,QACpE,gBAAAY;AAAA,UAACrB;AAAA,UAAA;AAAA,YACC,QAAQE;AAAA,YACR,SAASc;AAAA,YACT,QAAQE,KAAU,gBAAAG,EAACH,GAAA,EAAO,SAAST,GAAa;AAAA,YAE/C,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FlowContextInterface } from '../../Flow/useFlow';
|
|
2
|
+
import { CommonComponentInterface } from '../../Base';
|
|
3
|
+
import { EventType } from '../../../types/Helpers';
|
|
4
|
+
import { OnEventType } from '../../Base/useBase';
|
|
5
|
+
export interface InformationRequestsContextInterface extends FlowContextInterface {
|
|
6
|
+
companyId: string;
|
|
7
|
+
selectedRequestId?: string;
|
|
8
|
+
component: (React.ComponentType<CommonComponentInterface> & {
|
|
9
|
+
Footer?: React.ComponentType<{
|
|
10
|
+
onEvent: OnEventType<EventType, unknown>;
|
|
11
|
+
}>;
|
|
12
|
+
}) | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function InformationRequestFormContextual(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace InformationRequestFormContextual {
|
|
16
|
+
var Footer: ({ onEvent }: {
|
|
17
|
+
onEvent: OnEventType<EventType, unknown>;
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFlow as n } from "../../Flow/useFlow.js";
|
|
3
|
+
import { ensureRequired as u } from "../../../helpers/ensureRequired.js";
|
|
4
|
+
import { InformationRequestForm as o } from "./InformationRequestForm/InformationRequestForm.js";
|
|
5
|
+
function s() {
|
|
6
|
+
const { companyId: e, selectedRequestId: r, onEvent: t } = n();
|
|
7
|
+
return /* @__PURE__ */ m(
|
|
8
|
+
o,
|
|
9
|
+
{
|
|
10
|
+
companyId: e,
|
|
11
|
+
requestId: u(r),
|
|
12
|
+
onEvent: t
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
s.Footer = o.Footer;
|
|
17
|
+
export {
|
|
18
|
+
s as InformationRequestFormContextual
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=InformationRequestsComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InformationRequestsComponents.js","sources":["../../../../src/components/Payroll/InformationRequests/InformationRequestsComponents.tsx"],"sourcesContent":["import { InformationRequestForm } from './InformationRequestForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\nexport interface InformationRequestsContextInterface extends FlowContextInterface {\n companyId: string\n selectedRequestId?: string\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\nexport function InformationRequestFormContextual() {\n const { companyId, selectedRequestId, onEvent } = useFlow<InformationRequestsContextInterface>()\n\n return (\n <InformationRequestForm\n companyId={companyId}\n requestId={ensureRequired(selectedRequestId)}\n onEvent={onEvent}\n />\n )\n}\n\nInformationRequestFormContextual.Footer = InformationRequestForm.Footer\n"],"names":["InformationRequestFormContextual","companyId","selectedRequestId","onEvent","useFlow","jsx","InformationRequestForm","ensureRequired"],"mappings":";;;;AAoBO,SAASA,IAAmC;AACjD,QAAM,EAAE,WAAAC,GAAW,mBAAAC,GAAmB,SAAAC,EAAA,IAAYC,EAAA;AAElD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAL;AAAA,MACA,WAAWM,EAAeL,CAAiB;AAAA,MAC3C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAH,EAAiC,SAASM,EAAuB;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { informationRequestEvents } from '../../../shared/constants';
|
|
2
|
+
export type EventPayloads = {
|
|
3
|
+
[informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {
|
|
4
|
+
requestId: string;
|
|
5
|
+
};
|
|
6
|
+
[informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined;
|
|
7
|
+
[informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const informationRequestsMachine: {
|
|
10
|
+
list: import('robot3').MachineState<any>;
|
|
11
|
+
form: import('robot3').MachineState<any>;
|
|
12
|
+
final: import('robot3').MachineState<any>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { state as t, transition as o, reduce as n } from "robot3";
|
|
2
|
+
import { InformationRequestFormContextual as r } from "./InformationRequestsComponents.js";
|
|
3
|
+
import { informationRequestEvents as s } from "../../../shared/constants.js";
|
|
4
|
+
const d = {
|
|
5
|
+
list: t(
|
|
6
|
+
o(
|
|
7
|
+
s.INFORMATION_REQUEST_RESPOND,
|
|
8
|
+
"form",
|
|
9
|
+
n(
|
|
10
|
+
(e, i) => ({
|
|
11
|
+
...e,
|
|
12
|
+
component: r,
|
|
13
|
+
selectedRequestId: i.payload.requestId
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
),
|
|
18
|
+
form: t(
|
|
19
|
+
o(
|
|
20
|
+
s.INFORMATION_REQUEST_FORM_DONE,
|
|
21
|
+
"list",
|
|
22
|
+
n(
|
|
23
|
+
(e) => ({
|
|
24
|
+
...e,
|
|
25
|
+
component: null,
|
|
26
|
+
selectedRequestId: void 0
|
|
27
|
+
})
|
|
28
|
+
)
|
|
29
|
+
),
|
|
30
|
+
o(
|
|
31
|
+
s.INFORMATION_REQUEST_FORM_CANCEL,
|
|
32
|
+
"list",
|
|
33
|
+
n(
|
|
34
|
+
(e) => ({
|
|
35
|
+
...e,
|
|
36
|
+
component: null,
|
|
37
|
+
selectedRequestId: void 0
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
),
|
|
42
|
+
final: t()
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
d as informationRequestsMachine
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=informationRequestsStateMachine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"informationRequestsStateMachine.js","sources":["../../../../src/components/Payroll/InformationRequests/informationRequestsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { InformationRequestFormContextual } from './InformationRequestsComponents'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nexport type EventPayloads = {\n [informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {\n requestId: string\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n}\n\nexport const informationRequestsMachine = {\n list: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_RESPOND,\n 'form',\n reduce(\n (\n ctx: InformationRequestsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof informationRequestEvents.INFORMATION_REQUEST_RESPOND\n >,\n ): InformationRequestsContextInterface => ({\n ...ctx,\n component: InformationRequestFormContextual,\n selectedRequestId: ev.payload.requestId,\n }),\n ),\n ),\n ),\n form: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'list',\n reduce(\n (ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n }),\n ),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'list',\n reduce(\n (ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n }),\n ),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["informationRequestsMachine","state","transition","informationRequestEvents","reduce","ctx","ev","InformationRequestFormContextual"],"mappings":";;;AAcO,MAAMA,IAA6B;AAAA,EACxC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OAIyC;AAAA,UACzC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,mBAAmBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,MAAML;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CAACC,OAAmF;AAAA,UAClF,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,IAEFH;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CAACC,OAAmF;AAAA,UAClF,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,OAAOJ,EAAA;AACT;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as P } from "react-i18next";
|
|
3
3
|
import { getBlockerTranslationKeys as v } from "../payrollHelpers.js";
|
|
4
4
|
import { useComponentContext as A } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
-
import { Flex as
|
|
5
|
+
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
7
8
|
import "react";
|
|
8
9
|
import { useI18n as C } from "../../../../i18n/I18n.js";
|
|
9
|
-
function
|
|
10
|
+
function H({
|
|
10
11
|
blockers: o,
|
|
11
12
|
onMultipleViewClick: i,
|
|
12
13
|
multipleViewLabel: h,
|
|
@@ -30,7 +31,7 @@ function F({
|
|
|
30
31
|
};
|
|
31
32
|
}), t = p[0];
|
|
32
33
|
if (!y && t)
|
|
33
|
-
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ d
|
|
34
|
+
return /* @__PURE__ */ l(a, { status: "error", label: t.title, className: s, children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 8, children: [
|
|
34
35
|
/* @__PURE__ */ l(c, { children: t.description }),
|
|
35
36
|
t.helpText && t.helpText !== t.description && /* @__PURE__ */ l(c, { variant: "supporting", size: "sm", children: t.helpText })
|
|
36
37
|
] }) });
|
|
@@ -41,7 +42,7 @@ function F({
|
|
|
41
42
|
status: "error",
|
|
42
43
|
label: e("multipleIssuesTitle", { count: o.length }),
|
|
43
44
|
className: s,
|
|
44
|
-
children: /* @__PURE__ */ d
|
|
45
|
+
children: /* @__PURE__ */ m(d, { flexDirection: "column", gap: 16, children: [
|
|
45
46
|
/* @__PURE__ */ l(x, { items: g }),
|
|
46
47
|
i && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(f, { variant: "secondary", onClick: i, title: u, children: u }) })
|
|
47
48
|
] })
|
|
@@ -49,6 +50,6 @@ function F({
|
|
|
49
50
|
);
|
|
50
51
|
}
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
H as PayrollBlockerAlerts
|
|
53
54
|
};
|
|
54
55
|
//# sourceMappingURL=PayrollBlockerAlerts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollBlockerAlerts.js","sources":["../../../../../src/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type ApiPayrollBlocker, getBlockerTranslationKeys } from '../payrollHelpers'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\ninterface PayrollBlockerAlertsProps {\n blockers: ApiPayrollBlocker[]\n className?: string\n onMultipleViewClick?: () => void\n multipleViewLabel?: string\n}\n\n/**\n * PayrollBlockerAlerts - Alert-style component for inline blocker display\n * Shows single blocker as alert, or multiple blockers as summary with \"Review\" button\n * Returns null for empty blocker arrays\n */\nexport function PayrollBlockerAlerts({\n blockers,\n onMultipleViewClick,\n multipleViewLabel,\n className,\n}: PayrollBlockerAlertsProps) {\n useI18n('Payroll.PayrollBlocker')\n const { t } = useTranslation('Payroll.PayrollBlocker')\n const { Alert, Button, Text, UnorderedList } = useComponentContext()\n\n // Return null for empty blockers array\n if (blockers.length === 0) {\n return null\n }\n\n const hasMultipleBlockers = blockers.length > 1\n\n const enrichedBlockers = blockers.map(blocker => {\n const translationKeys = getBlockerTranslationKeys(blocker.key)\n\n const title = t(translationKeys.titleKey, {\n defaultValue: blocker.key.replace(/_/g, ' ').replace(/\\b\\w/g, l => l.toUpperCase()),\n })\n const description = t(translationKeys.descriptionKey, {\n defaultValue: blocker.message || t('defaultBlockerDescription'),\n })\n const helpText = t(translationKeys.helpTextKey, { defaultValue: t('defaultBlockerHelp') })\n\n return {\n ...blocker,\n title,\n description,\n helpText,\n }\n })\n\n const singleBlocker = enrichedBlockers[0]\n\n if (!hasMultipleBlockers && singleBlocker) {\n return (\n <Alert status=\"error\" label={singleBlocker.title} className={className}>\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{singleBlocker.description}</Text>\n {singleBlocker.helpText && singleBlocker.helpText !== singleBlocker.description && (\n <Text variant=\"supporting\" size=\"sm\">\n {singleBlocker.helpText}\n </Text>\n )}\n </Flex>\n </Alert>\n )\n }\n\n const listItems = enrichedBlockers.map(blocker => blocker.title)\n const defaultMultipleLabel = multipleViewLabel || t('viewAllBlockers')\n\n return (\n <Alert\n status=\"error\"\n label={t('multipleIssuesTitle', { count: blockers.length })}\n className={className}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={listItems} />\n {onMultipleViewClick && (\n <div>\n <Button variant=\"secondary\" onClick={onMultipleViewClick} title={defaultMultipleLabel}>\n {defaultMultipleLabel}\n </Button>\n </div>\n )}\n </Flex>\n </Alert>\n )\n}\n"],"names":["PayrollBlockerAlerts","blockers","onMultipleViewClick","multipleViewLabel","className","useI18n","t","useTranslation","Alert","Button","Text","UnorderedList","useComponentContext","hasMultipleBlockers","enrichedBlockers","blocker","translationKeys","getBlockerTranslationKeys","title","l","description","helpText","singleBlocker","jsx","jsxs","Flex","listItems","defaultMultipleLabel"],"mappings":";;;;;;;;;AAkBO,SAASA,EAAqB;AAAA,EACnC,UAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AACF,GAA8B;AAC5B,EAAAC,EAAQ,wBAAwB;AAChC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/C,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,EAAA,IAAkBC,EAAA;AAG/C,MAAIX,EAAS,WAAW;AACtB,WAAO;AAGT,QAAMY,IAAsBZ,EAAS,SAAS,GAExCa,IAAmBb,EAAS,IAAI,CAAAc,MAAW;AAC/C,UAAMC,IAAkBC,EAA0BF,EAAQ,GAAG,GAEvDG,IAAQZ,EAAEU,EAAgB,UAAU;AAAA,MACxC,cAAcD,EAAQ,IAAI,QAAQ,MAAM,GAAG,EAAE,QAAQ,SAAS,CAAAI,MAAKA,EAAE,YAAA,CAAa;AAAA,IAAA,CACnF,GACKC,IAAcd,EAAEU,EAAgB,gBAAgB;AAAA,MACpD,cAAcD,EAAQ,WAAWT,EAAE,2BAA2B;AAAA,IAAA,CAC/D,GACKe,IAAWf,EAAEU,EAAgB,aAAa,EAAE,cAAcV,EAAE,oBAAoB,GAAG;AAEzF,WAAO;AAAA,MACL,GAAGS;AAAA,MACH,OAAAG;AAAA,MACA,aAAA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