@gusto/embedded-react-sdk 0.26.0 → 0.28.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 +103 -0
- package/dist/assets/icons/plus-circle.svg.js +5 -5
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Base/Base.js +13 -12
- package/dist/components/Base/Base.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +4 -2
- package/dist/components/Common/DataView/DataCards/DataCards.js +52 -32
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +3 -2
- package/dist/components/Common/DataView/DataTable/DataTable.js +68 -53
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -2
- package/dist/components/Common/DataView/DataView.js +28 -18
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +6 -1
- package/dist/components/Common/DataView/useDataView.js +34 -19
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.js +23 -23
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js +6 -10
- package/dist/components/Common/DocumentList/DocumentList.module.scss.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +12 -12
- package/dist/components/Common/InlineSpinner/InlineSpinner.module.scss.js +1 -1
- package/dist/components/Common/InternalError/InternalError.module.scss.js +4 -4
- package/dist/components/Common/ReorderableList/ReorderableList.module.scss.js +8 -8
- package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
- package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
- package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +9 -9
- package/dist/components/Common/UI/Banner/Banner.module.scss.js +1 -1
- package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Common/UI/Button/Button.module.scss.js +1 -1
- package/dist/components/Common/UI/CalendarPreview/CalendarPreview.module.scss.js +4 -4
- package/dist/components/Common/UI/Card/Card.d.ts +1 -1
- package/dist/components/Common/UI/Card/Card.js +10 -20
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +1 -1
- package/dist/components/Common/UI/Card/CardTypes.d.ts +4 -4
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +3 -3
- package/dist/components/Common/UI/DatePicker/DatePicker.module.scss.js +4 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +1 -1
- package/dist/components/Common/UI/Dialog/Dialog.module.scss.js +2 -2
- package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
- package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +26 -26
- package/dist/components/Common/UI/Input/Input.module.scss.js +8 -8
- package/dist/components/Common/UI/Modal/Modal.module.scss.js +12 -12
- package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
- package/dist/components/Common/UI/Radio/Radio.module.scss.js +6 -6
- package/dist/components/Common/UI/Select/Select.module.scss.js +4 -4
- package/dist/components/Common/UI/Table/Table.js +1 -1
- package/dist/components/Common/UI/Table/Table.js.map +1 -1
- package/dist/components/Common/UI/Table/Table.module.scss.js +1 -1
- package/dist/components/Common/UI/Tabs/Tabs.module.scss.js +1 -1
- package/dist/components/Common/UI/Text/Text.module.scss.js +17 -15
- package/dist/components/Common/UI/Text/Text.module.scss.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -3
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -3
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +8 -7
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +3 -2
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +7 -6
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +8 -7
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PaySchedule.js +4 -3
- package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
- package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
- package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
- package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
- package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
- package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
- package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -4
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +32 -31
- package/dist/components/Contractor/ContractorList/index.js.map +1 -1
- package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
- package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
- package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +9 -7
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -8
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +11 -9
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +14 -14
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Contractor/Profile/ContractorProfileForm.module.scss.js +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Contractor/Submit/Submit.js +21 -20
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +13 -12
- package/dist/components/Employee/Compensation/Actions.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +17 -16
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +23 -22
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +3 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +145 -137
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +106 -101
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -87
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +2 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +110 -104
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +51 -45
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +31 -30
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +4 -8
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +3 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Actions.js +7 -6
- package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/Head.js +7 -5
- package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
- package/dist/components/Employee/EmployeeList/List.js +3 -2
- package/dist/components/Employee/EmployeeList/List.js.map +1 -1
- package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
- package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.js +11 -10
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Split.js +11 -10
- package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
- package/dist/components/Employee/Profile/Actions.js +6 -5
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +6 -5
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.module.scss.js +1 -1
- package/dist/components/Employee/Profile/HomeAddress.js +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +6 -5
- package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
- package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
- package/dist/components/Employee/Taxes/Actions.js +7 -6
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +14 -13
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -3
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Flow/Flow.js +9 -7
- package/dist/components/Flow/Flow.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +4 -4
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +41 -39
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequests.d.ts +7 -2
- package/dist/components/InformationRequests/InformationRequests.js +78 -45
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +10 -10
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.d.ts +2 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +33 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +7 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +39 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/index.d.ts +5 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.d.ts +15 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js +14 -0
- package/dist/components/Payroll/OffCycleReasonSelection/types.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js +35 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateForm.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.d.ts +2 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js +65 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js +18 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormPresentation.module.scss.js.map +1 -0
- package/dist/components/Payroll/PayPeriodDateForm/PayPeriodDateFormTypes.d.ts +53 -0
- package/dist/components/Payroll/PayPeriodDateForm/index.d.ts +3 -0
- package/dist/components/Payroll/PayPeriodDateForm/usePayPeriodDateValidation.d.ts +5 -0
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +4 -2
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +19 -18
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.module.scss.js +5 -5
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
- package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +26 -24
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +30 -29
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +4 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +18 -18
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +4 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +34 -28
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +29 -29
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +4 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +4 -0
- package/dist/components/Payroll/index.js +12 -8
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +8 -3
- package/dist/contexts/ThemeProvider/theme.js +29 -24
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/dateFormatting.d.ts +3 -0
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/i18n/I18n.js +1 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +157 -161
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -14
- package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -1
- package/dist/i18n/en/InformationRequests.json.js +8 -0
- package/dist/i18n/en/InformationRequests.json.js.map +1 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js +12 -0
- package/dist/i18n/en/Payroll.OffCycleReasonSelection.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js +32 -0
- package/dist/i18n/en/Payroll.PayPeriodDateForm.json.js.map +1 -0
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.js +10 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +52 -3
- package/package.json +11 -11
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +0 -8
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +0 -14
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +0 -1
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useGarnishmentsListSuspense as
|
|
5
|
-
import { useGarnishmentsGetChildSupportDataSuspense as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import j from "./GarnishmentForm.js";
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as q } from "react-i18next";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { useGarnishmentsListSuspense as B } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
5
|
+
import { useGarnishmentsGetChildSupportDataSuspense as H } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
|
|
6
|
+
import I from "./ChildSupportForm.js";
|
|
7
|
+
import V from "./GarnishmentForm.js";
|
|
9
8
|
import k from "./CustomDeductionForm.js";
|
|
10
|
-
import { BaseComponent as
|
|
11
|
-
import { useBase as
|
|
12
|
-
import { Grid as
|
|
13
|
-
import { useComponentDictionary as
|
|
14
|
-
import { componentEvents as
|
|
15
|
-
import { useComponentContext as
|
|
16
|
-
import
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */ n(
|
|
9
|
+
import { BaseComponent as w } from "../../../Base/Base.js";
|
|
10
|
+
import { useBase as z } from "../../../Base/useBase.js";
|
|
11
|
+
import { Grid as J } from "../../../Common/Grid/Grid.js";
|
|
12
|
+
import { useComponentDictionary as K, useI18n as Q } from "../../../../i18n/I18n.js";
|
|
13
|
+
import { componentEvents as y } from "../../../../shared/constants.js";
|
|
14
|
+
import { useComponentContext as W } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
15
|
+
import { Flex as x } from "../../../Common/Flex/Flex.js";
|
|
16
|
+
function pe(i) {
|
|
17
|
+
return /* @__PURE__ */ n(w, { ...i, children: /* @__PURE__ */ n(X, { ...i, children: i.children }) });
|
|
19
18
|
}
|
|
20
|
-
const
|
|
19
|
+
const G = [
|
|
21
20
|
"child_support",
|
|
22
21
|
"federal_tax_lien",
|
|
23
22
|
"state_tax_lien",
|
|
@@ -26,17 +25,17 @@ const S = [
|
|
|
26
25
|
"federal_loan",
|
|
27
26
|
"other_garnishment"
|
|
28
27
|
];
|
|
29
|
-
function
|
|
30
|
-
const { onEvent:
|
|
31
|
-
|
|
32
|
-
const { data:
|
|
28
|
+
function X({ className: i, employeeId: s, deductionId: g, dictionary: L }) {
|
|
29
|
+
const { onEvent: f } = z(), { t } = q("Employee.Deductions"), a = W();
|
|
30
|
+
K("Employee.Deductions", L), Q("Employee.Deductions");
|
|
31
|
+
const { data: _ } = B({ employeeId: s }), { data: c } = H({}), o = g ? _.garnishmentList?.find((e) => e.uuid === g) ?? null : null, b = t(o ? "editDeductionTitle" : "addDeductionTitle"), r = o?.garnishmentType, v = c.childSupportData?.agencies?.map((e) => ({
|
|
33
32
|
label: e.name,
|
|
34
33
|
value: e.state
|
|
35
|
-
})) || [], [
|
|
36
|
-
|
|
37
|
-
), [
|
|
38
|
-
|
|
39
|
-
),
|
|
34
|
+
})) || [], [D, A] = h(
|
|
35
|
+
r && G.includes(r) || !o
|
|
36
|
+
), [d, F] = h(
|
|
37
|
+
r || "child_support"
|
|
38
|
+
), C = {
|
|
40
39
|
child_support: t("childSupportTitle"),
|
|
41
40
|
federal_tax_lien: t("federalTaxLien"),
|
|
42
41
|
state_tax_lien: t("stateTaxLien"),
|
|
@@ -44,88 +43,92 @@ function Q({ className: s, employeeId: r, deductionId: p, dictionary: y }) {
|
|
|
44
43
|
creditor_garnishment: t("creditorGarnishment"),
|
|
45
44
|
federal_loan: t("federalLoan"),
|
|
46
45
|
other_garnishment: t("otherGarnishment")
|
|
47
|
-
},
|
|
46
|
+
}, T = C[d], O = G.map((e) => ({
|
|
48
47
|
value: e,
|
|
49
|
-
label:
|
|
50
|
-
})),
|
|
51
|
-
|
|
52
|
-
},
|
|
48
|
+
label: C[e]
|
|
49
|
+
})), P = o ? r ? "garnishment" : "custom" : "garnishment", [S, R] = h(o?.childSupport?.state || ""), N = (e) => {
|
|
50
|
+
R(e);
|
|
51
|
+
}, m = c.childSupportData?.agencies?.find(
|
|
52
|
+
(e) => e.state === S
|
|
53
|
+
)?.fipsCodes, M = (m ?? []).filter((e) => typeof e.code == "string").map((e) => ({
|
|
53
54
|
label: e.county?.length ? e.county : t("allCounties"),
|
|
54
|
-
value: e.code
|
|
55
|
-
}))
|
|
56
|
-
(e) => e.state ===
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
55
|
+
value: e.code ?? ""
|
|
56
|
+
})), u = m?.length === 1 ? m[0] : void 0, Y = u && !u.county?.length ? u.code : null, U = c.childSupportData?.agencies?.find(
|
|
57
|
+
(e) => e.state === S
|
|
58
|
+
), p = () => {
|
|
59
|
+
_.garnishmentList?.some((e) => e.active) ? f(y.EMPLOYEE_DEDUCTION_CANCEL) : f(y.EMPLOYEE_DEDUCTION_CANCEL_EMPTY);
|
|
60
|
+
}, j = (e) => {
|
|
61
|
+
A(e === "garnishment");
|
|
61
62
|
};
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */ n(
|
|
65
|
-
t("
|
|
63
|
+
return /* @__PURE__ */ n("section", { className: i, children: /* @__PURE__ */ l(J, { gap: 32, children: [
|
|
64
|
+
/* @__PURE__ */ l(x, { flexDirection: "column", gap: 2, children: [
|
|
65
|
+
/* @__PURE__ */ n(a.Heading, { as: "h2", children: b }),
|
|
66
|
+
/* @__PURE__ */ n(a.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
|
|
66
67
|
] }),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */ a("section", { children: [
|
|
70
|
-
/* @__PURE__ */ n(i.Heading, { as: "h3", children: t("externalPostTaxDeductions") }),
|
|
71
|
-
/* @__PURE__ */ n(i.Text, { variant: "supporting", children: t("externalPostTaxDeductionsDescription") })
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ n(
|
|
74
|
-
i.RadioGroup,
|
|
75
|
-
{
|
|
76
|
-
label: t("deductionTypeLabel"),
|
|
77
|
-
description: t("deductionTypeRadioLabel"),
|
|
78
|
-
options: [
|
|
79
|
-
{ value: "garnishment", label: t("garnishmentOption") },
|
|
80
|
-
{ value: "custom", label: t("customDeductionOption") }
|
|
81
|
-
],
|
|
82
|
-
defaultValue: v,
|
|
83
|
-
onChange: F,
|
|
84
|
-
isRequired: !0,
|
|
85
|
-
isDisabled: !!o,
|
|
86
|
-
className: c.deductionTypeRadioGroup
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
f && /* @__PURE__ */ a("section", { children: [
|
|
90
|
-
/* @__PURE__ */ n(i.Text, { weight: "bold", className: c.garnishmentTypeLabel, children: t("garnishmentType") }),
|
|
68
|
+
!o && /* @__PURE__ */ l(E, { children: [
|
|
69
|
+
/* @__PURE__ */ l(x, { flexDirection: "column", gap: 20, children: [
|
|
91
70
|
/* @__PURE__ */ n(
|
|
92
|
-
|
|
71
|
+
a.RadioGroup,
|
|
72
|
+
{
|
|
73
|
+
label: t("deductionTypeLabel"),
|
|
74
|
+
description: t("deductionTypeRadioLabel"),
|
|
75
|
+
options: [
|
|
76
|
+
{ value: "garnishment", label: t("garnishmentOption") },
|
|
77
|
+
{ value: "custom", label: t("customDeductionOption") }
|
|
78
|
+
],
|
|
79
|
+
defaultValue: P,
|
|
80
|
+
onChange: j,
|
|
81
|
+
isRequired: !0
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
D && /* @__PURE__ */ n(
|
|
85
|
+
a.Select,
|
|
93
86
|
{
|
|
94
87
|
label: t("garnishmentType"),
|
|
95
|
-
options:
|
|
96
|
-
placeholder:
|
|
97
|
-
shouldVisuallyHideLabel: !0,
|
|
88
|
+
options: O,
|
|
89
|
+
placeholder: T,
|
|
98
90
|
onChange: (e) => {
|
|
99
|
-
|
|
91
|
+
F(e);
|
|
100
92
|
},
|
|
101
|
-
isDisabled: !!o
|
|
93
|
+
isDisabled: !!o,
|
|
94
|
+
isRequired: !0
|
|
102
95
|
}
|
|
103
96
|
)
|
|
104
97
|
] }),
|
|
105
98
|
/* @__PURE__ */ n("hr", {})
|
|
106
99
|
] }),
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
D ? /* @__PURE__ */ n(E, { children: d === "child_support" ? /* @__PURE__ */ n(
|
|
101
|
+
I,
|
|
109
102
|
{
|
|
110
103
|
deduction: o,
|
|
111
|
-
employeeId:
|
|
112
|
-
handleStateAgencySelect:
|
|
113
|
-
stateAgencies:
|
|
114
|
-
counties:
|
|
115
|
-
|
|
104
|
+
employeeId: s,
|
|
105
|
+
handleStateAgencySelect: N,
|
|
106
|
+
stateAgencies: v,
|
|
107
|
+
counties: M,
|
|
108
|
+
singleAllCountiesFipsCode: Y,
|
|
109
|
+
selectedAgency: U,
|
|
110
|
+
onCancel: p
|
|
116
111
|
}
|
|
117
112
|
) : /* @__PURE__ */ n(
|
|
118
|
-
|
|
113
|
+
V,
|
|
114
|
+
{
|
|
115
|
+
deduction: o,
|
|
116
|
+
employeeId: s,
|
|
117
|
+
selectedGarnishmentType: d,
|
|
118
|
+
selectedGarnishmentTitle: T,
|
|
119
|
+
onCancel: p
|
|
120
|
+
}
|
|
121
|
+
) }) : /* @__PURE__ */ n(
|
|
122
|
+
k,
|
|
119
123
|
{
|
|
120
124
|
deduction: o,
|
|
121
|
-
employeeId:
|
|
122
|
-
|
|
123
|
-
selectedGarnishmentTitle: D
|
|
125
|
+
employeeId: s,
|
|
126
|
+
onCancel: p
|
|
124
127
|
}
|
|
125
|
-
)
|
|
126
|
-
] });
|
|
128
|
+
)
|
|
129
|
+
] }) });
|
|
127
130
|
}
|
|
128
131
|
export {
|
|
129
|
-
|
|
132
|
+
pe as DeductionsForm
|
|
130
133
|
};
|
|
131
134
|
//# sourceMappingURL=DeductionsForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportDataSuspense } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport styles from './DeductionsForm.module.scss'\nimport ChildSupportForm from './ChildSupportForm'\nimport GarnishmentForm from './GarnishmentForm'\nimport CustomDeductionForm from './CustomDeductionForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport CaretLeft from '@/assets/icons/caret-left.svg?react'\n\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either garnishment (court-ordered) or a custom deduction\nconst SUPPORTED_GARNISHMENT_TYPES: GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n]\n\nfunction Root({ className, employeeId, deductionId, dictionary }: DeductionsFormProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n // Fetch all garnishments to find the specific one by ID\n const { data } = useGarnishmentsListSuspense({ employeeId })\n\n // Fetch child support garnishment metadata\n const { data: childSupportData } = useGarnishmentsGetChildSupportDataSuspense({})\n\n // find existing deduction to determine if in ADD or EDIT mode\n // if deduction exists we are editing, else we are adding\n const deduction = deductionId\n ? (data.garnishmentList?.find(g => g.uuid === deductionId) ?? null)\n : null\n const title = !deduction ? t('addDeductionTitle') : t('editDeductionTitle')\n const deductionType = deduction?.garnishmentType\n const stateAgencies =\n childSupportData.childSupportData?.agencies?.map(a => ({\n label: a.name as string,\n value: a.state as string,\n })) || []\n\n // if deduction exists check if it has a type, else if does not exist default to garnishment\n const [isGarnishment, setIsGarnishment] = useState<boolean>(\n (deductionType && SUPPORTED_GARNISHMENT_TYPES.includes(deductionType)) || !deduction,\n )\n const [selectedGarnishment, setSelectedGarnishment] = useState<GarnishmentType>(\n deductionType || 'child_support',\n )\n const garnishmentLabels: Record<string, string> = {\n child_support: t('childSupportTitle'),\n federal_tax_lien: t('federalTaxLien'),\n state_tax_lien: t('stateTaxLien'),\n student_loan: t('studentLoan'),\n creditor_garnishment: t('creditorGarnishment'),\n federal_loan: t('federalLoan'),\n other_garnishment: t('otherGarnishment'),\n }\n const garnishmentPlaceholder = garnishmentLabels[selectedGarnishment]\n const garnishmentOptions = SUPPORTED_GARNISHMENT_TYPES.map(garnishment => ({\n value: garnishment,\n label: garnishmentLabels[garnishment] as string,\n }))\n\n const defaultDeductionTypeSelection = deduction\n ? deductionType\n ? 'garnishment'\n : 'custom'\n : 'garnishment'\n\n // filter out specific fipsCodes/counties as mapped to selected state agency\n // some states only have 1 fips code/county to cover the entire state,\n // but the API will return a null label so we need to provide a default label\n const [stateAgency, setStateAgency] = useState<string>(deduction?.childSupport?.state || '')\n const handleStateAgencySelect = (stateAgency: string) => {\n setStateAgency(stateAgency)\n }\n const counties =\n childSupportData.childSupportData?.agencies\n ?.find(agency => agency.state === stateAgency)\n ?.fipsCodes?.map(fipsCode => ({\n label: fipsCode.county?.length ? fipsCode.county : t('allCounties'),\n value: fipsCode.code as string,\n })) || []\n\n // get a reference to the currently selected agency to determine which required fields to display/include in submission\n const selectedAgency = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )\n\n const handleCancel = () => {\n // if any active garnishments return to list view, else return to empty state view\n if (data.garnishmentList?.some(g => g.active)) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY)\n }\n }\n\n const handleSelectDeductionType = (selection: string) => {\n setIsGarnishment(selection === 'garnishment')\n }\n\n return (\n <section className={className}>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n <CaretLeft className={styles.leftCaretIcon} />\n {t('backToDeductionsCta')}\n </Components.Button>\n <Grid gap={16} className={styles.formHeadingContainer}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <section>\n <Components.Heading as=\"h3\">{t('externalPostTaxDeductions')}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('externalPostTaxDeductionsDescription')}\n </Components.Text>\n </section>\n <Components.RadioGroup\n label={t('deductionTypeLabel')}\n description={t('deductionTypeRadioLabel')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customDeductionOption') },\n ]}\n defaultValue={defaultDeductionTypeSelection}\n onChange={handleSelectDeductionType}\n isRequired\n isDisabled={!!deduction}\n className={styles.deductionTypeRadioGroup}\n />\n {isGarnishment && (\n <section>\n <Components.Text weight=\"bold\" className={styles.garnishmentTypeLabel}>\n {t('garnishmentType')}\n </Components.Text>\n <Components.Select\n label={t('garnishmentType')}\n options={garnishmentOptions}\n placeholder={garnishmentPlaceholder}\n shouldVisuallyHideLabel\n onChange={value => {\n setSelectedGarnishment(value as GarnishmentType)\n }}\n isDisabled={!!deduction} // API does not allow to change/edit an existing deduction type\n />\n </section>\n )}\n <hr />\n </Grid>\n\n {isGarnishment ? (\n <>\n {selectedGarnishment === 'child_support' ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n selectedAgency={selectedAgency}\n />\n ) : (\n <GarnishmentForm\n deduction={deduction}\n employeeId={employeeId}\n selectedGarnishmentType={selectedGarnishment}\n selectedGarnishmentTitle={garnishmentPlaceholder!}\n />\n )}\n </>\n ) : (\n <CustomDeductionForm deduction={deduction} employeeId={employeeId} />\n )}\n </section>\n )\n}\n"],"names":["DeductionsForm","props","jsx","BaseComponent","Root","SUPPORTED_GARNISHMENT_TYPES","className","employeeId","deductionId","dictionary","onEvent","useBase","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","childSupportData","useGarnishmentsGetChildSupportDataSuspense","deduction","g","title","deductionType","stateAgencies","a","isGarnishment","setIsGarnishment","useState","selectedGarnishment","setSelectedGarnishment","garnishmentLabels","garnishmentPlaceholder","garnishmentOptions","garnishment","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","counties","agency","fipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","CaretLeft","styles","Grid","value","Fragment","ChildSupportForm","GarnishmentForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;;AA2BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAGA,MAAMI,IAAiD;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAASD,EAAK,EAAE,WAAAE,GAAW,YAAAC,GAAY,aAAAC,GAAa,YAAAC,KAAmC;AACrF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBN,CAAU,GACxDO,EAAQ,qBAAqB;AAG7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAX,GAAY,GAGrD,EAAE,MAAMY,MAAqBC,EAA2C,CAAA,CAAE,GAI1EC,IAAYb,IACbS,EAAK,iBAAiB,KAAK,OAAKK,EAAE,SAASd,CAAW,KAAK,OAC5D,MACEe,IAA8C,EAArCF,IAAuC,uBAAzB,mBAA6C,GACpEG,IAAgBH,GAAW,iBAC3BI,IACJN,EAAiB,kBAAkB,UAAU,IAAI,CAAAO,OAAM;AAAA,IACrD,OAAOA,EAAE;AAAA,IACT,OAAOA,EAAE;AAAA,EAAA,EACT,KAAK,CAAA,GAGH,CAACC,GAAeC,CAAgB,IAAIC;AAAA,IACvCL,KAAiBnB,EAA4B,SAASmB,CAAa,KAAM,CAACH;AAAA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,YAC1B,SAASqB;AAAA,YACT,aAAaD;AAAA,YACb,yBAAuB;AAAA,YACvB,UAAU,CAAAmB,MAAS;AACjB,cAAArB,EAAuBqB,CAAwB;AAAA,YACjD;AAAA,YACA,YAAY,CAAC,CAAC/B;AAAA,UAAA;AAAA,QAAA;AAAA,MAChB,GACF;AAAA,wBAED,MAAA,CAAA,CAAG;AAAA,IAAA,GACN;AAAA,IAECM,IACC,gBAAAzB,EAAAmD,GAAA,EACG,UAAAvB,MAAwB,kBACvB,gBAAA5B;AAAA,MAACoD;AAAA,MAAA;AAAA,QACC,WAAAjC;AAAA,QACA,YAAAd;AAAA,QACA,yBAAAgC;AAAA,QACA,eAAAd;AAAA,QACA,UAAAe;AAAA,QACA,gBAAAG;AAAA,MAAA;AAAA,IAAA,IAGF,gBAAAzC;AAAA,MAACqD;AAAA,MAAA;AAAA,QACC,WAAAlC;AAAA,QACA,YAAAd;AAAA,QACA,yBAAyBuB;AAAA,QACzB,0BAA0BG;AAAA,MAAA;AAAA,IAAA,EAC5B,CAEJ,IAEA,gBAAA/B,EAACsD,GAAA,EAAoB,WAAAnC,GAAsB,YAAAd,EAAA,CAAwB;AAAA,EAAA,GAEvE;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"DeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useState } from 'react'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportDataSuspense } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\nimport ChildSupportForm from './ChildSupportForm'\nimport GarnishmentForm from './GarnishmentForm'\nimport CustomDeductionForm from './CustomDeductionForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\n\ninterface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deductionId?: string | null\n}\n\nexport function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\n// deductions can be either garnishment (court-ordered) or a custom deduction\nconst SUPPORTED_GARNISHMENT_TYPES: GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n]\n\nfunction Root({ className, employeeId, deductionId, dictionary }: DeductionsFormProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n // Fetch all garnishments to find the specific one by ID\n const { data } = useGarnishmentsListSuspense({ employeeId })\n\n // Fetch child support garnishment metadata\n const { data: childSupportData } = useGarnishmentsGetChildSupportDataSuspense({})\n\n // find existing deduction to determine if in ADD or EDIT mode\n // if deduction exists we are editing, else we are adding\n const deduction = deductionId\n ? (data.garnishmentList?.find(g => g.uuid === deductionId) ?? null)\n : null\n const title = !deduction ? t('addDeductionTitle') : t('editDeductionTitle')\n const deductionType = deduction?.garnishmentType\n const stateAgencies =\n childSupportData.childSupportData?.agencies?.map(a => ({\n label: a.name as string,\n value: a.state as string,\n })) || []\n\n // if deduction exists check if it has a type, else if does not exist default to garnishment\n const [isGarnishment, setIsGarnishment] = useState<boolean>(\n (deductionType && SUPPORTED_GARNISHMENT_TYPES.includes(deductionType)) || !deduction,\n )\n const [selectedGarnishment, setSelectedGarnishment] = useState<GarnishmentType>(\n deductionType || 'child_support',\n )\n const garnishmentLabels: Record<string, string> = {\n child_support: t('childSupportTitle'),\n federal_tax_lien: t('federalTaxLien'),\n state_tax_lien: t('stateTaxLien'),\n student_loan: t('studentLoan'),\n creditor_garnishment: t('creditorGarnishment'),\n federal_loan: t('federalLoan'),\n other_garnishment: t('otherGarnishment'),\n }\n const garnishmentPlaceholder = garnishmentLabels[selectedGarnishment]\n const garnishmentOptions = SUPPORTED_GARNISHMENT_TYPES.map(garnishment => ({\n value: garnishment,\n label: garnishmentLabels[garnishment] as string,\n }))\n\n const defaultDeductionTypeSelection = deduction\n ? deductionType\n ? 'garnishment'\n : 'custom'\n : 'garnishment'\n\n // filter out specific fipsCodes/counties as mapped to selected state agency\n // some states only have 1 fips code/county to cover the entire state,\n // but the API will return a null label so we need to provide a default label\n const [stateAgency, setStateAgency] = useState<string>(deduction?.childSupport?.state || '')\n const handleStateAgencySelect = (stateAgency: string) => {\n setStateAgency(stateAgency)\n }\n const selectedAgencyFipsCodes = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )?.fipsCodes\n const counties = (selectedAgencyFipsCodes ?? [])\n .filter(fipsCode => typeof fipsCode.code === 'string')\n .map(fipsCode => ({\n label: fipsCode.county?.length ? fipsCode.county : t('allCounties'),\n value: fipsCode.code ?? '',\n }))\n const singleFipsCode =\n selectedAgencyFipsCodes?.length === 1 ? selectedAgencyFipsCodes[0] : undefined\n const singleAllCountiesFipsCode =\n singleFipsCode && !singleFipsCode.county?.length ? singleFipsCode.code : null\n\n // get a reference to the currently selected agency to determine which required fields to display/include in submission\n const selectedAgency = childSupportData.childSupportData?.agencies?.find(\n agency => agency.state === stateAgency,\n )\n\n const handleCancel = () => {\n // if any active garnishments return to list view, else return to empty state view\n if (data.garnishmentList?.some(g => g.active)) {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL_EMPTY)\n }\n }\n\n const handleSelectDeductionType = (selection: string) => {\n setIsGarnishment(selection === 'garnishment')\n }\n\n return (\n <section className={className}>\n <Grid gap={32}>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('externalPostTaxDeductionsDescription')}\n </Components.Text>\n </Flex>\n\n {!deduction && (\n <>\n <Flex flexDirection=\"column\" gap={20}>\n <Components.RadioGroup\n label={t('deductionTypeLabel')}\n description={t('deductionTypeRadioLabel')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customDeductionOption') },\n ]}\n defaultValue={defaultDeductionTypeSelection}\n onChange={handleSelectDeductionType}\n isRequired\n />\n\n {isGarnishment && (\n <Components.Select\n label={t('garnishmentType')}\n options={garnishmentOptions}\n placeholder={garnishmentPlaceholder}\n onChange={value => {\n setSelectedGarnishment(value as GarnishmentType)\n }}\n isDisabled={!!deduction} // API does not allow to change/edit an existing deduction type\n isRequired\n />\n )}\n </Flex>\n\n <hr />\n </>\n )}\n\n {isGarnishment ? (\n <>\n {selectedGarnishment === 'child_support' ? (\n <ChildSupportForm\n deduction={deduction}\n employeeId={employeeId}\n handleStateAgencySelect={handleStateAgencySelect}\n stateAgencies={stateAgencies}\n counties={counties}\n singleAllCountiesFipsCode={singleAllCountiesFipsCode}\n selectedAgency={selectedAgency}\n onCancel={handleCancel}\n />\n ) : (\n <GarnishmentForm\n deduction={deduction}\n employeeId={employeeId}\n selectedGarnishmentType={selectedGarnishment}\n selectedGarnishmentTitle={garnishmentPlaceholder!}\n onCancel={handleCancel}\n />\n )}\n </>\n ) : (\n <CustomDeductionForm\n deduction={deduction}\n employeeId={employeeId}\n onCancel={handleCancel}\n />\n )}\n </Grid>\n </section>\n )\n}\n"],"names":["DeductionsForm","props","jsx","BaseComponent","Root","SUPPORTED_GARNISHMENT_TYPES","className","employeeId","deductionId","dictionary","onEvent","useBase","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","data","useGarnishmentsListSuspense","childSupportData","useGarnishmentsGetChildSupportDataSuspense","deduction","g","title","deductionType","stateAgencies","a","isGarnishment","setIsGarnishment","useState","selectedGarnishment","setSelectedGarnishment","garnishmentLabels","garnishmentPlaceholder","garnishmentOptions","garnishment","defaultDeductionTypeSelection","stateAgency","setStateAgency","handleStateAgencySelect","selectedAgencyFipsCodes","agency","counties","fipsCode","singleFipsCode","singleAllCountiesFipsCode","selectedAgency","handleCancel","componentEvents","handleSelectDeductionType","selection","jsxs","Grid","Flex","Fragment","value","ChildSupportForm","GarnishmentForm","CustomDeductionForm"],"mappings":";;;;;;;;;;;;;;;AA0BO,SAASA,GAAeC,GAAqD;AAClF,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAGA,MAAMI,IAAiD;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,SAASD,EAAK,EAAE,WAAAE,GAAW,YAAAC,GAAY,aAAAC,GAAa,YAAAC,KAAmC;AACrF,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBN,CAAU,GACxDO,EAAQ,qBAAqB;AAG7B,QAAM,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAX,GAAY,GAGrD,EAAE,MAAMY,MAAqBC,EAA2C,CAAA,CAAE,GAI1EC,IAAYb,IACbS,EAAK,iBAAiB,KAAK,OAAKK,EAAE,SAASd,CAAW,KAAK,OAC5D,MACEe,IAA8C,EAArCF,IAAuC,uBAAzB,mBAA6C,GACpEG,IAAgBH,GAAW,iBAC3BI,IACJN,EAAiB,kBAAkB,UAAU,IAAI,CAAAO,OAAM;AAA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OAAO,EAAE,iBAAiB;AAAA,YAC1B,SAASqB;AAAA,YACT,aAAaD;AAAA,YACb,UAAU,CAAAsB,MAAS;AACjB,cAAAxB,EAAuBwB,CAAwB;AAAA,YACjD;AAAA,YACA,YAAY,CAAC,CAAClC;AAAA,YACd,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,GAEJ;AAAA,wBAEC,MAAA,CAAA,CAAG;AAAA,IAAA,GACN;AAAA,IAGDM,IACC,gBAAAzB,EAAAoD,GAAA,EACG,UAAAxB,MAAwB,kBACvB,gBAAA5B;AAAA,MAACsD;AAAA,MAAA;AAAA,QACC,WAAAnC;AAAA,QACA,YAAAd;AAAA,QACA,yBAAAgC;AAAA,QACA,eAAAd;AAAA,QACA,UAAAiB;AAAA,QACA,2BAAAG;AAAA,QACA,gBAAAC;AAAA,QACA,UAAUC;AAAA,MAAA;AAAA,IAAA,IAGZ,gBAAA7C;AAAA,MAACuD;AAAA,MAAA;AAAA,QACC,WAAApC;AAAA,QACA,YAAAd;AAAA,QACA,yBAAyBuB;AAAA,QACzB,0BAA0BG;AAAA,QAC1B,UAAUc;AAAA,MAAA;AAAA,IAAA,GAGhB,IAEA,gBAAA7C;AAAA,MAACwD;AAAA,MAAA;AAAA,QACC,WAAArC;AAAA,QACA,YAAAd;AAAA,QACA,UAAUwC;AAAA,MAAA;AAAA,IAAA;AAAA,EACZ,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
@@ -51,6 +51,7 @@ interface GarnishmentFormProps extends CommonComponentInterface<'Employee.Deduct
|
|
|
51
51
|
deduction?: Garnishment | null;
|
|
52
52
|
selectedGarnishmentType: GarnishmentType;
|
|
53
53
|
selectedGarnishmentTitle: string;
|
|
54
|
+
onCancel: () => void;
|
|
54
55
|
}
|
|
55
|
-
declare function GarnishmentForm({ deduction, employeeId, selectedGarnishmentType, selectedGarnishmentTitle, }: GarnishmentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
declare function GarnishmentForm({ deduction, employeeId, selectedGarnishmentType, selectedGarnishmentTitle, onCancel, }: GarnishmentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
56
57
|
export default GarnishmentForm;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTranslation as
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { useMemo as
|
|
1
|
+
import { jsx as t, jsxs as o, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as L } from "react-i18next";
|
|
3
|
+
import { useForm as N, useWatch as g, FormProvider as V } from "react-hook-form";
|
|
4
|
+
import { useMemo as w } from "react";
|
|
5
5
|
import { z as r } from "zod";
|
|
6
|
-
import { zodResolver as
|
|
7
|
-
import { GarnishmentType as
|
|
8
|
-
import { useGarnishmentsCreateMutation as
|
|
9
|
-
import { useGarnishmentsUpdateMutation as
|
|
10
|
-
import { useComponentContext as
|
|
11
|
-
import { Form as
|
|
12
|
-
import { Flex as
|
|
13
|
-
import
|
|
6
|
+
import { zodResolver as B } from "@hookform/resolvers/zod";
|
|
7
|
+
import { GarnishmentType as G } from "@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments";
|
|
8
|
+
import { useGarnishmentsCreateMutation as I } from "@gusto/embedded-api/react-query/garnishmentsCreate";
|
|
9
|
+
import { useGarnishmentsUpdateMutation as U } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
|
|
10
|
+
import { useComponentContext as _ } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
import { Form as j } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
13
|
+
import "classnames";
|
|
14
|
+
import { componentEvents as b } from "../../../../shared/constants.js";
|
|
15
|
+
import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
16
|
+
import { TextInputField as $ } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
17
|
+
import { ActionsLayout as z } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
18
|
+
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
14
19
|
import "react-error-boundary";
|
|
15
20
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
16
21
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
17
22
|
import "@tanstack/react-query";
|
|
18
|
-
import { useBase as
|
|
19
|
-
import { componentEvents as c } from "../../../../shared/constants.js";
|
|
23
|
+
import { useBase as H } from "../../../Base/useBase.js";
|
|
20
24
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
21
25
|
import "dompurify";
|
|
22
26
|
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
23
|
-
|
|
24
|
-
import { RadioGroupField as f } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
25
|
-
import { NumberInputField as p } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
26
|
-
const z = r.object({
|
|
27
|
+
const Y = r.object({
|
|
27
28
|
active: r.boolean(),
|
|
28
29
|
amount: r.number().min(0).transform(String),
|
|
29
30
|
description: r.string().min(1),
|
|
@@ -33,15 +34,16 @@ const z = r.object({
|
|
|
33
34
|
annualMaximum: r.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
|
|
34
35
|
totalAmount: r.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
|
|
35
36
|
deductAsPercentage: r.boolean(),
|
|
36
|
-
garnishmentType: r.nativeEnum(
|
|
37
|
+
garnishmentType: r.nativeEnum(G)
|
|
37
38
|
});
|
|
38
|
-
function
|
|
39
|
+
function De({
|
|
39
40
|
deduction: e,
|
|
40
41
|
employeeId: h,
|
|
41
42
|
selectedGarnishmentType: A,
|
|
42
|
-
selectedGarnishmentTitle: D
|
|
43
|
+
selectedGarnishmentTitle: D,
|
|
44
|
+
onCancel: y
|
|
43
45
|
}) {
|
|
44
|
-
const { onEvent:
|
|
46
|
+
const { onEvent: p, baseSubmitHandler: x } = H(), { t: n } = L("Employee.Deductions"), u = _(), { mutateAsync: P, isPending: E } = I(), { mutateAsync: v, isPending: T } = U(), M = E || T, C = w(() => ({
|
|
45
47
|
amount: e?.amount ? Number(e.amount) : 0,
|
|
46
48
|
description: e?.description ?? "",
|
|
47
49
|
times: e?.times ?? null,
|
|
@@ -52,108 +54,112 @@ function he({
|
|
|
52
54
|
active: !0,
|
|
53
55
|
courtOrdered: !0,
|
|
54
56
|
garnishmentType: e?.garnishmentType ?? A
|
|
55
|
-
}), [e]),
|
|
56
|
-
resolver:
|
|
57
|
-
defaultValues:
|
|
58
|
-
}), { control: d } =
|
|
59
|
-
await
|
|
57
|
+
}), [e]), s = N({
|
|
58
|
+
resolver: B(Y),
|
|
59
|
+
defaultValues: C
|
|
60
|
+
}), { control: d } = s, q = g({ control: d, name: "recurring" }), i = g({ control: d, name: "deductAsPercentage" }), F = async (R) => {
|
|
61
|
+
await x(R, async (a) => {
|
|
60
62
|
if (e) {
|
|
61
|
-
const { garnishment:
|
|
63
|
+
const { garnishment: l } = await v({
|
|
62
64
|
request: {
|
|
63
65
|
garnishmentId: e.uuid,
|
|
64
66
|
requestBody: {
|
|
65
|
-
...
|
|
67
|
+
...a,
|
|
66
68
|
version: e.version,
|
|
67
|
-
times:
|
|
69
|
+
times: a.recurring ? null : 1
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
});
|
|
71
|
-
|
|
73
|
+
p(b.EMPLOYEE_DEDUCTION_UPDATED, l);
|
|
72
74
|
} else {
|
|
73
|
-
const { garnishment:
|
|
75
|
+
const { garnishment: l } = await P({
|
|
74
76
|
request: {
|
|
75
77
|
employeeId: h,
|
|
76
|
-
requestBody: { ...
|
|
78
|
+
requestBody: { ...a, times: a.recurring ? null : 1 }
|
|
77
79
|
}
|
|
78
80
|
});
|
|
79
|
-
|
|
81
|
+
p(b.EMPLOYEE_DEDUCTION_CREATED, l);
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
+
}, O = () => {
|
|
85
|
+
y();
|
|
84
86
|
};
|
|
85
|
-
return /* @__PURE__ */ t(
|
|
86
|
-
/* @__PURE__ */ t(
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
87
|
+
return /* @__PURE__ */ t(V, { ...s, children: /* @__PURE__ */ t(j, { onSubmit: s.handleSubmit(F), children: /* @__PURE__ */ t(m, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(S, { children: [
|
|
88
|
+
/* @__PURE__ */ t(u.Heading, { as: "h3", children: D }),
|
|
89
|
+
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
90
|
+
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
91
|
+
/* @__PURE__ */ t($, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
|
|
92
|
+
/* @__PURE__ */ t(
|
|
93
|
+
f,
|
|
94
|
+
{
|
|
95
|
+
name: "recurring",
|
|
96
|
+
label: n("frequencyLabel"),
|
|
97
|
+
isRequired: !0,
|
|
98
|
+
options: [
|
|
99
|
+
{ value: !0, label: n("frequencyRecurringOptionV2") },
|
|
100
|
+
{ value: !1, label: n("frequencyOneTimeOptionV2") }
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ t(
|
|
105
|
+
f,
|
|
106
|
+
{
|
|
107
|
+
name: "deductAsPercentage",
|
|
108
|
+
label: n("deductionTypeLabelV2"),
|
|
109
|
+
isRequired: !0,
|
|
110
|
+
options: [
|
|
111
|
+
{ value: !0, label: n("deductionTypePercentageOptionV2") },
|
|
112
|
+
{ value: !1, label: n("deductionTypeFixedAmountOption") }
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
c,
|
|
118
|
+
{
|
|
119
|
+
name: "amount",
|
|
120
|
+
adornmentStart: !i && "$",
|
|
121
|
+
adornmentEnd: i && "%",
|
|
122
|
+
label: n("deductionAmountLabel"),
|
|
123
|
+
isRequired: !0,
|
|
124
|
+
min: 0,
|
|
125
|
+
format: i ? "percent" : "currency",
|
|
126
|
+
description: n(i ? "deductionAmountDescriptionPercentage" : "deductionAmountDescriptionFixed")
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
q && /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
131
|
+
/* @__PURE__ */ t(
|
|
132
|
+
c,
|
|
133
|
+
{
|
|
134
|
+
name: "totalAmount",
|
|
135
|
+
adornmentStart: "$",
|
|
136
|
+
format: "currency",
|
|
137
|
+
label: n("totalAmountLabel"),
|
|
138
|
+
description: n("totalAmountDescription"),
|
|
139
|
+
min: 0
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ t(
|
|
143
|
+
c,
|
|
144
|
+
{
|
|
145
|
+
name: "annualMaximum",
|
|
146
|
+
adornmentStart: "$",
|
|
147
|
+
format: "currency",
|
|
148
|
+
label: n("annualMaxLabel"),
|
|
149
|
+
min: 0,
|
|
150
|
+
description: n("annualMaxDescription")
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] })
|
|
148
154
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ t(
|
|
151
|
-
/* @__PURE__ */ t(
|
|
155
|
+
/* @__PURE__ */ o(z, { children: [
|
|
156
|
+
/* @__PURE__ */ t(u.Button, { variant: "secondary", onClick: O, children: n("cancelCta") }),
|
|
157
|
+
/* @__PURE__ */ t(u.Button, { type: "submit", isLoading: M, children: n("saveCta") })
|
|
152
158
|
] })
|
|
153
159
|
] }) }) }) });
|
|
154
160
|
}
|
|
155
161
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
162
|
+
Y as DeductionSchema,
|
|
163
|
+
De as default
|
|
158
164
|
};
|
|
159
165
|
//# sourceMappingURL=GarnishmentForm.js.map
|