@justifi/webcomponents 4.10.0 → 4.12.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 (477) hide show
  1. package/dist/cjs/Business-f8e37adb.js +144 -0
  2. package/dist/cjs/{Payment-89a8bc21.js → Payment-eceed10f.js} +1 -0
  3. package/dist/cjs/{SubAccount-05867651.js → SubAccount-b3902202.js} +1 -1
  4. package/dist/cjs/additional-questions-details_5.cjs.entry.js +5 -6
  5. package/dist/cjs/business-additional-questions-schema-bdfd29c3.js +78 -0
  6. package/dist/cjs/business-details-core.cjs.entry.js +9 -4
  7. package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-61b8196a.js} +33 -0
  8. package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-date_4.cjs.entry.js} +70 -56
  9. package/dist/cjs/form-control-datepart.cjs.entry.js +80 -0
  10. package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
  11. package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +4 -46
  12. package/dist/cjs/{form-input-masks-e3bf2614.js → form-input-masks-baa06faf.js} +1 -1
  13. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +10 -5
  14. package/dist/cjs/{index-69b9386b.js → index-5d5f2219.js} +3 -0
  15. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +38 -26
  16. package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +20 -21
  17. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  18. package/dist/cjs/justifi-billing-form_4.cjs.entry.js +5 -5
  19. package/dist/cjs/justifi-business-details.cjs.entry.js +23 -7
  20. package/dist/cjs/justifi-business-form.cjs.entry.js +71 -54
  21. package/dist/cjs/justifi-business-list.cjs.entry.js +4 -6
  22. package/dist/cjs/justifi-business-owners.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  24. package/dist/cjs/justifi-checkout-core.cjs.entry.js +34 -24
  25. package/dist/cjs/justifi-checkout.cjs.entry.js +15 -11
  26. package/dist/cjs/justifi-details.cjs.entry.js +2 -2
  27. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +30 -6
  28. package/dist/cjs/{justifi-new-payment-method_3.cjs.entry.js → justifi-new-payment-method_4.cjs.entry.js} +95 -11
  29. package/dist/cjs/justifi-owner-form.cjs.entry.js +42 -20
  30. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +3 -4
  31. package/dist/cjs/justifi-payment-details.cjs.entry.js +29 -8
  32. package/dist/cjs/justifi-payment-form.cjs.entry.js +19 -7
  33. package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +2 -2
  34. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +25 -18
  35. package/dist/cjs/justifi-payments-list.cjs.entry.js +29 -9
  36. package/dist/cjs/justifi-payout-details.cjs.entry.js +31 -11
  37. package/dist/cjs/justifi-payouts-list.cjs.entry.js +30 -10
  38. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +3 -4
  39. package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -2
  40. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +5 -6
  41. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +4 -5
  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-32c43c76.js +144 -0
  45. package/dist/cjs/payment-details-core.cjs.entry.js +10 -5
  46. package/dist/cjs/{payment.service-0b0086dc.js → payment.service-9db24ab9.js} +1 -1
  47. package/dist/cjs/payments-list-core.cjs.entry.js +11 -6
  48. package/dist/cjs/payout-details-core.cjs.entry.js +11 -7
  49. package/dist/cjs/{payout.service-5cc3b4e9.js → payout.service-a0efb71a.js} +1 -1
  50. package/dist/cjs/payouts-list-core.cjs.entry.js +11 -6
  51. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +5 -6
  52. package/dist/cjs/subaccount-bank-details.cjs.entry.js +2 -2
  53. package/dist/cjs/subaccount-terms-details.cjs.entry.js +2 -2
  54. package/dist/cjs/{utils-23e70ef2.js → utils-6e35fa70.js} +1 -1
  55. package/dist/cjs/{utils-2b9940e1.js → utils-6f62f7a1.js} +0 -7
  56. package/dist/cjs/utils-f8079741.js +41 -0
  57. package/dist/cjs/{utils-df5167a8.js → utils-fc72268d.js} +8 -1
  58. package/dist/cjs/webcomponents.cjs.js +2 -2
  59. package/dist/collection/api/Business.js +3 -20
  60. package/dist/collection/api/Checkout.js +6 -1
  61. package/dist/collection/api/ComponentError.js +14 -0
  62. package/dist/collection/api/Identity.js +7 -4
  63. package/dist/collection/api/Payment.js +1 -0
  64. package/dist/collection/api/services/checkout.service.js +7 -3
  65. package/dist/collection/api/services/utils.js +11 -0
  66. package/dist/collection/api/shared.js +11 -1
  67. package/dist/collection/collection-manifest.json +3 -2
  68. package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +1 -1
  69. package/dist/collection/components/business-details/business-details-core.js +30 -2
  70. package/dist/collection/components/business-details/business-details.js +30 -0
  71. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +2 -2
  72. package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +1 -1
  73. package/dist/collection/components/business-details/get-business.js +15 -3
  74. package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +1 -1
  75. package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +1 -1
  76. package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +1 -1
  77. package/dist/collection/components/business-details/test/busines-details-core.spec.js +56 -16
  78. package/dist/collection/components/business-details/test/business-details.spec.js +20 -4
  79. package/dist/collection/components/business-details/test/get-business.spec.js +13 -6
  80. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
  81. package/dist/collection/components/business-forms/business-form/business-form.js +124 -50
  82. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +12 -12
  83. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -2
  84. package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.js → owner-form/identity-address/identity-address-form.js} +13 -10
  85. package/dist/collection/components/business-forms/owner-form/identity-address/test/identity-address.e2e.js +9 -0
  86. package/dist/collection/components/business-forms/{business-form/business-address/test/business-address.spec.js → owner-form/identity-address/test/identity-address.spec.js} +21 -14
  87. package/dist/collection/components/business-forms/owner-form/owner-form.js +75 -13
  88. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +20 -2
  89. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +21 -4
  90. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +44 -4
  91. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +31 -6
  92. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +23 -4
  93. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +74 -15
  94. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +15 -6
  95. package/dist/collection/components/business-forms/schemas/business-address-schema.js +40 -14
  96. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +55 -12
  97. package/dist/collection/components/business-forms/schemas/business-form-schema.js +4 -4
  98. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +40 -34
  99. package/dist/collection/components/business-forms/schemas/schema-helpers.js +8 -0
  100. package/dist/collection/components/business-forms/utils/business-form-types.js +30 -0
  101. package/dist/collection/components/business-forms/utils/helpers.js +22 -0
  102. package/dist/collection/components/business-forms/utils/payload-parsers.js +1 -0
  103. package/dist/collection/components/business-list/business-list.js +0 -2
  104. package/dist/collection/components/checkout/checkout-actions.js +2 -2
  105. package/dist/collection/components/checkout/checkout-core.css +361 -0
  106. package/dist/collection/components/checkout/checkout-core.js +32 -27
  107. package/dist/collection/components/checkout/checkout.js +5 -5
  108. package/dist/collection/components/checkout/new-payment-method.js +12 -6
  109. package/dist/collection/components/checkout/payment-method-options.css +18 -2
  110. package/dist/collection/components/checkout/payment-method-options.js +62 -5
  111. package/dist/collection/components/checkout/payment-method-payload.js +1 -0
  112. package/dist/collection/components/checkout/saved-payment-method.js +11 -6
  113. package/dist/collection/components/checkout/sezzel-payment-method.js +247 -0
  114. package/dist/collection/components/form/form-control-date.css +1803 -0
  115. package/dist/collection/components/form/form-control-date.js +192 -0
  116. package/dist/collection/components/form/form-control-text.js +35 -1
  117. package/dist/collection/components/form/utils.js +6 -0
  118. package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +17 -2
  119. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +30 -1
  120. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +35 -1
  121. package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +26 -8
  122. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +51 -11
  123. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +55 -3
  124. package/dist/collection/components/payment-details/get-payment-details.js +15 -3
  125. package/dist/collection/components/payment-details/payment-details-core.js +30 -1
  126. package/dist/collection/components/payment-details/payment-details.js +35 -1
  127. package/dist/collection/components/payment-details/test/get-payment-details.spec.js +11 -3
  128. package/dist/collection/components/payment-details/test/payment-details-core.spec.js +55 -12
  129. package/dist/collection/components/payment-details/test/payment-details.spec.js +69 -3
  130. package/dist/collection/components/payment-form/payment-form.js +54 -3
  131. package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
  132. package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
  133. package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
  134. package/dist/collection/components/payments-list/get-payments.js +15 -4
  135. package/dist/collection/components/payments-list/payments-list-core.js +28 -2
  136. package/dist/collection/components/payments-list/payments-list.js +35 -1
  137. package/dist/collection/components/payments-list/test/get-payments.spec.js +11 -3
  138. package/dist/collection/components/payments-list/test/payments-list-core.spec.js +43 -28
  139. package/dist/collection/components/payments-list/test/payments-list.spec.js +31 -3
  140. package/dist/collection/components/payout-details/get-payout-details.js +17 -6
  141. package/dist/collection/components/payout-details/payout-details-core.js +31 -3
  142. package/dist/collection/components/payout-details/payout-details.js +35 -1
  143. package/dist/collection/components/payout-details/test/get-payout-details.spec.js +15 -5
  144. package/dist/collection/components/payout-details/test/payout-details-core.spec.js +54 -16
  145. package/dist/collection/components/payout-details/test/payout-details.spec.js +50 -1
  146. package/dist/collection/components/payouts-list/get-payouts.js +17 -5
  147. package/dist/collection/components/payouts-list/payouts-list-core.js +28 -2
  148. package/dist/collection/components/payouts-list/payouts-list.js +34 -1
  149. package/dist/collection/components/payouts-list/test/get-payouts.spec.js +11 -3
  150. package/dist/collection/components/payouts-list/test/payouts-list-core.spec.js +42 -29
  151. package/dist/collection/components/payouts-list/test/payouts-list.spec.js +33 -0
  152. package/dist/collection/components/select-input/select-input.js +1 -1
  153. package/dist/collection/components/select-input/test/select-input.spec.js +4 -4
  154. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +3 -3
  155. package/dist/collection/components/text-input/test/text-input.spec.js +4 -4
  156. package/dist/collection/components/text-input/text-input.js +1 -1
  157. package/dist/collection/utils/form-input-masks.js +1 -1
  158. package/dist/collection/utils/utils.js +0 -5
  159. package/dist/docs.json +1583 -607
  160. package/dist/esm/Business-2410f7e3.js +136 -0
  161. package/dist/esm/{Payment-55886c86.js → Payment-ef9fc1ae.js} +1 -0
  162. package/dist/esm/{SubAccount-61ac70eb.js → SubAccount-f4ae9809.js} +1 -1
  163. package/dist/esm/additional-questions-details_5.entry.js +5 -6
  164. package/dist/esm/business-additional-questions-schema-5571d40f.js +75 -0
  165. package/dist/esm/business-details-core.entry.js +9 -4
  166. package/dist/esm/business-form-types-46ecd908.js +50 -0
  167. package/dist/esm/{form-control-datepart_3.entry.js → form-control-date_4.entry.js} +68 -55
  168. package/dist/esm/form-control-datepart.entry.js +76 -0
  169. package/dist/esm/form-control-monetary.entry.js +1 -1
  170. package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +5 -46
  171. package/dist/esm/{form-input-masks-a8187c77.js → form-input-masks-850c8cd4.js} +1 -1
  172. package/dist/esm/gross-payment-chart-core.entry.js +10 -5
  173. package/dist/esm/{index-df86d9a2.js → index-83dcf934.js} +3 -0
  174. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +36 -24
  175. package/dist/esm/justifi-additional-questions_4.entry.js +20 -21
  176. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  177. package/dist/esm/justifi-billing-form_4.entry.js +5 -5
  178. package/dist/esm/justifi-business-details.entry.js +23 -7
  179. package/dist/esm/justifi-business-form.entry.js +71 -54
  180. package/dist/esm/justifi-business-list.entry.js +4 -6
  181. package/dist/esm/justifi-business-owners.entry.js +2 -2
  182. package/dist/esm/justifi-card-form.entry.js +1 -1
  183. package/dist/esm/justifi-checkout-core.entry.js +34 -24
  184. package/dist/esm/justifi-checkout.entry.js +15 -11
  185. package/dist/esm/justifi-details.entry.js +2 -2
  186. package/dist/esm/justifi-gross-payment-chart.entry.js +29 -5
  187. package/dist/esm/{justifi-new-payment-method_3.entry.js → justifi-new-payment-method_4.entry.js} +95 -12
  188. package/dist/esm/justifi-owner-form.entry.js +42 -20
  189. package/dist/esm/justifi-payment-balance-transactions.entry.js +3 -4
  190. package/dist/esm/justifi-payment-details.entry.js +29 -8
  191. package/dist/esm/justifi-payment-form.entry.js +19 -7
  192. package/dist/esm/justifi-payment-method-selector.entry.js +2 -2
  193. package/dist/esm/justifi-payment-provisioning.entry.js +25 -18
  194. package/dist/esm/justifi-payments-list.entry.js +29 -9
  195. package/dist/esm/justifi-payout-details.entry.js +31 -11
  196. package/dist/esm/justifi-payouts-list.entry.js +30 -10
  197. package/dist/esm/justifi-proceeds-list.entry.js +3 -4
  198. package/dist/esm/justifi-refund-form.entry.js +2 -2
  199. package/dist/esm/justifi-subaccount-details.entry.js +5 -6
  200. package/dist/esm/justifi-subaccounts-list.entry.js +4 -5
  201. package/dist/esm/justifi-table_2.entry.js +1 -1
  202. package/dist/esm/loader.js +3 -3
  203. package/dist/esm/payload-parsers-192e0c3e.js +131 -0
  204. package/dist/esm/payment-details-core.entry.js +10 -5
  205. package/dist/esm/{payment.service-f274ef98.js → payment.service-ec28a959.js} +1 -1
  206. package/dist/esm/payments-list-core.entry.js +11 -6
  207. package/dist/esm/payout-details-core.entry.js +11 -7
  208. package/dist/esm/{payout.service-af293f61.js → payout.service-5fd5986c.js} +1 -1
  209. package/dist/esm/payouts-list-core.entry.js +11 -6
  210. package/dist/esm/subaccount-account-details_4.entry.js +5 -6
  211. package/dist/esm/subaccount-bank-details.entry.js +2 -2
  212. package/dist/esm/subaccount-terms-details.entry.js +2 -2
  213. package/dist/esm/{utils-d01c5f3a.js → utils-210fdf39.js} +1 -1
  214. package/dist/esm/{utils-d9e90399.js → utils-243abdb4.js} +1 -7
  215. package/dist/esm/utils-4609f32c.js +38 -0
  216. package/dist/esm/{utils-2828201a.js → utils-6f05d9d7.js} +8 -2
  217. package/dist/esm/webcomponents.js +3 -3
  218. package/dist/module/Business.js +48 -21
  219. package/dist/module/Payment.js +1 -0
  220. package/dist/module/SubAccount.js +1 -1
  221. package/dist/module/business-additional-questions-form-step.js +4 -2
  222. package/dist/module/business-additional-questions-schema.js +16 -7
  223. package/dist/module/business-address-schema.js +42 -16
  224. package/dist/module/business-core-info-form-step.js +5 -4
  225. package/dist/module/business-core-info-schema.js +56 -13
  226. package/dist/module/business-core-info.js +2 -2
  227. package/dist/module/business-details-core2.js +8 -3
  228. package/dist/module/business-form-types.js +32 -1
  229. package/dist/module/business-identity-schema.js +41 -35
  230. package/dist/module/business-owners-form-step.js +14 -10
  231. package/dist/module/business-representative-form-step.js +22 -13
  232. package/dist/module/business-representative.js +17 -17
  233. package/dist/module/checkout-core.js +50 -33
  234. package/dist/module/form-control-date.d.ts +11 -0
  235. package/dist/module/form-control-date.js +6 -0
  236. package/dist/module/form-control-date2.js +68 -0
  237. package/dist/module/form-control-text2.js +5 -1
  238. package/dist/module/form-input-masks.js +1 -1
  239. package/dist/module/generic-info-details2.js +2 -2
  240. package/dist/module/gross-payment-chart-core2.js +8 -2
  241. package/dist/module/helpers.js +25 -0
  242. package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
  243. package/dist/module/justifi-business-details.js +22 -5
  244. package/dist/module/justifi-business-form.js +81 -61
  245. package/dist/module/justifi-business-list.js +1 -3
  246. package/dist/module/justifi-checkout.js +31 -21
  247. package/dist/module/justifi-gross-payment-chart.js +28 -4
  248. package/dist/module/justifi-identity-address-form.d.ts +11 -0
  249. package/dist/module/justifi-identity-address-form.js +6 -0
  250. package/dist/module/justifi-payment-balance-transactions.js +1 -1
  251. package/dist/module/justifi-payment-details.js +26 -5
  252. package/dist/module/justifi-payment-form.js +18 -4
  253. package/dist/module/justifi-payment-provisioning.js +35 -27
  254. package/dist/module/justifi-payments-list.js +26 -6
  255. package/dist/module/justifi-payout-details.js +28 -8
  256. package/dist/module/justifi-payouts-list.js +27 -7
  257. package/dist/module/justifi-sezzel-payment-method.d.ts +11 -0
  258. package/dist/module/justifi-sezzel-payment-method.js +6 -0
  259. package/dist/module/justifi-subaccount-details.js +1 -1
  260. package/dist/module/justifi-subaccounts-list.js +1 -1
  261. package/dist/module/legal-address-form-step.js +10 -13
  262. package/dist/module/legal-address-form.js +5 -9
  263. package/dist/module/new-payment-method.js +5 -4
  264. package/dist/module/owner-form.js +46 -20
  265. package/dist/module/payload-parsers.js +11 -1
  266. package/dist/module/payment-details-core2.js +9 -3
  267. package/dist/module/payment-method-form.js +1 -1
  268. package/dist/module/payment-method-options.js +34 -12
  269. package/dist/module/payments-list-core2.js +9 -3
  270. package/dist/module/payout-details-core2.js +10 -5
  271. package/dist/module/payouts-list-core2.js +9 -3
  272. package/dist/module/saved-payment-method.js +4 -4
  273. package/dist/module/select-input2.js +1 -1
  274. package/dist/module/sezzel-payment-method.js +99 -0
  275. package/dist/module/subaccount-merchant-details2.js +3 -3
  276. package/dist/module/text-input2.js +1 -1
  277. package/dist/module/utils2.js +1 -7
  278. package/dist/module/utils3.js +31 -1
  279. package/dist/module/utils4.js +7 -1
  280. package/dist/types/api/Business.d.ts +0 -19
  281. package/dist/types/api/Checkout.d.ts +63 -2
  282. package/dist/types/api/ComponentError.d.ts +18 -0
  283. package/dist/types/api/Identity.d.ts +2 -0
  284. package/dist/types/api/Payment.d.ts +2 -1
  285. package/dist/types/api/SubAccount.d.ts +0 -2
  286. package/dist/types/api/services/checkout.service.d.ts +8 -2
  287. package/dist/types/api/services/utils.d.ts +2 -0
  288. package/dist/types/api/shared.d.ts +9 -0
  289. package/dist/types/components/business-details/business-details-core.d.ts +3 -0
  290. package/dist/types/components/business-details/business-details.d.ts +3 -0
  291. package/dist/types/components/business-forms/business-form/business-form.d.ts +9 -2
  292. package/dist/types/components/business-forms/business-form/business-representative/business-representative.d.ts +3 -3
  293. package/dist/types/components/business-forms/owner-form/identity-address/identity-address-form.d.ts +10 -0
  294. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +9 -3
  295. package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +1 -0
  296. package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +1 -0
  297. package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +3 -1
  298. package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +2 -0
  299. package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +1 -0
  300. package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +6 -2
  301. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +1 -1
  302. package/dist/types/components/business-forms/schemas/business-address-schema.d.ts +1 -12
  303. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +3 -3
  304. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +11 -11
  305. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +7 -37
  306. package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +6 -0
  307. package/dist/types/components/business-forms/utils/business-form-types.d.ts +15 -0
  308. package/dist/types/components/business-forms/utils/helpers.d.ts +8 -0
  309. package/dist/types/components/checkout/checkout-actions.d.ts +3 -3
  310. package/dist/types/components/checkout/checkout-core.d.ts +5 -4
  311. package/dist/types/components/checkout/checkout.d.ts +1 -1
  312. package/dist/types/components/checkout/new-payment-method.d.ts +2 -1
  313. package/dist/types/components/checkout/payment-method-options.d.ts +5 -1
  314. package/dist/types/components/checkout/payment-method-payload.d.ts +8 -0
  315. package/dist/types/components/checkout/saved-payment-method.d.ts +2 -1
  316. package/dist/types/components/checkout/sezzel-payment-method.d.ts +23 -0
  317. package/dist/types/components/form/form-control-date.d.ts +18 -0
  318. package/dist/types/components/form/form-control-text.d.ts +2 -0
  319. package/dist/types/components/form/utils.d.ts +1 -0
  320. package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +5 -8
  321. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +3 -0
  322. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -0
  323. package/dist/types/components/payment-details/payment-details-core.d.ts +3 -0
  324. package/dist/types/components/payment-details/payment-details.d.ts +4 -0
  325. package/dist/types/components/payment-form/payment-form.d.ts +4 -1
  326. package/dist/types/components/payments-list/payments-list-core.d.ts +2 -0
  327. package/dist/types/components/payments-list/payments-list.d.ts +4 -0
  328. package/dist/types/components/payout-details/payout-details-core.d.ts +3 -0
  329. package/dist/types/components/payout-details/payout-details.d.ts +4 -0
  330. package/dist/types/components/payouts-list/payouts-list-core.d.ts +2 -0
  331. package/dist/types/components/payouts-list/payouts-list.d.ts +4 -0
  332. package/dist/types/components.d.ts +329 -52
  333. package/dist/types/utils/utils.d.ts +0 -1
  334. package/dist/webcomponents/p-02fa533c.js +1 -0
  335. package/dist/webcomponents/p-0315876e.entry.js +1 -0
  336. package/dist/webcomponents/p-0c269feb.entry.js +1 -0
  337. package/dist/webcomponents/p-0eb56b44.entry.js +1 -0
  338. package/dist/webcomponents/p-0eb77101.entry.js +1 -0
  339. package/dist/webcomponents/p-1334f776.entry.js +1 -0
  340. package/dist/webcomponents/p-19001cc5.entry.js +1 -0
  341. package/dist/webcomponents/p-2319abaf.entry.js +1 -0
  342. package/dist/webcomponents/p-26fe62d6.entry.js +1 -0
  343. package/dist/webcomponents/p-28b38699.js +1 -0
  344. package/dist/webcomponents/{p-4df6174c.entry.js → p-29376518.entry.js} +1 -1
  345. package/dist/webcomponents/p-2bee72bd.entry.js +1 -0
  346. package/dist/webcomponents/p-3302bc76.js +1 -0
  347. package/dist/webcomponents/p-3adc0688.entry.js +1 -0
  348. package/dist/webcomponents/p-3fe05c4a.entry.js +1 -0
  349. package/dist/webcomponents/p-41b1ad3a.entry.js +1 -0
  350. package/dist/webcomponents/p-4616768c.entry.js +1 -0
  351. package/dist/webcomponents/p-56780f10.entry.js +1 -0
  352. package/dist/webcomponents/p-5c269619.js +1 -0
  353. package/dist/webcomponents/p-5ff7826e.entry.js +1 -0
  354. package/dist/webcomponents/{p-8482c23f.js → p-65510838.js} +1 -1
  355. package/dist/webcomponents/p-6f294d5d.js +1 -0
  356. package/dist/webcomponents/{p-4d50d08a.entry.js → p-7d8d2984.entry.js} +1 -1
  357. package/dist/webcomponents/p-7da249b8.entry.js +1 -0
  358. package/dist/webcomponents/p-84b9ffc9.entry.js +1 -0
  359. package/dist/webcomponents/{p-07b326d0.entry.js → p-8657128b.entry.js} +1 -1
  360. package/dist/webcomponents/p-8abba4c2.entry.js +1 -0
  361. package/dist/webcomponents/p-8c9d9812.entry.js +1 -0
  362. package/dist/webcomponents/p-910bb656.js +1 -0
  363. package/dist/webcomponents/p-9245777b.js +1 -0
  364. package/dist/webcomponents/{p-221b9504.entry.js → p-927150b4.entry.js} +1 -1
  365. package/dist/webcomponents/p-96cebc8b.entry.js +1 -0
  366. package/dist/webcomponents/{p-0e189d6a.entry.js → p-99d6b67e.entry.js} +1 -1
  367. package/dist/webcomponents/p-9e3f9e05.entry.js +1 -0
  368. package/dist/webcomponents/{p-688bb5da.js → p-9ee8ad4d.js} +1 -1
  369. package/dist/webcomponents/{p-a46174e0.entry.js → p-9f3facf1.entry.js} +1 -1
  370. package/dist/webcomponents/p-9f529959.entry.js +1 -0
  371. package/dist/webcomponents/{p-fb49ef28.entry.js → p-a6f170ba.entry.js} +1 -1
  372. package/dist/webcomponents/p-a8caec98.entry.js +1 -0
  373. package/dist/webcomponents/p-a90f7ca0.js +1 -0
  374. package/dist/webcomponents/p-abc03d5a.entry.js +1 -0
  375. package/dist/webcomponents/p-b318b899.js +1 -0
  376. package/dist/webcomponents/{p-1bfadb9f.entry.js → p-c1b92cec.entry.js} +1 -1
  377. package/dist/webcomponents/{p-a68519e5.entry.js → p-c556deda.entry.js} +1 -1
  378. package/dist/webcomponents/{p-3d4aaa4a.entry.js → p-c6e207f6.entry.js} +1 -1
  379. package/dist/webcomponents/{p-b68f1dd9.entry.js → p-cdfde1ca.entry.js} +1 -1
  380. package/dist/webcomponents/p-d69a485a.entry.js +1 -0
  381. package/dist/webcomponents/p-e2ba8d84.entry.js +1 -0
  382. package/dist/webcomponents/{p-ebf7c70f.entry.js → p-e4342f49.entry.js} +1 -1
  383. package/dist/webcomponents/p-ed72a5cc.js +1 -0
  384. package/dist/webcomponents/{p-6b51cf97.entry.js → p-f0698778.entry.js} +1 -1
  385. package/dist/webcomponents/p-f4ae621e.entry.js +1 -0
  386. package/dist/webcomponents/p-f76283a5.entry.js +19 -0
  387. package/dist/webcomponents/p-fce2b224.entry.js +1 -0
  388. package/dist/webcomponents/p-fd60d5af.js +1 -0
  389. package/dist/webcomponents/p-ff211f76.js +1 -0
  390. package/dist/webcomponents/webcomponents.css +1 -1
  391. package/dist/webcomponents/webcomponents.esm.js +1 -1
  392. package/package.json +1 -1
  393. package/dist/cjs/Business-663db337.js +0 -92
  394. package/dist/cjs/Identity-1c4528b8.js +0 -49
  395. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
  396. package/dist/cjs/business-form-select-options-7ccd8dca.js +0 -85
  397. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
  398. package/dist/cjs/payload-parsers-9e72e80f.js +0 -99
  399. package/dist/cjs/utils-f5d82f21.js +0 -10
  400. package/dist/collection/api/mockData/MockOnboardingData.js +0 -117
  401. package/dist/collection/api/mockData/MockPayments.js +0 -243
  402. package/dist/collection/api/mockData/MockSubAccount.js +0 -102
  403. package/dist/collection/api/mockData/mockGrossVolumeReport.js +0 -125
  404. package/dist/collection/components/business-forms/business-form/business-address/test/business-address.e2e.js +0 -9
  405. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +0 -2536
  406. package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +0 -97
  407. package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +0 -97
  408. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
  409. package/dist/collection/components/business-forms/utils/business-form-select-options.js +0 -80
  410. package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
  411. package/dist/esm/Business-6cc4e473.js +0 -87
  412. package/dist/esm/Identity-5f8f916f.js +0 -46
  413. package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
  414. package/dist/esm/business-form-select-options-6b9293fe.js +0 -82
  415. package/dist/esm/business-form-types-de9f38cd.js +0 -19
  416. package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
  417. package/dist/esm/payload-parsers-caea809d.js +0 -91
  418. package/dist/esm/utils-546ca6aa.js +0 -8
  419. package/dist/module/Identity.js +0 -46
  420. package/dist/module/business-form-select-options.js +0 -82
  421. package/dist/module/justifi-business-address-form-step.d.ts +0 -11
  422. package/dist/module/justifi-business-address-form-step.js +0 -75
  423. package/dist/module/justifi-business-address-form.d.ts +0 -11
  424. package/dist/module/justifi-business-address-form.js +0 -6
  425. package/dist/types/api/mockData/MockOnboardingData.d.ts +0 -8
  426. package/dist/types/api/mockData/MockPayments.d.ts +0 -3
  427. package/dist/types/api/mockData/MockSubAccount.d.ts +0 -3
  428. package/dist/types/components/business-forms/business-form/business-address/business-address-form.d.ts +0 -9
  429. package/dist/types/components/business-forms/payment-provisioning/business-address/business-address-form-step.d.ts +0 -9
  430. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +0 -33
  431. package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +0 -11
  432. package/dist/webcomponents/p-03b1d0d5.entry.js +0 -1
  433. package/dist/webcomponents/p-0923e39c.js +0 -1
  434. package/dist/webcomponents/p-16dcf053.entry.js +0 -1
  435. package/dist/webcomponents/p-17d72f4a.js +0 -1
  436. package/dist/webcomponents/p-2df32b4a.entry.js +0 -1
  437. package/dist/webcomponents/p-34352d04.js +0 -1
  438. package/dist/webcomponents/p-38ba2848.entry.js +0 -1
  439. package/dist/webcomponents/p-41870765.entry.js +0 -1
  440. package/dist/webcomponents/p-461f42b8.entry.js +0 -1
  441. package/dist/webcomponents/p-48c2400e.js +0 -1
  442. package/dist/webcomponents/p-491ca87f.js +0 -1
  443. package/dist/webcomponents/p-5be4e217.entry.js +0 -1
  444. package/dist/webcomponents/p-60714f2a.entry.js +0 -1
  445. package/dist/webcomponents/p-60b2344a.js +0 -1
  446. package/dist/webcomponents/p-63296409.js +0 -1
  447. package/dist/webcomponents/p-65500b31.entry.js +0 -19
  448. package/dist/webcomponents/p-6d39b8bc.entry.js +0 -1
  449. package/dist/webcomponents/p-6ed680e9.js +0 -1
  450. package/dist/webcomponents/p-7b2cddc7.js +0 -1
  451. package/dist/webcomponents/p-7ec301b5.entry.js +0 -1
  452. package/dist/webcomponents/p-817211f2.entry.js +0 -1
  453. package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
  454. package/dist/webcomponents/p-975ab96e.js +0 -1
  455. package/dist/webcomponents/p-9b99370e.js +0 -1
  456. package/dist/webcomponents/p-9e4b81ad.entry.js +0 -1
  457. package/dist/webcomponents/p-a141c531.js +0 -1
  458. package/dist/webcomponents/p-a2dbe90f.entry.js +0 -1
  459. package/dist/webcomponents/p-a4122c35.entry.js +0 -1
  460. package/dist/webcomponents/p-af8363a1.entry.js +0 -1
  461. package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
  462. package/dist/webcomponents/p-b37d6888.entry.js +0 -1
  463. package/dist/webcomponents/p-b5a3bf86.entry.js +0 -1
  464. package/dist/webcomponents/p-b8f22856.js +0 -1
  465. package/dist/webcomponents/p-cb8f9cb8.entry.js +0 -1
  466. package/dist/webcomponents/p-d0761829.entry.js +0 -1
  467. package/dist/webcomponents/p-da34bba7.entry.js +0 -1
  468. package/dist/webcomponents/p-dbe32e75.entry.js +0 -1
  469. package/dist/webcomponents/p-e0c1cba8.js +0 -1
  470. package/dist/webcomponents/p-e924f2e1.entry.js +0 -1
  471. package/dist/webcomponents/p-ea03b424.entry.js +0 -1
  472. package/dist/webcomponents/p-ec230480.entry.js +0 -1
  473. package/dist/webcomponents/p-eed5f4ad.entry.js +0 -1
  474. package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
  475. /package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.css → owner-form/identity-address/identity-address-form.css} +0 -0
  476. /package/dist/types/{api → home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil}/mockData/mockGrossVolumeReport.d.ts +0 -0
  477. /package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/{config.d.ts → packages/webcomponents/config.d.ts} +0 -0
