@justifi/webcomponents 4.4.0 → 4.5.1

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 (487) hide show
  1. package/dist/cjs/{Api-7303478d.js → Api-d2df6e84.js} +16 -4
  2. package/dist/cjs/Api-d2df6e84.js.map +1 -0
  3. package/dist/cjs/Payout-4906a445.js +116 -0
  4. package/dist/cjs/Payout-4906a445.js.map +1 -0
  5. package/dist/cjs/{business-form-schema-63b311b2.js → business-form-schema-725ec6f5.js} +40 -22
  6. package/dist/cjs/business-form-schema-725ec6f5.js.map +1 -0
  7. package/dist/cjs/form-control-datepart_2.cjs.entry.js +107 -0
  8. package/dist/cjs/form-control-datepart_2.cjs.entry.js.map +1 -0
  9. package/dist/cjs/form-control-monetary.cjs.entry.js +65 -0
  10. package/dist/cjs/form-control-monetary.cjs.entry.js.map +1 -0
  11. package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +99 -12
  12. package/dist/cjs/form-control-number_3.cjs.entry.js.map +1 -0
  13. package/dist/cjs/form-control-select.cjs.entry.js +47 -0
  14. package/dist/cjs/form-control-select.cjs.entry.js.map +1 -0
  15. package/dist/cjs/{index-83b2ec02.js → index-3533152c.js} +10 -6
  16. package/dist/cjs/index-3533152c.js.map +1 -0
  17. package/dist/cjs/index-5a880722.js +3233 -0
  18. package/dist/cjs/index-5a880722.js.map +1 -0
  19. package/dist/cjs/{index.esm-7e12ce07.js → index.esm-84a0a7a8.js} +1 -19
  20. package/dist/cjs/index.esm-84a0a7a8.js.map +1 -0
  21. package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +396 -0
  22. package/dist/cjs/justifi-additional-questions_5.cjs.entry.js.map +1 -0
  23. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
  24. package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -1
  25. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-business-form.cjs.entry.js +98 -16
  27. package/dist/cjs/justifi-business-form.cjs.entry.js.map +1 -1
  28. package/dist/cjs/justifi-business-list.cjs.entry.js +189 -0
  29. package/dist/cjs/justifi-business-list.cjs.entry.js.map +1 -0
  30. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
  31. package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -1
  32. package/dist/cjs/justifi-details.cjs.entry.js +30 -0
  33. package/dist/cjs/justifi-details.cjs.entry.js.map +1 -0
  34. package/dist/cjs/justifi-payment-details.cjs.entry.js +63 -0
  35. package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -0
  36. package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
  37. package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -1
  38. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1487 -19
  39. package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
  40. package/dist/cjs/justifi-payments-list.cjs.entry.js +49 -47
  41. package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
  42. package/dist/cjs/justifi-payout-details.cjs.entry.js +61 -0
  43. package/dist/cjs/justifi-payout-details.cjs.entry.js.map +1 -0
  44. package/dist/cjs/justifi-payouts-list.cjs.entry.js +64 -54
  45. package/dist/cjs/justifi-payouts-list.cjs.entry.js.map +1 -1
  46. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +156 -0
  47. package/dist/cjs/justifi-proceeds-list.cjs.entry.js.map +1 -0
  48. package/dist/cjs/justifi-table.cjs.entry.js +68 -0
  49. package/dist/cjs/justifi-table.cjs.entry.js.map +1 -0
  50. package/dist/cjs/loader.cjs.js +2 -2
  51. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  52. package/dist/cjs/table-utils-617126e5.js +13 -0
  53. package/dist/cjs/table-utils-617126e5.js.map +1 -0
  54. package/dist/cjs/{utils-4ee7e080.js → utils-0fd61dbd.js} +43 -104
  55. package/dist/cjs/utils-0fd61dbd.js.map +1 -0
  56. package/dist/cjs/utils-d95b09c2.js +35 -0
  57. package/dist/cjs/utils-d95b09c2.js.map +1 -0
  58. package/dist/cjs/webcomponents.cjs.js +3 -3
  59. package/dist/cjs/webcomponents.cjs.js.map +1 -1
  60. package/dist/collection/api/Api.js +15 -3
  61. package/dist/collection/api/Api.js.map +1 -1
  62. package/dist/collection/api/Business.js +50 -0
  63. package/dist/collection/api/Business.js.map +1 -0
  64. package/dist/collection/api/Payment.js.map +1 -1
  65. package/dist/collection/api/Payout.js +9 -0
  66. package/dist/collection/api/Payout.js.map +1 -1
  67. package/dist/collection/api/Proceed.js +42 -0
  68. package/dist/collection/api/Proceed.js.map +1 -0
  69. package/dist/collection/api/shared.js +2 -0
  70. package/dist/collection/api/shared.js.map +1 -0
  71. package/dist/collection/collection-manifest.json +13 -1
  72. package/dist/collection/components/bank-account-form/bank-account-form.js +6 -1
  73. package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -1
  74. package/dist/collection/components/bank-account-form/bank-account-form.stories.js +8 -0
  75. package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
  76. package/dist/collection/components/business-form/additional-questions/additional-questions.js +59 -0
  77. package/dist/collection/components/business-form/additional-questions/additional-questions.js.map +1 -0
  78. package/dist/collection/components/business-form/business-address/business-address-form.js +1 -1
  79. package/dist/collection/components/business-form/business-address/business-address-form.js.map +1 -1
  80. package/dist/collection/components/business-form/business-address/test/business-address.spec.js +22 -18
  81. package/dist/collection/components/business-form/business-address/test/business-address.spec.js.map +1 -1
  82. package/dist/collection/components/business-form/business-form-schema.js +48 -37
  83. package/dist/collection/components/business-form/business-form-schema.js.map +1 -1
  84. package/dist/collection/components/business-form/business-form.css +5283 -43
  85. package/dist/collection/components/business-form/business-form.js +83 -6
  86. package/dist/collection/components/business-form/business-form.js.map +1 -1
  87. package/dist/collection/components/business-form/{businessForm.stories.js → business-form.stories.js} +8 -8
  88. package/dist/collection/components/business-form/business-form.stories.js.map +1 -0
  89. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +10 -17
  90. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map +1 -1
  91. package/dist/collection/components/business-form/business-owners/business-owners.css +5283 -0
  92. package/dist/collection/components/business-form/business-owners/business-owners.js +48 -37
  93. package/dist/collection/components/business-form/business-owners/business-owners.js.map +1 -1
  94. package/dist/collection/components/business-form/business-representative/business-representative.js +12 -17
  95. package/dist/collection/components/business-form/business-representative/business-representative.js.map +1 -1
  96. package/dist/collection/components/business-form/test/business-form.spec.js +44 -0
  97. package/dist/collection/components/business-form/test/business-form.spec.js.map +1 -0
  98. package/dist/collection/components/business-list/business-list.css +576 -0
  99. package/dist/collection/components/business-list/business-list.js +209 -0
  100. package/dist/collection/components/business-list/business-list.js.map +1 -0
  101. package/dist/collection/components/business-list/business-list.stories.js +68 -0
  102. package/dist/collection/components/business-list/business-list.stories.js.map +1 -0
  103. package/dist/collection/components/business-list/example.js +12 -0
  104. package/dist/collection/components/card-form/card-form.js +6 -1
  105. package/dist/collection/components/card-form/card-form.js.map +1 -1
  106. package/dist/collection/components/card-form/card-form.stories.js +8 -0
  107. package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
  108. package/dist/collection/components/details/details.css +7983 -0
  109. package/dist/collection/components/details/details.js +66 -0
  110. package/dist/collection/components/details/details.js.map +1 -0
  111. package/dist/collection/components/details/utils.js +10 -0
  112. package/dist/collection/components/details/utils.js.map +1 -0
  113. package/dist/collection/components/form/form-control-datepart.js +233 -0
  114. package/dist/collection/components/form/form-control-datepart.js.map +1 -0
  115. package/dist/collection/components/form/form-control-monetary.js +186 -0
  116. package/dist/collection/components/form/form-control-monetary.js.map +1 -0
  117. package/dist/collection/components/form/form-control-number-masked.js +217 -0
  118. package/dist/collection/components/form/form-control-number-masked.js.map +1 -0
  119. package/dist/collection/components/form/form-control-number.css +1818 -0
  120. package/dist/collection/components/form/form-control-number.js +194 -0
  121. package/dist/collection/components/form/form-control-number.js.map +1 -0
  122. package/dist/collection/components/form/form-control-select.css +6 -0
  123. package/dist/collection/components/form/form-control-select.js +36 -4
  124. package/dist/collection/components/form/form-control-select.js.map +1 -1
  125. package/dist/collection/components/form/form-control-text.css +7 -0
  126. package/dist/collection/components/form/form-control-text.js +45 -3
  127. package/dist/collection/components/form/form-control-text.js.map +1 -1
  128. package/dist/collection/components/form/form.js +16 -8
  129. package/dist/collection/components/form/form.js.map +1 -1
  130. package/dist/collection/components/legal-address-form/legal-address-form-schema.js +11 -0
  131. package/dist/collection/components/legal-address-form/legal-address-form-schema.js.map +1 -0
  132. package/dist/collection/components/legal-address-form/legal-address-form.css +2489 -0
  133. package/dist/collection/components/legal-address-form/legal-address-form.js +90 -0
  134. package/dist/collection/components/legal-address-form/legal-address-form.js.map +1 -0
  135. package/dist/collection/components/payment-details/example.js +12 -0
  136. package/dist/collection/components/payment-details/payment-details.css +7983 -0
  137. package/dist/collection/components/payment-details/payment-details.js +129 -0
  138. package/dist/collection/components/payment-details/payment-details.js.map +1 -0
  139. package/dist/collection/components/payment-details/payment-details.stories.js +47 -0
  140. package/dist/collection/components/payment-details/payment-details.stories.js.map +1 -0
  141. package/dist/collection/components/payment-method-form/payment-method-form.css +5 -0
  142. package/dist/collection/components/payment-method-form/payment-method-form.js +25 -35
  143. package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -1
  144. package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +7 -7
  145. package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -1
  146. package/dist/collection/components/payments-list/payments-list.css +0 -7380
  147. package/dist/collection/components/payments-list/payments-list.js +69 -43
  148. package/dist/collection/components/payments-list/payments-list.js.map +1 -1
  149. package/dist/collection/components/payments-list/payments-list.stories.js +10 -10
  150. package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
  151. package/dist/collection/components/payments-list/test/payments-list.spec.js +3 -54
  152. package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -1
  153. package/dist/collection/components/payout-details/example.js +12 -0
  154. package/dist/collection/components/payout-details/payout-details.css +7983 -0
  155. package/dist/collection/components/payout-details/payout-details.js +126 -0
  156. package/dist/collection/components/payout-details/payout-details.js.map +1 -0
  157. package/dist/collection/components/payout-details/payout-details.stories.js +47 -0
  158. package/dist/collection/components/payout-details/payout-details.stories.js.map +1 -0
  159. package/dist/collection/components/payouts-list/example.js +12 -0
  160. package/dist/collection/components/payouts-list/payouts-list.css +0 -7407
  161. package/dist/collection/components/payouts-list/payouts-list.js +82 -48
  162. package/dist/collection/components/payouts-list/payouts-list.js.map +1 -1
  163. package/dist/collection/components/payouts-list/payouts-list.stories.js +10 -10
  164. package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
  165. package/dist/collection/components/proceeds-list/example.js +12 -0
  166. package/dist/collection/components/proceeds-list/proceeds-list.css +576 -0
  167. package/dist/collection/components/proceeds-list/proceeds-list.js +207 -0
  168. package/dist/collection/components/proceeds-list/proceeds-list.js.map +1 -0
  169. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +69 -0
  170. package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -0
  171. package/dist/collection/components/table/table-utils.js +8 -0
  172. package/dist/collection/components/table/table-utils.js.map +1 -0
  173. package/dist/collection/components/table/table.css +8077 -0
  174. package/dist/collection/components/table/table.js +215 -0
  175. package/dist/collection/components/table/table.js.map +1 -0
  176. package/dist/collection/components/table/test/table.spec.js +59 -0
  177. package/dist/collection/components/table/test/table.spec.js.map +1 -0
  178. package/dist/collection/utils/country-options.js +202 -0
  179. package/dist/collection/utils/country-options.js.map +1 -0
  180. package/dist/collection/utils/phone-masks.js +4 -0
  181. package/dist/collection/utils/phone-masks.js.map +1 -0
  182. package/dist/collection/utils/utils.js +40 -0
  183. package/dist/collection/utils/utils.js.map +1 -1
  184. package/dist/components/Api.js +15 -3
  185. package/dist/components/Api.js.map +1 -1
  186. package/dist/components/Payout.js +113 -0
  187. package/dist/components/Payout.js.map +1 -0
  188. package/dist/components/additional-questions.js +51 -0
  189. package/dist/components/additional-questions.js.map +1 -0
  190. package/dist/components/business-address-form.js +8 -2
  191. package/dist/components/business-address-form.js.map +1 -1
  192. package/dist/components/business-generic-info.js +61 -35
  193. package/dist/components/business-generic-info.js.map +1 -1
  194. package/dist/components/business-owners.js +52 -36
  195. package/dist/components/business-owners.js.map +1 -1
  196. package/dist/components/business-representative.js +31 -15
  197. package/dist/components/business-representative.js.map +1 -1
  198. package/dist/components/details.js +66 -0
  199. package/dist/components/details.js.map +1 -0
  200. package/dist/components/form-control-datepart.d.ts +11 -0
  201. package/dist/components/form-control-datepart.js +8 -0
  202. package/dist/components/form-control-datepart.js.map +1 -0
  203. package/dist/components/form-control-datepart2.js +97 -0
  204. package/dist/components/form-control-datepart2.js.map +1 -0
  205. package/dist/components/form-control-monetary.d.ts +11 -0
  206. package/dist/components/form-control-monetary.js +8 -0
  207. package/dist/components/form-control-monetary.js.map +1 -0
  208. package/dist/components/form-control-monetary2.js +82 -0
  209. package/dist/components/form-control-monetary2.js.map +1 -0
  210. package/dist/components/form-control-number-masked.d.ts +11 -0
  211. package/dist/components/form-control-number-masked.js +8 -0
  212. package/dist/components/form-control-number-masked.js.map +1 -0
  213. package/dist/components/form-control-number-masked2.js +81 -0
  214. package/dist/components/form-control-number-masked2.js.map +1 -0
  215. package/dist/components/form-control-number.d.ts +11 -0
  216. package/dist/components/form-control-number.js +8 -0
  217. package/dist/components/form-control-number.js.map +1 -0
  218. package/dist/components/form-control-number2.js +70 -0
  219. package/dist/components/form-control-number2.js.map +1 -0
  220. package/dist/components/form-control-select.js +2 -2
  221. package/dist/components/form-control-select2.js +20 -7
  222. package/dist/components/form-control-select2.js.map +1 -1
  223. package/dist/components/form-control-text2.js +23 -4
  224. package/dist/components/form-control-text2.js.map +1 -1
  225. package/dist/components/index.d.ts +6 -0
  226. package/dist/components/index.esm.js +1 -18
  227. package/dist/components/index.esm.js.map +1 -1
  228. package/dist/components/index.js +1 -1
  229. package/dist/components/index2.js +3231 -0
  230. package/dist/components/index2.js.map +1 -0
  231. package/dist/components/justifi-additional-questions.d.ts +11 -0
  232. package/dist/components/justifi-additional-questions.js +8 -0
  233. package/dist/components/justifi-additional-questions.js.map +1 -0
  234. package/dist/components/justifi-bank-account-form.js +2 -0
  235. package/dist/components/justifi-bank-account-form.js.map +1 -1
  236. package/dist/components/justifi-business-form.js +146 -28
  237. package/dist/components/justifi-business-form.js.map +1 -1
  238. package/dist/components/justifi-business-generic-info.js +1 -1
  239. package/dist/components/justifi-business-list.d.ts +11 -0
  240. package/dist/components/justifi-business-list.js +215 -0
  241. package/dist/components/justifi-business-list.js.map +1 -0
  242. package/dist/components/justifi-card-form.js +2 -0
  243. package/dist/components/justifi-card-form.js.map +1 -1
  244. package/dist/components/justifi-details.d.ts +11 -0
  245. package/dist/components/justifi-details.js +8 -0
  246. package/dist/components/justifi-details.js.map +1 -0
  247. package/dist/components/justifi-legal-address-form.d.ts +11 -0
  248. package/dist/components/justifi-legal-address-form.js +8 -0
  249. package/dist/components/justifi-legal-address-form.js.map +1 -0
  250. package/dist/components/justifi-payment-details.d.ts +11 -0
  251. package/dist/components/justifi-payment-details.js +88 -0
  252. package/dist/components/justifi-payment-details.js.map +1 -0
  253. package/dist/components/justifi-payment-form.js +2 -1
  254. package/dist/components/justifi-payment-form.js.map +1 -1
  255. package/dist/components/justifi-payments-list.js +52 -45
  256. package/dist/components/justifi-payments-list.js.map +1 -1
  257. package/dist/components/justifi-payout-details.d.ts +11 -0
  258. package/dist/components/justifi-payout-details.js +86 -0
  259. package/dist/components/justifi-payout-details.js.map +1 -0
  260. package/dist/components/justifi-payouts-list.js +65 -50
  261. package/dist/components/justifi-payouts-list.js.map +1 -1
  262. package/dist/components/justifi-proceeds-list.d.ts +11 -0
  263. package/dist/components/justifi-proceeds-list.js +182 -0
  264. package/dist/components/justifi-proceeds-list.js.map +1 -0
  265. package/dist/components/justifi-table.d.ts +11 -0
  266. package/dist/components/justifi-table.js +8 -0
  267. package/dist/components/justifi-table.js.map +1 -0
  268. package/dist/components/legal-address-form.js +271 -0
  269. package/dist/components/legal-address-form.js.map +1 -0
  270. package/dist/components/payment-method-form.js +1488 -21
  271. package/dist/components/payment-method-form.js.map +1 -1
  272. package/dist/components/phone-masks.js +7 -0
  273. package/dist/components/phone-masks.js.map +1 -0
  274. package/dist/components/table.js +94 -0
  275. package/dist/components/table.js.map +1 -0
  276. package/dist/components/utils.js +41 -102
  277. package/dist/components/utils.js.map +1 -1
  278. package/dist/esm/{Api-436dfa09.js → Api-a95f17ac.js} +16 -4
  279. package/dist/esm/Api-a95f17ac.js.map +1 -0
  280. package/dist/esm/Payout-9a1f2859.js +113 -0
  281. package/dist/esm/Payout-9a1f2859.js.map +1 -0
  282. package/dist/esm/{business-form-schema-30c48693.js → business-form-schema-5885d3d6.js} +40 -22
  283. package/dist/esm/business-form-schema-5885d3d6.js.map +1 -0
  284. package/dist/esm/form-control-datepart_2.entry.js +102 -0
  285. package/dist/esm/form-control-datepart_2.entry.js.map +1 -0
  286. package/dist/esm/form-control-monetary.entry.js +61 -0
  287. package/dist/esm/form-control-monetary.entry.js.map +1 -0
  288. package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +98 -12
  289. package/dist/esm/form-control-number_3.entry.js.map +1 -0
  290. package/dist/esm/form-control-select.entry.js +43 -0
  291. package/dist/esm/form-control-select.entry.js.map +1 -0
  292. package/dist/esm/index-5ed53c20.js +3231 -0
  293. package/dist/esm/index-5ed53c20.js.map +1 -0
  294. package/dist/esm/{index-c8f391de.js → index-fe877d03.js} +10 -7
  295. package/dist/esm/index-fe877d03.js.map +1 -0
  296. package/dist/esm/{index.esm-be2cd327.js → index.esm-89fe6af9.js} +2 -19
  297. package/dist/esm/index.esm-89fe6af9.js.map +1 -0
  298. package/dist/esm/justifi-additional-questions_5.entry.js +388 -0
  299. package/dist/esm/justifi-additional-questions_5.entry.js.map +1 -0
  300. package/dist/esm/justifi-bank-account-form.entry.js +3 -1
  301. package/dist/esm/justifi-bank-account-form.entry.js.map +1 -1
  302. package/dist/esm/justifi-billing-form_2.entry.js +2 -2
  303. package/dist/esm/justifi-business-form.entry.js +98 -16
  304. package/dist/esm/justifi-business-form.entry.js.map +1 -1
  305. package/dist/esm/justifi-business-list.entry.js +185 -0
  306. package/dist/esm/justifi-business-list.entry.js.map +1 -0
  307. package/dist/esm/justifi-card-form.entry.js +3 -1
  308. package/dist/esm/justifi-card-form.entry.js.map +1 -1
  309. package/dist/esm/justifi-details.entry.js +26 -0
  310. package/dist/esm/justifi-details.entry.js.map +1 -0
  311. package/dist/esm/justifi-payment-details.entry.js +59 -0
  312. package/dist/esm/justifi-payment-details.entry.js.map +1 -0
  313. package/dist/esm/justifi-payment-form.entry.js +3 -2
  314. package/dist/esm/justifi-payment-form.entry.js.map +1 -1
  315. package/dist/esm/justifi-payment-method-form.entry.js +1487 -19
  316. package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
  317. package/dist/esm/justifi-payments-list.entry.js +47 -45
  318. package/dist/esm/justifi-payments-list.entry.js.map +1 -1
  319. package/dist/esm/justifi-payout-details.entry.js +57 -0
  320. package/dist/esm/justifi-payout-details.entry.js.map +1 -0
  321. package/dist/esm/justifi-payouts-list.entry.js +60 -50
  322. package/dist/esm/justifi-payouts-list.entry.js.map +1 -1
  323. package/dist/esm/justifi-proceeds-list.entry.js +152 -0
  324. package/dist/esm/justifi-proceeds-list.entry.js.map +1 -0
  325. package/dist/esm/justifi-table.entry.js +64 -0
  326. package/dist/esm/justifi-table.entry.js.map +1 -0
  327. package/dist/esm/loader.js +3 -3
  328. package/dist/esm/select-input_2.entry.js +1 -1
  329. package/dist/esm/table-utils-6cdcaa8c.js +11 -0
  330. package/dist/esm/table-utils-6cdcaa8c.js.map +1 -0
  331. package/dist/esm/utils-1e7d6279.js +28 -0
  332. package/dist/esm/utils-1e7d6279.js.map +1 -0
  333. package/dist/esm/{utils-e7782126.js → utils-ad0bbe03.js} +42 -103
  334. package/dist/esm/utils-ad0bbe03.js.map +1 -0
  335. package/dist/esm/webcomponents.js +4 -4
  336. package/dist/esm/webcomponents.js.map +1 -1
  337. package/dist/types/api/Api.d.ts +1 -1
  338. package/dist/types/api/Business.d.ts +133 -0
  339. package/dist/types/api/Payment.d.ts +1 -0
  340. package/dist/types/api/Payout.d.ts +10 -12
  341. package/dist/types/api/Proceed.d.ts +60 -0
  342. package/dist/types/api/shared.d.ts +11 -0
  343. package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +6 -0
  344. package/dist/types/components/business-form/additional-questions/additional-questions.d.ts +15 -0
  345. package/dist/types/components/business-form/business-form-schema.d.ts +47 -21
  346. package/dist/types/components/business-form/business-form.d.ts +7 -2
  347. package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +1 -2
  348. package/dist/types/components/business-form/business-owners/business-owners.d.ts +3 -2
  349. package/dist/types/components/business-form/business-representative/business-representative.d.ts +1 -2
  350. package/dist/types/components/business-list/business-list.d.ts +35 -0
  351. package/dist/types/components/business-list/business-list.stories.d.ts +9 -0
  352. package/dist/types/components/card-form/card-form.stories.d.ts +6 -0
  353. package/dist/types/components/details/details.d.ts +7 -0
  354. package/dist/types/components/details/utils.d.ts +19 -0
  355. package/dist/types/components/form/form-control-datepart.d.ts +19 -0
  356. package/dist/types/components/form/form-control-monetary.d.ts +17 -0
  357. package/dist/types/components/form/form-control-number-masked.d.ts +19 -0
  358. package/dist/types/components/form/form-control-number.d.ts +18 -0
  359. package/dist/types/components/form/form-control-select.d.ts +6 -1
  360. package/dist/types/components/form/form-control-text.d.ts +6 -0
  361. package/dist/types/components/form/form.d.ts +5 -4
  362. package/dist/types/components/legal-address-form/legal-address-form-schema.d.ts +17 -0
  363. package/dist/types/components/legal-address-form/legal-address-form.d.ts +16 -0
  364. package/dist/types/components/payment-details/payment-details.d.ts +28 -0
  365. package/dist/types/components/payment-details/payment-details.stories.d.ts +8 -0
  366. package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -3
  367. package/dist/types/components/payments-list/payments-list.d.ts +6 -14
  368. package/dist/types/components/payments-list/payments-list.stories.d.ts +1 -8
  369. package/dist/types/components/payout-details/payout-details.d.ts +28 -0
  370. package/dist/types/components/payout-details/payout-details.stories.d.ts +8 -0
  371. package/dist/types/components/payouts-list/payouts-list.d.ts +7 -15
  372. package/dist/types/components/payouts-list/payouts-list.stories.d.ts +1 -8
  373. package/dist/types/components/proceeds-list/proceeds-list.d.ts +37 -0
  374. package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +9 -0
  375. package/dist/types/components/table/table-utils.d.ts +14 -0
  376. package/dist/types/components/table/table.d.ts +28 -0
  377. package/dist/types/components.d.ts +637 -12
  378. package/dist/types/stencil-public-runtime.d.ts +2 -0
  379. package/dist/types/utils/country-options.d.ts +5 -0
  380. package/dist/types/utils/phone-masks.d.ts +3 -0
  381. package/dist/types/utils/utils.d.ts +2 -0
  382. package/dist/webcomponents/{p-1953797f.entry.js → p-1beaaba3.entry.js} +2 -2
  383. package/dist/webcomponents/{p-33d69eb5.entry.js → p-2b6f5e35.entry.js} +2 -2
  384. package/dist/webcomponents/p-2b6f5e35.entry.js.map +1 -0
  385. package/dist/webcomponents/p-2c2cde2d.js +2 -0
  386. package/dist/webcomponents/p-2c2cde2d.js.map +1 -0
  387. package/dist/webcomponents/p-2e66512d.entry.js +2 -0
  388. package/dist/webcomponents/p-2e66512d.entry.js.map +1 -0
  389. package/dist/webcomponents/p-640bfa9f.entry.js +2 -0
  390. package/dist/webcomponents/p-640bfa9f.entry.js.map +1 -0
  391. package/dist/webcomponents/p-641883b2.entry.js +2 -0
  392. package/dist/webcomponents/p-641883b2.entry.js.map +1 -0
  393. package/dist/webcomponents/p-6d549d84.entry.js +2 -0
  394. package/dist/webcomponents/p-6d549d84.entry.js.map +1 -0
  395. package/dist/webcomponents/p-75292cca.entry.js +2 -0
  396. package/dist/webcomponents/p-75292cca.entry.js.map +1 -0
  397. package/dist/webcomponents/p-7d6c309d.entry.js +2 -0
  398. package/dist/webcomponents/p-7d6c309d.entry.js.map +1 -0
  399. package/dist/webcomponents/p-8f421dc6.js +2 -0
  400. package/dist/webcomponents/p-8f421dc6.js.map +1 -0
  401. package/dist/webcomponents/p-9346ae33.js +2 -0
  402. package/dist/webcomponents/p-9346ae33.js.map +1 -0
  403. package/dist/webcomponents/p-a2aae7c9.entry.js +2 -0
  404. package/dist/webcomponents/p-a2aae7c9.entry.js.map +1 -0
  405. package/dist/webcomponents/{p-23e9c7d4.entry.js → p-a922b908.entry.js} +2 -2
  406. package/dist/webcomponents/p-ab0756ff.js +2 -0
  407. package/dist/webcomponents/p-ab0756ff.js.map +1 -0
  408. package/dist/webcomponents/{p-0fd4aae2.js → p-c46241ba.js} +2 -2
  409. package/dist/webcomponents/p-c46241ba.js.map +1 -0
  410. package/dist/webcomponents/p-ccb0e1c5.js +2 -0
  411. package/dist/webcomponents/p-ccb0e1c5.js.map +1 -0
  412. package/dist/webcomponents/{p-d5cadc78.entry.js → p-cd0eca25.entry.js} +2 -2
  413. package/dist/webcomponents/{p-d5cadc78.entry.js.map → p-cd0eca25.entry.js.map} +1 -1
  414. package/dist/webcomponents/{p-7041a637.entry.js → p-d92116e6.entry.js} +2 -2
  415. package/dist/webcomponents/{p-7041a637.entry.js.map → p-d92116e6.entry.js.map} +1 -1
  416. package/dist/webcomponents/p-da4e6389.entry.js +2 -0
  417. package/dist/webcomponents/p-da4e6389.entry.js.map +1 -0
  418. package/dist/webcomponents/p-db9945b1.entry.js +2 -0
  419. package/dist/webcomponents/p-db9945b1.entry.js.map +1 -0
  420. package/dist/webcomponents/p-e1f6c8ec.entry.js +2 -0
  421. package/dist/webcomponents/p-e1f6c8ec.entry.js.map +1 -0
  422. package/dist/webcomponents/p-e6695628.js +2 -0
  423. package/dist/webcomponents/p-e6695628.js.map +1 -0
  424. package/dist/webcomponents/p-e70b2a21.js +3 -0
  425. package/dist/webcomponents/p-e70b2a21.js.map +1 -0
  426. package/dist/webcomponents/p-ee32a236.entry.js +2 -0
  427. package/dist/webcomponents/p-ee32a236.entry.js.map +1 -0
  428. package/dist/webcomponents/p-f6cc37a6.entry.js +2 -0
  429. package/dist/webcomponents/{p-309a886f.entry.js.map → p-f6cc37a6.entry.js.map} +1 -1
  430. package/dist/webcomponents/p-f72c3084.entry.js +2 -0
  431. package/dist/webcomponents/p-f72c3084.entry.js.map +1 -0
  432. package/dist/webcomponents/p-f8067330.entry.js +2 -0
  433. package/dist/webcomponents/p-f8067330.entry.js.map +1 -0
  434. package/dist/webcomponents/p-f9e127a5.js +2 -0
  435. package/dist/webcomponents/p-f9e127a5.js.map +1 -0
  436. package/dist/webcomponents/p-fe2ec58b.entry.js +2 -0
  437. package/dist/webcomponents/p-fe2ec58b.entry.js.map +1 -0
  438. package/dist/webcomponents/webcomponents.esm.js +1 -1
  439. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  440. package/package.json +8 -5
  441. package/dist/cjs/Api-7303478d.js.map +0 -1
  442. package/dist/cjs/business-form-schema-63b311b2.js.map +0 -1
  443. package/dist/cjs/form-control-select_2.cjs.entry.js.map +0 -1
  444. package/dist/cjs/index-83b2ec02.js.map +0 -1
  445. package/dist/cjs/index.esm-7e12ce07.js.map +0 -1
  446. package/dist/cjs/justifi-business-address-form.cjs.entry.js +0 -37
  447. package/dist/cjs/justifi-business-address-form.cjs.entry.js.map +0 -1
  448. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js +0 -148
  449. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js.map +0 -1
  450. package/dist/cjs/utils-4ee7e080.js.map +0 -1
  451. package/dist/collection/components/business-form/businessForm.stories.js.map +0 -1
  452. package/dist/esm/Api-436dfa09.js.map +0 -1
  453. package/dist/esm/business-form-schema-30c48693.js.map +0 -1
  454. package/dist/esm/form-control-select_2.entry.js.map +0 -1
  455. package/dist/esm/index-c8f391de.js.map +0 -1
  456. package/dist/esm/index.esm-be2cd327.js.map +0 -1
  457. package/dist/esm/justifi-business-address-form.entry.js +0 -33
  458. package/dist/esm/justifi-business-address-form.entry.js.map +0 -1
  459. package/dist/esm/justifi-business-generic-info_3.entry.js +0 -142
  460. package/dist/esm/justifi-business-generic-info_3.entry.js.map +0 -1
  461. package/dist/esm/utils-e7782126.js.map +0 -1
  462. package/dist/webcomponents/p-0fd4aae2.js.map +0 -1
  463. package/dist/webcomponents/p-1a1f2196.js +0 -2
  464. package/dist/webcomponents/p-1a1f2196.js.map +0 -1
  465. package/dist/webcomponents/p-309a886f.entry.js +0 -2
  466. package/dist/webcomponents/p-33d69eb5.entry.js.map +0 -1
  467. package/dist/webcomponents/p-3a80a2ec.entry.js +0 -2
  468. package/dist/webcomponents/p-3a80a2ec.entry.js.map +0 -1
  469. package/dist/webcomponents/p-45fea6a8.entry.js +0 -2
  470. package/dist/webcomponents/p-45fea6a8.entry.js.map +0 -1
  471. package/dist/webcomponents/p-79456add.js +0 -2
  472. package/dist/webcomponents/p-79456add.js.map +0 -1
  473. package/dist/webcomponents/p-af080b21.js +0 -2
  474. package/dist/webcomponents/p-af080b21.js.map +0 -1
  475. package/dist/webcomponents/p-bc969904.js +0 -3
  476. package/dist/webcomponents/p-bc969904.js.map +0 -1
  477. package/dist/webcomponents/p-cd097ce9.entry.js +0 -2
  478. package/dist/webcomponents/p-cd097ce9.entry.js.map +0 -1
  479. package/dist/webcomponents/p-d5bc9f22.entry.js +0 -2
  480. package/dist/webcomponents/p-d5bc9f22.entry.js.map +0 -1
  481. package/dist/webcomponents/p-dd1ebc0b.entry.js +0 -2
  482. package/dist/webcomponents/p-dd1ebc0b.entry.js.map +0 -1
  483. package/dist/webcomponents/p-e05e0c6b.entry.js +0 -2
  484. package/dist/webcomponents/p-e05e0c6b.entry.js.map +0 -1
  485. /package/dist/types/components/business-form/{businessForm.stories.d.ts → business-form.stories.d.ts} +0 -0
  486. /package/dist/webcomponents/{p-1953797f.entry.js.map → p-1beaaba3.entry.js.map} +0 -0
  487. /package/dist/webcomponents/{p-23e9c7d4.entry.js.map → p-a922b908.entry.js.map} +0 -0
