@gusto/embedded-react-sdk 0.46.0 → 0.46.3
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 +117 -0
- package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
- package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
- package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
- package/dist/components/Common/DataView/DataTable/DataTable.js +85 -80
- package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -0
- package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -0
- package/dist/components/Common/DataView/DataView.d.ts +1 -0
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Common/DataView/useDataView.d.ts +10 -1
- package/dist/components/Common/DataView/useDataView.js +20 -17
- package/dist/components/Common/DataView/useDataView.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +10 -10
- package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
- package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +9 -9
- package/dist/components/Common/PaginationControl/PaginationControl.js +11 -10
- package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
- package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js +11 -10
- package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +4 -4
- package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
- package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
- package/dist/components/Common/UI/NumberInput/NumberInput.js +51 -48
- package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +1 -1
- package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +6 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +3 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +5 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +33 -34
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +60 -202
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +79 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
- package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +36 -36
- package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
- package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
- package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +213 -191
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +6 -5
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +162 -131
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +74 -88
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.js +86 -72
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -3
- package/dist/components/Employee/Dashboard/DashboardComponents.js +138 -101
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +17 -10
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +359 -313
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +5 -3
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -1
- package/dist/components/Employee/Dashboard/TaxesView.js +114 -101
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +147 -148
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +37 -36
- package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +2 -2
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +34 -35
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +57 -57
- package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +14 -5
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +55 -36
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +18 -18
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +3 -3
- package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
- package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
- package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
- package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +170 -157
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +56 -55
- package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +20 -20
- package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +0 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +11 -12
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.test.d.ts +1 -0
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +6 -1
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +95 -94
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +6 -1
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +87 -86
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +18 -18
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +3 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
- package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +96 -89
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +61 -60
- package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
- package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
- package/dist/components/Employee/exports/employeeManagement.js +18 -16
- package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
- package/dist/components/Employee/index.d.ts +2 -0
- package/dist/components/Employee/index.js +32 -30
- package/dist/components/Employee/index.js.map +1 -1
- package/dist/components/Flow/FlowHeader.js +34 -31
- package/dist/components/Flow/FlowHeader.js.map +1 -1
- package/dist/components/Flow/useFlow.d.ts +12 -0
- package/dist/components/Flow/useFlow.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
- package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
- package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
- package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
- package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
- 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 +91 -87
- 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 +91 -125
- 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 +60 -91
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +4 -4
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +0 -16
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +139 -225
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +78 -54
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
- package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
- package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +34 -34
- package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
- package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
- package/dist/helpers/breadcrumbHelpers.d.ts +1 -1
- package/dist/helpers/breadcrumbHelpers.js.map +1 -1
- package/dist/helpers/federalEin.d.ts +1 -0
- package/dist/helpers/federalEin.js.map +1 -1
- package/dist/helpers/mask.d.ts +8 -4
- package/dist/helpers/mask.js.map +1 -1
- package/dist/helpers/rem.d.ts +2 -1
- package/dist/helpers/rem.js.map +1 -1
- package/dist/hooks/useAsyncError.d.ts +1 -0
- package/dist/hooks/useAsyncError.js.map +1 -1
- package/dist/hooks/useForkRef/useForkRef.d.ts +1 -0
- package/dist/hooks/useForkRef/useForkRef.js.map +1 -1
- package/dist/i18n/I18n.d.ts +9 -1
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +14 -14
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +16 -22
- package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
- package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
- package/dist/i18n/en/Employee.Compensation.json.js +66 -58
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +28 -24
- package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
- package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Employee.PaymentMethod.json.js +25 -25
- package/dist/i18n/en/Employee.StateTaxes.json.js +12 -10
- package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
- package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
- package/dist/i18n/en/common.json.d.ts +14 -0
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
- package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
- package/dist/partner-hook-utils/types.d.ts +4 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +13 -12
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/i18next.d.ts +30 -29
- package/dist/types/observability.d.ts +1 -1
- package/docs/reference/endpoint-inventory.json +24 -8
- package/package.json +30 -27
- package/dist/components/Employee/Dashboard/CompensationCard.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/fields.tsx"],"sourcesContent":["import type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { CompensationErrorCodes } from './compensationSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { CheckboxHookFieldProps } from '@/partner-hook-utils/form/fields/CheckboxHookField'\nimport type { DatePickerHookFieldProps } from '@/partner-hook-utils/form/fields/DatePickerHookField'\nimport {\n TextInputHookField,\n SelectHookField,\n NumberInputHookField,\n CheckboxHookField,\n DatePickerHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\nexport type RequiredValidation = typeof CompensationErrorCodes.REQUIRED\nexport type RateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'RATE_MINIMUM'\n | 'RATE_EXEMPT_THRESHOLD']\nexport type EffectiveDateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'EFFECTIVE_DATE_BEFORE_HIRE']\n\nexport type TitleFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\nexport function TitleField(props: TitleFieldProps) {\n return <TextInputHookField {...props} name=\"title\" />\n}\n\nexport type FlsaStatusFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, FlsaStatusType>\n>\n\nexport function FlsaStatusField(props: FlsaStatusFieldProps) {\n return <SelectHookField {...props} name=\"flsaStatus\" />\n}\n\nexport type RateFieldProps = HookFieldProps<NumberInputHookFieldProps<RateValidation>>\n\nexport function RateField(props: RateFieldProps) {\n return <NumberInputHookField {...props} name=\"rate\" format=\"currency\" min={0} />\n}\n\nexport type PaymentUnitFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentUnit>\n>\n\nexport function PaymentUnitField(props: PaymentUnitFieldProps) {\n return <SelectHookField {...props} name=\"paymentUnit\" />\n}\n\nexport type AdjustForMinimumWageFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\nexport function AdjustForMinimumWageField(props: AdjustForMinimumWageFieldProps) {\n return <CheckboxHookField {...props} name=\"adjustForMinimumWage\" />\n}\n\nexport type MinimumWageIdFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, MinimumWage>\n>\n\nexport function MinimumWageIdField(props: MinimumWageIdFieldProps) {\n return <SelectHookField {...props} name=\"minimumWageId\" />\n}\n\nexport type EffectiveDateFieldProps = HookFieldProps<\n DatePickerHookFieldProps<EffectiveDateValidation>\n>\n\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["TitleField","props","jsx","TextInputHookField","FlsaStatusField","SelectHookField","RateField","NumberInputHookField","PaymentUnitField","AdjustForMinimumWageField","CheckboxHookField","MinimumWageIdField","EffectiveDateField","DatePickerHookField"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Compensation/shared/useCompensationForm/fields.tsx"],"sourcesContent":["import type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { CompensationErrorCodes } from './compensationSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { CheckboxHookFieldProps } from '@/partner-hook-utils/form/fields/CheckboxHookField'\nimport type { DatePickerHookFieldProps } from '@/partner-hook-utils/form/fields/DatePickerHookField'\nimport {\n TextInputHookField,\n SelectHookField,\n NumberInputHookField,\n CheckboxHookField,\n DatePickerHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\nexport type RequiredValidation = typeof CompensationErrorCodes.REQUIRED\nexport type RateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'RATE_MINIMUM'\n | 'RATE_EXEMPT_THRESHOLD']\nexport type EffectiveDateValidation = (typeof CompensationErrorCodes)[\n | 'REQUIRED'\n | 'EFFECTIVE_DATE_BEFORE_HIRE'\n | 'EFFECTIVE_DATE_BEFORE_MIN']\n\nexport type TitleFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\nexport function TitleField(props: TitleFieldProps) {\n return <TextInputHookField {...props} name=\"title\" />\n}\n\nexport type FlsaStatusFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, FlsaStatusType>\n>\n\nexport function FlsaStatusField(props: FlsaStatusFieldProps) {\n return <SelectHookField {...props} name=\"flsaStatus\" />\n}\n\nexport type RateFieldProps = HookFieldProps<NumberInputHookFieldProps<RateValidation>>\n\nexport function RateField(props: RateFieldProps) {\n return <NumberInputHookField {...props} name=\"rate\" format=\"currency\" min={0} />\n}\n\nexport type PaymentUnitFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentUnit>\n>\n\nexport function PaymentUnitField(props: PaymentUnitFieldProps) {\n return <SelectHookField {...props} name=\"paymentUnit\" />\n}\n\nexport type AdjustForMinimumWageFieldProps = HookFieldProps<CheckboxHookFieldProps>\n\nexport function AdjustForMinimumWageField(props: AdjustForMinimumWageFieldProps) {\n return <CheckboxHookField {...props} name=\"adjustForMinimumWage\" />\n}\n\nexport type MinimumWageIdFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, MinimumWage>\n>\n\nexport function MinimumWageIdField(props: MinimumWageIdFieldProps) {\n return <SelectHookField {...props} name=\"minimumWageId\" />\n}\n\nexport type EffectiveDateFieldProps = HookFieldProps<\n DatePickerHookFieldProps<EffectiveDateValidation>\n>\n\nexport function EffectiveDateField(props: EffectiveDateFieldProps) {\n return <DatePickerHookField {...props} name=\"effectiveDate\" />\n}\n"],"names":["TitleField","props","jsx","TextInputHookField","FlsaStatusField","SelectHookField","RateField","NumberInputHookField","PaymentUnitField","AdjustForMinimumWageField","CheckboxHookField","MinimumWageIdField","EffectiveDateField","DatePickerHookField"],"mappings":";;;;;;AA8BO,SAASA,EAAWC,GAAwB;AACjD,SAAO,gBAAAC,EAACC,GAAA,EAAoB,GAAGF,GAAO,MAAK,SAAQ;AACrD;AAMO,SAASG,EAAgBH,GAA6B;AAC3D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,cAAa;AACvD;AAIO,SAASK,EAAUL,GAAuB;AAC/C,SAAO,gBAAAC,EAACK,KAAsB,GAAGN,GAAO,MAAK,QAAO,QAAO,YAAW,KAAK,EAAA,CAAG;AAChF;AAMO,SAASO,EAAiBP,GAA8B;AAC7D,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,eAAc;AACxD;AAIO,SAASQ,EAA0BR,GAAuC;AAC/E,SAAO,gBAAAC,EAACQ,GAAA,EAAmB,GAAGT,GAAO,MAAK,wBAAuB;AACnE;AAMO,SAASU,EAAmBV,GAAgC;AACjE,SAAO,gBAAAC,EAACG,GAAA,EAAiB,GAAGJ,GAAO,MAAK,iBAAgB;AAC1D;AAMO,SAASW,EAAmBX,GAAgC;AACjE,SAAO,gBAAAC,EAACW,GAAA,EAAqB,GAAGZ,GAAO,MAAK,iBAAgB;AAC9D;"}
|
package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js
CHANGED
|
@@ -1,267 +1,289 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { useForm as
|
|
3
|
-
import { zodResolver as
|
|
4
|
-
import { useJobsAndCompensationsGetJobs as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
1
|
+
import { useRef as q, useMemo as I, useEffect as H } from "react";
|
|
2
|
+
import { useForm as Ie, useWatch as me } from "react-hook-form";
|
|
3
|
+
import { zodResolver as Re } from "@hookform/resolvers/zod";
|
|
4
|
+
import { useJobsAndCompensationsGetJobs as Te } from "@gusto/embedded-api/react-query/jobsAndCompensationsGetJobs";
|
|
5
|
+
import { GetV1EmployeesEmployeeIdJobsQueryParamInclude as we } from "@gusto/embedded-api/models/operations/getv1employeesemployeeidjobs";
|
|
6
|
+
import { useJobsAndCompensationsCreateCompensationMutation as je } from "@gusto/embedded-api/react-query/jobsAndCompensationsCreateCompensation";
|
|
7
|
+
import { useJobsAndCompensationsUpdateCompensationMutation as Le } from "@gusto/embedded-api/react-query/jobsAndCompensationsUpdateCompensation";
|
|
8
|
+
import { useLocationsGetMinimumWages as _e } from "@gusto/embedded-api/react-query/locationsGetMinimumWages";
|
|
9
|
+
import { useEmployeeAddressesGetWorkAddresses as Je } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
|
|
10
|
+
import { useEmployeesGet as Ve } from "@gusto/embedded-api/react-query/employeesGet";
|
|
11
|
+
import { createCompensationSchema as Xe } from "./compensationSchema.js";
|
|
12
|
+
import { EffectiveDateField as ke, MinimumWageIdField as Ye, AdjustForMinimumWageField as qe, PaymentUnitField as He, RateField as Be, FlsaStatusField as Ge, TitleField as Qe } from "./fields.js";
|
|
13
|
+
import { withOptions as B } from "../../../../../partner-hook-utils/form/withOptions.js";
|
|
14
|
+
import { createGetFormSubmissionValues as Ke } from "../../../../../partner-hook-utils/form/getFormSubmissionValues.js";
|
|
15
|
+
import { useDeriveFieldsMetadata as $e } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
|
|
16
|
+
import { useHookFormInternals as xe } from "../../../../../partner-hook-utils/form/useHookFormInternals.js";
|
|
17
|
+
import { composeErrorHandler as ze } from "../../../../../partner-hook-utils/composeErrorHandler.js";
|
|
18
|
+
import { FlsaStatus as i, PAY_PERIODS as p, TIP_CREDITS_UNSUPPORTED_STATES as Ze } from "../../../../../shared/constants.js";
|
|
19
|
+
import { useBaseSubmit as et } from "../../../../Base/useBaseSubmit.js";
|
|
20
|
+
import { SDKInternalError as M } from "../../../../../types/sdkError.js";
|
|
21
|
+
import { formatDateToStringDate as tt, addDays as nt } from "../../../../../helpers/dateFormatting.js";
|
|
22
|
+
function it(e, o, n) {
|
|
21
23
|
if (!e) return { compensation: null, job: null };
|
|
22
|
-
if (
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
24
|
+
if (o) {
|
|
25
|
+
for (const s of e) {
|
|
26
|
+
const W = s.compensations?.find((R) => R.uuid === o);
|
|
27
|
+
if (W) return { compensation: W, job: s };
|
|
26
28
|
}
|
|
27
|
-
return { compensation: null, job: null };
|
|
29
|
+
return { compensation: null, job: n ? e.find((s) => s.uuid === n) ?? null : null };
|
|
28
30
|
}
|
|
29
|
-
return
|
|
31
|
+
return n ? { compensation: null, job: e.find((r) => r.uuid === n) ?? null } : { compensation: null, job: null };
|
|
30
32
|
}
|
|
31
|
-
function
|
|
33
|
+
function ot(e) {
|
|
32
34
|
if (!e) return null;
|
|
33
|
-
for (const
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
35
|
+
for (const o of e) {
|
|
36
|
+
if (!o.primary) continue;
|
|
37
|
+
const n = o.compensations?.find((r) => r.uuid === o.currentCompensationUuid);
|
|
38
|
+
if (n?.flsaStatus) return n.flsaStatus;
|
|
37
39
|
}
|
|
38
40
|
return null;
|
|
39
41
|
}
|
|
40
|
-
function
|
|
42
|
+
function st(e) {
|
|
41
43
|
if (!e?.compensations) return [];
|
|
42
|
-
const
|
|
43
|
-
return e.compensations.filter((
|
|
44
|
+
const o = de();
|
|
45
|
+
return e.compensations.filter((n) => n.effectiveDate !== void 0 && n.effectiveDate > o);
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
return e.length === 0 ? null : e.reduce((
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
function at(e) {
|
|
48
|
+
return e.length === 0 ? null : e.reduce((o, n) => {
|
|
49
|
+
const r = n.effectiveDate;
|
|
50
|
+
return r && (!o || r < o) ? r : o;
|
|
49
51
|
}, null);
|
|
50
52
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
],
|
|
65
|
-
function
|
|
53
|
+
const le = [
|
|
54
|
+
i.EXEMPT,
|
|
55
|
+
i.SALARIED_NONEXEMPT,
|
|
56
|
+
i.NONEXEMPT,
|
|
57
|
+
i.OWNER,
|
|
58
|
+
i.COMMISSION_ONLY_EXEMPT,
|
|
59
|
+
i.COMMISSION_ONLY_NONEXEMPT
|
|
60
|
+
], rt = le.map((e) => ({ value: e, label: e })), ce = [
|
|
61
|
+
p.HOUR,
|
|
62
|
+
p.WEEK,
|
|
63
|
+
p.MONTH,
|
|
64
|
+
p.YEAR,
|
|
65
|
+
p.PAYCHECK
|
|
66
|
+
], ut = ce.map((e) => ({ value: e, label: e }));
|
|
67
|
+
function de() {
|
|
66
68
|
return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
67
69
|
}
|
|
68
|
-
function
|
|
70
|
+
function wt({
|
|
69
71
|
employeeId: e,
|
|
70
|
-
jobId:
|
|
71
|
-
compensationId:
|
|
72
|
-
optionalFieldsToRequire:
|
|
73
|
-
defaultValues:
|
|
74
|
-
validationMode:
|
|
75
|
-
shouldFocusError:
|
|
76
|
-
withEffectiveDateField:
|
|
72
|
+
jobId: o,
|
|
73
|
+
compensationId: n,
|
|
74
|
+
optionalFieldsToRequire: r,
|
|
75
|
+
defaultValues: s,
|
|
76
|
+
validationMode: W = "onSubmit",
|
|
77
|
+
shouldFocusError: R = !0,
|
|
78
|
+
withEffectiveDateField: E = !0
|
|
77
79
|
}) {
|
|
78
|
-
const
|
|
79
|
-
{
|
|
80
|
+
const T = Te(
|
|
81
|
+
{
|
|
82
|
+
employeeId: e ?? "",
|
|
83
|
+
// Fetch all effective-dated compensations when editing an existing one so
|
|
84
|
+
// resolveCompAndJob can find the target comp (future-dated comps are
|
|
85
|
+
// omitted from the default response, which only returns the current comp).
|
|
86
|
+
include: n ? we.AllCompensations : void 0
|
|
87
|
+
},
|
|
80
88
|
{ enabled: !!e }
|
|
81
|
-
),
|
|
89
|
+
), w = Je(
|
|
82
90
|
{ employeeId: e ?? "" },
|
|
83
91
|
{ enabled: !!e }
|
|
84
|
-
),
|
|
85
|
-
{ locationUuid:
|
|
86
|
-
{ enabled: !!
|
|
87
|
-
),
|
|
92
|
+
), j = Ve({ employeeId: e ?? "" }, { enabled: !!e }), f = T.data?.jobs, G = w.data?.employeeWorkAddressesList?.find((t) => t.active), Q = G?.locationUuid, fe = j.data?.employee, L = _e(
|
|
93
|
+
{ locationUuid: Q ?? "" },
|
|
94
|
+
{ enabled: !!Q }
|
|
95
|
+
), C = L.data?.minimumWageList ?? [], { compensation: u, job: a } = it(
|
|
88
96
|
f,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
),
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
n,
|
|
98
|
+
o
|
|
99
|
+
), pe = f && a ? f.filter((t) => t.uuid !== a.uuid).length : 0, _ = q(null);
|
|
100
|
+
_.current === null && f !== void 0 && (_.current = f.some((t) => t.primary));
|
|
101
|
+
const F = _.current === !0 ? ot(f) : null, N = a?.hireDate ?? // Secondary jobs being created (AddAnotherJob) have no hireDate until the
|
|
102
|
+
// job POST completes. Fall back to the primary job's hireDate so the schema
|
|
103
|
+
// can enforce EFFECTIVE_DATE_BEFORE_HIRE during that window.
|
|
104
|
+
f?.find((t) => t.primary)?.hireDate ?? null, K = st(a).filter(
|
|
105
|
+
(t) => t.uuid !== n
|
|
106
|
+
), ve = K.length > 0, $ = at(K), d = !n, J = d ? "create" : "update", V = d && F === i.NONEXEMPT && a?.primary !== !0, h = I(() => {
|
|
107
|
+
if (E && !(!d && a?.primary === !0))
|
|
108
|
+
return tt(nt(/* @__PURE__ */ new Date(), 1)) ?? void 0;
|
|
109
|
+
}, [d, a?.primary, E]), [x, Ee] = I(
|
|
110
|
+
() => Xe({
|
|
111
|
+
mode: J,
|
|
112
|
+
optionalFieldsToRequire: r,
|
|
113
|
+
hireDate: N,
|
|
114
|
+
minEffectiveDate: h,
|
|
115
|
+
withEffectiveDateField: E
|
|
99
116
|
}),
|
|
100
|
-
[
|
|
101
|
-
),
|
|
117
|
+
[J, r, N, h, E]
|
|
118
|
+
), z = G?.state, P = I(
|
|
102
119
|
() => ({
|
|
103
|
-
title: u?.title ??
|
|
120
|
+
title: u?.title ?? s?.title ?? "",
|
|
104
121
|
// When adding a secondary, the FLSA must match the primary's — force it
|
|
105
122
|
// here (overriding any partner default) so the form submits the right
|
|
106
123
|
// value even though `Fields.FlsaStatus` is hidden.
|
|
107
|
-
flsaStatus:
|
|
108
|
-
rate: Number(u?.rate ??
|
|
109
|
-
adjustForMinimumWage: u?.adjustForMinimumWage ??
|
|
110
|
-
minimumWageId: u?.minimumWages?.[0]?.uuid ??
|
|
111
|
-
paymentUnit: u?.paymentUnit ??
|
|
112
|
-
effectiveDate: u?.effectiveDate ??
|
|
124
|
+
flsaStatus: V ? F : u?.flsaStatus ?? s?.flsaStatus ?? F ?? void 0,
|
|
125
|
+
rate: Number(u?.rate ?? s?.rate ?? 0),
|
|
126
|
+
adjustForMinimumWage: u?.adjustForMinimumWage ?? s?.adjustForMinimumWage ?? !1,
|
|
127
|
+
minimumWageId: u?.minimumWages?.[0]?.uuid ?? s?.minimumWageId ?? "",
|
|
128
|
+
paymentUnit: u?.paymentUnit ?? s?.paymentUnit ?? p.HOUR,
|
|
129
|
+
effectiveDate: u?.effectiveDate ?? s?.effectiveDate ?? null
|
|
113
130
|
}),
|
|
114
|
-
[u, a,
|
|
115
|
-
),
|
|
116
|
-
resolver:
|
|
117
|
-
mode:
|
|
118
|
-
shouldFocusError:
|
|
119
|
-
defaultValues:
|
|
120
|
-
values:
|
|
131
|
+
[u, a, s, F, V]
|
|
132
|
+
), S = Ie({
|
|
133
|
+
resolver: Re(x),
|
|
134
|
+
mode: W,
|
|
135
|
+
shouldFocusError: R,
|
|
136
|
+
defaultValues: P,
|
|
137
|
+
values: P,
|
|
121
138
|
resetOptions: { keepDirtyValues: !0 }
|
|
122
|
-
}), { control:
|
|
123
|
-
control:
|
|
139
|
+
}), { control: Z, getValues: g, setValue: m, clearErrors: A } = S, l = me({ control: Z, name: "flsaStatus" }), Me = me({
|
|
140
|
+
control: Z,
|
|
124
141
|
name: "adjustForMinimumWage"
|
|
125
142
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
!
|
|
143
|
+
H(() => {
|
|
144
|
+
A(["paymentUnit", "rate"]), l === i.OWNER ? m("paymentUnit", p.PAYCHECK) : l === i.COMMISSION_ONLY_NONEXEMPT || l === i.COMMISSION_ONLY_EXEMPT ? (m("paymentUnit", p.YEAR), m("rate", 0)) : m("paymentUnit", P.paymentUnit);
|
|
145
|
+
}, [l, m, A, P.paymentUnit]);
|
|
146
|
+
const Se = a ? a.compensations?.find((t) => t.uuid === a.currentCompensationUuid) : void 0, b = (u?.flsaStatus ?? Se?.flsaStatus ?? null) === i.NONEXEMPT && l !== void 0 && l !== i.NONEXEMPT && pe > 0, U = q(!1), X = q(null);
|
|
147
|
+
H(() => {
|
|
148
|
+
!d && b && !U.current ? (X.current = g("effectiveDate") ?? null, m("effectiveDate", de(), { shouldDirty: !0, shouldValidate: !1 }), U.current = !0) : !d && !b && U.current && (m("effectiveDate", X.current ?? null, {
|
|
132
149
|
shouldDirty: !0,
|
|
133
150
|
shouldValidate: !1
|
|
134
|
-
}),
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
baseSubmitHandler:
|
|
138
|
-
error:
|
|
139
|
-
setError:
|
|
140
|
-
} =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
const
|
|
151
|
+
}), X.current = null, U.current = !1);
|
|
152
|
+
}, [d, b, g, m]);
|
|
153
|
+
const ee = Le(), te = je(), ge = ee.isPending || te.isPending, {
|
|
154
|
+
baseSubmitHandler: be,
|
|
155
|
+
error: ye,
|
|
156
|
+
setError: Oe
|
|
157
|
+
} = et("CompensationForm"), ne = ze(e ? [T, w, j, L] : [], { submitError: ye, setSubmitError: Oe }), ie = l === i.COMMISSION_ONLY_NONEXEMPT || l === i.COMMISSION_ONLY_EXEMPT, De = l === i.OWNER, We = !V && (l !== i.NONEXEMPT || a?.primary === !0 || d), y = l === i.NONEXEMPT && C.length > 0 && z !== void 0 && !Ze.includes(z);
|
|
158
|
+
H(() => {
|
|
159
|
+
y || (g("adjustForMinimumWage") && m("adjustForMinimumWage", !1, { shouldDirty: !0, shouldValidate: !1 }), g("minimumWageId") && m("minimumWageId", "", { shouldDirty: !0, shouldValidate: !1 }), A(["adjustForMinimumWage", "minimumWageId"]));
|
|
160
|
+
}, [y, g, m, A]);
|
|
161
|
+
const Ce = C.map((t) => ({
|
|
145
162
|
value: t.uuid,
|
|
146
163
|
label: `${t.wage} - ${t.authority}: ${t.notes ?? ""}`
|
|
147
|
-
})),
|
|
148
|
-
|
|
164
|
+
})), v = $e(Ee, S.control), oe = I(
|
|
165
|
+
() => [h, N].filter((t) => !!t).reduce((t, O) => !t || O > t ? O : t, null),
|
|
166
|
+
[h, N]
|
|
167
|
+
), Fe = {
|
|
168
|
+
title: v.title,
|
|
149
169
|
effectiveDate: {
|
|
150
|
-
...
|
|
151
|
-
isDisabled:
|
|
170
|
+
...v.effectiveDate,
|
|
171
|
+
isDisabled: b && !d,
|
|
172
|
+
minDate: oe,
|
|
173
|
+
maxDate: $
|
|
152
174
|
},
|
|
153
|
-
flsaStatus:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
175
|
+
flsaStatus: B(
|
|
176
|
+
v.flsaStatus,
|
|
177
|
+
rt,
|
|
178
|
+
le
|
|
157
179
|
),
|
|
158
|
-
rate: { ...
|
|
159
|
-
paymentUnit:
|
|
160
|
-
{ ...
|
|
161
|
-
|
|
162
|
-
|
|
180
|
+
rate: { ...v.rate, isDisabled: ie },
|
|
181
|
+
paymentUnit: B(
|
|
182
|
+
{ ...v.paymentUnit, isDisabled: De || ie },
|
|
183
|
+
ut,
|
|
184
|
+
ce
|
|
163
185
|
),
|
|
164
186
|
adjustForMinimumWage: {
|
|
165
|
-
...
|
|
166
|
-
isDisabled: !
|
|
187
|
+
...v.adjustForMinimumWage,
|
|
188
|
+
isDisabled: !y
|
|
167
189
|
},
|
|
168
|
-
minimumWageId:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
190
|
+
minimumWageId: B(
|
|
191
|
+
v.minimumWageId,
|
|
192
|
+
Ce,
|
|
193
|
+
C
|
|
172
194
|
)
|
|
173
|
-
},
|
|
174
|
-
let
|
|
175
|
-
return await new Promise((
|
|
176
|
-
|
|
177
|
-
async (
|
|
178
|
-
await
|
|
179
|
-
const
|
|
180
|
-
rate: String(
|
|
181
|
-
paymentUnit:
|
|
182
|
-
flsaStatus:
|
|
183
|
-
effectiveDate:
|
|
184
|
-
title:
|
|
185
|
-
adjustForMinimumWage:
|
|
186
|
-
minimumWages:
|
|
195
|
+
}, Ne = async (t) => {
|
|
196
|
+
let O;
|
|
197
|
+
return await new Promise((se) => {
|
|
198
|
+
S.handleSubmit(
|
|
199
|
+
async (Ae) => {
|
|
200
|
+
await be(Ae, async (c) => {
|
|
201
|
+
const ae = t?.jobId ?? o, k = t?.compensationId ?? n, re = k ? "update" : "create", Ue = E ? t?.effectiveDate ?? c.effectiveDate ?? void 0 : t?.effectiveDate ?? void 0, ue = {
|
|
202
|
+
rate: String(c.rate),
|
|
203
|
+
paymentUnit: c.paymentUnit,
|
|
204
|
+
flsaStatus: c.flsaStatus,
|
|
205
|
+
effectiveDate: Ue,
|
|
206
|
+
title: c.title || void 0,
|
|
207
|
+
adjustForMinimumWage: c.adjustForMinimumWage,
|
|
208
|
+
minimumWages: c.adjustForMinimumWage ? [{ uuid: c.minimumWageId }] : []
|
|
187
209
|
};
|
|
188
|
-
let
|
|
189
|
-
if (
|
|
190
|
-
if (!
|
|
191
|
-
throw new
|
|
210
|
+
let D;
|
|
211
|
+
if (re === "create") {
|
|
212
|
+
if (!ae)
|
|
213
|
+
throw new M(
|
|
192
214
|
"jobId is required to create a compensation. Pass it as a hook prop or via submit options."
|
|
193
215
|
);
|
|
194
|
-
if (!
|
|
195
|
-
throw new
|
|
196
|
-
if (
|
|
216
|
+
if (!c.flsaStatus)
|
|
217
|
+
throw new M("flsaStatus is required to create a compensation.");
|
|
218
|
+
if (D = (await te.mutateAsync({
|
|
197
219
|
request: {
|
|
198
|
-
jobId:
|
|
199
|
-
compensationsRequestBody: { ...
|
|
220
|
+
jobId: ae,
|
|
221
|
+
compensationsRequestBody: { ...ue, flsaStatus: c.flsaStatus }
|
|
200
222
|
}
|
|
201
|
-
})).compensation, !
|
|
223
|
+
})).compensation, !D) throw new M("Compensation creation failed");
|
|
202
224
|
} else {
|
|
203
|
-
if (!
|
|
204
|
-
throw new
|
|
225
|
+
if (!k)
|
|
226
|
+
throw new M(
|
|
205
227
|
"compensationId is required to update a compensation. Pass it as a hook prop or via submit options."
|
|
206
228
|
);
|
|
207
|
-
const
|
|
208
|
-
if (!
|
|
209
|
-
throw new
|
|
229
|
+
const Y = t?.compensationVersion ?? u?.version;
|
|
230
|
+
if (!Y)
|
|
231
|
+
throw new M(
|
|
210
232
|
"compensation version is required to update a compensation. Pass it via submit options when threading post-create, or ensure the compensation is loaded."
|
|
211
233
|
);
|
|
212
|
-
if (
|
|
234
|
+
if (D = (await ee.mutateAsync({
|
|
213
235
|
request: {
|
|
214
|
-
compensationId:
|
|
236
|
+
compensationId: k,
|
|
215
237
|
compensationsUpdateRequestBody: {
|
|
216
|
-
version:
|
|
217
|
-
...
|
|
238
|
+
version: Y,
|
|
239
|
+
...ue
|
|
218
240
|
}
|
|
219
241
|
}
|
|
220
|
-
})).compensation, !
|
|
242
|
+
})).compensation, !D) throw new M("Compensation update failed");
|
|
221
243
|
}
|
|
222
|
-
|
|
223
|
-
}),
|
|
244
|
+
O = { mode: re, data: D };
|
|
245
|
+
}), se();
|
|
224
246
|
},
|
|
225
247
|
() => {
|
|
226
|
-
|
|
248
|
+
se();
|
|
227
249
|
}
|
|
228
250
|
)();
|
|
229
|
-
}),
|
|
230
|
-
},
|
|
231
|
-
return
|
|
251
|
+
}), O;
|
|
252
|
+
}, he = e ? T.isLoading || w.isLoading || j.isLoading || L.isLoading : !1, Pe = xe(S);
|
|
253
|
+
return he || e && (!f || !fe) ? { isLoading: !0, errorHandling: ne } : {
|
|
232
254
|
isLoading: !1,
|
|
233
255
|
data: {
|
|
234
256
|
compensation: u,
|
|
235
257
|
currentJob: a,
|
|
236
|
-
minimumWages:
|
|
237
|
-
minimumEffectiveDate:
|
|
238
|
-
maximumEffectiveDate:
|
|
239
|
-
hasPendingFutureCompensation:
|
|
258
|
+
minimumWages: C,
|
|
259
|
+
minimumEffectiveDate: oe,
|
|
260
|
+
maximumEffectiveDate: $,
|
|
261
|
+
hasPendingFutureCompensation: ve
|
|
240
262
|
},
|
|
241
263
|
status: {
|
|
242
|
-
isPending:
|
|
243
|
-
mode:
|
|
244
|
-
willDeleteSecondaryJobs:
|
|
264
|
+
isPending: ge,
|
|
265
|
+
mode: J,
|
|
266
|
+
willDeleteSecondaryJobs: b
|
|
245
267
|
},
|
|
246
|
-
actions: { onSubmit:
|
|
247
|
-
errorHandling:
|
|
268
|
+
actions: { onSubmit: Ne },
|
|
269
|
+
errorHandling: ne,
|
|
248
270
|
form: {
|
|
249
271
|
Fields: {
|
|
250
|
-
Title:
|
|
251
|
-
FlsaStatus:
|
|
252
|
-
Rate:
|
|
253
|
-
PaymentUnit:
|
|
254
|
-
AdjustForMinimumWage:
|
|
255
|
-
MinimumWageId:
|
|
256
|
-
EffectiveDate:
|
|
272
|
+
Title: Qe,
|
|
273
|
+
FlsaStatus: We ? Ge : void 0,
|
|
274
|
+
Rate: Be,
|
|
275
|
+
PaymentUnit: He,
|
|
276
|
+
AdjustForMinimumWage: y ? qe : void 0,
|
|
277
|
+
MinimumWageId: y && Me ? Ye : void 0,
|
|
278
|
+
EffectiveDate: E ? ke : void 0
|
|
257
279
|
},
|
|
258
280
|
fieldsMetadata: Fe,
|
|
259
|
-
hookFormInternals:
|
|
260
|
-
getFormSubmissionValues:
|
|
281
|
+
hookFormInternals: Pe,
|
|
282
|
+
getFormSubmissionValues: Ke(S, x)
|
|
261
283
|
}
|
|
262
284
|
};
|
|
263
285
|
}
|
|
264
286
|
export {
|
|
265
|
-
|
|
287
|
+
wt as useCompensationForm
|
|
266
288
|
};
|
|
267
289
|
//# sourceMappingURL=useCompensationForm.js.map
|