@gusto/embedded-react-sdk 0.36.0 → 0.37.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  3. package/dist/UNSTABLE_Hooks.js +6 -6
  4. package/dist/components/Base/Base.d.ts +8 -10
  5. package/dist/components/Base/Base.js +121 -100
  6. package/dist/components/Base/Base.js.map +1 -1
  7. package/dist/components/Base/index.d.ts +1 -1
  8. package/dist/components/Base/useBase.d.ts +3 -7
  9. package/dist/components/Base/useBase.js.map +1 -1
  10. package/dist/components/Base/useBaseSubmit.d.ts +3 -5
  11. package/dist/components/Base/useBaseSubmit.js +27 -50
  12. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  13. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  15. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  16. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
  17. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  18. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -8
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -8
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -10
  28. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -8
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  31. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  32. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  33. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  34. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  35. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -13
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  37. package/dist/components/Company/Industry/Context.js +9 -11
  38. package/dist/components/Company/Industry/Context.js.map +1 -1
  39. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  40. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  41. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -8
  42. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  43. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -8
  44. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  45. package/dist/components/Company/OnboardingOverview/context.js +6 -8
  46. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  47. package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
  48. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  49. package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
  50. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  51. package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -10
  52. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -8
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -8
  56. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  57. package/dist/components/Contractor/Address/Form.js +7 -6
  58. package/dist/components/Contractor/Address/Form.js.map +1 -1
  59. package/dist/components/Contractor/Address/useAddress.js +8 -10
  60. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  61. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
  62. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  63. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  64. package/dist/components/Contractor/Profile/useContractorProfile.js +26 -28
  65. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  66. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +13 -15
  67. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  68. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +5 -7
  69. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  70. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +5 -7
  71. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  72. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  73. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  74. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  75. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  76. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  77. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  78. package/dist/components/Employee/EmployeeList/useEmployeeList.js +6 -8
  79. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  80. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
  81. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  82. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +6 -8
  83. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  84. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +8 -10
  85. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  86. package/dist/components/Employee/Profile/HomeAddress.js +9 -8
  87. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  88. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +15 -14
  89. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  90. package/dist/components/Employee/Profile/Profile.js +30 -29
  91. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  92. package/dist/components/Employee/Profile/useProfile.js +6 -8
  93. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  94. package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
  95. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  96. package/dist/components/Employee/StateTaxes/useStateTaxes.js +6 -8
  97. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  98. package/dist/components/Employee/Taxes/Taxes.js +53 -53
  99. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  100. package/dist/components/Employee/Taxes/useTaxes.js +6 -8
  101. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  102. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
  103. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
  104. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
  105. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
  106. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
  107. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
  108. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
  109. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
  110. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
  111. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
  112. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
  113. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
  114. package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
  115. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
  116. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
  117. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
  118. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
  119. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
  120. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
  121. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
  122. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
  123. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
  124. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
  125. package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
  126. package/dist/components/Employee/Terminations/index.d.ts +8 -0
  127. package/dist/components/Employee/Terminations/types.d.ts +1 -0
  128. package/dist/components/Employee/index.d.ts +7 -0
  129. package/dist/components/Employee/index.js +34 -28
  130. package/dist/components/Employee/index.js.map +1 -1
  131. package/dist/components/InformationRequests/InformationRequests.js +31 -31
  132. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  133. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
  134. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  135. package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
  136. package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
  137. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
  138. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
  139. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
  140. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
  141. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
  142. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
  143. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
  144. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
  145. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
  146. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
  147. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
  148. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
  149. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
  150. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
  151. package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
  152. package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
  153. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -3
  154. package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
  155. package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
  156. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  157. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
  158. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
  159. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  160. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
  161. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  162. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  163. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
  164. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  165. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
  166. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
  167. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
  168. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
  169. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
  170. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  171. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
  172. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
  173. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  174. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
  175. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  176. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
  177. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -70
  178. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  179. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
  180. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
  181. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
  182. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
  183. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
  184. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  185. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
  186. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  187. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
  188. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +225 -194
  189. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  190. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
  191. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
  192. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
  193. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
  194. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  195. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
  196. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
  197. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
  198. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  199. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
  200. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  201. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
  202. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  203. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
  204. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  205. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
  206. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  207. package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
  208. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  209. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
  210. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
  211. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  212. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
  213. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  214. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  215. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  216. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
  217. package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
  218. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
  219. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
  220. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
  221. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
  222. package/dist/components/Payroll/Transition/index.d.ts +3 -0
  223. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
  224. package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
  225. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
  226. package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
  227. package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
  228. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
  229. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
  230. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
  231. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
  232. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
  233. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
  234. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
  235. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
  236. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
  237. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
  238. package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
  239. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
  240. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
  241. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
  242. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
  243. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
  244. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
  245. package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
  246. package/dist/components/Payroll/helpers.d.ts +2 -1
  247. package/dist/components/Payroll/helpers.js +98 -87
  248. package/dist/components/Payroll/helpers.js.map +1 -1
  249. package/dist/components/Payroll/index.d.ts +6 -0
  250. package/dist/components/Payroll/index.js +32 -26
  251. package/dist/components/Payroll/index.js.map +1 -1
  252. package/dist/components/Payroll/payrollTypes.d.ts +21 -0
  253. package/dist/components/Payroll/payrollTypes.js +27 -0
  254. package/dist/components/Payroll/payrollTypes.js.map +1 -0
  255. package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
  256. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  257. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
  258. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
  259. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
  260. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
  261. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +18 -0
  262. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
  263. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
  264. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +9 -0
  265. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +15 -0
  266. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -0
  267. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +15 -0
  268. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
  269. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
  270. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
  271. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
  272. package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
  273. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +3 -0
  274. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +16 -0
  275. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +7 -0
  276. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
  277. package/dist/components/UNSTABLE_Hooks/index.d.ts +5 -0
  278. package/dist/components/UNSTABLE_Hooks/types.d.ts +46 -0
  279. package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
  280. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  281. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
  282. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  283. package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
  284. package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
  285. package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
  286. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  287. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
  288. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
  289. package/dist/i18n/I18n.js +11 -11
  290. package/dist/i18n/I18n.js.map +1 -1
  291. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
  292. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
  293. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
  294. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
  295. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
  296. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
  297. package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
  298. package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
  299. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
  300. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  301. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
  302. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
  303. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  304. package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
  305. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  306. package/dist/i18n/en/Payroll.Transition.json.js +8 -0
  307. package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
  308. package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
  309. package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
  310. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
  311. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
  312. package/dist/i18n/en/common.json.d.ts +2 -1
  313. package/dist/i18n/en/common.json.js +9 -9
  314. package/dist/index.d.ts +3 -2
  315. package/dist/index.js +14 -13
  316. package/dist/shared/constants.d.ts +32 -0
  317. package/dist/shared/constants.js +83 -65
  318. package/dist/shared/constants.js.map +1 -1
  319. package/dist/style.css +1 -1
  320. package/dist/types/i18next.d.ts +163 -1
  321. package/dist/types/observability.d.ts +31 -65
  322. package/dist/types/sdkError.d.ts +91 -0
  323. package/dist/types/sdkError.js +95 -0
  324. package/dist/types/sdkError.js.map +1 -0
  325. package/dist/types/sdkError.test.d.ts +1 -0
  326. package/docs/reference/endpoint-inventory.json +120 -14
  327. package/package.json +13 -13
  328. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
  329. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
  330. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
  331. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
  332. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
  333. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
  334. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
  335. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
  336. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
  337. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
  338. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
  339. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
  340. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
  341. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
  342. package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
  343. package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
  344. package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n OffCycleReason as ApiOffCycleReason,\n WithholdingPayPeriod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\nimport type { MultiSelectComboBoxOption } from '@/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation()\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const [taxWithholdingConfig, setTaxWithholdingConfig] = useState<OffCycleTaxWithholdingConfig>({\n withholdingPayPeriod: WithholdingPayPeriod.EveryOtherWeek,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[payrollType].withholdingType,\n })\n const [isTaxWithholdingModalOpen, setIsTaxWithholdingModalOpen] = useState(false)\n\n const handleTaxWithholdingEditClick = useCallback(() => {\n setIsTaxWithholdingModalOpen(true)\n }, [])\n\n const handleTaxWithholdingModalDone = useCallback((config: OffCycleTaxWithholdingConfig) => {\n setTaxWithholdingConfig(config)\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const handleTaxWithholdingModalCancel = useCallback(() => {\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const { data: employeesData, isLoading: isLoadingEmployees } = useEmployeesListSuspense({\n companyId,\n onboardedActive: true,\n })\n\n const employees: MultiSelectComboBoxOption[] = useMemo(() => {\n const employeeList = employeesData.showEmployees ?? []\n return employeeList.map(employee => {\n const fullName = [employee.firstName, employee.lastName].filter(Boolean).join(' ')\n return {\n label: fullName,\n value: employee.uuid,\n }\n })\n }, [employeesData])\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const translateValidation = (key: string): string => t(key as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n )\n const schema = z\n .object({\n reason: z.enum(['bonus', 'correction']),\n skipRegularDeductions: z.boolean(),\n includeAllEmployees: z.boolean(),\n selectedEmployeeUuids: z.array(z.string()),\n })\n .and(dateSchema)\n .superRefine((data, ctx) => {\n if (!data.includeAllEmployees && data.selectedEmployeeUuids.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['selectedEmployeeUuids'],\n message: tCreation('errors.noEmployeesSelected'),\n })\n }\n })\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n includeAllEmployees: true,\n selectedEmployeeUuids: [],\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n setTaxWithholdingConfig(prev => ({\n ...prev,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[watchedReason].withholdingType,\n }))\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.isCheckOnly ? checkDate : data.startDate!\n const endDate = data.isCheckOnly ? checkDate : data.endDate!\n const employeeUuids =\n !data.includeAllEmployees && data.selectedEmployeeUuids.length > 0\n ? data.selectedEmployeeUuids\n : undefined\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n employeeUuids,\n withholdingPayPeriod: taxWithholdingConfig.withholdingPayPeriod,\n fixedWithholdingRate: taxWithholdingConfig.withholdingRate === 'supplemental',\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new Error(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation\n employees={employees}\n isLoadingEmployees={isLoadingEmployees}\n isPending={isPending}\n taxWithholdingConfig={taxWithholdingConfig}\n isTaxWithholdingModalOpen={isTaxWithholdingModalOpen}\n onTaxWithholdingEditClick={handleTaxWithholdingEditClick}\n onTaxWithholdingModalDone={handleTaxWithholdingModalDone}\n onTaxWithholdingModalCancel={handleTaxWithholdingModalCancel}\n />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","taxWithholdingConfig","setTaxWithholdingConfig","useState","WithholdingPayPeriod","OFF_CYCLE_REASON_DEFAULTS","isTaxWithholdingModalOpen","setIsTaxWithholdingModalOpen","handleTaxWithholdingEditClick","useCallback","handleTaxWithholdingModalDone","config","handleTaxWithholdingModalCancel","employeesData","isLoadingEmployees","useEmployeesListSuspense","employees","useMemo","employee","translateValidation","key","methods","useForm","values","context","options","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","data","ctx","zodResolver","watchedReason","useEffect","prev","onSubmit","checkDate","startDate","endDate","employeeUuids","response","RFCDate","payrollUuid","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,MAAMA,KAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAEO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,MAAe,GAAGF,GACjB,4BAACG,IAAA,EAAM,GAAGH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AC3C,UAAA,gBAAAzD;AAAA,IAACoE;AAAA,IAAA;AAAA,MACC,WAAAjC;AAAA,MACA,oBAAAF;AAAA,MACA,WAAAf;AAAA,MACA,sBAAAE;AAAA,MACA,2BAAAK;AAAA,MACA,2BAA2BE;AAAA,MAC3B,2BAA2BE;AAAA,MAC3B,6BAA6BE;AAAA,IAAA;AAAA,EAAA,GAEjC,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"OffCycleCreation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreation.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react'\nimport { FormProvider, useForm, type Resolver } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsCreateOffCycleMutation } from '@gusto/embedded-api/react-query/payrollsCreateOffCycle'\nimport {\n OffCycleReason as ApiOffCycleReason,\n WithholdingPayPeriod,\n} from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { OFF_CYCLE_REASON_DEFAULTS, type OffCycleReason } from '../OffCycleReasonSelection'\nimport {\n createOffCyclePayPeriodDateFormSchema,\n type OffCyclePayrollDateType,\n} from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes'\nimport { useOffCyclePayPeriodDateValidation } from '../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleCreationFormData, OffCycleCreationProps } from './OffCycleCreationTypes'\nimport { OffCycleCreationPresentation } from './OffCycleCreationPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { Form } from '@/components/Common/Form'\nimport type { MultiSelectComboBoxOption } from '@/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes'\n\nconst LOCAL_TO_API_REASON: Record<OffCycleReason, ApiOffCycleReason> = {\n bonus: ApiOffCycleReason.Bonus,\n correction: ApiOffCycleReason.Correction,\n}\n\nexport function OffCycleCreation(props: OffCycleCreationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ dictionary, companyId, payrollType = 'bonus' }: OffCycleCreationProps) {\n useComponentDictionary('Payroll.OffCycleCreation', dictionary)\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleReasonSelection')\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n const { t: tCreation } = useTranslation('Payroll.OffCycleCreation')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { minCheckDate, today } = useOffCyclePayPeriodDateValidation()\n const { mutateAsync: createOffCyclePayroll, isPending } = usePayrollsCreateOffCycleMutation()\n\n const [taxWithholdingConfig, setTaxWithholdingConfig] = useState<OffCycleTaxWithholdingConfig>({\n withholdingPayPeriod: WithholdingPayPeriod.EveryOtherWeek,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[payrollType].withholdingType,\n })\n const [isTaxWithholdingModalOpen, setIsTaxWithholdingModalOpen] = useState(false)\n\n const handleTaxWithholdingEditClick = useCallback(() => {\n setIsTaxWithholdingModalOpen(true)\n }, [])\n\n const handleTaxWithholdingModalDone = useCallback((config: OffCycleTaxWithholdingConfig) => {\n setTaxWithholdingConfig(config)\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const handleTaxWithholdingModalCancel = useCallback(() => {\n setIsTaxWithholdingModalOpen(false)\n }, [])\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n onboardedActive: true,\n })\n\n const employees: MultiSelectComboBoxOption[] = useMemo(() => {\n const employeeList = employeesData.showEmployees ?? []\n return employeeList.map(employee => {\n const fullName = [employee.firstName, employee.lastName].filter(Boolean).join(' ')\n return {\n label: fullName,\n value: employee.uuid,\n }\n })\n }, [employeesData])\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const translateValidation = (key: string): string => t(key as any) as string\n\n const dynamicResolver: Resolver<OffCycleCreationFormData> = (values, context, options) => {\n const reason = values.reason\n const isCheckOnly = values.isCheckOnly\n const resolvedPayrollType: OffCyclePayrollDateType =\n reason === 'correction' ? 'correction' : payrollType\n\n const dateSchema = createOffCyclePayPeriodDateFormSchema(\n translateValidation,\n resolvedPayrollType,\n isCheckOnly ? today : minCheckDate,\n )\n const schema = z\n .object({\n reason: z.enum(['bonus', 'correction']),\n skipRegularDeductions: z.boolean(),\n includeAllEmployees: z.boolean(),\n selectedEmployeeUuids: z.array(z.string()),\n })\n .and(dateSchema)\n .superRefine((data, ctx) => {\n if (!data.includeAllEmployees && data.selectedEmployeeUuids.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['selectedEmployeeUuids'],\n message: tCreation('errors.noEmployeesSelected'),\n })\n }\n })\n\n return zodResolver(schema)(values, context, options)\n }\n\n const methods = useForm<OffCycleCreationFormData>({\n resolver: dynamicResolver,\n defaultValues: {\n reason: payrollType,\n isCheckOnly: false,\n startDate: null,\n endDate: null,\n checkDate: null,\n skipRegularDeductions: OFF_CYCLE_REASON_DEFAULTS[payrollType].skipDeductions,\n includeAllEmployees: false,\n selectedEmployeeUuids: [],\n },\n })\n\n const watchedReason = methods.watch('reason')\n\n useEffect(() => {\n methods.setValue(\n 'skipRegularDeductions',\n OFF_CYCLE_REASON_DEFAULTS[watchedReason].skipDeductions,\n )\n setTaxWithholdingConfig(prev => ({\n ...prev,\n withholdingRate: OFF_CYCLE_REASON_DEFAULTS[watchedReason].withholdingType,\n }))\n }, [watchedReason, methods])\n\n const onSubmit = async (data: OffCycleCreationFormData) => {\n const reason = data.reason\n const checkDate = data.checkDate!\n const startDate = data.isCheckOnly ? checkDate : data.startDate!\n const endDate = data.isCheckOnly ? checkDate : data.endDate!\n const employeeUuids =\n !data.includeAllEmployees && data.selectedEmployeeUuids.length > 0\n ? data.selectedEmployeeUuids\n : undefined\n\n await baseSubmitHandler(data, async () => {\n const response = await createOffCyclePayroll({\n request: {\n companyId,\n requestBody: {\n offCycle: true,\n offCycleReason: LOCAL_TO_API_REASON[reason],\n startDate: new RFCDate(startDate),\n endDate: new RFCDate(endDate),\n checkDate: new RFCDate(checkDate),\n skipRegularDeductions: data.skipRegularDeductions,\n isCheckOnlyPayroll: data.isCheckOnly,\n employeeUuids,\n withholdingPayPeriod: taxWithholdingConfig.withholdingPayPeriod,\n fixedWithholdingRate: taxWithholdingConfig.withholdingRate === 'supplemental',\n },\n },\n })\n\n const payrollUuid =\n response.payrollUnprocessed?.payrollUuid ?? response.payrollUnprocessed?.uuid\n\n if (!payrollUuid) {\n throw new SDKInternalError(tCreation('errors.missingPayrollId'))\n }\n\n onEvent(componentEvents.OFF_CYCLE_CREATED, { payrollUuid })\n })\n }\n\n return (\n <FormProvider {...methods}>\n <Form onSubmit={methods.handleSubmit(onSubmit)}>\n <OffCycleCreationPresentation\n employees={employees}\n isPending={isPending}\n taxWithholdingConfig={taxWithholdingConfig}\n isTaxWithholdingModalOpen={isTaxWithholdingModalOpen}\n onTaxWithholdingEditClick={handleTaxWithholdingEditClick}\n onTaxWithholdingModalDone={handleTaxWithholdingModalDone}\n onTaxWithholdingModalCancel={handleTaxWithholdingModalCancel}\n />\n </Form>\n </FormProvider>\n )\n}\n"],"names":["LOCAL_TO_API_REASON","ApiOffCycleReason","OffCycleCreation","props","jsx","BaseComponent","Root","dictionary","companyId","payrollType","useComponentDictionary","useI18n","t","useTranslation","tCreation","onEvent","baseSubmitHandler","useBase","minCheckDate","today","useOffCyclePayPeriodDateValidation","createOffCyclePayroll","isPending","usePayrollsCreateOffCycleMutation","taxWithholdingConfig","setTaxWithholdingConfig","useState","WithholdingPayPeriod","OFF_CYCLE_REASON_DEFAULTS","isTaxWithholdingModalOpen","setIsTaxWithholdingModalOpen","handleTaxWithholdingEditClick","useCallback","handleTaxWithholdingModalDone","config","handleTaxWithholdingModalCancel","employeesData","useEmployeesListSuspense","employees","useMemo","employee","translateValidation","key","methods","useForm","values","context","options","reason","isCheckOnly","dateSchema","createOffCyclePayPeriodDateFormSchema","schema","z","data","ctx","zodResolver","watchedReason","useEffect","prev","onSubmit","checkDate","startDate","endDate","employeeUuids","response","RFCDate","payrollUuid","SDKInternalError","componentEvents","FormProvider","Form","OffCycleCreationPresentation"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,KAAiE;AAAA,EACrE,OAAOC,EAAkB;AAAA,EACzB,YAAYA,EAAkB;AAChC;AAEO,SAASC,GAAiBC,GAA8B;AAC7D,SACE,gBAAAC,EAACC,MAAe,GAAGF,GACjB,4BAACG,IAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,GAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,aAAAC,IAAc,WAAkC;AACrF,EAAAC,GAAuB,4BAA4BH,CAAU,GAC7DI,EAAQ,0BAA0B,GAClCA,EAAQ,iCAAiC,GACzCA,EAAQ,mCAAmC,GAC3CA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B;AAEnC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC,GAC1D,EAAE,GAAGC,MAAcD,EAAe,0BAA0B,GAC5D,EAAE,SAAAE,GAAS,mBAAAC,EAAA,IAAsBC,GAAA,GAEjC,EAAE,cAAAC,GAAc,OAAAC,EAAA,IAAUC,EAAA,GAC1B,EAAE,aAAaC,GAAuB,WAAAC,EAAA,IAAcC,EAAA,GAEpD,CAACC,GAAsBC,CAAuB,IAAIC,EAAuC;AAAA,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,YACV,gBAAgBR,GAAoBgD,CAAM;AAAA,YAC1C,WAAW,IAAIkB,EAAQJ,CAAS;AAAA,YAChC,SAAS,IAAII,EAAQH,CAAO;AAAA,YAC5B,WAAW,IAAIG,EAAQL,CAAS;AAAA,YAChC,uBAAuBP,EAAK;AAAA,YAC5B,oBAAoBA,EAAK;AAAA,YACzB,eAAAU;AAAA,YACA,sBAAsBxC,EAAqB;AAAA,YAC3C,sBAAsBA,EAAqB,oBAAoB;AAAA,UAAA;AAAA,QACjE;AAAA,MACF,CACD,GAEK2C,IACJF,EAAS,oBAAoB,eAAeA,EAAS,oBAAoB;AAE3E,UAAI,CAACE;AACH,cAAM,IAAIC,GAAiBtD,EAAU,yBAAyB,CAAC;AAGjE,MAAAC,EAAQsD,GAAgB,mBAAmB,EAAE,aAAAF,EAAA,CAAa;AAAA,IAC5D,CAAC;AAAA,EACH;AAEA,SACE,gBAAA/D,EAACkE,GAAA,EAAc,GAAG3B,GAChB,UAAA,gBAAAvC,EAACmE,MAAK,UAAU5B,EAAQ,aAAaiB,CAAQ,GAC3C,UAAA,gBAAAxD;AAAA,IAACoE;AAAA,IAAA;AAAA,MACC,WAAAlC;AAAA,MACA,WAAAhB;AAAA,MACA,sBAAAE;AAAA,MACA,2BAAAK;AAAA,MACA,2BAA2BE;AAAA,MAC3B,2BAA2BE;AAAA,MAC3B,6BAA6BE;AAAA,IAAA;AAAA,EAAA,GAEjC,EAAA,CACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
