@justifi/webcomponents 4.10.0 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/dist/cjs/{Business-663db337.js → Business-7ae04d4f.js} +46 -1
  2. package/dist/cjs/business-additional-questions-schema-18a82d19.js +47 -0
  3. package/dist/cjs/business-details-core.cjs.entry.js +7 -2
  4. package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-29b2bad9.js} +7 -0
  5. package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-datepart_4.cjs.entry.js} +59 -12
  6. package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +3 -45
  7. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +7 -1
  8. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +24 -20
  9. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +6 -8
  10. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +1 -1
  11. package/dist/cjs/justifi-business-details.cjs.entry.js +21 -4
  12. package/dist/cjs/justifi-business-form.cjs.entry.js +60 -51
  13. package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
  14. package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
  15. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +29 -5
  16. package/dist/cjs/justifi-owner-form.cjs.entry.js +20 -12
  17. package/dist/cjs/justifi-payment-details.cjs.entry.js +25 -4
  18. package/dist/cjs/justifi-payment-form.cjs.entry.js +16 -3
  19. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +16 -16
  20. package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -5
  21. package/dist/cjs/justifi-payout-details.cjs.entry.js +27 -7
  22. package/dist/cjs/justifi-payouts-list.cjs.entry.js +26 -6
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/cjs/payload-parsers-f437272e.js +132 -0
  25. package/dist/cjs/payment-details-core.cjs.entry.js +7 -1
  26. package/dist/cjs/payments-list-core.cjs.entry.js +8 -2
  27. package/dist/cjs/payout-details-core.cjs.entry.js +8 -3
  28. package/dist/cjs/payouts-list-core.cjs.entry.js +8 -2
  29. package/dist/cjs/{utils-df5167a8.js → utils-87435719.js} +7 -0
  30. package/dist/cjs/utils-f8079741.js +41 -0
  31. package/dist/cjs/webcomponents.cjs.js +1 -1
  32. package/dist/collection/api/Business.js +2 -1
  33. package/dist/collection/api/ComponentError.js +14 -0
  34. package/dist/collection/api/services/utils.js +11 -0
  35. package/dist/collection/api/shared.js +11 -1
  36. package/dist/collection/collection-manifest.json +1 -2
  37. package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +1 -1
  38. package/dist/collection/components/business-details/business-details-core.js +30 -2
  39. package/dist/collection/components/business-details/business-details.js +30 -0
  40. package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +1 -1
  41. package/dist/collection/components/business-details/get-business.js +15 -3
  42. package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +1 -1
  43. package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +1 -1
  44. package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +1 -1
  45. package/dist/collection/components/business-details/test/busines-details-core.spec.js +56 -16
  46. package/dist/collection/components/business-details/test/business-details.spec.js +20 -4
  47. package/dist/collection/components/business-details/test/get-business.spec.js +13 -6
  48. package/dist/collection/components/business-forms/business-form/business-form.js +79 -50
  49. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -4
  50. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -2
  51. package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.js → owner-form/identity-address/identity-address-form.js} +13 -10
  52. package/dist/collection/components/business-forms/owner-form/identity-address/test/identity-address.e2e.js +9 -0
  53. package/dist/collection/components/business-forms/{business-form/business-address/test/business-address.spec.js → owner-form/identity-address/test/identity-address.spec.js} +21 -14
  54. package/dist/collection/components/business-forms/owner-form/owner-form.js +54 -8
  55. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +20 -2
  56. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +19 -1
  57. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +44 -4
  58. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +21 -6
  59. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +23 -4
  60. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +32 -14
  61. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +15 -6
  62. package/dist/collection/components/business-forms/schemas/business-address-schema.js +47 -12
  63. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +24 -12
  64. package/dist/collection/components/business-forms/schemas/business-form-schema.js +4 -4
  65. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +29 -34
  66. package/dist/collection/components/business-forms/utils/business-form-types.js +7 -0
  67. package/dist/collection/components/business-forms/utils/helpers.js +2 -0
  68. package/dist/collection/components/form/form-control-text.js +35 -1
  69. package/dist/collection/components/form/utils.js +6 -0
  70. package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +17 -2
  71. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +30 -1
  72. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +35 -1
  73. package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +26 -8
  74. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +51 -11
  75. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +55 -3
  76. package/dist/collection/components/payment-details/get-payment-details.js +15 -3
  77. package/dist/collection/components/payment-details/payment-details-core.js +30 -1
  78. package/dist/collection/components/payment-details/payment-details.js +35 -1
  79. package/dist/collection/components/payment-details/test/get-payment-details.spec.js +11 -3
  80. package/dist/collection/components/payment-details/test/payment-details-core.spec.js +55 -12
  81. package/dist/collection/components/payment-details/test/payment-details.spec.js +69 -3
  82. package/dist/collection/components/payment-form/payment-form.js +54 -3
  83. package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
  84. package/dist/collection/components/payments-list/get-payments.js +15 -4
  85. package/dist/collection/components/payments-list/payments-list-core.js +28 -2
  86. package/dist/collection/components/payments-list/payments-list.js +35 -1
  87. package/dist/collection/components/payments-list/test/get-payments.spec.js +11 -3
  88. package/dist/collection/components/payments-list/test/payments-list-core.spec.js +43 -28
  89. package/dist/collection/components/payments-list/test/payments-list.spec.js +31 -3
  90. package/dist/collection/components/payout-details/get-payout-details.js +17 -6
  91. package/dist/collection/components/payout-details/payout-details-core.js +31 -3
  92. package/dist/collection/components/payout-details/payout-details.js +35 -1
  93. package/dist/collection/components/payout-details/test/get-payout-details.spec.js +15 -5
  94. package/dist/collection/components/payout-details/test/payout-details-core.spec.js +54 -16
  95. package/dist/collection/components/payout-details/test/payout-details.spec.js +50 -1
  96. package/dist/collection/components/payouts-list/get-payouts.js +17 -5
  97. package/dist/collection/components/payouts-list/payouts-list-core.js +28 -2
  98. package/dist/collection/components/payouts-list/payouts-list.js +34 -1
  99. package/dist/collection/components/payouts-list/test/get-payouts.spec.js +11 -3
  100. package/dist/collection/components/payouts-list/test/payouts-list-core.spec.js +42 -29
  101. package/dist/collection/components/payouts-list/test/payouts-list.spec.js +33 -0
  102. package/dist/docs.json +753 -354
  103. package/dist/esm/{Business-6cc4e473.js → Business-91caaccb.js} +45 -2
  104. package/dist/esm/business-additional-questions-schema-b642a2b7.js +44 -0
  105. package/dist/esm/business-details-core.entry.js +8 -3
  106. package/dist/esm/{business-form-types-de9f38cd.js → business-form-types-0d76133c.js} +8 -1
  107. package/dist/esm/{form-control-datepart_3.entry.js → form-control-datepart_4.entry.js} +59 -13
  108. package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +4 -45
  109. package/dist/esm/gross-payment-chart-core.entry.js +8 -2
  110. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +22 -18
  111. package/dist/esm/justifi-additional-questions_4.entry.js +6 -8
  112. package/dist/esm/justifi-billing-form_4.entry.js +1 -1
  113. package/dist/esm/justifi-business-details.entry.js +22 -5
  114. package/dist/esm/justifi-business-form.entry.js +60 -51
  115. package/dist/esm/justifi-business-list.entry.js +1 -1
  116. package/dist/esm/justifi-checkout.entry.js +1 -1
  117. package/dist/esm/justifi-gross-payment-chart.entry.js +28 -4
  118. package/dist/esm/justifi-owner-form.entry.js +19 -11
  119. package/dist/esm/justifi-payment-details.entry.js +26 -5
  120. package/dist/esm/justifi-payment-form.entry.js +16 -3
  121. package/dist/esm/justifi-payment-provisioning.entry.js +16 -16
  122. package/dist/esm/justifi-payments-list.entry.js +26 -6
  123. package/dist/esm/justifi-payout-details.entry.js +28 -8
  124. package/dist/esm/justifi-payouts-list.entry.js +27 -7
  125. package/dist/esm/loader.js +1 -1
  126. package/dist/esm/payload-parsers-920f49dd.js +123 -0
  127. package/dist/esm/payment-details-core.entry.js +8 -2
  128. package/dist/esm/payments-list-core.entry.js +8 -2
  129. package/dist/esm/payout-details-core.entry.js +9 -4
  130. package/dist/esm/payouts-list-core.entry.js +8 -2
  131. package/dist/esm/utils-4609f32c.js +38 -0
  132. package/dist/esm/{utils-2828201a.js → utils-684d2e47.js} +7 -1
  133. package/dist/esm/webcomponents.js +1 -1
  134. package/dist/module/Business.js +45 -2
  135. package/dist/module/business-additional-questions-form-step.js +4 -2
  136. package/dist/module/business-additional-questions-schema.js +16 -7
  137. package/dist/module/business-address-schema.js +49 -14
  138. package/dist/module/business-core-info-form-step.js +3 -1
  139. package/dist/module/business-core-info-schema.js +24 -12
  140. package/dist/module/business-details-core2.js +8 -3
  141. package/dist/module/business-form-types.js +8 -1
  142. package/dist/module/business-identity-schema.js +30 -35
  143. package/dist/module/business-owners-form-step.js +12 -8
  144. package/dist/module/business-representative-form-step.js +9 -10
  145. package/dist/module/business-representative.js +4 -7
  146. package/dist/module/form-control-text2.js +5 -1
  147. package/dist/module/gross-payment-chart-core2.js +8 -2
  148. package/dist/module/helpers.js +4 -0
  149. package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
  150. package/dist/module/justifi-business-details.js +21 -4
  151. package/dist/module/justifi-business-form.js +65 -56
  152. package/dist/module/justifi-gross-payment-chart.js +28 -4
  153. package/dist/module/justifi-identity-address-form.d.ts +11 -0
  154. package/dist/module/justifi-identity-address-form.js +6 -0
  155. package/dist/module/justifi-payment-details.js +26 -5
  156. package/dist/module/justifi-payment-form.js +18 -4
  157. package/dist/module/justifi-payment-provisioning.js +24 -23
  158. package/dist/module/justifi-payments-list.js +26 -6
  159. package/dist/module/justifi-payout-details.js +28 -8
  160. package/dist/module/justifi-payouts-list.js +27 -7
  161. package/dist/module/legal-address-form-step.js +8 -11
  162. package/dist/module/legal-address-form.js +5 -9
  163. package/dist/module/owner-form.js +22 -12
  164. package/dist/module/payment-details-core2.js +8 -2
  165. package/dist/module/payment-method-form.js +1 -1
  166. package/dist/module/payments-list-core2.js +8 -2
  167. package/dist/module/payout-details-core2.js +9 -4
  168. package/dist/module/payouts-list-core2.js +8 -2
  169. package/dist/module/utils3.js +31 -1
  170. package/dist/module/utils4.js +7 -1
  171. package/dist/types/api/ComponentError.d.ts +18 -0
  172. package/dist/types/api/services/utils.d.ts +2 -0
  173. package/dist/types/api/shared.d.ts +9 -0
  174. package/dist/types/components/business-details/business-details-core.d.ts +3 -0
  175. package/dist/types/components/business-details/business-details.d.ts +3 -0
  176. package/dist/types/components/business-forms/business-form/business-form.d.ts +4 -2
  177. package/dist/types/components/business-forms/owner-form/identity-address/identity-address-form.d.ts +10 -0
  178. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +5 -1
  179. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +1 -0
  180. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +1 -0
  181. package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +3 -1
  182. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +1 -0
  183. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +1 -0
  184. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +3 -2
  185. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +1 -1
  186. package/dist/types/components/business-forms/schemas/business-address-schema.d.ts +1 -12
  187. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +1 -1
  188. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +7 -3
  189. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +5 -31
  190. package/dist/types/components/business-forms/utils/business-form-types.d.ts +10 -0
  191. package/dist/types/components/business-forms/utils/helpers.d.ts +2 -0
  192. package/dist/types/components/form/form-control-text.d.ts +2 -0
  193. package/dist/types/components/form/utils.d.ts +1 -0
  194. package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +5 -8
  195. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +3 -0
  196. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -0
  197. package/dist/types/components/payment-details/payment-details-core.d.ts +3 -0
  198. package/dist/types/components/payment-details/payment-details.d.ts +4 -0
  199. package/dist/types/components/payment-form/payment-form.d.ts +4 -1
  200. package/dist/types/components/payments-list/payments-list-core.d.ts +2 -0
  201. package/dist/types/components/payments-list/payments-list.d.ts +4 -0
  202. package/dist/types/components/payout-details/payout-details-core.d.ts +3 -0
  203. package/dist/types/components/payout-details/payout-details.d.ts +4 -0
  204. package/dist/types/components/payouts-list/payouts-list-core.d.ts +2 -0
  205. package/dist/types/components/payouts-list/payouts-list.d.ts +4 -0
  206. package/dist/types/components.d.ts +217 -43
  207. package/dist/webcomponents/p-091f9732.entry.js +1 -0
  208. package/dist/webcomponents/p-0b76c770.entry.js +1 -0
  209. package/dist/webcomponents/p-0d81883d.entry.js +1 -0
  210. package/dist/webcomponents/{p-cb8f9cb8.entry.js → p-102b593a.entry.js} +1 -1
  211. package/dist/webcomponents/p-28cd23c8.entry.js +1 -0
  212. package/dist/webcomponents/p-2b8368d2.js +1 -0
  213. package/dist/webcomponents/p-436d27b9.entry.js +1 -0
  214. package/dist/webcomponents/p-448063ba.entry.js +1 -0
  215. package/dist/webcomponents/p-5341321d.entry.js +1 -0
  216. package/dist/webcomponents/p-5b262705.entry.js +1 -0
  217. package/dist/webcomponents/p-5e503d7d.entry.js +1 -0
  218. package/dist/webcomponents/p-6047b960.entry.js +1 -0
  219. package/dist/webcomponents/p-6f294d5d.js +1 -0
  220. package/dist/webcomponents/p-7294eb89.entry.js +1 -0
  221. package/dist/webcomponents/p-746bfba6.entry.js +1 -0
  222. package/dist/webcomponents/p-7c6a355f.entry.js +1 -0
  223. package/dist/webcomponents/p-935d6f55.js +1 -0
  224. package/dist/webcomponents/{p-e924f2e1.entry.js → p-959250e3.entry.js} +1 -1
  225. package/dist/webcomponents/{p-b37d6888.entry.js → p-a130a884.entry.js} +1 -1
  226. package/dist/webcomponents/p-ac670a3e.js +1 -0
  227. package/dist/webcomponents/p-ae21ed6f.entry.js +19 -0
  228. package/dist/webcomponents/p-c071d8c1.entry.js +1 -0
  229. package/dist/webcomponents/p-c340b60f.js +1 -0
  230. package/dist/webcomponents/p-d5aab6b5.entry.js +1 -0
  231. package/dist/webcomponents/p-d5c80489.entry.js +1 -0
  232. package/dist/webcomponents/p-d776fe10.entry.js +1 -0
  233. package/dist/webcomponents/p-d8679fad.entry.js +1 -0
  234. package/dist/webcomponents/p-e84b3616.entry.js +1 -0
  235. package/dist/webcomponents/p-ea2cca2a.js +1 -0
  236. package/dist/webcomponents/webcomponents.esm.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/cjs/Identity-1c4528b8.js +0 -49
  239. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
  240. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
  241. package/dist/cjs/payload-parsers-9e72e80f.js +0 -99
  242. package/dist/cjs/utils-f5d82f21.js +0 -10
  243. package/dist/collection/api/mockData/MockOnboardingData.js +0 -117
  244. package/dist/collection/api/mockData/MockPayments.js +0 -243
  245. package/dist/collection/api/mockData/MockSubAccount.js +0 -102
  246. package/dist/collection/api/mockData/mockGrossVolumeReport.js +0 -125
  247. package/dist/collection/components/business-forms/business-form/business-address/test/business-address.e2e.js +0 -9
  248. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +0 -2536
  249. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +0 -97
  250. package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +0 -97
  251. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
  252. package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
  253. package/dist/esm/Identity-5f8f916f.js +0 -46
  254. package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
  255. package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
  256. package/dist/esm/payload-parsers-caea809d.js +0 -91
  257. package/dist/esm/utils-546ca6aa.js +0 -8
  258. package/dist/module/Identity.js +0 -46
  259. package/dist/module/justifi-business-address-form-step.d.ts +0 -11
  260. package/dist/module/justifi-business-address-form-step.js +0 -75
  261. package/dist/module/justifi-business-address-form.d.ts +0 -11
  262. package/dist/module/justifi-business-address-form.js +0 -6
  263. package/dist/types/api/mockData/MockOnboardingData.d.ts +0 -8
  264. package/dist/types/api/mockData/MockPayments.d.ts +0 -3
  265. package/dist/types/api/mockData/MockSubAccount.d.ts +0 -3
  266. package/dist/types/components/business-forms/business-form/business-address/business-address-form.d.ts +0 -9
  267. package/dist/types/components/business-forms/payment-provisioning/business-address/business-address-form-step.d.ts +0 -9
  268. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +0 -33
  269. package/dist/webcomponents/p-03b1d0d5.entry.js +0 -1
  270. package/dist/webcomponents/p-0e189d6a.entry.js +0 -1
  271. package/dist/webcomponents/p-16dcf053.entry.js +0 -1
  272. package/dist/webcomponents/p-17d72f4a.js +0 -1
  273. package/dist/webcomponents/p-38ba2848.entry.js +0 -1
  274. package/dist/webcomponents/p-41870765.entry.js +0 -1
  275. package/dist/webcomponents/p-461f42b8.entry.js +0 -1
  276. package/dist/webcomponents/p-48c2400e.js +0 -1
  277. package/dist/webcomponents/p-491ca87f.js +0 -1
  278. package/dist/webcomponents/p-5be4e217.entry.js +0 -1
  279. package/dist/webcomponents/p-60714f2a.entry.js +0 -1
  280. package/dist/webcomponents/p-65500b31.entry.js +0 -19
  281. package/dist/webcomponents/p-6ed680e9.js +0 -1
  282. package/dist/webcomponents/p-7ec301b5.entry.js +0 -1
  283. package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
  284. package/dist/webcomponents/p-9e4b81ad.entry.js +0 -1
  285. package/dist/webcomponents/p-a141c531.js +0 -1
  286. package/dist/webcomponents/p-a2dbe90f.entry.js +0 -1
  287. package/dist/webcomponents/p-a68519e5.entry.js +0 -1
  288. package/dist/webcomponents/p-af8363a1.entry.js +0 -1
  289. package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
  290. package/dist/webcomponents/p-b5a3bf86.entry.js +0 -1
  291. package/dist/webcomponents/p-b8f22856.js +0 -1
  292. package/dist/webcomponents/p-d0761829.entry.js +0 -1
  293. package/dist/webcomponents/p-dbe32e75.entry.js +0 -1
  294. package/dist/webcomponents/p-e0c1cba8.js +0 -1
  295. package/dist/webcomponents/p-eed5f4ad.entry.js +0 -1
  296. package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
  297. /package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.css → owner-form/identity-address/identity-address-form.css} +0 -0
  298. /package/dist/types/{api → home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil}/mockData/mockGrossVolumeReport.d.ts +0 -0
  299. /package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/{config.d.ts → packages/webcomponents/config.d.ts} +0 -0
