@gusto/embedded-react-sdk 0.10.3 → 0.10.5

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 (210) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/Base/Base.js +54 -51
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Base/useBase.d.ts +1 -1
  5. package/dist/components/Base/useBase.js.map +1 -1
  6. package/dist/components/Common/SignatureForm/SignatureForm.js +6 -4
  7. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js +12 -10
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +8 -6
  11. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/AssignSignatory.js +13 -11
  13. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  15. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -0
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +3 -2
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +4 -3
  27. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +10 -9
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/TitleSelect.js +8 -7
  33. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  35. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
  37. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  38. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +8 -7
  39. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  41. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  43. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  44. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  45. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  46. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -4
  47. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  48. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  49. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  50. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +17 -15
  51. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  52. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  53. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  54. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +9 -7
  55. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  57. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  58. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  59. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  60. package/dist/components/Company/FederalTaxes/FederalTaxes.js +17 -15
  61. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  62. package/dist/components/Company/FederalTaxes/Form.js +3 -2
  63. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  64. package/dist/components/Company/FederalTaxes/Head.js +11 -11
  65. package/dist/components/Company/FederalTaxes/Head.js.map +1 -1
  66. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +9 -8
  67. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  68. package/dist/components/Company/Industry/Actions.js +6 -5
  69. package/dist/components/Company/Industry/Actions.js.map +1 -1
  70. package/dist/components/Company/Industry/Context.js +7 -6
  71. package/dist/components/Company/Industry/Context.js.map +1 -1
  72. package/dist/components/Company/Industry/Edit.js +11 -10
  73. package/dist/components/Company/Industry/Edit.js.map +1 -1
  74. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  75. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  76. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  77. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  78. package/dist/components/Company/Locations/LocationForm/LocationForm.js +9 -7
  79. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  81. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  83. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  84. package/dist/components/Company/Locations/LocationsList/List.js +9 -8
  85. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationsList/LocationsList.js +11 -9
  87. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  88. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  89. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  90. package/dist/components/Company/OnboardingOverview/Completed.js +6 -5
  91. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  92. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +3 -2
  93. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  94. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +4 -2
  95. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  96. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  97. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  98. package/dist/components/Company/PaySchedule/PaySchedule.js +89 -107
  99. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  100. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  101. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  102. package/dist/components/Company/PaySchedule/_parts/Edit.js +65 -51
  103. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/_parts/Head.js +3 -2
  105. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  106. package/dist/components/Company/PaySchedule/_parts/List.js +6 -5
  107. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  108. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  109. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  110. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  111. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  112. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  113. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  114. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  115. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  116. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  117. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  118. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  119. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  120. package/dist/components/Contractor/Address/Address.js +2 -0
  121. package/dist/components/Contractor/Address/Address.js.map +1 -1
  122. package/dist/components/Contractor/Address/Form.js +3 -2
  123. package/dist/components/Contractor/Address/Form.js.map +1 -1
  124. package/dist/components/Contractor/Address/useAddress.js +6 -5
  125. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  126. package/dist/components/Contractor/List/index.js +48 -50
  127. package/dist/components/Contractor/List/index.js.map +1 -1
  128. package/dist/components/Contractor/NewHireReport/NewHireReport.js +17 -16
  129. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  130. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  131. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  132. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  133. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  134. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +3 -2
  135. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  136. package/dist/components/Employee/Compensation/Actions.js +5 -4
  137. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  138. package/dist/components/Employee/Compensation/Edit.js +3 -2
  139. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  140. package/dist/components/Employee/Compensation/List.js +6 -5
  141. package/dist/components/Employee/Compensation/List.js.map +1 -1
  142. package/dist/components/Employee/Deductions/Actions.js +9 -8
  143. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  144. package/dist/components/Employee/Deductions/DeductionForm.js +3 -2
  145. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  146. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  147. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  148. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  149. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  150. package/dist/components/Employee/Deductions/useDeductions.js +6 -5
  151. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  152. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  153. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  154. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +12 -10
  155. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  156. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +3 -2
  157. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  158. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  159. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  160. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
  161. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  162. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  163. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  164. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  165. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  166. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -2
  167. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  168. package/dist/components/Employee/EmployeeList/Head.js +3 -2
  169. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  170. package/dist/components/Employee/EmployeeList/List.js +3 -2
  171. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  172. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  173. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  174. package/dist/components/Employee/Landing/Landing.js +7 -6
  175. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  176. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  177. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  178. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +3 -2
  179. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  180. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  181. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  182. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +3 -2
  183. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  184. package/dist/components/Employee/PaymentMethod/Split.js +3 -2
  185. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  186. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  187. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  188. package/dist/components/Employee/Profile/Actions.js +7 -6
  189. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  190. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -9
  191. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  192. package/dist/components/Employee/Profile/HomeAddress.js +5 -4
  193. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  194. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  195. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  196. package/dist/components/Employee/Profile/useProfile.js +4 -3
  197. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  198. package/dist/components/Employee/Taxes/Actions.js +8 -7
  199. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  200. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  201. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  202. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  203. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  204. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  205. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  206. package/dist/i18n/en/Company.Locations.json.js +2 -2
  207. package/dist/i18n/en/Company.PaySchedule.json.js +24 -19
  208. package/dist/i18n/en/Company.PaySchedule.json.js.map +1 -1
  209. package/dist/types/i18next.d.ts +5 -1
  210. package/package.json +4 -1
