@justifi/webcomponents 4.18.0 → 4.19.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 (537) hide show
  1. package/dist/cjs/{Analytics-d4aa8c07.js → Analytics-ff013cbc.js} +1 -1
  2. package/dist/cjs/{Payment-24f22eca.js → Payment-1a8a8ca6.js} +0 -21
  3. package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
  4. package/dist/cjs/business-details-core.cjs.entry.js +1 -1
  5. package/dist/cjs/{business-form-types-11130bab.js → business-form-types-6e1fcda3.js} +4 -7
  6. package/dist/cjs/business.service-f63650f5.js +32 -0
  7. package/dist/cjs/button-3f400a66.js +26 -0
  8. package/dist/cjs/form-alert_5.cjs.entry.js +5 -5
  9. package/dist/cjs/{form-control-checkbox_5.cjs.entry.js → form-control-checkbox_9.cjs.entry.js} +434 -169
  10. package/dist/cjs/{form-control-number-masked_2.cjs.entry.js → form-control-date_3.cjs.entry.js} +50 -7
  11. package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-error-text_4.cjs.entry.js} +32 -2
  12. package/dist/cjs/form-control-file.cjs.entry.js +1 -1
  13. package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
  14. package/dist/cjs/form-control-number.cjs.entry.js +1 -1
  15. package/dist/cjs/{get-payout-csv-e4e4771a.js → get-payout-csv-f3aee6d0.js} +1 -1
  16. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +2 -2
  17. package/dist/cjs/input-handlers-cff032bb.js +20 -0
  18. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +196 -481
  19. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
  20. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +4 -4
  21. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
  23. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +30 -0
  24. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-checkout-core.cjs.entry.js +7 -6
  26. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
  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_4.cjs.entry.js +6 -6
  30. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +268 -0
  31. package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
  32. package/dist/cjs/justifi-payment-form.cjs.entry.js +9 -10
  33. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +4 -4
  34. package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +8 -12
  36. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +8 -60
  37. package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
  38. package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
  39. package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -4
  40. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -3
  41. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +4 -4
  42. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +8 -2
  43. package/dist/cjs/loader.cjs.js +1 -1
  44. package/dist/cjs/{package-5fee1ffb.js → package-cb0f8cb1.js} +1 -1
  45. package/dist/cjs/pagination-menu.cjs.entry.js +25 -0
  46. package/dist/cjs/payment-details-core.cjs.entry.js +9 -9
  47. package/dist/cjs/payment-provisioning-actions-06466dda.js +185 -0
  48. package/dist/cjs/{payment.service-35298e95.js → payment.service-0a64f9cd.js} +1 -1
  49. package/dist/cjs/payments-list-core.cjs.entry.js +69 -40
  50. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  51. package/dist/cjs/payouts-list-core.cjs.entry.js +90 -74
  52. package/dist/cjs/skeleton-748c5dde.js +43 -0
  53. package/dist/cjs/styled-host-cc053016.js +14 -0
  54. package/dist/cjs/table-loading-state-8b406852.js +38 -0
  55. package/dist/cjs/{utils-80191fbe.js → utils-89d86e29.js} +0 -33
  56. package/dist/cjs/{utils-8c3bf659.js → utils-ddacfc44.js} +0 -5
  57. package/dist/cjs/webcomponents.cjs.js +1 -1
  58. package/dist/collection/api/Payment.js +0 -20
  59. package/dist/collection/api/services/business.service.js +18 -0
  60. package/dist/collection/collection-manifest.json +9 -14
  61. package/dist/collection/components/bank-account-form/bank-account-form.js +1 -1
  62. package/dist/collection/components/billing-form/billing-form.js +2 -2
  63. package/dist/collection/components/business-details/business-details-core.js +1 -1
  64. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +1 -1
  65. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
  66. package/dist/collection/components/business-forms/business-form/business-form.js +2 -2
  67. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -1
  68. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +1 -1
  69. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
  70. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +520 -0
  71. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +80 -0
  72. package/dist/collection/components/business-forms/owner-form/owner-form.js +55 -225
  73. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +235 -0
  74. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +41 -121
  75. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -2
  76. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +255 -0
  77. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +42 -131
  78. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +342 -0
  79. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +34 -189
  80. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +81 -0
  81. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +229 -0
  82. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +42 -133
  83. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +23 -18
  84. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-input-group.js +2 -2
  85. package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-documents-on-file.js +1 -1
  86. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +238 -0
  87. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +41 -124
  88. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-actions.js +122 -1
  89. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +17 -18
  90. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +2 -2
  91. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +6 -6
  92. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
  93. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -2
  94. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-text.js +1 -1
  95. package/dist/collection/components/business-forms/utils/business-form-types.js +4 -7
  96. package/dist/collection/components/business-forms/utils/input-handlers.js +13 -0
  97. package/dist/collection/components/card-form/card-form.js +1 -1
  98. package/dist/collection/components/checkout/checkout-core.js +4 -5
  99. package/dist/collection/components/checkout/checkout.js +2 -2
  100. package/dist/collection/components/checkout/new-payment-method.js +1 -1
  101. package/dist/collection/components/checkout/payment-method-options.js +1 -1
  102. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  103. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  104. package/dist/collection/components/checkout/sezzle-payment-method.js +1 -1
  105. package/dist/collection/components/details/details.js +2 -2
  106. package/dist/collection/components/form/form-control-checkbox.js +1 -1
  107. package/dist/collection/components/form/form-control-date.js +1 -1
  108. package/dist/collection/components/form/form-control-file.js +1 -1
  109. package/dist/collection/components/form/form-control-monetary.js +1 -1
  110. package/dist/collection/components/form/form-control-number-masked.js +11 -5
  111. package/dist/collection/components/form/form-control-number.js +1 -1
  112. package/dist/collection/components/form/form-control-select.js +1 -1
  113. package/dist/collection/components/form/form-control-text.js +1 -1
  114. package/dist/collection/components/form/utils.js +0 -2
  115. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
  116. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance-core.js +3 -3
  117. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +6 -1
  118. package/dist/collection/components/pagination-menu/pagination-menu.js +3 -3
  119. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  120. package/dist/collection/components/payment-form/payment-form.js +4 -6
  121. package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
  122. package/dist/collection/components/payment-method-form/payment-method-form.js +2 -2
  123. package/dist/collection/components/payments-list/payments-list-core.js +66 -38
  124. package/dist/collection/components/payout-details/payout-details-core.js +2 -2
  125. package/dist/collection/components/payouts-list/payouts-list-core.js +88 -73
  126. package/dist/collection/components/refund-form/refund-form.js +2 -2
  127. package/dist/collection/ui-components/button-spinner.js +2 -0
  128. package/dist/collection/ui-components/button.js +19 -0
  129. package/dist/collection/ui-components/index.js +7 -0
  130. package/dist/collection/ui-components/skeleton.js +39 -0
  131. package/dist/collection/ui-components/styled-host/styled-host.js +5 -0
  132. package/dist/collection/ui-components/table-empty-state.js +8 -0
  133. package/dist/collection/ui-components/table-error-state.js +8 -0
  134. package/dist/collection/ui-components/table-loading-state.js +8 -0
  135. package/dist/collection/utils/utils.js +0 -21
  136. package/dist/docs.json +2080 -1746
  137. package/dist/esm/{Analytics-29fac206.js → Analytics-33b8fa8d.js} +1 -1
  138. package/dist/esm/{Payment-3e94da9c.js → Payment-6bf26fe2.js} +1 -21
  139. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  140. package/dist/esm/business-details-core.entry.js +2 -2
  141. package/dist/esm/{business-form-types-60f50b98.js → business-form-types-1bc5fe08.js} +5 -8
  142. package/dist/esm/business.service-74bd1212.js +29 -0
  143. package/dist/esm/button-34e75e0f.js +24 -0
  144. package/dist/esm/form-alert_5.entry.js +5 -5
  145. package/dist/esm/{form-control-checkbox_5.entry.js → form-control-checkbox_9.entry.js} +432 -171
  146. package/dist/esm/form-control-date_3.entry.js +130 -0
  147. package/dist/esm/{form-control-select_2.entry.js → form-control-error-text_4.entry.js} +32 -4
  148. package/dist/esm/form-control-file.entry.js +1 -1
  149. package/dist/esm/form-control-monetary.entry.js +1 -1
  150. package/dist/esm/form-control-number.entry.js +1 -1
  151. package/dist/esm/{get-payout-csv-9b4aaada.js → get-payout-csv-b494abfe.js} +1 -1
  152. package/dist/esm/gross-payment-chart-core.entry.js +3 -3
  153. package/dist/esm/input-handlers-270ac806.js +16 -0
  154. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +197 -482
  155. package/dist/esm/justifi-bank-account-form.entry.js +3 -3
  156. package/dist/esm/justifi-billing-form_2.entry.js +4 -4
  157. package/dist/esm/justifi-business-details.entry.js +4 -4
  158. package/dist/esm/justifi-business-form.entry.js +6 -6
  159. package/dist/esm/justifi-business-representative-form-inputs.entry.js +26 -0
  160. package/dist/esm/justifi-card-form.entry.js +3 -3
  161. package/dist/esm/justifi-checkout-core.entry.js +7 -6
  162. package/dist/esm/justifi-checkout.entry.js +5 -5
  163. package/dist/esm/justifi-details.entry.js +3 -3
  164. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  165. package/dist/esm/justifi-new-payment-method_4.entry.js +6 -6
  166. package/dist/esm/justifi-owner-form_3.entry.js +262 -0
  167. package/dist/esm/justifi-payment-details.entry.js +5 -5
  168. package/dist/esm/justifi-payment-form.entry.js +9 -10
  169. package/dist/esm/justifi-payment-method-form.entry.js +4 -4
  170. package/dist/esm/justifi-payment-method-selector.entry.js +2 -2
  171. package/dist/esm/justifi-payment-provisioning-core.entry.js +8 -12
  172. package/dist/esm/justifi-payment-provisioning.entry.js +7 -59
  173. package/dist/esm/justifi-payments-list.entry.js +5 -5
  174. package/dist/esm/justifi-payout-details.entry.js +5 -5
  175. package/dist/esm/justifi-payouts-list.entry.js +5 -5
  176. package/dist/esm/justifi-refund-form.entry.js +3 -3
  177. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +4 -4
  178. package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -2
  179. package/dist/esm/loader.js +1 -1
  180. package/dist/esm/{package-1123f528.js → package-3e407c6d.js} +1 -1
  181. package/dist/esm/pagination-menu.entry.js +21 -0
  182. package/dist/esm/payment-details-core.entry.js +10 -10
  183. package/dist/esm/payment-provisioning-actions-0635eff7.js +178 -0
  184. package/dist/esm/{payment.service-c62d82d3.js → payment.service-3ca4a492.js} +1 -1
  185. package/dist/esm/payments-list-core.entry.js +69 -40
  186. package/dist/esm/payout-details-core.entry.js +4 -4
  187. package/dist/esm/payouts-list-core.entry.js +90 -74
  188. package/dist/esm/skeleton-145a80d4.js +41 -0
  189. package/dist/esm/styled-host-ab9da520.js +12 -0
  190. package/dist/esm/table-loading-state-356c7215.js +34 -0
  191. package/dist/esm/{utils-56719d07.js → utils-01413a95.js} +1 -1
  192. package/dist/esm/{utils-f4c4ba7d.js → utils-3bb6347a.js} +1 -5
  193. package/dist/esm/{utils-5f4c4faa.js → utils-3c1dd2fa.js} +1 -31
  194. package/dist/esm/webcomponents.js +1 -1
  195. package/dist/module/Payment.js +1 -21
  196. package/dist/module/additional-questions.js +1 -1
  197. package/dist/module/billing-form.js +3 -3
  198. package/dist/module/business-additional-questions-form-step-core.js +141 -0
  199. package/dist/module/business-additional-questions-form-step.js +55 -100
  200. package/dist/module/business-additional-questions-schema.js +1 -1
  201. package/dist/module/business-address-schema.js +1 -1
  202. package/dist/module/business-bank-account-form-step.js +4 -4
  203. package/dist/module/business-core-info-form-step-core.js +151 -0
  204. package/dist/module/business-core-info-form-step.js +57 -106
  205. package/dist/module/business-core-info-schema.js +1 -1
  206. package/dist/module/business-core-info.js +1 -1
  207. package/dist/module/business-document-upload-form-step.js +34 -35
  208. package/dist/module/business-document-upload-input-group.js +2 -2
  209. package/dist/module/business-documents-on-file.js +1 -1
  210. package/dist/module/business-form-types.js +5 -8
  211. package/dist/module/business-identity-schema.js +1 -1
  212. package/dist/module/business-owners-form-step-core.js +216 -0
  213. package/dist/module/business-owners-form-step.js +67 -154
  214. package/dist/module/business-representative-form-inputs.js +85 -0
  215. package/dist/module/business-representative-form-step-core.js +152 -0
  216. package/dist/module/business-representative-form-step.js +63 -111
  217. package/dist/module/business-representative.js +1 -1
  218. package/dist/module/business-terms-conditions-form-step.js +3 -3
  219. package/dist/module/business-terms-conditions-text.js +1 -1
  220. package/dist/module/business.service.js +19 -1
  221. package/dist/module/button.js +24 -0
  222. package/dist/module/checkout-core.js +27 -32
  223. package/dist/module/details.js +1 -1
  224. package/dist/module/exported-parts.js +40 -0
  225. package/dist/module/form-control-checkbox2.js +1 -1
  226. package/dist/module/form-control-date2.js +1 -1
  227. package/dist/module/form-control-file2.js +1 -1
  228. package/dist/module/form-control-monetary2.js +1 -1
  229. package/dist/module/form-control-number-masked2.js +11 -5
  230. package/dist/module/form-control-number.js +1 -1
  231. package/dist/module/form-control-select2.js +1 -1
  232. package/dist/module/form-control-text2.js +1 -1
  233. package/dist/module/get-payout-csv.js +1 -1
  234. package/dist/module/gross-payment-chart-core2.js +1 -1
  235. package/dist/module/identity-address-form.js +2 -2
  236. package/dist/module/input-handlers.js +16 -0
  237. package/dist/module/justifi-additional-questions-form-step-core.d.ts +11 -0
  238. package/dist/module/justifi-additional-questions-form-step-core.js +6 -0
  239. package/dist/module/justifi-bank-account-form.js +1 -1
  240. package/dist/module/justifi-business-core-info-form-step-core.d.ts +11 -0
  241. package/dist/module/justifi-business-core-info-form-step-core.js +6 -0
  242. package/dist/module/justifi-business-details.js +1 -1
  243. package/dist/module/justifi-business-form.js +2 -2
  244. package/dist/module/justifi-business-owners-form-step-core.d.ts +11 -0
  245. package/dist/module/justifi-business-owners-form-step-core.js +6 -0
  246. package/dist/module/justifi-business-representative-form-inputs.d.ts +11 -0
  247. package/dist/module/justifi-business-representative-form-inputs.js +6 -0
  248. package/dist/module/justifi-business-representative-form-step-core.d.ts +11 -0
  249. package/dist/module/justifi-business-representative-form-step-core.js +6 -0
  250. package/dist/module/justifi-card-form.js +1 -1
  251. package/dist/module/justifi-checkout.js +27 -33
  252. package/dist/module/justifi-gross-payment-chart.js +1 -1
  253. package/dist/module/justifi-legal-address-form-step-core.d.ts +11 -0
  254. package/dist/module/justifi-legal-address-form-step-core.js +6 -0
  255. package/dist/module/justifi-payment-details.js +2 -2
  256. package/dist/module/justifi-payment-form.js +5 -6
  257. package/dist/module/justifi-payment-provisioning.js +97 -108
  258. package/dist/module/justifi-payments-list.js +8 -14
  259. package/dist/module/justifi-payout-details.js +1 -1
  260. package/dist/module/justifi-payouts-list.js +8 -13
  261. package/dist/module/justifi-refund-form.js +2 -2
  262. package/dist/module/justifi-season-interruption-insurance.js +7 -2
  263. package/dist/module/legal-address-form-step-core.js +138 -0
  264. package/dist/module/legal-address-form-step.js +53 -98
  265. package/dist/module/legal-address-form.js +2 -2
  266. package/dist/module/new-payment-method.js +1 -1
  267. package/dist/module/{justifi-table.d.ts → owner-form-core.d.ts} +4 -4
  268. package/dist/module/owner-form-core.js +6 -0
  269. package/dist/module/owner-form-core2.js +264 -0
  270. package/dist/module/{justifi-skeleton.d.ts → owner-form-inputs.d.ts} +4 -4
  271. package/dist/module/owner-form-inputs.js +6 -0
  272. package/dist/module/owner-form-inputs2.js +85 -0
  273. package/dist/module/owner-form.js +62 -188
  274. package/dist/module/package.js +1 -1
  275. package/dist/module/pagination-menu2.js +3 -3
  276. package/dist/module/payment-details-core2.js +7 -7
  277. package/dist/module/payment-method-form.js +2 -2
  278. package/dist/module/payment-method-options.js +1 -1
  279. package/dist/module/payment-method-selector.js +1 -1
  280. package/dist/module/payment-provisioning-actions.js +178 -0
  281. package/dist/module/payment-provisioning-core.js +100 -62
  282. package/dist/module/payment-provisioning-form-buttons.js +2 -2
  283. package/dist/module/payment-provisioning-form-steps.js +94 -52
  284. package/dist/module/payments-list-core2.js +71 -49
  285. package/dist/module/payout-details-core2.js +1 -1
  286. package/dist/module/payouts-list-core2.js +92 -82
  287. package/dist/module/save-new-payment-method.js +1 -1
  288. package/dist/module/saved-payment-method.js +1 -1
  289. package/dist/module/schema-validations.js +1 -1
  290. package/dist/module/season-interruption-insurance-core.js +2 -2
  291. package/dist/module/sezzle-payment-method.js +1 -1
  292. package/dist/module/skeleton.js +18 -50
  293. package/dist/module/styled-host.js +4 -4
  294. package/dist/module/utils2.js +1 -31
  295. package/dist/module/utils3.js +23 -26
  296. package/dist/module/utils4.js +23 -24
  297. package/dist/types/api/Payment.d.ts +0 -28
  298. package/dist/types/api/services/business.service.d.ts +10 -0
  299. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +43 -0
  300. package/dist/types/components/business-forms/owner-form/owner-form-inputs.d.ts +9 -0
  301. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +9 -28
  302. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +26 -0
  303. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +5 -15
  304. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +27 -0
  305. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +6 -21
  306. package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.d.ts +35 -0
  307. package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +5 -21
  308. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.d.ts +9 -0
  309. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +25 -0
  310. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +5 -17
  311. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +26 -0
  312. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +5 -15
  313. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-actions.d.ts +40 -1
  314. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-core.d.ts +2 -2
  315. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +1 -1
  316. package/dist/types/components/business-forms/utils/business-form-types.d.ts +6 -11
  317. package/dist/types/components/business-forms/utils/input-handlers.d.ts +4 -0
  318. package/dist/types/components/checkout/checkout-core.d.ts +0 -1
  319. package/dist/types/components/form/utils.d.ts +0 -1
  320. package/dist/types/components/insurance/season-interruption/season-interruption-insurance.d.ts +3 -0
  321. package/dist/types/components/payments-list/payments-list-core.d.ts +12 -2
  322. package/dist/types/components/payouts-list/payouts-list-core.d.ts +11 -4
  323. package/dist/types/components.d.ts +309 -482
  324. package/dist/types/ui-components/button-spinner.d.ts +1 -0
  325. package/dist/types/ui-components/button.d.ts +10 -0
  326. package/dist/types/ui-components/index.d.ts +7 -0
  327. package/dist/types/ui-components/skeleton.d.ts +13 -0
  328. package/dist/types/ui-components/styled-host/styled-host.d.ts +2 -0
  329. package/dist/types/ui-components/table-empty-state.d.ts +6 -0
  330. package/dist/types/ui-components/table-error-state.d.ts +6 -0
  331. package/dist/types/ui-components/table-loading-state.d.ts +6 -0
  332. package/dist/types/utils/utils.d.ts +0 -3
  333. package/dist/webcomponents/p-07109641.entry.js +1 -0
  334. package/dist/webcomponents/p-08b0fb31.js +1 -0
  335. package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
  336. package/dist/webcomponents/p-17e4246f.entry.js +1 -0
  337. package/dist/webcomponents/{p-e85ef4af.entry.js → p-195f92e9.entry.js} +1 -1
  338. package/dist/webcomponents/{p-959b478a.entry.js → p-1a43e355.entry.js} +2 -2
  339. package/dist/webcomponents/p-23014988.entry.js +1 -0
  340. package/dist/webcomponents/p-25dba252.entry.js +1 -0
  341. package/dist/webcomponents/{p-0dca0770.entry.js → p-27981600.entry.js} +1 -1
  342. package/dist/webcomponents/{p-66758365.entry.js → p-301e0493.entry.js} +1 -1
  343. package/dist/webcomponents/p-304dd644.entry.js +1 -0
  344. package/dist/webcomponents/p-30a493cd.entry.js +1 -0
  345. package/dist/webcomponents/p-462dc522.entry.js +1 -0
  346. package/dist/webcomponents/{p-09affce4.entry.js → p-487b72a8.entry.js} +1 -1
  347. package/dist/webcomponents/{p-571d7f1a.entry.js → p-4abc17f0.entry.js} +1 -1
  348. package/dist/webcomponents/{p-667a5aa8.js → p-4b4580dd.js} +1 -1
  349. package/dist/webcomponents/p-52021fa1.entry.js +1 -0
  350. package/dist/webcomponents/p-53e64f15.entry.js +1 -0
  351. package/dist/webcomponents/p-5968ff8a.js +1 -0
  352. package/dist/webcomponents/p-60a370fc.entry.js +1 -0
  353. package/dist/webcomponents/{p-e0bcfdb5.entry.js → p-623a4479.entry.js} +1 -1
  354. package/dist/webcomponents/{p-3294856b.entry.js → p-62b32c4c.entry.js} +1 -1
  355. package/dist/webcomponents/{p-092e080c.js → p-63acf322.js} +1 -1
  356. package/dist/webcomponents/p-6f03b35a.entry.js +1 -0
  357. package/dist/webcomponents/p-75b4daef.js +1 -0
  358. package/dist/webcomponents/p-7d85af5c.js +1 -0
  359. package/dist/webcomponents/{p-e8c651b8.js → p-83125497.js} +1 -1
  360. package/dist/webcomponents/{p-49b8e112.js → p-8603348a.js} +1 -1
  361. package/dist/webcomponents/{p-7a346c0b.entry.js → p-8c1e981b.entry.js} +1 -1
  362. package/dist/webcomponents/p-8df7bde8.js +1 -0
  363. package/dist/webcomponents/{p-f3555f0b.entry.js → p-8e541a32.entry.js} +1 -1
  364. package/dist/webcomponents/p-9279aa49.entry.js +1 -0
  365. package/dist/webcomponents/{p-0e4a54c8.entry.js → p-96b42e7d.entry.js} +1 -1
  366. package/dist/webcomponents/{p-9631b768.entry.js → p-99022846.entry.js} +1 -1
  367. package/dist/webcomponents/p-9c9c7dac.js +1 -0
  368. package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
  369. package/dist/webcomponents/p-ba4bae6f.js +1 -0
  370. package/dist/webcomponents/p-bbed6107.entry.js +1 -0
  371. package/dist/webcomponents/{p-67e497aa.entry.js → p-bc92235c.entry.js} +1 -1
  372. package/dist/webcomponents/p-be39c802.entry.js +1 -0
  373. package/dist/webcomponents/{p-3514b616.entry.js → p-c4b87db2.entry.js} +1 -1
  374. package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
  375. package/dist/webcomponents/{p-bb32b91c.entry.js → p-cd7105dd.entry.js} +1 -1
  376. package/dist/webcomponents/p-d101c5db.js +1 -0
  377. package/dist/webcomponents/{p-d5612f35.entry.js → p-d1fbeae5.entry.js} +1 -1
  378. package/dist/webcomponents/p-d8355f91.entry.js +1 -0
  379. package/dist/webcomponents/p-d89bad72.js +1 -0
  380. package/dist/webcomponents/{p-e1651130.js → p-dce846bf.js} +1 -1
  381. package/dist/webcomponents/{p-e8706cc4.js → p-df21aaad.js} +1 -1
  382. package/dist/webcomponents/{p-531d873a.entry.js → p-e2c88817.entry.js} +1 -1
  383. package/dist/webcomponents/{p-df38dd21.entry.js → p-e31f0f3e.entry.js} +1 -1
  384. package/dist/webcomponents/p-e333620e.js +1 -0
  385. package/dist/webcomponents/{p-464e4dfe.entry.js → p-e7067ef2.entry.js} +1 -1
  386. package/dist/webcomponents/{p-2244e679.entry.js → p-f0866375.entry.js} +1 -1
  387. package/dist/webcomponents/{p-debeefbb.entry.js → p-fb58feb5.entry.js} +1 -1
  388. package/dist/webcomponents/p-fe33151d.entry.js +1 -0
  389. package/dist/webcomponents/webcomponents.css +6 -1
  390. package/dist/webcomponents/webcomponents.esm.js +1 -1
  391. package/package.json +1 -1
  392. package/dist/cjs/SubAccount-135ff8c8.js +0 -107
  393. package/dist/cjs/business.service-9214509a.js +0 -13
  394. package/dist/cjs/form-control-date.cjs.entry.js +0 -43
  395. package/dist/cjs/form-control-error-text_2.cjs.entry.js +0 -36
  396. package/dist/cjs/justifi-business-list.cjs.entry.js +0 -110
  397. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +0 -86
  398. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +0 -159
  399. package/dist/cjs/justifi-skeleton.cjs.entry.js +0 -54
  400. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +0 -77
  401. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +0 -105
  402. package/dist/cjs/justifi-table_2.cjs.entry.js +0 -80
  403. package/dist/cjs/styled-host-b8bed12a.js +0 -14
  404. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +0 -58
  405. package/dist/cjs/subaccount-bank-details.cjs.entry.js +0 -19
  406. package/dist/cjs/subaccount-terms-details.cjs.entry.js +0 -19
  407. package/dist/collection/api/Proceed.js +0 -41
  408. package/dist/collection/api/SubAccount.js +0 -103
  409. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.css +0 -60
  410. package/dist/collection/components/business-list/business-list.js +0 -185
  411. package/dist/collection/components/business-list/business-list.stories.js +0 -68
  412. package/dist/collection/components/business-list/example.js +0 -12
  413. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +0 -143
  414. package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js +0 -32
  415. package/dist/collection/components/proceeds-list/example.js +0 -12
  416. package/dist/collection/components/proceeds-list/proceeds-list.js +0 -205
  417. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +0 -69
  418. package/dist/collection/components/skeleton/skeleton.css +0 -11
  419. package/dist/collection/components/skeleton/skeleton.js +0 -160
  420. package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +0 -59
  421. package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +0 -37
  422. package/dist/collection/components/subaccount-details/subaccount-details.js +0 -136
  423. package/dist/collection/components/subaccount-details/subaccount-details.stories.js +0 -25
  424. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +0 -38
  425. package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +0 -38
  426. package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +0 -38
  427. package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +0 -37
  428. package/dist/collection/components/subaccounts-list/subaccounts-list.css +0 -3
  429. package/dist/collection/components/subaccounts-list/subaccounts-list.js +0 -179
  430. package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js +0 -69
  431. package/dist/collection/components/table/table.css +0 -7
  432. package/dist/collection/components/table/table.js +0 -222
  433. package/dist/collection/components/table/utils.js +0 -4
  434. package/dist/collection/utils/styled-host/styled-host.js +0 -6
  435. package/dist/esm/SubAccount-7fcb1450.js +0 -105
  436. package/dist/esm/business.service-19a0c8d3.js +0 -11
  437. package/dist/esm/form-control-date.entry.js +0 -39
  438. package/dist/esm/form-control-error-text_2.entry.js +0 -31
  439. package/dist/esm/form-control-number-masked_2.entry.js +0 -88
  440. package/dist/esm/justifi-business-list.entry.js +0 -106
  441. package/dist/esm/justifi-payment-balance-transactions.entry.js +0 -82
  442. package/dist/esm/justifi-proceeds-list.entry.js +0 -155
  443. package/dist/esm/justifi-skeleton.entry.js +0 -50
  444. package/dist/esm/justifi-subaccount-details.entry.js +0 -73
  445. package/dist/esm/justifi-subaccounts-list.entry.js +0 -101
  446. package/dist/esm/justifi-table_2.entry.js +0 -75
  447. package/dist/esm/styled-host-57aae7fa.js +0 -12
  448. package/dist/esm/subaccount-account-details_4.entry.js +0 -51
  449. package/dist/esm/subaccount-bank-details.entry.js +0 -15
  450. package/dist/esm/subaccount-terms-details.entry.js +0 -15
  451. package/dist/module/SubAccount.js +0 -105
  452. package/dist/module/justifi-business-list.d.ts +0 -11
  453. package/dist/module/justifi-business-list.js +0 -147
  454. package/dist/module/justifi-payment-balance-transactions.d.ts +0 -11
  455. package/dist/module/justifi-payment-balance-transactions.js +0 -123
  456. package/dist/module/justifi-proceeds-list.d.ts +0 -11
  457. package/dist/module/justifi-proceeds-list.js +0 -198
  458. package/dist/module/justifi-skeleton.js +0 -6
  459. package/dist/module/justifi-subaccount-details.d.ts +0 -11
  460. package/dist/module/justifi-subaccount-details.js +0 -133
  461. package/dist/module/justifi-subaccounts-list.d.ts +0 -11
  462. package/dist/module/justifi-subaccounts-list.js +0 -144
  463. package/dist/module/justifi-table.js +0 -6
  464. package/dist/module/subaccount-account-details.d.ts +0 -11
  465. package/dist/module/subaccount-account-details.js +0 -6
  466. package/dist/module/subaccount-account-details2.js +0 -34
  467. package/dist/module/subaccount-bank-details.d.ts +0 -11
  468. package/dist/module/subaccount-bank-details.js +0 -35
  469. package/dist/module/subaccount-merchant-details.d.ts +0 -11
  470. package/dist/module/subaccount-merchant-details.js +0 -6
  471. package/dist/module/subaccount-merchant-details2.js +0 -33
  472. package/dist/module/subaccount-owners-details.d.ts +0 -11
  473. package/dist/module/subaccount-owners-details.js +0 -6
  474. package/dist/module/subaccount-owners-details2.js +0 -33
  475. package/dist/module/subaccount-representative-details.d.ts +0 -11
  476. package/dist/module/subaccount-representative-details.js +0 -6
  477. package/dist/module/subaccount-representative-details2.js +0 -33
  478. package/dist/module/subaccount-terms-details.d.ts +0 -11
  479. package/dist/module/subaccount-terms-details.js +0 -35
  480. package/dist/module/table.js +0 -93
  481. package/dist/types/api/Proceed.d.ts +0 -60
  482. package/dist/types/api/SubAccount.d.ts +0 -163
  483. package/dist/types/components/business-list/business-list.d.ts +0 -48
  484. package/dist/types/components/business-list/business-list.stories.d.ts +0 -9
  485. package/dist/types/components/payment-balance-transactions/payment-balance-transactions.d.ts +0 -17
  486. package/dist/types/components/payment-balance-transactions/payment-balance-transactions.stories.d.ts +0 -8
  487. package/dist/types/components/proceeds-list/proceeds-list.d.ts +0 -39
  488. package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +0 -9
  489. package/dist/types/components/skeleton/skeleton.d.ts +0 -12
  490. package/dist/types/components/subaccount-details/subaccount-account-details/subaccount-account-details.d.ts +0 -6
  491. package/dist/types/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.d.ts +0 -5
  492. package/dist/types/components/subaccount-details/subaccount-details.d.ts +0 -16
  493. package/dist/types/components/subaccount-details/subaccount-details.stories.d.ts +0 -7
  494. package/dist/types/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.d.ts +0 -5
  495. package/dist/types/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.d.ts +0 -5
  496. package/dist/types/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.d.ts +0 -5
  497. package/dist/types/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.d.ts +0 -5
  498. package/dist/types/components/subaccounts-list/subaccounts-list.d.ts +0 -19
  499. package/dist/types/components/subaccounts-list/subaccounts-list.stories.d.ts +0 -9
  500. package/dist/types/components/table/table.d.ts +0 -23
  501. package/dist/types/components/table/utils.d.ts +0 -3
  502. package/dist/types/utils/styled-host/styled-host.d.ts +0 -3
  503. package/dist/webcomponents/p-0a4a9ccd.entry.js +0 -1
  504. package/dist/webcomponents/p-0ed3c1d2.entry.js +0 -1
  505. package/dist/webcomponents/p-10b57ac6.entry.js +0 -1
  506. package/dist/webcomponents/p-1737f6bf.entry.js +0 -1
  507. package/dist/webcomponents/p-2306d44d.entry.js +0 -1
  508. package/dist/webcomponents/p-2af3672b.entry.js +0 -1
  509. package/dist/webcomponents/p-390157c9.entry.js +0 -1
  510. package/dist/webcomponents/p-412c7a22.entry.js +0 -1
  511. package/dist/webcomponents/p-4b9587ec.entry.js +0 -1
  512. package/dist/webcomponents/p-54287db6.entry.js +0 -1
  513. package/dist/webcomponents/p-547a2cd0.entry.js +0 -1
  514. package/dist/webcomponents/p-5963bcdc.entry.js +0 -1
  515. package/dist/webcomponents/p-5b1451e7.entry.js +0 -1
  516. package/dist/webcomponents/p-6700ac49.js +0 -1
  517. package/dist/webcomponents/p-68fd8283.js +0 -1
  518. package/dist/webcomponents/p-6bcf621a.entry.js +0 -1
  519. package/dist/webcomponents/p-6bd5d569.entry.js +0 -1
  520. package/dist/webcomponents/p-76180bb4.entry.js +0 -1
  521. package/dist/webcomponents/p-77dc159c.entry.js +0 -1
  522. package/dist/webcomponents/p-7d6aba64.entry.js +0 -1
  523. package/dist/webcomponents/p-81d3eda6.entry.js +0 -1
  524. package/dist/webcomponents/p-87932e16.js +0 -1
  525. package/dist/webcomponents/p-88c7ef46.entry.js +0 -1
  526. package/dist/webcomponents/p-8cc7a418.entry.js +0 -1
  527. package/dist/webcomponents/p-8dd22c8d.entry.js +0 -1
  528. package/dist/webcomponents/p-9e7c3231.entry.js +0 -1
  529. package/dist/webcomponents/p-b53d7b7f.js +0 -1
  530. package/dist/webcomponents/p-bbc18b9f.entry.js +0 -1
  531. package/dist/webcomponents/p-c4264aaf.js +0 -1
  532. package/dist/webcomponents/p-cb9ee476.entry.js +0 -1
  533. package/dist/webcomponents/p-d083a342.entry.js +0 -1
  534. package/dist/webcomponents/p-e46929a1.entry.js +0 -1
  535. package/dist/webcomponents/p-ea7c77a3.entry.js +0 -1
  536. package/dist/webcomponents/p-ed844504.js +0 -1
  537. package/dist/module/{index.esm.js → form.js} +2733 -2733
