@gusto/embedded-react-sdk 0.47.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -0
- package/dist/components/Common/ActionsLayout/ActionsLayout.d.ts +1 -0
- package/dist/components/Common/ActionsLayout/ActionsLayout.js.map +1 -1
- package/dist/components/Common/Alert/Alert.d.ts +2 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -0
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -0
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataView.d.ts +2 -0
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +4 -0
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DataView/useSelectionState.d.ts +1 -0
- package/dist/components/Common/DataView/useSelectionState.js.map +1 -1
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.d.ts +1 -0
- package/dist/components/Common/DateRangeFilter/DateRangeFilter.js.map +1 -1
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.d.ts +1 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
- package/dist/components/Common/DetailViewLayout/DetailViewLayoutTypes.d.ts +1 -0
- package/dist/components/Common/DocumentList/DocumentList.d.ts +6 -0
- package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.d.ts +1 -0
- package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -0
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/FadeIn/FadeIn.d.ts +1 -0
- package/dist/components/Common/FadeIn/FadeIn.js.map +1 -1
- package/dist/components/Common/FieldCaption/FieldCaption.d.ts +8 -0
- package/dist/components/Common/FieldCaption/FieldCaption.js.map +1 -1
- package/dist/components/Common/FieldDescription/FieldDescription.d.ts +5 -0
- package/dist/components/Common/FieldDescription/FieldDescription.js.map +1 -1
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.d.ts +5 -0
- package/dist/components/Common/FieldErrorMessage/FieldErrorMessage.js.map +1 -1
- package/dist/components/Common/FieldLayout/FieldLayout.d.ts +5 -0
- package/dist/components/Common/FieldLayout/FieldLayout.js.map +1 -1
- package/dist/components/Common/FieldLayout/FieldLayoutTypes.d.ts +15 -0
- package/dist/components/Common/Fieldset/Fieldset.d.ts +2 -0
- package/dist/components/Common/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Common/Flex/Flex.d.ts +4 -0
- package/dist/components/Common/Flex/Flex.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.d.ts +20 -0
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
- package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes.d.ts +33 -7
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.d.ts +16 -0
- package/dist/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +2 -0
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/Grid/Grid.d.ts +2 -0
- package/dist/components/Common/Grid/Grid.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.d.ts +7 -0
- package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
- package/dist/components/Common/HamburgerMenu/HamburgerMenuTypes.d.ts +11 -0
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.d.ts +7 -0
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js.map +1 -1
- package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayoutTypes.d.ts +14 -0
- package/dist/components/Common/InlineSpinner/InlineSpinner.d.ts +1 -0
- package/dist/components/Common/InlineSpinner/InlineSpinner.js.map +1 -1
- package/dist/components/Common/InternalError/InternalError.d.ts +1 -0
- package/dist/components/Common/InternalError/InternalError.js.map +1 -1
- package/dist/components/Common/Loading/Loading.d.ts +2 -0
- package/dist/components/Common/Loading/Loading.js.map +1 -1
- package/dist/components/Common/OnboardingStatusBadge/index.d.ts +3 -0
- package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
- package/dist/components/Common/ReorderableList/DropZone.d.ts +1 -0
- package/dist/components/Common/ReorderableList/DropZone.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableItem.d.ts +1 -3
- package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableList.d.ts +1 -0
- package/dist/components/Common/ReorderableList/ReorderableList.js.map +1 -1
- package/dist/components/Common/ReorderableList/ReorderableListTypes.d.ts +4 -0
- package/dist/components/Common/ReorderableList/constants.d.ts +1 -3
- package/dist/components/Common/ReorderableList/constants.js.map +1 -1
- package/dist/components/Common/RequirementsList/RequirementsList.d.ts +1 -0
- package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
- package/dist/components/Common/TaxInputs/TaxInputs.d.ts +7 -0
- package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
- package/dist/components/Common/Toast/Toast.d.ts +1 -0
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +2 -0
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatory.js +10 -7
- package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +16 -15
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +9 -8
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +8 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +21 -20
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/TitleSelect.js +4 -2
- package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
- package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +3 -2
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
- package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +14 -11
- package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +8 -7
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Actions.js +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +10 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +5 -5
- package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +1 -1
- package/dist/components/Company/Industry/Context.js +6 -8
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +6 -5
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +8 -6
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +1 -1
- package/dist/components/Company/Locations/LocationForm/Form.js +6 -4
- package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/LocationForm.js +17 -14
- package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +11 -12
- package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -9
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
- package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js +9 -8
- package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +5 -2
- package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -5
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +8 -8
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/Address.js +5 -2
- package/dist/components/Contractor/Address/Address.js.map +1 -1
- package/dist/components/Contractor/Address/Form.js +8 -6
- package/dist/components/Contractor/Address/Form.js.map +1 -1
- package/dist/components/Contractor/Address/Head.js +5 -4
- package/dist/components/Contractor/Address/Head.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -7
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/ContractorList/index.js +4 -4
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +4 -2
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -2
- package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +10 -10
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +2 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +15 -15
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +4 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +6 -6
- package/dist/components/Contractor/Submit/Submit.js +3 -2
- package/dist/components/Contractor/Submit/Submit.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.d.ts +6 -0
- package/dist/components/Contractor/exports/contractorManagement.js +15 -0
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -0
- package/dist/components/Employee/Compensation/management/Compensation.d.ts +35 -0
- package/dist/components/Employee/Compensation/management/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.d.ts +23 -3
- package/dist/components/Employee/Compensation/management/CompensationAddAnotherJobForm/CompensationAddAnotherJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.d.ts +21 -10
- package/dist/components/Employee/Compensation/management/CompensationAddJobForm/CompensationAddJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.d.ts +24 -7
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +18 -18
- package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationCard/index.d.ts +0 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.d.ts +7 -1
- package/dist/components/Employee/Compensation/management/CompensationComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.d.ts +27 -15
- package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.d.ts +12 -0
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.d.ts +12 -0
- package/dist/components/Employee/Compensation/management/CompensationEditPendingJobForm/CompensationEditPendingJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +3 -2
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/management/compensationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Compensation/management/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.d.ts +2 -0
- package/dist/components/Employee/Compensation/management/useManagementCompensationDictionary.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +61 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +5 -0
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +32 -9
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +1 -2
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +9 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +7 -7
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/index.d.ts +1 -4
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.d.ts +1 -0
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +5 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +3 -2
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/PendingChangesReviewModal.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +4 -0
- package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +98 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +168 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +153 -6
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +19 -0
- package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.d.ts +101 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +10 -10
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +1 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +75 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +137 -8
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/usePendingChangeDetailRenderer.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +18 -4
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +3 -0
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +21 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardFlow.d.ts +116 -0
- package/dist/components/Employee/Dashboard/DashboardFlow.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +20 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +36 -3
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +1 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/index.d.ts +0 -6
- package/dist/components/Employee/Deductions/management/Deductions.d.ts +30 -0
- package/dist/components/Employee/Deductions/management/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.d.ts +21 -8
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js +16 -16
- package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsComponents.d.ts +5 -1
- package/dist/components/Employee/Deductions/management/DeductionsComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.d.ts +21 -7
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/DeductionsEditForm.js.map +1 -1
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.d.ts +2 -0
- package/dist/components/Employee/Deductions/management/DeductionsEditForm/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.d.ts +1 -0
- package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/Deductions.d.ts +45 -0
- package/dist/components/Employee/Deductions/onboarding/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js +12 -12
- package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js +6 -5
- package/dist/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +5 -0
- package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/stateMachine.d.ts +1 -0
- package/dist/components/Employee/Deductions/onboarding/stateMachine.js.map +1 -1
- package/dist/components/Employee/Deductions/onboarding/useFormDictionary.d.ts +2 -0
- package/dist/components/Employee/Deductions/onboarding/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js +7 -6
- package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js +15 -14
- package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/DeductionsForm/index.d.ts +1 -1
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +38 -5
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +207 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +3 -2
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +129 -3
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +29 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +158 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +3 -2
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +131 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +6 -1
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +2 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +3 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js +7 -6
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
- package/dist/components/Employee/Documents/management/Documents.d.ts +24 -0
- package/dist/components/Employee/Documents/management/Documents.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.d.ts +17 -7
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js +15 -14
- package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentsComponents.d.ts +3 -0
- package/dist/components/Employee/Documents/management/DocumentsComponents.js.map +1 -1
- package/dist/components/Employee/Documents/management/documentsStateMachine.d.ts +1 -0
- package/dist/components/Employee/Documents/management/documentsStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +13 -10
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +4 -2
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +29 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.d.ts +23 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +6 -6
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +4 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +6 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.d.ts +27 -2
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.d.ts +3 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +7 -6
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/index.d.ts +1 -1
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.d.ts +1 -0
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js +11 -10
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/index.d.ts +0 -1
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +23 -6
- package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.d.ts +326 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/index.d.ts +2 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +62 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +130 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.d.ts +30 -3
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +17 -21
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +2 -0
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +12 -12
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.d.ts +23 -2
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js +38 -35
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +2 -0
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +10 -10
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/index.d.ts +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +86 -11
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +50 -62
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +34 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +11 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/index.d.ts +2 -5
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.d.ts +27 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.d.ts +9 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js +16 -15
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesCard/FederalTaxesCard.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.d.ts +5 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesComponents.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.d.ts +24 -0
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js +8 -7
- package/dist/components/Employee/FederalTaxes/management/FederalTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/management/federalTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/management/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/management/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.d.ts +24 -0
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js +13 -12
- package/dist/components/Employee/FederalTaxes/onboarding/FederalTaxes.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/FederalTaxes/onboarding/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.d.ts +4 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/index.d.ts +1 -2
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.d.ts +46 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.d.ts +112 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/index.d.ts +1 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +112 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +14 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddress.d.ts +21 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.d.ts +17 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js +8 -7
- package/dist/components/Employee/HomeAddress/management/HomeAddressCard/HomeAddressCard.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.d.ts +3 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressComponents.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.d.ts +20 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -0
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +5 -5
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +7 -1
- package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.d.ts +1 -0
- package/dist/components/Employee/HomeAddress/management/homeAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +46 -7
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +21 -6
- package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
- package/dist/components/Employee/Landing/Landing.d.ts +6 -0
- package/dist/components/Employee/Landing/Landing.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.d.ts +43 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +17 -0
- package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingExecutionFlow/index.d.ts +2 -2
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.d.ts +7 -0
- package/dist/components/Employee/OnboardingExecutionFlow/onboardingExecutionStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +59 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +7 -0
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +4 -4
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.d.ts +23 -6
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.d.ts +24 -7
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js +14 -14
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodCard.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.d.ts +23 -6
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodSplitForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/useFormDictionary.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/management/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +8 -8
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +43 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/onboarding/useFormDictionary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js +6 -6
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/BankFormBody/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js +11 -10
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +80 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +84 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +45 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +22 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +84 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +45 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +22 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +2 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +25 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +124 -7
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +52 -6
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +1 -2
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -1
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.d.ts +9 -0
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js +12 -12
- package/dist/components/Employee/Paystubs/management/PaystubsCard/PaystubsCard.js.map +1 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/index.d.ts +1 -1
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +25 -0
- package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
- package/dist/components/Employee/Profile/management/Profile.d.ts +25 -0
- package/dist/components/Employee/Profile/management/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.d.ts +22 -6
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js +12 -11
- package/dist/components/Employee/Profile/management/ProfileCard/ProfileCard.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileComponents.d.ts +5 -1
- package/dist/components/Employee/Profile/management/ProfileComponents.js.map +1 -1
- package/dist/components/Employee/Profile/management/ProfileEditForm.d.ts +25 -0
- package/dist/components/Employee/Profile/management/ProfileEditForm.js +8 -8
- package/dist/components/Employee/Profile/management/ProfileEditForm.js.map +1 -1
- package/dist/components/Employee/Profile/management/profileStateMachine.d.ts +1 -0
- package/dist/components/Employee/Profile/management/profileStateMachine.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/AdminProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +6 -6
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.d.ts +1 -0
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +7 -7
- package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
- package/dist/components/Employee/Profile/onboarding/Profile.d.ts +61 -0
- package/dist/components/Employee/Profile/onboarding/Profile.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +37 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.d.ts +170 -0
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/index.d.ts +4 -2
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +140 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/index.d.ts +0 -1
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +37 -4
- package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.d.ts +130 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +35 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/index.d.ts +2 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.d.ts +45 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +77 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +43 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/index.d.ts +2 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.d.ts +42 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +85 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.d.ts +35 -0
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/workAddressSchema.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +16 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +31 -0
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts +1 -0
- package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/index.d.ts +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxes.d.ts +24 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.d.ts +21 -6
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js +12 -11
- package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.d.ts +4 -0
- package/dist/components/Employee/StateTaxes/management/StateTaxesComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.d.ts +20 -8
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js +11 -10
- package/dist/components/Employee/StateTaxes/management/StateTaxesEditForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.d.ts +1 -0
- package/dist/components/Employee/StateTaxes/management/stateTaxesStateMachine.js.map +1 -1
- package/dist/components/Employee/StateTaxes/management/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/management/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.d.ts +22 -0
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js +8 -7
- package/dist/components/Employee/StateTaxes/onboarding/StateTaxes.js.map +1 -1
- package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.d.ts +2 -0
- package/dist/components/Employee/StateTaxes/onboarding/useViewDictionary.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.d.ts +4 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/index.d.ts +1 -2
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +39 -16
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.d.ts +6 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +4 -9
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMeta.d.ts +5 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldProps.d.ts +52 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +26 -5
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +106 -0
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/index.d.ts +0 -1
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +5 -8
- package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +53 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +7 -6
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +47 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +20 -0
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +10 -9
- package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +2 -0
- package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +48 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +1 -0
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -2
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/types.d.ts +16 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.d.ts +21 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.d.ts +17 -6
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js +17 -16
- package/dist/components/Employee/WorkAddress/management/WorkAddressCard/WorkAddressCard.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.d.ts +3 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressComponents.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.d.ts +20 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -0
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +7 -7
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -0
- package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +46 -7
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.d.ts +1 -0
- package/dist/components/Employee/WorkAddress/management/workAddressStateMachine.js.map +1 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/index.d.ts +0 -1
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +21 -4
- package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +7 -4
- package/dist/components/Employee/exports/employeeManagement.js +26 -26
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +11 -9
- package/dist/components/Employee/exports/employeeOnboarding.js +20 -16
- package/dist/components/Employee/exports/employeeOnboarding.js.map +1 -1
- package/dist/components/Employee/index.d.ts +0 -1
- package/dist/components/Flow/FlowHeader.js +4 -3
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +19 -18
- package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +8 -7
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +5 -4
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +9 -8
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/Dismissal/index.d.ts +2 -0
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +5 -5
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +10 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +2 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +2 -3
- package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +18 -18
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +295 -289
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +18 -18
- package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +15 -15
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +4 -4
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +3 -2
- package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +3 -2
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +2 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +3 -2
- package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
- package/dist/components/Payroll/index.d.ts +2 -0
- package/dist/components/Payroll/index.js +24 -22
- package/dist/components/Payroll/index.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +14 -14
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +8 -8
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +4 -4
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +4 -4
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +36 -34
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +4 -4
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +16 -16
- package/dist/components/TimeOff/index.d.ts +6 -2
- package/dist/components/TimeOff/index.js +21 -17
- package/dist/components/TimeOff/index.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +1 -1
- package/dist/components/index.d.ts +1 -6
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +28 -2
- package/dist/contexts/GustoProvider/GustoProvider.js +10 -11
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +42 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/SDKI18next.d.ts +1 -1
- package/dist/contexts/GustoProvider/SDKI18next.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +1 -3
- package/dist/contexts/ThemeProvider/ThemeProvider.d.ts +5 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/contexts/ThemeProvider/customRender.d.ts +1 -0
- package/dist/contexts/ThemeProvider/index.d.ts +0 -1
- package/dist/contexts/ThemeProvider/theme.d.ts +7 -101
- package/dist/contexts/ThemeProvider/theme.js +58 -64
- package/dist/contexts/ThemeProvider/theme.js.map +1 -1
- package/dist/contexts/ThemeProvider/types.d.ts +181 -0
- package/dist/contexts/ThemeProvider/useTheme.d.ts +4 -0
- package/dist/contexts/ThemeProvider/useTheme.js.map +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/i18n/I18n.js +0 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +56 -40
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
- package/dist/index.d.ts +20 -17
- package/dist/index.js +228 -158
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +13 -11
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +17 -15
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +11 -9
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +15 -13
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +13 -11
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +8 -6
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/index.d.ts +2 -0
- package/dist/partner-hook-utils/form/index.d.ts +1 -1
- package/dist/shared/constants.d.ts +5 -3
- package/dist/shared/constants.js +0 -1
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +9 -32
- package/docs/reference/endpoint-inventory.json +322 -1101
- package/package.json +20 -17
- package/dist/components/Company/index.js +0 -37
- package/dist/components/Company/index.js.map +0 -1
- package/dist/components/Contractor/index.js +0 -29
- package/dist/components/Contractor/index.js.map +0 -1
- package/dist/components/Employee/Compensation/management/CompensationEditJobForm/index.d.ts +0 -3
- package/dist/components/Employee/Deductions/shared/index.d.ts +0 -8
- package/dist/components/Employee/Documents/shared/index.d.ts +0 -3
- package/dist/components/Employee/FederalTaxes/onboarding/index.d.ts +0 -2
- package/dist/components/Employee/HomeAddress/shared/index.d.ts +0 -3
- package/dist/components/Employee/Paystubs/shared/index.d.ts +0 -3
- package/dist/components/Employee/Taxes/Actions.d.ts +0 -1
- package/dist/components/Employee/Taxes/Actions.js +0 -14
- package/dist/components/Employee/Taxes/Actions.js.map +0 -1
- package/dist/components/Employee/Taxes/FederalForm.d.ts +0 -12
- package/dist/components/Employee/Taxes/FederalForm.js +0 -109
- package/dist/components/Employee/Taxes/FederalForm.js.map +0 -1
- package/dist/components/Employee/Taxes/FederalHead.d.ts +0 -1
- package/dist/components/Employee/Taxes/FederalHead.js +0 -25
- package/dist/components/Employee/Taxes/FederalHead.js.map +0 -1
- package/dist/components/Employee/Taxes/StateForm.d.ts +0 -6
- package/dist/components/Employee/Taxes/StateForm.js +0 -35
- package/dist/components/Employee/Taxes/StateForm.js.map +0 -1
- package/dist/components/Employee/Taxes/Taxes.d.ts +0 -13
- package/dist/components/Employee/Taxes/Taxes.js +0 -133
- package/dist/components/Employee/Taxes/Taxes.js.map +0 -1
- package/dist/components/Employee/Taxes/index.d.ts +0 -2
- package/dist/components/Employee/Taxes/useTaxes.d.ts +0 -8
- package/dist/components/Employee/Taxes/useTaxes.js +0 -23
- package/dist/components/Employee/Taxes/useTaxes.js.map +0 -1
- package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +0 -3
- package/dist/components/Employee/Terminations/TerminationsData.d.ts +0 -6
- package/dist/components/Employee/Terminations/index.d.ts +0 -8
- package/dist/components/Employee/WorkAddress/shared/index.d.ts +0 -3
- package/dist/components/Employee/index.js +0 -49
- package/dist/components/Employee/index.js.map +0 -1
- package/dist/contexts/GustoApiProvider/index.d.ts +0 -3
- package/dist/i18n/en/Employee.Taxes.json.js +0 -58
- package/dist/i18n/en/Employee.Taxes.json.js.map +0 -1
|
@@ -5,21 +5,179 @@ import { NumberInputHookFieldProps } from '../../../../../partner-hook-utils/for
|
|
|
5
5
|
import { RadioGroupHookFieldProps } from '../../../../../partner-hook-utils/form/fields/RadioGroupHookField';
|
|
6
6
|
import { SelectHookFieldProps } from '../../../../../partner-hook-utils/form/fields/SelectHookField';
|
|
7
7
|
import { HookFieldProps } from '../../../../../partner-hook-utils/types';
|
|
8
|
+
/**
|
|
9
|
+
* The required-field error code produced by {@link useDeductionForm} fields that only emit `REQUIRED`.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Used as the `validationMessages` key for the description, recurring,
|
|
13
|
+
* deduct-as-percentage, and garnishment-type fields. See
|
|
14
|
+
* {@link DeductionFormErrorCodes}.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
8
18
|
export type RequiredValidation = typeof DeductionFormErrorCodes.REQUIRED;
|
|
19
|
+
/**
|
|
20
|
+
* The negative-amount error code produced by {@link useDeductionForm}'s currency fields.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Used as a `validationMessages` key on `Fields.Amount`, `Fields.TotalAmount`,
|
|
24
|
+
* and `Fields.AnnualMaximum`. See {@link DeductionFormErrorCodes}.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
9
28
|
export type NegativeAmountValidation = typeof DeductionFormErrorCodes.NEGATIVE_AMOUNT;
|
|
29
|
+
/**
|
|
30
|
+
* Validation error codes emitted by the `amount` field of {@link useDeductionForm}.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Use these as keys in `validationMessages` on `Fields.Amount`. See
|
|
34
|
+
* {@link DeductionFormErrorCodes} for the full description of each code.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
10
38
|
export type AmountValidation = RequiredValidation | NegativeAmountValidation;
|
|
39
|
+
/**
|
|
40
|
+
* Validation error codes emitted by the cap fields of {@link useDeductionForm} (`totalAmount`, `annualMaximum`).
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Use these as keys in `validationMessages` on `Fields.TotalAmount` and
|
|
44
|
+
* `Fields.AnnualMaximum`. See {@link DeductionFormErrorCodes} for the full
|
|
45
|
+
* description of each code.
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
11
49
|
export type CapValidation = NegativeAmountValidation;
|
|
50
|
+
/**
|
|
51
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.Description` component.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
12
55
|
export type DescriptionFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>;
|
|
56
|
+
/**
|
|
57
|
+
* Text input bound to the `description` field of {@link useDeductionForm}.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* Available on the hook result as `form.Fields.Description`. Always rendered.
|
|
61
|
+
*
|
|
62
|
+
* @param props - {@link DescriptionFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).
|
|
63
|
+
* @returns The rendered text input bound to `description`.
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
13
66
|
export declare function DescriptionField(props: DescriptionFieldProps): import("react").JSX.Element;
|
|
67
|
+
/**
|
|
68
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.Recurring` component.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
14
72
|
export type RecurringFieldProps = HookFieldProps<RadioGroupHookFieldProps<RequiredValidation, boolean>>;
|
|
73
|
+
/**
|
|
74
|
+
* Radio group bound to the `recurring` field of {@link useDeductionForm}.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Available on the hook result as `form.Fields.Recurring`. Always rendered.
|
|
78
|
+
* Picks between a recurring deduction (taken every paycheck) and a one-time
|
|
79
|
+
* deduction. The cap fields (`Fields.TotalAmount` and `Fields.AnnualMaximum`)
|
|
80
|
+
* are exposed only when this is set to recurring.
|
|
81
|
+
*
|
|
82
|
+
* @param props - {@link RecurringFieldProps} — accepts the standard hook field props plus `getOptionLabel` for boolean display.
|
|
83
|
+
* @returns The rendered radio group bound to `recurring`.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
15
86
|
export declare function RecurringField(props: RecurringFieldProps): import("react").JSX.Element;
|
|
87
|
+
/**
|
|
88
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.DeductAsPercentage` component.
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
16
92
|
export type DeductAsPercentageFieldProps = HookFieldProps<RadioGroupHookFieldProps<RequiredValidation, boolean>>;
|
|
93
|
+
/**
|
|
94
|
+
* Radio group bound to the `deductAsPercentage` field of {@link useDeductionForm}.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* Available on the hook result as `form.Fields.DeductAsPercentage`. Always
|
|
98
|
+
* rendered. Toggles how `Fields.Amount` is interpreted — as a fixed currency
|
|
99
|
+
* amount when `false`, or as a percentage of paycheck when `true`.
|
|
100
|
+
*
|
|
101
|
+
* @param props - {@link DeductAsPercentageFieldProps} — accepts the standard hook field props plus `getOptionLabel` for boolean display.
|
|
102
|
+
* @returns The rendered radio group bound to `deductAsPercentage`.
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
17
105
|
export declare function DeductAsPercentageField(props: DeductAsPercentageFieldProps): import("react").JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.Amount` component.
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
18
111
|
export type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>;
|
|
112
|
+
/**
|
|
113
|
+
* Number input bound to the `amount` field of {@link useDeductionForm}.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* Available on the hook result as `form.Fields.Amount`. Always rendered.
|
|
117
|
+
* Interpreted as a currency amount when `Fields.DeductAsPercentage` is set to
|
|
118
|
+
* a fixed amount, or as a percentage of paycheck when it's set to percentage.
|
|
119
|
+
*
|
|
120
|
+
* @param props - {@link AmountFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).
|
|
121
|
+
* @returns The rendered number input bound to `amount`.
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
19
124
|
export declare function AmountField(props: AmountFieldProps): import("react").JSX.Element;
|
|
125
|
+
/**
|
|
126
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.TotalAmount` component.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
20
130
|
export type TotalAmountFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>;
|
|
131
|
+
/**
|
|
132
|
+
* Number input bound to the `totalAmount` field of {@link useDeductionForm}.
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* Available on the hook result as `form.Fields.TotalAmount` only when
|
|
136
|
+
* `status.isRecurring` is `true`. A zero value means "no cap" — the hook
|
|
137
|
+
* drops it on the wire. Always null-check before rendering.
|
|
138
|
+
*
|
|
139
|
+
* @param props - {@link TotalAmountFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).
|
|
140
|
+
* @returns The rendered number input bound to `totalAmount`.
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
21
143
|
export declare function TotalAmountField(props: TotalAmountFieldProps): import("react").JSX.Element;
|
|
144
|
+
/**
|
|
145
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.AnnualMaximum` component.
|
|
146
|
+
*
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
22
149
|
export type AnnualMaximumFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>;
|
|
150
|
+
/**
|
|
151
|
+
* Number input bound to the `annualMaximum` field of {@link useDeductionForm}.
|
|
152
|
+
*
|
|
153
|
+
* @remarks
|
|
154
|
+
* Available on the hook result as `form.Fields.AnnualMaximum` only when
|
|
155
|
+
* `status.isRecurring` is `true`. A zero value means "no cap" — the hook
|
|
156
|
+
* drops it on the wire. Always null-check before rendering.
|
|
157
|
+
*
|
|
158
|
+
* @param props - {@link AnnualMaximumFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).
|
|
159
|
+
* @returns The rendered number input bound to `annualMaximum`.
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
23
162
|
export declare function AnnualMaximumField(props: AnnualMaximumFieldProps): import("react").JSX.Element;
|
|
163
|
+
/**
|
|
164
|
+
* Props accepted by {@link useDeductionForm}'s `Fields.GarnishmentType` component.
|
|
165
|
+
*
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
24
168
|
export type GarnishmentTypeFieldProps = HookFieldProps<SelectHookFieldProps<RequiredValidation, GarnishmentType>>;
|
|
169
|
+
/**
|
|
170
|
+
* Select bound to the `garnishmentType` field of {@link useDeductionForm}.
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
* Available on the hook result as `form.Fields.GarnishmentType` only when the
|
|
174
|
+
* hook is constructed with `courtOrdered: true`. Always null-check before
|
|
175
|
+
* rendering. Options: `Federal Tax Lien`, `State Tax Lien`, `Student Loan`,
|
|
176
|
+
* `Creditor Garnishment`, `Federal Loan`, `Other Garnishment`. For
|
|
177
|
+
* child-support garnishments, use {@link useChildSupportGarnishmentForm}.
|
|
178
|
+
*
|
|
179
|
+
* @param props - {@link GarnishmentTypeFieldProps} — accepts the standard hook field props plus `getOptionLabel` for garnishment-type display.
|
|
180
|
+
* @returns The rendered select bound to `garnishmentType`.
|
|
181
|
+
* @public
|
|
182
|
+
*/
|
|
25
183
|
export declare function GarnishmentTypeField(props: GarnishmentTypeFieldProps): import("react").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { SelectHookField as o } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
3
2
|
import { NumberInputHookField as t } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
|
|
4
3
|
import { RadioGroupHookField as r } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
|
|
5
|
-
import { TextInputHookField as
|
|
4
|
+
import { TextInputHookField as o } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
|
|
5
|
+
import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
|
|
6
6
|
function l(n) {
|
|
7
|
-
return /* @__PURE__ */ e(
|
|
7
|
+
return /* @__PURE__ */ e(o, { ...n, name: "description" });
|
|
8
8
|
}
|
|
9
9
|
function p(n) {
|
|
10
10
|
return /* @__PURE__ */ e(r, { ...n, name: "recurring" });
|
|
@@ -22,7 +22,7 @@ function A(n) {
|
|
|
22
22
|
return /* @__PURE__ */ e(t, { ...n, name: "annualMaximum" });
|
|
23
23
|
}
|
|
24
24
|
function g(n) {
|
|
25
|
-
return /* @__PURE__ */ e(
|
|
25
|
+
return /* @__PURE__ */ e(i, { ...n, name: "garnishmentType" });
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
28
|
F as AmountField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/fields.tsx"],"sourcesContent":["import type { GarnishmentType } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport type { DeductionFormErrorCodes } from './deductionFormSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { RadioGroupHookFieldProps } from '@/partner-hook-utils/form/fields/RadioGroupHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport {\n TextInputHookField,\n NumberInputHookField,\n RadioGroupHookField,\n SelectHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\nexport type RequiredValidation = typeof DeductionFormErrorCodes.REQUIRED\nexport type NegativeAmountValidation = typeof DeductionFormErrorCodes.NEGATIVE_AMOUNT\n\nexport type AmountValidation = RequiredValidation | NegativeAmountValidation\nexport type CapValidation = NegativeAmountValidation\n\n// ── Description ────────────────────────────────────────────────────────\n\nexport type DescriptionFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\nexport function DescriptionField(props: DescriptionFieldProps) {\n return <TextInputHookField {...props} name=\"description\" />\n}\n\n// ── Recurring (radio: boolean) ─────────────────────────────────────────\n\nexport type RecurringFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\nexport function RecurringField(props: RecurringFieldProps) {\n return <RadioGroupHookField {...props} name=\"recurring\" />\n}\n\n// ── DeductAsPercentage (radio: boolean) ────────────────────────────────\n\nexport type DeductAsPercentageFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\nexport function DeductAsPercentageField(props: DeductAsPercentageFieldProps) {\n return <RadioGroupHookField {...props} name=\"deductAsPercentage\" />\n}\n\n// ── Amount (currency or percent depending on deductAsPercentage) ───────\n\nexport type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>\n\nexport function AmountField(props: AmountFieldProps) {\n return <NumberInputHookField {...props} name=\"amount\" />\n}\n\n// ── TotalAmount (optional cap — only meaningful when recurring) ────────\n\nexport type TotalAmountFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\nexport function TotalAmountField(props: TotalAmountFieldProps) {\n return <NumberInputHookField {...props} name=\"totalAmount\" />\n}\n\n// ── AnnualMaximum (optional annual cap — only meaningful when recurring) ─\n\nexport type AnnualMaximumFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\nexport function AnnualMaximumField(props: AnnualMaximumFieldProps) {\n return <NumberInputHookField {...props} name=\"annualMaximum\" />\n}\n\n// ── GarnishmentType (court-ordered only) ───────────────────────────────\n\nexport type GarnishmentTypeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, GarnishmentType>\n>\n\nexport function GarnishmentTypeField(props: GarnishmentTypeFieldProps) {\n return <SelectHookField {...props} name=\"garnishmentType\" />\n}\n"],"names":["DescriptionField","props","jsx","TextInputHookField","RecurringField","RadioGroupHookField","DeductAsPercentageField","AmountField","NumberInputHookField","TotalAmountField","AnnualMaximumField","GarnishmentTypeField","SelectHookField"],"mappings":";;;;;AAwBO,SAASA,EAAiBC,GAA8B;AAC7D,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,eAAc;AAC3D;AAQO,SAASG,EAAeH,GAA4B;AACzD,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,aAAY;AAC1D;AAQO,SAASK,EAAwBL,GAAqC;AAC3E,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,sBAAqB;AACnE;AAMO,SAASM,EAAYN,GAAyB;AACnD,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,UAAS;AACxD;AAMO,SAASQ,EAAiBR,GAA8B;AAC7D,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,eAAc;AAC7D;AAMO,SAASS,EAAmBT,GAAgC;AACjE,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,iBAAgB;AAC/D;AAQO,SAASU,EAAqBV,GAAkC;AACrE,SAAO,gBAAAC,EAACU,GAAA,EAAiB,GAAGX,GAAO,MAAK,mBAAkB;AAC5D;"}
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/fields.tsx"],"sourcesContent":["import type { GarnishmentType } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport type { DeductionFormErrorCodes } from './deductionFormSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { RadioGroupHookFieldProps } from '@/partner-hook-utils/form/fields/RadioGroupHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport {\n TextInputHookField,\n NumberInputHookField,\n RadioGroupHookField,\n SelectHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\n/**\n * The required-field error code produced by {@link useDeductionForm} fields that only emit `REQUIRED`.\n *\n * @remarks\n * Used as the `validationMessages` key for the description, recurring,\n * deduct-as-percentage, and garnishment-type fields. See\n * {@link DeductionFormErrorCodes}.\n *\n * @public\n */\nexport type RequiredValidation = typeof DeductionFormErrorCodes.REQUIRED\n\n/**\n * The negative-amount error code produced by {@link useDeductionForm}'s currency fields.\n *\n * @remarks\n * Used as a `validationMessages` key on `Fields.Amount`, `Fields.TotalAmount`,\n * and `Fields.AnnualMaximum`. See {@link DeductionFormErrorCodes}.\n *\n * @public\n */\nexport type NegativeAmountValidation = typeof DeductionFormErrorCodes.NEGATIVE_AMOUNT\n\n/**\n * Validation error codes emitted by the `amount` field of {@link useDeductionForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.Amount`. See\n * {@link DeductionFormErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type AmountValidation = RequiredValidation | NegativeAmountValidation\n\n/**\n * Validation error codes emitted by the cap fields of {@link useDeductionForm} (`totalAmount`, `annualMaximum`).\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.TotalAmount` and\n * `Fields.AnnualMaximum`. See {@link DeductionFormErrorCodes} for the full\n * description of each code.\n *\n * @public\n */\nexport type CapValidation = NegativeAmountValidation\n\n// ── Description ────────────────────────────────────────────────────────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.Description` component.\n *\n * @public\n */\nexport type DescriptionFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/**\n * Text input bound to the `description` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Description`. Always rendered.\n *\n * @param props - {@link DescriptionFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered text input bound to `description`.\n * @public\n */\nexport function DescriptionField(props: DescriptionFieldProps) {\n return <TextInputHookField {...props} name=\"description\" />\n}\n\n// ── Recurring (radio: boolean) ─────────────────────────────────────────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.Recurring` component.\n *\n * @public\n */\nexport type RecurringFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\n/**\n * Radio group bound to the `recurring` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Recurring`. Always rendered.\n * Picks between a recurring deduction (taken every paycheck) and a one-time\n * deduction. The cap fields (`Fields.TotalAmount` and `Fields.AnnualMaximum`)\n * are exposed only when this is set to recurring.\n *\n * @param props - {@link RecurringFieldProps} — accepts the standard hook field props plus `getOptionLabel` for boolean display.\n * @returns The rendered radio group bound to `recurring`.\n * @public\n */\nexport function RecurringField(props: RecurringFieldProps) {\n return <RadioGroupHookField {...props} name=\"recurring\" />\n}\n\n// ── DeductAsPercentage (radio: boolean) ────────────────────────────────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.DeductAsPercentage` component.\n *\n * @public\n */\nexport type DeductAsPercentageFieldProps = HookFieldProps<\n RadioGroupHookFieldProps<RequiredValidation, boolean>\n>\n\n/**\n * Radio group bound to the `deductAsPercentage` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.DeductAsPercentage`. Always\n * rendered. Toggles how `Fields.Amount` is interpreted — as a fixed currency\n * amount when `false`, or as a percentage of paycheck when `true`.\n *\n * @param props - {@link DeductAsPercentageFieldProps} — accepts the standard hook field props plus `getOptionLabel` for boolean display.\n * @returns The rendered radio group bound to `deductAsPercentage`.\n * @public\n */\nexport function DeductAsPercentageField(props: DeductAsPercentageFieldProps) {\n return <RadioGroupHookField {...props} name=\"deductAsPercentage\" />\n}\n\n// ── Amount (currency or percent depending on deductAsPercentage) ───────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.Amount` component.\n *\n * @public\n */\nexport type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>\n\n/**\n * Number input bound to the `amount` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.Amount`. Always rendered.\n * Interpreted as a currency amount when `Fields.DeductAsPercentage` is set to\n * a fixed amount, or as a percentage of paycheck when it's set to percentage.\n *\n * @param props - {@link AmountFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered number input bound to `amount`.\n * @public\n */\nexport function AmountField(props: AmountFieldProps) {\n return <NumberInputHookField {...props} name=\"amount\" />\n}\n\n// ── TotalAmount (optional cap — only meaningful when recurring) ────────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.TotalAmount` component.\n *\n * @public\n */\nexport type TotalAmountFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\n/**\n * Number input bound to the `totalAmount` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.TotalAmount` only when\n * `status.isRecurring` is `true`. A zero value means \"no cap\" — the hook\n * drops it on the wire. Always null-check before rendering.\n *\n * @param props - {@link TotalAmountFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered number input bound to `totalAmount`.\n * @public\n */\nexport function TotalAmountField(props: TotalAmountFieldProps) {\n return <NumberInputHookField {...props} name=\"totalAmount\" />\n}\n\n// ── AnnualMaximum (optional annual cap — only meaningful when recurring) ─\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.AnnualMaximum` component.\n *\n * @public\n */\nexport type AnnualMaximumFieldProps = HookFieldProps<NumberInputHookFieldProps<CapValidation>>\n\n/**\n * Number input bound to the `annualMaximum` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.AnnualMaximum` only when\n * `status.isRecurring` is `true`. A zero value means \"no cap\" — the hook\n * drops it on the wire. Always null-check before rendering.\n *\n * @param props - {@link AnnualMaximumFieldProps} — accepts the standard hook field props (label, description, validationMessages, FieldComponent override).\n * @returns The rendered number input bound to `annualMaximum`.\n * @public\n */\nexport function AnnualMaximumField(props: AnnualMaximumFieldProps) {\n return <NumberInputHookField {...props} name=\"annualMaximum\" />\n}\n\n// ── GarnishmentType (court-ordered only) ───────────────────────────────\n\n/**\n * Props accepted by {@link useDeductionForm}'s `Fields.GarnishmentType` component.\n *\n * @public\n */\nexport type GarnishmentTypeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, GarnishmentType>\n>\n\n/**\n * Select bound to the `garnishmentType` field of {@link useDeductionForm}.\n *\n * @remarks\n * Available on the hook result as `form.Fields.GarnishmentType` only when the\n * hook is constructed with `courtOrdered: true`. Always null-check before\n * rendering. Options: `Federal Tax Lien`, `State Tax Lien`, `Student Loan`,\n * `Creditor Garnishment`, `Federal Loan`, `Other Garnishment`. For\n * child-support garnishments, use {@link useChildSupportGarnishmentForm}.\n *\n * @param props - {@link GarnishmentTypeFieldProps} — accepts the standard hook field props plus `getOptionLabel` for garnishment-type display.\n * @returns The rendered select bound to `garnishmentType`.\n * @public\n */\nexport function GarnishmentTypeField(props: GarnishmentTypeFieldProps) {\n return <SelectHookField {...props} name=\"garnishmentType\" />\n}\n"],"names":["DescriptionField","props","jsx","TextInputHookField","RecurringField","RadioGroupHookField","DeductAsPercentageField","AmountField","NumberInputHookField","TotalAmountField","AnnualMaximumField","GarnishmentTypeField","SelectHookField"],"mappings":";;;;;AA+EO,SAASA,EAAiBC,GAA8B;AAC7D,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,eAAc;AAC3D;AA0BO,SAASG,EAAeH,GAA4B;AACzD,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,aAAY;AAC1D;AAyBO,SAASK,EAAwBL,GAAqC;AAC3E,SAAO,gBAAAC,EAACG,GAAA,EAAqB,GAAGJ,GAAO,MAAK,sBAAqB;AACnE;AAuBO,SAASM,EAAYN,GAAyB;AACnD,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,UAAS;AACxD;AAuBO,SAASQ,EAAiBR,GAA8B;AAC7D,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,eAAc;AAC7D;AAuBO,SAASS,EAAmBT,GAAgC;AACjE,SAAO,gBAAAC,EAACM,GAAA,EAAsB,GAAGP,GAAO,MAAK,iBAAgB;AAC/D;AA2BO,SAASU,EAAqBV,GAAkC;AACrE,SAAO,gBAAAC,EAACU,GAAA,EAAiB,GAAGX,GAAO,MAAK,mBAAkB;AAC5D;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
|
-
export { useDeductionForm, type UseDeductionFormProps, type UseDeductionFormResult, type UseDeductionFormReady, type DeductionFormFields, type DeductionFormFieldsMetadata, type
|
|
3
|
-
export { createDeductionFormSchema, DeductionFormErrorCodes, type DeductionFormErrorCode, type DeductionFormData, type DeductionFormOutputs,
|
|
2
|
+
export { useDeductionForm, type UseDeductionFormProps, type UseDeductionFormResult, type UseDeductionFormReady, type DeductionFormFields, type DeductionFormFieldsMetadata, type DeductionFormOptionalFieldsToRequire, } from './useDeductionForm';
|
|
3
|
+
export { createDeductionFormSchema, DeductionFormErrorCodes, type DeductionFormErrorCode, type DeductionFormData, type DeductionFormOutputs, } from './deductionFormSchema';
|
|
4
|
+
export { DescriptionField, RecurringField, DeductAsPercentageField, AmountField, TotalAmountField, AnnualMaximumField, GarnishmentTypeField, } from './fields';
|
|
4
5
|
export type { RequiredValidation as DeductionFormRequiredValidation, NegativeAmountValidation as DeductionFormNegativeAmountValidation, AmountValidation as DeductionFormAmountValidation, CapValidation as DeductionFormCapValidation, DescriptionFieldProps, RecurringFieldProps, DeductAsPercentageFieldProps, AmountFieldProps, TotalAmountFieldProps, AnnualMaximumFieldProps, GarnishmentTypeFieldProps, } from './fields';
|
|
@@ -4,11 +4,22 @@ import { DeductionFormData, DeductionFormOptionalFieldsToRequire } from './deduc
|
|
|
4
4
|
import { DescriptionField, RecurringField, DeductAsPercentageField, AmountField, TotalAmountField, AnnualMaximumField, GarnishmentTypeField } from './fields';
|
|
5
5
|
import { BaseFormHookReady, FieldsMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
|
|
6
6
|
export type { DeductionFormOptionalFieldsToRequire } from './deductionFormSchema';
|
|
7
|
+
/**
|
|
8
|
+
* Configuration options for {@link useDeductionForm}.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Presence or absence of `garnishmentId` selects the API verb — see the
|
|
12
|
+
* `garnishmentId` field description. `courtOrdered` selects between the
|
|
13
|
+
* post-tax custom variant and the court-ordered garnishment variant.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
7
17
|
export interface UseDeductionFormProps {
|
|
18
|
+
/** UUID of the employee whose deduction is being created or edited. */
|
|
8
19
|
employeeId: string;
|
|
9
20
|
/**
|
|
10
|
-
* When set, loads that garnishment
|
|
11
|
-
*
|
|
21
|
+
* When set, loads that garnishment and updates it (PUT). When omitted, the
|
|
22
|
+
* form is in create mode (POST).
|
|
12
23
|
*/
|
|
13
24
|
garnishmentId?: string;
|
|
14
25
|
/**
|
|
@@ -18,18 +29,37 @@ export interface UseDeductionFormProps {
|
|
|
18
29
|
* `garnishmentType` is excluded from the schema and submit payload.
|
|
19
30
|
*
|
|
20
31
|
* Note: this hook does NOT handle `garnishmentType: 'child_support'`. Use
|
|
21
|
-
*
|
|
32
|
+
* {@link useChildSupportGarnishmentForm} for child-support agency-keyed payloads.
|
|
22
33
|
*/
|
|
23
34
|
courtOrdered: boolean;
|
|
35
|
+
/** Override fields that are optional on a given mode to be required. See {@link DeductionFormOptionalFieldsToRequire}. */
|
|
24
36
|
optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire;
|
|
37
|
+
/** Pre-fill form values. Server data takes precedence on update. */
|
|
25
38
|
defaultValues?: Partial<DeductionFormData>;
|
|
39
|
+
/** Passed through to react-hook-form. Defaults to `'onSubmit'`. */
|
|
26
40
|
validationMode?: UseFormProps['mode'];
|
|
41
|
+
/** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */
|
|
27
42
|
shouldFocusError?: boolean;
|
|
28
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Pre-bound field components exposed on `useDeductionForm().form.Fields`.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Each property is either the field component or `undefined`. A field is
|
|
49
|
+
* `undefined` when conditions for rendering it aren't met — see each member
|
|
50
|
+
* for its visibility rule. Always null-check conditional fields (e.g.
|
|
51
|
+
* `{Fields.TotalAmount && <Fields.TotalAmount ... />}`) before rendering.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
29
55
|
export interface DeductionFormFields {
|
|
56
|
+
/** Description text input. Always available. */
|
|
30
57
|
Description: typeof DescriptionField;
|
|
58
|
+
/** Recurring vs one-time radio group. Always available. */
|
|
31
59
|
Recurring: typeof RecurringField;
|
|
60
|
+
/** Fixed-amount vs percentage radio group. Always available. */
|
|
32
61
|
DeductAsPercentage: typeof DeductAsPercentageField;
|
|
62
|
+
/** Deduction amount input. Always available. */
|
|
33
63
|
Amount: typeof AmountField;
|
|
34
64
|
/** Only available when `status.isRecurring` is true. */
|
|
35
65
|
TotalAmount: typeof TotalAmountField | undefined;
|
|
@@ -38,13 +68,28 @@ export interface DeductionFormFields {
|
|
|
38
68
|
/** Only available when `courtOrdered: true`. */
|
|
39
69
|
GarnishmentType: typeof GarnishmentTypeField | undefined;
|
|
40
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Ready-state shape returned by {@link useDeductionForm} once data has loaded.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with
|
|
76
|
+
* the deduction-specific `data`, `status`, `actions`, and `form.Fields` shape.
|
|
77
|
+
* Static, entity-derived values live under `data.*`; reactive values that
|
|
78
|
+
* flip with form input live under `status.*`.
|
|
79
|
+
*
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
41
82
|
export interface UseDeductionFormReady extends BaseFormHookReady<FieldsMetadata, DeductionFormData, DeductionFormFields> {
|
|
83
|
+
/** Deduction-specific data payload: the loaded garnishment for update mode, or `null` in create mode. */
|
|
42
84
|
data: {
|
|
43
85
|
/** The garnishment loaded for update; `null` in create mode. */
|
|
44
86
|
deduction: Garnishment | null;
|
|
45
87
|
};
|
|
88
|
+
/** Submission state and reactive flags derived from current form input. */
|
|
46
89
|
status: {
|
|
90
|
+
/** `true` while a create or update mutation is in flight. */
|
|
47
91
|
isPending: boolean;
|
|
92
|
+
/** Reflects whether the next submit will POST a new deduction or PUT an existing one. */
|
|
48
93
|
mode: 'create' | 'update';
|
|
49
94
|
/**
|
|
50
95
|
* Mirrors the watched `recurring` value. Cap fields (`TotalAmount`,
|
|
@@ -54,11 +99,93 @@ export interface UseDeductionFormReady extends BaseFormHookReady<FieldsMetadata,
|
|
|
54
99
|
*/
|
|
55
100
|
isRecurring: boolean;
|
|
56
101
|
};
|
|
102
|
+
/** Submission action. */
|
|
57
103
|
actions: {
|
|
104
|
+
/** Submits the form. Returns the saved garnishment + mode on success, or `undefined` when validation fails or the request errored. */
|
|
58
105
|
onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>;
|
|
59
106
|
};
|
|
60
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Return value of {@link useDeductionForm}.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* Discriminated union: {@link HookLoadingResult} while the existing garnishment
|
|
113
|
+
* is loading (update mode only); {@link UseDeductionFormReady} once data is
|
|
114
|
+
* ready. In create mode the hook returns the ready branch immediately.
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
61
118
|
export type UseDeductionFormResult = HookLoadingResult | UseDeductionFormReady;
|
|
119
|
+
/**
|
|
120
|
+
* Headless hook for creating or updating a non-child-support deduction.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* Both variants — post-tax custom deductions and court-ordered garnishments —
|
|
124
|
+
* share the same field set (description, frequency, deduct-as-percentage,
|
|
125
|
+
* amount, optional caps) and differ only in whether the deduction is
|
|
126
|
+
* court-ordered and carries a `garnishmentType`. Set `courtOrdered: true` to
|
|
127
|
+
* surface the garnishment-type select; set it to `false` for a custom post-tax
|
|
128
|
+
* deduction.
|
|
129
|
+
*
|
|
130
|
+
* Presence or absence of `garnishmentId` selects the API verb: omit it to POST
|
|
131
|
+
* a new deduction, supply it to PUT updates against the existing row. For
|
|
132
|
+
* child-support garnishments, use {@link useChildSupportGarnishmentForm}
|
|
133
|
+
* instead — those require agency-keyed required attributes (case number,
|
|
134
|
+
* order number, remittance number, county) that this hook doesn't model.
|
|
135
|
+
*
|
|
136
|
+
* @param input - See {@link UseDeductionFormProps}.
|
|
137
|
+
* @returns A {@link HookLoadingResult} while loading, or a {@link UseDeductionFormReady} once ready.
|
|
138
|
+
* @public
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* import { useDeductionForm, SDKFormProvider } from '@gusto/embedded-react-sdk'
|
|
143
|
+
*
|
|
144
|
+
* function CustomDeductionPage({ employeeId, garnishmentId }: { employeeId: string; garnishmentId?: string }) {
|
|
145
|
+
* const form = useDeductionForm({ employeeId, garnishmentId, courtOrdered: false })
|
|
146
|
+
*
|
|
147
|
+
* if (form.isLoading) return <p>Loading…</p>
|
|
148
|
+
*
|
|
149
|
+
* const { Fields } = form.form
|
|
150
|
+
*
|
|
151
|
+
* return (
|
|
152
|
+
* <SDKFormProvider formHookResult={form}>
|
|
153
|
+
* <form
|
|
154
|
+
* onSubmit={e => {
|
|
155
|
+
* e.preventDefault()
|
|
156
|
+
* void form.actions.onSubmit()
|
|
157
|
+
* }}
|
|
158
|
+
* >
|
|
159
|
+
* <Fields.Description label="Description" validationMessages={{ REQUIRED: 'Required' }} />
|
|
160
|
+
* <Fields.Recurring
|
|
161
|
+
* label="Frequency"
|
|
162
|
+
* getOptionLabel={v => (v ? 'Recurring' : 'One-time')}
|
|
163
|
+
* validationMessages={{ REQUIRED: 'Required' }}
|
|
164
|
+
* />
|
|
165
|
+
* <Fields.Amount
|
|
166
|
+
* label="Amount"
|
|
167
|
+
* validationMessages={{ REQUIRED: 'Required', NEGATIVE_AMOUNT: 'Must be ≥ 0' }}
|
|
168
|
+
* />
|
|
169
|
+
* {Fields.TotalAmount && (
|
|
170
|
+
* <Fields.TotalAmount label="Total cap" validationMessages={{ NEGATIVE_AMOUNT: 'Must be ≥ 0' }} />
|
|
171
|
+
* )}
|
|
172
|
+
* <button type="submit">Save</button>
|
|
173
|
+
* </form>
|
|
174
|
+
* </SDKFormProvider>
|
|
175
|
+
* )
|
|
176
|
+
* }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
62
179
|
export declare function useDeductionForm({ employeeId, garnishmentId, courtOrdered, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseDeductionFormProps): UseDeductionFormResult;
|
|
180
|
+
/**
|
|
181
|
+
* Per-field metadata returned by {@link useDeductionForm} as `form.fieldsMetadata`.
|
|
182
|
+
*
|
|
183
|
+
* @remarks
|
|
184
|
+
* Carries per-field `isRequired`, `isDisabled`, label, description, and option
|
|
185
|
+
* entries derived from the schema and form state. Use these to drive UI such
|
|
186
|
+
* as disabled state or option lists when not relying on the pre-bound
|
|
187
|
+
* {@link DeductionFormFields} components.
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
63
191
|
export type DeductionFormFieldsMetadata = UseDeductionFormReady['form']['fieldsMetadata'];
|
|
64
|
-
export type DeductionFormFieldsType = UseDeductionFormReady['form']['Fields'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsUpdate'\nimport { useGarnishmentsList } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsList'\nimport {\n createDeductionFormSchema,\n type DeductionFormData,\n type DeductionFormOutputs,\n type DeductionFormOptionalFieldsToRequire,\n} from './deductionFormSchema'\nimport {\n DescriptionField,\n RecurringField,\n DeductAsPercentageField,\n AmountField,\n TotalAmountField,\n AnnualMaximumField,\n GarnishmentTypeField,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\n\nexport type { DeductionFormOptionalFieldsToRequire } from './deductionFormSchema'\n\n// GarnishmentType is a runtime enum; the schema gates which values are valid.\n// The hook's `withOptions` entries below carry the raw enum values so the\n// consumer can supply translated labels via `getOptionLabel` on the field.\n//\n// `'child_support'` is intentionally omitted — child-support garnishments\n// require agency-keyed required attributes (case number, order number,\n// remittance number, county) that this hook doesn't model. Use\n// `useChildSupportGarnishmentForm` for those.\nconst GARNISHMENT_TYPES: readonly GarnishmentType[] = [\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n] as const\n\nexport interface UseDeductionFormProps {\n employeeId: string\n /**\n * When set, loads that garnishment via the list query and updates it (PUT).\n * When omitted, the form is in create mode (POST).\n */\n garnishmentId?: string\n /**\n * Court-ordered deductions are stored as garnishments with `courtOrdered: true`\n * and require a `garnishmentType` (Federal Tax Lien, Student Loan, etc.).\n * When `false`, the form is for a \"custom\" post-tax deduction —\n * `garnishmentType` is excluded from the schema and submit payload.\n *\n * Note: this hook does NOT handle `garnishmentType: 'child_support'`. Use\n * `useChildSupportGarnishmentForm` for child-support agency-keyed payloads.\n */\n courtOrdered: boolean\n optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire\n defaultValues?: Partial<DeductionFormData>\n validationMode?: UseFormProps['mode']\n shouldFocusError?: boolean\n}\n\nexport interface DeductionFormFields {\n Description: typeof DescriptionField\n Recurring: typeof RecurringField\n DeductAsPercentage: typeof DeductAsPercentageField\n Amount: typeof AmountField\n /** Only available when `status.isRecurring` is true. */\n TotalAmount: typeof TotalAmountField | undefined\n /** Only available when `status.isRecurring` is true. */\n AnnualMaximum: typeof AnnualMaximumField | undefined\n /** Only available when `courtOrdered: true`. */\n GarnishmentType: typeof GarnishmentTypeField | undefined\n}\n\nexport interface UseDeductionFormReady extends BaseFormHookReady<\n FieldsMetadata,\n DeductionFormData,\n DeductionFormFields\n> {\n data: {\n /** The garnishment loaded for update; `null` in create mode. */\n deduction: Garnishment | null\n }\n status: {\n isPending: boolean\n mode: 'create' | 'update'\n /**\n * Mirrors the watched `recurring` value. Cap fields (`TotalAmount`,\n * `AnnualMaximum`) are only included on `Fields` when this is true — the\n * consumer can render them unconditionally and the gating happens in the\n * hook.\n */\n isRecurring: boolean\n }\n actions: {\n onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>\n }\n}\n\nexport type UseDeductionFormResult = HookLoadingResult | UseDeductionFormReady\n\nexport function useDeductionForm({\n employeeId,\n garnishmentId,\n courtOrdered,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseDeductionFormProps): UseDeductionFormResult {\n const isCreateMode = !garnishmentId\n const schemaMode = isCreateMode ? 'create' : 'update'\n\n // The garnishments API has no single-row GET — the list endpoint is the only\n // way to retrieve an existing garnishment. We use the (non-suspense) list\n // query and pick the matching row by uuid.\n const garnishmentsListQuery = useGarnishmentsListMutationLikeLoader({\n employeeId,\n enabled: !isCreateMode,\n })\n\n const fetchedDeduction = useMemo(() => {\n if (isCreateMode) return null\n return garnishmentsListQuery.data?.find(g => g.uuid === garnishmentId) ?? null\n }, [isCreateMode, garnishmentId, garnishmentsListQuery.data])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createDeductionFormSchema({\n mode: schemaMode,\n courtOrdered,\n optionalFieldsToRequire,\n }),\n [schemaMode, courtOrdered, optionalFieldsToRequire],\n )\n\n const resolvedDefaults: DeductionFormData = useMemo(\n () => ({\n description: fetchedDeduction?.description ?? partnerDefaults?.description ?? '',\n recurring: fetchedDeduction?.recurring ?? partnerDefaults?.recurring ?? true,\n deductAsPercentage:\n fetchedDeduction?.deductAsPercentage ?? partnerDefaults?.deductAsPercentage ?? true,\n amount: fetchedDeduction?.amount\n ? Number(fetchedDeduction.amount)\n : (partnerDefaults?.amount ?? 0),\n // Caps stay as numbers in the form (0 means \"no cap\"); the hook drops\n // them to null on the wire in onSubmit.\n totalAmount: fetchedDeduction?.totalAmount\n ? Number(fetchedDeduction.totalAmount)\n : (partnerDefaults?.totalAmount ?? 0),\n annualMaximum: fetchedDeduction?.annualMaximum\n ? Number(fetchedDeduction.annualMaximum)\n : (partnerDefaults?.annualMaximum ?? 0),\n garnishmentType:\n fetchedDeduction?.garnishmentType ??\n partnerDefaults?.garnishmentType ??\n // First non-child-support type — partners typically pick via the\n // GarnishmentType select before saving.\n 'federal_tax_lien',\n }),\n [fetchedDeduction, partnerDefaults],\n )\n\n const formMethods = useForm<DeductionFormData, unknown, DeductionFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n // The cap fields only appear when the deduction is recurring. Watching here\n // (inside the hook) keeps the consumer from having to reach into\n // hookFormInternals — the conditional Fields below flip to `undefined`.\n // The `recurring` RadioGroup round-trips its value as the strings `'true'`/\n // `'false'` (only the zod preprocessor coerces to a real boolean at\n // validation time). The string `'false'` is truthy, so reading the raw\n // watched value here would leave the cap fields visible for one-time\n // deductions after a frequency toggle. Compare against both shapes — mirrors\n // the `deductAsPercentage` handling in StandardDeductionForm.\n const watchedRecurring = useWatch({ control: formMethods.control, name: 'recurring' }) as\n | boolean\n | 'true'\n | 'false'\n | undefined\n const isRecurring = watchedRecurring === true || watchedRecurring === 'true'\n\n const createGarnishmentMutation = useGarnishmentsCreateMutation()\n const updateGarnishmentMutation = useGarnishmentsUpdateMutation()\n const isPending = createGarnishmentMutation.isPending || updateGarnishmentMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('DeductionForm')\n\n const queriesForErrors = !isCreateMode ? [garnishmentsListQuery] : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const garnishmentTypeOptions = GARNISHMENT_TYPES.map(value => ({ value, label: value }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const fieldsMetadata = {\n description: baseMetadata.description,\n recurring: withOptions<boolean>(\n baseMetadata.recurring,\n [\n { value: 'true', label: 'true' },\n { value: 'false', label: 'false' },\n ],\n [true, false],\n ),\n deductAsPercentage: withOptions<boolean>(\n baseMetadata.deductAsPercentage,\n [\n { value: 'true', label: 'true' },\n { value: 'false', label: 'false' },\n ],\n [true, false],\n ),\n amount: baseMetadata.amount,\n totalAmount: baseMetadata.totalAmount,\n annualMaximum: baseMetadata.annualMaximum,\n garnishmentType: courtOrdered\n ? withOptions(baseMetadata.garnishmentType, garnishmentTypeOptions, GARNISHMENT_TYPES)\n : baseMetadata.garnishmentType,\n }\n\n const onSubmit = async (): Promise<HookSubmitResult<Garnishment> | undefined> => {\n let submitResult: HookSubmitResult<Garnishment> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: DeductionFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n // The API's `times` column is \"number of remaining occurrences\" —\n // for one-time deductions we set it to 1, for recurring we null it\n // out. Matches the legacy GarnishmentForm/CustomDeductionForm.\n const times = payload.recurring ? null : 1\n // Wire conversions: amount is always a string; the optional caps\n // collapse to undefined when the partner left them at zero.\n const amountStr = String(payload.amount)\n const totalAmountStr = payload.totalAmount > 0 ? String(payload.totalAmount) : undefined\n const annualMaximumStr =\n payload.annualMaximum > 0 ? String(payload.annualMaximum) : undefined\n\n let updated: Garnishment | undefined\n\n if (isCreateMode) {\n const result = await createGarnishmentMutation.mutateAsync({\n request: {\n employeeId,\n garnishmentRequest: {\n active: true,\n description: payload.description,\n recurring: payload.recurring,\n deductAsPercentage: payload.deductAsPercentage,\n amount: amountStr,\n totalAmount: totalAmountStr,\n annualMaximum: annualMaximumStr,\n courtOrdered,\n garnishmentType: courtOrdered ? payload.garnishmentType : undefined,\n times,\n },\n },\n })\n updated = result.garnishment\n } else {\n if (!fetchedDeduction) {\n throw new SDKInternalError(\n 'Cannot update deduction: no matching garnishment on file',\n )\n }\n const result = await updateGarnishmentMutation.mutateAsync({\n request: {\n garnishmentId: fetchedDeduction.uuid,\n updateGarnishmentRequest: {\n version: fetchedDeduction.version as string,\n active: true,\n description: payload.description,\n recurring: payload.recurring,\n deductAsPercentage: payload.deductAsPercentage,\n amount: amountStr,\n totalAmount: totalAmountStr,\n annualMaximum: annualMaximumStr,\n courtOrdered,\n // The API rejects garnishment_type changes on update — only\n // include when court-ordered AND when matching the loaded\n // row's type (no-op pass-through).\n garnishmentType: courtOrdered ? payload.garnishmentType : undefined,\n times,\n },\n },\n })\n updated = result.garnishment\n }\n\n if (!updated) {\n throw new SDKInternalError(\n isCreateMode ? 'Deduction creation failed' : 'Deduction update failed',\n )\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updated,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (!isCreateMode && garnishmentsListQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n deduction: fetchedDeduction,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n isRecurring,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Description: DescriptionField,\n Recurring: RecurringField,\n DeductAsPercentage: DeductAsPercentageField,\n Amount: AmountField,\n TotalAmount: isRecurring ? TotalAmountField : undefined,\n AnnualMaximum: isRecurring ? AnnualMaximumField : undefined,\n GarnishmentType: courtOrdered ? GarnishmentTypeField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\nexport type DeductionFormFieldsMetadata = UseDeductionFormReady['form']['fieldsMetadata']\nexport type DeductionFormFieldsType = UseDeductionFormReady['form']['Fields']\n\n// ── Internal loader ─────────────────────────────────────────────────────\n//\n// `useGarnishmentsList` is the only way to retrieve an existing garnishment\n// row — the API has no single-row GET. We expose a tiny wrapper that returns\n// the array directly so the hook above can `.find()` by uuid. Skips the fetch\n// entirely in create mode via `enabled: false`.\n\nfunction useGarnishmentsListMutationLikeLoader({\n employeeId,\n enabled,\n}: {\n employeeId: string\n enabled: boolean\n}) {\n const query = useGarnishmentsList({ employeeId }, { enabled })\n return {\n data: query.data?.garnishments,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n }\n}\n"],"names":["GARNISHMENT_TYPES","useDeductionForm","employeeId","garnishmentId","courtOrdered","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","isCreateMode","schemaMode","garnishmentsListQuery","useGarnishmentsListMutationLikeLoader","fetchedDeduction","useMemo","g","schema","metadataConfig","createDeductionFormSchema","resolvedDefaults","formMethods","useForm","zodResolver","watchedRecurring","useWatch","isRecurring","createGarnishmentMutation","useGarnishmentsCreateMutation","updateGarnishmentMutation","useGarnishmentsUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","garnishmentTypeOptions","value","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","submitResult","resolve","data","payload","times","amountStr","totalAmountStr","annualMaximumStr","updated","SDKInternalError","hookFormInternals","useHookFormInternals","DescriptionField","RecurringField","DeductAsPercentageField","AmountField","TotalAmountField","AnnualMaximumField","GarnishmentTypeField","createGetFormSubmissionValues","enabled","query","useGarnishmentsList"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"useDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsUpdate'\nimport { useGarnishmentsList } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsList'\nimport {\n createDeductionFormSchema,\n type DeductionFormData,\n type DeductionFormOutputs,\n type DeductionFormOptionalFieldsToRequire,\n} from './deductionFormSchema'\nimport {\n DescriptionField,\n RecurringField,\n DeductAsPercentageField,\n AmountField,\n TotalAmountField,\n AnnualMaximumField,\n GarnishmentTypeField,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\n\nexport type { DeductionFormOptionalFieldsToRequire } from './deductionFormSchema'\n\n// GarnishmentType is a runtime enum; the schema gates which values are valid.\n// The hook's `withOptions` entries below carry the raw enum values so the\n// consumer can supply translated labels via `getOptionLabel` on the field.\n//\n// `'child_support'` is intentionally omitted — child-support garnishments\n// require agency-keyed required attributes (case number, order number,\n// remittance number, county) that this hook doesn't model. Use\n// `useChildSupportGarnishmentForm` for those.\nconst GARNISHMENT_TYPES: readonly GarnishmentType[] = [\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n] as const\n\n/**\n * Configuration options for {@link useDeductionForm}.\n *\n * @remarks\n * Presence or absence of `garnishmentId` selects the API verb — see the\n * `garnishmentId` field description. `courtOrdered` selects between the\n * post-tax custom variant and the court-ordered garnishment variant.\n *\n * @public\n */\nexport interface UseDeductionFormProps {\n /** UUID of the employee whose deduction is being created or edited. */\n employeeId: string\n /**\n * When set, loads that garnishment and updates it (PUT). When omitted, the\n * form is in create mode (POST).\n */\n garnishmentId?: string\n /**\n * Court-ordered deductions are stored as garnishments with `courtOrdered: true`\n * and require a `garnishmentType` (Federal Tax Lien, Student Loan, etc.).\n * When `false`, the form is for a \"custom\" post-tax deduction —\n * `garnishmentType` is excluded from the schema and submit payload.\n *\n * Note: this hook does NOT handle `garnishmentType: 'child_support'`. Use\n * {@link useChildSupportGarnishmentForm} for child-support agency-keyed payloads.\n */\n courtOrdered: boolean\n /** Override fields that are optional on a given mode to be required. See {@link DeductionFormOptionalFieldsToRequire}. */\n optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire\n /** Pre-fill form values. Server data takes precedence on update. */\n defaultValues?: Partial<DeductionFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useDeductionForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.TotalAmount && <Fields.TotalAmount ... />}`) before rendering.\n *\n * @public\n */\nexport interface DeductionFormFields {\n /** Description text input. Always available. */\n Description: typeof DescriptionField\n /** Recurring vs one-time radio group. Always available. */\n Recurring: typeof RecurringField\n /** Fixed-amount vs percentage radio group. Always available. */\n DeductAsPercentage: typeof DeductAsPercentageField\n /** Deduction amount input. Always available. */\n Amount: typeof AmountField\n /** Only available when `status.isRecurring` is true. */\n TotalAmount: typeof TotalAmountField | undefined\n /** Only available when `status.isRecurring` is true. */\n AnnualMaximum: typeof AnnualMaximumField | undefined\n /** Only available when `courtOrdered: true`. */\n GarnishmentType: typeof GarnishmentTypeField | undefined\n}\n\n/**\n * Ready-state shape returned by {@link useDeductionForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the deduction-specific `data`, `status`, `actions`, and `form.Fields` shape.\n * Static, entity-derived values live under `data.*`; reactive values that\n * flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseDeductionFormReady extends BaseFormHookReady<\n FieldsMetadata,\n DeductionFormData,\n DeductionFormFields\n> {\n /** Deduction-specific data payload: the loaded garnishment for update mode, or `null` in create mode. */\n data: {\n /** The garnishment loaded for update; `null` in create mode. */\n deduction: Garnishment | null\n }\n /** Submission state and reactive flags derived from current form input. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new deduction or PUT an existing one. */\n mode: 'create' | 'update'\n /**\n * Mirrors the watched `recurring` value. Cap fields (`TotalAmount`,\n * `AnnualMaximum`) are only included on `Fields` when this is true — the\n * consumer can render them unconditionally and the gating happens in the\n * hook.\n */\n isRecurring: boolean\n }\n /** Submission action. */\n actions: {\n /** Submits the form. Returns the saved garnishment + mode on success, or `undefined` when validation fails or the request errored. */\n onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>\n }\n}\n\n/**\n * Return value of {@link useDeductionForm}.\n *\n * @remarks\n * Discriminated union: {@link HookLoadingResult} while the existing garnishment\n * is loading (update mode only); {@link UseDeductionFormReady} once data is\n * ready. In create mode the hook returns the ready branch immediately.\n *\n * @public\n */\nexport type UseDeductionFormResult = HookLoadingResult | UseDeductionFormReady\n\n/**\n * Headless hook for creating or updating a non-child-support deduction.\n *\n * @remarks\n * Both variants — post-tax custom deductions and court-ordered garnishments —\n * share the same field set (description, frequency, deduct-as-percentage,\n * amount, optional caps) and differ only in whether the deduction is\n * court-ordered and carries a `garnishmentType`. Set `courtOrdered: true` to\n * surface the garnishment-type select; set it to `false` for a custom post-tax\n * deduction.\n *\n * Presence or absence of `garnishmentId` selects the API verb: omit it to POST\n * a new deduction, supply it to PUT updates against the existing row. For\n * child-support garnishments, use {@link useChildSupportGarnishmentForm}\n * instead — those require agency-keyed required attributes (case number,\n * order number, remittance number, county) that this hook doesn't model.\n *\n * @param input - See {@link UseDeductionFormProps}.\n * @returns A {@link HookLoadingResult} while loading, or a {@link UseDeductionFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useDeductionForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function CustomDeductionPage({ employeeId, garnishmentId }: { employeeId: string; garnishmentId?: string }) {\n * const form = useDeductionForm({ employeeId, garnishmentId, courtOrdered: false })\n *\n * if (form.isLoading) return <p>Loading…</p>\n *\n * const { Fields } = form.form\n *\n * return (\n * <SDKFormProvider formHookResult={form}>\n * <form\n * onSubmit={e => {\n * e.preventDefault()\n * void form.actions.onSubmit()\n * }}\n * >\n * <Fields.Description label=\"Description\" validationMessages={{ REQUIRED: 'Required' }} />\n * <Fields.Recurring\n * label=\"Frequency\"\n * getOptionLabel={v => (v ? 'Recurring' : 'One-time')}\n * validationMessages={{ REQUIRED: 'Required' }}\n * />\n * <Fields.Amount\n * label=\"Amount\"\n * validationMessages={{ REQUIRED: 'Required', NEGATIVE_AMOUNT: 'Must be ≥ 0' }}\n * />\n * {Fields.TotalAmount && (\n * <Fields.TotalAmount label=\"Total cap\" validationMessages={{ NEGATIVE_AMOUNT: 'Must be ≥ 0' }} />\n * )}\n * <button type=\"submit\">Save</button>\n * </form>\n * </SDKFormProvider>\n * )\n * }\n * ```\n */\nexport function useDeductionForm({\n employeeId,\n garnishmentId,\n courtOrdered,\n optionalFieldsToRequire,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseDeductionFormProps): UseDeductionFormResult {\n const isCreateMode = !garnishmentId\n const schemaMode = isCreateMode ? 'create' : 'update'\n\n // The garnishments API has no single-row GET — the list endpoint is the only\n // way to retrieve an existing garnishment. We use the (non-suspense) list\n // query and pick the matching row by uuid.\n const garnishmentsListQuery = useGarnishmentsListMutationLikeLoader({\n employeeId,\n enabled: !isCreateMode,\n })\n\n const fetchedDeduction = useMemo(() => {\n if (isCreateMode) return null\n return garnishmentsListQuery.data?.find(g => g.uuid === garnishmentId) ?? null\n }, [isCreateMode, garnishmentId, garnishmentsListQuery.data])\n\n const [schema, metadataConfig] = useMemo(\n () =>\n createDeductionFormSchema({\n mode: schemaMode,\n courtOrdered,\n optionalFieldsToRequire,\n }),\n [schemaMode, courtOrdered, optionalFieldsToRequire],\n )\n\n const resolvedDefaults: DeductionFormData = useMemo(\n () => ({\n description: fetchedDeduction?.description ?? partnerDefaults?.description ?? '',\n recurring: fetchedDeduction?.recurring ?? partnerDefaults?.recurring ?? true,\n deductAsPercentage:\n fetchedDeduction?.deductAsPercentage ?? partnerDefaults?.deductAsPercentage ?? true,\n amount: fetchedDeduction?.amount\n ? Number(fetchedDeduction.amount)\n : (partnerDefaults?.amount ?? 0),\n // Caps stay as numbers in the form (0 means \"no cap\"); the hook drops\n // them to null on the wire in onSubmit.\n totalAmount: fetchedDeduction?.totalAmount\n ? Number(fetchedDeduction.totalAmount)\n : (partnerDefaults?.totalAmount ?? 0),\n annualMaximum: fetchedDeduction?.annualMaximum\n ? Number(fetchedDeduction.annualMaximum)\n : (partnerDefaults?.annualMaximum ?? 0),\n garnishmentType:\n fetchedDeduction?.garnishmentType ??\n partnerDefaults?.garnishmentType ??\n // First non-child-support type — partners typically pick via the\n // GarnishmentType select before saving.\n 'federal_tax_lien',\n }),\n [fetchedDeduction, partnerDefaults],\n )\n\n const formMethods = useForm<DeductionFormData, unknown, DeductionFormOutputs>({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n // The cap fields only appear when the deduction is recurring. Watching here\n // (inside the hook) keeps the consumer from having to reach into\n // hookFormInternals — the conditional Fields below flip to `undefined`.\n // The `recurring` RadioGroup round-trips its value as the strings `'true'`/\n // `'false'` (only the zod preprocessor coerces to a real boolean at\n // validation time). The string `'false'` is truthy, so reading the raw\n // watched value here would leave the cap fields visible for one-time\n // deductions after a frequency toggle. Compare against both shapes — mirrors\n // the `deductAsPercentage` handling in StandardDeductionForm.\n const watchedRecurring = useWatch({ control: formMethods.control, name: 'recurring' }) as\n | boolean\n | 'true'\n | 'false'\n | undefined\n const isRecurring = watchedRecurring === true || watchedRecurring === 'true'\n\n const createGarnishmentMutation = useGarnishmentsCreateMutation()\n const updateGarnishmentMutation = useGarnishmentsUpdateMutation()\n const isPending = createGarnishmentMutation.isPending || updateGarnishmentMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('DeductionForm')\n\n const queriesForErrors = !isCreateMode ? [garnishmentsListQuery] : []\n const errorHandling = composeErrorHandler(queriesForErrors, { submitError, setSubmitError })\n\n const garnishmentTypeOptions = GARNISHMENT_TYPES.map(value => ({ value, label: value }))\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const fieldsMetadata = {\n description: baseMetadata.description,\n recurring: withOptions<boolean>(\n baseMetadata.recurring,\n [\n { value: 'true', label: 'true' },\n { value: 'false', label: 'false' },\n ],\n [true, false],\n ),\n deductAsPercentage: withOptions<boolean>(\n baseMetadata.deductAsPercentage,\n [\n { value: 'true', label: 'true' },\n { value: 'false', label: 'false' },\n ],\n [true, false],\n ),\n amount: baseMetadata.amount,\n totalAmount: baseMetadata.totalAmount,\n annualMaximum: baseMetadata.annualMaximum,\n garnishmentType: courtOrdered\n ? withOptions(baseMetadata.garnishmentType, garnishmentTypeOptions, GARNISHMENT_TYPES)\n : baseMetadata.garnishmentType,\n }\n\n const onSubmit = async (): Promise<HookSubmitResult<Garnishment> | undefined> => {\n let submitResult: HookSubmitResult<Garnishment> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: DeductionFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n // The API's `times` column is \"number of remaining occurrences\" —\n // for one-time deductions we set it to 1, for recurring we null it\n // out. Matches the legacy GarnishmentForm/CustomDeductionForm.\n const times = payload.recurring ? null : 1\n // Wire conversions: amount is always a string; the optional caps\n // collapse to undefined when the partner left them at zero.\n const amountStr = String(payload.amount)\n const totalAmountStr = payload.totalAmount > 0 ? String(payload.totalAmount) : undefined\n const annualMaximumStr =\n payload.annualMaximum > 0 ? String(payload.annualMaximum) : undefined\n\n let updated: Garnishment | undefined\n\n if (isCreateMode) {\n const result = await createGarnishmentMutation.mutateAsync({\n request: {\n employeeId,\n garnishmentRequest: {\n active: true,\n description: payload.description,\n recurring: payload.recurring,\n deductAsPercentage: payload.deductAsPercentage,\n amount: amountStr,\n totalAmount: totalAmountStr,\n annualMaximum: annualMaximumStr,\n courtOrdered,\n garnishmentType: courtOrdered ? payload.garnishmentType : undefined,\n times,\n },\n },\n })\n updated = result.garnishment\n } else {\n if (!fetchedDeduction) {\n throw new SDKInternalError(\n 'Cannot update deduction: no matching garnishment on file',\n )\n }\n const result = await updateGarnishmentMutation.mutateAsync({\n request: {\n garnishmentId: fetchedDeduction.uuid,\n updateGarnishmentRequest: {\n version: fetchedDeduction.version as string,\n active: true,\n description: payload.description,\n recurring: payload.recurring,\n deductAsPercentage: payload.deductAsPercentage,\n amount: amountStr,\n totalAmount: totalAmountStr,\n annualMaximum: annualMaximumStr,\n courtOrdered,\n // The API rejects garnishment_type changes on update — only\n // include when court-ordered AND when matching the loaded\n // row's type (no-op pass-through).\n garnishmentType: courtOrdered ? payload.garnishmentType : undefined,\n times,\n },\n },\n })\n updated = result.garnishment\n }\n\n if (!updated) {\n throw new SDKInternalError(\n isCreateMode ? 'Deduction creation failed' : 'Deduction update failed',\n )\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updated,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (!isCreateMode && garnishmentsListQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n deduction: fetchedDeduction,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n isRecurring,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n Description: DescriptionField,\n Recurring: RecurringField,\n DeductAsPercentage: DeductAsPercentageField,\n Amount: AmountField,\n TotalAmount: isRecurring ? TotalAmountField : undefined,\n AnnualMaximum: isRecurring ? AnnualMaximumField : undefined,\n GarnishmentType: courtOrdered ? GarnishmentTypeField : undefined,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Per-field metadata returned by {@link useDeductionForm} as `form.fieldsMetadata`.\n *\n * @remarks\n * Carries per-field `isRequired`, `isDisabled`, label, description, and option\n * entries derived from the schema and form state. Use these to drive UI such\n * as disabled state or option lists when not relying on the pre-bound\n * {@link DeductionFormFields} components.\n *\n * @public\n */\nexport type DeductionFormFieldsMetadata = UseDeductionFormReady['form']['fieldsMetadata']\n\n// ── Internal loader ─────────────────────────────────────────────────────\n//\n// `useGarnishmentsList` is the only way to retrieve an existing garnishment\n// row — the API has no single-row GET. We expose a tiny wrapper that returns\n// the array directly so the hook above can `.find()` by uuid. Skips the fetch\n// entirely in create mode via `enabled: false`.\n\nfunction useGarnishmentsListMutationLikeLoader({\n employeeId,\n enabled,\n}: {\n employeeId: string\n enabled: boolean\n}) {\n const query = useGarnishmentsList({ employeeId }, { enabled })\n return {\n data: query.data?.garnishments,\n isLoading: query.isLoading,\n error: query.error,\n refetch: query.refetch,\n }\n}\n"],"names":["GARNISHMENT_TYPES","useDeductionForm","employeeId","garnishmentId","courtOrdered","optionalFieldsToRequire","partnerDefaults","validationMode","shouldFocusError","isCreateMode","schemaMode","garnishmentsListQuery","useGarnishmentsListMutationLikeLoader","fetchedDeduction","useMemo","g","schema","metadataConfig","createDeductionFormSchema","resolvedDefaults","formMethods","useForm","zodResolver","watchedRecurring","useWatch","isRecurring","createGarnishmentMutation","useGarnishmentsCreateMutation","updateGarnishmentMutation","useGarnishmentsUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","garnishmentTypeOptions","value","baseMetadata","useDeriveFieldsMetadata","fieldsMetadata","withOptions","onSubmit","submitResult","resolve","data","payload","times","amountStr","totalAmountStr","annualMaximumStr","updated","SDKInternalError","hookFormInternals","useHookFormInternals","DescriptionField","RecurringField","DeductAsPercentageField","AmountField","TotalAmountField","AnnualMaximumField","GarnishmentTypeField","createGetFormSubmissionValues","enabled","query","useGarnishmentsList"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAMA,IAAgD;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAsLO,SAASC,GAAiB;AAAA,EAC/B,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAAkD;AAChD,QAAMC,IAAe,CAACN,GAChBO,IAAaD,IAAe,WAAW,UAKvCE,IAAwBC,GAAsC;AAAA,IAClE,YAAAV;AAAA,IACA,SAAS,CAACO;AAAA,EAAA,CACX,GAEKI,IAAmBC,EAAQ,MAC3BL,IAAqB,OAClBE,EAAsB,MAAM,KAAK,OAAKI,EAAE,SAASZ,CAAa,KAAK,MACzE,CAACM,GAAcN,GAAeQ,EAAsB,IAAI,CAAC,GAEtD,CAACK,GAAQC,CAAc,IAAIH;AAAA,IAC/B,MACEI,EAA0B;AAAA,MACxB,MAAMR;AAAA,MACN,cAAAN;AAAA,MACA,yBAAAC;AAAA,IAAA,CACD;AAAA,IACH,CAACK,GAAYN,GAAcC,CAAuB;AAAA,EAAA,GAG9Cc,IAAsCL;AAAA,IAC1C,OAAO;AAAA,MACL,aAAaD,GAAkB,eAAeP,GAAiB,eAAe;AAAA,MAC9E,WAAWO,GAAkB,aAAaP,GAAiB,aAAa;AAAA,MACxE,oBACEO,GAAkB,sBAAsBP,GAAiB,sBAAsB;AAAA,MACjF,QAAQO,GAAkB,SACtB,OAAOA,EAAiB,MAAM,IAC7BP,GAAiB,UAAU;AAAA;AAAA;AAAA,MAGhC,aAAaO,GAAkB,cAC3B,OAAOA,EAAiB,WAAW,IAClCP,GAAiB,eAAe;AAAA,MACrC,eAAeO,GAAkB,gBAC7B,OAAOA,EAAiB,aAAa,IACpCP,GAAiB,iBAAiB;AAAA,MACvC,iBACEO,GAAkB,mBAClBP,GAAiB;AAAA;AAAA,MAGjB;AAAA,IAAA;AAAA,IAEJ,CAACO,GAAkBP,CAAe;AAAA,EAAA,GAG9Bc,IAAcC,EAA0D;AAAA,IAC5E,UAAUC,EAAYN,CAAM;AAAA,IAC5B,MAAMT;AAAA,IACN,kBAAAC;AAAA,IACA,eAAeW;AAAA,IACf,QAAQA;AAAA,IACR,cAAc,EAAE,iBAAiB,GAAA;AAAA,EAAK,CACvC,GAWKI,IAAmBC,EAAS,EAAE,SAASJ,EAAY,SAAS,MAAM,aAAa,GAK/EK,IAAcF,MAAqB,MAAQA,MAAqB,QAEhEG,IAA4BC,EAAA,GAC5BC,IAA4BC,EAAA,GAC5BC,IAAYJ,EAA0B,aAAaE,EAA0B,WAE7E;AAAA,IACJ,mBAAAG;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,GAAc,eAAe,GAG3BC,IAAgBC,GADI3B,IAAyC,CAAA,IAA1B,CAACE,CAAqB,GACH,EAAE,aAAAqB,GAAa,gBAAAC,GAAgB,GAErFI,IAAyBrC,EAAkB,IAAI,CAAAsC,OAAU,EAAE,OAAAA,GAAO,OAAOA,IAAQ,GAEjFC,IAAeC,GAAwBvB,GAAgBG,EAAY,OAAO,GAC1EqB,IAAiB;AAAA,IACrB,aAAaF,EAAa;AAAA,IAC1B,WAAWG;AAAA,MACTH,EAAa;AAAA,MACb;AAAA,QACE,EAAE,OAAO,QAAQ,OAAO,OAAA;AAAA,QACxB,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,MAAQ;AAAA,MAEnC,CAAC,IAAM,EAAK;AAAA,IAAA;AAAA,IAEd,oBAAoBG;AAAA,MAClBH,EAAa;AAAA,MACb;AAAA,QACE,EAAE,OAAO,QAAQ,OAAO,OAAA;AAAA,QACxB,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,MAAQ;AAAA,MAEnC,CAAC,IAAM,EAAK;AAAA,IAAA;AAAA,IAEd,QAAQA,EAAa;AAAA,IACrB,aAAaA,EAAa;AAAA,IAC1B,eAAeA,EAAa;AAAA,IAC5B,iBAAiBnC,IACbsC,EAAYH,EAAa,iBAAiBF,GAAwBrC,CAAiB,IACnFuC,EAAa;AAAA,EAAA,GAGbI,IAAW,YAAgE;AAC/E,QAAIC;AAEJ,iBAAM,IAAI,QAAc,CAAAC,MAAW;AACjC,MAAKzB,EAAY;AAAA,QACf,OAAO0B,MAA+B;AACpC,gBAAMf,EAAkBe,GAAM,OAAMC,MAAW;AAI7C,kBAAMC,IAAQD,EAAQ,YAAY,OAAO,GAGnCE,IAAY,OAAOF,EAAQ,MAAM,GACjCG,IAAiBH,EAAQ,cAAc,IAAI,OAAOA,EAAQ,WAAW,IAAI,QACzEI,IACJJ,EAAQ,gBAAgB,IAAI,OAAOA,EAAQ,aAAa,IAAI;AAE9D,gBAAIK;AAEJ,gBAAI3C;AAkBF,cAAA2C,KAjBe,MAAM1B,EAA0B,YAAY;AAAA,gBACzD,SAAS;AAAA,kBACP,YAAAxB;AAAA,kBACA,oBAAoB;AAAA,oBAClB,QAAQ;AAAA,oBACR,aAAa6C,EAAQ;AAAA,oBACrB,WAAWA,EAAQ;AAAA,oBACnB,oBAAoBA,EAAQ;AAAA,oBAC5B,QAAQE;AAAA,oBACR,aAAaC;AAAA,oBACb,eAAeC;AAAA,oBACf,cAAA/C;AAAA,oBACA,iBAAiBA,IAAe2C,EAAQ,kBAAkB;AAAA,oBAC1D,OAAAC;AAAA,kBAAA;AAAA,gBACF;AAAA,cACF,CACD,GACgB;AAAA,iBACZ;AACL,kBAAI,CAACnC;AACH,sBAAM,IAAIwC;AAAA,kBACR;AAAA,gBAAA;AAwBJ,cAAAD,KArBe,MAAMxB,EAA0B,YAAY;AAAA,gBACzD,SAAS;AAAA,kBACP,eAAef,EAAiB;AAAA,kBAChC,0BAA0B;AAAA,oBACxB,SAASA,EAAiB;AAAA,oBAC1B,QAAQ;AAAA,oBACR,aAAakC,EAAQ;AAAA,oBACrB,WAAWA,EAAQ;AAAA,oBACnB,oBAAoBA,EAAQ;AAAA,oBAC5B,QAAQE;AAAA,oBACR,aAAaC;AAAA,oBACb,eAAeC;AAAA,oBACf,cAAA/C;AAAA;AAAA;AAAA;AAAA,oBAIA,iBAAiBA,IAAe2C,EAAQ,kBAAkB;AAAA,oBAC1D,OAAAC;AAAA,kBAAA;AAAA,gBACF;AAAA,cACF,CACD,GACgB;AAAA,YACnB;AAEA,gBAAI,CAACI;AACH,oBAAM,IAAIC;AAAA,gBACR5C,IAAe,8BAA8B;AAAA,cAAA;AAIjD,YAAAmC,IAAe;AAAA,cACb,MAAMnC,IAAe,WAAW;AAAA,cAChC,MAAM2C;AAAA,YAAA;AAAA,UAEV,CAAC,GACDP,EAAA;AAAA,QACF;AAAA,QACA,MAAM;AACJ,UAAAA,EAAA;AAAA,QACF;AAAA,MAAA,EACF;AAAA,IACF,CAAC,GAEMD;AAAA,EACT,GAEMU,IAAoBC,GAAqBnC,CAAW;AAE1D,SAAI,CAACX,KAAgBE,EAAsB,YAClC,EAAE,WAAW,IAAe,eAAAwB,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,WAAWtB;AAAA,IAAA;AAAA,IAEb,QAAQ;AAAA,MACN,WAAAiB;AAAA,MACA,MAAMrB,IAAe,WAAW;AAAA,MAChC,aAAAgB;AAAA,IAAA;AAAA,IAEF,SAAS,EAAE,UAAAkB,EAAA;AAAA,IACX,eAAAR;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,aAAaqB;AAAA,QACb,WAAWC;AAAA,QACX,oBAAoBC;AAAA,QACpB,QAAQC;AAAA,QACR,aAAalC,IAAcmC,IAAmB;AAAA,QAC9C,eAAenC,IAAcoC,IAAqB;AAAA,QAClD,iBAAiBzD,IAAe0D,IAAuB;AAAA,MAAA;AAAA,MAEzD,gBAAArB;AAAA,MACA,mBAAAa;AAAA,MACA,yBAAyBS,GAA8B3C,GAAaJ,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;AAsBA,SAASJ,GAAsC;AAAA,EAC7C,YAAAV;AAAA,EACA,SAAA8D;AACF,GAGG;AACD,QAAMC,IAAQC,EAAoB,EAAE,YAAAhE,KAAc,EAAE,SAAA8D,GAAS;AAC7D,SAAO;AAAA,IACL,MAAMC,EAAM,MAAM;AAAA,IAClB,WAAWA,EAAM;AAAA,IACjB,OAAOA,EAAM;AAAA,IACb,SAASA,EAAM;AAAA,EAAA;AAEnB;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment';
|
|
2
2
|
import { BaseHookReady, HookLoadingResult, HookSubmitResult } from '../../../../partner-hook-utils/types';
|
|
3
|
+
/** @internal */
|
|
3
4
|
export interface UseDeductionsListProps {
|
|
4
5
|
employeeId: string;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
interface DeductionsListDeleteResult {
|
|
7
8
|
garnishment: Garnishment;
|
|
8
9
|
remainingActiveCount: number;
|
|
9
10
|
}
|
|
11
|
+
/** @internal */
|
|
10
12
|
export interface UseDeductionsListReady extends BaseHookReady<{
|
|
11
13
|
deductions: Garnishment[];
|
|
12
14
|
}, {
|
|
@@ -18,5 +20,8 @@ export interface UseDeductionsListReady extends BaseHookReady<{
|
|
|
18
20
|
onDelete: (garnishment: Garnishment) => Promise<HookSubmitResult<DeductionsListDeleteResult> | undefined>;
|
|
19
21
|
};
|
|
20
22
|
}
|
|
23
|
+
/** @internal */
|
|
21
24
|
export type UseDeductionsListResult = HookLoadingResult | UseDeductionsListReady;
|
|
25
|
+
/** @internal */
|
|
22
26
|
export declare function useDeductionsList({ employeeId }: UseDeductionsListProps): UseDeductionsListResult;
|
|
27
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/shared/useDeductionsList.tsx"],"sourcesContent":["import { useGarnishmentsList } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsUpdate'\nimport type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult, HookSubmitResult } from '@/partner-hook-utils/types'\n\nexport interface UseDeductionsListProps {\n employeeId: string\n}\n\
|
|
1
|
+
{"version":3,"file":"useDeductionsList.js","sources":["../../../../../src/components/Employee/Deductions/shared/useDeductionsList.tsx"],"sourcesContent":["import { useGarnishmentsList } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsList'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api-v-2025-11-15/react-query/garnishmentsUpdate'\nimport type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type { BaseHookReady, HookLoadingResult, HookSubmitResult } from '@/partner-hook-utils/types'\n\n/** @internal */\nexport interface UseDeductionsListProps {\n employeeId: string\n}\n\ninterface DeductionsListDeleteResult {\n garnishment: Garnishment\n remainingActiveCount: number\n}\n\n/** @internal */\nexport interface UseDeductionsListReady extends BaseHookReady<\n { deductions: Garnishment[] },\n { isFetching: boolean; isPending: boolean; deletingGarnishmentUuid?: string }\n> {\n actions: {\n onDelete: (\n garnishment: Garnishment,\n ) => Promise<HookSubmitResult<DeductionsListDeleteResult> | undefined>\n }\n}\n\n/** @internal */\nexport type UseDeductionsListResult = HookLoadingResult | UseDeductionsListReady\n\n/** @internal */\nexport function useDeductionsList({ employeeId }: UseDeductionsListProps): UseDeductionsListResult {\n const garnishmentsQuery = useGarnishmentsList({ employeeId })\n const updateMutation = useGarnishmentsUpdateMutation()\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('DeductionsList')\n\n const errorHandling = composeErrorHandler([garnishmentsQuery], {\n submitError,\n setSubmitError,\n })\n\n const onDelete = async (\n garnishment: Garnishment,\n ): Promise<HookSubmitResult<DeductionsListDeleteResult> | undefined> => {\n let result: HookSubmitResult<DeductionsListDeleteResult> | undefined\n await baseSubmitHandler(garnishment, async payload => {\n const response = await updateMutation.mutateAsync({\n request: {\n garnishmentId: payload.uuid as string,\n updateGarnishmentRequest: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n const updated = (response.garnishment ?? payload) as Garnishment\n const currentDeductions = garnishmentsQuery.data?.garnishments ?? []\n const remainingActiveCount = currentDeductions.filter(\n g => g.active && g.uuid !== updated.uuid,\n ).length\n result = {\n mode: 'update',\n data: { garnishment: updated, remainingActiveCount },\n }\n })\n return result\n }\n\n const deletingGarnishmentUuid = updateMutation.isPending\n ? updateMutation.variables.request.garnishmentId\n : undefined\n\n const allDeductions = garnishmentsQuery.data?.garnishments\n\n if (garnishmentsQuery.isLoading || !allDeductions) {\n return { isLoading: true, errorHandling }\n }\n\n const deductions = allDeductions.filter(g => g.active)\n\n return {\n isLoading: false,\n data: { deductions },\n status: {\n isFetching: garnishmentsQuery.isFetching,\n isPending: updateMutation.isPending,\n deletingGarnishmentUuid,\n },\n actions: { onDelete },\n errorHandling,\n }\n}\n"],"names":["useDeductionsList","employeeId","garnishmentsQuery","useGarnishmentsList","updateMutation","useGarnishmentsUpdateMutation","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","onDelete","garnishment","result","payload","updated","remainingActiveCount","g","deletingGarnishmentUuid","allDeductions"],"mappings":";;;;AAiCO,SAASA,EAAkB,EAAE,YAAAC,KAA+D;AACjG,QAAMC,IAAoBC,EAAoB,EAAE,YAAAF,GAAY,GACtDG,IAAiBC,EAAA,GAEjB;AAAA,IACJ,mBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EAAA,IACRC,EAAc,gBAAgB,GAE5BC,IAAgBC,EAAoB,CAACT,CAAiB,GAAG;AAAA,IAC7D,aAAAK;AAAA,IACA,gBAAAC;AAAA,EAAA,CACD,GAEKI,IAAW,OACfC,MACsE;AACtE,QAAIC;AACJ,iBAAMR,EAAkBO,GAAa,OAAME,MAAW;AAYpD,YAAMC,KAXW,MAAMZ,EAAe,YAAY;AAAA,QAChD,SAAS;AAAA,UACP,eAAeW,EAAQ;AAAA,UACvB,0BAA0B;AAAA,YACxB,GAAGA;AAAA,YACH,aAAaA,EAAQ,eAAe;AAAA,YACpC,QAAQ;AAAA,YACR,SAASA,EAAQ;AAAA,UAAA;AAAA,QACnB;AAAA,MACF,CACD,GACyB,eAAeA,GAEnCE,KADoBf,EAAkB,MAAM,gBAAgB,CAAA,GACnB;AAAA,QAC7C,CAAAgB,MAAKA,EAAE,UAAUA,EAAE,SAASF,EAAQ;AAAA,MAAA,EACpC;AACF,MAAAF,IAAS;AAAA,QACP,MAAM;AAAA,QACN,MAAM,EAAE,aAAaE,GAAS,sBAAAC,EAAA;AAAA,MAAqB;AAAA,IAEvD,CAAC,GACMH;AAAA,EACT,GAEMK,IAA0Bf,EAAe,YAC3CA,EAAe,UAAU,QAAQ,gBACjC,QAEEgB,IAAgBlB,EAAkB,MAAM;AAE9C,SAAIA,EAAkB,aAAa,CAACkB,IAC3B,EAAE,WAAW,IAAM,eAAAV,EAAA,IAKrB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,EAAE,YAJSU,EAAc,OAAO,CAAAF,MAAKA,EAAE,MAAM,EAI3C;AAAA,IACR,QAAQ;AAAA,MACN,YAAYhB,EAAkB;AAAA,MAC9B,WAAWE,EAAe;AAAA,MAC1B,yBAAAe;AAAA,IAAA;AAAA,IAEF,SAAS,EAAE,UAAAP,EAAA;AAAA,IACX,eAAAF;AAAA,EAAA;AAEJ;"}
|
|
@@ -5,6 +5,8 @@ import { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/
|
|
|
5
5
|
* `setPendingDeleteDeduction(...)` to open the dialog, and the dialog's
|
|
6
6
|
* confirm calls `handleConfirmDelete`, which in turn invokes the
|
|
7
7
|
* caller-supplied `handleDelete(garnishment)`.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
8
10
|
*/
|
|
9
11
|
export declare function useDeleteDeduction(handleDelete: (garnishment: Garnishment) => Promise<void>): {
|
|
10
12
|
pendingDeleteDeduction: Garnishment | null;
|