@gusto/embedded-react-sdk 0.47.1 → 0.48.1
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 +139 -0
- package/dist/components/Common/EmptyData/EmptyData.d.ts +1 -1
- package/dist/components/Common/EmptyData/EmptyData.js +10 -12
- package/dist/components/Common/EmptyData/EmptyData.js.map +1 -1
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js +6 -10
- package/dist/components/Common/EmptyData/EmptyData.module.scss.js.map +1 -1
- package/dist/components/Common/Form/Form.d.ts +1 -1
- package/dist/components/Common/Form/Form.js +8 -7
- package/dist/components/Common/Form/Form.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.js +8 -8
- package/dist/components/Common/UI/Card/Card.js.map +1 -1
- package/dist/components/Common/UI/Card/Card.module.scss.js +5 -3
- package/dist/components/Common/UI/Card/Card.module.scss.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 +8 -6
- package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
- package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +14 -13
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -17
- 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 +7 -6
- package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +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 -17
- 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 -19
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccount.js +6 -7
- package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
- 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 -17
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
- package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
- package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
- package/dist/components/Company/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 +6 -5
- package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +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 -17
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentSigner.js +2 -3
- package/dist/components/Company/DocumentSigner/DocumentSigner.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/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/Actions.js +7 -6
- package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +10 -7
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Form.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -26
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Actions.js +6 -5
- package/dist/components/Company/Industry/Actions.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -20
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Edit.js +12 -10
- package/dist/components/Company/Industry/Edit.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +14 -14
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/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 -17
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
- package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/List.js +9 -9
- 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 -17
- 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 +4 -18
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleForm.js +5 -4
- package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +8 -8
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -17
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
- package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
- package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -17
- 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 +4 -2
- 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 -19
- 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/PaymentStatement/PaymentStatement.js +2 -3
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +2 -3
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
- 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/ContractorProfileForm.js +13 -13
- package/dist/components/Contractor/Profile/useContractorProfile.d.ts +6 -6
- package/dist/components/Contractor/Profile/useContractorProfile.js +39 -48
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- 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 +2 -3
- 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 +8 -9
- 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 +2 -3
- 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 +2 -3
- 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 +2 -3
- 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 +2 -3
- 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 +2 -3
- 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 +2 -3
- 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 +6 -6
- 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 +2 -3
- 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 +15 -15
- 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 +2 -3
- 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 +2 -3
- 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 +7 -6
- 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 +5 -4
- 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 -17
- 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 +11 -12
- 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 +16 -16
- 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 +7 -4
- 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 +13 -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 +9 -10
- 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 +5 -5
- 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 +5 -5
- 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 +13 -14
- 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 +2 -3
- 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.map +1 -1
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +6 -7
- 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 +15 -15
- 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 +6 -7
- 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 +8 -7
- 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 +10 -9
- 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 +4 -4
- 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 +6 -6
- 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 +11 -12
- 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 +8 -7
- 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 +18 -19
- 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 +10 -11
- 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 +8 -9
- 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 +11 -12
- 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 +8 -8
- 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 +5 -5
- 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 +4 -4
- 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 +9 -10
- 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 +5 -5
- 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 +5 -5
- 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 +2 -3
- 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 +8 -8
- 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 +11 -10
- 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 +6 -7
- 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 -2
- package/dist/components/Employee/exports/employeeManagement.js +58 -56
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +11 -10
- package/dist/components/Employee/exports/employeeOnboarding.js +24 -22
- 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 +1 -1
- package/dist/components/InformationRequests/InformationRequests.js +7 -8
- package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +16 -17
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -3
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +11 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +0 -1
- package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.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 +27 -36
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +10 -10
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +13 -11
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
- package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -7
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
- package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.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/PayrollReceipts/PayrollReceipts.js +6 -7
- package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +6 -7
- package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -1
- package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +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/TransitionCreation/TransitionCreationPresentation.js +10 -10
- 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 +22 -33
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js +2 -3
- package/dist/components/TimeOff/AddEmployeesHoliday/AddEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.js +2 -3
- package/dist/components/TimeOff/AddEmployeesToPolicy/AddEmployeesToPolicy.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 +3 -2
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +2 -3
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +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 +25 -24
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/index.d.ts +1 -6
- package/dist/contexts/GustoProvider/GustoProvider.d.ts +0 -7
- package/dist/contexts/GustoProvider/GustoProvider.js +10 -11
- package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/GustoProvider/index.d.ts +1 -1
- package/dist/contexts/index.d.ts +0 -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/i18n/en/common.json.d.ts +0 -1
- package/dist/i18n/en/common.json.js +2 -2
- package/dist/index.d.ts +18 -16
- package/dist/index.js +229 -163
- package/dist/index.js.map +1 -1
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js +1 -1
- package/dist/node_modules/react-dnd/dist/core/DndProvider.js.map +1 -1
- package/dist/partner-hook-utils/composeErrorHandler.js +3 -1
- package/dist/partner-hook-utils/composeErrorHandler.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js +15 -12
- package/dist/partner-hook-utils/form/fields/CheckboxHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +19 -16
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js +16 -13
- package/dist/partner-hook-utils/form/fields/RadioGroupHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SelectHookField.js +15 -12
- package/dist/partner-hook-utils/form/fields/SelectHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js +21 -18
- package/dist/partner-hook-utils/form/fields/SwitchHookField.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js +12 -9
- package/dist/partner-hook-utils/form/fields/TextInputHookField.js.map +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 -33
- package/docs/reference/endpoint-inventory.json +291 -1070
- package/package.json +32 -18
- package/dist/assets/icons/magnifyingGlass.png.js +0 -5
- package/dist/assets/icons/magnifyingGlass.png.js.map +0 -1
- 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 -13
- 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 -21
- 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
|
@@ -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":"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"}
|
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeleteDeduction.js","sources":["../../../../../src/components/Employee/Deductions/shared/useDeleteDeduction.ts"],"sourcesContent":["import { useState } from 'react'\nimport type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\n\n/**\n * Pending-state + confirm-handler companion for `DeleteDeductionDialog`.\n * Mirrors `useDeleteBankAccount` — the contract is: a row's menu calls\n * `setPendingDeleteDeduction(...)` to open the dialog, and the dialog's\n * confirm calls `handleConfirmDelete`, which in turn invokes the\n * caller-supplied `handleDelete(garnishment)`.\n */\nexport function useDeleteDeduction(handleDelete: (garnishment: Garnishment) => Promise<void>) {\n const [pendingDeleteDeduction, setPendingDeleteDeduction] = useState<Garnishment | null>(null)\n\n const handleConfirmDelete = async () => {\n if (!pendingDeleteDeduction) return\n const target = pendingDeleteDeduction\n setPendingDeleteDeduction(null)\n await handleDelete(target)\n }\n\n return {\n pendingDeleteDeduction,\n setPendingDeleteDeduction,\n handleConfirmDelete,\n }\n}\n"],"names":["useDeleteDeduction","handleDelete","pendingDeleteDeduction","setPendingDeleteDeduction","useState","target"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useDeleteDeduction.js","sources":["../../../../../src/components/Employee/Deductions/shared/useDeleteDeduction.ts"],"sourcesContent":["import { useState } from 'react'\nimport type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment'\n\n/**\n * Pending-state + confirm-handler companion for `DeleteDeductionDialog`.\n * Mirrors `useDeleteBankAccount` — the contract is: a row's menu calls\n * `setPendingDeleteDeduction(...)` to open the dialog, and the dialog's\n * confirm calls `handleConfirmDelete`, which in turn invokes the\n * caller-supplied `handleDelete(garnishment)`.\n *\n * @internal\n */\nexport function useDeleteDeduction(handleDelete: (garnishment: Garnishment) => Promise<void>) {\n const [pendingDeleteDeduction, setPendingDeleteDeduction] = useState<Garnishment | null>(null)\n\n const handleConfirmDelete = async () => {\n if (!pendingDeleteDeduction) return\n const target = pendingDeleteDeduction\n setPendingDeleteDeduction(null)\n await handleDelete(target)\n }\n\n return {\n pendingDeleteDeduction,\n setPendingDeleteDeduction,\n handleConfirmDelete,\n }\n}\n"],"names":["useDeleteDeduction","handleDelete","pendingDeleteDeduction","setPendingDeleteDeduction","useState","target"],"mappings":";AAYO,SAASA,EAAmBC,GAA2D;AAC5F,QAAM,CAACC,GAAwBC,CAAyB,IAAIC,EAA6B,IAAI;AAS7F,SAAO;AAAA,IACL,wBAAAF;AAAA,IACA,2BAAAC;AAAA,IACA,qBAV0B,YAAY;AACtC,UAAI,CAACD,EAAwB;AAC7B,YAAMG,IAASH;AACf,MAAAC,EAA0B,IAAI,GAC9B,MAAMF,EAAaI,CAAM;AAAA,IAC3B;AAAA,EAKE;AAEJ;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseComponentInterface } from '../../../Base';
|
|
2
|
+
/** @internal */
|
|
2
3
|
export interface DocumentManagerProps {
|
|
3
4
|
employeeId: string;
|
|
4
5
|
formId: string;
|
|
@@ -8,5 +9,7 @@ export interface DocumentManagerProps {
|
|
|
8
9
|
* selected form's PDF — including unsigned forms, which are shown as-is.
|
|
9
10
|
* Signing is intentionally not offered here; forms are signed by the employee
|
|
10
11
|
* during onboarding, not by an admin viewing the dashboard.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
11
14
|
*/
|
|
12
15
|
export declare function DocumentManager(props: DocumentManagerProps & BaseComponentInterface): import("react").JSX.Element;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as s, Trans as
|
|
3
|
-
import { useEmployeeFormsGetSuspense as
|
|
2
|
+
import { useTranslation as s, Trans as p } from "react-i18next";
|
|
3
|
+
import { useEmployeeFormsGetSuspense as u } from "@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGet";
|
|
4
4
|
import { useEmployeeFormsGetPdfSuspense as f } from "@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGetPdf";
|
|
5
5
|
import { BaseComponent as d } from "../../../Base/Base.js";
|
|
6
6
|
import { useBase as C } from "../../../Base/useBase.js";
|
|
7
7
|
import { Flex as D } from "../../../Common/Flex/Flex.js";
|
|
8
8
|
import { ActionsLayout as y } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
9
9
|
import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
10
|
+
import "react";
|
|
10
11
|
import { useI18n as h } from "../../../../i18n/I18n.js";
|
|
11
12
|
import { componentEvents as E } from "../../../../shared/constants.js";
|
|
12
13
|
import { DocumentViewer as x } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
13
|
-
function
|
|
14
|
+
function P(o) {
|
|
14
15
|
return h("Employee.DocumentManager"), /* @__PURE__ */ e(d, { ...o, componentName: "Employee.DocumentManager", children: /* @__PURE__ */ e(w, { employeeId: o.employeeId, formId: o.formId }) });
|
|
15
16
|
}
|
|
16
17
|
function w({ employeeId: o, formId: i }) {
|
|
17
18
|
const { t: r } = s("Employee.DocumentManager"), t = g(), { onEvent: a } = C(), {
|
|
18
19
|
data: { form: n }
|
|
19
|
-
} =
|
|
20
|
+
} = u({ employeeId: o, formId: i }), {
|
|
20
21
|
data: { formPdf: c }
|
|
21
22
|
} = f({ employeeId: o, formId: i }), m = c?.documentUrl;
|
|
22
23
|
return n ? /* @__PURE__ */ l(D, { flexDirection: "column", gap: 16, children: [
|
|
23
24
|
n.title && /* @__PURE__ */ e(t.Heading, { as: "h2", children: n.title }),
|
|
24
25
|
m && /* @__PURE__ */ e(t.Text, { children: /* @__PURE__ */ e(
|
|
25
|
-
|
|
26
|
+
p,
|
|
26
27
|
{
|
|
27
28
|
t: r,
|
|
28
29
|
i18nKey: "downloadDocumentCta",
|
|
@@ -53,6 +54,6 @@ function w({ employeeId: o, formId: i }) {
|
|
|
53
54
|
] }) : null;
|
|
54
55
|
}
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
P as DocumentManager
|
|
57
58
|
};
|
|
58
59
|
//# sourceMappingURL=DocumentManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\nexport interface DocumentManagerProps {\n employeeId: string\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n */\nexport function DocumentManager(props: DocumentManagerProps & BaseComponentInterface) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({ employeeId, formId }: DocumentManagerProps) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentManager.js","sources":["../../../../../src/components/Employee/Documents/management/DocumentManager.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGet'\nimport { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api-v-2025-11-15/react-query/employeeFormsGetPdf'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { DocumentViewer } from '@/components/Common/DocumentViewer'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport interface DocumentManagerProps {\n employeeId: string\n formId: string\n}\n\n/**\n * Read-only document viewer for the admin-facing employee dashboard. Renders the\n * selected form's PDF — including unsigned forms, which are shown as-is.\n * Signing is intentionally not offered here; forms are signed by the employee\n * during onboarding, not by an admin viewing the dashboard.\n *\n * @internal\n */\nexport function DocumentManager(props: DocumentManagerProps & BaseComponentInterface) {\n useI18n('Employee.DocumentManager')\n return (\n <BaseComponent {...props} componentName=\"Employee.DocumentManager\">\n <DocumentManagerRoot employeeId={props.employeeId} formId={props.formId} />\n </BaseComponent>\n )\n}\n\nfunction DocumentManagerRoot({ employeeId, formId }: DocumentManagerProps) {\n const { t } = useTranslation('Employee.DocumentManager')\n const Components = useComponentContext()\n const { onEvent } = useBase()\n\n const {\n data: { form },\n } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId })\n\n const pdfUrl = formPdf?.documentUrl\n\n if (!form) return null\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {form.title && <Components.Heading as=\"h2\">{form.title}</Components.Heading>}\n {pdfUrl && (\n <Components.Text>\n <Trans\n t={t}\n i18nKey=\"downloadDocumentCta\"\n components={{\n downloadLink: (\n <Components.Link\n href={pdfUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n download={`${form.title || 'form'}.pdf`}\n />\n ),\n }}\n />\n </Components.Text>\n )}\n <DocumentViewer url={pdfUrl} title={form.title} viewDocumentLabel={t('viewDocumentCta')} />\n\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.CANCEL)\n }}\n >\n {t('backCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["DocumentManager","props","useI18n","jsx","BaseComponent","DocumentManagerRoot","employeeId","formId","t","useTranslation","Components","useComponentContext","onEvent","useBase","form","useEmployeeFormsGetSuspense","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","jsxs","Flex","Trans","DocumentViewer","ActionsLayout","componentEvents"],"mappings":";;;;;;;;;;;;;AAwBO,SAASA,EAAgBC,GAAsD;AACpF,SAAAC,EAAQ,0BAA0B,GAEhC,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GAAO,eAAc,4BACtC,UAAA,gBAAAE,EAACE,GAAA,EAAoB,YAAYJ,EAAM,YAAY,QAAQA,EAAM,QAAQ,GAC3E;AAEJ;AAEA,SAASI,EAAoB,EAAE,YAAAC,GAAY,QAAAC,KAAgC;AACzE,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjDC,IAAaC,EAAA,GACb,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd;AAAA,IACJ,MAAM,EAAE,MAAAC,EAAA;AAAA,EAAK,IACXC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAChD;AAAA,IACJ,MAAM,EAAE,SAAAS,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAX,GAAY,QAAAC,GAAQ,GAEnDW,IAASF,GAAS;AAExB,SAAKF,IAGH,gBAAAK,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAN,EAAK,2BAAUJ,EAAW,SAAX,EAAmB,IAAG,MAAM,YAAK,MAAA,CAAM;AAAA,IACtDQ,KACC,gBAAAf,EAACO,EAAW,MAAX,EACC,UAAA,gBAAAP;AAAA,MAACkB;AAAA,MAAA;AAAA,QACC,GAAAb;AAAA,QACA,SAAQ;AAAA,QACR,YAAY;AAAA,UACV,cACE,gBAAAL;AAAA,YAACO,EAAW;AAAA,YAAX;AAAA,cACC,MAAMQ;AAAA,cACN,QAAO;AAAA,cACP,KAAI;AAAA,cACJ,UAAU,GAAGJ,EAAK,SAAS,MAAM;AAAA,YAAA;AAAA,UAAA;AAAA,QACnC;AAAA,MAEJ;AAAA,IAAA,GAEJ;AAAA,IAEF,gBAAAX,EAACmB,GAAA,EAAe,KAAKJ,GAAQ,OAAOJ,EAAK,OAAO,mBAAmBN,EAAE,iBAAiB,EAAA,CAAG;AAAA,sBAExFe,GAAA,EACC,UAAA,gBAAApB;AAAA,MAACO,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAE,EAAQY,EAAgB,MAAM;AAAA,QAChC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,GACF,IAnCgB;AAqCpB;"}
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import { BaseComponentInterface, CommonComponentInterface } from '../../../Base';
|
|
2
2
|
import { EventType } from '../../../../shared/constants';
|
|
3
3
|
import { OnEventType } from '../../../Base/useBase';
|
|
4
|
+
/**
|
|
5
|
+
* Props for {@link Documents}.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
4
9
|
export interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {
|
|
10
|
+
/** The associated employee identifier. */
|
|
5
11
|
employeeId: string;
|
|
12
|
+
/** Event handler fired on flow state changes. */
|
|
6
13
|
onEvent: OnEventType<EventType, unknown>;
|
|
7
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Standalone employee documents management flow.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Orchestrates the documents card and the per-form document manager. The flow
|
|
20
|
+
* starts on the documents card and routes to the document manager when a row's
|
|
21
|
+
* View CTA is selected; cancelling from the document manager returns to the
|
|
22
|
+
* card.
|
|
23
|
+
*
|
|
24
|
+
* | Event | Description | Data |
|
|
25
|
+
* | ----- | ----------- | ---- |
|
|
26
|
+
* | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |
|
|
27
|
+
*
|
|
28
|
+
* @param props - See {@link DocumentsProps}.
|
|
29
|
+
* @returns The documents management flow.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
8
32
|
export declare function Documents({ dictionary, FallbackComponent, ...props }: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>): import("react").JSX.Element;
|
|
@@ -5,7 +5,6 @@ import { DocumentsCardContextual as a } from "./DocumentsComponents.js";
|
|
|
5
5
|
import { documentsStateMachine as i } from "./documentsStateMachine.js";
|
|
6
6
|
import { Flow as u } from "../../../Flow/Flow.js";
|
|
7
7
|
import { BaseBoundaries as p } from "../../../Base/Base.js";
|
|
8
|
-
import "../../../Base/useBase.js";
|
|
9
8
|
import { useComponentDictionary as s, useI18n as f } from "../../../../i18n/I18n.js";
|
|
10
9
|
function D({ employeeId: o, onEvent: e }) {
|
|
11
10
|
f("Employee.Management.Documents");
|
|
@@ -19,7 +18,7 @@ function D({ employeeId: o, onEvent: e }) {
|
|
|
19
18
|
);
|
|
20
19
|
return /* @__PURE__ */ n(u, { machine: m, onEvent: e });
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function E({
|
|
23
22
|
dictionary: o,
|
|
24
23
|
FallbackComponent: e,
|
|
25
24
|
...m
|
|
@@ -34,6 +33,6 @@ function w({
|
|
|
34
33
|
);
|
|
35
34
|
}
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
E as Documents
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=Documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n employeeId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Documents.js","sources":["../../../../../src/components/Employee/Documents/management/Documents.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo } from 'react'\nimport { DocumentsCardContextual, type DocumentsContextInterface } from './DocumentsComponents'\nimport { documentsStateMachine } from './documentsStateMachine'\nimport { Flow } from '@/components/Flow/Flow'\nimport {\n BaseBoundaries,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { type EventType } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { useI18n } from '@/i18n'\nimport type { OnEventType } from '@/components/Base/useBase'\n\n/**\n * Props for {@link Documents}.\n *\n * @public\n */\nexport interface DocumentsProps extends CommonComponentInterface<'Employee.Management.Documents'> {\n /** The associated employee identifier. */\n employeeId: string\n /** Event handler fired on flow state changes. */\n onEvent: OnEventType<EventType, unknown>\n}\n\nfunction DocumentsFlow({ employeeId, onEvent }: DocumentsProps) {\n useI18n('Employee.Management.Documents')\n\n const machine = useMemo(\n () =>\n createMachine('card', documentsStateMachine, (ctx: DocumentsContextInterface) => ({\n ...ctx,\n component: DocumentsCardContextual,\n employeeId,\n })),\n [employeeId],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n\n/**\n * Standalone employee documents management flow.\n *\n * @remarks\n * Orchestrates the documents card and the per-form document manager. The flow\n * starts on the documents card and routes to the document manager when a row's\n * View CTA is selected; cancelling from the document manager returns to the\n * card.\n *\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `employee/management/documents/card/viewRequested` | Fired when a row's View CTA is clicked on the documents card | `{ employeeId: string; formId: string }` |\n *\n * @param props - See {@link DocumentsProps}.\n * @returns The documents management flow.\n * @public\n */\nexport function Documents({\n dictionary,\n FallbackComponent,\n ...props\n}: DocumentsProps & BaseComponentInterface<'Employee.Management.Documents'>) {\n useComponentDictionary('Employee.Management.Documents', dictionary)\n return (\n <BaseBoundaries\n componentName=\"Employee.Management.Documents\"\n FallbackComponent={FallbackComponent}\n >\n <DocumentsFlow {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["DocumentsFlow","employeeId","onEvent","useI18n","machine","useMemo","createMachine","documentsStateMachine","ctx","DocumentsCardContextual","jsx","Flow","Documents","dictionary","FallbackComponent","props","useComponentDictionary","BaseBoundaries"],"mappings":";;;;;;;;AA2BA,SAASA,EAAc,EAAE,YAAAC,GAAY,SAAAC,KAA2B;AAC9D,EAAAC,EAAQ,+BAA+B;AAEvC,QAAMC,IAAUC;AAAA,IACd,MACEC,EAAc,QAAQC,GAAuB,CAACC,OAAoC;AAAA,MAChF,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IAAA,EACA;AAAA,IACJ,CAACA,CAAU;AAAA,EAAA;AAGb,SAAO,gBAAAS,EAACC,GAAA,EAAK,SAAAP,GAAkB,SAAAF,EAAA,CAAkB;AACnD;AAmBO,SAASU,EAAU;AAAA,EACxB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,GAAGC;AACL,GAA6E;AAC3E,SAAAC,EAAuB,iCAAiCH,CAAU,GAEhE,gBAAAH;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAH;AAAA,MAEA,UAAA,gBAAAJ,EAACV,GAAA,EAAe,GAAGe,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhC;"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import { EventType } from '../../../../../shared/constants';
|
|
2
2
|
import { OnEventType } from '../../../../Base/useBase';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link DocumentsCard}.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
3
8
|
export interface DocumentsCardProps {
|
|
9
|
+
/** The associated employee identifier. */
|
|
4
10
|
employeeId: string;
|
|
11
|
+
/** Event handler fired when a row's View CTA is clicked. */
|
|
5
12
|
onEvent: OnEventType<EventType, unknown>;
|
|
6
13
|
}
|
|
7
14
|
/**
|
|
8
15
|
* Standalone "Documents" (forms) card. Owns its own data fetch via
|
|
9
16
|
* {@link useDocumentsList} and renders the employee's forms in a table with a
|
|
10
|
-
* per-row "View" action. Emits
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* alert rendering is the
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
+
* per-row "View" action. Emits
|
|
18
|
+
* `employee/management/documents/card/viewRequested` with
|
|
19
|
+
* `{ employeeId, formId }` when a row's View CTA is clicked. The card is
|
|
20
|
+
* read-only — viewing or signing a form happens in the screen the parent
|
|
21
|
+
* routes to — and renders no alerts: alert rendering is the parent's
|
|
22
|
+
* responsibility.
|
|
23
|
+
*
|
|
24
|
+
* @param props - See {@link DocumentsCardProps}.
|
|
25
|
+
* @returns The documents card.
|
|
26
|
+
* @public
|
|
17
27
|
*/
|
|
18
28
|
export declare function DocumentsCard(props: DocumentsCardProps): import("react").JSX.Element;
|