@@ -1,7 +1,8 @@
1
1
  import { Payout } from "../../api";
2
- import { getErrorMessage } from "../../api/services/utils";
2
+ import { ComponentErrorSeverity } from "../../api/ComponentError";
3
+ import { getErrorCode, getErrorMessage } from "../../api/services/utils";
3
4
  export const makeGetPayouts = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
4
- var _a;
5
+ var _a, _b;
5
6
  try {
6
7
  const response = await service.fetchPayouts(id, authToken, params);
7
8
  if (!response.error) {
@@ -10,11 +11,22 @@ export const makeGetPayouts = ({ id, authToken, service }) => async ({ params, o
10
11
  onSuccess({ payouts, pagingInfo });
11
12
  }
12
13
  else {
13
- const responseError = getErrorMessage(response.error);
14
- return onError(responseError);
14
+ const error = getErrorMessage(response.error);
15
+ const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
16
+ return onError({
17
+ error,
18
+ code,
19
+ severity: ComponentErrorSeverity.ERROR,
20
+ });
15
21
  }
16
22
  }
17
23
  catch (error) {
18
- return onError(error.message || error);
24
+ const message = getErrorMessage(error);
25
+ const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
26
+ return onError({
27
+ error: message,
28
+ code,
29
+ severity: ComponentErrorSeverity.ERROR,
30
+ });
19
31
  }
20
32
  };
@@ -54,8 +54,13 @@ export class PayoutsListCore {
54
54
  this.paging = pagingInfo;
55
55
  this.loading = false;
56
56
  },
57
- onError: (errorMessage) => {
58
- this.errorMessage = errorMessage;
57
+ onError: ({ error, code, severity }) => {
58
+ this.errorMessage = error;
59
+ this.errorEvent.emit({
60
+ errorCode: code,
61
+ message: error,
62
+ severity
63
+ });
59
64
  this.loading = false;
60
65
  },
61
66
  });
