@justifi/webcomponents 4.9.0 → 4.10.0-rc.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 (334) hide show
  1. package/dist/cjs/{Business-64dffab7.js → Business-79361c8a.js} +1 -0
  2. package/dist/cjs/Identity-b6364aee.js +27 -0
  3. package/dist/cjs/{SubAccount-f8144025.js → SubAccount-b3902202.js} +1 -1
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +3 -3
  5. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
  6. package/dist/cjs/business-details-core.cjs.entry.js +2 -2
  7. package/dist/cjs/business-form-select-options-7ccd8dca.js +85 -0
  8. package/dist/cjs/business-form-types-3cdd5447.js +19 -0
  9. package/dist/cjs/form-control-datepart_3.cjs.entry.js +32 -46
  10. package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
  11. package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +44 -1
  12. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +3 -3
  13. package/dist/cjs/{index-07ddbad2.js → index-69b9386b.js} +57 -0
  14. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +505 -0
  15. package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +12 -42
  16. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  17. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +5 -13
  18. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
  19. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
  20. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +36 -90
  21. package/dist/cjs/justifi-business-form.cjs.entry.js +16 -15
  22. package/dist/cjs/justifi-business-list.cjs.entry.js +3 -3
  23. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  24. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  25. package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-details.cjs.entry.js +2 -2
  28. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  29. package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +1 -1
  30. package/dist/cjs/justifi-owner-form.cjs.entry.js +160 -0
  31. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +1 -1
  35. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  36. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  37. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  38. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
  40. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +4 -4
  41. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +3 -3
  42. package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
  43. package/dist/cjs/loader.cjs.js +2 -2
  44. package/dist/cjs/payload-parsers-25ed3936.js +98 -0
  45. package/dist/cjs/payment-details-core.cjs.entry.js +3 -3
  46. package/dist/cjs/payments-list-core.cjs.entry.js +2 -2
  47. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  48. package/dist/cjs/payouts-list-core.cjs.entry.js +2 -2
  49. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +3 -3
  50. package/dist/cjs/subaccount-bank-details.cjs.entry.js +2 -2
  51. package/dist/cjs/subaccount-terms-details.cjs.entry.js +2 -2
  52. package/dist/cjs/{utils-5c3e442d.js → utils-23e70ef2.js} +1 -1
  53. package/dist/cjs/{utils-84208d99.js → utils-6f62f7a1.js} +18 -0
  54. package/dist/cjs/utils-df5167a8.js +13 -0
  55. package/dist/cjs/webcomponents.cjs.js +2 -2
  56. package/dist/collection/api/Identity.js +43 -0
  57. package/dist/collection/collection-manifest.json +15 -8
  58. package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
  59. package/dist/collection/components/business-details/owner-details/owner-details.js +2 -2
  60. package/dist/collection/components/business-details/representative-details/representative-details.js +2 -2
  61. package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
  62. package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +2536 -0
  63. package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.js +4 -4
  64. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.css +2493 -0
  65. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +77 -0
  66. package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
  67. package/dist/collection/components/business-forms/business-form/business-owners/business-owners.css +7779 -0
  68. package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
  69. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.css +2493 -0
  70. package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
  71. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.css +2493 -0
  72. package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.js +1 -1
  73. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.js +218 -0
  74. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
  75. package/dist/collection/components/business-forms/business-form-stepped/business-address/business-address-form-step.js +97 -0
  76. package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +97 -0
  77. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.js +239 -0
  78. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/test/business-core-info-form-step.spec.js +97 -0
  79. package/dist/collection/components/{business-form → business-forms/business-form-stepped}/business-form-stepped.css +105 -0
  80. package/dist/collection/components/business-forms/business-form-stepped/business-form-stepped.js +199 -0
  81. package/dist/collection/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.js +284 -0
  82. package/dist/collection/components/business-forms/business-form-stepped/business-owners/test/business-owners-form-step.spec.js +97 -0
  83. package/dist/collection/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.js +230 -0
  84. package/dist/collection/components/business-forms/business-form-stepped/business-representative/test/business-representative-form-step.spec.js +97 -0
  85. package/dist/collection/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.js +232 -0
  86. package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +61 -0
  87. package/dist/collection/components/business-forms/owner-form/owner-form.css +7779 -0
  88. package/dist/collection/components/business-forms/owner-form/owner-form.js +367 -0
  89. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +7 -0
  90. package/dist/collection/components/business-forms/schemas/business-address-schema.js +15 -0
  91. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +13 -0
  92. package/dist/collection/components/business-forms/schemas/business-form-schema.js +6 -0
  93. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +35 -0
  94. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +16 -0
  95. package/dist/collection/components/business-forms/utils/business-form-select-options.js +80 -0
  96. package/dist/collection/components/business-forms/utils/business-form-types.js +17 -0
  97. package/dist/collection/components/business-forms/utils/payload-parsers.js +37 -0
  98. package/dist/collection/components/form/utils.js +1 -0
  99. package/dist/collection/utils/utils.js +16 -0
  100. package/dist/docs.json +1690 -300
  101. package/dist/esm/{Business-9921d35f.js → Business-1df362e0.js} +1 -1
  102. package/dist/esm/Identity-774788c0.js +25 -0
  103. package/dist/esm/{SubAccount-76f6d565.js → SubAccount-f4ae9809.js} +1 -1
  104. package/dist/esm/additional-questions-details_5.entry.js +3 -3
  105. package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
  106. package/dist/esm/business-details-core.entry.js +2 -2
  107. package/dist/esm/business-form-select-options-6b9293fe.js +82 -0
  108. package/dist/esm/business-form-types-de9f38cd.js +19 -0
  109. package/dist/esm/form-control-datepart_3.entry.js +32 -46
  110. package/dist/esm/form-control-monetary.entry.js +1 -1
  111. package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +44 -2
  112. package/dist/esm/gross-payment-chart-core.entry.js +3 -3
  113. package/dist/esm/{index-fb5ca346.js → index-df86d9a2.js} +57 -0
  114. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +497 -0
  115. package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +12 -41
  116. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  117. package/dist/esm/justifi-billing-form_4.entry.js +4 -12
  118. package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
  119. package/dist/esm/justifi-business-details.entry.js +3 -3
  120. package/dist/esm/justifi-business-form-stepped.entry.js +36 -90
  121. package/dist/esm/justifi-business-form.entry.js +15 -14
  122. package/dist/esm/justifi-business-list.entry.js +3 -3
  123. package/dist/esm/justifi-business-owners.entry.js +1 -1
  124. package/dist/esm/justifi-card-form.entry.js +1 -1
  125. package/dist/esm/justifi-checkout-core.entry.js +2 -2
  126. package/dist/esm/justifi-checkout.entry.js +1 -1
  127. package/dist/esm/justifi-details.entry.js +2 -2
  128. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  129. package/dist/esm/justifi-new-payment-method_3.entry.js +1 -1
  130. package/dist/esm/justifi-owner-form.entry.js +156 -0
  131. package/dist/esm/justifi-payment-balance-transactions.entry.js +2 -2
  132. package/dist/esm/justifi-payment-details.entry.js +2 -2
  133. package/dist/esm/justifi-payment-form.entry.js +2 -2
  134. package/dist/esm/justifi-payment-method-selector.entry.js +1 -1
  135. package/dist/esm/justifi-payments-list.entry.js +2 -2
  136. package/dist/esm/justifi-payout-details.entry.js +2 -2
  137. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  138. package/dist/esm/justifi-proceeds-list.entry.js +2 -2
  139. package/dist/esm/justifi-refund-form.entry.js +1 -1
  140. package/dist/esm/justifi-subaccount-details.entry.js +4 -4
  141. package/dist/esm/justifi-subaccounts-list.entry.js +3 -3
  142. package/dist/esm/justifi-table_2.entry.js +1 -1
  143. package/dist/esm/loader.js +3 -3
  144. package/dist/esm/payload-parsers-1dd7474f.js +90 -0
  145. package/dist/esm/payment-details-core.entry.js +3 -3
  146. package/dist/esm/payments-list-core.entry.js +2 -2
  147. package/dist/esm/payout-details-core.entry.js +3 -3
  148. package/dist/esm/payouts-list-core.entry.js +2 -2
  149. package/dist/esm/subaccount-account-details_4.entry.js +3 -3
  150. package/dist/esm/subaccount-bank-details.entry.js +2 -2
  151. package/dist/esm/subaccount-terms-details.entry.js +2 -2
  152. package/dist/esm/{utils-5193fcd7.js → utils-243abdb4.js} +17 -1
  153. package/dist/esm/utils-2828201a.js +10 -0
  154. package/dist/esm/{utils-a3e96d9f.js → utils-d01c5f3a.js} +1 -1
  155. package/dist/esm/webcomponents.js +3 -3
  156. package/dist/module/Business.js +1 -1
  157. package/dist/module/SubAccount.js +1 -1
  158. package/dist/module/billing-form.js +1 -1
  159. package/dist/module/business-additional-questions-form-step.js +120 -0
  160. package/dist/module/business-additional-questions-schema.js +10 -0
  161. package/dist/module/business-address-form.js +3 -3
  162. package/dist/module/business-address-schema.js +18 -0
  163. package/dist/module/business-core-info-form-step.js +141 -0
  164. package/dist/module/business-core-info-schema.js +16 -0
  165. package/dist/module/business-core-info.js +69 -0
  166. package/dist/module/business-form-select-options.js +82 -0
  167. package/dist/module/business-form-types.js +19 -0
  168. package/dist/module/business-identity-schema.js +38 -0
  169. package/dist/{webcomponents/p-3bae0ed3.entry.js → module/business-owners-form-step.js} +213 -1
  170. package/dist/module/business-representative-form-step.js +157 -0
  171. package/dist/module/business-representative.js +1 -1
  172. package/dist/module/checkout-core.js +1 -1
  173. package/dist/module/justifi-additional-questions-form-step.d.ts +11 -0
  174. package/dist/module/justifi-additional-questions-form-step.js +6 -0
  175. package/dist/module/justifi-business-address-form-step.d.ts +11 -0
  176. package/dist/module/justifi-business-address-form-step.js +75 -0
  177. package/dist/module/justifi-business-core-info-form-step.d.ts +11 -0
  178. package/dist/module/justifi-business-core-info-form-step.js +6 -0
  179. package/dist/module/justifi-business-core-info.d.ts +11 -0
  180. package/dist/module/justifi-business-core-info.js +6 -0
  181. package/dist/module/justifi-business-form-stepped.js +72 -113
  182. package/dist/module/justifi-business-form.js +19 -14
  183. package/dist/module/justifi-business-list.js +1 -1
  184. package/dist/module/justifi-business-owners-form-step.d.ts +11 -0
  185. package/dist/module/justifi-business-owners-form-step.js +6 -0
  186. package/dist/module/justifi-business-representative-form-step.d.ts +11 -0
  187. package/dist/module/justifi-business-representative-form-step.js +6 -0
  188. package/dist/module/justifi-legal-address-form-step.d.ts +11 -0
  189. package/dist/module/justifi-legal-address-form-step.js +6 -0
  190. package/dist/module/justifi-owner-form.d.ts +11 -0
  191. package/dist/module/justifi-owner-form.js +6 -0
  192. package/dist/module/justifi-payment-balance-transactions.js +1 -1
  193. package/dist/module/justifi-proceeds-list.js +1 -1
  194. package/dist/module/justifi-subaccount-details.js +1 -1
  195. package/dist/module/justifi-subaccounts-list.js +1 -1
  196. package/dist/module/legal-address-form-step.js +136 -0
  197. package/dist/module/owner-form.js +244 -0
  198. package/dist/module/payload-parsers.js +39 -0
  199. package/dist/module/payment-details-core2.js +1 -1
  200. package/dist/module/payment-method-form.js +2 -9
  201. package/dist/module/payments-list-core2.js +1 -1
  202. package/dist/module/payout-details-core2.js +1 -1
  203. package/dist/module/payouts-list-core2.js +1 -1
  204. package/dist/module/subaccount-merchant-details2.js +1 -1
  205. package/dist/module/utils2.js +17 -1
  206. package/dist/module/utils4.js +10 -0
  207. package/dist/types/api/Business.d.ts +1 -18
  208. package/dist/types/api/Identity.d.ts +60 -0
  209. package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
  210. package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -1
  211. package/dist/types/components/business-details/representative-details/representative-details.d.ts +1 -1
  212. package/dist/types/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.d.ts +1 -1
  213. package/dist/types/components/{business-form → business-forms/business-form}/business-address/business-address-form.d.ts +1 -1
  214. package/dist/types/components/{business-form/business-generic-info/business-generic-info.d.ts → business-forms/business-form/business-core-info/business-core-info.d.ts} +5 -5
  215. package/dist/types/components/{business-form → business-forms/business-form}/business-form.d.ts +5 -10
  216. package/dist/types/components/{business-form → business-forms/business-form}/business-owners/business-owners.d.ts +1 -1
  217. package/dist/types/components/{business-form → business-forms/business-form}/business-representative/business-representative.d.ts +1 -1
  218. package/dist/types/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.d.ts +2 -2
  219. package/dist/types/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.d.ts +30 -0
  220. package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +9 -0
  221. package/dist/types/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.d.ts +36 -0
  222. package/dist/types/components/business-forms/business-form-stepped/business-form-stepped.d.ts +45 -0
  223. package/dist/types/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.d.ts +36 -0
  224. package/dist/types/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.d.ts +26 -0
  225. package/dist/types/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.d.ts +31 -0
  226. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +36 -0
  227. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +11 -0
  228. package/dist/types/components/{business-form/business-address/business-address-form-schema.d.ts → business-forms/schemas/business-address-schema.d.ts} +11 -8
  229. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +19 -0
  230. package/dist/types/components/{business-form → business-forms/schemas}/business-form-schema.d.ts +2 -26
  231. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +59 -0
  232. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +33 -0
  233. package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +11 -0
  234. package/dist/types/components/business-forms/utils/business-form-types.d.ts +39 -0
  235. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +4 -0
  236. package/dist/types/components/form/form.d.ts +1 -1
  237. package/dist/types/components/form/utils.d.ts +1 -0
  238. package/dist/types/components.d.ts +409 -59
  239. package/dist/types/utils/utils.d.ts +2 -0
  240. package/dist/webcomponents/p-0399f02b.entry.js +1 -0
  241. package/dist/webcomponents/{p-4edd9721.js → p-04a98c63.js} +1 -1
  242. package/dist/webcomponents/p-06888c2e.entry.js +1 -0
  243. package/dist/webcomponents/{p-adc96df1.entry.js → p-07b326d0.entry.js} +1 -1
  244. package/dist/webcomponents/p-0811bc77.entry.js +1 -0
  245. package/dist/webcomponents/p-17d72f4a.js +1 -0
  246. package/dist/webcomponents/{p-babd292f.entry.js → p-17f64853.entry.js} +1 -1
  247. package/dist/webcomponents/{p-97c42345.entry.js → p-1bfadb9f.entry.js} +1 -1
  248. package/dist/webcomponents/p-22085999.entry.js +1 -0
  249. package/dist/webcomponents/{p-531844f6.entry.js → p-252835df.entry.js} +1 -1
  250. package/dist/webcomponents/{p-34f9fe6b.js → p-28b38699.js} +1 -1
  251. package/dist/webcomponents/{p-baafa7f5.js → p-34352d04.js} +1 -1
  252. package/dist/webcomponents/{p-79f99d62.entry.js → p-374c44e6.entry.js} +1 -1
  253. package/dist/webcomponents/{p-1bac1674.entry.js → p-4697ccfa.entry.js} +1 -1
  254. package/dist/webcomponents/p-4781cd06.js +1 -0
  255. package/dist/webcomponents/{p-dc05b5c5.entry.js → p-4d50d08a.entry.js} +1 -1
  256. package/dist/webcomponents/p-4d806131.entry.js +1 -0
  257. package/dist/webcomponents/{p-09b94d22.entry.js → p-4df6174c.entry.js} +1 -1
  258. package/dist/webcomponents/p-4e0b3206.entry.js +1 -0
  259. package/dist/webcomponents/p-583dd5a2.entry.js +1 -0
  260. package/dist/webcomponents/{p-c032b216.entry.js → p-5be4e217.entry.js} +1 -1
  261. package/dist/webcomponents/{p-018b71f5.entry.js → p-5da4fbe7.entry.js} +1 -1
  262. package/dist/webcomponents/{p-796cf44f.entry.js → p-6103c20d.entry.js} +1 -1
  263. package/dist/webcomponents/{p-bb037696.js → p-65510838.js} +1 -1
  264. package/dist/webcomponents/p-688bb5da.js +2 -0
  265. package/dist/webcomponents/{p-92a55427.entry.js → p-6b51cf97.entry.js} +1 -1
  266. package/dist/webcomponents/{p-72d1ad98.entry.js → p-7654c70d.entry.js} +1 -1
  267. package/dist/webcomponents/{p-f64a85cf.entry.js → p-847441ce.entry.js} +1 -1
  268. package/dist/webcomponents/p-861ba3fc.entry.js +1 -0
  269. package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
  270. package/dist/webcomponents/p-975ab96e.js +1 -0
  271. package/dist/webcomponents/p-9ce8d98c.entry.js +1 -0
  272. package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
  273. package/dist/webcomponents/p-a141c531.js +1 -0
  274. package/dist/webcomponents/{p-e536a4c1.entry.js → p-a2dbe90f.entry.js} +1 -1
  275. package/dist/webcomponents/{p-591e29bf.entry.js → p-a46174e0.entry.js} +1 -1
  276. package/dist/webcomponents/{p-c8d51336.entry.js → p-a98eea84.entry.js} +1 -1
  277. package/dist/webcomponents/{p-bb7f6095.entry.js → p-b1bc23af.entry.js} +1 -1
  278. package/dist/webcomponents/{p-ec358d69.entry.js → p-b27c9b0d.entry.js} +1 -1
  279. package/dist/webcomponents/{p-7cd06ada.entry.js → p-b68f1dd9.entry.js} +1 -1
  280. package/dist/webcomponents/p-b8f22856.js +1 -0
  281. package/dist/webcomponents/{p-1cbdca15.entry.js → p-c8d62072.entry.js} +1 -1
  282. package/dist/webcomponents/{p-c2c3d5d1.entry.js → p-da34bba7.entry.js} +1 -1
  283. package/dist/webcomponents/{p-3134ab82.entry.js → p-e3748ea4.entry.js} +1 -1
  284. package/dist/webcomponents/{p-99a8b7d0.entry.js → p-e924f2e1.entry.js} +1 -1
  285. package/dist/webcomponents/{p-9c310f5c.entry.js → p-ebf7c70f.entry.js} +1 -1
  286. package/dist/webcomponents/{p-41031759.entry.js → p-eef5ed19.entry.js} +1 -1
  287. package/dist/webcomponents/{p-8f895ec3.entry.js → p-efc7025c.entry.js} +1 -1
  288. package/dist/webcomponents/p-f3453ca2.js +1 -0
  289. package/dist/webcomponents/{p-f55ac955.entry.js → p-f3ca6fda.entry.js} +1 -1
  290. package/dist/webcomponents/{p-9a63eec9.entry.js → p-fb49ef28.entry.js} +1 -1
  291. package/dist/webcomponents/{p-9e3771b7.entry.js → p-fe2af0cf.entry.js} +1 -1
  292. package/dist/webcomponents/{p-41490d96.entry.js → p-fe8a94c1.entry.js} +1 -1
  293. package/dist/webcomponents/webcomponents.esm.js +1 -1
  294. package/package.json +1 -1
  295. package/dist/cjs/BusinessFormEventTypes-62990815.js +0 -42
  296. package/dist/cjs/business-form-schema-37e5381d.js +0 -148
  297. package/dist/collection/components/business-form/BusinessFormEventTypes.js +0 -6
  298. package/dist/collection/components/business-form/business-address/business-address-form-schema.js +0 -13
  299. package/dist/collection/components/business-form/business-form-schema.js +0 -159
  300. package/dist/collection/components/business-form/business-form-stepped.js +0 -260
  301. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +0 -77
  302. package/dist/collection/components/business-form/business-representative/business-representative-schema.js +0 -1
  303. package/dist/collection/components/business-form/helpers.js +0 -23
  304. package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +0 -10
  305. package/dist/esm/BusinessFormEventTypes-182e20be.js +0 -39
  306. package/dist/esm/business-form-schema-f8f554d1.js +0 -144
  307. package/dist/module/BusinessFormEventTypes.js +0 -39
  308. package/dist/module/business-generic-info.js +0 -210
  309. package/dist/module/justifi-business-generic-info.d.ts +0 -11
  310. package/dist/module/justifi-business-generic-info.js +0 -6
  311. package/dist/types/components/business-form/BusinessFormEventTypes.d.ts +0 -5
  312. package/dist/types/components/business-form/business-form-stepped.d.ts +0 -48
  313. package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +0 -17
  314. package/dist/types/components/business-form/helpers.d.ts +0 -1
  315. package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +0 -17
  316. package/dist/webcomponents/p-1b04d091.entry.js +0 -1
  317. package/dist/webcomponents/p-44b88365.entry.js +0 -1
  318. package/dist/webcomponents/p-4ed3a9f5.entry.js +0 -1
  319. package/dist/webcomponents/p-51b0bf2a.entry.js +0 -1
  320. package/dist/webcomponents/p-5d5d7550.entry.js +0 -1
  321. package/dist/webcomponents/p-5ea274b8.js +0 -1
  322. package/dist/webcomponents/p-5f785ede.entry.js +0 -1
  323. package/dist/webcomponents/p-6d05174c.js +0 -2
  324. package/dist/webcomponents/p-a81229a5.entry.js +0 -1
  325. package/dist/webcomponents/p-b8a8b551.js +0 -1
  326. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.e2e.js +0 -0
  327. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.spec.js +0 -0
  328. /package/dist/collection/components/{business-form → business-forms/business-form}/business-form.css +0 -0
  329. /package/dist/collection/components/{business-form → business-forms/business-form}/test/business-form.spec.js +0 -0
  330. /package/dist/collection/components/{business-form/business-address/business-address-form.css → business-forms/business-form-stepped/business-address/business-address-form-step.css} +0 -0
  331. /package/dist/collection/components/{business-form/business-generic-info/business-generic-info.css → business-forms/business-form-stepped/business-core-info/business-core-info-form-step.css} +0 -0
  332. /package/dist/collection/components/{business-form/business-owners/business-owners.css → business-forms/business-form-stepped/business-owners/business-owners-form-step.css} +0 -0
  333. /package/dist/collection/components/{business-form/business-representative/business-representative.css → business-forms/business-form-stepped/business-representative/business-representative-form-step.css} +0 -0
  334. /package/dist/collection/components/{business-form/legal-address-form/legal-address-form.css → business-forms/business-form-stepped/legal-address-form/legal-address-form-step.css} +0 -0
