@justifi/webcomponents 4.2.2 → 4.4.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 (380) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/{Api-11362403.js → Api-7303478d.js} +3 -2
  3. package/dist/cjs/Api-7303478d.js.map +1 -0
  4. package/dist/cjs/business-form-schema-63b311b2.js +132 -0
  5. package/dist/cjs/business-form-schema-63b311b2.js.map +1 -0
  6. package/dist/cjs/form-control-select_2.cjs.entry.js +61 -0
  7. package/dist/cjs/form-control-select_2.cjs.entry.js.map +1 -0
  8. package/dist/cjs/{index-34312a38.js → index-83b2ec02.js} +136 -20
  9. package/dist/cjs/index-83b2ec02.js.map +1 -0
  10. package/dist/cjs/{index.esm-bcf90c56.js → index.esm-7e12ce07.js} +301 -14
  11. package/dist/cjs/index.esm-7e12ce07.js.map +1 -0
  12. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +8 -3
  13. package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -1
  14. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +5 -5
  15. package/dist/cjs/justifi-billing-form_2.cjs.entry.js.map +1 -1
  16. package/dist/cjs/justifi-business-address-form.cjs.entry.js +37 -0
  17. package/dist/cjs/justifi-business-address-form.cjs.entry.js.map +1 -0
  18. package/dist/cjs/justifi-business-form.cjs.entry.js +751 -0
  19. package/dist/cjs/justifi-business-form.cjs.entry.js.map +1 -0
  20. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js +148 -0
  21. package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js.map +1 -0
  22. package/dist/cjs/justifi-card-form.cjs.entry.js +8 -3
  23. package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -1
  24. package/dist/cjs/justifi-payment-form.cjs.entry.js +24 -7
  25. package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -1
  26. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +22 -17
  27. package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
  28. package/dist/cjs/justifi-payments-list.cjs.entry.js +75 -4038
  29. package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
  30. package/dist/cjs/justifi-payouts-list.cjs.entry.js +113 -0
  31. package/dist/cjs/justifi-payouts-list.cjs.entry.js.map +1 -0
  32. package/dist/cjs/loader.cjs.js +3 -12
  33. package/dist/cjs/loader.cjs.js.map +1 -1
  34. package/dist/cjs/select-input_2.cjs.entry.js +6 -6
  35. package/dist/cjs/select-input_2.cjs.entry.js.map +1 -1
  36. package/dist/cjs/{state-options-efeaa587.js → state-options-83b52cd1.js} +1 -1
  37. package/dist/{esm/state-options-188acc34.js.map → cjs/state-options-83b52cd1.js.map} +1 -1
  38. package/dist/cjs/utils-4ee7e080.js +3979 -0
  39. package/dist/cjs/utils-4ee7e080.js.map +1 -0
  40. package/dist/cjs/webcomponents.cjs.js +3 -6
  41. package/dist/cjs/webcomponents.cjs.js.map +1 -1
  42. package/dist/collection/api/Api.js +3 -2
  43. package/dist/collection/api/Api.js.map +1 -1
  44. package/dist/collection/api/Payout.js +33 -0
  45. package/dist/collection/api/Payout.js.map +1 -0
  46. package/dist/collection/api/index.js +1 -0
  47. package/dist/collection/api/index.js.map +1 -1
  48. package/dist/collection/api/mockData/MockPayments.js +1 -1
  49. package/dist/collection/collection-manifest.json +18 -12
  50. package/dist/collection/components/bank-account-form/bank-account-form.js +38 -10
  51. package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -1
  52. package/dist/collection/components/bank-account-form/bank-account-form.stories.js +2 -0
  53. package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
  54. package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js +1 -1
  55. package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js +3 -3
  56. package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
  57. package/dist/collection/components/billing-form/billing-form.css +212 -39
  58. package/dist/collection/components/billing-form/billing-form.js +16 -10
  59. package/dist/collection/components/billing-form/billing-form.js.map +1 -1
  60. package/dist/collection/components/billing-form/test/billing-form.spec.js +51 -24
  61. package/dist/collection/components/billing-form/test/billing-form.spec.js.map +1 -1
  62. package/dist/collection/components/{business-address/business-address-schema.js → business-form/business-address/business-address-form-schema.js} +2 -2
  63. package/dist/collection/components/business-form/business-address/business-address-form-schema.js.map +1 -0
  64. package/dist/collection/components/business-form/business-address/business-address-form.css +2532 -0
  65. package/dist/collection/components/business-form/business-address/business-address-form.js +98 -0
  66. package/dist/collection/components/business-form/business-address/business-address-form.js.map +1 -0
  67. package/dist/collection/components/business-form/business-address/test/business-address.e2e.js +10 -0
  68. package/dist/collection/components/business-form/business-address/test/business-address.e2e.js.map +1 -0
  69. package/dist/collection/components/business-form/business-address/test/business-address.spec.js +72 -0
  70. package/dist/collection/components/business-form/business-address/test/business-address.spec.js.map +1 -0
  71. package/dist/collection/components/business-form/business-form-schema.js +149 -0
  72. package/dist/collection/components/business-form/business-form-schema.js.map +1 -0
  73. package/dist/collection/components/business-form/business-form.css +2532 -0
  74. package/dist/collection/components/business-form/business-form.js +76 -0
  75. package/dist/collection/components/business-form/business-form.js.map +1 -0
  76. package/dist/collection/components/{business-info/business-info.css → business-form/business-generic-info/business-generic-info.css} +745 -530
  77. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +79 -0
  78. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map +1 -0
  79. package/dist/collection/components/business-form/business-owners/business-owners.css +2489 -0
  80. package/dist/collection/components/business-form/business-owners/business-owners.js +120 -0
  81. package/dist/collection/components/business-form/business-owners/business-owners.js.map +1 -0
  82. package/dist/collection/components/business-form/business-representative/business-representative-schema.js +2 -0
  83. package/dist/collection/components/business-form/business-representative/business-representative-schema.js.map +1 -0
  84. package/dist/collection/components/business-form/business-representative/business-representative.css +2489 -0
  85. package/dist/collection/components/business-form/business-representative/business-representative.js +76 -0
  86. package/dist/collection/components/business-form/business-representative/business-representative.js.map +1 -0
  87. package/dist/collection/components/business-form/businessForm.stories.js +115 -0
  88. package/dist/collection/components/business-form/businessForm.stories.js.map +1 -0
  89. package/dist/collection/components/card-form/card-form.js +38 -10
  90. package/dist/collection/components/card-form/card-form.js.map +1 -1
  91. package/dist/collection/components/card-form/card-form.stories.js +5 -2
  92. package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
  93. package/dist/collection/components/card-form/test/card-form.e2e.js +1 -1
  94. package/dist/collection/components/card-form/test/card-form.spec.js +3 -3
  95. package/dist/collection/components/{business-address/business-address.css → form/form-control-select.css} +344 -1212
  96. package/dist/collection/components/form/form-control-select.js +168 -0
  97. package/dist/collection/components/form/form-control-select.js.map +1 -0
  98. package/dist/collection/components/form/form-control-text.css +1794 -0
  99. package/dist/collection/components/form/form-control-text.js +152 -0
  100. package/dist/collection/components/form/form-control-text.js.map +1 -0
  101. package/dist/collection/components/form/form.js +85 -0
  102. package/dist/collection/components/form/form.js.map +1 -0
  103. package/dist/collection/components/payment-form/payment-form.css +220 -45
  104. package/dist/collection/components/payment-form/payment-form.js +47 -7
  105. package/dist/collection/components/payment-form/payment-form.js.map +1 -1
  106. package/dist/collection/components/payment-form/payment-form.stories.js +3 -2
  107. package/dist/collection/components/payment-form/payment-form.stories.js.map +1 -1
  108. package/dist/collection/components/payment-form/payment-method-selector.css +348 -145
  109. package/dist/collection/components/payment-form/payment-method-selector.js +5 -3
  110. package/dist/collection/components/payment-form/payment-method-selector.js.map +1 -1
  111. package/dist/collection/components/payment-form/test/payment-form.e2e.js +1 -1
  112. package/dist/collection/components/payment-form/test/payment-form.spec.js +4 -3
  113. package/dist/collection/components/payment-form/test/payment-form.spec.js.map +1 -1
  114. package/dist/collection/components/payment-method-form/get-computed-theme.js +2 -0
  115. package/dist/collection/components/payment-method-form/get-computed-theme.js.map +1 -1
  116. package/dist/collection/components/payment-method-form/payment-method-form.js +19 -11
  117. package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -1
  118. package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js +1 -1
  119. package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +3 -3
  120. package/dist/collection/components/payment-method-form/theme.js.map +1 -1
  121. package/dist/collection/components/payments-list/example.js +12 -0
  122. package/dist/collection/components/payments-list/payments-list.css +7954 -1
  123. package/dist/collection/components/payments-list/payments-list.js +104 -27
  124. package/dist/collection/components/payments-list/payments-list.js.map +1 -1
  125. package/dist/collection/components/payments-list/payments-list.stories.js +78 -0
  126. package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -0
  127. package/dist/collection/components/payments-list/test/payments-list.spec.js +82 -18
  128. package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -1
  129. package/dist/collection/components/payouts-list/payouts-list.css +7983 -0
  130. package/dist/collection/components/payouts-list/payouts-list.js +181 -0
  131. package/dist/collection/components/payouts-list/payouts-list.js.map +1 -0
  132. package/dist/collection/components/payouts-list/payouts-list.stories.js +69 -0
  133. package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -0
  134. package/dist/collection/components/select-input/select-input.css +344 -141
  135. package/dist/collection/components/select-input/select-input.js +5 -4
  136. package/dist/collection/components/select-input/select-input.js.map +1 -1
  137. package/dist/collection/components/select-input/test/select-input.spec.js +72 -28
  138. package/dist/collection/components/select-input/test/select-input.spec.js.map +1 -1
  139. package/dist/collection/components/text-input/test/text-input.spec.js +47 -5
  140. package/dist/collection/components/text-input/test/text-input.spec.js.map +1 -1
  141. package/dist/collection/components/text-input/text-input.css +344 -141
  142. package/dist/collection/components/text-input/text-input.js +2 -2
  143. package/dist/collection/components/text-input/text-input.js.map +1 -1
  144. package/dist/collection/utils/utils.js +7 -2
  145. package/dist/collection/utils/utils.js.map +1 -1
  146. package/dist/components/Api.js +2 -1
  147. package/dist/components/Api.js.map +1 -1
  148. package/dist/components/billing-form.js +2 -2
  149. package/dist/components/billing-form.js.map +1 -1
  150. package/dist/components/business-address-form.js +65 -0
  151. package/dist/components/business-address-form.js.map +1 -0
  152. package/dist/components/business-generic-info.js +190 -0
  153. package/dist/components/business-generic-info.js.map +1 -0
  154. package/dist/components/business-owners.js +102 -0
  155. package/dist/components/business-owners.js.map +1 -0
  156. package/dist/components/business-representative.js +75 -0
  157. package/dist/components/business-representative.js.map +1 -0
  158. package/dist/components/{justifi-business-info.d.ts → form-control-select.d.ts} +4 -4
  159. package/dist/components/form-control-select.js +8 -0
  160. package/dist/components/form-control-select.js.map +1 -0
  161. package/dist/components/form-control-select2.js +53 -0
  162. package/dist/components/form-control-select2.js.map +1 -0
  163. package/dist/components/form-control-text.d.ts +11 -0
  164. package/dist/components/form-control-text.js +8 -0
  165. package/dist/components/form-control-text.js.map +1 -0
  166. package/dist/components/form-control-text2.js +51 -0
  167. package/dist/components/form-control-text2.js.map +1 -0
  168. package/dist/components/index.esm.js +298 -14
  169. package/dist/components/index.esm.js.map +1 -1
  170. package/dist/components/justifi-bank-account-form.js +7 -2
  171. package/dist/components/justifi-bank-account-form.js.map +1 -1
  172. package/dist/components/justifi-business-address-form.d.ts +11 -0
  173. package/dist/components/justifi-business-address-form.js +8 -0
  174. package/dist/components/justifi-business-address-form.js.map +1 -0
  175. package/dist/components/justifi-business-form.d.ts +11 -0
  176. package/dist/components/justifi-business-form.js +802 -0
  177. package/dist/components/justifi-business-form.js.map +1 -0
  178. package/dist/components/justifi-business-generic-info.d.ts +11 -0
  179. package/dist/components/justifi-business-generic-info.js +8 -0
  180. package/dist/components/justifi-business-generic-info.js.map +1 -0
  181. package/dist/components/justifi-business-owners.d.ts +11 -0
  182. package/dist/components/justifi-business-owners.js +8 -0
  183. package/dist/components/justifi-business-owners.js.map +1 -0
  184. package/dist/components/justifi-business-representative.d.ts +11 -0
  185. package/dist/components/justifi-business-representative.js +8 -0
  186. package/dist/components/justifi-business-representative.js.map +1 -0
  187. package/dist/components/justifi-card-form.js +7 -2
  188. package/dist/components/justifi-card-form.js.map +1 -1
  189. package/dist/components/justifi-payment-form.js +23 -4
  190. package/dist/components/justifi-payment-form.js.map +1 -1
  191. package/dist/components/justifi-payments-list.js +78 -4038
  192. package/dist/components/justifi-payments-list.js.map +1 -1
  193. package/dist/components/justifi-payouts-list.d.ts +11 -0
  194. package/dist/components/justifi-payouts-list.js +134 -0
  195. package/dist/components/justifi-payouts-list.js.map +1 -0
  196. package/dist/components/payment-method-form.js +21 -16
  197. package/dist/components/payment-method-form.js.map +1 -1
  198. package/dist/components/payment-method-selector.js +1 -1
  199. package/dist/components/payment-method-selector.js.map +1 -1
  200. package/dist/components/select-input2.js +3 -3
  201. package/dist/components/select-input2.js.map +1 -1
  202. package/dist/components/state-options.js.map +1 -1
  203. package/dist/components/text-input2.js +2 -2
  204. package/dist/components/text-input2.js.map +1 -1
  205. package/dist/components/utils.js +3972 -0
  206. package/dist/components/utils.js.map +1 -0
  207. package/dist/esm/{Api-a07f0057.js → Api-436dfa09.js} +3 -2
  208. package/dist/esm/Api-436dfa09.js.map +1 -0
  209. package/dist/esm/business-form-schema-30c48693.js +128 -0
  210. package/dist/esm/business-form-schema-30c48693.js.map +1 -0
  211. package/dist/esm/form-control-select_2.entry.js +56 -0
  212. package/dist/esm/form-control-select_2.entry.js.map +1 -0
  213. package/dist/esm/{index-044f93fc.js → index-c8f391de.js} +136 -20
  214. package/dist/esm/index-c8f391de.js.map +1 -0
  215. package/dist/esm/{index.esm-5624a5ed.js → index.esm-be2cd327.js} +299 -15
  216. package/dist/esm/index.esm-be2cd327.js.map +1 -0
  217. package/dist/esm/justifi-bank-account-form.entry.js +8 -3
  218. package/dist/esm/justifi-bank-account-form.entry.js.map +1 -1
  219. package/dist/esm/justifi-billing-form_2.entry.js +5 -5
  220. package/dist/esm/justifi-billing-form_2.entry.js.map +1 -1
  221. package/dist/esm/justifi-business-address-form.entry.js +33 -0
  222. package/dist/esm/justifi-business-address-form.entry.js.map +1 -0
  223. package/dist/esm/justifi-business-form.entry.js +747 -0
  224. package/dist/esm/justifi-business-form.entry.js.map +1 -0
  225. package/dist/esm/justifi-business-generic-info_3.entry.js +142 -0
  226. package/dist/esm/justifi-business-generic-info_3.entry.js.map +1 -0
  227. package/dist/esm/justifi-card-form.entry.js +8 -3
  228. package/dist/esm/justifi-card-form.entry.js.map +1 -1
  229. package/dist/esm/justifi-payment-form.entry.js +21 -4
  230. package/dist/esm/justifi-payment-form.entry.js.map +1 -1
  231. package/dist/esm/justifi-payment-method-form.entry.js +22 -17
  232. package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
  233. package/dist/esm/justifi-payments-list.entry.js +75 -4038
  234. package/dist/esm/justifi-payments-list.entry.js.map +1 -1
  235. package/dist/esm/justifi-payouts-list.entry.js +109 -0
  236. package/dist/esm/justifi-payouts-list.entry.js.map +1 -0
  237. package/dist/esm/loader.js +4 -13
  238. package/dist/esm/loader.js.map +1 -1
  239. package/dist/esm/select-input_2.entry.js +6 -6
  240. package/dist/esm/select-input_2.entry.js.map +1 -1
  241. package/dist/esm/{state-options-188acc34.js → state-options-ece00aa2.js} +1 -1
  242. package/dist/esm/state-options-ece00aa2.js.map +1 -0
  243. package/dist/esm/utils-e7782126.js +3972 -0
  244. package/dist/esm/utils-e7782126.js.map +1 -0
  245. package/dist/esm/webcomponents.js +4 -7
  246. package/dist/esm/webcomponents.js.map +1 -1
  247. package/dist/types/api/Payout.d.ts +62 -0
  248. package/dist/types/api/index.d.ts +1 -0
  249. package/dist/types/components/business-form/business-address/business-address-form.d.ts +9 -0
  250. package/dist/types/components/{business-info/business-info-schema.d.ts → business-form/business-form-schema.d.ts} +55 -4
  251. package/dist/types/components/business-form/business-form.d.ts +14 -0
  252. package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +16 -0
  253. package/dist/types/components/business-form/business-owners/business-owners.d.ts +32 -0
  254. package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +15 -0
  255. package/dist/types/components/business-form/business-representative/business-representative.d.ts +12 -0
  256. package/dist/types/components/business-form/businessForm.stories.d.ts +21 -0
  257. package/dist/types/components/form/form-control-select.d.ts +16 -0
  258. package/dist/types/components/form/form-control-text.d.ts +12 -0
  259. package/dist/types/components/form/form.d.ts +21 -0
  260. package/dist/types/components/payment-form/payment-form.d.ts +2 -0
  261. package/dist/types/components/payment-method-form/theme.d.ts +2 -0
  262. package/dist/types/components/payments-list/payments-list.d.ts +38 -5
  263. package/dist/types/components/payments-list/payments-list.stories.d.ts +17 -0
  264. package/dist/types/components/payouts-list/payouts-list.d.ts +45 -0
  265. package/dist/types/components/payouts-list/payouts-list.stories.d.ts +16 -0
  266. package/dist/types/components.d.ts +339 -26
  267. package/dist/types/stencil-public-runtime.d.ts +14 -2
  268. package/dist/types/utils/utils.d.ts +1 -0
  269. package/dist/webcomponents/p-0fd4aae2.js +2 -0
  270. package/dist/webcomponents/p-0fd4aae2.js.map +1 -0
  271. package/dist/webcomponents/p-1953797f.entry.js +2 -0
  272. package/dist/webcomponents/p-1953797f.entry.js.map +1 -0
  273. package/dist/webcomponents/p-1a1f2196.js +2 -0
  274. package/dist/webcomponents/p-1a1f2196.js.map +1 -0
  275. package/dist/webcomponents/p-23e9c7d4.entry.js +2 -0
  276. package/dist/webcomponents/p-23e9c7d4.entry.js.map +1 -0
  277. package/dist/webcomponents/p-309a886f.entry.js +2 -0
  278. package/dist/webcomponents/p-309a886f.entry.js.map +1 -0
  279. package/dist/webcomponents/p-33d69eb5.entry.js +2 -0
  280. package/dist/webcomponents/p-33d69eb5.entry.js.map +1 -0
  281. package/dist/webcomponents/p-3a80a2ec.entry.js +2 -0
  282. package/dist/webcomponents/p-3a80a2ec.entry.js.map +1 -0
  283. package/dist/webcomponents/p-45fea6a8.entry.js +2 -0
  284. package/dist/webcomponents/p-45fea6a8.entry.js.map +1 -0
  285. package/dist/webcomponents/{p-0ea23153.js → p-47bc59b5.js} +1 -1
  286. package/dist/webcomponents/p-47bc59b5.js.map +1 -0
  287. package/dist/webcomponents/p-7041a637.entry.js +2 -0
  288. package/dist/webcomponents/p-7041a637.entry.js.map +1 -0
  289. package/dist/webcomponents/p-79456add.js +2 -0
  290. package/dist/webcomponents/p-79456add.js.map +1 -0
  291. package/dist/webcomponents/{p-1f151d49.js → p-af080b21.js} +2 -2
  292. package/dist/webcomponents/p-af080b21.js.map +1 -0
  293. package/dist/webcomponents/p-bc969904.js +3 -0
  294. package/dist/webcomponents/p-bc969904.js.map +1 -0
  295. package/dist/webcomponents/p-cd097ce9.entry.js +2 -0
  296. package/dist/webcomponents/p-cd097ce9.entry.js.map +1 -0
  297. package/dist/webcomponents/p-d5bc9f22.entry.js +2 -0
  298. package/dist/webcomponents/p-d5bc9f22.entry.js.map +1 -0
  299. package/dist/webcomponents/p-d5cadc78.entry.js +2 -0
  300. package/dist/webcomponents/p-d5cadc78.entry.js.map +1 -0
  301. package/dist/webcomponents/p-dd1ebc0b.entry.js +2 -0
  302. package/dist/webcomponents/p-dd1ebc0b.entry.js.map +1 -0
  303. package/dist/webcomponents/p-e05e0c6b.entry.js +2 -0
  304. package/dist/webcomponents/p-e05e0c6b.entry.js.map +1 -0
  305. package/dist/webcomponents/webcomponents.css +1 -1
  306. package/dist/webcomponents/webcomponents.esm.js +1 -1
  307. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  308. package/loader/index.d.ts +1 -1
  309. package/package.json +12 -14
  310. package/CHANGELOG.md +0 -208
  311. package/changelog-template.hbs +0 -10
  312. package/dist/cjs/Api-11362403.js.map +0 -1
  313. package/dist/cjs/Payment-ac4dea02.js +0 -73
  314. package/dist/cjs/Payment-ac4dea02.js.map +0 -1
  315. package/dist/cjs/index-34312a38.js.map +0 -1
  316. package/dist/cjs/index.esm-bcf90c56.js.map +0 -1
  317. package/dist/cjs/justifi-business-address.cjs.entry.js +0 -69
  318. package/dist/cjs/justifi-business-address.cjs.entry.js.map +0 -1
  319. package/dist/cjs/justifi-business-info.cjs.entry.js +0 -174
  320. package/dist/cjs/justifi-business-info.cjs.entry.js.map +0 -1
  321. package/dist/cjs/state-options-efeaa587.js.map +0 -1
  322. package/dist/collection/components/business-address/business-address-schema.js.map +0 -1
  323. package/dist/collection/components/business-address/business-address.js +0 -100
  324. package/dist/collection/components/business-address/business-address.js.map +0 -1
  325. package/dist/collection/components/business-address/test/business-address.e2e.js +0 -10
  326. package/dist/collection/components/business-address/test/business-address.e2e.js.map +0 -1
  327. package/dist/collection/components/business-address/test/business-address.spec.js +0 -18
  328. package/dist/collection/components/business-address/test/business-address.spec.js.map +0 -1
  329. package/dist/collection/components/business-info/business-info-schema.js +0 -94
  330. package/dist/collection/components/business-info/business-info-schema.js.map +0 -1
  331. package/dist/collection/components/business-info/business-info.js +0 -168
  332. package/dist/collection/components/business-info/business-info.js.map +0 -1
  333. package/dist/components/Payment.js +0 -71
  334. package/dist/components/Payment.js.map +0 -1
  335. package/dist/components/justifi-business-address.d.ts +0 -11
  336. package/dist/components/justifi-business-address.js +0 -99
  337. package/dist/components/justifi-business-address.js.map +0 -1
  338. package/dist/components/justifi-business-info.js +0 -207
  339. package/dist/components/justifi-business-info.js.map +0 -1
  340. package/dist/esm/Api-a07f0057.js.map +0 -1
  341. package/dist/esm/Payment-c86e1e84.js +0 -71
  342. package/dist/esm/Payment-c86e1e84.js.map +0 -1
  343. package/dist/esm/index-044f93fc.js.map +0 -1
  344. package/dist/esm/index.esm-5624a5ed.js.map +0 -1
  345. package/dist/esm/justifi-business-address.entry.js +0 -65
  346. package/dist/esm/justifi-business-address.entry.js.map +0 -1
  347. package/dist/esm/justifi-business-info.entry.js +0 -170
  348. package/dist/esm/justifi-business-info.entry.js.map +0 -1
  349. package/dist/esm/polyfills/css-shim.js +0 -1
  350. package/dist/types/components/bank-account-form/bank-account-form.d.ts +0 -56
  351. package/dist/types/components/business-address/business-address.d.ts +0 -11
  352. package/dist/types/components/business-info/business-info.d.ts +0 -20
  353. package/dist/types/components/card-form/card-form.d.ts +0 -62
  354. package/dist/webcomponents/p-0969db8f.entry.js +0 -2
  355. package/dist/webcomponents/p-0969db8f.entry.js.map +0 -1
  356. package/dist/webcomponents/p-0ea23153.js.map +0 -1
  357. package/dist/webcomponents/p-1ca0646b.js +0 -2
  358. package/dist/webcomponents/p-1ca0646b.js.map +0 -1
  359. package/dist/webcomponents/p-1f151d49.js.map +0 -1
  360. package/dist/webcomponents/p-255b1284.entry.js +0 -2
  361. package/dist/webcomponents/p-255b1284.entry.js.map +0 -1
  362. package/dist/webcomponents/p-3aa91155.js +0 -3
  363. package/dist/webcomponents/p-3aa91155.js.map +0 -1
  364. package/dist/webcomponents/p-4ecc9860.entry.js +0 -2
  365. package/dist/webcomponents/p-4ecc9860.entry.js.map +0 -1
  366. package/dist/webcomponents/p-90c0d9e1.entry.js +0 -2
  367. package/dist/webcomponents/p-90c0d9e1.entry.js.map +0 -1
  368. package/dist/webcomponents/p-bd5352d6.entry.js +0 -2
  369. package/dist/webcomponents/p-bd5352d6.entry.js.map +0 -1
  370. package/dist/webcomponents/p-c903cc5a.entry.js +0 -2
  371. package/dist/webcomponents/p-c903cc5a.entry.js.map +0 -1
  372. package/dist/webcomponents/p-d87b0711.entry.js +0 -2
  373. package/dist/webcomponents/p-d87b0711.entry.js.map +0 -1
  374. package/dist/webcomponents/p-dbf7100f.entry.js +0 -2
  375. package/dist/webcomponents/p-dbf7100f.entry.js.map +0 -1
  376. package/dist/webcomponents/p-e0054bc3.js +0 -2
  377. package/dist/webcomponents/p-e0054bc3.js.map +0 -1
  378. package/dist/webcomponents/p-f30d1567.entry.js +0 -2
  379. package/dist/webcomponents/p-f30d1567.entry.js.map +0 -1
  380. /package/dist/types/components/{business-address/business-address-schema.d.ts → business-form/business-address/business-address-form-schema.d.ts} +0 -0
