@gusto/embedded-react-sdk 0.10.2 → 0.10.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/Base/Base.d.ts +3 -2
  3. package/dist/components/Base/Base.js +32 -31
  4. package/dist/components/Base/Base.js.map +1 -1
  5. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  6. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  7. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  11. package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
  12. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  14. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  31. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  32. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  33. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  34. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  35. package/dist/components/Company/BankAccount/BankAccountComponents.js +16 -9
  36. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  37. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +23 -8
  38. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  39. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +1 -0
  40. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +23 -25
  41. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
  43. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountForm/context.d.ts +4 -0
  45. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  46. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js +14 -13
  48. package/dist/components/Company/BankAccount/BankAccountList/AccountView.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  50. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  52. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  53. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  54. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  55. package/dist/components/Company/BankAccount/stateMachine.d.ts +1 -1
  56. package/dist/components/Company/BankAccount/stateMachine.js +13 -5
  57. package/dist/components/Company/BankAccount/stateMachine.js.map +1 -1
  58. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  59. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  60. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
  61. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  62. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  63. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +45 -44
  65. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  67. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  68. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  69. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  70. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
  71. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  72. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  73. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  74. package/dist/components/Company/FederalTaxes/Head.js +11 -11
  75. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  76. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
  77. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  78. package/dist/components/Company/Industry/Actions.js +6 -5
  79. package/dist/components/Company/Industry/Actions.js.map +1 -1
  80. package/dist/components/Company/Industry/Context.js +7 -6
  81. package/dist/components/Company/Industry/Context.js.map +1 -1
  82. package/dist/components/Company/Industry/Edit.js +11 -10
  83. package/dist/components/Company/Industry/Edit.js.map +1 -1
  84. package/dist/components/Company/Industry/Industry.js +30 -31
  85. package/dist/components/Company/Industry/Industry.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  87. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  89. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  90. package/dist/components/Company/Locations/LocationForm/LocationForm.js +36 -37
  91. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  93. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  95. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationsList/List.js +12 -8
  97. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
  99. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  100. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  101. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  102. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  103. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  104. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  105. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  106. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
  107. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  108. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  109. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  110. package/dist/components/Company/PaySchedule/PaySchedule.js +72 -71
  111. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  112. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  113. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  114. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -8
  115. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  116. package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
  117. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  118. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  119. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  121. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  122. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  123. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  124. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  125. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  126. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  127. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  129. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  131. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  132. package/dist/components/Contractor/Address/Address.js +39 -38
  133. package/dist/components/Contractor/Address/Address.js.map +1 -1
  134. package/dist/components/Contractor/Address/Form.js +3 -2
  135. package/dist/components/Contractor/Address/Form.js.map +1 -1
  136. package/dist/components/Contractor/Address/useAddress.js +6 -5
  137. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  138. package/dist/components/Contractor/List/index.js +48 -50
  139. package/dist/components/Contractor/List/index.js.map +1 -1
  140. package/dist/components/Contractor/NewHireReport/NewHireReport.js +52 -52
  141. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  142. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  143. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  144. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  145. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  146. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  147. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  148. package/dist/components/Employee/Compensation/Actions.js +5 -4
  149. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  150. package/dist/components/Employee/Compensation/Compensation.js +123 -132
  151. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  152. package/dist/components/Employee/Compensation/Edit.js +3 -2
  153. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  154. package/dist/components/Employee/Compensation/List.js +6 -5
  155. package/dist/components/Employee/Compensation/List.js.map +1 -1
  156. package/dist/components/Employee/Deductions/Actions.js +9 -8
  157. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  158. package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
  159. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  160. package/dist/components/Employee/Deductions/Deductions.js +74 -79
  161. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  162. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  163. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  164. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  165. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  166. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  167. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  168. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  169. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  170. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
  171. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  172. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  173. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  174. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  175. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  176. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +38 -42
  177. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  178. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  179. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  180. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  181. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  182. package/dist/components/Employee/EmployeeList/EmployeeList.js +59 -58
  183. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  184. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  185. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  186. package/dist/components/Employee/EmployeeList/List.js +3 -2
  187. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  188. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  189. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  190. package/dist/components/Employee/Landing/Landing.js +7 -6
  191. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  192. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  193. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  194. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  195. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  196. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  197. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  198. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +95 -97
  199. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  200. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  201. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  202. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  203. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  204. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  205. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  206. package/dist/components/Employee/Profile/Actions.js +7 -6
  207. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  208. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  209. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  210. package/dist/components/Employee/Profile/HomeAddress.js +5 -4
  211. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  212. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  213. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  214. package/dist/components/Employee/Profile/Profile.js +118 -124
  215. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  216. package/dist/components/Employee/Profile/useProfile.js +4 -3
  217. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  218. package/dist/components/Employee/Taxes/Actions.js +8 -7
  219. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  220. package/dist/components/Employee/Taxes/FederalForm.js +7 -6
  221. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  222. package/dist/components/Employee/Taxes/Taxes.js +59 -60
  223. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  224. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  225. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  226. package/dist/contexts/ApiProvider/ApiProvider.js +16 -14
  227. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  228. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +5 -0
  229. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +2 -0
  230. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +20 -17
  231. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  232. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.d.ts +7 -0
  233. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js +10 -0
  234. package/dist/contexts/LoadingIndicatorProvider/LoadingIndicatorProvider.js.map +1 -0
  235. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +6 -0
  236. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +11 -0
  237. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -0
  238. package/dist/i18n/en/Company.Locations.json.js +2 -2
  239. package/dist/shared/constants.d.ts +2 -0
  240. package/dist/shared/constants.js +10 -9
  241. package/dist/shared/constants.js.map +1 -1
  242. package/dist/style.css +1 -1
  243. package/dist/types/i18next.d.ts +1 -1
  244. package/package.json +8 -1
@@ -3,11 +3,12 @@ import { useTranslation as p } from "react-i18next";
3
3
  import { useCompensation as d } from "./useCompensation.js";
4
4
  import C from "../../../assets/icons/pencil.svg.js";
5
5
  import c from "../../../assets/icons/trashcan.svg.js";
6
+ import "classnames";
6
7
  import { HamburgerMenu as f } from "../../Common/HamburgerMenu/HamburgerMenu.js";
7
8
  import { useDataView as y } from "../../Common/DataView/useDataView.js";
8
9
  import { DataView as g } from "../../Common/DataView/DataView.js";