@@ -1,104 +1,11 @@
1
- import { Host, h } from "@stencil/core";
2
- import { FormController } from "../../form/form";
3
- import { PHONE_MASKS, SSN_MASK } from "../../../utils/form-input-masks";
4
- import { Api } from "../../../api";
5
- import { Owner } from "../../../api/Identity";
6
- import { parseIdentityInfo } from "../utils/payload-parsers";
7
- import { identitySchema } from "../schemas/business-identity-schema";
8
- import { config } from "../../../../config";
9
- import { LoadingSpinner } from "../../form/utils";
10
- import { deconstructDate } from "../utils/helpers";
11
- import { OwnerFormClickActions } from "../utils/business-form-types";
12
- import { ComponentErrorCodes, ComponentErrorSeverity } from "../../../api/ComponentError";
1
+ import { h } from "@stencil/core";
2
+ import { makeGetIdentity, makePatchIdentity, makePostIdentity } from "../payment-provisioning/payment-provisioning-actions";
3
+ import { IdentityService } from "../../../api/services/business.service";
13
4
  export class BusinessOwnerForm {
14
5
  constructor() {
15
- this.instantiateOwner = (data) => {
16
- this.owner = Object.assign({}, new Owner(data));
17
- this.formController.setInitialValues(this.owner);
18
- };
19
- this.fetchData = async () => {
20
- if (!this.ownerId) {
21
- this.instantiateOwner({});
22
- return;
23
- }
24
- this.isLoading = true;
25
- try {
26
- const response = await this.api.get(this.identityEndpoint);
27
- this.instantiateOwner(response.data);
28
- }
29
- catch (error) {
30
- this.errorEvent.emit({
31
- errorCode: ComponentErrorCodes.FETCH_ERROR,
32
- message: error.message,
33
- severity: ComponentErrorSeverity.ERROR,
34
- data: error,
35
- });
36
- }
37
- finally {
38
- this.isLoading = false;
39
- }
40
- };
41
- this.sendData = async () => {
42
- this.isLoading = true;
43
- try {
44
- if (this.ownerId) {
45
- const payload = parseIdentityInfo(this.formController.values.getValue());
46
- const response = await this.api.patch(this.identityEndpoint, JSON.stringify(payload));
47
- return this.handleResponse(response);
48
- }
49
- else {
50
- const payload = Object.assign(Object.assign({}, parseIdentityInfo(this.formController.values.getValue())), { business_id: this.businessId });
51
- const response = await this.api.post(this.identityEndpoint, JSON.stringify(payload));
52
- this.ownerId = response.data.id;
53
- return this.handleResponse(response);
54
- }
55
- }
56
- catch (error) {
57
- this.errorEvent.emit({
58
- errorCode: ComponentErrorCodes.PATCH_ERROR,
59
- message: error.message,
60
- severity: ComponentErrorSeverity.ERROR,
61
- data: error,
62
- });
63
- }
64
- finally {
65
- this.isLoading = false;
66
- }
67
- };
68
- this.inputHandler = (name, value) => {
69
- this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
70
- };
71
- this.onAddressFormUpdate = (values) => {
72
- this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
73
- };
74
- this.onDateOfBirthUpdate = (event) => {
75
- if (event.detail === '') {
76
- this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: null, dob_month: null, dob_year: null }));
77
- }
78
- else {
79
- const dob_values = deconstructDate(event.detail);
80
- this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }));
81
- }
82
- };
83
- this.handleAddOwner = () => {
84
- const eventName = this.ownerId ? OwnerFormClickActions.updateOwner : OwnerFormClickActions.addOwner;
85
- this.clickEvent.emit({ name: eventName });
86
- };
87
- this.handleRemoveOwner = () => {
88
- this.removeOwner(this.ownerId);
89
- this.clickEvent.emit({ name: OwnerFormClickActions.removeOwner });
90
- };
91
- this.validateAndSubmit = async (event) => {
92
- event.preventDefault();
93
- const isValid = await this.validate();
94
- if (isValid) {
95
- this.submit();
96
- }
97
- };
98
- this.isLoading = false;
99
- this.formController = undefined;
100
- this.errors = {};
101
- this.owner = {};
6
+ this.getOwner = undefined;
7
+ this.patchOwner = undefined;
8
+ this.postOwner = undefined;
102
9
  this.authToken = undefined;
