@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
@@ -1,14 +1,14 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { newSpecPage } from "@stencil/core/testing";
3
- import { BusinessAddressForm } from "../business-address-form";
4
- describe('business-address', () => {
5
- it('should render BusinessAddressForm component', async () => {
3
+ import { IdentityAddressForm } from "../identity-address-form";
4
+ describe('identity-address', () => {
5
+ it('should render IdentityAddressForm component', async () => {
6
6
  const page = await newSpecPage({
7
- components: [BusinessAddressForm],
8
- template: () => (h("justifi-business-address-form", null)),
7
+ components: [IdentityAddressForm],
8
+ template: () => (h("justifi-identity-address-form", null)),
9
9
  });
10
10
  expect(page.root).toEqualHtml(`
11
- <justifi-business-address-form exportparts="label,input,input-invalid">
11
+ <justifi-identity-address-form exportparts="label,input,input-invalid">
12
12
  <mock:shadow-root>
13
13
  <div class="row gy-3">
14
14
  <div class="col-12 col-md-8">
@@ -28,14 +28,18 @@ describe('business-address', () => {
28
28
  </div>
29
29
 
30
30
  <div class="col-12 col-md-6">
31
- <form-control-number label="Postal Code" name="postal_code"></form-control-number>
31
+ <form-control-text label="Postal Code" maxlength="5" name="postal_code"></form-control-text>
32
+ </div>
33
+
34
+ <div class="col-12">
35
+ <form-control-select disabled="" label="Country" name="country"></form-control-select>
32
36
  </div>
33
37
  </div>
34
38
  </mock:shadow-root>
35
- </justifi-business-address-form>
39
+ </justifi-identity-address-form>
36
40
  `);
37
41
  });
38
- it('should render BusinessAddressForm component with defaults', async () => {
42
+ it('should render IdentityAddressForm component with defaults', async () => {
39
43
  const businessAddress = {
40
44
  line1: 'Street 1',
41
45
  line2: 'Apartment 1',
@@ -45,11 +49,11 @@ describe('business-address', () => {
45
49
  country: 'Country',
46
50
  };
47
51
  const page = await newSpecPage({
48
- components: [BusinessAddressForm],
49
- template: () => (h("justifi-business-address-form", { defaultValues: businessAddress })),
52
+ components: [IdentityAddressForm],
53
+ template: () => (h("justifi-identity-address-form", { defaultValues: businessAddress })),
50
54
  });
51
55
  expect(page.root).toEqualHtml(`
52
- <justifi-business-address-form exportparts="label,input,input-invalid">
56
+ <justifi-identity-address-form exportparts="label,input,input-invalid">
53
57
  <mock:shadow-root>
54
58
  <div class="gy-3 row">
55
59
  <div class="col-12 col-md-8">
@@ -65,11 +69,14 @@ describe('business-address', () => {
65
69
  <form-control-select defaultValue="State" label="State" name="state"></form-control-select>
66
70
  </div>
67
71
  <div class="col-12 col-md-6">
68
- <form-control-number defaultValue="12345" label="Postal Code" name="postal_code"></form-control-number>
72
+ <form-control-text defaultvalue="12345" label="Postal Code" maxlength="5" name="postal_code"></form-control-text>
73
+ </div>
74
+ <div class="col-12">
75
+ <form-control-select defaultValue="Country" disabled="" label="Country" name="country"></form-control-select>
69
76
  </div>
70
77
  </div>
71
78
  </mock:shadow-root>
72
- </justifi-business-address-form>
79
+ </justifi-identity-address-form>
73
80
  `);
74
81
  });
75
82
  });
@@ -4,14 +4,16 @@ import { PHONE_MASKS } from "../../../utils/form-input-masks";
4
4
  import { Api } from "../../../api";
5
5
  import { Owner } from "../../../api/Identity";
6
6
  import { parseIdentityInfo } from "../utils/payload-parsers";
7
- import { ownerSchema } from "../schemas/business-identity-schema";
7
+ import { identitySchema } from "../schemas/business-identity-schema";
8
8
  import { config } from "../../../../config";
9
9
  import { LoadingSpinner } from "../../form/utils";
10
- import { OwnerFormServerErrors } from "../utils/business-form-types";
10
+ import { OwnerFormServerErrors, OwnerFormClickActions } from "../utils/business-form-types";
11
11
  export class BusinessOwnerForm {
12
12
  constructor() {
13
13
  this.fetchData = async () => {
14
14
  if (!this.ownerId) {
15
+ this.owner = Object.assign({}, new Owner({}));
16
+ this.formController.setInitialValues(this.owner);
15
17
  return;
16
18
  }
17
19
  this.isLoading = true;
@@ -55,6 +57,14 @@ export class BusinessOwnerForm {
55
57
  this.onAddressFormUpdate = (values) => {
56
58
  this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
57
59
  };
60
+ this.handleAddOwner = () => {
61
+ const eventName = this.ownerId ? OwnerFormClickActions.updateOwner : OwnerFormClickActions.addOwner;
62
+ this.clickEvent.emit({ name: eventName });
63
+ };
64
+ this.handleRemoveOwner = () => {
65
+ this.removeOwner(this.ownerId);
66
+ this.clickEvent.emit({ name: OwnerFormClickActions.removeOwner });
67
+ };
58
68
  this.validateAndSubmit = (event) => {
59
69
  event.preventDefault();
60
70
  const isValid = this.formController.validate();
@@ -65,6 +75,7 @@ export class BusinessOwnerForm {
65
75
  this.authToken = undefined;
66
76
  this.ownerId = undefined;
67
77
  this.businessId = undefined;
78
+ this.allowOptionalFields = undefined;
68
79
  this.removeOwner = undefined;
69
80
  this.newFormOpen = undefined;
70
81
  this.ownersLength = undefined;
@@ -114,7 +125,7 @@ export class BusinessOwnerForm {
114
125
  const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
115
126
  if (!this.authToken)
116
127
  console.error(missingAuthTokenMessage);
117
- this.formController = new FormController(ownerSchema);
128
+ this.formController = new FormController(identitySchema('owner', this.allowOptionalFields));
118
129
  this.api = Api(this.authToken, config.proxyApiOrigin);
119
130
  this.fetchData();
120
131
  }
@@ -130,11 +141,8 @@ export class BusinessOwnerForm {
130
141
  }
131
142
  render() {
132
143
  const ownerDefaultValue = this.formController.getInitialValues();
133
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("fieldset", null, h("legend", null, this.formTitle), h("div", { class: 'row gy-3' }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.title, options: [
134
- { label: 'Select Prefix', value: '' },
135
- { label: 'Mrs.', value: 'Mrs.' },
136
- ], 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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: "EIN/SSN", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.address, handleFormUpdate: values => this.onAddressFormUpdate(values) })), h("div", { class: "container d-flex gap-2" }, h("button", { type: "submit", class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}`, disabled: this.isLoading }, this.isLoading ? LoadingSpinner() : this.submitButtonText), this.showRemoveButton &&
137
- h("button", { type: "button", class: "btn btn-danger", onClick: () => this.removeOwner(this.ownerId) }, "Remove owner"))), h("hr", null)))));
144
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("fieldset", null, h("legend", null, this.formTitle), h("div", { class: 'row gy-3' }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: "EIN/SSN", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.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: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate })), h("div", { class: "container d-flex gap-2" }, h("button", { type: "submit", class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}`, onClick: () => this.handleAddOwner(), disabled: this.isLoading }, this.isLoading ? LoadingSpinner() : this.submitButtonText), this.showRemoveButton &&
145
+ h("button", { type: "button", class: "btn btn-danger", onClick: () => this.handleRemoveOwner() }, "Remove owner"))), h("hr", null)))));
138
146
  }
139
147
  static get is() { return "justifi-owner-form"; }
140
148
  static get encapsulation() { return "shadow"; }
@@ -201,6 +209,23 @@ export class BusinessOwnerForm {
201
209
  "attribute": "business-id",
202
210
  "reflect": false
203
211
  },
212
+ "allowOptionalFields": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": true,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": ""
225
+ },
226
+ "attribute": "allow-optional-fields",
227
+ "reflect": false
228
+ },
204
229
  "removeOwner": {
205
230
  "type": "unknown",
206
231
  "mutable": false,
@@ -282,6 +307,27 @@ export class BusinessOwnerForm {
282
307
  }
283
308
  }
284
309
  }
310
+ }, {
311
+ "method": "clickEvent",
312
+ "name": "click-event",
313
+ "bubbles": true,
314
+ "cancelable": true,
315
+ "composed": true,
316
+ "docs": {
317
+ "tags": [],
318
+ "text": ""
319
+ },
320
+ "complexType": {
321
+ "original": "OwnerFormClickEvent",
322
+ "resolved": "OwnerFormClickEvent",
323
+ "references": {
324
+ "OwnerFormClickEvent": {
325
+ "location": "import",
326
+ "path": "../utils/business-form-types",
327
+ "id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
328
+ }
329
+ }
330
+ }
285
331
  }, {
286
332
  "method": "formLoading",
287
333
  "name": "formLoading",
@@ -3,7 +3,7 @@ import { FormController } from "../../../form/form";
3
3
  import { AdditionalQuestions } from "../../../../api/Business";
4
4
  import { Api } from "../../../../api";
5
5
  import { config } from "../../../../../config";
6
- import { additionQuestionsSchema } from "../../schemas/business-additional-questions-schema";
6
+ import { additionalQuestionsSchema } from "../../schemas/business-additional-questions-schema";
7
7
  import { BusinessFormServerErrors } from "../../utils/business-form-types";
8
8
  /**
9
9
  * @exportedPart label: Label for inputs
@@ -45,6 +45,7 @@ export class AdditionalQuestionsFormStep {
45
45
  };
46
46
  this.authToken = undefined;
47
47
  this.businessId = undefined;
48
+ this.allowOptionalFields = undefined;
48
49
  this.formController = undefined;
49
50
  this.errors = {};
50
51
  this.additional_questions = {};
@@ -72,7 +73,7 @@ export class AdditionalQuestionsFormStep {
72
73
  console.error(missingAuthTokenMessage);
73
74
  if (!this.businessId)
74
75
  console.error(missingBusinessIdMessage);
75
- this.formController = new FormController(additionQuestionsSchema);
76
+ this.formController = new FormController(additionalQuestionsSchema(this.allowOptionalFields));
76
77
  this.api = Api(this.authToken, config.proxyApiOrigin);
77
78
  this.fetchData();
78
79
  }
@@ -121,6 +122,23 @@ export class AdditionalQuestionsFormStep {
121
122
  },
122
123
  "attribute": "business-id",
123
124
  "reflect": false
125
+ },
126
+ "allowOptionalFields": {
127
+ "type": "boolean",
128
+ "mutable": false,
129
+ "complexType": {
130
+ "original": "boolean",
131
+ "resolved": "boolean",
132
+ "references": {}
133
+ },
134
+ "required": false,
135
+ "optional": true,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": ""
139
+ },
140
+ "attribute": "allow-optional-fields",
141
+ "reflect": false
124
142
  }
125
143
  };
126
144
  }
@@ -54,6 +54,7 @@ export class BusinessCoreInfoFormStep {
54
54
  };
55
55
  this.authToken = undefined;
56
56
  this.businessId = undefined;
57
+ this.allowOptionalFields = undefined;
57
58
  this.formController = undefined;
58
59
  this.errors = {};
59
60
  this.coreInfo = {};
@@ -81,7 +82,7 @@ export class BusinessCoreInfoFormStep {
81
82
  console.error(missingAuthTokenMessage);
82
83
  if (!this.businessId)
83
84
  console.error(missingBusinessIdMessage);
84
- this.formController = new FormController(businessCoreInfoSchema);
85
+ this.formController = new FormController(businessCoreInfoSchema(this.allowOptionalFields));
85
86
  this.api = Api(this.authToken, config.proxyApiOrigin);
86
87
  this.fetchData();
87
88
  }
@@ -141,6 +142,23 @@ export class BusinessCoreInfoFormStep {
141
142
  },
142
143
  "attribute": "business-id",
143
144
  "reflect": false
145
+ },
146
+ "allowOptionalFields": {
147
+ "type": "boolean",
148
+ "mutable": false,
149
+ "complexType": {
150
+ "original": "boolean",
151
+ "resolved": "boolean",
152
+ "references": {}
153
+ },
154
+ "required": false,
155
+ "optional": true,
156
+ "docs": {
157
+ "tags": [],
158
+ "text": ""
159
+ },
160
+ "attribute": "allow-optional-fields",
161
+ "reflect": false
144
162
  }
145
163
  };
146
164
  }
@@ -1,8 +1,8 @@
1
1
  import { Host, h } from "@stencil/core";
2
- import { BusinessFormServerErrors } from "../../utils/business-form-types";
3
2
  import { Api } from "../../../../api";
4
3
  import { config } from "../../../../../config";
5
4
  import { Owner } from "../../../../api/Identity";
5
+ import { BusinessFormServerErrors, OwnerFormClickActions } from "../../utils/business-form-types";
6
6
  /**
7
7
  * @exportedPart label: Label for inputs
8
8
  * @exportedPart input: The input fields
@@ -55,10 +55,11 @@ export class BusinessOwnersFormStep {
55
55
  this.formLoading.emit(false);
56
56
  }
57
57
  };
58
- this.addOwnerForm = () => {
58
+ this.addOwnerForm = (fireClick) => {
59
59
  this.newFormOpen = true;
60
60
  const newOwner = Object.assign({}, new Owner({}));
61
61
  this.owners = [...this.owners, newOwner];
62
+ fireClick && this.clickEvent.emit({ name: OwnerFormClickActions.addOwnerForm });
62
63
  };
63
64
  this.removeOwnerForm = (id) => {
64
65
  this.owners = this.owners.filter(owner => owner.id !== id);
@@ -78,6 +79,7 @@ export class BusinessOwnersFormStep {
78
79
  };
79
80
  this.authToken = undefined;
80
81
  this.businessId = undefined;
82
+ this.allowOptionalFields = undefined;
81
83
  this.owners = [];
82
84
  this.newFormOpen = undefined;
83
85
  this.refs = [];
@@ -130,9 +132,9 @@ export class BusinessOwnersFormStep {
130
132
  }
131
133
  render() {
132
134
  return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: 'col-12' }, this.owners.map((owner) => {
133
- return (h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.owners.length, onSubmitted: (e) => this.handleOwnerSubmit(e), onFormLoading: (e) => this.formLoading.emit(e.detail), ref: (ref) => { this.matchRef(ref, owner.id); } }));
135
+ return (h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.owners.length, onSubmitted: (e) => this.handleOwnerSubmit(e), onFormLoading: (e) => this.formLoading.emit(e.detail), allowOptionalFields: this.allowOptionalFields, ref: (ref) => { this.matchRef(ref, owner.id); } }));
134
136
  })), this.showAddOwnerButton &&
135
- h("div", { class: 'col-12' }, h("button", { class: 'btn btn-primary', onClick: this.addOwnerForm }, "Add Owner"))));
137
+ h("div", { class: 'col-12' }, h("button", { class: 'btn btn-primary', onClick: () => this.addOwnerForm(true) }, "Add Owner"))));
136
138
  }
137
139
  static get is() { return "justifi-business-owners-form-step"; }
138
140
  static get originalStyleUrls() {
@@ -180,6 +182,23 @@ export class BusinessOwnersFormStep {
180
182
  },
181
183
  "attribute": "business-id",
182
184
  "reflect": false
185
+ },
186
+ "allowOptionalFields": {
187
+ "type": "boolean",
188
+ "mutable": false,
189
+ "complexType": {
190
+ "original": "boolean",
191
+ "resolved": "boolean",
192
+ "references": {}
193
+ },
194
+ "required": false,
195
+ "optional": true,
196
+ "docs": {
197
+ "tags": [],
198
+ "text": ""
199
+ },
200
+ "attribute": "allow-optional-fields",
201
+ "reflect": false
183
202
  }
184
203
  };
185
204
  }
@@ -212,6 +231,27 @@ export class BusinessOwnersFormStep {
212
231
  }
213
232
  }
214
233
  }
234
+ }, {
235
+ "method": "clickEvent",
236
+ "name": "click-event",
237
+ "bubbles": true,
238
+ "cancelable": true,
239
+ "composed": true,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": ""
243
+ },
244
+ "complexType": {
245
+ "original": "OwnerFormClickEvent",
246
+ "resolved": "OwnerFormClickEvent",
247
+ "references": {
248
+ "OwnerFormClickEvent": {
249
+ "location": "import",
250
+ "path": "../../utils/business-form-types",
251
+ "id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
252
+ }
253
+ }
254
+ }
215
255
  }, {
216
256
  "method": "formLoading",
217
257
  "name": "formLoading",
@@ -3,7 +3,7 @@ import { FormController } from "../../../form/form";
3
3
  import { PHONE_MASKS } from "../../../../utils/form-input-masks";
4
4
  import Api from "../../../../api/Api";
5
5
  import { parseIdentityInfo } from "../../utils/payload-parsers";
6
- import { representativeSchema } from "../../schemas/business-identity-schema";
6
+ import { identitySchema } from "../../schemas/business-identity-schema";
7
7
  import { config } from "../../../../../config";
8
8
  import { BusinessFormServerErrors } from "../../utils/business-form-types";
9
9
  import { Representative } from "../../../../api/Identity";
@@ -45,6 +45,7 @@ export class BusinessRepresentativeFormStep {
45
45
  };
46
46
  this.authToken = undefined;
47
47
  this.businessId = undefined;
48
+ this.allowOptionalFields = undefined;
48
49
  this.formController = undefined;
49
50
  this.errors = {};
50
51
  this.representative = {};
@@ -72,7 +73,7 @@ export class BusinessRepresentativeFormStep {
72
73
  console.error(missingAuthTokenMessage);
73
74
  if (!this.businessId)
74
75
  console.error(missingBusinessIdMessage);
75
- this.formController = new FormController(representativeSchema);
76
+ this.formController = new FormController(identitySchema('representative', this.allowOptionalFields));
76
77
  this.api = Api(this.authToken, config.proxyApiOrigin);
77
78
  this.fetchData();
78
79
  }
@@ -82,10 +83,7 @@ export class BusinessRepresentativeFormStep {
82
83
  }
83
84
  render() {
84
85
  const representativeDefaultValue = this.formController.getInitialValues();
85
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, 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: [
86
- { label: 'Select Prefix', value: '' },
87
- { label: 'Mrs.', value: 'Mrs.' },
88
- ], 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: "EIN/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) })))))));
86
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, 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: "EIN/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 })))))));
89
87
  }
90
88
  static get is() { return "justifi-business-representative-form-step"; }
91
89
  static get originalStyleUrls() {
@@ -133,6 +131,23 @@ export class BusinessRepresentativeFormStep {
133
131
  },
134
132
  "attribute": "business-id",
135
133
  "reflect": false
134
+ },
135
+ "allowOptionalFields": {
136
+ "type": "boolean",
137
+ "mutable": false,
138
+ "complexType": {
139
+ "original": "boolean",
140
+ "resolved": "boolean",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": true,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": ""
148
+ },
149
+ "attribute": "allow-optional-fields",
150
+ "reflect": false
136
151
  }
137
152
  };
138
153
  }
@@ -3,10 +3,11 @@ import { FormController } from "../../../form/form";
3
3
  import Api from "../../../../api/Api";
4
4
  import { Address } from "../../../../api/Business";
5
5
  import { parseAddressInfo } from "../../utils/payload-parsers";
6
- import { legalAddressSchema } from "../../schemas/business-address-schema";
6
+ import { addressSchema } from "../../schemas/business-address-schema";
7
7
  import { config } from "../../../../../config";
8
8
  import { BusinessFormServerErrors } from "../../utils/business-form-types";
9
9
  import StateOptions from "../../../../utils/state-options";
10
+ import { filterPostalInput } from "../../../form/utils";
10
11
  /**
11
12
  * @exportedPart label: Label for inputs
12
13
  * @exportedPart input: The input fields
@@ -47,6 +48,7 @@ export class LegalAddressFormStep {
47
48
  };
48
49
  this.authToken = undefined;
49
50
  this.businessId = undefined;
51
+ this.allowOptionalFields = undefined;
50
52
  this.formController = undefined;
51
53
  this.errors = {};
52
54
  this.legal_address = {};
@@ -74,7 +76,7 @@ export class LegalAddressFormStep {
74
76
  console.error(missingAuthTokenMessage);
75
77
  if (!this.businessId)
76
78
  console.error(missingBusinessIdMessage);
77
- this.formController = new FormController(legalAddressSchema);
79
+ this.formController = new FormController(addressSchema(this.allowOptionalFields));
78
80
  this.api = Api(this.authToken, config.proxyApiOrigin);
79
81
  this.fetchData();
80
82
  }
@@ -83,9 +85,9 @@ export class LegalAddressFormStep {
83
85
  this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
84
86
  }
85
87
  render() {
86
- var _a, _b, _c, _d, _e;
88
+ var _a, _b, _c, _d, _e, _f;
87
89
  const legalAddressDefaultValue = this.formController.getInitialValues();
88
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, 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: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.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: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.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: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.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: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.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: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.country,
90
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, 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: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.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: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.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: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.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: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.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: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.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: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.country,
89
91
  // just for now so we skip handling country specificities
90
92
  disabled: true })))))));
91
93
  }
@@ -135,6 +137,23 @@ export class LegalAddressFormStep {
135
137
  },
136
138
  "attribute": "business-id",
137
139
  "reflect": false
140
+ },
141
+ "allowOptionalFields": {
142
+ "type": "boolean",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "boolean",
146
+ "resolved": "boolean",
147
+ "references": {}
148
+ },
149
+ "required": false,
150
+ "optional": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": ""
154
+ },
155
+ "attribute": "allow-optional-fields",
156
+ "reflect": false
138
157
  }
139
158
  };
140
159
  }
@@ -10,11 +10,17 @@ export class PaymentProvisioning {
10
10
  constructor() {
11
11
  this.refs = [];
12
12
  this.componentStepMapping = {
13
- 0: () => h("justifi-business-core-info-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[0] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
14
- 1: () => h("justifi-legal-address-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[1] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
15
- 2: () => h("justifi-additional-questions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[2] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
16
- 3: () => h("justifi-business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
17
- 4: () => h("justifi-business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
13
+ 0: () => h("justifi-business-core-info-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[0] = el, onFormLoading: this.handleFormLoading, onServerError: this.handleServerErrors, allowOptionalFields: this.allowOptionalFields }),
14
+ 1: () => h("justifi-legal-address-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[1] = el, onFormLoading: this.handleFormLoading, onServerError: this.handleServerErrors, allowOptionalFields: this.allowOptionalFields }),
15
+ 2: () => h("justifi-additional-questions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[2] = el, onFormLoading: this.handleFormLoading, onServerError: this.handleServerErrors, allowOptionalFields: this.allowOptionalFields }),
16
+ 3: () => h("justifi-business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el, onFormLoading: this.handleFormLoading, onServerError: this.handleServerErrors, allowOptionalFields: this.allowOptionalFields }),
17
+ 4: () => h("justifi-business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el, onFormLoading: this.handleFormLoading, onServerError: this.handleServerErrors, allowOptionalFields: this.allowOptionalFields }),
18
+ };
19
+ this.handleFormLoading = (e) => {
20
+ this.formLoading = e.detail;
21
+ };
22
+ this.handleServerErrors = (e) => {
23
+ this.errorMessage = e.detail.message;
18
24
  };
19
25
  this.incrementSteps = () => {
20
26
  if (this.currentStep < this.totalSteps) {
@@ -26,6 +32,7 @@ export class PaymentProvisioning {
26
32
  this.businessId = undefined;
27
33
  this.testMode = false;
28
34
  this.hideErrors = false;
35
+ this.allowOptionalFields = false;
29
36
  this.formLoading = false;
30
37
  this.errorMessage = '';
31
38
  this.currentStep = 0;
@@ -47,12 +54,6 @@ export class PaymentProvisioning {
47
54
  this.refs = [this.coreInfoRef, this.legalAddressRef, this.additionalQuestionsRef, this.representativeRef, this.ownersRef];
48
55
  this.totalSteps = Object.keys(this.componentStepMapping).length - 1;
49
56
  }
50
- handleFormLoading(e) {
51
- this.formLoading = e.detail;
52
- }
53
- handleServerErrors(e) {
54
- this.errorMessage = e.detail.message;
55
- }
56
57
  showPreviousStepButton() {
57
58
  return this.currentStep > 0;
58
59
  }
@@ -61,8 +62,7 @@ export class PaymentProvisioning {
61
62
  }
62
63
  previousStepButtonOnClick() {
63
64
  this.clickEvent.emit({ name: BusinessFormClickActions.previousStep });
64
- const currentStep = this.refs[this.currentStep];
65
- currentStep.validateAndSubmit({ onSuccess: this.decrementSteps });
65
+ this.decrementSteps();
66
66
  }
67
67
  nextStepButtonOnClick(e, clickEventName) {
68
68
  e.preventDefault();
@@ -161,6 +161,24 @@ export class PaymentProvisioning {
161
161
  "attribute": "hide-errors",
162
162
  "reflect": false,
163
163
  "defaultValue": "false"
164
+ },
165
+ "allowOptionalFields": {
166
+ "type": "boolean",
167
+ "mutable": false,
168
+ "complexType": {
169
+ "original": "boolean",
170
+ "resolved": "boolean",
171
+ "references": {}
172
+ },
173
+ "required": false,
174
+ "optional": true,
175
+ "docs": {
176
+ "tags": [],
177
+ "text": ""
178
+ },
179
+ "attribute": "allow-optional-fields",
180
+ "reflect": false,
181
+ "defaultValue": "false"
164
182
  }
165
183
  };
166
184
  }
@@ -175,7 +193,7 @@ export class PaymentProvisioning {
175
193
  static get events() {
176
194
  return [{
177
195
  "method": "clickEvent",
178
- "name": "clickEvent",
196
+ "name": "click-event",
179
197
  "bubbles": true,
180
198
  "cancelable": true,
181
199
  "composed": true,