@gusto/embedded-react-sdk 0.26.0 → 0.27.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 +70 -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/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/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.module.scss.js +1 -1
- 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.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/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 +38 -36
- 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 +12 -10
- 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 +51 -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,28 +1,29 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as o, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as T } from "react-i18next";
|
|
3
|
-
import { useForm as
|
|
4
|
-
import { useMemo as
|
|
3
|
+
import { useForm as L, useWatch as f, FormProvider as O } from "react-hook-form";
|
|
4
|
+
import { useMemo as N } from "react";
|
|
5
5
|
import { z as r } from "zod";
|
|
6
|
-
import { zodResolver as
|
|
7
|
-
import { useGarnishmentsCreateMutation as
|
|
8
|
-
import { useGarnishmentsUpdateMutation as
|
|
9
|
-
import { useComponentContext as
|
|
10
|
-
import { Form as
|
|
11
|
-
import { Flex as
|
|
12
|
-
import
|
|
6
|
+
import { zodResolver as V } from "@hookform/resolvers/zod";
|
|
7
|
+
import { useGarnishmentsCreateMutation as w } from "@gusto/embedded-api/react-query/garnishmentsCreate";
|
|
8
|
+
import { useGarnishmentsUpdateMutation as B } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
|
|
9
|
+
import { useComponentContext as I } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import { Form as U } from "../../../Common/Form/Form.js";
|
|
11
|
+
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
12
|
+
import "classnames";
|
|
13
|
+
import { componentEvents as b } from "../../../../shared/constants.js";
|
|
14
|
+
import { RadioGroupField as g } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
15
|
+
import { TextInputField as _ } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
16
|
+
import { ActionsLayout as j } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
17
|
+
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
13
18
|
import "react-error-boundary";
|
|
14
19
|
import "@gusto/embedded-api/models/errors/apierror";
|
|
15
20
|
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
16
21
|
import "@tanstack/react-query";
|
|
17
|
-
import { useBase as
|
|
18
|
-
import { componentEvents as c } from "../../../../shared/constants.js";
|
|
22
|
+
import { useBase as G } from "../../../Base/useBase.js";
|
|
19
23
|
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
20
24
|
import "dompurify";
|
|
21
25
|
import "../../../../contexts/LocaleProvider/useLocale.js";
|
|
22
|
-
|
|
23
|
-
import { RadioGroupField as g } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
24
|
-
import { NumberInputField as d } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
25
|
-
const G = r.object({
|
|
26
|
+
const $ = r.object({
|
|
26
27
|
active: r.boolean(),
|
|
27
28
|
amount: r.number().min(0).transform(String),
|
|
28
29
|
description: r.string().min(1),
|
|
@@ -32,8 +33,8 @@ const G = r.object({
|
|
|
32
33
|
totalAmount: r.number().min(0).transform((e) => e > 0 ? e.toString() : null).nullable(),
|
|
33
34
|
deductAsPercentage: r.boolean()
|
|
34
35
|
});
|
|
35
|
-
function
|
|
36
|
-
const { onEvent:
|
|
36
|
+
function be({ deduction: e, employeeId: h, onCancel: D }) {
|
|
37
|
+
const { onEvent: d, baseSubmitHandler: A } = G(), { t: n } = T("Employee.Deductions"), u = I(), { mutateAsync: x, isPending: P } = w(), { mutateAsync: y, isPending: E } = B(), v = P || E, C = N(() => ({
|
|
37
38
|
amount: e?.amount ? Number(e.amount) : 0,
|
|
38
39
|
description: e?.description ?? "",
|
|
39
40
|
times: e?.times ?? null,
|
|
@@ -42,109 +43,113 @@ function pe({ deduction: e, employeeId: A }) {
|
|
|
42
43
|
totalAmount: e?.totalAmount ? Number(e.totalAmount) : null,
|
|
43
44
|
deductAsPercentage: e?.deductAsPercentage ?? !0,
|
|
44
45
|
active: !0
|
|
45
|
-
}), [e]),
|
|
46
|
-
resolver:
|
|
47
|
-
defaultValues:
|
|
48
|
-
}), { control: p } =
|
|
49
|
-
await
|
|
46
|
+
}), [e]), s = L({
|
|
47
|
+
resolver: V($),
|
|
48
|
+
defaultValues: C
|
|
49
|
+
}), { control: p } = s, M = f({ control: p, name: "recurring" }), i = f({ control: p, name: "deductAsPercentage" }), q = async (R) => {
|
|
50
|
+
await A(R, async (a) => {
|
|
50
51
|
if (e) {
|
|
51
|
-
const { garnishment:
|
|
52
|
+
const { garnishment: l } = await y({
|
|
52
53
|
request: {
|
|
53
54
|
garnishmentId: e.uuid,
|
|
54
55
|
requestBody: {
|
|
55
|
-
...
|
|
56
|
+
...a,
|
|
56
57
|
version: e.version,
|
|
57
|
-
times:
|
|
58
|
+
times: a.recurring ? null : 1
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
+
d(b.EMPLOYEE_DEDUCTION_UPDATED, l);
|
|
62
63
|
} else {
|
|
63
|
-
const { garnishment:
|
|
64
|
+
const { garnishment: l } = await x({
|
|
64
65
|
request: {
|
|
65
|
-
employeeId:
|
|
66
|
-
requestBody: { ...
|
|
66
|
+
employeeId: h,
|
|
67
|
+
requestBody: { ...a, courtOrdered: !1, times: a.recurring ? null : 1 }
|
|
67
68
|
// custom deductions cannot be court ordered/garnishment
|
|
68
69
|
}
|
|
69
70
|
});
|
|
70
|
-
|
|
71
|
+
d(b.EMPLOYEE_DEDUCTION_CREATED, l);
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
|
-
},
|
|
74
|
-
|
|
74
|
+
}, F = () => {
|
|
75
|
+
D();
|
|
75
76
|
};
|
|
76
|
-
return /* @__PURE__ */ t(
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
77
|
+
return /* @__PURE__ */ t(O, { ...s, children: /* @__PURE__ */ t(U, { onSubmit: s.handleSubmit(q), children: /* @__PURE__ */ t(m, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(S, { children: [
|
|
78
|
+
/* @__PURE__ */ t(u.Heading, { as: "h3", children: n("customDeductionTitle") }),
|
|
79
|
+
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
80
|
+
/* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
81
|
+
/* @__PURE__ */ t(_, { name: "description", label: n("descriptionLabelV2"), isRequired: !0 }),
|
|
82
|
+
/* @__PURE__ */ t(
|
|
83
|
+
g,
|
|
84
|
+
{
|
|
85
|
+
name: "recurring",
|
|
86
|
+
label: n("frequencyLabel"),
|
|
87
|
+
isRequired: !0,
|
|
88
|
+
options: [
|
|
89
|
+
{ value: !0, label: n("frequencyRecurringOptionV2") },
|
|
90
|
+
{ value: !1, label: n("frequencyOneTimeOptionV2") }
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ t(
|
|
95
|
+
g,
|
|
96
|
+
{
|
|
97
|
+
name: "deductAsPercentage",
|
|
98
|
+
label: n("deductionTypeLabelV2"),
|
|
99
|
+
isRequired: !0,
|
|
100
|
+
options: [
|
|
101
|
+
{ value: !0, label: n("deductionTypePercentageOptionV2") },
|
|
102
|
+
{ value: !1, label: n("deductionTypeFixedAmountOption") }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ t(
|
|
107
|
+
c,
|
|
108
|
+
{
|
|
109
|
+
name: "amount",
|
|
110
|
+
adornmentStart: !i && "$",
|
|
111
|
+
adornmentEnd: i && "%",
|
|
112
|
+
label: n("deductionAmountLabel"),
|
|
113
|
+
isRequired: !0,
|
|
114
|
+
min: 0,
|
|
115
|
+
format: i ? "percent" : "currency",
|
|
116
|
+
description: n(i ? "deductionAmountDescriptionPercentage" : "deductionAmountDescriptionFixed")
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] }),
|
|
120
|
+
M && /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
121
|
+
/* @__PURE__ */ t(
|
|
122
|
+
c,
|
|
123
|
+
{
|
|
124
|
+
name: "totalAmount",
|
|
125
|
+
adornmentStart: "$",
|
|
126
|
+
format: "currency",
|
|
127
|
+
label: n("totalAmountLabel"),
|
|
128
|
+
description: n("totalAmountDescription"),
|
|
129
|
+
min: 0
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ t(
|
|
133
|
+
c,
|
|
134
|
+
{
|
|
135
|
+
name: "annualMaximum",
|
|
136
|
+
adornmentStart: "$",
|
|
137
|
+
format: "currency",
|
|
138
|
+
label: n("annualMaxLabel"),
|
|
139
|
+
min: 0,
|
|
140
|
+
description: n("annualMaxDescription")
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] })
|
|
139
144
|
] }),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */ t(
|
|
142
|
-
/* @__PURE__ */ t(
|
|
145
|
+
/* @__PURE__ */ o(j, { children: [
|
|
146
|
+
/* @__PURE__ */ t(u.Button, { variant: "secondary", onClick: F, children: n("cancelCta") }),
|
|
147
|
+
/* @__PURE__ */ t(u.Button, { type: "submit", isLoading: v, children: n("saveCta") })
|
|
143
148
|
] })
|
|
144
149
|
] }) }) }) });
|
|
145
150
|
}
|
|
146
151
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
$ as DeductionSchema,
|
|
153
|
+
be as default
|
|
149
154
|
};
|
|
150
155
|
//# sourceMappingURL=CustomDeductionForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomDeductionForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, RadioGroupField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n times: z.number().nullable(),\n recurring: z.boolean(),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n totalAmount: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.boolean(),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n}\n\nfunction CustomDeductionForm({ deduction, employeeId }: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring ?? true,\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n totalAmount: deduction?.totalAmount ? Number(deduction.totalAmount) : null,\n deductAsPercentage: deduction?.deductAsPercentage ?? true,\n active: true,\n } as DeductionInputs\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { control } = formMethods\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedAmountPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, courtOrdered: false, times: payload.recurring ? null : 1 }, // custom deductions cannot be court ordered/garnishment\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CANCEL)\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <Components.Heading as=\"h3\">{t('customDeductionTitle')}</Components.Heading>\n <TextInputField name=\"description\" label={t('descriptionLabelV2')} isRequired />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: true, label: t('frequencyRecurringOptionV2') },\n { value: false, label: t('frequencyOneTimeOptionV2') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabelV2')}\n isRequired\n options={[\n { value: true, label: t('deductionTypePercentageOptionV2') },\n { value: false, label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField\n name=\"amount\"\n adornmentStart={!watchedAmountPercentage && '$'}\n adornmentEnd={watchedAmountPercentage && '%'}\n label={t('deductionAmountLabel')}\n isRequired\n min={0}\n format={watchedAmountPercentage ? 'percent' : 'currency'}\n description={\n watchedAmountPercentage\n ? t('deductionAmountDescriptionPercentage')\n : t('deductionAmountDescriptionFixed')\n }\n />\n {watchedRecurring && (\n <>\n <NumberInputField\n name=\"totalAmount\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('totalAmountLabel')}\n description={t('totalAmountDescription')}\n min={0}\n />\n <NumberInputField\n name=\"annualMaximum\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('annualMaxLabel')}\n min={0}\n description={t('annualMaxDescription')}\n />\n </>\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {!deduction ? t('addDeductionCta') : t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default CustomDeductionForm\n"],"names":["DeductionSchema","z","val","CustomDeductionForm","deduction","employeeId","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","control","watchedRecurring","useWatch","watchedAmountPercentage","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,OAAOA,EAAE,OAAA,EAAS,SAAA;AAAA,EAClB,WAAWA,EAAE,QAAA;AAAA,EACb,eAAeA,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,aAAaD,EACV,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAAC,MAAQA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAA;AAAA,EACH,oBAAoBD,EAAE,QAAA;AACxB,CAAC;AAUD,SAASE,GAAoB,EAAE,WAAAC,GAAW,YAAAC,KAAqC;AAC7E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEb,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAC/CC,EAAA,GACI,EAAE,aAAaC,GAAiB,WAAWC,EAAA,IAC/CC,EAAA,GACIC,IAAYL,KAAmBG,G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,EAAE,sBAAsB;AAAA,QAC/B,YAAU;AAAA,QACV,KAAK;AAAA,QACL,QAAQmB,IAA0B,YAAY;AAAA,QAC9C,aAEMnB,EADJmB,IACM,yCACA,iCADsC;AAAA,MACL;AAAA,IAAA;AAAA,IAG1CF,KACC,gBAAAc,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAJ;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,gBAAe;AAAA,UACf,QAAO;AAAA,UACP,OAAOnC,EAAE,kBAAkB;AAAA,UAC3B,aAAaA,EAAE,wBAAwB;AAAA,UACvC,KAAK;AAAA,QAAA;AAAA,MAAA;AAAA,MAEP,gBAAA4B;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,gBAAe;AAAA,UACf,QAAO;AAAA,UACP,OAAOnC,EAAE,gBAAgB;AAAA,UACzB,KAAK;AAAA,UACL,aAAaA,EAAE,sBAAsB;AAAA,QAAA;AAAA,MAAA;AAAA,IACvC,GACF;AAAA,sBAEDoC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAR,EAAC1B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASwB,GAC7C,UAAA1B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA4B,EAAC1B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAoCV,EAAnCL,IAAqC,gBAAvB,iBAAoC,EAAA,CACtD;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"CustomDeductionForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { NumberInputField, TextInputField, RadioGroupField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n times: z.number().nullable(),\n recurring: z.boolean(),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n totalAmount: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.boolean(),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n onCancel: () => void\n}\n\nfunction CustomDeductionForm({ deduction, employeeId, onCancel }: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation()\n const isPending = isPendingCreate || isPendingUpdate\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n description: deduction?.description ?? '',\n times: deduction?.times ?? null,\n recurring: deduction?.recurring ?? true,\n annualMaximum: deduction?.annualMaximum ? Number(deduction.annualMaximum) : null,\n totalAmount: deduction?.totalAmount ? Number(deduction.totalAmount) : null,\n deductAsPercentage: deduction?.deductAsPercentage ?? true,\n active: true,\n } as DeductionInputs\n }, [deduction])\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n const { control } = formMethods\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedAmountPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n const onSubmit: SubmitHandler<DeductionPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, courtOrdered: false, times: payload.recurring ? null : 1 }, // custom deductions cannot be court ordered/garnishment\n },\n })\n\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: deduction.uuid,\n requestBody: {\n ...payload,\n version: deduction.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n return (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <>\n <Components.Heading as=\"h3\">{t('customDeductionTitle')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField name=\"description\" label={t('descriptionLabelV2')} isRequired />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n isRequired\n options={[\n { value: true, label: t('frequencyRecurringOptionV2') },\n { value: false, label: t('frequencyOneTimeOptionV2') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabelV2')}\n isRequired\n options={[\n { value: true, label: t('deductionTypePercentageOptionV2') },\n { value: false, label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <NumberInputField\n name=\"amount\"\n adornmentStart={!watchedAmountPercentage && '$'}\n adornmentEnd={watchedAmountPercentage && '%'}\n label={t('deductionAmountLabel')}\n isRequired\n min={0}\n format={watchedAmountPercentage ? 'percent' : 'currency'}\n description={\n watchedAmountPercentage\n ? t('deductionAmountDescriptionPercentage')\n : t('deductionAmountDescriptionFixed')\n }\n />\n </Flex>\n {watchedRecurring && (\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"totalAmount\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('totalAmountLabel')}\n description={t('totalAmountDescription')}\n min={0}\n />\n <NumberInputField\n name=\"annualMaximum\"\n adornmentStart=\"$\"\n format=\"currency\"\n label={t('annualMaxLabel')}\n min={0}\n description={t('annualMaxDescription')}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n </>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default CustomDeductionForm\n"],"names":["DeductionSchema","z","val","CustomDeductionForm","deduction","employeeId","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultValues","useMemo","formMethods","useForm","zodResolver","control","watchedRecurring","useWatch","watchedAmountPercentage","onSubmit","data","payload","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","FormProvider","jsx","Form","Flex","jsxs","Fragment","TextInputField","RadioGroupField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,MAAMA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAA;AAAA,EACV,QAAQA,EA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ACf,QAAO;AAAA,YACP,OAAOnC,EAAE,kBAAkB;AAAA,YAC3B,aAAaA,EAAE,wBAAwB;AAAA,YACvC,KAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEP,gBAAA4B;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,gBAAe;AAAA,YACf,QAAO;AAAA,YACP,OAAOnC,EAAE,gBAAgB;AAAA,YACzB,KAAK;AAAA,YACL,aAAaA,EAAE,sBAAsB;AAAA,UAAA;AAAA,QAAA;AAAA,MACvC,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCoC,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAR,EAAC1B,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASwB,GAC7C,UAAA1B,EAAE,WAAW,EAAA,CAChB;AAAA,MACA,gBAAA4B,EAAC1B,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWQ,GACzC,UAAAV,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -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,I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AAW;AAAA,UAAX;AAAA,YACC,OAAO,EAAE,iBAAiB;AAAA,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,iBAC3B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C,gBAAAzB;AAAA,UAACW,EAAW;AAAA,UAAX;AAAA,YACC,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;
|