@gusto/embedded-react-sdk 0.44.2 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (593) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js +7 -7
  3. package/dist/components/Common/DetailViewLayout/DetailViewLayout.js.map +1 -1
  4. package/dist/components/Common/UI/Alert/Alert.js +24 -23
  5. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  6. package/dist/components/Common/UI/Alert/Alert.module.scss.js +16 -14
  7. package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
  8. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +8 -0
  9. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +38 -38
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -20
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/Head.js +12 -9
  15. package/dist/components/Company/AssignSignatory/Head.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +25 -25
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -20
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -22
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  22. package/dist/components/Company/BankAccount/BankAccountForm/Head.js +11 -8
  23. package/dist/components/Company/BankAccount/BankAccountForm/Head.js.map +1 -1
  24. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -20
  25. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountList/Head.js +44 -39
  27. package/dist/components/Company/BankAccount/BankAccountList/Head.js.map +1 -1
  28. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -20
  29. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  30. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +26 -26
  31. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  32. package/dist/components/Company/FederalTaxes/FederalTaxes.js +9 -9
  33. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  34. package/dist/components/Company/FederalTaxes/Head.js +7 -6
  35. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -28
  37. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  38. package/dist/components/Company/Industry/Context.js +7 -23
  39. package/dist/components/Company/Industry/Context.js.map +1 -1
  40. package/dist/components/Company/Industry/Head.js +10 -9
  41. package/dist/components/Company/Industry/Head.js.map +1 -1
  42. package/dist/components/Company/Industry/IndustrySelect.js +22 -19
  43. package/dist/components/Company/Industry/IndustrySelect.js.map +1 -1
  44. package/dist/components/Company/Locations/LocationForm/Head.js +9 -8
  45. package/dist/components/Company/Locations/LocationForm/Head.js.map +1 -1
  46. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -20
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  48. package/dist/components/Company/Locations/LocationsList/Head.js +11 -10
  49. package/dist/components/Company/Locations/LocationsList/Head.js.map +1 -1
  50. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -11
  51. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  52. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -20
  53. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  54. package/dist/components/Company/OnboardingOverview/context.js +4 -20
  55. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  56. package/dist/components/Company/PaySchedule/PayScheduleList.js +18 -18
  57. package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
  58. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -20
  59. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  60. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -20
  61. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  62. package/dist/components/Contractor/Address/useAddress.js +6 -22
  63. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  64. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +1 -1
  65. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  66. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +7 -7
  67. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  68. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -2
  69. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  70. package/dist/components/Contractor/Profile/useContractorProfile.js +42 -52
  71. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  72. package/dist/components/Employee/Compensation/index.d.ts +1 -1
  73. package/dist/components/Employee/Compensation/{Compensation.d.ts → onboarding/Compensation.d.ts} +3 -3
  74. package/dist/components/Employee/Compensation/onboarding/Compensation.js +88 -0
  75. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -0
  76. package/dist/components/Employee/Compensation/{CompensationFlowComponents.d.ts → onboarding/CompensationFlowComponents.d.ts} +3 -3
  77. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js +59 -0
  78. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -0
  79. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +21 -0
  80. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +249 -0
  81. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -0
  82. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js +8 -0
  83. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.module.scss.js.map +1 -0
  84. package/dist/components/Employee/Compensation/onboarding/EditCompensation/index.d.ts +3 -0
  85. package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsList.d.ts +1 -1
  86. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +43 -0
  87. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -0
  88. package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.js +10 -10
  89. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -0
  90. package/dist/components/Employee/Compensation/{compensationStateMachine.js → onboarding/compensationStateMachine.js} +1 -1
  91. package/dist/components/Employee/Compensation/onboarding/compensationStateMachine.js.map +1 -0
  92. package/dist/components/Employee/Compensation/onboarding/index.d.ts +2 -0
  93. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +9 -0
  94. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js +10 -0
  95. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -0
  96. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +7 -0
  97. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +41 -35
  98. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  99. package/dist/components/Employee/Compensation/shared/useCompensationForm/index.d.ts +0 -2
  100. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +24 -3
  101. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +193 -181
  102. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  103. package/dist/components/Employee/Compensation/shared/useJobForm/index.d.ts +0 -2
  104. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
  105. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +14 -13
  106. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
  107. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +19 -2
  108. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +133 -130
  109. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  110. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +13 -0
  111. package/dist/components/Employee/Dashboard/BasicDetailsView.js +87 -65
  112. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  113. package/dist/components/Employee/Dashboard/CompensationCard.d.ts +13 -0
  114. package/dist/components/Employee/Dashboard/Dashboard.js +89 -109
  115. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  116. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +15 -0
  117. package/dist/components/Employee/Dashboard/DashboardComponents.js +120 -25
  118. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  119. package/dist/components/Employee/Dashboard/DocumentsView.d.ts +11 -0
  120. package/dist/components/Employee/Dashboard/DocumentsView.js +24 -17
  121. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
  122. package/dist/components/Employee/Dashboard/JobAndPayView.d.ts +9 -17
  123. package/dist/components/Employee/Dashboard/JobAndPayView.js +495 -114
  124. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  125. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.d.ts +10 -0
  126. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js +64 -0
  127. package/dist/components/Employee/Dashboard/PendingChangesReviewModal.js.map +1 -0
  128. package/dist/components/Employee/Dashboard/TaxesView.d.ts +13 -0
  129. package/dist/components/Employee/Dashboard/TaxesView.js +82 -60
  130. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  131. package/dist/components/Employee/Dashboard/dashboardStateMachine.d.ts +7 -0
  132. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +227 -40
  133. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  134. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +50 -0
  135. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +57 -0
  136. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -0
  137. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.test.d.ts +1 -0
  138. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +7 -4
  139. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
  140. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +14 -8
  141. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +60 -36
  142. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  143. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.d.ts +8 -0
  144. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js +61 -0
  145. package/dist/components/Employee/Dashboard/usePendingChangeDetailRenderer.js.map +1 -0
  146. package/dist/components/Employee/Deductions/Deductions.d.ts +2 -8
  147. package/dist/components/Employee/Deductions/Deductions.js +25 -52
  148. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  149. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.d.ts +9 -0
  150. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js +137 -0
  151. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.js.map +1 -0
  152. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +9 -5
  153. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +97 -94
  154. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  155. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.d.ts +18 -0
  156. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js +137 -0
  157. package/dist/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.js.map +1 -0
  158. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.d.ts +10 -5
  159. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +57 -77
  160. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  161. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +5 -5
  162. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +29 -39
  163. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  164. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +8 -6
  165. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -1
  166. package/dist/components/Employee/Deductions/{DeductionsComponents.d.ts → deductionsContextualComponents.d.ts} +7 -8
  167. package/dist/components/Employee/Deductions/deductionsContextualComponents.js +74 -0
  168. package/dist/components/Employee/Deductions/deductionsContextualComponents.js.map +1 -0
  169. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +7 -0
  170. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js +31 -0
  171. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -0
  172. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +7 -0
  173. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js +10 -0
  174. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -0
  175. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.test.d.ts +1 -0
  176. package/dist/components/Employee/Deductions/shared/index.d.ts +7 -0
  177. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +63 -0
  178. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +64 -0
  179. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -0
  180. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +36 -0
  181. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +39 -0
  182. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -0
  183. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/index.d.ts +4 -0
  184. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +62 -0
  185. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +208 -0
  186. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -0
  187. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.d.ts +63 -0
  188. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +52 -0
  189. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -0
  190. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +25 -0
  191. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +36 -0
  192. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -0
  193. package/dist/components/Employee/Deductions/shared/useDeductionForm/index.d.ts +4 -0
  194. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +64 -0
  195. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +203 -0
  196. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -0
  197. package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +22 -0
  198. package/dist/components/Employee/Deductions/shared/useDeductionsList.js +50 -0
  199. package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -0
  200. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +13 -0
  201. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js +17 -0
  202. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -0
  203. package/dist/components/Employee/Deductions/stateMachine.d.ts +4 -5
  204. package/dist/components/Employee/Deductions/stateMachine.js +67 -89
  205. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  206. package/dist/components/Employee/Documents/management/DocumentManager.d.ts +6 -0
  207. package/dist/components/Employee/Documents/management/DocumentManager.js +60 -0
  208. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -0
  209. package/dist/components/Employee/Documents/management/index.d.ts +3 -0
  210. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.js +3 -3
  211. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Actions.js.map +1 -0
  212. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.d.ts +1 -1
  213. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/DocumentList.js +5 -5
  214. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
  215. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.js +1 -1
  216. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/Head.js.map +1 -0
  217. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.js +3 -3
  218. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -0
  219. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +8 -0
  220. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
  221. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.d.ts +1 -1
  222. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentSigner.js +5 -5
  223. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -0
  224. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.d.ts +1 -1
  225. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibility.js +4 -4
  226. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -0
  227. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.js +11 -11
  228. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -0
  229. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -0
  230. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts +1 -0
  231. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/countries.js.map +1 -0
  232. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.d.ts +1 -1
  233. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.js +13 -13
  234. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -0
  235. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.d.ts +2 -2
  236. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/documentSignerStateMachine.js +8 -8
  237. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  238. package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.js +1 -1
  239. package/dist/components/Employee/Documents/onboarding/DocumentSigner/stateMachine.js.map +1 -0
  240. package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.d.ts +3 -3
  241. package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocuments.js +6 -6
  242. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -0
  243. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js +117 -0
  244. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -0
  245. package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.d.ts +1 -1
  246. package/dist/components/Employee/{DocumentSigner → Documents/shared}/SignatureForm/SignatureForm.js +14 -14
  247. package/dist/components/Employee/Documents/shared/SignatureForm/SignatureForm.js.map +1 -0
  248. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js.map +1 -0
  249. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +1 -0
  250. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -0
  251. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +89 -82
  252. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js.map +1 -1
  253. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +37 -35
  254. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  255. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.d.ts +1 -0
  256. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js +14 -8
  257. package/dist/components/Employee/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  258. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +38 -39
  259. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  260. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +29 -27
  261. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  262. package/dist/components/Employee/PaymentMethod/index.d.ts +1 -1
  263. package/dist/components/Employee/PaymentMethod/management/ListView.d.ts +8 -0
  264. package/dist/components/Employee/PaymentMethod/management/ListView.js +138 -0
  265. package/dist/components/Employee/PaymentMethod/management/ListView.js.map +1 -0
  266. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.d.ts +11 -0
  267. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js +49 -0
  268. package/dist/components/Employee/PaymentMethod/management/PaymentMethod.js.map +1 -0
  269. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.d.ts +8 -0
  270. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js +23 -0
  271. package/dist/components/Employee/PaymentMethod/management/PaymentMethodComponents.js.map +1 -0
  272. package/dist/components/Employee/PaymentMethod/management/index.d.ts +4 -0
  273. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.d.ts +5 -0
  274. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js +75 -0
  275. package/dist/components/Employee/PaymentMethod/management/paymentMethodStateMachine.js.map +1 -0
  276. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.d.ts +8 -0
  277. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +66 -0
  278. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js.map +1 -0
  279. package/dist/components/Employee/PaymentMethod/onboarding/ListView.d.ts +9 -0
  280. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js +168 -0
  281. package/dist/components/Employee/PaymentMethod/onboarding/ListView.js.map +1 -0
  282. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.d.ts +11 -0
  283. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js +44 -0
  284. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethod.js.map +1 -0
  285. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.d.ts +8 -0
  286. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js +23 -0
  287. package/dist/components/Employee/PaymentMethod/onboarding/PaymentMethodComponents.js.map +1 -0
  288. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.d.ts +8 -0
  289. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js +97 -0
  290. package/dist/components/Employee/PaymentMethod/onboarding/SplitView.js.map +1 -0
  291. package/dist/components/Employee/PaymentMethod/onboarding/index.d.ts +2 -0
  292. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.d.ts +5 -0
  293. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js +75 -0
  294. package/dist/components/Employee/PaymentMethod/onboarding/paymentMethodStateMachine.js.map +1 -0
  295. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.d.ts +9 -0
  296. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js +31 -0
  297. package/dist/components/Employee/PaymentMethod/shared/DeleteBankAccountDialog.js.map +1 -0
  298. package/dist/components/Employee/PaymentMethod/shared/index.d.ts +7 -0
  299. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.d.ts +15 -0
  300. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +22 -0
  301. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js.map +1 -0
  302. package/dist/components/Employee/PaymentMethod/shared/useBankForm/index.d.ts +5 -0
  303. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +37 -0
  304. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +105 -0
  305. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -0
  306. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.d.ts +39 -0
  307. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js +26 -0
  308. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankFormSchema.js.map +1 -0
  309. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.d.ts +13 -0
  310. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js +19 -0
  311. package/dist/components/Employee/PaymentMethod/shared/useDeleteBankAccount.js.map +1 -0
  312. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.d.ts +6 -0
  313. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js +9 -0
  314. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/fields.js.map +1 -0
  315. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/index.d.ts +5 -0
  316. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +31 -0
  317. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +94 -0
  318. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -0
  319. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.d.ts +31 -0
  320. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js +22 -0
  321. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodFormSchema.js.map +1 -0
  322. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +20 -0
  323. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +68 -0
  324. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -0
  325. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.d.ts +6 -0
  326. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js +9 -0
  327. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/fields.js.map +1 -0
  328. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/index.d.ts +6 -0
  329. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.d.ts +48 -0
  330. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +46 -0
  331. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js.map +1 -0
  332. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +65 -0
  333. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +209 -0
  334. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -0
  335. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.d.ts +53 -0
  336. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js +93 -0
  337. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsFormSchema.js.map +1 -0
  338. package/dist/components/Employee/Profile/onboarding/AdminProfile.js +88 -87
  339. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  340. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js +2 -2
  341. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  342. package/dist/components/Employee/Taxes/FederalForm.js +27 -26
  343. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  344. package/dist/components/Employee/Taxes/FederalHead.js +13 -10
  345. package/dist/components/Employee/Taxes/FederalHead.js.map +1 -1
  346. package/dist/components/Employee/Taxes/StateForm.js +17 -14
  347. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  348. package/dist/components/Employee/Taxes/Taxes.js +75 -69
  349. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  350. package/dist/components/Employee/Taxes/useTaxes.js +4 -20
  351. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  352. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +26 -26
  353. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  354. package/dist/components/Employee/exports/employeeManagement.d.ts +4 -1
  355. package/dist/components/Employee/exports/employeeManagement.js +22 -18
  356. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  357. package/dist/components/Employee/exports/employeeOnboarding.d.ts +3 -3
  358. package/dist/components/Employee/exports/employeeOnboarding.js +4 -4
  359. package/dist/components/Employee/index.d.ts +4 -4
  360. package/dist/components/Employee/index.js +5 -5
  361. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +26 -34
  362. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  363. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +35 -35
  364. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  365. package/dist/components/Payroll/usePreparedPayrollData.js +22 -36
  366. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  367. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +84 -82
  368. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  369. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.d.ts +1 -1
  370. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js +49 -48
  371. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.js.map +1 -1
  372. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailTypes.d.ts +1 -0
  373. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +39 -37
  374. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  375. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js +31 -31
  376. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormPresentation.js.map +1 -1
  377. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionFormTypes.d.ts +1 -0
  378. package/dist/components/TimeOff/PolicyList/PolicyList.js +27 -27
  379. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  380. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +50 -50
  381. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  382. package/dist/components/TimeOff/PolicySettings/PolicySettings.d.ts +1 -0
  383. package/dist/components/TimeOff/PolicySettings/PolicySettings.js +66 -41
  384. package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
  385. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.d.ts +1 -1
  386. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +59 -48
  387. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
  388. package/dist/components/TimeOff/PolicySettings/PolicySettingsTypes.d.ts +3 -0
  389. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js +34 -33
  390. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelectorPresentation.js.map +1 -1
  391. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +3 -0
  392. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js +69 -61
  393. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  394. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +119 -75
  395. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  396. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +72 -61
  397. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  398. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  399. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +103 -84
  400. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  401. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  402. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +51 -49
  403. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  404. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  405. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +78 -59
  406. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  407. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js +8 -0
  408. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.module.scss.js.map +1 -0
  409. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +6 -2
  410. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +209 -154
  411. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  412. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.d.ts +3 -1
  413. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +36 -34
  414. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  415. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +136 -134
  416. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  417. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.module.scss.js +6 -6
  418. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.d.ts +1 -1
  419. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js +63 -65
  420. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailPresentation.js.map +1 -1
  421. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetailTypes.d.ts +1 -0
  422. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +50 -49
  423. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  424. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.module.scss.js +4 -4
  425. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.d.ts +1 -1
  426. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js +66 -55
  427. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayout.js.map +1 -1
  428. package/dist/components/TimeOff/shared/PolicyDetailLayout/PolicyDetailLayoutTypes.d.ts +1 -0
  429. package/dist/contexts/ApiProvider/ApiProvider.js +33 -39
  430. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  431. package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +17 -0
  432. package/dist/contexts/ApiProvider/createSdkQueryClient.js +14 -0
  433. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -0
  434. package/dist/helpers/formattedStrings.d.ts +12 -0
  435. package/dist/helpers/formattedStrings.js +55 -33
  436. package/dist/helpers/formattedStrings.js.map +1 -1
  437. package/dist/hooks/useClientPagination/useClientPagination.d.ts +44 -0
  438. package/dist/hooks/useClientPagination/useClientPagination.js +69 -0
  439. package/dist/hooks/useClientPagination/useClientPagination.js.map +1 -0
  440. package/dist/hooks/useClientPagination/useClientPagination.test.d.ts +1 -0
  441. package/dist/i18n/I18n.js +6 -5
  442. package/dist/i18n/I18n.js.map +1 -1
  443. package/dist/i18n/en/Company.PaySchedule.json.js +22 -20
  444. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  445. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js +8 -6
  446. package/dist/i18n/en/Company.TimeOff.CreateTimeOffPolicy.json.js.map +1 -1
  447. package/dist/i18n/en/Company.TimeOff.HolidayPolicy.json.js +9 -9
  448. package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js +6 -4
  449. package/dist/i18n/en/Company.TimeOff.PolicyDetail.json.js.map +1 -1
  450. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +17 -15
  451. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js.map +1 -1
  452. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js +10 -8
  453. package/dist/i18n/en/Company.TimeOff.SelectPolicyType.json.js.map +1 -1
  454. package/dist/i18n/en/Employee.Dashboard.json.js +16 -12
  455. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  456. package/dist/i18n/en/Employee.Deductions.json.js +104 -76
  457. package/dist/i18n/en/Employee.Deductions.json.js.map +1 -1
  458. package/dist/i18n/en/Employee.DocumentManager.json.js +12 -0
  459. package/dist/i18n/en/Employee.DocumentManager.json.js.map +1 -0
  460. package/dist/i18n/en/Employee.PaymentMethod.json.js +76 -64
  461. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  462. package/dist/i18n/en/common.json.d.ts +7 -0
  463. package/dist/i18n/en/common.json.js +19 -17
  464. package/dist/i18n/en/common.json.js.map +1 -1
  465. package/dist/index.d.ts +16 -6
  466. package/dist/index.js +138 -112
  467. package/dist/index.js.map +1 -1
  468. package/dist/partner-hook-utils/form/fields/NumberInputHookField.d.ts +2 -1
  469. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js +20 -18
  470. package/dist/partner-hook-utils/form/fields/NumberInputHookField.js.map +1 -1
  471. package/dist/shared/constants.d.ts +8 -2
  472. package/dist/shared/constants.js +11 -8
  473. package/dist/shared/constants.js.map +1 -1
  474. package/dist/style.css +1 -1
  475. package/dist/test-utils/assertions.d.ts +16 -0
  476. package/dist/types/i18next.d.ts +140 -4
  477. package/dist/types/sdkError.js +58 -47
  478. package/dist/types/sdkError.js.map +1 -1
  479. package/docs/reference/endpoint-inventory.json +980 -1170
  480. package/package.json +29 -21
  481. package/dist/components/Employee/Compensation/Compensation.js +0 -87
  482. package/dist/components/Employee/Compensation/Compensation.js.map +0 -1
  483. package/dist/components/Employee/Compensation/CompensationFlowComponents.js +0 -61
  484. package/dist/components/Employee/Compensation/CompensationFlowComponents.js.map +0 -1
  485. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.d.ts +0 -14
  486. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js +0 -128
  487. package/dist/components/Employee/Compensation/EditCompensation/EditCompensation.js.map +0 -1
  488. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.d.ts +0 -17
  489. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js +0 -224
  490. package/dist/components/Employee/Compensation/EditCompensation/EditCompensationPresentation.js.map +0 -1
  491. package/dist/components/Employee/Compensation/EditCompensation/index.d.ts +0 -5
  492. package/dist/components/Employee/Compensation/JobsList/JobsList.js +0 -47
  493. package/dist/components/Employee/Compensation/JobsList/JobsList.js.map +0 -1
  494. package/dist/components/Employee/Compensation/JobsList/JobsListPresentation.js.map +0 -1
  495. package/dist/components/Employee/Compensation/compensationSchema.d.ts +0 -29
  496. package/dist/components/Employee/Compensation/compensationSchema.js +0 -63
  497. package/dist/components/Employee/Compensation/compensationSchema.js.map +0 -1
  498. package/dist/components/Employee/Compensation/compensationStateMachine.js.map +0 -1
  499. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.d.ts +0 -15
  500. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js +0 -27
  501. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCurrentCompensationForm.js.map +0 -1
  502. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.d.ts +0 -13
  503. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js +0 -26
  504. package/dist/components/Employee/Compensation/shared/useJobForm/useCurrentJobForm.js.map +0 -1
  505. package/dist/components/Employee/Deductions/Actions.d.ts +0 -1
  506. package/dist/components/Employee/Deductions/DeductionsComponents.js +0 -31
  507. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +0 -1
  508. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.d.ts +0 -39
  509. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +0 -237
  510. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +0 -1
  511. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +0 -22
  512. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +0 -162
  513. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +0 -1
  514. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.d.ts +0 -34
  515. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +0 -168
  516. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +0 -1
  517. package/dist/components/Employee/Deductions/Head.d.ts +0 -1
  518. package/dist/components/Employee/Deductions/useDeductions.d.ts +0 -30
  519. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +0 -1
  520. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +0 -1
  521. package/dist/components/Employee/DocumentSigner/DocumentList/Head.js.map +0 -1
  522. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +0 -1
  523. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +0 -24
  524. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +0 -1
  525. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +0 -1
  526. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +0 -1
  527. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +0 -1
  528. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +0 -1
  529. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/countries.js.map +0 -1
  530. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +0 -1
  531. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +0 -1
  532. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +0 -1
  533. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/fields.js.map +0 -1
  534. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/signEmployeeFormSchema.js.map +0 -1
  535. package/dist/components/Employee/DocumentSigner/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +0 -1
  536. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +0 -1
  537. package/dist/components/Employee/EmployeeDocuments/EmployeeDocuments.js.map +0 -1
  538. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +0 -115
  539. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +0 -1
  540. package/dist/components/Employee/PaymentMethod/Actions.d.ts +0 -1
  541. package/dist/components/Employee/PaymentMethod/Actions.js +0 -20
  542. package/dist/components/Employee/PaymentMethod/Actions.js.map +0 -1
  543. package/dist/components/Employee/PaymentMethod/BankAccount.d.ts +0 -13
  544. package/dist/components/Employee/PaymentMethod/BankAccount.js +0 -13
  545. package/dist/components/Employee/PaymentMethod/BankAccount.js.map +0 -1
  546. package/dist/components/Employee/PaymentMethod/BankAccountEdit.d.ts +0 -1
  547. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +0 -58
  548. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +0 -1
  549. package/dist/components/Employee/PaymentMethod/BankAccountsList.d.ts +0 -1
  550. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +0 -51
  551. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +0 -1
  552. package/dist/components/Employee/PaymentMethod/Head.d.ts +0 -1
  553. package/dist/components/Employee/PaymentMethod/Head.js +0 -13
  554. package/dist/components/Employee/PaymentMethod/Head.js.map +0 -1
  555. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +0 -9
  556. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +0 -183
  557. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +0 -1
  558. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.d.ts +0 -10
  559. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +0 -38
  560. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +0 -1
  561. package/dist/components/Employee/PaymentMethod/Split.d.ts +0 -1
  562. package/dist/components/Employee/PaymentMethod/Split.js +0 -175
  563. package/dist/components/Employee/PaymentMethod/Split.js.map +0 -1
  564. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +0 -54
  565. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +0 -68
  566. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +0 -1
  567. /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/JobsListPresentation.d.ts +0 -0
  568. /package/dist/components/Employee/Compensation/{JobsList → onboarding/JobsList}/index.d.ts +0 -0
  569. /package/dist/components/Employee/Compensation/{compensationStateMachine.d.ts → onboarding/compensationStateMachine.d.ts} +0 -0
  570. /package/dist/components/Employee/{DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.test.d.ts → Compensation/shared/derivePrimaryFlsaStatus.test.d.ts} +0 -0
  571. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Actions.d.ts +0 -0
  572. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/Head.d.ts +0 -0
  573. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/List.d.ts +0 -0
  574. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
  575. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +0 -0
  576. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.d.ts +0 -0
  577. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/EmploymentEligibilitySchema.js +0 -0
  578. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.d.ts +0 -0
  579. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/countries.js +0 -0
  580. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/EmploymentEligibility/index.d.ts +0 -0
  581. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js +0 -0
  582. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/I9SignatureForm/I9SignatureForm.module.scss.js.map +0 -0
  583. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/index.d.ts +0 -0
  584. /package/dist/components/Employee/{DocumentSigner → Documents/onboarding/DocumentSigner}/stateMachine.d.ts +0 -0
  585. /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/EmployeeDocumentsPresentation.d.ts +0 -0
  586. /package/dist/components/Employee/{EmployeeDocuments → Documents/onboarding/EmployeeDocuments}/index.d.ts +0 -0
  587. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.d.ts +0 -0
  588. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/fields.js +0 -0
  589. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/index.d.ts +0 -0
  590. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.d.ts +0 -0
  591. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/signEmployeeFormSchema.js +0 -0
  592. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +0 -0
  593. /package/dist/components/Employee/{DocumentSigner → Documents}/shared/useSignEmployeeForm/useSignEmployeeForm.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChBD,EAAM,OAAO,KAAK,CAAAE,MAAKA,EAAE,aAAa,mBAAmB,IADP,IAI9CC,KAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChCC,IAAcD,EAAO,EAAK,GAC1B,EAAE,mBAAAE,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMf,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,EAAE,MAAMgB,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAApB;AAAA,MACA,eAAeQ,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIa,IAAiBC,EAAY,YAAY;AAC7C,UAAMC,IAAS,MAAMlB,EAAe;AAAA,MAClC,SAAS;AAAA,QACP,WAAAL;AAAA,QACA,WAAAC;AAAA,QACA,QAAAE;AAAA,QACA,aAAa;AAAA,UACX,eAAAD;AAAA,QAAA;AAAA,MACF;AAAA,IACF,CACD;AACD,IAAAO,EAAmBc,EAAO,eAAe,GACrCA,EAAO,oBACTZ,EAAkB,UAAU,IAC5BP,IAAcmB,EAAO,eAAe;AAAA,EAExC,GAAG,CAACvB,GAAWC,GAAWI,GAAgBW,GAAkBb,GAAQC,CAAW,CAAC,GAE1EoB,IAAuBF,EAAY,YAAY;AACnD,UAAMR;AAAA,MAAkB;AAAA,MAAM,MAC5BW,EAAWJ,GAAgB;AAAA,QACzB,aAAa5B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;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zB,aAAa5B;AAAA,QACb,SAASC;AAAA,QACT,aAAaC;AAAA,MAAA,CACd;AAAA,IAAA;AAAA,EAEL,GAAG,CAACmB,GAAmBO,CAAc,CAAC;AAEtC,EAAAK,EAAU,MAAM;AACd,IAAIb,EAAY,YAChBA,EAAY,UAAU,IACjBW,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMG,IAAmBrB,KAA2B,CAACK,EAAkB,SACjEiB,IAAetB,KAA2BK,EAAkB,SAC5DkB,IAAYF,KAAoBR;AAEtC,SAAO;AAAA,IACL,sBAAAK;AAAA,IACA,iBAAAhB;AAAA,IACA,aAAaU,GAAiB;AAAA,IAC9B,WAAAW;AAAA,IACA,cAAAD;AAAA,IACA,gBAAgBjB,EAAkB;AAAA,EAAA;AAEtC;"}
