@gusto/embedded-react-sdk 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/CHANGELOG.md +11 -3
  2. package/dist/components/Base/Base.d.ts +6 -5
  3. package/dist/components/Base/Base.js +40 -39
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Base/index.d.ts +1 -0
  6. package/dist/components/Common/ActionsLayout/index.d.ts +1 -0
  7. package/dist/components/Common/DataView/DataCards/index.d.ts +1 -0
  8. package/dist/components/Common/DataView/index.d.ts +1 -0
  9. package/dist/components/Common/DocumentList/index.d.ts +1 -0
  10. package/dist/components/Common/DocumentViewer/index.d.ts +1 -0
  11. package/dist/components/Common/FieldCaption/index.d.ts +1 -0
  12. package/dist/components/Common/FieldDescription/index.d.ts +1 -0
  13. package/dist/components/Common/FieldErrorMessage/index.d.ts +1 -0
  14. package/dist/components/Common/FieldLayout/index.d.ts +1 -0
  15. package/dist/components/Common/Fields/CheckboxField/index.d.ts +1 -0
  16. package/dist/components/Common/Fields/CheckboxGroupField/index.d.ts +1 -0
  17. package/dist/components/Common/Fields/ComboBoxField/index.d.ts +1 -0
  18. package/dist/components/Common/Fields/DatePickerField/index.d.ts +1 -0
  19. package/dist/components/Common/Fields/NumberInputField/index.d.ts +1 -0
  20. package/dist/components/Common/Fields/RadioGroupField/index.d.ts +1 -0
  21. package/dist/components/Common/Fields/SelectField/index.d.ts +1 -0
  22. package/dist/components/Common/Fields/SwitchField/index.d.ts +1 -0
  23. package/dist/components/Common/Fields/TextInputField/index.d.ts +1 -0
  24. package/dist/components/Common/Fieldset/index.d.ts +1 -0
  25. package/dist/components/Common/Flex/index.d.ts +1 -0
  26. package/dist/components/Common/Form/index.d.ts +1 -0
  27. package/dist/components/Common/HamburgerMenu/index.d.ts +1 -0
  28. package/dist/components/Common/HorizontalFieldLayout/index.d.ts +1 -0
  29. package/dist/components/Common/PaginationControl/index.d.ts +1 -0
  30. package/dist/components/Common/ReorderableList/index.d.ts +1 -0
  31. package/dist/components/Common/SignatureForm/index.d.ts +1 -0
  32. package/dist/components/Common/TaxInputs/index.d.ts +1 -0
  33. package/dist/components/Common/UI/Alert/index.d.ts +1 -0
  34. package/dist/components/Common/UI/Button/index.d.ts +1 -0
  35. package/dist/components/Common/UI/CalendarPreview/index.d.ts +1 -0
  36. package/dist/components/Common/UI/Checkbox/index.d.ts +1 -0
  37. package/dist/components/Common/UI/CheckboxGroup/index.d.ts +1 -0
  38. package/dist/components/Common/UI/DatePicker/index.d.ts +1 -0
  39. package/dist/components/Common/UI/Heading/index.d.ts +1 -0
  40. package/dist/components/Common/UI/Input/index.d.ts +1 -0
  41. package/dist/components/Common/UI/Link/index.d.ts +1 -0
  42. package/dist/components/Common/UI/List/index.d.ts +1 -0
  43. package/dist/components/Common/UI/Menu/index.d.ts +1 -0
  44. package/dist/components/Common/UI/NumberInput/index.d.ts +1 -0
  45. package/dist/components/Common/UI/ProgressBar/index.d.ts +1 -0
  46. package/dist/components/Common/UI/Radio/index.d.ts +1 -0
  47. package/dist/components/Common/UI/RadioGroup/index.d.ts +1 -0
  48. package/dist/components/Common/UI/Select/index.d.ts +1 -0
  49. package/dist/components/Common/UI/Switch/index.d.ts +1 -0
  50. package/dist/components/Common/UI/Table/index.d.ts +1 -0
  51. package/dist/components/Common/UI/Text/index.d.ts +1 -0
  52. package/dist/components/Common/UI/TextInput/index.d.ts +1 -0
  53. package/dist/components/Common/VisuallyHidden/index.d.ts +1 -0
  54. package/dist/components/Common/index.d.ts +1 -0
  55. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +3 -3
  56. package/dist/components/Company/AssignSignatory/AssignSignatory.js +20 -19
  57. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/index.d.ts +1 -0
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  60. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  61. package/dist/components/Company/AssignSignatory/InviteSignatory/index.d.ts +1 -0
  62. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  63. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/index.d.ts +1 -0
  65. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  66. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  67. package/dist/components/Company/BankAccount/BankAccount.d.ts +10 -0
  68. package/dist/components/Company/BankAccount/BankAccount.js +32 -0
  69. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -0
  70. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  71. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -0
  73. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +13 -0
  74. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +63 -0
  75. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -0
  76. package/dist/components/Company/DocumentSigner/DocumentList/Head.js.map +1 -0
  77. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -0
  78. package/dist/components/Company/DocumentSigner/DocumentList/ManageSignatories.js.map +1 -0
  79. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/index.d.ts +1 -0
  80. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.js +3 -4
  81. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -0
  82. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +12 -0
  83. package/dist/components/Company/DocumentSigner/DocumentSigner.js +41 -0
  84. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -0
  85. package/dist/components/Company/DocumentSigner/SignatureForm/Actions.js.map +1 -0
  86. package/dist/components/Company/DocumentSigner/SignatureForm/Form.js.map +1 -0
  87. package/dist/components/Company/DocumentSigner/SignatureForm/Head.js.map +1 -0
  88. package/dist/components/Company/DocumentSigner/SignatureForm/Preview.js.map +1 -0
  89. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +14 -0
  90. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +72 -0
  91. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -0
  92. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/index.d.ts +1 -0
  93. package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.js +3 -4
  94. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -0
  95. package/dist/components/Company/DocumentSigner/assignSignatoryState.js.map +1 -0
  96. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -0
  97. package/dist/components/Company/DocumentSigner/index.d.ts +2 -0
  98. package/dist/components/Company/DocumentSigner/stateMachine.js.map +1 -0
  99. package/dist/components/Company/FederalTaxes/FederalTaxes.d.ts +1 -4
  100. package/dist/components/Company/FederalTaxes/FederalTaxes.js +27 -27
  101. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  102. package/dist/components/Company/FederalTaxes/index.d.ts +1 -0
  103. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -12
  104. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  105. package/dist/components/Company/Industry/Context.js +6 -7
  106. package/dist/components/Company/Industry/Context.js.map +1 -1
  107. package/dist/components/Company/Industry/Industry.d.ts +1 -1
  108. package/dist/components/Company/Industry/Industry.js +29 -28
  109. package/dist/components/Company/Industry/Industry.js.map +1 -1
  110. package/dist/components/Company/Industry/index.d.ts +1 -0
  111. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  112. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  113. package/dist/components/Company/Locations/Locations.d.ts +9 -0
  114. package/dist/components/Company/Locations/Locations.js +27 -0
  115. package/dist/components/Company/Locations/Locations.js.map +1 -0
  116. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +3 -3
  117. package/dist/components/Company/Locations/LocationsList/LocationsList.js +27 -32
  118. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  119. package/dist/components/Company/Locations/LocationsList/index.d.ts +1 -0
  120. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  121. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  122. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.d.ts +2 -2
  123. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js +13 -13
  124. package/dist/components/Company/OnboardingFlow/OnboardingFlowComponents.js.map +1 -1
  125. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js +3 -3
  126. package/dist/components/Company/OnboardingFlow/onboardingStateMachine.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/OnboardingOverview.d.ts +1 -1
  128. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +15 -15
  129. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  130. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  131. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  132. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +2 -2
  133. package/dist/components/Company/PaySchedule/PaySchedule.js +63 -62
  134. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/_parts/index.d.ts +1 -0
  136. package/dist/components/Company/PaySchedule/index.d.ts +1 -0
  137. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  138. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +9 -0
  140. package/dist/components/Company/StateTaxes/StateTaxes.js +27 -0
  141. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -0
  142. package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.js → StateTaxesComponents.js} +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -0
  144. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  145. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  146. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +3 -3
  147. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  148. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  149. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  150. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +1 -1
  151. package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -1
  152. package/dist/components/Company/index.d.ts +7 -6
  153. package/dist/components/Company/index.js +18 -18
  154. package/dist/components/Employee/Compensation/Compensation.d.ts +1 -1
  155. package/dist/components/Employee/Compensation/Compensation.js +45 -44
  156. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  157. package/dist/components/Employee/Compensation/Edit.js +17 -16
  158. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  159. package/dist/components/Employee/Compensation/index.d.ts +1 -0
  160. package/dist/components/Employee/Compensation/useCompensation.d.ts +6 -46
  161. package/dist/components/Employee/Compensation/useCompensation.js +60 -45
  162. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  163. package/dist/components/Employee/Deductions/Deductions.d.ts +2 -2
  164. package/dist/components/Employee/Deductions/Deductions.js +73 -71
  165. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  166. package/dist/components/Employee/Deductions/index.d.ts +1 -0
  167. package/dist/components/Employee/Deductions/useDeductions.js +6 -7
  168. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  169. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  170. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  171. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +11 -0
  172. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +27 -0
  173. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -0
  174. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  175. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  176. package/dist/components/Employee/DocumentSigner/index.d.ts +2 -1
  177. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +1 -1
  178. package/dist/components/Employee/EmployeeList/EmployeeList.js +38 -38
  179. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  180. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  181. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  182. package/dist/components/Employee/Landing/Landing.d.ts +1 -1
  183. package/dist/components/Employee/Landing/Landing.js +5 -5
  184. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  185. package/dist/components/Employee/Landing/index.d.ts +1 -0
  186. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.d.ts +27 -0
  187. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js +29 -0
  188. package/dist/components/Employee/OnboardingFlow/OnboardingFlow.js.map +1 -0
  189. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js +107 -0
  190. package/dist/components/Employee/OnboardingFlow/onboardingStateMachine.js.map +1 -0
  191. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.d.ts +1 -1
  192. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +30 -30
  193. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  194. package/dist/components/Employee/OnboardingSummary/index.d.ts +1 -0
  195. package/dist/components/Employee/PaymentMethod/PaymentMethod.d.ts +1 -1
  196. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +68 -68
  197. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  198. package/dist/components/Employee/PaymentMethod/index.d.ts +1 -0
  199. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  200. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  201. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +1 -1
  202. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +1 -1
  203. package/dist/components/Employee/Profile/Profile.d.ts +1 -1
  204. package/dist/components/Employee/Profile/Profile.js +89 -88
  205. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  206. package/dist/components/Employee/Profile/SelfPersonalDetails.d.ts +2 -2
  207. package/dist/components/Employee/Profile/index.d.ts +1 -0
  208. package/dist/components/Employee/Profile/useProfile.js +3 -4
  209. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  210. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +17 -0
  211. package/dist/components/{Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js → Employee/SelfOnboardingFlow/SelfOnboardingComponents.js} +7 -7
  212. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -0
  213. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.d.ts +2 -0
  214. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js +22 -0
  215. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingFlow.js.map +1 -0
  216. package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.js → Employee/SelfOnboardingFlow/selfOnboardingMachine.js} +4 -4
  217. package/dist/components/Employee/SelfOnboardingFlow/selfOnboardingMachine.js.map +1 -0
  218. package/dist/components/Employee/Taxes/StateForm.d.ts +3 -3
  219. package/dist/components/Employee/Taxes/StateForm.js +1 -1
  220. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  221. package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
  222. package/dist/components/Employee/Taxes/Taxes.js +82 -78
  223. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  224. package/dist/components/Employee/Taxes/index.d.ts +1 -0
  225. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  226. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  227. package/dist/components/Employee/index.d.ts +4 -1
  228. package/dist/components/Employee/index.js +20 -16
  229. package/dist/components/Employee/index.js.map +1 -1
  230. package/dist/components/Flow/useFlow.d.ts +2 -1
  231. package/dist/components/Flow/useFlow.js.map +1 -1
  232. package/dist/components/index.d.ts +1 -1
  233. package/dist/contexts/ApiProvider/ApiProvider.d.ts +1 -1
  234. package/dist/contexts/ApiProvider/ApiProvider.js +17 -17
  235. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  236. package/dist/contexts/GustoApiProvider/index.d.ts +1 -0
  237. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -7
  238. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +16 -14
  239. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  240. package/dist/contexts/GustoProvider/index.d.ts +2 -1
  241. package/dist/contexts/LocaleProvider/index.d.ts +1 -0
  242. package/dist/contexts/ThemeProvider/index.d.ts +1 -0
  243. package/dist/contexts/index.d.ts +1 -0
  244. package/dist/hooks/useForkRef/index.d.ts +1 -0
  245. package/dist/i18n/I18n.d.ts +2 -0
  246. package/dist/i18n/I18n.js +27 -21
  247. package/dist/i18n/I18n.js.map +1 -1
  248. package/dist/i18n/index.d.ts +1 -0
  249. package/dist/index.d.ts +1 -2
  250. package/dist/index.js +7 -13
  251. package/dist/index.js.map +1 -1
  252. package/dist/shared/constants.d.ts +1 -1
  253. package/dist/shared/constants.js +1 -1
  254. package/dist/shared/constants.js.map +1 -1
  255. package/dist/style.css +1 -1
  256. package/dist/types/Helpers.d.ts +14 -0
  257. package/dist/types/i18next.d.ts +60 -61
  258. package/package.json +1 -1
  259. package/dist/components/Company/BankAccount/BankAccountFlow.d.ts +0 -5
  260. package/dist/components/Company/BankAccount/BankAccountFlow.js +0 -24
  261. package/dist/components/Company/BankAccount/BankAccountFlow.js.map +0 -1
  262. package/dist/components/Company/DocumentSignerFlow/DocumentList/Actions.js.map +0 -1
  263. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.d.ts +0 -13
  264. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js +0 -69
  265. package/dist/components/Company/DocumentSignerFlow/DocumentList/DocumentList.js.map +0 -1
  266. package/dist/components/Company/DocumentSignerFlow/DocumentList/Head.js.map +0 -1
  267. package/dist/components/Company/DocumentSignerFlow/DocumentList/List.js.map +0 -1
  268. package/dist/components/Company/DocumentSignerFlow/DocumentList/ManageSignatories.js.map +0 -1
  269. package/dist/components/Company/DocumentSignerFlow/DocumentList/useDocumentList.js.map +0 -1
  270. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.d.ts +0 -6
  271. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js +0 -35
  272. package/dist/components/Company/DocumentSignerFlow/DocumentSignerFlow.js.map +0 -1
  273. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Actions.js.map +0 -1
  274. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Form.js.map +0 -1
  275. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Head.js.map +0 -1
  276. package/dist/components/Company/DocumentSignerFlow/SignatureForm/Preview.js.map +0 -1
  277. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.d.ts +0 -17
  278. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js +0 -78
  279. package/dist/components/Company/DocumentSignerFlow/SignatureForm/SignatureForm.js.map +0 -1
  280. package/dist/components/Company/DocumentSignerFlow/SignatureForm/useSignatureForm.js.map +0 -1
  281. package/dist/components/Company/DocumentSignerFlow/assignSignatoryState.js.map +0 -1
  282. package/dist/components/Company/DocumentSignerFlow/documentSignerStateMachine.js.map +0 -1
  283. package/dist/components/Company/DocumentSignerFlow/index.d.ts +0 -1
  284. package/dist/components/Company/DocumentSignerFlow/stateMachine.js.map +0 -1
  285. package/dist/components/Company/Locations/LocationsFlow.d.ts +0 -5
  286. package/dist/components/Company/Locations/LocationsFlow.js +0 -21
  287. package/dist/components/Company/Locations/LocationsFlow.js.map +0 -1
  288. package/dist/components/Company/StateTaxes/StateTaxesFlow.d.ts +0 -5
  289. package/dist/components/Company/StateTaxes/StateTaxesFlow.js +0 -21
  290. package/dist/components/Company/StateTaxes/StateTaxesFlow.js.map +0 -1
  291. package/dist/components/Company/StateTaxes/StateTaxesFlowComponents.js.map +0 -1
  292. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.d.ts +0 -5
  293. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js +0 -21
  294. package/dist/components/Employee/DocumentSigner/DocumentSignerFlow.js.map +0 -1
  295. package/dist/components/Flow/EmployeeOnboardingFlow.d.ts +0 -27
  296. package/dist/components/Flow/EmployeeOnboardingFlow.js +0 -29
  297. package/dist/components/Flow/EmployeeOnboardingFlow.js.map +0 -1
  298. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.d.ts +0 -5
  299. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingComponents.js.map +0 -1
  300. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.d.ts +0 -13
  301. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js +0 -26
  302. package/dist/components/Flow/EmployeeSelfOnboardingFlow/EmployeeSelfOnboardingFlow.js.map +0 -1
  303. package/dist/components/Flow/StateMachines/employeeOnboarding.js +0 -136
  304. package/dist/components/Flow/StateMachines/employeeOnboarding.js.map +0 -1
  305. package/dist/components/Flow/StateMachines/employeeSelfOnboarding.js.map +0 -1
  306. package/dist/components/Flow/StateMachines/index.d.ts +0 -2
  307. package/dist/components/Flow/index.d.ts +0 -2
  308. package/dist/components/Flow/index.js +0 -7
  309. package/dist/components/Flow/index.js.map +0 -1
  310. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.d.ts +0 -0
  311. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Actions.js +0 -0
  312. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.d.ts +0 -0
  313. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/Head.js +0 -0
  314. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.d.ts +0 -0
  315. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/List.js +0 -0
  316. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.d.ts +0 -0
  317. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.js +0 -0
  318. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js +0 -0
  319. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/ManageSignatories.module.scss.js.map +0 -0
  320. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/DocumentList/useDocumentList.d.ts +0 -0
  321. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.d.ts +0 -0
  322. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Actions.js +0 -0
  323. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.d.ts +0 -0
  324. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Form.js +0 -0
  325. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.d.ts +0 -0
  326. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Head.js +0 -0
  327. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.d.ts +0 -0
  328. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/Preview.js +0 -0
  329. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/SignatureForm/useSignatureForm.d.ts +0 -0
  330. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.d.ts +0 -0
  331. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/assignSignatoryState.js +0 -0
  332. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.d.ts +0 -0
  333. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/documentSignerStateMachine.js +0 -0
  334. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.d.ts +0 -0
  335. /package/dist/components/Company/{DocumentSignerFlow → DocumentSigner}/stateMachine.js +0 -0
  336. /package/dist/components/Company/{DocumentSignerFlow/useDocumentSignerFlow.d.ts → DocumentSigner/useDocumentSigner.d.ts} +0 -0
  337. /package/dist/components/Company/StateTaxes/{StateTaxesFlowComponents.d.ts → StateTaxesComponents.d.ts} +0 -0
  338. /package/dist/components/{Flow/StateMachines/employeeOnboarding.d.ts → Employee/OnboardingFlow/onboardingStateMachine.d.ts} +0 -0
  339. /package/dist/components/{Flow/StateMachines/employeeSelfOnboarding.d.ts → Employee/SelfOnboardingFlow/selfOnboardingMachine.d.ts} +0 -0
