@gusto/embedded-react-sdk 0.45.0 → 0.46.2

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 (233) hide show
  1. package/CHANGELOG.md +64 -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 +51 -50
  7. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  8. package/dist/components/Common/DataView/DataView.d.ts +1 -0
  9. package/dist/components/Common/DataView/DataView.js.map +1 -1
  10. package/dist/components/Common/DataView/useDataView.d.ts +8 -1
  11. package/dist/components/Common/DataView/useDataView.js +20 -17
  12. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  15. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  17. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
  18. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  19. package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
  20. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  21. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
  22. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  23. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  24. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
  25. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  26. package/dist/components/Company/Industry/Context.js +23 -7
  27. package/dist/components/Company/Industry/Context.js.map +1 -1
  28. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
  29. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  30. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
  31. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  32. package/dist/components/Company/OnboardingOverview/context.js +20 -4
  33. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  34. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  35. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
  36. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  37. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
  38. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  39. package/dist/components/Contractor/Address/useAddress.js +22 -6
  40. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  41. package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
  42. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  43. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
  44. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
  45. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
  46. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
  47. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
  48. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
  49. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +85 -0
  50. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
  51. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
  52. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
  53. package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
  54. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
  55. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
  56. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
  57. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
  58. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
  59. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
  60. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
  61. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
  62. package/dist/components/Employee/Compensation/management/index.d.ts +6 -0
  63. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
  64. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
  65. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  66. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
  67. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
  68. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
  69. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
  70. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
  71. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  72. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
  73. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  74. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  75. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +212 -187
  76. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  77. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  78. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
  79. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
  80. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
  81. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
  82. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
  83. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  84. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
  85. package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
  86. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  87. package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
  88. package/dist/components/Employee/Dashboard/Dashboard.js +86 -68
  89. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  90. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +8 -4
  91. package/dist/components/Employee/Dashboard/DashboardComponents.js +147 -93
  92. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  93. package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
  94. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
  95. package/dist/components/Employee/Dashboard/JobAndPayView.js +304 -264
  96. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  97. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +10 -0
  98. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
  99. package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
  100. package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
  101. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  102. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +152 -142
  103. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  104. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
  105. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
  106. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
  107. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
  108. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
  109. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
  110. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
  111. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +53 -55
  112. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  113. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
  114. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
  115. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
  116. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
  117. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
  118. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
  119. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  120. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  121. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
  122. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  123. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  124. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
  125. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  126. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
  127. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
  128. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  129. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
  130. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
  131. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
  132. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
  133. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
  134. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
  135. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
  136. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
  137. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
  138. package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
  139. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  140. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
  141. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  142. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
  143. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
  144. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  145. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  146. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  147. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  148. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  149. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  150. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  151. package/dist/components/Employee/Taxes/useTaxes.js +20 -4
  152. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  153. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
  154. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  155. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
  156. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
  157. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  158. package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
  159. package/dist/components/Employee/exports/employeeManagement.js +18 -16
  160. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  161. package/dist/components/Employee/index.d.ts +2 -0
  162. package/dist/components/Employee/index.js +32 -30
  163. package/dist/components/Employee/index.js.map +1 -1
  164. package/dist/components/Flow/FlowHeader.js +34 -31
  165. package/dist/components/Flow/FlowHeader.js.map +1 -1
  166. package/dist/components/Flow/useFlow.d.ts +12 -0
  167. package/dist/components/Flow/useFlow.js.map +1 -1
  168. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
  169. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  170. package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
  171. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  172. package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
  173. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  174. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
  175. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  176. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
  177. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
  178. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
  179. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  180. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
  181. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  182. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
  183. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  184. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  185. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
  186. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  187. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  188. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
  189. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  190. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  191. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
  192. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  193. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
  194. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
  195. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  196. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
  197. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
  198. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  199. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
  200. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
  201. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  202. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
  203. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  204. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
  205. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
  206. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  207. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
  208. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
  209. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
  210. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
  211. package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
  212. package/dist/i18n/en/Employee.Compensation.json.js +68 -56
  213. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  214. package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
  215. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  216. package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
  217. package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
  218. package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
  219. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
  220. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
  221. package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
  222. package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
  223. package/dist/i18n/en/common.json.d.ts +21 -0
  224. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
  225. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
  226. package/dist/partner-hook-utils/types.d.ts +4 -0
  227. package/dist/shared/constants.d.ts +4 -0
  228. package/dist/shared/constants.js +20 -18
  229. package/dist/shared/constants.js.map +1 -1
  230. package/dist/style.css +1 -1
  231. package/dist/types/i18next.d.ts +45 -11
  232. package/docs/reference/endpoint-inventory.json +24 -8
  233. package/package.json +1 -1
@@ -1,56 +1,48 @@
1
- import { jsx as t, jsxs as R } from "react/jsx-runtime";
2
- import { useState as I } from "react";
3
- import T from "classnames";
4
- import { useTranslation as U, Trans as g } from "react-i18next";
5
- import { useJobForm as D } from "../../shared/useJobForm/useJobForm.js";
6
- import { useCompensationForm as H } from "../../shared/useCompensationForm/useCompensationForm.js";
7
- import O from "./EditCompensation.module.scss.js";
8
- import { BaseBoundaries as w, BaseLayout as v } from "../../../../Base/Base.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useState as R } from "react";
3
+ import U from "classnames";
4
+ import { useJobForm as I } from "../../shared/useJobForm/useJobForm.js";
5
+ import { useCompensationForm as O } from "../../shared/useCompensationForm/useCompensationForm.js";
6
+ import { AddCompensationFormBody as j } from "../../shared/AddCompensationFormBody.js";
7
+ import B from "./EditCompensation.module.scss.js";
8
+ import { BaseBoundaries as N, BaseLayout as l } from "../../../../Base/Base.js";
9
9
  import "../../../../Base/useBase.js";