1
  import { OffCycleCreationPresentationProps } from './OffCycleCreationTypes';
2
- export declare function OffCycleCreationPresentation({ employees, isLoadingEmployees, isPending, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, }: OffCycleCreationPresentationProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function OffCycleCreationPresentation({ employees, isPending, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, }: OffCycleCreationPresentationProps): import("react/jsx-runtime").JSX.Element;
@@ -1,64 +1,72 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { useMemo as F, useCallback as G } from "react";
3
- import { useFormContext as w } from "react-hook-form";
4
- import { useTranslation as n } from "react-i18next";
5
- import { OffCyclePayPeriodDateFormPresentation as W } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
6
- import { WAGE_TYPE_CATEGORIES as k } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
7
- import { useI18n as r } from "../../../i18n/I18n.js";
8
- import { useComponentContext as v } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { Flex as l } from "../../Common/Flex/Flex.js";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as A, useCallback as F } from "react";
3
+ import { useFormContext as G } from "react-hook-form";
4
+ import { useTranslation as r } from "react-i18next";
5
+ import { OffCyclePayPeriodDateFormPresentation as w } from "../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js";
6
+ import { WAGE_TYPE_CATEGORIES as W } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
7
+ import a from "./OffCycleCreationPresentation.module.scss.js";
8
+ import { useI18n as c } from "../../../i18n/I18n.js";
9
+ import { useComponentContext as k } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import { Flex as o } from "../../Common/Flex/Flex.js";
10
11
  import "classnames";