@@ -2,6 +2,7 @@ import { Host, h } from "@stencil/core";
2
2
  import { ErrorState } from "../details/utils";
3
3
  import { BusinessService } from "../../api/services/business.service";
4
4
  import { makeGetBusiness } from "./get-business";
5
+ import { ComponentErrorCodes, ComponentErrorSeverity } from "../../api/ComponentError";
5
6
  /**
6
7
  *
7
8
  * @exportedPart detail-section
@@ -23,6 +24,11 @@ export class BusinessDetails {
23
24
  initializeGetBusiness() {
24
25
  if (!this.businessId || !this.authToken) {
25
26
  this.errorMessage = 'Invalid business id or auth token';
27
+ this.errorEvent.emit({
28
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
29
+ message: this.errorMessage,
30
+ severity: ComponentErrorSeverity.ERROR,
31
+ });
26
32
  return;
27
33
  }
28
34
  this.getBusiness = makeGetBusiness({
@@ -83,4 +89,28 @@ export class BusinessDetails {
83
89
  "getBusiness": {}
84
90
  };
85
91
  }
92
+ static get events() {
93
+ return [{
94
+ "method": "errorEvent",
95
+ "name": "error-event",
96
+ "bubbles": true,
97
+ "cancelable": true,
98
+ "composed": true,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": ""
102
+ },
103
+ "complexType": {
104
+ "original": "ComponentError",
105
+ "resolved": "ComponentError",
106
+ "references": {
107
+ "ComponentError": {
108
+ "location": "import",
109
+ "path": "../../api/ComponentError",
110
+ "id": "src/api/ComponentError.ts::ComponentError"
111
+ }
112
+ }
113
+ }
114
+ }];
115
+ }
86
116
  }
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { newSpecPage } from "@stencil/core/testing";
3
3
  import { Business } from "../../../../api/Business";
4
4
  import { GenericInfoDetails } from "../generic-info-details";
5
- import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
5
+ import mockedBusinessDetails from "../../../../../../../mockData/mockBusinessDetails.json";
6
6
  describe('GenericInfoDetails', () => {
7
7
  it('should render', async () => {
8
8
  const businessDetails = new Business(mockedBusinessDetails.data);
@@ -1,6 +1,8 @@
1
1
  import { Business } from "../../api/Business";
2
- import { getErrorMessage } from "../../api/services/utils";
2
+ import { ComponentErrorSeverity } from "../../api/ComponentError";
3
+ import { getErrorCode, getErrorMessage } from "../../api/services/utils";
3
4
  export const makeGetBusiness = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
5
+ var _a;
4
6
  try {
5
7
  const response = await service.fetchBusiness(id, authToken);
6
8
  if (!response.error) {
@@ -8,10 +10,20 @@ export const makeGetBusiness = ({ id, authToken, service }) => async ({ onSucces
8
10
  }
9
11
  else {
10
12
  const responseError = getErrorMessage(response.error);
11
- return onError({ error: responseError });
13
+ const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
14
+ return onError({
15
+ error: responseError,
16
+ code,
17
+ severity: ComponentErrorSeverity.ERROR,
18
+ });
12
19
  }
13
20
  }
14
21
  catch (error) {
15
- return onError({ error: error.message || error });
22
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
23
+ return onError({
24
+ error: error.message || error,
25
+ code,
26
+ severity: ComponentErrorSeverity.ERROR,
27
+ });
16
28
  }
17
29
  };
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  import { newSpecPage } from "@stencil/core/testing";
3
3
  import { Business } from "../../../../api/Business";
4
4
  import { LegalAddressDetails } from "../legal-address-details";
5
- import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
5
+ import mockedBusinessDetails from "../../../../../../../mockData/mockBusinessDetails.json";
6
6
  describe('LegalAddressDetails', () => {
7
7
  it('should render', async () => {
8
8
  const businessDetails = new Business(mockedBusinessDetails.data);
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { newSpecPage } from "@stencil/core/testing";
3
3
  import { Business } from "../../../../api/Business";
4
- import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
4
+ import mockedBusinessDetails from "../../../../../../../mockData/mockBusinessDetails.json";
5
5
  import { OwnerDetails } from "../owner-details";
6
6
  describe('owner-details', () => {
7
7
  it('should render owner-details', async () => {
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { newSpecPage } from "@stencil/core/testing";
3
3
  import { Business } from "../../../../api/Business";
4
- import mockedBusinessDetails from "../../../../api/mockData/mockBusinessDetails.json";
4
+ import mockedBusinessDetails from "../../../../../../../mockData/mockBusinessDetails.json";
5
5
  import { JustifiRepresentativeDetails } from "../representative-details";
6
6
  describe('RepresentativeDetails', () => {
7
7
  it('should render', async () => {
@@ -1,22 +1,20 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { BusinessDetailsCore } from "../business-details-core";
3
4
  import { makeGetBusiness } from "../get-business";
4
- import mockBusinessDetails from "./../../../api/mockData/mockBusinessDetails.json";
5
+ import mockBusinessDetails from "./../../../../../../mockData/mockBusinessDetails.json";
5
6
  import { Business } from "../../../api/Business";
7
+ import { API_NOT_AUTHENTICATED_ERROR } from "../../../api/shared";
6
8
  describe('BusinessDetailsCore', () => {
7
9
  it('should display loading state correclty', async () => {
8
10
  const page = await newSpecPage({
9
11
  components: [BusinessDetailsCore],
10
- html: '<business-details-core></business-details-core>',
12
+ template: () => h("business-details-core", null),
11
13
  });
12
14
  await page.waitForChanges();
13
15
  expect(page.root).toMatchSnapshot();
14
16
  });
15
17
  it('should display error state correctly', async () => {
16
- const page = await newSpecPage({
17
- components: [BusinessDetailsCore],
18
- html: '<business-details-core></business-details-core>',
19
- });
20
18
  const getBusiness = makeGetBusiness({
21
19
  id: '',
22
20
  authToken: '',
@@ -24,17 +22,14 @@ describe('BusinessDetailsCore', () => {
24
22
  fetchBusiness: async () => ({ error: 'error' }),
25
23
  },
26
24
  });
27
- page.rootInstance.componentWillLoad = () => { };
28
- page.rootInstance.getBusiness = getBusiness;
29
- page.rootInstance.fetchData();
25
+ const page = await newSpecPage({
26
+ components: [BusinessDetailsCore],
27
+ template: () => h("business-details-core", { getBusiness: getBusiness }),
28
+ });
30
29
  await page.waitForChanges();
31
30
  expect(page.root).toMatchSnapshot();
32
31
  });
33
32
  it('should set business details correctly to state', async () => {
34
- const page = await newSpecPage({
35
- components: [BusinessDetailsCore],
36
- html: '<business-details-core></business-details-core>',
37
- });
38
33
  const getBusiness = makeGetBusiness({
39
34
  id: '',
40
35
  authToken: '',
@@ -42,12 +37,57 @@ describe('BusinessDetailsCore', () => {
42
37
  fetchBusiness: async () => Promise.resolve(mockBusinessDetails),
43
38
  },
44
39
  });
45
- page.rootInstance.componentWillLoad = () => { };
46
- page.rootInstance.getBusiness = getBusiness;
47
- page.rootInstance.fetchData();
40
+ const page = await newSpecPage({
41
+ components: [BusinessDetailsCore],
42
+ template: () => h("business-details-core", { getBusiness: getBusiness }),
43
+ });
48
44
  await page.waitForChanges();
49
45
  const expectedBusiness = new Business(mockBusinessDetails.data);
50
46
  expect(page.rootInstance.business).toEqual(expectedBusiness);
51
47
  expect(page.root).toMatchSnapshot();
52
48
  });
49
+ it('should emit error event when fetch fails', async () => {
50
+ const getBusiness = makeGetBusiness({
51
+ authToken: 'abc',
52
+ id: 'abc',
53
+ service: {
54
+ fetchBusiness: jest.fn().mockRejectedValue(new Error('Fetch error')),
55
+ },
56
+ });
57
+ const errorSpy = jest.fn();
58
+ const page = await newSpecPage({
59
+ components: [BusinessDetailsCore],
60
+ template: () => h("business-details-core", { getBusiness: getBusiness, "onError-event": errorSpy }),
61
+ });
62
+ await page.waitForChanges();
63
+ expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
64
+ detail: {
65
+ errorCode: 'fetch-error',
66
+ message: 'Fetch error',
67
+ severity: 'error',
68
+ }
69
+ }));
70
+ });
71
+ it('should emit error event when API returns error', async () => {
72
+ const getBusiness = makeGetBusiness({
73
+ authToken: 'abc',
74
+ id: 'abc',
75
+ service: {
76
+ fetchBusiness: jest.fn().mockResolvedValue(API_NOT_AUTHENTICATED_ERROR),
77
+ },
78
+ });
79
+ const errorSpy = jest.fn();
80
+ const page = await newSpecPage({
81
+ components: [BusinessDetailsCore],
82
+ template: () => h("business-details-core", { getBusiness: getBusiness, "onError-event": errorSpy }),
83
+ });
84
+ await page.waitForChanges();
85
+ expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
86
+ detail: {
87
+ errorCode: 'not-authenticated',
88
+ message: 'Not Authenticated',
89
+ severity: 'error',
90
+ }
91
+ }));
92
+ });
53
93
  });
@@ -1,3 +1,4 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { BusinessDetails } from "../business-details";
3
4
  import { BusinessDetailsCore } from "../business-details-core";
@@ -5,7 +6,7 @@ describe('justifi-business-details', () => {
5
6
  it('initializes getBusiness on load with valid props', async () => {
6
7
  const page = await newSpecPage({
7
8
  components: [BusinessDetails],
8
- html: `<justifi-business-details business-id="123" auth-token="token" />`,
9
+ template: () => h("justifi-business-details", { "business-id": "123", "auth-token": "token" }),
9
10
  });
10
11
  page.waitForChanges();
11
12
  expect(page.rootInstance.getBusiness).toBeDefined();
@@ -14,7 +15,7 @@ describe('justifi-business-details', () => {
14
15
  it('sets an error message with invalid props', async () => {
15
16
  const page = await newSpecPage({
16
17
  components: [BusinessDetails],
17
- html: `<justifi-business-details></justifi-business-details>`, // No props provided
18
+ template: () => h("justifi-business-details", null), // No props provided
18
19
  });
19
20
  page.waitForChanges();
20
21
  expect(page.rootInstance.errorMessage).toBe('Invalid business id or auth token');
@@ -22,7 +23,7 @@ describe('justifi-business-details', () => {
22
23
  it('renders the error state when there is an error message', async () => {
23
24
  const page = await newSpecPage({
24
25
  components: [BusinessDetails, BusinessDetailsCore],
25
- html: `<justifi-business-details />`,
26
+ template: () => h("justifi-business-details", null),
26
27
  });
27
28
  await page.waitForChanges();
28
29
  expect(page.rootInstance.errorMessage).toBe('Invalid business id or auth token');
@@ -31,10 +32,25 @@ describe('justifi-business-details', () => {
31
32
  it('renders business-details-core when there is no error message', async () => {
32
33
  const page = await newSpecPage({
33
34
  components: [BusinessDetails, BusinessDetailsCore],
34
- html: `<justifi-business-details business-id="123" auth-token="token" />`,
35
+ template: () => h("justifi-business-details", { "business-id": "123", "auth-token": "token" }),
35
36
  });
36
37
  page.waitForChanges();
37
38
  const core = page.root.shadowRoot.querySelector('business-details-core');
38
39
  expect(core).not.toBeNull();
39
40
  });
41
+ it('emits an error event when there is no auth token', async () => {
42
+ const errorSpy = jest.fn();
43
+ const page = await newSpecPage({
44
+ components: [BusinessDetails],
45
+ template: () => h("justifi-business-details", { "business-id": "123", "onError-event": errorSpy }),
46
+ });
47
+ page.waitForChanges();
48
+ expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
49
+ detail: {
50
+ errorCode: 'missing-props',
51
+ message: 'Invalid business id or auth token',
52
+ severity: 'error',
53
+ }
54
+ }));
55
+ });
40
56
  });
@@ -1,6 +1,7 @@
1
1
  import { makeGetBusiness } from "../get-business";
2
- import mockResponse from "../../../api/mockData/mockBusinessDetails.json";
2
+ import mockResponse from "../../../../../../mockData/mockBusinessDetails.json";
3
3
  import { Business } from "../../../api/Business";
4
+ import { API_NOT_AUTHENTICATED_ERROR } from "../../../api/shared";
4
5
  // Mocks
5
6
  jest.mock('../../../api/services/utils.ts', () => ({
6
7
  getErrorMessage: jest.fn(),
@@ -31,9 +32,7 @@ describe('makeGetBusiness', () => {
31
32
  expect(onError).not.toHaveBeenCalled();
32
33
  });
33
34
  it('calls onError with an error message on fetch error', async () => {
34
- const error = 'Test error';
35
- const responseError = { error };
36
- mockService.fetchBusiness.mockResolvedValue(responseError);
35
+ mockService.fetchBusiness.mockResolvedValue(API_NOT_AUTHENTICATED_ERROR);
37
36
  const onSuccess = jest.fn();
38
37
  const onError = jest.fn();
39
38
  const getBusiness = makeGetBusiness({
@@ -42,7 +41,11 @@ describe('makeGetBusiness', () => {
42
41
  service: mockService,
43
42
  });
44
43
  await getBusiness({ onSuccess, onError });
45
- expect(onError).toHaveBeenCalledWith({ error });
44
+ expect(onError).toHaveBeenCalledWith({
45
+ error: 'Not Authenticated',
46
+ code: 'not-authenticated',
47
+ severity: 'error',
48
+ });
46
49
  });
47
50
  it('calls onError with an error message on fetch exception', async () => {
48
51
  const error = new Error('Network error');
@@ -55,6 +58,10 @@ describe('makeGetBusiness', () => {
55
58
  service: mockService,
56
59
  });
57
60
  await getBusiness({ onSuccess, onError });
58
- expect(onError).toHaveBeenCalledWith({ error: error.message });
61
+ expect(onError).toHaveBeenCalledWith({
62
+ error: error.message,
63
+ code: 'fetch-error',
64
+ severity: 'error',
65
+ });
59
66
  });
60
67
  });
@@ -13,6 +13,52 @@ import { Business } from "../../../api/Business";
13
13
  * @exportedPart input-invalid: Invalid state for inputfs
14
14
  */
