@gusto/embedded-react-sdk 0.14.0 → 0.15.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 (263) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/assets/icons/feature-icon-check.svg.js +10 -0
  3. package/dist/assets/icons/feature-icon-check.svg.js.map +1 -0
  4. package/dist/assets/icons/plus-circle.svg.js +10 -0
  5. package/dist/assets/icons/plus-circle.svg.js.map +1 -0
  6. package/dist/assets/icons/x-circle.svg.js +10 -0
  7. package/dist/assets/icons/x-circle.svg.js.map +1 -0
  8. package/dist/components/Base/Base.js +4 -4
  9. package/dist/components/Common/DataView/DataView.d.ts +2 -1
  10. package/dist/components/Common/DataView/DataView.js +19 -18
  11. package/dist/components/Common/DataView/DataView.js.map +1 -1
  12. package/dist/components/Common/PaginationControl/PaginationControl.js +36 -36
  13. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  14. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +3 -1
  15. package/dist/components/Common/SignatureForm/SignatureForm.js +13 -10
  16. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -6
  18. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormFields.js +14 -11
  20. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  21. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
  22. package/dist/components/Common/UI/Button/ButtonIcon.module.scss.js +1 -1
  23. package/dist/components/Common/index.d.ts +1 -0
  24. package/dist/components/Company/AssignSignatory/AssignSignatory.js +10 -7
  25. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -2
  27. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -6
  31. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +15 -13
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +13 -10
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +14 -12
  40. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  41. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  42. package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -3
  43. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  46. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +6 -4
  48. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  50. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  51. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  55. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  57. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  58. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -8
  59. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  60. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  61. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +14 -11
  62. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  63. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  64. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  65. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  66. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -12
  67. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  68. package/dist/components/Company/FederalTaxes/Form.js +4 -4
  69. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  70. package/dist/components/Company/Industry/Actions.js +8 -7
  71. package/dist/components/Company/Industry/Actions.js.map +1 -1
  72. package/dist/components/Company/Industry/Context.js +1 -1
  73. package/dist/components/Company/Industry/Edit.js +4 -2
  74. package/dist/components/Company/Industry/Edit.js.map +1 -1
  75. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  76. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  77. package/dist/components/Company/Locations/LocationForm/Form.js +7 -4
  78. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  79. package/dist/components/Company/Locations/LocationForm/LocationForm.js +17 -14
  80. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  81. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  82. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  83. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  84. package/dist/components/Company/Locations/LocationsList/List.js +22 -20
  85. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationsList/LocationsList.js +12 -9
  87. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +3 -1
  89. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  90. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  91. package/dist/components/Company/OnboardingOverview/Completed.js +3 -2
  92. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  93. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +7 -6
  94. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  95. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +9 -6
  96. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  97. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  98. package/dist/components/Company/PaySchedule/PaySchedule.js +34 -32
  99. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  100. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  101. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  102. package/dist/components/Company/PaySchedule/_parts/Edit.js +3 -2
  103. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -7
  105. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  106. package/dist/components/Company/PaySchedule/_parts/List.js +6 -6
  107. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  108. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  109. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  110. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  111. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  112. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  113. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  114. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  115. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  116. package/dist/components/Contractor/Address/Address.js +6 -3
  117. package/dist/components/Contractor/Address/Address.js.map +1 -1
  118. package/dist/components/Contractor/Address/Form.js +9 -6
  119. package/dist/components/Contractor/Address/Form.js.map +1 -1
  120. package/dist/components/Contractor/Address/useAddress.js +1 -1
  121. package/dist/components/Contractor/ContractorList/index.js +57 -55
  122. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  123. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +3 -1
  124. package/dist/components/Contractor/ContractorList/useContractorList.js +7 -6
  125. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  126. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -10
  127. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  128. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -2
  129. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  130. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  131. package/dist/components/Contractor/Submit/Submit.js +20 -19
  132. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  133. package/dist/components/Employee/Compensation/Actions.js +13 -12
  134. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  135. package/dist/components/Employee/Compensation/Compensation.js +144 -147
  136. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  137. package/dist/components/Employee/Compensation/Edit.js +27 -26
  138. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  139. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +4 -4
  140. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +6 -6
  141. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +20 -19
  142. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +1 -1
  143. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +3 -2
  144. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  145. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -7
  146. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  147. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  148. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  149. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  150. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +12 -9
  151. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  152. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  153. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  154. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  155. package/dist/components/Employee/EmployeeList/EmployeeList.js +15 -12
  156. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  157. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  158. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  159. package/dist/components/Employee/EmployeeList/List.js +43 -41
  160. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  161. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +3 -1
  162. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  163. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  164. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  165. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  166. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
  167. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  168. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +1 -1
  169. package/dist/components/Employee/Landing/Landing.js +3 -2
  170. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  171. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  172. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  173. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -2
  174. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  175. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
  176. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +4 -2
  177. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  178. package/dist/components/Employee/PaymentMethod/Split.js +4 -4
  179. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  180. package/dist/components/Employee/Profile/Actions.js +6 -5
  181. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  182. package/dist/components/Employee/Profile/AdminPersonalDetails.js +7 -6
  183. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  184. package/dist/components/Employee/Profile/HomeAddress.js +6 -4
  185. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  186. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +31 -28
  187. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  188. package/dist/components/Employee/Profile/useProfile.js +1 -1
  189. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  190. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  191. package/dist/components/Employee/StateTaxes/useStateTaxes.js +1 -1
  192. package/dist/components/Employee/Taxes/Actions.js +7 -6
  193. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  194. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  195. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  196. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  197. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +6 -0
  198. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +32 -0
  199. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +1 -0
  200. package/dist/components/Payroll/PayrollBlocker/{PayrollBlockerAlerts.d.ts → components/PayrollBlockerAlerts.d.ts} +1 -1
  201. package/dist/components/Payroll/PayrollBlocker/{PayrollBlockerAlerts.js → components/PayrollBlockerAlerts.js} +18 -17
  202. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -0
  203. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +41 -0
  204. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -0
  205. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.module.scss.js +8 -0
  206. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.module.scss.js.map +1 -0
  207. package/dist/components/Payroll/PayrollBlocker/index.d.ts +3 -1
  208. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +129 -67
  209. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  210. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +6 -1
  211. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +85 -71
  212. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  213. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +21 -20
  214. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  215. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +47 -46
  216. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  217. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  218. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +32 -26
  219. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  220. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +1 -0
  221. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +72 -48
  222. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  223. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +21 -20
  224. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  225. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +15 -15
  226. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  227. package/dist/components/Payroll/PayrollList/PayrollList.d.ts +1 -1
  228. package/dist/components/Payroll/PayrollList/PayrollList.js +65 -24
  229. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  230. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +13 -1
  231. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +153 -50
  232. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  233. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +10 -0
  234. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -0
  235. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +98 -74
  236. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  237. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +73 -72
  238. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  239. package/dist/components/Payroll/helpers.d.ts +2 -0
  240. package/dist/components/Payroll/helpers.js +38 -37
  241. package/dist/components/Payroll/helpers.js.map +1 -1
  242. package/dist/components/Payroll/usePreparedPayrollData.d.ts +4 -1
  243. package/dist/components/Payroll/usePreparedPayrollData.js +25 -19
  244. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  245. package/dist/components/index.d.ts +1 -1
  246. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  247. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  248. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +9 -9
  249. package/dist/i18n/en/Payroll.PayrollHistory.json.js +9 -9
  250. package/dist/i18n/en/Payroll.PayrollList.json.js +24 -14
  251. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  252. package/dist/i18n/en/Payroll.PayrollOverview.json.js +16 -16
  253. package/dist/index.js +1 -1
  254. package/dist/shared/constants.d.ts +6 -0
  255. package/dist/shared/constants.js +11 -8
  256. package/dist/shared/constants.js.map +1 -1
  257. package/dist/style.css +1 -1
  258. package/dist/types/i18next.d.ts +15 -1
  259. package/package.json +14 -14
  260. package/dist/components/Payroll/PayrollBlocker/PayrollBlockerAlerts.js.map +0 -1
  261. package/dist/components/Payroll/RunPayrollFlow/RunPayroll.d.ts +0 -23
  262. package/dist/components/Payroll/RunPayrollFlow/RunPayrollFlow.d.ts +0 -6
  263. /package/dist/components/Payroll/PayrollBlocker/{PayrollBlockerList.d.ts → components/PayrollBlockerList.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Employee/Compensation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () => WA_RISK_CLASS_CODES.map(({ code, description }) => ({ value: code, label: description })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationCTA\"\n components={{ classificationCta: <Components.Link /> }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <Components.Checkbox label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","RadioGroupField","ComboBoxField"],"mappings":";;;;;;;;;;;;;;;;AA2BO,MAAMA,KAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAASC,EAAmB,UAAU,GACtCC,IAAaC,EAAA,GAEbC,IAAqBC;AAAA,IACzB,MAAMC,EAAoB,IAAI,CAAC,EAAE,MAAAC,GAAM,aAAAC,EAAA,OAAmB,EAAE,OAAOD,GAAM,OAAOC,IAAc;AAAA,IAC9F,CAAA;AAAA,EAAC,GAGG;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,GAAQ,eAAAC,EAAA;AAAA,EAAc,IACjCC,EAAA,GAEEC,IAAoBC,EAAS,EAAE,SAAAP,GAAS,MAAM,cAAc,GAC5DQ,IAAwBD,EAAS,EAAE,SAAAP,GAAS,MAAM,kBAAkB,GACpE,EAAE,YAAAS,GAAY,MAAAC,GAAM,cAAAC,GAAc,kBAAAC,GAAkB,OAAAC,GAAO,2BAAAC,EAAA,IAC/DC,EAAA;AAiBF,MAdAC,EAAU,MAAM;AACd,IAAIV,MAAsBW,EAAW,QACnCf,EAAS,eAAe,UAAU,IAElCI,MAAsBW,EAAW,6BACjCX,MAAsBW,EAAW,0BAEjCf,EAAS,eAAe,MAAM,GAC9BA,EAAS,QAAQ,CAAC,KACTE,GAAe,eACxBF,EAAS,eAAeE,EAAc,WAAW;AAAA,EAErD,GAAG,CAACE,GAAmBJ,GAAUE,GAAe,WAAW,CAAC,GAG1D,EACEM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;AAAA,UACT,cAAcN,EAAE,8BAA8B;AAAA,UAC9C,aAAaA,EAAE,uBAAuB;AAAA,QAAA;AAAA,MAAA;AAAA,IACxC,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Employee/Compensation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n CheckboxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () => WA_RISK_CLASS_CODES.map(({ code, description }) => ({ value: code, label: description })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationCTA\"\n components={{ classificationCta: <Components.Link /> }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <CheckboxField label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","CheckboxField","RadioGroupField","ComboBoxField"],"mappings":";;;;;;;;;;;;;;;;;AA4BO,MAAMA,KAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAASC,EAAmB,UAAU,GACtCC,IAAaC,EAAA,GAEbC,IAAqBC;AAAA,IACzB,MAAMC,EAAoB,IAAI,CAAC,EAAE,MAAAC,GAAM,aAAAC,EAAA,OAAmB,EAAE,OAAOD,GAAM,OAAOC,IAAc;AAAA,IAC9F,CAAA;AAAA,EAAC,GAGG;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IAC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qB;AAAA,UAC9B,aACE,gBAAAyC;AAAA,YAACG;AAAA,YAAA;AAAA,cACC,GAAA5C;AAAA,cACA,SAAQ;AAAA,cACR,YAAY;AAAA,gBACV,QACE,gBAAAyC;AAAA,kBAACrC,EAAW;AAAA,kBAAX;AAAA,oBACC,MAAK;AAAA,oBACL,QAAO;AAAA,oBACP,KAAI;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACN;AAAA,YAEJ;AAAA,UAAA;AAAA,UAGJ,SAAS;AAAA,YACP,EAAE,OAAOJ,EAAE,2BAA2B,GAAG,OAAO,GAAA;AAAA,YAChD,EAAE,OAAOA,EAAE,0BAA0B,GAAG,OAAO,GAAA;AAAA,UAAM;AAAA,QACvD;AAAA,MAAA;AAAA,MAEDmB,KACC,gBAAAsB;AAAA,QAACS;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOlD,EAAE,uBAAuB;AAAA,UAChC,SAASM;AAAA,UACT,cAAcN,EAAE,8BAA8B;AAAA,UAC9C,aAAaA,EAAE,uBAAuB;AAAA,QAAA;AAAA,MAAA;AAAA,IACxC,EAAA,CAEJ;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -17,8 +17,8 @@ import { RadioGroupField as x } from "../../../Common/Fields/RadioGroupField/Rad