@@ -1,119 +1,121 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useState as r, useMemo as m } from "react";
3
- import { useTranslation as _ } from "react-i18next";
4
- import { useQueryClient as q } from "@tanstack/react-query";
5
- import { useHolidayPayPoliciesGetSuspense as U, invalidateAllHolidayPayPoliciesGet as Y } from "@gusto/embedded-api/react-query/holidayPayPoliciesGet";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useState as d, useMemo as u } from "react";
3
+ import { useTranslation as T } from "react-i18next";
4
+ import { useQueryClient as Y } from "@tanstack/react-query";
5
+ import { useHolidayPayPoliciesGetSuspense as j, invalidateAllHolidayPayPoliciesGet as q } from "@gusto/embedded-api/react-query/holidayPayPoliciesGet";
6
6
  import { useHolidayPayPoliciesRemoveEmployeesMutation as x } from "@gusto/embedded-api/react-query/holidayPayPoliciesRemoveEmployees";
7
7
  import { useEmployeesListSuspense as Q } from "@gusto/embedded-api/react-query/employeesList";
8
- import { getDefaultHolidayItems as j } from "../shared/holidayHelpers.js";
9
- import { HolidayPolicyDetailPresentation as G } from "./HolidayPolicyDetailPresentation.js";
8
+ import { getDefaultHolidayItems as G } from "../shared/holidayHelpers.js";
9
+ import { HolidayPolicyDetailPresentation as $ } from "./HolidayPolicyDetailPresentation.js";
10
+ import { useClientPagination as K } from "../../../hooks/useClientPagination/useClientPagination.js";
10
11
  import { BaseComponent as V } from "../../Base/Base.js";