@@ -0,0 +1,181 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { Api, Payout, PayoutStatuses } from "../../api";
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
+ };
11
+ /**
12
+ * @exportedPart table-head: Table head
13
+ * @exportedPart table-head-row: Head row
14
+ * @exportedPart table-head-cell: Individual head cell
15
+ * @exportedPart table-body: Body of the table
16
+ * @exportedPart table-row: Row of the table
17
+ * @exportedPart table-cell: Individual cell of the table
18
+ * @exportedPart loading-state-cell: Row for loading state
19
+ * @exportedPart loading-state-spinner: Spinner element for loading state
20
+ * @exportedPart error-state: Row for Error state
21
+ * @exportedPart empty-state: Row for Emtpy state
22
+ * @exportedPart pagination-bar: Pagination bar
23
+ * @exportedPart arrow: Both paging buttons
24
+ * @exportedPart arrow-left: Previous page button
25
+ * @exportedPart arrow-right: Next page button
26
+ * @exportedPart arrow-disabled: Disabled state for paging buttons
27
+ */
28
+ export class PayoutsList {
29
+ 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
+ this.onPageChange = (direction) => {
39
+ return () => {
40
+ this.fetchData(direction);
41
+ };
42
+ };
43
+ this.mapStatusToBadge = (status) => {
44
+ switch (status) {
45
+ case PayoutStatuses.scheduled || PayoutStatuses.in_transit:
46
+ return 'bg-primary';
47
+ case PayoutStatuses.failed || PayoutStatuses.canceled:
48
+ return 'bg-danger';
49
+ case PayoutStatuses.forwarded:
50
+ return 'bg-secondary';
51
+ case PayoutStatuses.paid:
52
+ return 'bg-success';
53
+ default:
54
+ return 'bg-secondary';
55
+ }
56
+ };
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
+ this.accountId = undefined;
64
+ this.authToken = undefined;
65
+ this.payouts = [];
66
+ this.loading = true;
67
+ this.errorMessage = undefined;
68
+ this.paging = pagingDefaults;
69
+ }
70
+ updateOnPropChange() {
71
+ this.fetchData();
72
+ }
73
+ connectedCallback() {
74
+ this.fetchData();
75
+ }
76
+ async fetchData(direction) {
77
+ var _a;
78
+ if (!this.accountId || !this.authToken) {
79
+ this.errorMessage = "Can not fetch any data without an AccountID and an AuthToken";
80
+ this.loading = false;
81
+ return;
82
+ }
83
+ 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);
92
+ if (!response.error) {
93
+ this.paging = Object.assign(Object.assign({}, this.paging), response.page_info);
94
+ const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.map(dataItem => new Payout(dataItem));
95
+ this.payouts = data;
96
+ }
97
+ else {
98
+ this.errorMessage = typeof response.error === 'string' ? response.error : response.error.message;
99
+ }
100
+ this.loading = false;
101
+ }
102
+ showEmptyState() {
103
+ return this.payouts ? this.payouts.length < 1 : true;
104
+ }
105
+ 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()))))));
112
+ }
113
+ static get is() { return "justifi-payouts-list"; }
114
+ static get encapsulation() { return "shadow"; }
115
+ static get originalStyleUrls() {
116
+ return {
117
+ "$": ["payouts-list.scss"]
118
+ };
119
+ }
120
+ static get styleUrls() {
121
+ return {
122
+ "$": ["payouts-list.css"]
123
+ };
124
+ }
125
+ static get properties() {
126
+ return {
127
+ "accountId": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "attribute": "account-id",
142
+ "reflect": false
143
+ },
144
+ "authToken": {
145
+ "type": "string",
146
+ "mutable": false,
147
+ "complexType": {
148
+ "original": "string",
149
+ "resolved": "string",
150
+ "references": {}
151
+ },
152
+ "required": false,
153
+ "optional": false,
154
+ "docs": {
155
+ "tags": [],
156
+ "text": ""
157
+ },
158
+ "attribute": "auth-token",
159
+ "reflect": false
160
+ }
161
+ };
162
+ }
163
+ static get states() {
164
+ return {
165
+ "payouts": {},
166
+ "loading": {},
167
+ "errorMessage": {},
168
+ "paging": {}
169
+ };
170
+ }
171
+ static get watchers() {
172
+ return [{
173
+ "propName": "accountId",
174
+ "methodName": "updateOnPropChange"
175
+ }, {
176
+ "propName": "authToken",
177
+ "methodName": "updateOnPropChange"
178
+ }];
179
+ }
180
+ }
181
+ //# sourceMappingURL=payouts-list.js.map
@@ -0,0 +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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,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"]}
@@ -0,0 +1,69 @@
1
+ export default {
2
+ title: 'dev/Components/PayoutsList',
3
+ component: 'justifi-payouts-list',
4
+ parameters: {},
5
+ argTypes: {
6
+ 'client-id': {
7
+ control: 'text',
8
+ table: {
9
+ category: 'props',
10
+ }
11
+ },
12
+ },
13
+ };
14
+ class PayoutsListArgs {
15
+ constructor(args) {
16
+ this['auth-token'] = args['auth-token'] || '';
17
+ this['account-id'] = args['account-id'] || '';
18
+ this['client-id'] = args['client-id'] || '';
19
+ }
20
+ }
21
+ const Template = (args) => {
22
+ return (`
23
+ <justifi-payouts-list
24
+ data-testid="justifi-payouts-list"
25
+ auth-token="${args['auth-token']}"
26
+ account-id="${args['account-id']}"
27
+ client-id="${args['client-id']}"
28
+ />
29
+ `);
30
+ };
31
+ export const Basic = Template.bind({});
32
+ Basic.args = new PayoutsListArgs({});
33
+ export const Styled = Template.bind({});
34
+ Styled.args = new PayoutsListArgs({});
35
+ Styled.decorators = [
36
+ (Story) => `
37
+ ${Story()}
38
+ <style>
39
+ justifi-payouts-list::part(table-head-cell) {
40
+ background-color: #F4F4F6;
41
+ }
42
+ justifi-payouts-list::part(pagination-bar) {
43
+ background-color: #F4F4F6;
44
+ }
45
+ justifi-payouts-list::part(arrow) {
46
+ --bs-btn-disabled-bg: #212529;
47
+ --bs-btn-disabled-border-color: #212529;
48
+ --bs-btn-bg: #212529;
49
+ --bs-btn-border-color: #212529;
50
+ --bs-btn-hover-bg: #fccc32;
51
+ --bs-btn-hover-border-color: #fccc32;
52
+ }
53
+ justifi-payouts-list::part(error-state) {
54
+ color: red;
55
+ background-color: #EEEEF5;
56
+ }
57
+ justifi-payouts-list::part(loading-state-cell) {
58
+ background-color: #EEEEF5;
59
+ }
60
+ justifi-payouts-list::part(table-row) {
61
+ background-color: #EEEEF5;
62
+ }
63
+ justifi-payouts-list::part(table-row-even) {
64
+ background-color: #F4F4F6;
65
+ }
66
+ </style>
67
+ `
68
+ ];
69
+ //# sourceMappingURL=payouts-list.stories.js.map
@@ -0,0 +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"]}