@@ -0,0 +1,209 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { Api } from "../../api";
3
+ import { pagingDefaults } from "../table/table-utils";
4
+ import { Business } from "../../api/Business";
5
+ import { formatDate } from "../../utils/utils";
6
+ /**
7
+ * @exportedPart table-head: Table head
8
+ * @exportedPart table-head-row: Head row
9
+ * @exportedPart table-head-cell: Individual head cell
10
+ * @exportedPart table-body: Body of the table
11
+ * @exportedPart table-row: Row of the table
12
+ * @exportedPart table-cell: Individual cell of the table
13
+ * @exportedPart loading-state-cell: Row for loading state
14
+ * @exportedPart loading-state-spinner: Spinner element for loading state
15
+ * @exportedPart error-state: Row for Error state
16
+ * @exportedPart empty-state: Row for Emtpy state
17
+ * @exportedPart pagination-bar: Pagination bar
18
+ * @exportedPart arrow: Both paging buttons
19
+ * @exportedPart arrow-left: Previous page button
20
+ * @exportedPart arrow-right: Next page button
21
+ * @exportedPart arrow-disabled: Disabled state for paging buttons
22
+ */
23
+ export class BusinessList {
24
+ constructor() {
25
+ this.onPageChange = (direction) => {
26
+ return () => {
27
+ this.fetchData(direction);
28
+ };
29
+ };
30
+ this.mapProductStatusToBadge = (status) => {
31
+ return status && 'bg-success' || 'bg-secondary';
32
+ };
33
+ this.mapBusinessType = (type) => {
34
+ switch (type) {
35
+ case 'individual':
36
+ return 'Individual';
37
+ case 'non_profit':
38
+ return 'Non Profit';
39
+ case 'for_profit':
40
+ return 'For Profit';
41
+ case 'government_entity':
42
+ return 'Government Entity';
43
+ }
44
+ };
45
+ this.mapBusinessStructure = (type) => {
46
+ switch (type) {
47
+ case 'sole_proprietorship':
48
+ return 'Sole Proprietorship';
49
+ case 'single_llc':
50
+ return 'Single LLC';
51
+ case 'multi_llc':
52
+ return 'Multi LLC';
53
+ case 'private_partnership':
54
+ return 'Private Partnership';
55
+ case 'private_corporation':
56
+ return 'Private Corporation';
57
+ case 'unincorporated_association':
58
+ return 'Unincorporated Association';
59
+ case 'public_partnership':
60
+ return 'Public Partnership';
61
+ case 'public_corporation':
62
+ return 'Public Corporation';
63
+ case 'incorporated':
64
+ return 'Incorporated';
65
+ case 'unincorporated':
66
+ return 'Unincorporated';
67
+ case 'government_unit':
68
+ return 'Government Unit';
69
+ case 'government_instrumentality':
70
+ return 'Government Instrumentality';
71
+ case 'tax_exempt_government_instrumentality':
72
+ return 'Tax Exempt Government Instrumentality';
73
+ }
74
+ };
75
+ this.accountId = undefined;
76
+ this.authToken = undefined;
77
+ this.businesses = [];
78
+ this.loading = true;
79
+ this.errorMessage = undefined;
80
+ this.paging = pagingDefaults;
81
+ }
82
+ updateOnPropChange() {
83
+ this.fetchData();
84
+ }
85
+ connectedCallback() {
86
+ this.fetchData();
87
+ }
88
+ async fetchData(direction) {
89
+ var _a;
90
+ if (!this.accountId || !this.authToken) {
91
+ this.errorMessage = "Can not fetch any data without an AccountID and an AuthToken";
92
+ this.loading = false;
93
+ return;
94
+ }
95
+ this.loading = true;
96
+ const endpoint = `entities/business`;
97
+ const response = await Api(this.authToken, process.env.ENTITIES_API_ORIGIN).get(endpoint, {
98
+ account_id: this.accountId,
99
+ paging: this.paging,
100
+ direction: direction
101
+ });
102
+ if (!response.error) {
103
+ this.paging = Object.assign(Object.assign({}, this.paging), response.page_info);
104
+ const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.map(dataItem => new Business(dataItem));
105
+ this.businesses = data;
106
+ }
107
+ else {
108
+ this.errorMessage = typeof response.error === 'string' ? response.error : response.error.message;
109
+ }
110
+ this.loading = false;
111
+ }
112
+ render() {
113
+ return (h(Host, null, h("justifi-table", { columnData: [
114
+ ['Legal Name', 'The name associated with this Business'],
115
+ ['Business Type', 'The business type'],
116
+ ['Business Structure', 'The business structure'],
117
+ ['Tax ID', 'The tax ID associated with this business'],
118
+ ['Industry', 'The industry this business participates in'],
119
+ ['Product Ready', 'List of our products that are used by this business'],
120
+ ['Created at', 'Date this business was created'],
121
+ ], rowData: this.businesses.map((business) => ([
122
+ business.legal_name,
123
+ this.mapBusinessType(business.business_type),
124
+ this.mapBusinessStructure(business.business_structure),
125
+ business.tax_id,
126
+ business.industry,
127
+ {
128
+ type: 'inner',
129
+ value: `
130
+ <div class="d-flex flex-nowrap gap-1">
131
+ <span class="badge ${this.mapProductStatusToBadge(business.product_categories.credit)}">Credit</span>
132
+ <span class="badge ${this.mapProductStatusToBadge(business.product_categories.insurance)}">Insurance</span>
133
+ <span class="badge ${this.mapProductStatusToBadge(business.product_categories.lending)}">Lending</span>
134
+ <span class="badge ${this.mapProductStatusToBadge(business.product_categories.payment)}">Payment</span>
135
+ </div>
136
+ `
137
+ },
138
+ formatDate(business.created_at),
139
+ ])), loading: this.loading, "error-message": this.errorMessage, paging: Object.assign(Object.assign({}, this.paging), { onPrev: this.onPageChange('prev'), onNext: this.onPageChange('next') }) })));
140
+ }
141
+ static get is() { return "justifi-business-list"; }
142
+ static get encapsulation() { return "shadow"; }
143
+ static get originalStyleUrls() {
144
+ return {
145
+ "$": ["business-list.scss"]
146
+ };
147
+ }
148
+ static get styleUrls() {
149
+ return {
150
+ "$": ["business-list.css"]
151
+ };
152
+ }
153
+ static get properties() {
154
+ return {
155
+ "accountId": {
156
+ "type": "string",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "string",
160
+ "resolved": "string",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": ""
168
+ },
169
+ "attribute": "account-id",
170
+ "reflect": false
171
+ },
172
+ "authToken": {
173
+ "type": "string",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "string",
177
+ "resolved": "string",
178
+ "references": {}
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": ""
185
+ },
186
+ "attribute": "auth-token",
187
+ "reflect": false
188
+ }
189
+ };
190
+ }
191
+ static get states() {
192
+ return {
193
+ "businesses": {},
194
+ "loading": {},
195
+ "errorMessage": {},
196
+ "paging": {}
197
+ };
198
+ }
199
+ static get watchers() {
200
+ return [{
201
+ "propName": "accountId",
202
+ "methodName": "updateOnPropChange"
203
+ }, {
204
+ "propName": "authToken",
205
+ "methodName": "updateOnPropChange"
206
+ }];
207
+ }
208
+ }
209
+ //# sourceMappingURL=business-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-list.js","sourceRoot":"","sources":["../../../../src/components/business-list/business-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,GAAG,EAA0B,MAAM,WAAW,CAAC;AACxD,OAAO,EAAc,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;;;;;;;;;;;;EAgBE;AAOF,MAAM,OAAO,YAAY;;IAkBvB,iBAAY,GAAG,CAAC,SAAiB,EAAE,EAAE;MACnC,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;MAC5B,CAAC,CAAA;IACH,CAAC,CAAA;IAED,4BAAuB,GAAG,CAAC,MAAe,EAAE,EAAE;MAC5C,OAAO,MAAM,IAAI,YAAY,IAAI,cAAc,CAAC;IAClD,CAAC,CAAA;IAED,oBAAe,GAAG,CAAC,IAAY,EAAE,EAAE;MACjC,QAAQ,IAAI,EAAE;QACZ,KAAK,YAAY;UACf,OAAO,YAAY,CAAA;QACrB,KAAK,YAAY;UACf,OAAO,YAAY,CAAA;QACrB,KAAK,YAAY;UACf,OAAO,YAAY,CAAA;QACrB,KAAK,mBAAmB;UACtB,OAAO,mBAAmB,CAAA;OAC7B;IACH,CAAC,CAAA;IAED,yBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE;MACtC,QAAQ,IAA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QAAQ,CAAC,kBAAkB,CAAC;UACtD,QAAQ,CAAC,MAAM;UACf,QAAQ,CAAC,QAAQ;UACjB;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;;2CAEkB,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC;2CAChE,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,SAAS,CAAC;2CACnE,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC;2CACjE,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC;;mBAEzF;WACF;UACD,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC;SAChC,CACF,CAAC,EAEJ,OAAO,EAAE,IAAI,CAAC,OAAO,mBACN,IAAI,CAAC,YAAY,EAChC,MAAM,kCACD,IAAI,CAAC,MAAM,KACd,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EACjC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAEnC,CACG,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\nimport { Api, IApiResponseCollection } from '../../api';\nimport { PagingInfo, pagingDefaults } from '../table/table-utils';\nimport { Business } from '../../api/Business';\nimport { formatDate } from '../../utils/utils';\n\n/**\n * @exportedPart table-head: Table head\n * @exportedPart table-head-row: Head row\n * @exportedPart table-head-cell: Individual head cell\n * @exportedPart table-body: Body of the table\n * @exportedPart table-row: Row of the table\n * @exportedPart table-cell: Individual cell of the table\n * @exportedPart loading-state-cell: Row for loading state\n * @exportedPart loading-state-spinner: Spinner element for loading state\n * @exportedPart error-state: Row for Error state\n * @exportedPart empty-state: Row for Emtpy state\n * @exportedPart pagination-bar: Pagination bar\n * @exportedPart arrow: Both paging buttons\n * @exportedPart arrow-left: Previous page button\n * @exportedPart arrow-right: Next page button\n * @exportedPart arrow-disabled: Disabled state for paging buttons\n*/\n@Component({\n tag: 'justifi-business-list',\n styleUrl: 'business-list.scss',\n shadow: true,\n})\n\nexport class BusinessList {\n @Prop() accountId: string;\n @Prop() authToken: string;\n @State() businesses: Business[] = [];\n @State() loading: boolean = true;\n @State() errorMessage: string;\n @State() paging: PagingInfo = pagingDefaults;\n\n @Watch('accountId')\n @Watch('authToken')\n updateOnPropChange() {\n this.fetchData();\n }\n\n connectedCallback() {\n this.fetchData();\n }\n\n onPageChange = (direction: string) => {\n return () => {\n this.fetchData(direction);\n }\n }\n\n mapProductStatusToBadge = (status: boolean) => {\n return status && 'bg-success' || 'bg-secondary';\n }\n\n mapBusinessType = (type: string) => {\n switch (type) {\n case 'individual':\n return 'Individual'\n case 'non_profit':\n return 'Non Profit'\n case 'for_profit':\n return 'For Profit'\n case 'government_entity':\n return 'Government Entity'\n }\n }\n\n mapBusinessStructure = (type: string) => {\n switch (type) {\n case 'sole_proprietorship':\n return 'Sole Proprietorship'\n case 'single_llc':\n return 'Single LLC'\n case 'multi_llc':\n return 'Multi LLC'\n case 'private_partnership':\n return 'Private Partnership'\n case 'private_corporation':\n return 'Private Corporation'\n case 'unincorporated_association':\n return 'Unincorporated Association'\n case 'public_partnership':\n return 'Public Partnership'\n case 'public_corporation':\n return 'Public Corporation'\n case 'incorporated':\n return 'Incorporated'\n case 'unincorporated':\n return 'Unincorporated'\n case 'government_unit':\n return 'Government Unit'\n case 'government_instrumentality':\n return 'Government Instrumentality'\n case 'tax_exempt_government_instrumentality':\n return 'Tax Exempt Government Instrumentality'\n }\n }\n\n async fetchData(direction?: string): Promise<void> {\n if (!this.accountId || !this.authToken) {\n this.errorMessage = \"Can not fetch any data without an AccountID and an AuthToken\";\n this.loading = false;\n return;\n }\n this.loading = true;\n const endpoint = `entities/business`;\n\n const response: IApiResponseCollection<Business[]> = await Api(this.authToken, process.env.ENTITIES_API_ORIGIN).get(endpoint, {\n account_id: this.accountId,\n paging: this.paging,\n direction: direction\n });\n if (!response.error) {\n this.paging = {\n ...this.paging,\n ...response.page_info\n }\n\n const data = response?.data?.map(dataItem => new Business(dataItem));\n this.businesses = data;\n } else {\n this.errorMessage = typeof response.error === 'string' ? response.error : response.error.message;\n }\n\n this.loading = false;\n }\n\n render() {\n return (\n <Host>\n <justifi-table\n columnData={[\n ['Legal Name', 'The name associated with this Business'],\n ['Business Type', 'The business type'],\n ['Business Structure', 'The business structure'],\n ['Tax ID', 'The tax ID associated with this business'],\n ['Industry', 'The industry this business participates in'],\n ['Product Ready', 'List of our products that are used by this business'],\n ['Created at', 'Date this business was created'],\n ]}\n rowData={\n this.businesses.map((business) => (\n [\n business.legal_name,\n this.mapBusinessType(business.business_type),\n this.mapBusinessStructure(business.business_structure),\n business.tax_id,\n business.industry,\n {\n type: 'inner',\n value: `\n <div class=\"d-flex flex-nowrap gap-1\">\n <span class=\"badge ${this.mapProductStatusToBadge(business.product_categories.credit)}\">Credit</span>\n <span class=\"badge ${this.mapProductStatusToBadge(business.product_categories.insurance)}\">Insurance</span>\n <span class=\"badge ${this.mapProductStatusToBadge(business.product_categories.lending)}\">Lending</span>\n <span class=\"badge ${this.mapProductStatusToBadge(business.product_categories.payment)}\">Payment</span>\n </div>\n `\n },\n formatDate(business.created_at),\n ]\n ))\n }\n loading={this.loading}\n error-message={this.errorMessage}\n paging={{\n ...this.paging,\n onPrev: this.onPageChange('prev'),\n onNext: this.onPageChange('next')\n }}\n />\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,68 @@
1
+ export default {
2
+ title: 'dev/Components/BusinessList',
3
+ component: 'justifi-business-list',
4
+ parameters: {}
5
+ };
6
+ class BusinessListArgs {
7
+ constructor(args) {
8
+ this['auth-token'] = args['auth-token'] || '';
9
+ this['account-id'] = args['account-id'] || '';
10
+ }
11
+ }
12
+ const Template = (args) => {
13
+ return (`
14
+ <justifi-business-list
15
+ data-testid="justifi-business-list"
16
+ auth-token="${args['auth-token']}"
17
+ account-id="${args['account-id']}"
18
+ />
19
+ `);
20
+ };
21
+ export const Basic = Template.bind({});
22
+ Basic.args = new BusinessListArgs({});
23
+ export const Styled = Template.bind({});
24
+ Styled.args = new BusinessListArgs({});
25
+ Styled.decorators = [
26
+ (Story) => `
27
+ ${Story()}
28
+ <style>
29
+ justifi-business-list::part(table-head-cell) {
30
+ background-color: #F4F4F6;
31
+ }
32
+ justifi-business-list::part(pagination-bar) {
33
+ background-color: #F4F4F6;
34
+ }
35
+ justifi-business-list::part(arrow) {
36
+ --bs-btn-disabled-bg: #212529;
37
+ --bs-btn-disabled-border-color: #212529;
38
+ --bs-btn-bg: #212529;
39
+ --bs-btn-border-color: #212529;
40
+ --bs-btn-hover-bg: #fccc32;
41
+ --bs-btn-hover-border-color: #fccc32;
42
+ }
43
+ justifi-business-list::part(error-state) {
44
+ color: red;
45
+ background-color: #EEEEF5;
46
+ }
47
+ justifi-business-list::part(loading-state-cell) {
48
+ background-color: #EEEEF5;
49
+ }
50
+ justifi-business-list::part(table-row) {
51
+ background-color: #EEEEF5;
52
+ }
53
+ justifi-business-list::part(table-row-even) {
54
+ background-color: #F4F4F6;
55
+ }
56
+ </style>
57
+ `
58
+ ];
59
+ export const Contained = Template.bind({});
60
+ Contained.decorators = [
61
+ (Story) => `
62
+ <div style="position: relative; width: 900px; height: 300px; overflow-x: hidden;">
63
+ ${Story()}
64
+ </div>
65
+ `
66
+ ];
67
+ Contained.args = new BusinessListArgs({});
68
+ //# sourceMappingURL=business-list.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-list.stories.js","sourceRoot":"","sources":["../../../../src/components/business-list/business-list.stories.ts"],"names":[],"mappings":"AAAA,eAAe;EACb,KAAK,EAAE,6BAA6B;EACpC,SAAS,EAAE,uBAAuB;EAClC,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,gBAAgB;EAIpB,YAAY,IAAI;IACd,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC9C,IAAI,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;EAChD,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,CAAC,IAAsB,EAAE,EAAE;EAC1C,OAAO,CAAC;;;oBAGU,IAAI,CAAC,YAAY,CAAC;oBAClB,IAAI,CAAC,YAAY,CAAC;;GAEnC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC;AACvC,MAAM,CAAC,UAAU,GAAG;EAClB,CAAC,KAAK,EAAE,EAAE,CAAC;MACP,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BV;CACF,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,UAAU,GAAG;EACrB,CAAC,KAAK,EAAE,EAAE,CAAC;;QAEL,KAAK,EAAE;;GAEZ;CACF,CAAA;AACD,SAAS,CAAC,IAAI,GAAG,IAAI,gBAAgB,CAAC,EAAE,CAAC,CAAC","sourcesContent":["export default {\n title: 'dev/Components/BusinessList',\n component: 'justifi-business-list',\n parameters: {}\n};\n\nclass BusinessListArgs {\n 'auth-token': string;\n 'account-id': string;\n\n constructor(args) {\n this['auth-token'] = args['auth-token'] || '';\n this['account-id'] = args['account-id'] || '';\n }\n}\n\nconst Template = (args: BusinessListArgs) => {\n return (`\n <justifi-business-list\n data-testid=\"justifi-business-list\"\n auth-token=\"${args['auth-token']}\"\n account-id=\"${args['account-id']}\"\n />\n `);\n};\n\nexport const Basic = Template.bind({});\nBasic.args = new BusinessListArgs({});\n\nexport const Styled = Template.bind({});\nStyled.args = new BusinessListArgs({});\nStyled.decorators = [\n (Story) => `\n ${Story()}\n <style>\n justifi-business-list::part(table-head-cell) {\n background-color: #F4F4F6;\n }\n justifi-business-list::part(pagination-bar) {\n background-color: #F4F4F6;\n }\n justifi-business-list::part(arrow) {\n --bs-btn-disabled-bg: #212529;\n --bs-btn-disabled-border-color: #212529;\n --bs-btn-bg: #212529;\n --bs-btn-border-color: #212529;\n --bs-btn-hover-bg: #fccc32;\n --bs-btn-hover-border-color: #fccc32;\n }\n justifi-business-list::part(error-state) {\n color: red;\n background-color: #EEEEF5;\n }\n justifi-business-list::part(loading-state-cell) {\n background-color: #EEEEF5;\n }\n justifi-business-list::part(table-row) {\n background-color: #EEEEF5;\n }\n justifi-business-list::part(table-row-even) {\n background-color: #F4F4F6;\n }\n </style>\n `\n]\n\nexport const Contained = Template.bind({});\nContained.decorators = [\n (Story) => `\n <div style=\"position: relative; width: 900px; height: 300px; overflow-x: hidden;\">\n ${Story()}\n </div>\n `\n]\nContained.args = new BusinessListArgs({});\n"]}
@@ -0,0 +1,12 @@
1
+ import { head } from '../../../storybook-pages/example-parts';
2
+
3
+ export default `<!DOCTYPE html>
4
+ <html dir="ltr" lang="en">
5
+
6
+ ${head('justifi-business-list')}
7
+
8
+ <body>
9
+ <justifi-business-list></justifi-business-list>
10
+ </body>
11
+
12
+ </html>`;
@@ -39,8 +39,10 @@ export class CardForm {
39
39
  }