103
10
  this.ownerId = undefined;
104
11
  this.businessId = undefined;
@@ -107,73 +14,39 @@ export class BusinessOwnerForm {
107
14
  this.newFormOpen = undefined;
108
15
  this.ownersLength = undefined;
109
16
  }
110
- get identityEndpoint() {
111
- return this.ownerId ? `entities/identity/${this.ownerId}` : 'entities/identity';
112
- }
113
- get formTitle() {
114
- return this.ownerId ? 'Edit Business Owner' : 'Add Business Owner';
115
- }
116
- get submitButtonText() {
117
- return this.ownerId ? 'Update' : 'Add';
118
- }
119
- get showRemoveButton() {
120
- const blankForm = !this.ownerId && this.newFormOpen;
121
- if (this.ownersLength <= 1) {
122
- return false;
123
- }
124
- else {
125
- if (blankForm) {
126
- return true;
127
- }
128
- else if (this.ownerId && !this.newFormOpen) {
129
- return true;
130
- }
131
- }
17
+ async validate() {
18
+ return this.coreComponent.validate();
132
19
  }
133
- loadingWatcher() {
134
- this.formLoading.emit(this.isLoading);
20
+ async submit() {
21
+ return this.coreComponent.submit();
135
22
  }
136
- handleResponse(response) {
137
- this.submitted.emit({ data: response, metadata: { ownerId: this.ownerId } });
138
- let errorCode = this.ownerId ? ComponentErrorCodes.PATCH_ERROR : ComponentErrorCodes.POST_ERROR;
139
- if (response.error) {
140
- this.errorEvent.emit({
141
- errorCode: errorCode,
142
- message: response.error.message,
143
- severity: ComponentErrorSeverity.ERROR,
144
- data: response.error,
145
- });
146
- return false;
147
- }
148
- else {
149
- this.instantiateOwner(response.data);
150
- return true;
151
- }
23
+ async validateAndSubmit({ onSuccess }) {
24
+ this.coreComponent.validateAndSubmit({ onSuccess });
152
25
  }
153
26
  componentWillLoad() {
154
- this.formController = new FormController(identitySchema('owner', this.allowOptionalFields));
155
- this.api = Api({ authToken: this.authToken, apiOrigin: config.proxyApiOrigin });
156
- if (this.authToken) {
157
- this.fetchData();
158
- }
159
- }
160
- componentDidLoad() {
161
- this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
162
- this.formController.values.subscribe(values => (this.owner = Object.assign({}, values)));
27
+ this.initializeApi();
163
28
  }
164
- async validate() {
165
- return this.formController.validate();
166
- }
167
- async submit() {
168
- const isValid = await this.validate();
169
- if (isValid) {
170
- return this.sendData();
29
+ initializeApi() {
30
+ if (!this.authToken) {
31
+ return;
171
32
  }
33
+ this.getOwner = makeGetIdentity({
34
+ authToken: this.authToken,
35
+ identityId: this.ownerId,
36
+ service: new IdentityService()
37
+ });
38
+ this.patchOwner = makePatchIdentity({
39
+ authToken: this.authToken,
40
+ identityId: this.ownerId,
41
+ service: new IdentityService()
42
+ });
43
+ this.postOwner = makePostIdentity({
44
+ authToken: this.authToken,
45
+ service: new IdentityService()
46
+ });
172
47
  }
173
48
  render() {
174
- const ownerDefaultValue = this.formController.getInitialValues();
175
- return (h(Host, { key: '3a578c58fa8c11c2baf46a95e623414a694c18a2', exportparts: 'label,input,input-invalid' }, h("form", { key: 'ef53b26ec0ed5a41559bf3d4dbf85f8b79c8d8db', onSubmit: this.validateAndSubmit }, h("fieldset", { key: 'f23d280aa2ff12c685b87dcd3dc3dcb34bbf1784' }, h("legend", { key: '3d825e9ec1ad52471e175d78e8f012d1f1de2594', class: 'fw-semibold fs-5' }, this.formTitle), h("br", { key: '38d6a4fb10ddf4be97950e2eb985f0e136d295c4' }), h("div", { key: '3d1ede4480f325cc18ba22458527a8ba60159360', class: 'row gy-3' }, h("div", { key: '5f542713f105488bcf0b83d7f8cbd3702e8fd2da', class: 'col-12 col-md-6' }, h("form-control-text", { key: '4b415df939665d4a2ae29a78b0d6f3036b824233', name: 'name', label: 'Full Name', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: 'f92a0fdd5fa3288586ddc3815aa8e475b48687e3', class: 'col-12 col-md-4' }, h("form-control-text", { key: 'f3defa8f646072654ff528c4c3f7029a3e94e188', name: 'title', label: 'Title', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: 'cf0ad4643b076a5611526a30b753b349326fdc5c', class: 'col-12 col-md-6' }, h("form-control-text", { key: '4dff997ae72b053586ab9a89c8cfa253d786c2e6', name: 'email', label: 'Email Address', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: 'baf2251fe3813beca1943ea3c37090ae31cff04c', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: '465c8e61db06d11cf7fe85cf49868fc50375ca01', name: 'phone', label: 'Phone Number', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: '862ec747120b5b4a05091545bbba8e8e0649a063', class: 'col-12 col-md-4' }, h("form-control-date", { key: '1724de6338244e687135d992df528ffc9286284b', name: 'dob_full', label: 'Birth Date', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), h("div", { key: '9289f44bcb62e4b7baa36f6d5a88d1f2eab8f9dc', class: 'col-12 col-md-8' }, h("form-control-number-masked", { key: '4e2ac4ee3edc0cce36e97014184029b09be47e80', name: 'identification_number', label: 'SSN', defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: '1373375140a0c071c80764b69c2bacc26c22cf42', class: 'col-12' }, h("justifi-identity-address-form", { key: 'cc01cfc035e53ff6d995f387cd1dce713c5a6199', errors: this.errors.address, defaultValues: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate })), h("div", { key: 'f51f56934730f45b5ea8cad8c051c7995a101d01', class: 'col-12 d-flex gap-2' }, h("button", { key: 'e267c7f93110b5b45fea9e170718dd74fd2dba3e', 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 &&
176
- h("button", { key: '61486f9ae64c488abf267c15ddcbc61537b3e433', type: 'button', class: 'btn btn-danger', onClick: () => this.handleRemoveOwner() }, "Remove owner"))), h("hr", { key: 'c599a8b0f3f41f58691cb353f91d3b167bbcab11' })))));
49
+ return (h("owner-form-core", { key: '332d1e77d01886f13aba09b32b2d5f2199131619', ownerId: this.ownerId, businessId: this.businessId, getOwner: this.getOwner, patchOwner: this.patchOwner, postOwner: this.postOwner, allowOptionalFields: this.allowOptionalFields, removeOwner: this.removeOwner, newFormOpen: this.newFormOpen, ownersLength: this.ownersLength, ref: ref => this.coreComponent = ref }));
177
50
  }
178
51
  static get is() { return "justifi-owner-form"; }
179
52
  static get properties() {
@@ -299,71 +172,13 @@ export class BusinessOwnerForm {
299
172
  }
300
173
  static get states() {
301
174
  return {
302
- "isLoading": {},
303
- "formController": {},
304
- "errors": {},
305
- "owner": {}
175
+ "getOwner": {},
176
+ "patchOwner": {},
177
+ "postOwner": {}
306
178
  };
307
179
  }
308
180
  static get events() {
309
181
  return [{
310
- "method": "submitted",
311
- "name": "submitted",
312
- "bubbles": true,
313
- "cancelable": true,
314
- "composed": true,
315
- "docs": {
316
- "tags": [],
317
- "text": ""
318
- },
319
- "complexType": {
320
- "original": "OwnerFormSubmitEvent",
321
- "resolved": "OwnerFormSubmitEvent",
322
- "references": {
323
- "OwnerFormSubmitEvent": {
324
- "location": "import",
325
- "path": "../utils/business-form-types",
326
- "id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormSubmitEvent"
327
- }
328
- }
329
- }
330
- }, {
331
- "method": "clickEvent",
332
- "name": "click-event",
333
- "bubbles": true,
334
- "cancelable": true,
335
- "composed": true,
336
- "docs": {
337
- "tags": [],
338
- "text": ""
339
- },
340
- "complexType": {
341
- "original": "OwnerFormClickEvent",
342
- "resolved": "OwnerFormClickEvent",
343
- "references": {
344
- "OwnerFormClickEvent": {
345
- "location": "import",
346
- "path": "../utils/business-form-types",
347
- "id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
348
- }
349
- }
350
- }
351
- }, {
352
- "method": "formLoading",
353
- "name": "formLoading",
354
- "bubbles": true,
355
- "cancelable": true,
356
- "composed": true,
357
- "docs": {
358
- "tags": [],
359
- "text": ""
360
- },
361
- "complexType": {
362
- "original": "boolean",
363
- "resolved": "boolean",
364
- "references": {}
365
- }
366
- }, {
367
182
  "method": "errorEvent",
368
183
  "name": "error-event",
369
184
  "bubbles": true,
@@ -421,13 +236,28 @@ export class BusinessOwnerForm {
421
236
  "text": "",
422
237
  "tags": []
423
238
  }
239
+ },
240
+ "validateAndSubmit": {
241
+ "complexType": {
242
+ "signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
243
+ "parameters": [{
244
+ "name": "__0",
245
+ "type": "{ onSuccess: any; }",
246
+ "docs": ""
247
+ }],
248
+ "references": {
249
+ "Promise": {
250
+ "location": "global",
251
+ "id": "global::Promise"
252
+ }
253
+ },
254
+ "return": "Promise<void>"
255
+ },
256
+ "docs": {
257
+ "text": "",
258
+ "tags": []
259
+ }
424
260
  }
425
261
  };
426
262
  }
427
- static get watchers() {
428
- return [{
429
- "propName": "isLoading",
430
- "methodName": "loadingWatcher"
431
- }];
432
- }
433
263
  }
@@ -0,0 +1,235 @@
1
+ import { h } from "@stencil/core";
2
+ import { additionalQuestionsSchema } from "../../schemas/business-additional-questions-schema";
3
+ import { FormController } from "../../../form/form";
4
+ import { AdditionalQuestions } from "../../../../api/Business";
5
+ import { CURRENCY_MASK } from "../../../../utils/form-input-masks";
6
+ import { businessServiceReceivedOptions, recurringPaymentsOptions, seasonalBusinessOptions } from "../../utils/business-form-options";
7
+ export class AdditionalQuestionsFormStepCore {
8
+ constructor() {
9
+ this.getData = () => {
10
+ this.formLoading.emit(true);
11
+ this.getBusiness({
12
+ onSuccess: (response) => {
13
+ this.additional_questions = new AdditionalQuestions(response.data.additional_questions || {});
14
+ this.formController.setInitialValues(Object.assign({}, this.additional_questions));
15
+ },
16
+ onError: ({ error, code, severity }) => {
17
+ this.errorEvent.emit({
18
+ message: error,
19
+ errorCode: code,
20
+ severity: severity
21
+ });
22
+ },
23
+ final: () => this.formLoading.emit(false)
24
+ });
25
+ };
26
+ this.sendData = (onSuccess) => {
27
+ let submittedData;
28
+ this.formLoading.emit(true);
29
+ this.patchBusiness({
30
+ payload: this.patchPayload,
31
+ onSuccess: (response) => {
32
+ submittedData = response;
33
+ onSuccess();
34
+ },
35
+ onError: ({ error, code, severity }) => {
36
+ submittedData = error;
37
+ this.errorEvent.emit({
38
+ message: error,
39
+ errorCode: code,
40
+ severity: severity
41
+ });
42
+ },
43
+ final: () => {
44
+ this.submitted.emit({ data: { submittedData } });
45
+ this.formLoading.emit(false);
46
+ }
47
+ });
48
+ };
49
+ this.inputHandler = (name, value) => {
50
+ this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
51
+ };
52
+ this.formController = undefined;
53
+ this.errors = {};
54
+ this.additional_questions = {};
55
+ this.getBusiness = undefined;
56
+ this.patchBusiness = undefined;
57
+ this.allowOptionalFields = undefined;
58
+ }
59
+ async validateAndSubmit({ onSuccess }) {
60
+ this.formController.validateAndSubmit(() => this.sendData(onSuccess));
61
+ }
62
+ ;
63
+ get patchPayload() {
64
+ let formValues = this.formController.values.getValue();
65
+ return JSON.stringify({ additional_questions: formValues });
66
+ }
67
+ componentWillLoad() {
68
+ this.getBusiness && this.getData();
69
+ this.formController = new FormController(additionalQuestionsSchema(this.allowOptionalFields));
70
+ }
71
+ componentDidLoad() {
72
+ this.formController.errors.subscribe(errors => {
73
+ this.errors = Object.assign({}, errors);
74
+ });
75
+ }
76
+ render() {
77
+ var _a, _b, _c, _d, _e, _f, _g;
78
+ const additionalQuestionsDefaultValue = this.formController.getInitialValues();
79
+ return (h("form", { key: 'f5a3d2826c65e84e90325000973c5cdc2922c643' }, h("fieldset", { key: '8dfecfc242e62ca523c3950b9f29e159ee8debc5' }, h("legend", { key: '192071e8d05c1d075ad79678890b47fe116577d2' }, "Additional Questions"), h("hr", { key: 'e2b7369711b4ba285522200233c5112ad5320a74' }), h("div", { key: '3ef5edae7215eb35835cfc6dd373c311ba7446a5', class: 'row gy-3' }, h("div", { key: '6af600e3612b03b505c0d2c1ddbfdb9520b9df9d', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '8afb46cdad6b2ceab63227bd6f659f7f8b2a9153', name: 'business_revenue', label: 'What is the business\u2019 estimated annual revenue from its primary business activities?', inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: 'ae94caaafd45e4c46899d802337ce0a3a8d5b3aa', class: 'col-12 col-md-6' }, h("form-control-monetary", { key: '6b86e3a15934a15ecfbf7a1ac369c8ed9ee2f6a4', name: 'business_payment_volume', label: "What is the business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { key: '4b8fe3214082368c111183fcb1b76abf2c1ba5a1', class: 'col-12' }, h("form-control-select", { key: '88e5c2593bc1b55a797e1d67e103759c5e2e29e8', name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { key: 'a914e7114fd6fd4e44136ba8b986c20d1984dba8', class: 'col-12' }, h("form-control-select", { key: '38c9934952884a6d1dc70f4ebd61f03a87bd8091', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { key: '7a6d2a527e7486cff7dfa1d594e2f0378e66b583', class: 'col-12' }, h("form-control-text", { key: '6e445ff593a7970967040ae5bfd3b8056e17c129', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), h("div", { key: 'cf00fad8a096be8e28ef12bde563ead6f8b5ef6d', class: 'col-12' }, h("form-control-select", { key: '7cf9edd70b0ceaf25d2fd5947ecaf2760e76dd75', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { key: 'ceb6355fef7bae249330e0f39758be1812ff8cbe', class: 'col-12' }, h("form-control-text", { key: '689edc0fb02f926112c529301366e31d6d130aa6', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_g = this.errors) === null || _g === void 0 ? void 0 : _g.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
80
+ }
81
+ static get is() { return "justifi-additional-questions-form-step-core"; }
82
+ static get properties() {
83
+ return {
84
+ "getBusiness": {
85
+ "type": "unknown",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "Function",
89
+ "resolved": "Function",
90
+ "references": {
91
+ "Function": {
92
+ "location": "global",
93
+ "id": "global::Function"
94
+ }
95
+ }
96
+ },
97
+ "required": false,
98
+ "optional": false,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": ""
102
+ }
103
+ },
104
+ "patchBusiness": {
105
+ "type": "unknown",
106
+ "mutable": false,
107
+ "complexType": {
108
+ "original": "Function",
109
+ "resolved": "Function",
110
+ "references": {
111
+ "Function": {
112
+ "location": "global",
113
+ "id": "global::Function"
114
+ }
115
+ }
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": ""
122
+ }
123
+ },
124
+ "allowOptionalFields": {
125
+ "type": "boolean",
126
+ "mutable": false,
127
+ "complexType": {
128
+ "original": "boolean",
129
+ "resolved": "boolean",
130
+ "references": {}
131
+ },
132
+ "required": false,
133
+ "optional": true,
134
+ "docs": {
135
+ "tags": [],
136
+ "text": ""
137
+ },
138
+ "attribute": "allow-optional-fields",
139
+ "reflect": false
140
+ }
141
+ };
142
+ }
143
+ static get states() {
144
+ return {
145
+ "formController": {},
146
+ "errors": {},
147
+ "additional_questions": {}
148
+ };
149
+ }
150
+ static get events() {
151
+ return [{
152
+ "method": "submitted",
153
+ "name": "submitted",
154
+ "bubbles": true,
155
+ "cancelable": true,
156
+ "composed": true,
157
+ "docs": {
158
+ "tags": [],
159
+ "text": ""
160
+ },
161
+ "complexType": {
162
+ "original": "BusinessFormSubmitEvent",
163
+ "resolved": "BusinessFormSubmitEvent",
164
+ "references": {
165
+ "BusinessFormSubmitEvent": {
166
+ "location": "import",
167
+ "path": "../../utils/business-form-types",
168
+ "id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
169
+ }
170
+ }
171
+ }
172
+ }, {
173
+ "method": "formLoading",
174
+ "name": "formLoading",
175
+ "bubbles": true,
176
+ "cancelable": true,
177
+ "composed": true,
178
+ "docs": {
179
+ "tags": [],
180
+ "text": ""
181
+ },
182
+ "complexType": {
183
+ "original": "boolean",
184
+ "resolved": "boolean",
185
+ "references": {}
186
+ }
187
+ }, {
188
+ "method": "errorEvent",
189
+ "name": "error-event",
190
+ "bubbles": true,
191
+ "cancelable": true,
192
+ "composed": true,
193
+ "docs": {
194
+ "tags": [],
195
+ "text": ""
196
+ },
197
+ "complexType": {
198
+ "original": "ComponentError",
199
+ "resolved": "ComponentError",
200
+ "references": {
201
+ "ComponentError": {
202
+ "location": "import",
203
+ "path": "../../../../components",
204
+ "id": "src/components.d.ts::ComponentError"
205
+ }
206
+ }
207
+ }
208
+ }];
209
+ }
210
+ static get methods() {
211
+ return {
212
+ "validateAndSubmit": {
213
+ "complexType": {
214
+ "signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
215
+ "parameters": [{
216
+ "name": "__0",
217
+ "type": "{ onSuccess: any; }",
218
+ "docs": ""
219
+ }],
220
+ "references": {
221
+ "Promise": {
222
+ "location": "global",
223
+ "id": "global::Promise"
224
+ }
225
+ },
226
+ "return": "Promise<void>"
227
+ },
228
+ "docs": {
229
+ "text": "",
230
+ "tags": []
231
+ }
232
+ }
233
+ };
234
+ }
235
+ }