9
- const D = () => {
10
- const { employeeJobs: i, mode: o, isPending: l, handleEdit: r, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
10
+ const P = () => {
11
+ const { employeeJobs: i, mode: o, isPending: r, handleEdit: l, handleDelete: s } = d(), { t } = p("Employee.Compensation"), { ...m } = y({
11
12
  data: i,
12
13
  columns: [
13
14
  {
@@ -45,7 +46,7 @@ const D = () => {
45
46
  label: t("allCompensations.editCta"),
46
47
  icon: /* @__PURE__ */ a(C, { "aria-hidden": !0 }),
47
48
  onClick: () => {
48
- r(e.uuid);
49
+ l(e.uuid);
49
50
  }
50
51
  },
51
52
  ...e.primary ? [] : [
@@ -58,7 +59,7 @@ const D = () => {
58
59
  }
59
60
  ]
60
61
  ],
61
- isLoading: l
62
+ isLoading: r
62
63
  }
63
64
  )
64
65
  });
@@ -66,6 +67,6 @@ const D = () => {
66
67
  return /* @__PURE__ */ a(g, { "data-testid": "data-view", label: t("allCompensations.tableLabel"), ...m });
67
68
  };
68
69
  export {
69
- D as List
70
+ P as List
70
71
  };
71
72
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,WAAAC,GAAW,YAAAC,GAAY,cAAAC,MAAiBC,EAAgB,GAC9E,EAAE,EAAA,IAAMC,EAAe,uBAAuB,GAE9C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMR;AAAA,IACN,SAAS;AAAA,MACP;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACS,MAAaA,EAAI,SAAS;AAAA,MACrC;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,6BAA6B;AAAA,QACtC,QAAQ,CAACA,MAAa;AACd,gBAAAC,IAAaD,EAAI,eAAe;AAAA,YACpC,CAAAE,MAAQA,EAAK,SAASF,EAAI;AAAA,UAAA,GACzB;AACH,iBAAOC,MAAe,SAAY,EAAE,oBAAoBA,CAAU,EAAE,IAAI;AAAA,QAAA;AAAA,MAE5E;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,+BAA+B;AAAA,QACxC,QAAQ,CAACD,MAAaA,EAAI,MAAM,cAAc;AAAA,MAChD;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAO,EAAE,4BAA4B;AAAA,QACrC,QAAQ,CAACA,MAAaA,EAAI,eAAe;AAAA,MAAA;AAAA,IAE7C;AAAA,IACA,UAAU,CAACA,MACT,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAc,EAAE,gBAAgB;AAAA,QAChC,OAAO;AAAA,UACL;AAAA,YACE,OAAO,EAAE,0BAA0B;AAAA,YACnC,MAAM,gBAAAD,EAACE,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,YAC7B,SAAS,MAAM;AACb,cAAAX,EAAWM,EAAI,IAAI;AAAA,YAAA;AAAA,UAEvB;AAAA,UACA,GAAKA,EAAI,UAUL,CAAA,IATA;AAAA,YACE;AAAA,cACE,OAAO,EAAE,4BAA4B;AAAA,cACrC,MAAM,gBAAAG,EAACG,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAX,EAAaK,EAAI,IAAI;AAAA,cAAA;AAAA,YACvB;AAAA,UACF;AAAA,QAGR;AAAA,QACA,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAKX,WAAA,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../src/components/Employee/Compensation/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { type Job } from '@gusto/embedded-api/models/components/job'\nimport { useCompensation } from './useCompensation'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { DataView, useDataView } from '@/components/Common'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const List = () => {\n const { employeeJobs, mode, isPending, handleEdit, handleDelete } = useCompensation()\n const { t } = useTranslation('Employee.Compensation')\n\n const { ...dataViewProps } = useDataView({\n data: employeeJobs,\n columns: [\n {\n key: 'title',\n title: t('allCompensations.jobColumn'),\n render: (job: Job) => job.title || '',\n },\n {\n key: 'flsaStatus',\n title: t('allCompensations.typeColumn'),\n render: (job: Job) => {\n const flsaStatus = job.compensations?.find(\n comp => comp.uuid === job.currentCompensationUuid,\n )?.flsaStatus\n return flsaStatus !== undefined ? t(`flsaStatusLabels.${flsaStatus}`) : null\n },\n },\n {\n key: 'rate',\n title: t('allCompensations.amountColumn'),\n render: (job: Job) => job.rate?.toString() || '',\n },\n {\n key: 'paymentUnit',\n title: t('allCompensations.perColumn'),\n render: (job: Job) => job.paymentUnit || '',\n },\n ],\n itemMenu: (job: Job) => (\n <HamburgerMenu\n triggerLabel={t('hamburgerTitle')}\n items={[\n {\n label: t('allCompensations.editCta'),\n icon: <PencilSvg aria-hidden />,\n onClick: () => {\n handleEdit(job.uuid)\n },\n },\n ...(!job.primary\n ? [\n {\n label: t('allCompensations.deleteCta'),\n icon: <TrashCanSvg aria-hidden />,\n onClick: () => {\n handleDelete(job.uuid)\n },\n },\n ]\n : []),\n ]}\n isLoading={isPending}\n />\n ),\n })\n\n if (mode !== 'LIST') {\n return\n }\n\n return (\n <DataView data-testid=\"data-view\" label={t('allCompensations.tableLabel')} {...dataViewProps} />\n )\n}\n"],"names":["List","employeeJobs","mode","isPending","handleEdit","handleDelete","useCompensation","useTranslation","dataViewProps","useDataView","job","flsaStatus","comp","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AAQO,MAAMA,IAAO,MAAM;AACx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,MAAM,gBAAAG,EAACG,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,cAC/B,SAAS,MAAM;AACb,gBAAAX,EAAaK,EAAI,IAAI;AAAA,cAAA;AAAA,YACvB;AAAA,UACF;AAAA,QAGR;AAAA,QACA,WAAWP;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,CAEH;AAED,MAAID,MAAS;AAKX,WAAA,gBAAAW,EAACI,KAAS,eAAY,aAAY,OAAO,EAAE,6BAA6B,GAAI,GAAGT,GAAe;AAElG;"}
@@ -1,25 +1,26 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as d } from "react-i18next";
3
3
  import { useDeductions as m } from "./useDeductions.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as l } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const y = () => {
7
- const { mode: n, handleAdd: i, handleCancel: r, handlePassthrough: s, isPending: c } = m(), { t: o } = d("Employee.Deductions"), t = l();
7
+ const L = () => {
8
+ const { mode: o, handleAdd: i, handleCancel: r, handlePassthrough: s, isPending: c } = m(), { t: n } = d("Employee.Deductions"), t = l();
8
9
  return /* @__PURE__ */ a(u, { children: [
9
- (n === "ADD" || n === "EDIT") && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: r, children: o("cancelCta") }),
10
- n === "LIST" && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: i, children: o("addDeductionCta") }),
10
+ (o === "ADD" || o === "EDIT") && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: r, children: n("cancelCta") }),
11
+ o === "LIST" && /* @__PURE__ */ e(t.Button, { variant: "secondary", onClick: i, children: n("addDeductionCta") }),
11
12
  /* @__PURE__ */ e(
12
13
  t.Button,
13
14
  {
14
- type: n === "LIST" ? "button" : "submit",
15
+ type: o === "LIST" ? "button" : "submit",
15
16
  isLoading: c,
16
- onClick: n === "LIST" ? s : void 0,
17
- children: o("continueCta")
17
+ onClick: o === "LIST" ? s : void 0,
18
+ children: n("continueCta")
18
19
  }
19
20
  )
