@gusto/embedded-react-sdk 0.10.7-rc.2 → 0.11.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 (272) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/Base/Base.js +19 -18
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js +20 -19
  5. package/dist/components/Common/HamburgerMenu/HamburgerMenu.js.map +1 -1
  6. package/dist/components/Common/ReorderableList/ReorderableItem.js +1 -1
  7. package/dist/components/Common/ReorderableList/ReorderableItem.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  13. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  14. package/dist/components/Common/UI/Button/Button.d.ts +1 -1
  15. package/dist/components/Common/UI/Button/Button.js +4 -4
  16. package/dist/components/Common/UI/Button/Button.js.map +1 -1
  17. package/dist/components/Common/UI/Button/ButtonTypes.d.ts +1 -1
  18. package/dist/components/Company/AssignSignatory/AssignSignatory.d.ts +0 -5
  19. package/dist/components/Company/AssignSignatory/AssignSignatory.js +40 -42
  20. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +8 -6
  22. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +10 -8
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.d.ts +0 -4
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +51 -53
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
  29. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +8 -6
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.d.ts +0 -4
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +40 -42
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  35. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  37. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  38. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  39. package/dist/components/Company/AssignSignatory/index.d.ts +0 -1
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  41. package/dist/components/Company/BankAccount/BankAccount.d.ts +0 -5
  42. package/dist/components/Company/BankAccount/BankAccount.js +17 -23
  43. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  45. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.d.ts +0 -5
  47. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +28 -31
  48. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  49. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -9
  50. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  51. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  52. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +12 -10
  53. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  54. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.d.ts +0 -5
  55. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +25 -28
  56. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  57. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +13 -11
  58. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  59. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.d.ts +0 -5
  60. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +33 -36
  61. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +6 -4
  63. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  64. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +7 -5
  65. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  66. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +0 -6
  67. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +38 -41
  68. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  69. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  70. package/dist/components/Company/DocumentSigner/DocumentSigner.d.ts +0 -4
  71. package/dist/components/Company/DocumentSigner/DocumentSigner.js +23 -26
  72. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  73. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -6
  74. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  75. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  77. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  78. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  79. package/dist/components/Company/FederalTaxes/FederalTaxes.js +7 -6
  80. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  81. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  82. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  83. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  84. package/dist/components/Company/Industry/Actions.js +7 -5
  85. package/dist/components/Company/Industry/Actions.js.map +1 -1
  86. package/dist/components/Company/Industry/Context.js +1 -1
  87. package/dist/components/Company/Industry/Edit.js +12 -10
  88. package/dist/components/Company/Industry/Edit.js.map +1 -1
  89. package/dist/components/Company/Industry/Industry.d.ts +0 -5
  90. package/dist/components/Company/Industry/Industry.js +23 -29
  91. package/dist/components/Company/Industry/Industry.js.map +1 -1
  92. package/dist/components/Company/Locations/LocationForm/Actions.js +8 -6
  93. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  94. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  95. package/dist/components/Company/Locations/LocationForm/LocationForm.d.ts +0 -5
  96. package/dist/components/Company/Locations/LocationForm/LocationForm.js +43 -45
  97. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  99. package/dist/components/Company/Locations/Locations.d.ts +0 -4
  100. package/dist/components/Company/Locations/Locations.js +14 -18
  101. package/dist/components/Company/Locations/Locations.js.map +1 -1
  102. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  103. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  104. package/dist/components/Company/Locations/LocationsList/List.js +4 -2
  105. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  106. package/dist/components/Company/Locations/LocationsList/LocationsList.d.ts +0 -5
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +33 -35
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  110. package/dist/components/Company/OnboardingOverview/Completed.js +14 -12
  111. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  112. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +8 -6
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  114. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +3 -2
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  116. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  117. package/dist/components/Company/PaySchedule/PaySchedule.d.ts +1 -7
  118. package/dist/components/Company/PaySchedule/PaySchedule.js +68 -71
  119. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  120. package/dist/components/Company/PaySchedule/_parts/Actions.js +12 -10
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  122. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  123. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -6
  124. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  125. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  126. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  127. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  128. package/dist/components/Company/StateTaxes/StateTaxes.d.ts +0 -4
  129. package/dist/components/Company/StateTaxes/StateTaxes.js +16 -20
  130. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +7 -5
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.d.ts +0 -5
  134. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +44 -47
  135. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  137. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +8 -6
  138. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  139. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +7 -5
  140. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  141. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.d.ts +0 -5
  142. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +26 -29
  143. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  144. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  145. package/dist/components/Contractor/Address/Address.d.ts +0 -5
  146. package/dist/components/Contractor/Address/Address.js +36 -38
  147. package/dist/components/Contractor/Address/Address.js.map +1 -1
  148. package/dist/components/Contractor/Address/Form.js +1 -1
  149. package/dist/components/Contractor/Address/useAddress.js +1 -1
  150. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  151. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +7 -5
  153. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  155. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  156. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  157. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  158. package/dist/components/Contractor/Profile/ContractorProfile.d.ts +11 -0
  159. package/dist/components/Contractor/Profile/ContractorProfile.js +24 -0
  160. package/dist/components/Contractor/Profile/ContractorProfile.js.map +1 -0
  161. package/dist/components/Contractor/Profile/ContractorProfileForm.d.ts +5 -0
  162. package/dist/components/Contractor/Profile/ContractorProfileForm.js +140 -0
  163. package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -0
  164. package/dist/components/Contractor/Profile/index.d.ts +3 -0
  165. package/dist/components/Contractor/Profile/useContractorProfile.d.ts +254 -0
  166. package/dist/components/Contractor/Profile/useContractorProfile.js +223 -0
  167. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -0
  168. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.d.ts +6 -0
  169. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js +27 -0
  170. package/dist/components/Contractor/Submit/ContractorSubmitWithApi.js.map +1 -0
  171. package/dist/components/Contractor/Submit/SubmitDone.d.ts +5 -0
  172. package/dist/components/Contractor/Submit/SubmitDone.js +18 -0
  173. package/dist/components/Contractor/Submit/SubmitDone.js.map +1 -0
  174. package/dist/components/Contractor/Submit/index.d.ts +6 -0
  175. package/dist/components/Contractor/Submit/index.js +20 -0
  176. package/dist/components/Contractor/Submit/index.js.map +1 -0
  177. package/dist/components/Contractor/Submit/index.module.scss.js +8 -0
  178. package/dist/components/Contractor/Submit/index.module.scss.js.map +1 -0
  179. package/dist/components/Contractor/index.d.ts +2 -0
  180. package/dist/components/Contractor/index.js +10 -6
  181. package/dist/components/Contractor/index.js.map +1 -1
  182. package/dist/components/Employee/Compensation/Actions.js +6 -5
  183. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  184. package/dist/components/Employee/Compensation/Compensation.d.ts +0 -6
  185. package/dist/components/Employee/Compensation/Compensation.js +97 -102
  186. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Edit.js +15 -14
  188. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  189. package/dist/components/Employee/Compensation/List.js +25 -23
  190. package/dist/components/Employee/Compensation/List.js.map +1 -1
  191. package/dist/components/Employee/Deductions/Actions.js +12 -10
  192. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionForm.js +12 -10
  194. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsList.js +7 -5
  196. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  197. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +12 -10
  198. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  200. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  201. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.d.ts +0 -5
  203. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +26 -28
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  205. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  207. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentSigner.d.ts +1 -7
  209. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +16 -20
  210. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.d.ts +0 -7
  212. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +41 -44
  213. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  215. package/dist/components/Employee/EmployeeList/Actions.js +6 -4
  216. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  217. package/dist/components/Employee/EmployeeList/EmployeeList.d.ts +0 -5
  218. package/dist/components/Employee/EmployeeList/EmployeeList.js +57 -59
  219. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  221. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/List.js +15 -14
  223. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  225. package/dist/components/Employee/Landing/Landing.js +13 -12
  226. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  227. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  228. package/dist/components/Employee/PaymentMethod/Actions.js +9 -7
  229. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  230. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -3
  231. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  232. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +10 -8
  233. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  234. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  235. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  236. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  237. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  239. package/dist/components/Employee/Profile/Actions.js +9 -7
  240. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  241. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +3 -3
  242. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  243. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  244. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  245. package/dist/components/Employee/Profile/PersonalDetailsInputs.d.ts +2 -2
  246. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  247. package/dist/components/Employee/Profile/Profile.d.ts +0 -8
  248. package/dist/components/Employee/Profile/Profile.js +131 -138
  249. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  250. package/dist/components/Employee/Profile/useProfile.js +1 -1
  251. package/dist/components/Employee/Taxes/Actions.js +10 -8
  252. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  253. package/dist/components/Employee/Taxes/FederalForm.js +12 -10
  254. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  255. package/dist/components/Employee/Taxes/Taxes.d.ts +0 -6
  256. package/dist/components/Employee/Taxes/Taxes.js +76 -81
  257. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  258. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  259. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +4 -2
  260. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  261. package/dist/i18n/I18n.js +1 -1
  262. package/dist/i18n/I18n.js.map +1 -1
  263. package/dist/i18n/en/Contractor.ContractorSubmit.json.js +22 -0
  264. package/dist/i18n/en/Contractor.ContractorSubmit.json.js.map +1 -0
  265. package/dist/i18n/en/Contractor.Profile.json.js +73 -0
  266. package/dist/i18n/en/Contractor.Profile.json.js.map +1 -0
  267. package/dist/shared/constants.d.ts +14 -0
  268. package/dist/shared/constants.js +33 -26
  269. package/dist/shared/constants.js.map +1 -1
  270. package/dist/style.css +1 -1
  271. package/dist/types/i18next.d.ts +77 -1
  272. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAoB,GACjC,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAsB,GACjF,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACK,WAAA;AAGH,QAAAK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAK,EAAA,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAC,gBAAAC,EAAAX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAEM,EAAAE,IAAiB,sBAAsB,0BAA0B,EACtE,CAAA;AAAA,sBACC,KAAG,EAAA,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAASO,OAAA;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IACJ;AAAA,IAED,gBAAAE,EAAAE,GAAA,EACC,UAAC,gBAAAF,EAAAX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAEE,EAAAE,IAAiB,oBAAoB,wBAAwB,GAClE,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"MissingRequirements.js","sources":["../../../../src/components/Company/OnboardingOverview/MissingRequirements.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { ActionsLayout, Flex } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const MissingRequirements = () => {\n const Components = useComponentContext()\n const { onboardingSteps, onboardingCompleted, handleContinue } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n\n if (onboardingCompleted) {\n return null\n }\n\n const isInitialSetup = !onboardingSteps?.some(step => step.required && step.completed)\n\n return (\n <Flex flexDirection=\"column\" alignItems=\"flex-start\" gap={8}>\n <Components.Heading as=\"h2\">\n {t(isInitialSetup ? 'initialSetupTitle' : 'missingRequirementsTitle')}\n </Components.Heading>\n <p>{t(isInitialSetup ? 'initialSetupDescription' : 'missingRequirementsDescription')}</p>\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps.map(step => ({\n completed: step.completed!,\n title: t(`stepTitles.${step.id!}`),\n description: t(`stepDescriptions.${step.id!}`),\n }))}\n />\n )}\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleContinue}>\n {t(isInitialSetup ? 'initialSetupCta' : 'missingRequirementsCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n )\n}\n"],"names":["MissingRequirements","Components","useComponentContext","onboardingSteps","onboardingCompleted","handleContinue","useOnboardingOverview","t","useTranslation","isInitialSetup","step","Flex","jsx","RequirementsList","ActionsLayout"],"mappings":";;;;;;;;;AAMO,MAAMA,IAAsB,MAAM;AACvC,QAAMC,IAAaC,EAAoB,GACjC,EAAE,iBAAAC,GAAiB,qBAAAC,GAAqB,gBAAAC,EAAA,IAAmBC,EAAsB,GACjF,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AAEzD,MAAIJ;AACK,WAAA;AAGH,QAAAK,IAAiB,CAACN,GAAiB,KAAK,OAAQO,EAAK,YAAYA,EAAK,SAAS;AAErF,2BACGC,GAAK,EAAA,eAAc,UAAS,YAAW,cAAa,KAAK,GACxD,UAAA;AAAA,IAAC,gBAAAC,EAAAX,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAEM,EAAAE,IAAiB,sBAAsB,0BAA0B,EACtE,CAAA;AAAA,sBACC,KAAG,EAAA,UAAAF,EAAEE,IAAiB,4BAA4B,gCAAgC,GAAE;AAAA,IACpFN,KACC,gBAAAS;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,cAAcV,EAAgB,IAAI,CAASO,OAAA;AAAA,UACzC,WAAWA,EAAK;AAAA,UAChB,OAAOH,EAAE,cAAcG,EAAK,EAAG,EAAE;AAAA,UACjC,aAAaH,EAAE,oBAAoBG,EAAK,EAAG,EAAE;AAAA,QAAA,EAC7C;AAAA,MAAA;AAAA,IACJ;AAAA,IAED,gBAAAE,EAAAE,GAAA,EACC,UAAC,gBAAAF,EAAAX,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASI,GAC7C,UAAEE,EAAAE,IAAiB,oBAAoB,wBAAwB,GAClE,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -7,8 +7,9 @@ import { BaseComponent as f } from "../../Base/Base.js";
