@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,367 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { FormController } from "../../form/form";
|
|
3
|
+
import { PHONE_MASKS } from "../../../utils/form-input-masks";
|
|
4
|
+
import { Api } from "../../../api";
|
|
5
|
+
import { Owner } from "../../../api/Identity";
|
|
6
|
+
import { parseIdentityInfo } from "../utils/payload-parsers";
|
|
7
|
+
import { ownerSchema } from "../schemas/business-identity-schema";
|
|
8
|
+
import { config } from "../../../../config";
|
|
9
|
+
import { LoadingSpinner } from "../../form/utils";
|
|
10
|
+
import { OwnerFormServerErrors } from "../utils/business-form-types";
|
|
11
|
+
export class BusinessOwnerForm {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.fetchData = async () => {
|
|
14
|
+
if (!this.ownerId) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this.isLoading = true;
|
|
18
|
+
try {
|
|
19
|
+
const response = await this.api.get(this.identityEndpoint);
|
|
20
|
+
this.owner = Object.assign({}, new Owner(response.data));
|
|
21
|
+
this.formController.setInitialValues(this.owner);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
this.serverError.emit({ data: error, message: OwnerFormServerErrors.fetchData });
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
this.isLoading = false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.sendData = async () => {
|
|
31
|
+
this.isLoading = true;
|
|
32
|
+
try {
|
|
33
|
+
if (this.ownerId) {
|
|
34
|
+
const payload = parseIdentityInfo(this.formController.values.getValue());
|
|
35
|
+
const response = await this.api.patch(this.identityEndpoint, JSON.stringify(payload));
|
|
36
|
+
return this.handleResponse(response);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const payload = Object.assign(Object.assign({}, parseIdentityInfo(this.formController.values.getValue())), { business_id: this.businessId });
|
|
40
|
+
const response = await this.api.post(this.identityEndpoint, JSON.stringify(payload));
|
|
41
|
+
this.ownerId = response.data.id;
|
|
42
|
+
return this.handleResponse(response);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.warn(error);
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
this.isLoading = false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
this.inputHandler = (name, value) => {
|
|
53
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
54
|
+
};
|
|
55
|
+
this.onAddressFormUpdate = (values) => {
|
|
56
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
|
|
57
|
+
};
|
|
58
|
+
this.validateAndSubmit = (event) => {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
const isValid = this.formController.validate();
|
|
61
|
+
if (isValid) {
|
|
62
|
+
this.submit();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
this.authToken = undefined;
|
|
66
|
+
this.ownerId = undefined;
|
|
67
|
+
this.businessId = undefined;
|
|
68
|
+
this.removeOwner = undefined;
|
|
69
|
+
this.newFormOpen = undefined;
|
|
70
|
+
this.ownersLength = undefined;
|
|
71
|
+
this.isLoading = false;
|
|
72
|
+
this.formController = undefined;
|
|
73
|
+
this.errors = {};
|
|
74
|
+
this.owner = {};
|
|
75
|
+
}
|
|
76
|
+
get identityEndpoint() {
|
|
77
|
+
return this.ownerId ? `entities/identity/${this.ownerId}` : 'entities/identity';
|
|
78
|
+
}
|
|
79
|
+
get formTitle() {
|
|
80
|
+
return this.ownerId ? 'Edit Business Owner' : 'Add Business Owner';
|
|
81
|
+
}
|
|
82
|
+
get submitButtonText() {
|
|
83
|
+
return this.ownerId ? 'Update' : 'Add';
|
|
84
|
+
}
|
|
85
|
+
get showRemoveButton() {
|
|
86
|
+
const blankForm = !this.ownerId && this.newFormOpen;
|
|
87
|
+
if (this.ownersLength <= 1) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
if (blankForm) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
else if (this.ownerId && !this.newFormOpen) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
loadingWatcher() {
|
|
100
|
+
this.formLoading.emit(this.isLoading);
|
|
101
|
+
}
|
|
102
|
+
handleResponse(response) {
|
|
103
|
+
this.submitted.emit({ data: response, metadata: { ownerId: this.ownerId } });
|
|
104
|
+
let errorMessage = this.ownerId ? OwnerFormServerErrors.patchData : OwnerFormServerErrors.postData;
|
|
105
|
+
if (response.error) {
|
|
106
|
+
this.serverError.emit({ data: response.error, message: errorMessage });
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
componentWillLoad() {
|
|
114
|
+
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
115
|
+
if (!this.authToken)
|
|
116
|
+
console.error(missingAuthTokenMessage);
|
|
117
|
+
this.formController = new FormController(ownerSchema);
|
|
118
|
+
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
119
|
+
this.fetchData();
|
|
120
|
+
}
|
|
121
|
+
componentDidLoad() {
|
|
122
|
+
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
123
|
+
this.formController.values.subscribe(values => (this.owner = Object.assign({}, values)));
|
|
124
|
+
}
|
|
125
|
+
async validate() {
|
|
126
|
+
return this.formController.validate();
|
|
127
|
+
}
|
|
128
|
+
async submit() {
|
|
129
|
+
return this.sendData();
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
const ownerDefaultValue = this.formController.getInitialValues();
|
|
133
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("fieldset", null, h("legend", null, this.formTitle), h("div", { class: 'row gy-3' }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-select", { name: "title", label: "Prefix", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.title, options: [
|
|
134
|
+
{ label: 'Select Prefix', value: '' },
|
|
135
|
+
{ label: 'Mrs.', value: 'Mrs.' },
|
|
136
|
+
], error: this.errors.title, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { class: "col-12" }, h("label", { part: "label", class: "form-label" }, "Birth Date")), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_day", label: "Day", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.dob_day, error: this.errors.dob_day, inputHandler: this.inputHandler, type: "day" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_month", label: "Month", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.dob_month, error: this.errors.dob_month, inputHandler: this.inputHandler, type: "month" })), h("div", { class: "col-12 col-md-4" }, h("form-control-datepart", { name: "dob_year", label: "Year", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.dob_year, error: this.errors.dob_year, inputHandler: this.inputHandler, type: "year" })), h("div", { class: "col-12" }, h("form-control-number", { name: "identification_number", label: "EIN/SSN", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.identification_number, error: this.errors.identification_number, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("justifi-business-address-form", { errors: this.errors.address, defaultValues: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.address, handleFormUpdate: values => this.onAddressFormUpdate(values) })), h("div", { class: "container d-flex gap-2" }, h("button", { type: "submit", class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}`, disabled: this.isLoading }, this.isLoading ? LoadingSpinner() : this.submitButtonText), this.showRemoveButton &&
|
|
137
|
+
h("button", { type: "button", class: "btn btn-danger", onClick: () => this.removeOwner(this.ownerId) }, "Remove owner"))), h("hr", null)))));
|
|
138
|
+
}
|
|
139
|
+
static get is() { return "justifi-owner-form"; }
|
|
140
|
+
static get encapsulation() { return "shadow"; }
|
|
141
|
+
static get originalStyleUrls() {
|
|
142
|
+
return {
|
|
143
|
+
"$": ["owner-form.scss"]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
static get styleUrls() {
|
|
147
|
+
return {
|
|
148
|
+
"$": ["owner-form.css"]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
static get properties() {
|
|
152
|
+
return {
|
|
153
|
+
"authToken": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string",
|
|
158
|
+
"resolved": "string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": ""
|
|
166
|
+
},
|
|
167
|
+
"attribute": "auth-token",
|
|
168
|
+
"reflect": false
|
|
169
|
+
},
|
|
170
|
+
"ownerId": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"mutable": false,
|
|
173
|
+
"complexType": {
|
|
174
|
+
"original": "string",
|
|
175
|
+
"resolved": "string",
|
|
176
|
+
"references": {}
|
|
177
|
+
},
|
|
178
|
+
"required": false,
|
|
179
|
+
"optional": true,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": ""
|
|
183
|
+
},
|
|
184
|
+
"attribute": "owner-id",
|
|
185
|
+
"reflect": false
|
|
186
|
+
},
|
|
187
|
+
"businessId": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"mutable": false,
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "string",
|
|
192
|
+
"resolved": "string",
|
|
193
|
+
"references": {}
|
|
194
|
+
},
|
|
195
|
+
"required": false,
|
|
196
|
+
"optional": true,
|
|
197
|
+
"docs": {
|
|
198
|
+
"tags": [],
|
|
199
|
+
"text": ""
|
|
200
|
+
},
|
|
201
|
+
"attribute": "business-id",
|
|
202
|
+
"reflect": false
|
|
203
|
+
},
|
|
204
|
+
"removeOwner": {
|
|
205
|
+
"type": "unknown",
|
|
206
|
+
"mutable": false,
|
|
207
|
+
"complexType": {
|
|
208
|
+
"original": "(id: string) => void",
|
|
209
|
+
"resolved": "(id: string) => void",
|
|
210
|
+
"references": {}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": ""
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"newFormOpen": {
|
|
220
|
+
"type": "boolean",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "boolean",
|
|
224
|
+
"resolved": "boolean",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": true,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": ""
|
|
232
|
+
},
|
|
233
|
+
"attribute": "new-form-open",
|
|
234
|
+
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"ownersLength": {
|
|
237
|
+
"type": "number",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "number",
|
|
241
|
+
"resolved": "number",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": true,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": ""
|
|
249
|
+
},
|
|
250
|
+
"attribute": "owners-length",
|
|
251
|
+
"reflect": false
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
static get states() {
|
|
256
|
+
return {
|
|
257
|
+
"isLoading": {},
|
|
258
|
+
"formController": {},
|
|
259
|
+
"errors": {},
|
|
260
|
+
"owner": {}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
static get events() {
|
|
264
|
+
return [{
|
|
265
|
+
"method": "submitted",
|
|
266
|
+
"name": "submitted",
|
|
267
|
+
"bubbles": true,
|
|
268
|
+
"cancelable": true,
|
|
269
|
+
"composed": true,
|
|
270
|
+
"docs": {
|
|
271
|
+
"tags": [],
|
|
272
|
+
"text": ""
|
|
273
|
+
},
|
|
274
|
+
"complexType": {
|
|
275
|
+
"original": "OwnerFormSubmitEvent",
|
|
276
|
+
"resolved": "OwnerFormSubmitEvent",
|
|
277
|
+
"references": {
|
|
278
|
+
"OwnerFormSubmitEvent": {
|
|
279
|
+
"location": "import",
|
|
280
|
+
"path": "../utils/business-form-types",
|
|
281
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormSubmitEvent"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}, {
|
|
286
|
+
"method": "formLoading",
|
|
287
|
+
"name": "formLoading",
|
|
288
|
+
"bubbles": true,
|
|
289
|
+
"cancelable": true,
|
|
290
|
+
"composed": true,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": ""
|
|
294
|
+
},
|
|
295
|
+
"complexType": {
|
|
296
|
+
"original": "boolean",
|
|
297
|
+
"resolved": "boolean",
|
|
298
|
+
"references": {}
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
"method": "serverError",
|
|
302
|
+
"name": "serverError",
|
|
303
|
+
"bubbles": true,
|
|
304
|
+
"cancelable": true,
|
|
305
|
+
"composed": true,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "OwnerFormServerErrorEvent",
|
|
312
|
+
"resolved": "OwnerFormServerErrorEvent",
|
|
313
|
+
"references": {
|
|
314
|
+
"OwnerFormServerErrorEvent": {
|
|
315
|
+
"location": "import",
|
|
316
|
+
"path": "../utils/business-form-types",
|
|
317
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormServerErrorEvent"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}];
|
|
322
|
+
}
|
|
323
|
+
static get methods() {
|
|
324
|
+
return {
|
|
325
|
+
"validate": {
|
|
326
|
+
"complexType": {
|
|
327
|
+
"signature": "() => Promise<boolean>",
|
|
328
|
+
"parameters": [],
|
|
329
|
+
"references": {
|
|
330
|
+
"Promise": {
|
|
331
|
+
"location": "global",
|
|
332
|
+
"id": "global::Promise"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"return": "Promise<boolean>"
|
|
336
|
+
},
|
|
337
|
+
"docs": {
|
|
338
|
+
"text": "",
|
|
339
|
+
"tags": []
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
"submit": {
|
|
343
|
+
"complexType": {
|
|
344
|
+
"signature": "() => Promise<boolean>",
|
|
345
|
+
"parameters": [],
|
|
346
|
+
"references": {
|
|
347
|
+
"Promise": {
|
|
348
|
+
"location": "global",
|
|
349
|
+
"id": "global::Promise"
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"return": "Promise<boolean>"
|
|
353
|
+
},
|
|
354
|
+
"docs": {
|
|
355
|
+
"text": "",
|
|
356
|
+
"tags": []
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
static get watchers() {
|
|
362
|
+
return [{
|
|
363
|
+
"propName": "isLoading",
|
|
364
|
+
"methodName": "loadingWatcher"
|
|
365
|
+
}];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { FormController } from "../../../form/form";
|
|
3
|
+
import { AdditionalQuestions } from "../../../../api/Business";
|
|
4
|
+
import { Api } from "../../../../api";
|
|
5
|
+
import { config } from "../../../../../config";
|
|
6
|
+
import { additionQuestionsSchema } from "../../schemas/business-additional-questions-schema";
|
|
7
|
+
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
8
|
+
/**
|
|
9
|
+
* @exportedPart label: Label for inputs
|
|
10
|
+
* @exportedPart input: The input fields
|
|
11
|
+
* @exportedPart input-invalid: Invalid state for inputfs
|
|
12
|
+
*/
|
|
13
|
+
export class AdditionalQuestionsFormStep {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.fetchData = async () => {
|
|
16
|
+
this.formLoading.emit(true);
|
|
17
|
+
try {
|
|
18
|
+
const response = await this.api.get(this.businessEndpoint);
|
|
19
|
+
this.additional_questions = new AdditionalQuestions(response.data.additional_questions || {});
|
|
20
|
+
this.formController.setInitialValues(Object.assign({}, this.additional_questions));
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
this.formLoading.emit(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this.sendData = async (onSuccess) => {
|
|
30
|
+
this.formLoading.emit(true);
|
|
31
|
+
try {
|
|
32
|
+
const payload = this.formController.values.getValue();
|
|
33
|
+
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ additional_questions: payload }));
|
|
34
|
+
this.handleResponse(response, onSuccess);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
this.serverError.emit({ data: error, message: BusinessFormServerErrors.patchData });
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
this.formLoading.emit(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
this.inputHandler = (name, value) => {
|
|
44
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
45
|
+
};
|
|
46
|
+
this.authToken = undefined;
|
|
47
|
+
this.businessId = undefined;
|
|
48
|
+
this.formController = undefined;
|
|
49
|
+
this.errors = {};
|
|
50
|
+
this.additional_questions = {};
|
|
51
|
+
}
|
|
52
|
+
get businessEndpoint() {
|
|
53
|
+
return `entities/business/${this.businessId}`;
|
|
54
|
+
}
|
|
55
|
+
handleResponse(response, onSuccess) {
|
|
56
|
+
if (response.error) {
|
|
57
|
+
this.serverError.emit({ data: response.error, message: BusinessFormServerErrors.patchData });
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
onSuccess();
|
|
61
|
+
}
|
|
62
|
+
this.submitted.emit({ data: response, metadata: { completedStep: 'additionalQuestions' } });
|
|
63
|
+
}
|
|
64
|
+
async validateAndSubmit({ onSuccess }) {
|
|
65
|
+
this.formController.validateAndSubmit(() => this.sendData(onSuccess));
|
|
66
|
+
}
|
|
67
|
+
;
|
|
68
|
+
componentWillLoad() {
|
|
69
|
+
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
70
|
+
const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
|
|
71
|
+
if (!this.authToken)
|
|
72
|
+
console.error(missingAuthTokenMessage);
|
|
73
|
+
if (!this.businessId)
|
|
74
|
+
console.error(missingBusinessIdMessage);
|
|
75
|
+
this.formController = new FormController(additionQuestionsSchema);
|
|
76
|
+
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
77
|
+
this.fetchData();
|
|
78
|
+
}
|
|
79
|
+
componentDidLoad() {
|
|
80
|
+
this.formController.values.subscribe(values => this.additional_questions = Object.assign({}, values));
|
|
81
|
+
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
var _a, _b, _c, _d;
|
|
85
|
+
const additionalQuestionsDefaultValue = this.formController.getInitialValues();
|
|
86
|
+
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 })))))));
|
|
87
|
+
}
|
|
88
|
+
static get is() { return "justifi-additional-questions-form-step"; }
|
|
89
|
+
static get properties() {
|
|
90
|
+
return {
|
|
91
|
+
"authToken": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "string",
|
|
96
|
+
"resolved": "string",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": ""
|
|
104
|
+
},
|
|
105
|
+
"attribute": "auth-token",
|
|
106
|
+
"reflect": false
|
|
107
|
+
},
|
|
108
|
+
"businessId": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"mutable": false,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "string",
|
|
113
|
+
"resolved": "string",
|
|
114
|
+
"references": {}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": false,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": ""
|
|
121
|
+
},
|
|
122
|
+
"attribute": "business-id",
|
|
123
|
+
"reflect": false
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
static get states() {
|
|
128
|
+
return {
|
|
129
|
+
"formController": {},
|
|
130
|
+
"errors": {},
|
|
131
|
+
"additional_questions": {}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
static get events() {
|
|
135
|
+
return [{
|
|
136
|
+
"method": "submitted",
|
|
137
|
+
"name": "submitted",
|
|
138
|
+
"bubbles": true,
|
|
139
|
+
"cancelable": true,
|
|
140
|
+
"composed": true,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "BusinessFormSubmitEvent",
|
|
147
|
+
"resolved": "BusinessFormSubmitEvent",
|
|
148
|
+
"references": {
|
|
149
|
+
"BusinessFormSubmitEvent": {
|
|
150
|
+
"location": "import",
|
|
151
|
+
"path": "../../utils/business-form-types",
|
|
152
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
"method": "formLoading",
|
|
158
|
+
"name": "formLoading",
|
|
159
|
+
"bubbles": true,
|
|
160
|
+
"cancelable": true,
|
|
161
|
+
"composed": true,
|
|
162
|
+
"docs": {
|
|
163
|
+
"tags": [],
|
|
164
|
+
"text": ""
|
|
165
|
+
},
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "boolean",
|
|
168
|
+
"resolved": "boolean",
|
|
169
|
+
"references": {}
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
"method": "serverError",
|
|
173
|
+
"name": "serverError",
|
|
174
|
+
"bubbles": true,
|
|
175
|
+
"cancelable": true,
|
|
176
|
+
"composed": true,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": ""
|
|
180
|
+
},
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "BusinessFormServerErrorEvent",
|
|
183
|
+
"resolved": "BusinessFormServerErrorEvent",
|
|
184
|
+
"references": {
|
|
185
|
+
"BusinessFormServerErrorEvent": {
|
|
186
|
+
"location": "import",
|
|
187
|
+
"path": "../../utils/business-form-types",
|
|
188
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormServerErrorEvent"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}];
|
|
193
|
+
}
|
|
194
|
+
static get methods() {
|
|
195
|
+
return {
|
|
196
|
+
"validateAndSubmit": {
|
|
197
|
+
"complexType": {
|
|
198
|
+
"signature": "({ onSuccess }: { onSuccess: any; }) => Promise<void>",
|
|
199
|
+
"parameters": [{
|
|
200
|
+
"name": "__0",
|
|
201
|
+
"type": "{ onSuccess: any; }",
|
|
202
|
+
"docs": ""
|
|
203
|
+
}],
|
|
204
|
+
"references": {
|
|
205
|
+
"Promise": {
|
|
206
|
+
"location": "global",
|
|
207
|
+
"id": "global::Promise"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"return": "Promise<void>"
|
|
211
|
+
},
|
|
212
|
+
"docs": {
|
|
213
|
+
"text": "",
|
|
214
|
+
"tags": []
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|