@justifi/webcomponents 4.8.3 → 4.10.0-rc.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.
- package/dist/cjs/{Business-42d0c522.js → Business-79361c8a.js} +7 -7
- package/dist/cjs/Identity-b6364aee.js +27 -0
- package/dist/cjs/{Payout-44b49b2d.js → Payment-89a8bc21.js} +0 -43
- package/dist/cjs/Payout-a2dd7b01.js +45 -0
- package/dist/cjs/{SubAccount-2a803b22.js → SubAccount-b3902202.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +24 -10
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
- package/dist/cjs/business-details-core.cjs.entry.js +55 -0
- package/dist/cjs/business-form-select-options-7ccd8dca.js +85 -0
- package/dist/cjs/business-form-types-3cdd5447.js +19 -0
- package/dist/cjs/form-control-datepart_3.cjs.entry.js +32 -46
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +44 -1
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +11036 -0
- package/dist/cjs/{index-55950669.js → index-69b9386b.js} +57 -3
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +505 -0
- package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +12 -42
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/{select-input_2.cjs.entry.js → justifi-billing-form_4.cjs.entry.js} +1810 -1
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
- package/dist/cjs/justifi-business-details.cjs.entry.js +43 -57
- package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +36 -89
- package/dist/cjs/justifi-business-form.cjs.entry.js +18 -16
- package/dist/cjs/justifi-business-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +95 -0
- package/dist/cjs/justifi-checkout.cjs.entry.js +99 -0
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +39 -11008
- package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +168 -0
- package/dist/cjs/justifi-owner-form.cjs.entry.js +160 -0
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -4
- package/dist/cjs/{justifi-billing-form_2.cjs.entry.js → justifi-payment-method-selector.cjs.entry.js} +4 -79
- package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +6 -5
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +5 -4
- package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/payload-parsers-25ed3936.js +98 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +10 -4
- package/dist/cjs/{payment.service-605896dc.js → payment.service-0b0086dc.js} +2 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +4 -3
- package/dist/cjs/payout-details-core.cjs.entry.js +4 -4
- package/dist/cjs/{payout.service-b39f2739.js → payout.service-5cc3b4e9.js} +2 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +4 -3
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +7 -7
- package/dist/cjs/subaccount-bank-details.cjs.entry.js +3 -3
- package/dist/cjs/subaccount-terms-details.cjs.entry.js +3 -3
- package/dist/cjs/{utils-d126d17c.js → utils-23e70ef2.js} +5 -5
- package/dist/cjs/{utils-29a8a91d.js → utils-6f62f7a1.js} +29 -2
- package/dist/cjs/utils-df5167a8.js +13 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Business.js +6 -7
- package/dist/collection/api/Checkout.js +1 -0
- package/dist/collection/api/Identity.js +43 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/services/business.service.js +8 -0
- package/dist/collection/api/services/checkout.service.js +12 -0
- package/dist/collection/api/services/reports.service.js +9 -0
- package/dist/collection/collection-manifest.json +22 -8
- package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
- package/dist/collection/components/billing-form/billing-form.js +1 -2
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +5 -2
- package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +16 -0
- package/dist/collection/components/business-details/business-details-core.js +86 -0
- package/dist/collection/components/business-details/business-details.js +20 -65
- package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -2
- package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +16 -0
- package/dist/collection/components/business-details/get-business.js +17 -0
- package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +5 -2
- package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +16 -0
- package/dist/collection/components/business-details/owner-details/owner-details.js +12 -14
- package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +16 -0
- package/dist/collection/components/business-details/representative-details/representative-details.js +7 -5
- package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +16 -0
- package/dist/collection/components/business-details/test/busines-details-core.spec.js +53 -0
- package/dist/collection/components/business-details/test/business-details.spec.js +40 -0
- package/dist/collection/components/business-details/test/get-business.spec.js +60 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
- package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +2536 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.js +4 -4
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.css +2493 -0
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +77 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
- package/dist/collection/components/business-forms/business-form/business-owners/business-owners.css +7779 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.css +2493 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.css +2493 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.js +1 -1
- package/dist/collection/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.js +218 -0
- package/dist/collection/components/business-forms/business-form-stepped/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-address/business-address-form-step.js +97 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.js +239 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-core-info/test/business-core-info-form-step.spec.js +97 -0
- package/dist/collection/components/{business-form → business-forms/business-form-stepped}/business-form-stepped.css +105 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-form-stepped.js +199 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.js +284 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-owners/test/business-owners-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.js +230 -0
- package/dist/collection/components/business-forms/business-form-stepped/business-representative/test/business-representative-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.js +232 -0
- package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +61 -0
- package/dist/collection/components/business-forms/owner-form/owner-form.css +7779 -0
- package/dist/collection/components/business-forms/owner-form/owner-form.js +367 -0
- package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +7 -0
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +15 -0
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +13 -0
- package/dist/collection/components/business-forms/schemas/business-form-schema.js +6 -0
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +35 -0
- package/dist/collection/components/business-forms/schemas/business-owners-schema.js +16 -0
- package/dist/collection/components/business-forms/utils/business-form-select-options.js +80 -0
- package/dist/collection/components/business-forms/utils/business-form-types.js +17 -0
- package/dist/collection/components/business-forms/utils/payload-parsers.js +37 -0
- package/dist/collection/components/checkout/checkout-actions.js +33 -0
- package/dist/collection/components/checkout/checkout-core.css +2604 -0
- package/dist/collection/components/checkout/checkout-core.js +248 -0
- package/dist/collection/components/checkout/checkout.js +112 -0
- package/dist/collection/components/checkout/new-payment-method.js +188 -0
- package/dist/collection/components/checkout/payment-method-option-utils.js +19 -0
- package/dist/collection/components/checkout/payment-method-options.css +7073 -0
- package/dist/collection/components/checkout/payment-method-options.js +248 -0
- package/dist/collection/components/checkout/saved-payment-method.js +123 -0
- package/dist/collection/components/checkout/test/checkout.js +22 -0
- package/dist/collection/components/checkout/test/checkout.spec.js +166 -0
- package/dist/collection/components/checkout/test/mockCheckout.js +19 -0
- package/dist/collection/components/details/utils.js +4 -1
- package/dist/collection/components/form/utils.js +1 -0
- package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +14 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +119 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +25 -73
- package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +69 -0
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +64 -0
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +23 -8
- package/dist/collection/components/payment-details/payment-details-core.js +8 -2
- package/dist/collection/components/payment-details/payment-details.js +0 -1
- package/dist/collection/components/payment-form/payment-form.js +1 -1
- package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
- package/dist/collection/components/payout-details/payout-details-core.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +2 -2
- package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +2 -2
- package/dist/collection/utils/utils.js +25 -3
- package/dist/docs.json +2945 -590
- package/dist/esm/{Business-e9340f6b.js → Business-1df362e0.js} +7 -8
- package/dist/esm/Identity-774788c0.js +25 -0
- package/dist/esm/{Payout-dc5f009c.js → Payment-55886c86.js} +1 -43
- package/dist/esm/Payout-dfe15b00.js +43 -0
- package/dist/esm/{SubAccount-46b4c2b1.js → SubAccount-f4ae9809.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +24 -10
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
- package/dist/esm/business-details-core.entry.js +51 -0
- package/dist/esm/business-form-select-options-6b9293fe.js +82 -0
- package/dist/esm/business-form-types-de9f38cd.js +19 -0
- package/dist/esm/form-control-datepart_3.entry.js +32 -46
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +44 -2
- package/dist/esm/gross-payment-chart-core.entry.js +11032 -0
- package/dist/esm/{index-62b8aa8a.js → index-df86d9a2.js} +57 -3
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +497 -0
- package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +12 -41
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/{select-input_2.entry.js → justifi-billing-form_4.entry.js} +1809 -2
- package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
- package/dist/esm/justifi-business-details.entry.js +42 -56
- package/dist/esm/justifi-business-form-stepped.entry.js +36 -89
- package/dist/esm/justifi-business-form.entry.js +17 -15
- package/dist/esm/justifi-business-list.entry.js +5 -4
- package/dist/esm/justifi-business-owners.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +1 -1
- package/dist/esm/justifi-checkout-core.entry.js +91 -0
- package/dist/esm/justifi-checkout.entry.js +95 -0
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +39 -11008
- package/dist/esm/justifi-new-payment-method_3.entry.js +162 -0
- package/dist/esm/justifi-owner-form.entry.js +156 -0
- package/dist/esm/justifi-payment-balance-transactions.entry.js +4 -3
- package/dist/esm/justifi-payment-details.entry.js +5 -4
- package/dist/esm/justifi-payment-form.entry.js +4 -3
- package/dist/esm/{justifi-billing-form_2.entry.js → justifi-payment-method-selector.entry.js} +4 -78
- package/dist/esm/justifi-payments-list.entry.js +5 -4
- package/dist/esm/justifi-payout-details.entry.js +5 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -4
- package/dist/esm/justifi-proceeds-list.entry.js +4 -3
- package/dist/esm/justifi-refund-form.entry.js +3 -2
- package/dist/esm/justifi-subaccount-details.entry.js +6 -5
- package/dist/esm/justifi-subaccounts-list.entry.js +5 -4
- package/dist/esm/justifi-table_2.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/payload-parsers-1dd7474f.js +90 -0
- package/dist/esm/payment-details-core.entry.js +10 -4
- package/dist/esm/{payment.service-bea02ccf.js → payment.service-f274ef98.js} +2 -1
- package/dist/esm/payments-list-core.entry.js +4 -3
- package/dist/esm/payout-details-core.entry.js +4 -4
- package/dist/esm/{payout.service-92e56814.js → payout.service-af293f61.js} +2 -1
- package/dist/esm/payouts-list-core.entry.js +4 -3
- package/dist/esm/subaccount-account-details_4.entry.js +7 -7
- package/dist/esm/subaccount-bank-details.entry.js +3 -3
- package/dist/esm/subaccount-terms-details.entry.js +3 -3
- package/dist/esm/{utils-76a93600.js → utils-243abdb4.js} +26 -3
- package/dist/esm/utils-2828201a.js +10 -0
- package/dist/esm/{utils-576874df.js → utils-d01c5f3a.js} +5 -5
- package/dist/esm/webcomponents.js +3 -3
- package/dist/module/Business.js +7 -8
- package/dist/module/Payment.js +138 -0
- package/dist/module/Payout.js +1 -138
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/additional-questions-details2.js +5 -2
- package/dist/module/billing-form.js +2 -3
- package/dist/module/business-additional-questions-form-step.js +120 -0
- package/dist/module/business-additional-questions-schema.js +10 -0
- package/dist/module/business-address-form.js +3 -3
- package/dist/module/business-address-schema.js +18 -0
- package/dist/module/business-core-info-form-step.js +141 -0
- package/dist/module/business-core-info-schema.js +16 -0
- package/dist/module/business-core-info.js +69 -0
- package/dist/module/business-details-core.d.ts +11 -0
- package/dist/module/business-details-core.js +6 -0
- package/dist/module/business-details-core2.js +101 -0
- package/dist/module/business-form-select-options.js +82 -0
- package/dist/module/business-form-types.js +19 -0
- package/dist/module/business-identity-schema.js +38 -0
- package/dist/module/business-owners-form-step.js +213 -0
- package/dist/module/business-representative-form-step.js +157 -0
- package/dist/module/business-representative.js +1 -1
- package/dist/module/checkout-core.js +163 -0
- package/dist/module/generic-info-details2.js +4 -2
- package/dist/module/gross-payment-chart-core.d.ts +11 -0
- package/dist/module/gross-payment-chart-core.js +6 -0
- package/dist/module/gross-payment-chart-core2.js +11055 -0
- package/dist/module/justifi-additional-questions-form-step.d.ts +11 -0
- package/dist/module/justifi-additional-questions-form-step.js +6 -0
- package/dist/module/justifi-business-address-form-step.d.ts +11 -0
- package/dist/module/justifi-business-address-form-step.js +75 -0
- package/dist/module/justifi-business-core-info-form-step.d.ts +11 -0
- package/dist/module/justifi-business-core-info-form-step.js +6 -0
- package/dist/module/justifi-business-core-info.d.ts +11 -0
- package/dist/module/justifi-business-core-info.js +6 -0
- package/dist/module/justifi-business-details.js +51 -60
- package/dist/module/justifi-business-form-stepped.js +72 -112
- package/dist/module/justifi-business-form.js +20 -14
- package/dist/module/justifi-business-list.js +2 -1
- package/dist/module/justifi-business-owners-form-step.d.ts +11 -0
- package/dist/module/justifi-business-owners-form-step.js +6 -0
- package/dist/module/justifi-business-representative-form-step.d.ts +11 -0
- package/dist/module/justifi-business-representative-form-step.js +6 -0
- package/dist/module/justifi-checkout-core.d.ts +11 -0
- package/dist/module/justifi-checkout-core.js +6 -0
- package/dist/module/justifi-checkout.d.ts +11 -0
- package/dist/module/justifi-checkout.js +172 -0
- package/dist/module/justifi-gross-payment-chart.js +49 -11016
- package/dist/module/justifi-legal-address-form-step.d.ts +11 -0
- package/dist/module/justifi-legal-address-form-step.js +6 -0
- package/dist/module/justifi-new-payment-method.d.ts +11 -0
- package/dist/module/justifi-new-payment-method.js +6 -0
- package/dist/module/justifi-owner-form.d.ts +11 -0
- package/dist/module/justifi-owner-form.js +6 -0
- package/dist/module/justifi-payment-balance-transactions.js +3 -2
- package/dist/module/justifi-payment-details.js +2 -1
- package/dist/module/justifi-payment-form.js +2 -1
- package/dist/module/justifi-payment-method-options.d.ts +11 -0
- package/dist/module/justifi-payment-method-options.js +6 -0
- package/dist/module/justifi-payments-list.js +2 -1
- package/dist/module/justifi-payout-details.js +2 -1
- package/dist/module/justifi-payouts-list.js +2 -1
- package/dist/module/justifi-proceeds-list.js +2 -1
- package/dist/module/justifi-refund-form.js +1 -0
- package/dist/module/justifi-saved-payment-method.d.ts +11 -0
- package/dist/module/justifi-saved-payment-method.js +6 -0
- package/dist/module/justifi-subaccount-details.js +2 -1
- package/dist/module/justifi-subaccounts-list.js +2 -1
- package/dist/module/legal-address-details2.js +5 -2
- package/dist/module/legal-address-form-step.js +136 -0
- package/dist/module/new-payment-method.js +105 -0
- package/dist/module/owner-details2.js +10 -4
- package/dist/module/owner-form.js +244 -0
- package/dist/module/payload-parsers.js +39 -0
- package/dist/module/payment-details-core2.js +9 -3
- package/dist/module/payment-method-form.js +4 -10
- package/dist/module/payment-method-options.js +128 -0
- package/dist/module/payment-method-selector.js +2 -1
- package/dist/module/payment.service.js +1 -0
- package/dist/module/payments-list-core2.js +2 -1
- package/dist/module/payout-details-core2.js +3 -3
- package/dist/module/payout.service.js +1 -0
- package/dist/module/payouts-list-core2.js +3 -2
- package/dist/module/representative-details2.js +5 -3
- package/dist/module/saved-payment-method.js +66 -0
- package/dist/module/subaccount-account-details2.js +2 -2
- package/dist/module/subaccount-bank-details.js +2 -2
- package/dist/module/subaccount-merchant-details2.js +3 -3
- package/dist/module/subaccount-owners-details2.js +2 -2
- package/dist/module/subaccount-representative-details2.js +2 -2
- package/dist/module/subaccount-terms-details.js +2 -2
- package/dist/module/utils.js +4 -4
- package/dist/module/utils2.js +26 -3
- package/dist/module/utils4.js +10 -0
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Business.d.ts +1 -18
- package/dist/types/api/Checkout.d.ts +14 -0
- package/dist/types/api/Identity.d.ts +60 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/services/business.service.d.ts +8 -0
- package/dist/types/api/services/checkout.service.d.ts +9 -0
- package/dist/types/api/services/reports.service.d.ts +5 -0
- package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
- package/dist/types/components/billing-form/billing-form.d.ts +0 -1
- package/dist/types/components/business-details/business-details-core.d.ts +16 -0
- package/dist/types/components/business-details/business-details.d.ts +3 -13
- package/dist/types/components/business-details/get-business.d.ts +8 -0
- package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -9
- package/dist/types/components/business-details/representative-details/representative-details.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/business-address/business-address-form.d.ts +1 -1
- package/dist/types/components/{business-form/business-generic-info/business-generic-info.d.ts → business-forms/business-form/business-core-info/business-core-info.d.ts} +5 -5
- package/dist/types/components/{business-form → business-forms/business-form}/business-form.d.ts +5 -10
- package/dist/types/components/{business-form → business-forms/business-form}/business-owners/business-owners.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/business-representative/business-representative.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.d.ts +2 -2
- package/dist/types/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.d.ts +30 -0
- package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +9 -0
- package/dist/types/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/business-form-stepped/business-form-stepped.d.ts +45 -0
- package/dist/types/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.d.ts +26 -0
- package/dist/types/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.d.ts +31 -0
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +36 -0
- package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +11 -0
- package/dist/types/components/{business-form/business-address/business-address-form-schema.d.ts → business-forms/schemas/business-address-schema.d.ts} +11 -8
- package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +19 -0
- package/dist/types/components/{business-form → business-forms/schemas}/business-form-schema.d.ts +2 -26
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +59 -0
- package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +33 -0
- package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +11 -0
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +39 -0
- package/dist/types/components/business-forms/utils/payload-parsers.d.ts +4 -0
- package/dist/types/components/checkout/checkout-actions.d.ts +17 -0
- package/dist/types/components/checkout/checkout-core.d.ts +28 -0
- package/dist/types/components/checkout/checkout.d.ts +12 -0
- package/dist/types/components/checkout/new-payment-method.d.ts +17 -0
- package/dist/types/components/checkout/payment-method-option-utils.d.ts +16 -0
- package/dist/types/components/checkout/payment-method-options.d.ts +18 -0
- package/dist/types/components/checkout/saved-payment-method.d.ts +11 -0
- package/dist/types/components/checkout/test/checkout.d.ts +1 -0
- package/dist/types/components/checkout/test/mockCheckout.d.ts +19 -0
- package/dist/types/components/details/utils.d.ts +1 -1
- package/dist/types/components/form/form.d.ts +1 -1
- package/dist/types/components/form/utils.d.ts +1 -0
- package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +11 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +18 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -14
- package/dist/types/components/payment-details/payment-details.d.ts +0 -1
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +3 -9
- package/dist/types/components.d.ts +626 -91
- package/dist/types/utils/utils.d.ts +3 -0
- package/dist/webcomponents/p-0399f02b.entry.js +1 -0
- package/dist/webcomponents/{p-6478f3ca.js → p-04a98c63.js} +1 -1
- package/dist/webcomponents/p-06888c2e.entry.js +1 -0
- package/dist/webcomponents/{p-234bc840.entry.js → p-07b326d0.entry.js} +1 -1
- package/dist/webcomponents/p-0811bc77.entry.js +1 -0
- package/dist/webcomponents/p-0923e39c.js +1 -0
- package/dist/webcomponents/p-17d72f4a.js +1 -0
- package/dist/webcomponents/p-17f64853.entry.js +1 -0
- package/dist/webcomponents/p-1bfadb9f.entry.js +1 -0
- package/dist/webcomponents/p-22085999.entry.js +1 -0
- package/dist/webcomponents/p-252835df.entry.js +1 -0
- package/dist/webcomponents/{p-22c1acd6.js → p-28b38699.js} +1 -1
- package/dist/webcomponents/p-34352d04.js +1 -0
- package/dist/webcomponents/p-374c44e6.entry.js +1 -0
- package/dist/webcomponents/{p-0a0cf2e6.entry.js → p-4697ccfa.entry.js} +1 -1
- package/dist/webcomponents/p-4781cd06.js +1 -0
- package/dist/webcomponents/{p-4c01df65.entry.js → p-4d50d08a.entry.js} +1 -1
- package/dist/webcomponents/p-4d806131.entry.js +1 -0
- package/dist/webcomponents/{p-7a1a06c0.entry.js → p-4df6174c.entry.js} +1 -1
- package/dist/webcomponents/p-4e0b3206.entry.js +1 -0
- package/dist/webcomponents/{p-4ee44c76.entry.js → p-583dd5a2.entry.js} +1 -1
- package/dist/webcomponents/p-5be4e217.entry.js +1 -0
- package/dist/webcomponents/p-5da4fbe7.entry.js +1 -0
- package/dist/webcomponents/{p-40349ffc.entry.js → p-6103c20d.entry.js} +1 -1
- package/dist/webcomponents/p-63296409.js +1 -0
- package/dist/webcomponents/{p-5c0310ee.js → p-65510838.js} +1 -1
- package/dist/webcomponents/p-688bb5da.js +2 -0
- package/dist/webcomponents/p-6b51cf97.entry.js +1 -0
- package/dist/webcomponents/p-7654c70d.entry.js +1 -0
- package/dist/webcomponents/p-7b2cddc7.js +1 -0
- package/dist/webcomponents/p-847441ce.entry.js +1 -0
- package/dist/webcomponents/p-861ba3fc.entry.js +1 -0
- package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
- package/dist/webcomponents/p-975ab96e.js +1 -0
- package/dist/webcomponents/p-9ce8d98c.entry.js +1 -0
- package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
- package/dist/webcomponents/p-a141c531.js +1 -0
- package/dist/webcomponents/p-a2dbe90f.entry.js +1 -0
- package/dist/webcomponents/{p-4fa27a28.entry.js → p-a46174e0.entry.js} +1 -1
- package/dist/webcomponents/p-a98eea84.entry.js +1 -0
- package/dist/webcomponents/p-b1bc23af.entry.js +1 -0
- package/dist/webcomponents/p-b27c9b0d.entry.js +1 -0
- package/dist/webcomponents/{p-7c0f91fa.entry.js → p-b68f1dd9.entry.js} +1 -1
- package/dist/webcomponents/p-b8f22856.js +1 -0
- package/dist/webcomponents/p-c8d62072.entry.js +1 -0
- package/dist/webcomponents/{p-08833966.entry.js → p-da34bba7.entry.js} +1 -1
- package/dist/webcomponents/p-e3748ea4.entry.js +1 -0
- package/dist/webcomponents/p-e3fab0e2.js +1 -0
- package/dist/webcomponents/p-e924f2e1.entry.js +1 -0
- package/dist/webcomponents/p-ebf7c70f.entry.js +1 -0
- package/dist/webcomponents/p-eef5ed19.entry.js +1 -0
- package/dist/webcomponents/p-efc7025c.entry.js +1 -0
- package/dist/webcomponents/p-f3453ca2.js +1 -0
- package/dist/webcomponents/p-f3ca6fda.entry.js +1 -0
- package/dist/webcomponents/p-fb49ef28.entry.js +1 -0
- package/dist/webcomponents/p-fe2af0cf.entry.js +19 -0
- package/dist/webcomponents/p-fe8a94c1.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/BusinessFormEventTypes-863f48e9.js +0 -42
- package/dist/cjs/business-form-schema-37e5381d.js +0 -148
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +0 -1747
- package/dist/collection/components/business-form/BusinessFormEventTypes.js +0 -6
- package/dist/collection/components/business-form/business-address/business-address-form-schema.js +0 -13
- package/dist/collection/components/business-form/business-form-schema.js +0 -159
- package/dist/collection/components/business-form/business-form-stepped.js +0 -260
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +0 -77
- package/dist/collection/components/business-form/business-representative/business-representative-schema.js +0 -1
- package/dist/collection/components/business-form/helpers.js +0 -23
- package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +0 -10
- package/dist/esm/BusinessFormEventTypes-989960ba.js +0 -39
- package/dist/esm/business-form-schema-f8f554d1.js +0 -144
- package/dist/esm/justifi-payment-method-form.entry.js +0 -1743
- package/dist/module/BusinessFormEventTypes.js +0 -39
- package/dist/module/business-generic-info.js +0 -210
- package/dist/module/justifi-business-generic-info.d.ts +0 -11
- package/dist/module/justifi-business-generic-info.js +0 -6
- package/dist/types/components/business-form/BusinessFormEventTypes.d.ts +0 -5
- package/dist/types/components/business-form/business-form-stepped.d.ts +0 -48
- package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +0 -17
- package/dist/types/components/business-form/helpers.d.ts +0 -1
- package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +0 -17
- package/dist/webcomponents/p-081cf5f6.entry.js +0 -1
- package/dist/webcomponents/p-0bc8b02e.entry.js +0 -1
- package/dist/webcomponents/p-112acd3c.entry.js +0 -1
- package/dist/webcomponents/p-1555e6b1.js +0 -1
- package/dist/webcomponents/p-16f41fd0.entry.js +0 -1
- package/dist/webcomponents/p-17715325.js +0 -1
- package/dist/webcomponents/p-3a4d4869.entry.js +0 -1
- package/dist/webcomponents/p-3cb0b96d.js +0 -1
- package/dist/webcomponents/p-4ba2c711.entry.js +0 -1
- package/dist/webcomponents/p-4f14df36.js +0 -2
- package/dist/webcomponents/p-5422a24b.entry.js +0 -1
- package/dist/webcomponents/p-578e0a05.entry.js +0 -1
- package/dist/webcomponents/p-640d90dc.entry.js +0 -1
- package/dist/webcomponents/p-663bfe87.js +0 -1
- package/dist/webcomponents/p-696396c7.entry.js +0 -1
- package/dist/webcomponents/p-6ab67031.entry.js +0 -1
- package/dist/webcomponents/p-6d0725ef.entry.js +0 -1
- package/dist/webcomponents/p-810b72b5.js +0 -1
- package/dist/webcomponents/p-8516d602.entry.js +0 -1
- package/dist/webcomponents/p-894a7475.entry.js +0 -19
- package/dist/webcomponents/p-94ebfafb.entry.js +0 -1
- package/dist/webcomponents/p-9cb3ff78.entry.js +0 -1
- package/dist/webcomponents/p-9e81808f.entry.js +0 -1
- package/dist/webcomponents/p-a432110c.entry.js +0 -1
- package/dist/webcomponents/p-b1881723.entry.js +0 -1
- package/dist/webcomponents/p-b5aba473.entry.js +0 -1
- package/dist/webcomponents/p-b8a8b551.js +0 -1
- package/dist/webcomponents/p-bd099662.entry.js +0 -1
- package/dist/webcomponents/p-bfd917b8.entry.js +0 -1
- package/dist/webcomponents/p-c90fa055.entry.js +0 -1
- package/dist/webcomponents/p-ebb91944.entry.js +0 -1
- package/dist/webcomponents/p-ec4f27e7.entry.js +0 -1
- package/dist/webcomponents/p-fa495a43.entry.js +0 -1
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.e2e.js +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.spec.js +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-form.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/test/business-form.spec.js +0 -0
- /package/dist/collection/components/{business-form/business-address/business-address-form.css → business-forms/business-form-stepped/business-address/business-address-form-step.css} +0 -0
- /package/dist/collection/components/{business-form/business-generic-info/business-generic-info.css → business-forms/business-form-stepped/business-core-info/business-core-info-form-step.css} +0 -0
- /package/dist/collection/components/{business-form/business-owners/business-owners.css → business-forms/business-form-stepped/business-owners/business-owners-form-step.css} +0 -0
- /package/dist/collection/components/{business-form/business-representative/business-representative.css → business-forms/business-form-stepped/business-representative/business-representative-form-step.css} +0 -0
- /package/dist/collection/components/{business-form/legal-address-form/legal-address-form.css → business-forms/business-form-stepped/legal-address-form/legal-address-form-step.css} +0 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { FormController } from "../../../form/form";
|
|
3
|
+
import { Api } from "../../../../api";
|
|
4
|
+
import { config } from "../../../../../config";
|
|
5
|
+
import { additionQuestionsSchema } from "../../schemas/business-additional-questions-schema";
|
|
6
|
+
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
7
|
+
/**
|
|
8
|
+
* @exportedPart label: Label for inputs
|
|
9
|
+
* @exportedPart input: The input fields
|
|
10
|
+
* @exportedPart input-invalid: Invalid state for inputfs
|
|
11
|
+
*/
|
|
12
|
+
export class AdditionalQuestionsFormStep {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.fetchData = async () => {
|
|
15
|
+
this.formLoading.emit(true);
|
|
16
|
+
try {
|
|
17
|
+
const response = await this.api.get(this.businessEndpoint);
|
|
18
|
+
this.additional_questions = response.data.additional_questions;
|
|
19
|
+
this.formController.setInitialValues(this.additional_questions);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
this.formLoading.emit(false);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.sendData = async (onSuccess) => {
|
|
29
|
+
this.formLoading.emit(true);
|
|
30
|
+
try {
|
|
31
|
+
const payload = this.formController.values.getValue();
|
|
32
|
+
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ additional_questions: payload }));
|
|
33
|
+
this.handleResponse(response, onSuccess);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.patchData });
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
this.formLoading.emit(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
this.inputHandler = (name, value) => {
|
|
43
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
44
|
+
};
|
|
45
|
+
this.authToken = undefined;
|
|
46
|
+
this.businessId = undefined;
|
|
47
|
+
this.formController = undefined;
|
|
48
|
+
this.errors = {};
|
|
49
|
+
this.additional_questions = {};
|
|
50
|
+
}
|
|
51
|
+
get businessEndpoint() {
|
|
52
|
+
return `entities/business/${this.businessId}`;
|
|
53
|
+
}
|
|
54
|
+
handleResponse(response, onSuccess) {
|
|
55
|
+
if (response.error) {
|
|
56
|
+
this.serverError.emit({ data: response.error, message: BusinessFormServerErrors.patchData });
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
onSuccess();
|
|
60
|
+
}
|
|
61
|
+
this.submitted.emit({ data: response, metadata: { completedStep: 'additionalQuestions' } });
|
|
62
|
+
}
|
|
63
|
+
async validateAndSubmit({ onSuccess }) {
|
|
64
|
+
this.formController.validateAndSubmit(() => this.sendData(onSuccess));
|
|
65
|
+
}
|
|
66
|
+
;
|
|
67
|
+
componentWillLoad() {
|
|
68
|
+
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
69
|
+
const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
|
|
70
|
+
if (!this.authToken)
|
|
71
|
+
console.error(missingAuthTokenMessage);
|
|
72
|
+
if (!this.businessId)
|
|
73
|
+
console.error(missingBusinessIdMessage);
|
|
74
|
+
this.formController = new FormController(additionQuestionsSchema);
|
|
75
|
+
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
76
|
+
this.fetchData();
|
|
77
|
+
}
|
|
78
|
+
componentDidLoad() {
|
|
79
|
+
this.formController.values.subscribe(values => this.additional_questions = Object.assign({}, values));
|
|
80
|
+
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
var _a, _b, _c, _d;
|
|
84
|
+
const additionalQuestionsDefaultValue = this.formController.getInitialValues();
|
|
85
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Additional Questions"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-monetary", { name: "business_revenue", label: "Business Revenue", inputHandler: this.inputHandler, error: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue })), h("div", { class: "col-12" }, h("form-control-monetary", { name: "business_payment_volume", label: "Business Payment Volume", inputHandler: this.inputHandler, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume })), h("div", { class: "col-12" }, h("form-control-monetary", { name: "business_dispute_volume", label: "Business Dispute Volume", inputHandler: this.inputHandler, error: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_dispute_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_dispute_volume })), h("div", { class: "col-12" }, h("form-control-monetary", { name: "business_receivable_volume", label: "Business Receivable Volume", inputHandler: this.inputHandler, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_receivable_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_receivable_volume })))))));
|
|
86
|
+
}
|
|
87
|
+
static get is() { return "justifi-additional-questions-form-step"; }
|
|
88
|
+
static get properties() {
|
|
89
|
+
return {
|
|
90
|
+
"authToken": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "string",
|
|
95
|
+
"resolved": "string",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": ""
|
|
103
|
+
},
|
|
104
|
+
"attribute": "auth-token",
|
|
105
|
+
"reflect": false
|
|
106
|
+
},
|
|
107
|
+
"businessId": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": ""
|
|
120
|
+
},
|
|
121
|
+
"attribute": "business-id",
|
|
122
|
+
"reflect": false
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get states() {
|
|
127
|
+
return {
|
|
128
|
+
"formController": {},
|
|
129
|
+
"errors": {},
|
|
130
|
+
"additional_questions": {}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
static get events() {
|
|
134
|
+
return [{
|
|
135
|
+
"method": "submitted",
|
|
136
|
+
"name": "submitted",
|
|
137
|
+
"bubbles": true,
|
|
138
|
+
"cancelable": true,
|
|
139
|
+
"composed": true,
|
|
140
|
+
"docs": {
|
|
141
|
+
"tags": [],
|
|
142
|
+
"text": ""
|
|
143
|
+
},
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "BusinessFormSubmitEvent",
|
|
146
|
+
"resolved": "BusinessFormSubmitEvent",
|
|
147
|
+
"references": {
|
|
148
|
+
"BusinessFormSubmitEvent": {
|
|
149
|
+
"location": "import",
|
|
150
|
+
"path": "../../utils/business-form-types",
|
|
151
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, {
|
|
156
|
+
"method": "formLoading",
|
|
157
|
+
"name": "formLoading",
|
|
158
|
+
"bubbles": true,
|
|
159
|
+
"cancelable": true,
|
|
160
|
+
"composed": true,
|
|
161
|
+
"docs": {
|
|
162
|
+
"tags": [],
|
|
163
|
+
"text": ""
|
|
164
|
+
},
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "boolean",
|
|
167
|
+
"resolved": "boolean",
|
|
168
|
+
"references": {}
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
"method": "serverError",
|
|
172
|
+
"name": "serverError",
|
|
173
|
+
"bubbles": true,
|
|
174
|
+
"cancelable": true,
|
|
175
|
+
"composed": true,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": ""
|
|
179
|
+
},
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "BusinessFormServerErrorEvent",
|
|
182
|
+
"resolved": "BusinessFormServerErrorEvent",
|
|
183
|
+
"references": {
|
|
184
|
+
"BusinessFormServerErrorEvent": {
|
|
185
|
+
"location": "import",
|
|
186
|
+
"path": "../../utils/business-form-types",
|
|
187
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormServerErrorEvent"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}];
|
|
192
|
+
}
|
|
193
|
+
static get methods() {
|
|
194
|
+
return {
|
|
195
|
+
"validateAndSubmit": {
|
|
196
|
+
"complexType": {
|
|
197
|
+
"signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
|
|
198
|
+
"parameters": [{
|
|
199
|
+
"name": "__0",
|
|
200
|
+
"type": "{ onSuccess: any; }",
|
|
201
|
+
"docs": ""
|
|
202
|
+
}],
|
|
203
|
+
"references": {
|
|
204
|
+
"Promise": {
|
|
205
|
+
"location": "global",
|
|
206
|
+
"id": "global::Promise"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"return": "Promise<void>"
|
|
210
|
+
},
|
|
211
|
+
"docs": {
|
|
212
|
+
"text": "",
|
|
213
|
+
"tags": []
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { AdditionalQuestionsFormStep } from "../business-additional-questions-form-step";
|
|
3
|
+
describe.skip('justifi-additional-questions-form-step', () => {
|
|
4
|
+
let consoleSpy;
|
|
5
|
+
// Initialize the spy in the beforeEach
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
8
|
+
});
|
|
9
|
+
// Restore the original function in the afterEach
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
consoleSpy.mockRestore();
|
|
12
|
+
});
|
|
13
|
+
it('should log a warning if no authToken is provided', async () => {
|
|
14
|
+
await newSpecPage({
|
|
15
|
+
components: [AdditionalQuestionsFormStep],
|
|
16
|
+
html: `<justifi-additional-questions-form-step></justifi-additional-questions-form-step>`,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
it('should log a warning if no businessId is provided', async () => {
|
|
20
|
+
await newSpecPage({
|
|
21
|
+
components: [AdditionalQuestionsFormStep],
|
|
22
|
+
html: `<justifi-additional-questions-form-step></justifi-additional-questions-form-step>`,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it('should emit server error event if server error when fetching data', async () => {
|
|
26
|
+
await newSpecPage({
|
|
27
|
+
components: [AdditionalQuestionsFormStep],
|
|
28
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('should emit server error event if server error when patching data', async () => {
|
|
32
|
+
await newSpecPage({
|
|
33
|
+
components: [AdditionalQuestionsFormStep],
|
|
34
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('should render', async () => {
|
|
38
|
+
await newSpecPage({
|
|
39
|
+
components: [AdditionalQuestionsFormStep],
|
|
40
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('should call fetchData if rendered with valid props', async () => {
|
|
44
|
+
await newSpecPage({
|
|
45
|
+
components: [AdditionalQuestionsFormStep],
|
|
46
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it('should populate inputs with data from fetchData', async () => {
|
|
50
|
+
await newSpecPage({
|
|
51
|
+
components: [AdditionalQuestionsFormStep],
|
|
52
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('should instantiate new Form Controller on load', async () => {
|
|
56
|
+
await newSpecPage({
|
|
57
|
+
components: [AdditionalQuestionsFormStep],
|
|
58
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
it('should fire form controller validation when called', async () => {
|
|
62
|
+
await newSpecPage({
|
|
63
|
+
components: [AdditionalQuestionsFormStep],
|
|
64
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
it('should only call submit after validate returns true', async () => {
|
|
68
|
+
await newSpecPage({
|
|
69
|
+
components: [AdditionalQuestionsFormStep],
|
|
70
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
it('should call sendData when submit is called', async () => {
|
|
74
|
+
await newSpecPage({
|
|
75
|
+
components: [AdditionalQuestionsFormStep],
|
|
76
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it('should send correct data payload', async () => {
|
|
80
|
+
await newSpecPage({
|
|
81
|
+
components: [AdditionalQuestionsFormStep],
|
|
82
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
it('should emit submitted event when sendData resolves', async () => {
|
|
86
|
+
await newSpecPage({
|
|
87
|
+
components: [AdditionalQuestionsFormStep],
|
|
88
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
it('should emit formLoading event when data is being sent or fetched', async () => {
|
|
92
|
+
await newSpecPage({
|
|
93
|
+
components: [AdditionalQuestionsFormStep],
|
|
94
|
+
html: `<justifi-additional-questions-form-step business-id="biz_123" auth-token="some-token"></justifi-additional-questions-form-step>`,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import StateOptions from "../../../billing-form/state-options";
|
|
3
|
+
export class BusinessAddressFormStep {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.handleFormUpdate = undefined;
|
|
6
|
+
this.errors = undefined;
|
|
7
|
+
this.defaultValues = undefined;
|
|
8
|
+
this.address = {};
|
|
9
|
+
}
|
|
10
|
+
handleAddressChange(newValues) {
|
|
11
|
+
this.handleFormUpdate(newValues);
|
|
12
|
+
}
|
|
13
|
+
inputHandler(name, value) {
|
|
14
|
+
this.address[name] = value;
|
|
15
|
+
this.address = Object.assign({}, this.address);
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "line1", label: "Street Address", defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "line2", label: "Apartment, Suite, etc. (optional)", defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, error: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "state", label: "State", defaultValue: (_g = this.defaultValues) === null || _g === void 0 ? void 0 : _g.state, options: StateOptions, error: (_h = this.errors) === null || _h === void 0 ? void 0 : _h.state, inputHandler: (name, value) => this.inputHandler(name, value) })), h("div", { class: "col-12 col-md-6" }, h("form-control-number", { name: "postal_code", label: "Postal Code", defaultValue: (_j = this.defaultValues) === null || _j === void 0 ? void 0 : _j.postal_code, error: (_k = this.errors) === null || _k === void 0 ? void 0 : _k.postal_code, inputHandler: (name, value) => this.inputHandler(name, value) })))));
|
|
20
|
+
}
|
|
21
|
+
static get is() { return "justifi-business-address-form-step"; }
|
|
22
|
+
static get encapsulation() { return "shadow"; }
|
|
23
|
+
static get originalStyleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["business-address-form-step.scss"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static get styleUrls() {
|
|
29
|
+
return {
|
|
30
|
+
"$": ["business-address-form-step.css"]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static get properties() {
|
|
34
|
+
return {
|
|
35
|
+
"handleFormUpdate": {
|
|
36
|
+
"type": "unknown",
|
|
37
|
+
"mutable": false,
|
|
38
|
+
"complexType": {
|
|
39
|
+
"original": "(values: any) => void",
|
|
40
|
+
"resolved": "(values: any) => void",
|
|
41
|
+
"references": {}
|
|
42
|
+
},
|
|
43
|
+
"required": false,
|
|
44
|
+
"optional": false,
|
|
45
|
+
"docs": {
|
|
46
|
+
"tags": [],
|
|
47
|
+
"text": ""
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"errors": {
|
|
51
|
+
"type": "any",
|
|
52
|
+
"mutable": false,
|
|
53
|
+
"complexType": {
|
|
54
|
+
"original": "any",
|
|
55
|
+
"resolved": "any",
|
|
56
|
+
"references": {}
|
|
57
|
+
},
|
|
58
|
+
"required": false,
|
|
59
|
+
"optional": false,
|
|
60
|
+
"docs": {
|
|
61
|
+
"tags": [],
|
|
62
|
+
"text": ""
|
|
63
|
+
},
|
|
64
|
+
"attribute": "errors",
|
|
65
|
+
"reflect": false
|
|
66
|
+
},
|
|
67
|
+
"defaultValues": {
|
|
68
|
+
"type": "any",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "any",
|
|
72
|
+
"resolved": "any",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"attribute": "default-values",
|
|
82
|
+
"reflect": false
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static get states() {
|
|
87
|
+
return {
|
|
88
|
+
"address": {}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
static get watchers() {
|
|
92
|
+
return [{
|
|
93
|
+
"propName": "address",
|
|
94
|
+
"methodName": "handleAddressChange"
|
|
95
|
+
}];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { BusinessAddressFormStep } from "../business-address-form-step";
|
|
3
|
+
describe.skip('justifi-business-address-form-step', () => {
|
|
4
|
+
let consoleSpy;
|
|
5
|
+
// Initialize the spy in the beforeEach
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
consoleSpy = jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
8
|
+
});
|
|
9
|
+
// Restore the original function in the afterEach
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
consoleSpy.mockRestore();
|
|
12
|
+
});
|
|
13
|
+
it('should log a warning if no authToken is provided', async () => {
|
|
14
|
+
await newSpecPage({
|
|
15
|
+
components: [BusinessAddressFormStep],
|
|
16
|
+
html: `<justifi-business-address-form-step></justifi-business-address-form-step>`,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
it('should log a warning if no businessId is provided', async () => {
|
|
20
|
+
await newSpecPage({
|
|
21
|
+
components: [BusinessAddressFormStep],
|
|
22
|
+
html: `<justifi-business-address-form-step></justifi-business-address-form-step>`,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it('should emit server error event if server error when fetching data', async () => {
|
|
26
|
+
await newSpecPage({
|
|
27
|
+
components: [BusinessAddressFormStep],
|
|
28
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('should emit server error event if server error when patching data', async () => {
|
|
32
|
+
await newSpecPage({
|
|
33
|
+
components: [BusinessAddressFormStep],
|
|
34
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('should render', async () => {
|
|
38
|
+
await newSpecPage({
|
|
39
|
+
components: [BusinessAddressFormStep],
|
|
40
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('should call fetchData if rendered with valid props', async () => {
|
|
44
|
+
await newSpecPage({
|
|
45
|
+
components: [BusinessAddressFormStep],
|
|
46
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it('should populate inputs with data from fetchData', async () => {
|
|
50
|
+
await newSpecPage({
|
|
51
|
+
components: [BusinessAddressFormStep],
|
|
52
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('should instantiate new Form Controller on load', async () => {
|
|
56
|
+
await newSpecPage({
|
|
57
|
+
components: [BusinessAddressFormStep],
|
|
58
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
it('should fire form controller validation when called', async () => {
|
|
62
|
+
await newSpecPage({
|
|
63
|
+
components: [BusinessAddressFormStep],
|
|
64
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
it('should only call submit after validate returns true', async () => {
|
|
68
|
+
await newSpecPage({
|
|
69
|
+
components: [BusinessAddressFormStep],
|
|
70
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
it('should call sendData when submit is called', async () => {
|
|
74
|
+
await newSpecPage({
|
|
75
|
+
components: [BusinessAddressFormStep],
|
|
76
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it('should send correct data payload', async () => {
|
|
80
|
+
await newSpecPage({
|
|
81
|
+
components: [BusinessAddressFormStep],
|
|
82
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
it('should emit submitted event when sendData resolves', async () => {
|
|
86
|
+
await newSpecPage({
|
|
87
|
+
components: [BusinessAddressFormStep],
|
|
88
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
it('should emit formLoading event when data is being sent or fetched', async () => {
|
|
92
|
+
await newSpecPage({
|
|
93
|
+
components: [BusinessAddressFormStep],
|
|
94
|
+
html: `<justifi-business-address-form-step business-id="biz_123" auth-token="some-token"></justifi-business-address-form-step>`,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
});
|