@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.
Files changed (284) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  6. package/dist/components/Common/DataView/DataTable/DataTable.js +85 -80
  7. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  8. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js +8 -0
  9. package/dist/components/Common/DataView/DataTable/DataTable.module.scss.js.map +1 -0
  10. package/dist/components/Common/DataView/DataView.d.ts +1 -0
  11. package/dist/components/Common/DataView/DataView.js.map +1 -1
  12. package/dist/components/Common/DataView/useDataView.d.ts +10 -1
  13. package/dist/components/Common/DataView/useDataView.js +20 -17
  14. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  15. package/dist/components/Common/DocumentViewer/DocumentViewer.js +10 -10
  16. package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
  17. package/dist/components/Common/DocumentViewer/DocumentViewer.module.scss.js +9 -9
  18. package/dist/components/Common/PaginationControl/PaginationControl.js +11 -10
  19. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  20. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -1
  21. package/dist/components/Common/UI/DescriptionList/DescriptionList.js +11 -10
  22. package/dist/components/Common/UI/DescriptionList/DescriptionList.js.map +1 -1
  23. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +4 -4
  24. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  25. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  26. package/dist/components/Common/UI/NumberInput/NumberInput.js +51 -48
  27. package/dist/components/Common/UI/NumberInput/NumberInput.js.map +1 -1
  28. package/dist/components/Common/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  29. package/dist/components/Common/VisuallyHidden/VisuallyHidden.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  35. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  37. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  38. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  39. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  40. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  41. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  42. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  43. package/dist/components/Company/Industry/Context.js +6 -7
  44. package/dist/components/Company/Industry/Context.js.map +1 -1
  45. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  46. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  47. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  48. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  49. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  50. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  51. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  52. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  54. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  56. package/dist/components/Contractor/Address/useAddress.js +5 -6
  57. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  58. package/dist/components/Contractor/Profile/useContractorProfile.js +33 -34
  59. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  60. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
  61. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
  62. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
  63. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
  64. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
  65. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +60 -202
  66. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -1
  67. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
  68. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +79 -0
  69. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
  70. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
  71. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
  72. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
  73. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
  74. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
  75. package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
  76. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
  77. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
  78. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  79. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js +36 -36
  80. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
  81. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
  82. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
  83. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
  84. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
  85. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
  86. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  87. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
  88. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  89. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  90. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +213 -191
  91. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  92. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  93. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +6 -5
  94. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +162 -131
  95. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  96. package/dist/components/Employee/Dashboard/BasicDetailsView.js +74 -88
  97. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  98. package/dist/components/Employee/Dashboard/Dashboard.js +86 -72
  99. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  100. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -3
  101. package/dist/components/Employee/Dashboard/DashboardComponents.js +138 -101
  102. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  103. package/dist/components/Employee/Dashboard/DocumentsView.js +17 -10
  104. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
  105. package/dist/components/Employee/Dashboard/JobAndPayView.js +359 -313
  106. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  107. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +5 -3
  108. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -1
  109. package/dist/components/Employee/Dashboard/TaxesView.js +114 -101
  110. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  111. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +147 -148
  112. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  113. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
  114. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +37 -36
  115. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
  116. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +2 -2
  117. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +34 -35
  118. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  119. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +57 -57
  120. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -1
  121. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +14 -5
  122. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +55 -36
  123. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
  124. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  125. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +18 -18
  126. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
  127. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  128. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +3 -3
  129. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
  130. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  131. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  132. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  133. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
  134. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  135. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
  136. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
  137. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  138. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
  139. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
  140. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
  141. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
  142. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
  143. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
  144. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
  145. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
  146. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
  147. package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
  148. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  149. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
  150. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  151. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
  152. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +170 -157
  153. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  154. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +56 -55
  155. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
  156. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +20 -20
  157. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -1
  158. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  159. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +1 -1
  160. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  161. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -1
  162. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  163. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  164. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.d.ts +0 -1
  165. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js +11 -12
  166. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.js.map +1 -1
  167. package/dist/components/Employee/Profile/shared/useHomeAddressForm/homeAddressSchema.test.d.ts +1 -0
  168. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +6 -1
  169. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +95 -94
  170. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
  171. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  172. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +6 -1
  173. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +87 -86
  174. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  175. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +18 -18
  176. package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
  177. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  178. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  179. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  180. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
  181. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  182. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
  183. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +96 -89
  184. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  185. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +61 -60
  186. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
  187. package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
  188. package/dist/components/Employee/exports/employeeManagement.js +18 -16
  189. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  190. package/dist/components/Employee/index.d.ts +2 -0
  191. package/dist/components/Employee/index.js +32 -30
  192. package/dist/components/Employee/index.js.map +1 -1
  193. package/dist/components/Flow/FlowHeader.js +34 -31
  194. package/dist/components/Flow/FlowHeader.js.map +1 -1
  195. package/dist/components/Flow/useFlow.d.ts +12 -0
  196. package/dist/components/Flow/useFlow.js.map +1 -1
  197. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +2 -3
  198. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  199. package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
  200. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  201. package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
  202. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  203. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
  204. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  205. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
  206. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  207. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
  208. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  209. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
  210. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  211. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  212. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
  213. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  214. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  215. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -125
  216. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  217. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  218. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +60 -91
  219. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  220. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +4 -4
  221. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +0 -16
  222. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +139 -225
  223. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  224. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
  225. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +78 -54
  226. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  227. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
  228. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
  229. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  230. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
  231. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  232. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +34 -34
  233. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
  234. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
  235. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
  236. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  237. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
  238. package/dist/helpers/breadcrumbHelpers.d.ts +1 -1
  239. package/dist/helpers/breadcrumbHelpers.js.map +1 -1
  240. package/dist/helpers/federalEin.d.ts +1 -0
  241. package/dist/helpers/federalEin.js.map +1 -1
  242. package/dist/helpers/mask.d.ts +8 -4
  243. package/dist/helpers/mask.js.map +1 -1
  244. package/dist/helpers/rem.d.ts +2 -1
  245. package/dist/helpers/rem.js.map +1 -1
  246. package/dist/hooks/useAsyncError.d.ts +1 -0
  247. package/dist/hooks/useAsyncError.js.map +1 -1
  248. package/dist/hooks/useForkRef/useForkRef.d.ts +1 -0
  249. package/dist/hooks/useForkRef/useForkRef.js.map +1 -1
  250. package/dist/i18n/I18n.d.ts +9 -1
  251. package/dist/i18n/I18n.js.map +1 -1
  252. package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +14 -14
  253. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +16 -22
  254. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
  255. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
  256. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
  257. package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
  258. package/dist/i18n/en/Employee.Compensation.json.js +66 -58
  259. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  260. package/dist/i18n/en/Employee.Dashboard.json.js +28 -24
  261. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  262. package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
  263. package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
  264. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
  265. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
  266. package/dist/i18n/en/Employee.PaymentMethod.json.js +25 -25
  267. package/dist/i18n/en/Employee.StateTaxes.json.js +12 -10
  268. package/dist/i18n/en/Employee.StateTaxes.json.js.map +1 -1
  269. package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
  270. package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
  271. package/dist/i18n/en/common.json.d.ts +14 -0
  272. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
  273. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
  274. package/dist/partner-hook-utils/types.d.ts +4 -0
  275. package/dist/shared/constants.d.ts +2 -0
  276. package/dist/shared/constants.js +13 -12
  277. package/dist/shared/constants.js.map +1 -1
  278. package/dist/style.css +1 -1
  279. package/dist/types/hooks.d.ts +1 -1
  280. package/dist/types/i18next.d.ts +30 -29
  281. package/dist/types/observability.d.ts +1 -1
  282. package/docs/reference/endpoint-inventory.json +24 -8
  283. package/package.json +30 -27
  284. 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":";;;;;;AA6BO,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;"}
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;"}
@@ -1,267 +1,289 @@
1
- import { useRef as X, useMemo as se, useEffect as V } from "react";
2
- import { useForm as De, useWatch as oe } 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
- import { useEmployeesGet as we } from "@gusto/embedded-api/react-query/employeesGet";
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 { FlsaStatus as n, PAY_PERIODS as l, TIP_CREDITS_UNSUPPORTED_STATES as Qe } from "../../../../../shared/constants.js";
18
- import { useBaseSubmit as $e } from "../../../../Base/useBaseSubmit.js";
19
- import { SDKInternalError as S } from "../../../../../types/sdkError.js";
20
- function xe(e, s, o) {
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 (s) {
23
- for (const i of e) {
24
- const r = i.compensations?.find((C) => C.uuid === s);
25
- if (r) return { compensation: r, job: i };
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 o ? { compensation: null, job: e.find((i) => i.uuid === o) ?? null } : { compensation: null, job: null };
31
+ return n ? { compensation: null, job: e.find((r) => r.uuid === n) ?? null } : { compensation: null, job: null };
30
32
  }
31
- function ze(e) {
33
+ function ot(e) {
32
34
  if (!e) return null;
33
- for (const s of e) {
34
- if (!s.primary) continue;
35
- const o = s.compensations?.find((i) => i.uuid === s.currentCompensationUuid);
36
- if (o?.flsaStatus) return o.flsaStatus;
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 Ze(e) {
42
+ function st(e) {
41
43
  if (!e?.compensations) return [];
42
- const s = re();
43
- return e.compensations.filter((o) => o.effectiveDate !== void 0 && o.effectiveDate > s);
44
+ const o = de();
45
+ return e.compensations.filter((n) => n.effectiveDate !== void 0 && n.effectiveDate > o);
44
46
  }
45
- function et(e) {
46
- return e.length === 0 ? null : e.reduce((s, o) => {
47
- const i = o.effectiveDate;
48
- return i && (!s || i < s) ? i : s;
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 ie = [
52
- n.EXEMPT,
53
- n.SALARIED_NONEXEMPT,
54
- n.NONEXEMPT,
55
- n.OWNER,
56
- n.COMMISSION_ONLY_EXEMPT,
57
- n.COMMISSION_ONLY_NONEXEMPT
58
- ], tt = ie.map((e) => ({ value: e, label: e })), ae = [
59
- l.HOUR,
60
- l.WEEK,
61
- l.MONTH,
62
- l.YEAR,
63
- l.PAYCHECK
64
- ], nt = ae.map((e) => ({ value: e, label: e }));
65
- function re() {
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 Ct({
70
+ function wt({
69
71
  employeeId: e,
70
- jobId: s,
71
- compensationId: o,
72
- optionalFieldsToRequire: i,
73
- defaultValues: r,
74
- validationMode: C = "onSubmit",
75
- shouldFocusError: ue = !0,
76
- withEffectiveDateField: y = !0
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 P = Ie(
79
- { employeeId: e ?? "" },
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
- ), D = je(
89
+ ), w = Je(
82
90
  { employeeId: e ?? "" },
83
91
  { enabled: !!e }
84
- ), A = we({ employeeId: e ?? "" }, { enabled: !!e }), f = P.data?.jobs, Y = D.data?.employeeWorkAddressesList?.find((t) => t.active), k = Y?.locationUuid, me = A.data?.employee, I = Te(
85
- { locationUuid: k ?? "" },
86
- { enabled: !!k }
87
- ), F = I.data?.minimumWageList ?? [], { compensation: u, job: a } = xe(
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
- o,
90
- s
91
- ), ce = f && a ? f.filter((t) => t.uuid !== a.uuid).length : 0, U = X(null);
92
- U.current === null && f !== void 0 && (U.current = f.some((t) => t.primary));
93
- const W = U.current === !0 ? ze(f) : null, R = a?.hireDate ?? null, q = Ze(a), de = q.length > 0, le = et(q), p = !o, T = p ? "create" : "update", j = p && W === n.NONEXEMPT && a?.primary !== !0, [H, fe] = se(
94
- () => Le({
95
- mode: T,
96
- optionalFieldsToRequire: i,
97
- hireDate: R,
98
- withEffectiveDateField: y
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
- [T, i, R, y]
101
- ), B = Y?.state, N = se(
117
+ [J, r, N, h, E]
118
+ ), z = G?.state, P = I(
102
119
  () => ({
103
- title: u?.title ?? a?.title ?? r?.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: j ? W : u?.flsaStatus ?? r?.flsaStatus ?? W ?? void 0,
108
- rate: Number(u?.rate ?? r?.rate ?? 0),
109
- adjustForMinimumWage: u?.adjustForMinimumWage ?? r?.adjustForMinimumWage ?? !1,
110
- minimumWageId: u?.minimumWages?.[0]?.uuid ?? r?.minimumWageId ?? "",
111
- paymentUnit: u?.paymentUnit ?? r?.paymentUnit ?? l.HOUR,
112
- effectiveDate: u?.effectiveDate ?? r?.effectiveDate ?? null
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, r, W, j]
115
- ), M = De({
116
- resolver: Ae(H),
117
- mode: C,
118
- shouldFocusError: ue,
119
- defaultValues: N,
120
- values: N,
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: G, getValues: v, setValue: m } = M, c = oe({ control: G, name: "flsaStatus" }), pe = oe({
123
- control: G,
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
- V(() => {
127
- c === n.OWNER ? m("paymentUnit", l.PAYCHECK) : c === n.COMMISSION_ONLY_NONEXEMPT || c === n.COMMISSION_ONLY_EXEMPT ? (m("paymentUnit", l.YEAR), m("rate", 0)) : m("paymentUnit", N.paymentUnit);
128
- }, [c, m, N.paymentUnit]);
129
- const Ee = a ? a.compensations?.find((t) => t.uuid === a.currentCompensationUuid) : void 0, g = (u?.flsaStatus ?? Ee?.flsaStatus ?? null) === n.NONEXEMPT && c !== void 0 && c !== n.NONEXEMPT && ce > 0, h = X(!1), w = X(null);
130
- V(() => {
131
- !p && g && !h.current ? (w.current = v("effectiveDate") ?? null, m("effectiveDate", re(), { shouldDirty: !0, shouldValidate: !1 }), h.current = !0) : !p && !g && h.current && (m("effectiveDate", w.current ?? null, {
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
- }), w.current = null, h.current = !1);
135
- }, [p, g, v, m]);
136
- const K = Re(), Q = Ue(), Se = K.isPending || Q.isPending, {
137
- baseSubmitHandler: Me,
138
- error: ve,
139
- setError: ge
140
- } = $e("CompensationForm"), $ = Ke(e ? [P, D, A, I] : [], { submitError: ve, setSubmitError: ge }), x = c === n.COMMISSION_ONLY_NONEXEMPT || c === n.COMMISSION_ONLY_EXEMPT, be = c === n.OWNER, Oe = !j && (c !== n.NONEXEMPT || a?.primary === !0 || p), b = c === n.NONEXEMPT && F.length > 0 && B !== void 0 && !Qe.includes(B);
141
- V(() => {
142
- b || (v("adjustForMinimumWage") && m("adjustForMinimumWage", !1, { shouldDirty: !0, shouldValidate: !1 }), v("minimumWageId") && m("minimumWageId", "", { shouldDirty: !0, shouldValidate: !1 }));
143
- }, [b, v, m]);
144
- const ye = F.map((t) => ({
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
- })), E = Be(fe, M.control), Fe = {
148
- title: E.title,
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
- ...E.effectiveDate,
151
- isDisabled: g && !p
170
+ ...v.effectiveDate,
171
+ isDisabled: b && !d,
172
+ minDate: oe,
173
+ maxDate: $
152
174
  },
153
- flsaStatus: J(
154
- E.flsaStatus,
155
- tt,
156
- ie
175
+ flsaStatus: B(
176
+ v.flsaStatus,
177
+ rt,
178
+ le
157
179
  ),
158
- rate: { ...E.rate, isDisabled: x },
159
- paymentUnit: J(
160
- { ...E.paymentUnit, isDisabled: be || x },
161
- nt,
162
- ae
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
- ...E.adjustForMinimumWage,
166
- isDisabled: !b
187
+ ...v.adjustForMinimumWage,
188
+ isDisabled: !y
167
189
  },
168
- minimumWageId: J(
169
- E.minimumWageId,
170
- ye,
171
- F
190
+ minimumWageId: B(
191
+ v.minimumWageId,
192
+ Ce,
193
+ C
172
194
  )
173
- }, We = async (t) => {
174
- let z;
175
- return await new Promise((Z) => {
176
- M.handleSubmit(
177
- async (Ce) => {
178
- await Me(Ce, async (d) => {
179
- const ee = t?.jobId ?? s, L = t?.compensationId ?? o, te = L ? "update" : "create", Pe = y ? t?.effectiveDate ?? d.effectiveDate ?? void 0 : t?.effectiveDate ?? void 0, ne = {
180
- rate: String(d.rate),
181
- paymentUnit: d.paymentUnit,
182
- flsaStatus: d.flsaStatus,
183
- effectiveDate: Pe,
184
- title: d.title || void 0,
185
- adjustForMinimumWage: d.adjustForMinimumWage,
186
- minimumWages: d.adjustForMinimumWage ? [{ uuid: d.minimumWageId }] : []
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 O;
189
- if (te === "create") {
190
- if (!ee)
191
- throw new S(
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 (!d.flsaStatus)
195
- throw new S("flsaStatus is required to create a compensation.");
196
- if (O = (await Q.mutateAsync({
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: ee,
199
- compensationsRequestBody: { ...ne, flsaStatus: d.flsaStatus }
220
+ jobId: ae,
221
+ compensationsRequestBody: { ...ue, flsaStatus: c.flsaStatus }
200
222
  }
201
- })).compensation, !O) throw new S("Compensation creation failed");
223
+ })).compensation, !D) throw new M("Compensation creation failed");
202
224
  } else {
203
- if (!L)
204
- throw new S(
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 _ = t?.compensationVersion ?? u?.version;
208
- if (!_)
209
- throw new S(
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 (O = (await K.mutateAsync({
234
+ if (D = (await ee.mutateAsync({
213
235
  request: {
214
- compensationId: L,
236
+ compensationId: k,
215
237
  compensationsUpdateRequestBody: {
216
- version: _,
217
- ...ne
238
+ version: Y,
239
+ ...ue
218
240
  }
219
241
  }
220
- })).compensation, !O) throw new S("Compensation update failed");
242
+ })).compensation, !D) throw new M("Compensation update failed");
221
243
  }
222
- z = { mode: te, data: O };
223
- }), Z();
244
+ O = { mode: re, data: D };
245
+ }), se();
224
246
  },
225
247
  () => {
226
- Z();
248
+ se();
227
249
  }
228
250
  )();
229
- }), z;
230
- }, Ne = e ? P.isLoading || D.isLoading || A.isLoading || I.isLoading : !1, he = Ge(M);
231
- return Ne || e && (!f || !me) ? { isLoading: !0, errorHandling: $ } : {
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: F,
237
- minimumEffectiveDate: R,
238
- maximumEffectiveDate: le,
239
- hasPendingFutureCompensation: de
258
+ minimumWages: C,
259
+ minimumEffectiveDate: oe,
260
+ maximumEffectiveDate: $,
261
+ hasPendingFutureCompensation: ve
240
262
  },
241
263
  status: {
242
- isPending: Se,
243
- mode: T,
244
- willDeleteSecondaryJobs: g
264
+ isPending: ge,
265
+ mode: J,
266
+ willDeleteSecondaryJobs: b
245
267
  },
246
- actions: { onSubmit: We },
247
- errorHandling: $,
268
+ actions: { onSubmit: Ne },
269
+ errorHandling: ne,
248
270
  form: {
249
271
  Fields: {
250
- Title: qe,
251
- FlsaStatus: Oe ? ke : void 0,
252
- Rate: Ye,
253
- PaymentUnit: Je,
254
- AdjustForMinimumWage: b ? Ve : void 0,
255
- MinimumWageId: b && pe ? Xe : void 0,
256
- EffectiveDate: y ? _e : void 0
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: he,
260
- getFormSubmissionValues: He(M, H)
281
+ hookFormInternals: Pe,
282
+ getFormSubmissionValues: Ke(S, x)
261
283
  }
262
284
  };
263
285
  }
264
286
  export {
265
- Ct as useCompensationForm
287
+ wt as useCompensationForm
266
288
  };
267
289
  //# sourceMappingURL=useCompensationForm.js.map