11
12
  import "../../../shared/constants.js";
12
- import { RadioGroupField as L } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
+ import { RadioGroupField as N } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
14
  import { SwitchField as R } from "../../Common/Fields/SwitchField/SwitchField.js";
14
15
  import { OffCycleReasonSelectionPresentation as j } from "../OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js";
15
16
  import { MultiSelectComboBoxField as I } from "../../Common/Fields/MultiSelectComboBoxField/MultiSelectComboBoxField.js";
16
- import { OffCycleTaxWithholdingTable as M } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
17
- import { OffCycleTaxWithholdingModal as V } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
18
- function ie({
19
- employees: y,
20
- isLoadingEmployees: h,
21
- isPending: p,
22
- taxWithholdingConfig: m,
23
- isTaxWithholdingModalOpen: g,
24
- onTaxWithholdingEditClick: C,
25
- onTaxWithholdingModalDone: x,
26
- onTaxWithholdingModalCancel: T
17
+ import { OffCycleTaxWithholdingTable as L } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.js";
18
+ import { OffCycleTaxWithholdingModal as M } from "../OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js";
19
+ function te({
20
+ employees: g,
21
+ isPending: d,
22
+ taxWithholdingConfig: u,
23
+ isTaxWithholdingModalOpen: C,
24
+ onTaxWithholdingEditClick: x,
25
+ onTaxWithholdingModalDone: T,
26
+ onTaxWithholdingModalCancel: b
27
27
  }) {
28
- r("Payroll.OffCycleCreation"), r("Payroll.OffCycleDeductionsSetting"), r("Payroll.EmployeeSelection"), r("Payroll.OffCycleTaxWithholding");
29
- const { t: i } = n("Payroll.OffCycleCreation"), { t } = n("Payroll.OffCycleDeductionsSetting"), { t: a } = n("Payroll.EmployeeSelection"), { t: c } = n("Payroll.OffCycleTaxWithholding"), { Heading: d, Text: b, Button: D } = v(), E = F(
30
- () => k.map((o) => {
31
- const f = {
32
- category: o,
33
- label: c(`wageTypeGroups.${o}.label`)
28
+ c("Payroll.OffCycleCreation"), c("Payroll.OffCycleDeductionsSetting"), c("Payroll.EmployeeSelection"), c("Payroll.OffCycleTaxWithholding");
29
+ const { t: i } = r("Payroll.OffCycleCreation"), { t: n } = r("Payroll.OffCycleDeductionsSetting"), { t: s } = r("Payroll.EmployeeSelection"), { t: p } = r("Payroll.OffCycleTaxWithholding"), { Heading: m, Text: f, Button: D } = k(), P = A(
30
+ () => W.map((l) => {
31
+ const y = {
32
+ category: l,
33
+ label: p(`wageTypeGroups.${l}.label`)
34
34
  };
35
- return (o === "regular" || o === "supplemental") && (f.description = c(`wageTypeGroups.${o}.description`)), f;
35
+ return (l === "regular" || l === "supplemental") && (y.description = p(`wageTypeGroups.${l}.description`)), y;
36
36
  }),
37
- [c]
38
- ), { setValue: u, watch: O } = w(), P = O("includeAllEmployees"), S = G(
39
- (o) => {
40
- o && u("selectedEmployeeUuids", []);
37
+ [p]
38
+ ), { setValue: h, watch: E } = G(), O = E("includeAllEmployees"), S = F(
39
+ (l) => {
40
+ l && h("selectedEmployeeUuids", []);
41
41
  },
42
- [u]
43
- ), A = [
42
+ [h]
43
+ ), v = [
44
44
  {
45
45
  value: !1,
46
- label: t("options.include.label")
46
+ label: n("options.include.label")
47
47
  },
48
48
  {
49
49
  value: !0,
50
- label: t("options.skip.label")
50
+ label: n("options.skip.label")
51
51
  }
52
52
  ];
53
- return /* @__PURE__ */ s(l, { flexDirection: "column", gap: 32, children: [
54
- /* @__PURE__ */ s(l, { flexDirection: "column", gap: 4, children: [
55
- /* @__PURE__ */ e(d, { as: "h2", children: i("pageTitle") }),
56
- /* @__PURE__ */ e(b, { variant: "supporting", children: i("pageDescription") })
53
+ return /* @__PURE__ */ t(o, { flexDirection: "column", gap: 32, children: [
54
+ /* @__PURE__ */ t(o, { flexDirection: "column", gap: 4, children: [
55
+ /* @__PURE__ */ e(m, { as: "h2", children: i("pageTitle") }),
56
+ /* @__PURE__ */ e(f, { variant: "supporting", children: i("pageDescription") })
57
57
  ] }),
58
- /* @__PURE__ */ e(l, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(W, {}) }),
59
- /* @__PURE__ */ e(l, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(j, { name: "reason" }) }),
60
- /* @__PURE__ */ s(l, { flexDirection: "column", gap: 12, children: [
61
- /* @__PURE__ */ e(d, { as: "h3", children: a("sectionTitle") }),
58
+ /* @__PURE__ */ t(o, { flexDirection: "column", gap: 20, children: [
59
+ /* @__PURE__ */ t(o, { flexDirection: "column", gap: 4, children: [
60
+ /* @__PURE__ */ e(m, { as: "h3", children: i("payPeriodSectionTitle") }),
61
+ /* @__PURE__ */ e(f, { variant: "supporting", children: i("payPeriodSectionDescription") })
62
+ ] }),
63
+ /* @__PURE__ */ e(w, {})
64
+ ] }),
65
+ /* @__PURE__ */ e("hr", { className: a.divider }),
66
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(j, { name: "reason" }) }),
67
+ /* @__PURE__ */ e("hr", { className: a.divider }),
68
+ /* @__PURE__ */ t(o, { flexDirection: "column", gap: 12, children: [
69
+ /* @__PURE__ */ e(m, { as: "h3", children: s("sectionTitle") }),
62
70
  /* @__PURE__ */ e(
63
71
  R,
64
72
  {
@@ -67,49 +75,50 @@ function ie({
67
75
  onChange: S
68
76
  }
69
77
  ),
70
- !P && /* @__PURE__ */ e(
78
+ !O && /* @__PURE__ */ e(
71
79
  I,
72
80
  {
73
81
  name: "selectedEmployeeUuids",
74
- label: a("sectionTitle"),
82
+ label: s("sectionTitle"),
75
83
  shouldVisuallyHideLabel: !0,
76
- placeholder: a("searchPlaceholder"),
77
- options: y,
78
- isLoading: h
84
+ placeholder: s("searchPlaceholder"),
85
+ options: g
79
86
  }
80
87
  )
81
88
  ] }),
82
- /* @__PURE__ */ e(l, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
83
- L,
89
+ /* @__PURE__ */ e("hr", { className: a.divider }),
90
+ /* @__PURE__ */ e(o, { flexDirection: "column", gap: 20, children: /* @__PURE__ */ e(
91
+ N,
84
92
  {
85
93
  name: "skipRegularDeductions",
86
- label: t("title"),
87
- description: t("description"),
88
- options: A,
89
- convertValueToString: (o) => String(o)
94
+ label: n("title"),
95
+ description: n("description"),
96
+ options: v,
97
+ convertValueToString: (l) => String(l)
90
98
  }
91
99
  ) }),
100
+ /* @__PURE__ */ e("hr", { className: a.divider }),
92
101
  /* @__PURE__ */ e(
93
- M,
102
+ L,
94
103
  {
95
- wageTypeGroups: E,
96
- config: m,
97
- onEditClick: C
104
+ wageTypeGroups: P,
105
+ config: u,
106
+ onEditClick: x
98
107
  }
99
108
  ),
100
- g && /* @__PURE__ */ e(
101
- V,
109
+ C && /* @__PURE__ */ e(
110
+ M,
102
111
  {
103
112
  isOpen: !0,
104
- defaultConfig: m,
105
- onDone: x,
106
- onCancel: T
113
+ defaultConfig: u,
114
+ onDone: T,
115
+ onCancel: b
107
116
  }
108
117
  ),
109
- /* @__PURE__ */ e(l, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(D, { type: "submit", isLoading: p, isDisabled: p, children: i("continueCta") }) })
118
+ /* @__PURE__ */ e(o, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(D, { type: "submit", isLoading: d, isDisabled: d, children: i("continueCta") }) })
110
119
  ] });
111
120
  }
112
121
  export {
113
- ie as OffCycleCreationPresentation
122
+ te as OffCycleCreationPresentation
114
123
  };
115
124
  //# sourceMappingURL=OffCycleCreationPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({\n employees,\n isLoadingEmployees,\n isPending,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tEmployees } = useTranslation('Payroll.EmployeeSelection')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Button } = useComponentContext()\n\n const wageTypeGroups: WageTypeGroup[] = useMemo(\n () =>\n WAGE_TYPE_CATEGORIES.map(category => {\n const group: WageTypeGroup = {\n category,\n label: tWithholding(`wageTypeGroups.${category}.label`),\n }\n if (category === 'regular' || category === 'supplemental') {\n group.description = tWithholding(`wageTypeGroups.${category}.description`)\n }\n return group\n }),\n [tWithholding],\n )\n\n const { setValue, watch } = useFormContext<OffCycleCreationFormData>()\n const includeAllEmployees = watch('includeAllEmployees')\n\n const handleToggleIncludeAll = useCallback(\n (checked: boolean) => {\n if (checked) {\n setValue('selectedEmployeeUuids', [])\n }\n },\n [setValue],\n )\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n <Flex flexDirection=\"column\" gap={12}>\n <Heading as=\"h3\">{tEmployees('sectionTitle')}</Heading>\n <SwitchField\n name=\"includeAllEmployees\"\n label={t('includeAllEmployeesLabel')}\n onChange={handleToggleIncludeAll}\n />\n {!includeAllEmployees && (\n <MultiSelectComboBoxField\n name=\"selectedEmployeeUuids\"\n label={tEmployees('sectionTitle')}\n shouldVisuallyHideLabel\n placeholder={tEmployees('searchPlaceholder')}\n options={employees}\n isLoading={isLoadingEmployees}\n />\n )}\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n <OffCycleTaxWithholdingTable\n wageTypeGroups={wageTypeGroups}\n config={taxWithholdingConfig}\n onEditClick={onTaxWithholdingEditClick}\n />\n {isTaxWithholdingModalOpen && (\n <OffCycleTaxWithholdingModal\n isOpen\n defaultConfig={taxWithholdingConfig}\n onDone={onTaxWithholdingModalDone}\n onCancel={onTaxWithholdingModalCancel}\n />\n )}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","employees","isLoadingEmployees","isPending","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tEmployees","tWithholding","Heading","Text","Button","useComponentContext","wageTypeGroups","useMemo","WAGE_TYPE_CATEGORIES","category","group","setValue","watch","useFormContext","includeAllEmployees","handleToggleIncludeAll","useCallback","checked","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","OffCycleReasonSelectionPresentation","SwitchField","MultiSelectComboBoxField","RadioGroupField","value","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":";;;;;;;;;;;;;;;;;AAmBO,SAASA,GAA6B;AAAA,EAC3C,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,6BAAAC;AACF,GAAsC;AACpC,EAAAC,EAAQ,0BAA0B,GAClCA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B,GACnCA,EAAQ,gCAAgC;AACxC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAEC,MAAmBD,EAAe,mCAAmC,GACvE,EAAE,GAAGE,MAAeF,EAAe,2BAA2B,GAC9D,EAAE,GAAGG,MAAiBH,EAAe,gCAAgC,GACrE,EAAE,SAAAI,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAkCC;AAAA,IACtC,MACEC,EAAqB,IAAI,CAAAC,MAAY;AACnC,YAAMC,IAAuB;AAAA,QAC3B,UAAAD;AAAA,QACA,OAAOR,EAAa,kBAAkBQ,CAAQ,QAAQ;AAAA,MAAA;AAExD,cAAIA,MAAa,aAAaA,MAAa,oBACzCC,EAAM,cAAcT,EAAa,kBAAkBQ,CAAQ,cAAc,IAEpEC;AAAA,IACT,CAAC;AAAA,IACH,CAACT,CAAY;AAAA,EAAA,GAGT,EAAE,UAAAU,GAAU,OAAAC,EAAA,IAAUC,EAAA,GACtBC,IAAsBF,EAAM,qBAAqB,GAEjDG,IAAyBC;AAAA,IAC7B,CAACC,MAAqB;AACpB,MAAIA,KACFN,EAAS,yBAAyB,EAAE;AAAA,IAExC;AAAA,IACA,CAACA,CAAQ;AAAA,EAAA,GAGLO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A,IAEA,gBAAAgC,EAACD,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAC;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAO3B,EAAY,OAAO;AAAA,QAC1B,aAAaA,EAAY,aAAa;AAAA,QACtC,SAASmB;AAAA,QACT,sBAAsB,CAAAS,MAAS,OAAOA,CAAK;AAAA,MAAA;AAAA,IAAA,GAE/C;AAAA,IAEA,gBAAAN;AAAA,MAACO;AAAA,MAAA;AAAA,QACC,gBAAAtB;AAAA,QACA,QAAQf;AAAA,QACR,aAAaE;AAAA,MAAA;AAAA,IAAA;AAAA,IAEdD,KACC,gBAAA6B;AAAA,MAACQ;AAAA,MAAA;AAAA,QACC,QAAM;AAAA,QACN,eAAetC;AAAA,QACf,QAAQG;AAAA,QACR,UAAUC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAIbyB,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACjB,GAAA,EAAO,MAAK,UAAS,WAAWd,GAAW,YAAYA,GACrD,UAAAO,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"OffCycleCreationPresentation.js","sources":["../../../../src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.tsx"],"sourcesContent":["import { useCallback, useMemo } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { OffCycleReasonSelectionPresentation } from '../OffCycleReasonSelection'\nimport { OffCyclePayPeriodDateFormPresentation } from '../OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation'\nimport { OffCycleTaxWithholdingTable } from '../OffCycleTaxWithholdingTable'\nimport { OffCycleTaxWithholdingModal } from '../OffCycleTaxWithholdingModal'\nimport {\n WAGE_TYPE_CATEGORIES,\n type WageTypeGroup,\n} from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type {\n OffCycleCreationFormData,\n OffCycleCreationPresentationProps,\n} from './OffCycleCreationTypes'\nimport styles from './OffCycleCreationPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex, RadioGroupField, SwitchField, MultiSelectComboBoxField } from '@/components/Common'\n\nexport function OffCycleCreationPresentation({\n employees,\n isPending,\n taxWithholdingConfig,\n isTaxWithholdingModalOpen,\n onTaxWithholdingEditClick,\n onTaxWithholdingModalDone,\n onTaxWithholdingModalCancel,\n}: OffCycleCreationPresentationProps) {\n useI18n('Payroll.OffCycleCreation')\n useI18n('Payroll.OffCycleDeductionsSetting')\n useI18n('Payroll.EmployeeSelection')\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleCreation')\n const { t: tDeductions } = useTranslation('Payroll.OffCycleDeductionsSetting')\n const { t: tEmployees } = useTranslation('Payroll.EmployeeSelection')\n const { t: tWithholding } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Heading, Text, Button } = useComponentContext()\n\n const wageTypeGroups: WageTypeGroup[] = useMemo(\n () =>\n WAGE_TYPE_CATEGORIES.map(category => {\n const group: WageTypeGroup = {\n category,\n label: tWithholding(`wageTypeGroups.${category}.label`),\n }\n if (category === 'regular' || category === 'supplemental') {\n group.description = tWithholding(`wageTypeGroups.${category}.description`)\n }\n return group\n }),\n [tWithholding],\n )\n\n const { setValue, watch } = useFormContext<OffCycleCreationFormData>()\n const includeAllEmployees = watch('includeAllEmployees')\n\n const handleToggleIncludeAll = useCallback(\n (checked: boolean) => {\n if (checked) {\n setValue('selectedEmployeeUuids', [])\n }\n },\n [setValue],\n )\n\n const deductionsOptions = [\n {\n value: false,\n label: tDeductions('options.include.label'),\n },\n {\n value: true,\n label: tDeductions('options.skip.label'),\n },\n ]\n\n return (\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h2\">{t('pageTitle')}</Heading>\n <Text variant=\"supporting\">{t('pageDescription')}</Text>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={4}>\n <Heading as=\"h3\">{t('payPeriodSectionTitle')}</Heading>\n <Text variant=\"supporting\">{t('payPeriodSectionDescription')}</Text>\n </Flex>\n <OffCyclePayPeriodDateFormPresentation />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <OffCycleReasonSelectionPresentation name=\"reason\" />\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={12}>\n <Heading as=\"h3\">{tEmployees('sectionTitle')}</Heading>\n <SwitchField\n name=\"includeAllEmployees\"\n label={t('includeAllEmployeesLabel')}\n onChange={handleToggleIncludeAll}\n />\n {!includeAllEmployees && (\n <MultiSelectComboBoxField\n name=\"selectedEmployeeUuids\"\n label={tEmployees('sectionTitle')}\n shouldVisuallyHideLabel\n placeholder={tEmployees('searchPlaceholder')}\n options={employees}\n />\n )}\n </Flex>\n\n <hr className={styles.divider} />\n\n <Flex flexDirection=\"column\" gap={20}>\n <RadioGroupField<boolean>\n name=\"skipRegularDeductions\"\n label={tDeductions('title')}\n description={tDeductions('description')}\n options={deductionsOptions}\n convertValueToString={value => String(value)}\n />\n </Flex>\n\n <hr className={styles.divider} />\n\n <OffCycleTaxWithholdingTable\n wageTypeGroups={wageTypeGroups}\n config={taxWithholdingConfig}\n onEditClick={onTaxWithholdingEditClick}\n />\n {isTaxWithholdingModalOpen && (\n <OffCycleTaxWithholdingModal\n isOpen\n defaultConfig={taxWithholdingConfig}\n onDone={onTaxWithholdingModalDone}\n onCancel={onTaxWithholdingModalCancel}\n />\n )}\n\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button type=\"submit\" isLoading={isPending} isDisabled={isPending}>\n {t('continueCta')}\n </Button>\n </Flex>\n </Flex>\n )\n}\n"],"names":["OffCycleCreationPresentation","employees","isPending","taxWithholdingConfig","isTaxWithholdingModalOpen","onTaxWithholdingEditClick","onTaxWithholdingModalDone","onTaxWithholdingModalCancel","useI18n","t","useTranslation","tDeductions","tEmployees","tWithholding","Heading","Text","Button","useComponentContext","wageTypeGroups","useMemo","WAGE_TYPE_CATEGORIES","category","group","setValue","watch","useFormContext","includeAllEmployees","handleToggleIncludeAll","useCallback","checked","deductionsOptions","jsxs","Flex","jsx","OffCyclePayPeriodDateFormPresentation","styles","OffCycleReasonSelectionPresentation","SwitchField","MultiSelectComboBoxField","RadioGroupField","value","OffCycleTaxWithholdingTable","OffCycleTaxWithholdingModal"],"mappings":";;;;;;;;;;;;;;;;;;AAoBO,SAASA,GAA6B;AAAA,EAC3C,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,6BAAAC;AACF,GAAsC;AACpC,EAAAC,EAAQ,0BAA0B,GAClCA,EAAQ,mCAAmC,GAC3CA,EAAQ,2BAA2B,GACnCA,EAAQ,gCAAgC;AACxC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,0BAA0B,GACjD,EAAE,GAAGC,MAAgBD,EAAe,mCAAmC,GACvE,EAAE,GAAGE,MAAeF,EAAe,2BAA2B,GAC9D,EAAE,GAAGG,MAAiBH,EAAe,gCAAgC,GACrE,EAAE,SAAAI,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAA,GAE5BC,IAAkCC;AAAA,IACtC,MACEC,EAAqB,IAAI,CAAAC,MAAY;AACnC,YAAMC,IAAuB;AAAA,QAC3B,UAAAD;AAAA,QACA,OAAOR,EAAa,kBAAkBQ,CAAQ,QAAQ;AAAA,MAAA;AAExD,cAAIA,MAAa,aAAaA,MAAa,oBACzCC,EAAM,cAAcT,EAAa,kBAAkBQ,CAAQ,cAAc,IAEpEC;AAAA,IACT,CAAC;AAAA,IACH,CAACT,CAAY;AAAA,EAAA,GAGT,EAAE,UAAAU,GAAU,OAAA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;AAAA,IAAA;AAAA,sBAIbyB,GAAA,EAAK,gBAAe,YAAW,KAAK,IACnC,UAAA,gBAAAC,EAACjB,GAAA,EAAO,MAAK,UAAS,WAAWd,GAAW,YAAYA,GACrD,UAAAO,EAAE,aAAa,GAClB,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -0,0 +1,8 @@
1
+ const d = "_divider_bmae3_1", e = {
2
+ divider: d
3
+ };
4
+ export {
5
+ e as default,
6
+ d as divider
7
+ };
8
+ //# sourceMappingURL=OffCycleCreationPresentation.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OffCycleCreationPresentation.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -15,7 +15,6 @@ export interface OffCycleCreationFormData extends OffCyclePayPeriodDateFormData
15
15
  }
16
16
  export interface OffCycleCreationPresentationProps {
17
17
  employees: MultiSelectComboBoxOption[];
18
- isLoadingEmployees: boolean;
19
18
  isPending?: boolean;
20
19
  taxWithholdingConfig: OffCycleTaxWithholdingConfig;
21
20
  isTaxWithholdingModalOpen: boolean;
@@ -1,12 +1,12 @@
1
- const e = "_root_erc2u_1", t = "_dateFields_erc2u_7", c = "_checkDateField_erc2u_16", o = {
1
+ const e = "_root_1g8u9_1", t = "_dateFields_1g8u9_7", o = "_checkDateField_1g8u9_16", c = {
2
2
  root: e,
3
3
  dateFields: t,
4
- checkDateField: c
4
+ checkDateField: o
5
5
  };
6
6
  export {
7
- c as checkDateField,
7
+ o as checkDateField,
8
8
  t as dateFields,
9
- o as default,
9
+ c as default,
10
10
  e as root
11
11
  };
12
12
  //# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.module.scss.js.map
@@ -31,14 +31,14 @@ const r = (t, c, i) => s.object({
31
31
  path: ["checkDate"],
32
32
  message: t("validations.checkDateRequired")
33
33
  });
34
- else if (!e.isCheckOnly) {
34
+ else {
35
35
  const o = new Date(e.checkDate);
36
36
  o.setHours(0, 0, 0, 0);
37
37
  const d = new Date(i);
38
38
  d.setHours(0, 0, 0, 0), o < d && a.addIssue({
39
39
  code: s.ZodIssueCode.custom,
40
40
  path: ["checkDate"],
41
- message: t("validations.checkDateAchLeadTime")
41
+ message: e.isCheckOnly ? t("validations.checkDateNotPast") : t("validations.checkDateAchLeadTime")
42
42
  });
43
43
  }
44
44
  });
@@ -1 +1 @@
1
- {"version":3,"file":"OffCyclePayPeriodDateFormTypes.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type OffCyclePayrollDateType = 'bonus' | 'correction'\n\nexport interface OffCyclePayPeriodDateFormData {\n isCheckOnly: boolean\n startDate: Date | null\n endDate: Date | null\n checkDate: Date | null\n}\n\nexport const createOffCyclePayPeriodDateFormSchema = (\n t: (key: string) => string,\n payrollType: OffCyclePayrollDateType,\n minCheckDate: Date,\n) => {\n return z\n .object({\n isCheckOnly: z.boolean(),\n startDate: z.date().nullable(),\n endDate: z.date().nullable(),\n checkDate: z.date().nullable(),\n })\n .superRefine((data, ctx) => {\n if (!data.isCheckOnly) {\n if (!data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateRequired'),\n })\n }\n\n if (!data.endDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateRequired'),\n })\n }\n\n if (data.startDate && data.endDate && data.endDate < data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateAfterStart'),\n })\n }\n\n if (payrollType === 'correction' && data.startDate) {\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n if (data.startDate > today) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateNotFuture'),\n })\n }\n }\n }\n\n if (!data.checkDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateRequired'),\n })\n } else if (!data.isCheckOnly) {\n const checkDateNormalized = new Date(data.checkDate)\n checkDateNormalized.setHours(0, 0, 0, 0)\n const minCheckDateNormalized = new Date(minCheckDate)\n minCheckDateNormalized.setHours(0, 0, 0, 0)\n\n if (checkDateNormalized < minCheckDateNormalized) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateAchLeadTime'),\n })\n }\n }\n })\n}\n\nexport type OffCyclePayPeriodDateFormSchema = ReturnType<\n typeof createOffCyclePayPeriodDateFormSchema\n>\n"],"names":["createOffCyclePayPeriodDateFormSchema","payrollType","minCheckDate","z","data","ctx","today","checkDateNormalized","minCheckDateNormalized"],"mappings":";AAWO,MAAMA,IAAwC,CACnD,GACAC,GACAC,MAEOC,EACJ,OAAO;AAAA,EACN,aAAaA,EAAE,QAAA;AAAA,EACf,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAA,EACpB,SAASA,EAAE,KAAA,EAAO,SAAA;AAAA,EAClB,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAS,CAC9B,EACA,YAAY,CAACC,GAAMC,MAAQ;AAC1B,MAAI,CAACD,EAAK,gBACHA,EAAK,aACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,WAAW;AAAA,IAClB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGEC,EAAK,WACRC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,6BAA6B;AAAA,EAAA,CACzC,GAGCC,EAAK,aAAaA,EAAK,WAAWA,EAAK,UAAUA,EAAK,aACxDC,EAAI,SAAS;AAAA,IACX,MAAMF,EAAE,aAAa;AAAA,IACrB,MAAM,CAAC,SAAS;AAAA,IAChB,SAAS,EAAE,+BAA+B;AAAA,EAAA,CAC3C,GAGCF,MAAgB,gBAAgBG,EAAK,YAAW;AAClD,UAAME,wBAAY,KAAA;AAClB,IAAAA,EAAM,SAAS,GAAG,GAAG,GAAG,CAAC,GACrBF,EAAK,YAAYE,KACnBD,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,gCAAgC;AAAA,IAAA,CAC5C;AAAA,EAEL;AAGF,MAAI,CAACC,EAAK;AACR,IAAAC,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,+BAA+B;AAAA,IAAA,CAC3C;AAAA,WACQ,CAACC,EAAK,aAAa;AAC5B,UAAMG,IAAsB,IAAI,KAAKH,EAAK,SAAS;AACnD,IAAAG,EAAoB,SAAS,GAAG,GAAG,GAAG,CAAC;AACvC,UAAMC,IAAyB,IAAI,KAAKN,CAAY;AACpD,IAAAM,EAAuB,SAAS,GAAG,GAAG,GAAG,CAAC,GAEtCD,IAAsBC,KACxBH,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAAS,EAAE,kCAAkC;AAAA,IAAA,CAC9C;AAAA,EAEL;AACF,CAAC;"}
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormTypes.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport type OffCyclePayrollDateType = 'bonus' | 'correction'\n\nexport interface OffCyclePayPeriodDateFormData {\n isCheckOnly: boolean\n startDate: Date | null\n endDate: Date | null\n checkDate: Date | null\n}\n\nexport const createOffCyclePayPeriodDateFormSchema = (\n t: (key: string) => string,\n payrollType: OffCyclePayrollDateType,\n minCheckDate: Date,\n) => {\n return z\n .object({\n isCheckOnly: z.boolean(),\n startDate: z.date().nullable(),\n endDate: z.date().nullable(),\n checkDate: z.date().nullable(),\n })\n .superRefine((data, ctx) => {\n if (!data.isCheckOnly) {\n if (!data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateRequired'),\n })\n }\n\n if (!data.endDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateRequired'),\n })\n }\n\n if (data.startDate && data.endDate && data.endDate < data.startDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['endDate'],\n message: t('validations.endDateAfterStart'),\n })\n }\n\n if (payrollType === 'correction' && data.startDate) {\n const today = new Date()\n today.setHours(0, 0, 0, 0)\n if (data.startDate > today) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['startDate'],\n message: t('validations.startDateNotFuture'),\n })\n }\n }\n }\n\n if (!data.checkDate) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: t('validations.checkDateRequired'),\n })\n } else {\n const checkDateNormalized = new Date(data.checkDate)\n checkDateNormalized.setHours(0, 0, 0, 0)\n const minCheckDateNormalized = new Date(minCheckDate)\n minCheckDateNormalized.setHours(0, 0, 0, 0)\n\n if (checkDateNormalized < minCheckDateNormalized) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['checkDate'],\n message: data.isCheckOnly\n ? t('validations.checkDateNotPast')\n : t('validations.checkDateAchLeadTime'),\n })\n }\n }\n })\n}\n\nexport type OffCyclePayPeriodDateFormSchema = ReturnType<\n typeof createOffCyclePayPeriodDateFormSchema\n>\n"],"names":["createOffCyclePayPeriodDateFormSchema","payrollType","minCheckDate","z","data","ctx","today","checkDateNormalized","minCheckDateNormalized"],"mappings":";AAWO,MAAMA,IAAwC,CACnD,GACAC,GACAC,MAEOC,EACJ,OAAO;AAAA,EACN,aAAaA,EAAE,QAAA;AAAA,EACf,WAAWA,EAAE,KAAA,EAAO,SAAA;AAAA,EACpB,SAASA,EAAE,KAAA,EAAO,SAAA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ACxBH,EAAI,SAAS;AAAA,MACX,MAAMF,EAAE,aAAa;AAAA,MACrB,MAAM,CAAC,WAAW;AAAA,MAClB,SAASC,EAAK,cACV,EAAE,8BAA8B,IAChC,EAAE,kCAAkC;AAAA,IAAA,CACzC;AAAA,EAEL;AACF,CAAC;"}
@@ -1,3 +1,4 @@
1
+ export declare const ACH_LEAD_TIME_BUSINESS_DAYS = 2;
1
2
  export declare function useOffCyclePayPeriodDateValidation(): {
2
3
  today: Date;
3
4
  minCheckDate: Date;
@@ -13,6 +13,7 @@ function u() {
13
13
  };
14
14
  }