@@ -0,0 +1,239 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { BusinessTypeOptions, BusinessStructureOptions } from "../../utils/business-form-select-options";
3
+ import { FormController } from "../../../form/form";
4
+ import { PHONE_MASKS, TAX_ID_MASKS } from "../../../../utils/form-input-masks";
5
+ import { CoreBusinessInfo } from "../../../../api/Business";
6
+ import { Api } from "../../../../api";
7
+ import { businessCoreInfoSchema } from "../../schemas/business-core-info-schema";
8
+ import { config } from "../../../../../config";
9
+ import { parseCoreInfo } from "../../utils/payload-parsers";
10
+ import { flattenNestedObject } from "../../../../utils/utils";
11
+ import { BusinessFormServerErrors } from "../../utils/business-form-types";
12
+ /**
13
+ *
14
+ * The difference between this component and business-generic-info-details
15
+ * is that this component is meant to be a form and send data
16
+ * and the other one is meant to be just read only.
17
+ *
18
+ * @exportedPart label: Label for inputs
19
+ * @exportedPart input: The input fields
20
+ * @exportedPart input-invalid: Invalid state for inputfs
21
+ */
22
+ export class BusinessCoreInfoFormStep {
23
+ constructor() {
24
+ this.fetchData = async () => {
25
+ this.formLoading.emit(true);
26
+ try {
27
+ const response = await this.api.get(this.businessEndpoint);
28
+ this.coreInfo = new CoreBusinessInfo(response.data);
29
+ this.formController.setInitialValues(Object.assign({}, this.coreInfo));
30
+ }
31
+ catch (error) {
32
+ this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
33
+ }
34
+ finally {
35
+ this.formLoading.emit(false);
36
+ }
37
+ };
38
+ this.sendData = async (onSuccess) => {
39
+ this.formLoading.emit(true);
40
+ try {
41
+ const payload = parseCoreInfo(flattenNestedObject(this.formController.values.getValue()));
42
+ const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
43
+ this.handleResponse(response, onSuccess);
44
+ }
45
+ catch (error) {
46
+ this.serverError.emit({ data: error, message: BusinessFormServerErrors.patchData });
47
+ }
48
+ finally {
49
+ this.formLoading.emit(false);
50
+ }
51
+ };
52
+ this.inputHandler = (name, value) => {
53
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
54
+ };
55
+ this.authToken = undefined;
56
+ this.businessId = undefined;
57
+ this.formController = undefined;
58
+ this.errors = {};
59
+ this.coreInfo = {};
60
+ }
61
+ get businessEndpoint() {
62
+ return `entities/business/${this.businessId}`;
63
+ }
64
+ handleResponse(response, onSuccess) {
65
+ if (response.error) {
66
+ this.serverError.emit({ data: response.error, message: BusinessFormServerErrors.patchData });
67
+ }
68
+ else {
69
+ onSuccess();
70
+ }
71
+ this.submitted.emit({ data: response, metadata: { completedStep: 'coreInfo' } });
72
+ }
73
+ async validateAndSubmit({ onSuccess }) {
74
+ this.formController.validateAndSubmit(() => this.sendData(onSuccess));
75
+ }
76
+ ;
77
+ componentWillLoad() {
78
+ const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
79
+ const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
80
+ if (!this.authToken)
81
+ console.error(missingAuthTokenMessage);
82
+ if (!this.businessId)
83
+ console.error(missingBusinessIdMessage);
84
+ this.formController = new FormController(businessCoreInfoSchema);
85
+ this.api = Api(this.authToken, config.proxyApiOrigin);
86
+ this.fetchData();
87
+ }
88
+ componentDidLoad() {
89
+ this.formController.values.subscribe(values => this.coreInfo = Object.assign({}, values));
90
+ this.formController.errors.subscribe(errors => {
91
+ this.errors = Object.assign({}, errors);
92
+ });
93
+ }
94
+ render() {
95
+ const coreInfoDefaultValue = this.formController.getInitialValues();
96
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: BusinessTypeOptions, defaultValue: coreInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: BusinessStructureOptions, defaultValue: coreInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, error: this.errors.industry, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-number-masked", { name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.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: coreInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })))))));
97
+ }
98
+ static get is() { return "justifi-business-core-info-form-step"; }
99
+ static get originalStyleUrls() {
100
+ return {
101
+ "$": ["business-core-info-form-step.scss"]
102
+ };
103
+ }
104
+ static get styleUrls() {
105
+ return {
106
+ "$": ["business-core-info-form-step.css"]
107
+ };
108
+ }
109
+ static get properties() {
110
+ return {
111
+ "authToken": {
112
+ "type": "string",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "string",
116
+ "resolved": "string",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": ""
124
+ },
125
+ "attribute": "auth-token",
126
+ "reflect": false
127
+ },
128
+ "businessId": {
129
+ "type": "string",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "string",
133
+ "resolved": "string",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": false,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": ""
141
+ },
142
+ "attribute": "business-id",
143
+ "reflect": false
144
+ }
145
+ };
146
+ }
147
+ static get states() {
148
+ return {
149
+ "formController": {},
150
+ "errors": {},
151
+ "coreInfo": {}
152
+ };
153
+ }
154
+ static get events() {
155
+ return [{
156
+ "method": "submitted",
157
+ "name": "submitted",
158
+ "bubbles": true,
159
+ "cancelable": true,
160
+ "composed": true,
161
+ "docs": {
162
+ "tags": [],
163
+ "text": ""
164
+ },
165
+ "complexType": {
166
+ "original": "BusinessFormSubmitEvent",
167
+ "resolved": "BusinessFormSubmitEvent",
168
+ "references": {
169
+ "BusinessFormSubmitEvent": {
170
+ "location": "import",
171
+ "path": "../../utils/business-form-types",
172
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
173
+ }
174
+ }
175
+ }
176
+ }, {
177
+ "method": "formLoading",
178
+ "name": "formLoading",
179
+ "bubbles": true,
180
+ "cancelable": true,
181
+ "composed": true,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": ""
185
+ },
186
+ "complexType": {
187
+ "original": "boolean",
188
+ "resolved": "boolean",
189
+ "references": {}
190
+ }
191
+ }, {
192
+ "method": "serverError",
193
+ "name": "serverError",
194
+ "bubbles": true,
195
+ "cancelable": true,
196
+ "composed": true,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": ""
200
+ },
201
+ "complexType": {
202
+ "original": "BusinessFormServerErrorEvent",
203
+ "resolved": "BusinessFormServerErrorEvent",
204
+ "references": {
205
+ "BusinessFormServerErrorEvent": {
206
+ "location": "import",
207
+ "path": "../../utils/business-form-types",
208
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormServerErrorEvent"
209
+ }
210
+ }
211
+ }
212
+ }];
213
+ }
214
+ static get methods() {
215
+ return {
216
+ "validateAndSubmit": {
217
+ "complexType": {
218
+ "signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
219
+ "parameters": [{
220
+ "name": "__0",
221
+ "type": "{ onSuccess: any; }",
222
+ "docs": ""
223
+ }],
224
+ "references": {
225
+ "Promise": {
226
+ "location": "global",
227
+ "id": "global::Promise"
228
+ }
229
+ },
230
+ "return": "Promise<void>"
231
+ },
232
+ "docs": {
233
+ "text": "",
234
+ "tags": []
235
+ }
236
+ }
237
+ };
238
+ }
239
+ }
@@ -0,0 +1,97 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { BusinessCoreInfoFormStep } from "../business-core-info-form-step";
3
+ describe.skip('justifi-business-core-info-form-step', () => {
4
+ let consoleSpy;
5
+ // Initialize the spy in the beforeEach
6
+ beforeEach(() => {
7
+ consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
8
+ });
9
+ // Restore the original function in the afterEach
10
+ afterEach(() => {
11
+ consoleSpy.mockRestore();
12
+ });
13
+ it('should log a warning if no authToken is provided', async () => {
14
+ await newSpecPage({
15
+ components: [BusinessCoreInfoFormStep],
16
+ html: `<justifi-business-core-info-form-step></justifi-business-core-info-form-step>`,
17
+ });
18
+ });
19
+ it('should log a warning if no businessId is provided', async () => {
20
+ await newSpecPage({
21
+ components: [BusinessCoreInfoFormStep],
22
+ html: `<justifi-business-core-info-form-step></justifi-business-core-info-form-step>`,
23
+ });
24
+ });
25
+ it('should emit server error event if server error when fetching data', async () => {
26
+ await newSpecPage({
27
+ components: [BusinessCoreInfoFormStep],
28
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
29
+ });
30
+ });
31
+ it('should emit server error event if server error when patching data', async () => {
32
+ await newSpecPage({
33
+ components: [BusinessCoreInfoFormStep],
34
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
35
+ });
36
+ });
37
+ it('should render', async () => {
38
+ await newSpecPage({
39
+ components: [BusinessCoreInfoFormStep],
40
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
41
+ });
42
+ });
43
+ it('should call fetchData if rendered with valid props', async () => {
44
+ await newSpecPage({
45
+ components: [BusinessCoreInfoFormStep],
46
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
47
+ });
48
+ });
49
+ it('should populate inputs with data from fetchData', async () => {
50
+ await newSpecPage({
51
+ components: [BusinessCoreInfoFormStep],
52
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
53
+ });
54
+ });
55
+ it('should instantiate new Form Controller on load', async () => {
56
+ await newSpecPage({
57
+ components: [BusinessCoreInfoFormStep],
58
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
59
+ });
60
+ });
61
+ it('should fire form controller validation when called', async () => {
62
+ await newSpecPage({
63
+ components: [BusinessCoreInfoFormStep],
64
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
65
+ });
66
+ });
67
+ it('should only call submit after validate returns true', async () => {
68
+ await newSpecPage({
69
+ components: [BusinessCoreInfoFormStep],
70
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
71
+ });
72
+ });
73
+ it('should call sendData when submit is called', async () => {
74
+ await newSpecPage({
75
+ components: [BusinessCoreInfoFormStep],
76
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
77
+ });
78
+ });
79
+ it('should send correct data payload', async () => {
80
+ await newSpecPage({
81
+ components: [BusinessCoreInfoFormStep],
82
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
83
+ });
84
+ });
85
+ it('should emit submitted event when sendData resolves', async () => {
86
+ await newSpecPage({
87
+ components: [BusinessCoreInfoFormStep],
88
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
89
+ });
90
+ });
91
+ it('should emit formLoading event when data is being sent or fetched', async () => {
92
+ await newSpecPage({
93
+ components: [BusinessCoreInfoFormStep],
94
+ html: `<justifi-business-core-info-form-step business-id="biz_123" auth-token="some-token"></justifi-business-core-info-form-step>`,
95
+ });
96
+ });
97
+ });
@@ -2536,6 +2536,68 @@ progress {
2536
2536
  --bs-btn-border-radius: var(--bs-border-radius-sm);
2537
2537
  }
