@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
|
@@ -11,11 +11,11 @@ import { Form as Z } from "../../Common/Form/Form.js";
|
|
|
11
11
|
import { BaseComponent as $ } from "../../Base/Base.js";
|
|
12
12
|
import { useBase as V } from "../../Base/useBase.js";
|
|
13
13
|
import { Flex as ee } from "../../Common/Flex/Flex.js";
|
|
14
|
-
import "react-i18next";
|
|
15
14
|
import "classnames";
|
|
15
|
+
import { componentEvents as S } from "../../../shared/constants.js";
|
|
16
|
+
import "react-i18next";
|
|
16
17
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
18
|
import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
|
|
18
|
-
import { componentEvents as S } from "../../../shared/constants.js";
|
|
19
19
|
import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
|
|
20
20
|
import { Head as te } from "./_parts/Head.js";
|
|
21
21
|
import { List as ae } from "./_parts/List.js";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as c, Trans as
|
|
2
|
+
import { useTranslation as c, Trans as r } from "react-i18next";
|
|
3
3
|
import { usePaySchedule as d } from "../usePaySchedule.js";
|
|
4
4
|
import { Flex as h } from "../../../Common/Flex/Flex.js";
|
|
5
5
|
import "classnames";
|
|
6
|
-
import
|
|
6
|
+
import "../../../../shared/constants.js";
|
|
7
|
+
import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
7
8
|
import "react";
|
|
8
|
-
const
|
|
9
|
-
const { t: i } = c("Company.PaySchedule"), n =
|
|
9
|
+
const x = () => {
|
|
10
|
+
const { t: i } = c("Company.PaySchedule"), n = m(), { mode: a } = d();
|
|
10
11
|
let t = /* @__PURE__ */ e(o, {});
|
|
11
|
-
switch (
|
|
12
|
+
switch (a) {
|
|
12
13
|
case "LIST_PAY_SCHEDULES":
|
|
13
14
|
t = /* @__PURE__ */ s(o, { children: [
|
|
14
15
|
/* @__PURE__ */ e(n.Heading, { as: "h2", children: i("headings.pageTitle") }),
|
|
15
16
|
/* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
|
|
16
|
-
|
|
17
|
+
r,
|
|
17
18
|
{
|
|
18
19
|
i18nKey: "listDescription",
|
|
19
20
|
t: i,
|
|
@@ -23,7 +24,7 @@ const L = () => {
|
|
|
23
24
|
}
|
|
24
25
|
) }),
|
|
25
26
|
/* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
|
|
26
|
-
|
|
27
|
+
r,
|
|
27
28
|
{
|
|
28
29
|
i18nKey: "listDescription2",
|
|
29
30
|
t: i,
|
|
@@ -44,6 +45,6 @@ const L = () => {
|
|
|
44
45
|
return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: t }) });
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
x as Head
|
|
48
49
|
};
|
|
49
50
|
//# sourceMappingURL=Head.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n ScheduleLink: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n PaymentLawLink: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","t","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n ScheduleLink: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n PaymentLawLink: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","t","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEb,EAAE,MAAAC,EAAA,IAASC,EAAA;AACjB,MAAIC,IAAoC,gBAAAC,EAAAC,GAAA,EAAE;AAE1C,UAAQJ,GAAA;AAAA,IACN,KAAK;AACH,MAAAE,IACE,gBAAAG,EAAAD,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAO,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,GAAAV;AAAA,YACA,YAAY;AAAA,cACV,cAAc,gBAAAO,EAACL,EAAW,MAAX,CAAA,CAAgB;AAAA,YAAA;AAAA,UACjC;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT,GAAAV;AAAA,YACA,YAAY;AAAA,cACV,gBAAgB,gBAAAO,EAACL,EAAW,MAAX,CAAA,CAAgB;AAAA,YAAA;AAAA,UACnC;AAAA,QAAA,EACF,CACF;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AACH,MAAAI,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AACH,MAAAM,IACE,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAGF,SACE,gBAAAO,EAACI,GAAA,EAAK,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAA,EAAQ,UAAAD,EAAA,CAAc,GACzB;AAEJ;"}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as h } from "react-i18next";
|
|
3
3
|
import { usePaySchedule as y } from "../usePaySchedule.js";
|
|
4
4
|
import o from "./List.module.scss.js";
|
|
5
5
|
import { Flex as s } from "../../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
+
import "../../../../shared/constants.js";
|
|
7
8
|
import { HamburgerMenu as f } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
8
9
|
import S from "../../../../assets/icons/pencil.svg.js";
|
|
9
10
|
import { useComponentContext as v } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
11
|
import { VisuallyHidden as g } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
11
12
|
import { useDataView as L } from "../../../Common/DataView/useDataView.js";
|
|
12
13
|
import { DataView as C } from "../../../Common/DataView/DataView.js";
|
|
13
|
-
const
|
|
14
|
-
const { t:
|
|
14
|
+
const F = () => {
|
|
15
|
+
const { t: r } = h("Company.PaySchedule"), n = v(), { paySchedules: m, mode: c, handleEdit: l } = y(), { ...d } = L({
|
|
15
16
|
data: m || [],
|
|
16
17
|
columns: [
|
|
17
18
|
{
|
|
18
|
-
title:
|
|
19
|
+
title: r("payScheduleList.name"),
|
|
19
20
|
key: "customName",
|
|
20
21
|
render: (t) => {
|
|
21
22
|
const a = !!t.name;
|
|
22
23
|
let i = a ? t.name : t.customName;
|
|
23
24
|
i && i.length > 1 ? i = i.charAt(0).toUpperCase() + i.slice(1) : i = t.customName;
|
|
24
|
-
const
|
|
25
|
-
return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */
|
|
25
|
+
const p = t.customName;
|
|
26
|
+
return /* @__PURE__ */ e(s, { flexDirection: "column", gap: 0, children: /* @__PURE__ */ u("div", { className: o.content, children: [
|
|
26
27
|
/* @__PURE__ */ e("div", { children: i }),
|
|
27
|
-
a && /* @__PURE__ */ e("div", { children:
|
|
28
|
+
a && /* @__PURE__ */ e("div", { children: p })
|
|
28
29
|
] }) });
|
|
29
30
|
}
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
|
-
title: /* @__PURE__ */ e(g, { children:
|
|
33
|
+
title: /* @__PURE__ */ e(g, { children: r("payScheduleList.active") }),
|
|
33
34
|
key: "active",
|
|
34
|
-
render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(
|
|
35
|
+
render: (t) => /* @__PURE__ */ e(s, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ e("div", { className: o.content, children: t.active ? /* @__PURE__ */ e(n.Badge, { status: "success", children: r("payScheduleList.active") }) : /* @__PURE__ */ e(n.Badge, { status: "info", children: r("payScheduleList.inactive") }) }) })
|
|
35
36
|
}
|
|
36
37
|
],
|
|
37
38
|
itemMenu: (t) => /* @__PURE__ */ e(
|
|
@@ -40,7 +41,7 @@ const B = () => {
|
|
|
40
41
|
triggerLabel: "Actions",
|
|
41
42
|
items: [
|
|
42
43
|
{
|
|
43
|
-
label:
|
|
44
|
+
label: r("payScheduleList.edit"),
|
|
44
45
|
onClick: () => {
|
|
45
46
|
l(t);
|
|
46
47
|
},
|
|
@@ -53,6 +54,6 @@ const B = () => {
|
|
|
53
54
|
return c !== "LIST_PAY_SCHEDULES" ? null : /* @__PURE__ */ e(C, { label: "test", ...d });
|
|
54
55
|
};
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
F as List
|
|
57
58
|
};
|
|
58
59
|
//# sourceMappingURL=List.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport styles from './List.module.scss'\nimport { useDataView, DataView, Flex, VisuallyHidden } from '@/components/Common'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n const { paySchedules, mode, handleEdit } = usePaySchedule()\n\n const { ...dataViewProps } = useDataView({\n data: paySchedules || [],\n columns: [\n {\n title: t('payScheduleList.name'),\n key: 'customName',\n render: schedule => {\n const hasName = !!schedule.name\n let displayName = hasName ? schedule.name : schedule.customName\n if (displayName && displayName.length > 1) {\n displayName = displayName.charAt(0).toUpperCase() + displayName.slice(1)\n } else {\n displayName = schedule.customName\n }\n const displayFrequency = schedule.customName\n return (\n <Flex flexDirection={'column'} gap={0}>\n <div className={styles.content}>\n <div>{displayName}</div>\n {hasName && <div>{displayFrequency}</div>}\n </div>\n </Flex>\n )\n },\n },\n {\n title: <VisuallyHidden>{t('payScheduleList.active')}</VisuallyHidden>,\n key: 'active',\n render: schedule => (\n <Flex alignItems={'center'} justifyContent={'center'}>\n <div className={styles.content}>\n {schedule.active ? (\n <Components.Badge status=\"success\">{t('payScheduleList.active')}</Components.Badge>\n ) : (\n <Components.Badge status=\"info\">{t('payScheduleList.inactive')}</Components.Badge>\n )}\n </div>\n </Flex>\n ),\n },\n ],\n itemMenu: schedule => {\n return (\n <HamburgerMenu\n triggerLabel=\"Actions\"\n items={[\n {\n label: t('payScheduleList.edit'),\n onClick: () => {\n handleEdit(schedule)\n },\n icon: <PencilSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST_PAY_SCHEDULES') {\n return null\n }\n\n return <DataView label=\"test\" {...dataViewProps} />\n}\n"],"names":["List","t","useTranslation","Components","useComponentContext","paySchedules","mode","handleEdit","usePaySchedule","dataViewProps","useDataView","schedule","hasName","displayName","displayFrequency","jsx","Flex","jsxs","styles","VisuallyHidden","HamburgerMenu","PencilSvg","DataView"],"mappings":";;;;;;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EA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GAEnE,EAAA,CACF;AAAA,MAAA;AAAA,IAEJ;AAAA,IAEF,UAAU,CAAAU,MAEN,gBAAAI;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,OAAO;AAAA,UACL;AAAA,YACE,OAAOnB,EAAE,sBAAsB;AAAA,YAC/B,SAAS,MAAM;AACb,cAAAM,EAAWI,CAAQ;AAAA,YACrB;AAAA,YACA,MAAM,gBAAAI,EAACM,GAAA,EAAU,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QAC/B;AAAA,MACF;AAAA,IAAA;AAAA,EAGN,CACD;AAED,SAAIf,MAAS,uBACJ,OAGF,gBAAAS,EAACO,GAAA,EAAS,OAAM,QAAQ,GAAGb,GAAe;AACnD;"}
|
|
@@ -10,9 +10,10 @@ import "../../Base/useBase.js";
|
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
14
|
import "dompurify";
|
|
14
15
|
import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const
|
|
16
|
+
const x = o.object({
|
|
16
17
|
frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
|
|
17
18
|
anchorPayDate: o.date().optional(),
|
|
18
19
|
anchorEndOfPayPeriod: o.date().optional(),
|
|
@@ -20,10 +21,10 @@ const s = o.object({
|
|
|
20
21
|
day2: o.number().min(1).max(31).optional(),
|
|
21
22
|
customName: o.string().optional(),
|
|
22
23
|
customTwicePerMonth: o.string().optional()
|
|
23
|
-
}), [
|
|
24
|
+
}), [S, f] = t("PayScheduleContext");
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
f as PayScheduleProvider,
|
|
27
|
+
x as PayScheduleSchema,
|
|
28
|
+
S as usePaySchedule
|
|
28
29
|
};
|
|
29
30
|
//# sourceMappingURL=usePaySchedule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
|
|
@@ -9,11 +9,12 @@ import "../../../Base/useBase.js";
|
|
|
9
9
|
import "../../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesFormContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
d as StateTaxesFormProvider,
|
|
18
|
+
c as useStateTaxesForm
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
|
|
@@ -9,11 +9,12 @@ import "../../../Base/useBase.js";
|
|
|
9
9
|
import "../../../../shared/constants.js";
|
|
10
10
|
import "classnames";
|
|
11
11
|
import "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
12
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
12
13
|
import "dompurify";
|
|
13
14
|
import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
|
|
14
|
-
const [
|
|
15
|
+
const [c, d] = t("StateTaxesListContext");
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
d as StateTaxesListProvider,
|
|
18
|
+
c as useStateTaxesList
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
|
|
@@ -11,13 +11,13 @@ import { Actions as B } from "./Actions.js";
|
|
|
11
11
|
import { Form as N } from "../../Common/Form/Form.js";
|
|
12
12
|
import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
|
|
13
13
|
import { Flex as w } from "../../Common/Flex/Flex.js";
|
|
14
|
-
import "react-i18next";
|
|
15
14
|
import "classnames";
|
|
15
|
+
import { contractorEvents as d } from "../../../shared/constants.js";
|
|
16
|
+
import "react-i18next";
|
|
16
17
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
17
18
|
import "react";
|
|
18
19
|
import { BaseComponent as G } from "../../Base/Base.js";
|
|
19
20
|
import { useBase as H } from "../../Base/useBase.js";
|
|
20
|
-
import { contractorEvents as d } from "../../../shared/constants.js";
|
|
21
21
|
function mt(r) {
|
|
22
22
|
return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
|
|
23
23
|
}
|
|
@@ -10,20 +10,21 @@ import "../../Base/useBase.js";
|
|
|
10
10
|
import "../../../shared/constants.js";
|
|
11
11
|
import "classnames";
|
|
12
12
|
import "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
+
import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
13
14
|
import "dompurify";
|
|
14
15
|
import { createCompoundContext as r } from "../../Base/createCompoundContext.js";
|
|
15
|
-
const
|
|
16
|
+
const u = t.object({
|
|
16
17
|
street1: t.string().min(1),
|
|
17
18
|
street2: t.string().optional(),
|
|
18
19
|
city: t.string().min(1),
|
|
19
20
|
state: t.string().min(1),
|
|
20
21
|
zip: t.string().min(1)
|
|
21
|
-
}), [
|
|
22
|
+
}), [z, b] = r(
|
|
22
23
|
"ContractorAddressContext"
|
|
23
24
|
);
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
u as AddressFormSchema,
|
|
27
|
+
b as AddressProvider,
|
|
28
|
+
z as useAddress
|
|
28
29
|
};
|
|
29
30
|
//# sourceMappingURL=useAddress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAiBO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAA,EAAS,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
|
|
@@ -2,41 +2,41 @@ import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as d } from "react-i18next";
|
|
3
3
|
import { useContractorsDeleteMutation as w } from "@gusto/embedded-api/react-query/contractorsDelete";
|
|
4
4
|
import { useContractors as H } from "./useContractorList.js";
|
|
5
|
-
import { Flex as
|
|
5
|
+
import { Flex as f } from "../../Common/Flex/Flex.js";
|
|
6
6
|
import "classnames";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import M from "../../../
|
|
7
|
+
import { CONTRACTOR_TYPE as k, componentEvents as m } from "../../../shared/constants.js";
|
|
8
|
+
import { EmptyData as U } from "../../Common/EmptyData/EmptyData.js";
|
|
9
|
+
import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
10
|
+
import { HamburgerMenu as j } from "../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
11
|
+
import { firstLastName as M } from "../../../helpers/formattedStrings.js";
|
|
12
|
+
import V from "../../../assets/icons/pencil.svg.js";
|
|
12
13
|
import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
13
|
-
import { ContractorOnboardingStatusBadge as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { BaseComponent as
|
|
16
|
-
import { useBase as
|
|
17
|
-
import { CONTRACTOR_TYPE as Y, componentEvents as m } from "../../../shared/constants.js";
|
|
14
|
+
import { ContractorOnboardingStatusBadge as F } from "../../Common/OnboardingStatusBadge/index.js";
|
|
15
|
+
import { useI18n as q } from "../../../i18n/I18n.js";
|
|
16
|
+
import { BaseComponent as G } from "../../Base/Base.js";
|
|
17
|
+
import { useBase as Y } from "../../Base/useBase.js";
|
|
18
18
|
import z from "../../../assets/icons/trashcan.svg.js";
|
|
19
19
|
import { useDataView as J } from "../../Common/DataView/useDataView.js";
|
|
20
20
|
import { DataView as K } from "../../Common/DataView/DataView.js";
|
|
21
21
|
function Q({ count: o, handleAdd: a }) {
|
|
22
22
|
const { Button: r, Heading: i } = u(), { t: n } = d("Contractor.ContractorList");
|
|
23
|
-
return /* @__PURE__ */ l(
|
|
23
|
+
return /* @__PURE__ */ l(f, { alignItems: "center", justifyContent: "space-between", children: [
|
|
24
24
|
/* @__PURE__ */ t(i, { as: "h2", children: n("title") }),
|
|
25
25
|
o !== 0 && /* @__PURE__ */ t(r, { variant: "secondary", onClick: a, children: n("addAnotherCta") })
|
|
26
26
|
] });
|
|
27
27
|
}
|
|
28
28
|
function W({ handleAdd: o }) {
|
|
29
29
|
const { Button: a } = u(), { t: r } = d("Contractor.ContractorList");
|
|
30
|
-
return /* @__PURE__ */ t(
|
|
30
|
+
return /* @__PURE__ */ t(U, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(h, { justifyContent: "center", children: /* @__PURE__ */ t(a, { onClick: o, children: r("addContractorCta") }) }) });
|
|
31
31
|
}
|
|
32
32
|
function Tt(o) {
|
|
33
|
-
return /* @__PURE__ */ t(
|
|
33
|
+
return /* @__PURE__ */ t(G, { ...o, children: /* @__PURE__ */ t(X, { ...o, children: o.children }) });
|
|
34
34
|
}
|
|
35
35
|
function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
36
|
-
|
|
37
|
-
const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler:
|
|
38
|
-
contractors:
|
|
39
|
-
totalCount:
|
|
36
|
+
q("Contractor.ContractorList");
|
|
37
|
+
const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: g } = Y(), { Alert: T, Button: P } = u(), {
|
|
38
|
+
contractors: L,
|
|
39
|
+
totalCount: C,
|
|
40
40
|
handleNextPage: N,
|
|
41
41
|
handleFirstPage: b,
|
|
42
42
|
handleLastPage: y,
|
|
@@ -49,12 +49,12 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
49
49
|
columns: [
|
|
50
50
|
{
|
|
51
51
|
title: n("listHeaders.name"),
|
|
52
|
-
render: (e) => e.type ===
|
|
52
|
+
render: (e) => e.type === k.BUSINESS ? e.businessName : M({ first_name: e.firstName, last_name: e.lastName })
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
title: n("listHeaders.status"),
|
|
56
56
|
render: ({ onboarded: e, onboardingStatus: c }) => /* @__PURE__ */ t(
|
|
57
|
-
|
|
57
|
+
F,
|
|
58
58
|
{
|
|
59
59
|
onboarded: e,
|
|
60
60
|
onboardingStatus: c
|
|
@@ -62,14 +62,14 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
],
|
|
65
|
-
data:
|
|
65
|
+
data: L,
|
|
66
66
|
itemMenu: (e) => /* @__PURE__ */ t(
|
|
67
|
-
|
|
67
|
+
j,
|
|
68
68
|
{
|
|
69
69
|
items: [
|
|
70
70
|
{
|
|
71
71
|
label: n("editCta"),
|
|
72
|
-
icon: /* @__PURE__ */ t(
|
|
72
|
+
icon: /* @__PURE__ */ t(V, { "aria-hidden": !0 }),
|
|
73
73
|
onClick: () => {
|
|
74
74
|
_(e.uuid);
|
|
75
75
|
}
|
|
@@ -86,7 +86,7 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
86
86
|
isLoading: I
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
emptyState: () => /* @__PURE__ */ t(W, { handleAdd:
|
|
89
|
+
emptyState: () => /* @__PURE__ */ t(W, { handleAdd: p }),
|
|
90
90
|
pagination: {
|
|
91
91
|
handleNextPage: N,
|
|
92
92
|
handleFirstPage: b,
|
|
@@ -95,27 +95,28 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
|
|
|
95
95
|
handleItemsPerPageChange: O,
|
|
96
96
|
currentPage: A,
|
|
97
97
|
totalPages: D,
|
|
98
|
+
totalCount: C,
|
|
98
99
|
itemsPerPage: R
|
|
99
100
|
}
|
|
100
|
-
}),
|
|
101
|
+
}), p = () => {
|
|
101
102
|
s(m.CONTRACTOR_CREATE);
|
|
102
103
|
}, _ = (e) => {
|
|
103
104
|
s(m.CONTRACTOR_UPDATE, { contractorId: e });
|
|
104
105
|
}, v = () => {
|
|
105
106
|
s(m.CONTRACTOR_ONBOARDING_CONTINUE);
|
|
106
107
|
}, x = async (e) => {
|
|
107
|
-
await
|
|
108
|
+
await g(e, async (c) => {
|
|
108
109
|
await B({
|
|
109
110
|
request: { contractorUuid: c }
|
|
110
111
|
}), s(m.CONTRACTOR_DELETED, { contractorId: c });
|
|
111
112
|
});
|
|
112
113
|
};
|
|
113
114
|
return /* @__PURE__ */ l("section", { className: a, children: [
|
|
114
|
-
i && /* @__PURE__ */ t(
|
|
115
|
-
/* @__PURE__ */ l(
|
|
116
|
-
/* @__PURE__ */ t(Q, { count:
|
|
115
|
+
i && /* @__PURE__ */ t(T, { label: i, status: "success" }),
|
|
116
|
+
/* @__PURE__ */ l(f, { flexDirection: "column", children: [
|
|
117
|
+
/* @__PURE__ */ t(Q, { count: C, handleAdd: p }),
|
|
117
118
|
/* @__PURE__ */ t(K, { label: n("contractorListLabel"), ...S }),
|
|
118
|
-
/* @__PURE__ */ t(
|
|
119
|
+
/* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(P, { onClick: v, isLoading: !1, children: n("continueCta") }) })
|
|
119
120
|
] })
|
|
120
121
|
] });
|
|
121
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\nexport interface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nexport function EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\nexport interface ContractorListProps extends CommonComponentInterface<'Contractor.ContractorList'> {\n companyId: string\n successMessage?: string\n}\n\nexport function ContractorList(props: ContractorListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n },\n {\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n },\n ]}\n triggerLabel={t('editCta')}\n isLoading={isPendingDelete}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","handleEdit","TrashCanSvg","handleDelete","componentEvents","uuid","handleContinue","payload","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBO,SAASA,EAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AACpD,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAA,GACtB,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAC,EAACC,GAAA,E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ACA,iBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,0BAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,IAAA;AAAA,EACF,CACD,GAEKlC,IAAY,MAAM;AACtB,IAAAqB,EAAQ+B,EAAgB,iBAAiB;AAAA,EAC3C,GAEMH,IAAa,CAACI,MAAiB;AACnC,IAAAhC,EAAQ+B,EAAgB,mBAAmB,EAAE,cAAcC,GAAM;AAAA,EACnE,GAEMC,IAAiB,MAAM;AAC3B,IAAAjC,EAAQ+B,EAAgB,8BAA8B;AAAA,EACxD,GAEMD,IAAe,OAAOE,MAAiB;AAC3C,UAAM/B,EAAkB+B,GAAM,OAAME,MAAW;AAC7C,YAAMnB,EAAyB;AAAA,QAC7B,SAAS,EAAE,gBAAgBmB,EAAA;AAAA,MAAQ,CACpC,GAEDlC,EAAQ+B,EAAgB,oBAAoB,EAAE,cAAcG,GAAS;AAAA,IACvE,CAAC;AAAA,EACH;AAEA,SACE,gBAAAjD,EAAC,aAAQ,WAAAW,GACN,UAAA;AAAA,IAAAE,KAAkB,gBAAAX,EAACgB,GAAA,EAAM,OAAOL,GAAgB,QAAO,WAAU;AAAA,IAClE,gBAAAb,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,MAAA,gBAAAC,EAACV,GAAA,EAAK,OAAO4B,GAAY,WAAA1B,EAAA,CAAsB;AAAA,wBAC9CwD,GAAA,EAAS,OAAOpD,EAAE,qBAAqB,GAAI,GAAGmC,GAAe;AAAA,MAC9D,gBAAA/B,EAACG,GAAA,EACC,UAAA,gBAAAH,EAACP,GAAA,EAAO,SAASqD,GAAgB,WAAW,IACzC,UAAAlD,EAAE,aAAa,EAAA,CAClB,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Contractor/ContractorList/index.tsx"],"sourcesContent":["import { type Contractor } from '@gusto/embedded-api/models/components/contractor'\nimport { useTranslation } from 'react-i18next'\nimport { useContractorsDeleteMutation } from '@gusto/embedded-api/react-query/contractorsDelete'\nimport { useContractors } from './useContractorList'\nimport { ActionsLayout, DataView, EmptyData, Flex, useDataView } from '@/components/Common'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu/HamburgerMenu'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ContractorOnboardingStatusBadge } from '@/components/Common/OnboardingStatusBadge'\nimport { useI18n } from '@/i18n'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { componentEvents, CONTRACTOR_TYPE } from '@/shared/constants'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\n\nexport interface HeadProps {\n count: number\n handleAdd: () => void\n}\nexport function Head({ count, handleAdd }: HeadProps) {\n const { Button, Heading } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <Flex alignItems=\"center\" justifyContent=\"space-between\">\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {count !== 0 && (\n <Button variant=\"secondary\" onClick={handleAdd}>\n {t('addAnotherCta')}\n </Button>\n )}\n </Flex>\n )\n}\n\nexport interface EmptyDataContractorsListProps {\n handleAdd: () => void\n}\nexport function EmptyDataContractorsList({ handleAdd }: EmptyDataContractorsListProps) {\n const { Button } = useComponentContext()\n const { t } = useTranslation('Contractor.ContractorList')\n\n return (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <ActionsLayout justifyContent=\"center\">\n <Button onClick={handleAdd}>{t('addContractorCta')}</Button>\n </ActionsLayout>\n </EmptyData>\n )\n}\n\nexport interface ContractorListProps extends CommonComponentInterface<'Contractor.ContractorList'> {\n companyId: string\n successMessage?: string\n}\n\nexport function ContractorList(props: ContractorListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, dictionary, successMessage }: ContractorListProps) {\n useI18n('Contractor.ContractorList')\n const { t } = useTranslation('Contractor.ContractorList')\n const { onEvent, baseSubmitHandler } = useBase()\n const { Alert, Button } = useComponentContext()\n const {\n contractors,\n totalCount,\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n itemsPerPage,\n } = useContractors({ companyUuid: companyId })\n const { mutateAsync: deleteContractorMutation, isPending: isPendingDelete } =\n useContractorsDeleteMutation()\n\n const dataViewProps = useDataView<Contractor>({\n columns: [\n {\n title: t('listHeaders.name'),\n render: contractor =>\n contractor.type === CONTRACTOR_TYPE.BUSINESS\n ? contractor.businessName\n : firstLastName({ first_name: contractor.firstName, last_name: contractor.lastName }),\n },\n {\n title: t('listHeaders.status'),\n render: ({ onboarded, onboardingStatus }) => (\n <ContractorOnboardingStatusBadge\n onboarded={onboarded}\n onboardingStatus={onboardingStatus}\n />\n ),\n },\n ],\n data: contractors,\n itemMenu: contractor => (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(contractor.uuid)\n },\n },\n {\n label: t('deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n void handleDelete(contractor.uuid)\n },\n },\n ]}\n triggerLabel={t('editCta')}\n isLoading={isPendingDelete}\n />\n ),\n emptyState: () => <EmptyDataContractorsList handleAdd={handleAdd} />,\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n totalCount,\n itemsPerPage,\n },\n })\n\n const handleAdd = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleEdit = (uuid: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId: uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.CONTRACTOR_ONBOARDING_CONTINUE)\n }\n\n const handleDelete = async (uuid: string) => {\n await baseSubmitHandler(uuid, async payload => {\n await deleteContractorMutation({\n request: { contractorUuid: payload },\n })\n\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId: payload })\n })\n }\n\n return (\n <section className={className}>\n {successMessage && <Alert label={successMessage} status=\"success\" />}\n <Flex flexDirection=\"column\">\n <Head count={totalCount} handleAdd={handleAdd} />\n <DataView label={t('contractorListLabel')} {...dataViewProps} />\n <ActionsLayout>\n <Button onClick={handleContinue} isLoading={false}>\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </section>\n )\n}\n"],"names":["Head","count","handleAdd","Button","Heading","useComponentContext","t","useTranslation","jsxs","Flex","jsx","EmptyDataContractorsList","EmptyData","ActionsLayout","ContractorList","props","BaseComponent","Root","companyId","className","dictionary","successMessage","useI18n","onEvent","baseSubmitHandler","useBase","Alert","contractors","totalCount","handleNextPage","handleFirstPage","handleLastPage","handlePreviousPage","handleItemsPerPageChange","currentPage","totalPages","itemsPerPage","useContractors","deleteContractorMutation","isPendingDelete","useContractorsDeleteMutation","dataViewProps","useDataView","contractor","CONTRACTOR_TYPE","firstLastName","onboarded","onboardingStatus","ContractorOnboardingStatusBadge","HamburgerMenu","PencilSvg","handleEdit","TrashCanSvg","handleDelete","componentEvents","uuid","handleContinue","payload","DataView"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBO,SAASA,EAAK,EAAE,OAAAC,GAAO,WAAAC,KAAwB;AACpD,QAAM,EAAE,QAAAC,GAAQ,SAAAC,EAAA,IAAYC,EAAA,GACtB,EAAE,GAAAC,EAAA,IAAMC,EAAe,2BAA2B;AAExD,SACE,gBAAAC,EAACC,GAAA,EAAK,YAAW,UAAS,gBAAe,iBACvC,UAAA;AAAA,IAAA,gBAAAC,EAACN,GAAA,EAAQ,IAAG,MAAM,UAAAE,EAAE,OAA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