15
15
  export {
16
+ s as ACH_LEAD_TIME_BUSINESS_DAYS,
16
17
  u as useOffCyclePayPeriodDateValidation
17
18
  };
18
19
  //# sourceMappingURL=useOffCyclePayPeriodDateValidation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOffCyclePayPeriodDateValidation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { addBusinessDays } from '@/helpers/dateFormatting'\n\nconst ACH_LEAD_TIME_BUSINESS_DAYS = 2\n\nexport function useOffCyclePayPeriodDateValidation() {\n const today = useMemo(() => {\n const now = new Date()\n now.setHours(0, 0, 0, 0)\n return now\n }, [])\n\n const minCheckDate = useMemo(() => {\n return addBusinessDays(today, ACH_LEAD_TIME_BUSINESS_DAYS)\n }, [today])\n\n return {\n today,\n minCheckDate,\n achLeadTimeBusinessDays: ACH_LEAD_TIME_BUSINESS_DAYS,\n }\n}\n"],"names":["ACH_LEAD_TIME_BUSINESS_DAYS","useOffCyclePayPeriodDateValidation","today","useMemo","now","minCheckDate","addBusinessDays"],"mappings":";;AAGA,MAAMA,IAA8B;AAE7B,SAASC,IAAqC;AACnD,QAAMC,IAAQC,EAAQ,MAAM;AAC1B,UAAMC,wBAAU,KAAA;AAChB,WAAAA,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GAChBA;AAAA,EACT,GAAG,CAAA,CAAE,GAECC,IAAeF,EAAQ,MACpBG,EAAgBJ,GAAOF,CAA2B,GACxD,CAACE,CAAK,CAAC;AAEV,SAAO;AAAA,IACL,OAAAA;AAAA,IACA,cAAAG;AAAA,IACA,yBAAyBL;AAAA,EAAA;AAE7B;"}