20
21
  ] });
21
22
  };
22
23
  export {
23
- y as Actions
24
+ L as Actions
24
25
  };
25
26
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Deductions/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { mode, handleAdd, handleCancel, handlePassthrough, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'EDIT') && (\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n )}\n <Components.Button\n type={mode === 'LIST' ? 'button' : 'submit'}\n isLoading={isPending}\n onClick={mode === 'LIST' ? handlePassthrough : undefined}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","mode","handleAdd","handleCancel","handlePassthrough","isPending","useDeductions","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,mBAAAC,GAAmB,WAAAC,MAAcC,EAAc,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAV,MAAS,SAASA,MAAS,WAC3B,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAC7C,UAAAI,EAAE,WAAW,GAChB;AAAA,IAEDN,MAAS,UACP,gBAAAW,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAC7C,UAAEK,EAAA,iBAAiB,EACtB,CAAA;AAAA,IAEF,gBAAAK;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMR,MAAS,SAAS,WAAW;AAAA,QACnC,WAAWI;AAAA,QACX,SAASJ,MAAS,SAASG,IAAoB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAClB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Deductions/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { mode, handleAdd, handleCancel, handlePassthrough, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n {(mode === 'ADD' || mode === 'EDIT') && (\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n )}\n {mode === 'LIST' && (\n <Components.Button variant=\"secondary\" onClick={handleAdd}>\n {t('addDeductionCta')}\n </Components.Button>\n )}\n <Components.Button\n type={mode === 'LIST' ? 'button' : 'submit'}\n isLoading={isPending}\n onClick={mode === 'LIST' ? handlePassthrough : undefined}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","mode","handleAdd","handleCancel","handlePassthrough","isPending","useDeductions","t","useTranslation","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,mBAAAC,GAAmB,WAAAC,MAAcC,EAAc,GAChF,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB;AAEvC,2BACGC,GACG,EAAA,UAAA;AAAA,KAAAV,MAAS,SAASA,MAAS,WAC3B,gBAAAW,EAACH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASN,GAC7C,UAAAI,EAAE,WAAW,GAChB;AAAA,IAEDN,MAAS,UACP,gBAAAW,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASP,GAC7C,UAAEK,EAAA,iBAAiB,EACtB,CAAA;AAAA,IAEF,gBAAAK;AAAA,MAACH,EAAW;AAAA,MAAX;AAAA,QACC,MAAMR,MAAS,SAAS,WAAW;AAAA,QACnC,WAAWI;AAAA,QACX,SAASJ,MAAS,SAASG,IAAoB;AAAA,QAE9C,YAAE,aAAa;AAAA,MAAA;AAAA,IAAA;AAAA,EAClB,GACF;AAEJ;"}
@@ -2,13 +2,14 @@ import { jsxs as l, Fragment as m, jsx as t } from "react/jsx-runtime";
2
2
  import { useFormContext as s, useWatch as i } from "react-hook-form";
3
3
  import { useTranslation as p } from "react-i18next";
4
4
  import { useDeductions as b } from "./useDeductions.js";
5
+ import "classnames";
5
6
  import { useI18n as f } from "../../../i18n/I18n.js";
6
7
  import { useComponentContext as D } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import { TextInputField as g } from "../../Common/Fields/TextInputField/TextInputField.js";
8
9
  import { RadioGroupField as a } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
10
  import { NumberInputField as u } from "../../Common/Fields/NumberInputField/NumberInputField.js";
10
11
  import { CheckboxField as x } from "../../Common/Fields/CheckboxField/CheckboxField.js";
11
- const I = () => {
12
+ const R = () => {
12
13
  const { mode: n } = b(), { control: r } = s();
13
14
  f("Employee.Deductions");
14
15
  const { t: e } = p("Employee.Deductions"), o = D(), c = i({ control: r, name: "recurring" }), d = i({ control: r, name: "deductAsPercentage" });
@@ -71,6 +72,6 @@ const I = () => {
71
72
  ] });
72
73
  };
73
74
  export {
74
- I as DeductionForm
75
+ R as DeductionForm
75
76
  };
76
77
  //# sourceMappingURL=DeductionForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionForm.js","sources":["../../../../src/components/Employee/Deductions/DeductionForm.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions, type DeductionInputs } from './useDeductions'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const DeductionForm = () => {\n const { mode } = useDeductions()\n const { control } = useFormContext<DeductionInputs>()\n useI18n('Employee.Deductions')\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedDeductAsPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n if (mode !== 'ADD' && mode !== 'EDIT') return\n\n return (\n <>\n <Components.Heading as=\"h2\">\n {mode === 'EDIT' ? t('editDeductionTitle') : t('addDeductionTitle')}\n </Components.Heading>\n <Components.Text>{t('addDeuctionDescription')}</Components.Text>\n <TextInputField\n name=\"description\"\n label={t('descriptionLabel')}\n isRequired\n errorMessage={t('validations.description')}\n />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <div className=\"deduction-amount-section\">\n <NumberInputField\n name=\"amount\"\n isRequired\n label={t('deductionAmountLabel')}\n format={watchedDeductAsPercentage === 'true' ? 'percent' : 'currency'}\n min={0}\n errorMessage={t('validations.amount')}\n />\n </div>\n {watchedRecurring === 'true' && (\n <NumberInputField\n name=\"annualMaximum\"\n label={t('annualMaxLabel')}\n format=\"currency\"\n min={0}\n />\n )}\n <CheckboxField name=\"courtOrdered\" label={t('courtOrderedLabel')} />\n </>\n )\n}\n"],"names":["DeductionForm","mode","useDeductions","control","useFormContext","useI18n","t","useTranslation","Components","useComponentContext","watchedRecurring","useWatch","watchedDeductAsPercentage","jsxs","Fragment","jsx","TextInputField","RadioGroupField","NumberInputField","CheckboxField"],"mappings":";;;;;;;;;;AAYO,MAAMA,IAAgB,MAAM;AAC3B,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,SAAAC,EAAQ,IAAIC,EAAgC;AACpD,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjCC,IAAmBC,EAAS,EAAE,SAAAR,GAAS,MAAM,aAAa,GAC1DS,IAA4BD,EAAS,EAAE,SAAAR,GAAS,MAAM,sBAAsB;AAE9E,MAAA,EAAAF,MAAS,SAASA,MAAS;AAE/B,WAEI,gBAAAY,EAAAC,GAAA,EAAA,UAAA;AAAA,MAAA,gBAAAC,EAACP,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAkBF,EAAlBL,MAAS,SAAW,uBAA0B,mBAAN,EAC3C,CAAA;AAAA,wBACCO,EAAW,MAAX,EAAiB,UAAAF,EAAE,wBAAwB,GAAE;AAAA,MAC9C,gBAAAS;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOV,EAAE,kBAAkB;AAAA,UAC3B,YAAU;AAAA,UACV,cAAcA,EAAE,yBAAyB;AAAA,QAAA;AAAA,MAC3C;AAAA,MACA,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,gBAAgB;AAAA,UACzB,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,0BAA0B,EAAE;AAAA,YACtD,EAAE,OAAO,SAAS,OAAOA,EAAE,wBAAwB,EAAE;AAAA,UAAA;AAAA,QACvD;AAAA,MACF;AAAA,MACA,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOX,EAAE,oBAAoB;AAAA,UAC7B,SAAS;AAAA,YACP,EAAE,OAAO,QAAQ,OAAOA,EAAE,+BAA+B,EAAE;AAAA,YAC3D,EAAE,OAAO,SAAS,OAAOA,EAAE,gCAAgC,EAAE;AAAA,UAAA;AAAA,QAC/D;AAAA,MACF;AAAA,MACA,gBAAAS,EAAC,OAAI,EAAA,WAAU,4BACb,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOZ,EAAE,sBAAsB;AAAA,UAC/B,QAAQM,MAA8B,SAAS,YAAY;AAAA,UAC3D,KAAK;AAAA,UACL,cAAcN,EAAE,oBAAoB;AAAA,QAAA;AAAA,MAAA,GAExC;AAAA,MACCI,MAAqB,UACpB,gBAAAK;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOZ,EAAE,gBAAgB;AAAA,UACzB,QAAO;AAAA,UACP,KAAK;AAAA,QAAA;AAAA,MACP;AAAA,wBAEDa,GAAc,EAAA,MAAK,gBAAe,OAAOb,EAAE,mBAAmB,EAAG,CAAA;AAAA,IAAA,GACpE;AAEJ;"}
1
+ {"version":3,"file":"DeductionForm.js","sources":["../../../../src/components/Employee/Deductions/DeductionForm.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions, type DeductionInputs } from './useDeductions'\nimport {\n CheckboxField,\n NumberInputField,\n RadioGroupField,\n TextInputField,\n} from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const DeductionForm = () => {\n const { mode } = useDeductions()\n const { control } = useFormContext<DeductionInputs>()\n useI18n('Employee.Deductions')\n const { t } = useTranslation('Employee.Deductions')\n const Components = useComponentContext()\n\n const watchedRecurring = useWatch({ control, name: 'recurring' })\n const watchedDeductAsPercentage = useWatch({ control, name: 'deductAsPercentage' })\n\n if (mode !== 'ADD' && mode !== 'EDIT') return\n\n return (\n <>\n <Components.Heading as=\"h2\">\n {mode === 'EDIT' ? t('editDeductionTitle') : t('addDeductionTitle')}\n </Components.Heading>\n <Components.Text>{t('addDeuctionDescription')}</Components.Text>\n <TextInputField\n name=\"description\"\n label={t('descriptionLabel')}\n isRequired\n errorMessage={t('validations.description')}\n />\n <RadioGroupField\n name=\"recurring\"\n label={t('frequencyLabel')}\n options={[\n { value: 'true', label: t('frequencyRecurringOption') },\n { value: 'false', label: t('frequencyOneTimeOption') },\n ]}\n />\n <RadioGroupField\n name=\"deductAsPercentage\"\n label={t('deductionTypeLabel')}\n options={[\n { value: 'true', label: t('deductionTypePercentageOption') },\n { value: 'false', label: t('deductionTypeFixedAmountOption') },\n ]}\n />\n <div className=\"deduction-amount-section\">\n <NumberInputField\n name=\"amount\"\n isRequired\n label={t('deductionAmountLabel')}\n format={watchedDeductAsPercentage === 'true' ? 'percent' : 'currency'}\n min={0}\n errorMessage={t('validations.amount')}\n />\n </div>\n {watchedRecurring === 'true' && (\n <NumberInputField\n name=\"annualMaximum\"\n label={t('annualMaxLabel')}\n format=\"currency\"\n min={0}\n />\n )}\n <CheckboxField name=\"courtOrdered\" label={t('courtOrderedLabel')} />\n </>\n )\n}\n"],"names":["DeductionForm","mode","useDeductions","control","useFormContext","useI18n","t","useTranslation","Components","useComponentContext","watchedRecurring","useWatch","watchedDeductAsPercentage","jsxs","Fragment","jsx","TextInputField","RadioGroupField","NumberInputField","CheckboxField"],"mappings":";;;;;;;;;;;AAYO,MAAMA,IAAgB,MAAM;AAC3B,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,SA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,EAAA,WAAU,4BACb,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOZ,EAAE,sBAAsB;AAAA,UAC/B,QAAQM,MAA8B,SAAS,YAAY;AAAA,UAC3D,KAAK;AAAA,UACL,cAAcN,EAAE,oBAAoB;AAAA,QAAA;AAAA,MAAA,GAExC;AAAA,MACCI,MAAqB,UACpB,gBAAAK;AAAA,QAACG;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOZ,EAAE,gBAAgB;AAAA,UACzB,QAAO;AAAA,UACP,KAAK;AAAA,QAAA;AAAA,MACP;AAAA,wBAEDa,GAAc,EAAA,MAAK,gBAAe,OAAOb,EAAE,mBAAmB,EAAG,CAAA;AAAA,IAAA,GACpE;AAEJ;"}
@@ -1,39 +1,34 @@
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";
1
+ import { jsx as t, jsxs as A } from "react/jsx-runtime";
2
+ import { useTranslation as U } from "react-i18next";
3
+ import { useState as M, useMemo as Y, useEffect as q } from "react";
4
4
  import { z as T } from "zod";
5
- import { useForm as L, FormProvider as O } from "react-hook-form";
6
- import { zodResolver as R } from "@hookform/resolvers/zod";
7
- import { useGarnishmentsListSuspense as G, invalidateGarnishmentsList as N } 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";
5
+ import { useForm as O, FormProvider as C } from "react-hook-form";
6
+ import { zodResolver as y } from "@hookform/resolvers/zod";
7
+ import { useGarnishmentsListSuspense as B } from "@gusto/embedded-api/react-query/garnishmentsList";
8
+ import { useGarnishmentsCreateMutation as R } from "@gusto/embedded-api/react-query/garnishmentsCreate";
9
+ import { useGarnishmentsUpdateMutation as j } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
10
+ import { DeductionSchema as G, DeductionsProvider as z } from "./useDeductions.js";
11
+ import { BaseComponent as H } from "../../Base/Base.js";
12
+ import { useBase as V } from "../../Base/useBase.js";
13
+ import { Form as L } from "../../Common/Form/Form.js";
14
+ import { useComponentDictionary as k, useI18n as J } from "../../../i18n/I18n.js";
16
15
  import { componentEvents as s } from "../../../shared/constants.js";
17
- import { Actions as _ } from "./Actions.js";
18
- import { IncludeDeductionsForm as X } from "./IncludeDeductionsForm.js";
19
- import { Head as b } 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";
16
+ import { Actions as N } from "./Actions.js";
17
+ import { IncludeDeductionsForm as K } from "./IncludeDeductionsForm.js";
18
+ import { Head as S } from "./Head.js";
19
+ import { DeductionForm as Q } from "./DeductionForm.js";
20
+ import { DeductionsList as W } from "./DeductionsList.js";
21
+ import { useFlow as X } from "../../Flow/useFlow.js";
23
22
  T.object({ includeDeductions: T.enum(["Yes", "No"]) });
24
- function te(n) {
25
- return /* @__PURE__ */ t(k, { ...n, children: /* @__PURE__ */ t(ne, { ...n, children: n.children }) });
23
+ function Z(o) {
24
+ return /* @__PURE__ */ t(H, { ...o, children: /* @__PURE__ */ t($, { ...o, children: o.children }) });
26
25
  }
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: x } = G({ employeeId: n }), p = x.garnishmentList, { mutateAsync: g, isPending: w } = z({
31
- onSettled: () => N(f, [n])
32
- }), { mutateAsync: F, isPending: U } = j({
33
- onSettled: () => N(f, [n])
34
- }), P = p.filter((r) => r.active), [u, m] = M(P.length < 1 ? "INITIAL" : "LIST"), [e, l] = M(null);
35
- W("Employee.Deductions");
36
- const D = y(() => ({
26
+ const $ = ({ employeeId: o, className: d, dictionary: a }) => {
27
+ const { onEvent: i, baseSubmitHandler: h } = V();
28
+ k("Employee.Deductions", a);
29
+ const { data: _ } = B({ employeeId: o }), f = _.garnishmentList, { mutateAsync: p, isPending: b } = j(), { mutateAsync: x, isPending: w } = R(), g = f.filter((r) => r.active), [u, m] = M(g.length < 1 ? "INITIAL" : "LIST"), [e, l] = M(null);
30
+ J("Employee.Deductions");
31
+ const D = Y(() => ({
37
32
  amount: e?.amount ? Number(e.amount) : 0,
38
33
  description: e?.description ?? "",
39
34
  times: e?.times ?? null,
@@ -43,57 +38,57 @@ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
43
38
  deductAsPercentage: e?.deductAsPercentage?.toString() ?? "true",
44
39
  active: !0,
45
40
  courtOrdered: e?.courtOrdered ?? !1
46
- }), [e]), I = L({
41
+ }), [e]), I = O({
47
42
  // resolver: zodResolver(IncludeDeductionsSchema),
48
43
  defaultValues: { includeDeductions: "No" }
49
- }), E = L({
50
- resolver: R(V),
44
+ }), E = O({
45
+ resolver: y(G),
51
46
  defaultValues: D
52
- }), { reset: v } = E;
53
- B(() => {
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({
47
+ }), { reset: P } = E;
48
+ q(() => {
49
+ P(D);
50
+ }, [e, D, P, u]);
51
+ const F = async (r) => {
52
+ await h(r, async (n) => {
53
+ const { garnishment: c } = await p({
59
54
  request: {
60
- garnishmentId: o.uuid,
55
+ garnishmentId: n.uuid,
61
56
  requestBody: {
62
- ...o,
63
- totalAmount: o.totalAmount ?? void 0,
57
+ ...n,
58
+ totalAmount: n.totalAmount ?? void 0,
64
59
  active: !1,
65
- version: o.version
60
+ version: n.version
66
61
  }
67
62
  }
68
63
  });
69
64
  i(s.EMPLOYEE_DEDUCTION_DELETED, c);
70
65
  });
71
- }, A = async (r) => {
72
- await h(r, async (o) => {
73
- if ("includeDeductions" in o)
74
- if (o.includeDeductions === "Yes")
66
+ }, v = async (r) => {
67
+ await h(r, async (n) => {
68
+ if ("includeDeductions" in n)
69
+ if (n.includeDeductions === "Yes")
75
70
  m("ADD"), i(s.EMPLOYEE_DEDUCTION_ADD);
76
71
  else {
77
72
  i(s.EMPLOYEE_DEDUCTION_DONE);
78
73
  return;
79
74
  }
80
- if (!("includeDeductions" in o)) {
75
+ if (!("includeDeductions" in n)) {
81
76
  if (u === "ADD") {
82
- const { garnishment: c } = await F({
77
+ const { garnishment: c } = await x({
83
78
  request: {
84
- employeeId: n,
85
- requestBody: { ...o, times: o.recurring ? null : 1 }
79
+ employeeId: o,
80
+ requestBody: { ...n, times: n.recurring ? null : 1 }
86
81
  }
87
82
  });
88
83
  i(s.EMPLOYEE_DEDUCTION_CREATED, c);
89
84
  } else if (u === "EDIT") {
90
- const { garnishment: c } = await g({
85
+ const { garnishment: c } = await p({
91
86
  request: {
92
87
  garnishmentId: e?.uuid ?? "",
93
88
  requestBody: {
94
- ...o,
89
+ ...n,
95
90
  version: e?.version,
96
- times: o.recurring ? null : 1
91
+ times: n.recurring ? null : 1
97
92
  }
98
93
  }
99
94
  });
@@ -104,20 +99,20 @@ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
104
99
  });
105
100
  };
106
101
  return /* @__PURE__ */ t("section", { className: d, children: /* @__PURE__ */ t(
107
- Q,
102
+ z,
108
103
  {
109
104
  value: {
110
- isPending: U || w,
111
- employeeId: n,
105
+ isPending: w || b,
106
+ employeeId: o,
112
107
  mode: u,
113
- deductions: p,
108
+ deductions: f,
114
109
  handleAdd: () => {
115
110
  m("ADD");
116
111
  },
117
112
  handleCancel: () => {
118
- m(P.length < 1 ? "INITIAL" : "LIST"), l(null);
113
+ m(g.length < 1 ? "INITIAL" : "LIST"), l(null);
119
114
  },
120
- handleDelete: Y,
115
+ handleDelete: F,
121
116
  handleEdit: (r) => {
122
117
  m("EDIT"), l(r);
123
118
  },
@@ -125,21 +120,21 @@ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
125
120
  i(s.EMPLOYEE_DEDUCTION_DONE);
126
121
  }
127
122
  },
128
- children: u === "INITIAL" ? /* @__PURE__ */ t(O, { ...I, children: /* @__PURE__ */ C(S, { onSubmit: I.handleSubmit(A), children: [
129
- /* @__PURE__ */ t(b, {}),
130
- /* @__PURE__ */ t(X, {}),
131
- /* @__PURE__ */ t(_, {})
132
- ] }) }) : /* @__PURE__ */ t(O, { ...E, children: /* @__PURE__ */ C(S, { onSubmit: E.handleSubmit(A), children: [
133
- /* @__PURE__ */ t(b, {}),
134
- /* @__PURE__ */ t($, {}),
135
- /* @__PURE__ */ t(Z, {}),
136
- /* @__PURE__ */ t(_, {})
123
+ children: u === "INITIAL" ? /* @__PURE__ */ t(C, { ...I, children: /* @__PURE__ */ A(L, { onSubmit: I.handleSubmit(v), children: [
124
+ /* @__PURE__ */ t(S, {}),
125
+ /* @__PURE__ */ t(K, {}),
126
+ /* @__PURE__ */ t(N, {})
127
+ ] }) }) : /* @__PURE__ */ t(C, { ...E, children: /* @__PURE__ */ A(L, { onSubmit: E.handleSubmit(v), children: [
128
+ /* @__PURE__ */ t(S, {}),
129
+ /* @__PURE__ */ t(W, {}),
130
+ /* @__PURE__ */ t(Q, {}),
131
+ /* @__PURE__ */ t(N, {})
137
132
  ] }) })
138
133
  }
139
134
  ) });
140
- }, Se = () => {
141
- const { employeeId: n, onEvent: d } = ee(), { t: a } = q("common");
142
- if (!n)
135
+ }, Oe = () => {
136
+ const { employeeId: o, onEvent: d } = X(), { t: a } = U("common");
137
+ if (!o)
143
138
  throw new Error(
144
139
  a("errors.missingParamsOrContext", {
145
140
  component: "Deductions",
@@ -147,11 +142,11 @@ const ne = ({ employeeId: n, className: d, dictionary: a }) => {
147
142
  provider: "FlowProvider"
148
143
  })
149
144
  );
150
- return /* @__PURE__ */ t(te, { employeeId: n, onEvent: d });
145
+ return /* @__PURE__ */ t(Z, { employeeId: o, onEvent: d });
151
146
  };
152
147
  export {
153
- te as Deductions,
154
- Se as DeductionsContextual,
155
- ne as Root
148
+ Z as Deductions,
149
+ Oe as DeductionsContextual,
150
+ $ as Root
156
151
  };
157
152
  //# 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 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(activeDeductions.length < 1 ? 'INITIAL' : '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","DeductionsList","DeductionForm","DeductionsContextual","useFlow","t","useTranslation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0CgCA,EAAE,OAAO,EAAE,mBAAmBA,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,CAAA;AAG9E,SAASC,GAAWC,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,GAAW,YAAAC,QAAkC;AAC9E,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GACzCC,IAAcC,EAAe;AACnC,EAAAC,EAAuB,uBAAuBN,CAAU;AAExD,QAAM,EAAE,MAAAO,EAAK,IAAIC,EAA4B,EAAE,YAAAV,GAAY,GACrDW,IAAaF,EAAK,iBAGlB,EAAE,aAAaG,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMC,EAA2BT,GAAa,CAACN,CAAU,CAAC;AAAA,EAAA,CACtE,GACG,EAAE,aAAagB,GAAiB,WAAWC,EAAA,IAC/CC,EAA8B;AAAA,IAC5B,WAAW,MAAMH,EAA2BT,GAAa,CAACN,CAAU,CAAC;AAAA,EAAA,CACtE,GAEGmB,IAAmBR,EAAW,OAAO,CAAAS,MAAaA,EAAU,MAAM,GAClE,CAACC,GAAMC,CAAO,IAAIC,EAAeJ,EAAiB,SAAS,IAAI,YAAY,MAAM,GACjF,CAACK,GAAkBC,CAAmB,IAAIF,EAA6B,IAAI;AACjF,EAAAG,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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 { useGarnishmentsListSuspense } 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 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 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 const { mutateAsync: createDeduction, isPending: isPendingCreate } =\n useGarnishmentsCreateMutation()\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(activeDeductions.length < 1 ? 'INITIAL' : '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","useComponentDictionary","data","useGarnishmentsListSuspense","deductions","updateDeduction","isPendingUpdate","useGarnishmentsUpdateMutation","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":";;;;;;;;;;;;;;;;;;;;;AAsCgCA,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,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AACO,MAAMG,IAAO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AAA;AAAA,QAAA,gBAAAxC,EAAC+C,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,YAAAjD,GAAY,SAAAG,EAAQ,IAAI+C,EAAoC,GAC9D,EAAE,GAAAC,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACpD;AACH,UAAM,IAAI;AAAA,MACRmD,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MACX,CAAA;AAAA,IACH;AAEK,SAAA,gBAAAtD,EAACF,GAAW,EAAA,YAAAK,GAAwB,SAAAG,EAAkB,CAAA;AAC/D;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { useDeductions as g } from "./useDeductions.js";
4
+ import "classnames";
4
5
  import o from "../../Common/hooks/useNumberFormatter.js";
5
6
  import b from "../../../assets/icons/pencil.svg.js";
6
7
  import C from "../../../assets/icons/trashcan.svg.js";
7
8
  import { HamburgerMenu as h } from "../../Common/HamburgerMenu/HamburgerMenu.js";
8
9
  import { useDataView as y } from "../../Common/DataView/useDataView.js";
9
10
  import { DataView as D } from "../../Common/DataView/DataView.js";
10
- const S = () => {
11
+ const V = () => {
11
12
  const { mode: i, deductions: m, handleDelete: a, handleEdit: u, isPending: c } = g(), { t: r } = p("Employee.Deductions"), s = o("currency"), l = o("percent"), d = m.filter((e) => e.active), { ...f } = y({
12
13
  data: d,
13
14
  columns: [
@@ -53,6 +54,6 @@ const S = () => {
53
54
  return /* @__PURE__ */ t(D, { label: r("deductionsTableLabel"), ...f });
54
55
  };
55
56
  export {
56
- S as DeductionsList
57
+ V as DeductionsList
57
58
  };
58
59
  //# sourceMappingURL=DeductionsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsList.js","sources":["../../../../src/components/Employee/Deductions/DeductionsList.tsx"],"sourcesContent":["import type React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useDataView, DataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const DeductionsList: React.FC = () => {\n const { mode, deductions, handleDelete, handleEdit, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n { key: 'description', title: t('nameColumn') },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPending}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: () => {\n handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n return <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n}\n"],"names":["DeductionsList","mode","deductions","handleDelete","handleEdit","isPending","useDeductions","t","useTranslation","formatCurrency","useNumberFormatter","formatPercent","activeDeductions","deduction","dataViewProps","useDataView","formattedAmount","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;AASO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,MAAAC,GAAM,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,WAAAC,MAAcC,EAAc,GAC1E,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS,GAE5CE,IAAmBV,EAAW,OAAO,CAAAW,MAAaA,EAAU,MAAM,GAElE,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMH;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,eAAe,OAAOL,EAAE,YAAY,EAAE;AAAA,MAC7C;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAaM,MACZA,EAAU,YAAYN,EAAE,eAAe,IAAIA,EAAE,kBAAkB;AAAA,MAE1E;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAaM,MAAA;AACnB,gBAAMG,IAAkBH,EAAU,qBAC9BF,EAAc,OAAOE,EAAU,MAAM,CAAC,IACtCJ,EAAe,OAAOI,EAAU,MAAM,CAAC;AACpC,iBAAAA,EAAU,YACbN,EAAE,mBAAmB,EAAE,OAAOS,EAAiB,CAAA,IAC/CA;AAAA,QAAA;AAAA,MACN;AAAA,IAEJ;AAAA,IACA,UAAU,CAAaH,MAEnB,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWb;AAAA,QACX,OAAO;AAAA,UACL;AAAA,YACE,OAAOE,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAH,EAAWS,CAAS;AAAA,YACtB;AAAA,YACA,MAAM,gBAAAI,EAACE,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAC/B;AAAA,UACA;AAAA,YACE,OAAOZ,EAAE,WAAW;AAAA,YACpB,SAAS,MAAM;AACb,cAAAJ,EAAaU,CAAS;AAAA,YACxB;AAAA,YACA,MAAM,gBAAAI,EAACG,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,MAAInB,MAAS;AACb,6BAAQoB,GAAS,EAAA,OAAOd,EAAE,sBAAsB,GAAI,GAAGO,GAAe;AACxE;"}
1
+ {"version":3,"file":"DeductionsList.js","sources":["../../../../src/components/Employee/Deductions/DeductionsList.tsx"],"sourcesContent":["import type React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { useDataView, DataView } from '@/components/Common'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport TrashCanSvg from '@/assets/icons/trashcan.svg?react'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\n\nexport const DeductionsList: React.FC = () => {\n const { mode, deductions, handleDelete, handleEdit, isPending } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n const formatCurrency = useNumberFormatter('currency')\n const formatPercent = useNumberFormatter('percent')\n\n const activeDeductions = deductions.filter(deduction => deduction.active)\n\n const { ...dataViewProps } = useDataView({\n data: activeDeductions,\n columns: [\n { key: 'description', title: t('nameColumn') },\n {\n key: 'recurring',\n title: t('frequencyColumn'),\n render: deduction => {\n return deduction.recurring ? t('recurringText') : t('nonRecurringText')\n },\n },\n {\n key: 'amount',\n title: t('withheldColumn'),\n render: deduction => {\n const formattedAmount = deduction.deductAsPercentage\n ? formatPercent(Number(deduction.amount))\n : formatCurrency(Number(deduction.amount))\n return deduction.recurring\n ? t('recurringAmount', { value: formattedAmount })\n : formattedAmount\n },\n },\n ],\n itemMenu: deduction => {\n return (\n <HamburgerMenu\n isLoading={isPending}\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEdit(deduction)\n },\n icon: <PencilSvg aria-hidden />,\n },\n {\n label: t('deleteCta'),\n onClick: () => {\n handleDelete(deduction)\n },\n icon: <TrashCanSvg aria-hidden />,\n },\n ]}\n />\n )\n },\n })\n\n if (mode !== 'LIST') return\n return <DataView label={t('deductionsTableLabel')} {...dataViewProps} />\n}\n"],"names":["DeductionsList","mode","deductions","handleDelete","handleEdit","isPending","useDeductions","t","useTranslation","formatCurrency","useNumberFormatter","formatPercent","activeDeductions","deduction","dataViewProps","useDataView","formattedAmount","jsx","HamburgerMenu","PencilSvg","TrashCanSvg","DataView"],"mappings":";;;;;;;;;;AASO,MAAMA,IAA2B,MAAM;AAC5C,QAAM,EAAE,MAAAC,GAAM,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,WAAAC,MAAcC,EAAc,GAC1E,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAiBC,EAAmB,UAAU,GAC9CC,IAAgBD,EAAmB,SAAS,GAE5CE,IAAmBV,EAAW,OAAO,CAAAW,MAAaA,EAAU,MAAM,GAElE,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMH;AAAA,IACN,SAAS;AAAA,MACP,EAAE,KAAK,eAAe,OAAOL,EAAE,YAAY,EAAE;AAAA,MAC7C;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,iBAAiB;AAAA,QAC1B,QAAQ,CAAaM,MACZA,EAAU,YAAYN,EAAE,eAAe,IAAIA,EAAE,kBAAkB;AAAA,MAE1E;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,OAAOA,EAAE,gBAAgB;AAAA,QACzB,QAAQ,CAAaM,MAAA;AACnB,gBAAMG,IAAkBH,EAAU,qBAC9BF,EAAc,OAAOE,EAAU,MAAM,CAAC,IACtCJ,EAAe,OAAOI,EAAU,MAAM,CAAC;AACpC,iBAAAA,EAAU,YACbN,EAAE,mBAAmB,EAAE,OAAOS,EAAiB,CAAA,IAC/CA;AAAA,QAAA;AAAA,MACN;AAAA,IAEJ;AAAA,IACA,UAAU,CAAaH,MAEnB,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAWb;AAAA,QACX,OAAO;AAAA,UACL;AAAA,YACE,OAAOE,EAAE,SAAS;AAAA,YAClB,SAAS,MAAM;AACb,cAAAH,EAAWS,CAAS;AAAA,YACtB;AAAA,YACA,MAAM,gBAAAI,EAACE,GAAU,EAAA,eAAW,GAAC,CAAA;AAAA,UAC/B;AAAA,UACA;AAAA,YACE,OAAOZ,EAAE,WAAW;AAAA,YACpB,SAAS,MAAM;AACb,cAAAJ,EAAaU,CAAS;AAAA,YACxB;AAAA,YACA,MAAM,gBAAAI,EAACG,GAAY,EAAA,eAAW,GAAC,CAAA;AAAA,UAAA;AAAA,QACjC;AAAA,MACF;AAAA,IACF;AAAA,EAEJ,CACD;AAED,MAAInB,MAAS;AACb,6BAAQoB,GAAS,EAAA,OAAOd,EAAE,sBAAsB,GAAI,GAAGO,GAAe;AACxE;"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { useTranslation as n } from "react-i18next";
3
3
  import { useDeductions as t } from "./useDeductions.js";
4
+ import "classnames";
4
5
  import { RadioGroupField as u } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
5
- const l = () => {
6
+ const m = () => {
6
7
  const { mode: o } = t(), { t: e } = n("Employee.Deductions");
7
8
  if (o === "INITIAL")
8
9
  return /* @__PURE__ */ i(
@@ -19,6 +20,6 @@ const l = () => {
19
20
  );
20
21
  };
21
22
  export {
22
- l as IncludeDeductionsForm
23
+ m as IncludeDeductionsForm
23
24
  };
24
25
  //# sourceMappingURL=IncludeDeductionsForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../src/components/Employee/Deductions/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const IncludeDeductionsForm = () => {\n const { mode } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n if (mode !== 'INITIAL') return\n return (\n <RadioGroupField\n name=\"includeDeductions\"\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 )\n}\n"],"names":["IncludeDeductionsForm","mode","useDeductions","t","useTranslation","jsx","RadioGroupField"],"mappings":";;;;AAIO,MAAMA,IAAwB,MAAM;AACnC,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAClD,MAAIH,MAAS;AAEX,WAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAE;AAAA,UACjD,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAE;AAAA,QAAA;AAAA,MACjD;AAAA,IACF;AAEJ;"}
1
+ {"version":3,"file":"IncludeDeductionsForm.js","sources":["../../../../src/components/Employee/Deductions/IncludeDeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useDeductions } from './useDeductions'\nimport { RadioGroupField } from '@/components/Common'\n\nexport const IncludeDeductionsForm = () => {\n const { mode } = useDeductions()\n const { t } = useTranslation('Employee.Deductions')\n if (mode !== 'INITIAL') return\n return (\n <RadioGroupField\n name=\"includeDeductions\"\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 )\n}\n"],"names":["IncludeDeductionsForm","mode","useDeductions","t","useTranslation","jsx","RadioGroupField"],"mappings":";;;;;AAIO,MAAMA,IAAwB,MAAM;AACnC,QAAA,EAAE,MAAAC,EAAK,IAAIC,EAAc,GACzB,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB;AAClD,MAAIH,MAAS;AAEX,WAAA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOH,EAAE,4BAA4B;AAAA,QACrC,aAAaA,EAAE,8BAA8B;AAAA,QAC7C,SAAS;AAAA,UACP,EAAE,OAAO,OAAO,OAAOA,EAAE,sBAAsB,EAAE;AAAA,UACjD,EAAE,OAAO,MAAM,OAAOA,EAAE,qBAAqB,EAAE;AAAA,QAAA;AAAA,MACjD;AAAA,IACF;AAEJ;"}
@@ -9,10 +9,11 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
9
9
  import "@tanstack/react-query";
10
10
  import "../../Base/useBase.js";
11
11
  import "../../../shared/constants.js";
12
+ import "classnames";
12
13
  import "dompurify";
13
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
14
15
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
- const x = r.object({
16
+ const D = r.object({
16
17
  active: r.boolean(),
17
18
  amount: r.number().min(0).transform(String),
18
19
  description: r.string().min(1),
@@ -23,10 +24,10 @@ const x = r.object({
23
24
  annualMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
24
25
  payPeriodMaximum: r.number().min(0).transform((t) => t > 0 ? t.toString() : null).nullable(),
25
26
  deductAsPercentage: r.string().transform((t) => t === "true")
26
- }), [D, S] = o("DeductionsContext");
27
+ }), [S, C] = o("DeductionsContext");
27
28
  export {
28
- x as DeductionSchema,
29
- S as DeductionsProvider,
30
- D as useDeductions
29
+ D as DeductionSchema,
30
+ C as DeductionsProvider,
31
+ S as useDeductions
31
32
  };
32
33
  //# 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;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
3
  import { useDocumentList as s } from "./useDocumentList.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as m } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function d() {
7
- const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: e } = s(), i = c();
8
- return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(i.Button, { onClick: t, isLoading: !1, isDisabled: !e, children: n("continueCta") }) });
7
+ function C() {
8
+ const { t: n } = r("Employee.DocumentSigner"), { handleContinue: t, hasSignedAllForms: i } = s(), e = c();
9
+ return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(e.Button, { onClick: t, isLoading: !1, isDisabled: !i, children: n("continueCta") }) });
9
10
  }
10
11
  export {
11
- d as Actions
12
+ C as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map