@justifi/webcomponents 4.9.1 → 4.10.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-64dffab7.js → Business-663db337.js} +13 -1
- package/dist/cjs/Identity-1c4528b8.js +49 -0
- package/dist/cjs/{SubAccount-f8144025.js → SubAccount-05867651.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +4 -3
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
- package/dist/cjs/business-details-core.cjs.entry.js +2 -2
- 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 +68 -78
- package/dist/cjs/form-control-monetary.cjs.entry.js +20 -18
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +50 -3
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +4 -3
- package/dist/cjs/{index-07ddbad2.js → index-69b9386b.js} +57 -0
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +506 -0
- package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +14 -42
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +5 -6
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
- package/dist/cjs/justifi-business-details.cjs.entry.js +5 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +18 -15
- package/dist/cjs/justifi-business-list.cjs.entry.js +4 -3
- 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 +3 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +1 -1
- package/dist/cjs/justifi-owner-form.cjs.entry.js +162 -0
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +3 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +89 -0
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +3 -2
- package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +5 -4
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/payload-parsers-9e72e80f.js +99 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +4 -3
- package/dist/cjs/payments-list-core.cjs.entry.js +3 -2
- package/dist/cjs/payout-details-core.cjs.entry.js +4 -3
- package/dist/cjs/payouts-list-core.cjs.entry.js +3 -2
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +4 -3
- package/dist/cjs/subaccount-bank-details.cjs.entry.js +2 -2
- package/dist/cjs/subaccount-terms-details.cjs.entry.js +2 -2
- package/dist/cjs/{utils-5c3e442d.js → utils-23e70ef2.js} +1 -1
- package/dist/cjs/{utils-84208d99.js → utils-2b9940e1.js} +25 -0
- package/dist/cjs/utils-df5167a8.js +13 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Business.js +10 -1
- package/dist/collection/api/Identity.js +43 -0
- package/dist/collection/collection-manifest.json +15 -8
- package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
- package/dist/collection/components/billing-form/billing-form.js +1 -1
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +4 -4
- package/dist/collection/components/business-details/owner-details/owner-details.js +2 -2
- package/dist/collection/components/business-details/representative-details/representative-details.js +2 -2
- package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
- 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.js +77 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
- package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
- package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
- 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/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/payment-provisioning/additional-questions/business-additional-questions-form-step.js +219 -0
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +2536 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +239 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/test/business-core-info-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.css +7779 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +284 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/test/business-owners-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +231 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/test/business-representative-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +233 -0
- package/dist/collection/components/{business-form/business-form-stepped.css → business-forms/payment-provisioning/payment-provisioning.css} +105 -0
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +199 -0
- package/dist/collection/components/business-forms/payment-provisioning/test/payment-provisioning.spec.js +61 -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 +16 -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/form/form-control-datepart.js +39 -34
- package/dist/collection/components/form/form-control-monetary.js +22 -20
- package/dist/collection/components/form/form-control-number.js +1 -0
- package/dist/collection/components/form/form-control-select.js +3 -1
- package/dist/collection/components/form/form-control-text.js +2 -1
- package/dist/collection/components/form/test/form-control-datepart.spec.js +88 -0
- package/dist/collection/components/form/test/form-control-monetary.spec.js +69 -0
- package/dist/collection/components/form/test/form-control-number.spec.js +77 -0
- package/dist/collection/components/form/test/form-control-select.spec.js +84 -0
- package/dist/collection/components/form/test/form-control-text.spec.js +104 -0
- package/dist/collection/components/form/test/form.spec.js +60 -0
- package/dist/collection/components/form/utils.js +1 -0
- package/dist/collection/utils/utils.js +21 -0
- package/dist/docs.json +1943 -552
- package/dist/esm/{Business-9921d35f.js → Business-6cc4e473.js} +12 -2
- package/dist/esm/Identity-5f8f916f.js +46 -0
- package/dist/esm/{SubAccount-76f6d565.js → SubAccount-61ac70eb.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +4 -3
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
- package/dist/esm/business-details-core.entry.js +2 -2
- 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 +68 -78
- package/dist/esm/form-control-monetary.entry.js +20 -18
- package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +50 -4
- package/dist/esm/gross-payment-chart-core.entry.js +4 -3
- package/dist/esm/{index-fb5ca346.js → index-df86d9a2.js} +57 -0
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +498 -0
- package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +14 -41
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/justifi-billing-form_4.entry.js +4 -5
- package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
- package/dist/esm/justifi-business-details.entry.js +5 -3
- package/dist/esm/justifi-business-form.entry.js +17 -14
- package/dist/esm/justifi-business-list.entry.js +4 -3
- 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 +3 -2
- package/dist/esm/justifi-checkout.entry.js +1 -1
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-new-payment-method_3.entry.js +1 -1
- package/dist/esm/justifi-owner-form.entry.js +158 -0
- package/dist/esm/justifi-payment-balance-transactions.entry.js +3 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-form.entry.js +3 -2
- package/dist/esm/justifi-payment-method-selector.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +85 -0
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-proceeds-list.entry.js +3 -2
- package/dist/esm/justifi-refund-form.entry.js +1 -1
- package/dist/esm/justifi-subaccount-details.entry.js +5 -4
- package/dist/esm/justifi-subaccounts-list.entry.js +4 -3
- package/dist/esm/justifi-table_2.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/payload-parsers-caea809d.js +91 -0
- package/dist/esm/payment-details-core.entry.js +4 -3
- package/dist/esm/payments-list-core.entry.js +3 -2
- package/dist/esm/payout-details-core.entry.js +4 -3
- package/dist/esm/payouts-list-core.entry.js +3 -2
- package/dist/esm/subaccount-account-details_4.entry.js +4 -3
- package/dist/esm/subaccount-bank-details.entry.js +2 -2
- package/dist/esm/subaccount-terms-details.entry.js +2 -2
- package/dist/esm/utils-2828201a.js +10 -0
- package/dist/esm/{utils-a3e96d9f.js → utils-d01c5f3a.js} +1 -1
- package/dist/esm/{utils-5193fcd7.js → utils-d9e90399.js} +23 -1
- package/dist/esm/webcomponents.js +3 -3
- package/dist/module/Business.js +12 -2
- package/dist/module/Identity.js +46 -0
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/billing-form.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +121 -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 +19 -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-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/{webcomponents/p-f64a85cf.entry.js → module/business-owners-form-step.js} +214 -1
- package/dist/module/business-representative-form-step.js +158 -0
- package/dist/module/business-representative.js +1 -1
- package/dist/module/checkout-core.js +1 -1
- package/dist/module/form-control-datepart2.js +37 -33
- package/dist/module/form-control-monetary2.js +20 -18
- package/dist/module/form-control-number2.js +1 -0
- package/dist/module/form-control-select2.js +3 -1
- package/dist/module/form-control-text2.js +2 -1
- 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-form.js +19 -14
- package/dist/module/justifi-business-list.js +1 -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-legal-address-form-step.d.ts +11 -0
- package/dist/module/justifi-legal-address-form-step.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 +1 -1
- package/dist/module/justifi-payment-provisioning.d.ts +11 -0
- package/dist/module/justifi-payment-provisioning.js +190 -0
- package/dist/module/justifi-proceeds-list.js +1 -1
- package/dist/module/justifi-subaccount-details.js +1 -1
- package/dist/module/justifi-subaccounts-list.js +1 -1
- package/dist/module/legal-address-form-step.js +137 -0
- package/dist/module/owner-form.js +222 -0
- package/dist/module/payload-parsers.js +39 -0
- package/dist/module/payment-details-core2.js +1 -1
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payments-list-core2.js +1 -1
- package/dist/module/payout-details-core2.js +1 -1
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/subaccount-merchant-details2.js +1 -1
- package/dist/module/utils2.js +23 -1
- package/dist/module/utils4.js +10 -0
- package/dist/types/api/Business.d.ts +11 -21
- package/dist/types/api/Identity.d.ts +60 -0
- package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
- package/dist/types/components/business-details/additional-questions-details/additional-questions-details.d.ts +2 -2
- package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -1
- 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/owner-form/owner-form.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +31 -0
- package/dist/types/components/business-forms/payment-provisioning/business-address/business-address-form-step.d.ts +9 -0
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +27 -0
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +31 -0
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +45 -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/form/form-control-datepart.d.ts +2 -1
- package/dist/types/components/form/form-control-monetary.d.ts +2 -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.d.ts +463 -113
- package/dist/types/utils/utils.d.ts +3 -0
- package/dist/webcomponents/p-03b1d0d5.entry.js +1 -0
- package/dist/webcomponents/{p-adc96df1.entry.js → p-07b326d0.entry.js} +1 -1
- package/dist/webcomponents/p-0e189d6a.entry.js +1 -0
- package/dist/webcomponents/p-16dcf053.entry.js +1 -0
- package/dist/webcomponents/p-17d72f4a.js +1 -0
- package/dist/webcomponents/{p-97c42345.entry.js → p-1bfadb9f.entry.js} +1 -1
- package/dist/webcomponents/p-221b9504.entry.js +1 -0
- package/dist/webcomponents/p-2df32b4a.entry.js +1 -0
- package/dist/webcomponents/{p-baafa7f5.js → p-34352d04.js} +1 -1
- package/dist/webcomponents/p-38ba2848.entry.js +1 -0
- package/dist/webcomponents/p-3d4aaa4a.entry.js +1 -0
- package/dist/webcomponents/p-41870765.entry.js +1 -0
- package/dist/webcomponents/p-461f42b8.entry.js +1 -0
- package/dist/webcomponents/p-48c2400e.js +1 -0
- package/dist/webcomponents/p-491ca87f.js +1 -0
- package/dist/webcomponents/{p-dc05b5c5.entry.js → p-4d50d08a.entry.js} +1 -1
- package/dist/webcomponents/{p-09b94d22.entry.js → p-4df6174c.entry.js} +1 -1
- package/dist/webcomponents/{p-c032b216.entry.js → p-5be4e217.entry.js} +1 -1
- package/dist/webcomponents/p-60714f2a.entry.js +1 -0
- package/dist/webcomponents/p-60b2344a.js +1 -0
- package/dist/webcomponents/{p-9e3771b7.entry.js → p-65500b31.entry.js} +1 -1
- package/dist/webcomponents/p-688bb5da.js +2 -0
- package/dist/webcomponents/{p-92a55427.entry.js → p-6b51cf97.entry.js} +1 -1
- package/dist/webcomponents/p-6d39b8bc.entry.js +1 -0
- package/dist/webcomponents/p-7ec301b5.entry.js +1 -0
- package/dist/webcomponents/p-817211f2.entry.js +1 -0
- package/dist/webcomponents/{p-bb037696.js → p-8482c23f.js} +1 -1
- package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
- package/dist/webcomponents/p-975ab96e.js +1 -0
- package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
- package/dist/webcomponents/p-a141c531.js +1 -0
- package/dist/webcomponents/{p-e536a4c1.entry.js → p-a2dbe90f.entry.js} +1 -1
- package/dist/webcomponents/p-a4122c35.entry.js +1 -0
- package/dist/webcomponents/{p-591e29bf.entry.js → p-a46174e0.entry.js} +1 -1
- package/dist/webcomponents/{p-1cbdca15.entry.js → p-a68519e5.entry.js} +1 -1
- package/dist/webcomponents/p-af8363a1.entry.js +1 -0
- package/dist/webcomponents/{p-bb7f6095.entry.js → p-b1bc23af.entry.js} +1 -1
- package/dist/webcomponents/p-b37d6888.entry.js +1 -0
- package/dist/webcomponents/p-b5a3bf86.entry.js +1 -0
- package/dist/webcomponents/{p-7cd06ada.entry.js → p-b68f1dd9.entry.js} +1 -1
- package/dist/webcomponents/p-b8f22856.js +1 -0
- package/dist/webcomponents/p-cb8f9cb8.entry.js +1 -0
- package/dist/webcomponents/p-d0761829.entry.js +1 -0
- package/dist/webcomponents/{p-c2c3d5d1.entry.js → p-da34bba7.entry.js} +1 -1
- package/dist/webcomponents/p-dbe32e75.entry.js +1 -0
- package/dist/webcomponents/p-e0c1cba8.js +1 -0
- package/dist/webcomponents/{p-99a8b7d0.entry.js → p-e924f2e1.entry.js} +1 -1
- package/dist/webcomponents/p-ea03b424.entry.js +1 -0
- package/dist/webcomponents/{p-9c310f5c.entry.js → p-ebf7c70f.entry.js} +1 -1
- package/dist/webcomponents/p-ec230480.entry.js +1 -0
- package/dist/webcomponents/p-eed5f4ad.entry.js +1 -0
- package/dist/webcomponents/{p-9a63eec9.entry.js → p-fb49ef28.entry.js} +1 -1
- package/dist/webcomponents/{p-41490d96.entry.js → p-fe8a94c1.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/BusinessFormEventTypes-62990815.js +0 -42
- package/dist/cjs/business-form-schema-37e5381d.js +0 -148
- package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +0 -143
- 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-182e20be.js +0 -39
- package/dist/esm/business-form-schema-f8f554d1.js +0 -144
- package/dist/esm/justifi-business-form-stepped.entry.js +0 -139
- package/dist/module/BusinessFormEventTypes.js +0 -39
- package/dist/module/business-generic-info.js +0 -210
- package/dist/module/justifi-business-form-stepped.d.ts +0 -11
- package/dist/module/justifi-business-form-stepped.js +0 -231
- 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-018b71f5.entry.js +0 -1
- package/dist/webcomponents/p-1b04d091.entry.js +0 -1
- package/dist/webcomponents/p-1bac1674.entry.js +0 -1
- package/dist/webcomponents/p-2f0653f4.entry.js +0 -1
- package/dist/webcomponents/p-3134ab82.entry.js +0 -1
- package/dist/webcomponents/p-34f9fe6b.js +0 -1
- package/dist/webcomponents/p-3bae0ed3.entry.js +0 -1
- package/dist/webcomponents/p-41031759.entry.js +0 -1
- package/dist/webcomponents/p-4ed3a9f5.entry.js +0 -1
- package/dist/webcomponents/p-4edd9721.js +0 -1
- package/dist/webcomponents/p-51b0bf2a.entry.js +0 -1
- package/dist/webcomponents/p-531844f6.entry.js +0 -1
- package/dist/webcomponents/p-5d5d7550.entry.js +0 -1
- package/dist/webcomponents/p-5ea274b8.js +0 -1
- package/dist/webcomponents/p-5f785ede.entry.js +0 -1
- package/dist/webcomponents/p-6d05174c.js +0 -2
- package/dist/webcomponents/p-72d1ad98.entry.js +0 -1
- package/dist/webcomponents/p-796cf44f.entry.js +0 -1
- package/dist/webcomponents/p-8f895ec3.entry.js +0 -1
- package/dist/webcomponents/p-a81229a5.entry.js +0 -1
- package/dist/webcomponents/p-b8a8b551.js +0 -1
- package/dist/webcomponents/p-babd292f.entry.js +0 -1
- package/dist/webcomponents/p-c8d51336.entry.js +0 -1
- package/dist/webcomponents/p-e6939585.entry.js +0 -1
- package/dist/webcomponents/p-ec358d69.entry.js +0 -1
- package/dist/webcomponents/p-f55ac955.entry.js +0 -1
- /package/dist/cjs/{state-options-96d05a98.js → state-options-4fbcb48a.js} +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.css +0 -0
- /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-generic-info/business-generic-info.css → business-forms/business-form/business-core-info/business-core-info.css} +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}/business-owners/business-owners.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-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/billing-form → utils}/state-options.js +0 -0
- /package/dist/esm/{state-options-fc1daf67.js → state-options-a356fb11.js} +0 -0
- /package/dist/types/{components/billing-form → utils}/state-options.d.ts +0 -0
- /package/dist/webcomponents/{p-8e2a88a8.js → p-6078a370.js} +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { FormController } from "../../../form/form";
|
|
3
|
+
import Api from "../../../../api/Api";
|
|
4
|
+
import { Address } from "../../../../api/Business";
|
|
5
|
+
import { parseAddressInfo } from "../../utils/payload-parsers";
|
|
6
|
+
import { legalAddressSchema } from "../../schemas/business-address-schema";
|
|
7
|
+
import { config } from "../../../../../config";
|
|
8
|
+
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
9
|
+
import StateOptions from "../../../../utils/state-options";
|
|
10
|
+
/**
|
|
11
|
+
* @exportedPart label: Label for inputs
|
|
12
|
+
* @exportedPart input: The input fields
|
|
13
|
+
* @exportedPart input-invalid: Invalid state for inputfs
|
|
14
|
+
*/
|
|
15
|
+
export class LegalAddressFormStep {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.fetchData = async () => {
|
|
18
|
+
this.formLoading.emit(true);
|
|
19
|
+
try {
|
|
20
|
+
const response = await this.api.get(this.businessEndpoint);
|
|
21
|
+
this.legal_address = new Address(response.data.legal_address || {});
|
|
22
|
+
this.formController.setInitialValues(Object.assign({}, this.legal_address));
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
this.formLoading.emit(false);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.sendData = async (onSuccess) => {
|
|
32
|
+
this.formLoading.emit(true);
|
|
33
|
+
try {
|
|
34
|
+
const payload = parseAddressInfo(this.formController.values.getValue());
|
|
35
|
+
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ legal_address: payload }));
|
|
36
|
+
this.handleResponse(response, onSuccess);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.patchData });
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
this.formLoading.emit(false);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
this.inputHandler = (name, value) => {
|
|
46
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
47
|
+
};
|
|
48
|
+
this.authToken = undefined;
|
|
49
|
+
this.businessId = undefined;
|
|
50
|
+
this.formController = undefined;
|
|
51
|
+
this.errors = {};
|
|
52
|
+
this.legal_address = {};
|
|
53
|
+
}
|
|
54
|
+
get businessEndpoint() {
|
|
55
|
+
return `entities/business/${this.businessId}`;
|
|
56
|
+
}
|
|
57
|
+
handleResponse(response, onSuccess) {
|
|
58
|
+
if (response.error) {
|
|
59
|
+
this.serverError.emit({ data: response.error, message: BusinessFormServerErrors.patchData });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
onSuccess();
|
|
63
|
+
}
|
|
64
|
+
this.submitted.emit({ data: response, metadata: { completedStep: 'legalAddress' } });
|
|
65
|
+
}
|
|
66
|
+
async validateAndSubmit({ onSuccess }) {
|
|
67
|
+
this.formController.validateAndSubmit(() => this.sendData(onSuccess));
|
|
68
|
+
}
|
|
69
|
+
;
|
|
70
|
+
componentWillLoad() {
|
|
71
|
+
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
72
|
+
const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
|
|
73
|
+
if (!this.authToken)
|
|
74
|
+
console.error(missingAuthTokenMessage);
|
|
75
|
+
if (!this.businessId)
|
|
76
|
+
console.error(missingBusinessIdMessage);
|
|
77
|
+
this.formController = new FormController(legalAddressSchema);
|
|
78
|
+
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
79
|
+
this.fetchData();
|
|
80
|
+
}
|
|
81
|
+
componentDidLoad() {
|
|
82
|
+
this.formController.values.subscribe(values => this.legal_address = Object.assign({}, values));
|
|
83
|
+
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
84
|
+
}
|
|
85
|
+
render() {
|
|
86
|
+
var _a, _b, _c, _d, _e;
|
|
87
|
+
const legalAddressDefaultValue = this.formController.getInitialValues();
|
|
88
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Business Legal Address"), h("hr", null), h("div", { class: "row gx-2 gy-2" }, h("div", { class: "col-12" }, h("form-control-text", { name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, error: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.line1 })), h("div", { class: "col-12" }, h("form-control-text", { name: "line2", label: "Address Line 2", inputHandler: (name, value) => this.inputHandler(name, value), defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2 })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.city })), h("div", { class: "col-12" }, h("form-control-select", { name: "state", label: "State", options: StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, error: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.state })), h("div", { class: "col-12" }, h("form-control-number", { name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.postal_code })), h("div", { class: "col-12" }, h("form-control-select", { name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, error: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.country,
|
|
89
|
+
// just for now so we skip handling country specificities
|
|
90
|
+
disabled: true })))))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "justifi-legal-address-form-step"; }
|
|
93
|
+
static get originalStyleUrls() {
|
|
94
|
+
return {
|
|
95
|
+
"$": ["legal-address-form-step.scss"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get styleUrls() {
|
|
99
|
+
return {
|
|
100
|
+
"$": ["legal-address-form-step.css"]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get properties() {
|
|
104
|
+
return {
|
|
105
|
+
"authToken": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "string",
|
|
110
|
+
"resolved": "string",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": ""
|
|
118
|
+
},
|
|
119
|
+
"attribute": "auth-token",
|
|
120
|
+
"reflect": false
|
|
121
|
+
},
|
|
122
|
+
"businessId": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "string",
|
|
127
|
+
"resolved": "string",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": ""
|
|
135
|
+
},
|
|
136
|
+
"attribute": "business-id",
|
|
137
|
+
"reflect": false
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
static get states() {
|
|
142
|
+
return {
|
|
143
|
+
"formController": {},
|
|
144
|
+
"errors": {},
|
|
145
|
+
"legal_address": {}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
static get events() {
|
|
149
|
+
return [{
|
|
150
|
+
"method": "submitted",
|
|
151
|
+
"name": "submitted",
|
|
152
|
+
"bubbles": true,
|
|
153
|
+
"cancelable": true,
|
|
154
|
+
"composed": true,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": ""
|
|
158
|
+
},
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "BusinessFormSubmitEvent",
|
|
161
|
+
"resolved": "BusinessFormSubmitEvent",
|
|
162
|
+
"references": {
|
|
163
|
+
"BusinessFormSubmitEvent": {
|
|
164
|
+
"location": "import",
|
|
165
|
+
"path": "../../utils/business-form-types",
|
|
166
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
"method": "formLoading",
|
|
172
|
+
"name": "formLoading",
|
|
173
|
+
"bubbles": true,
|
|
174
|
+
"cancelable": true,
|
|
175
|
+
"composed": true,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": ""
|
|
179
|
+
},
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "boolean",
|
|
182
|
+
"resolved": "boolean",
|
|
183
|
+
"references": {}
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
"method": "serverError",
|
|
187
|
+
"name": "serverError",
|
|
188
|
+
"bubbles": true,
|
|
189
|
+
"cancelable": true,
|
|
190
|
+
"composed": true,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": ""
|
|
194
|
+
},
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "BusinessFormServerErrorEvent",
|
|
197
|
+
"resolved": "BusinessFormServerErrorEvent",
|
|
198
|
+
"references": {
|
|
199
|
+
"BusinessFormServerErrorEvent": {
|
|
200
|
+
"location": "import",
|
|
201
|
+
"path": "../../utils/business-form-types",
|
|
202
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormServerErrorEvent"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}];
|
|
207
|
+
}
|
|
208
|
+
static get methods() {
|
|
209
|
+
return {
|
|
210
|
+
"validateAndSubmit": {
|
|
211
|
+
"complexType": {
|
|
212
|
+
"signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
|
|
213
|
+
"parameters": [{
|
|
214
|
+
"name": "__0",
|
|
215
|
+
"type": "{ onSuccess: any; }",
|
|
216
|
+
"docs": ""
|
|
217
|
+
}],
|
|
218
|
+
"references": {
|
|
219
|
+
"Promise": {
|
|
220
|
+
"location": "global",
|
|
221
|
+
"id": "global::Promise"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"return": "Promise<void>"
|
|
225
|
+
},
|
|
226
|
+
"docs": {
|
|
227
|
+
"text": "",
|
|
228
|
+
"tags": []
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -2536,6 +2536,68 @@ progress {
|
|
|
2536
2536
|
--bs-btn-border-radius: var(--bs-border-radius-sm);
|
|
2537
2537
|
}
|
|
2538
2538
|
|
|
2539
|
+
.spinner-grow,
|
|
2540
|
+
.spinner-border {
|
|
2541
|
+
display: inline-block;
|
|
2542
|
+
width: var(--bs-spinner-width);
|
|
2543
|
+
height: var(--bs-spinner-height);
|
|
2544
|
+
vertical-align: var(--bs-spinner-vertical-align);
|
|
2545
|
+
border-radius: 50%;
|
|
2546
|
+
animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
@keyframes spinner-border {
|
|
2550
|
+
to {
|
|
2551
|
+
transform: rotate(360deg) /* rtl:ignore */;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
.spinner-border {
|
|
2555
|
+
--bs-spinner-width: 2rem;
|
|
2556
|
+
--bs-spinner-height: 2rem;
|
|
2557
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
2558
|
+
--bs-spinner-border-width: 0.25em;
|
|
2559
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
2560
|
+
--bs-spinner-animation-name: spinner-border;
|
|
2561
|
+
border: var(--bs-spinner-border-width) solid currentcolor;
|
|
2562
|
+
border-right-color: transparent;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
.spinner-border-sm {
|
|
2566
|
+
--bs-spinner-width: 1rem;
|
|
2567
|
+
--bs-spinner-height: 1rem;
|
|
2568
|
+
--bs-spinner-border-width: 0.2em;
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
@keyframes spinner-grow {
|
|
2572
|
+
0% {
|
|
2573
|
+
transform: scale(0);
|
|
2574
|
+
}
|
|
2575
|
+
50% {
|
|
2576
|
+
opacity: 1;
|
|
2577
|
+
transform: none;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
.spinner-grow {
|
|
2581
|
+
--bs-spinner-width: 2rem;
|
|
2582
|
+
--bs-spinner-height: 2rem;
|
|
2583
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
2584
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
2585
|
+
--bs-spinner-animation-name: spinner-grow;
|
|
2586
|
+
background-color: currentcolor;
|
|
2587
|
+
opacity: 0;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
.spinner-grow-sm {
|
|
2591
|
+
--bs-spinner-width: 1rem;
|
|
2592
|
+
--bs-spinner-height: 1rem;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2596
|
+
.spinner-border,
|
|
2597
|
+
.spinner-grow {
|
|
2598
|
+
--bs-spinner-animation-speed: 1.5s;
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2539
2601
|
@keyframes progress-bar-stripes {
|
|
2540
2602
|
0% {
|
|
2541
2603
|
background-position-x: 1rem;
|
|
@@ -7933,4 +7995,47 @@ progress {
|
|
|
7933
7995
|
*::part(input-invalid):focus {
|
|
7934
7996
|
border-color: var(--jfi-form-control-border-color-error);
|
|
7935
7997
|
box-shadow: var(--jfi-form-control-box-shadow-error-focus);
|
|
7998
|
+
}
|
|
7999
|
+
|
|
8000
|
+
.jfi-submit-button {
|
|
8001
|
+
font-family: var(--jfi-layout-font-family);
|
|
8002
|
+
color: var(--jfi-submit-button-color);
|
|
8003
|
+
background-color: var(--jfi-submit-button-background-color);
|
|
8004
|
+
border-color: var(--jfi-submit-button-border-color);
|
|
8005
|
+
padding: var(--jfi-submit-button-padding);
|
|
8006
|
+
font-size: var(--jfi-submit-button-font-size);
|
|
8007
|
+
border-radius: var(--jfi-submit-button-border-radius);
|
|
8008
|
+
width: var(--jfi-submit-button-width);
|
|
8009
|
+
box-shadow: var(--jfi-submit-button-box-shadow);
|
|
8010
|
+
}
|
|
8011
|
+
|
|
8012
|
+
.jfi-submit-button:hover {
|
|
8013
|
+
color: var(--jfi-submit-button-color-hover);
|
|
8014
|
+
background-color: var(--jfi-submit-button-background-color-hover);
|
|
8015
|
+
border-color: var(--jfi-submit-button-border-color-hover);
|
|
8016
|
+
}
|
|
8017
|
+
|
|
8018
|
+
.jfi-submit-button:focus {
|
|
8019
|
+
color: var(--jfi-submit-button-color-focus);
|
|
8020
|
+
background-color: var(--jfi-submit-button-background-color-focus);
|
|
8021
|
+
border-color: var(--jfi-submit-button-border-color-focus);
|
|
8022
|
+
}
|
|
8023
|
+
|
|
8024
|
+
.btn.jfi-submit-button:active {
|
|
8025
|
+
color: var(--jfi-submit-button-color-active);
|
|
8026
|
+
background-color: var(--jfi-submit-button-background-color-active);
|
|
8027
|
+
border-color: var(--jfi-submit-button-border-color-active);
|
|
8028
|
+
}
|
|
8029
|
+
|
|
8030
|
+
.btn.jfi-submit-button-loading {
|
|
8031
|
+
min-width: 75px;
|
|
8032
|
+
color: var(--jfi-submit-button-color-loading);
|
|
8033
|
+
background-color: var(--jfi-submit-button-background-color-loading);
|
|
8034
|
+
border-color: var(--jfi-submit-button-border-color-loading);
|
|
8035
|
+
}
|
|
8036
|
+
|
|
8037
|
+
.btn.jfi-submit-button-loading .spinner-border {
|
|
8038
|
+
border-top-color: var(--jfi-submit-button-color-loading);
|
|
8039
|
+
border-bottom-color: var(--jfi-submit-button-color-loading);
|
|
8040
|
+
border-left-color: var(--jfi-submit-button-color-loading);
|
|
7936
8041
|
}
|
package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { FormAlert, LoadingSpinner } from "../../form/utils";
|
|
3
|
+
import { BusinessFormClickActions } from "../utils/business-form-types";
|
|
4
|
+
/**
|
|
5
|
+
* @exportedPart label: Label for inputs
|
|
6
|
+
* @exportedPart input: The input fields
|
|
7
|
+
* @exportedPart input-invalid: Invalid state for inputfs
|
|
8
|
+
*/
|
|
9
|
+
export class PaymentProvisioning {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.refs = [];
|
|
12
|
+
this.componentStepMapping = {
|
|
13
|
+
0: () => h("justifi-business-core-info-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[0] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
|
|
14
|
+
1: () => h("justifi-legal-address-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[1] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
|
|
15
|
+
2: () => h("justifi-additional-questions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[2] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
|
|
16
|
+
3: () => h("justifi-business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
|
|
17
|
+
4: () => h("justifi-business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el, onFormLoading: (e) => this.handleFormLoading(e), onServerError: (e) => this.handleServerErrors(e) }),
|
|
18
|
+
};
|
|
19
|
+
this.incrementSteps = () => {
|
|
20
|
+
if (this.currentStep < this.totalSteps) {
|
|
21
|
+
return this.currentStep++;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.decrementSteps = () => { return this.currentStep--; };
|
|
25
|
+
this.authToken = undefined;
|
|
26
|
+
this.businessId = undefined;
|
|
27
|
+
this.testMode = false;
|
|
28
|
+
this.hideErrors = false;
|
|
29
|
+
this.formLoading = false;
|
|
30
|
+
this.errorMessage = '';
|
|
31
|
+
this.currentStep = 0;
|
|
32
|
+
this.totalSteps = 5;
|
|
33
|
+
}
|
|
34
|
+
get showErrors() {
|
|
35
|
+
return this.errorMessage && !this.hideErrors;
|
|
36
|
+
}
|
|
37
|
+
get businessEndpoint() {
|
|
38
|
+
return `entities/business/${this.businessId}`;
|
|
39
|
+
}
|
|
40
|
+
componentWillLoad() {
|
|
41
|
+
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
42
|
+
const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
|
|
43
|
+
if (!this.authToken)
|
|
44
|
+
console.error(missingAuthTokenMessage);
|
|
45
|
+
if (!this.businessId)
|
|
46
|
+
console.error(missingBusinessIdMessage);
|
|
47
|
+
this.refs = [this.coreInfoRef, this.legalAddressRef, this.additionalQuestionsRef, this.representativeRef, this.ownersRef];
|
|
48
|
+
this.totalSteps = Object.keys(this.componentStepMapping).length - 1;
|
|
49
|
+
}
|
|
50
|
+
handleFormLoading(e) {
|
|
51
|
+
this.formLoading = e.detail;
|
|
52
|
+
}
|
|
53
|
+
handleServerErrors(e) {
|
|
54
|
+
this.errorMessage = e.detail.message;
|
|
55
|
+
}
|
|
56
|
+
showPreviousStepButton() {
|
|
57
|
+
return this.currentStep > 0;
|
|
58
|
+
}
|
|
59
|
+
showNextStepButton() {
|
|
60
|
+
return this.currentStep < this.totalSteps;
|
|
61
|
+
}
|
|
62
|
+
previousStepButtonOnClick() {
|
|
63
|
+
this.clickEvent.emit({ name: BusinessFormClickActions.previousStep });
|
|
64
|
+
const currentStep = this.refs[this.currentStep];
|
|
65
|
+
currentStep.validateAndSubmit({ onSuccess: this.decrementSteps });
|
|
66
|
+
}
|
|
67
|
+
nextStepButtonOnClick(e, clickEventName) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
this.clickEvent.emit({ name: clickEventName });
|
|
70
|
+
const currentStep = this.refs[this.currentStep];
|
|
71
|
+
currentStep.validateAndSubmit({ onSuccess: this.incrementSteps });
|
|
72
|
+
}
|
|
73
|
+
showSubmitButton() {
|
|
74
|
+
return this.currentStep === this.totalSteps;
|
|
75
|
+
}
|
|
76
|
+
currentStepComponent() {
|
|
77
|
+
return this.componentStepMapping[this.currentStep]();
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("h1", null, "Business Information"), this.showErrors && FormAlert(this.errorMessage), h("div", { class: "my-4" }, this.currentStepComponent()), h("div", { class: "d-flex justify-content-between align-items-center" }, h("div", { class: "d-flex align-items-center" }, "Step ", this.currentStep + 1, " of ", this.totalSteps + 1), h("div", { class: "d-flex gap-2" }, this.showPreviousStepButton() && (h("button", { type: "button", class: "btn btn-secondary", onClick: () => this.previousStepButtonOnClick(), disabled: this.formLoading }, "Previous")), this.showNextStepButton() && (h("button", { type: "button", class: `btn btn-primary jfi-submit-button${this.formLoading ? ' jfi-submit-button-loading' : ''}`, onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.nextStep), disabled: this.formLoading }, this.formLoading ? LoadingSpinner() : 'Next')), this.showSubmitButton() && (h("button", { type: "submit", class: `btn btn-primary jfi-submit-button${this.formLoading ? ' jfi-submit-button-loading' : ''}`, onClick: (e) => this.nextStepButtonOnClick(e, BusinessFormClickActions.submit), disabled: this.formLoading }, this.formLoading ? LoadingSpinner() : 'Submit'))))));
|
|
81
|
+
}
|
|
82
|
+
static get is() { return "justifi-payment-provisioning"; }
|
|
83
|
+
static get originalStyleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["payment-provisioning.scss"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get styleUrls() {
|
|
89
|
+
return {
|
|
90
|
+
"$": ["payment-provisioning.css"]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static get properties() {
|
|
94
|
+
return {
|
|
95
|
+
"authToken": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": ""
|
|
108
|
+
},
|
|
109
|
+
"attribute": "auth-token",
|
|
110
|
+
"reflect": false
|
|
111
|
+
},
|
|
112
|
+
"businessId": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": ""
|
|
125
|
+
},
|
|
126
|
+
"attribute": "business-id",
|
|
127
|
+
"reflect": false
|
|
128
|
+
},
|
|
129
|
+
"testMode": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "boolean",
|
|
134
|
+
"resolved": "boolean",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": ""
|
|
142
|
+
},
|
|
143
|
+
"attribute": "test-mode",
|
|
144
|
+
"reflect": false,
|
|
145
|
+
"defaultValue": "false"
|
|
146
|
+
},
|
|
147
|
+
"hideErrors": {
|
|
148
|
+
"type": "boolean",
|
|
149
|
+
"mutable": false,
|
|
150
|
+
"complexType": {
|
|
151
|
+
"original": "boolean",
|
|
152
|
+
"resolved": "boolean",
|
|
153
|
+
"references": {}
|
|
154
|
+
},
|
|
155
|
+
"required": false,
|
|
156
|
+
"optional": true,
|
|
157
|
+
"docs": {
|
|
158
|
+
"tags": [],
|
|
159
|
+
"text": ""
|
|
160
|
+
},
|
|
161
|
+
"attribute": "hide-errors",
|
|
162
|
+
"reflect": false,
|
|
163
|
+
"defaultValue": "false"
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
static get states() {
|
|
168
|
+
return {
|
|
169
|
+
"formLoading": {},
|
|
170
|
+
"errorMessage": {},
|
|
171
|
+
"currentStep": {},
|
|
172
|
+
"totalSteps": {}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
static get events() {
|
|
176
|
+
return [{
|
|
177
|
+
"method": "clickEvent",
|
|
178
|
+
"name": "clickEvent",
|
|
179
|
+
"bubbles": true,
|
|
180
|
+
"cancelable": true,
|
|
181
|
+
"composed": true,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "BusinessFormClickEvent",
|
|
188
|
+
"resolved": "BusinessFormClickEvent",
|
|
189
|
+
"references": {
|
|
190
|
+
"BusinessFormClickEvent": {
|
|
191
|
+
"location": "import",
|
|
192
|
+
"path": "../utils/business-form-types",
|
|
193
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormClickEvent"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { PaymentProvisioning } from "../payment-provisioning";
|
|
3
|
+
describe.skip('justifi-payment-provisioning', () => {
|
|
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: [PaymentProvisioning],
|
|
16
|
+
html: `<justifi-payment-provisioning></justifi-payment-provisioning>`,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
it('should log a warning if no businessId is provided', async () => {
|
|
20
|
+
await newSpecPage({
|
|
21
|
+
components: [PaymentProvisioning],
|
|
22
|
+
html: `<justifi-payment-provisioning></justifi-payment-provisioning>`,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
it('should emit server error event if server error when fetching data', async () => {
|
|
26
|
+
await newSpecPage({
|
|
27
|
+
components: [PaymentProvisioning],
|
|
28
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('should emit server error event if server error when patching data', async () => {
|
|
32
|
+
await newSpecPage({
|
|
33
|
+
components: [PaymentProvisioning],
|
|
34
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
it('should render', async () => {
|
|
38
|
+
await newSpecPage({
|
|
39
|
+
components: [PaymentProvisioning],
|
|
40
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('should call onSuccess when a step is successfully completed', async () => {
|
|
44
|
+
await newSpecPage({
|
|
45
|
+
components: [PaymentProvisioning],
|
|
46
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it('should emit clickEvent when a button is clicked', async () => {
|
|
50
|
+
await newSpecPage({
|
|
51
|
+
components: [PaymentProvisioning],
|
|
52
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
it('should emit submitted event when a step is completed', async () => {
|
|
56
|
+
await newSpecPage({
|
|
57
|
+
components: [PaymentProvisioning],
|
|
58
|
+
html: `<justifi-payment-provisioning business-id="biz_123" auth-token="some-token"></justifi-payment-provisioning>`,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { object, string } from "yup";
|
|
2
|
+
export const additionQuestionsSchema = object({
|
|
3
|
+
business_revenue: string().required('Enter business revenue'),
|
|
4
|
+
business_payment_volume: string().required('Enter business payment volume'),
|
|
5
|
+
business_dispute_volume: string().required('Enter business dispute volume'),
|
|
6
|
+
business_receivable_volume: string().required('Enter business receivable volume'),
|
|
7
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { object, string } from "yup";
|
|
2
|
+
import StateOptions from "../../../utils/state-options";
|
|
3
|
+
export const legalAddressSchema = object({
|
|
4
|
+
line1: string().required('Enter street address'),
|
|
5
|
+
line2: string().nullable(),
|
|
6
|
+
city: string().required('Enter city'),
|
|
7
|
+
state: string().required('Select state').oneOf(StateOptions.map((option) => option.value), 'Select state'),
|
|
8
|
+
postal_code: string().required('Enter postal code'),
|
|
9
|
+
country: string().required('Select country'),
|
|
10
|
+
});
|
|
11
|
+
export const identityAddressSchema = object({
|
|
12
|
+
line1: string().required('Enter street address'),
|
|
13
|
+
city: string().required('Enter city'),
|
|
14
|
+
state: string().required('Select state').oneOf(StateOptions.map((option) => option.value), 'Select state'),
|
|
15
|
+
postal_code: string().required('Enter postal code'),
|
|
16
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { object, string } from "yup";
|
|
2
|
+
export const businessCoreInfoSchema = object({
|
|
3
|
+
legal_name: string().required('Enter legal name'),
|
|
4
|
+
website_url: string()
|
|
5
|
+
.url('Enter valid website url')
|
|
6
|
+
.required('Enter website url'),
|
|
7
|
+
email: string().email('Enter valid email').required('Enter email'),
|
|
8
|
+
phone: string().required('Enter phone number'),
|
|
9
|
+
doing_business_as: string().required('Enter doing business as'),
|
|
10
|
+
business_type: string().required('Select business type'),
|
|
11
|
+
business_structure: string().required('Select business structure'),
|
|
12
|
+
industry: string().required('Enter a business industry'),
|
|
13
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { object } from "yup";
|
|
2
|
+
import { businessCoreInfoSchema } from "./business-core-info-schema";
|
|
3
|
+
import { additionQuestionsSchema } from "./business-additional-questions-schema";
|
|
4
|
+
import { representativeSchema } from "./business-identity-schema";
|
|
5
|
+
import { legalAddressSchema } from "./business-address-schema";
|
|
6
|
+
export const businessFormSchema = object(Object.assign(Object.assign({}, businessCoreInfoSchema.fields), { legal_address: legalAddressSchema, additional_questions: additionQuestionsSchema, representative: representativeSchema }));
|