1
+ {"version":3,"file":"useOffCyclePayPeriodDateValidation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { addBusinessDays } from '@/helpers/dateFormatting'\n\nexport const ACH_LEAD_TIME_BUSINESS_DAYS = 2\n\nexport function useOffCyclePayPeriodDateValidation() {\n const today = useMemo(() => {\n const now = new Date()\n now.setHours(0, 0, 0, 0)\n return now\n }, [])\n\n const minCheckDate = useMemo(() => {\n return addBusinessDays(today, ACH_LEAD_TIME_BUSINESS_DAYS)\n }, [today])\n\n return {\n today,\n minCheckDate,\n achLeadTimeBusinessDays: ACH_LEAD_TIME_BUSINESS_DAYS,\n }\n}\n"],"names":["ACH_LEAD_TIME_BUSINESS_DAYS","useOffCyclePayPeriodDateValidation","today","useMemo","now","minCheckDate","addBusinessDays"],"mappings":";;AAGO,MAAMA,IAA8B;AAEpC,SAASC,IAAqC;AACnD,QAAMC,IAAQC,EAAQ,MAAM;AAC1B,UAAMC,wBAAU,KAAA;AAChB,WAAAA,EAAI,SAAS,GAAG,GAAG,GAAG,CAAC,GAChBA;AAAA,EACT,GAAG,CAAA,CAAE,GAECC,IAAeF,EAAQ,MACpBG,EAAgBJ,GAAOF,CAA2B,GACxD,CAACE,CAAK,CAAC;AAEV,SAAO;AAAA,IACL,OAAAA;AAAA,IACA,cAAAG;AAAA,IACA,yBAAyBL;AAAA,EAAA;AAE7B;"}