2538
2538
 
2539
+ .spinner-grow,
2540
+ .spinner-border {
2541
+ display: inline-block;
2542
+ width: var(--bs-spinner-width);
2543
+ height: var(--bs-spinner-height);
2544
+ vertical-align: var(--bs-spinner-vertical-align);
2545
+ border-radius: 50%;
2546
+ animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
2547
+ }
2548
+
2549
+ @keyframes spinner-border {
2550
+ to {
2551
+ transform: rotate(360deg) /* rtl:ignore */;
2552
+ }
2553
+ }
2554
+ .spinner-border {
2555
+ --bs-spinner-width: 2rem;
2556
+ --bs-spinner-height: 2rem;
2557
+ --bs-spinner-vertical-align: -0.125em;
2558
+ --bs-spinner-border-width: 0.25em;
2559
+ --bs-spinner-animation-speed: 0.75s;
2560
+ --bs-spinner-animation-name: spinner-border;
2561
+ border: var(--bs-spinner-border-width) solid currentcolor;
2562
+ border-right-color: transparent;
2563
+ }
2564
+
2565
+ .spinner-border-sm {
2566
+ --bs-spinner-width: 1rem;
2567
+ --bs-spinner-height: 1rem;
2568
+ --bs-spinner-border-width: 0.2em;
2569
+ }
2570
+
2571
+ @keyframes spinner-grow {
2572
+ 0% {
2573
+ transform: scale(0);
2574
+ }
2575
+ 50% {
2576
+ opacity: 1;
2577
+ transform: none;
2578
+ }
2579
+ }
2580
+ .spinner-grow {
2581
+ --bs-spinner-width: 2rem;
2582
+ --bs-spinner-height: 2rem;
2583
+ --bs-spinner-vertical-align: -0.125em;
2584
+ --bs-spinner-animation-speed: 0.75s;
2585
+ --bs-spinner-animation-name: spinner-grow;
2586
+ background-color: currentcolor;
2587
+ opacity: 0;
2588
+ }
2589
+
2590
+ .spinner-grow-sm {
2591
+ --bs-spinner-width: 1rem;
2592
+ --bs-spinner-height: 1rem;
2593
+ }
2594
+
2595
+ @media (prefers-reduced-motion: reduce) {
2596
+ .spinner-border,
2597
+ .spinner-grow {
2598
+ --bs-spinner-animation-speed: 1.5s;
2599
+ }
2600
+ }
2539
2601
  @keyframes progress-bar-stripes {
2540
2602
  0% {
2541
2603
  background-position-x: 1rem;
@@ -7933,4 +7995,47 @@ progress {
7933
7995
  *::part(input-invalid):focus {
7934
7996
  border-color: var(--jfi-form-control-border-color-error);
7935
7997
  box-shadow: var(--jfi-form-control-box-shadow-error-focus);
7998
+ }
7999
+
8000
+ .jfi-submit-button {
8001
+ font-family: var(--jfi-layout-font-family);
8002
+ color: var(--jfi-submit-button-color);
8003
+ background-color: var(--jfi-submit-button-background-color);
8004
+ border-color: var(--jfi-submit-button-border-color);
8005
+ padding: var(--jfi-submit-button-padding);
8006
+ font-size: var(--jfi-submit-button-font-size);
8007
+ border-radius: var(--jfi-submit-button-border-radius);
8008
+ width: var(--jfi-submit-button-width);
8009
+ box-shadow: var(--jfi-submit-button-box-shadow);
8010
+ }
8011
+
8012
+ .jfi-submit-button:hover {
8013
+ color: var(--jfi-submit-button-color-hover);
8014
+ background-color: var(--jfi-submit-button-background-color-hover);
8015
+ border-color: var(--jfi-submit-button-border-color-hover);
8016
+ }
8017
+
8018
+ .jfi-submit-button:focus {
8019
+ color: var(--jfi-submit-button-color-focus);
8020
+ background-color: var(--jfi-submit-button-background-color-focus);
8021
+ border-color: var(--jfi-submit-button-border-color-focus);
8022
+ }
8023
+
8024
+ .btn.jfi-submit-button:active {
8025
+ color: var(--jfi-submit-button-color-active);
8026
+ background-color: var(--jfi-submit-button-background-color-active);
8027
+ border-color: var(--jfi-submit-button-border-color-active);
8028
+ }
8029
+
8030
+ .btn.jfi-submit-button-loading {
8031
+ min-width: 75px;
8032
+ color: var(--jfi-submit-button-color-loading);
8033
+ background-color: var(--jfi-submit-button-background-color-loading);
8034
+ border-color: var(--jfi-submit-button-border-color-loading);
8035
+ }
8036
+
8037
+ .btn.jfi-submit-button-loading .spinner-border {
8038
+ border-top-color: var(--jfi-submit-button-color-loading);
8039
+ border-bottom-color: var(--jfi-submit-button-color-loading);
8040
+ border-left-color: var(--jfi-submit-button-color-loading);
7936
8041
  }
@@ -0,0 +1,199 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { FormAlert, LoadingSpinner } from "../../form/utils";
3
+ import { BusinessFormClickActions } from "../utils/business-form-types";
4
+ /**
5
+ * @exportedPart label: Label for inputs
6
+ * @exportedPart input: The input fields
7
+ * @exportedPart input-invalid: Invalid state for inputfs
8
+ */
9
+ export class BusinessFormStepped {
10
+ constructor() {
11
+ this.refs = [];
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) }),
18
+ };
19
+ this.incrementSteps = () => {
20
+ if (this.currentStep < this.totalSteps) {
21
+ return this.currentStep++;
22
+ }
23
+ };
24
+ this.decrementSteps = () => { return this.currentStep--; };
25
+ this.authToken = undefined;
26
+ this.businessId = undefined;
27
+ this.testMode = false;
28
+ this.hideErrors = false;
29
+ this.formLoading = false;
30
+ this.errorMessage = '';
31
+ this.currentStep = 0;
32
+ this.totalSteps = 5;
33
+ }
34
+ get showErrors() {
35
+ return this.errorMessage && !this.hideErrors;
36
+ }
37
+ get businessEndpoint() {
38
+ return `entities/business/${this.businessId}`;
39
+ }
40
+ componentWillLoad() {
41
+ const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
42
+ const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
43
+ if (!this.authToken)
44
+ console.error(missingAuthTokenMessage);
45
+ if (!this.businessId)
46
+ console.error(missingBusinessIdMessage);
47
+ this.refs = [this.coreInfoRef, this.legalAddressRef, this.additionalQuestionsRef, this.representativeRef, this.ownersRef];
48
+ this.totalSteps = Object.keys(this.componentStepMapping).length - 1;
49
+ }
50
+ handleFormLoading(e) {
51
+ this.formLoading = e.detail;
52
+ }
53
+ handleServerErrors(e) {
54
+ this.errorMessage = e.detail.message;
55
+ }
56
+ showPreviousStepButton() {
57
+ return this.currentStep > 0;
58
+ }
59
+ showNextStepButton() {
60
+ return this.currentStep < this.totalSteps;
61
+ }
62
+ previousStepButtonOnClick() {
63
+ this.clickEvent.emit({ name: BusinessFormClickActions.previousStep });
64
+ const currentStep = this.refs[this.currentStep];
65
+ currentStep.validateAndSubmit({ onSuccess: this.decrementSteps });
66
+ }
67
+ nextStepButtonOnClick(e, clickEventName) {
68
+ e.preventDefault();
69
+ this.clickEvent.emit({ name: clickEventName });
70
+ const currentStep = this.refs[this.currentStep];
71
+ currentStep.validateAndSubmit({ onSuccess: this.incrementSteps });
72
+ }
73
+ showSubmitButton() {
74
+ return this.currentStep === this.totalSteps;
75
+ }
76
+ currentStepComponent() {
77
+ return this.componentStepMapping[this.currentStep]();
78
+ }
79
+ render() {
80
+ return (h(Host, { exportparts: "label,input,input-invalid" }, h("h1", null, "Business Information"), this.showErrors && FormAlert(this.errorMessage), h("div", { class: "my-4" }, this.currentStepComponent()), h("div", { class: "d-flex justify-content-between align-items-center" }, h("div", { class: "d-flex align-items-center" }, "Step ", this.currentStep + 1, " of ", this.totalSteps + 1), h("div", { class: "d-flex gap-2" }, this.showPreviousStepButton() && (h("button", { type: "button", class: "btn btn-secondary", onClick: () => this.previousStepButtonOnClick(), disabled: this.formLoading }, "Previous")), this.showNextStepButton() && (h("button", { type: "button", class: `btn btn-primary jfi-submit-button${this.formLoading ? ' jfi-submit-button-loading' : ''}`, onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.nextStep), disabled: this.formLoading }, this.formLoading ? LoadingSpinner() : 'Next')), this.showSubmitButton() && (h("button", { type: "submit", class: `btn btn-primary jfi-submit-button${this.formLoading ? ' jfi-submit-button-loading' : ''}`, onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.submit), disabled: this.formLoading }, this.formLoading ? LoadingSpinner() : 'Submit'))))));
81
+ }
82
+ static get is() { return "justifi-business-form-stepped"; }
83
+ static get originalStyleUrls() {
84
+ return {
85
+ "$": ["business-form-stepped.scss"]
86
+ };
87
+ }
88
+ static get styleUrls() {
89
+ return {
90
+ "$": ["business-form-stepped.css"]
91
+ };
92
+ }
93
+ static get properties() {
94
+ return {
95
+ "authToken": {
96
+ "type": "string",
97
+ "mutable": false,
98
+ "complexType": {
99
+ "original": "string",
100
+ "resolved": "string",
101
+ "references": {}
102
+ },
103
+ "required": false,
104
+ "optional": false,
105
+ "docs": {
106
+ "tags": [],
107
+ "text": ""
108
+ },
109
+ "attribute": "auth-token",
110
+ "reflect": false
111
+ },
112
+ "businessId": {
113
+ "type": "string",
114
+ "mutable": false,
115
+ "complexType": {
116
+ "original": "string",
117
+ "resolved": "string",
118
+ "references": {}
119
+ },
120
+ "required": false,
121
+ "optional": false,
122
+ "docs": {
123
+ "tags": [],
124
+ "text": ""
125
+ },
126
+ "attribute": "business-id",
127
+ "reflect": false
128
+ },
129
+ "testMode": {
130
+ "type": "boolean",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "boolean",
134
+ "resolved": "boolean",
135
+ "references": {}
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": ""
142
+ },
143
+ "attribute": "test-mode",
144
+ "reflect": false,
145
+ "defaultValue": "false"
146
+ },
147
+ "hideErrors": {
148
+ "type": "boolean",
149
+ "mutable": false,
150
+ "complexType": {
151
+ "original": "boolean",
152
+ "resolved": "boolean",
153
+ "references": {}
154
+ },
155
+ "required": false,
156
+ "optional": true,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": ""
160
+ },
161
+ "attribute": "hide-errors",
162
+ "reflect": false,
163
+ "defaultValue": "false"
164
+ }
165
+ };
166
+ }
167
+ static get states() {
168
+ return {
169
+ "formLoading": {},
170
+ "errorMessage": {},
171
+ "currentStep": {},
172
+ "totalSteps": {}
173
+ };
174
+ }
175
+ static get events() {
176
+ return [{
177
+ "method": "clickEvent",
178
+ "name": "clickEvent",
179
+ "bubbles": true,
180
+ "cancelable": true,
181
+ "composed": true,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": ""
185
+ },
186
+ "complexType": {
187
+ "original": "BusinessFormClickEvent",
188
+ "resolved": "BusinessFormClickEvent",
189
+ "references": {
190
+ "BusinessFormClickEvent": {
191
+ "location": "import",
192
+ "path": "../utils/business-form-types",
193
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormClickEvent"
194
+ }
195
+ }
196
+ }
197
+ }];
198
+ }
199
+ }