40
40
  /**
41
41
  * Manually resizes the iframe to fit the contents of the iframe
42
+ * @deprecated This method will be removed in future releases.
42
43
  */
43
44
  async resize() {
45
+ console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
44
46
  if (!this.childRef) {
45
47
  throw new Error('Cannot call validate');
46
48
  }
@@ -256,7 +258,10 @@ export class CardForm {
256
258
  },
257
259
  "docs": {
258
260
  "text": "Manually resizes the iframe to fit the contents of the iframe",
259
- "tags": []
261
+ "tags": [{
262
+ "name": "deprecated",
263
+ "text": "This method will be removed in future releases."
264
+ }]
260
265
  }
261
266
  }
262
267
  };
@@ -1 +1 @@
1
- {"version":3,"file":"card-form.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,QAAQ;;;;sBAcW,KAAK;;;EA+BnC,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,kGAAkG,CAAC,CAAC;IACjH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;EACzC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;EAClC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,MAAM;IACV,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;EAChC,CAAC;EAED,MAAM;IACJ,OAAO,CACL,mCACE,GAAG,EAAE,EAAE,CAAC,EAAE;QACR,IAAI,EAAE,EAAE;UACN,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;MACH,CAAC,mBACc,IAAI,CAAC,YAAY,8BACP,MAAM,iBAClB,IAAI,CAAC,UAAU,+BACD,IAAI,CAAC,aAAa,kCACf,IAAI,CAAC,gBAAgB,yCACd,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Method, Listen, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-card-form',\n shadow: false,\n})\nexport class CardForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n /**\n * Boolean indicating if the Card Form should render in a single line\n */\n @Prop() singleLine: boolean = false;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#cardFormReady\n */\n\n @Event() cardFormReady: EventEmitter;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#ready\n */\n\n @Event() ready: EventEmitter;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.cardFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate(): Promise<{ isValid: boolean }> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n */\n @Method()\n async resize(): Promise<void> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"card\"\n single-line={this.singleLine}\n payment-method-form-ready={this.cardFormReady}\n payment-method-form-tokenize={this.cardFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"card-form.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,QAAQ;;;;sBAcW,KAAK;;;EA+BnC,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,kGAAkG,CAAC,CAAC;IACjH,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,wMAAwM,CACzM,CAAC;IACF,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACpC,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,Q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;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Method, Listen, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-card-form',\n shadow: false,\n})\nexport class CardForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n /**\n * Boolean indicating if the Card Form should render in a single line\n */\n @Prop() singleLine: boolean = false;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#cardFormReady\n */\n\n @Event() cardFormReady: EventEmitter;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#ready\n */\n\n @Event() ready: EventEmitter;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.cardFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`,\n );\n this.cardFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate(): Promise<{ isValid: boolean }> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"card\"\n single-line={this.singleLine}\n payment-method-form-ready={this.cardFormReady}\n payment-method-form-tokenize={this.cardFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
@@ -10,9 +10,17 @@ export default {
10
10
  category: 'props',
11
11
  },
12
12
  },