17
17
  import { TextInputField as J } from "../../../Common/Fields/TextInputField/TextInputField.js";
18
18
  import { ActionsLayout as K } from "../../../Common/ActionsLayout/ActionsLayout.js";
19
19
  import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
20
- import { useComponentDictionary as Q, useI18n as X } from "../../../../i18n/I18n.js";
21
- import { useComponentContext as Z } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
20
+ import { useComponentContext as Q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
21
+ import { useComponentDictionary as X, useI18n as Z } from "../../../../i18n/I18n.js";
22
22
  import { CheckboxField as $ } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
23
23
  const ee = i.object({
24
24
  active: i.boolean(),
@@ -35,8 +35,8 @@ function Me(t) {
35
35
  return /* @__PURE__ */ n(z, { ...t, children: /* @__PURE__ */ n(ne, { ...t, children: t.children }) });
36
36
  }
37
37
  function ne({ className: t, children: b, employeeId: g, deductionId: h, dictionary: y }) {
38
- const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = Z();
39
- Q("Employee.Deductions", y), X("Employee.Deductions");
38
+ const { onEvent: u, baseSubmitHandler: P } = H(), { t: r } = N("Employee.Deductions"), m = Q();
39
+ X("Employee.Deductions", y), Z("Employee.Deductions");
40
40
  const { data: C } = k({ employeeId: g }), e = h ? C.garnishmentList?.find((c) => c.uuid === h) ?? null : null, { mutateAsync: M, isPending: O } = j(), { mutateAsync: L, isPending: T } = Y(), a = B(() => ({
41
41
  amount: e?.amount ? Number(e.amount) : 0,
42
42
  description: e?.description ?? "",
@@ -8,10 +8,10 @@ import { Flex as w } from "../../../Common/Flex/Flex.js";
8
8
  import "classnames";
9
9
  import { componentEvents as a } from "../../../../shared/constants.js";
10
10
  import { ActionsLayout as I } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
+ import { HamburgerMenu as M } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
11
12
  import u from "../../../Common/hooks/useNumberFormatter.js";
12
- import M from "../../../../assets/icons/pencil.svg.js";
13
- import U from "../../../../assets/icons/trashcan.svg.js";
14
- import { HamburgerMenu as B } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
13
+ import U from "../../../../assets/icons/pencil.svg.js";
14
+ import B from "../../../../assets/icons/trashcan.svg.js";
15
15
  import { useComponentDictionary as S, useI18n as Y } from "../../../../i18n/I18n.js";
16
16
  import { useComponentContext as q } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
17
17
  import { useDataView as F } from "../../../Common/DataView/useDataView.js";
@@ -62,7 +62,7 @@ function V({ className: r, children: s, employeeId: d, dictionary: l }) {
62
62
  }
63
63
  ],
64
64
  itemMenu: (e) => /* @__PURE__ */ n(
65
- B,
65
+ M,
66
66
  {
67
67
  isLoading: g,
68
68
  items: [
@@ -71,14 +71,14 @@ function V({ className: r, children: s, employeeId: d, dictionary: l }) {
71
71
  onClick: () => {
72
72
  v(e);
73
73
  },
74
- icon: /* @__PURE__ */ n(M, { "aria-hidden": !0 })
74
+ icon: /* @__PURE__ */ n(U, { "aria-hidden": !0 })
75
75
  },
76
76
  {
77
77
  label: t("deleteCta"),
78
78
  onClick: async () => {
79
79
  await y(e);
80
80
  },
81
- icon: /* @__PURE__ */ n(U, { "aria-hidden": !0 })
81
+ icon: /* @__PURE__ */ n(B, { "aria-hidden": !0 })
82
82
  }
83
83
  ]
84
84
  }
@@ -1,6 +1,6 @@
1
- import { jsx as e, jsxs as p, Fragment as a } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as p, Fragment as a } from "react/jsx-runtime";
2
2
  import { useTranslation as D } from "react-i18next";
3
- import { z as m } from "zod";
3
+ import { z as c } from "zod";
4
4
  import { useForm as f, FormProvider as E } from "react-hook-form";
5
5
  import { zodResolver as h } from "@hookform/resolvers/zod";
6
6
  import { BaseComponent as C } from "../../../Base/Base.js";
@@ -10,40 +10,41 @@ import "classnames";
10
10
  import { componentEvents as s } from "../../../../shared/constants.js";
11
11
  import { RadioGroupField as v } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
12
12
  import { ActionsLayout as F } from "../../../Common/ActionsLayout/ActionsLayout.js";
13
- import { useComponentDictionary as I, useI18n as Y } from "../../../../i18n/I18n.js";
14
- import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
- const L = m.object({ includeDeductions: m.enum(["Yes", "No"]) });
16
- function G(n) {
17
- return /* @__PURE__ */ e(C, { ...n, children: /* @__PURE__ */ e(_, { ...n, children: n.children }) });
13
+ import { useComponentContext as I } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import "react";
15
+ import { useComponentDictionary as Y, useI18n as y } from "../../../../i18n/I18n.js";
16
+ const L = c.object({ includeDeductions: c.enum(["Yes", "No"]) });
17
+ function H(n) {
18
+ return /* @__PURE__ */ o(C, { ...n, children: /* @__PURE__ */ o(_, { ...n, children: n.children }) });
18
19
  }
19
20
  function _({ className: n, children: t, dictionary: u }) {
20
- const { onEvent: i } = b(), { t: o } = D("Employee.Deductions"), r = y();
21
- I("Employee.Deductions", u), Y("Employee.Deductions");
22
- const c = f({
21
+ const { onEvent: i } = b(), { t: e } = D("Employee.Deductions"), r = I();
22
+ Y("Employee.Deductions", u), y("Employee.Deductions");
23
+ const m = f({
23
24
  resolver: h(L),
24
25
  defaultValues: { includeDeductions: "No" }
25
26
  }), d = (l) => {
26
27
  l.includeDeductions === "Yes" ? i(s.EMPLOYEE_DEDUCTION_INCLUDE_YES) : i(s.EMPLOYEE_DEDUCTION_INCLUDE_NO);
27
28
  };
28
- return /* @__PURE__ */ e("section", { className: n, children: /* @__PURE__ */ e(E, { ...c, children: /* @__PURE__ */ e(N, { onSubmit: c.handleSubmit(d), children: t || /* @__PURE__ */ p(a, { children: [
29
- /* @__PURE__ */ e(r.Heading, { as: "h2", children: o("pageTitle") }),
30
- /* @__PURE__ */ e(
29
+ return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(E, { ...m, children: /* @__PURE__ */ o(N, { onSubmit: m.handleSubmit(d), children: t || /* @__PURE__ */ p(a, { children: [
30
+ /* @__PURE__ */ o(r.Heading, { as: "h2", children: e("pageTitle") }),
31
+ /* @__PURE__ */ o(
31
32
  v,
32
33
  {
33
34
  name: "includeDeductions",
34
35
  isRequired: !0,
35
- label: o("includeDeductionsFormLabel"),
36
- description: o("includeDeductionsDescription"),
36
+ label: e("includeDeductionsFormLabel"),
37
+ description: e("includeDeductionsDescription"),
37
38
  options: [
38
- { value: "Yes", label: o("includeDeductionsYes") },
39
- { value: "No", label: o("includeDeductionsNo") }
39
+ { value: "Yes", label: e("includeDeductionsYes") },
40
+ { value: "No", label: e("includeDeductionsNo") }
40
41
  ]
41
42
  }
42
43
  ),
43
- /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(r.Button, { type: "submit", children: o("continueCta") }) })
44
+ /* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(r.Button, { type: "submit", children: e("continueCta") }) })
44
45
  ] }) }) }) });
45
46
  }
46
47
  export {
47
- G as IncludeDeductionsForm
48
+ H as IncludeDeductionsForm
48
49
  };
49
50
  //# sourceMappingURL=IncludeDeductionsForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../../src/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { RadioGroupField } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\ninterface IncludeDeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductionsForm(props: IncludeDeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, dictionary }: IncludeDeductionsFormProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const formMethods = useForm<IncludeDeductionsPayload>({\n resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const onSubmit: SubmitHandler<IncludeDeductionsPayload> = data => {\n if (data.includeDeductions === 'Yes') {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <RadioGroupField\n name=\"includeDeductions\"\n isRequired\n label={t('includeDeductionsFormLabel')}\n description={t('includeDeductionsDescription')}\n options={[\n { value: 'Yes', label: t('includeDeductionsYes') },\n { value: 'No', label: t('includeDeductionsNo') },\n ]}\n />\n <ActionsLayout>\n <Components.Button type=\"submit\">{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["IncludeDeductionsSchema","z","IncludeDeductionsForm","props","jsx","BaseComponent","Root","className","children","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","formMethods","useForm","zodResolver","onSubmit","data","componentEvents","FormProvider","Form","jsxs","Fragment","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAA0BC,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG;AAO9E,SAASC,EAAsBC,GAA4D;AAChG,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAA0C;AAC7E,QAAM,EAAE,SAAAC,EAAA,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../src/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n useBase,\n} from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { RadioGroupField } from '@/components/Common'\nimport { ActionsLayout } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst IncludeDeductionsSchema = z.object({ includeDeductions: z.enum(['Yes', 'No']) })\nexport type IncludeDeductionsPayload = z.output<typeof IncludeDeductionsSchema>\n\ninterface IncludeDeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {\n employeeId: string\n}\n\nexport function IncludeDeductionsForm(props: IncludeDeductionsFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ className, children, dictionary }: IncludeDeductionsFormProps) {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n useComponentDictionary('Employee.Deductions', dictionary)\n useI18n('Employee.Deductions')\n\n const formMethods = useForm<IncludeDeductionsPayload>({\n resolver: zodResolver(IncludeDeductionsSchema),\n defaultValues: { includeDeductions: 'No' },\n })\n\n const onSubmit: SubmitHandler<IncludeDeductionsPayload> = data => {\n if (data.includeDeductions === 'Yes') {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_YES)\n } else {\n onEvent(componentEvents.EMPLOYEE_DEDUCTION_INCLUDE_NO)\n }\n }\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Components.Heading as=\"h2\">{t('pageTitle')}</Components.Heading>\n <RadioGroupField\n name=\"includeDeductions\"\n isRequired\n label={t('includeDeductionsFormLabel')}\n description={t('includeDeductionsDescription')}\n options={[\n { value: 'Yes', label: t('includeDeductionsYes') },\n { value: 'No', label: t('includeDeductionsNo') },\n ]}\n />\n <ActionsLayout>\n <Components.Button type=\"submit\">{t('continueCta')}</Components.Button>\n </ActionsLayout>\n </>\n )}\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["IncludeDeductionsSchema","z","IncludeDeductionsForm","props","jsx","BaseComponent","Root","className","children","dictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","useComponentDictionary","useI18n","formMethods","useForm","zodResolver","onSubmit","data","componentEvents","FormProvider","Form","jsxs","Fragment","RadioGroupField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAMA,IAA0BC,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG;AAO9E,SAASC,EAAsBC,GAA4D;AAChG,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,YAAAC,KAA0C;AAC7E,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GACd,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAA;AAEnB,EAAAC,EAAuB,uBAAuBP,CAAU,GACxDQ,EAAQ,qBAAqB;AAE7B,QAAMC,IAAcC,EAAkC;AAAA,IACpD,UAAUC,EAAYpB,CAAuB;AAAA,IAC7C,eAAe,EAAE,mBAAmB,KAAA;AAAA,EAAK,CAC1C,GAEKqB,IAAoD,CAAAC,MAAQ;AAChE,IAAIA,EAAK,sBAAsB,QAC7BZ,EAAQa,EAAgB,8BAA8B,IAEtDb,EAAQa,EAAgB,6BAA6B;AAAA,EAEzD;AAEA,2BACG,WAAA,EAAQ,WAAAhB,GACP,UAAA,gBAAAH,EAACoB,GAAA,EAAc,GAAGN,GAChB,UAAA,gBAAAd,EAACqB,GAAA,EAAK,UAAUP,EAAY,aAAaG,CAAQ,GAC9C,UAAAb,KAGC,gBAAAkB,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAvB,EAACU,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAF,EAAE,WAAW,GAAE;AAAA,IAC5C,gBAAAR;AAAA,MAACwB;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOhB,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAA;AAAA,UAC/C,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,IAAA;AAAA,IAEF,gBAAAR,EAACyB,GAAA,EACC,UAAA,gBAAAzB,EAACU,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAF,EAAE,aAAa,EAAA,CAAE,EAAA,CACrD;AAAA,EAAA,GACF,EAAA,CAEJ,GACF,GACF;AAEJ;"}
@@ -5,11 +5,12 @@ import "classnames";
5
5
  import "../../../../shared/constants.js";
6
6
  import { ActionsLayout as s } from "../../../Common/ActionsLayout/ActionsLayout.js";
7
7
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
- function h() {
8
+ import "react";
9
+ function g() {
9
10
  const { t } = r("Employee.DocumentSigner"), { handleContinue: n, hasSignedAllForms: i } = m(), e = c();
10
11
  return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { onClick: n, isLoading: !1, isDisabled: !i, children: t("continueCta") }) });
11
12
  }
12
13
  export {
13
- h as Actions
14
+ g as Actions
14
15
  };
15
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,GAAgB,mBAAAC,EAAA,IAAsBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.DocumentSigner')\n const { handleContinue, hasSignedAllForms } = useDocumentList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleContinue} isLoading={false} isDisabled={!hasSignedAllForms}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleContinue","hasSignedAllForms","useDocumentList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,yBAAyB,GAChD,EAAE,gBAAAC,GAAgB,mBAAAC,EAAA,IAAsBC,EAAA,GACxCC,IAAaC,EAAA;AAEnB,2BACGC,GAAA,EACC,UAAA,gBAAAC,EAACH,EAAW,QAAX,EAAkB,SAASH,GAAgB,WAAW,IAAO,YAAY,CAACC,GACxE,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
@@ -10,12 +10,15 @@ import { useI18n as S } from "../../../../i18n/I18n.js";
10
10
  import { componentEvents as m } from "../../../../shared/constants.js";
11
11
  import { Flex as g } from "../../../Common/Flex/Flex.js";
12
12
  import "classnames";
13
- function B(e) {
13
+ import "react-i18next";
14
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import "react";
16
+ function G(e) {
14
17
  return /* @__PURE__ */ o(F, { ...e, children: /* @__PURE__ */ o(O, { ...e }) });
15
18
  }
16
- function O({ employeeId: e, className: s, children: n }) {
19
+ function O({ employeeId: e, className: s, children: t }) {
17
20
  S("Employee.DocumentSigner");
18
- const { onEvent: t } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, p = i.every((r) => !r.requiresSigning);
21
+ const { onEvent: n } = L(), { data: u, error: c } = f({ employeeId: e }), i = u.formList, p = i.every((r) => !r.requiresSigning);
19
22
  return /* @__PURE__ */ o("section", { className: s, children: /* @__PURE__ */ o(
20
23
  h,
21
24
  {
@@ -23,14 +26,14 @@ function O({ employeeId: e, className: s, children: n }) {
23
26
  employeeForms: i,
24
27
  hasSignedAllForms: p,
25
28
  handleContinue: () => {
26
- t(m.EMPLOYEE_FORMS_DONE);
29
+ n(m.EMPLOYEE_FORMS_DONE);
27
30
  },
28
31
  handleRequestFormToSign: (r) => {
29
- t(m.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: r.uuid });
32
+ n(m.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: r.uuid });
30
33
  },
31
34
  documentListError: c
32
35
  },
33
- children: n || /* @__PURE__ */ l(g, { flexDirection: "column", children: [
36
+ children: t || /* @__PURE__ */ l(g, { flexDirection: "column", children: [
34
37
  /* @__PURE__ */ o(d, {}),
35
38
  /* @__PURE__ */ o(E, {}),
36
39
  /* @__PURE__ */ o(a, {})
@@ -39,6 +42,6 @@ function O({ employeeId: e, className: s, children: n }) {
39
42
  ) });
40
43
  }
41
44
  export {
42
- B as DocumentList
45
+ G as DocumentList
43
46
  };
44
47
  //# sourceMappingURL=DocumentList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAU3F,SACE,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
1
+ {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { useEmployeeFormsListSuspense } from '@gusto/embedded-api/react-query/employeeFormsList'\nimport { type Form } from '@gusto/embedded-api/models/components/form'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\n\ninterface DocumentListProps extends CommonComponentInterface {\n employeeId: string\n}\n\nexport function DocumentList(props: DocumentListProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, className, children }: DocumentListProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent } = useBase()\n\n const { data, error: documentListError } = useEmployeeFormsListSuspense({ employeeId })\n const employeeForms = data.formList!\n\n const hasSignedAllForms = employeeForms.every(employeeForm => !employeeForm.requiresSigning)\n\n const handleRequestFormToSign = (data: Form) => {\n onEvent(componentEvents.EMPLOYEE_VIEW_FORM_TO_SIGN, { uuid: data.uuid })\n }\n\n const handleContinue = () => {\n onEvent(componentEvents.EMPLOYEE_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n employeeForms,\n hasSignedAllForms,\n handleContinue,\n handleRequestFormToSign,\n documentListError,\n }}\n >\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Actions />\n </Flex>\n )}\n </DocumentListProvider>\n </section>\n )\n}\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","employeeId","className","children","useI18n","onEvent","useBase","data","documentListError","useEmployeeFormsListSuspense","employeeForms","hasSignedAllForms","employeeForm","DocumentListProvider","componentEvents","jsxs","Flex","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;;AAoBO,SAASA,EAAaC,GAAmD;AAC9E,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,WAAAC,GAAW,UAAAC,KAA+B;AACpE,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,EAAA,IAAYC,EAAA,GAEd,EAAE,MAAAC,GAAM,OAAOC,EAAA,IAAsBC,EAA6B,EAAE,YAAAR,GAAY,GAChFS,IAAgBH,EAAK,UAErBI,IAAoBD,EAAc,MAAM,CAAAE,MAAgB,CAACA,EAAa,eAAe;AAU3F,SACE,gBAAAd,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,eAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,gBAVe,MAAM;AAC3B,UAAAN,EAAQS,EAAgB,mBAAmB;AAAA,QAC7C;AAAA,QASQ,yBAfwB,CAACP,MAAe;AAC9C,UAAAF,EAAQS,EAAgB,4BAA4B,EAAE,MAAMP,EAAK,MAAM;AAAA,QACzE;AAAA,QAcQ,mBAAAC;AAAA,MAAA;AAAA,MAGD,UAAAL,KAGC,gBAAAY,EAACC,GAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAlB,EAACmB,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAK;AAAA,0BACLC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ;"}
@@ -4,8 +4,10 @@ import { useDocumentList as s } from "./useDocumentList.js";
4
4
  import { Flex as l } from "../../../Common/Flex/Flex.js";
5
5
  import "classnames";
6
6
  import "../../../../shared/constants.js";
7
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import "react";
7
9
  import { DocumentList as u } from "../../../Common/DocumentList/DocumentList.js";
8
- function f() {
10
+ function D() {
9
11
  const { employeeForms: i, handleRequestFormToSign: n, documentListError: r } = s(), { t: e } = m("Employee.DocumentSigner");
10
12
  return /* @__PURE__ */ o("section", { style: { width: "100%" }, children: /* @__PURE__ */ o(l, { flexDirection: "column", gap: 32, children: /* @__PURE__ */ o(
11
13
  u,
@@ -34,6 +36,6 @@ function f() {
34
36
  ) }) });
35
37
  }
36
38
  export {
37
- f as List
39
+ D as List
38
40
  };
39
41
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Employee/DocumentSigner/DocumentList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDocumentList } from './useDocumentList'\nimport { Flex, DocumentList as SharedDocumentList } from '@/components/Common'\n\nexport function List() {\n const { employeeForms, handleRequestFormToSign, documentListError } = useDocumentList()\n const { t } = useTranslation('Employee.DocumentSigner')\n\n return (\n <section style={{ width: '100%' }}>\n <Flex flexDirection=\"column\" gap={32}>\n <SharedDocumentList\n forms={employeeForms.map(form => ({\n uuid: form.uuid,\n title: form.title,\n description: form.description,\n requires_signing: form.requiresSigning,\n }))}\n onRequestSign={handleRequestFormToSign}\n withError={!!documentListError}\n label={t('documentListLabel')}\n columnLabels={{\n form: t('formColumnLabel'),\n action: t('actionColumnLabel'),\n }}\n statusLabels={{\n signCta: t('signDocumentCta'),\n notSigned: t('notSigned'),\n complete: t('signDocumentComplete'),\n }}\n emptyStateLabel={t('emptyTableTitle')}\n errorLabel={t('documentListError')}\n />\n </Flex>\n </section>\n )\n}\n"],"names":["List","employeeForms","handleRequestFormToSign","documentListError","useDocumentList","t","useTranslation","jsx","Flex","SharedDocumentList","form"],"mappings":";;;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,eAAAC,GAAe,yBAAAC,GAAyB,mBAAAC,EAAA,IAAsBC,EAAA,GAChE,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB;AAEtD,SACE,gBAAAC,EAAC,WAAA,EAAQ,OAAO,EAAE,OAAO,UACvB,UAAA,gBAAAA,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAD;AAAA,IAACE;AAAAA,IAAA;AAAA,MACC,OAAOR,EAAc,IAAI,CAAAS,OAAS;AAAA,QAChC,MAAMA,EAAK;AAAA,QACX,OAAOA,EAAK;AAAA,QACZ,aAAaA,EAAK;AAAA,QAClB,kBAAkBA,EAAK;AAAA,MAAA,EACvB;AAAA,MACF,eAAeR;AAAA,MACf,WAAW,CAAC,CAACC;AAAA,MACb,OAAOE,EAAE,mBAAmB;AAAA,MAC5B,cAAc;AAAA,QACZ,MAAMA,EAAE,iBAAiB;AAAA,QACzB,QAAQA,EAAE,mBAAmB;AAAA,MAAA;AAAA,MAE/B,cAAc;AAAA,QACZ,SAASA,EAAE,iBAAiB;AAAA,QAC5B,WAAWA,EAAE,WAAW;AAAA,QACxB,UAAUA,EAAE,sBAAsB;AAAA,MAAA;AAAA,MAEpC,iBAAiBA,EAAE,iBAAiB;AAAA,MACpC,YAAYA,EAAE,mBAAmB;AAAA,IAAA;AAAA,EAAA,GAErC,EAAA,CACF;AAEJ;"}
@@ -9,9 +9,9 @@ import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import "dompurify";
13
14
  import "../../../../contexts/LocaleProvider/useLocale.js";
14
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
15
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
16
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
17
17
  const [f, v] = t("DocumentListContext");
@@ -13,15 +13,18 @@ import { useI18n as G } from "../../../../i18n/I18n.js";
13
13
  import { componentEvents as i } from "../../../../shared/constants.js";
14
14
  import { Flex as M } from "../../../Common/Flex/Flex.js";
15
15
  import "classnames";
16
+ import "react-i18next";
17
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
18
+ import "react";
16
19
  import { SignatureForm as R } from "../../../Common/SignatureForm/SignatureForm.js";
17
- function W(r) {
20
+ function oo(r) {
18
21
  return /* @__PURE__ */ o(A, { ...r, children: /* @__PURE__ */ o(j, { ...r }) });
19
22
  }
20
- function j({ employeeId: r, formId: s, className: u, children: t }) {
23
+ function j({ employeeId: r, formId: s, className: u, children: n }) {
21
24
  G("Employee.DocumentSigner");
22
- const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }), n = c.form, {
25
+ const { onEvent: e, baseSubmitHandler: a } = C(), { data: c } = x({ employeeId: r, formId: s }), t = c.form, {
23
26
  data: { formPdf: f }
24
- } = h({ employeeId: r, formId: n.uuid }), d = f.documentUrl, { mutateAsync: p, isPending: l } = P();
27
+ } = h({ employeeId: r, formId: t.uuid }), d = f.documentUrl, { mutateAsync: p, isPending: l } = P();
25
28
  return /* @__PURE__ */ o("section", { className: u, children: /* @__PURE__ */ o(
26
29
  w,
27
30
  {
@@ -30,16 +33,16 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
30
33
  handleBack: () => {
31
34
  e(i.CANCEL);
32
35
  },
33
- form: n,
36
+ form: t,
34
37
  isPending: l
35
38
  },
36
39
  children: /* @__PURE__ */ o(R, { onSubmit: async (g) => {
37
40
  await a(g, async (m) => {
38
- if (n.uuid) {
41
+ if (t.uuid) {
39
42
  const { form: S } = await p({
40
43
  request: {
41
44
  employeeId: r,
42
- formId: n.uuid,
45
+ formId: t.uuid,
43
46
  requestBody: {
44
47
  signatureText: m.signature,
45
48
  agree: m.confirmSignature
@@ -49,7 +52,7 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
49
52
  e(i.EMPLOYEE_SIGN_FORM, S);
50
53
  }
51
54
  });
52
- }, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: t || /* @__PURE__ */ F(E, { children: [
55
+ }, children: /* @__PURE__ */ o(M, { flexDirection: "column", children: n || /* @__PURE__ */ F(E, { children: [
53
56
  /* @__PURE__ */ o(v, {}),
54
57
  /* @__PURE__ */ o(B, {}),
55
58
  /* @__PURE__ */ o(b, {}),
@@ -59,6 +62,6 @@ function j({ employeeId: r, formId: s, className: u, children: t }) {
59
62
  ) });
60
63
  }
61
64
  export {
62
- W as SignatureForm
65
+ oo as SignatureForm
63
66
  };
64
67
  //# sourceMappingURL=SignatureForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;AAyBO,SAASA,EAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAAA;AAwBhE,SACE,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAlB,EAACsB,GAAA,EAAoB,UA5BN,OAAOX,MAA8B;AACxD,cAAMF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAA,IAAmB,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACD,YAAAf,EAAQa,EAAgB,oBAAoBG,CAAc;AAAA,UAC5D;AAAA,QACF,CAAC;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UAAAnB,KAGC,gBAAAoB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAc;AAAA,0BACdC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Employee/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useEmployeeFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/employeeFormsGetPdf'\nimport { useEmployeeFormsSignMutation } from '@gusto/embedded-api/react-query/employeeFormsSign'\nimport { useEmployeeFormsGetSuspense } from '@gusto/embedded-api/react-query/employeeFormsGet'\nimport { Form as FormComponent } from './Form'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { Preview } from './Preview'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport {\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Flex } from '@/components/Common'\nimport type { SignatureFormInputs } from '@/components/Common/SignatureForm'\nimport { SignatureForm as SharedSignatureForm } from '@/components/Common/SignatureForm'\n\ninterface SignatureFormProps extends CommonComponentInterface {\n employeeId: string\n formId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nfunction Root({ employeeId, formId, className, children }: SignatureFormProps) {\n useI18n('Employee.DocumentSigner')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useEmployeeFormsGetSuspense({ employeeId, formId })\n const form = data.form!\n\n const {\n data: { formPdf },\n } = useEmployeeFormsGetPdfSuspense({ employeeId, formId: form.uuid })\n const pdfUrl = formPdf!.documentUrl\n\n const { mutateAsync: signForm, isPending: isSignFormPending } = useEmployeeFormsSignMutation()\n\n const handleBack = () => {\n onEvent(componentEvents.CANCEL)\n }\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n if (form.uuid) {\n const { form: signFormResult } = await signForm({\n request: {\n employeeId,\n formId: form.uuid,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n onEvent(componentEvents.EMPLOYEE_SIGN_FORM, signFormResult)\n }\n })\n }\n\n return (\n <section className={className}>\n <SignatureFormProvider\n value={{\n pdfUrl,\n handleBack,\n form,\n isPending: isSignFormPending,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\">\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <FormComponent />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n </section>\n )\n}\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","employeeId","formId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","data","useEmployeeFormsGetSuspense","form","formPdf","useEmployeeFormsGetPdfSuspense","pdfUrl","signForm","isSignFormPending","useEmployeeFormsSignMutation","SignatureFormProvider","componentEvents","SharedSignatureForm","payload","signFormResult","Flex","jsxs","Fragment","Head","Preview","FormComponent","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBO,SAASA,GAAcC,GAAoD;AAChF,SACE,gBAAAC,EAACC,KAAe,GAAGF,GACjB,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,SAASG,EAAK,EAAE,YAAAC,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,KAAgC;AAC7E,EAAAC,EAAQ,yBAAyB;AACjC,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAA,IAAsBC,EAAA,GAEjC,EAAE,MAAAC,EAAA,IAASC,EAA4B,EAAE,YAAAT,GAAY,QAAAC,GAAQ,GAC7DS,IAAOF,EAAK,MAEZ;AAAA,IACJ,MAAM,EAAE,SAAAG,EAAA;AAAA,EAAQ,IACdC,EAA+B,EAAE,YAAAZ,GAAY,QAAQU,EAAK,MAAM,GAC9DG,IAASF,EAAS,aAElB,EAAE,aAAaG,GAAU,WAAWC,EAAA,IAAsBC,EAAA;AAwBhE,SACE,gBAAAnB,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAAJ;AAAA,QACA,YA3BW,MAAM;AACvB,UAAAR,EAAQa,EAAgB,MAAM;AAAA,QAChC;AAAA,QA0BQ,MAAAR;AAAA,QACA,WAAWK;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAlB,EAACsB,GAAA,EAAoB,UA5BN,OAAOX,MAA8B;AACxD,cAAMF,EAAkBE,GAAM,OAAMY,MAAW;AAC7C,cAAIV,EAAK,MAAM;AACb,kBAAM,EAAE,MAAMW,EAAA,IAAmB,MAAMP,EAAS;AAAA,cAC9C,SAAS;AAAA,gBACP,YAAAd;AAAA,gBACA,QAAQU,EAAK;AAAA,gBACb,aAAa;AAAA,kBACX,eAAeU,EAAQ;AAAA,kBACvB,OAAOA,EAAQ;AAAA,gBAAA;AAAA,cACjB;AAAA,YACF,CACD;AACD,YAAAf,EAAQa,EAAgB,oBAAoBG,CAAc;AAAA,UAC5D;AAAA,QACF,CAAC;AAAA,MACH,GAaQ,UAAA,gBAAAxB,EAACyB,KAAK,eAAc,UACjB,UAAAnB,KAGC,gBAAAoB,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAA3B,EAAC4B,GAAA,EAAK;AAAA,0BACLC,GAAA,EAAQ;AAAA,0BACRC,GAAA,EAAc;AAAA,0BACdC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -9,9 +9,9 @@ import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
11
  import "classnames";
12
+ import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import "dompurify";
13
14
  import "../../../../contexts/LocaleProvider/useLocale.js";
14
- import "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
15
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
16
16
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
17
17
  const [s, f] = o("SignatureFormContext");
@@ -3,13 +3,14 @@ import { useTranslation as r } from "react-i18next";
3
3
  import { useEmployeeList as m } from "./useEmployeeList.js";
4
4
  import "classnames";
5
5
  import "../../../shared/constants.js";
6
- import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
7
- import { useComponentContext as p } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- function d() {
9
- const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = p();
10
- return e.length === 0 ? null : /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(i.Button, { onClick: n, isLoading: !1, children: t("continueCta") }) });
6
+ import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
7
+ import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import "react";
9
+ function h() {
10
+ const { t } = r("Employee.EmployeeList"), { handleSkip: n, employees: e } = m(), i = s();
11
+ return e.length === 0 ? null : /* @__PURE__ */ o(p, { children: /* @__PURE__ */ o(i.Button, { onClick: n, isLoading: !1, children: t("continueCta") }) });
11
12
  }
12
13
  export {
13
- d as Actions
14
+ h as Actions
14
15
  };
15
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAA,IAAcC,EAAA,GAC5BC,IAAaC,EAAA;AAEnB,SAAIH,EAAU,WAAW,IAChB,OAIP,gBAAAI,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/EmployeeList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeeList } from './useEmployeeList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.EmployeeList')\n const { handleSkip, employees } = useEmployeeList()\n const Components = useComponentContext()\n\n if (employees.length === 0) {\n return null\n }\n\n return (\n <ActionsLayout>\n <Components.Button onClick={handleSkip} isLoading={false}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","handleSkip","employees","useEmployeeList","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAC9C,EAAE,YAAAC,GAAY,WAAAC,EAAA,IAAcC,EAAA,GAC5BC,IAAaC,EAAA;AAEnB,SAAIH,EAAU,WAAW,IAChB,OAIP,gBAAAI,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,SAASH,GAAY,WAAW,IAChD,UAAA,EAAE,aAAa,GAClB,GACF;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as C } from "react/jsx-runtime";
2
- import { useState as y } from "react";
2
+ import { useState as h } from "react";
3
3
  import { useEmployeesList as G } from "@gusto/embedded-api/react-query/employeesList";
4
4
  import { useEmployeesDeleteMutation as F } from "@gusto/embedded-api/react-query/employeesDelete";
5
5
  import { useEmployeesUpdateOnboardingStatusMutation as Y } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
@@ -12,6 +12,8 @@ import { Flex as H } from "../../Common/Flex/Flex.js";
12
12
  import "classnames";
13
13
  import { componentEvents as s, EmployeeOnboardingStatus as E } from "../../../shared/constants.js";
14
14
  import { Loading as V } from "../../Common/Loading/Loading.js";
15
+ import "react-i18next";
16
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
17
  import { useI18n as z, useComponentDictionary as J } from "../../../i18n/I18n.js";
16
18
  import { Head as K } from "./Head.js";
17
19
  import { List as Q } from "./List.js";
@@ -19,19 +21,19 @@ import { useFlow as X } from "../../Flow/useFlow.js";
19
21
  function Z(n) {
20
22
  return /* @__PURE__ */ o(q, { ...n, children: /* @__PURE__ */ o($, { ...n, children: n.children }) });
21
23
  }
22
- function $({ companyId: n, className: m, children: l, dictionary: h }) {
23
- z("Employee.EmployeeList"), J("Employee.EmployeeList", h);
24
- const { onEvent: a, baseSubmitHandler: r } = j(), [p, i] = y(1), [P, g] = y(5), { data: u, fetchStatus: f, isFetching: O } = G(
24
+ function $({ companyId: n, className: m, children: l, dictionary: P }) {
25
+ z("Employee.EmployeeList"), J("Employee.EmployeeList", P);
26
+ const { onEvent: a, baseSubmitHandler: r } = j(), [p, i] = h(1), [u, g] = h(5), { data: d, fetchStatus: f, isFetching: O } = G(
25
27
  {
26
28
  companyId: n,
27
29
  page: p,
28
- per: P
30
+ per: u
29
31
  },
30
32
  { placeholderData: U }
31
33
  ), { mutateAsync: D } = F(), { mutateAsync: I } = Y();
32
- if (f === "fetching" && !u)
34
+ if (f === "fetching" && !d)
33
35
  return /* @__PURE__ */ o(V, {});
34
- const { httpMeta: N, showEmployees: A } = u, L = A, c = Number(N.response.headers.get("x-total-pages") ?? 1), _ = (e) => {
36
+ const { httpMeta: N, showEmployees: A } = d, L = A, c = Number(N.response.headers.get("x-total-pages") ?? 1), _ = (e) => {
35
37
  g(e);
36
38
  }, M = () => {
37
39
  i(1);
@@ -49,7 +51,7 @@ function $({ companyId: n, className: m, children: l, dictionary: h }) {
49
51
  });
50
52
  }, T = async (e) => {
51
53
  await r(e, async (t) => {
52
- await d({
54
+ await y({
53
55
  employeeId: t,
54
56
  status: E.SELF_ONBOARDING_AWAITING_ADMIN_REVIEW
55
57
  }), a(s.EMPLOYEE_UPDATE, {
@@ -59,12 +61,12 @@ function $({ companyId: n, className: m, children: l, dictionary: h }) {
59
61
  });
60
62
  }, x = async (e) => {
61
63
  await r(e, async (t) => {
62
- await d({
64
+ await y({
63
65
  employeeId: t,
64
66
  status: E.ADMIN_ONBOARDING_INCOMPLETE
65
67
  });
66
68
  });
67
- }, d = async (e) => {
69
+ }, y = async (e) => {
68
70
  await r(e, async ({ employeeId: t, status: v }) => {
69
71
  const { employeeOnboardingStatus: B } = await I({
70
72
  request: { employeeId: t, requestBody: { onboardingStatus: v } }
@@ -96,6 +98,7 @@ function $({ companyId: n, className: m, children: l, dictionary: h }) {
96
98
  handleSkip: () => {
97
99
  a(s.EMPLOYEE_ONBOARDING_DONE);
98
100
  },
101
+ itemsPerPage: u,
99
102
  isFetching: O
100
103
  },
101
104
  children: l || /* @__PURE__ */ C(H, { flexDirection: "column", children: [
@@ -106,12 +109,12 @@ function $({ companyId: n, className: m, children: l, dictionary: h }) {
106
109
  }
107
110
  ) });
108
111
  }
109
- const De = () => {
112
+ const Ne = () => {
110
113
  const { companyId: n, onEvent: m } = X();
111
114
  return /* @__PURE__ */ o(Z, { companyId: n, onEvent: m });
112
115
  };
113
116
  export {
114
117
  Z as EmployeeList,
115
- De as EmployeeListContextual
118
+ Ne as EmployeeListContextual
116
119
  };
117
120
  //# sourceMappingURL=EmployeeList.js.map