@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,5 +1,5 @@
1
1
  import { z as o } from "zod";
2
- import { FilingForm as e, TaxPayerType as r } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
2
+ import { FilingForm as r, TaxPayerType as e } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "react-error-boundary";
@@ -10,20 +10,21 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
10
  import "@tanstack/react-query";
11
11
  import "../../Base/useBase.js";
12
12
  import "../../../shared/constants.js";
13
+ import "classnames";
13
14
  import "dompurify";
14
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
16
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
16
- const y = o.object({
17
+ const C = o.object({
17
18
  federalEin: o.string().optional(),
18
- taxPayerType: o.enum(Object.values(r)).optional(),
19
- filingForm: o.enum(Object.values(e)).optional(),
19
+ taxPayerType: o.enum(Object.values(e)).optional(),
20
+ filingForm: o.enum(Object.values(r)).optional(),
20
21
  legalName: o.string().min(1)
21
- }), [C, b] = t(
22
+ }), [b, j] = t(
22
23
  "CompanyFederalTaxesContext"
23
24
  );
24
25
  export {
25
- y as FederalTaxFormSchema,
26
- b as FederalTaxesProvider,
27
- C as useFederalTaxes
26
+ C as FederalTaxFormSchema,
27
+ j as FederalTaxesProvider,
28
+ b as useFederalTaxes
28
29
  };
29
30
  //# sourceMappingURL=useFederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AASa,MAAAA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAS;AAAA,EACpF,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAS;AAAA,EAChF,WAAWF,EAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"useFederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/useFederalTaxes.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { FederalTaxDetails } from '@gusto/embedded-api/models/components/federaltaxdetails'\nimport {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport const FederalTaxFormSchema = z.object({\n federalEin: z.string().optional(),\n taxPayerType: z.enum(Object.values(TaxPayerType) as [string, ...string[]]).optional(),\n filingForm: z.enum(Object.values(FilingForm) as [string, ...string[]]).optional(),\n legalName: z.string().min(1),\n})\n\nexport type FederalTaxFormInputs = z.input<typeof FederalTaxFormSchema>\n\nexport type FederalTaxesDefaultValues = RequireAtLeastOne<{\n taxPayerType?: FederalTaxFormInputs['taxPayerType']\n filingForm?: FederalTaxFormInputs['filingForm']\n legalName?: FederalTaxFormInputs['legalName']\n}>\n\ntype FederalTaxesContextType = {\n isPending: boolean\n federalTaxDetails?: FederalTaxDetails\n}\n\nconst [useFederalTaxes, FederalTaxesProvider] = createCompoundContext<FederalTaxesContextType>(\n 'CompanyFederalTaxesContext',\n)\n\nexport { useFederalTaxes, FederalTaxesProvider }\n"],"names":["FederalTaxFormSchema","z","TaxPayerType","FilingForm","useFederalTaxes","FederalTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAAA,IAAuBC,EAAE,OAAO;AAAA,EAC3C,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,cAAcA,EAAE,KAAK,OAAO,OAAOC,CAAY,CAA0B,EAAE,SAAS;AAAA,EACpF,YAAYD,EAAE,KAAK,OAAO,OAAOE,CAAU,CAA0B,EAAE,SAAS;AAAA,EAChF,WAAWF,EAAE,OAAO,EAAE,IAAI,CAAC;AAC7B,CAAC,GAeK,CAACG,GAAiBC,CAAoB,IAAIC;AAAA,EAC9C;AACF;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as s } from "react-i18next";
3
- import { useIndustryApiState as i } from "./Context.js";
2
+ import { useTranslation as i } from "react-i18next";
3
+ import { useIndustryApiState as s } from "./Context.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const f = () => {
7
- const { t: o } = s("Company.Industry"), { isPending: n } = i(), r = e();
7
+ const y = () => {
8
+ const { t: o } = i("Company.Industry"), { isPending: n } = s(), r = e();
8
9
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
9
10
  };
10
11
  export {
11
- f as Actions
12
+ y as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAU,IAAIC,EAAoB,GACpCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAEF,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAU,IAAIC,EAAoB,GACpCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAEF,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
@@ -8,18 +8,19 @@ 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 t } from "../../Base/createCompoundContext.js";
14
- const [c, A] = t("IndustryItems", {
15
+ const [A, P] = t("IndustryItems", {
15
16
  items: []
16
- }), [P, f] = t("IndustryApi", {
17
+ }), [f, v] = t("IndustryApi", {
17
18
  isPending: !1
18
19
  });
19
20
  export {
20
- f as IndustryApiStateProvider,
21
- A as IndustryItemsProvider,
22
- P as useIndustryApiState,
23
- c as useIndustryItems
21
+ v as IndustryApiStateProvider,
22
+ P as IndustryItemsProvider,
23
+ f as useIndustryApiState,
24
+ A as useIndustryItems
24
25
  };
25
26
  //# sourceMappingURL=Context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/Company/Industry/Context.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\nimport type { ComboBoxOption } from '@/components/Common/UI/ComboBox/ComboBoxTypes'\n\nconst [useIndustryItems, IndustryItemsProvider] = createCompoundContext('IndustryItems', {\n items: [] as ComboBoxOption[],\n})\n\nconst [useIndustryApiState, IndustryApiStateProvider] = createCompoundContext('IndustryApi', {\n isPending: false,\n})\n\nexport { IndustryApiStateProvider, IndustryItemsProvider, useIndustryItems, useIndustryApiState }\n"],"names":["useIndustryItems","IndustryItemsProvider","createCompoundContext","useIndustryApiState","IndustryApiStateProvider"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,CAACA,GAAkBC,CAAqB,IAAIC,EAAsB,iBAAiB;AAAA,EACvF,OAAO,CAAA;AACT,CAAC,GAEK,CAACC,GAAqBC,CAAwB,IAAIF,EAAsB,eAAe;AAAA,EAC3F,WAAW;AACb,CAAC;"}
@@ -1,14 +1,15 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useTranslation as t } from "react-i18next";
3
- import { useIndustryItems as s } from "./Context.js";
4
- import { ComboBoxField as m } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
5
- const p = () => {
6
- const { t: o } = t("Company.Industry"), { items: e } = s();
7
- return /* @__PURE__ */ r(
8
- m,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as e } from "react-i18next";
3
+ import { useIndustryItems as m } from "./Context.js";
4
+ import "classnames";
5
+ import { ComboBoxField as s } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
6
+ const d = () => {
7
+ const { t: o } = e("Company.Industry"), { items: r } = m();
8
+ return /* @__PURE__ */ t(
9
+ s,
9
10
  {
10
11
  isRequired: !0,
11
- options: e,
12
+ options: r,
12
13
  label: o("label"),
13
14
  name: "naics_code",
14
15
  placeholder: o("placeholder")
@@ -16,6 +17,6 @@ const p = () => {
16
17
  );
17
18
  };
18
19
  export {
19
- p as Edit
20
+ d as Edit
20
21
  };
21
22
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAM,IAAIC,EAAiB;AAGjC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAM,IAAIC,EAAiB;AAGjC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
@@ -1,9 +1,10 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useLocationsForm as e } from "./useLocationForm.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const f = () => {
7
+ const h = () => {
7
8
  const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
8
9
  return /* @__PURE__ */ r(c, { children: [
9
10
  /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
@@ -11,6 +12,6 @@ const f = () => {
11
12
  ] });
12
13
  };
13
14
  export {
14
- f as Actions
15
+ h as Actions
15
16
  };
16
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
@@ -4,12 +4,13 @@ import { useTranslation as l } from "react-i18next";
4
4
  import { zipValidation as n, phoneValidation as m } from "../../../../helpers/validations.js";
5
5
  import { Flex as d } from "../../../Common/Flex/Flex.js";
6
6
  import { Grid as p } from "../../../Common/Grid/Grid.js";
7
+ import "classnames";
7
8
  import { STATES_ABBR as c } from "../../../../shared/constants.js";
8
9
  import { useMaskedTransform as u, commonMasks as b } from "../../../../helpers/mask.js";
9
10
  import { TextInputField as s } from "../../../Common/Fields/TextInputField/TextInputField.js";
10
11
  import { SelectField as f } from "../../../Common/Fields/SelectField/SelectField.js";
11
12
  import { CheckboxGroupField as g } from "../../../Common/Fields/CheckboxGroupField/CheckboxGroupField.js";
12
- const q = i.object({
13
+ const k = i.object({
13
14
  phoneNumber: m,
14
15
  street1: i.string().min(1),
15
16
  street2: i.string().optional(),
@@ -18,7 +19,7 @@ const q = i.object({
18
19
  zip: n,
19
20
  addressType: i.array(i.enum(["mailingAddress", "filingAddress"])).optional()
20
21
  });
21
- function k() {
22
+ function S() {
22
23
  const { t: e } = l("Company.Locations"), o = u(b.phoneMask);
23
24
  return /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
24
25
  /* @__PURE__ */ t(
@@ -104,7 +105,7 @@ function k() {
104
105
  ] });
105
106
  }
106
107
  export {
107
- k as Form,
108
- q as LocationFormSchema
108
+ S as Form,
109
+ k as LocationFormSchema
109
110
  };
110
111
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UACvC;AAAA,4BACCS,GAAe,EAAA,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOT,EAAE,WAAW;AAAA,cACpB,YAAU;AAAA,cACV,cAAcA,EAAE,kBAAkB;AAAA,YAAA;AAAA,UACpC;AAAA,UACA,gBAAAQ;AAAA,YAACE;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,SAASC,EAAY,IAAI,CAACC,OAA6C;AAAA,gBACrE,OAAOZ,EAAE,cAAcY,CAAS,IAAI,EAAE,IAAI,UAAU;AAAA,gBACpD,OAAOA;AAAA,cAAA,EACP;AAAA,cACF,OAAOZ,EAAE,YAAY;AAAA,cACrB,aAAaA,EAAE,kBAAkB;AAAA,cACjC,cAAcA,EAAE,mBAAmB;AAAA,cACnC,YAAU;AAAA,YAAA;AAAA,UACZ;AAAA,UACA,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,UAAU;AAAA,cACnB,cAAcA,EAAE,iBAAiB;AAAA,YAAA;AAAA,UACnC;AAAA,UACA,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,kBAAkB;AAAA,cAC3B,cAAcA,EAAE,mBAAmB;AAAA,cACnC,WAAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,IACA,gBAAAM;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOb,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,qBAAqB;AAAA,YAC9B,aAAaA,EAAE,2BAA2B;AAAA,UAC5C;AAAA,UACA;AAAA,YACE,OAAO;AAAA,YACP,OAAOA,EAAE,oBAAoB;AAAA,YAC7B,aAAaA,EAAE,0BAA0B;AAAA,UAAA;AAAA,QAC3C;AAAA,MACF;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Form.tsx"],"sourcesContent":["import { z } from 'zod'\nimport { useTranslation } from 'react-i18next'\nimport { phoneValidation, zipValidation } from '@/helpers/validations'\nimport { CheckboxGroupField, Flex, Grid, SelectField, TextInputField } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\nimport { commonMasks, useMaskedTransform } from '@/helpers/mask'\n\nexport const LocationFormSchema = z.object({\n phoneNumber: phoneValidation,\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: zipValidation,\n addressType: z.array(z.enum(['mailingAddress', 'filingAddress'])).optional(),\n})\n\nexport type LocationFormInputs = z.infer<typeof LocationFormSchema>\n\nexport function Form() {\n const { t } = useTranslation('Company.Locations')\n const transform = useMaskedTransform(commonMasks.phoneMask)\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Grid\n gap={{ base: 20, small: 8 }}\n gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }}\n >\n <TextInputField\n name=\"street1\"\n isRequired\n label={t('street1Label')}\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2Label')} />\n <TextInputField\n name=\"city\"\n label={t('cityLabel')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map((stateAbbr: (typeof STATES_ABBR)[number]) => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common' }),\n value: stateAbbr,\n }))}\n label={t('stateLabel')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField\n name=\"zip\"\n isRequired\n label={t('zipLabel')}\n errorMessage={t('validations.zip')}\n />\n <TextInputField\n name=\"phoneNumber\"\n isRequired\n label={t('phoneNumberLabel')}\n errorMessage={t('validations.phone')}\n transform={transform}\n />\n </Grid>\n <CheckboxGroupField\n name=\"addressType\"\n label={t('addressTypeLabel')}\n options={[\n {\n value: 'mailingAddress',\n label: t('mailingAddressLabel'),\n description: t('mailingAddressDescription'),\n },\n {\n value: 'filingAddress',\n label: t('filingAddressLabel'),\n description: t('filingAddressDescription'),\n },\n ]}\n />\n </Flex>\n )\n}\n"],"names":["LocationFormSchema","z","phoneValidation","zipValidation","Form","t","useTranslation","transform","useMaskedTransform","commonMasks","jsxs","Flex","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr","CheckboxGroupField"],"mappings":";;;;;;;;;;;;AAOa,MAAAA,IAAqBC,EAAE,OAAO;AAAA,EACzC,aAAaC;AAAA,EACb,SAASD,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKE;AAAA,EACL,aAAaF,EAAE,MAAMA,EAAE,KAAK,CAAC,kBAAkB,eAAe,CAAC,CAAC,EAAE,SAAS;AAC7E,CAAC;AAIM,SAASG,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1CC,IAAYC,EAAmBC,EAAY,SAAS;AAE1D,SACG,gBAAAC,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE;AAAA,QAC1B,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAE;AAAA,QAE1D,UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,YAAU;AAAA,cACV,OAAOT,EAAE,cAAc;AAAA,cACvB,cAAcA,EAAE,qBAAqB;AAAA,YAAA;AAAA,UACvC;AAAA,4BACCS,GAAe,EAAA,MAAK,WAAU,OAAOT,EAAE,cAAc,GAAG;AAAA,UACzD,gBAAAQ;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,OAAOT,EAAE,WAA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"./Actions.js";
10
10
  import { LocationsFormProvider as _ } from "./useLocationForm.js";
11
11
  import { Form as w } from "../../../Common/Form/Form.js";
12
12
  import { Flex as z } from "../../../Common/Flex/Flex.js";
13
+ import "react-i18next";
14
+ import "classnames";
13
15
  import { BaseComponent as H } from "../../../Base/Base.js";
14
16
  import { useBase as U } from "../../../Base/useBase.js";
15
17
  import { useI18n as j } from "../../../../i18n/I18n.js";
@@ -23,7 +25,7 @@ function Y(t) {
23
25
  function g({
24
26
  companyId: t,
25
27
  location: e,
26
- className: n,
28
+ className: i,
27
29
  children: r
28
30
  }) {
29
31
  j("Company.Locations");
@@ -36,12 +38,12 @@ function g({
36
38
  street2: e?.street2 ?? "",
37
39
  state: e?.state ?? "",
38
40
  zip: e?.zip ?? "",
39
- addressType: F.filter((i) => e?.[i] ?? !1)
41
+ addressType: F.filter((n) => e?.[n] ?? !1)
40
42
  }
41
43
  }), T = () => {
42
44
  s(a.CANCEL);
43
- }, b = async (i) => {
44
- await y(i, async (D) => {
45
+ }, b = async (n) => {
46
+ await y(n, async (D) => {
45
47
  const { addressType: u, ...E } = D, p = {
46
48
  ...E,
47
49
  mailingAddress: u?.includes("mailingAddress"),
@@ -66,7 +68,7 @@ function g({
66
68
  }
67
69
  });
68
70
  };
69
- return /* @__PURE__ */ o("section", { className: n, children: /* @__PURE__ */ o(x, { ...c, control: P, children: /* @__PURE__ */ o(w, { onSubmit: c.handleSubmit(b), children: /* @__PURE__ */ o(
71
+ return /* @__PURE__ */ o("section", { className: i, children: /* @__PURE__ */ o(x, { ...c, control: P, children: /* @__PURE__ */ o(w, { onSubmit: c.handleSubmit(b), children: /* @__PURE__ */ o(
70
72
  _,
71
73
  {
72
74
  value: { handleCancel: T, isPending: h || C },
@@ -81,11 +83,11 @@ function g({
81
83
  function d({
82
84
  companyId: t,
83
85
  locationId: e,
84
- className: n,
86
+ className: i,
85
87
  children: r,
86
88
  ...s
87
89
  }) {
88
- return /* @__PURE__ */ o(H, { ...s, children: e ? /* @__PURE__ */ o(Y, { companyId: t, locationId: e, className: n, children: r }) : /* @__PURE__ */ o(g, { companyId: t, className: n, children: r }) });
90
+ return /* @__PURE__ */ o(H, { ...s, children: e ? /* @__PURE__ */ o(Y, { companyId: t, locationId: e, className: i, children: r }) : /* @__PURE__ */ o(g, { companyId: t, className: i, children: r }) });
89
91
  }
90
92
  d.Head = f;
91
93
  d.Form = l;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAJ;AAAA,EACA,WAAAK;AAAA,EACA,UAAAC;AACF,GAAgD;AAC9C,EAAAC,EAAQ,mBAAmB;AAC3B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzF,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAAoBC,EAA2B,GACzFC,IAAc,CAAC,kBAAkB,eAAe,GAEhD,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAYC,EAA4B;AAAA,IAC1D,UAAUC,EAAYC,CAAkB;AAAA,IACxC,eAAe;AAAA,MACb,MAAMtB,GAAU,QAAQ;AAAA,MACxB,aAAaA,GAAU,eAAe;AAAA,MACtC,SAASA,GAAU,WAAW;AA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A;AAAA,MACC,OAAO,EAAE,cAAAV,GAAc,WAAWZ,KAAmBG,EAAgB;AAAA,MAErE,UAAA,gBAAAb,EAACiC,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA7B,KAIG,gBAAA8B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAnC,EAACoC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,EAEJ,CAAA,EACF,CAAA,GACF;AAEJ;AAEO,SAASC,EAAa;AAAA,EAC3B,WAAArC;AAAA,EACA,YAAAsC;AAAA,EACA,WAAArC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGP;AACL,GAA+C;AAC7C,2BACG4C,GAAe,EAAA,GAAG5C,GAChB,UAAA2C,sBACE5C,GAAiB,EAAA,WAAAM,GAAsB,YAAAsC,GAAwB,WAAArC,GAC7D,UAAAC,GACH,IAEA,gBAAAJ,EAACC,KAAK,WAAAC,GAAsB,WAAAC,GACzB,UAAAC,EACH,CAAA,GAEJ;AAEJ;AAEAmC,EAAa,OAAOH;AACpBG,EAAa,OAAOF;AACpBE,EAAa,UAAUD;"}
1
+ {"version":3,"file":"LocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/LocationForm.tsx"],"sourcesContent":["import { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useLocationsUpdateMutation } from '@gusto/embedded-api/react-query/locationsUpdate'\nimport { useLocationsRetrieveSuspense } from '@gusto/embedded-api/react-query/locationsRetrieve'\nimport { useLocationsCreateMutation } from '@gusto/embedded-api/react-query/locationsCreate'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { Head } from './Head'\nimport type { LocationFormInputs } from './Form'\nimport { Form, LocationFormSchema } from './Form'\nimport { Actions } from './Actions'\nimport { LocationsFormProvider } from './useLocationForm'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Flex } from '@/components/Common'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport type { WithRequired } from '@/types/Helpers'\n\ninterface LocationFormProps extends CommonComponentInterface {\n companyId: string\n locationId?: string\n}\n\n/**Accounting for conditional logic where location data needs to be fetched only if locationId is present */\nfunction RootWithLocation(props: WithRequired<LocationFormProps, 'locationId'>) {\n const {\n data: { location },\n } = useLocationsRetrieveSuspense({ locationId: props.locationId })\n return <Root {...props} location={location} />\n}\n\nfunction Root({\n companyId,\n location,\n className,\n children,\n}: LocationFormProps & { location?: Location }) {\n useI18n('Company.Locations')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { mutateAsync: createLocation, isPending: isPendingCreate } = useLocationsCreateMutation()\n const { mutateAsync: updateLocation, isPending: isPendingUpdate } = useLocationsUpdateMutation()\n const addressType = ['mailingAddress', 'filingAddress'] as const\n\n const { control, ...methods } = useForm<LocationFormInputs>({\n resolver: zodResolver(LocationFormSchema),\n defaultValues: {\n city: location?.city ?? '',\n phoneNumber: location?.phoneNumber ?? '',\n street1: location?.street1 ?? '',\n street2: location?.street2 ?? '',\n state: location?.state ?? '',\n zip: location?.zip ?? '',\n addressType: addressType.filter(key => location?.[key] ?? false),\n },\n })\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n const onSubmit = async (data: LocationFormInputs) => {\n await baseSubmitHandler(data, async innerData => {\n const { addressType, ...payload } = innerData\n\n const requestBody = {\n ...payload,\n mailingAddress: addressType?.includes('mailingAddress'),\n filingAddress: addressType?.includes('filingAddress'),\n }\n\n if (location && location.version !== undefined) {\n // Edit existing location\n const { location: responseData } = await updateLocation({\n request: {\n locationId: location.uuid,\n requestBody: { ...requestBody, version: location.version },\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_UPDATED, responseData)\n } else {\n // Add new location\n const { location: responseData } = await createLocation({\n request: {\n companyId,\n requestBody,\n },\n })\n onEvent(componentEvents.COMPANY_LOCATION_CREATED, responseData)\n }\n })\n }\n\n return (\n <section className={className}>\n <FormProvider {...methods} control={control}>\n <HtmlForm onSubmit={methods.handleSubmit(onSubmit)}>\n <LocationsFormProvider\n value={{ handleCancel, isPending: isPendingCreate || isPendingUpdate }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsFormProvider>\n </HtmlForm>\n </FormProvider>\n </section>\n )\n}\n\nexport function LocationForm({\n companyId,\n locationId,\n className,\n children,\n ...props\n}: LocationFormProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {locationId ? (\n <RootWithLocation companyId={companyId} locationId={locationId} className={className}>\n {children}\n </RootWithLocation>\n ) : (\n <Root companyId={companyId} className={className}>\n {children}\n </Root>\n )}\n </BaseComponent>\n )\n}\n\nLocationForm.Head = Head\nLocationForm.Form = Form\nLocationForm.Actions = Actions\n"],"names":["RootWithLocation","props","location","useLocationsRetrieveSuspense","jsx","Root","companyId","className","children","useI18n","onEvent","baseSubmitHandler","useBase","createLocation","isPendingCreate","useLocationsCreateMutation","updateLocation","isPendingUpdate","useLocationsUpdateMutation","addressType","control","methods","useForm","zodResolver","LocationFormSchema","key","handleCancel","componentEvents","onSubmit","data","innerData","payload","requestBody","responseData","FormProvider","HtmlForm","LocationsFormProvider","Flex","jsxs","Fragment","Head","Form","Actions","LocationForm","locationId","BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAASA,EAAiBC,GAAsD;AACxE,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,MACfC,EAA6B,EAAE,YAAYF,EAAM,YAAY;AACjE,SAAQ,gBAAAG,EAAAC,GAAA,EAAM,GAAGJ,GAAO,UAAAC,EAAoB,CAAA;AAC9C;AAEA,SAASG,EAAK;AAAA,E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;AAEAmC,EAAa,OAAOH;AACpBG,EAAa,OAAOF;AACpBE,EAAa,UAAUD;"}
@@ -8,14 +8,15 @@ 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 [F, d] = o(
15
+ const [d, L] = o(
15
16
  "CompanyDocumentFormContext"
16
17
  );
17
18
  export {
18
- d as LocationsFormProvider,
19
- F as useLocationsForm
19
+ L as LocationsFormProvider,
20
+ d as useLocationsForm
20
21
  };
21
22
  //# sourceMappingURL=useLocationForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAOM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationForm.js","sources":["../../../../../src/components/Company/Locations/LocationForm/useLocationForm.ts"],"sourcesContent":["import { createCompoundContext } from '@/components/Base'\n\ntype LocationsFormContextType = {\n isPending: boolean\n handleCancel: () => void\n}\n\nconst [useLocationsForm, LocationsFormProvider] = createCompoundContext<LocationsFormContextType>(\n 'CompanyDocumentFormContext',\n)\n\nexport { useLocationsForm, LocationsFormProvider }\n"],"names":["useLocationsForm","LocationsFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAOM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
@@ -1,9 +1,10 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useLocationsList as a } from "./useLocationsList.js";
4
+ import "classnames";
4
5
  import { ActionsLayout as e } from "../../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
- function f() {
7
+ function L() {
7
8
  const { t: o } = s("Company.Locations"), { handleAddLocation: i, handleContinue: r } = a(), n = m();
8
9
  return /* @__PURE__ */ c(e, { children: [
9
10
  /* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: i, children: o("addLocationCta") }),
@@ -11,6 +12,6 @@ function f() {
11
12
  ] });
12
13
  }
13
14
  export {
14
- f as Actions
15
+ L as Actions
15
16
  };
16
17
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationsList/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Company.Locations')\n const { handleAddLocation, handleContinue } = useLocationsList()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addLocationCta')}\n </Components.Button>\n <Components.Button onClick={handleContinue}>{t('continueCta')}</Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleAddLocation","handleContinue","useLocationsList","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,mBAAAC,GAAmB,gBAAAC,EAAe,IAAIC,EAAiB,GACzDC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,gBAAgB,EACrB,CAAA;AAAA,IACA,gBAAAQ,EAACH,EAAW,QAAX,EAAkB,SAASF,GAAiB,UAAAH,EAAE,aAAa,EAAE,CAAA;AAAA,EAAA,GAChE;AAEJ;"}
@@ -2,10 +2,11 @@ import { jsx as t, Fragment as r, jsxs as n } from "react/jsx-runtime";
2
2
  import { useTranslation as L } from "react-i18next";
3
3
  import { useLocationsList as C } from "./useLocationsList.js";
4
4
  import P from "../../../../assets/icons/pencil.svg.js";
5
+ import "classnames";
5
6
  import { EmptyData as b } from "../../../Common/EmptyData/EmptyData.js";
6
7
  import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import { HamburgerMenu as x } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
8
- import { getStreet as A, getCityStateZip as T } from "../../../../helpers/formattedStrings.js";
9
+ import { getStreet as T, getCityStateZip as A } from "../../../../helpers/formattedStrings.js";
9
10
  import { VisuallyHidden as k } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
10
11
  import { useDataView as D } from "../../../Common/DataView/useDataView.js";
11
12
  import { DataView as S } from "../../../Common/DataView/DataView.js";
@@ -17,8 +18,8 @@ const Z = () => {
17
18
  totalPages: l,
18
19
  handleFirstPage: m,
19
20
  handleItemsPerPageChange: c,
20
- handleLastPage: g,
21
- handleNextPage: p,
21
+ handleLastPage: p,
22
+ handleNextPage: g,
22
23
  handlePreviousPage: u,
23
24
  handleAddLocation: h
24
25
  } = C(), { t: e } = L("Company.Locations"), { ...f } = D({
@@ -28,9 +29,9 @@ const Z = () => {
28
29
  key: "name",
29
30
  title: e("locationListCol1"),
30
31
  render: (i) => /* @__PURE__ */ t(r, { children: /* @__PURE__ */ n("address", { children: [
31
- A(i),
32
+ /* @__PURE__ */ t(a.Text, { as: "span", children: T(i) }),
32
33
  /* @__PURE__ */ t("br", {}),
33
- /* @__PURE__ */ t("small", { children: T(i) })
34
+ /* @__PURE__ */ t(a.Text, { as: "span", size: "sm", children: A(i) })
34
35
  ] }) })
35
36
  },
36
37
  {
@@ -63,15 +64,15 @@ const Z = () => {
63
64
  }
64
65
  ),
65
66
  pagination: {
66
- handleNextPage: p,
67
+ handleNextPage: g,
67
68
  handleFirstPage: m,
68
- handleLastPage: g,
69
+ handleLastPage: p,
69
70
  handlePreviousPage: u,
70
71
  handleItemsPerPageChange: c,
71
72
  currentPage: d,
72
73
  totalPages: l
73
74
  },
74
- emptyState: () => /* @__PURE__ */ t(b, { title: e("emptyTableTitle"), description: e("emptyTableDescription"), children: /* @__PURE__ */ t(a.Button, { variant: "secondary", onClick: h, children: e("addFirstLicationCta") }) })
75
+ emptyState: () => /* @__PURE__ */ t(b, { title: e("emptyTableTitle"), description: e("emptyTableDescription"), children: /* @__PURE__ */ t(a.Button, { variant: "secondary", onClick: h, children: e("addFirstLocationCta") }) })
75
76
  });
76
77
  return /* @__PURE__ */ t(S, { label: e("locationListLabel"), ...f });
77
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n {getStreet(location)}\n <br />\n <small>{getCityStateZip(location)}</small>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLicationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,EAAY;AAAA,IACvC,MAAMd;AAAA,IACN,SAAS;AAAA,MAC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H;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,IACF;AAAA,IACA,YAAY,MACT,gBAAAa,EAAAQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
1
+ {"version":3,"file":"List.js","sources":["../../../../../src/components/Company/Locations/LocationsList/List.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsList } from './useLocationsList'\nimport PencilSvg from '@/assets/icons/pencil.svg?react'\nimport { DataView, EmptyData, useDataView, VisuallyHidden } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { HamburgerMenu } from '@/components/Common/HamburgerMenu'\nimport { getCityStateZip, getStreet } from '@/helpers/formattedStrings'\n\n/**List of employees slot for EmployeeList component */\nexport const List = () => {\n const Components = useComponentContext()\n const {\n locationList,\n handleEditLocation,\n currentPage,\n totalPages,\n handleFirstPage,\n handleItemsPerPageChange,\n handleLastPage,\n handleNextPage,\n handlePreviousPage,\n handleAddLocation,\n } = useLocationsList()\n\n const { t } = useTranslation('Company.Locations')\n const { ...dataViewProps } = useDataView({\n data: locationList,\n columns: [\n {\n key: 'name',\n title: t('locationListCol1'),\n render: location => {\n return (\n <>\n <address>\n <Components.Text as=\"span\">{getStreet(location)}</Components.Text>\n <br />\n <Components.Text as=\"span\" size=\"sm\">\n {getCityStateZip(location)}\n </Components.Text>\n </address>\n </>\n )\n },\n },\n {\n key: 'status',\n title: <VisuallyHidden>{t('locationListCol2')}</VisuallyHidden>,\n render: location => {\n return (\n <>\n {location.mailingAddress && (\n <Components.Badge status={'info'}>{t('mailingAddress')}</Components.Badge>\n )}\n {location.filingAddress && (\n <>\n {' '}\n <Components.Badge status={'info'}>{t('filingAddress')}</Components.Badge>\n </>\n )}\n </>\n )\n },\n },\n ],\n itemMenu: location => {\n return (\n <HamburgerMenu\n items={[\n {\n label: t('editCta'),\n onClick: () => {\n handleEditLocation(location.uuid)\n },\n icon: <PencilSvg aria-hidden />,\n 'data-testid': 'edit-location',\n },\n ]}\n data-testid=\"location-hamburger\"\n triggerLabel={t('hamburgerTitle')}\n />\n )\n },\n pagination: {\n handleNextPage,\n handleFirstPage,\n handleLastPage,\n handlePreviousPage,\n handleItemsPerPageChange,\n currentPage,\n totalPages,\n },\n emptyState: () => (\n <EmptyData title={t('emptyTableTitle')} description={t('emptyTableDescription')}>\n <Components.Button variant=\"secondary\" onClick={handleAddLocation}>\n {t('addFirstLocationCta')}\n </Components.Button>\n </EmptyData>\n ),\n })\n return <DataView label={t('locationListLabel')} {...dataViewProps} />\n}\n"],"names":["List","Components","useComponentContext","locationList","handleEditLocation","currentPage","totalPages","handleFirstPage","handleItemsPerPageChange","handleLastPage","handleNextPage","handlePreviousPage","handleAddLocation","useLocationsList","t","useTranslation","dataViewProps","useDataView","location","jsx","Fragment","getStreet","getCityStateZip","VisuallyHidden","jsxs","HamburgerMenu","PencilSvg","EmptyData","DataView"],"mappings":";;;;;;;;;;;;AASO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAoB,GACjC;AAAA,IACJ,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,MACEC,EAAiB,GAEf,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,GAAGC,EAAc,IAAIC,E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A;AAAA,QAEnB;AAAA,QACA,eAAY;AAAA,QACZ,cAAcZ,EAAE,gBAAgB;AAAA,MAAA;AAAA,IAClC;AAAA,IAGJ,YAAY;AAAA,MACV,gBAAAJ;AAAA,MACA,iBAAAH;AAAA,MACA,gBAAAE;AAAA,MACA,oBAAAE;AAAA,MACA,0BAAAH;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,IACF;AAAA,IACA,YAAY,MACT,gBAAAa,EAAAQ,GAAA,EAAU,OAAOb,EAAE,iBAAiB,GAAG,aAAaA,EAAE,uBAAuB,GAC5E,UAAC,gBAAAK,EAAAlB,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASW,GAC7C,UAAAE,EAAE,qBAAqB,EAC1B,CAAA,EACF,CAAA;AAAA,EAAA,CAEH;AACD,2BAAQc,GAAS,EAAA,OAAOd,EAAE,mBAAmB,GAAI,GAAGE,GAAe;AACrE;"}
@@ -9,8 +9,10 @@ import { useI18n as x } from "../../../../i18n/I18n.js";
9
9
  import { BaseComponent as E } from "../../../Base/Base.js";
10
10
  import { useBase as I } from "../../../Base/useBase.js";
11
11
  import { Flex as v } from "../../../Common/Flex/Flex.js";
12
- import { companyEvents as s } from "../../../../shared/constants.js";
13
- function i(o) {
12
+ import "react-i18next";
13
+ import "classnames";
14
+ import { companyEvents as i } from "../../../../shared/constants.js";
15
+ function s(o) {
14
16
  return /* @__PURE__ */ e(E, { ...o, children: /* @__PURE__ */ e(M, { ...o, children: o.children }) });
15
17
  }
16
18
  function M({ companyId: o, className: g, children: c }) {
@@ -41,13 +43,13 @@ function M({ companyId: o, className: g, children: c }) {
41
43
  L(t);
42
44
  },
43
45
  handleAddLocation: () => {
44
- a(s.COMPANY_LOCATION_CREATE);
46
+ a(i.COMPANY_LOCATION_CREATE);
45
47
  },
46
48
  handleEditLocation: (t) => {
47
- a(s.COMPANY_LOCATION_EDIT, { uuid: t });
49
+ a(i.COMPANY_LOCATION_EDIT, { uuid: t });
48
50
  },
49
51
  handleContinue: () => {
50
- a(s.COMPANY_LOCATION_DONE);
52
+ a(i.COMPANY_LOCATION_DONE);
51
53
  }
52
54
  },
53
55
  children: /* @__PURE__ */ e(v, { flexDirection: "column", gap: 32, children: c || /* @__PURE__ */ C(A, { children: [
@@ -58,10 +60,10 @@ function M({ companyId: o, className: g, children: c }) {
58
60
  }
59
61
  ) });
60
62
  }
61
- i.Head = l;
62
- i.List = h;
63
- i.Actions = P;
63
+ s.Head = l;
64
+ s.List = h;
65
+ s.Actions = P;
64
66
  export {
65
- i as LocationsList
67
+ s as LocationsList
66
68
  };
67
69
  //# sourceMappingURL=LocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc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AmB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAzB,EAAC0B,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA9B,EAAc,OAAO4B;AACrB5B,EAAc,OAAO6B;AACrB7B,EAAc,UAAU8B;"}
1
+ {"version":3,"file":"LocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/LocationsList.tsx"],"sourcesContent":["import { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useState } from 'react'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { Actions } from './Actions'\nimport { LocationsListProvider } from './useLocationsList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface LocationsListProps extends BaseComponentInterface {\n companyId: string\n}\n\nexport function LocationsList(props: LocationsListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, className, children }: LocationsListProps) {\n useI18n('Company.Locations')\n const { onEvent } = useBase()\n\n const [currentPage, setCurrentPage] = useState(1)\n const [itemsPerPage, setItemsPerPage] = useState(5)\n\n const {\n data: { locationList, httpMeta },\n } = useLocationsGetSuspense({ companyId, page: currentPage, per: itemsPerPage })\n\n const totalPages = Number(httpMeta.response.headers.get('x-total-pages') ?? 1)\n\n const handleItemsPerPageChange = (newCount: number) => {\n setItemsPerPage(newCount)\n }\n const handleFirstPage = () => {\n setCurrentPage(1)\n }\n const handlePreviousPage = () => {\n setCurrentPage(prevPage => Math.max(prevPage - 1, 1))\n }\n const handleNextPage = () => {\n setCurrentPage(prevPage => Math.min(prevPage + 1, totalPages))\n }\n const handleLastPage = () => {\n setCurrentPage(totalPages)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_LOCATION_DONE)\n }\n const handleAddLocation = () => {\n onEvent(companyEvents.COMPANY_LOCATION_CREATE)\n }\n const handleEditLocation = (uuid: string) => {\n onEvent(companyEvents.COMPANY_LOCATION_EDIT, { uuid })\n }\n\n return (\n <section className={className}>\n <LocationsListProvider\n value={{\n locationList: locationList ?? [],\n currentPage,\n totalPages,\n handleFirstPage,\n handlePreviousPage,\n handleNextPage,\n handleLastPage,\n handleItemsPerPageChange,\n handleAddLocation,\n handleEditLocation,\n handleContinue,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </LocationsListProvider>\n </section>\n )\n}\n\nLocationsList.Head = Head\nLocationsList.List = List\nLocationsList.Actions = Actions\n"],"names":["LocationsList","props","jsx","BaseComponent","Root","companyId","className","children","useI18n","onEvent","useBase","currentPage","setCurrentPage","useState","itemsPerPage","setItemsPerPage","locationList","httpMeta","useLocationsGetSuspense","totalPages","LocationsListProvider","prevPage","newCount","companyEvents","uuid","Flex","jsxs","Fragment","Head","List","Actions"],"mappings":";;;;;;;;;;;;;;AAgBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,KAAgC;AACpE,EAAAC,EAAQ,mBAAmB;AACrB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC,GAC1C,CAACC,GAAcC,CAAe,IAAIF,EAAS,CAAC,GAE5C;AAAA,IACJ,MAAM,EAAE,cAAAG,GAAc,UAAAC,EAAS;AAA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A;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA9B,EAAc,OAAO4B;AACrB5B,EAAc,OAAO6B;AACrB7B,EAAc,UAAU8B;"}
@@ -8,14 +8,15 @@ 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 [x, d] = o(
15
+ const [d, f] = o(
15
16
  "CompanyDocumentListContext"
16
17
  );
17
18
  export {
18
- d as LocationsListProvider,
19
- x as useLocationsList
19
+ f as LocationsListProvider,
20
+ d as useLocationsList
20
21
  };
21
22
  //# sourceMappingURL=useLocationsList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAiBM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}
1
+ {"version":3,"file":"useLocationsList.js","sources":["../../../../../src/components/Company/Locations/LocationsList/useLocationsList.ts"],"sourcesContent":["import { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\ntype LocationsListContextType = {\n locationList: Location[]\n totalPages: number\n currentPage: number\n handleItemsPerPageChange: (n: number) => void\n handleFirstPage: () => void\n handlePreviousPage: () => void\n handleNextPage: () => void\n handleLastPage: () => void\n handleEditLocation: (uuid: string) => void\n handleAddLocation: () => void\n handleContinue: () => void\n}\n\nconst [useLocationsList, LocationsListProvider] = createCompoundContext<LocationsListContextType>(\n 'CompanyDocumentListContext',\n)\n\nexport { useLocationsList, LocationsListProvider }\n"],"names":["useLocationsList","LocationsListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAA,CAACA,GAAkBC,CAAqB,IAAIC;AAAA,EAChD;AACF;"}