15
15
  export class BusinessForm {
16
+ constructor() {
17
+ this.sendData = async () => {
18
+ this.isLoading = true;
19
+ try {
20
+ const values = this.formController.values.getValue();
21
+ const initialValues = this.formController.getInitialValues();
22
+ const payload = parseBusiness(values, initialValues);
23
+ const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
24
+ this.handleReponse(response);
25
+ }
26
+ catch (error) {
27
+ this.errorMessage = BusinessFormServerErrors.patchData;
28
+ }
29
+ finally {
30
+ this.isLoading = false;
31
+ }
32
+ };
33
+ this.fetchData = async () => {
34
+ this.isLoading = true;
35
+ try {
36
+ const response = await this.api.get(this.businessEndpoint);
37
+ const business = new Business(response.data);
38
+ this.formController.setInitialValues(Object.assign({}, business));
39
+ }
40
+ catch (error) {
41
+ this.errorMessage = BusinessFormServerErrors.fetchData;
42
+ }
43
+ finally {
44
+ this.isLoading = false;
45
+ }
46
+ };
47
+ this.validateAndSubmit = (event) => {
48
+ event.preventDefault();
49
+ this.formController.validateAndSubmit(this.sendData);
50
+ };
51
+ this.authToken = undefined;
52
+ this.businessId = undefined;
53
+ this.hideErrors = false;
54
+ this.isLoading = false;
55
+ this.errorMessage = undefined;
56
+ }
57
+ fireClickEvents(event) {
58
+ console.warn('`clickEvent` is deprecated and will be removed in the next major release. Please use `click-event` instead.');
59
+ this.clickEventNew.emit(event);
60
+ this.clickEventOld.emit(event);
61
+ }
16
62
  get disabledState() {
17
63
  return this.isLoading;
18
64
  }
@@ -22,16 +68,6 @@ export class BusinessForm {
22
68
  get businessEndpoint() {
23
69
  return `entities/business/${this.businessId}`;
24
70
  }
25
- constructor() {
26
- this.authToken = undefined;
27
- this.businessId = undefined;
28
- this.hideErrors = false;
29
- this.isLoading = false;
30
- this.errorMessage = undefined;
31
- this.sendData = this.sendData.bind(this);
32
- this.fetchData = this.fetchData.bind(this);
33
- this.validateAndSubmit = this.validateAndSubmit.bind(this);
34
- }
35
71
  componentWillLoad() {
36
72
  const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
37
73
  const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
@@ -43,42 +79,14 @@ export class BusinessForm {
43
79
  this.api = Api(this.authToken, config.proxyApiOrigin);
44
80
  this.fetchData();
45
81
  }
46
- async sendData() {
47
- this.isLoading = true;
48
- try {
49
- const values = this.formController.values.getValue();
50
- const initialValues = this.formController.getInitialValues();
51
- const payload = parseBusiness(values, initialValues);
52
- const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
53
- this.submitted.emit({ data: response });
54
- }
55
- catch (error) {
82
+ handleReponse(response) {
83
+ if (response.error) {
56
84
  this.errorMessage = BusinessFormServerErrors.patchData;
57
85
  }
58
- finally {
59
- this.isLoading = false;
60
- }
61
- }
62
- async fetchData() {
63
- this.isLoading = true;
64
- try {
65
- const response = await this.api.get(this.businessEndpoint);
66
- const business = new Business(response.data);
67
- this.formController.setInitialValues(Object.assign({}, business));
68
- }
69
- catch (error) {
70
- this.errorMessage = BusinessFormServerErrors.fetchData;
71
- }
72
- finally {
73
- this.isLoading = false;
74
- }
75
- }
76
- validateAndSubmit(event) {
77
- event.preventDefault();
78
- this.formController.validateAndSubmit(this.sendData);
86
+ this.submitted.emit({ data: response });
79
87
  }
80
88
  render() {
81
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("div", { class: "row gap-3" }, h("div", { class: "col-12 mb-4" }, h("h1", null, "Business Information")), this.showErrors && FormAlert(this.errorMessage), h("div", { class: "col-12 mb-4" }, h("justifi-business-core-info", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-legal-address-form", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-additional-questions", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-business-representative", { formController: this.formController })), h("div", { class: "col-12 d-flex flex-row-reverse" }, h("button", { type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.clickEvent.emit({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
89
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("div", { class: "row gap-3" }, h("div", { class: "col-12 mb-4" }, h("h1", null, "Business Information")), this.showErrors && FormAlert(this.errorMessage), h("div", { class: "col-12 mb-4" }, h("justifi-business-core-info", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-legal-address-form", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-additional-questions", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-business-representative", { formController: this.formController })), h("div", { class: "col-12 d-flex flex-row-reverse" }, h("button", { type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
82
90
  }
83
91
  static get is() { return "justifi-business-form"; }
84
92
  static get originalStyleUrls() {
@@ -155,8 +163,29 @@ export class BusinessForm {
155
163
  }
156
164
  static get events() {
157
165
  return [{
158
- "method": "clickEvent",
159
- "name": "clickEvent",
166
+ "method": "submitted",
167
+ "name": "submitted",
168
+ "bubbles": true,
169
+ "cancelable": true,
170
+ "composed": true,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": ""
174
+ },
175
+ "complexType": {
176
+ "original": "BusinessFormSubmitEvent",
177
+ "resolved": "BusinessFormSubmitEvent",
178
+ "references": {
179
+ "BusinessFormSubmitEvent": {
180
+ "location": "import",
181
+ "path": "../utils/business-form-types",
182
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
183
+ }
184
+ }
185
+ }
186
+ }, {
187
+ "method": "clickEventNew",
188
+ "name": "click-event",
160
189
  "bubbles": true,
161
190
  "cancelable": true,
162
191
  "composed": true,
@@ -176,8 +205,8 @@ export class BusinessForm {
176
205
  }
177
206
  }
178
207
  }, {
179
- "method": "submitted",
180
- "name": "submitted",
208
+ "method": "clickEventOld",
209
+ "name": "clickEvent",
181
210
  "bubbles": true,
182
211
  "cancelable": true,
183
212
  "composed": true,
@@ -186,13 +215,13 @@ export class BusinessForm {
186
215
  "text": ""
187
216
  },
188
217
  "complexType": {
189
- "original": "BusinessFormSubmitEvent",
190
- "resolved": "BusinessFormSubmitEvent",
218
+ "original": "BusinessFormClickEvent",
219
+ "resolved": "BusinessFormClickEvent",
191
220
  "references": {
192
- "BusinessFormSubmitEvent": {
221
+ "BusinessFormClickEvent": {
193
222
  "location": "import",
194
223
  "path": "../utils/business-form-types",
195
- "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
224
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormClickEvent"
196
225
  }
197
226
  }
198
227
  }
@@ -20,10 +20,7 @@ export class BusinessRepresentative {
20
20
  }
21
21
  render() {
22
22
  const representativeDefaultValue = this.formController.getInitialValues().representative;
23
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "Representative"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-select", { name: "title", label: "Prefix", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, options: [
24
- { label: 'Select Prefix', value: '' },
25
- { label: 'Mrs.', value: 'Mrs.' },
26
- ], error: this.errors.title, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { class: "col-12" }, h("label", { part: "label", class: "form-label" }, "Birth Date")), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_day", label: "Day", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_day, error: this.errors.dob_day, inputHandler: this.inputHandler, type: "day" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_month", label: "Month", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_month, error: this.errors.dob_month, inputHandler: this.inputHandler, type: "month" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_year", label: "Year", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_year, error: this.errors.dob_year, inputHandler: this.inputHandler, type: "year" })), h("div", { class: "col-12" }, h("form-control-number", { name: "identification_number", label: "SSN", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, error: this.errors.identification_number, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("justifi-business-address-form", { errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: values => this.onAddressFormUpdate(values) }))))));
23
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "Representative"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "title", label: "Title", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, error: this.errors.title, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { class: "col-12" }, h("label", { part: "label", class: "form-label" }, "Birth Date")), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_day", label: "Day", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_day, error: this.errors.dob_day, inputHandler: this.inputHandler, type: "day" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_month", label: "Month", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_month, error: this.errors.dob_month, inputHandler: this.inputHandler, type: "month" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_year", label: "Year", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_year, error: this.errors.dob_year, inputHandler: this.inputHandler, type: "year" })), h("div", { class: "col-12" }, h("form-control-number", { name: "identification_number", label: "SSN", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, error: this.errors.identification_number, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("justifi-identity-address-form", { errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate }))))));
27
24
  }
28
25
  static get is() { return "justifi-business-representative"; }
29
26
  static get originalStyleUrls() {
@@ -1,4 +1,6 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import StateOptions from "../../../../utils/state-options";
3
+ import { filterPostalInput } from "../../../form/utils";
2
4
  /**
3
5
  * @exportedPart label: Label for inputs
4
6
  * @exportedPart input: The input fields
@@ -19,9 +21,9 @@ export class LegalAddressForm {
19
21
  this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { legal_address: Object.assign(Object.assign({}, this.formController.values.getValue().legal_address), { [name]: value }) }));
20
22
  }
21
23
  render() {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
23
25
  const legalAddressDefaultValue = this.formController.getInitialValues().legal_address;
24
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "Business Legal Address"), h("hr", null), h("div", { class: "row gx-2 gy-2" }, h("div", { class: "col-12" }, h("form-control-text", { name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, error: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.line1 })), h("div", { class: "col-12" }, h("form-control-text", { name: "line2", label: "Address Line 2", inputHandler: (name, value) => this.inputHandler(name, value), defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2 })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, error: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.legal_address) === null || _d === void 0 ? void 0 : _d.city })), h("div", { class: "col-12" }, h("form-control-text", { name: "state", label: "State", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, error: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.legal_address) === null || _f === void 0 ? void 0 : _f.state })), h("div", { class: "col-12" }, h("form-control-number", { name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, error: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.legal_address) === null || _h === void 0 ? void 0 : _h.postal_code })), h("div", { class: "col-12" }, h("form-control-select", { name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, error: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.legal_address) === null || _k === void 0 ? void 0 : _k.country,
26
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "Business Legal Address"), h("hr", null), h("div", { class: "row gx-2 gy-2" }, h("div", { class: "col-12" }, h("form-control-text", { name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, error: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.line1 })), h("div", { class: "col-12" }, h("form-control-text", { name: "line2", label: "Address Line 2", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, error: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.legal_address) === null || _d === void 0 ? void 0 : _d.line2 })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, error: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.legal_address) === null || _f === void 0 ? void 0 : _f.city })), h("div", { class: "col-12" }, h("form-control-select", { name: "state", label: "State", options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, error: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.legal_address) === null || _h === void 0 ? void 0 : _h.state })), h("div", { class: "col-12" }, h("form-control-text", { name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, error: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.legal_address) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: 5, keyDownHandler: filterPostalInput })), h("div", { class: "col-12" }, h("form-control-select", { name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, error: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.legal_address) === null || _m === void 0 ? void 0 : _m.country,
25
27
  // just for now so we skip handling country specificities
26
28
  disabled: true }))))));
27
29
  }
@@ -1,7 +1,12 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import StateOptions from "../../../../utils/state-options";
3
- export class BusinessAddressForm {
3
+ import { filterPostalInput } from "../../../form/utils";
4
+ export class IdentityAddressForm {
4
5
  constructor() {
6
+ this.inputHandler = (name, value) => {
7
+ this.address[name] = value;
8
+ this.address = Object.assign({}, this.address);
9
+ };
5
10
  this.handleFormUpdate = undefined;
6
11
  this.errors = undefined;
7
12
  this.defaultValues = undefined;
@@ -10,24 +15,22 @@ export class BusinessAddressForm {
10
15
  handleAddressChange(newValues) {
11
16
  this.handleFormUpdate(newValues);
12
17
  }
13
- inputHandler(name, value) {
14
- this.address[name] = value;
15
- this.address = Object.assign({}, this.address);
16
- }
17
18
  render() {
18
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
19
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "line1", label: "Street Address", defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "line2", label: "Apartment, Suite, etc. (optional)", defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, error: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "state", label: "State", defaultValue: (_g = this.defaultValues) === null || _g === void 0 ? void 0 : _g.state, options: StateOptions, error: (_h = this.errors) === null || _h === void 0 ? void 0 : _h.state, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-6" }, h("form-control-number", { name: "postal_code", label: "Postal Code", defaultValue: (_j = this.defaultValues) === null || _j === void 0 ? void 0 : _j.postal_code, error: (_k = this.errors) === null || _k === void 0 ? void 0 : _k.postal_code, inputHandler: (name, value) => this.inputHandler(name, value) })))));
19
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
20
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "line1", label: "Street Address", defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "line2", label: "Apartment, Suite, etc. (optional)", defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, error: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "state", label: "State", defaultValue: (_g = this.defaultValues) === null || _g === void 0 ? void 0 : _g.state, options: StateOptions, error: (_h = this.errors) === null || _h === void 0 ? void 0 : _h.state, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "postal_code", label: "Postal Code", defaultValue: (_j = this.defaultValues) === null || _j === void 0 ? void 0 : _j.postal_code, error: (_k = this.errors) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: 5, keyDownHandler: filterPostalInput, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-select", { name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: (_l = this.defaultValues) === null || _l === void 0 ? void 0 : _l.country, error: (_m = this.errors) === null || _m === void 0 ? void 0 : _m.country,
21
+ // just for now so we skip handling country specificities
22
+ disabled: true })))));
20
23
  }
21
- static get is() { return "justifi-business-address-form"; }
24
+ static get is() { return "justifi-identity-address-form"; }
22
25
  static get encapsulation() { return "shadow"; }
23
26
  static get originalStyleUrls() {
24
27
  return {
25
- "$": ["business-address-form.scss"]
28
+ "$": ["identity-address-form.scss"]
26
29
  };
27
30
  }
28
31
  static get styleUrls() {
29
32
  return {
30
- "$": ["business-address-form.css"]
33
+ "$": ["identity-address-form.css"]
31
34
  };
32
35
  }
33
36
  static get properties() {
@@ -0,0 +1,9 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('justifi-identity-address-form', () => {
3
+ it('renders', async () => {
4
+ const page = await newE2EPage();
5
+ await page.setContent('<justifi-identity-address-form></justifi-identity-address-form>');
6
+ const element = await page.find('justifi-identity-address-form');
7
+ expect(element).toHaveClass('hydrated');
8
+ });
9
+ });