13
+ 'resize': {
14
+ description: 'Deprecated: This method will be removed in future releases.',
15
+ table: {
16
+ category: 'methods',
17
+ },
18
+ },
13
19
  },
14
20
  decorators: [
15
21
  story => `
22
+ <!-- Deprecated Notice -->
23
+ <p style="color: red; font-family: 'Roboto Mono', monospace;">Note: The 'resize' method is deprecated and will be removed in future releases.</p>
16
24
  ${story()}
17
25
  <script>${addEvents()}</script>
18
26
  `,
@@ -1 +1 @@
1
- {"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,G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AK;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;EAChB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,aAAa,EAAE,KAAK;EACpB,eAAe,EAAE,eAAe;CACjC,CAAC","sourcesContent":["interface CardFormStoryArgs {\n 'iframe-origin': string;\n 'single-line': boolean;\n 'validation-mode': string;\n 'css-variables': string;\n}\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nexport default {\n title: 'Components/CardForm',\n component: 'justifi-card-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n },\n decorators: [\n story => `\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (cardForm: HTMLJustifiCardFormElement) => {\n const valid = await cardForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (cardForm: HTMLJustifiCardFormElement, paymentMethodData) => {\n const tokenizeResponse = await cardForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (cardForm: HTMLJustifiCardFormElement) => {\n await cardForm.resize();\n};\nconst handleReady = () => {\n console.log('card form is ready');\n const cardForm = document.querySelector('justifi-card-form') as HTMLJustifiCardFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(cardForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(cardForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(cardForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('cardFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n border-radius: 3px;\n border: 1px solid black;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>`;\n\nconst Template = (args: CardFormStoryArgs) => {\n const includeButtons = true;\n\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-card-form\n data-testid=\"card-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n single-line='${args['single-line']}'\n />\n </div>\n ${includeButtons ? FormButtons : ''}\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'validation-mode': 'onSubmit',\n 'single-line': false,\n};\n\nexport const SingleLine = Template.bind({});\nSingleLine.args = {\n 'single-line': true,\n};\n\nconst styledVariables = `\n --jfi-load-google-font: 'Inter:wght@200;400;700;900&family=Agdasima';\n --jfi-layout-font-family: Agdasima;\n --jfi-layout-padding: 4px;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 100;\n --jfi-form-label-font-family: Inter;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n`;\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'single-line': false,\n 'css-variables': styledVariables,\n};\n"]}
1
+ {"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAErD,eAAe;EACb,KAAK,EAAE,qBAAqB;EAC5B,SAAS,EAAE,mBAAmB;EAC9B,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,QAAQ,EAAE;MACR,WAAW,EAAE,6DAA6D;MAC1E,KAAK,EAAE;QACL,QAAQ,EAAE,SAAS;OACpB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC;;;QAGL,KAAK,EAAE;gBACC,SAAS,EAAE;KACtB;GACF;CACF,CAAC;AAEF,MAAM,mBAAmB,GAAG,KAAK,EAAE,QAAoC,EAAE,EAAE;EACzE,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,CAAC;EACxC,OAAO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AAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;EACrB,gBAAgB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;SAiBX,CAAC;AAEV,MAAM,QAAQ,GAAG,CAAC,IAAuB,EAAE,EAAE;EAC3C,MAAM,cAAc,GAAG,IAAI,CAAC;EAE5B,OAAO;;;;UAIC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;;;;;2BAKV,IAAI,CAAC,iBAAiB,CAAC,IAAI,UAAU;yBACvC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;uBAC7B,IAAI,CAAC,aAAa,CAAC;;;MAGpC,cAAc,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;GACpC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;EACX,iBAAiB,EAAE,UAAU;EAC7B,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;EAChB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,aAAa,EAAE,KAAK;EACpB,eAAe,EAAE,eAAe;CACjC,CAAC","sourcesContent":["interface CardFormStoryArgs {\n 'iframe-origin': string;\n 'single-line': boolean;\n 'validation-mode': string;\n 'css-variables': string;\n}\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nexport default {\n title: 'Components/CardForm',\n component: 'justifi-card-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n 'resize': {\n description: 'Deprecated: This method will be removed in future releases.',\n table: {\n category: 'methods',\n },\n },\n },\n decorators: [\n story => `\n <!-- Deprecated Notice -->\n <p style=\"color: red; font-family: 'Roboto Mono', monospace;\">Note: The 'resize' method is deprecated and will be removed in future releases.</p>\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (cardForm: HTMLJustifiCardFormElement) => {\n const valid = await cardForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (cardForm: HTMLJustifiCardFormElement, paymentMethodData) => {\n const tokenizeResponse = await cardForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (cardForm: HTMLJustifiCardFormElement) => {\n await cardForm.resize();\n};\nconst handleReady = () => {\n console.log('card form is ready');\n const cardForm = document.querySelector('justifi-card-form') as HTMLJustifiCardFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(cardForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(cardForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(cardForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('cardFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n border-radius: 3px;\n border: 1px solid black;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>`;\n\nconst Template = (args: CardFormStoryArgs) => {\n const includeButtons = true;\n\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-card-form\n data-testid=\"card-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n single-line='${args['single-line']}'\n />\n </div>\n ${includeButtons ? FormButtons : ''}\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'validation-mode': 'onSubmit',\n 'single-line': false,\n};\n\nexport const SingleLine = Template.bind({});\nSingleLine.args = {\n 'single-line': true,\n};\n\nconst styledVariables = `\n --jfi-load-google-font: 'Inter:wght@200;400;700;900&family=Agdasima';\n --jfi-layout-font-family: Agdasima;\n --jfi-layout-padding: 4px;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 100;\n --jfi-form-label-font-family: Inter;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n`;\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'single-line': false,\n 'css-variables': styledVariables,\n};\n"]}