7
7
  import { useBase as v } from "../../Base/useBase.js";
8
8
  import { useI18n as C, useComponentDictionary as g } from "../../../i18n/I18n.js";
9
9
  import { Flex as h } from "../../Common/Flex/Flex.js";
10
+ import "classnames";
10
11
  import { componentEvents as i } from "../../../shared/constants.js";
11
- function P(o) {
12
+ function j(o) {
12
13
  return C("Company.OnboardingOverview"), g("Company.OnboardingOverview", o.dictionary), /* @__PURE__ */ n(f, { ...o, children: /* @__PURE__ */ n(b, { ...o, children: o.children }) });
13
14
  }
14
15
  const b = ({ companyId: o, className: t, children: e }) => {
@@ -34,6 +35,6 @@ const b = ({ companyId: o, className: t, children: e }) => {
34
35
  ) });
35
36
  };
36
37
  export {
37
- P as OnboardingOverview
38
+ j as OnboardingOverview
38
39
  };
39
40
  //# sourceMappingURL=OnboardingOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACbC,EAAA,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AACtE,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,EAAK,IAAIC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAgB,IAAIH,EAAK;AAUpD,SAAA,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAIG,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAU,EAAA;AAAA,0BACVC,GAAoB,CAAA,CAAA;AAAA,MAAA,EAAA,CACvB,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"OnboardingOverview.js","sources":["../../../../src/components/Company/OnboardingOverview/OnboardingOverview.tsx"],"sourcesContent":["import { useCompaniesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/companiesGetOnboardingStatus'\nimport { OnboardingOverviewProvider } from './context'\nimport { MissingRequirements } from './MissingRequirements'\nimport { Completed } from './Completed'\nimport {\n BaseComponent,\n useBase,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface OnboardingOverviewProps extends CommonComponentInterface<'Company.OnboardingOverview'> {\n companyId: string\n}\n\nexport function OnboardingOverview(props: OnboardingOverviewProps & BaseComponentInterface) {\n useI18n('Company.OnboardingOverview')\n useComponentDictionary('Company.OnboardingOverview', props.dictionary)\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, className, children }: OnboardingOverviewProps) => {\n const { onEvent } = useBase()\n\n const { data } = useCompaniesGetOnboardingStatusSuspense({ companyUuid: companyId })\n const { onboardingCompleted, onboardingSteps } = data.companyOnboardingStatus!\n\n const handleDone = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_DONE)\n }\n const handleContinue = () => {\n onEvent(componentEvents.COMPANY_OVERVIEW_CONTINUE)\n }\n\n return (\n <section className={className}>\n <OnboardingOverviewProvider\n value={{\n onboardingCompleted,\n onboardingSteps,\n handleDone,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Completed />\n <MissingRequirements />\n </>\n )}\n </Flex>\n </OnboardingOverviewProvider>\n </section>\n )\n}\n"],"names":["OnboardingOverview","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","companyId","className","children","onEvent","useBase","data","useCompaniesGetOnboardingStatusSuspense","onboardingCompleted","onboardingSteps","OnboardingOverviewProvider","componentEvents","Flex","jsxs","Fragment","Completed","MissingRequirements"],"mappings":";;;;;;;;;;;AAmBO,SAASA,EAAmBC,GAAyD;AAC1F,SAAAC,EAAQ,4BAA4B,GACbC,EAAA,8BAA8BF,EAAM,UAAU,GAEnE,gBAAAG,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,QAAwC;AACtE,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,EAAE,MAAAC,EAAK,IAAIC,EAAwC,EAAE,aAAaN,GAAW,GAC7E,EAAE,qBAAAO,GAAqB,iBAAAC,EAAgB,IAAIH,EAAK;AAUpD,SAAA,gBAAAR,EAAC,aAAQ,WAAAI,GACP,UAAA,gBAAAJ;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,qBAAAF;AAAA,QACA,iBAAAC;AAAA,QACA,YAbW,MAAM;AACvB,UAAAL,EAAQO,EAAgB,qBAAqB;AAAA,QAC/C;AAAA,QAYQ,gBAXe,MAAM;AAC3B,UAAAP,EAAQO,EAAgB,yBAAyB;AAAA,QACnD;AAAA,MAUM;AAAA,MAEA,UAAA,gBAAAb,EAACc,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAT,KAIG,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhB,EAACiB,GAAU,EAAA;AAAA,0BACVC,GAAoB,CAAA,CAAA;AAAA,MAAA,EAAA,CACvB,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