10
- import { Flex as F } from "../../../../Common/Flex/Flex.js";
11
- import { componentEvents as E, FLSA_OVERTIME_SALARY_LIMIT as h } from "../../../../../shared/constants.js";
12
- import { ActionsLayout as A } from "../../../../Common/ActionsLayout/ActionsLayout.js";
13
- import { Form as P } from "../../../../Common/Form/Form.js";
14
- import { useComponentContext as _ } from "../../../../../contexts/ComponentAdapter/useComponentContext.js";
15
- import { useComponentDictionary as N, useI18n as j } from "../../../../../i18n/I18n.js";
16
- import { composeErrorHandler as L } from "../../../../../partner-hook-utils/composeErrorHandler.js";
17
- import { composeSubmitHandler as x } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
18
- import B from "../../../../../hooks/useNumberFormatter.js";
19
- function me({ dictionary: i, ...s }) {
20
- return N("Employee.Compensation", i), /* @__PURE__ */ t(w, { componentName: "Employee.Compensation", children: /* @__PURE__ */ t(J, { ...s }) });
10
+ import { Form as T } from "../../../../Common/Form/Form.js";
11
+ import { useComponentDictionary as _, useI18n as A } from "../../../../../i18n/I18n.js";
12
+ import { composeErrorHandler as f } from "../../../../../partner-hook-utils/composeErrorHandler.js";
13
+ import { composeSubmitHandler as H } from "../../../../../partner-hook-utils/form/composeSubmitHandler.js";
14
+ import { componentEvents as a } from "../../../../../shared/constants.js";
15
+ function $({ dictionary: r, ...s }) {
16
+ return _("Employee.Compensation", r), /* @__PURE__ */ n(N, { componentName: "Employee.Compensation", children: /* @__PURE__ */ n(J, { ...s }) });
21
17
  }
22
18
  function J({
23
- employeeId: i,
19
+ employeeId: r,
24
20
  startDate: s,
25
- currentJobId: c,
26
- title: f,
27
- submitCtaLabel: u,
28
- onCancel: p,
29
- partnerDefaultValues: e,
30
- className: l,
31
- onEvent: m
21
+ currentJobId: m,
22
+ title: E,
23
+ submitCtaLabel: b,
24
+ onCancel: C,
25
+ partnerDefaultValues: i,
26
+ className: v,
27
+ onEvent: d
32
28
  }) {
33
- j("Employee.Compensation");
34
- const [a, n] = I(c ?? void 0), o = D({
35
- employeeId: i,
36
- jobId: a,
37
- // The Compensation flow does not surface a hire-date field — the date is
38
- // derived from the employee's `startDate` (passed via submit options
39
- // below). Hiding via the hook flag also drops the field from the schema
40
- // so partner forms don't silently fail validation on create.
41
- withHireDateField: !1,
29
+ A("Employee.Compensation");
30
+ const F = !s, [u, g] = R(m ?? void 0), t = I({
31
+ employeeId: r,
32
+ jobId: u,
33
+ withHireDateField: F,
42
34
  defaultValues: {
43
- title: e?.title ?? ""
35
+ title: i?.title ?? ""
44
36
  },
45
37
  // The Compensation flow always shows a job title field, even when editing
46
38
  // an existing job. The hook's schema only requires `title` on create; we
47
39
  // require it on update too to preserve the existing UX.
48
40
  optionalFieldsToRequire: { update: ["title"] },
49
41
  shouldFocusError: !1
50
- }), y = o.isLoading ? void 0 : o.data.currentJob?.currentCompensationUuid ?? void 0, d = H({
51
- employeeId: i,
52
- jobId: a,
53
- compensationId: y,
42
+ }), h = t.isLoading ? void 0 : t.data.currentJob?.currentCompensationUuid ?? void 0, e = O({
43
+ employeeId: r,
44
+ jobId: u,
45
+ compensationId: h,
54
46
  // No effective-date field is surfaced, and no `effectiveDate` is
55
47
  // threaded into `actions.onSubmit` either: the server initializes
56
48
  // `effective_date` on the auto-stub created by the parent job POST,
@@ -64,186 +56,52 @@ function J({
64
56
  // here to preserve the existing UX (no "(optional)" labels).
65
57
  optionalFieldsToRequire: { update: ["flsaStatus", "rate", "paymentUnit"] },
66
58
  defaultValues: {
67
- flsaStatus: e?.flsaStatus,
68
- rate: typeof e?.rate == "number" ? e.rate : e?.rate ? Number(e.rate) : void 0,
69
- paymentUnit: e?.paymentUnit
59
+ flsaStatus: i?.flsaStatus,
60
+ rate: typeof i?.rate == "number" ? i.rate : i?.rate ? Number(i.rate) : void 0,
61
+ paymentUnit: i?.paymentUnit
70
62
  },
71
63
  shouldFocusError: !1
72
64
  });
73
- if (o.isLoading || d.isLoading) {
74
- const r = L([o, d]);
75
- return /* @__PURE__ */ t(v, { isLoading: !0, error: r.errors });
65
+ if (t.isLoading || e.isLoading) {
66
+ const o = f([t, e]);
67
+ return /* @__PURE__ */ n(l, { isLoading: !0, error: o.errors });
76
68
  }
77
- const b = x([o, d], async () => {
78
- const r = await o.actions.onSubmit({ employeeId: i, hireDate: s });
79
- if (!r) return;
80
- m(
81
- r.mode === "create" ? E.EMPLOYEE_JOB_CREATED : E.EMPLOYEE_JOB_UPDATED,
82
- r.data
69
+ const c = H([t, e], async () => {
70
+ const o = await t.actions.onSubmit({
71
+ employeeId: r,
72
+ hireDate: s ?? void 0
73
+ });
74
+ if (!o) return;
75
+ d(
76
+ o.mode === "create" ? a.EMPLOYEE_JOB_CREATED : a.EMPLOYEE_JOB_UPDATED,
77
+ o.data
83
78
  );
84
- const M = r.data.compensations?.find(
85
- (W) => W.uuid === r.data.currentCompensationUuid
86
- ), C = await d.actions.onSubmit({
87
- jobId: r.data.uuid,
88
- compensationId: r.data.currentCompensationUuid ?? void 0,
89
- compensationVersion: M?.version ?? void 0
79
+ const P = o.data.compensations?.find(
80
+ (L) => L.uuid === o.data.currentCompensationUuid
81
+ ), p = await e.actions.onSubmit({
82
+ jobId: o.data.uuid,
83
+ compensationId: o.data.currentCompensationUuid ?? void 0,
84
+ compensationVersion: P?.version ?? void 0
90
85
  });
91
- if (!C) {
92
- c || n(r.data.uuid);
86
+ if (!p) {
87
+ m || g(o.data.uuid);
93
88
  return;
94
89
  }
95
- m(E.EMPLOYEE_COMPENSATION_UPDATED, C.data);
96
- }), S = L([b]), k = o.status.isPending || d.status.isPending;
97
- return /* @__PURE__ */ t("section", { className: T(O.container, l), children: /* @__PURE__ */ t(v, { error: S.errors, children: /* @__PURE__ */ t(P, { onSubmit: b.handleSubmit, children: /* @__PURE__ */ t(
98
- Q,
90
+ d(a.EMPLOYEE_COMPENSATION_UPDATED, p.data);
91
+ }), y = f([c]), S = t.status.isPending || e.status.isPending;
92
+ return /* @__PURE__ */ n("section", { className: U(B.container, v), children: /* @__PURE__ */ n(l, { error: y.errors, children: /* @__PURE__ */ n(T, { onSubmit: c.handleSubmit, children: /* @__PURE__ */ n(
93
+ j,
99
94
  {
100
- jobForm: o,
101
- compensationForm: d,
102
- title: f,
103
- submitCtaLabel: u,
104
- isPending: k,
105
- onCancel: p
95
+ jobForm: t,
96
+ compensationForm: e,
97
+ title: E,
98
+ submitCtaLabel: b,
99
+ isPending: S,
100
+ onCancel: C
106
101
  }
107
102
  ) }) }) });
108
103
  }
109
- function Q({
110
- jobForm: i,
111
- compensationForm: s,
112
- title: c,
113
- submitCtaLabel: f,
114
- isPending: u,
115
- onCancel: p
116
- }) {
117
- const { t: e } = U("Employee.Compensation"), l = _(), m = B("currency"), a = i.form.Fields, n = s.form.Fields;
118
- return /* @__PURE__ */ R(F, { flexDirection: "column", gap: 32, children: [
119
- /* @__PURE__ */ t(l.Heading, { as: "h2", children: c }),
120
- s.status.willDeleteSecondaryJobs && /* @__PURE__ */ t(
121
- l.Alert,
122
- {
123
- label: e("validations.classificationChangeNotification"),
124
- status: "warning"
125
- }
126
- ),
127
- /* @__PURE__ */ t(
128
- a.Title,
129
- {
130
- label: e("jobTitle"),
131
- validationMessages: { REQUIRED: e("validations.title") },
132
- formHookResult: i
133
- }
134
- ),
135
- n.FlsaStatus && /* @__PURE__ */ t(
136
- n.FlsaStatus,
137
- {
138
- label: e("employeeClassification"),
139
- description: /* @__PURE__ */ t(
140
- g,
141
- {
142
- t: e,
143
- i18nKey: "classificationLink",
144
- components: { ClassificationLink: /* @__PURE__ */ t(l.Link, {}) }
145
- }
146
- ),
147
- validationMessages: {
148
- REQUIRED: e("validations.exemptThreshold", {
149
- limit: m(h)
150
- })
151
- },
152
- getOptionLabel: (o) => e(`flsaStatusLabels.${o}`),
153
- formHookResult: s
154
- }
155
- ),
156
- /* @__PURE__ */ t(
157
- n.Rate,
158
- {
159
- label: e("amount"),
160
- validationMessages: {
161
- REQUIRED: e("validations.rate"),
162
- RATE_MINIMUM: e("validations.nonZeroRate"),
163
- RATE_EXEMPT_THRESHOLD: e("validations.rateExemptThreshold", {
164
- limit: m(h)
165
- })
166
- },
167
- formHookResult: s
168
- }
169
- ),
170
- /* @__PURE__ */ t(
171
- n.PaymentUnit,
172
- {
173
- label: e("paymentUnitLabel"),
174
- description: e("paymentUnitDescription"),
175
- validationMessages: { REQUIRED: e("validations.paymentUnit") },
176
- getOptionLabel: (o) => e(`paymentUnitOptions.${o}`),
177
- formHookResult: s
178
- }
179
- ),
180
- n.AdjustForMinimumWage && /* @__PURE__ */ t(
181
- n.AdjustForMinimumWage,
182
- {
183
- label: e("adjustForMinimumWage"),
184
- description: e("adjustForMinimumWageDescription"),
185
- formHookResult: s
186
- }
187
- ),
188
- n.MinimumWageId && /* @__PURE__ */ t(
189
- n.MinimumWageId,
190
- {
191
- label: e("minimumWageLabel"),
192
- description: e("minimumWageDescription"),
193
- validationMessages: { REQUIRED: e("validations.minimumWage") },
194
- getOptionLabel: (o) => `${m(Number(o.wage))} - ${o.authority}: ${o.notes ?? ""}`,
195
- formHookResult: s
196
- }
197
- ),
198
- a.TwoPercentShareholder && /* @__PURE__ */ t(
199
- a.TwoPercentShareholder,
200
- {
201
- label: e("twoPercentStakeholderLabel"),
202
- formHookResult: i
203
- }
204
- ),
205
- a.StateWcCovered && /* @__PURE__ */ t(
206
- a.StateWcCovered,
207
- {
208
- label: e("stateWcCoveredLabel"),
209
- description: /* @__PURE__ */ t(
210
- g,
211
- {
212
- t: e,
213
- i18nKey: "stateWcCoveredDescription",
214
- components: {
215
- wcLink: /* @__PURE__ */ t(
216
- l.Link,
217
- {
218
- href: "https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/",
219
- target: "_blank",
220
- rel: "noopener noreferrer"
221
- }
222
- )
223
- }
224
- }
225
- ),
226
- getOptionLabel: (o) => e(o ? "stateWcCoveredOptions.yes" : "stateWcCoveredOptions.no"),
227
- formHookResult: i
228
- }
229
- ),
230
- a.StateWcClassCode && /* @__PURE__ */ t(
231
- a.StateWcClassCode,
232
- {
233
- label: e("stateWcClassCodeLabel"),
234
- description: e("stateWcClassCodeDescription"),
235
- placeholder: e("stateWcClassCodeLabel"),
236
- validationMessages: { REQUIRED: e("validations.stateWcClassCode") },
237
- formHookResult: i
238
- }
239
- ),
240
- /* @__PURE__ */ R(A, { children: [
241
- p && /* @__PURE__ */ t(l.Button, { variant: "secondary", onClick: p, isDisabled: u, children: e("cancelNewJobCta") }),
242
- /* @__PURE__ */ t(l.Button, { type: "submit", isLoading: u, children: f })
243
- ] })
244
- ] });
245
- }
246
104
  export {
247
- me as EditCompensation
105
+ $ as EditCompensation
248
106
  };
249
107
  //# sourceMappingURL=EditCompensation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm, type UseJobFormReady } from '../../shared/useJobForm'\nimport {\n useCompensationForm,\n type UseCompensationFormReady,\n} from '../../shared/useCompensationForm'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, FLSA_OVERTIME_SALARY_LIMIT, type EventType } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n startDate: string\n currentJobId?: string | null\n title: string\n submitCtaLabel: string\n onCancel?: () => void\n partnerDefaultValues?: CompensationDefaultValues\n /**\n * Receives the broadcast events: `EMPLOYEE_JOB_CREATED` / `EMPLOYEE_JOB_UPDATED`\n * (with the saved `Job`), then `EMPLOYEE_COMPENSATION_UPDATED` (with the saved\n * `Compensation`) on a successful submit chain. Use `EMPLOYEE_COMPENSATION_UPDATED`\n * for \"save complete\" branching.\n */\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n // The Compensation flow does not surface a hire-date field — the date is\n // derived from the employee's `startDate` (passed via submit options\n // below). Hiding via the hook flag also drops the field from the schema\n // so partner forms don't silently fail validation on create.\n withHireDateField: false,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({ employeeId, hireDate: startDate })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <FormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n\ninterface FormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\nfunction FormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: FormBodyProps) {\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n />\n )}\n\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n\n {CompFields.FlsaStatus && (\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n )}\n\n <CompFields.Rate\n label={t('amount')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n\n <CompFields.PaymentUnit\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","FormBody","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;AAyCO,SAASA,GAAiB,EAAE,YAAAC,GAAY,GAAGC,KAAgC;AAChF,SAAAC,EAAuB,yBAAyBF,CAAU,GAExD,gBAAAG,EAACC,KAAe,eAAc,yBAC5B,4BAACC,GAAA,EAAM,GAAGJ,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASI,EAAK;AAAA,EACZ,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AACF,GAA0B;AACxB,EAAAC,EAAQ,uBAAuB;AAM/B,QAAM,CAACC,GAAeC,CAAgB,IAAIC,EAA6BV,KAAgB,MAA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C;AAAA,gBAACuC,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,gBAAgB,CAACa,MACLf,EAAVe,IAAY,8BAAiC,0BAAN;AAAA,QAEzC,gBAAgBpC;AAAA,MAAA;AAAA,IAAA;AAAA,IAInB2B,EAAU,oBACT,gBAAA3C;AAAA,MAAC2C,EAAU;AAAA,MAAV;AAAA,QACC,OAAON,EAAE,uBAAuB;AAAA,QAChC,aAAaA,EAAE,6BAA6B;AAAA,QAC5C,aAAaA,EAAE,uBAAuB;AAAA,QACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,QAChE,gBAAgBrB;AAAA,MAAA;AAAA,IAAA;AAAA,sBAInBqC,GAAA,EACE,UAAA;AAAA,MAAA7C,KACC,gBAAAR,EAACuC,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAAS/B,GAAU,YAAYwB,GACnE,UAAAK,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAArC,EAACuC,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWP,GACzC,UAAAzB,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"EditCompensation.js","sources":["../../../../../../src/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport classNames from 'classnames'\nimport type { CompensationDefaultValues } from '../Compensation'\nimport { useJobForm } from '../../shared/useJobForm'\nimport { useCompensationForm } from '../../shared/useCompensationForm'\nimport { AddCompensationFormBody } from '../../shared/AddCompensationFormBody'\nimport styles from './EditCompensation.module.scss'\nimport { BaseBoundaries, BaseLayout, type CommonComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport { composeSubmitHandler } from '@/partner-hook-utils/form/composeSubmitHandler'\nimport { componentEvents, type EventType } from '@/shared/constants'\n\nexport interface EditCompensationProps extends CommonComponentInterface<'Employee.Compensation'> {\n employeeId: string\n /**\n * When provided, the hire date is pre-filled from this value and the hire\n * date field is hidden. When absent (add-job from empty state), the hire\n * date field is rendered so the user can set it explicitly.\n */\n startDate?: string\n currentJobId?: string | null\n title: string\n submitCtaLabel: string\n onCancel?: () => void\n partnerDefaultValues?: CompensationDefaultValues\n /**\n * Receives the broadcast events: `EMPLOYEE_JOB_CREATED` / `EMPLOYEE_JOB_UPDATED`\n * (with the saved `Job`), then `EMPLOYEE_COMPENSATION_UPDATED` (with the saved\n * `Compensation`) on a successful submit chain. Use `EMPLOYEE_COMPENSATION_UPDATED`\n * for \"save complete\" branching.\n */\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function EditCompensation({ dictionary, ...props }: EditCompensationProps) {\n useComponentDictionary('Employee.Compensation', dictionary)\n return (\n <BaseBoundaries componentName=\"Employee.Compensation\">\n <Root {...props} />\n </BaseBoundaries>\n )\n}\n\nfunction Root({\n employeeId,\n startDate,\n currentJobId,\n title,\n submitCtaLabel,\n onCancel,\n partnerDefaultValues,\n className,\n onEvent,\n}: EditCompensationProps) {\n useI18n('Employee.Compensation')\n\n // When startDate is provided (onboarding), hide the hire date field and derive\n // it from the prop at submit time. When absent (add-job from dashboard empty\n // state), render the field so the user can set it explicitly.\n const withHireDateField = !startDate\n\n // Track jobId locally so a partial-failure submit chain (job POST succeeds,\n // comp PUT fails) doesn't re-POST and create a duplicate job on retry. We\n // initialize from the prop and only write back when the partner-supplied\n // `currentJobId` was nullish (i.e. add-job flow) — see the submit handler.\n const [resolvedJobId, setResolvedJobId] = useState<string | undefined>(currentJobId ?? undefined)\n\n const jobForm = useJobForm({\n employeeId,\n jobId: resolvedJobId,\n withHireDateField,\n defaultValues: {\n title: partnerDefaultValues?.title ?? '',\n },\n // The Compensation flow always shows a job title field, even when editing\n // an existing job. The hook's schema only requires `title` on create; we\n // require it on update too to preserve the existing UX.\n optionalFieldsToRequire: { update: ['title'] },\n shouldFocusError: false,\n })\n\n // Resolve the compensationId from the job we just loaded so the comp form can\n // seed from the existing comp on edit. While the job form is still loading we\n // pass undefined (compensation form starts in create mode); once the job\n // resolves the prop change re-renders the comp form into update mode with the\n // existing compensation as the seed.\n const resolvedCompensationId = jobForm.isLoading\n ? undefined\n : (jobForm.data.currentJob?.currentCompensationUuid ?? undefined)\n\n const compensationForm = useCompensationForm({\n employeeId,\n jobId: resolvedJobId,\n compensationId: resolvedCompensationId,\n // No effective-date field is surfaced, and no `effectiveDate` is\n // threaded into `actions.onSubmit` either: the server initializes\n // `effective_date` on the auto-stub created by the parent job POST,\n // and subsequent updates omit it from the PUT body so the existing\n // value is preserved (e.g. a deliberately-set future-dated comp\n // wouldn't be silently overwritten on an unrelated edit).\n withEffectiveDateField: false,\n // The Compensation flow always presents flsaStatus, rate, and paymentUnit\n // as required, even when editing an existing compensation. The hook's\n // schema marks them `'create'`-only by default; we promote them on update\n // here to preserve the existing UX (no \"(optional)\" labels).\n optionalFieldsToRequire: { update: ['flsaStatus', 'rate', 'paymentUnit'] },\n defaultValues: {\n flsaStatus: partnerDefaultValues?.flsaStatus,\n rate:\n typeof partnerDefaultValues?.rate === 'number'\n ? partnerDefaultValues.rate\n : partnerDefaultValues?.rate\n ? Number(partnerDefaultValues.rate)\n : undefined,\n paymentUnit: partnerDefaultValues?.paymentUnit,\n },\n shouldFocusError: false,\n })\n\n if (jobForm.isLoading || compensationForm.isLoading) {\n const loadingErrorHandling = composeErrorHandler([jobForm, compensationForm])\n return <BaseLayout isLoading error={loadingErrorHandling.errors} />\n }\n\n const submitResult = composeSubmitHandler([jobForm, compensationForm], async () => {\n const jobResult = await jobForm.actions.onSubmit({\n employeeId,\n hireDate: startDate ?? undefined,\n })\n if (!jobResult) return\n\n onEvent(\n jobResult.mode === 'create'\n ? componentEvents.EMPLOYEE_JOB_CREATED\n : componentEvents.EMPLOYEE_JOB_UPDATED,\n jobResult.data,\n )\n\n // Always thread through the freshly returned job's currentCompensationUuid +\n // its version so we PUT against the latest comp regardless of whether the job\n // POST just auto-created the stub or the job PUT bumped a version.\n const stubCompensation = jobResult.data.compensations?.find(\n c => c.uuid === jobResult.data.currentCompensationUuid,\n )\n\n const compensationResult = await compensationForm.actions.onSubmit({\n jobId: jobResult.data.uuid,\n compensationId: jobResult.data.currentCompensationUuid ?? undefined,\n compensationVersion: stubCompensation?.version ?? undefined,\n })\n if (!compensationResult) {\n if (!currentJobId) setResolvedJobId(jobResult.data.uuid)\n return\n }\n\n onEvent(componentEvents.EMPLOYEE_COMPENSATION_UPDATED, compensationResult.data)\n })\n\n const errorHandling = composeErrorHandler([submitResult])\n\n const isPending = jobForm.status.isPending || compensationForm.status.isPending\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={errorHandling.errors}>\n <Form onSubmit={submitResult.handleSubmit}>\n <AddCompensationFormBody\n jobForm={jobForm}\n compensationForm={compensationForm}\n title={title}\n submitCtaLabel={submitCtaLabel}\n isPending={isPending}\n onCancel={onCancel}\n />\n </Form>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EditCompensation","dictionary","props","useComponentDictionary","jsx","BaseBoundaries","Root","employeeId","startDate","currentJobId","title","submitCtaLabel","onCancel","partnerDefaultValues","className","onEvent","useI18n","withHireDateField","resolvedJobId","setResolvedJobId","useState","jobForm","useJobForm","resolvedCompensationId","compensationForm","useCompensationForm","loadingErrorHandling","composeErrorHandler","BaseLayout","submitResult","composeSubmitHandler","jobResult","componentEvents","stubCompensation","c","compensationResult","errorHandling","isPending","classNames","styles","Form","AddCompensationFormBody"],"mappings":";;;;;;;;;;;;;;AAqCO,SAASA,EAAiB,EAAE,YAAAC,GAAY,GAAGC,KAAgC;AAChF,SAAAC,EAAuB,yBAAyBF,CAAU,G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B;AAAA,IAAA;AAAA,EAAA,EACF,CACF,GACF,GACF;AAEJ;"}
@@ -0,0 +1,18 @@
1
+ import { UseJobFormReady } from './useJobForm';
2
+ import { UseCompensationFormReady } from './useCompensationForm';
3
+ export interface AddCompensationFormBodyProps {
4
+ jobForm: UseJobFormReady;
5
+ compensationForm: UseCompensationFormReady;
6
+ title: string;
7
+ submitCtaLabel: string;
8
+ isPending: boolean;
9
+ onCancel?: () => void;
10
+ }
11
+ /**
12
+ * Renders the shared field layout used by both `EditCompensation` (onboarding) and
13
+ * `AddAnotherJob` (management). Field visibility is driven entirely by the hook
14
+ * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,
15
+ * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —
16
+ * so this component renders the correct subset for each use case with no extra props.
17
+ */
18
+ export declare function AddCompensationFormBody({ jobForm, compensationForm, title, submitCtaLabel, isPending, onCancel, }: AddCompensationFormBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,169 @@
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as R, Trans as f } from "react-i18next";
3
+ import { Flex as v } from "../../../Common/Flex/Flex.js";
4
+ import "classnames";
5
+ import { FLSA_OVERTIME_SALARY_LIMIT as u } from "../../../../shared/constants.js";
6
+ import { ActionsLayout as C } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as D } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import b from "../../../../hooks/useNumberFormatter.js";
9
+ function H({
10
+ jobForm: l,
11
+ compensationForm: s,
12
+ title: p,
13
+ submitCtaLabel: E,
14
+ isPending: d,
15
+ onCancel: c
16
+ }) {
17
+ const { t: e } = R("Employee.Compensation"), n = D(), r = b("currency"), i = l.form.Fields, a = s.form.Fields;
18
+ return /* @__PURE__ */ m(v, { flexDirection: "column", gap: 32, children: [
19
+ /* @__PURE__ */ t(n.Heading, { as: "h2", children: p }),
20
+ s.status.willDeleteSecondaryJobs && /* @__PURE__ */ t(
21
+ n.Alert,
22
+ {
23
+ label: e("validations.classificationChangeNotification"),
24
+ status: "warning"
25
+ }
26
+ ),
27
+ i.Title && /* @__PURE__ */ t(
28
+ i.Title,
29
+ {
30
+ label: e("jobTitle"),
31
+ validationMessages: { REQUIRED: e("validations.title") },
32
+ formHookResult: l
33
+ }
34
+ ),
35
+ i.HireDate && /* @__PURE__ */ t(
36
+ i.HireDate,
37
+ {
38
+ label: e("hireDate"),
39
+ validationMessages: { REQUIRED: e("validations.hireDate") },
40
+ formHookResult: l
41
+ }
42
+ ),
43
+ a.FlsaStatus && /* @__PURE__ */ t(
44
+ a.FlsaStatus,
45
+ {
46
+ label: e("employeeClassification"),
47
+ description: /* @__PURE__ */ t(
48
+ f,
49
+ {
50
+ t: e,
51
+ i18nKey: "classificationLink",
52
+ components: { ClassificationLink: /* @__PURE__ */ t(n.Link, {}) }
53
+ }
54
+ ),
55
+ validationMessages: {
56
+ REQUIRED: e("validations.exemptThreshold", {
57
+ limit: r(u)
58
+ })
59
+ },
60
+ getOptionLabel: (o) => e(`flsaStatusLabels.${o}`),
61
+ formHookResult: s
62
+ }
63
+ ),
64
+ /* @__PURE__ */ t(
65
+ a.Rate,
66
+ {
67
+ label: e("amount"),
68
+ validationMessages: {
69
+ REQUIRED: e("validations.rate"),
70
+ RATE_MINIMUM: e("validations.nonZeroRate"),
71
+ RATE_EXEMPT_THRESHOLD: e("validations.rateExemptThreshold", {
72
+ limit: r(u)
73
+ })
74
+ },
75
+ formHookResult: s
76
+ }
77
+ ),
78
+ /* @__PURE__ */ t(
79
+ a.PaymentUnit,
80
+ {
81
+ label: e("paymentUnitLabel"),
82
+ description: e("paymentUnitDescription"),
83
+ validationMessages: { REQUIRED: e("validations.paymentUnit") },
84
+ getOptionLabel: (o) => e(`paymentUnitOptions.${o}`),
85
+ formHookResult: s
86
+ }
87
+ ),
88
+ a.AdjustForMinimumWage && /* @__PURE__ */ t(
89
+ a.AdjustForMinimumWage,
90
+ {
91
+ label: e("adjustForMinimumWage"),
92
+ description: e("adjustForMinimumWageDescription"),
93
+ formHookResult: s
94
+ }
95
+ ),
96
+ a.MinimumWageId && /* @__PURE__ */ t(
97
+ a.MinimumWageId,
98
+ {
99
+ label: e("minimumWageLabel"),
100
+ description: e("minimumWageDescription"),
101
+ validationMessages: { REQUIRED: e("validations.minimumWage") },
102
+ getOptionLabel: (o) => `${r(Number(o.wage))} - ${o.authority}: ${o.notes ?? ""}`,
103
+ formHookResult: s
104
+ }
105
+ ),
106
+ a.EffectiveDate && /* @__PURE__ */ t(
107
+ a.EffectiveDate,
108
+ {
109
+ label: e("effectiveDate"),
110
+ validationMessages: {
111
+ REQUIRED: e("validations.effectiveDate"),
112
+ EFFECTIVE_DATE_BEFORE_HIRE: e("validations.effectiveDateBeforeHire"),
113
+ EFFECTIVE_DATE_BEFORE_MIN: e("validations.effectiveDateBeforeMin")
114
+ },
115
+ formHookResult: s
116
+ }
117
+ ),
118
+ i.TwoPercentShareholder && /* @__PURE__ */ t(
119
+ i.TwoPercentShareholder,
120
+ {
121
+ label: e("twoPercentStakeholderLabel"),
122
+ formHookResult: l
123
+ }
124
+ ),
125
+ i.StateWcCovered && /* @__PURE__ */ t(
126
+ i.StateWcCovered,
127
+ {
128
+ label: e("stateWcCoveredLabel"),
129
+ description: /* @__PURE__ */ t(
130
+ f,
131
+ {
132
+ t: e,
133
+ i18nKey: "stateWcCoveredDescription",
134
+ components: {
135
+ wcLink: /* @__PURE__ */ t(
136
+ n.Link,
137
+ {
138
+ href: "https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/",
139
+ target: "_blank",
140
+ rel: "noopener noreferrer"
141
+ }
142
+ )
143
+ }
144
+ }
145
+ ),
146
+ getOptionLabel: (o) => e(o ? "stateWcCoveredOptions.yes" : "stateWcCoveredOptions.no"),
147
+ formHookResult: l
148
+ }
149
+ ),
150
+ i.StateWcClassCode && /* @__PURE__ */ t(
151
+ i.StateWcClassCode,
152
+ {
153
+ label: e("stateWcClassCodeLabel"),
154
+ description: e("stateWcClassCodeDescription"),
155
+ placeholder: e("stateWcClassCodeLabel"),
156
+ validationMessages: { REQUIRED: e("validations.stateWcClassCode") },
157
+ formHookResult: l
158
+ }
159
+ ),
160
+ /* @__PURE__ */ m(C, { children: [
161
+ c && /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: c, isDisabled: d, children: e("cancelNewJobCta") }),
162
+ /* @__PURE__ */ t(n.Button, { type: "submit", isLoading: d, children: E })
163
+ ] })
164
+ ] });
165
+ }
166
+ export {
167
+ H as AddCompensationFormBody
168
+ };
169
+ //# sourceMappingURL=AddCompensationFormBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddCompensationFormBody.js","sources":["../../../../../src/components/Employee/Compensation/shared/AddCompensationFormBody.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport type { PaymentUnit } from '@gusto/embedded-api/models/components/compensation'\nimport type { FlsaStatusType } from '@gusto/embedded-api/models/components/flsastatustype'\nimport type { MinimumWage } from '@gusto/embedded-api/models/components/minimumwage'\nimport type { UseJobFormReady } from './useJobForm'\nimport type { UseCompensationFormReady } from './useCompensationForm'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FLSA_OVERTIME_SALARY_LIMIT } from '@/shared/constants'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\nexport interface AddCompensationFormBodyProps {\n jobForm: UseJobFormReady\n compensationForm: UseCompensationFormReady\n title: string\n submitCtaLabel: string\n isPending: boolean\n onCancel?: () => void\n}\n\n/**\n * Renders the shared field layout used by both `EditCompensation` (onboarding) and\n * `AddAnotherJob` (management). Field visibility is driven entirely by the hook\n * configuration — `JobFields.HireDate` is only defined when `withHireDateField: true`,\n * and `CompFields.EffectiveDate` is only defined when `withEffectiveDateField: true` —\n * so this component renders the correct subset for each use case with no extra props.\n */\nexport function AddCompensationFormBody({\n jobForm,\n compensationForm,\n title,\n submitCtaLabel,\n isPending,\n onCancel,\n}: AddCompensationFormBodyProps) {\n const { t } = useTranslation('Employee.Compensation')\n const Components = useComponentContext()\n const format = useNumberFormatter('currency')\n\n const JobFields = jobForm.form.Fields\n const CompFields = compensationForm.form.Fields\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n\n {compensationForm.status.willDeleteSecondaryJobs && (\n <Components.Alert\n label={t('validations.classificationChangeNotification')}\n status=\"warning\"\n />\n )}\n\n {JobFields.Title && (\n <JobFields.Title\n label={t('jobTitle')}\n validationMessages={{ REQUIRED: t('validations.title') }}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.HireDate && (\n <JobFields.HireDate\n label={t('hireDate')}\n validationMessages={{ REQUIRED: t('validations.hireDate') }}\n formHookResult={jobForm}\n />\n )}\n\n {CompFields.FlsaStatus && (\n <CompFields.FlsaStatus\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationLink\"\n components={{ ClassificationLink: <Components.Link /> }}\n />\n }\n validationMessages={{\n REQUIRED: t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n getOptionLabel={(status: FlsaStatusType) => t(`flsaStatusLabels.${status}`)}\n formHookResult={compensationForm}\n />\n )}\n\n <CompFields.Rate\n label={t('amount')}\n validationMessages={{\n REQUIRED: t('validations.rate'),\n RATE_MINIMUM: t('validations.nonZeroRate'),\n RATE_EXEMPT_THRESHOLD: t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n }),\n }}\n formHookResult={compensationForm}\n />\n\n <CompFields.PaymentUnit\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n validationMessages={{ REQUIRED: t('validations.paymentUnit') }}\n getOptionLabel={(unit: PaymentUnit) => t(`paymentUnitOptions.${unit}`)}\n formHookResult={compensationForm}\n />\n\n {CompFields.AdjustForMinimumWage && (\n <CompFields.AdjustForMinimumWage\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.MinimumWageId && (\n <CompFields.MinimumWageId\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n validationMessages={{ REQUIRED: t('validations.minimumWage') }}\n getOptionLabel={(wage: MinimumWage) =>\n `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`\n }\n formHookResult={compensationForm}\n />\n )}\n\n {CompFields.EffectiveDate && (\n <CompFields.EffectiveDate\n label={t('effectiveDate')}\n validationMessages={{\n REQUIRED: t('validations.effectiveDate'),\n EFFECTIVE_DATE_BEFORE_HIRE: t('validations.effectiveDateBeforeHire'),\n EFFECTIVE_DATE_BEFORE_MIN: t('validations.effectiveDateBeforeMin'),\n }}\n formHookResult={compensationForm}\n />\n )}\n\n {JobFields.TwoPercentShareholder && (\n <JobFields.TwoPercentShareholder\n label={t('twoPercentStakeholderLabel')}\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcCovered && (\n <JobFields.StateWcCovered\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n getOptionLabel={(covered: boolean) =>\n covered ? t('stateWcCoveredOptions.yes') : t('stateWcCoveredOptions.no')\n }\n formHookResult={jobForm}\n />\n )}\n\n {JobFields.StateWcClassCode && (\n <JobFields.StateWcClassCode\n label={t('stateWcClassCodeLabel')}\n description={t('stateWcClassCodeDescription')}\n placeholder={t('stateWcClassCodeLabel')}\n validationMessages={{ REQUIRED: t('validations.stateWcClassCode') }}\n formHookResult={jobForm}\n />\n )}\n\n <ActionsLayout>\n {onCancel && (\n <Components.Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelNewJobCta')}\n </Components.Button>\n )}\n <Components.Button type=\"submit\" isLoading={isPending}>\n {submitCtaLabel}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["AddCompensationFormBody","jobForm","compensationForm","title","submitCtaLabel","isPending","onCancel","t","useTranslation","Components","useComponentContext","format","useNumberFormatter","JobFields","CompFields","jsxs","Flex","jsx","Trans","FLSA_OVERTIME_SALARY_LIMIT","status","unit","wage","covered","ActionsLayout"],"mappings":";;;;;;;;AA2BO,SAASA,EAAwB;AAAA,EACtC,SAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,GAAiC;AAC/B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAAaC,EAAA,GACbC,IAASC,EAAmB,UAAU,GAEtCC,IAAYZ,EAAQ,KAAK,QACzBa,IAAaZ,EAAiB,KAAK;AAEzC,SACE,gBAAAa,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC,EAACR,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAN,GAAM;AAAA,IAElCD,EAAiB,OAAO,2BACvB,gBAAAe;AAAA,MAACR,EAAW;AAAA,MAAX;AAAA,QACC,OAAOF,EAAE,8CAA8C;AAAA,QACvD,QAAO;AAAA,MAAA;AAAA,IAAA;AAAA,IAIVM,EAAU,SACT,gBAAAI;AAAA,MAACJ,EAAU;AAAA,MAAV;AAAA,QACC,OAAON,EAAE,UAAU;AAAA,QACnB,oBAAoB,EAAE,UAAUA,EAAE,mBAAmB,EAAA;AAAA,QACrD,gBAAgBN;AAAA,MAAA;AAAA,IAAA;AAAA,IAInBY,EAAU,YACT,gBAAAI;AAAA,MAACJ,EAAU;AAAA,MAAV;AAAA,QACC,OAAON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;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QAAA;AAAA,QAGJ,gBAAgB,CAACc,MACLhB,EAAVgB,IAAY,8BAAiC,0BAAN;AAAA,QAEzC,gBAAgBtB;AAAA,MAAA;AAAA,IAAA;AAAA,IAInBY,EAAU,oBACT,gBAAAI;AAAA,MAACJ,EAAU;AAAA,MAAV;AAAA,QACC,OAAON,EAAE,uBAAuB;AAAA,QAChC,aAAaA,EAAE,6BAA6B;AAAA,QAC5C,aAAaA,EAAE,uBAAuB;AAAA,QACtC,oBAAoB,EAAE,UAAUA,EAAE,8BAA8B,EAAA;AAAA,QAChE,gBAAgBN;AAAA,MAAA;AAAA,IAAA;AAAA,sBAInBuB,GAAA,EACE,UAAA;AAAA,MAAAlB,KACC,gBAAAW,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAAU,YAAYD,GACnE,UAAAE,EAAE,iBAAiB,EAAA,CACtB;AAAA,MAEF,gBAAAU,EAACR,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWJ,GACzC,UAAAD,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -8,6 +8,7 @@ export declare const CompensationErrorCodes: {
8
8
  readonly PAYMENT_UNIT_COMMISSION: "PAYMENT_UNIT_COMMISSION";
9
9
  readonly RATE_COMMISSION_ZERO: "RATE_COMMISSION_ZERO";
10
10
  readonly EFFECTIVE_DATE_BEFORE_HIRE: "EFFECTIVE_DATE_BEFORE_HIRE";
11
+ readonly EFFECTIVE_DATE_BEFORE_MIN: "EFFECTIVE_DATE_BEFORE_MIN";
11
12
  };
12
13
  export type CompensationErrorCode = (typeof CompensationErrorCodes)[keyof typeof CompensationErrorCodes];
13
14
  declare const fieldValidators: {
@@ -83,6 +84,21 @@ export interface CompensationSchemaOptions {
83
84
  * `EFFECTIVE_DATE_BEFORE_HIRE` issue when violated.
84
85
  */
85
86
  hireDate?: string | null;
87
+ /**
88
+ * Absolute lower bound for `effectiveDate`, enforced in both create and
89
+ * update modes whenever provided. Typically `addDays(today, 1)` (tomorrow)
90
+ * for management screens where effective dates must be in the future, or
91
+ * `max(tomorrow, hireDate)` for secondary new jobs. Surfaces an
92
+ * `EFFECTIVE_DATE_BEFORE_MIN` issue when violated.
93
+ *
94
+ * **Callers must only pass this when the carve-out cannot fire.** The
95
+ * carve-out (`willDeleteSecondaryJobs` in update mode) forces `effectiveDate`
96
+ * to today on a disabled field — passing `minEffectiveDate` for a primary
97
+ * job in update mode would cause a spurious validation failure on submit.
98
+ * Secondary jobs are safe because their FLSA field is hidden, preventing the
99
+ * carve-out from activating.
100
+ */
101
+ minEffectiveDate?: string | null;
86
102
  /**
87
103
  * When `false`, drops `effectiveDate` from the validated shape — the field
88
104
  * becomes hook-managed (e.g. seeded from the parent job's `hireDate` during