11
- import { useBase as K } from "../../Base/useBase.js";
12
- import { componentEvents as f } from "../../../shared/constants.js";
13
- import { useComponentContext as z } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import { useI18n as S } from "../../../i18n/I18n.js";
15
- import { useLocale as J } from "../../../contexts/LocaleProvider/useLocale.js";
16
- import { firstLastName as p } from "../../../helpers/formattedStrings.js";
17
- import W from "../../../assets/icons/trashcan.svg.js";
18
- import X from "../../../assets/icons/edit-02.svg.js";
19
- import Z from "../../../assets/icons/plus-circle.svg.js";
20
- import { HamburgerMenu as $ } from "../../Common/HamburgerMenu/HamburgerMenu.js";
21
- function De(a) {
22
- return /* @__PURE__ */ t(V, { ...a, componentName: "Company.TimeOff.HolidayPolicy", children: /* @__PURE__ */ t(ee, { ...a }) });
12
+ import { useBase as z } from "../../Base/useBase.js";
13
+ import { componentEvents as y } from "../../../shared/constants.js";
14
+ import { useComponentContext as J } from "../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import { useI18n as D } from "../../../i18n/I18n.js";
16
+ import { useLocale as W } from "../../../contexts/LocaleProvider/useLocale.js";
17
+ import { firstLastName as S } from "../../../helpers/formattedStrings.js";
18
+ import X from "../../../assets/icons/trashcan.svg.js";
19
+ import Z from "../../../assets/icons/edit-02.svg.js";
20
+ import ee from "../../../assets/icons/plus-circle.svg.js";
21
+ import { HamburgerMenu as oe } from "../../Common/HamburgerMenu/HamburgerMenu.js";
22
+ function He(t) {
23
+ return /* @__PURE__ */ a(V, { ...t, componentName: "Company.TimeOff.HolidayPolicy", children: /* @__PURE__ */ a(ae, { ...t }) });
23
24
  }
24
- function ee({ companyId: a, defaultTab: H = "holidays" }) {
25
- S("Company.TimeOff.HolidayPolicy"), S("Company.TimeOff.PolicyDetail");
26
- const { t: i } = _("Company.TimeOff.HolidayPolicy"), { t: c } = _("Company.TimeOff.PolicyDetail"), { Button: h } = z(), { locale: C } = J(), N = q(), { onEvent: u, baseSubmitHandler: O } = K(), [b, L] = r(H), [l, P] = r(""), [A, E] = r(null), [n, d] = r(null), s = U({ companyUuid: a }).data.holidayPayPolicy, { data: v } = Q({
27
- companyId: a,
25
+ function ae({ companyId: t, defaultTab: _ = "holidays" }) {
26
+ D("Company.TimeOff.HolidayPolicy"), D("Company.TimeOff.PolicyDetail");
27
+ const { t: i } = T("Company.TimeOff.HolidayPolicy"), { t: l } = T("Company.TimeOff.PolicyDetail"), { Button: p } = J(), { locale: f } = W(), H = Y(), { onEvent: r, baseSubmitHandler: b } = z(), [A, N] = d(_), [O, h] = d(null), [n, m] = d(null), s = j({ companyUuid: t }).data.holidayPayPolicy, { data: C } = Q({
28
+ companyId: t,
28
29
  terminated: !1
29
- }), g = x(), w = m(() => {
30
- const e = j(i, void 0, C), { federalHolidays: o } = s;
31
- return e.filter((D) => o[D.uuid]?.selected === !0);
32
- }, [i, s, C]), T = m(
30
+ }), P = x(), L = u(() => {
31
+ const e = G(i, void 0, f), { federalHolidays: o } = s;
32
+ return e.filter((c) => o[c.uuid]?.selected === !0);
33
+ }, [i, s, f]), g = u(
33
34
  () => new Set(s.employees.map((e) => e.uuid)),
34
35
  [s.employees]
35
- ), y = m(() => (v.showEmployees ?? []).filter((o) => T.has(o.uuid)).map((o) => ({
36
+ ), w = u(() => (C.showEmployees ?? []).filter((o) => g.has(o.uuid)).map((o) => ({
36
37
  uuid: o.uuid,
37
38
  firstName: o.firstName,
38
39
  lastName: o.lastName,
39
- jobTitle: o.title ?? null
40
- })), [v.showEmployees, T]), I = m(() => {
41
- if (!l) return y;
42
- const e = l.toLowerCase();
43
- return y.filter((o) => p({
44
- first_name: o.firstName,
45
- last_name: o.lastName
46
- }).toLowerCase().includes(e));
47
- }, [y, l]), M = async () => {
40
+ jobTitle: o.jobs?.find((c) => c.primary)?.title ?? null
41
+ })), [C.showEmployees, g]), {
42
+ data: I,
43
+ pagination: M,
44
+ searchValue: k,
45
+ actions: E
46
+ } = K(w, {
47
+ defaultItemsPerPage: 10,
48
+ searchPredicate: (e, o) => `${e.firstName ?? ""} ${e.lastName ?? ""}`.toLowerCase().includes(o.toLowerCase())
49
+ }), B = async () => {
48
50
  if (!n) return;
49
51
  const e = n.uuid, o = n.name;
50
- d(null), await O({}, async () => {
51
- await g.mutateAsync({
52
+ m(null), await b({}, async () => {
53
+ await P.mutateAsync({
52
54
  request: {
53
- companyUuid: a,
55
+ companyUuid: t,
54
56
  requestBody: {
55
57
  version: s.version,
56
58
  employees: [{ uuid: e }]
57
59
  }
58
60
  }
59
- }), await Y(N), E(i("flash.employeeRemoved", { name: o }));
61
+ }), await q(H), h(i("flash.employeeRemoved", { name: o }));
60
62
  });
61
- }, k = () => {
62
- u(f.TIME_OFF_BACK_TO_LIST);
63
- }, B = () => {
64
- u(f.TIME_OFF_HOLIDAY_ADD_EMPLOYEES);
65
63
  }, F = () => {
66
- u(f.TIME_OFF_EDIT_HOLIDAY_POLICY);
67
- }, R = [
68
- /* @__PURE__ */ t(
69
- h,
64
+ r(y.TIME_OFF_BACK_TO_LIST);
65
+ }, v = () => {
66
+ r(y.TIME_OFF_HOLIDAY_ADD_EMPLOYEES);
67
+ }, R = () => {
68
+ r(y.TIME_OFF_EDIT_HOLIDAY_POLICY);
69
+ }, U = [
70
+ /* @__PURE__ */ a(
71
+ p,
70
72
  {
71
73
  variant: "secondary",
72
- icon: /* @__PURE__ */ t(Z, { "aria-hidden": !0 }),
73
- onClick: B,
74
+ icon: /* @__PURE__ */ a(ee, { "aria-hidden": !0 }),
75
+ onClick: v,
74
76
  children: i("show.addEmployeesCta")
75
77
  },
76
78
  "add"
77
79
  ),
78
- /* @__PURE__ */ t(
79
- h,
80
+ /* @__PURE__ */ a(
81
+ p,
80
82
  {
81
83
  variant: "secondary",
82
- icon: /* @__PURE__ */ t(X, { "aria-hidden": !0 }),
83
- onClick: F,
84
+ icon: /* @__PURE__ */ a(Z, { "aria-hidden": !0 }),
85
+ onClick: R,
84
86
  children: i("show.editPolicyCta")
85
87
  },
86
88
  "edit"
87
89
  )
88
90
  ];
89
- return /* @__PURE__ */ t(
90
- G,
91
+ return /* @__PURE__ */ a(
92
+ $,
91
93
  {
92
94
  title: i("show.title"),
93
- onBack: k,
94
- backLabel: c("backLabel"),
95
- actions: R,
96
- holidays: w,
97
- selectedTabId: b,
98
- onTabChange: L,
95
+ onBack: F,
96
+ backLabel: l("backLabel"),
97
+ actions: U,
98
+ onAddEmployee: v,
99
+ holidays: L,
100
+ selectedTabId: A,
101
+ onTabChange: N,
99
102
  employees: {
100
103
  data: I,
101
- searchValue: l,
102
- onSearchChange: P,
103
- onSearchClear: () => {
104
- P("");
105
- },
106
- itemMenu: (e) => /* @__PURE__ */ t(
107
- $,
104
+ searchValue: k,
105
+ onSearchChange: E.onSearchChange,
106
+ onSearchClear: E.onSearchClear,
107
+ pagination: M,
108
+ itemMenu: (e) => /* @__PURE__ */ a(
109
+ oe,
108
110
  {
109
111
  items: [
110
112
  {
111
- label: c("removeEmployeeDialog.confirmCta"),
112
- icon: /* @__PURE__ */ t(W, { "aria-hidden": !0 }),
113
+ label: l("removeEmployeeDialog.confirmCta"),
114
+ icon: /* @__PURE__ */ a(X, { "aria-hidden": !0 }),
113
115
  onClick: () => {
114
- d({
116
+ m({
115
117
  uuid: e.uuid,
116
- name: p({
118
+ name: S({
117
119
  first_name: e.firstName,
118
120
  last_name: e.lastName
119
121
  })
@@ -121,8 +123,8 @@ function ee({ companyId: a, defaultTab: H = "holidays" }) {
121
123
  }
122
124
  }
123
125
  ],
124
- triggerLabel: c("employeeActions", {
125
- name: p({ first_name: e.firstName, last_name: e.lastName })
126
+ triggerLabel: l("employeeActions", {
127
+ name: S({ first_name: e.firstName, last_name: e.lastName })
126
128
  })
127
129
  }
128
130
  )
@@ -130,20 +132,20 @@ function ee({ companyId: a, defaultTab: H = "holidays" }) {
130
132
  removeDialog: {
131
133
  isOpen: n !== null,
132
134
  employeeName: n?.name ?? "",
133
- onConfirm: M,
135
+ onConfirm: B,
134
136
  onClose: () => {
135
- d(null);
137
+ m(null);
136
138
  },
137
- isPending: g.isPending
139
+ isPending: P.isPending
138
140
  },
139
- successAlert: A ?? void 0,
141
+ successAlert: O ?? void 0,
140
142
  onDismissAlert: () => {
141
- E(null);
143
+ h(null);
142
144
  }
143
145
  }
144
146
  );
145
147
  }
146
148
  export {
147
- De as HolidayPolicyDetail
149
+ He as HolidayPolicyDetail
148
150
  };
149
151
  //# sourceMappingURL=HolidayPolicyDetail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface {\n companyId: string\n defaultTab?: 'holidays' | 'employees'\n}\n\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [searchValue, setSearchValue] = useState('')\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const filteredEmployees = useMemo(() => {\n if (!searchValue) return employees\n const query = searchValue.toLowerCase()\n return employees.filter(emp => {\n const name = firstLastName({\n first_name: emp.firstName,\n last_name: emp.lastName,\n }).toLowerCase()\n return name.includes(query)\n })\n }, [employees, searchValue])\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: filteredEmployees,\n searchValue,\n onSearchChange: setSearchValue,\n onSearchClear: () => {\n setSearchValue('')\n },\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","searchValue","setSearchValue","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","filteredEmployees","query","firstLastName","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BO,SAASA,GAAoBC,GAAiC;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,gBACH;AAAA,cAAA;AAAA,YACF;AAAA,YAEF,cAAcjD,EAAQ,mBAAmB;AAAA,cACvC,MAAMoC,EAAc,EAAE,YAAYa,EAAS,WAAW,WAAWA,EAAS,SAAA,CAAU;AAAA,YAAA,CACrF;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAGJ,cAAc;AAAA,QACZ,QAAQhC,MAAuB;AAAA,QAC/B,cAAcA,GAAoB,QAAQ;AAAA,QAC1C,WAAWoB;AAAA,QACX,SAAS,MAAM;AACb,UAAAnB,EAAsB,IAAI;AAAA,QAC5B;AAAA,QACA,WAAWK,EAAwB;AAAA,MAAA;AAAA,MAErC,cAAcR,KAAgB;AAAA,MAC9B,gBAAgB,MAAM;AACpB,QAAAC,EAAgB,IAAI;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"HolidayPolicyDetail.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n useHolidayPayPoliciesGetSuspense,\n invalidateAllHolidayPayPoliciesGet,\n} from '@gusto/embedded-api/react-query/holidayPayPoliciesGet'\nimport { useHolidayPayPoliciesRemoveEmployeesMutation } from '@gusto/embedded-api/react-query/holidayPayPoliciesRemoveEmployees'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { getDefaultHolidayItems } from '../shared/holidayHelpers'\nimport { HolidayPolicyDetailPresentation } from './HolidayPolicyDetailPresentation'\nimport type { HolidayPolicyDetailEmployee } from './HolidayPolicyDetailTypes'\nimport { useClientPagination } from '@/hooks/useClientPagination/useClientPagination'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { firstLastName } from '@/helpers/formattedStrings'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport EditIcon from '@/assets/icons/edit-02.svg?react'\nimport PlusCircleIcon from '@/assets/icons/plus-circle.svg?react'\n\nexport interface HolidayPolicyDetailProps extends BaseComponentInterface {\n companyId: string\n defaultTab?: 'holidays' | 'employees'\n}\n\nexport function HolidayPolicyDetail(props: HolidayPolicyDetailProps) {\n return (\n <BaseComponent {...props} componentName=\"Company.TimeOff.HolidayPolicy\">\n <Root {...props} />\n </BaseComponent>\n )\n}\n\ninterface RemoveDialogTarget {\n uuid: string\n name: string\n}\n\nfunction Root({ companyId, defaultTab = 'holidays' }: HolidayPolicyDetailProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n useI18n('Company.TimeOff.PolicyDetail')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { t: tShared } = useTranslation('Company.TimeOff.PolicyDetail')\n const { Button } = useComponentContext()\n const { locale } = useLocale()\n const queryClient = useQueryClient()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [selectedTabId, setSelectedTabId] = useState<string>(defaultTab)\n const [successAlert, setSuccessAlert] = useState<string | null>(null)\n const [removeDialogTarget, setRemoveDialogTarget] = useState<RemoveDialogTarget | null>(null)\n\n const holidayQuery = useHolidayPayPoliciesGetSuspense({ companyUuid: companyId })\n const holidayPayPolicy = holidayQuery.data.holidayPayPolicy!\n\n const { data: employeesData } = useEmployeesListSuspense({\n companyId,\n terminated: false,\n })\n\n const removeEmployeesMutation = useHolidayPayPoliciesRemoveEmployeesMutation()\n\n const holidays = useMemo(() => {\n const allHolidays = getDefaultHolidayItems(t, undefined, locale)\n const { federalHolidays } = holidayPayPolicy\n return allHolidays.filter(holiday => {\n const holidayData = federalHolidays[holiday.uuid as keyof typeof federalHolidays]\n return holidayData?.selected === true\n })\n }, [t, holidayPayPolicy, locale])\n\n const policyEmployeeUuids = useMemo(\n () => new Set(holidayPayPolicy.employees.map(e => e.uuid)),\n [holidayPayPolicy.employees],\n )\n\n const employees: HolidayPolicyDetailEmployee[] = useMemo(() => {\n const allEmployees = employeesData.showEmployees ?? []\n return allEmployees\n .filter(emp => policyEmployeeUuids.has(emp.uuid))\n .map(emp => ({\n uuid: emp.uuid,\n firstName: emp.firstName,\n lastName: emp.lastName,\n jobTitle: emp.jobs?.find(job => job.primary)?.title ?? null,\n }))\n }, [employeesData.showEmployees, policyEmployeeUuids])\n\n const {\n data: pagedEmployees,\n pagination,\n searchValue,\n actions: paginationActions,\n } = useClientPagination(employees, {\n defaultItemsPerPage: 10,\n searchPredicate: (emp, query) =>\n `${emp.firstName ?? ''} ${emp.lastName ?? ''}`.toLowerCase().includes(query.toLowerCase()),\n })\n\n const handleRemoveEmployee = async () => {\n if (!removeDialogTarget) return\n\n const targetUuid = removeDialogTarget.uuid\n const targetName = removeDialogTarget.name\n setRemoveDialogTarget(null)\n\n await baseSubmitHandler({}, async () => {\n await removeEmployeesMutation.mutateAsync({\n request: {\n companyUuid: companyId,\n requestBody: {\n version: holidayPayPolicy.version!,\n employees: [{ uuid: targetUuid }],\n },\n },\n })\n await invalidateAllHolidayPayPoliciesGet(queryClient)\n setSuccessAlert(t('flash.employeeRemoved', { name: targetName }))\n })\n }\n\n const handleBack = () => {\n onEvent(componentEvents.TIME_OFF_BACK_TO_LIST)\n }\n\n const handleAddEmployees = () => {\n onEvent(componentEvents.TIME_OFF_HOLIDAY_ADD_EMPLOYEES)\n }\n\n const handleEditPolicy = () => {\n onEvent(componentEvents.TIME_OFF_EDIT_HOLIDAY_POLICY)\n }\n\n const actions = [\n <Button\n key=\"add\"\n variant=\"secondary\"\n icon={<PlusCircleIcon aria-hidden />}\n onClick={handleAddEmployees}\n >\n {t('show.addEmployeesCta')}\n </Button>,\n <Button\n key=\"edit\"\n variant=\"secondary\"\n icon={<EditIcon aria-hidden />}\n onClick={handleEditPolicy}\n >\n {t('show.editPolicyCta')}\n </Button>,\n ]\n\n return (\n <HolidayPolicyDetailPresentation\n title={t('show.title')}\n onBack={handleBack}\n backLabel={tShared('backLabel')}\n actions={actions}\n onAddEmployee={handleAddEmployees}\n holidays={holidays}\n selectedTabId={selectedTabId}\n onTabChange={setSelectedTabId}\n employees={{\n data: pagedEmployees,\n searchValue,\n onSearchChange: paginationActions.onSearchChange,\n onSearchClear: paginationActions.onSearchClear,\n pagination,\n itemMenu: employee => (\n <HamburgerMenu\n items={[\n {\n label: tShared('removeEmployeeDialog.confirmCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n setRemoveDialogTarget({\n uuid: employee.uuid,\n name: firstLastName({\n first_name: employee.firstName,\n last_name: employee.lastName,\n }),\n })\n },\n },\n ]}\n triggerLabel={tShared('employeeActions', {\n name: firstLastName({ first_name: employee.firstName, last_name: employee.lastName }),\n })}\n />\n ),\n }}\n removeDialog={{\n isOpen: removeDialogTarget !== null,\n employeeName: removeDialogTarget?.name ?? '',\n onConfirm: handleRemoveEmployee,\n onClose: () => {\n setRemoveDialogTarget(null)\n },\n isPending: removeEmployeesMutation.isPending,\n }}\n successAlert={successAlert ?? undefined}\n onDismissAlert={() => {\n setSuccessAlert(null)\n }}\n />\n )\n}\n"],"names":["HolidayPolicyDetail","props","jsx","BaseComponent","Root","companyId","defaultTab","useI18n","t","useTranslation","tShared","Button","useComponentContext","locale","useLocale","queryClient","useQueryClient","onEvent","baseSubmitHandler","useBase","selectedTabId","setSelectedTabId","useState","successAlert","setSuccessAlert","removeDialogTarget","setRemoveDialogTarget","holidayPayPolicy","useHolidayPayPoliciesGetSuspense","employeesData","useEmployeesListSuspense","removeEmployeesMutation","useHolidayPayPoliciesRemoveEmployeesMutation","holidays","useMemo","allHolidays","getDefaultHolidayItems","federalHolidays","holiday","policyEmployeeUuids","employees","emp","job","pagedEmployees","pagination","searchValue","paginationActions","useClientPagination","query","handleRemoveEmployee","targetUuid","targetName","invalidateAllHolidayPayPoliciesGet","handleBack","componentEvents","handleAddEmployees","handleEditPolicy","actions","PlusCircleIcon","EditIcon","HolidayPolicyDetailPresentation","employee","HamburgerMenu","TrashCanSvg","firstLastName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BO,SAASA,GAAoBC,GAAiC;AACnE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,eAAc,iCACtC,UAAA,gBAAAC,EAACE,IAAA,EAAM,GAAGH,EAAA,CAAO,EAAA,CACnB;AAEJ;AAOA,SAASG,GAAK,EAAE,WAAAC,GAAW,YAAAC,IAAa,cAAwC;AAC9E,EAAAC,EAAQ,+BAA+B,GACvCA,EAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GACtD,EAAE,GAAGC,MAAYD,EAAe,8BAA8B,GAC9D,EAAE,QAAAE,EAAA,IAAWC,EAAA,GACb,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAcC,EAAA,GACd,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,CAACC,GAAeC,CAAgB,IAAIC,EAAiBhB,CAAU,GAC/D,CAACiB,GAAcC,CAAe,IAAIF,EAAwB,IAAI,GAC9D,CAACG,GAAoBC,CAAqB,IAAIJ,EAAoC,IAAI,GAGtFK,IADeC,EAAiC,EAAE,aAAavB,GAAW,EAC1C,KAAK,kBAErC,EAAE,MAAMwB,EAAA,IAAkBC,EAAyB;AAAA,IACvD,WAAAzB;AAAA,IACA,YAAY;AAAA,EAAA,CACb,GAEK0B,IAA0BC,EAAA,GAE1BC,IAAWC,EAAQ,MAAM;AAC7B,UAAMC,IAAcC,EAAuB5B,GAAG,QAAWK,CAAM,GACzD,EAAE,iBAAAwB,MAAoBV;AAC5B,WAAOQ,EAAY,OAAO,CAAAG,MACJD,EAAgBC,EAAQ,IAAoC,GAC5D,aAAa,EAClC;AAAA,EACH,GAAG,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CAAC;AAAA,gBAC/B,SAAS,MAAM;AACb,kBAAArC,EAAsB;AAAA,oBACpB,MAAMmC,EAAS;AAAA,oBACf,MAAMG,EAAc;AAAA,sBAClB,YAAYH,EAAS;AAAA,sBACrB,WAAWA,EAAS;AAAA,oBAAA,CACrB;AAAA,kBAAA,CACF;AAAA,gBACH;AAAA,cAAA;AAAA,YACF;AAAA,YAEF,cAAcnD,EAAQ,mBAAmB;AAAA,cACvC,MAAMsD,EAAc,EAAE,YAAYH,EAAS,WAAW,WAAWA,EAAS,SAAA,CAAU;AAAA,YAAA,CACrF;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAGJ,cAAc;AAAA,QACZ,QAAQpC,MAAuB;AAAA,QAC/B,cAAcA,GAAoB,QAAQ;AAAA,QAC1C,WAAWwB;AAAA,QACX,SAAS,MAAM;AACb,UAAAvB,EAAsB,IAAI;AAAA,QAC5B;AAAA,QACA,WAAWK,EAAwB;AAAA,MAAA;AAAA,MAErC,cAAcR,KAAgB;AAAA,MAC9B,gBAAgB,MAAM;AACpB,QAAAC,EAAgB,IAAI;AAAA,MACtB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
1
  import { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes';
2
- export declare function HolidayPolicyDetailPresentation({ title, subtitle, onBack, backLabel, actions, holidays, selectedTabId, onTabChange, employees, removeDialog, successAlert, onDismissAlert, }: HolidayPolicyDetailPresentationProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function HolidayPolicyDetailPresentation({ title, subtitle, onBack, backLabel, actions, holidays, selectedTabId, onTabChange, employees, onAddEmployee, removeDialog, successAlert, onDismissAlert, }: HolidayPolicyDetailPresentationProps): import("react/jsx-runtime").JSX.Element;
@@ -1,80 +1,81 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useMemo as h } from "react";
3
- import { useTranslation as m } from "react-i18next";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useMemo as D } from "react";
3
+ import { useTranslation as n } from "react-i18next";
4
4
  import "classnames";
5
5
  import "../../../shared/constants.js";
6
- import { useComponentContext as H } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- import { useI18n as d } from "../../../i18n/I18n.js";
6
+ import { useI18n as l } from "../../../i18n/I18n.js";
8
7
  import { PolicyDetailLayout as T } from "../shared/PolicyDetailLayout/PolicyDetailLayout.js";
9
- import { useDataView as x } from "../../Common/DataView/useDataView.js";
10
- import { DataView as D } from "../../Common/DataView/DataView.js";
11
- const P = "holidays";
12
- function S({
13
- title: a,
8
+ import { useDataView as O } from "../../Common/DataView/useDataView.js";
9
+ import { DataView as P } from "../../Common/DataView/DataView.js";
10
+ const v = "holidays";
11
+ function j({
12
+ title: t,
14
13
  subtitle: e,
15
- onBack: i,
16
- backLabel: r,
17
- actions: n,
18
- holidays: l,
19
- selectedTabId: s,
20
- onTabChange: t,
21
- employees: y,
22
- removeDialog: c,
23
- successAlert: p,
24
- onDismissAlert: f
14
+ onBack: a,
15
+ backLabel: i,
16
+ actions: o,
17
+ holidays: s,
18
+ selectedTabId: m,
19
+ onTabChange: y,
20
+ employees: d,
21
+ onAddEmployee: f,
22
+ removeDialog: b,
23
+ successAlert: c,
24
+ onDismissAlert: p
25
25
  }) {
26
- d("Company.TimeOff.HolidayPolicy");
27
- const { t: b } = m("Company.TimeOff.HolidayPolicy"), u = /* @__PURE__ */ o(v, { holidays: l });
28
- return /* @__PURE__ */ o(
26
+ l("Company.TimeOff.HolidayPolicy");
27
+ const { t: u } = n("Company.TimeOff.HolidayPolicy"), H = /* @__PURE__ */ r(x, { holidays: s });
28
+ return /* @__PURE__ */ r(
29
29
  T,
30
30
  {
31
- title: a,
31
+ title: t,
32
32
  subtitle: e,
33
- onBack: i,
34
- backLabel: r,
35
- actions: n,
33
+ onBack: a,
34
+ backLabel: i,
35
+ actions: o,
36
36
  firstTab: {
37
- id: P,
38
- label: b("tabs.holidays"),
39
- content: u
37
+ id: v,
38
+ label: u("tabs.holidays"),
39
+ content: H
40
40
  },
41
- selectedTabId: s,
42
- onTabChange: t,
43
- employees: y,
44
- removeDialog: c,
45
- successAlert: p,
46
- onDismissAlert: f
41
+ selectedTabId: m,
42
+ onTabChange: y,
43
+ employees: d,
44
+ onAddEmployee: f,
45
+ removeDialog: b,
46
+ successAlert: c,
47
+ onDismissAlert: p
47
48
  }
48
49
  );
49
50
  }
50
- function v({ holidays: a }) {
51
- d("Company.TimeOff.HolidayPolicy");
52
- const { t: e } = m("Company.TimeOff.HolidayPolicy"), { Text: i, Box: r, BoxHeader: n } = H(), l = h(
51
+ function x({ holidays: t }) {
52
+ l("Company.TimeOff.HolidayPolicy");
53
+ const { t: e } = n("Company.TimeOff.HolidayPolicy"), a = D(
53
54
  () => [
54
55
  {
55
56
  key: "name",
56
57
  title: e("tableHeaders.holidayName"),
57
- render: (t) => /* @__PURE__ */ o(i, { weight: "medium", children: t.name })
58
+ render: (o) => o.name
58
59
  },
59
60
  {
60
61
  key: "observedDate",
61
62
  title: e("tableHeaders.observedDate"),
62
- render: (t) => /* @__PURE__ */ o(i, { variant: "supporting", children: t.observedDate })
63
+ render: (o) => o.observedDate
63
64
  },
64
65
  {
65
66
  key: "nextObservation",
66
67
  title: e("tableHeaders.nextObservation"),
67
- render: (t) => /* @__PURE__ */ o(i, { variant: "supporting", children: t.nextObservation })
68
+ render: (o) => o.nextObservation
68
69
  }
69
70
  ],
70
- [e, i]
71
- ), s = x({
72
- data: a,
73
- columns: l
71
+ [e]
72
+ ), i = O({
73
+ data: t,
74
+ columns: a
74
75
  });
75
- return /* @__PURE__ */ o(r, { header: /* @__PURE__ */ o(n, { title: e("show.holidaySchedule") }), withPadding: !1, children: /* @__PURE__ */ o(D, { label: e("tableLabel"), ...s }) });
76
+ return /* @__PURE__ */ r(P, { label: e("tableLabel"), ...i });
76
77
  }
77
78
  export {
78
- S as HolidayPolicyDetailPresentation
79
+ j as HolidayPolicyDetailPresentation
79
80
  };
80
81
  //# sourceMappingURL=HolidayPolicyDetailPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HolidayPolicyDetailPresentation.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { HolidayItem } from '../HolidaySelectionForm/HolidaySelectionFormTypes'\nimport { PolicyDetailLayout } from '../shared/PolicyDetailLayout'\nimport type { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes'\nimport { DataView, useDataView } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst HOLIDAYS_TAB_ID = 'holidays'\n\nexport function HolidayPolicyDetailPresentation({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n holidays,\n selectedTabId,\n onTabChange,\n employees,\n removeDialog,\n successAlert,\n onDismissAlert,\n}: HolidayPolicyDetailPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n\n const holidaysTabContent = <HolidaysTab holidays={holidays} />\n\n return (\n <PolicyDetailLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n firstTab={{\n id: HOLIDAYS_TAB_ID,\n label: t('tabs.holidays'),\n content: holidaysTabContent,\n }}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n employees={employees}\n removeDialog={removeDialog}\n successAlert={successAlert}\n onDismissAlert={onDismissAlert}\n />\n )\n}\n\nfunction HolidaysTab({ holidays }: { holidays: HolidayItem[] }) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n const { Text, Box, BoxHeader } = useComponentContext()\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => <Text weight=\"medium\">{item.name}</Text>,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.observedDate}</Text>,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => <Text variant=\"supporting\">{item.nextObservation}</Text>,\n },\n ],\n [t, Text],\n )\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n })\n\n return (\n <Box header={<BoxHeader title={t('show.holidaySchedule')} />} withPadding={false}>\n <DataView label={t('tableLabel')} {...dataViewProps} />\n </Box>\n )\n}\n"],"names":["HOLIDAYS_TAB_ID","HolidayPolicyDetailPresentation","title","subtitle","onBack","backLabel","actions","holidays","selectedTabId","onTabChange","employees","removeDialog","successAlert","onDismissAlert","useI18n","t","useTranslation","holidaysTabContent","jsx","HolidaysTab","PolicyDetailLayout","Text","Box","BoxHeader","useComponentContext","columns","useMemo","item","dataViewProps","useDataView","DataView"],"mappings":";;;;;;;;;;AASA,MAAMA,IAAkB;AAEjB,SAASC,EAAgC;AAAA,EAC9C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,GAAyC;AACvC,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GAEtDC,IAAqB,gBAAAC,EAACC,GAAA,EAAY,UAAAZ,EAAA,CAAoB;AAE5D,SACE,gBAAAW;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAlB;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAU;AAAA,QACR,IAAIN;A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3,"file":"HolidayPolicyDetailPresentation.js","sources":["../../../../src/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetailPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { HolidayItem } from '../HolidaySelectionForm/HolidaySelectionFormTypes'\nimport { PolicyDetailLayout } from '../shared/PolicyDetailLayout'\nimport type { HolidayPolicyDetailPresentationProps } from './HolidayPolicyDetailTypes'\nimport { DataView, useDataView } from '@/components/Common'\nimport { useI18n } from '@/i18n'\n\nconst HOLIDAYS_TAB_ID = 'holidays'\n\nexport function HolidayPolicyDetailPresentation({\n title,\n subtitle,\n onBack,\n backLabel,\n actions,\n holidays,\n selectedTabId,\n onTabChange,\n employees,\n onAddEmployee,\n removeDialog,\n successAlert,\n onDismissAlert,\n}: HolidayPolicyDetailPresentationProps) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n\n const holidaysTabContent = <HolidaysTab holidays={holidays} />\n\n return (\n <PolicyDetailLayout\n title={title}\n subtitle={subtitle}\n onBack={onBack}\n backLabel={backLabel}\n actions={actions}\n firstTab={{\n id: HOLIDAYS_TAB_ID,\n label: t('tabs.holidays'),\n content: holidaysTabContent,\n }}\n selectedTabId={selectedTabId}\n onTabChange={onTabChange}\n employees={employees}\n onAddEmployee={onAddEmployee}\n removeDialog={removeDialog}\n successAlert={successAlert}\n onDismissAlert={onDismissAlert}\n />\n )\n}\n\nfunction HolidaysTab({ holidays }: { holidays: HolidayItem[] }) {\n useI18n('Company.TimeOff.HolidayPolicy')\n const { t } = useTranslation('Company.TimeOff.HolidayPolicy')\n\n const columns = useMemo(\n () => [\n {\n key: 'name' as keyof HolidayItem,\n title: t('tableHeaders.holidayName'),\n render: (item: HolidayItem) => item.name,\n },\n {\n key: 'observedDate' as keyof HolidayItem,\n title: t('tableHeaders.observedDate'),\n render: (item: HolidayItem) => item.observedDate,\n },\n {\n key: 'nextObservation' as keyof HolidayItem,\n title: t('tableHeaders.nextObservation'),\n render: (item: HolidayItem) => item.nextObservation,\n },\n ],\n [t],\n )\n\n const dataViewProps = useDataView<HolidayItem>({\n data: holidays,\n columns,\n })\n\n return <DataView label={t('tableLabel')} {...dataViewProps} />\n}\n"],"names":["HOLIDAYS_TAB_ID","HolidayPolicyDetailPresentation","title","subtitle","onBack","backLabel","actions","holidays","selectedTabId","onTabChange","employees","onAddEmployee","removeDialog","successAlert","onDismissAlert","useI18n","t","useTranslation","holidaysTabContent","jsx","HolidaysTab","PolicyDetailLayout","columns","useMemo","item","dataViewProps","useDataView","DataView"],"mappings":";;;;;;;;;AAQA,MAAMA,IAAkB;AAEjB,SAASC,EAAgC;AAAA,EAC9C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AACF,GAAyC;AACvC,EAAAC,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GAEtDC,IAAqB,gBAAAC,EAACC,GAAA,EAAY,UAAAb,EAAA,CAAoB;AAE5D,SACE,gBAAAY;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAnB;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAU;AAAA,QACR,IAAIN;AAAA,QACJ,OAAOgB,EAAE,eAAe;AAAA,QACxB,SAASE;AAAA,MAAA;AAAA,MAEX,eAAAV;AAAA,MACA,aAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,SAASM,EAAY,EAAE,UAAAb,KAAyC;AAC9D,EAAAQ,EAAQ,+BAA+B;AACvC,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,+BAA+B,GAEtDK,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,KAAK;AAAA,QACL,OAAOP,EAAE,0BAA0B;AAAA,QACnC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,MAEtC;AAAA,QACE,KAAK;AAAA,QACL,OAAOR,EAAE,2BAA2B;AAAA,QACpC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,MAEtC;AAAA,QACE,KAAK;AAAA,QACL,OAAOR,EAAE,8BAA8B;AAAA,QACvC,QAAQ,CAACQ,MAAsBA,EAAK;AAAA,MAAA;AAAA,IACtC;AAAA,IAEF,CAACR,CAAC;AAAA,EAAA,GAGES,IAAgBC,EAAyB;AAAA,IAC7C,MAAMnB;AAAA,IACN,SAAAe;AAAA,EAAA,CACD;AAED,2BAAQK,GAAA,EAAS,OAAOX,EAAE,YAAY,GAAI,GAAGS,GAAe;AAC9D;"}
@@ -15,6 +15,7 @@ export interface HolidayPolicyDetailPresentationProps {
15
15
  selectedTabId: string;
16
16
  onTabChange: (id: string) => void;
17
17
  employees: Pick<EmployeeTableProps<HolidayPolicyDetailEmployee>, 'data' | 'searchValue' | 'onSearchChange' | 'onSearchClear' | 'searchPlaceholder' | 'itemMenu' | 'pagination' | 'isFetching' | 'emptyState'>;
18
+ onAddEmployee?: () => void;
18
19
  removeDialog: RemoveDialogState;
19
20
  successAlert?: string;
20
21
  onDismissAlert?: () => void;