+ import "classnames";
11
12
  import "dompurify";
12
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
15
  const [x, C] = o("OnboardingOverviewContext");
16
16
  export {
@@ -4,11 +4,5 @@ interface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule
4
4
  companyId: string;
5
5
  defaultValues?: PayScheduleDefaultValues;
6
6
  }
7
- export declare const PaySchedule: {
8
- ({ companyId, defaultValues, dictionary, ...props }: PayScheduleProps & BaseComponentInterface): import("react/jsx-runtime").JSX.Element;
9
- Head: () => import("react/jsx-runtime").JSX.Element;
10
- List: () => import("react/jsx-runtime").JSX.Element | null;
11
- Edit: () => import("react/jsx-runtime").JSX.Element | null;
12
- Actions: () => import("react/jsx-runtime").JSX.Element;
13
- };
7
+ export declare const PaySchedule: ({ companyId, defaultValues, dictionary, ...props }: PayScheduleProps & BaseComponentInterface) => import("react/jsx-runtime").JSX.Element;
14
8
  export {};
@@ -1,30 +1,31 @@
1
- import { jsx as t, jsxs as J } from "react/jsx-runtime";
2
- import { useForm as K, FormProvider as Q } from "react-hook-form";
3
- import { zodResolver as W } from "@hookform/resolvers/zod";
4
- import { useState as A, useEffect as _ } from "react";
5
- import { usePaySchedulesGetPreview as X } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
- import { usePaySchedulesUpdateMutation as Z } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
- import { usePaySchedulesGetAllSuspense as $ } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
- import { usePaySchedulesCreateMutation as V } from "@gusto/embedded-api/react-query/paySchedulesCreate";
9
- import { PayScheduleSchema as ee, PayScheduleProvider as oe } from "./usePaySchedule.js";
10
- import { Form as re } from "../../Common/Form/Form.js";
11
- import { BaseComponent as ae } from "../../Base/Base.js";
12
- import { useBase as te } from "../../Base/useBase.js";
13
- import { Flex as ne } from "../../Common/Flex/Flex.js";
14
- import { useI18n as ce, useComponentDictionary as ie } from "../../../i18n/I18n.js";
15
- import { componentEvents as l } from "../../../shared/constants.js";
16
- import { formatDateToStringDate as p } from "../../../helpers/dateFormatting.js";
17
- import { Head as w } from "./_parts/Head.js";
18
- import { List as C } from "./_parts/List.js";
19
- import { Edit as L } from "./_parts/Edit.js";
20
- import { Actions as q } from "./_parts/Actions.js";
21
- const u = ({
1
+ import { jsx as t, jsxs as I } from "react/jsx-runtime";
2
+ import { useForm as j, FormProvider as k } from "react-hook-form";
3
+ import { zodResolver as G } from "@hookform/resolvers/zod";
4
+ import { useState as v, useEffect as A } from "react";
5
+ import { usePaySchedulesGetPreview as z } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
+ import { usePaySchedulesUpdateMutation as J } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
+ import { usePaySchedulesGetAllSuspense as K } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
+ import { usePaySchedulesCreateMutation as Q } from "@gusto/embedded-api/react-query/paySchedulesCreate";
9
+ import { PayScheduleSchema as W, PayScheduleProvider as X } from "./usePaySchedule.js";
10
+ import { Form as Z } from "../../Common/Form/Form.js";
11
+ import { BaseComponent as $ } from "../../Base/Base.js";
12
+ import { useBase as V } from "../../Base/useBase.js";
13
+ import { Flex as ee } from "../../Common/Flex/Flex.js";
14
+ import "classnames";
15
+ import { componentEvents as S } from "../../../shared/constants.js";
16
+ import { useI18n as oe, useComponentDictionary as re } from "../../../i18n/I18n.js";
17
+ import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
18
+ import { Head as ae } from "./_parts/Head.js";
19
+ import { List as te } from "./_parts/List.js";
20
+ import { Edit as ne } from "./_parts/Edit.js";
21
+ import { Actions as ce } from "./_parts/Actions.js";
22
+ const Oe = ({
22
23
  companyId: n,
23
24
  defaultValues: s,
24
25
  dictionary: a,
25
26
  ...P
26
- }) => (ce("Company.PaySchedule"), ie("Company.PaySchedule", a), /* @__PURE__ */ t(ae, { ...P, children: /* @__PURE__ */ t(de, { companyId: n, defaultValues: s, children: P.children }) })), de = ({ companyId: n, children: s, defaultValues: a }) => {
27
- const { baseSubmitHandler: P, onEvent: h, fieldErrors: f, setError: T } = te(), [i, y] = A("LIST_PAY_SCHEDULES"), [E, O] = A(null), H = {
27
+ }) => (oe("Company.PaySchedule"), re("Company.PaySchedule", a), /* @__PURE__ */ t($, { ...P, children: /* @__PURE__ */ t(ie, { companyId: n, defaultValues: s, children: P.children }) })), ie = ({ companyId: n, children: s, defaultValues: a }) => {
28
+ const { baseSubmitHandler: P, onEvent: u, fieldErrors: h, setError: _ } = V(), [i, y] = v("LIST_PAY_SCHEDULES"), [f, w] = v(null), C = {
28
29
  frequency: a?.frequency ?? "Every week",
29
30
  anchorPayDate: a?.anchorPayDate ? new Date(a.anchorPayDate) : void 0,
30
31
  anchorEndOfPayPeriod: a?.anchorEndOfPayPeriod ? new Date(a.anchorEndOfPayPeriod) : void 0,
@@ -33,23 +34,23 @@ const u = ({
33
34
  customName: a?.customName ?? "",
34
35
  customTwicePerMonth: "false",
35
36
  payPeriodPreviewRange: 0
36
- }, { data: U } = $({
37
+ }, { data: L } = K({
37
38
  companyId: n
38
- }), M = V(), Y = Z(), D = K({
39
- resolver: W(ee),
40
- defaultValues: H
41
- }), { watch: N, setValue: S, reset: d, clearErrors: b, setError: v } = D;
42
- _(() => {
43
- f && f.forEach((o) => {
44
- v(o.key, { message: o.message });
39
+ }), q = Q(), T = J(), E = j({
40
+ resolver: G(W),
41
+ defaultValues: C
42
+ }), { watch: O, setValue: D, reset: d, clearErrors: H, setError: p } = E;
43
+ A(() => {
44
+ h && h.forEach((o) => {
45
+ p(o.key, { message: o.message });
45
46
  });
46
- }, [v, f]);
47
- const e = N(), g = e.anchorPayDate && p(e.anchorPayDate) || "", B = e.anchorEndOfPayPeriod && p(e.anchorEndOfPayPeriod) || "", { data: R, isLoading: x } = X(
47
+ }, [p, h]);
48
+ const e = O(), U = e.anchorPayDate && l(e.anchorPayDate) || "", M = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: Y, isLoading: N } = z(
48
49
  {
49
50
  companyId: n,
50
51
  frequency: e.frequency,
51
- anchorPayDate: g,
52
- anchorEndOfPayPeriod: B,
52
+ anchorPayDate: U,
53
+ anchorEndOfPayPeriod: M,
53
54
  day1: e.day1 ?? void 0,
54
55
  day2: e.day2 ?? void 0
55
56
  },
@@ -57,14 +58,14 @@ const u = ({
57
58
  enabled: !!(e.anchorPayDate && e.anchorEndOfPayPeriod && (i === "ADD_PAY_SCHEDULE" || i === "EDIT_PAY_SCHEDULE"))
58
59
  }
59
60
  );
60
- _(() => {
61
- e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? S("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && S("customTwicePerMonth", "custom");
62
- }, [e.frequency, e.day1, e.day2, S, e.customTwicePerMonth]);
63
- const F = () => {
61
+ A(() => {
62
+ e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? D("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && D("customTwicePerMonth", "custom");
63
+ }, [e.frequency, e.day1, e.day2, D, e.customTwicePerMonth]);
64
+ const b = () => {
64
65
  y("ADD_PAY_SCHEDULE"), d({});
65
- }, I = () => {
66
- y("LIST_PAY_SCHEDULES"), d({}), b(), T(null);
67
- }, j = (o) => {
66
+ }, g = () => {
67
+ y("LIST_PAY_SCHEDULES"), d({}), H(), _(null);
68
+ }, B = (o) => {
68
69
  d({
69
70
  frequency: o.frequency,
70
71
  anchorPayDate: o.anchorPayDate ? new Date(o.anchorPayDate) : void 0,
@@ -72,14 +73,14 @@ const u = ({
72
73
  day1: o.day1 ?? void 0,
73
74
  day2: o.day2 ?? void 0,
74
75
  customName: o.customName ?? ""
75
- }), O(o), y("EDIT_PAY_SCHEDULE");
76
- }, k = () => {
77
- h(l.PAY_SCHEDULE_DONE);
78
- }, G = async (o) => {
76
+ }), w(o), y("EDIT_PAY_SCHEDULE");
77
+ }, R = () => {
78
+ u(S.PAY_SCHEDULE_DONE);
79
+ }, x = async (o) => {
79
80
  await P(o, async (r) => {
80
- const m = (c) => c && p(c) || "";
81
+ const m = (c) => c && l(c) || "";
81
82
  if (i === "ADD_PAY_SCHEDULE") {
82
- const c = await M.mutateAsync({
83
+ const c = await q.mutateAsync({
83
84
  request: {
84
85
  companyId: n,
85
86
  requestBody: {
@@ -92,11 +93,11 @@ const u = ({
92
93
  }
93
94
  }
94
95
  });
95
- h(l.PAY_SCHEDULE_CREATED, c), d();
96
+ u(S.PAY_SCHEDULE_CREATED, c), d();
96
97
  } else if (i === "EDIT_PAY_SCHEDULE") {
97
- const c = E?.version, z = await Y.mutateAsync({
98
+ const c = f?.version, F = await T.mutateAsync({
98
99
  request: {
99
- payScheduleId: E?.uuid,
100
+ payScheduleId: f?.uuid,
100
101
  companyId: n,
101
102
  requestBody: {
102
103
  frequency: r.frequency,
@@ -109,40 +110,36 @@ const u = ({
109
110
  }
110
111
  }
111
112
  });
112
- h(l.PAY_SCHEDULE_UPDATED, z), d();
113
+ u(S.PAY_SCHEDULE_UPDATED, F), d();
113
114
  }
114
115
  y("LIST_PAY_SCHEDULES");
115
116
  });
116
117
  };
117
118
  return /* @__PURE__ */ t(
118
- oe,
119
+ X,
119
120
  {
120
121
  value: {
121
122
  companyId: n,
122
- handleAdd: F,
123
- handleEdit: j,
124
- handleCancel: I,
125
- handleContinue: k,
123
+ handleAdd: b,
124
+ handleEdit: B,
125
+ handleCancel: g,
126
+ handleContinue: R,
126
127
  mode: i,
127
- paySchedules: U.payScheduleList,
128
- payPeriodPreview: R?.object?.payPeriods,
129
- payPreviewLoading: x,
130
- currentPaySchedule: E
128
+ paySchedules: L.payScheduleList,
129
+ payPeriodPreview: Y?.object?.payPeriods,
130
+ payPreviewLoading: N,
131
+ currentPaySchedule: f
131
132
  },
132
- children: /* @__PURE__ */ t("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ t(Q, { ...D, children: /* @__PURE__ */ t(re, { onSubmit: D.handleSubmit(G), children: s || /* @__PURE__ */ J(ne, { flexDirection: "column", children: [
133
- /* @__PURE__ */ t(w, {}),
134
- /* @__PURE__ */ t(C, {}),
135
- /* @__PURE__ */ t(L, {}),
136
- /* @__PURE__ */ t(q, {})
133
+ children: /* @__PURE__ */ t("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ t(k, { ...E, children: /* @__PURE__ */ t(Z, { onSubmit: E.handleSubmit(x), children: s || /* @__PURE__ */ I(ee, { flexDirection: "column", children: [
134
+ /* @__PURE__ */ t(ae, {}),
135
+ /* @__PURE__ */ t(te, {}),
136
+ /* @__PURE__ */ t(ne, {}),
137
+ /* @__PURE__ */ t(ce, {})
137
138
  ] }) }) }) })
138
139
  }
139
140
  );
140
141
  };
141
- u.Head = w;
142
- u.List = C;
143
- u.Edit = L;
144
- u.Actions = q;
145
142
  export {
146
- u as PaySchedule
143
+ Oe as PaySchedule
147
144
  };
148
145
  //# sourceMappingURL=PaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n const [mode, setMode] = useState<MODE>('LIST_PAY_SCHEDULES')\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n payPeriodPreviewRange: 0,\n }\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.key as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n\nPaySchedule.Head = Head\nPaySchedule.List = List\nPaySchedule.Edit = Edit\nPaySchedule.Actions = Actions\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","paySchedules","usePaySchedulesGetAllSuspense","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,IAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAME,EAAA,SAAA,CACT,EACF,CAAA,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,MAAiBC,GAAQ,GAC9E,CAACC,GAAMC,CAAO,IAAIC,EAAe,oBAAoB,GACrD,CAACC,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWnB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IACzC,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,EACzB,GAEM,EAAE,MAAMoB,EAAa,IAAIC,EAA8B;AAAA,IAC3D,WAAAtB;AAAA,EAAA,CACD,GAEKuB,IAA4BC,EAA8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Y,OAAOiE;AACnBjE,EAAY,OAAOkE;AACnBlE,EAAY,OAAOmE;AACnBnE,EAAY,UAAUoE;"}
1
+ {"version":3,"file":"PaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/PaySchedule.tsx"],"sourcesContent":["import type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useEffect, useState } from 'react'\nimport { usePaySchedulesGetPreview } from '@gusto/embedded-api/react-query/paySchedulesGetPreview'\nimport { usePaySchedulesUpdateMutation } from '@gusto/embedded-api/react-query/paySchedulesUpdate'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePaySchedulesCreateMutation } from '@gusto/embedded-api/react-query/paySchedulesCreate'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Frequency } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayschedules'\nimport type { MODE, PayScheduleInputs, PayScheduleOutputs } from './usePaySchedule'\nimport {\n PayScheduleProvider,\n PayScheduleSchema,\n type PayScheduleDefaultValues,\n} from './usePaySchedule'\nimport { Actions, Edit, Head, List } from './_parts'\nimport { Form } from '@/components/Common/Form'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\ninterface PayScheduleProps extends CommonComponentInterface<'Company.PaySchedule'> {\n companyId: string\n defaultValues?: PayScheduleDefaultValues\n}\n\nexport const PaySchedule = ({\n companyId,\n defaultValues,\n dictionary,\n ...props\n}: PayScheduleProps & BaseComponentInterface) => {\n useI18n('Company.PaySchedule')\n useComponentDictionary('Company.PaySchedule', dictionary)\n return (\n <BaseComponent {...props}>\n <Root companyId={companyId} defaultValues={defaultValues}>\n {props.children}\n </Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ companyId, children, defaultValues }: PayScheduleProps) => {\n const { baseSubmitHandler, onEvent, fieldErrors, setError: setBaseError } = useBase()\n const [mode, setMode] = useState<MODE>('LIST_PAY_SCHEDULES')\n const [currentPaySchedule, setCurrentPaySchedule] = useState<PayScheduleType | null>(null)\n const transformedDefaultValues: PayScheduleInputs = {\n frequency: defaultValues?.frequency ?? 'Every week',\n anchorPayDate: defaultValues?.anchorPayDate ? new Date(defaultValues.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: defaultValues?.anchorEndOfPayPeriod\n ? new Date(defaultValues.anchorEndOfPayPeriod)\n : undefined,\n day1: defaultValues?.day1 ?? undefined,\n day2: defaultValues?.day2 ?? undefined,\n customName: defaultValues?.customName ?? '',\n customTwicePerMonth: 'false',\n payPeriodPreviewRange: 0,\n }\n\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({\n companyId,\n })\n\n const createPayScheduleMutation = usePaySchedulesCreateMutation()\n const updatePayScheduleMutation = usePaySchedulesUpdateMutation()\n\n const formMethods = useForm<PayScheduleInputs, unknown, PayScheduleOutputs>({\n resolver: zodResolver(PayScheduleSchema),\n defaultValues: transformedDefaultValues,\n })\n const { watch, setValue, reset, clearErrors, setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors) {\n // TODO: These error messages are not being localized correctly\n fieldErrors.forEach(error => {\n setError(error.key as keyof PayScheduleInputs, { message: error.message })\n })\n }\n }, [setError, fieldErrors])\n\n const allValues = watch()\n\n const formattedAnchorPayDate = allValues.anchorPayDate\n ? formatDateToStringDate(allValues.anchorPayDate) || ''\n : ''\n const formattedAnchorEndOfPayPeriod = allValues.anchorEndOfPayPeriod\n ? formatDateToStringDate(allValues.anchorEndOfPayPeriod) || ''\n : ''\n\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: allValues.frequency,\n anchorPayDate: formattedAnchorPayDate,\n anchorEndOfPayPeriod: formattedAnchorEndOfPayPeriod,\n day1: allValues.day1 ?? undefined,\n day2: allValues.day2 ?? undefined,\n },\n {\n enabled: Boolean(\n allValues.anchorPayDate &&\n allValues.anchorEndOfPayPeriod &&\n (mode === 'ADD_PAY_SCHEDULE' || mode === 'EDIT_PAY_SCHEDULE'),\n ),\n },\n )\n\n // Set the custom_twice_per_month value based on the frequency and day_1 and day_2 values as it is not set by the API call\n useEffect(() => {\n if (\n allValues.frequency === 'Twice per month' &&\n allValues.day1 === 15 &&\n allValues.day2 === 31 &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `1st15th`)\n } else if (\n allValues.frequency === 'Twice per month' &&\n allValues.customTwicePerMonth === undefined\n ) {\n setValue('customTwicePerMonth', `custom`)\n }\n }, [allValues.frequency, allValues.day1, allValues.day2, setValue, allValues.customTwicePerMonth])\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n clearErrors()\n setBaseError(null)\n }\n const handleEdit = (schedule: PayScheduleType) => {\n reset({\n frequency: schedule.frequency as Frequency,\n anchorPayDate: schedule.anchorPayDate ? new Date(schedule.anchorPayDate) : undefined,\n anchorEndOfPayPeriod: schedule.anchorEndOfPayPeriod\n ? new Date(schedule.anchorEndOfPayPeriod)\n : undefined,\n day1: schedule.day1 ?? undefined,\n day2: schedule.day2 ?? undefined,\n customName: schedule.customName ?? '',\n })\n setCurrentPaySchedule(schedule)\n setMode('EDIT_PAY_SCHEDULE')\n }\n const handleContinue = () => {\n onEvent(componentEvents.PAY_SCHEDULE_DONE)\n }\n const onSubmit: SubmitHandler<PayScheduleOutputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const formatPayloadDate = (date: Date | undefined): string => {\n return date ? formatDateToStringDate(date) || '' : ''\n }\n\n if (mode === 'ADD_PAY_SCHEDULE') {\n const createPayScheduleResponse = await createPayScheduleMutation.mutateAsync({\n request: {\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_CREATED, createPayScheduleResponse)\n reset()\n } else if (mode === 'EDIT_PAY_SCHEDULE') {\n const version = currentPaySchedule?.version\n const updatePayScheduleResponse = await updatePayScheduleMutation.mutateAsync({\n request: {\n payScheduleId: currentPaySchedule?.uuid as string,\n companyId,\n requestBody: {\n frequency: payload.frequency,\n anchorPayDate: formatPayloadDate(payload.anchorPayDate),\n anchorEndOfPayPeriod: formatPayloadDate(payload.anchorEndOfPayPeriod),\n customName: payload.customName,\n day1: payload.day1,\n day2: payload.day2,\n version: version as string,\n },\n },\n })\n onEvent(componentEvents.PAY_SCHEDULE_UPDATED, updatePayScheduleResponse)\n reset()\n }\n setMode('LIST_PAY_SCHEDULES')\n })\n }\n\n return (\n <PayScheduleProvider\n value={{\n companyId,\n handleAdd,\n handleEdit,\n handleCancel,\n handleContinue,\n mode,\n paySchedules: paySchedules.payScheduleList,\n payPeriodPreview: payPreviewData?.object?.payPeriods,\n payPreviewLoading: isLoading,\n currentPaySchedule,\n }}\n >\n <span data-testid=\"pay-schedule-edit-form\">\n <FormProvider {...formMethods}>\n <Form onSubmit={formMethods.handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <Flex flexDirection=\"column\">\n <Head />\n <List />\n <Edit />\n <Actions />\n </Flex>\n )}\n </Form>\n </FormProvider>\n </span>\n </PayScheduleProvider>\n )\n}\n"],"names":["PaySchedule","companyId","defaultValues","dictionary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","children","baseSubmitHandler","onEvent","fieldErrors","setBaseError","useBase","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","paySchedules","usePaySchedulesGetAllSuspense","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","clearErrors","setError","useEffect","error","allValues","formattedAnchorPayDate","formatDateToStringDate","formattedAnchorEndOfPayPeriod","payPreviewData","isLoading","usePaySchedulesGetPreview","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","createPayScheduleResponse","version","updatePayScheduleResponse","PayScheduleProvider","FormProvider","Form","jsxs","Flex","Head","List","Edit","Actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,GAAQ,qBAAqB,GAC7BC,GAAuB,uBAAuBH,CAAU,GAEtD,gBAAAI,EAACC,GAAe,EAAA,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,MAAK,WAAAR,GAAsB,eAAAC,GACzB,UAAME,EAAA,SAAA,CACT,EACF,CAAA,IAIEK,KAAO,CAAC,EAAE,WAAAR,GAAW,UAAAS,GAAU,eAAAR,QAAsC;AACzE,QAAM,EAAE,mBAAAS,GAAmB,SAAAC,GAAS,aAAAC,GAAa,UAAUC,MAAiBC,EAAQ,GAC9E,CAACC,GAAMC,CAAO,IAAIC,EAAe,oBAAoB,GACrD,CAACC,GAAoBC,CAAqB,IAAIF,EAAiC,IAAI,GACnFG,IAA8C;AAAA,IAClD,WAAWnB,GAAe,aAAa;AAAA,IACvC,eAAeA,GAAe,gBAAgB,IAAI,KAAKA,EAAc,aAAa,IAAI;AAAA,IACtF,sBAAsBA,GAAe,uBACjC,IAAI,KAAKA,EAAc,oBAAoB,IAC3C;AAAA,IACJ,MAAMA,GAAe,QAAQ;AAAA,IAC7B,MAAMA,GAAe,QAAQ;AAAA,IAC7B,YAAYA,GAAe,cAAc;AAAA,IAC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;AAAA,0BACLC,IAAK,EAAA;AAAA,0BACLC,IAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1,18 +1,20 @@
1
1
  import { jsxs as e, Fragment as d, jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
3
  import { usePaySchedule as m } from "../usePaySchedule.js";
4
- import { ActionsLayout as a } from "../../../Common/ActionsLayout/ActionsLayout.js";
4
+ import "classnames";
5
+ import "../../../../shared/constants.js";
6
+ import { ActionsLayout as r } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
7
  import { useComponentContext as u } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const S = () => {
7
- const { t: n } = l("Company.PaySchedule"), { mode: c, handleAdd: r, handleCancel: i, handleContinue: s } = m(), t = u();
8
+ const v = () => {
9
+ const { t: n } = l("Company.PaySchedule"), { mode: i, handleAdd: a, handleCancel: c, handleContinue: s } = m(), t = u();
8
10
  return /* @__PURE__ */ e(d, { children: [
9
- c === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(a, { children: [
11
+ i === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(r, { children: [
10
12
  /* @__PURE__ */ o(
11
13
  t.Button,
12
14
  {
13
15
  variant: "secondary",
14
16
  onClick: () => {
15
- r();
17
+ a();
16
18
  },
17
19
  children: n("addAnotherPayScheduleCta")
18
20
  }
@@ -28,26 +30,26 @@ const S = () => {
28
30
  }
29
31
  )
30
32
  ] }),
31
- c === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
33
+ i === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
32
34
  /* @__PURE__ */ o(
33
35
  t.Button,
34
36
  {
35
37
  variant: "secondary",
36
38
  onClick: () => {
37
- i();
39
+ c();
38
40
  },
39
41
  children: n("actions.cancel")
40
42
  }
41
43
  ),
42
44
  /* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
43
45
  ] }),
44
- c === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
46
+ i === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(r, { children: [
45
47
  /* @__PURE__ */ o(
46
48
  t.Button,
47
49
  {
48
50
  variant: "secondary",
49
51
  onClick: () => {
50
- i();
52
+ c();
51
53
  },
52
54
  children: n("actions.cancel")
53
55
  }
@@ -57,6 +59,6 @@ const S = () => {
57
59
  ] });
58
60
  };
59
61
  export {
60
- S as Actions
62
+ v as Actions
61
63
  };
62
64
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAe,GACnEC,IAAaC,EAAoB;AAEvC,SAEK,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAASR,MAAA,0CACPS,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACH,YAAAJ,EAAA;AAAA,UACZ;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAC/B;AAAA,MACA,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACE,YAAAF,EAAA;AAAA,UACjB;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,EACtD,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const { mode, handleAdd, handleCancel, handleContinue } = usePaySchedule()\n const Components = useComponentContext()\n\n return (\n <>\n {mode === 'LIST_PAY_SCHEDULES' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleAdd()\n }}\n >\n {t('addAnotherPayScheduleCta')}\n </Components.Button>\n <Components.Button\n variant=\"primary\"\n onClick={() => {\n handleContinue()\n }}\n >\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n {mode === 'ADD_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n {mode === 'EDIT_PAY_SCHEDULE' && (\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n handleCancel()\n }}\n >\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\">{t('actions.save')}</Components.Button>\n </ActionsLayout>\n )}\n </>\n )\n}\n"],"names":["Actions","t","useTranslation","mode","handleAdd","handleCancel","handleContinue","usePaySchedule","Components","useComponentContext","jsxs","Fragment","ActionsLayout","jsx"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,MAAAC,GAAM,WAAAC,GAAW,cAAAC,GAAc,gBAAAC,EAAA,IAAmBC,EAAe,GACnEC,IAAaC,EAAoB;AAEvC,SAEK,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAASR,MAAA,0CACPS,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACH,YAAAJ,EAAA;AAAA,UACZ;AAAA,UAEC,YAAE,0BAA0B;AAAA,QAAA;AAAA,MAC/B;AAAA,MACA,gBAAAS;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACE,YAAAF,EAAA;AAAA,UACjB;AAAA,UAEC,YAAE,aAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB,GACF;AAAA,IAEDH,MAAS,sBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,GACtD;AAAA,IAEDE,MAAS,uBACR,gBAAAO,EAACE,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAACL,EAAW;AAAA,QAAX;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,MAAM;AACA,YAAAH,EAAA;AAAA,UACf;AAAA,UAEC,YAAE,gBAAgB;AAAA,QAAA;AAAA,MACrB;AAAA,MACA,gBAAAQ,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAU,UAAAP,EAAE,cAAc,EAAE,CAAA;AAAA,IAAA,EACtD,CAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -6,15 +6,15 @@ import { usePaySchedule as x } from "../usePaySchedule.js";
6
6
  import n from "./Edit.module.scss.js";
7
7
  import { Flex as f } from "../../../Common/Flex/Flex.js";
8
8
  import { Grid as E } from "../../../Common/Grid/Grid.js";
9
- import { useComponentContext as R } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { formatDateNamedWeekdayShortPlusDate as P } from "../../../../helpers/dateFormatting.js";
9
+ import { RadioGroupField as R } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
10
  import { TextInputField as O } from "../../../Common/Fields/TextInputField/TextInputField.js";
12
- import { SelectField as v } from "../../../Common/Fields/SelectField/SelectField.js";
13
- import { RadioGroupField as F } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
14
- import { NumberInputField as D } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
15
- import { DatePickerField as w } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
11
+ import { DatePickerField as P } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
12
+ import { NumberInputField as v } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
13
+ import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import { formatDateNamedWeekdayShortPlusDate as D } from "../../../../helpers/dateFormatting.js";
15
+ import { SelectField as w } from "../../../Common/Fields/SelectField/SelectField.js";
16
16
  const z = () => {
17
- const d = R(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [r, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
17
+ const d = F(), { t: e } = T("Company.PaySchedule"), { payPeriodPreview: t, mode: p, payPreviewLoading: b } = x(), { setValue: o } = S(), [r, g] = N(0), i = u({ name: "frequency" }), l = u({ name: "customTwicePerMonth" }), y = u({ name: "payPeriodPreviewRange" }), q = i === "Twice per month" && l === "custom" || i === "Monthly", C = i === "Twice per month" && l === "custom";
18
18
  return h(() => {
19
19
  i === "Twice per month" && l === "1st15th" && (o("day1", 15), o("day2", 31));
20
20
  }, [i, l, o]), h(() => {
@@ -23,7 +23,7 @@ const z = () => {
23
23
  /* @__PURE__ */ a("div", { className: n.payScheduleForm, children: /* @__PURE__ */ m(f, { flexDirection: "column", children: [
24
24
  /* @__PURE__ */ a(O, { name: "customName", label: "Name", isRequired: !0 }),
25
25
  /* @__PURE__ */ a(
26
- v,
26
+ w,
27
27
  {
28
28
  name: "frequency",
29
29
  label: e("labels.frequency"),
@@ -37,7 +37,7 @@ const z = () => {
37
37
  }
38
38
  ),
39
39
  i === "Twice per month" && /* @__PURE__ */ a(
40
- F,
40
+ R,
41
41
  {
42
42
  name: "customTwicePerMonth",
43
43
  label: e("labels.frequencyOptions"),
@@ -49,7 +49,7 @@ const z = () => {
49
49
  }
50
50
  ),
51
51
  /* @__PURE__ */ a(
52
- w,
52
+ P,
53
53
  {
54
54
  name: "anchorPayDate",
55
55
  label: e("labels.firstPayDate"),
@@ -58,7 +58,7 @@ const z = () => {
58
58
  }
59
59
  ),
60
60
  /* @__PURE__ */ a(
61
- w,
61
+ P,
62
62
  {
63
63
  name: "anchorEndOfPayPeriod",
64
64
  label: e("labels.firstPayPeriodEndDate"),
@@ -66,18 +66,18 @@ const z = () => {
66
66
  isRequired: !0
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ a("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(D, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
70
- /* @__PURE__ */ a("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(D, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
69
+ /* @__PURE__ */ a("div", { className: q ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day1", label: e("labels.firstPayDayOfTheMonth"), isRequired: !0 }) }),
70
+ /* @__PURE__ */ a("div", { className: C ? "" : n.visuallyHidden, children: /* @__PURE__ */ a(v, { name: "day2", label: e("labels.lastPayDayOfTheMonth"), isRequired: !0 }) })
71
71
  ] }) }),
72
72
  /* @__PURE__ */ a(f, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: t && t[r] ? /* @__PURE__ */ m("div", { className: n.calendarContainer, children: [
73
73
  !b && /* @__PURE__ */ a(
74
- v,
74
+ w,
75
75
  {
76
76
  name: "payPeriodPreviewRange",
77
77
  label: e("labels.preview"),
78
78
  options: t.map((s, c) => ({
79
79
  value: String(c),
80
- label: `${P(s.startDate)} – ${P(s.endDate)}`
80
+ label: `${D(s.startDate)} – ${D(s.endDate)}`
81
81
  })),
82
82
  defaultValue: String(r),
83
83
  onChange: (s) => {
@@ -1,14 +1,16 @@
1
- import { jsx as e, jsxs as r, Fragment as o } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s, Fragment as o } from "react/jsx-runtime";
2
2
  import { useTranslation as c, Trans as a } from "react-i18next";
3
3
  import { usePaySchedule as d } from "../usePaySchedule.js";
4
4
  import { Flex as h } from "../../../Common/Flex/Flex.js";
5
+ import "classnames";
6
+ import "../../../../shared/constants.js";
5
7
  import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const y = () => {
7
- const { t } = c("Company.PaySchedule"), n = l(), { mode: s } = d();
8
+ const S = () => {
9
+ const { t } = c("Company.PaySchedule"), n = l(), { mode: r } = d();
8
10
  let i = /* @__PURE__ */ e(o, {});
9
- switch (s) {
11
+ switch (r) {
10
12
  case "LIST_PAY_SCHEDULES":
11
- i = /* @__PURE__ */ r(o, { children: [
13
+ i = /* @__PURE__ */ s(o, { children: [
12
14
  /* @__PURE__ */ e(n.Heading, { as: "h2", children: t("headings.pageTitle") }),
13
15
  /* @__PURE__ */ e(n.Text, { children: /* @__PURE__ */ e(
14
16
  a,
@@ -42,6 +44,6 @@ const y = () => {
42
44
  return /* @__PURE__ */ e(h, { justifyContent: "space-between", flexDirection: "column", gap: 4, children: /* @__PURE__ */ e("header", { children: i }) });
43
45
  };
44
46
  export {
45
- y as Head
47
+ S as Head
46
48
  };
47
49
  //# sourceMappingURL=Head.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAIC,EAAe;AAChC,MAAIC,IAAsC,gBAAAC,EAAAC,GAAA,EAAA;AAE1C,UAAQJ,GAAM;AAAA,IACZ,KAAK;AACH,MAAAE,IAEI,gBAAAG,EAAAD,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAD,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,oBAAoB,GAAE;AAAA,QACrD,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,wBAAwB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UAC3C;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAK,EAACL,EAAW,MAAX,EACC,UAAA,gBAAAK;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAS;AAAA,YACT;AAAA,YACA,YAAY;AAAA,cACV,iBAAiB,gBAAAH,EAACL,EAAW,MAAX,CAAgB,CAAA;AAAA,YAAA;AAAA,UACpC;AAAA,QAAA,EAEJ,CAAA;AAAA,MAAA,GACF;AAEF;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,yBAAyB,GAAE;AAE5D;AAAA,IACF,KAAK;AAED,MAAAI,IAAA,gBAAAC,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAA,EAAE,0BAA0B,GAAE;AAE7D;AAAA,EACF;AAIA,SAAA,gBAAAK,EAACI,GAAK,EAAA,gBAAe,iBAAgB,eAAe,UAAU,KAAK,GACjE,UAAA,gBAAAJ,EAAC,UAAQ,EAAA,UAAAD,EAAc,CAAA,GACzB;AAEJ;"}
1
+ {"version":3,"file":"Head.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Head.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport { usePaySchedule } from '../usePaySchedule'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n// Head slot for PaySchedule component\nexport const Head = () => {\n const { t } = useTranslation('Company.PaySchedule')\n const Components = useComponentContext()\n\n const { mode } = usePaySchedule()\n let headingOutput: React.ReactElement = <></>\n\n switch (mode) {\n case 'LIST_PAY_SCHEDULES':\n headingOutput = (\n <>\n <Components.Heading as=\"h2\">{t('headings.pageTitle')}</Components.Heading>\n <Components.Text>\n <Trans\n i18nKey={'listDescription'}\n t={t}\n components={{\n how_to_choose_schedule: <Components.Link />,\n }}\n />\n </Components.Text>\n <Components.Text>\n <Trans\n i18nKey={'listDescription2'}\n t={t}\n components={{\n payment_law_doc: <Components.Link />,\n }}\n />\n </Components.Text>\n </>\n )\n break\n case 'ADD_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.addPaySchedule')}</Components.Heading>\n )\n break\n case 'EDIT_PAY_SCHEDULE':\n headingOutput = (\n <Components.Heading as=\"h2\">{t('headings.editPaySchedule')}</Components.Heading>\n )\n break\n default:\n }\n\n return (\n <Flex justifyContent=\"space-between\" flexDirection={'column'} gap={4}>\n <header>{headingOutput}</header>\n </Flex>\n )\n}\n"],"names":["Head","useTranslation","Components","useComponentContext","mode","usePaySchedule","headingOutput","jsx","Fragment","jsxs","Trans","Flex"],"mappings":";;;;;;;AAMO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAaC,EAAoB,GAEjC,EAAE,MAAAC,EAAK,IAAI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