@gusto/embedded-react-sdk 0.44.2 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +7 -7
- package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.js +24 -23
- package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
- package/dist/components/Common/UI/Alert/Alert.module.scss.js +16 -14
- package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
- package/dist/components/Common/UI/Alert/AlertTypes.d.ts +8 -0
- package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +38 -38
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -20
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/Head.js +12 -9
- package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +25 -25
- package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -20
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -22
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js +11 -8
- package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -20
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountList/Head.js +44 -39
- package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -20
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +26 -26
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
- package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -9
- package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
- package/dist/components/Company/FederalTaxes/Head.js +7 -6
- package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -28
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -23
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Industry/Head.js +10 -9
- package/dist/components/Company/Industry/Head.js.map +1 -1
- package/dist/components/Company/Industry/IndustrySelect.js +22 -19
- package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/Head.js +9 -8
- package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -20
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/Head.js +11 -10
- package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -11
- package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -20
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -20
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/PayScheduleList.js +18 -18
- package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -20
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -20
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +6 -22
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +7 -7
- package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -2
- package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +42 -52
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/index.d.ts +1 -1
- package/dist/components/Employee/Compensation/{Compensation.d.ts → onboarding/Compensation.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/Compensation.js +88 -0
- package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -0
- package/dist/components/Employee/Compensation/{CompensationFlowComponents.d.ts → onboarding/CompensationFlowComponents.d.ts} +3 -3
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js +59 -0
- package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +21 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +249 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsList.d.ts +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +43 -0
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -0
- package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.js +10 -10
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -0
- package/dist/components/Employee/Compensation/{compensationStateMachine.js → onboarding/compensationStateMachine.js} +1 -1
- package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -0
- package/dist/components/Employee/Compensation/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +9 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js +10 -0
- package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +7 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +41 -35
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -3
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +193 -181
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +14 -13
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +19 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +133 -130
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +87 -65
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/CompensationCard.d.ts +13 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +89 -109
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +15 -0
- package/dist/components/Employee/Dashboard/DashboardComponents.js +120 -25
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.d.ts +11 -0
- package/dist/components/Employee/Dashboard/DocumentsView.js +24 -17
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +9 -17
- package/dist/components/Employee/Dashboard/JobAndPayView.js +495 -114
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.d.ts +10 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js +64 -0
- package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
- package/dist/components/Employee/Dashboard/TaxesView.js +82 -60
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +7 -0
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +227 -40
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +50 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +57 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.test.d.ts +1 -0
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +7 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +14 -8
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +60 -36
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.d.ts +8 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js +61 -0
- package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js.map +1 -0
- package/dist/components/Employee/Deductions/Deductions.d.ts +2 -8
- package/dist/components/Employee/Deductions/Deductions.js +25 -52
- package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.d.ts +9 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +9 -5
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +97 -94
- package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.d.ts +18 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +137 -0
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +10 -5
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +57 -77
- package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +5 -5
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +29 -39
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +8 -6
- package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
- package/dist/components/Employee/Deductions/{DeductionsComponents.d.ts → deductionsContextualComponents.d.ts} +7 -8
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js +74 -0
- package/dist/components/Employee/Deductions/deductionsContextualComponents.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js +31 -0
- package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js +10 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/formatDeductionAmount.test.d.ts +1 -0
- package/dist/components/Employee/Deductions/shared/index.d.ts +7 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +64 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +36 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +39 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +62 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +208 -0
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +63 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +52 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +25 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +36 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +4 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +64 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +203 -0
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +22 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js +50 -0
- package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +13 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js +17 -0
- package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -0
- package/dist/components/Employee/Deductions/stateMachine.d.ts +4 -5
- package/dist/components/Employee/Deductions/stateMachine.js +67 -89
- package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
- package/dist/components/Employee/Documents/management/DocumentManager.d.ts +6 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js +60 -0
- package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -0
- package/dist/components/Employee/Documents/management/index.d.ts +3 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.js +3 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +8 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.js +5 -5
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.js +11 -11
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.js +13 -13
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.js +8 -8
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.js +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.d.ts +3 -3
- package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.js +6 -6
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +117 -0
- package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.d.ts +1 -1
- package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.js +14 -14
- package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +89 -82
- package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +37 -35
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
- package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +38 -39
- package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +29 -27
- package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/index.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/management/ListView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js +138 -0
- package/dist/components/Employee/PaymentMethod/management/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +49 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/management/index.d.ts +4 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +66 -0
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +168 -0
- package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +11 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +44 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +23 -0
- package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +8 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js +97 -0
- package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +2 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +75 -0
- package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +9 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js +31 -0
- package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/index.d.ts +7 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +15 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +37 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +105 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +39 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +26 -0
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +13 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js +19 -0
- package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +5 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +94 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +31 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js +22 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +20 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +68 -0
- package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js +9 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +6 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +48 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +46 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +65 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +209 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +53 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +93 -0
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -0
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js +88 -87
- package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -2
- package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +27 -26
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalHead.js +13 -10
- package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
- package/dist/components/Employee/Taxes/StateForm.js +17 -14
- package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
- package/dist/components/Employee/Taxes/Taxes.js +75 -69
- package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
- package/dist/components/Employee/Taxes/useTaxes.js +4 -20
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +26 -26
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +4 -1
- package/dist/components/Employee/exports/employeeManagement.js +22 -18
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
- package/dist/components/Employee/exports/employeeOnboarding.js +4 -4
- package/dist/components/Employee/index.d.ts +4 -4
- package/dist/components/Employee/index.js +5 -5
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +26 -34
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +22 -36
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +84 -82
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +49 -48
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +39 -37
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +31 -31
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +1 -0
- package/dist/components/TimeOff/PolicyList/PolicyList.js +27 -27
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +50 -50
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -0
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js +66 -41
- package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +59 -48
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +3 -0
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +34 -33
- package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -0
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +69 -61
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +119 -75
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +72 -61
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +103 -84
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +51 -49
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +78 -59
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +8 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js.map +1 -0
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +6 -2
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +209 -154
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +3 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +36 -34
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +136 -134
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +6 -6
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +63 -65
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +1 -0
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +50 -49
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +66 -55
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
- package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +1 -0
- package/dist/contexts/ApiProvider/ApiProvider.js +33 -39
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +17 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js +14 -0
- package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -0
- package/dist/helpers/formattedStrings.d.ts +12 -0
- package/dist/helpers/formattedStrings.js +55 -33
- package/dist/helpers/formattedStrings.js.map +1 -1
- package/dist/hooks/useClientPagination/useClientPagination.d.ts +44 -0
- package/dist/hooks/useClientPagination/useClientPagination.js +69 -0
- package/dist/hooks/useClientPagination/useClientPagination.js.map +1 -0
- package/dist/hooks/useClientPagination/useClientPagination.test.d.ts +1 -0
- package/dist/i18n/I18n.js +6 -5
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.PaySchedule.json.js +22 -20
- package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +8 -6
- package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +9 -9
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +6 -4
- package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +10 -8
- package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +16 -12
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.Deductions.json.js +104 -76
- package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +12 -0
- package/dist/i18n/en/Employee.DocumentManager.json.js.map +1 -0
- package/dist/i18n/en/Employee.PaymentMethod.json.js +76 -64
- package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +7 -0
- package/dist/i18n/en/common.json.js +19 -17
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +138 -112
- package/dist/index.js.map +1 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +2 -1
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +20 -18
- package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
- package/dist/shared/constants.d.ts +8 -2
- package/dist/shared/constants.js +11 -8
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/assertions.d.ts +16 -0
- package/dist/types/i18next.d.ts +140 -4
- package/dist/types/sdkError.js +58 -47
- package/dist/types/sdkError.js.map +1 -1
- package/docs/reference/endpoint-inventory.json +980 -1170
- package/package.json +29 -21
- package/dist/components/Employee/Compensation/Compensation.js +0 -87
- package/dist/components/Employee/Compensation/Compensation.js.map +0 -1
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js +0 -61
- package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +0 -14
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +0 -128
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +0 -17
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +0 -224
- package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +0 -5
- package/dist/components/Employee/Compensation/JobsList/JobsList.js +0 -47
- package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +0 -1
- package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationSchema.d.ts +0 -29
- package/dist/components/Employee/Compensation/compensationSchema.js +0 -63
- package/dist/components/Employee/Compensation/compensationSchema.js.map +0 -1
- package/dist/components/Employee/Compensation/compensationStateMachine.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +0 -15
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +0 -27
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +0 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +0 -13
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +0 -26
- package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Actions.d.ts +0 -1
- package/dist/components/Employee/Deductions/DeductionsComponents.js +0 -31
- package/dist/components/Employee/Deductions/DeductionsComponents.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +0 -39
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -237
- package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -22
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -162
- package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +0 -34
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +0 -168
- package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +0 -1
- package/dist/components/Employee/Deductions/Head.d.ts +0 -1
- package/dist/components/Employee/Deductions/useDeductions.d.ts +0 -30
- package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +0 -24
- package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
- package/dist/components/Employee/DocumentSigner/stateMachine.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +0 -1
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +0 -115
- package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Actions.js +0 -20
- package/dist/components/Employee/PaymentMethod/Actions.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js +0 -13
- package/dist/components/Employee/PaymentMethod/BankAccount.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +0 -58
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js +0 -51
- package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Head.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Head.js +0 -13
- package/dist/components/Employee/PaymentMethod/Head.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +0 -9
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js +0 -183
- package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +0 -10
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +0 -38
- package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/Split.d.ts +0 -1
- package/dist/components/Employee/PaymentMethod/Split.js +0 -175
- package/dist/components/Employee/PaymentMethod/Split.js.map +0 -1
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +0 -54
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +0 -68
- package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +0 -1
- /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.d.ts +0 -0
- /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/index.d.ts +0 -0
- /package/dist/components/Employee/Compensation/{compensationStateMachine.d.ts → onboarding/compensationStateMachine.d.ts} +0 -0
- /package/dist/components/Employee/{DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts → Compensation/shared/derivePrimaryFlsaStatus.test.d.ts} +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js.map +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
- /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocumentsPresentation.d.ts +0 -0
- /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/index.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.js +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -0
- /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.js +0 -0
package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n} as const\n\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\nexport type CompensationFormOutputs = CompensationFormData\n\nexport interface CompensationSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n}\n\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const { mode = 'create', optionalFieldsToRequire, hireDate } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Only enforce the hire-date lower bound when picking a brand-new\n // effective date (create mode). On update, the loaded effectiveDate\n // can legitimately predate the parent job's hireDate (e.g. carried\n // over from a stub or out-of-order data) and the API accepts the\n // unchanged value or omitting it entirely. Blocking the submit here\n // would trap partners whose flow doesn't render Fields.EffectiveDate.\n if (mode === 'create' && hireDate && data.effectiveDate && data.effectiveDate < hireDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","buildFormSchema"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"compensationSchema.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceToISODate } from '@/partner-hook-utils/form/preprocessors'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport { yearlyRate } from '@/helpers/payRateCalculator'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\nexport const CompensationErrorCodes = {\n REQUIRED: 'REQUIRED',\n RATE_MINIMUM: 'RATE_MINIMUM',\n RATE_EXEMPT_THRESHOLD: 'RATE_EXEMPT_THRESHOLD',\n PAYMENT_UNIT_OWNER: 'PAYMENT_UNIT_OWNER',\n PAYMENT_UNIT_COMMISSION: 'PAYMENT_UNIT_COMMISSION',\n RATE_COMMISSION_ZERO: 'RATE_COMMISSION_ZERO',\n EFFECTIVE_DATE_BEFORE_HIRE: 'EFFECTIVE_DATE_BEFORE_HIRE',\n} as const\n\nexport type CompensationErrorCode =\n (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes]\n\nconst fieldValidators = {\n /**\n * Optional in both modes. Setting title here scopes the change to this\n * compensation's `effectiveDate` — pair it with a future-dated comp to\n * schedule a promotion title alongside a rate change. Use\n * `useJobForm.Fields.Title` instead when creating a job (title is required\n * by the API on job creation) or when renaming the active role\n * immediately, and avoid rendering both fields on the same screen.\n */\n title: z.string(),\n // `flsaStatus` is `.optional()` so the field can render an empty placeholder\n // until the user (or partner default) picks one. Requiredness is still\n // enforced via `requiredFieldsConfig` on submit in `create` mode.\n flsaStatus: z\n .enum([\n FlsaStatus.EXEMPT,\n FlsaStatus.SALARIED_NONEXEMPT,\n FlsaStatus.NONEXEMPT,\n FlsaStatus.OWNER,\n FlsaStatus.COMMISSION_ONLY_EXEMPT,\n FlsaStatus.COMMISSION_ONLY_NONEXEMPT,\n ])\n .optional(),\n paymentUnit: z.enum([\n PAY_PERIODS.HOUR,\n PAY_PERIODS.WEEK,\n PAY_PERIODS.MONTH,\n PAY_PERIODS.YEAR,\n PAY_PERIODS.PAYCHECK,\n ]),\n rate: z.preprocess(coerceNaN(0), z.number()),\n /**\n * The effective date a new compensation should take effect on.\n *\n * - **create mode (`compensationId` absent)**: required; partners typically default\n * to the parent job's `hireDate` (onboarding stub-fill) or a future date\n * (rate change). Must be on or after `hireDate`. Server-side this maps to\n * POST /v1/jobs/:jobId/compensations.\n * - **update mode (`compensationId` present)**: optional; if omitted the API\n * keeps the existing effective date. The `hireDate` lower bound is **not**\n * enforced — loaded values may legitimately predate the hire date. Maps to\n * PUT /v1/compensations/:id.\n */\n effectiveDate: z.preprocess(coerceToISODate, z.iso.date().nullable()),\n adjustForMinimumWage: z.boolean(),\n minimumWageId: z.string(),\n}\n\nexport type CompensationFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\nconst requiredFieldsConfig = {\n title: 'never',\n flsaStatus: 'create',\n paymentUnit: 'create',\n rate: 'create',\n effectiveDate: 'create',\n minimumWageId: data => data.adjustForMinimumWage,\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\nfunction validateFlsaRules(data: CompensationFormData, ctx: z.RefinementCtx) {\n const { flsaStatus, paymentUnit, rate } = data\n\n if (\n flsaStatus === FlsaStatus.EXEMPT ||\n flsaStatus === FlsaStatus.SALARIED_NONEXEMPT ||\n flsaStatus === FlsaStatus.NONEXEMPT\n ) {\n // Surface the EXEMPT salary-threshold issue *before* the generic minimum,\n // so a partner setting rate=0 with EXEMPT sees the more actionable\n // \"must meet salary threshold\" message rather than the generic\n // \"amount must be at least $1.00\".\n if (\n flsaStatus === FlsaStatus.EXEMPT &&\n yearlyRate(rate, paymentUnit) < FLSA_OVERTIME_SALARY_LIMIT\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_EXEMPT_THRESHOLD,\n })\n } else if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (flsaStatus === FlsaStatus.OWNER) {\n if (paymentUnit !== PAY_PERIODS.PAYCHECK) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_OWNER,\n })\n }\n if (rate < 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_MINIMUM,\n })\n }\n } else if (\n flsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT ||\n flsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT\n ) {\n if (paymentUnit !== PAY_PERIODS.YEAR) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['paymentUnit'],\n message: CompensationErrorCodes.PAYMENT_UNIT_COMMISSION,\n })\n }\n if (rate !== 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['rate'],\n message: CompensationErrorCodes.RATE_COMMISSION_ZERO,\n })\n }\n }\n}\n\nexport type CompensationOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\nexport type CompensationFormOutputs = CompensationFormData\n\nexport interface CompensationSchemaOptions {\n mode?: 'create' | 'update'\n optionalFieldsToRequire?: CompensationOptionalFieldsToRequire\n /**\n * Lower bound for `effectiveDate` (typically the parent job's `hireDate`).\n * Only enforced in `create` mode — on `update` the loaded effective date\n * may legitimately predate the hire date and is left as-is. Surfaces an\n * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.\n */\n hireDate?: string | null\n /**\n * When `false`, drops `effectiveDate` from the validated shape — the field\n * becomes hook-managed (e.g. seeded from the parent job's `hireDate` during\n * onboarding). Partners may still supply the value at submit time via\n * `CompensationSubmitOptions.effectiveDate`. Defaults to `true`.\n */\n withEffectiveDateField?: boolean\n}\n\nexport function createCompensationSchema(options: CompensationSchemaOptions = {}) {\n const {\n mode = 'create',\n optionalFieldsToRequire,\n hireDate,\n withEffectiveDateField = true,\n } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: CompensationErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: withEffectiveDateField ? [] : ['effectiveDate'],\n superRefine: (data, ctx) => {\n validateFlsaRules(data, ctx)\n // Only enforce the hire-date lower bound when picking a brand-new\n // effective date (create mode). On update, the loaded effectiveDate\n // can legitimately predate the parent job's hireDate (e.g. carried\n // over from a stub or out-of-order data) and the API accepts the\n // unchanged value or omitting it entirely. Blocking the submit here\n // would trap partners whose flow doesn't render Fields.EffectiveDate.\n // When `withEffectiveDateField` is false the field is excluded from\n // the shape and `data.effectiveDate` is undefined — this check\n // naturally short-circuits.\n if (mode === 'create' && hireDate && data.effectiveDate && data.effectiveDate < hireDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['effectiveDate'],\n message: CompensationErrorCodes.EFFECTIVE_DATE_BEFORE_HIRE,\n })\n }\n },\n })\n}\n"],"names":["CompensationErrorCodes","fieldValidators","z","FlsaStatus","PAY_PERIODS","coerceNaN","coerceToISODate","requiredFieldsConfig","data","validateFlsaRules","ctx","flsaStatus","paymentUnit","rate","yearlyRate","FLSA_OVERTIME_SALARY_LIMIT","createCompensationSchema","options","mode","optionalFieldsToRequire","hireDate","withEffectiveDateField","buildFormSchema"],"mappings":";;;;;AAYO,MAAMA,IAAyB;AAAA,EACpC,UAAU;AAAA,EACV,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,4BAA4B;AAC9B,GAKMC,IAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStB,OAAOC,EAAE,OAAA;AAAA;AAAA;AAAA;AAAA,EAIT,YAAYA,EACT,KAAK;AAAA,IACJC,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,IACXA,EAAW;AAAA,EAAA,CACZ,EACA,SAAA;AAAA,EACH,aAAaD,EAAE,KAAK;AAAA,IAClBE,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,EAAA,CACb;AAAA,EACD,MAAMF,EAAE,WAAWG,EAAU,CAAC,GAAGH,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa3C,eAAeA,EAAE,WAAWI,GAAiBJ,EAAE,IAAI,OAAO,UAAU;AAAA,EACpE,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA;AACnB,GAMMK,IAAuB;AAAA,EAC3B,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,MAAM;AAAA,EACN,eAAe;AAAA,EACf,eAAe,OAAQC,EAAK;AAC9B;AAEA,SAASC,EAAkBD,GAA4BE,GAAsB;AAC3E,QAAM,EAAE,YAAAC,GAAY,aAAAC,GAAa,MAAAC,EAAA,IAASL;AAE1C,EACEG,MAAeR,EAAW,UAC1BQ,MAAeR,EAAW,sBAC1BQ,MAAeR,EAAW,YAOxBQ,MAAeR,EAAW,UAC1BW,EAAWD,GAAMD,CAAW,IAAIG,IAEhCL,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASF,EAAuB;AAAA,EAAA,CACjC,IACQa,IAAO,KAChBH,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASF,EAAuB;AAAA,EAAA,CACjC,IAEMW,MAAeR,EAAW,SAC/BS,MAAgBR,EAAY,YAC9BM,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAASF,EAAuB;AAAA,EAAA,CACjC,GAECa,IAAO,KACTH,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASF,EAAuB;AAAA,EAAA,CACjC,MAGHW,MAAeR,EAAW,0BAC1BQ,MAAeR,EAAW,+BAEtBS,MAAgBR,EAAY,QAC9BM,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,aAAa;AAAA,IACpB,SAASF,EAAuB;AAAA,EAAA,CACjC,GAECa,MAAS,KACXH,EAAI,SAAS;AAAA,IACX,MAAMR,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,MAAM;AAAA,IACb,SAASF,EAAuB;AAAA,EAAA,CACjC;AAGP;AA0BO,SAASgB,EAAyBC,IAAqC,IAAI;AAChF,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,yBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,wBAAAC,IAAyB;AAAA,EAAA,IACvBJ;AAEJ,SAAOK,EAAgBrB,GAAiB;AAAA,IACtC,sBAAAM;AAAA,IACA,mBAAmBP,EAAuB;AAAA,IAC1C,MAAAkB;AAAA,IACA,yBAAAC;AAAA,IACA,eAAeE,IAAyB,KAAK,CAAC,eAAe;AAAA,IAC7D,aAAa,CAACb,GAAME,MAAQ;AAC1B,MAAAD,EAAkBD,GAAME,CAAG,GAUvBQ,MAAS,YAAYE,KAAYZ,EAAK,iBAAiBA,EAAK,gBAAgBY,KAC9EV,EAAI,SAAS;AAAA,QACX,MAAMR,EAAE,aAAa;AAAA,QACrB,MAAM,CAAC,eAAe;AAAA,QACtB,SAASF,EAAuB;AAAA,MAAA,CACjC;AAAA,IAEL;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "./types/i18next.d.ts"
|
|
2
2
|
export { useCompensationForm } from './useCompensationForm';
|
|
3
|
-
export { useCurrentCompensationForm } from './useCurrentCompensationForm';
|
|
4
3
|
export type { CompensationSubmitOptions, UseCompensationFormProps, UseCompensationFormResult, UseCompensationFormReady, CompensationFieldsMetadata, CompensationFormFields, } from './useCompensationForm';
|
|
5
|
-
export type { UseCurrentCompensationFormProps } from './useCurrentCompensationForm';
|
|
6
4
|
export { createCompensationSchema, CompensationErrorCodes, type CompensationErrorCode, type CompensationOptionalFieldsToRequire, type CompensationFormData, type CompensationFormOutputs, type CompensationSchemaOptions, } from './compensationSchema';
|
|
7
5
|
export type { RequiredValidation, RateValidation, EffectiveDateValidation, TitleFieldProps, EffectiveDateFieldProps, FlsaStatusFieldProps, RateFieldProps, PaymentUnitFieldProps, AdjustForMinimumWageFieldProps, MinimumWageIdFieldProps, } from './fields';
|
package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts
CHANGED
|
@@ -17,10 +17,18 @@ export interface CompensationSubmitOptions {
|
|
|
17
17
|
* version from its cached `currentCompensation`.
|
|
18
18
|
*/
|
|
19
19
|
compensationVersion?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Supply `effectiveDate` at submit time. When `withEffectiveDateField`
|
|
22
|
+
* is `true`, this overrides the form's value. When `withEffectiveDateField`
|
|
23
|
+
* is `false`, this is the only way to put `effective_date` on the wire —
|
|
24
|
+
* the form value is not read in that mode (matching the options-only
|
|
25
|
+
* convention of `useWorkAddressForm` / `useHomeAddressForm` / `useJobForm`).
|
|
26
|
+
*/
|
|
27
|
+
effectiveDate?: string;
|
|
20
28
|
}
|
|
21
29
|
export interface UseCompensationFormProps {
|
|
22
30
|
employeeId?: string;
|
|
23
|
-
/**
|
|
31
|
+
/** The parent job's UUID. Required in create mode (scopes `POST /v1/jobs/:jobId/compensations`). Optional in update mode — the parent job is derived from the loaded compensation. */
|
|
24
32
|
jobId?: string;
|
|
25
33
|
/** Present → update mode (PUT /v1/compensations/:id). Omitted → create mode (POST /v1/jobs/:jobId/compensations). */
|
|
26
34
|
compensationId?: string;
|
|
@@ -28,6 +36,19 @@ export interface UseCompensationFormProps {
|
|
|
28
36
|
defaultValues?: Partial<CompensationFormData>;
|
|
29
37
|
validationMode?: UseFormProps['mode'];
|
|
30
38
|
shouldFocusError?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When `false`, hides `Fields.EffectiveDate` (becomes `undefined`) and
|
|
41
|
+
* removes `effectiveDate` from schema validation. In this mode the hook
|
|
42
|
+
* does not read any form value at submit time — `effective_date` is
|
|
43
|
+
* omitted from the request body unless explicitly supplied via
|
|
44
|
+
* `CompensationSubmitOptions.effectiveDate`. This matches the
|
|
45
|
+
* options-only convention of `useWorkAddressForm` /
|
|
46
|
+
* `useHomeAddressForm` / `useJobForm`, and means the
|
|
47
|
+
* `willDeleteSecondaryJobs` carve-out's form-state side effects do not
|
|
48
|
+
* leak onto the wire (there is no field to render them in anyway).
|
|
49
|
+
* Defaults to `true`.
|
|
50
|
+
*/
|
|
51
|
+
withEffectiveDateField?: boolean;
|
|
31
52
|
}
|
|
32
53
|
export interface CompensationFormFields {
|
|
33
54
|
Title: typeof TitleField;
|
|
@@ -42,7 +63,7 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
|
|
|
42
63
|
data: {
|
|
43
64
|
/** The compensation row loaded for update; `null` in create mode. */
|
|
44
65
|
compensation: Compensation | null;
|
|
45
|
-
/** The parent job
|
|
66
|
+
/** The parent job. In update mode it's derived from the loaded compensation; in create mode it's looked up by `jobId`. `null` if neither resolves. */
|
|
46
67
|
currentJob: Job | null;
|
|
47
68
|
minimumWages: MinimumWage[];
|
|
48
69
|
/** Lower bound for `effectiveDate` (typically the parent job's hire date). */
|
|
@@ -80,6 +101,6 @@ export interface UseCompensationFormReady extends BaseFormHookReady<FieldsMetada
|
|
|
80
101
|
onSubmit: (options?: CompensationSubmitOptions) => Promise<HookSubmitResult<Compensation> | undefined>;
|
|
81
102
|
};
|
|
82
103
|
}
|
|
83
|
-
export declare function useCompensationForm({ employeeId, jobId, compensationId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, }: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady;
|
|
104
|
+
export declare function useCompensationForm({ employeeId, jobId, compensationId, optionalFieldsToRequire, defaultValues: partnerDefaults, validationMode, shouldFocusError, withEffectiveDateField, }: UseCompensationFormProps): HookLoadingResult | UseCompensationFormReady;
|
|
84
105
|
export type UseCompensationFormResult = HookLoadingResult | UseCompensationFormReady;
|
|
85
106
|
export type CompensationFieldsMetadata = UseCompensationFormReady['form']['fieldsMetadata'];
|
package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js
CHANGED
|
@@ -1,197 +1,209 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useJobsAndCompensationsGetJobs as
|
|
5
|
-
import { useJobsAndCompensationsCreateCompensationMutation as
|
|
6
|
-
import { useJobsAndCompensationsUpdateCompensationMutation as
|
|
7
|
-
import { useLocationsGetMinimumWages as
|
|
8
|
-
import { useEmployeeAddressesGetWorkAddresses as
|
|
1
|
+
import { useRef as X, useMemo as oe, useEffect as V } from "react";
|
|
2
|
+
import { useForm as De, useWatch as se } from "react-hook-form";
|
|
3
|
+
import { zodResolver as Ae } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useJobsAndCompensationsGetJobs as Ie } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
|
|
5
|
+
import { useJobsAndCompensationsCreateCompensationMutation as Ue } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation";
|
|
6
|
+
import { useJobsAndCompensationsUpdateCompensationMutation as Re } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
|
|
7
|
+
import { useLocationsGetMinimumWages as Te } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
|
|
8
|
+
import { useEmployeeAddressesGetWorkAddresses as je } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
9
9
|
import { useEmployeesGet as we } from "@gusto/embedded-api/react-query/employeesGet";
|
|
10
|
-
import { createCompensationSchema as
|
|
11
|
-
import { EffectiveDateField as
|
|
12
|
-
import { withOptions as
|
|
13
|
-
import { createGetFormSubmissionValues as
|
|
14
|
-
import { useDeriveFieldsMetadata as
|
|
15
|
-
import { useHookFormInternals as
|
|
16
|
-
import { composeErrorHandler as
|
|
17
|
-
import { PAY_PERIODS as
|
|
18
|
-
import { useBaseSubmit as
|
|
19
|
-
import { SDKInternalError as
|
|
20
|
-
function
|
|
21
|
-
|
|
10
|
+
import { createCompensationSchema as Le } from "./compensationSchema.js";
|
|
11
|
+
import { EffectiveDateField as _e, MinimumWageIdField as Xe, AdjustForMinimumWageField as Ve, PaymentUnitField as Je, RateField as Ye, FlsaStatusField as ke, TitleField as qe } from "./fields.js";
|
|
12
|
+
import { withOptions as J } from "../../../../../partner-hook-utils/form/withOptions.js";
|
|
13
|
+
import { createGetFormSubmissionValues as He } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
|
|
14
|
+
import { useDeriveFieldsMetadata as Be } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
|
|
15
|
+
import { useHookFormInternals as Ge } from "../../../../../partner-hook-utils/form/useHookFormInternals.js";
|
|
16
|
+
import { composeErrorHandler as Ke } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
17
|
+
import { PAY_PERIODS as d, FlsaStatus as t, TIP_CREDITS_UNSUPPORTED_STATES as Qe } from "../../../../../shared/constants.js";
|
|
18
|
+
import { useBaseSubmit as $e } from "../../../../Base/useBaseSubmit.js";
|
|
19
|
+
import { SDKInternalError as E } from "../../../../../types/sdkError.js";
|
|
20
|
+
function xe(e, n, s) {
|
|
21
|
+
if (!e) return { compensation: null, job: null };
|
|
22
|
+
if (n) {
|
|
23
|
+
for (const i of e) {
|
|
24
|
+
const a = i.compensations?.find((C) => C.uuid === n);
|
|
25
|
+
if (a) return { compensation: a, job: i };
|
|
26
|
+
}
|
|
27
|
+
return { compensation: null, job: null };
|
|
28
|
+
}
|
|
29
|
+
return s ? { compensation: null, job: e.find((i) => i.uuid === s) ?? null } : { compensation: null, job: null };
|
|
30
|
+
}
|
|
31
|
+
function ze(e) {
|
|
32
|
+
if (!e) return null;
|
|
33
|
+
for (const n of e) {
|
|
34
|
+
if (!n.primary) continue;
|
|
35
|
+
const s = n.compensations?.find((i) => i.uuid === n.currentCompensationUuid);
|
|
36
|
+
if (s?.flsaStatus) return s.flsaStatus;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function Ze(e) {
|
|
41
|
+
if (!e?.compensations) return [];
|
|
42
|
+
const n = re();
|
|
43
|
+
return e.compensations.filter((s) => s.effectiveDate !== void 0 && s.effectiveDate > n);
|
|
22
44
|
}
|
|
23
|
-
|
|
45
|
+
function et(e) {
|
|
46
|
+
return e.length === 0 ? null : e.reduce((n, s) => {
|
|
47
|
+
const i = s.effectiveDate;
|
|
48
|
+
return i && (!n || i < n) ? i : n;
|
|
49
|
+
}, null);
|
|
50
|
+
}
|
|
51
|
+
const ie = [
|
|
24
52
|
t.EXEMPT,
|
|
25
53
|
t.SALARIED_NONEXEMPT,
|
|
26
54
|
t.NONEXEMPT,
|
|
27
55
|
t.OWNER,
|
|
28
56
|
t.COMMISSION_ONLY_EXEMPT,
|
|
29
57
|
t.COMMISSION_ONLY_NONEXEMPT
|
|
30
|
-
],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
],
|
|
37
|
-
function
|
|
58
|
+
], tt = ie.map((e) => ({ value: e, label: e })), ae = [
|
|
59
|
+
d.HOUR,
|
|
60
|
+
d.WEEK,
|
|
61
|
+
d.MONTH,
|
|
62
|
+
d.YEAR,
|
|
63
|
+
d.PAYCHECK
|
|
64
|
+
], nt = ae.map((e) => ({ value: e, label: e }));
|
|
65
|
+
function re() {
|
|
38
66
|
return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
39
67
|
}
|
|
40
|
-
function
|
|
41
|
-
employeeId:
|
|
42
|
-
jobId:
|
|
43
|
-
compensationId:
|
|
44
|
-
optionalFieldsToRequire:
|
|
45
|
-
defaultValues:
|
|
46
|
-
validationMode:
|
|
47
|
-
shouldFocusError: ue = !0
|
|
68
|
+
function ht({
|
|
69
|
+
employeeId: e,
|
|
70
|
+
jobId: n,
|
|
71
|
+
compensationId: s,
|
|
72
|
+
optionalFieldsToRequire: i,
|
|
73
|
+
defaultValues: a,
|
|
74
|
+
validationMode: C = "onSubmit",
|
|
75
|
+
shouldFocusError: ue = !0,
|
|
76
|
+
withEffectiveDateField: O = !0
|
|
48
77
|
}) {
|
|
49
|
-
const P =
|
|
50
|
-
{ employeeId:
|
|
51
|
-
{ enabled: !!
|
|
52
|
-
), D =
|
|
53
|
-
{ employeeId:
|
|
54
|
-
{ enabled: !!
|
|
55
|
-
),
|
|
56
|
-
{ locationUuid:
|
|
57
|
-
{ enabled: !!
|
|
58
|
-
),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
(u) => u.effectiveDate !== void 0 && u.effectiveDate > e
|
|
74
|
-
);
|
|
75
|
-
}, [n]), de = h.length > 0, ce = l(() => h.length === 0 ? null : h.reduce((e, u) => {
|
|
76
|
-
const c = u.effectiveDate;
|
|
77
|
-
return c && (!e || c < e) ? c : e;
|
|
78
|
-
}, null), [h]), E = !S, J = E ? "create" : "update", T = E && W === t.NONEXEMPT, [H, le] = l(
|
|
79
|
-
() => Te({ mode: J, optionalFieldsToRequire: Y, hireDate: w }),
|
|
80
|
-
[J, Y, w]
|
|
81
|
-
), B = k?.state, y = l(
|
|
78
|
+
const P = Ie(
|
|
79
|
+
{ employeeId: e ?? "" },
|
|
80
|
+
{ enabled: !!e }
|
|
81
|
+
), D = je(
|
|
82
|
+
{ employeeId: e ?? "" },
|
|
83
|
+
{ enabled: !!e }
|
|
84
|
+
), A = we({ employeeId: e ?? "" }, { enabled: !!e }), l = P.data?.jobs, Y = D.data?.employeeWorkAddressesList?.find((o) => o.active), k = Y?.locationUuid, me = A.data?.employee, I = Te(
|
|
85
|
+
{ locationUuid: k ?? "" },
|
|
86
|
+
{ enabled: !!k }
|
|
87
|
+
), y = I.data?.minimumWageList ?? [], { compensation: r, job: p } = xe(
|
|
88
|
+
l,
|
|
89
|
+
s,
|
|
90
|
+
n
|
|
91
|
+
), ce = l && p ? l.filter((o) => o.uuid !== p.uuid).length : 0, U = X(null);
|
|
92
|
+
U.current === null && l !== void 0 && (U.current = l.some((o) => o.primary));
|
|
93
|
+
const W = U.current === !0 ? ze(l) : null, R = p?.hireDate ?? null, q = Ze(p), de = q.length > 0, le = et(q), F = !s, T = F ? "create" : "update", j = F && W === t.NONEXEMPT, [H, fe] = oe(
|
|
94
|
+
() => Le({
|
|
95
|
+
mode: T,
|
|
96
|
+
optionalFieldsToRequire: i,
|
|
97
|
+
hireDate: R,
|
|
98
|
+
withEffectiveDateField: O
|
|
99
|
+
}),
|
|
100
|
+
[T, i, R, O]
|
|
101
|
+
), B = Y?.state, N = oe(
|
|
82
102
|
() => ({
|
|
83
|
-
title:
|
|
103
|
+
title: r?.title ?? a?.title ?? "",
|
|
84
104
|
// When adding a secondary, the FLSA must match the primary's — force it
|
|
85
105
|
// here (overriding any partner default) so the form submits the right
|
|
86
106
|
// value even though `Fields.FlsaStatus` is hidden.
|
|
87
|
-
flsaStatus:
|
|
88
|
-
rate: Number(
|
|
89
|
-
adjustForMinimumWage:
|
|
90
|
-
minimumWageId:
|
|
91
|
-
paymentUnit:
|
|
92
|
-
effectiveDate:
|
|
107
|
+
flsaStatus: j ? W : r?.flsaStatus ?? a?.flsaStatus ?? W ?? void 0,
|
|
108
|
+
rate: Number(r?.rate ?? a?.rate ?? 0),
|
|
109
|
+
adjustForMinimumWage: r?.adjustForMinimumWage ?? a?.adjustForMinimumWage ?? !1,
|
|
110
|
+
minimumWageId: r?.minimumWages?.[0]?.uuid ?? a?.minimumWageId ?? "",
|
|
111
|
+
paymentUnit: r?.paymentUnit ?? a?.paymentUnit ?? d.HOUR,
|
|
112
|
+
effectiveDate: r?.effectiveDate ?? a?.effectiveDate ?? null
|
|
93
113
|
}),
|
|
94
|
-
[
|
|
95
|
-
),
|
|
96
|
-
resolver:
|
|
97
|
-
mode:
|
|
114
|
+
[r, a, W, j]
|
|
115
|
+
), M = De({
|
|
116
|
+
resolver: Ae(H),
|
|
117
|
+
mode: C,
|
|
98
118
|
shouldFocusError: ue,
|
|
99
|
-
defaultValues:
|
|
100
|
-
values:
|
|
119
|
+
defaultValues: N,
|
|
120
|
+
values: N,
|
|
101
121
|
resetOptions: { keepDirtyValues: !0 }
|
|
102
|
-
}), { control: G, getValues:
|
|
122
|
+
}), { control: G, getValues: S, setValue: u } = M, m = se({ control: G, name: "flsaStatus" }), pe = se({
|
|
103
123
|
control: G,
|
|
104
124
|
name: "adjustForMinimumWage"
|
|
105
125
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
e && !C.current ? (j.current = O("effectiveDate") ?? null, a("effectiveDate", ne(), { shouldDirty: !0, shouldValidate: !1 }), C.current = !0) : !e && C.current && (a("effectiveDate", j.current ?? null, {
|
|
126
|
+
V(() => {
|
|
127
|
+
m === t.OWNER ? u("paymentUnit", d.PAYCHECK) : m === t.COMMISSION_ONLY_NONEXEMPT || m === t.COMMISSION_ONLY_EXEMPT ? (u("paymentUnit", d.YEAR), u("rate", 0)) : u("paymentUnit", N.paymentUnit);
|
|
128
|
+
}, [m, u, N.paymentUnit]);
|
|
129
|
+
const Ee = r?.flsaStatus, v = !F && Ee === t.NONEXEMPT && m !== void 0 && m !== t.NONEXEMPT && ce > 0, h = X(!1), w = X(null);
|
|
130
|
+
V(() => {
|
|
131
|
+
v && !h.current ? (w.current = S("effectiveDate") ?? null, u("effectiveDate", re(), { shouldDirty: !0, shouldValidate: !1 }), h.current = !0) : !v && h.current && (u("effectiveDate", w.current ?? null, {
|
|
113
132
|
shouldDirty: !0,
|
|
114
133
|
shouldValidate: !1
|
|
115
|
-
}),
|
|
116
|
-
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
})), z = !E && R === t.NONEXEMPT && i !== void 0 && i !== t.NONEXEMPT && A > 0, M = qe(le, v.control), Ne = {
|
|
136
|
-
title: M.title,
|
|
137
|
-
effectiveDate: { ...M.effectiveDate, isDisabled: z },
|
|
138
|
-
flsaStatus: V(
|
|
139
|
-
M.flsaStatus,
|
|
140
|
-
Qe,
|
|
141
|
-
oe
|
|
134
|
+
}), w.current = null, h.current = !1);
|
|
135
|
+
}, [v, S, u]);
|
|
136
|
+
const K = Re(), Q = Ue(), Me = K.isPending || Q.isPending, {
|
|
137
|
+
baseSubmitHandler: Se,
|
|
138
|
+
error: ve,
|
|
139
|
+
setError: ge
|
|
140
|
+
} = $e("CompensationForm"), $ = Ke(e ? [P, D, A, I] : [], { submitError: ve, setSubmitError: ge }), x = m === t.COMMISSION_ONLY_NONEXEMPT || m === t.COMMISSION_ONLY_EXEMPT, be = m === t.OWNER, Oe = !j && (m !== t.NONEXEMPT || p?.primary === !0 || F), g = m === t.NONEXEMPT && y.length > 0 && B !== void 0 && !Qe.includes(B);
|
|
141
|
+
V(() => {
|
|
142
|
+
g || (S("adjustForMinimumWage") && u("adjustForMinimumWage", !1, { shouldDirty: !0, shouldValidate: !1 }), S("minimumWageId") && u("minimumWageId", "", { shouldDirty: !0, shouldValidate: !1 }));
|
|
143
|
+
}, [g, S, u]);
|
|
144
|
+
const ye = y.map((o) => ({
|
|
145
|
+
value: o.uuid,
|
|
146
|
+
label: `${o.wage} - ${o.authority}: ${o.notes ?? ""}`
|
|
147
|
+
})), f = Be(fe, M.control), We = {
|
|
148
|
+
title: f.title,
|
|
149
|
+
effectiveDate: { ...f.effectiveDate, isDisabled: v },
|
|
150
|
+
flsaStatus: J(
|
|
151
|
+
f.flsaStatus,
|
|
152
|
+
tt,
|
|
153
|
+
ie
|
|
142
154
|
),
|
|
143
|
-
rate: { ...
|
|
144
|
-
paymentUnit:
|
|
145
|
-
{ ...
|
|
146
|
-
|
|
155
|
+
rate: { ...f.rate, isDisabled: x },
|
|
156
|
+
paymentUnit: J(
|
|
157
|
+
{ ...f.paymentUnit, isDisabled: be || x },
|
|
158
|
+
nt,
|
|
147
159
|
ae
|
|
148
160
|
),
|
|
149
161
|
adjustForMinimumWage: {
|
|
150
|
-
...
|
|
151
|
-
isDisabled: !
|
|
162
|
+
...f.adjustForMinimumWage,
|
|
163
|
+
isDisabled: !g
|
|
152
164
|
},
|
|
153
|
-
minimumWageId:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
minimumWageId: J(
|
|
166
|
+
f.minimumWageId,
|
|
167
|
+
ye,
|
|
168
|
+
y
|
|
157
169
|
)
|
|
158
|
-
},
|
|
159
|
-
let
|
|
160
|
-
return await new Promise((
|
|
161
|
-
|
|
162
|
-
async (
|
|
163
|
-
await
|
|
164
|
-
const
|
|
165
|
-
rate: String(
|
|
166
|
-
paymentUnit:
|
|
167
|
-
flsaStatus:
|
|
168
|
-
effectiveDate:
|
|
169
|
-
title:
|
|
170
|
-
adjustForMinimumWage:
|
|
171
|
-
minimumWages:
|
|
170
|
+
}, Fe = async (o) => {
|
|
171
|
+
let z;
|
|
172
|
+
return await new Promise((Z) => {
|
|
173
|
+
M.handleSubmit(
|
|
174
|
+
async (Ce) => {
|
|
175
|
+
await Se(Ce, async (c) => {
|
|
176
|
+
const ee = o?.jobId ?? n, L = o?.compensationId ?? s, te = L ? "update" : "create", Pe = O ? o?.effectiveDate ?? c.effectiveDate ?? void 0 : o?.effectiveDate ?? void 0, ne = {
|
|
177
|
+
rate: String(c.rate),
|
|
178
|
+
paymentUnit: c.paymentUnit,
|
|
179
|
+
flsaStatus: c.flsaStatus,
|
|
180
|
+
effectiveDate: Pe,
|
|
181
|
+
title: c.title || void 0,
|
|
182
|
+
adjustForMinimumWage: c.adjustForMinimumWage,
|
|
183
|
+
minimumWages: c.adjustForMinimumWage ? [{ uuid: c.minimumWageId }] : []
|
|
172
184
|
};
|
|
173
185
|
let b;
|
|
174
|
-
if (
|
|
175
|
-
if (!
|
|
176
|
-
throw new
|
|
186
|
+
if (te === "create") {
|
|
187
|
+
if (!ee)
|
|
188
|
+
throw new E(
|
|
177
189
|
"jobId is required to create a compensation. Pass it as a hook prop or via submit options."
|
|
178
190
|
);
|
|
179
|
-
if (!
|
|
180
|
-
throw new
|
|
191
|
+
if (!c.flsaStatus)
|
|
192
|
+
throw new E("flsaStatus is required to create a compensation.");
|
|
181
193
|
if (b = (await Q.mutateAsync({
|
|
182
194
|
request: {
|
|
183
|
-
jobId:
|
|
184
|
-
compensationsRequestBody: { ...
|
|
195
|
+
jobId: ee,
|
|
196
|
+
compensationsRequestBody: { ...ne, flsaStatus: c.flsaStatus }
|
|
185
197
|
}
|
|
186
|
-
})).compensation, !b) throw new
|
|
198
|
+
})).compensation, !b) throw new E("Compensation creation failed");
|
|
187
199
|
} else {
|
|
188
200
|
if (!L)
|
|
189
|
-
throw new
|
|
201
|
+
throw new E(
|
|
190
202
|
"compensationId is required to update a compensation. Pass it as a hook prop or via submit options."
|
|
191
203
|
);
|
|
192
|
-
const _ =
|
|
204
|
+
const _ = o?.compensationVersion ?? r?.version;
|
|
193
205
|
if (!_)
|
|
194
|
-
throw new
|
|
206
|
+
throw new E(
|
|
195
207
|
"compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded."
|
|
196
208
|
);
|
|
197
209
|
if (b = (await K.mutateAsync({
|
|
@@ -199,54 +211,54 @@ function vt({
|
|
|
199
211
|
compensationId: L,
|
|
200
212
|
compensationsUpdateRequestBody: {
|
|
201
213
|
version: _,
|
|
202
|
-
...
|
|
214
|
+
...ne
|
|
203
215
|
}
|
|
204
216
|
}
|
|
205
|
-
})).compensation, !b) throw new
|
|
217
|
+
})).compensation, !b) throw new E("Compensation update failed");
|
|
206
218
|
}
|
|
207
|
-
|
|
208
|
-
}),
|
|
219
|
+
z = { mode: te, data: b };
|
|
220
|
+
}), Z();
|
|
209
221
|
},
|
|
210
222
|
() => {
|
|
211
|
-
|
|
223
|
+
Z();
|
|
212
224
|
}
|
|
213
225
|
)();
|
|
214
|
-
}),
|
|
215
|
-
},
|
|
216
|
-
return
|
|
226
|
+
}), z;
|
|
227
|
+
}, Ne = e ? P.isLoading || D.isLoading || A.isLoading || I.isLoading : !1, he = Ge(M);
|
|
228
|
+
return Ne || e && (!l || !me) ? { isLoading: !0, errorHandling: $ } : {
|
|
217
229
|
isLoading: !1,
|
|
218
230
|
data: {
|
|
219
|
-
compensation:
|
|
220
|
-
currentJob:
|
|
221
|
-
minimumWages:
|
|
222
|
-
minimumEffectiveDate:
|
|
223
|
-
maximumEffectiveDate:
|
|
231
|
+
compensation: r,
|
|
232
|
+
currentJob: p,
|
|
233
|
+
minimumWages: y,
|
|
234
|
+
minimumEffectiveDate: R,
|
|
235
|
+
maximumEffectiveDate: le,
|
|
224
236
|
hasPendingFutureCompensation: de
|
|
225
237
|
},
|
|
226
238
|
status: {
|
|
227
|
-
isPending:
|
|
228
|
-
mode:
|
|
229
|
-
willDeleteSecondaryJobs:
|
|
239
|
+
isPending: Me,
|
|
240
|
+
mode: T,
|
|
241
|
+
willDeleteSecondaryJobs: v
|
|
230
242
|
},
|
|
231
|
-
actions: { onSubmit:
|
|
243
|
+
actions: { onSubmit: Fe },
|
|
232
244
|
errorHandling: $,
|
|
233
245
|
form: {
|
|
234
246
|
Fields: {
|
|
235
|
-
Title:
|
|
236
|
-
FlsaStatus:
|
|
237
|
-
Rate:
|
|
238
|
-
PaymentUnit:
|
|
239
|
-
AdjustForMinimumWage:
|
|
240
|
-
MinimumWageId:
|
|
241
|
-
EffectiveDate:
|
|
247
|
+
Title: qe,
|
|
248
|
+
FlsaStatus: Oe ? ke : void 0,
|
|
249
|
+
Rate: Ye,
|
|
250
|
+
PaymentUnit: Je,
|
|
251
|
+
AdjustForMinimumWage: g ? Ve : void 0,
|
|
252
|
+
MinimumWageId: g && pe ? Xe : void 0,
|
|
253
|
+
EffectiveDate: O ? _e : void 0
|
|
242
254
|
},
|
|
243
|
-
fieldsMetadata:
|
|
244
|
-
hookFormInternals:
|
|
245
|
-
getFormSubmissionValues:
|
|
255
|
+
fieldsMetadata: We,
|
|
256
|
+
hookFormInternals: he,
|
|
257
|
+
getFormSubmissionValues: He(M, H)
|
|
246
258
|
}
|
|
247
259
|
};
|
|
248
260
|
}
|
|
249
261
|
export {
|
|
250
|
-
|
|
262
|
+
ht as useCompensationForm
|
|
251
263
|
};
|
|
252
264
|
//# sourceMappingURL=useCompensationForm.js.map
|