@@ -1,37 +1,39 @@
1
- import { jsx as t, jsxs as I } from "react/jsx-runtime";
2
- import { useTranslation as Y } from "react-i18next";
3
- import { useState as M, useMemo as q, useEffect as B } from "react";
1
+ import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
+ import { useTranslation as q } from "react-i18next";
3
+ import { useState as M, useMemo as y, useEffect as B } from "react";
4
4
  import { z as A } from "zod";
5
- import { useForm as C, FormProvider as O } from "react-hook-form";
5
+ import { useForm as O, FormProvider as T } from "react-hook-form";
6
6
  import { zodResolver as R } from "@hookform/resolvers/zod";
7
- import { useGarnishmentsListSuspense as y, invalidateGarnishmentsList as T } from "@gusto/embedded-api/react-query/garnishmentsList";
8
- import { useGarnishmentsCreateMutation as G } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
- import { useGarnishmentsUpdateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
- import { useQueryClient as z } from "@tanstack/react-query";
11
- import { DeductionSchema as H, DeductionsProvider as V } from "./useDeductions.js";
12
- import { BaseComponent as Q } from "../../Base/Base.js";
13
- import { useBase as k } from "../../Base/useBase.js";
14
- import { Form as L } from "../../Common/Form/Form.js";
15
- import { useI18n as J } from "../../../i18n/I18n.js";
7
+ import { useGarnishmentsListSuspense as G, invalidateGarnishmentsList as L } from "@gusto/embedded-api/react-query/garnishmentsList";
8
+ import { useGarnishmentsCreateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
+ import { useGarnishmentsUpdateMutation as z } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
+ import { useQueryClient as H } from "@tanstack/react-query";
11
+ import { DeductionSchema as V, DeductionsProvider as Q } from "./useDeductions.js";
12
+ import { BaseComponent as k } from "../../Base/Base.js";
13
+ import { useBase as J } from "../../Base/useBase.js";
14
+ import { Form as S } from "../../Common/Form/Form.js";
15
+ import { useComponentDictionary as K, useI18n as W } from "../../../i18n/I18n.js";
16
16
  import { componentEvents as s } from "../../../shared/constants.js";
17
- import { Actions as S } from "./Actions.js";
18
- import { IncludeDeductionsForm as K } from "./IncludeDeductionsForm.js";
19
- import { Head as N } from "./Head.js";
20
- import { DeductionForm as W } from "./DeductionForm.js";
21
- import { DeductionsList as X } from "./DeductionsList.js";
22
- import { useFlow as Z } from "../../Flow/useFlow.js";
17
+ import { Actions as N } from "./Actions.js";
18
+ import { IncludeDeductionsForm as X } from "./IncludeDeductionsForm.js";
19
+ import { Head as _ } from "./Head.js";
20
+ import { DeductionForm as Z } from "./DeductionForm.js";
21
+ import { DeductionsList as $ } from "./DeductionsList.js";
22
+ import { useFlow as ee } from "../../Flow/useFlow.js";
23
23
  A.object({ includeDeductions: A.enum(["Yes", "No"]) });
24
- function $(n) {
25
- return /* @__PURE__ */ t(Q, { ...n, children: /* @__PURE__ */ t(ee, { ...n, children: n.children }) });
24
+ function te(n) {
25
+ return /* @__PURE__ */ t(k, { ...n, children: /* @__PURE__ */ t(ne, { ...n, children: n.children }) });
26
26
  }
27
- const ee = ({ employeeId: n, className: d }) => {
28
- const { onEvent: r, baseSubmitHandler: E } = k(), h = z(), { data: _ } = y({ employeeId: n }), f = _.garnishmentList, { mutateAsync: p, isPending: b } = j({
29
- onSettled: () => T(h, [n])
30
- }), { mutateAsync: x, isPending: w } = G({
31
- onSettled: () => T(h, [n])
32
- }), F = f.filter((i) => i.active), [u, m] = M(F.length < 1 ? "INITIAL" : "LIST"), [e, a] = M(null);
33
- J("Employee.Deductions");
34
- const l = q(() => ({
27
+ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
28
+ const { onEvent: i, baseSubmitHandler: h } = J(), f = H();
29
+ K("Employee.Deductions", a);
30
+ const { data: b } = G({ employeeId: n }), p = b.garnishmentList, { mutateAsync: g, isPending: x } = z({
31
+ onSettled: () => L(f, [n])
32
+ }), { mutateAsync: w, isPending: F } = j({
33
+ onSettled: () => L(f, [n])
34
+ }), U = p.filter((r) => r.active), [u, m] = M(U.length < 1 ? "INITIAL" : "LIST"), [e, l] = M(null);
35
+ W("Employee.Deductions");
36
+ const D = y(() => ({
35
37
  amount: e?.amount ? Number(e.amount) : 0,
36
38
  description: e?.description ?? "",
37
39
  times: e?.times ?? null,
@@ -41,19 +43,19 @@ const ee = ({ employeeId: n, className: d }) => {
41
43
  deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
42
44
  active: !0,
43
45
  courtOrdered: e?.courtOrdered ?? !1
44
- }), [e]), g = C({
46
+ }), [e]), P = O({
45
47
  // resolver: zodResolver(IncludeDeductionsSchema),
46
48
  defaultValues: { includeDeductions: "No" }
47
- }), D = C({
48
- resolver: R(H),
49
- defaultValues: l
50
- }), { reset: P } = D;
49
+ }), E = O({
50
+ resolver: R(V),
51
+ defaultValues: D
52
+ }), { reset: v } = E;
51
53
  B(() => {
52
- P(l);
53
- }, [e, l, P, u]);
54
- const U = async (i) => {
55
- await E(i, async (o) => {
56
- const { garnishment: c } = await p({
54
+ v(D);
55
+ }, [e, D, v, u]);
56
+ const Y = async (r) => {
57
+ await h(r, async (o) => {
58
+ const { garnishment: c } = await g({
57
59
  request: {
58
60
  garnishmentId: o.uuid,
59
61
  requestBody: {
@@ -64,28 +66,28 @@ const ee = ({ employeeId: n, className: d }) => {
64
66
  }
65
67
  }
66
68
  });
67
- r(s.EMPLOYEE_DEDUCTION_DELETED, c);
69
+ i(s.EMPLOYEE_DEDUCTION_DELETED, c);
68
70
  });
69
- }, v = async (i) => {
70
- await E(i, async (o) => {
71
+ }, I = async (r) => {
72
+ await h(r, async (o) => {
71
73
  if ("includeDeductions" in o)
72
74
  if (o.includeDeductions === "Yes")
73
- m("ADD"), r(s.EMPLOYEE_DEDUCTION_ADD);
75
+ m("ADD"), i(s.EMPLOYEE_DEDUCTION_ADD);
74
76
  else {
75
- r(s.EMPLOYEE_DEDUCTION_DONE);
77
+ i(s.EMPLOYEE_DEDUCTION_DONE);
76
78
  return;
77
79
  }
78
80
  if (!("includeDeductions" in o)) {
79
81
  if (u === "ADD") {
80
- const { garnishment: c } = await x({
82
+ const { garnishment: c } = await w({
81
83
  request: {
82
84
  employeeId: n,
83
85
  requestBody: { ...o, times: o.recurring ? null : 1 }
84
86
  }
85
87
  });
86
- r(s.EMPLOYEE_DEDUCTION_CREATED, c);
88
+ i(s.EMPLOYEE_DEDUCTION_CREATED, c);
87
89
  } else if (u === "EDIT") {
88
- const { garnishment: c } = await p({
90
+ const { garnishment: c } = await g({
89
91
  request: {
90
92
  garnishmentId: e?.uuid ?? "",
91
93
  requestBody: {
@@ -95,61 +97,61 @@ const ee = ({ employeeId: n, className: d }) => {
95
97
  }
96
98
  }
97
99
  });
98
- r(s.EMPLOYEE_DEDUCTION_UPDATED, c), a(null);
100
+ i(s.EMPLOYEE_DEDUCTION_UPDATED, c), l(null);
99
101
  }
100
102
  m("LIST");
101
103
  }
102
104
  });
103
105
  };
104
106
  return /* @__PURE__ */ t("section", { className: d, children: /* @__PURE__ */ t(
105
- V,
107
+ Q,
106
108
  {
107
109
  value: {
108
- isPending: w || b,
110
+ isPending: F || x,
109
111
  employeeId: n,
110
112
  mode: u,
111
- deductions: f,
113
+ deductions: p,
112
114
  handleAdd: () => {
113
115
  m("ADD");
114
116
  },
115
117
  handleCancel: () => {
116
- m("LIST"), a(null);
118
+ m("LIST"), l(null);
117
119
  },
118
- handleDelete: U,
119
- handleEdit: (i) => {
120
- m("EDIT"), a(i);
120
+ handleDelete: Y,
121
+ handleEdit: (r) => {
122
+ m("EDIT"), l(r);
121
123
  },
122
124
  handlePassthrough: () => {
123
- r(s.EMPLOYEE_DEDUCTION_DONE);
125
+ i(s.EMPLOYEE_DEDUCTION_DONE);
124
126
  }
125
127
  },
126
- children: u === "INITIAL" ? /* @__PURE__ */ t(O, { ...g, children: /* @__PURE__ */ I(L, { onSubmit: g.handleSubmit(v), children: [
127
- /* @__PURE__ */ t(N, {}),
128
- /* @__PURE__ */ t(K, {}),
129
- /* @__PURE__ */ t(S, {})
130
- ] }) }) : /* @__PURE__ */ t(O, { ...D, children: /* @__PURE__ */ I(L, { onSubmit: D.handleSubmit(v), children: [
131
- /* @__PURE__ */ t(N, {}),
128
+ children: u === "INITIAL" ? /* @__PURE__ */ t(T, { ...P, children: /* @__PURE__ */ C(S, { onSubmit: P.handleSubmit(I), children: [
129
+ /* @__PURE__ */ t(_, {}),
132
130
  /* @__PURE__ */ t(X, {}),
133
- /* @__PURE__ */ t(W, {}),
134
- /* @__PURE__ */ t(S, {})
131
+ /* @__PURE__ */ t(N, {})
132
+ ] }) }) : /* @__PURE__ */ t(T, { ...E, children: /* @__PURE__ */ C(S, { onSubmit: E.handleSubmit(I), children: [
133
+ /* @__PURE__ */ t(_, {}),
134
+ /* @__PURE__ */ t($, {}),
135
+ /* @__PURE__ */ t(Z, {}),
136
+ /* @__PURE__ */ t(N, {})
135
137
  ] }) })
136
138
  }
137
139
  ) });
138
- }, Le = () => {
139
- const { employeeId: n, onEvent: d } = Z(), { t: r } = Y("common");
140
+ }, Ne = () => {
141
+ const { employeeId: n, onEvent: d } = ee(), { t: a } = q("common");
140
142
  if (!n)
141
143
  throw new Error(
142
- r("errors.missingParamsOrContext", {
144
+ a("errors.missingParamsOrContext", {
143
145
  component: "Deductions",
144
146
  param: "employeeId",
145
147
  provider: "FlowProvider"
146
148
  })
147
149
  );
148
- return /* @__PURE__ */ t($, { employeeId: n, onEvent: d });
150
+ return /* @__PURE__ */ t(te, { employeeId: n, onEvent: d });
149
151
  };
150
152
  export {
151
- $ as Deductions,
152
- Le as DeductionsContextual,
153
- ee as Root
153
+ te as Deductions,
154
+ Ne as DeductionsContextual,
155
+ ne as Root
154
156
  };
155
157
  //# sourceMappingURL=Deductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n useGarnishmentsListSuspense,\n invalidateGarnishmentsList,\n} from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useQueryClient } from '@tanstack/react-query'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport type { EmployeeOnboardingContextInterface } from '@/components/Flow/EmployeeOnboardingFlow'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface DeductionsProps extends CommonComponentInterface {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode('LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<EmployeeOnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","invalidateGarnishmentsList","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyCgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,CAAA;AAG9E,SAASC,EAAWC,GAAiD;AAExE,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACO,MAAMG,KAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,QAAiC;AAClE,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAcC,EAAe,GAE7B,EAAE,MAAAC,EAAK,IAAIC,EAA4B,EAAE,YAAAR,GAAY,GACrDS,IAAaF,EAAK,iBAGlB,EAAE,aAAaG,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMC,EAA2BR,GAAa,CAACL,CAAU,CAAC;AAAA,EAAA,CACtE,GACG,EAAE,aAAac,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMH,EAA2BR,GAAa,CAACL,CAAU,CAAC;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AI;AAAA,MACRoD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MACX,CAAA;AAAA,IACH;AAEK,SAAA,gBAAAvD,EAACF,GAAW,EAAA,YAAAK,GAAwB,SAAAE,EAAkB,CAAA;AAC/D;"}
1
+ {"version":3,"file":"Deductions.js","sources":["../../../../src/components/Employee/Deductions/Deductions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEffect, useMemo, useState } from 'react'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n useGarnishmentsListSuspense,\n invalidateGarnishmentsList,\n} from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { type Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useQueryClient } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n type DeductionInputs,\n type DeductionPayload,\n DeductionSchema,\n DeductionsProvider,\n type MODE,\n} from './useDeductions'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Actions } from '@/components/Employee/Deductions/Actions'\nimport { IncludeDeductionsForm } from '@/components/Employee/Deductions/IncludeDeductionsForm'\nimport { Head } from '@/components/Employee/Deductions/Head'\nimport { DeductionForm } from '@/components/Employee/Deductions/DeductionForm'\nimport { DeductionsList } from '@/components/Employee/Deductions/DeductionsList'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface DeductionsProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\nexport function Deductions(props: DeductionsProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\nexport const Root = ({ employeeId, className, dictionary }: DeductionsProps) => {\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n useComponentDictionary('Employee.Deductions', dictionary)\n\n const { data } = useGarnishmentsListSuspense({ employeeId })\n const deductions = data.garnishmentList!\n\n // Used for deletion or edit of deduction\n const { mutateAsync: updateDeduction, isPending: isPendingUpdate } =\n useGarnishmentsUpdateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation({\n onSettled: () => invalidateGarnishmentsList(queryClient, [employeeId]),\n })\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n const [mode, setMode] = useState<MODE>(activeDeductions.length < 1 ? 'INITIAL' : 'LIST')\n const [currentDeduction, setCurrentDeduction] = useState<Garnishment | null>(null)\n useI18n('Employee.Deductions')\n\n const defaultValues: DeductionInputs = useMemo(() => {\n return {\n amount: currentDeduction?.amount ? Number(currentDeduction.amount) : 0,\n description: currentDeduction?.description ?? '',\n times: currentDeduction?.times ?? null,\n recurring: currentDeduction?.recurring?.toString() ?? 'true',\n annualMaximum: currentDeduction?.annualMaximum\n ? Number(currentDeduction.annualMaximum)\n : null,\n payPeriodMaximum: currentDeduction?.payPeriodMaximum\n ? Number(currentDeduction.payPeriodMaximum)\n : null,\n deductAsPercentage: currentDeduction?.deductAsPercentage?.toString() ?? 'true',\n active: true,\n courtOrdered: currentDeduction?.courtOrdered ?? false,\n } as DeductionInputs\n }, [currentDeduction])\n\n const includeDeductionsFormMethods = useForm<IncludeDeductionsPayload>({\n // resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const formMethods = useForm<DeductionInputs, unknown, DeductionPayload>({\n resolver: zodResolver(DeductionSchema),\n defaultValues,\n })\n\n const { reset: resetForm } = formMethods\n\n useEffect(() => {\n resetForm(defaultValues)\n }, [currentDeduction, defaultValues, resetForm, mode])\n\n const handleDelete = async (deduction: Garnishment) => {\n await baseSubmitHandler(deduction, async payload => {\n //Deletion of deduction is simply updating it with active: false\n const { garnishment } = await updateDeduction({\n request: {\n garnishmentId: payload.uuid,\n requestBody: {\n ...payload,\n totalAmount: payload.totalAmount ?? undefined,\n active: false,\n version: payload.version as string,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DELETED, garnishment)\n })\n }\n const onSubmit: SubmitHandler<DeductionPayload | IncludeDeductionsPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n if ('includeDeductions' in payload) {\n if (payload.includeDeductions === 'Yes') {\n setMode('ADD')\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_ADD)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n return\n }\n }\n if (!('includeDeductions' in payload)) {\n if (mode === 'ADD') {\n const { garnishment: createDeductionResponse } = await createDeduction({\n request: {\n employeeId: employeeId,\n requestBody: { ...payload, times: payload.recurring ? null : 1 },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_CREATED, createDeductionResponse)\n } else if (mode === 'EDIT') {\n const { garnishment: updateDeductionResponse } = await updateDeduction({\n request: {\n garnishmentId: currentDeduction?.uuid ?? '',\n requestBody: {\n ...payload,\n version: currentDeduction?.version as string,\n times: payload.recurring ? null : 1,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_UPDATED, updateDeductionResponse)\n setCurrentDeduction(null)\n }\n setMode('LIST')\n }\n })\n }\n const handleAdd = () => {\n setMode('ADD')\n }\n const handleCancel = () => {\n setMode('LIST')\n setCurrentDeduction(null)\n }\n const handleEdit = (deduction: Garnishment) => {\n setMode('EDIT')\n setCurrentDeduction(deduction)\n }\n const handlePassthrough = () => {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_DONE)\n }\n return (\n <section className={className}>\n <DeductionsProvider\n value={{\n isPending: isPendingCreate || isPendingUpdate,\n employeeId,\n mode,\n deductions,\n handleAdd,\n handleCancel,\n handleDelete,\n handleEdit,\n handlePassthrough,\n }}\n >\n {mode === 'INITIAL' ? (\n <FormProvider {...includeDeductionsFormMethods}>\n <Form onSubmit={includeDeductionsFormMethods.handleSubmit(onSubmit)}>\n <Head />\n <IncludeDeductionsForm />\n <Actions />\n </Form>\n </FormProvider>\n ) : (\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Head />\n <DeductionsList />\n <DeductionForm />\n <Actions />\n </Form>\n </FormProvider>\n )}\n </DeductionsProvider>\n </section>\n )\n}\n\nexport const DeductionsContextual = () => {\n const { employeeId, onEvent } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Deductions',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <Deductions employeeId={employeeId} onEvent={onEvent} />\n}\n"],"names":["z","Deductions","props","jsx","BaseComponent","Root","employeeId","className","dictionary","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","invalidateGarnishmentsList","createDeduction","isPendingCreate","useGarnishmentsCreateMutation","activeDeductions","deduction","mode","setMode","useState","currentDeduction","setCurrentDeduction","useI18n","defaultValues","useMemo","includeDeductionsFormMethods","useForm","formMethods","zodResolver","DeductionSchema","resetForm","useEffect","handleDelete","payload","garnishment","componentEvents","onSubmit","createDeductionResponse","updateDeductionResponse","DeductionsProvider","FormProvider","jsxs","Form","Head","IncludeDeductionsForm","Actions","Deduct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gBQ,mBAfkB,MAAM;AAC9B,UAAAjB,EAAQoC,EAAgB,uBAAuB;AAAA,QACjD;AAAA,MAcM;AAAA,MAEC,UAASlB,MAAA,YACP,gBAAAxB,EAAA+C,GAAA,EAAc,GAAGf,GAChB,UAAC,gBAAAgB,EAAAC,GAAA,EAAK,UAAUjB,EAA6B,aAAaW,CAAQ,GAChE,UAAA;AAAA,QAAA,gBAAA3C,EAACkD,GAAK,EAAA;AAAA,0BACLC,GAAsB,EAAA;AAAA,0BACtBC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EACF,CAAA,IAEC,gBAAApD,EAAA+C,GAAA,EAAc,GAAGb,GAChB,UAAC,gBAAAc,EAAAC,GAAA,EAAK,UAAUf,EAAY,aAAaS,CAAQ,GAC/C,UAAA;AAAA,QAAA,gBAAA3C,EAACkD,GAAK,EAAA;AAAA,0BACLG,GAAe,EAAA;AAAA,0BACfC,GAAc,EAAA;AAAA,0BACdF,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,GAEaG,KAAuB,MAAM;AACxC,QAAM,EAAE,YAAApD,GAAY,SAAAG,EAAQ,IAAIkD,GAAoC,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACvD;AACH,UAAM,IAAI;AAAA,MACRsD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MACX,CAAA;AAAA,IACH;AAEK,SAAA,gBAAAzD,EAACF,IAAW,EAAA,YAAAK,GAAwB,SAAAG,EAAkB,CAAA;AAC/D;"}
@@ -1 +1,2 @@
1
+ import "./types/i18next.d.ts"
1
2
  export * from './Deductions';
@@ -8,9 +8,8 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
8
8
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
9
  import "../../Base/useBase.js";
10
10
  import "dompurify";
11
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
13
- const g = r.object({
11
+ import { createCompoundContext as n } from "../../Base/createCompoundContext.js";
12
+ const b = r.object({
14
13
  active: r.boolean(),
15
14
  amount: r.number().min(0).transform(String),
16
15
  description: r.string().min(1),
@@ -21,10 +20,10 @@ const g = r.object({
21
20
  annualMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
22
21
  payPeriodMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
23
22
  deductAsPercentage: r.string().transform((t) => t === "true")
24
- }), [f, x] = o("DeductionsContext");
23
+ }), [g, f] = n("DeductionsContext");
25
24
  export {
26
- g as DeductionSchema,
27
- x as DeductionsProvider,
28
- f as useDeductions
25
+ b as DeductionSchema,
26
+ f as DeductionsProvider,
27
+ g as useDeductions
29
28
  };
30
29
  //# sourceMappingURL=useDeductions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
1
+ {"version":3,"file":"useDeductions.js","sources":["../../../../src/components/Employee/Deductions/useDeductions.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE = 'ADD' | 'LIST' | 'INITIAL' | 'EDIT'\n\nexport const DeductionSchema = z.object({\n active: z.boolean(),\n amount: z.number().min(0).transform(String),\n description: z.string().min(1),\n courtOrdered: z.boolean(),\n times: z.number().nullable(), //The number of times to apply the garnishment. Ignored if recurring is true.\n recurring: z.string().transform(val => val === 'true'),\n annualMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n payPeriodMaximum: z\n .number()\n .min(0)\n .transform(val => (val > 0 ? val.toString() : null))\n .nullable(),\n deductAsPercentage: z.string().transform(val => val === 'true'),\n})\n\nexport type DeductionInputs = z.input<typeof DeductionSchema>\nexport type DeductionPayload = z.output<typeof DeductionSchema>\n\ntype DeductionsContextType = {\n isPending: boolean\n deductions: Garnishment[]\n employeeId: string\n mode: MODE\n handleAdd: () => void\n handleCancel: () => void\n handleEdit: (deduction: Garnishment) => void\n handleDelete: (deduction: Garnishment) => void\n handlePassthrough: () => void\n}\nconst [useDeductions, DeductionsProvider] =\n createCompoundContext<DeductionsContextType>('DeductionsContext')\nexport { useDeductions, DeductionsProvider }\n"],"names":["DeductionSchema","z","val","useDeductions","DeductionsProvider","createCompoundContext"],"mappings":";;;;;;;;;;;AAMa,MAAAA,IAAkBC,EAAE,OAAO;AAAA,EACtC,QAAQA,EAAE,QAAQ;AAAA,EAClB,QAAQA,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,UAAU,MAAM;AAAA,EAC1C,aAAaA,EAAE,SAAS,IAAI,CAAC;AAAA,EAC7B,cAAcA,EAAE,QAAQ;AAAA,EACxB,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA,EAC3B,WAAWA,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAAA,EACrD,eAAeD,EACZ,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,kBAAkBD,EACf,OAAA,EACA,IAAI,CAAC,EACL,UAAU,CAAQC,MAAAA,IAAM,IAAIA,EAAI,SAAA,IAAa,IAAK,EAClD,SAAS;AAAA,EACZ,oBAAoBD,EAAE,SAAS,UAAU,CAAAC,MAAOA,MAAQ,MAAM;AAChE,CAAC,GAgBK,CAACC,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
@@ -7,11 +7,10 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "../../../Base/useBase.js";
9
9
  import "dompurify";
10
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
10
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
12
- const [C, D] = t("DocumentListContext");
11
+ const [x, C] = t("DocumentListContext");
13
12
  export {
14
- D as DocumentListProvider,
15
- C as useDocumentList
13
+ C as DocumentListProvider,
14
+ x as useDocumentList
16
15
  };
17
16
  //# sourceMappingURL=useDocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
1
+ {"version":3,"file":"useDocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/useDocumentList.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype DocumentListContextType = {\n employeeForms: Form[]\n hasSignedAllForms: boolean\n handleContinue: () => void\n handleRequestFormToSign: (form: Form) => void\n documentListError: Error | null\n formToSign?: Form\n}\n\nconst [useDocumentList, DocumentListProvider] =\n createCompoundContext<DocumentListContextType>('DocumentListContext')\nexport { useDocumentList, DocumentListProvider }\n"],"names":["useDocumentList","DocumentListProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAYA,MAAM,CAACA,GAAiBC,CAAoB,IAC1CC,EAA+C,qBAAqB;"}
@@ -0,0 +1,11 @@
1
+ import { DocumentList } from './DocumentList/DocumentList';
2
+ import { SignatureForm } from './SignatureForm/SignatureForm';
3
+ import { BaseComponentInterface } from '../../Base';
4
+ export interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {
5
+ employeeId: string;
6
+ }
7
+ export declare const DocumentSigner: {
8
+ ({ employeeId, onEvent, dictionary }: DocumentSignerProps): import("react/jsx-runtime").JSX.Element;
9
+ DocumentList: typeof DocumentList;
10
+ SignatureForm: typeof SignatureForm;
11
+ };
@@ -0,0 +1,27 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { createMachine as c } from "robot3";
3
+ import { DocumentListContextual as p } from "./documentSignerStateMachine.js";
4
+ import { documentSignerMachine as u } from "./stateMachine.js";
5
+ import { DocumentList as a } from "./DocumentList/DocumentList.js";
6
+ import { SignatureForm as f } from "./SignatureForm/SignatureForm.js";
7
+ import { Flow as s } from "../../Flow/Flow.js";
8
+ import { useComponentDictionary as g } from "../../../i18n/I18n.js";
9
+ const o = ({ employeeId: t, onEvent: m, dictionary: r }) => {
10
+ g("Employee.DocumentSigner", r);
11
+ const e = c(
12
+ "index",
13
+ u,
14
+ (n) => ({
15
+ ...n,
16
+ component: p,
17
+ employeeId: t
18
+ })
19
+ );
20
+ return /* @__PURE__ */ i(s, { machine: e, onEvent: m });
21
+ };
22
+ o.DocumentList = a;
23
+ o.SignatureForm = f;
24
+ export {
25
+ o as DocumentSigner
26
+ };
27
+ //# sourceMappingURL=DocumentSigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Employee/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport {\n DocumentListContextual,\n type DocumentSignerContextInterface,\n} from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport { DocumentList } from './DocumentList/DocumentList'\nimport { SignatureForm } from './SignatureForm/SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Employee.DocumentSigner'> {\n employeeId: string\n}\n\nexport const DocumentSigner = ({ employeeId, onEvent, dictionary }: DocumentSignerProps) => {\n useComponentDictionary('Employee.DocumentSigner', dictionary)\n\n const documentSigner = createMachine(\n 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: DocumentListContextual,\n employeeId,\n }),\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSigner","employeeId","onEvent","dictionary","useComponentDictionary","documentSigner","createMachine","documentSignerMachine","initialContext","DocumentListContextual","jsx","Flow","DocumentList","SignatureForm"],"mappings":";;;;;;;;AAgBO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,GAAY,SAAAC,GAAS,YAAAC,QAAsC;AAC1F,EAAAC,EAAuB,2BAA2BD,CAAU;AAE5D,QAAME,IAAiBC;AAAA,IACrB;AAAA,IACAC;AAAA,IACA,CAACC,OAAoD;AAAA,MACnD,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,YAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAgB,SAAAH,EAAkB,CAAA;AAC1D;AAEAF,EAAe,eAAeY;AAC9BZ,EAAe,gBAAgBa;"}
@@ -7,11 +7,10 @@ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "../../../Base/useBase.js";
9
9
  import "dompurify";
10
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
10
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
12
- const [C, F] = o("SignatureFormContext");
11
+ const [x, C] = o("SignatureFormContext");
13
12
  export {
14
- F as SignatureFormProvider,
15
- C as useSignatureForm
13
+ C as SignatureFormProvider,
14
+ x as useSignatureForm
16
15
  };
17
16
  //# sourceMappingURL=useSignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"useSignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.ts"],"sourcesContent":["import type { Form } from '@gusto/embedded-api/models/components/form'\nimport { createCompoundContext } from '@/components/Base'\n\ntype SignatureFormContextType = {\n form: Form\n pdfUrl?: string | null\n handleBack: () => void\n isPending: boolean\n}\n\nconst [useSignatureForm, SignatureFormProvider] =\n createCompoundContext<SignatureFormContextType>('SignatureFormContext')\nexport { useSignatureForm, SignatureFormProvider }\n"],"names":["useSignatureForm","SignatureFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAUA,MAAM,CAACA,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
@@ -1 +1,2 @@
1
- export * from './DocumentSignerFlow';
1
+ import "./types/i18next.d.ts"
2
+ export * from './DocumentSigner';
@@ -1,5 +1,5 @@
1
1
  import { BaseComponentInterface, CommonComponentInterface } from '../../Base/Base';
2
- interface EmployeeListProps extends CommonComponentInterface {
2
+ interface EmployeeListProps extends CommonComponentInterface<'Employee.EmployeeList'> {
3
3
  companyId: string;
4
4
  }
5
5
  export declare function EmployeeList(props: EmployeeListProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,29 @@
1
- import { jsx as n, jsxs as Y } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as F } from "react/jsx-runtime";
2
2
  import { useState as y } from "react";
3
- import { useEmployeesListSuspense as F, invalidateEmployeesList as U } from "@gusto/embedded-api/react-query/employeesList";
4
- import { useEmployeesDeleteMutation as q } from "@gusto/embedded-api/react-query/employeesDelete";
5
- import { useEmployeesUpdateOnboardingStatusMutation as W } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
6
- import { useQueryClient as H } from "@tanstack/react-query";
7
- import { EmployeeListProvider as j } from "./useEmployeeList.js";
3
+ import { useEmployeesListSuspense as U, invalidateEmployeesList as q } from "@gusto/embedded-api/react-query/employeesList";
4
+ import { useEmployeesDeleteMutation as W } from "@gusto/embedded-api/react-query/employeesDelete";
5
+ import { useEmployeesUpdateOnboardingStatusMutation as H } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
6
+ import { useQueryClient as j } from "@tanstack/react-query";
7
+ import { EmployeeListProvider as k } from "./useEmployeeList.js";
8
8
  import { Actions as P } from "./Actions.js";
9
- import { BaseComponent as k } from "../../Base/Base.js";
10
- import { useBase as V } from "../../Base/useBase.js";
11
- import { Flex as Q } from "../../Common/Flex/Flex.js";
12
- import { useI18n as z } from "../../../i18n/I18n.js";
9
+ import { BaseComponent as V } from "../../Base/Base.js";
10
+ import { useBase as Q } from "../../Base/useBase.js";
11
+ import { Flex as z } from "../../Common/Flex/Flex.js";
12
+ import { useI18n as J, useComponentDictionary as K } from "../../../i18n/I18n.js";
13
13
  import { componentEvents as s, EmployeeOnboardingStatus as c } from "../../../shared/constants.js";
14
14
  import { Head as h } from "./Head.js";
15
15
  import { List as O } from "./List.js";
16
- import { useFlow as J } from "../../Flow/useFlow.js";
16
+ import { useFlow as X } from "../../Flow/useFlow.js";
17
17
  function m(o) {
18
- return /* @__PURE__ */ n(k, { ...o, children: /* @__PURE__ */ n(K, { ...o, children: o.children }) });
18
+ return /* @__PURE__ */ n(V, { ...o, children: /* @__PURE__ */ n(Z, { ...o, children: o.children }) });
19
19
  }
20
- function K({ companyId: o, className: l, children: u }) {
21
- z("Employee.EmployeeList");
22
- const { onEvent: a, baseSubmitHandler: i } = V(), [p, r] = y(1), [g, A] = y(5), N = H(), { data: f } = F({ companyId: o, page: p, per: g }), { httpMeta: I, employeeList: L } = f, D = L, { mutateAsync: _ } = q(), { mutateAsync: M } = W(), E = Number(I.response.headers.get("x-total-pages") ?? 1), S = (e) => {
23
- A(e);
24
- }, w = () => {
25
- r(1);
20
+ function Z({ companyId: o, className: l, children: p, dictionary: g }) {
21
+ J("Employee.EmployeeList"), K("Employee.EmployeeList", g);
22
+ const { onEvent: a, baseSubmitHandler: i } = Q(), [u, r] = y(1), [A, L] = y(5), N = j(), { data: f } = U({ companyId: o, page: u, per: A }), { httpMeta: D, employeeList: I } = f, _ = I, { mutateAsync: M } = W(), { mutateAsync: S } = H(), E = Number(D.response.headers.get("x-total-pages") ?? 1), w = (e) => {
23
+ L(e);
26
24
  }, b = () => {
25
+ r(1);
26
+ }, C = () => {
27
27
  r((e) => Math.max(e - 1, 1));
28
28
  }, R = () => {
29
29
  r((e) => Math.min(e + 1, E));
@@ -31,11 +31,11 @@ function K({ companyId: o, className: l, children: u }) {
31
31
  r(E);
32
32
  }, x = async (e) => {
33
33
  await i(e, async (t) => {
34
- await _({
34
+ await M({
35
35
  request: { employeeId: t }
36
- }), await U(N, [o]), a(s.EMPLOYEE_DELETED, { employeeId: t });
36
+ }), await q(N, [o]), a(s.EMPLOYEE_DELETED, { employeeId: t });
37
37
  });
38
- }, C = async (e) => {
38
+ }, v = async (e) => {
39
39
  await i(e, async (t) => {
40
40
  await d({
41
41
  employeeId: t,
@@ -45,7 +45,7 @@ function K({ companyId: o, className: l, children: u }) {
45
45
  onboardingStatus: c.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW
46
46
  });
47
47
  });
48
- }, v = async (e) => {
48
+ }, B = async (e) => {
49
49
  await i(e, async (t) => {
50
50
  await d({
51
51
  employeeId: t,
@@ -53,15 +53,15 @@ function K({ companyId: o, className: l, children: u }) {
53
53
  });
54
54
  });
55
55
  }, d = async (e) => {
56
- await i(e, async ({ employeeId: t, status: B }) => {
57
- const { employeeOnboardingStatus: G } = await M({
58
- request: { employeeId: t, requestBody: { onboardingStatus: B } }
56
+ await i(e, async ({ employeeId: t, status: G }) => {
57
+ const { employeeOnboardingStatus: Y } = await S({
58
+ request: { employeeId: t, requestBody: { onboardingStatus: G } }
59
59
  });
60
- a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, G);
60
+ a(s.EMPLOYEE_ONBOARDING_STATUS_UPDATED, Y);
61
61
  });
62
62
  };
63
63
  return /* @__PURE__ */ n("section", { className: l, children: /* @__PURE__ */ n(
64
- j,
64
+ k,
65
65
  {
66
66
  value: {
67
67
  handleEdit: (e, t) => {
@@ -70,22 +70,22 @@ function K({ companyId: o, className: l, children: u }) {
70
70
  handleNew: () => {
71
71
  a(s.EMPLOYEE_CREATE);
72
72
  },
73
- handleReview: C,
73
+ handleReview: v,
74
74
  handleDelete: x,
75
- employees: D,
76
- currentPage: p,
75
+ employees: _,
76
+ currentPage: u,
77
77
  totalPages: E,
78
- handleFirstPage: w,
79
- handlePreviousPage: b,
78
+ handleFirstPage: b,
79
+ handlePreviousPage: C,
80
80
  handleNextPage: R,
81
81
  handleLastPage: T,
82
- handleCancelSelfOnboarding: v,
83
- handleItemsPerPageChange: S,
82
+ handleCancelSelfOnboarding: B,
83
+ handleItemsPerPageChange: w,
84
84
  handleSkip: () => {
85
85
  a(s.EMPLOYEE_ONBOARDING_DONE);
86
86
  }
87
87
  },
88
- children: u || /* @__PURE__ */ Y(Q, { flexDirection: "column", children: [
88
+ children: p || /* @__PURE__ */ F(z, { flexDirection: "column", children: [
89
89
  /* @__PURE__ */ n(h, {}),
90
90
  /* @__PURE__ */ n(O, {}),
91
91
  /* @__PURE__ */ n(P, {})
@@ -96,12 +96,12 @@ function K({ companyId: o, className: l, children: u }) {
96
96
  m.Head = h;
97
97
  m.List = O;
98
98
  m.Actions = P;
99
- const Pe = () => {
100
- const { companyId: o, onEvent: l } = J();
99
+ const Oe = () => {
100
+ const { companyId: o, onEvent: l } = X();
101
101
  return /* @__PURE__ */ n(m, { companyId: o, onEvent: l });
102
102
  };
103
103
  export {
104
104
  m as EmployeeList,
105
- Pe as EmployeeListContextual
105
+ Oe as EmployeeListContextual
106
106
  };
107
107
  //# sourceMappingURL=EmployeeList.js.map