@justifi/webcomponents 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Api-7303478d.js → Api-d2df6e84.js} +16 -4
- package/dist/cjs/Api-d2df6e84.js.map +1 -0
- package/dist/cjs/Payout-4906a445.js +116 -0
- package/dist/cjs/Payout-4906a445.js.map +1 -0
- package/dist/cjs/{business-form-schema-63b311b2.js → business-form-schema-725ec6f5.js} +40 -22
- package/dist/cjs/business-form-schema-725ec6f5.js.map +1 -0
- package/dist/cjs/form-control-datepart_2.cjs.entry.js +107 -0
- package/dist/cjs/form-control-datepart_2.cjs.entry.js.map +1 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js +65 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js.map +1 -0
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +99 -12
- package/dist/cjs/form-control-number_3.cjs.entry.js.map +1 -0
- package/dist/cjs/form-control-select.cjs.entry.js +47 -0
- package/dist/cjs/form-control-select.cjs.entry.js.map +1 -0
- package/dist/cjs/{index-83b2ec02.js → index-3533152c.js} +10 -6
- package/dist/cjs/index-3533152c.js.map +1 -0
- package/dist/cjs/index-5a880722.js +3233 -0
- package/dist/cjs/index-5a880722.js.map +1 -0
- package/dist/cjs/{index.esm-7e12ce07.js → index.esm-84a0a7a8.js} +1 -19
- package/dist/cjs/index.esm-84a0a7a8.js.map +1 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +396 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +98 -16
- package/dist/cjs/justifi-business-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-business-list.cjs.entry.js +189 -0
- package/dist/cjs/justifi-business-list.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +30 -0
- package/dist/cjs/justifi-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-details.cjs.entry.js +63 -0
- package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1487 -19
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +49 -47
- package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payout-details.cjs.entry.js +61 -0
- package/dist/cjs/justifi-payout-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +64 -54
- package/dist/cjs/justifi-payouts-list.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +156 -0
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-table.cjs.entry.js +68 -0
- package/dist/cjs/justifi-table.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select-input_2.cjs.entry.js +1 -1
- package/dist/cjs/table-utils-617126e5.js +13 -0
- package/dist/cjs/table-utils-617126e5.js.map +1 -0
- package/dist/cjs/{utils-4ee7e080.js → utils-0fd61dbd.js} +43 -104
- package/dist/cjs/utils-0fd61dbd.js.map +1 -0
- package/dist/cjs/utils-d95b09c2.js +35 -0
- package/dist/cjs/utils-d95b09c2.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/cjs/webcomponents.cjs.js.map +1 -1
- package/dist/collection/api/Api.js +15 -3
- package/dist/collection/api/Api.js.map +1 -1
- package/dist/collection/api/Business.js +50 -0
- package/dist/collection/api/Business.js.map +1 -0
- package/dist/collection/api/Payment.js.map +1 -1
- package/dist/collection/api/Payout.js +9 -0
- package/dist/collection/api/Payout.js.map +1 -1
- package/dist/collection/api/Proceed.js +42 -0
- package/dist/collection/api/Proceed.js.map +1 -0
- package/dist/collection/api/shared.js +2 -0
- package/dist/collection/api/shared.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js +6 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -1
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js +8 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
- package/dist/collection/components/business-form/additional-questions/additional-questions.js +59 -0
- package/dist/collection/components/business-form/additional-questions/additional-questions.js.map +1 -0
- package/dist/collection/components/business-form/business-address/business-address-form.js +1 -1
- package/dist/collection/components/business-form/business-address/business-address-form.js.map +1 -1
- package/dist/collection/components/business-form/business-address/test/business-address.spec.js +22 -18
- package/dist/collection/components/business-form/business-address/test/business-address.spec.js.map +1 -1
- package/dist/collection/components/business-form/business-form-schema.js +48 -37
- package/dist/collection/components/business-form/business-form-schema.js.map +1 -1
- package/dist/collection/components/business-form/business-form.css +5283 -43
- package/dist/collection/components/business-form/business-form.js +83 -6
- package/dist/collection/components/business-form/business-form.js.map +1 -1
- package/dist/collection/components/business-form/{businessForm.stories.js → business-form.stories.js} +8 -8
- package/dist/collection/components/business-form/business-form.stories.js.map +1 -0
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +10 -17
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map +1 -1
- package/dist/collection/components/business-form/business-owners/business-owners.css +5283 -0
- package/dist/collection/components/business-form/business-owners/business-owners.js +48 -37
- package/dist/collection/components/business-form/business-owners/business-owners.js.map +1 -1
- package/dist/collection/components/business-form/business-representative/business-representative.js +12 -17
- package/dist/collection/components/business-form/business-representative/business-representative.js.map +1 -1
- package/dist/collection/components/business-form/test/business-form.spec.js +44 -0
- package/dist/collection/components/business-form/test/business-form.spec.js.map +1 -0
- package/dist/collection/components/business-list/business-list.css +576 -0
- package/dist/collection/components/business-list/business-list.js +209 -0
- package/dist/collection/components/business-list/business-list.js.map +1 -0
- package/dist/collection/components/business-list/business-list.stories.js +68 -0
- package/dist/collection/components/business-list/business-list.stories.js.map +1 -0
- package/dist/collection/components/business-list/example.js +12 -0
- package/dist/collection/components/card-form/card-form.js +6 -1
- package/dist/collection/components/card-form/card-form.js.map +1 -1
- package/dist/collection/components/card-form/card-form.stories.js +8 -0
- package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
- package/dist/collection/components/details/details.css +7983 -0
- package/dist/collection/components/details/details.js +66 -0
- package/dist/collection/components/details/details.js.map +1 -0
- package/dist/collection/components/details/utils.js +10 -0
- package/dist/collection/components/details/utils.js.map +1 -0
- package/dist/collection/components/form/form-control-datepart.js +233 -0
- package/dist/collection/components/form/form-control-datepart.js.map +1 -0
- package/dist/collection/components/form/form-control-monetary.js +186 -0
- package/dist/collection/components/form/form-control-monetary.js.map +1 -0
- package/dist/collection/components/form/form-control-number-masked.js +217 -0
- package/dist/collection/components/form/form-control-number-masked.js.map +1 -0
- package/dist/collection/components/form/form-control-number.css +1818 -0
- package/dist/collection/components/form/form-control-number.js +194 -0
- package/dist/collection/components/form/form-control-number.js.map +1 -0
- package/dist/collection/components/form/form-control-select.css +6 -0
- package/dist/collection/components/form/form-control-select.js +36 -4
- package/dist/collection/components/form/form-control-select.js.map +1 -1
- package/dist/collection/components/form/form-control-text.css +7 -0
- package/dist/collection/components/form/form-control-text.js +45 -3
- package/dist/collection/components/form/form-control-text.js.map +1 -1
- package/dist/collection/components/form/form.js +16 -8
- package/dist/collection/components/form/form.js.map +1 -1
- package/dist/collection/components/legal-address-form/legal-address-form-schema.js +11 -0
- package/dist/collection/components/legal-address-form/legal-address-form-schema.js.map +1 -0
- package/dist/collection/components/legal-address-form/legal-address-form.css +2489 -0
- package/dist/collection/components/legal-address-form/legal-address-form.js +90 -0
- package/dist/collection/components/legal-address-form/legal-address-form.js.map +1 -0
- package/dist/collection/components/payment-details/example.js +12 -0
- package/dist/collection/components/payment-details/payment-details.css +7983 -0
- package/dist/collection/components/payment-details/payment-details.js +129 -0
- package/dist/collection/components/payment-details/payment-details.js.map +1 -0
- package/dist/collection/components/payment-details/payment-details.stories.js +47 -0
- package/dist/collection/components/payment-details/payment-details.stories.js.map +1 -0
- package/dist/collection/components/payment-method-form/payment-method-form.css +5 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +25 -35
- package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -1
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +7 -7
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -1
- package/dist/collection/components/payments-list/payments-list.css +0 -7380
- package/dist/collection/components/payments-list/payments-list.js +69 -43
- package/dist/collection/components/payments-list/payments-list.js.map +1 -1
- package/dist/collection/components/payments-list/payments-list.stories.js +10 -10
- package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
- package/dist/collection/components/payments-list/test/payments-list.spec.js +3 -54
- package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -1
- package/dist/collection/components/payout-details/example.js +12 -0
- package/dist/collection/components/payout-details/payout-details.css +7983 -0
- package/dist/collection/components/payout-details/payout-details.js +126 -0
- package/dist/collection/components/payout-details/payout-details.js.map +1 -0
- package/dist/collection/components/payout-details/payout-details.stories.js +47 -0
- package/dist/collection/components/payout-details/payout-details.stories.js.map +1 -0
- package/dist/collection/components/payouts-list/example.js +12 -0
- package/dist/collection/components/payouts-list/payouts-list.css +0 -7407
- package/dist/collection/components/payouts-list/payouts-list.js +82 -48
- package/dist/collection/components/payouts-list/payouts-list.js.map +1 -1
- package/dist/collection/components/payouts-list/payouts-list.stories.js +10 -10
- package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
- package/dist/collection/components/proceeds-list/example.js +12 -0
- package/dist/collection/components/proceeds-list/proceeds-list.css +576 -0
- package/dist/collection/components/proceeds-list/proceeds-list.js +207 -0
- package/dist/collection/components/proceeds-list/proceeds-list.js.map +1 -0
- package/dist/collection/components/proceeds-list/proceeds-list.stories.js +69 -0
- package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -0
- package/dist/collection/components/table/table-utils.js +8 -0
- package/dist/collection/components/table/table-utils.js.map +1 -0
- package/dist/collection/components/table/table.css +8077 -0
- package/dist/collection/components/table/table.js +215 -0
- package/dist/collection/components/table/table.js.map +1 -0
- package/dist/collection/components/table/test/table.spec.js +59 -0
- package/dist/collection/components/table/test/table.spec.js.map +1 -0
- package/dist/collection/utils/country-options.js +202 -0
- package/dist/collection/utils/country-options.js.map +1 -0
- package/dist/collection/utils/phone-masks.js +4 -0
- package/dist/collection/utils/phone-masks.js.map +1 -0
- package/dist/collection/utils/utils.js +40 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/Api.js +15 -3
- package/dist/components/Api.js.map +1 -1
- package/dist/components/Payout.js +113 -0
- package/dist/components/Payout.js.map +1 -0
- package/dist/components/additional-questions.js +51 -0
- package/dist/components/additional-questions.js.map +1 -0
- package/dist/components/business-address-form.js +8 -2
- package/dist/components/business-address-form.js.map +1 -1
- package/dist/components/business-generic-info.js +61 -35
- package/dist/components/business-generic-info.js.map +1 -1
- package/dist/components/business-owners.js +52 -36
- package/dist/components/business-owners.js.map +1 -1
- package/dist/components/business-representative.js +31 -15
- package/dist/components/business-representative.js.map +1 -1
- package/dist/components/details.js +66 -0
- package/dist/components/details.js.map +1 -0
- package/dist/components/form-control-datepart.d.ts +11 -0
- package/dist/components/form-control-datepart.js +8 -0
- package/dist/components/form-control-datepart.js.map +1 -0
- package/dist/components/form-control-datepart2.js +97 -0
- package/dist/components/form-control-datepart2.js.map +1 -0
- package/dist/components/form-control-monetary.d.ts +11 -0
- package/dist/components/form-control-monetary.js +8 -0
- package/dist/components/form-control-monetary.js.map +1 -0
- package/dist/components/form-control-monetary2.js +82 -0
- package/dist/components/form-control-monetary2.js.map +1 -0
- package/dist/components/form-control-number-masked.d.ts +11 -0
- package/dist/components/form-control-number-masked.js +8 -0
- package/dist/components/form-control-number-masked.js.map +1 -0
- package/dist/components/form-control-number-masked2.js +81 -0
- package/dist/components/form-control-number-masked2.js.map +1 -0
- package/dist/components/form-control-number.d.ts +11 -0
- package/dist/components/form-control-number.js +8 -0
- package/dist/components/form-control-number.js.map +1 -0
- package/dist/components/form-control-number2.js +70 -0
- package/dist/components/form-control-number2.js.map +1 -0
- package/dist/components/form-control-select.js +2 -2
- package/dist/components/form-control-select2.js +20 -7
- package/dist/components/form-control-select2.js.map +1 -1
- package/dist/components/form-control-text2.js +23 -4
- package/dist/components/form-control-text2.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.esm.js +1 -18
- package/dist/components/index.esm.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +3231 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/justifi-additional-questions.d.ts +11 -0
- package/dist/components/justifi-additional-questions.js +8 -0
- package/dist/components/justifi-additional-questions.js.map +1 -0
- package/dist/components/justifi-bank-account-form.js +2 -0
- package/dist/components/justifi-bank-account-form.js.map +1 -1
- package/dist/components/justifi-business-form.js +146 -28
- package/dist/components/justifi-business-form.js.map +1 -1
- package/dist/components/justifi-business-generic-info.js +1 -1
- package/dist/components/justifi-business-list.d.ts +11 -0
- package/dist/components/justifi-business-list.js +215 -0
- package/dist/components/justifi-business-list.js.map +1 -0
- package/dist/components/justifi-card-form.js +2 -0
- package/dist/components/justifi-card-form.js.map +1 -1
- package/dist/components/justifi-details.d.ts +11 -0
- package/dist/components/justifi-details.js +8 -0
- package/dist/components/justifi-details.js.map +1 -0
- package/dist/components/justifi-legal-address-form.d.ts +11 -0
- package/dist/components/justifi-legal-address-form.js +8 -0
- package/dist/components/justifi-legal-address-form.js.map +1 -0
- package/dist/components/justifi-payment-details.d.ts +11 -0
- package/dist/components/justifi-payment-details.js +88 -0
- package/dist/components/justifi-payment-details.js.map +1 -0
- package/dist/components/justifi-payment-form.js +2 -1
- package/dist/components/justifi-payment-form.js.map +1 -1
- package/dist/components/justifi-payments-list.js +52 -45
- package/dist/components/justifi-payments-list.js.map +1 -1
- package/dist/components/justifi-payout-details.d.ts +11 -0
- package/dist/components/justifi-payout-details.js +86 -0
- package/dist/components/justifi-payout-details.js.map +1 -0
- package/dist/components/justifi-payouts-list.js +65 -50
- package/dist/components/justifi-payouts-list.js.map +1 -1
- package/dist/components/justifi-proceeds-list.d.ts +11 -0
- package/dist/components/justifi-proceeds-list.js +182 -0
- package/dist/components/justifi-proceeds-list.js.map +1 -0
- package/dist/components/justifi-table.d.ts +11 -0
- package/dist/components/justifi-table.js +8 -0
- package/dist/components/justifi-table.js.map +1 -0
- package/dist/components/legal-address-form.js +271 -0
- package/dist/components/legal-address-form.js.map +1 -0
- package/dist/components/payment-method-form.js +1488 -21
- package/dist/components/payment-method-form.js.map +1 -1
- package/dist/components/phone-masks.js +7 -0
- package/dist/components/phone-masks.js.map +1 -0
- package/dist/components/table.js +94 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/utils.js +41 -102
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/{Api-436dfa09.js → Api-a95f17ac.js} +16 -4
- package/dist/esm/Api-a95f17ac.js.map +1 -0
- package/dist/esm/Payout-9a1f2859.js +113 -0
- package/dist/esm/Payout-9a1f2859.js.map +1 -0
- package/dist/esm/{business-form-schema-30c48693.js → business-form-schema-5885d3d6.js} +40 -22
- package/dist/esm/business-form-schema-5885d3d6.js.map +1 -0
- package/dist/esm/form-control-datepart_2.entry.js +102 -0
- package/dist/esm/form-control-datepart_2.entry.js.map +1 -0
- package/dist/esm/form-control-monetary.entry.js +61 -0
- package/dist/esm/form-control-monetary.entry.js.map +1 -0
- package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +98 -12
- package/dist/esm/form-control-number_3.entry.js.map +1 -0
- package/dist/esm/form-control-select.entry.js +43 -0
- package/dist/esm/form-control-select.entry.js.map +1 -0
- package/dist/esm/index-5ed53c20.js +3231 -0
- package/dist/esm/index-5ed53c20.js.map +1 -0
- package/dist/esm/{index-c8f391de.js → index-fe877d03.js} +10 -7
- package/dist/esm/index-fe877d03.js.map +1 -0
- package/dist/esm/{index.esm-be2cd327.js → index.esm-89fe6af9.js} +2 -19
- package/dist/esm/index.esm-89fe6af9.js.map +1 -0
- package/dist/esm/justifi-additional-questions_5.entry.js +388 -0
- package/dist/esm/justifi-additional-questions_5.entry.js.map +1 -0
- package/dist/esm/justifi-bank-account-form.entry.js +3 -1
- package/dist/esm/justifi-bank-account-form.entry.js.map +1 -1
- package/dist/esm/justifi-billing-form_2.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +98 -16
- package/dist/esm/justifi-business-form.entry.js.map +1 -1
- package/dist/esm/justifi-business-list.entry.js +185 -0
- package/dist/esm/justifi-business-list.entry.js.map +1 -0
- package/dist/esm/justifi-card-form.entry.js +3 -1
- package/dist/esm/justifi-card-form.entry.js.map +1 -1
- package/dist/esm/justifi-details.entry.js +26 -0
- package/dist/esm/justifi-details.entry.js.map +1 -0
- package/dist/esm/justifi-payment-details.entry.js +59 -0
- package/dist/esm/justifi-payment-details.entry.js.map +1 -0
- package/dist/esm/justifi-payment-form.entry.js +3 -2
- package/dist/esm/justifi-payment-form.entry.js.map +1 -1
- package/dist/esm/justifi-payment-method-form.entry.js +1487 -19
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
- package/dist/esm/justifi-payments-list.entry.js +47 -45
- package/dist/esm/justifi-payments-list.entry.js.map +1 -1
- package/dist/esm/justifi-payout-details.entry.js +57 -0
- package/dist/esm/justifi-payout-details.entry.js.map +1 -0
- package/dist/esm/justifi-payouts-list.entry.js +60 -50
- package/dist/esm/justifi-payouts-list.entry.js.map +1 -1
- package/dist/esm/justifi-proceeds-list.entry.js +152 -0
- package/dist/esm/justifi-proceeds-list.entry.js.map +1 -0
- package/dist/esm/justifi-table.entry.js +64 -0
- package/dist/esm/justifi-table.entry.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select-input_2.entry.js +1 -1
- package/dist/esm/table-utils-6cdcaa8c.js +11 -0
- package/dist/esm/table-utils-6cdcaa8c.js.map +1 -0
- package/dist/esm/utils-1e7d6279.js +28 -0
- package/dist/esm/utils-1e7d6279.js.map +1 -0
- package/dist/esm/{utils-e7782126.js → utils-ad0bbe03.js} +42 -103
- package/dist/esm/utils-ad0bbe03.js.map +1 -0
- package/dist/esm/webcomponents.js +4 -4
- package/dist/esm/webcomponents.js.map +1 -1
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Business.d.ts +133 -0
- package/dist/types/api/Payment.d.ts +1 -0
- package/dist/types/api/Payout.d.ts +10 -12
- package/dist/types/api/Proceed.d.ts +60 -0
- package/dist/types/api/shared.d.ts +11 -0
- package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +6 -0
- package/dist/types/components/business-form/additional-questions/additional-questions.d.ts +15 -0
- package/dist/types/components/business-form/business-form-schema.d.ts +47 -21
- package/dist/types/components/business-form/business-form.d.ts +7 -2
- package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +1 -2
- package/dist/types/components/business-form/business-owners/business-owners.d.ts +3 -2
- package/dist/types/components/business-form/business-representative/business-representative.d.ts +1 -2
- package/dist/types/components/business-list/business-list.d.ts +35 -0
- package/dist/types/components/business-list/business-list.stories.d.ts +9 -0
- package/dist/types/components/card-form/card-form.stories.d.ts +6 -0
- package/dist/types/components/details/details.d.ts +7 -0
- package/dist/types/components/details/utils.d.ts +19 -0
- package/dist/types/components/form/form-control-datepart.d.ts +19 -0
- package/dist/types/components/form/form-control-monetary.d.ts +17 -0
- package/dist/types/components/form/form-control-number-masked.d.ts +19 -0
- package/dist/types/components/form/form-control-number.d.ts +18 -0
- package/dist/types/components/form/form-control-select.d.ts +6 -1
- package/dist/types/components/form/form-control-text.d.ts +6 -0
- package/dist/types/components/form/form.d.ts +5 -4
- package/dist/types/components/legal-address-form/legal-address-form-schema.d.ts +17 -0
- package/dist/types/components/legal-address-form/legal-address-form.d.ts +16 -0
- package/dist/types/components/payment-details/payment-details.d.ts +28 -0
- package/dist/types/components/payment-details/payment-details.stories.d.ts +8 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -3
- package/dist/types/components/payments-list/payments-list.d.ts +6 -14
- package/dist/types/components/payments-list/payments-list.stories.d.ts +1 -8
- package/dist/types/components/payout-details/payout-details.d.ts +28 -0
- package/dist/types/components/payout-details/payout-details.stories.d.ts +8 -0
- package/dist/types/components/payouts-list/payouts-list.d.ts +7 -15
- package/dist/types/components/payouts-list/payouts-list.stories.d.ts +1 -8
- package/dist/types/components/proceeds-list/proceeds-list.d.ts +37 -0
- package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +9 -0
- package/dist/types/components/table/table-utils.d.ts +14 -0
- package/dist/types/components/table/table.d.ts +28 -0
- package/dist/types/components.d.ts +637 -12
- package/dist/types/stencil-public-runtime.d.ts +2 -0
- package/dist/types/utils/country-options.d.ts +5 -0
- package/dist/types/utils/phone-masks.d.ts +3 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/webcomponents/{p-1953797f.entry.js → p-1beaaba3.entry.js} +2 -2
- package/dist/webcomponents/{p-33d69eb5.entry.js → p-2b6f5e35.entry.js} +2 -2
- package/dist/webcomponents/p-2b6f5e35.entry.js.map +1 -0
- package/dist/webcomponents/p-2c2cde2d.js +2 -0
- package/dist/webcomponents/p-2c2cde2d.js.map +1 -0
- package/dist/webcomponents/p-2e66512d.entry.js +2 -0
- package/dist/webcomponents/p-2e66512d.entry.js.map +1 -0
- package/dist/webcomponents/p-640bfa9f.entry.js +2 -0
- package/dist/webcomponents/p-640bfa9f.entry.js.map +1 -0
- package/dist/webcomponents/p-641883b2.entry.js +2 -0
- package/dist/webcomponents/p-641883b2.entry.js.map +1 -0
- package/dist/webcomponents/p-6d549d84.entry.js +2 -0
- package/dist/webcomponents/p-6d549d84.entry.js.map +1 -0
- package/dist/webcomponents/p-75292cca.entry.js +2 -0
- package/dist/webcomponents/p-75292cca.entry.js.map +1 -0
- package/dist/webcomponents/p-7d6c309d.entry.js +2 -0
- package/dist/webcomponents/p-7d6c309d.entry.js.map +1 -0
- package/dist/webcomponents/p-8f421dc6.js +2 -0
- package/dist/webcomponents/p-8f421dc6.js.map +1 -0
- package/dist/webcomponents/p-9346ae33.js +2 -0
- package/dist/webcomponents/p-9346ae33.js.map +1 -0
- package/dist/webcomponents/p-a2aae7c9.entry.js +2 -0
- package/dist/webcomponents/p-a2aae7c9.entry.js.map +1 -0
- package/dist/webcomponents/{p-23e9c7d4.entry.js → p-a922b908.entry.js} +2 -2
- package/dist/webcomponents/p-ab0756ff.js +2 -0
- package/dist/webcomponents/p-ab0756ff.js.map +1 -0
- package/dist/webcomponents/{p-0fd4aae2.js → p-c46241ba.js} +2 -2
- package/dist/webcomponents/p-c46241ba.js.map +1 -0
- package/dist/webcomponents/p-ccb0e1c5.js +2 -0
- package/dist/webcomponents/p-ccb0e1c5.js.map +1 -0
- package/dist/webcomponents/{p-d5cadc78.entry.js → p-cd0eca25.entry.js} +2 -2
- package/dist/webcomponents/{p-d5cadc78.entry.js.map → p-cd0eca25.entry.js.map} +1 -1
- package/dist/webcomponents/{p-7041a637.entry.js → p-d92116e6.entry.js} +2 -2
- package/dist/webcomponents/{p-7041a637.entry.js.map → p-d92116e6.entry.js.map} +1 -1
- package/dist/webcomponents/p-da4e6389.entry.js +2 -0
- package/dist/webcomponents/p-da4e6389.entry.js.map +1 -0
- package/dist/webcomponents/p-db9945b1.entry.js +2 -0
- package/dist/webcomponents/p-db9945b1.entry.js.map +1 -0
- package/dist/webcomponents/p-e1f6c8ec.entry.js +2 -0
- package/dist/webcomponents/p-e1f6c8ec.entry.js.map +1 -0
- package/dist/webcomponents/p-e6695628.js +2 -0
- package/dist/webcomponents/p-e6695628.js.map +1 -0
- package/dist/webcomponents/p-e70b2a21.js +3 -0
- package/dist/webcomponents/p-e70b2a21.js.map +1 -0
- package/dist/webcomponents/p-ee32a236.entry.js +2 -0
- package/dist/webcomponents/p-ee32a236.entry.js.map +1 -0
- package/dist/webcomponents/p-f6cc37a6.entry.js +2 -0
- package/dist/webcomponents/{p-309a886f.entry.js.map → p-f6cc37a6.entry.js.map} +1 -1
- package/dist/webcomponents/p-f72c3084.entry.js +2 -0
- package/dist/webcomponents/p-f72c3084.entry.js.map +1 -0
- package/dist/webcomponents/p-f8067330.entry.js +2 -0
- package/dist/webcomponents/p-f8067330.entry.js.map +1 -0
- package/dist/webcomponents/p-f9e127a5.js +2 -0
- package/dist/webcomponents/p-f9e127a5.js.map +1 -0
- package/dist/webcomponents/p-fe2ec58b.entry.js +2 -0
- package/dist/webcomponents/p-fe2ec58b.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +8 -5
- package/dist/cjs/Api-7303478d.js.map +0 -1
- package/dist/cjs/business-form-schema-63b311b2.js.map +0 -1
- package/dist/cjs/form-control-select_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-83b2ec02.js.map +0 -1
- package/dist/cjs/index.esm-7e12ce07.js.map +0 -1
- package/dist/cjs/justifi-business-address-form.cjs.entry.js +0 -37
- package/dist/cjs/justifi-business-address-form.cjs.entry.js.map +0 -1
- package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js +0 -148
- package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js.map +0 -1
- package/dist/cjs/utils-4ee7e080.js.map +0 -1
- package/dist/collection/components/business-form/businessForm.stories.js.map +0 -1
- package/dist/esm/Api-436dfa09.js.map +0 -1
- package/dist/esm/business-form-schema-30c48693.js.map +0 -1
- package/dist/esm/form-control-select_2.entry.js.map +0 -1
- package/dist/esm/index-c8f391de.js.map +0 -1
- package/dist/esm/index.esm-be2cd327.js.map +0 -1
- package/dist/esm/justifi-business-address-form.entry.js +0 -33
- package/dist/esm/justifi-business-address-form.entry.js.map +0 -1
- package/dist/esm/justifi-business-generic-info_3.entry.js +0 -142
- package/dist/esm/justifi-business-generic-info_3.entry.js.map +0 -1
- package/dist/esm/utils-e7782126.js.map +0 -1
- package/dist/webcomponents/p-0fd4aae2.js.map +0 -1
- package/dist/webcomponents/p-1a1f2196.js +0 -2
- package/dist/webcomponents/p-1a1f2196.js.map +0 -1
- package/dist/webcomponents/p-309a886f.entry.js +0 -2
- package/dist/webcomponents/p-33d69eb5.entry.js.map +0 -1
- package/dist/webcomponents/p-3a80a2ec.entry.js +0 -2
- package/dist/webcomponents/p-3a80a2ec.entry.js.map +0 -1
- package/dist/webcomponents/p-45fea6a8.entry.js +0 -2
- package/dist/webcomponents/p-45fea6a8.entry.js.map +0 -1
- package/dist/webcomponents/p-79456add.js +0 -2
- package/dist/webcomponents/p-79456add.js.map +0 -1
- package/dist/webcomponents/p-af080b21.js +0 -2
- package/dist/webcomponents/p-af080b21.js.map +0 -1
- package/dist/webcomponents/p-bc969904.js +0 -3
- package/dist/webcomponents/p-bc969904.js.map +0 -1
- package/dist/webcomponents/p-cd097ce9.entry.js +0 -2
- package/dist/webcomponents/p-cd097ce9.entry.js.map +0 -1
- package/dist/webcomponents/p-d5bc9f22.entry.js +0 -2
- package/dist/webcomponents/p-d5bc9f22.entry.js.map +0 -1
- package/dist/webcomponents/p-dd1ebc0b.entry.js +0 -2
- package/dist/webcomponents/p-dd1ebc0b.entry.js.map +0 -1
- package/dist/webcomponents/p-e05e0c6b.entry.js +0 -2
- package/dist/webcomponents/p-e05e0c6b.entry.js.map +0 -1
- /package/dist/types/components/business-form/{businessForm.stories.d.ts → business-form.stories.d.ts} +0 -0
- /package/dist/webcomponents/{p-1953797f.entry.js.map → p-1beaaba3.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-23e9c7d4.entry.js.map → p-a922b908.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
|
-
|
|
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
|
|
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
|
|
46
|
-
return
|
|
47
|
-
case PayoutStatuses.
|
|
48
|
-
return
|
|
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
|
|
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
|
|
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
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
: direction
|
|
88
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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,EA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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 >←</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 >→</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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,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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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,
|
|
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"]}
|