@@ -167,6 +172,27 @@ export class PayoutsListCore {
167
172
  }
168
173
  }
169
174
  }
175
+ }, {
176
+ "method": "errorEvent",
177
+ "name": "error-event",
178
+ "bubbles": true,
179
+ "cancelable": true,
180
+ "composed": true,
181
+ "docs": {
182
+ "tags": [],
183
+ "text": ""
184
+ },
185
+ "complexType": {
186
+ "original": "ComponentError",
187
+ "resolved": "ComponentError",
188
+ "references": {
189
+ "ComponentError": {
190
+ "location": "import",
191
+ "path": "../../api/ComponentError",
192
+ "id": "src/api/ComponentError.ts::ComponentError"
193
+ }
194
+ }
195
+ }
170
196
  }];
171
197
  }
172
198
  static get watchers() {
@@ -3,6 +3,7 @@ import { tableExportedParts } from "../table/exported-parts";
3
3
  import { PayoutService } from "../../api/services/payout.service";
4
4
  import { makeGetPayouts } from "./get-payouts";
5
5
  import { ErrorState } from "../details/utils";
6
+ import { ComponentErrorCodes } from "../../api/ComponentError";
6
7
  /**
7
8
  * @exportedPart table-head: Table head
8
9
  * @exportedPart table-head-row: Head row
@@ -24,6 +25,10 @@ import { ErrorState } from "../details/utils";
24
25
  */
25
26
  export class PayoutsList {
26
27
  constructor() {
28
+ this.handleOnError = (event) => {
29
+ this.errorMessage = event.detail.message;
30
+ this.errorEvent.emit(event.detail);
31
+ };
27
32
  this.accountId = undefined;
28
33
  this.authToken = undefined;
29
34
  this.getPayouts = undefined;
@@ -45,13 +50,17 @@ export class PayoutsList {
45
50
  }
46
51
  else {
47
52
  this.errorMessage = 'Account ID and Auth Token are required';
53
+ this.errorEvent.emit({
54
+ errorCode: ComponentErrorCodes.MISSING_PROPS,
55
+ message: 'Account ID and Auth Token are required',
56
+ });
48
57
  }
49
58
  }
50
59
  render() {
51
60
  if (this.errorMessage) {
52
61
  return ErrorState(this.errorMessage);
53
62
  }
54
- return (h(Host, { exportedparts: tableExportedParts }, h("payouts-list-core", { getPayouts: this.getPayouts })));
63
+ return (h(Host, { exportedparts: tableExportedParts }, h("payouts-list-core", { getPayouts: this.getPayouts, "onError-event": this.handleOnError })));
55
64
  }
56
65
  static get is() { return "justifi-payouts-list"; }
57
66
  static get encapsulation() { return "shadow"; }
@@ -99,6 +108,30 @@ export class PayoutsList {
99
108
  "errorMessage": {}
100
109
  };
101
110
  }
111
+ static get events() {
112
+ return [{
113
+ "method": "errorEvent",
114
+ "name": "error-event",
115
+ "bubbles": true,
116
+ "cancelable": true,
117
+ "composed": true,
118
+ "docs": {
119
+ "tags": [],
120
+ "text": ""
121
+ },
122
+ "complexType": {
123
+ "original": "ComponentError",
124
+ "resolved": "ComponentError",
125
+ "references": {
126
+ "ComponentError": {
127
+ "location": "import",
128
+ "path": "../../api/ComponentError",
129
+ "id": "src/api/ComponentError.ts::ComponentError"
130
+ }
131
+ }
132
+ }
133
+ }];
134
+ }
102
135
  static get watchers() {
103
136
  return [{
104
137
  "propName": "accountId",
@@ -1,7 +1,7 @@
1
1
  import { Payout } from "../../../api";
2
2
  import { PayoutService } from "../../../api/services/payout.service";
3
3
  import { makeGetPayouts } from "../get-payouts";
4
- import mockResponse from "../../../api/mockData/mockPayoutsSuccess.json";
4
+ import mockResponse from "../../../../../../mockData/mockPayoutsSuccess.json";
5
5
  describe('makeGetPayouts', () => {
6
6
  const mockId = '123';
7
7
  const mockAuthToken = 'token';
@@ -43,7 +43,11 @@ describe('makeGetPayouts', () => {
43
43
  service: mockServiceInstance,
44
44
  });
45
45
  await getPayouts({ params: mockParams, onSuccess, onError });
46
- expect(onError).toHaveBeenCalledWith('Error fetching payouts');
46
+ expect(onError).toHaveBeenCalledWith({
47
+ code: 'fetch-error',
48
+ error: 'Error fetching payouts',
49
+ severity: 'error',
50
+ });
47
51
  expect(onSuccess).not.toHaveBeenCalled();
48
52
  });
49
53
  it('should call onError with an error message on API failure', async () => {
@@ -58,7 +62,11 @@ describe('makeGetPayouts', () => {
58
62
  service: mockServiceInstance,
59
63
  });
60
64
  await getPayouts({ params: mockParams, onSuccess, onError });
61
- expect(onError).toHaveBeenCalledWith('Error fetching payouts');
65
+ expect(onError).toHaveBeenCalledWith({
66
+ code: 'fetch-error',
67
+ error: 'Error fetching payouts',
68
+ severity: 'error',
69
+ });
62
70
  expect(onSuccess).not.toHaveBeenCalled();
63
71
  });
64
72
  });
@@ -1,8 +1,9 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { Table } from "../../table/table";
3
4
  import { PaginationMenu } from "../../pagination-menu/pagination-menu";
4
5
  import { PayoutsListCore } from "../payouts-list-core";
5
- import mockSuccessResponse from "../../../api/mockData/mockPayoutsSuccess.json";
6
+ import mockSuccessResponse from "../../../../../../mockData/mockPayoutsSuccess.json";
6
7
  import { makeGetPayouts } from "../get-payouts";
7
8
  const mockPayoutsResponse = mockSuccessResponse;
8
9
  describe('payouts-list-core', () => {
@@ -10,19 +11,15 @@ describe('payouts-list-core', () => {
10
11
  const mockPayoutService = {
11
12
  fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
12
13
  };
13
- const page = await newSpecPage({
14
- components: [PayoutsListCore, Table, PaginationMenu],
15
- html: `
16
- <payouts-list-core></payouts-list-core>
17
- `,
18
- });
19
- page.rootInstance.componentWillLoad = () => { };
20
- page.rootInstance.getPayouts = makeGetPayouts({
14
+ const getPayouts = makeGetPayouts({
21
15
  id: '123',
22
16
  authToken: '123',
23
17
  service: mockPayoutService
24
18
  });
25
- page.rootInstance.fetchData();
19
+ const page = await newSpecPage({
20
+ components: [PayoutsListCore, Table, PaginationMenu],
21
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
22
+ });
26
23
  await page.waitForChanges();
27
24
  const justifiTable = page.root.querySelector('justifi-table');
28
25
  const shadowRoot = justifiTable.shadowRoot;
@@ -41,11 +38,8 @@ describe('payouts-list-core', () => {
41
38
  });
42
39
  const page = await newSpecPage({
43
40
  components: [PayoutsListCore, Table, PaginationMenu],
44
- html: '<payouts-list-core></payouts-list-core>',
41
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
45
42
  });
46
- page.rootInstance.componentWillLoad = () => { };
47
- page.rootInstance.getPayouts = getPayouts;
48
- page.rootInstance.fetchData();
49
43
  await page.waitForChanges();
50
44
  const justifiTable = page.root.querySelector('justifi-table');
51
45
  const shadowRoot = justifiTable.shadowRoot;
@@ -53,21 +47,42 @@ describe('payouts-list-core', () => {
53
47
  expect(error).toBeTruthy();
54
48
  expect(page.root).toMatchSnapshot();
55
49
  });
56
- it('emits payout-row-clicked event on row click', async () => {
50
+ it('emits an error event on failed data fetch', async () => {
57
51
  const mockPayoutService = {
58
- fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
52
+ fetchPayouts: jest.fn().mockRejectedValue(new Error('Fetch error'))
59
53
  };
54
+ const getPayouts = makeGetPayouts({
55
+ id: 'some-id',
56
+ authToken: 'some-auth-token',
57
+ service: mockPayoutService
58
+ });
59
+ const errorSpy = jest.fn();
60
60
  const page = await newSpecPage({
61
61
  components: [PayoutsListCore, Table, PaginationMenu],
62
- html: '<payouts-list-core></payouts-list-core>',
62
+ template: () => h("payouts-list-core", { getPayouts: getPayouts, "onError-event": errorSpy }),
63
63
  });
64
- page.rootInstance.componentWillLoad = () => { };
65
- page.rootInstance.getPayouts = makeGetPayouts({
64
+ await page.waitForChanges();
65
+ expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
66
+ detail: {
67
+ errorCode: 'fetch-error',
68
+ message: 'Fetch error',
69
+ severity: 'error',
70
+ }
71
+ }));
72
+ });
73
+ it('emits payout-row-clicked event on row click', async () => {
74
+ const mockPayoutService = {
75
+ fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
76
+ };
77
+ const getPayouts = makeGetPayouts({
66
78
  id: '123',
67
79
  authToken: '123',
68
80
  service: mockPayoutService
69
81
  });
70
- page.rootInstance.fetchData();
82
+ const page = await newSpecPage({
83
+ components: [PayoutsListCore, Table, PaginationMenu],
84
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
85
+ });
71
86
  await page.waitForChanges();
72
87
  const rowClickedHandler = jest.fn();
73
88
  page.win.addEventListener('payout-row-clicked', rowClickedHandler);
@@ -83,22 +98,20 @@ describe('payouts-list-core', () => {
83
98
  const mockPayoutService = {
84
99
  fetchPayouts: jest.fn().mockResolvedValue(mockPayoutsResponse),
85
100
  };
86
- const page = await newSpecPage({
87
- components: [PayoutsListCore, Table, PaginationMenu],
88
- html: `<payouts-list-core></payouts-list-core>`,
89
- });
90
- page.rootInstance.componentWillLoad = () => { };
91
- page.rootInstance.getPayouts = makeGetPayouts({
101
+ const getPayouts = makeGetPayouts({
92
102
  id: '123',
93
103
  authToken: '123',
94
104
  service: mockPayoutService
95
105
  });
96
- page.rootInstance.fetchData();
106
+ const page = await newSpecPage({
107
+ components: [PayoutsListCore, Table, PaginationMenu],
108
+ template: () => h("payouts-list-core", { getPayouts: getPayouts }),
109
+ });
97
110
  await page.waitForChanges();
98
111
  page.rootInstance.handleClickNext('nextCursor');
99
112
  await page.waitForChanges();
100
- // The mock function should be called 3 times: once for the initial load, twice for when mockGetPayouts is set and later after the pagination interaction
101
- expect(mockPayoutService.fetchPayouts).toHaveBeenCalledTimes(3);
113
+ // The mock function should be called 2 times: once for the initial load and later after the pagination interaction
114
+ expect(mockPayoutService.fetchPayouts).toHaveBeenCalledTimes(2);
102
115
  const updatedParams = page.rootInstance.params;
103
116
  expect(updatedParams.after_cursor).toBe('nextCursor');
104
117
  });
@@ -1,6 +1,9 @@
1
+ import { h } from "@stencil/core";
1
2
  import { newSpecPage } from "@stencil/core/testing";
2
3
  import { PayoutsList } from "../payouts-list";
3
4
  import { PayoutsListCore } from "../payouts-list-core";
5
+ import { PayoutService } from "../../../api/services/payout.service";
6
+ jest.mock('../../../api/services/payout.service');
4
7
  describe('payouts-list', () => {
5
8
  it('renders an error message when accountId and authToken are not provided', async () => {
6
9
  const page = await newSpecPage({
@@ -26,4 +29,34 @@ describe('payouts-list', () => {
26
29
  await page.waitForChanges();
27
30
  expect(page.root).toMatchSnapshot();
28
31
  });
32
+ it('emits an error event when accountId and authToken are not provided', async () => {
33
+ const onErrorSpy = jest.fn();
34
+ const page = await newSpecPage({
35
+ components: [PayoutsList, PayoutsListCore],
36
+ template: () => h("justifi-payouts-list", { "onError-event": onErrorSpy }),
37
+ });
38
+ await page.waitForChanges();
39
+ expect(onErrorSpy).toHaveBeenCalledWith(expect.objectContaining({
40
+ detail: {
41
+ errorCode: 'missing-props',
42
+ message: 'Account ID and Auth Token are required',
43
+ },
44
+ }));
45
+ });
46
+ it('emits an error event when fetch fails', async () => {
47
+ PayoutService.prototype.fetchPayouts = jest.fn().mockRejectedValue(new Error('Fetch error'));
48
+ const onErrorSpy = jest.fn();
49
+ const page = await newSpecPage({
50
+ components: [PayoutsList, PayoutsListCore],
51
+ template: () => (h("justifi-payouts-list", { "account-id": "abc", "auth-token": "abc", "onError-event": onErrorSpy })),
52
+ });
53
+ await page.waitForChanges();
54
+ expect(onErrorSpy).toHaveBeenCalledWith(expect.objectContaining({
55
+ detail: {
56
+ errorCode: 'fetch-error',
57
+ message: 'Fetch error',
58
+ severity: 'error',
59
+ },
60
+ }));
61
+ });
29
62
  });
@@ -14,7 +14,7 @@ export class SelectInput {
14
14
  this.fieldReceivedInput.emit({ name: name, value: target.value });
15
15
  }
16
16
  render() {
17
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label" }, this.label), h("select", { name: this.name, onInput: event => this.onInput(event), part: `input${this.error ? ' input-invalid' : ''}`, class: this.error ? 'form-select is-invalid' : 'form-select' }, this.options.map(option => (h("option", { value: option.value }, option.label)))), this.error && h("div", { class: "invalid-feedback" }, this.error)));
17
+ return (h(Host, { exportparts: "label,input,input-invalid,invalid-feedback" }, h("label", { part: "label", class: "form-label" }, this.label), h("select", { name: this.name, onInput: event => this.onInput(event), part: `input${this.error ? ' input-invalid' : ''}`, class: this.error ? 'form-select is-invalid' : 'form-select' }, this.options.map(option => (h("option", { value: option.value }, option.label)))), this.error && h("div", { class: "invalid-feedback", part: "invalid-feedback" }, this.error)));
18
18
  }
19
19
  static get is() { return "select-input"; }
20
20
  static get encapsulation() { return "shadow"; }
@@ -15,7 +15,7 @@ describe('select-input', () => {
15
15
  ];
16
16
  await page.waitForChanges();
17
17
  expect(page.root).toEqualHtml(`
18
- <select-input exportparts="label,input,input-invalid">
18
+ <select-input exportparts="label,input,input-invalid,invalid-feedback">
19
19
  <mock:shadow-root>
20
20
  <label part="label" class="form-label"></label>
21
21
  <select class="form-select" part="input">
@@ -38,7 +38,7 @@ describe('select-input', () => {
38
38
  root.options = [{ label: 'Option 1', value: '1' }];
39
39
  await page.waitForChanges();
40
40
  expect(root).toEqualHtml(`
41
- <select-input exportparts="label,input,input-invalid" label="Test Label" name="test">
41
+ <select-input exportparts="label,input,input-invalid,invalid-feedback" label="Test Label" name="test">
42
42
  <mock:shadow-root>
43
43
  <label part="label" class="form-label">Test Label</label>
44
44
  <select class="form-select" name="test" part="input">
@@ -65,11 +65,11 @@ describe('select-input', () => {
65
65
  page.root.error = 'Test Error';
66
66
  await page.waitForChanges();
67
67
  expect(page.root).toEqualHtml(`
68
- <select-input exportparts="label,input,input-invalid">
68
+ <select-input exportparts="label,input,input-invalid,invalid-feedback">
69
69
  <mock:shadow-root>
70
70
  <label part="label" class="form-label"></label>
71
71
  <select class="form-select is-invalid" part="input input-invalid"></select>
72
- <div class="invalid-feedback">
72
+ <div class="invalid-feedback" part="invalid-feedback">
73
73
  Test Error
74
74
  </div>
75
75
  </mock:shadow-root>
@@ -1,13 +1,13 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { DetailItem, DetailSectionTitle } from "../../details/utils";
3
- import { formatLegalAddress, snakeCaseToHumanReadable } from "../../../utils/utils";
3
+ import { formatLegalAddress } from "../../../utils/utils";
4
4
  export class SubaccountMerchantDetails {
5
5
  constructor() {
6
6
  this.onboardingData = undefined;
7
7
  }
8
8
  render() {
9
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
10
- return (h(Host, null, h("div", { class: 'p-2' }, h(DetailSectionTitle, { sectionTitle: 'Merchant Details' }), h("div", { class: "d-table gap-2 w-100" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: 'Doing Business As', value: (_d = (_c = (_b = (_a = this.onboardingData) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.business_details) === null || _c === void 0 ? void 0 : _c.doing_business_as) === null || _d === void 0 ? void 0 : _d.name }), h(DetailItem, { title: 'Website', value: (_g = (_f = (_e = this.onboardingData) === null || _e === void 0 ? void 0 : _e.payload) === null || _f === void 0 ? void 0 : _f.business_details) === null || _g === void 0 ? void 0 : _g.url }), h(DetailItem, { title: 'Business Email', value: (_k = (_j = (_h = this.onboardingData) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.business_details) === null || _k === void 0 ? void 0 : _k.email }), h(DetailItem, { title: 'Phone Number', value: (_o = (_m = (_l = this.onboardingData) === null || _l === void 0 ? void 0 : _l.payload) === null || _m === void 0 ? void 0 : _m.business_details) === null || _o === void 0 ? void 0 : _o.phone }), h(DetailItem, { title: 'Address', value: ((_r = (_q = (_p = this.onboardingData) === null || _p === void 0 ? void 0 : _p.payload) === null || _q === void 0 ? void 0 : _q.business_details) === null || _r === void 0 ? void 0 : _r.legal) ? `${formatLegalAddress((_u = (_t = (_s = this.onboardingData) === null || _s === void 0 ? void 0 : _s.payload) === null || _t === void 0 ? void 0 : _t.business_details) === null || _u === void 0 ? void 0 : _u.legal)}` : '' })), h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: 'Business Structure', value: ((_x = (_w = (_v = this.onboardingData) === null || _v === void 0 ? void 0 : _v.payload) === null || _w === void 0 ? void 0 : _w.business_details) === null || _x === void 0 ? void 0 : _x.structure) ? snakeCaseToHumanReadable((_0 = (_z = (_y = this.onboardingData) === null || _y === void 0 ? void 0 : _y.payload) === null || _z === void 0 ? void 0 : _z.business_details) === null || _0 === void 0 ? void 0 : _0.structure) : '' }), h(DetailItem, { title: 'Business Type', value: (_3 = (_2 = (_1 = this.onboardingData) === null || _1 === void 0 ? void 0 : _1.payload) === null || _2 === void 0 ? void 0 : _2.business_details) === null || _3 === void 0 ? void 0 : _3.type })))))));
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
10
+ return (h(Host, null, h("div", { class: 'p-2' }, h(DetailSectionTitle, { sectionTitle: 'Merchant Details' }), h("div", { class: "d-table gap-2 w-100" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: 'Doing Business As', value: (_d = (_c = (_b = (_a = this.onboardingData) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.business_details) === null || _c === void 0 ? void 0 : _c.doing_business_as) === null || _d === void 0 ? void 0 : _d.name }), h(DetailItem, { title: 'Website', value: (_g = (_f = (_e = this.onboardingData) === null || _e === void 0 ? void 0 : _e.payload) === null || _f === void 0 ? void 0 : _f.business_details) === null || _g === void 0 ? void 0 : _g.url }), h(DetailItem, { title: 'Business Email', value: (_k = (_j = (_h = this.onboardingData) === null || _h === void 0 ? void 0 : _h.payload) === null || _j === void 0 ? void 0 : _j.business_details) === null || _k === void 0 ? void 0 : _k.email }), h(DetailItem, { title: 'Phone Number', value: (_o = (_m = (_l = this.onboardingData) === null || _l === void 0 ? void 0 : _l.payload) === null || _m === void 0 ? void 0 : _m.business_details) === null || _o === void 0 ? void 0 : _o.phone }), h(DetailItem, { title: 'Address', value: ((_r = (_q = (_p = this.onboardingData) === null || _p === void 0 ? void 0 : _p.payload) === null || _q === void 0 ? void 0 : _q.business_details) === null || _r === void 0 ? void 0 : _r.legal) ? `${formatLegalAddress((_u = (_t = (_s = this.onboardingData) === null || _s === void 0 ? void 0 : _s.payload) === null || _t === void 0 ? void 0 : _t.business_details) === null || _u === void 0 ? void 0 : _u.legal)}` : '' })), h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: 'Business Type', value: (_x = (_w = (_v = this.onboardingData) === null || _v === void 0 ? void 0 : _v.payload) === null || _w === void 0 ? void 0 : _w.business_details) === null || _x === void 0 ? void 0 : _x.type })))))));
11
11
  }
12
12
  static get is() { return "subaccount-merchant-details"; }
13
13
  static get encapsulation() { return "shadow"; }
@@ -7,7 +7,7 @@ describe('text-input', () => {
7
7
  html: `<text-input></text-input>`,
8
8
  });
9
9
  expect(page.root).toEqualHtml(`
10
- <text-input exportparts="label,input,input-invalid">
10
+ <text-input exportparts="label,input,input-invalid,invalid-feedback">
11
11
  <mock:shadow-root>
12
12
  <label class="form-label" part="label"></label>
13
13
  <input class="form-control" part="input" type="text">
@@ -21,7 +21,7 @@ describe('text-input', () => {
21
21
  html: `<text-input name="test" label="Test" default-value="Hello"></text-input>`,
22
22
  });
23
23
  expect(page.root).toEqualHtml(`
24
- <text-input name="test" label="Test" default-value="Hello" exportparts="label,input,input-invalid">
24
+ <text-input name="test" label="Test" default-value="Hello" exportparts="label,input,input-invalid,invalid-feedback">
25
25
  <mock:shadow-root>
26
26
  <label class="form-label" part="label">Test</label>
27
27
  <input class="form-control" name="test" part="input" type="text" value="Hello">
@@ -35,11 +35,11 @@ describe('text-input', () => {
35
35
  html: `<text-input error="Something went wrong"></text-input>`,
36
36
  });
37
37
  expect(page.root).toEqualHtml(`
38
- <text-input error="Something went wrong" exportparts="label,input,input-invalid">
38
+ <text-input error="Something went wrong" exportparts="label,input,input-invalid,invalid-feedback">
39
39
  <mock:shadow-root>
40
40
  <label class="form-label" part="label"></label>
41
41
  <input class="form-control is-invalid" part="input input-invalid" type="text">
42
- <div class="invalid-feedback">Something went wrong</div>
42
+ <div class="invalid-feedback" part="invalid-feedback">Something went wrong</div>
43
43
  </mock:shadow-root>
44
44
  </text-input>
45
45
  `);
@@ -13,7 +13,7 @@ export class TextInput {
13
13
  this.fieldReceivedInput.emit({ name: name, value: target.value });
14
14
  }
15
15
  render() {
16
- return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label" }, this.label), h("input", { name: this.name, type: "text", onInput: event => this.onInput(event), value: this.internalValue || this.defaultValue, part: `input${this.error ? ' input-invalid' : ''}`, class: this.error ? 'form-control is-invalid' : 'form-control' }), this.error && h("div", { class: "invalid-feedback" }, this.error)));
16
+ return (h(Host, { exportparts: "label,input,input-invalid,invalid-feedback" }, h("label", { part: "label", class: "form-label" }, this.label), h("input", { name: this.name, type: "text", onInput: event => this.onInput(event), value: this.internalValue || this.defaultValue, part: `input${this.error ? ' input-invalid' : ''}`, class: this.error ? 'form-control is-invalid' : 'form-control' }), this.error && h("div", { class: "invalid-feedback", part: "invalid-feedback" }, this.error)));
17
17
  }
18
18
  static get is() { return "text-input"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -1,4 +1,4 @@
1
1
  export const PHONE_MASKS = {
2
2
  US: '(000) 000-0000',
3
3
  };
4
- export const TAX_ID_MASKS = { US: '00-000000000' };
4
+ export const TAX_ID_MASKS = { US: '00-0000000' };
@@ -1,6 +1,5 @@
1
1
  import { format } from "date-fns";
2
2
  import Dinero from "dinero.js";
3
- import StateOptions from "./state-options";
4
3
  export const RegExZip = /^\d{5}/;
5
4
  export function formatCurrency(amount, withSymbol = true) {
6
5
  if (!amount)
@@ -204,7 +203,3 @@ export async function loadFontsOnParent() {
204
203
  export function isEmptyObject(obj) {
205
204
  return Object.keys(obj).length === 0 && obj.constructor === Object;
206
205
  }
207
- export function getStateAbbreviation(stateName) {
208
- const state = StateOptions.find(s => s.label === stateName);
209
- return state ? state.value : stateName;
210
- }