@justifi/webcomponents 4.4.0 → 4.5.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 (462) 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-4ffc90c0.js} +10 -1
  16. package/dist/cjs/index-4ffc90c0.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 +1 -1
  24. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
  25. package/dist/cjs/justifi-business-form.cjs.entry.js +98 -16
  26. package/dist/cjs/justifi-business-form.cjs.entry.js.map +1 -1
  27. package/dist/cjs/justifi-business-list.cjs.entry.js +189 -0
  28. package/dist/cjs/justifi-business-list.cjs.entry.js.map +1 -0
  29. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  30. package/dist/cjs/justifi-details.cjs.entry.js +30 -0
  31. package/dist/cjs/justifi-details.cjs.entry.js.map +1 -0
  32. package/dist/cjs/justifi-payment-details.cjs.entry.js +63 -0
  33. package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -0
  34. package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
  35. package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -1
  36. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +7 -5
  37. package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
  38. package/dist/cjs/justifi-payments-list.cjs.entry.js +49 -47
  39. package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
  40. package/dist/cjs/justifi-payout-details.cjs.entry.js +61 -0
  41. package/dist/cjs/justifi-payout-details.cjs.entry.js.map +1 -0
  42. package/dist/cjs/justifi-payouts-list.cjs.entry.js +64 -54
  43. package/dist/cjs/justifi-payouts-list.cjs.entry.js.map +1 -1
  44. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +156 -0
  45. package/dist/cjs/justifi-proceeds-list.cjs.entry.js.map +1 -0
  46. package/dist/cjs/justifi-table.cjs.entry.js +68 -0
  47. package/dist/cjs/justifi-table.cjs.entry.js.map +1 -0
  48. package/dist/cjs/loader.cjs.js +2 -2
  49. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  50. package/dist/cjs/table-utils-617126e5.js +13 -0
  51. package/dist/cjs/table-utils-617126e5.js.map +1 -0
  52. package/dist/cjs/{utils-4ee7e080.js → utils-0fd61dbd.js} +43 -104
  53. package/dist/cjs/utils-0fd61dbd.js.map +1 -0
  54. package/dist/cjs/utils-a5b5bfdf.js +35 -0
  55. package/dist/cjs/utils-a5b5bfdf.js.map +1 -0
  56. package/dist/cjs/webcomponents.cjs.js +3 -3
  57. package/dist/cjs/webcomponents.cjs.js.map +1 -1
  58. package/dist/collection/api/Api.js +15 -3
  59. package/dist/collection/api/Api.js.map +1 -1
  60. package/dist/collection/api/Business.js +50 -0
  61. package/dist/collection/api/Business.js.map +1 -0
  62. package/dist/collection/api/Payment.js.map +1 -1
  63. package/dist/collection/api/Payout.js +9 -0
  64. package/dist/collection/api/Payout.js.map +1 -1
  65. package/dist/collection/api/Proceed.js +42 -0
  66. package/dist/collection/api/Proceed.js.map +1 -0
  67. package/dist/collection/api/shared.js +2 -0
  68. package/dist/collection/api/shared.js.map +1 -0
  69. package/dist/collection/collection-manifest.json +13 -1
  70. package/dist/collection/components/business-form/additional-questions/additional-questions.js +59 -0
  71. package/dist/collection/components/business-form/additional-questions/additional-questions.js.map +1 -0
  72. package/dist/collection/components/business-form/business-address/business-address-form.js +1 -1
  73. package/dist/collection/components/business-form/business-address/business-address-form.js.map +1 -1
  74. package/dist/collection/components/business-form/business-address/test/business-address.spec.js +22 -18
  75. package/dist/collection/components/business-form/business-address/test/business-address.spec.js.map +1 -1
  76. package/dist/collection/components/business-form/business-form-schema.js +48 -37
  77. package/dist/collection/components/business-form/business-form-schema.js.map +1 -1
  78. package/dist/collection/components/business-form/business-form.css +5283 -43
  79. package/dist/collection/components/business-form/business-form.js +83 -6
  80. package/dist/collection/components/business-form/business-form.js.map +1 -1
  81. package/dist/collection/components/business-form/{businessForm.stories.js → business-form.stories.js} +8 -8
  82. package/dist/collection/components/business-form/business-form.stories.js.map +1 -0
  83. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +10 -17
  84. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map +1 -1
  85. package/dist/collection/components/business-form/business-owners/business-owners.css +5283 -0
  86. package/dist/collection/components/business-form/business-owners/business-owners.js +48 -37
  87. package/dist/collection/components/business-form/business-owners/business-owners.js.map +1 -1
  88. package/dist/collection/components/business-form/business-representative/business-representative.js +12 -17
  89. package/dist/collection/components/business-form/business-representative/business-representative.js.map +1 -1
  90. package/dist/collection/components/business-form/test/business-form.spec.js +44 -0
  91. package/dist/collection/components/business-form/test/business-form.spec.js.map +1 -0
  92. package/dist/collection/components/business-list/business-list.css +576 -0
  93. package/dist/collection/components/business-list/business-list.js +209 -0
  94. package/dist/collection/components/business-list/business-list.js.map +1 -0
  95. package/dist/collection/components/business-list/business-list.stories.js +68 -0
  96. package/dist/collection/components/business-list/business-list.stories.js.map +1 -0
  97. package/dist/collection/components/business-list/example.js +12 -0
  98. package/dist/collection/components/details/details.css +7983 -0
  99. package/dist/collection/components/details/details.js +66 -0
  100. package/dist/collection/components/details/details.js.map +1 -0
  101. package/dist/collection/components/details/utils.js +10 -0
  102. package/dist/collection/components/details/utils.js.map +1 -0
  103. package/dist/collection/components/form/form-control-datepart.js +233 -0
  104. package/dist/collection/components/form/form-control-datepart.js.map +1 -0
  105. package/dist/collection/components/form/form-control-monetary.js +186 -0
  106. package/dist/collection/components/form/form-control-monetary.js.map +1 -0
  107. package/dist/collection/components/form/form-control-number-masked.js +217 -0
  108. package/dist/collection/components/form/form-control-number-masked.js.map +1 -0
  109. package/dist/collection/components/form/form-control-number.css +1818 -0
  110. package/dist/collection/components/form/form-control-number.js +194 -0
  111. package/dist/collection/components/form/form-control-number.js.map +1 -0
  112. package/dist/collection/components/form/form-control-select.css +6 -0
  113. package/dist/collection/components/form/form-control-select.js +36 -4
  114. package/dist/collection/components/form/form-control-select.js.map +1 -1
  115. package/dist/collection/components/form/form-control-text.css +7 -0
  116. package/dist/collection/components/form/form-control-text.js +45 -3
  117. package/dist/collection/components/form/form-control-text.js.map +1 -1
  118. package/dist/collection/components/form/form.js +16 -8
  119. package/dist/collection/components/form/form.js.map +1 -1
  120. package/dist/collection/components/legal-address-form/legal-address-form-schema.js +11 -0
  121. package/dist/collection/components/legal-address-form/legal-address-form-schema.js.map +1 -0
  122. package/dist/collection/components/legal-address-form/legal-address-form.css +2489 -0
  123. package/dist/collection/components/legal-address-form/legal-address-form.js +90 -0
  124. package/dist/collection/components/legal-address-form/legal-address-form.js.map +1 -0
  125. package/dist/collection/components/payment-details/example.js +12 -0
  126. package/dist/collection/components/payment-details/payment-details.css +7983 -0
  127. package/dist/collection/components/payment-details/payment-details.js +129 -0
  128. package/dist/collection/components/payment-details/payment-details.js.map +1 -0
  129. package/dist/collection/components/payment-details/payment-details.stories.js +47 -0
  130. package/dist/collection/components/payment-details/payment-details.stories.js.map +1 -0
  131. package/dist/collection/components/payments-list/payments-list.css +0 -7380
  132. package/dist/collection/components/payments-list/payments-list.js +69 -43
  133. package/dist/collection/components/payments-list/payments-list.js.map +1 -1
  134. package/dist/collection/components/payments-list/payments-list.stories.js +10 -10
  135. package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
  136. package/dist/collection/components/payments-list/test/payments-list.spec.js +3 -54
  137. package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -1
  138. package/dist/collection/components/payout-details/example.js +12 -0
  139. package/dist/collection/components/payout-details/payout-details.css +7983 -0
  140. package/dist/collection/components/payout-details/payout-details.js +126 -0
  141. package/dist/collection/components/payout-details/payout-details.js.map +1 -0
  142. package/dist/collection/components/payout-details/payout-details.stories.js +47 -0
  143. package/dist/collection/components/payout-details/payout-details.stories.js.map +1 -0
  144. package/dist/collection/components/payouts-list/example.js +12 -0
  145. package/dist/collection/components/payouts-list/payouts-list.css +0 -7407
  146. package/dist/collection/components/payouts-list/payouts-list.js +82 -48
  147. package/dist/collection/components/payouts-list/payouts-list.js.map +1 -1
  148. package/dist/collection/components/payouts-list/payouts-list.stories.js +10 -10
  149. package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
  150. package/dist/collection/components/proceeds-list/example.js +12 -0
  151. package/dist/collection/components/proceeds-list/proceeds-list.css +576 -0
  152. package/dist/collection/components/proceeds-list/proceeds-list.js +207 -0
  153. package/dist/collection/components/proceeds-list/proceeds-list.js.map +1 -0
  154. package/dist/collection/components/proceeds-list/proceeds-list.stories.js +69 -0
  155. package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -0
  156. package/dist/collection/components/table/table-utils.js +8 -0
  157. package/dist/collection/components/table/table-utils.js.map +1 -0
  158. package/dist/collection/components/table/table.css +8077 -0
  159. package/dist/collection/components/table/table.js +215 -0
  160. package/dist/collection/components/table/table.js.map +1 -0
  161. package/dist/collection/components/table/test/table.spec.js +59 -0
  162. package/dist/collection/components/table/test/table.spec.js.map +1 -0
  163. package/dist/collection/utils/country-options.js +202 -0
  164. package/dist/collection/utils/country-options.js.map +1 -0
  165. package/dist/collection/utils/phone-masks.js +4 -0
  166. package/dist/collection/utils/phone-masks.js.map +1 -0
  167. package/dist/collection/utils/utils.js +40 -0
  168. package/dist/collection/utils/utils.js.map +1 -1
  169. package/dist/components/Api.js +15 -3
  170. package/dist/components/Api.js.map +1 -1
  171. package/dist/components/Payout.js +113 -0
  172. package/dist/components/Payout.js.map +1 -0
  173. package/dist/components/additional-questions.js +51 -0
  174. package/dist/components/additional-questions.js.map +1 -0
  175. package/dist/components/business-address-form.js +8 -2
  176. package/dist/components/business-address-form.js.map +1 -1
  177. package/dist/components/business-generic-info.js +61 -35
  178. package/dist/components/business-generic-info.js.map +1 -1
  179. package/dist/components/business-owners.js +52 -36
  180. package/dist/components/business-owners.js.map +1 -1
  181. package/dist/components/business-representative.js +31 -15
  182. package/dist/components/business-representative.js.map +1 -1
  183. package/dist/components/details.js +66 -0
  184. package/dist/components/details.js.map +1 -0
  185. package/dist/components/form-control-datepart.d.ts +11 -0
  186. package/dist/components/form-control-datepart.js +8 -0
  187. package/dist/components/form-control-datepart.js.map +1 -0
  188. package/dist/components/form-control-datepart2.js +97 -0
  189. package/dist/components/form-control-datepart2.js.map +1 -0
  190. package/dist/components/form-control-monetary.d.ts +11 -0
  191. package/dist/components/form-control-monetary.js +8 -0
  192. package/dist/components/form-control-monetary.js.map +1 -0
  193. package/dist/components/form-control-monetary2.js +82 -0
  194. package/dist/components/form-control-monetary2.js.map +1 -0
  195. package/dist/components/form-control-number-masked.d.ts +11 -0
  196. package/dist/components/form-control-number-masked.js +8 -0
  197. package/dist/components/form-control-number-masked.js.map +1 -0
  198. package/dist/components/form-control-number-masked2.js +81 -0
  199. package/dist/components/form-control-number-masked2.js.map +1 -0
  200. package/dist/components/form-control-number.d.ts +11 -0
  201. package/dist/components/form-control-number.js +8 -0
  202. package/dist/components/form-control-number.js.map +1 -0
  203. package/dist/components/form-control-number2.js +70 -0
  204. package/dist/components/form-control-number2.js.map +1 -0
  205. package/dist/components/form-control-select.js +2 -2
  206. package/dist/components/form-control-select2.js +20 -7
  207. package/dist/components/form-control-select2.js.map +1 -1
  208. package/dist/components/form-control-text2.js +23 -4
  209. package/dist/components/form-control-text2.js.map +1 -1
  210. package/dist/components/index.d.ts +6 -0
  211. package/dist/components/index.esm.js +1 -18
  212. package/dist/components/index.esm.js.map +1 -1
  213. package/dist/components/index.js +1 -1
  214. package/dist/components/index2.js +3231 -0
  215. package/dist/components/index2.js.map +1 -0
  216. package/dist/components/justifi-additional-questions.d.ts +11 -0
  217. package/dist/components/justifi-additional-questions.js +8 -0
  218. package/dist/components/justifi-additional-questions.js.map +1 -0
  219. package/dist/components/justifi-business-form.js +146 -28
  220. package/dist/components/justifi-business-form.js.map +1 -1
  221. package/dist/components/justifi-business-generic-info.js +1 -1
  222. package/dist/components/justifi-business-list.d.ts +11 -0
  223. package/dist/components/justifi-business-list.js +215 -0
  224. package/dist/components/justifi-business-list.js.map +1 -0
  225. package/dist/components/justifi-details.d.ts +11 -0
  226. package/dist/components/justifi-details.js +8 -0
  227. package/dist/components/justifi-details.js.map +1 -0
  228. package/dist/components/justifi-legal-address-form.d.ts +11 -0
  229. package/dist/components/justifi-legal-address-form.js +8 -0
  230. package/dist/components/justifi-legal-address-form.js.map +1 -0
  231. package/dist/components/justifi-payment-details.d.ts +11 -0
  232. package/dist/components/justifi-payment-details.js +88 -0
  233. package/dist/components/justifi-payment-details.js.map +1 -0
  234. package/dist/components/justifi-payment-form.js +2 -1
  235. package/dist/components/justifi-payment-form.js.map +1 -1
  236. package/dist/components/justifi-payments-list.js +52 -45
  237. package/dist/components/justifi-payments-list.js.map +1 -1
  238. package/dist/components/justifi-payout-details.d.ts +11 -0
  239. package/dist/components/justifi-payout-details.js +86 -0
  240. package/dist/components/justifi-payout-details.js.map +1 -0
  241. package/dist/components/justifi-payouts-list.js +65 -50
  242. package/dist/components/justifi-payouts-list.js.map +1 -1
  243. package/dist/components/justifi-proceeds-list.d.ts +11 -0
  244. package/dist/components/justifi-proceeds-list.js +182 -0
  245. package/dist/components/justifi-proceeds-list.js.map +1 -0
  246. package/dist/components/justifi-table.d.ts +11 -0
  247. package/dist/components/justifi-table.js +8 -0
  248. package/dist/components/justifi-table.js.map +1 -0
  249. package/dist/components/legal-address-form.js +271 -0
  250. package/dist/components/legal-address-form.js.map +1 -0
  251. package/dist/components/payment-method-form.js +6 -4
  252. package/dist/components/payment-method-form.js.map +1 -1
  253. package/dist/components/phone-masks.js +7 -0
  254. package/dist/components/phone-masks.js.map +1 -0
  255. package/dist/components/table.js +94 -0
  256. package/dist/components/table.js.map +1 -0
  257. package/dist/components/utils.js +41 -102
  258. package/dist/components/utils.js.map +1 -1
  259. package/dist/esm/{Api-436dfa09.js → Api-a95f17ac.js} +16 -4
  260. package/dist/esm/Api-a95f17ac.js.map +1 -0
  261. package/dist/esm/Payout-9a1f2859.js +113 -0
  262. package/dist/esm/Payout-9a1f2859.js.map +1 -0
  263. package/dist/esm/{business-form-schema-30c48693.js → business-form-schema-5885d3d6.js} +40 -22
  264. package/dist/esm/business-form-schema-5885d3d6.js.map +1 -0
  265. package/dist/esm/form-control-datepart_2.entry.js +102 -0
  266. package/dist/esm/form-control-datepart_2.entry.js.map +1 -0
  267. package/dist/esm/form-control-monetary.entry.js +61 -0
  268. package/dist/esm/form-control-monetary.entry.js.map +1 -0
  269. package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +98 -12
  270. package/dist/esm/form-control-number_3.entry.js.map +1 -0
  271. package/dist/esm/form-control-select.entry.js +43 -0
  272. package/dist/esm/form-control-select.entry.js.map +1 -0
  273. package/dist/esm/index-5ed53c20.js +3231 -0
  274. package/dist/esm/index-5ed53c20.js.map +1 -0
  275. package/dist/esm/{index-c8f391de.js → index-609a2c67.js} +10 -2
  276. package/dist/esm/index-609a2c67.js.map +1 -0
  277. package/dist/esm/{index.esm-be2cd327.js → index.esm-89fe6af9.js} +2 -19
  278. package/dist/esm/index.esm-89fe6af9.js.map +1 -0
  279. package/dist/esm/justifi-additional-questions_5.entry.js +388 -0
  280. package/dist/esm/justifi-additional-questions_5.entry.js.map +1 -0
  281. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  282. package/dist/esm/justifi-billing-form_2.entry.js +2 -2
  283. package/dist/esm/justifi-business-form.entry.js +98 -16
  284. package/dist/esm/justifi-business-form.entry.js.map +1 -1
  285. package/dist/esm/justifi-business-list.entry.js +185 -0
  286. package/dist/esm/justifi-business-list.entry.js.map +1 -0
  287. package/dist/esm/justifi-card-form.entry.js +1 -1
  288. package/dist/esm/justifi-details.entry.js +26 -0
  289. package/dist/esm/justifi-details.entry.js.map +1 -0
  290. package/dist/esm/justifi-payment-details.entry.js +59 -0
  291. package/dist/esm/justifi-payment-details.entry.js.map +1 -0
  292. package/dist/esm/justifi-payment-form.entry.js +3 -2
  293. package/dist/esm/justifi-payment-form.entry.js.map +1 -1
  294. package/dist/esm/justifi-payment-method-form.entry.js +7 -5
  295. package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
  296. package/dist/esm/justifi-payments-list.entry.js +47 -45
  297. package/dist/esm/justifi-payments-list.entry.js.map +1 -1
  298. package/dist/esm/justifi-payout-details.entry.js +57 -0
  299. package/dist/esm/justifi-payout-details.entry.js.map +1 -0
  300. package/dist/esm/justifi-payouts-list.entry.js +60 -50
  301. package/dist/esm/justifi-payouts-list.entry.js.map +1 -1
  302. package/dist/esm/justifi-proceeds-list.entry.js +152 -0
  303. package/dist/esm/justifi-proceeds-list.entry.js.map +1 -0
  304. package/dist/esm/justifi-table.entry.js +64 -0
  305. package/dist/esm/justifi-table.entry.js.map +1 -0
  306. package/dist/esm/loader.js +3 -3
  307. package/dist/esm/select-input_2.entry.js +1 -1
  308. package/dist/esm/table-utils-6cdcaa8c.js +11 -0
  309. package/dist/esm/table-utils-6cdcaa8c.js.map +1 -0
  310. package/dist/esm/{utils-e7782126.js → utils-ad0bbe03.js} +42 -103
  311. package/dist/esm/utils-ad0bbe03.js.map +1 -0
  312. package/dist/esm/utils-cdf0b984.js +28 -0
  313. package/dist/esm/utils-cdf0b984.js.map +1 -0
  314. package/dist/esm/webcomponents.js +4 -4
  315. package/dist/esm/webcomponents.js.map +1 -1
  316. package/dist/types/api/Api.d.ts +1 -1
  317. package/dist/types/api/Business.d.ts +133 -0
  318. package/dist/types/api/Payment.d.ts +1 -0
  319. package/dist/types/api/Payout.d.ts +10 -12
  320. package/dist/types/api/Proceed.d.ts +60 -0
  321. package/dist/types/api/shared.d.ts +11 -0
  322. package/dist/types/components/business-form/additional-questions/additional-questions.d.ts +15 -0
  323. package/dist/types/components/business-form/business-form-schema.d.ts +47 -21
  324. package/dist/types/components/business-form/business-form.d.ts +7 -2
  325. package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +1 -2
  326. package/dist/types/components/business-form/business-owners/business-owners.d.ts +3 -2
  327. package/dist/types/components/business-form/business-representative/business-representative.d.ts +1 -2
  328. package/dist/types/components/business-list/business-list.d.ts +35 -0
  329. package/dist/types/components/business-list/business-list.stories.d.ts +9 -0
  330. package/dist/types/components/details/details.d.ts +7 -0
  331. package/dist/types/components/details/utils.d.ts +19 -0
  332. package/dist/types/components/form/form-control-datepart.d.ts +19 -0
  333. package/dist/types/components/form/form-control-monetary.d.ts +17 -0
  334. package/dist/types/components/form/form-control-number-masked.d.ts +19 -0
  335. package/dist/types/components/form/form-control-number.d.ts +18 -0
  336. package/dist/types/components/form/form-control-select.d.ts +6 -1
  337. package/dist/types/components/form/form-control-text.d.ts +6 -0
  338. package/dist/types/components/form/form.d.ts +5 -4
  339. package/dist/types/components/legal-address-form/legal-address-form-schema.d.ts +17 -0
  340. package/dist/types/components/legal-address-form/legal-address-form.d.ts +16 -0
  341. package/dist/types/components/payment-details/payment-details.d.ts +28 -0
  342. package/dist/types/components/payment-details/payment-details.stories.d.ts +8 -0
  343. package/dist/types/components/payments-list/payments-list.d.ts +6 -14
  344. package/dist/types/components/payments-list/payments-list.stories.d.ts +1 -8
  345. package/dist/types/components/payout-details/payout-details.d.ts +28 -0
  346. package/dist/types/components/payout-details/payout-details.stories.d.ts +8 -0
  347. package/dist/types/components/payouts-list/payouts-list.d.ts +7 -15
  348. package/dist/types/components/payouts-list/payouts-list.stories.d.ts +1 -8
  349. package/dist/types/components/proceeds-list/proceeds-list.d.ts +37 -0
  350. package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +9 -0
  351. package/dist/types/components/table/table-utils.d.ts +14 -0
  352. package/dist/types/components/table/table.d.ts +28 -0
  353. package/dist/types/components.d.ts +635 -12
  354. package/dist/types/stencil-public-runtime.d.ts +2 -0
  355. package/dist/types/utils/country-options.d.ts +5 -0
  356. package/dist/types/utils/phone-masks.d.ts +3 -0
  357. package/dist/types/utils/utils.d.ts +2 -0
  358. package/dist/webcomponents/{p-33d69eb5.entry.js → p-0237a6bc.entry.js} +2 -2
  359. package/dist/webcomponents/p-0237a6bc.entry.js.map +1 -0
  360. package/dist/webcomponents/{p-7041a637.entry.js → p-0d6e9f76.entry.js} +2 -2
  361. package/dist/webcomponents/p-126146d4.js +2 -0
  362. package/dist/webcomponents/p-126146d4.js.map +1 -0
  363. package/dist/webcomponents/p-239564c6.entry.js +2 -0
  364. package/dist/webcomponents/p-239564c6.entry.js.map +1 -0
  365. package/dist/webcomponents/p-27b15fe8.entry.js +2 -0
  366. package/dist/webcomponents/p-27b15fe8.entry.js.map +1 -0
  367. package/dist/webcomponents/p-2c2cde2d.js +2 -0
  368. package/dist/webcomponents/p-2c2cde2d.js.map +1 -0
  369. package/dist/webcomponents/p-308b6784.js +3 -0
  370. package/dist/webcomponents/p-308b6784.js.map +1 -0
  371. package/dist/webcomponents/p-391b8f1d.entry.js +2 -0
  372. package/dist/webcomponents/p-391b8f1d.entry.js.map +1 -0
  373. package/dist/webcomponents/p-439fc294.entry.js +2 -0
  374. package/dist/webcomponents/p-439fc294.entry.js.map +1 -0
  375. package/dist/webcomponents/p-66f010e5.entry.js +2 -0
  376. package/dist/webcomponents/{p-d5bc9f22.entry.js.map → p-66f010e5.entry.js.map} +1 -1
  377. package/dist/webcomponents/p-7abb092c.entry.js +2 -0
  378. package/dist/webcomponents/{p-309a886f.entry.js.map → p-7abb092c.entry.js.map} +1 -1
  379. package/dist/webcomponents/{p-d5cadc78.entry.js → p-7e3bbe32.entry.js} +2 -2
  380. package/dist/webcomponents/p-86464cab.entry.js +2 -0
  381. package/dist/webcomponents/p-86464cab.entry.js.map +1 -0
  382. package/dist/webcomponents/p-8f421dc6.js +2 -0
  383. package/dist/webcomponents/p-8f421dc6.js.map +1 -0
  384. package/dist/webcomponents/p-9346ae33.js +2 -0
  385. package/dist/webcomponents/p-9346ae33.js.map +1 -0
  386. package/dist/webcomponents/p-ab0756ff.js +2 -0
  387. package/dist/webcomponents/p-ab0756ff.js.map +1 -0
  388. package/dist/webcomponents/p-b042bf80.entry.js +2 -0
  389. package/dist/webcomponents/p-b042bf80.entry.js.map +1 -0
  390. package/dist/webcomponents/{p-1953797f.entry.js → p-b967262f.entry.js} +2 -2
  391. package/dist/webcomponents/p-bf9c2be2.entry.js +2 -0
  392. package/dist/webcomponents/p-bf9c2be2.entry.js.map +1 -0
  393. package/dist/webcomponents/p-c18d876e.entry.js +2 -0
  394. package/dist/webcomponents/p-c18d876e.entry.js.map +1 -0
  395. package/dist/webcomponents/p-c1e4288d.entry.js +2 -0
  396. package/dist/webcomponents/p-c1e4288d.entry.js.map +1 -0
  397. package/dist/webcomponents/{p-0fd4aae2.js → p-c46241ba.js} +2 -2
  398. package/dist/webcomponents/p-c46241ba.js.map +1 -0
  399. package/dist/webcomponents/p-ccb0e1c5.js +2 -0
  400. package/dist/webcomponents/p-ccb0e1c5.js.map +1 -0
  401. package/dist/webcomponents/p-d1bbf409.entry.js +2 -0
  402. package/dist/webcomponents/p-d1bbf409.entry.js.map +1 -0
  403. package/dist/webcomponents/p-e26d7eea.entry.js +2 -0
  404. package/dist/webcomponents/p-e26d7eea.entry.js.map +1 -0
  405. package/dist/webcomponents/{p-23e9c7d4.entry.js → p-e77d8c6e.entry.js} +2 -2
  406. package/dist/webcomponents/p-f0acb27e.entry.js +2 -0
  407. package/dist/webcomponents/p-f0acb27e.entry.js.map +1 -0
  408. package/dist/webcomponents/p-f8d49acb.entry.js +2 -0
  409. package/dist/webcomponents/p-f8d49acb.entry.js.map +1 -0
  410. package/dist/webcomponents/p-f9e127a5.js +2 -0
  411. package/dist/webcomponents/p-f9e127a5.js.map +1 -0
  412. package/dist/webcomponents/webcomponents.esm.js +1 -1
  413. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  414. package/package.json +7 -5
  415. package/dist/cjs/Api-7303478d.js.map +0 -1
  416. package/dist/cjs/business-form-schema-63b311b2.js.map +0 -1
  417. package/dist/cjs/form-control-select_2.cjs.entry.js.map +0 -1
  418. package/dist/cjs/index-83b2ec02.js.map +0 -1
  419. package/dist/cjs/index.esm-7e12ce07.js.map +0 -1
  420. package/dist/cjs/justifi-business-address-form.cjs.entry.js +0 -37
  421. package/dist/cjs/justifi-business-address-form.cjs.entry.js.map +0 -1
  422. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js +0 -148
  423. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js.map +0 -1
  424. package/dist/cjs/utils-4ee7e080.js.map +0 -1
  425. package/dist/collection/components/business-form/businessForm.stories.js.map +0 -1
  426. package/dist/esm/Api-436dfa09.js.map +0 -1
  427. package/dist/esm/business-form-schema-30c48693.js.map +0 -1
  428. package/dist/esm/form-control-select_2.entry.js.map +0 -1
  429. package/dist/esm/index-c8f391de.js.map +0 -1
  430. package/dist/esm/index.esm-be2cd327.js.map +0 -1
  431. package/dist/esm/justifi-business-address-form.entry.js +0 -33
  432. package/dist/esm/justifi-business-address-form.entry.js.map +0 -1
  433. package/dist/esm/justifi-business-generic-info_3.entry.js +0 -142
  434. package/dist/esm/justifi-business-generic-info_3.entry.js.map +0 -1
  435. package/dist/esm/utils-e7782126.js.map +0 -1
  436. package/dist/webcomponents/p-0fd4aae2.js.map +0 -1
  437. package/dist/webcomponents/p-1a1f2196.js +0 -2
  438. package/dist/webcomponents/p-1a1f2196.js.map +0 -1
  439. package/dist/webcomponents/p-309a886f.entry.js +0 -2
  440. package/dist/webcomponents/p-33d69eb5.entry.js.map +0 -1
  441. package/dist/webcomponents/p-3a80a2ec.entry.js +0 -2
  442. package/dist/webcomponents/p-3a80a2ec.entry.js.map +0 -1
  443. package/dist/webcomponents/p-45fea6a8.entry.js +0 -2
  444. package/dist/webcomponents/p-45fea6a8.entry.js.map +0 -1
  445. package/dist/webcomponents/p-79456add.js +0 -2
  446. package/dist/webcomponents/p-79456add.js.map +0 -1
  447. package/dist/webcomponents/p-af080b21.js +0 -2
  448. package/dist/webcomponents/p-af080b21.js.map +0 -1
  449. package/dist/webcomponents/p-bc969904.js +0 -3
  450. package/dist/webcomponents/p-bc969904.js.map +0 -1
  451. package/dist/webcomponents/p-cd097ce9.entry.js +0 -2
  452. package/dist/webcomponents/p-cd097ce9.entry.js.map +0 -1
  453. package/dist/webcomponents/p-d5bc9f22.entry.js +0 -2
  454. package/dist/webcomponents/p-dd1ebc0b.entry.js +0 -2
  455. package/dist/webcomponents/p-dd1ebc0b.entry.js.map +0 -1
  456. package/dist/webcomponents/p-e05e0c6b.entry.js +0 -2
  457. package/dist/webcomponents/p-e05e0c6b.entry.js.map +0 -1
  458. /package/dist/types/components/business-form/{businessForm.stories.d.ts → business-form.stories.d.ts} +0 -0
  459. /package/dist/webcomponents/{p-7041a637.entry.js.map → p-0d6e9f76.entry.js.map} +0 -0
  460. /package/dist/webcomponents/{p-d5cadc78.entry.js.map → p-7e3bbe32.entry.js.map} +0 -0
  461. /package/dist/webcomponents/{p-1953797f.entry.js.map → p-b967262f.entry.js.map} +0 -0
  462. /package/dist/webcomponents/{p-23e9c7d4.entry.js.map → p-e77d8c6e.entry.js.map} +0 -0