@@ -1,10 +1,11 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as l } from "react-i18next";
3
- import { useOnboardingOverview as m } from "./context.js";
2
+ import { useTranslation as m } from "react-i18next";
3
+ import { useOnboardingOverview as l } from "./context.js";
4
4
  import { Flex as a } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
5
6
  import { useComponentContext as d } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const u = () => {
7
- const e = d(), { onboardingCompleted: t, handleDone: r } = m(), { t: n } = l("Company.OnboardingOverview");
7
+ const f = () => {
8
+ const e = d(), { onboardingCompleted: t, handleDone: r } = l(), { t: n } = m("Company.OnboardingOverview");
8
9
  return t ? /* @__PURE__ */ i(a, { alignItems: "center", flexDirection: "column", gap: 8, children: [
9
10
  /* @__PURE__ */ o(e.Heading, { as: "h2", textAlign: "center", children: n("onboardingCompletedTitle") }),
10
11
  /* @__PURE__ */ o("p", { children: n("onboardingCompletedDescription") }),
@@ -12,6 +13,6 @@ const u = () => {
12
13
  ] }) : null;
13
14
  };
14
15
  export {
15
- u as Completed
16
+ f as Completed
16
17
  };
17
18
  //# sourceMappingURL=Completed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
1
+ {"version":3,"file":"Completed.js","sources":["../../../../src/components/Company/OnboardingOverview/Completed.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useOnboardingOverview } from './context'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Completed = () => {\n const Components = useComponentContext()\n const { onboardingCompleted, handleDone } = useOnboardingOverview()\n const { t } = useTranslation('Company.OnboardingOverview')\n if (!onboardingCompleted) {\n return null\n }\n return (\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardingCompletedTitle')}\n </Components.Heading>\n <p>{t('onboardingCompletedDescription')}</p>\n <Components.Button variant=\"secondary\" onClick={handleDone}>\n {t('onboardingCompletedCta')}\n </Components.Button>\n </Flex>\n )\n}\n"],"names":["Completed","Components","useComponentContext","onboardingCompleted","handleDone","useOnboardingOverview","t","useTranslation","Flex","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAY,MAAM;AAC7B,QAAMC,IAAaC,EAAoB,GACjC,EAAE,qBAAAC,GAAqB,YAAAC,EAAW,IAAIC,EAAsB,GAC5D,EAAE,GAAAC,EAAA,IAAMC,EAAe,4BAA4B;AACzD,SAAKJ,sBAIFK,GAAK,EAAA,YAAW,UAAS,eAAc,UAAS,KAAK,GACpD,UAAA;AAAA,IAAC,gBAAAC,EAAAR,EAAW,SAAX,EAAmB,IAAG,MAAK,WAAU,UACnC,UAAEK,EAAA,0BAA0B,EAC/B,CAAA;AAAA,IACC,gBAAAG,EAAA,KAAA,EAAG,UAAEH,EAAA,gCAAgC,EAAE,CAAA;AAAA,IACxC,gBAAAG,EAACR,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASG,GAC7C,UAAEE,EAAA,wBAAwB,EAC7B,CAAA;AAAA,EAAA,GACF,IAXO;AAaX;"}
@@ -2,10 +2,11 @@ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { useOnboardingOverview as a } from "./context.js";
4
4
  import { Flex as c } from "../../Common/Flex/Flex.js";
5
+ import "classnames";
5
6
  import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { RequirementsList as d } from "../../Common/RequirementsList/RequirementsList.js";
7
8
  import { useComponentContext as g } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
- const S = () => {
9
+ const b = () => {
9
10
  const r = g(), { onboardingSteps: n, onboardingCompleted: s, handleContinue: m } = a(), { t: e } = p("Company.OnboardingOverview");
10
11
  if (s)
11
12
  return null;
@@ -27,6 +28,6 @@ const S = () => {
27
28
  ] });
28
29
  };
29
30
  export {
30
- S as MissingRequirements
31
+ b as MissingRequirements
31
32
  };
32
33
  //# sourceMappingURL=MissingRequirements.js.map
@@ -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,10 @@ 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 "react-i18next";
11
+ import "classnames";
10
12
  import { componentEvents as i } from "../../../shared/constants.js";
11
- function P(o) {
13
+ function A(o) {
12
14
  return C("Company.OnboardingOverview"), g("Company.OnboardingOverview", o.dictionary), /* @__PURE__ */ n(f, { ...o, children: /* @__PURE__ */ n(b, { ...o, children: o.children }) });
13
15
  }
14
16
  const b = ({ companyId: o, className: t, children: e }) => {
@@ -34,6 +36,6 @@ const b = ({ companyId: o, className: t, children: e }) => {
34
36
  ) });
35
37
  };
36
38
  export {
37
- P as OnboardingOverview
39
+ A as OnboardingOverview
38
40
  };
39
41
  //# 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,12 +8,13 @@ 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
14
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
14
- const [w, x] = o("OnboardingOverviewContext");
15
+ const [x, C] = o("OnboardingOverviewContext");
15
16
  export {
16
- x as OnboardingOverviewProvider,
17
- w as useOnboardingOverview
17
+ C as OnboardingOverviewProvider,
18
+ x as useOnboardingOverview
18
19
  };
19
20
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
@@ -1,30 +1,32 @@
1
- import { jsx as t, jsxs as k } from "react/jsx-runtime";
2
- import { useForm as G, FormProvider as z } from "react-hook-form";
3
- import { zodResolver as J } from "@hookform/resolvers/zod";
4
- import { useState as p, useEffect as w } from "react";
5
- import { usePaySchedulesGetPreview as K } from "@gusto/embedded-api/react-query/paySchedulesGetPreview";
6
- import { usePaySchedulesUpdateMutation as Q } from "@gusto/embedded-api/react-query/paySchedulesUpdate";
7
- import { usePaySchedulesGetAllSuspense as W } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
8
- import { usePaySchedulesCreateMutation as X } from "@gusto/embedded-api/react-query/paySchedulesCreate";
9
- import { PayScheduleSchema as Z, PayScheduleProvider as $ } from "./usePaySchedule.js";
10
- import { Form as V } from "../../Common/Form/Form.js";
11
- import { BaseComponent as ee } from "../../Base/Base.js";
12
- import { useBase as oe } from "../../Base/useBase.js";
13
- import { Flex as re } from "../../Common/Flex/Flex.js";
14
- import { useI18n as ae, useComponentDictionary as te } from "../../../i18n/I18n.js";
15
- import { componentEvents as q } from "../../../shared/constants.js";
16
- import { formatDateToStringDate as ne } from "../../../helpers/dateFormatting.js";
17
- import { Head as _ } from "./_parts/Head.js";
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 "react-i18next";
15
+ import "classnames";
16
+ import { useI18n as ce, useComponentDictionary as ie } from "../../../i18n/I18n.js";
17
+ import { componentEvents as p } from "../../../shared/constants.js";
18
+ import { formatDateToStringDate as l } from "../../../helpers/dateFormatting.js";
19
+ import { Head as w } from "./_parts/Head.js";
18
20
  import { List as C } from "./_parts/List.js";
19
21
  import { Edit as L } from "./_parts/Edit.js";
20
- import { Actions as O } from "./_parts/Actions.js";
21
- const f = ({
22
+ import { Actions as q } from "./_parts/Actions.js";
23
+ const u = ({
22
24
  companyId: n,
23
- defaultValues: P,
25
+ defaultValues: s,
24
26
  dictionary: a,
25
- ...m
26
- }) => (ae("Company.PaySchedule"), te("Company.PaySchedule", a), /* @__PURE__ */ t(ee, { ...m, children: /* @__PURE__ */ t(ce, { companyId: n, defaultValues: P, children: m.children }) })), ce = ({ companyId: n, children: P, defaultValues: a }) => {
27
- const { baseSubmitHandler: m, onEvent: E, fieldErrors: D } = oe(), [S, u] = p("LIST_PAY_SCHEDULES"), [i, T] = p(null), H = {
27
+ ...P
28
+ }) => (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 }) => {
29
+ const { baseSubmitHandler: P, onEvent: h, fieldErrors: f, setError: T } = te(), [i, m] = A("LIST_PAY_SCHEDULES"), [E, O] = A(null), H = {
28
30
  frequency: a?.frequency ?? "Every week",
29
31
  anchorPayDate: a?.anchorPayDate ? new Date(a.anchorPayDate) : void 0,
30
32
  anchorEndOfPayPeriod: a?.anchorEndOfPayPeriod ? new Date(a.anchorEndOfPayPeriod) : void 0,
@@ -33,95 +35,75 @@ const f = ({
33
35
  customName: a?.customName ?? "",
34
36
  customTwicePerMonth: "false",
35
37
  payPeriodPreviewRange: 0
36
- }, [d, y] = p(null), { data: M, isLoading: U } = K(
38
+ }, { data: U } = $({
39
+ companyId: n
40
+ }), M = V(), Y = Z(), D = K({
41
+ resolver: W(ee),
42
+ defaultValues: H
43
+ }), { watch: N, setValue: S, reset: d, clearErrors: b, setError: v } = D;
44
+ _(() => {
45
+ f && f.forEach((o) => {
46
+ v(o.key, { message: o.message });
47
+ });
48
+ }, [v, f]);
49
+ const e = N(), g = e.anchorPayDate && l(e.anchorPayDate) || "", B = e.anchorEndOfPayPeriod && l(e.anchorEndOfPayPeriod) || "", { data: R, isLoading: x } = X(
37
50
  {
38
51
  companyId: n,
39
- frequency: d?.frequency,
40
- anchorPayDate: d?.anchorPayDate ?? "",
41
- anchorEndOfPayPeriod: d?.anchorEndOfPayPeriod ?? "",
42
- day1: d?.day1 ?? void 0,
43
- day2: d?.day2 ?? void 0
52
+ frequency: e.frequency,
53
+ anchorPayDate: g,
54
+ anchorEndOfPayPeriod: B,
55
+ day1: e.day1 ?? void 0,
56
+ day2: e.day2 ?? void 0
44
57
  },
45
58
  {
46
- enabled: !0
59
+ enabled: !!(e.anchorPayDate && e.anchorEndOfPayPeriod && (i === "ADD_PAY_SCHEDULE" || i === "EDIT_PAY_SCHEDULE"))
47
60
  }
48
- // Casting to non-null because we know it's not null from the enabled prop
49
- ), { data: Y } = W({
50
- companyId: n
51
- }), N = X(), g = Q(), l = G({
52
- resolver: J(Z),
53
- defaultValues: H
54
- }), { watch: b, setValue: v, reset: s, setError: A } = l;
55
- w(() => {
56
- D && D.forEach((o) => {
57
- A(o.key, { message: o.message });
58
- });
59
- }, [A, D]);
60
- const e = b();
61
- w(() => {
62
- e.frequency === "Twice per month" && e.day1 === 15 && e.day2 === 31 && e.customTwicePerMonth === void 0 ? v("customTwicePerMonth", "1st15th") : e.frequency === "Twice per month" && e.customTwicePerMonth === void 0 && v("customTwicePerMonth", "custom");
63
- }, [e.frequency, e.day1, e.day2, v, e.customTwicePerMonth]), w(() => {
64
- !e.anchorPayDate || !e.anchorEndOfPayPeriod || y({
65
- frequency: e.frequency,
66
- anchorPayDate: e.anchorPayDate.toString(),
67
- anchorEndOfPayPeriod: e.anchorEndOfPayPeriod.toString(),
68
- day1: e.day1 || void 0,
69
- day2: e.day2 || void 0,
70
- uuid: "",
71
- version: i?.version || ""
72
- //TODO: This needs to be set to something
73
- });
74
- }, [
75
- e.anchorEndOfPayPeriod,
76
- e.anchorPayDate,
77
- e.day1,
78
- e.day2,
79
- e.frequency,
80
- i?.version,
81
- y
82
- ]);
83
- const R = () => {
84
- u("ADD_PAY_SCHEDULE"), s({});
85
- }, x = () => {
86
- u("LIST_PAY_SCHEDULES"), s({}), y(null);
87
- }, B = (o) => {
88
- s({
61
+ );
62
+ _(() => {
63
+ 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");
64
+ }, [e.frequency, e.day1, e.day2, S, e.customTwicePerMonth]);
65
+ const F = () => {
66
+ m("ADD_PAY_SCHEDULE"), d({});
67
+ }, I = () => {
68
+ m("LIST_PAY_SCHEDULES"), d({}), b(), T(null);
69
+ }, j = (o) => {
70
+ d({
89
71
  frequency: o.frequency,
90
72
  anchorPayDate: o.anchorPayDate ? new Date(o.anchorPayDate) : void 0,
91
73
  anchorEndOfPayPeriod: o.anchorEndOfPayPeriod ? new Date(o.anchorEndOfPayPeriod) : void 0,
92
74
  day1: o.day1 ?? void 0,
93
75
  day2: o.day2 ?? void 0,
94
76
  customName: o.customName ?? ""
95
- }), T(o), u("EDIT_PAY_SCHEDULE");
96
- }, F = () => {
97
- E(q.PAY_SCHEDULE_DONE);
98
- }, j = async (o) => {
99
- await m(o, async (r) => {
100
- const h = (c) => c && ne(c) || "";
101
- if (S === "ADD_PAY_SCHEDULE") {
102
- const c = await N.mutateAsync({
77
+ }), O(o), m("EDIT_PAY_SCHEDULE");
78
+ }, k = () => {
79
+ h(p.PAY_SCHEDULE_DONE);
80
+ }, G = async (o) => {
81
+ await P(o, async (r) => {
82
+ const y = (c) => c && l(c) || "";
83
+ if (i === "ADD_PAY_SCHEDULE") {
84
+ const c = await M.mutateAsync({
103
85
  request: {
104
86
  companyId: n,
105
87
  requestBody: {
106
88
  frequency: r.frequency,
107
- anchorPayDate: h(r.anchorPayDate),
108
- anchorEndOfPayPeriod: h(r.anchorEndOfPayPeriod),
89
+ anchorPayDate: y(r.anchorPayDate),
90
+ anchorEndOfPayPeriod: y(r.anchorEndOfPayPeriod),
109
91
  customName: r.customName,
110
92
  day1: r.day1,
111
93
  day2: r.day2
112
94
  }
113
95
  }
114
96
  });
115
- E(q.PAY_SCHEDULE_CREATED, c), s(), y(null);
116
- } else if (S === "EDIT_PAY_SCHEDULE") {
117
- const c = i?.version, I = await g.mutateAsync({
97
+ h(p.PAY_SCHEDULE_CREATED, c), d();
98
+ } else if (i === "EDIT_PAY_SCHEDULE") {
99
+ const c = E?.version, z = await Y.mutateAsync({
118
100
  request: {
119
- payScheduleId: i?.uuid,
101
+ payScheduleId: E?.uuid,
120
102
  companyId: n,
121
103
  requestBody: {
122
104
  frequency: r.frequency,
123
- anchorPayDate: h(r.anchorPayDate),
124
- anchorEndOfPayPeriod: h(r.anchorEndOfPayPeriod),
105
+ anchorPayDate: y(r.anchorPayDate),
106
+ anchorEndOfPayPeriod: y(r.anchorEndOfPayPeriod),
125
107
  customName: r.customName,
126
108
  day1: r.day1,
127
109
  day2: r.day2,
@@ -129,40 +111,40 @@ const f = ({
129
111
  }
130
112
  }
131
113
  });
132
- E(q.PAY_SCHEDULE_UPDATED, I), s(), y(null);
114
+ h(p.PAY_SCHEDULE_UPDATED, z), d();
133
115
  }
134
- u("LIST_PAY_SCHEDULES");
116
+ m("LIST_PAY_SCHEDULES");
135
117
  });
136
118
  };
137
119
  return /* @__PURE__ */ t(
138
- $,
120
+ oe,
139
121
  {
140
122
  value: {
141
123
  companyId: n,
142
- handleAdd: R,
143
- handleEdit: B,
144
- handleCancel: x,
145
- handleContinue: F,
146
- mode: S,
147
- paySchedules: Y.payScheduleList,
148
- payPeriodPreview: M?.object?.payPeriods,
149
- payPreviewLoading: U,
150
- currentPaySchedule: i
124
+ handleAdd: F,
125
+ handleEdit: j,
126
+ handleCancel: I,
127
+ handleContinue: k,
128
+ mode: i,
129
+ paySchedules: U.payScheduleList,
130
+ payPeriodPreview: R?.object?.payPeriods,
131
+ payPreviewLoading: x,
132
+ currentPaySchedule: E
151
133
  },
152
- children: /* @__PURE__ */ t("span", { "data-testid": "pay-schedule-edit-form", children: /* @__PURE__ */ t(z, { ...l, children: /* @__PURE__ */ t(V, { onSubmit: l.handleSubmit(j), children: P || /* @__PURE__ */ k(re, { flexDirection: "column", children: [
153
- /* @__PURE__ */ t(_, {}),
134
+ 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: [
135
+ /* @__PURE__ */ t(w, {}),
154
136
  /* @__PURE__ */ t(C, {}),
155
137
  /* @__PURE__ */ t(L, {}),
156
- /* @__PURE__ */ t(O, {})
138
+ /* @__PURE__ */ t(q, {})
157
139
  ] }) }) }) })
158
140
  }
159
141
  );
160
142
  };
161
- f.Head = _;
162
- f.List = C;
163
- f.Edit = L;
164
- f.Actions = O;
143
+ u.Head = w;
144
+ u.List = C;
145
+ u.Edit = L;
146
+ u.Actions = q;
165
147
  export {
166
- f as PaySchedule
148
+ u as PaySchedule
167
149
  };
168
150
  //# 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 } = 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 [payScheduleDraft, setPayScheduleDraft] = useState<PayScheduleType | null>(null)\n const { data: payPreviewData, isLoading } = usePaySchedulesGetPreview(\n {\n companyId,\n frequency: payScheduleDraft?.frequency as Frequency,\n anchorPayDate: payScheduleDraft?.anchorPayDate ?? '',\n anchorEndOfPayPeriod: payScheduleDraft?.anchorEndOfPayPeriod ?? '',\n day1: payScheduleDraft?.day1 ?? undefined,\n day2: payScheduleDraft?.day2 ?? undefined,\n },\n {\n enabled: true,\n }, // Casting to non-null because we know it's not null from the enabled prop\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, 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 // 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 useEffect(() => {\n // Don't update if dates are not set\n if (!allValues.anchorPayDate || !allValues.anchorEndOfPayPeriod) {\n return\n }\n\n setPayScheduleDraft({\n frequency: allValues.frequency,\n anchorPayDate: allValues.anchorPayDate.toString(),\n anchorEndOfPayPeriod: allValues.anchorEndOfPayPeriod.toString(),\n day1: allValues.day1 || undefined,\n day2: allValues.day2 || undefined,\n uuid: '',\n version: currentPaySchedule?.version || '', //TODO: This needs to be set to something\n })\n }, [\n allValues.anchorEndOfPayPeriod,\n allValues.anchorPayDate,\n allValues.day1,\n allValues.day2,\n allValues.frequency,\n currentPaySchedule?.version,\n setPayScheduleDraft,\n ])\n\n // Custom effect to show/hide pay schedule preview errors\n\n const handleAdd = () => {\n setMode('ADD_PAY_SCHEDULE')\n reset({})\n }\n const handleCancel = () => {\n setMode('LIST_PAY_SCHEDULES')\n reset({})\n setPayScheduleDraft(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: 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 setPayScheduleDraft(null)\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: 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 setPayScheduleDraft(null)\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","useBase","mode","setMode","useState","currentPaySchedule","setCurrentPaySchedule","transformedDefaultValues","payScheduleDraft","setPayScheduleDraft","payPreviewData","isLoading","usePaySchedulesGetPreview","paySchedules","usePaySchedulesGetAllSuspense","createPayScheduleMutation","usePaySchedulesCreateMutation","updatePayScheduleMutation","usePaySchedulesUpdateMutation","formMethods","useForm","zodResolver","PayScheduleSchema","watch","setValue","reset","setError","useEffect","error","allValues","handleAdd","handleCancel","handleEdit","schedule","handleContinue","componentEvents","onSubmit","data","payload","formatPayloadDate","date","formatDateToStringDate","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,EAAA,IAAgBC,GAAQ,GACtD,CAACC,GAAMC,CAAO,IAAIC,EAAe,oBAAoB,GACrD,CAACC,GAAoBC,CAAqB,IAAIF,EAAiC,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AAAoC,EAAgB,sBAAsBS,CAAyB,GACjEnB,EAAA,GACNhB,EAAoB,IAAI;AAAA,MAAA;AAE1B,MAAAN,EAAQ,oBAAoB;AAAA,IAAA,CAC7B;AAAA,EACH;AAGE,SAAA,gBAAAT;AAAA,IAACmD;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAzD;AAAA,QACA,WAAA0C;AAAA,QACA,YAAAE;AAAA,QACA,cAAAD;AAAA,QACA,gBAAAG;AAAA,QACA,MAAAhC;AAAA,QACA,cAAcW,EAAa;AAAA,QAC3B,kBAAkBH,GAAgB,QAAQ;AAAA,QAC1C,mBAAmBC;AAAA,QACnB,oBAAAN;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAX,EAAC,UAAK,eAAY,0BAChB,4BAACoD,GAAc,EAAA,GAAG3B,GAChB,UAAC,gBAAAzB,EAAAqD,GAAA,EAAK,UAAU5B,EAAY,aAAaiB,CAAQ,GAC9C,UAAAvC,KAGE,gBAAAmD,EAAAC,IAAA,EAAK,eAAc,UAClB,UAAA;AAAA,QAAA,gBAAAvD,EAACwD,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEAlE,EAAY,OAAO+D;AACnB/D,EAAY,OAAOgE;AACnBhE,EAAY,OAAOiE;AACnBjE,EAAY,UAAUkE;"}
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,EAA8B,GAC1DC,IAA4BC,EAA8B,GAE1DC,IAAcC,EAAwD;AAAA,IAC1E,UAAUC,EAAYC,EAAiB;AAAA,IACvC,eAAeV;AAAA,EAAA,CAChB,GACK,EAAE,OAAAW,GAAO,UAAA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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 { ActionsLayout as i } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  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();
7
+ const E = () => {
8
+ const { t: n } = l("Company.PaySchedule"), { mode: c, handleAdd: a, handleCancel: r, handleContinue: s } = m(), t = u();
8
9
  return /* @__PURE__ */ e(d, { children: [
9
- c === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(a, { children: [
10
+ c === "LIST_PAY_SCHEDULES" && /* @__PURE__ */ e(i, { children: [
10
11
  /* @__PURE__ */ o(
11
12
  t.Button,
12
13
  {
13
14
  variant: "secondary",
14
15
  onClick: () => {
15
- r();
16
+ a();
16
17
  },
17
18
  children: n("addAnotherPayScheduleCta")
18
19
  }
@@ -28,26 +29,26 @@ const S = () => {
28
29
  }
29
30
  )
30
31
  ] }),
31
- c === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
32
+ c === "ADD_PAY_SCHEDULE" && /* @__PURE__ */ e(i, { children: [
32
33
  /* @__PURE__ */ o(
33
34
  t.Button,
34
35
  {
35
36
  variant: "secondary",
36
37
  onClick: () => {
37
- i();
38
+ r();
38
39
  },
39
40
  children: n("actions.cancel")
40
41
  }
41
42
  ),
42
43
  /* @__PURE__ */ o(t.Button, { type: "submit", children: n("actions.save") })
43
44
  ] }),
44
- c === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(a, { children: [
45
+ c === "EDIT_PAY_SCHEDULE" && /* @__PURE__ */ e(i, { children: [
45
46
  /* @__PURE__ */ o(
46
47
  t.Button,
47
48
  {
48
49
  variant: "secondary",
49
50
  onClick: () => {
50
- i();
51
+ r();
51
52
  },
52
53
  children: n("actions.cancel")
53
54
  }
@@ -57,6 +58,6 @@ const S = () => {
57
58
  ] });
58
59
  };
59
60
  export {
60
- S as Actions
61
+ E as Actions
61
62
  };
62
63
  //# 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;AA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AAE,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,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