@gusto/embedded-react-sdk 0.38.0-rc.1 → 0.38.0-rc.2
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/dist/UNSTABLE_Hooks.d.ts +1 -1
- package/dist/UNSTABLE_Hooks.js +64 -42
- package/dist/UNSTABLE_Hooks.js.map +1 -1
- package/dist/assets/icons/percent-circle.svg.js +10 -0
- package/dist/assets/icons/percent-circle.svg.js.map +1 -0
- package/dist/assets/icons/plus-circle.svg.js +1 -1
- package/dist/assets/icons/plus-circle.svg.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +5 -3
- package/dist/components/Common/DataView/DataCards/DataCards.js +59 -46
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js +9 -7
- package/dist/components/Common/DataView/DataCards/DataCards.module.scss.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +4 -3
- package/dist/components/Common/DataView/DataTable/DataTable.js +67 -57
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +4 -3
- package/dist/components/Common/DataView/DataView.js +24 -22
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +33 -6
- package/dist/components/Common/DataView/useDataView.js +23 -20
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DataView/useSelectionState.d.ts +5 -0
- package/dist/components/Common/DataView/useSelectionState.js +8 -0
- package/dist/components/Common/DataView/useSelectionState.js.map +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +3 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js +65 -71
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js +10 -6
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.module.scss.js.map +1 -1
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.d.ts +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js +2 -2
- package/dist/components/Common/Fields/hooks/useStringifyGenericFieldValue.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -7
- package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
- package/dist/components/Common/SignatureForm/SignatureFormFields.js +5 -4
- package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.d.ts +1 -1
- package/dist/components/Common/UI/Box/Box.js +9 -8
- package/dist/components/Common/UI/Box/Box.js.map +1 -1
- package/dist/components/Common/UI/Box/Box.module.scss.js +12 -8
- package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Box/BoxTypes.d.ts +2 -9
- package/dist/components/Common/UI/BoxHeader/BoxHeader.d.ts +2 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js +23 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js +8 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeader.module.scss.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.d.ts +10 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js +7 -0
- package/dist/components/Common/UI/BoxHeader/BoxHeaderTypes.js.map +1 -0
- package/dist/components/Common/UI/BoxHeader/index.d.ts +2 -0
- package/dist/components/Common/UI/Button/Button.module.scss.js +2 -2
- package/dist/components/Common/UI/Checkbox/Checkbox.js +60 -49
- package/dist/components/Common/UI/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js +10 -6
- package/dist/components/Common/UI/Checkbox/Checkbox.module.scss.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js +34 -36
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/Common/UI/DateRangePicker/DateRangePicker.module.scss.js +12 -12
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +19 -12
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +6 -4
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.d.ts +6 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js +4 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionListTypes.js.map +1 -1
- package/dist/components/Common/UI/Heading/Heading.module.scss.js +15 -15
- package/dist/components/Common/UI/Input/Input.js.map +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.d.ts +1 -1
- package/dist/components/Common/UI/RadioGroup/RadioGroupTypes.js.map +1 -1
- package/dist/components/Common/UI/Select/Select.js +22 -22
- package/dist/components/Common/UI/Select/Select.js.map +1 -1
- package/dist/components/Common/UI/Select/SelectTypes.d.ts +1 -1
- package/dist/components/Common/UI/Table/Table.js +12 -12
- 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/Table/TableTypes.d.ts +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js +3 -3
- package/dist/components/Common/UI/Table/TableTypes.js.map +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js +1 -1
- package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -1
- package/dist/components/Common/UI/TextInput/TextInput.js +13 -13
- package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
- 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 +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.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/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 +13 -13
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +1 -1
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +6 -5
- 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 +11 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.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/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.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 +88 -85
- 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 +21 -16
- package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
- package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +4 -5
- 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 +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +33 -33
- package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.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 +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +14 -14
- package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +2 -2
- 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/Form.js +4 -4
- package/dist/components/Contractor/Address/useAddress.js +6 -5
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +65 -65
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +80 -80
- package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +10 -10
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +69 -79
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +10 -12
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +45 -45
- package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +63 -63
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.module.scss.js +4 -4
- package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/Actions.js +1 -1
- package/dist/components/Employee/Compensation/Compensation.js +79 -76
- package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/List.js +6 -5
- package/dist/components/Employee/Compensation/List.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +107 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +5 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +146 -0
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +12 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +5 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js +25 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -0
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +7 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +51 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +22 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js +211 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/TaxesView.js +97 -0
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +3 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +8 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/index.d.ts +9 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +20 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +29 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +30 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +52 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +16 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +22 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +20 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +24 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -0
- package/dist/components/Employee/Dashboard/index.d.ts +14 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.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/EmploymentEligibility/EmploymentEligibility.js +22 -22
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +8 -8
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
- package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +2 -3
- package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/Actions.js +3 -2
- package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
- package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
- package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
- package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
- package/dist/components/Employee/PaymentMethod/Split.js +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 +7 -6
- package/dist/components/Employee/Profile/Actions.js.map +1 -1
- package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
- package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/useProfile.js +4 -3
- package/dist/components/Employee/Profile/useProfile.js.map +1 -1
- package/dist/components/Employee/StateTaxes/Actions.js +7 -6
- 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 +8 -7
- package/dist/components/Employee/Taxes/Actions.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- 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/Employee/index.d.ts +2 -0
- package/dist/components/Employee/index.js +28 -26
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -2
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +2 -2
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +16 -16
- package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +78 -77
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js +1 -1
- package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -2
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +72 -70
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +7 -9
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +18 -18
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +105 -115
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +16 -18
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +7 -7
- package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +13 -13
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/helpers.d.ts +1 -1
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +9 -8
- package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +12 -11
- package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +3 -2
- package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +8 -7
- package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +9 -8
- package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +13 -12
- package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/index.d.ts +0 -3
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js +8 -7
- package/dist/components/UNSTABLE_Hooks/form/resolveFieldError.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +7 -7
- package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +4 -4
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +20 -20
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js +172 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/PayScheduleForm.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.d.ts +23 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js +37 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.d.ts +55 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js +54 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/payScheduleSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.d.ts +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js +180 -0
- package/dist/components/UNSTABLE_Hooks/hooks/usePayScheduleForm/usePayScheduleForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js +69 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/SignCompanyForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js +14 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/index.d.ts +7 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.d.ts +25 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js +24 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/signCompanyFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.d.ts +57 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js +101 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignCompanyForm/useSignCompanyForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js +71 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.d.ts +5 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js +179 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/SignEmployeeI9Form.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.d.ts +53 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js +164 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/index.d.ts +9 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.d.ts +150 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js +152 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.d.ts +151 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js +172 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +1 -1
- package/dist/components/UNSTABLE_Hooks/index.d.ts +4 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +40 -79
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.js → HolidaySelectionForm/HolidaySelectionFormPresentation.js} +19 -19
- package/dist/components/UNSTABLE_TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectHolidays/SelectHolidaysTypes.d.ts → HolidaySelectionForm/HolidaySelectionFormTypes.d.ts} +4 -4
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.d.ts +3 -1
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +29 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.js → PolicyTypeSelector/PolicyTypeSelectorPresentation.js} +8 -8
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/PolicyTypeSelector/PolicyTypeSelectorTypes.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js +8 -8
- package/dist/components/UNSTABLE_TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.d.ts +8 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +71 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js +12 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.module.scss.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +206 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +20 -0
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/PolicyConfigurationForm/index.d.ts +6 -0
- package/dist/components/UNSTABLE_TimeOff/index.d.ts +4 -4
- package/dist/components/UNSTABLE_TimeOff/index.js +10 -10
- package/dist/components/UNSTABLE_TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +2 -0
- package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/EmployeeTableTypes.d.ts +3 -3
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.d.ts +30 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js +97 -0
- package/dist/components/UNSTABLE_TimeOff/shared/holidayHelpers.js.map +1 -0
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +52 -50
- package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
- package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +10 -0
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +28 -21
- package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +2 -0
- package/dist/contexts/ThemeProvider/theme.js +4 -2
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/helpers/buildQueryErrorHandling.d.ts +22 -0
- package/dist/helpers/buildQueryErrorHandling.js +11 -0
- package/dist/helpers/buildQueryErrorHandling.js.map +1 -0
- package/dist/helpers/dateFormatting.d.ts +2 -0
- package/dist/helpers/dateFormatting.js +38 -33
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/helpers/formattedStrings.js +40 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/i18n/I18n.js +9 -9
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +9 -9
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +18 -16
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +26 -0
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -0
- package/dist/i18n/en/Payroll.PayrollHistory.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollList.json.js +15 -15
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js +24 -0
- package/dist/i18n/en/UNSTABLE.PayScheduleForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js +20 -0
- package/dist/i18n/en/UNSTABLE.SignCompanyForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js +22 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeForm.json.js.map +1 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js +70 -0
- package/dist/i18n/en/UNSTABLE.SignEmployeeI9Form.json.js.map +1 -0
- package/dist/i18n/en/common.json.d.ts +3 -1
- package/dist/i18n/en/common.json.js +5 -5
- package/dist/shared/constants.d.ts +10 -0
- package/dist/shared/constants.js +15 -10
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +319 -10
- package/dist/types/sdkHooks.d.ts +1 -3
- package/docs/reference/endpoint-inventory.json +80 -2
- package/package.json +14 -14
- package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +0 -26
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +0 -3
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +0 -14
- package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +0 -1
- package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +0 -6
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.d.ts +0 -6
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js +0 -50
- package/dist/components/UNSTABLE_TimeOff/PolicyDetailsForm/PolicyDetailsForm.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.d.ts +0 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/SelectHolidaysPresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectHolidays/index.d.ts +0 -3
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.d.ts +0 -7
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.js +0 -27
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyType.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.d.ts +0 -2
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypePresentation.js.map +0 -1
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/SelectPolicyTypeTypes.d.ts +0 -6
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/SelectPolicyType/index.d.ts +0 -5
- package/dist/components/UNSTABLE_TimeOff/TimeOffManagement/shared/EmployeeTable/EmployeeTable.d.ts +0 -2
- package/dist/helpers/requiredIf.d.ts +0 -13
- /package/dist/components/UNSTABLE_TimeOff/{TimeOffManagement/shared → shared}/EmployeeTable/index.d.ts +0 -0
- /package/dist/components/{UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts → UNSTABLE_TimeOff/shared/holidayHelpers.test.d.ts} +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation as f } from "react-i18next";
|
|
3
|
+
import { Flex as o } from "../../Common/Flex/Flex.js";
|
|
4
|
+
import { useComponentContext as y } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
import { Loading as D } from "../../Common/Loading/Loading.js";
|
|
6
|
+
import F from "../../../hooks/useNumberFormatter.js";
|
|
7
|
+
function A({
|
|
8
|
+
federalTaxes: e,
|
|
9
|
+
stateTaxes: a,
|
|
10
|
+
isLoading: h = !1,
|
|
11
|
+
onEditFederalTaxes: s,
|
|
12
|
+
onEditStateTaxes: g
|
|
13
|
+
}) {
|
|
14
|
+
const { t: i } = f("Employee.Dashboard"), n = y(), p = F("currency");
|
|
15
|
+
if (h)
|
|
16
|
+
return /* @__PURE__ */ t(D, {});
|
|
17
|
+
const x = (l, r) => {
|
|
18
|
+
if (l.inputQuestionFormat.type === "Select" && l.inputQuestionFormat.options && l.inputQuestionFormat.options.length > 0) {
|
|
19
|
+
const u = l.inputQuestionFormat.options.find((d) => d.value === r);
|
|
20
|
+
if (u?.label)
|
|
21
|
+
return u.label;
|
|
22
|
+
}
|
|
23
|
+
if (typeof r == "number")
|
|
24
|
+
return l.inputQuestionFormat.type === "Currency" ? p(r) : r;
|
|
25
|
+
if (typeof r == "string" && !isNaN(parseFloat(r))) {
|
|
26
|
+
const u = parseFloat(r);
|
|
27
|
+
return l.inputQuestionFormat.type === "Currency" ? p(u) : r;
|
|
28
|
+
}
|
|
29
|
+
return typeof r == "boolean" ? i(r ? "common.yes" : "common.no") : r;
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ c(o, { flexDirection: "column", gap: 24, children: [
|
|
32
|
+
/* @__PURE__ */ t(
|
|
33
|
+
n.Box,
|
|
34
|
+
{
|
|
35
|
+
header: /* @__PURE__ */ t(
|
|
36
|
+
n.BoxHeader,
|
|
37
|
+
{
|
|
38
|
+
title: i("taxes.federal.title"),
|
|
39
|
+
action: /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: s, children: i("taxes.federal.editCta") })
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
children: /* @__PURE__ */ t(o, { flexDirection: "column", gap: 16, children: e && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 12, children: [
|
|
43
|
+
e.filingStatus && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
44
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.filingStatus") }),
|
|
45
|
+
/* @__PURE__ */ t(n.Text, { children: e.filingStatus })
|
|
46
|
+
] }),
|
|
47
|
+
"twoJobs" in e && e.twoJobs !== null && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
48
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.multipleJobs") }),
|
|
49
|
+
/* @__PURE__ */ t(n.Text, { children: e.twoJobs ? i("common.yes") : i("common.no") })
|
|
50
|
+
] }),
|
|
51
|
+
"dependentsAmount" in e && e.dependentsAmount && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
52
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.dependentsAndOtherCredits") }),
|
|
53
|
+
/* @__PURE__ */ t(n.Text, { children: p(parseFloat(e.dependentsAmount)) })
|
|
54
|
+
] }),
|
|
55
|
+
"otherIncome" in e && e.otherIncome && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
56
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.otherIncome") }),
|
|
57
|
+
/* @__PURE__ */ t(n.Text, { children: p(parseFloat(e.otherIncome)) })
|
|
58
|
+
] }),
|
|
59
|
+
"deductions" in e && e.deductions && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
60
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.deductions") }),
|
|
61
|
+
/* @__PURE__ */ t(n.Text, { children: p(parseFloat(e.deductions)) })
|
|
62
|
+
] }),
|
|
63
|
+
"extraWithholding" in e && e.extraWithholding && /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
64
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: i("taxes.federal.extraWithholding") }),
|
|
65
|
+
/* @__PURE__ */ t(n.Text, { children: p(parseFloat(e.extraWithholding)) })
|
|
66
|
+
] })
|
|
67
|
+
] }) })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
n.Box,
|
|
72
|
+
{
|
|
73
|
+
header: /* @__PURE__ */ t(
|
|
74
|
+
n.BoxHeader,
|
|
75
|
+
{
|
|
76
|
+
title: i("taxes.state.title"),
|
|
77
|
+
action: /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: g, children: i("taxes.state.editCta") })
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
children: /* @__PURE__ */ t(o, { flexDirection: "column", gap: 16, children: a && a.length > 0 ? /* @__PURE__ */ t(o, { flexDirection: "column", gap: 24, children: a.map((l, r) => /* @__PURE__ */ c(o, { flexDirection: "column", gap: 16, children: [
|
|
81
|
+
/* @__PURE__ */ t(n.Heading, { as: "h4", children: l.state }),
|
|
82
|
+
l.questions && l.questions.length > 0 && /* @__PURE__ */ t(o, { flexDirection: "column", gap: 12, children: l.questions.map((u, d) => {
|
|
83
|
+
const m = u.answers[0]?.value;
|
|
84
|
+
return m == null ? null : /* @__PURE__ */ c(o, { flexDirection: "column", gap: 0, children: [
|
|
85
|
+
/* @__PURE__ */ t(n.Text, { variant: "supporting", children: u.label }),
|
|
86
|
+
/* @__PURE__ */ t(n.Text, { children: x(u, m) })
|
|
87
|
+
] }, u.key || d);
|
|
88
|
+
}) })
|
|
89
|
+
] }, l.state || r)) }) : /* @__PURE__ */ t(n.Text, { children: i("taxes.state.noStateTaxes") }) })
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
A as TaxesView
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=TaxesView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaxesView.js","sources":["../../../../src/components/Employee/Dashboard/TaxesView.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { GetV1EmployeesEmployeeIdFederalTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidfederaltaxes'\nimport type { GetV1EmployeesEmployeeIdStateTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidstatetaxes'\nimport type { EmployeeStateTaxQuestion } from '@gusto/embedded-api/models/components/employeestatetaxquestion'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Loading } from '@/components/Common'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\ntype EmployeeFederalTax = NonNullable<\n GetV1EmployeesEmployeeIdFederalTaxesResponse['employeeFederalTax']\n>\ntype EmployeeStateTax = NonNullable<\n GetV1EmployeesEmployeeIdStateTaxesResponse['employeeStateTaxesList']\n>[number]\n\nexport interface TaxesViewProps {\n federalTaxes?: EmployeeFederalTax\n stateTaxes?: EmployeeStateTax[]\n isLoading?: boolean\n onEditFederalTaxes?: () => void\n onEditStateTaxes?: () => void\n}\n\nexport function TaxesView({\n federalTaxes,\n stateTaxes,\n isLoading = false,\n onEditFederalTaxes,\n onEditStateTaxes,\n}: TaxesViewProps) {\n const { t } = useTranslation('Employee.Dashboard')\n const Components = useComponentContext()\n const formatCurrency = useNumberFormatter('currency')\n\n if (isLoading) {\n return <Loading />\n }\n\n // Helper function to format state tax answer values\n const formatStateTaxAnswer = (\n question: EmployeeStateTaxQuestion,\n answer: string | number | boolean,\n ) => {\n // For Select type questions, look up the label from options\n if (\n question.inputQuestionFormat.type === 'Select' &&\n question.inputQuestionFormat.options &&\n question.inputQuestionFormat.options.length > 0\n ) {\n const option = question.inputQuestionFormat.options.find(opt => opt.value === answer)\n if (option?.label) {\n return option.label\n }\n }\n\n // For numeric values, only format as currency for Currency questions\n if (typeof answer === 'number') {\n if (question.inputQuestionFormat.type === 'Currency') {\n return formatCurrency(answer)\n }\n return answer\n }\n\n // For string currency values (like \"0.0\")\n if (typeof answer === 'string' && !isNaN(parseFloat(answer))) {\n const numValue = parseFloat(answer)\n // Check if this looks like a currency (has decimal point or question type is Currency)\n if (question.inputQuestionFormat.type === 'Currency') {\n return formatCurrency(numValue)\n }\n // For non-currency numeric strings, return as-is\n return answer\n }\n\n // For boolean values\n if (typeof answer === 'boolean') {\n return answer ? t('common.yes') : t('common.no')\n }\n\n // Default: return string value as-is\n return answer\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('taxes.federal.title')}\n action={\n <Components.Button variant=\"secondary\" onClick={onEditFederalTaxes}>\n {t('taxes.federal.editCta')}\n </Components.Button>\n }\n />\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {federalTaxes && (\n <Flex flexDirection=\"column\" gap={12}>\n {federalTaxes.filingStatus && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.filingStatus')}\n </Components.Text>\n <Components.Text>{federalTaxes.filingStatus}</Components.Text>\n </Flex>\n )}\n\n {'twoJobs' in federalTaxes && federalTaxes.twoJobs !== null && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.multipleJobs')}\n </Components.Text>\n <Components.Text>\n {federalTaxes.twoJobs ? t('common.yes') : t('common.no')}\n </Components.Text>\n </Flex>\n )}\n\n {'dependentsAmount' in federalTaxes && federalTaxes.dependentsAmount && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.dependentsAndOtherCredits')}\n </Components.Text>\n <Components.Text>\n {formatCurrency(parseFloat(federalTaxes.dependentsAmount))}\n </Components.Text>\n </Flex>\n )}\n\n {'otherIncome' in federalTaxes && federalTaxes.otherIncome && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.otherIncome')}\n </Components.Text>\n <Components.Text>\n {formatCurrency(parseFloat(federalTaxes.otherIncome))}\n </Components.Text>\n </Flex>\n )}\n\n {'deductions' in federalTaxes && federalTaxes.deductions && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.deductions')}\n </Components.Text>\n <Components.Text>\n {formatCurrency(parseFloat(federalTaxes.deductions))}\n </Components.Text>\n </Flex>\n )}\n\n {'extraWithholding' in federalTaxes && federalTaxes.extraWithholding && (\n <Flex flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">\n {t('taxes.federal.extraWithholding')}\n </Components.Text>\n <Components.Text>\n {formatCurrency(parseFloat(federalTaxes.extraWithholding))}\n </Components.Text>\n </Flex>\n )}\n </Flex>\n )}\n </Flex>\n </Components.Box>\n\n <Components.Box\n header={\n <Components.BoxHeader\n title={t('taxes.state.title')}\n action={\n <Components.Button variant=\"secondary\" onClick={onEditStateTaxes}>\n {t('taxes.state.editCta')}\n </Components.Button>\n }\n />\n }\n >\n <Flex flexDirection=\"column\" gap={16}>\n {stateTaxes && stateTaxes.length > 0 ? (\n <Flex flexDirection=\"column\" gap={24}>\n {stateTaxes.map((stateTax, index) => (\n <Flex key={stateTax.state || index} flexDirection=\"column\" gap={16}>\n <Components.Heading as=\"h4\">{stateTax.state}</Components.Heading>\n\n {stateTax.questions && stateTax.questions.length > 0 && (\n <Flex flexDirection=\"column\" gap={12}>\n {stateTax.questions.map((question, qIndex) => {\n const answer = question.answers[0]?.value\n if (answer === null || answer === undefined) return null\n\n return (\n <Flex key={question.key || qIndex} flexDirection=\"column\" gap={0}>\n <Components.Text variant=\"supporting\">{question.label}</Components.Text>\n <Components.Text>\n {formatStateTaxAnswer(question, answer)}\n </Components.Text>\n </Flex>\n )\n })}\n </Flex>\n )}\n </Flex>\n ))}\n </Flex>\n ) : (\n <Components.Text>{t('taxes.state.noStateTaxes')}</Components.Text>\n )}\n </Flex>\n </Components.Box>\n </Flex>\n )\n}\n"],"names":["TaxesView","federalTaxes","stateTaxes","isLoading","onEditFederalTaxes","onEditStateTaxes","t","useTranslation","Components","useComponentContext","formatCurrency","useNumberFormatter","Loading","formatStateTaxAnswer","question","answer","option","opt","numValue","jsxs","Flex","jsx","stateTax","index","qIndex"],"mappings":";;;;;;AAwBO,SAASA,EAAU;AAAA,EACxB,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,oBAAAC;AAAA,EACA,kBAAAC;AACF,GAAmB;AACjB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB,GAC3CC,IAAaC,EAAA,GACbC,IAAiBC,EAAmB,UAAU;AAEpD,MAAIR;AACF,6BAAQS,GAAA,EAAQ;AAIlB,QAAMC,IAAuB,CAC3BC,GACAC,MACG;AAEH,QACED,EAAS,oBAAoB,SAAS,YACtCA,EAAS,oBAAoB,WAC7BA,EAAS,oBAAoB,QAAQ,SAAS,GAC9C;AACA,YAAME,IAASF,EAAS,oBAAoB,QAAQ,KAAK,CAAAG,MAAOA,EAAI,UAAUF,CAAM;AACpF,UAAIC,GAAQ;AACV,eAAOA,EAAO;AAAA,IAElB;AAGA,QAAI,OAAOD,KAAW;AACpB,aAAID,EAAS,oBAAoB,SAAS,aACjCJ,EAAeK,CAAM,IAEvBA;AAIT,QAAI,OAAOA,KAAW,YAAY,CAAC,MAAM,WAAWA,CAAM,CAAC,GAAG;AAC5D,YAAMG,IAAW,WAAWH,CAAM;AAElC,a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
|
1
|
+
{"version":3,"file":"dashboardStateMachine.js","sources":["../../../../src/components/Employee/Dashboard/dashboardStateMachine.ts"],"sourcesContent":["import { state } from 'robot3'\nimport type { MachineTransition } from '@/types/Helpers'\n\nexport const dashboardStateMachine = {\n index: state<MachineTransition>(),\n}\n"],"names":["dashboardStateMachine","state"],"mappings":";AAGO,MAAMA,IAAwB;AAAA,EACnC,OAAOC,EAAA;AACT;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { useEmployeeBasicDetails } from './useEmployeeBasicDetails';
|
|
3
|
+
export type { UseEmployeeBasicDetailsProps, UseEmployeeBasicDetailsResult, } from './useEmployeeBasicDetails';
|
|
4
|
+
export { useEmployeeCompensation } from './useEmployeeCompensation';
|
|
5
|
+
export type { UseEmployeeCompensationProps, UseEmployeeCompensationResult, } from './useEmployeeCompensation';
|
|
6
|
+
export { useEmployeeTaxes } from './useEmployeeTaxes';
|
|
7
|
+
export type { UseEmployeeTaxesProps, UseEmployeeTaxesResult } from './useEmployeeTaxes';
|
|
8
|
+
export { useEmployeeForms } from './useEmployeeForms';
|
|
9
|
+
export type { UseEmployeeFormsProps, UseEmployeeFormsResult } from './useEmployeeForms';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Employee } from '@gusto/embedded-api/models/components/employee';
|
|
2
|
+
import { EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress';
|
|
3
|
+
import { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress';
|
|
4
|
+
import { HookLoadingResult, BaseHookReady } from '../../../../types/sdkHooks';
|
|
5
|
+
export interface UseEmployeeBasicDetailsProps {
|
|
6
|
+
employeeId: string;
|
|
7
|
+
}
|
|
8
|
+
interface UseEmployeeBasicDetailsReady extends Omit<BaseHookReady, 'data' | 'status'> {
|
|
9
|
+
data: {
|
|
10
|
+
employee: Employee;
|
|
11
|
+
currentHomeAddress?: EmployeeAddress;
|
|
12
|
+
currentWorkAddress?: EmployeeWorkAddress;
|
|
13
|
+
};
|
|
14
|
+
status: {
|
|
15
|
+
isPending: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type UseEmployeeBasicDetailsResult = HookLoadingResult | UseEmployeeBasicDetailsReady;
|
|
19
|
+
export declare function useEmployeeBasicDetails({ employeeId, }: UseEmployeeBasicDetailsProps): UseEmployeeBasicDetailsResult;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMemo as a } from "react";
|
|
2
|
+
import { useEmployeesGetSuspense as y } from "@gusto/embedded-api/react-query/employeesGet";
|
|
3
|
+
import { useEmployeeAddressesGetSuspense as f } from "@gusto/embedded-api/react-query/employeeAddressesGet";
|
|
4
|
+
import { useEmployeeAddressesGetWorkAddressesSuspense as A } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
5
|
+
import { buildQueryErrorHandling as g } from "../../../../helpers/buildQueryErrorHandling.js";
|
|
6
|
+
function h({
|
|
7
|
+
employeeId: e
|
|
8
|
+
}) {
|
|
9
|
+
const s = y({ employeeId: e }), r = f({ employeeId: e }), o = A({ employeeId: e }), n = s.data.employee, i = r.data.employeeAddressList, d = o.data.employeeWorkAddressesList, c = a(() => i?.find((t) => t.active), [i]), p = a(() => d?.find((t) => t.active), [d]), u = s.isFetching || r.isFetching || o.isFetching, l = !n && u, m = g([s, r, o]);
|
|
10
|
+
return l ? {
|
|
11
|
+
isLoading: !0,
|
|
12
|
+
errorHandling: m
|
|
13
|
+
} : {
|
|
14
|
+
isLoading: !1,
|
|
15
|
+
data: {
|
|
16
|
+
employee: n,
|
|
17
|
+
currentHomeAddress: c,
|
|
18
|
+
currentWorkAddress: p
|
|
19
|
+
},
|
|
20
|
+
status: {
|
|
21
|
+
isPending: u
|
|
22
|
+
},
|
|
23
|
+
errorHandling: m
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
h as useEmployeeBasicDetails
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useEmployeeBasicDetails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmployeeBasicDetails.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { buildQueryErrorHandling } from '@/helpers/buildQueryErrorHandling'\nimport type { HookLoadingResult, BaseHookReady } from '@/types/sdkHooks'\n\nexport interface UseEmployeeBasicDetailsProps {\n employeeId: string\n}\n\ninterface UseEmployeeBasicDetailsReady extends Omit<BaseHookReady, 'data' | 'status'> {\n data: {\n employee: Employee\n currentHomeAddress?: EmployeeAddress\n currentWorkAddress?: EmployeeWorkAddress\n }\n status: {\n isPending: boolean\n }\n}\n\nexport type UseEmployeeBasicDetailsResult = HookLoadingResult | UseEmployeeBasicDetailsReady\n\nexport function useEmployeeBasicDetails({\n employeeId,\n}: UseEmployeeBasicDetailsProps): UseEmployeeBasicDetailsResult {\n const employeeQuery = useEmployeesGetSuspense({ employeeId })\n const addressesQuery = useEmployeeAddressesGetSuspense({ employeeId })\n const workAddressesQuery = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n\n const employee = employeeQuery.data.employee\n const employeeAddressList = addressesQuery.data.employeeAddressList\n const employeeWorkAddressesList = workAddressesQuery.data.employeeWorkAddressesList\n\n // Derive current addresses\n const currentHomeAddress = useMemo(() => {\n return employeeAddressList?.find(address => address.active)\n }, [employeeAddressList])\n\n const currentWorkAddress = useMemo(() => {\n return employeeWorkAddressesList?.find(address => address.active)\n }, [employeeWorkAddressesList])\n\n const isPending =\n employeeQuery.isFetching || addressesQuery.isFetching || workAddressesQuery.isFetching\n const isLoading = !employee && isPending\n\n const errorHandling = buildQueryErrorHandling([employeeQuery, addressesQuery, workAddressesQuery])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n employee: employee!,\n currentHomeAddress,\n currentWorkAddress,\n },\n status: {\n isPending,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeBasicDetails","employeeId","employeeQuery","useEmployeesGetSuspense","addressesQuery","useEmployeeAddressesGetSuspense","workAddressesQuery","useEmployeeAddressesGetWorkAddressesSuspense","employee","employeeAddressList","employeeWorkAddressesList","currentHomeAddress","useMemo","address","currentWorkAddress","isPending","isLoading","errorHandling","buildQueryErrorHandling"],"mappings":";;;;;AA2BO,SAASA,EAAwB;AAAA,EACtC,YAAAC;AACF,GAAgE;AAC9D,QAAMC,IAAgBC,EAAwB,EAAE,YAAAF,GAAY,GACtDG,IAAiBC,EAAgC,EAAE,YAAAJ,GAAY,GAC/DK,IAAqBC,EAA6C,EAAE,YAAAN,GAAY,GAEhFO,IAAWN,EAAc,KAAK,UAC9BO,IAAsBL,EAAe,KAAK,qBAC1CM,IAA4BJ,EAAmB,KAAK,2BAGpDK,IAAqBC,EAAQ,MAC1BH,GAAqB,KAAK,CAAAI,MAAWA,EAAQ,MAAM,GACzD,CAACJ,CAAmB,CAAC,GAElBK,IAAqBF,EAAQ,MAC1BF,GAA2B,KAAK,CAAAG,MAAWA,EAAQ,MAAM,GAC/D,CAACH,CAAyB,CAAC,GAExBK,IACJb,EAAc,cAAcE,EAAe,cAAcE,EAAmB,YACxEU,IAAY,CAACR,KAAYO,GAEzBE,IAAgBC,EAAwB,CAAChB,GAAeE,GAAgBE,CAAkB,CAAC;AAEjG,SAAIU,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAAT;AAAA,MACA,oBAAAG;AAAA,MACA,oBAAAG;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAC;AAAA,IAAA;AAAA,IAEF,eAAAE;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Job } from '@gusto/embedded-api/models/components/job';
|
|
2
|
+
import { Garnishment } from '@gusto/embedded-api/models/components/garnishment';
|
|
3
|
+
import { GetV1EmployeesEmployeeIdPaymentMethodResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidpaymentmethod';
|
|
4
|
+
import { GetV1EmployeesEmployeeIdBankAccountsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidbankaccounts';
|
|
5
|
+
import { GetV1EmployeesEmployeeUuidPayStubsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeuuidpaystubs';
|
|
6
|
+
import { HookLoadingResult, BaseHookReady } from '../../../../types/sdkHooks';
|
|
7
|
+
import { PaginationControlProps } from '../../../Common/PaginationControl/PaginationControlTypes';
|
|
8
|
+
type EmployeeBankAccount = NonNullable<GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccountList']>[number];
|
|
9
|
+
type EmployeePayStub = NonNullable<GetV1EmployeesEmployeeUuidPayStubsResponse['employeePayStubsList']>[number];
|
|
10
|
+
export interface UseEmployeeCompensationProps {
|
|
11
|
+
employeeId: string;
|
|
12
|
+
}
|
|
13
|
+
interface UseEmployeeCompensationReady extends Omit<BaseHookReady, 'data' | 'status'> {
|
|
14
|
+
data: {
|
|
15
|
+
primaryJob?: Job;
|
|
16
|
+
employeePaymentMethod?: NonNullable<GetV1EmployeesEmployeeIdPaymentMethodResponse['employeePaymentMethod']>;
|
|
17
|
+
bankAccounts: EmployeeBankAccount[];
|
|
18
|
+
garnishmentList: Garnishment[];
|
|
19
|
+
payStubs: EmployeePayStub[];
|
|
20
|
+
};
|
|
21
|
+
status: {
|
|
22
|
+
isPending: boolean;
|
|
23
|
+
};
|
|
24
|
+
pagination: {
|
|
25
|
+
payStubs?: PaginationControlProps;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type UseEmployeeCompensationResult = HookLoadingResult | UseEmployeeCompensationReady;
|
|
29
|
+
export declare function useEmployeeCompensation({ employeeId, }: UseEmployeeCompensationProps): UseEmployeeCompensationResult;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo as m } from "react";
|
|
2
|
+
import { useEmployeesGetSuspense as F } from "@gusto/embedded-api/react-query/employeesGet";
|
|
3
|
+
import { useEmployeePaymentMethodGetSuspense as Q } from "@gusto/embedded-api/react-query/employeePaymentMethodGet";
|
|
4
|
+
import { useEmployeePaymentMethodsGetBankAccountsSuspense as k } from "@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts";
|
|
5
|
+
import { useGarnishmentsListSuspense as A } from "@gusto/embedded-api/react-query/garnishmentsList";
|
|
6
|
+
import { usePayrollsGetPayStubsSuspense as E } from "@gusto/embedded-api/react-query/payrollsGetPayStubs";
|
|
7
|
+
import { buildQueryErrorHandling as G } from "../../../../helpers/buildQueryErrorHandling.js";
|
|
8
|
+
import { usePagination as j } from "../../../../hooks/usePagination/usePagination.js";
|
|
9
|
+
function w({
|
|
10
|
+
employeeId: e
|
|
11
|
+
}) {
|
|
12
|
+
const { currentPage: h, itemsPerPage: d, getPaginationProps: p } = j({
|
|
13
|
+
defaultItemsPerPage: 10
|
|
14
|
+
}), s = F({ employeeId: e }), n = Q({ employeeId: e }), o = k({ employeeId: e }), a = A({ employeeId: e }), t = E({
|
|
15
|
+
employeeId: e,
|
|
16
|
+
page: h,
|
|
17
|
+
per: d
|
|
18
|
+
}), r = s.data.employee, P = n.data.employeePaymentMethod, c = o.data, l = a.data.garnishmentList, i = t.data, b = m(() => r?.jobs?.find((u) => u.primary === !0), [r?.jobs]), f = m(() => c.employeeBankAccountList || [], [c]), S = i.employeePayStubsList || [], L = m(() => {
|
|
19
|
+
const u = i.httpMeta.response.headers;
|
|
20
|
+
return p(u, t.isFetching);
|
|
21
|
+
}, [i.httpMeta.response.headers, t.isFetching, p]), y = s.isFetching || n.isFetching || o.isFetching || a.isFetching || t.isFetching, M = !r && y, g = G([
|
|
22
|
+
s,
|
|
23
|
+
n,
|
|
24
|
+
o,
|
|
25
|
+
a,
|
|
26
|
+
t
|
|
27
|
+
]);
|
|
28
|
+
return M ? {
|
|
29
|
+
isLoading: !0,
|
|
30
|
+
errorHandling: g
|
|
31
|
+
} : {
|
|
32
|
+
isLoading: !1,
|
|
33
|
+
data: {
|
|
34
|
+
primaryJob: b,
|
|
35
|
+
employeePaymentMethod: P || void 0,
|
|
36
|
+
bankAccounts: f,
|
|
37
|
+
garnishmentList: l || [],
|
|
38
|
+
payStubs: S
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
isPending: y
|
|
42
|
+
},
|
|
43
|
+
pagination: {
|
|
44
|
+
payStubs: L
|
|
45
|
+
},
|
|
46
|
+
errorHandling: g
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
w as useEmployeeCompensation
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=useEmployeeCompensation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmployeeCompensation.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeCompensation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeePaymentMethodGetSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodGet'\nimport { useEmployeePaymentMethodsGetBankAccountsSuspense } from '@gusto/embedded-api/react-query/employeePaymentMethodsGetBankAccounts'\nimport { useGarnishmentsListSuspense } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { usePayrollsGetPayStubsSuspense } from '@gusto/embedded-api/react-query/payrollsGetPayStubs'\nimport type { Job } from '@gusto/embedded-api/models/components/job'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport type { GetV1EmployeesEmployeeIdPaymentMethodResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidpaymentmethod'\nimport type { GetV1EmployeesEmployeeIdBankAccountsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidbankaccounts'\nimport type { GetV1EmployeesEmployeeUuidPayStubsResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeuuidpaystubs'\nimport { buildQueryErrorHandling } from '@/helpers/buildQueryErrorHandling'\nimport { usePagination } from '@/hooks/usePagination/usePagination'\nimport type { HookLoadingResult, BaseHookReady } from '@/types/sdkHooks'\nimport type { PaginationControlProps } from '@/components/Common/PaginationControl/PaginationControlTypes'\n\n// Derive types from operations responses\ntype EmployeeBankAccount = NonNullable<\n GetV1EmployeesEmployeeIdBankAccountsResponse['employeeBankAccountList']\n>[number]\ntype EmployeePayStub = NonNullable<\n GetV1EmployeesEmployeeUuidPayStubsResponse['employeePayStubsList']\n>[number]\n\nexport interface UseEmployeeCompensationProps {\n employeeId: string\n}\n\ninterface UseEmployeeCompensationReady extends Omit<BaseHookReady, 'data' | 'status'> {\n data: {\n primaryJob?: Job\n employeePaymentMethod?: NonNullable<\n GetV1EmployeesEmployeeIdPaymentMethodResponse['employeePaymentMethod']\n >\n bankAccounts: EmployeeBankAccount[]\n garnishmentList: Garnishment[]\n payStubs: EmployeePayStub[]\n }\n status: {\n isPending: boolean\n }\n pagination: {\n payStubs?: PaginationControlProps\n }\n}\n\nexport type UseEmployeeCompensationResult = HookLoadingResult | UseEmployeeCompensationReady\n\nexport function useEmployeeCompensation({\n employeeId,\n}: UseEmployeeCompensationProps): UseEmployeeCompensationResult {\n const { currentPage, itemsPerPage, getPaginationProps } = usePagination({\n defaultItemsPerPage: 10,\n })\n\n const employeeQuery = useEmployeesGetSuspense({ employeeId })\n const paymentMethodQuery = useEmployeePaymentMethodGetSuspense({ employeeId })\n const bankAccountsQuery = useEmployeePaymentMethodsGetBankAccountsSuspense({ employeeId })\n const garnishmentsQuery = useGarnishmentsListSuspense({ employeeId })\n const payStubsQuery = usePayrollsGetPayStubsSuspense({\n employeeId,\n page: currentPage,\n per: itemsPerPage,\n })\n\n const employee = employeeQuery.data.employee\n const employeePaymentMethod = paymentMethodQuery.data.employeePaymentMethod\n const bankAccountsData = bankAccountsQuery.data\n const garnishmentList = garnishmentsQuery.data.garnishmentList\n const payStubsData = payStubsQuery.data\n\n // Derive primary job\n const primaryJob = useMemo(() => {\n return employee?.jobs?.find(job => job.primary === true)\n }, [employee?.jobs])\n\n // Derive bank accounts\n const bankAccounts = useMemo(() => {\n return bankAccountsData.employeeBankAccountList || []\n }, [bankAccountsData])\n\n // Extract paystubs from response\n const payStubs = payStubsData.employeePayStubsList || []\n\n // Extract pagination from API response headers\n const payStubsPagination = useMemo(() => {\n const headers = payStubsData.httpMeta.response.headers\n return getPaginationProps(headers, payStubsQuery.isFetching)\n }, [payStubsData.httpMeta.response.headers, payStubsQuery.isFetching, getPaginationProps])\n\n const isPending =\n employeeQuery.isFetching ||\n paymentMethodQuery.isFetching ||\n bankAccountsQuery.isFetching ||\n garnishmentsQuery.isFetching ||\n payStubsQuery.isFetching\n\n const isLoading = !employee && isPending\n\n const errorHandling = buildQueryErrorHandling([\n employeeQuery,\n paymentMethodQuery,\n bankAccountsQuery,\n garnishmentsQuery,\n payStubsQuery,\n ])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n primaryJob,\n employeePaymentMethod: employeePaymentMethod || undefined,\n bankAccounts,\n garnishmentList: garnishmentList || [],\n payStubs,\n },\n status: {\n isPending,\n },\n pagination: {\n payStubs: payStubsPagination,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeCompensation","employeeId","currentPage","itemsPerPage","getPaginationProps","usePagination","employeeQuery","useEmployeesGetSuspense","paymentMethodQuery","useEmployeePaymentMethodGetSuspense","bankAccountsQuery","useEmployeePaymentMethodsGetBankAccountsSuspense","garnishmentsQuery","useGarnishmentsListSuspense","payStubsQuery","usePayrollsGetPayStubsSuspense","employee","employeePaymentMethod","bankAccountsData","garnishmentList","payStubsData","primaryJob","useMemo","job","bankAccounts","payStubs","payStubsPagination","headers","isPending","isLoading","errorHandling","buildQueryErrorHandling"],"mappings":";;;;;;;;AAgDO,SAASA,EAAwB;AAAA,EACtC,YAAAC;AACF,GAAgE;AAC9D,QAAM,EAAE,aAAAC,GAAa,cAAAC,GAAc,oBAAAC,EAAA,IAAuBC,EAAc;AAAA,IACtE,qBAAqB;AAAA,EAAA,CACtB,GAEKC,IAAgBC,EAAwB,EAAE,YAAAN,GAAY,GACtDO,IAAqBC,EAAoC,EAAE,YAAAR,GAAY,GACvES,IAAoBC,EAAiD,EAAE,YAAAV,GAAY,GACnFW,IAAoBC,EAA4B,EAAE,YAAAZ,GAAY,GAC9Da,IAAgBC,EAA+B;AAAA,IACnD,YAAAd;AAAA,IACA,MAAMC;AAAA,IACN,KAAKC;AAAA,EAAA,CACN,GAEKa,IAAWV,EAAc,KAAK,UAC9BW,IAAwBT,EAAmB,KAAK,uBAChDU,IAAmBR,EAAkB,MACrCS,IAAkBP,EAAkB,KAAK,iBACzCQ,IAAeN,EAAc,MAG7BO,IAAaC,EAAQ,MAClBN,GAAU,MAAM,KAAK,CAAAO,MAAOA,EAAI,YAAY,EAAI,GACtD,CAACP,GAAU,IAAI,CAAC,GAGbQ,IAAeF,EAAQ,MACpBJ,EAAiB,2BAA2B,CAAA,GAClD,CAACA,CAAgB,CAAC,GAGfO,IAAWL,EAAa,wBAAwB,CAAA,GAGhDM,IAAqBJ,EAAQ,MAAM;AACvC,UAAMK,IAAUP,EAAa,SAAS,SAAS;AAC/C,WAAOhB,EAAmBuB,GAASb,EAAc,UAAU;AAAA,EAC7D,GAAG,CAACM,EAAa,SAAS,SAAS,SAASN,EAAc,YAAYV,CAAkB,CAAC,GAEnFwB,IACJtB,EAAc,cACdE,EAAmB,cACnBE,EAAkB,cAClBE,EAAkB,cAClBE,EAAc,YAEVe,IAAY,CAACb,KAAYY,GAEzBE,IAAgBC,EAAwB;AAAA,IAC5CzB;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,IACAE;AAAA,EAAA,CACD;AAED,SAAIe,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,YAAAT;AAAA,MACA,uBAAuBJ,KAAyB;AAAA,MAChD,cAAAO;AAAA,MACA,iBAAiBL,KAAmB,CAAA;AAAA,MACpC,UAAAM;AAAA,IAAA;AAAA,IAEF,QAAQ;AAAA,MACN,WAAAG;AAAA,IAAA;AAAA,IAEF,YAAY;AAAA,MACV,UAAUF;AAAA,IAAA;AAAA,IAEZ,eAAAI;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Form } from '@gusto/embedded-api/models/components/form';
|
|
2
|
+
import { HookLoadingResult, BaseHookReady } from '../../../../types/sdkHooks';
|
|
3
|
+
export interface UseEmployeeFormsProps {
|
|
4
|
+
employeeId: string;
|
|
5
|
+
}
|
|
6
|
+
interface UseEmployeeFormsReady extends Omit<BaseHookReady, 'data' | 'status'> {
|
|
7
|
+
data: {
|
|
8
|
+
formList: Form[];
|
|
9
|
+
};
|
|
10
|
+
status: {
|
|
11
|
+
isPending: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type UseEmployeeFormsResult = HookLoadingResult | UseEmployeeFormsReady;
|
|
15
|
+
export declare function useEmployeeForms({ employeeId }: UseEmployeeFormsProps): UseEmployeeFormsResult;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEmployeeFormsListSuspense as e } from "@gusto/embedded-api/react-query/employeeFormsList";
|
|
2
|
+
import { buildQueryErrorHandling as m } from "../../../../helpers/buildQueryErrorHandling.js";
|
|
3
|
+
function d({ employeeId: t }) {
|
|
4
|
+
const o = e({ employeeId: t }), r = o.data.formList, s = o.isFetching, n = !r && s, i = m([o]);
|
|
5
|
+
return n ? {
|
|
6
|
+
isLoading: !0,
|
|
7
|
+
errorHandling: i
|
|
8
|
+
} : {
|
|
9
|
+
isLoading: !1,
|
|
10
|
+
data: {
|
|
11
|
+
formList: r || []
|
|
12
|
+
},
|
|
13
|
+
status: {
|
|
14
|
+
isPending: s
|
|
15
|
+
},
|
|
16
|
+
errorHandling: i
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
d as useEmployeeForms
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useEmployeeForms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmployeeForms.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeForms.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport type { Form } from '@gusto/embedded-api/models/components/form'\nimport { buildQueryErrorHandling } from '@/helpers/buildQueryErrorHandling'\nimport type { HookLoadingResult, BaseHookReady } from '@/types/sdkHooks'\n\nexport interface UseEmployeeFormsProps {\n employeeId: string\n}\n\ninterface UseEmployeeFormsReady extends Omit<BaseHookReady, 'data' | 'status'> {\n data: {\n formList: Form[]\n }\n status: {\n isPending: boolean\n }\n}\n\nexport type UseEmployeeFormsResult = HookLoadingResult | UseEmployeeFormsReady\n\nexport function useEmployeeForms({ employeeId }: UseEmployeeFormsProps): UseEmployeeFormsResult {\n const formsQuery = useEmployeeFormsListSuspense({ employeeId })\n\n const formList = formsQuery.data.formList\n\n const isPending = formsQuery.isFetching\n const isLoading = !formList && isPending\n\n const errorHandling = buildQueryErrorHandling([formsQuery])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n formList: formList || [],\n },\n status: {\n isPending,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeForms","employeeId","formsQuery","useEmployeeFormsListSuspense","formList","isPending","isLoading","errorHandling","buildQueryErrorHandling"],"mappings":";;AAoBO,SAASA,EAAiB,EAAE,YAAAC,KAA6D;AAC9F,QAAMC,IAAaC,EAA6B,EAAE,YAAAF,GAAY,GAExDG,IAAWF,EAAW,KAAK,UAE3BG,IAAYH,EAAW,YACvBI,IAAY,CAACF,KAAYC,GAEzBE,IAAgBC,EAAwB,CAACN,CAAU,CAAC;AAE1D,SAAII,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAUH,KAAY,CAAA;AAAA,IAAC;AAAA,IAEzB,QAAQ;AAAA,MACN,WAAAC;AAAA,IAAA;AAAA,IAEF,eAAAE;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GetV1EmployeesEmployeeIdFederalTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidfederaltaxes';
|
|
2
|
+
import { GetV1EmployeesEmployeeIdStateTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidstatetaxes';
|
|
3
|
+
import { HookLoadingResult, BaseHookReady } from '../../../../types/sdkHooks';
|
|
4
|
+
type EmployeeFederalTax = NonNullable<GetV1EmployeesEmployeeIdFederalTaxesResponse['employeeFederalTax']>;
|
|
5
|
+
type EmployeeStateTax = NonNullable<GetV1EmployeesEmployeeIdStateTaxesResponse['employeeStateTaxesList']>[number];
|
|
6
|
+
export interface UseEmployeeTaxesProps {
|
|
7
|
+
employeeId: string;
|
|
8
|
+
}
|
|
9
|
+
interface UseEmployeeTaxesReady extends Omit<BaseHookReady, 'data' | 'status'> {
|
|
10
|
+
data: {
|
|
11
|
+
employeeFederalTax?: EmployeeFederalTax;
|
|
12
|
+
employeeStateTaxesList: EmployeeStateTax[];
|
|
13
|
+
};
|
|
14
|
+
status: {
|
|
15
|
+
isPending: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type UseEmployeeTaxesResult = HookLoadingResult | UseEmployeeTaxesReady;
|
|
19
|
+
export declare function useEmployeeTaxes({ employeeId }: UseEmployeeTaxesProps): UseEmployeeTaxesResult;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEmployeeTaxSetupGetFederalTaxesSuspense as u } from "@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes";
|
|
2
|
+
import { useEmployeeTaxSetupGetStateTaxesSuspense as l } from "@gusto/embedded-api/react-query/employeeTaxSetupGetStateTaxes";
|
|
3
|
+
import { buildQueryErrorHandling as p } from "../../../../helpers/buildQueryErrorHandling.js";
|
|
4
|
+
function y({ employeeId: s }) {
|
|
5
|
+
const e = u({ employeeUuid: s }), t = l({ employeeUuid: s }), a = e.data.employeeFederalTax, r = t.data.employeeStateTaxesList, o = e.isFetching || t.isFetching, n = !a && o, i = p([e, t]);
|
|
6
|
+
return n ? {
|
|
7
|
+
isLoading: !0,
|
|
8
|
+
errorHandling: i
|
|
9
|
+
} : {
|
|
10
|
+
isLoading: !1,
|
|
11
|
+
data: {
|
|
12
|
+
employeeFederalTax: a,
|
|
13
|
+
employeeStateTaxesList: r || []
|
|
14
|
+
},
|
|
15
|
+
status: {
|
|
16
|
+
isPending: o
|
|
17
|
+
},
|
|
18
|
+
errorHandling: i
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
y as useEmployeeTaxes
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useEmployeeTaxes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmployeeTaxes.js","sources":["../../../../../src/components/Employee/Dashboard/hooks/useEmployeeTaxes.tsx"],"sourcesContent":["import { useEmployeeTaxSetupGetFederalTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetFederalTaxes'\nimport { useEmployeeTaxSetupGetStateTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetStateTaxes'\nimport type { GetV1EmployeesEmployeeIdFederalTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidfederaltaxes'\nimport type { GetV1EmployeesEmployeeIdStateTaxesResponse } from '@gusto/embedded-api/models/operations/getv1employeesemployeeidstatetaxes'\nimport { buildQueryErrorHandling } from '@/helpers/buildQueryErrorHandling'\nimport type { HookLoadingResult, BaseHookReady } from '@/types/sdkHooks'\n\n// Derive types from operations responses\ntype EmployeeFederalTax = NonNullable<\n GetV1EmployeesEmployeeIdFederalTaxesResponse['employeeFederalTax']\n>\ntype EmployeeStateTax = NonNullable<\n GetV1EmployeesEmployeeIdStateTaxesResponse['employeeStateTaxesList']\n>[number]\n\nexport interface UseEmployeeTaxesProps {\n employeeId: string\n}\n\ninterface UseEmployeeTaxesReady extends Omit<BaseHookReady, 'data' | 'status'> {\n data: {\n employeeFederalTax?: EmployeeFederalTax\n employeeStateTaxesList: EmployeeStateTax[]\n }\n status: {\n isPending: boolean\n }\n}\n\nexport type UseEmployeeTaxesResult = HookLoadingResult | UseEmployeeTaxesReady\n\nexport function useEmployeeTaxes({ employeeId }: UseEmployeeTaxesProps): UseEmployeeTaxesResult {\n const federalTaxesQuery = useEmployeeTaxSetupGetFederalTaxesSuspense({ employeeUuid: employeeId })\n const stateTaxesQuery = useEmployeeTaxSetupGetStateTaxesSuspense({ employeeUuid: employeeId })\n\n const employeeFederalTax = federalTaxesQuery.data.employeeFederalTax\n const employeeStateTaxesList = stateTaxesQuery.data.employeeStateTaxesList\n\n const isPending = federalTaxesQuery.isFetching || stateTaxesQuery.isFetching\n const isLoading = !employeeFederalTax && isPending\n\n const errorHandling = buildQueryErrorHandling([federalTaxesQuery, stateTaxesQuery])\n\n if (isLoading) {\n return {\n isLoading: true,\n errorHandling,\n }\n }\n\n return {\n isLoading: false,\n data: {\n employeeFederalTax,\n employeeStateTaxesList: employeeStateTaxesList || [],\n },\n status: {\n isPending,\n },\n errorHandling,\n }\n}\n"],"names":["useEmployeeTaxes","employeeId","federalTaxesQuery","useEmployeeTaxSetupGetFederalTaxesSuspense","stateTaxesQuery","useEmployeeTaxSetupGetStateTaxesSuspense","employeeFederalTax","employeeStateTaxesList","isPending","isLoading","errorHandling","buildQueryErrorHandling"],"mappings":";;;AA+BO,SAASA,EAAiB,EAAE,YAAAC,KAA6D;AAC9F,QAAMC,IAAoBC,EAA2C,EAAE,cAAcF,GAAY,GAC3FG,IAAkBC,EAAyC,EAAE,cAAcJ,GAAY,GAEvFK,IAAqBJ,EAAkB,KAAK,oBAC5CK,IAAyBH,EAAgB,KAAK,wBAE9CI,IAAYN,EAAkB,cAAcE,EAAgB,YAC5DK,IAAY,CAACH,KAAsBE,GAEnCE,IAAgBC,EAAwB,CAACT,GAAmBE,CAAe,CAAC;AAElF,SAAIK,IACK;AAAA,IACL,WAAW;AAAA,IACX,eAAAC;AAAA,EAAA,IAIG;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,oBAAAJ;AAAA,MACA,wBAAwBC,KAA0B,CAAA;AAAA,IAAC;AAAA,IAErD,QAAQ;AAAA,MACN,WAAAC;AAAA,IAAA;AAAA,IAEF,eAAAE;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./types/i18next.d.ts"
|
|
2
|
+
export { DashboardFlow } from './DashboardFlow';
|
|
3
|
+
export type { DashboardFlowProps } from './DashboardFlow';
|
|
4
|
+
export { Dashboard } from './Dashboard';
|
|
5
|
+
export type { DashboardProps } from './Dashboard';
|
|
6
|
+
export * from './hooks';
|
|
7
|
+
export { BasicDetailsView } from './BasicDetailsView';
|
|
8
|
+
export type { BasicDetailsViewProps } from './BasicDetailsView';
|
|
9
|
+
export { JobAndPayView } from './JobAndPayView';
|
|
10
|
+
export type { JobAndPayViewProps } from './JobAndPayView';
|
|
11
|
+
export { TaxesView } from './TaxesView';
|
|
12
|
+
export type { TaxesViewProps } from './TaxesView';
|
|
13
|
+
export { DocumentsView } from './DocumentsView';
|
|
14
|
+
export type { DocumentsViewProps } from './DocumentsView';
|
|
@@ -20,6 +20,7 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
20
20
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
21
21
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
22
22
|
import { componentEvents as M } from "../../../../shared/constants.js";
|
|
23
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
23
24
|
import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
|
|
24
25
|
import { TextInputField as te } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
25
26
|
import { NumberInputField as D } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
@@ -33,7 +34,7 @@ const ne = 0, oe = 0, ie = 100, _ = "Number must be greater than or equal to 0",
|
|
|
33
34
|
payPeriodMaximum: o.number().min(0, { error: _ }).transform((r) => r > 0 ? r.toString() : null).nullable(),
|
|
34
35
|
paymentPeriod: me
|
|
35
36
|
});
|
|
36
|
-
function
|
|
37
|
+
function Oe({
|
|
37
38
|
deduction: r,
|
|
38
39
|
handleStateAgencySelect: A,
|
|
39
40
|
stateAgencies: R,
|
|
@@ -228,6 +229,6 @@ function Ie({
|
|
|
228
229
|
] }) }) });
|
|
229
230
|
}
|
|
230
231
|
export {
|
|
231
|
-
|
|
232
|
+
Oe as default
|
|
232
233
|
};
|
|
233
234
|
//# sourceMappingURL=ChildSupportForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildSupportForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/ChildSupportForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\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 { type Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\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, SelectField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst MINIMUM_PAY_PERIOD_AMOUNT = 0\nconst MINIMUM_PAYCHECK_PERCENTAGE = 0\nconst MAXIMUM_PAYCHECK_PERCENTAGE = 100\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nconst ChildSupportPaymentPeriodSchema = z.enum(PaymentPeriod)\n\nconst ChildSupportSchema = z.object({\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string().nullable(),\n orderNumber: z.string().nullable(),\n remittanceNumber: z.string().nullable(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n payPeriodMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n paymentPeriod: ChildSupportPaymentPeriodSchema,\n})\n\nexport type ChildSupportInputs = z.input<typeof ChildSupportSchema>\nexport type ChildSupportPayload = z.output<typeof ChildSupportSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n handleStateAgencySelect: (stateAgency: string) => void\n stateAgencies: { label: string; value: string }[]\n counties: { label: string; value: string }[]\n singleAllCountiesFipsCode: string | null | undefined\n selectedAgency?: Agencies\n onCancel: () => void\n}\n\nfunction ChildSupportForm({\n deduction,\n handleStateAgencySelect,\n stateAgencies,\n counties,\n singleAllCountiesFipsCode,\n employeeId,\n selectedAgency,\n onCancel,\n}: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER = {\n case_number: {\n name: 'caseNumber',\n description: t('caseNumberDescription'),\n },\n order_number: {\n name: 'orderNumber',\n description: t('orderNumberDescription'),\n },\n remittance_number: {\n name: 'remittanceNumber',\n description: t('remittanceNumberDescription'),\n },\n } as const\n\n const requiredSelectedAgencyAttributes =\n selectedAgency?.requiredAttributes\n ?.map(attr => {\n if (!attr.key) {\n return null\n }\n if (!Object.prototype.hasOwnProperty.call(ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER, attr.key)) {\n return null\n }\n const key = attr.key as keyof typeof ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER\n const mappedAttr = ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[key]\n return {\n name: mappedAttr.name,\n label: attr.label as string,\n description: mappedAttr.description,\n }\n })\n .filter((attr): attr is NonNullable<typeof attr> => attr !== null) || []\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 defaultChildSupportValues: ChildSupportInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n state: deduction?.childSupport?.state || '',\n fipsCode: deduction?.childSupport?.fipsCode || '',\n caseNumber: deduction?.childSupport?.caseNumber || null,\n orderNumber: deduction?.childSupport?.orderNumber || null,\n remittanceNumber: deduction?.childSupport?.remittanceNumber || null,\n paymentPeriod: deduction?.childSupport?.paymentPeriod as PaymentPeriod,\n }\n }, [deduction])\n\n const childSupportFormMethods = useForm<ChildSupportInputs, unknown, ChildSupportPayload>({\n resolver: zodResolver(ChildSupportSchema),\n defaultValues: defaultChildSupportValues,\n })\n const { reset: resetChildSupportForm, setValue, control } = childSupportFormMethods\n const watchedStateAgency = useWatch({ control, name: 'state' })\n\n useEffect(() => {\n resetChildSupportForm(defaultChildSupportValues)\n }, [deduction, defaultChildSupportValues, resetChildSupportForm])\n\n // if in edit mode and user elects to change state agency, reset the required attribute values\n // as new selected agency might require different payload inputs, e.g. OH requires case number + order number\n useEffect(() => {\n setValue('caseNumber', null)\n setValue('orderNumber', null)\n setValue('remittanceNumber', null)\n }, [watchedStateAgency, setValue])\n\n useEffect(() => {\n if (typeof singleAllCountiesFipsCode === 'string') {\n setValue('fipsCode', singleAllCountiesFipsCode)\n }\n }, [singleAllCountiesFipsCode, setValue])\n\n const onChildSupportSubmit: SubmitHandler<ChildSupportPayload> = async data => {\n const childSupport = {\n state: data.state,\n paymentPeriod: data.paymentPeriod,\n fipsCode: data.fipsCode,\n caseNumber: data.caseNumber,\n orderNumber: data.orderNumber,\n remittanceNumber: data.remittanceNumber,\n }\n\n await baseSubmitHandler(data, async payload => {\n const requestBody = {\n active: true,\n amount: payload.amount,\n description: `Child Support - ${childSupport.caseNumber}`, // child support description follows prefix type + case number convention\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true, // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled\n payPeriodMaximum: payload.payPeriodMaximum,\n recurring: true,\n childSupport,\n }\n\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId,\n requestBody,\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 ...requestBody,\n version: deduction.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n const isManualPaymentRequired = selectedAgency?.manualPaymentRequired\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n return (\n <FormProvider {...childSupportFormMethods}>\n <Form onSubmit={childSupportFormMethods.handleSubmit(onChildSupportSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('childSupportTitle')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <SelectField\n name=\"state\"\n label={t('agency')}\n description={t('agencyDescription')}\n options={stateAgencies}\n onChange={handleStateAgencySelect}\n isRequired\n />\n\n {isManualPaymentRequired && (\n <Components.Alert status=\"warning\" label={t('manualPaymentRequired')} />\n )}\n\n {watchedStateAgency && (\n <Flex flexDirection=\"column\" gap={20}>\n {hasSelectableCounties && (\n <SelectField\n name=\"fipsCode\"\n label={t('county')}\n description={t('countyDescription')}\n options={counties}\n isRequired\n />\n )}\n {/* render required inputs for respective agency, e.g. OH requires case number + order number */}\n {requiredSelectedAgencyAttributes.map(({ name, label, description }) => (\n <TextInputField\n key={name}\n name={name}\n label={label}\n description={description}\n isRequired\n />\n ))}\n <NumberInputField\n name=\"payPeriodMaximum\"\n label={t('totalAmountWithheld')}\n description={t('totalAmountWithheldDescription')}\n min={MINIMUM_PAY_PERIOD_AMOUNT}\n adornmentStart=\"$\"\n isRequired\n />\n <NumberInputField\n name=\"amount\"\n label={t('maxPaycheckPercentage')}\n description={t('maxPaycheckPercentageDescription')}\n isRequired\n min={MINIMUM_PAYCHECK_PERCENTAGE}\n max={MAXIMUM_PAYCHECK_PERCENTAGE}\n adornmentEnd=\"%\"\n />\n <SelectField\n name=\"paymentPeriod\"\n label={t('per')}\n description={t('perDescription')}\n options={[\n {\n label: t('everyWeek'),\n value: 'Every week',\n },\n {\n label: t('everyOtherWeek'),\n value: 'Every other week',\n },\n {\n label: t('twicePerMonth'),\n value: 'Twice per month',\n },\n {\n label: t('monthly'),\n value: 'Monthly',\n },\n ]}\n isRequired\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n {watchedStateAgency && (\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default ChildSupportForm\n"],"names":["MINIMUM_PAY_PERIOD_AMOUNT","MINIMUM_PAYCHECK_PERCENTAGE","MAXIMUM_PAYCHECK_PERCENTAGE","NON_NEGATIVE_ERROR","ChildSupportPaymentPeriodSchema","z","PaymentPeriod","ChildSupportSchema","val","ChildSupportForm","deduction","handleStateAgencySelect","stateAgencies","counties","singleAllCountiesFipsCode","employeeId","selectedAgency","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER","requiredSelectedAgencyAttributes","attr","key","mappedAttr","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultChildSupportValues","useMemo","childSupportFormMethods","useForm","zodResolver","resetChildSupportForm","setValue","control","watchedStateAgency","useWatch","useEffect","onChildSupportSubmit","data","childSupport","payload","requestBody","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","isManualPaymentRequired","hasSelectableCounties","FormProvider","jsx","Form","jsxs","Flex","SelectField","name","label","description","TextInputField","NumberInputField","ActionsLayout"],"mappings":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X,EAAkB,MAAK,UAAS,WAAWa,GACzC,UAAAf,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ChildSupportForm.js","sources":["../../../../../src/components/Employee/Deductions/DeductionsForm/ChildSupportForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm, useWatch, type SubmitHandler } from 'react-hook-form'\nimport { useEffect, useMemo } from 'react'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { GarnishmentType } from '@gusto/embedded-api/models/operations/postv1employeesemployeeidgarnishments'\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 { type Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\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, SelectField } from '@/components/Common'\nimport { type CommonComponentInterface, useBase } from '@/components/Base'\nimport { componentEvents } from '@/shared/constants'\n\nconst MINIMUM_PAY_PERIOD_AMOUNT = 0\nconst MINIMUM_PAYCHECK_PERCENTAGE = 0\nconst MAXIMUM_PAYCHECK_PERCENTAGE = 100\n\nconst NON_NEGATIVE_ERROR = 'Number must be greater than or equal to 0'\n\nconst ChildSupportPaymentPeriodSchema = z.enum(PaymentPeriod)\n\nconst ChildSupportSchema = z.object({\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string().nullable(),\n orderNumber: z.string().nullable(),\n remittanceNumber: z.string().nullable(),\n amount: z.number().min(0, { error: NON_NEGATIVE_ERROR }).transform(String),\n payPeriodMaximum: z\n .number()\n .min(0, { error: NON_NEGATIVE_ERROR })\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n paymentPeriod: ChildSupportPaymentPeriodSchema,\n})\n\nexport type ChildSupportInputs = z.input<typeof ChildSupportSchema>\nexport type ChildSupportPayload = z.output<typeof ChildSupportSchema>\n\ninterface ChildSupportFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n deduction?: Garnishment | null\n handleStateAgencySelect: (stateAgency: string) => void\n stateAgencies: { label: string; value: string }[]\n counties: { label: string; value: string }[]\n singleAllCountiesFipsCode: string | null | undefined\n selectedAgency?: Agencies\n onCancel: () => void\n}\n\nfunction ChildSupportForm({\n deduction,\n handleStateAgencySelect,\n stateAgencies,\n counties,\n singleAllCountiesFipsCode,\n employeeId,\n selectedAgency,\n onCancel,\n}: ChildSupportFormProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER = {\n case_number: {\n name: 'caseNumber',\n description: t('caseNumberDescription'),\n },\n order_number: {\n name: 'orderNumber',\n description: t('orderNumberDescription'),\n },\n remittance_number: {\n name: 'remittanceNumber',\n description: t('remittanceNumberDescription'),\n },\n } as const\n\n const requiredSelectedAgencyAttributes =\n selectedAgency?.requiredAttributes\n ?.map(attr => {\n if (!attr.key) {\n return null\n }\n if (!Object.prototype.hasOwnProperty.call(ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER, attr.key)) {\n return null\n }\n const key = attr.key as keyof typeof ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER\n const mappedAttr = ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER[key]\n return {\n name: mappedAttr.name,\n label: attr.label as string,\n description: mappedAttr.description,\n }\n })\n .filter((attr): attr is NonNullable<typeof attr> => attr !== null) || []\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 defaultChildSupportValues: ChildSupportInputs = useMemo(() => {\n return {\n amount: deduction?.amount ? Number(deduction.amount) : 0,\n payPeriodMaximum: deduction?.payPeriodMaximum ? Number(deduction.payPeriodMaximum) : null,\n state: deduction?.childSupport?.state || '',\n fipsCode: deduction?.childSupport?.fipsCode || '',\n caseNumber: deduction?.childSupport?.caseNumber || null,\n orderNumber: deduction?.childSupport?.orderNumber || null,\n remittanceNumber: deduction?.childSupport?.remittanceNumber || null,\n paymentPeriod: deduction?.childSupport?.paymentPeriod as PaymentPeriod,\n }\n }, [deduction])\n\n const childSupportFormMethods = useForm<ChildSupportInputs, unknown, ChildSupportPayload>({\n resolver: zodResolver(ChildSupportSchema),\n defaultValues: defaultChildSupportValues,\n })\n const { reset: resetChildSupportForm, setValue, control } = childSupportFormMethods\n const watchedStateAgency = useWatch({ control, name: 'state' })\n\n useEffect(() => {\n resetChildSupportForm(defaultChildSupportValues)\n }, [deduction, defaultChildSupportValues, resetChildSupportForm])\n\n // if in edit mode and user elects to change state agency, reset the required attribute values\n // as new selected agency might require different payload inputs, e.g. OH requires case number + order number\n useEffect(() => {\n setValue('caseNumber', null)\n setValue('orderNumber', null)\n setValue('remittanceNumber', null)\n }, [watchedStateAgency, setValue])\n\n useEffect(() => {\n if (typeof singleAllCountiesFipsCode === 'string') {\n setValue('fipsCode', singleAllCountiesFipsCode)\n }\n }, [singleAllCountiesFipsCode, setValue])\n\n const onChildSupportSubmit: SubmitHandler<ChildSupportPayload> = async data => {\n const childSupport = {\n state: data.state,\n paymentPeriod: data.paymentPeriod,\n fipsCode: data.fipsCode,\n caseNumber: data.caseNumber,\n orderNumber: data.orderNumber,\n remittanceNumber: data.remittanceNumber,\n }\n\n await baseSubmitHandler(data, async payload => {\n const requestBody = {\n active: true,\n amount: payload.amount,\n description: `Child Support - ${childSupport.caseNumber}`, // child support description follows prefix type + case number convention\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true, // child support must always deduct as percentage up to a pay period maximum limit and is recurring until cancelled\n payPeriodMaximum: payload.payPeriodMaximum,\n recurring: true,\n childSupport,\n }\n\n if (!deduction) {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId,\n requestBody,\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 ...requestBody,\n version: deduction.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n }\n })\n }\n\n const handleCancel = () => {\n onCancel()\n }\n\n const isManualPaymentRequired = selectedAgency?.manualPaymentRequired\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n return (\n <FormProvider {...childSupportFormMethods}>\n <Form onSubmit={childSupportFormMethods.handleSubmit(onChildSupportSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{t('childSupportTitle')}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <SelectField\n name=\"state\"\n label={t('agency')}\n description={t('agencyDescription')}\n options={stateAgencies}\n onChange={handleStateAgencySelect}\n isRequired\n />\n\n {isManualPaymentRequired && (\n <Components.Alert status=\"warning\" label={t('manualPaymentRequired')} />\n )}\n\n {watchedStateAgency && (\n <Flex flexDirection=\"column\" gap={20}>\n {hasSelectableCounties && (\n <SelectField\n name=\"fipsCode\"\n label={t('county')}\n description={t('countyDescription')}\n options={counties}\n isRequired\n />\n )}\n {/* render required inputs for respective agency, e.g. OH requires case number + order number */}\n {requiredSelectedAgencyAttributes.map(({ name, label, description }) => (\n <TextInputField\n key={name}\n name={name}\n label={label}\n description={description}\n isRequired\n />\n ))}\n <NumberInputField\n name=\"payPeriodMaximum\"\n label={t('totalAmountWithheld')}\n description={t('totalAmountWithheldDescription')}\n min={MINIMUM_PAY_PERIOD_AMOUNT}\n adornmentStart=\"$\"\n isRequired\n />\n <NumberInputField\n name=\"amount\"\n label={t('maxPaycheckPercentage')}\n description={t('maxPaycheckPercentageDescription')}\n isRequired\n min={MINIMUM_PAYCHECK_PERCENTAGE}\n max={MAXIMUM_PAYCHECK_PERCENTAGE}\n adornmentEnd=\"%\"\n />\n <SelectField\n name=\"paymentPeriod\"\n label={t('per')}\n description={t('perDescription')}\n options={[\n {\n label: t('everyWeek'),\n value: 'Every week',\n },\n {\n label: t('everyOtherWeek'),\n value: 'Every other week',\n },\n {\n label: t('twicePerMonth'),\n value: 'Twice per month',\n },\n {\n label: t('monthly'),\n value: 'Monthly',\n },\n ]}\n isRequired\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n {watchedStateAgency && (\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('saveCta')}\n </Components.Button>\n )}\n </ActionsLayout>\n </Flex>\n </Form>\n </FormProvider>\n )\n}\n\nexport default ChildSupportForm\n"],"names":["MINIMUM_PAY_PERIOD_AMOUNT","MINIMUM_PAYCHECK_PERCENTAGE","MAXIMUM_PAYCHECK_PERCENTAGE","NON_NEGATIVE_ERROR","ChildSupportPaymentPeriodSchema","z","PaymentPeriod","ChildSupportSchema","val","ChildSupportForm","deduction","handleStateAgencySelect","stateAgencies","counties","singleAllCountiesFipsCode","employeeId","selectedAgency","onCancel","onEvent","baseSubmitHandler","useBase","t","useTranslation","Components","useComponentContext","ATTR_KEY_TO_TEXT_FIELD_NAME_MAPPER","requiredSelectedAgencyAttributes","attr","key","mappedAttr","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","isPending","defaultChildSupportValues","useMemo","childSupportFormMethods","useForm","zodResolver","resetChildSupportForm","setValue","control","watchedStateAgency","useWatch","useEffect","onChildSupportSubmit","data","childSupport","payload","requestBody","updateDeductionResponse","componentEvents","createDeductionResponse","handleCancel","isManualPaymentRequired","hasSelectableCounties","FormProvider","jsx","Form","jsxs","Flex","SelectField","name","label","description","TextInputField","NumberInputField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,KAA4B,GAC5BC,KAA8B,GAC9BC,KAA8B,KAE9BC,IAAqB,6CAErBC,KAAkCC,EAAE,KAAKC,CAAa,GAEtDC,KAAqBF,EAAE,OAAO;AAAA,EAClC,OAAOA,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,kBAAkBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC7B,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG,EAAE,OAAOF,EAAA,CAAoB,EAAE,UAAU,MAAM;AAAA,EACzE,kBAAkBE,EACf,SACA,IAAI,GAAG,EAAE,OAAOF,GAAoB,EACpC,UAAU,CAAAK,MAAQA,IAAM,IAAIA,EAAI,aAAa,IAAK,EAClD,SAAA;AAAA,EACH,eAAeJ;AACjB,CAAC;AAgBD,SAASK,GAAiB;AAAA,EACxB,WAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,YAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AACF,GAA0B;AACxB,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,GAAA,GACjC,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA,GAEbC,IAAqC;AAAA,IACzC,aAAa;AAAA,MACX,MAAM;AAAA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U;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,EAAA,CACF;AAAA,IAAA,GAEJ;AAAA,sBACCiD,IAAA,EACC,UAAA;AAAA,MAAA,gBAAAV,EAACrC,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASiC,GAC7C,UAAAnC,EAAE,WAAW,EAAA,CAChB;AAAA,MACCwB,KACC,gBAAAe,EAACrC,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWa,GACzC,UAAAf,EAAE,SAAS,EAAA,CACd;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -19,6 +19,7 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
|
19
19
|
import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
|
|
20
20
|
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
21
21
|
import { componentEvents as g } from "../../../../shared/constants.js";
|
|
22
|
+
import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
22
23
|
import { TextInputField as $ } from "../../../Common/Fields/TextInputField/TextInputField.js";
|
|
23
24
|
import { RadioGroupField as h } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
24
25
|
import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
@@ -32,7 +33,7 @@ const d = "Number must be greater than or equal to 0", z = r.object({
|
|
|
32
33
|
totalAmount: r.number().min(0, { error: d }).transform((e) => e > 0 ? e.toString() : null).nullable(),
|
|
33
34
|
deductAsPercentage: r.boolean()
|
|
34
35
|
});
|
|
35
|
-
function
|
|
36
|
+
function ge({ deduction: e, employeeId: A, onCancel: D }) {
|
|
36
37
|
const { onEvent: p, baseSubmitHandler: x } = j(), { t: n } = S("Employee.Deductions"), u = B(), { mutateAsync: E, isPending: P } = _(), { mutateAsync: y, isPending: R } = w(), v = P || R, C = V(() => ({
|
|
37
38
|
amount: e?.amount ? Number(e.amount) : 0,
|
|
38
39
|
description: e?.description ?? "",
|
|
@@ -149,6 +150,6 @@ function fe({ deduction: e, employeeId: A, onCancel: D }) {
|
|
|
149
150
|
}
|
|
150
151
|
export {
|
|
151
152
|
z as DeductionSchema,
|
|
152
|
-
|
|
153
|
+
ge as default
|
|
153
154
|
};
|
|
154
155
|
//# sourceMappingURL=CustomDeductionForm.js.map
|