@@ -1,13 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
- import { Api, Payout, PayoutStatuses } from "../../api";
2
+ import { Api, Payout, PayoutStatuses, PayoutStatusesSafeNames } from "../../api";
3
3
  import { formatCurrency, formatDate, formatTime } from "../../utils/utils";
4
- const pagingDefaults = {
5
- amount: 25,
6
- start_cursor: '',
7
- end_cursor: '',
8
- has_previous: false,
9
- has_next: false,
10
- };
4
+ import { pagingDefaults } from "../table/table-utils";
11
5
  /**
12
6
  * @exportedPart table-head: Table head
13
7
  * @exportedPart table-head-row: Head row
@@ -23,18 +17,12 @@ const pagingDefaults = {
23
17
  * @exportedPart arrow: Both paging buttons
24
18
  * @exportedPart arrow-left: Previous page button
25
19
  * @exportedPart arrow-right: Next page button
26
- * @exportedPart arrow-disabled: Disabled state for paging buttons
20
+ * @exportedPart button-disabled: Disabled state for paging buttons
21
+ * @exportedPart previous-button-text: Text for Previous button
22
+ * @exportedPart next-button-text: Text for Next button
27
23
  */
28
24
  export class PayoutsList {
29
25
  constructor() {
30
- // onChangeAmount = (e) => {
31
- // const newVal = e?.target?.value;
32
- // if (newVal) {
33
- // this.paging = pagingDefaults;
34
- // this.paging.amount = newVal;
35
- // this.fetchData();
36
- // }
37
- // }
38
26
  this.onPageChange = (direction) => {
39
27
  return () => {
40
28
  this.fetchData(direction);
@@ -42,24 +30,20 @@ export class PayoutsList {
42
30
  };
43
31
  this.mapStatusToBadge = (status) => {
44
32
  switch (status) {
45
- case PayoutStatuses.scheduled || PayoutStatuses.in_transit:
46
- return 'bg-primary';
47
- case PayoutStatuses.failed || PayoutStatuses.canceled:
48
- return 'bg-danger';
33
+ case PayoutStatuses.scheduled:
34
+ return `<span class="badge bg-primary" title='Batched and scheduled to be transferred'>${PayoutStatusesSafeNames[status]}</span>`;
35
+ case PayoutStatuses.in_transit:
36
+ return `<span class="badge bg-primary" title='Transfer to your bank account has been initiated'>${PayoutStatusesSafeNames[status]}</span>`;
37
+ case PayoutStatuses.failed:
38
+ return `<span class="badge bg-danger" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;
39
+ case PayoutStatuses.canceled:
40
+ return `<span class="badge bg-danger" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;
49
41
  case PayoutStatuses.forwarded:
50
- return 'bg-secondary';
42
+ return `<span class="badge bg-secondary" title='This payout initially failed; the funds have been forwarded to your next successful payout'>${PayoutStatusesSafeNames[status]}</span>`;
51
43
  case PayoutStatuses.paid:
52
- return 'bg-success';
53
- default:
54
- return 'bg-secondary';
44
+ return `<span class="badge bg-success" title='Successfully deposited into your bank account'>${PayoutStatusesSafeNames[status]}</span>`;
55
45
  }
56
46
  };
57
- this.emptyState = (h("tr", null, h("td", { class: "empty-state", part: "empty-state", colSpan: 10, style: { textAlign: 'center' } }, "No payouts to show")));
58
- this.errorState = () => (h("tr", null, h("td", { class: "error-state", part: "error-state", colSpan: 10, style: { textAlign: 'center' } }, "An unexpected error occurred: ", this.errorMessage)));
59
- this.loadingState = (h("tr", null, h("td", { class: "loading-state", part: "loading-state-cell", colSpan: 10, style: { textAlign: 'center' } }, h("div", { part: "loading-state-spinner", class: "spinner-border", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")))));
60
- this.paginationBar = () => {
61
- return (h("div", { class: "pagination-bar d-flex justify-content-center gap-3" }, h("button", { onClick: this.onPageChange('prev'), part: `arrow arrow-left${this.paging.has_previous ? '' : ' arrow-disabled'}`, disabled: !this.paging.has_previous, class: `btn btn-primary pagination-btn pagination-prev-btn${this.paging.has_previous ? '' : ' disabled'}` }, "\u2190"), h("button", { onClick: this.onPageChange('next'), part: `arrow arrow-right${this.paging.has_next ? '' : ' arrow-disabled'}`, disabled: !this.paging.has_next, class: `btn btn-primary pagination-btn pagination-next-btn${this.paging.has_next ? '' : ' disabled'}` }, "\u2192")));
62
- };
63
47
  this.accountId = undefined;
64
48
  this.authToken = undefined;
65
49
  this.payouts = [];
@@ -81,14 +65,11 @@ export class PayoutsList {
81
65
  return;
82
66
  }
83
67
  this.loading = true;
84
- const limit = this.paging.amount;
85
- const cursor = `${direction === 'prev'
86
- ? '&before_cursor=' + this.paging.start_cursor
87
- : direction === 'next'
88
- ? '&after_cursor=' + this.paging.end_cursor
89
- : ''}`;
90
- const endpoint = `account/${this.accountId}/payouts?limit=${limit}${cursor ? cursor : ''}`;
91
- const response = await Api(this.authToken).get(endpoint);
68
+ const endpoint = `account/${this.accountId}/payouts`;
69
+ const response = await Api(this.authToken).get(endpoint, {
70
+ paging: this.paging,
71
+ direction: direction
72
+ });
92
73
  if (!response.error) {
93
74
  this.paging = Object.assign(Object.assign({}, this.paging), response.page_info);
94
75
  const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.map(dataItem => new Payout(dataItem));
@@ -99,16 +80,45 @@ export class PayoutsList {
99
80
  }
100
81
  this.loading = false;
101
82
  }
102
- showEmptyState() {
103
- return this.payouts ? this.payouts.length < 1 : true;
104
- }
105
83
  render() {
106
- var _a;
107
- return (h(Host, { exportparts: "\n table-head,table-head-row,table-head-cell,table-body,table-row,table-cell,\n loading-state-cell,loading-state-spinner,error-state,empty-state,\n pagination-bar,arrow,arrow-left,arrow-right,arrow-disabled\n " }, h("table", { class: "table table-hover" }, h("thead", { class: "table-head sticky-top", part: "table-head" }, h("tr", { class: "table-light", part: 'table-head-row' }, h("th", { part: "table-head-cell", scope: "col", title: "The date and time each payment was made" }, "Paid Out On"), h("th", { part: "table-head-cell", scope: "col" }, "Type"), h("th", { part: "table-head-cell", scope: "col" }, "Account"), h("th", { part: "table-head-cell", scope: "col" }, "Paid Out To"), h("th", { part: "table-head-cell", scope: "col" }, "Payments"), h("th", { part: "table-head-cell", scope: "col" }, "Refunds"), h("th", { part: "table-head-cell", scope: "col" }, "Fees"), h("th", { part: "table-head-cell", scope: "col" }, "Other"), h("th", { part: "table-head-cell", scope: "col" }, "Payout Amount"), h("th", { part: "table-head-cell", scope: "col" }, "Status"))), h("tbody", { class: "table-body", part: 'table-body' }, this.loading ? this.loadingState :
108
- this.errorMessage ? this.errorState() :
109
- this.showEmptyState() ? this.emptyState :
110
- (_a = this.payouts) === null || _a === void 0 ? void 0 : _a.map((payout, index) => h("tr", { part: `table-row${index % 2 ? ' table-row-even' : ' table-row-odd'}` }, h("th", { scope: "row", part: "table-cell" }, h("div", null, formatDate(payout.created_at)), h("div", null, formatTime(payout.created_at))), h("td", { part: "table-cell" }, payout.payout_type), h("td", { part: "table-cell" }, payout.account_id), h("td", { part: "table-cell" }, payout.bank_account.full_name, " ", payout.bank_account.account_number_last4), h("td", { part: "table-cell" }, formatCurrency(payout.payments_total)), h("td", { part: "table-cell" }, formatCurrency(payout.refunds_total)), h("td", { part: "table-cell" }, formatCurrency(payout.fees_total)), h("td", { part: "table-cell" }, formatCurrency(payout.other_total)), h("td", { part: "table-cell" }, formatCurrency(payout.amount)), h("td", { part: "table-cell" }, h("span", { class: `badge ${this.mapStatusToBadge(payout.status)}` }, payout.status))))), this.paging &&
111
- h("tfoot", { class: "sticky-bottom" }, h("tr", { class: "table-light align-middle" }, h("td", { part: "pagination-bar", colSpan: 10 }, this.paginationBar()))))));
84
+ return (h(Host, null, h("justifi-table", { rowClickHandler: (e) => {
85
+ const clickedPayoutID = e.target.closest('tr').dataset.rowEntityId;
86
+ if (!clickedPayoutID) {
87
+ return;
88
+ }
89
+ this.rowClicked.emit(this.payouts.find((payout) => payout.id === clickedPayoutID));
90
+ }, columnData: [
91
+ ['Paid Out On', 'The date each transaction occurred'],
92
+ ['Type', 'The type of each transaction'],
93
+ ['Account', 'The ID of the account associated with each payout'],
94
+ ['Paid Out To', 'The bank account to which each payout was transferred'],
95
+ ['Payments', 'Sum of payments in each payout'],
96
+ ['Refunds', 'Sum of refunds in each payout'],
97
+ ['Fees', 'Sum of fees in each payout'],
98
+ ['Other', 'Sum of less common transactions in each payout (disputes, ACH returns, fee refunds, and forwarded balances due to failed payouts)'],
99
+ ['Payout Amount', 'The net sum of all transactions in each payout. This is the amount you\'ll see reflected on your bank statement'],
100
+ ['Status', 'The real-time status of each payout']
101
+ ], entityId: this.payouts.map((payout) => payout.id), rowData: this.payouts.map((payout) => ([
102
+ {
103
+ type: 'head',
104
+ value: `
105
+ <div>${formatDate(payout.created_at)}</div>
106
+ <div>${formatTime(payout.created_at)}</div>
107
+ `,
108
+ },
109
+ payout.payout_type,
110
+ payout.account_id,
111
+ `${payout.bank_account.full_name} ${payout.bank_account.account_number_last4}`,
112
+ formatCurrency(payout.payments_total),
113
+ formatCurrency(payout.refunds_total),
114
+ formatCurrency(payout.fees_total),
115
+ formatCurrency(payout.other_total),
116
+ formatCurrency(payout.amount),
117
+ {
118
+ type: 'inner',
119
+ value: this.mapStatusToBadge(payout.status)
120
+ }
121
+ ])), loading: this.loading, "error-message": this.errorMessage, paging: Object.assign(Object.assign({}, this.paging), { onPrev: this.onPageChange('prev'), onNext: this.onPageChange('next') }) })));
112
122
  }
113
123
  static get is() { return "justifi-payouts-list"; }
114
124
  static get encapsulation() { return "shadow"; }
@@ -168,6 +178,30 @@ export class PayoutsList {
168
178
  "paging": {}
169
179
  };
170
180
  }
181
+ static get events() {
182
+ return [{
183
+ "method": "rowClicked",
184
+ "name": "payout-row-clicked",
185
+ "bubbles": true,
186
+ "cancelable": true,
187
+ "composed": true,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": ""
191
+ },
192
+ "complexType": {
193
+ "original": "Payout",
194
+ "resolved": "Payout",
195
+ "references": {
196
+ "Payout": {
197
+ "location": "import",
198
+ "path": "../../api",
199
+ "id": "src/api/index.ts::Payout"
200
+ }
201
+ }
202
+ }
203
+ }];
204
+ }
171
205
  static get watchers() {
172
206
  return [{
173
207
  "propName": "accountId",
@@ -1 +1 @@
1
- {"version":3,"file":"payouts-list.js","sourceRoot":"","sources":["../../../../src/components/payouts-list/payouts-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,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU3E,MAAM,cAAc,GAAG;EACrB,MAAM,EAAE,EAAE;EACV,YAAY,EAAE,EAAE;EAChB,UAAU,EAAE,EAAE;EACd,YAAY,EAAE,KAAK;EACnB,QAAQ,EAAE,KAAK;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;EAgBE;AAOF,MAAM,OAAO,WAAW;;IAkBtB,4BAA4B;IAC5B,qCAAqC;IACrC,kBAAkB;IAClB,oCAAoC;IACpC,mCAAmC;IACnC,wBAAwB;IACxB,MAAM;IACN,IAAI;IAEJ,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,qBAAgB,GAAG,CAAC,MAAsB,EAAE,EAAE;MAC5C,QAAQ,MAAM,EAAE;QACd,KAAK,cAAc,CAAC,SAAS,IAAI,cAAc,CAAC,UAAU;UACxD,OAAO,YAAY,CAAC;QACtB,KAAK,cAAc,CAAC,MAAM,IAAI,cAAc,CAAC,QAAQ;UACnD,OAAO,WAAW,CAAC;QACrB,KAAK,cAAc,CAAC,SAAS;UAC3B,OAAO,cAAc,CAAC;QACxB,KAAK,cAAc,CAAC,IAAI;UACt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AAI,IAAI,EAAC,YAAY;kBAAE,MAAM,CAAC,YAAY,CAAC,SAAS;;kBAAG,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAM;gBACrG,UAAI,IAAI,EAAC,YAAY,IAAE,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,CAAM;gBAClE,UAAI,IAAI,EAAC,YAAY,IAAE,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CAAM;gBACjE,UAAI,IAAI,EAAC,YAAY,IAAE,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAM;gBAC9D,UAAI,IAAI,EAAC,YAAY,IAAE,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAM;gBAC/D,UAAI,IAAI,EAAC,YAAY,IAAE,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAM;gBAC1D,UAAI,IAAI,EAAC,YAAY;kBAAC,YAAM,KAAK,EAAE,SAAS,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAG,MAAM,CAAC,MAAM,CAAQ,CAAK,CAC5G,CACN,CAEG;QACP,IAAI,CAAC,MAAM;UACV,aAAO,KAAK,EAAC,eAAe;YAC1B,UAAI,KAAK,EAAC,0BAA0B;cAClC,UAAI,IAAI,EAAC,gBAAgB,EAAC,OAAO,EAAE,EAAE,IAClC,IAAI,CAAC,aAAa,EAAE,CAClB,CACF,CACC,CAEJ,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Watch } from '@stencil/core';\nimport { Api, IApiResponseCollection, Payout, PayoutStatuses } from '../../api';\nimport { formatCurrency, formatDate, formatTime } from '../../utils/utils';\n\ninterface PagingInfo {\n amount: number,\n start_cursor: string,\n end_cursor: string,\n has_previous: boolean,\n has_next: boolean,\n}\n\nconst pagingDefaults = {\n amount: 25,\n start_cursor: '',\n end_cursor: '',\n has_previous: false,\n has_next: false,\n}\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-payouts-list',\n styleUrl: 'payouts-list.scss',\n shadow: true,\n})\n\nexport class PayoutsList {\n @Prop() accountId: string;\n @Prop() authToken: string;\n @State() payouts: Payout[] = [];\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 // onChangeAmount = (e) => {\n // const newVal = e?.target?.value;\n // if (newVal) {\n // this.paging = pagingDefaults;\n // this.paging.amount = newVal;\n // this.fetchData();\n // }\n // }\n\n onPageChange = (direction: string) => {\n return () => {\n this.fetchData(direction);\n }\n }\n\n mapStatusToBadge = (status: PayoutStatuses) => {\n switch (status) {\n case PayoutStatuses.scheduled || PayoutStatuses.in_transit:\n return 'bg-primary';\n case PayoutStatuses.failed || PayoutStatuses.canceled:\n return 'bg-danger';\n case PayoutStatuses.forwarded:\n return 'bg-secondary';\n case PayoutStatuses.paid:\n return 'bg-success';\n default:\n return 'bg-secondary';\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 limit = this.paging.amount;\n const cursor = `${\n direction === 'prev'\n ? '&before_cursor='+this.paging.start_cursor\n : direction === 'next'\n ? '&after_cursor='+this.paging.end_cursor\n : ''\n }`;\n const endpoint = `account/${this.accountId}/payouts?limit=${limit}${cursor ? cursor : ''}`;\n\n const response: IApiResponseCollection<Payout[]> = await Api(this.authToken).get(endpoint);\n if (!response.error) {\n this.paging = {\n ...this.paging,\n ...response.page_info\n }\n\n const data = response?.data?.map(dataItem => new Payout(dataItem));\n this.payouts = data;\n } else {\n this.errorMessage = typeof response.error === 'string' ? response.error : response.error.message;\n }\n\n this.loading = false;\n }\n\n showEmptyState() {\n return this.payouts ? this.payouts.length < 1 : true;\n }\n\n emptyState = (\n <tr>\n <td class=\"empty-state\" part=\"empty-state\" colSpan={10} style={{ textAlign: 'center' }}>No payouts to show</td>\n </tr>\n );\n\n errorState = () => (\n <tr>\n <td class=\"error-state\" part=\"error-state\" colSpan={10} style={{ textAlign: 'center' }}>\n An unexpected error occurred: {this.errorMessage}\n </td>\n </tr>\n );\n\n loadingState = (\n <tr>\n <td class=\"loading-state\" part=\"loading-state-cell\" colSpan={10} style={{ textAlign: 'center' }}>\n <div part=\"loading-state-spinner\" class=\"spinner-border\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </td>\n </tr>\n );\n\n paginationBar = () => {\n return (\n <div class=\"pagination-bar d-flex justify-content-center gap-3\">\n <button\n onClick={this.onPageChange('prev')}\n part={`arrow arrow-left${this.paging.has_previous ? '' : ' arrow-disabled'}`}\n disabled={!this.paging.has_previous}\n class={`btn btn-primary pagination-btn pagination-prev-btn${this.paging.has_previous ? '' : ' disabled'}`}\n >&larr;</button>\n {/* <select class=\"amount-select\" part=\"amount-select\" onChange={this.onChangeAmount}>\n <option selected={this.paging.amount === 10} value={10}>10</option>\n <option selected={this.paging.amount === 25} value={25}>25</option>\n <option selected={this.paging.amount === 50} value={50}>50</option>\n </select> */}\n <button\n onClick={this.onPageChange('next')}\n part={`arrow arrow-right${this.paging.has_next ? '' : ' arrow-disabled'}`}\n disabled={!this.paging.has_next}\n class={`btn btn-primary pagination-btn pagination-next-btn${this.paging.has_next ? '' : ' disabled'}`}\n >&rarr;</button>\n </div>\n )\n };\n\n render() {\n return (\n <Host exportparts=\"\n table-head,table-head-row,table-head-cell,table-body,table-row,table-cell,\n loading-state-cell,loading-state-spinner,error-state,empty-state,\n pagination-bar,arrow,arrow-left,arrow-right,arrow-disabled\n \">\n <table class=\"table table-hover\">\n <thead class=\"table-head sticky-top\" part=\"table-head\">\n <tr class=\"table-light\" part='table-head-row'>\n <th part=\"table-head-cell\" scope=\"col\" title=\"The date and time each payment was made\">\n Paid Out On\n </th>\n <th part=\"table-head-cell\" scope=\"col\">\n Type\n </th>\n <th part=\"table-head-cell\" scope=\"col\">Account</th>\n <th part=\"table-head-cell\" scope=\"col\">Paid Out To</th>\n <th part=\"table-head-cell\" scope=\"col\">Payments</th>\n <th part=\"table-head-cell\" scope=\"col\">Refunds</th>\n <th part=\"table-head-cell\" scope=\"col\">Fees</th>\n <th part=\"table-head-cell\" scope=\"col\">Other</th>\n <th part=\"table-head-cell\" scope=\"col\">Payout Amount</th>\n <th part=\"table-head-cell\" scope=\"col\">Status</th>\n </tr>\n </thead>\n <tbody class=\"table-body\" part='table-body'>\n {\n this.loading ? this.loadingState :\n this.errorMessage ? this.errorState() :\n this.showEmptyState() ? this.emptyState :\n this.payouts?.map((payout, index) =>\n <tr part={`table-row${index%2 ? ' table-row-even' : ' table-row-odd'}`}>\n <th scope=\"row\" part=\"table-cell\">\n <div>{formatDate(payout.created_at)}</div>\n <div>{formatTime(payout.created_at)}</div>\n </th>\n <td part=\"table-cell\">{payout.payout_type}</td>\n <td part=\"table-cell\">{payout.account_id}</td>\n <td part=\"table-cell\">{payout.bank_account.full_name} {payout.bank_account.account_number_last4}</td>\n <td part=\"table-cell\">{formatCurrency(payout.payments_total)}</td>\n <td part=\"table-cell\">{formatCurrency(payout.refunds_total)}</td>\n <td part=\"table-cell\">{formatCurrency(payout.fees_total)}</td>\n <td part=\"table-cell\">{formatCurrency(payout.other_total)}</td>\n <td part=\"table-cell\">{formatCurrency(payout.amount)}</td>\n <td part=\"table-cell\"><span class={`badge ${this.mapStatusToBadge(payout.status)}`}>{payout.status}</span></td>\n </tr>\n )\n }\n </tbody>\n {this.paging &&\n <tfoot class=\"sticky-bottom\">\n <tr class=\"table-light align-middle\">\n <td part=\"pagination-bar\" colSpan={10}>\n {this.paginationBar()}\n </td>\n </tr>\n </tfoot>\n }\n </table>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"payouts-list.js","sourceRoot":"","sources":["../../../../src/components/payouts-list/payouts-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,GAAG,EAA0B,MAAM,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAc,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAElE;;;;;;;;;;;;;;;;;;EAkBE;AAOF,MAAM,OAAO,WAAW;;IAsBtB,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,qBAAgB,GAAG,CAAC,MAAsB,EAAE,EAAE;MAC5C,QAAQ,MAAM,EAAE;QACd,KAAK,cAAc,CAAC,SAAS;UAC3B,OAAO,kFAAkF,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC;QACpI,KAAK,cAAc,CAAC,UAAU;UAC5B,OAAO,2FAA2F,uBAAuB,CAAC,MAAM,CAAC,SAAS,CAAC;Q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O,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EACjD,OAAO,EACL,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC3B;UACE;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE;2BACE,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;2BAC7B,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;mBACrC;WACF;UACD,MAAM,CAAC,WAAW;UAClB,MAAM,CAAC,UAAU;UACjB,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,IAAI,MAAM,CAAC,YAAY,CAAC,oBAAoB,EAAE;UAC9E,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC;UACrC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC;UACpC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC;UACjC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC;UAClC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC;UAC7B;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC;WAC5C;SACF,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, Event, EventEmitter } from '@stencil/core';\nimport { Api, IApiResponseCollection, Payout, PayoutStatuses, PayoutStatusesSafeNames } from '../../api';\nimport { formatCurrency, formatDate, formatTime } from '../../utils/utils';\nimport { PagingInfo, pagingDefaults } from '../table/table-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 button-disabled: Disabled state for paging buttons\n * @exportedPart previous-button-text: Text for Previous button\n * @exportedPart next-button-text: Text for Next button\n*/\n@Component({\n tag: 'justifi-payouts-list',\n styleUrl: 'payouts-list.scss',\n shadow: true,\n})\n\nexport class PayoutsList {\n @Prop() accountId: string;\n @Prop() authToken: string;\n @State() payouts: Payout[] = [];\n @State() loading: boolean = true;\n @State() errorMessage: string;\n @State() paging: PagingInfo = pagingDefaults;\n @Event({\n eventName: 'payout-row-clicked',\n bubbles: true,\n }) rowClicked: EventEmitter<Payout>;\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 mapStatusToBadge = (status: PayoutStatuses) => {\n switch (status) {\n case PayoutStatuses.scheduled:\n return `<span class=\"badge bg-primary\" title='Batched and scheduled to be transferred'>${PayoutStatusesSafeNames[status]}</span>`;\n case PayoutStatuses.in_transit:\n return `<span class=\"badge bg-primary\" title='Transfer to your bank account has been initiated'>${PayoutStatusesSafeNames[status]}</span>`;\n case PayoutStatuses.failed:\n return `<span class=\"badge bg-danger\" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;\n case PayoutStatuses.canceled:\n return `<span class=\"badge bg-danger\" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;\n case PayoutStatuses.forwarded:\n return `<span class=\"badge bg-secondary\" title='This payout initially failed; the funds have been forwarded to your next successful payout'>${PayoutStatusesSafeNames[status]}</span>`;\n case PayoutStatuses.paid:\n return `<span class=\"badge bg-success\" title='Successfully deposited into your bank account'>${PayoutStatusesSafeNames[status]}</span>`;\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 = `account/${this.accountId}/payouts`;\n\n const response: IApiResponseCollection<Payout[]> = await Api(this.authToken).get(endpoint, {\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 Payout(dataItem));\n this.payouts = 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 rowClickHandler={(e) => {\n const clickedPayoutID = e.target.closest('tr').dataset.rowEntityId;\n if (!clickedPayoutID) { return }\n this.rowClicked.emit(this.payouts.find((payout) => payout.id === clickedPayoutID));\n }}\n columnData={[\n ['Paid Out On', 'The date each transaction occurred'],\n ['Type', 'The type of each transaction'],\n ['Account', 'The ID of the account associated with each payout'],\n ['Paid Out To', 'The bank account to which each payout was transferred'],\n ['Payments', 'Sum of payments in each payout'],\n ['Refunds', 'Sum of refunds in each payout'],\n ['Fees', 'Sum of fees in each payout'],\n ['Other', 'Sum of less common transactions in each payout (disputes, ACH returns, fee refunds, and forwarded balances due to failed payouts)'],\n ['Payout Amount', 'The net sum of all transactions in each payout. This is the amount you\\'ll see reflected on your bank statement'],\n ['Status', 'The real-time status of each payout']\n ]}\n entityId={this.payouts.map((payout) => payout.id)}\n rowData={\n this.payouts.map((payout) => (\n [\n {\n type: 'head',\n value: `\n <div>${formatDate(payout.created_at)}</div>\n <div>${formatTime(payout.created_at)}</div>\n `,\n },\n payout.payout_type,\n payout.account_id,\n `${payout.bank_account.full_name} ${payout.bank_account.account_number_last4}`,\n formatCurrency(payout.payments_total),\n formatCurrency(payout.refunds_total),\n formatCurrency(payout.fees_total),\n formatCurrency(payout.other_total),\n formatCurrency(payout.amount),\n {\n type: 'inner',\n value: this.mapStatusToBadge(payout.status)\n }\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"]}
@@ -2,20 +2,21 @@ export default {
2
2
  title: 'dev/Components/PayoutsList',
3
3
  component: 'justifi-payouts-list',
4
4
  parameters: {},
5
- argTypes: {
6
- 'client-id': {
7
- control: 'text',
8
- table: {
9
- category: 'props',
10
- }
11
- },
12
- },
5
+ decorators: [
6
+ (Story) => `
7
+ ${Story()}
8
+ <script>
9
+ window.addEventListener('payout-row-clicked', (e) => {
10
+ console.log(e);
11
+ })
12
+ </script>
13
+ `
14
+ ]
13
15
  };
14
16
  class PayoutsListArgs {
15
17
  constructor(args) {
16
18
  this['auth-token'] = args['auth-token'] || '';
17
19
  this['account-id'] = args['account-id'] || '';
18
- this['client-id'] = args['client-id'] || '';
19
20
  }
20
21
  }
21
22
  const Template = (args) => {
@@ -24,7 +25,6 @@ const Template = (args) => {
24
25
  data-testid="justifi-payouts-list"
25
26
  auth-token="${args['auth-token']}"
26
27
  account-id="${args['account-id']}"
27
- client-id="${args['client-id']}"
28
28
  />
29
29
  `);
30
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"payouts-list.stories.js","sourceRoot":"","sources":["../../../../src/components/payouts-list/payouts-list.stories.ts"],"names":[],"mappings":"AAAA,eAAe;EACb,KAAK,EAAE,4BAA4B;EACnC,SAAS,EAAE,sBAAsB;EACjC,UAAU,EAAE,EAAE;EACd,QAAQ,EAAE;IACR,WAAW,EAAE;MACX,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;OAClB;KACF;GACF;CACF,CAAC;AAEF,MAAM,eAAe;EAKnB,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;IAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;EAC9C,CAAC;CACF;AAED,MAAM,QAAQ,GAAG,CAAC,IAAqB,EAAE,EAAE;EACzC,OAAO,CAAC;;;oBAGU,IAAI,CAAC,YAAY,CAAC;oBAClB,IAAI,CAAC,YAAY,CAAC;mBACnB,IAAI,CAAC,WAAW,CAAC;;GAEjC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AACtC,MAAM,CAAC,UAAU,GAAG;EAClB,CAAC,KAAK,EAAE,EAAE,CAAC;MACP,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BV;CACF,CAAA","sourcesContent":["export default {\n title: 'dev/Components/PayoutsList',\n component: 'justifi-payouts-list',\n parameters: {},\n argTypes: {\n 'client-id': {\n control: 'text',\n table: {\n category: 'props',\n }\n },\n },\n};\n\nclass PayoutsListArgs {\n 'auth-token': string;\n 'account-id': string;\n 'client-id': string;\n\n constructor(args) {\n this['auth-token'] = args['auth-token'] || '';\n this['account-id'] = args['account-id'] || '';\n this['client-id'] = args['client-id'] || '';\n }\n}\n\nconst Template = (args: PayoutsListArgs) => {\n return (`\n <justifi-payouts-list\n data-testid=\"justifi-payouts-list\"\n auth-token=\"${args['auth-token']}\"\n account-id=\"${args['account-id']}\"\n client-id=\"${args['client-id']}\"\n />\n `);\n};\n\nexport const Basic = Template.bind({});\nBasic.args = new PayoutsListArgs({});\n\nexport const Styled = Template.bind({});\nStyled.args = new PayoutsListArgs({});\nStyled.decorators = [\n (Story) => `\n ${Story()}\n <style>\n justifi-payouts-list::part(table-head-cell) {\n background-color: #F4F4F6;\n }\n justifi-payouts-list::part(pagination-bar) {\n background-color: #F4F4F6;\n }\n justifi-payouts-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-payouts-list::part(error-state) {\n color: red;\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(loading-state-cell) {\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(table-row) {\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(table-row-even) {\n background-color: #F4F4F6;\n }\n </style>\n `\n]\n"]}
1
+ {"version":3,"file":"payouts-list.stories.js","sourceRoot":"","sources":["../../../../src/components/payouts-list/payouts-list.stories.ts"],"names":[],"mappings":"AAAA,eAAe;EACb,KAAK,EAAE,4BAA4B;EACnC,SAAS,EAAE,sBAAsB;EACjC,UAAU,EAAE,EAAE;EACd,UAAU,EAAE;IACV,CAAC,KAAK,EAAE,EAAE,CAAC;QACP,KAAK,EAAE;;;;;;KAMV;GACF;CACF,CAAC;AAEF,MAAM,eAAe;EAInB,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,IAAqB,EAAE,EAAE;EACzC,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,eAAe,CAAC,EAAE,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AACtC,MAAM,CAAC,UAAU,GAAG;EAClB,CAAC,KAAK,EAAE,EAAE,CAAC;MACP,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BV;CACF,CAAA","sourcesContent":["export default {\n title: 'dev/Components/PayoutsList',\n component: 'justifi-payouts-list',\n parameters: {},\n decorators: [\n (Story) => `\n ${Story()}\n <script>\n window.addEventListener('payout-row-clicked', (e) => {\n console.log(e);\n })\n </script>\n `\n ]\n};\n\nclass PayoutsListArgs {\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: PayoutsListArgs) => {\n return (`\n <justifi-payouts-list\n data-testid=\"justifi-payouts-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 PayoutsListArgs({});\n\nexport const Styled = Template.bind({});\nStyled.args = new PayoutsListArgs({});\nStyled.decorators = [\n (Story) => `\n ${Story()}\n <style>\n justifi-payouts-list::part(table-head-cell) {\n background-color: #F4F4F6;\n }\n justifi-payouts-list::part(pagination-bar) {\n background-color: #F4F4F6;\n }\n justifi-payouts-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-payouts-list::part(error-state) {\n color: red;\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(loading-state-cell) {\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(table-row) {\n background-color: #EEEEF5;\n }\n justifi-payouts-list::part(table-row-even) {\n background-color: #F4F4F6;\n }\n </style>\n `\n]\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-proceeds-list')}
7
+
8
+ <body>
9
+ <justifi-proceeds-list></justifi-proceeds-list>
10
+ </body>
11
+
12
+ </html>`;