@justifi/webcomponents 4.10.0-rc.0 → 4.11.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-79361c8a.js → Business-7ae04d4f.js} +58 -2
- package/dist/cjs/{SubAccount-b3902202.js → SubAccount-05867651.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -1
- package/dist/cjs/business-additional-questions-schema-18a82d19.js +47 -0
- package/dist/cjs/business-details-core.cjs.entry.js +7 -2
- package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-29b2bad9.js} +7 -0
- package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-datepart_4.cjs.entry.js} +97 -46
- package/dist/cjs/form-control-monetary.cjs.entry.js +19 -17
- package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +7 -45
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +9 -2
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +29 -24
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +7 -7
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +23 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +62 -51
- package/dist/cjs/justifi-business-list.cjs.entry.js +3 -2
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +5 -4
- package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +29 -5
- package/dist/cjs/justifi-owner-form.cjs.entry.js +22 -12
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +2 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +25 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +18 -4
- package/dist/cjs/{justifi-business-form-stepped.cjs.entry.js → justifi-payment-provisioning.cjs.entry.js} +20 -20
- package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -5
- package/dist/cjs/justifi-payout-details.cjs.entry.js +27 -7
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +26 -6
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +2 -1
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +3 -2
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +3 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/payload-parsers-f437272e.js +132 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +9 -2
- package/dist/cjs/payments-list-core.cjs.entry.js +10 -3
- package/dist/cjs/payout-details-core.cjs.entry.js +10 -4
- package/dist/cjs/payouts-list-core.cjs.entry.js +10 -3
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +2 -1
- package/dist/cjs/{utils-6f62f7a1.js → utils-2b9940e1.js} +7 -0
- package/dist/cjs/{utils-df5167a8.js → utils-87435719.js} +7 -0
- package/dist/cjs/utils-f8079741.js +41 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Business.js +12 -2
- package/dist/collection/api/ComponentError.js +14 -0
- package/dist/collection/api/services/utils.js +11 -0
- package/dist/collection/api/shared.js +11 -1
- package/dist/collection/collection-manifest.json +7 -8
- 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/additional-questions-details/test/additional-questions.spec.js +1 -1
- package/dist/collection/components/business-details/business-details-core.js +30 -2
- package/dist/collection/components/business-details/business-details.js +30 -0
- package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +1 -1
- package/dist/collection/components/business-details/get-business.js +15 -3
- package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +1 -1
- package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +1 -1
- package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +1 -1
- package/dist/collection/components/business-details/test/busines-details-core.spec.js +56 -16
- package/dist/collection/components/business-details/test/business-details.spec.js +20 -4
- package/dist/collection/components/business-details/test/get-business.spec.js +13 -6
- package/dist/collection/components/business-forms/business-form/business-form.js +79 -50
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -4
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -2
- package/dist/collection/components/business-forms/{business-form-stepped/business-address/business-address-form-step.js → owner-form/identity-address/identity-address-form.js} +14 -11
- package/dist/collection/components/business-forms/owner-form/identity-address/test/identity-address.e2e.js +9 -0
- package/dist/collection/components/business-forms/{business-form/business-address/test/business-address.spec.js → owner-form/identity-address/test/identity-address.spec.js} +21 -14
- package/dist/collection/components/business-forms/owner-form/owner-form.js +54 -8
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/business-additional-questions-form-step.js +23 -4
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.js +19 -1
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.js +44 -4
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.js +24 -8
- package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.js +24 -4
- package/dist/collection/components/business-forms/{business-form-stepped/business-form-stepped.js → payment-provisioning/payment-provisioning.js} +36 -18
- 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 +15 -6
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +49 -13
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +24 -12
- package/dist/collection/components/business-forms/schemas/business-form-schema.js +4 -4
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +29 -34
- package/dist/collection/components/business-forms/utils/business-form-types.js +7 -0
- package/dist/collection/components/business-forms/utils/helpers.js +2 -0
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- 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 +36 -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 +6 -0
- package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +17 -2
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +30 -1
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +35 -1
- package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +26 -8
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +51 -11
- package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +55 -3
- package/dist/collection/components/payment-details/get-payment-details.js +15 -3
- package/dist/collection/components/payment-details/payment-details-core.js +30 -1
- package/dist/collection/components/payment-details/payment-details.js +35 -1
- package/dist/collection/components/payment-details/test/get-payment-details.spec.js +11 -3
- package/dist/collection/components/payment-details/test/payment-details-core.spec.js +55 -12
- package/dist/collection/components/payment-details/test/payment-details.spec.js +69 -3
- package/dist/collection/components/payment-form/payment-form.js +54 -3
- package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
- package/dist/collection/components/payments-list/get-payments.js +15 -4
- package/dist/collection/components/payments-list/payments-list-core.js +28 -2
- package/dist/collection/components/payments-list/payments-list.js +35 -1
- package/dist/collection/components/payments-list/test/get-payments.spec.js +11 -3
- package/dist/collection/components/payments-list/test/payments-list-core.spec.js +43 -28
- package/dist/collection/components/payments-list/test/payments-list.spec.js +31 -3
- package/dist/collection/components/payout-details/get-payout-details.js +17 -6
- package/dist/collection/components/payout-details/payout-details-core.js +31 -3
- package/dist/collection/components/payout-details/payout-details.js +35 -1
- package/dist/collection/components/payout-details/test/get-payout-details.spec.js +15 -5
- package/dist/collection/components/payout-details/test/payout-details-core.spec.js +54 -16
- package/dist/collection/components/payout-details/test/payout-details.spec.js +50 -1
- package/dist/collection/components/payouts-list/get-payouts.js +17 -5
- package/dist/collection/components/payouts-list/payouts-list-core.js +28 -2
- package/dist/collection/components/payouts-list/payouts-list.js +34 -1
- package/dist/collection/components/payouts-list/test/get-payouts.spec.js +11 -3
- package/dist/collection/components/payouts-list/test/payouts-list-core.spec.js +42 -29
- package/dist/collection/components/payouts-list/test/payouts-list.spec.js +33 -0
- package/dist/collection/utils/utils.js +5 -0
- package/dist/docs.json +1018 -618
- package/dist/esm/{Business-1df362e0.js → Business-91caaccb.js} +56 -3
- package/dist/esm/{SubAccount-f4ae9809.js → SubAccount-61ac70eb.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +2 -1
- package/dist/esm/business-additional-questions-schema-b642a2b7.js +44 -0
- package/dist/esm/business-details-core.entry.js +8 -3
- package/dist/esm/{business-form-types-de9f38cd.js → business-form-types-0d76133c.js} +8 -1
- package/dist/esm/{form-control-datepart_3.entry.js → form-control-datepart_4.entry.js} +97 -47
- package/dist/esm/form-control-monetary.entry.js +19 -17
- package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +8 -45
- package/dist/esm/gross-payment-chart-core.entry.js +10 -3
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +28 -23
- package/dist/esm/justifi-additional-questions_4.entry.js +7 -7
- package/dist/esm/justifi-billing-form_4.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +24 -5
- package/dist/esm/justifi-business-form.entry.js +62 -51
- package/dist/esm/justifi-business-list.entry.js +3 -2
- package/dist/esm/justifi-checkout-core.entry.js +5 -4
- package/dist/esm/justifi-checkout.entry.js +1 -1
- package/dist/esm/justifi-gross-payment-chart.entry.js +28 -4
- package/dist/esm/justifi-owner-form.entry.js +21 -11
- package/dist/esm/justifi-payment-balance-transactions.entry.js +2 -1
- package/dist/esm/justifi-payment-details.entry.js +26 -5
- package/dist/esm/justifi-payment-form.entry.js +18 -4
- package/dist/esm/{justifi-business-form-stepped.entry.js → justifi-payment-provisioning.entry.js} +20 -20
- package/dist/esm/justifi-payments-list.entry.js +26 -6
- package/dist/esm/justifi-payout-details.entry.js +28 -8
- package/dist/esm/justifi-payouts-list.entry.js +27 -7
- package/dist/esm/justifi-proceeds-list.entry.js +2 -1
- package/dist/esm/justifi-subaccount-details.entry.js +3 -2
- package/dist/esm/justifi-subaccounts-list.entry.js +3 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/payload-parsers-920f49dd.js +123 -0
- package/dist/esm/payment-details-core.entry.js +10 -3
- package/dist/esm/payments-list-core.entry.js +10 -3
- package/dist/esm/payout-details-core.entry.js +11 -5
- package/dist/esm/payouts-list-core.entry.js +10 -3
- package/dist/esm/subaccount-account-details_4.entry.js +2 -1
- package/dist/esm/utils-4609f32c.js +38 -0
- package/dist/esm/{utils-2828201a.js → utils-684d2e47.js} +7 -1
- package/dist/esm/{utils-243abdb4.js → utils-d9e90399.js} +7 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Business.js +56 -3
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +7 -4
- package/dist/module/business-additional-questions-schema.js +16 -7
- package/dist/module/business-address-schema.js +50 -14
- package/dist/module/business-core-info-form-step.js +3 -1
- package/dist/module/business-core-info-schema.js +24 -12
- package/dist/module/business-details-core2.js +8 -3
- package/dist/module/business-form-types.js +8 -1
- package/dist/module/business-identity-schema.js +30 -35
- package/dist/module/business-owners-form-step.js +13 -8
- package/dist/module/business-representative-form-step.js +11 -11
- package/dist/module/business-representative.js +4 -7
- package/dist/module/checkout-core.js +4 -4
- 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 +6 -1
- package/dist/module/gross-payment-chart-core2.js +8 -2
- package/dist/module/helpers.js +4 -0
- package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
- package/dist/module/justifi-business-details.js +21 -4
- package/dist/module/justifi-business-form.js +65 -56
- package/dist/module/justifi-gross-payment-chart.js +28 -4
- package/dist/module/justifi-identity-address-form.d.ts +11 -0
- package/dist/module/justifi-identity-address-form.js +6 -0
- package/dist/module/justifi-payment-balance-transactions.js +1 -1
- package/dist/module/justifi-payment-details.js +26 -5
- package/dist/module/justifi-payment-form.js +18 -4
- package/dist/module/justifi-payment-provisioning.d.ts +11 -0
- package/dist/module/{justifi-business-form-stepped.js → justifi-payment-provisioning.js} +32 -31
- package/dist/module/justifi-payments-list.js +26 -6
- package/dist/module/justifi-payout-details.js +28 -8
- package/dist/module/justifi-payouts-list.js +27 -7
- 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 +10 -12
- package/dist/module/legal-address-form.js +5 -9
- package/dist/module/owner-form.js +23 -35
- package/dist/module/payment-details-core2.js +9 -3
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payments-list-core2.js +9 -3
- package/dist/module/payout-details-core2.js +10 -5
- package/dist/module/payouts-list-core2.js +9 -3
- package/dist/module/subaccount-merchant-details2.js +1 -1
- package/dist/module/utils2.js +7 -1
- package/dist/module/utils3.js +31 -1
- package/dist/module/utils4.js +7 -1
- package/dist/types/api/Business.d.ts +10 -3
- package/dist/types/api/ComponentError.d.ts +18 -0
- package/dist/types/api/services/utils.d.ts +2 -0
- package/dist/types/api/shared.d.ts +9 -0
- package/dist/types/components/business-details/additional-questions-details/additional-questions-details.d.ts +2 -2
- package/dist/types/components/business-details/business-details-core.d.ts +3 -0
- package/dist/types/components/business-details/business-details.d.ts +3 -0
- package/dist/types/components/business-forms/business-form/business-form.d.ts +4 -2
- package/dist/types/components/business-forms/owner-form/identity-address/identity-address-form.d.ts +10 -0
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +5 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/business-additional-questions-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/{business-form-stepped/business-form-stepped.d.ts → payment-provisioning/payment-provisioning.d.ts} +4 -3
- package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +1 -1
- package/dist/types/components/business-forms/schemas/business-address-schema.d.ts +1 -12
- package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +1 -1
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +7 -3
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +5 -31
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +10 -0
- package/dist/types/components/business-forms/utils/helpers.d.ts +2 -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-control-text.d.ts +2 -0
- package/dist/types/components/form/utils.d.ts +1 -0
- package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +5 -8
- package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +3 -0
- package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -0
- package/dist/types/components/payment-details/payment-details-core.d.ts +3 -0
- package/dist/types/components/payment-details/payment-details.d.ts +4 -0
- package/dist/types/components/payment-form/payment-form.d.ts +4 -1
- package/dist/types/components/payments-list/payments-list-core.d.ts +2 -0
- package/dist/types/components/payments-list/payments-list.d.ts +4 -0
- package/dist/types/components/payout-details/payout-details-core.d.ts +3 -0
- package/dist/types/components/payout-details/payout-details.d.ts +4 -0
- package/dist/types/components/payouts-list/payouts-list-core.d.ts +2 -0
- package/dist/types/components/payouts-list/payouts-list.d.ts +4 -0
- package/dist/types/components.d.ts +278 -104
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/webcomponents/p-091f9732.entry.js +1 -0
- package/dist/webcomponents/p-0b76c770.entry.js +1 -0
- package/dist/webcomponents/p-0d81883d.entry.js +1 -0
- package/dist/webcomponents/p-102b593a.entry.js +1 -0
- package/dist/webcomponents/p-221b9504.entry.js +1 -0
- package/dist/webcomponents/p-28cd23c8.entry.js +1 -0
- package/dist/webcomponents/p-2b8368d2.js +1 -0
- package/dist/webcomponents/p-2df32b4a.entry.js +1 -0
- package/dist/webcomponents/p-3d4aaa4a.entry.js +1 -0
- package/dist/webcomponents/p-436d27b9.entry.js +1 -0
- package/dist/webcomponents/p-448063ba.entry.js +1 -0
- package/dist/webcomponents/p-5341321d.entry.js +1 -0
- package/dist/webcomponents/{p-0399f02b.entry.js → p-5b262705.entry.js} +1 -1
- package/dist/webcomponents/p-5e503d7d.entry.js +1 -0
- package/dist/webcomponents/p-6047b960.entry.js +1 -0
- package/dist/webcomponents/p-60b2344a.js +1 -0
- package/dist/webcomponents/p-6d39b8bc.entry.js +1 -0
- package/dist/webcomponents/p-6f294d5d.js +1 -0
- package/dist/webcomponents/p-7294eb89.entry.js +1 -0
- package/dist/webcomponents/p-746bfba6.entry.js +1 -0
- package/dist/webcomponents/p-7c6a355f.entry.js +1 -0
- package/dist/webcomponents/p-817211f2.entry.js +1 -0
- package/dist/webcomponents/{p-65510838.js → p-8482c23f.js} +1 -1
- package/dist/webcomponents/p-935d6f55.js +1 -0
- package/dist/webcomponents/{p-e924f2e1.entry.js → p-959250e3.entry.js} +1 -1
- package/dist/webcomponents/p-a130a884.entry.js +1 -0
- package/dist/webcomponents/p-a4122c35.entry.js +1 -0
- package/dist/webcomponents/p-ac670a3e.js +1 -0
- package/dist/webcomponents/p-ae21ed6f.entry.js +19 -0
- package/dist/webcomponents/p-c071d8c1.entry.js +1 -0
- package/dist/webcomponents/p-c340b60f.js +1 -0
- package/dist/webcomponents/p-d5aab6b5.entry.js +1 -0
- package/dist/webcomponents/p-d5c80489.entry.js +1 -0
- package/dist/webcomponents/p-d776fe10.entry.js +1 -0
- package/dist/webcomponents/p-d8679fad.entry.js +1 -0
- package/dist/webcomponents/p-e84b3616.entry.js +1 -0
- package/dist/webcomponents/p-ea03b424.entry.js +1 -0
- package/dist/webcomponents/p-ea2cca2a.js +1 -0
- package/dist/webcomponents/p-ec230480.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Identity-b6364aee.js +0 -27
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
- package/dist/cjs/payload-parsers-25ed3936.js +0 -98
- package/dist/cjs/utils-f5d82f21.js +0 -10
- package/dist/collection/api/mockData/MockOnboardingData.js +0 -117
- package/dist/collection/api/mockData/MockPayments.js +0 -243
- package/dist/collection/api/mockData/MockSubAccount.js +0 -102
- package/dist/collection/api/mockData/mockGrossVolumeReport.js +0 -125
- package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +0 -2536
- package/dist/collection/components/business-forms/business-form/business-address/business-address-form.js +0 -97
- package/dist/collection/components/business-forms/business-form/business-address/test/business-address.e2e.js +0 -9
- package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +0 -97
- package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +0 -61
- package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
- package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
- package/dist/esm/Identity-774788c0.js +0 -25
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
- package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
- package/dist/esm/payload-parsers-1dd7474f.js +0 -90
- package/dist/esm/utils-546ca6aa.js +0 -8
- package/dist/module/justifi-business-address-form-step.d.ts +0 -11
- package/dist/module/justifi-business-address-form-step.js +0 -75
- package/dist/module/justifi-business-address-form.d.ts +0 -11
- package/dist/module/justifi-business-address-form.js +0 -6
- package/dist/module/justifi-business-form-stepped.d.ts +0 -11
- package/dist/types/api/mockData/MockOnboardingData.d.ts +0 -8
- package/dist/types/api/mockData/MockPayments.d.ts +0 -3
- package/dist/types/api/mockData/MockSubAccount.d.ts +0 -3
- package/dist/types/components/business-forms/business-form/business-address/business-address-form.d.ts +0 -9
- package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +0 -9
- package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +0 -33
- package/dist/webcomponents/p-04a98c63.js +0 -1
- package/dist/webcomponents/p-06888c2e.entry.js +0 -1
- package/dist/webcomponents/p-0811bc77.entry.js +0 -1
- package/dist/webcomponents/p-17d72f4a.js +0 -1
- package/dist/webcomponents/p-17f64853.entry.js +0 -1
- package/dist/webcomponents/p-22085999.entry.js +0 -1
- package/dist/webcomponents/p-252835df.entry.js +0 -1
- package/dist/webcomponents/p-28b38699.js +0 -1
- package/dist/webcomponents/p-374c44e6.entry.js +0 -1
- package/dist/webcomponents/p-4697ccfa.entry.js +0 -1
- package/dist/webcomponents/p-4781cd06.js +0 -1
- package/dist/webcomponents/p-4d806131.entry.js +0 -1
- package/dist/webcomponents/p-4e0b3206.entry.js +0 -1
- package/dist/webcomponents/p-583dd5a2.entry.js +0 -1
- package/dist/webcomponents/p-5be4e217.entry.js +0 -1
- package/dist/webcomponents/p-5da4fbe7.entry.js +0 -1
- package/dist/webcomponents/p-6103c20d.entry.js +0 -1
- package/dist/webcomponents/p-6ed680e9.js +0 -1
- package/dist/webcomponents/p-7654c70d.entry.js +0 -1
- package/dist/webcomponents/p-847441ce.entry.js +0 -1
- package/dist/webcomponents/p-861ba3fc.entry.js +0 -1
- package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
- package/dist/webcomponents/p-9ce8d98c.entry.js +0 -1
- package/dist/webcomponents/p-9e4b81ad.entry.js +0 -1
- package/dist/webcomponents/p-a141c531.js +0 -1
- package/dist/webcomponents/p-a2dbe90f.entry.js +0 -1
- package/dist/webcomponents/p-a98eea84.entry.js +0 -1
- package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
- package/dist/webcomponents/p-b27c9b0d.entry.js +0 -1
- package/dist/webcomponents/p-b8f22856.js +0 -1
- package/dist/webcomponents/p-c8d62072.entry.js +0 -1
- package/dist/webcomponents/p-e3748ea4.entry.js +0 -1
- package/dist/webcomponents/p-eef5ed19.entry.js +0 -1
- package/dist/webcomponents/p-efc7025c.entry.js +0 -1
- package/dist/webcomponents/p-f3453ca2.js +0 -1
- package/dist/webcomponents/p-f3ca6fda.entry.js +0 -1
- package/dist/webcomponents/p-fe2af0cf.entry.js +0 -19
- package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
- /package/dist/cjs/{state-options-96d05a98.js → state-options-4fbcb48a.js} +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped/business-address/business-address-form-step.css → owner-form/identity-address/identity-address-form.css} +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/additional-questions/test/business-additional-questions-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/business-core-info-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-core-info/test/business-core-info-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/business-owners-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-owners/test/business-owners-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/business-representative-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/business-representative/test/business-representative-form-step.spec.js +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped → payment-provisioning}/legal-address-form/legal-address-form-step.css +0 -0
- /package/dist/collection/components/business-forms/{business-form-stepped/business-form-stepped.css → payment-provisioning/payment-provisioning.css} +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/{api → home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil}/mockData/mockGrossVolumeReport.d.ts +0 -0
- /package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/{config.d.ts → packages/webcomponents/config.d.ts} +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
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import StateOptions from "
|
|
3
|
-
|
|
2
|
+
import StateOptions from "../../../../utils/state-options";
|
|
3
|
+
import { filterPostalInput } from "../../../form/utils";
|
|
4
|
+
export class IdentityAddressForm {
|
|
4
5
|
constructor() {
|
|
6
|
+
this.inputHandler = (name, value) => {
|
|
7
|
+
this.address[name] = value;
|
|
8
|
+
this.address = Object.assign({}, this.address);
|
|
9
|
+
};
|
|
5
10
|
this.handleFormUpdate = undefined;
|
|
6
11
|
this.errors = undefined;
|
|
7
12
|
this.defaultValues = undefined;
|
|
@@ -10,24 +15,22 @@ export class BusinessAddressFormStep {
|
|
|
10
15
|
handleAddressChange(newValues) {
|
|
11
16
|
this.handleFormUpdate(newValues);
|
|
12
17
|
}
|
|
13
|
-
inputHandler(name, value) {
|
|
14
|
-
this.address[name] = value;
|
|
15
|
-
this.address = Object.assign({}, this.address);
|
|
16
|
-
}
|
|
17
18
|
render() {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
19
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "line1", label: "Street Address", defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, inputHandler:
|
|
19
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
20
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "line1", label: "Street Address", defaultValue: (_a = this.defaultValues) === null || _a === void 0 ? void 0 : _a.line1, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line1, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "line2", label: "Apartment, Suite, etc. (optional)", defaultValue: (_c = this.defaultValues) === null || _c === void 0 ? void 0 : _c.line2, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.line2, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "city", label: "City", defaultValue: (_e = this.defaultValues) === null || _e === void 0 ? void 0 : _e.city, error: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.city, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "state", label: "State", defaultValue: (_g = this.defaultValues) === null || _g === void 0 ? void 0 : _g.state, options: StateOptions, error: (_h = this.errors) === null || _h === void 0 ? void 0 : _h.state, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "postal_code", label: "Postal Code", defaultValue: (_j = this.defaultValues) === null || _j === void 0 ? void 0 : _j.postal_code, error: (_k = this.errors) === null || _k === void 0 ? void 0 : _k.postal_code, maxLength: 5, keyDownHandler: filterPostalInput, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-select", { name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: (_l = this.defaultValues) === null || _l === void 0 ? void 0 : _l.country, error: (_m = this.errors) === null || _m === void 0 ? void 0 : _m.country,
|
|
21
|
+
// just for now so we skip handling country specificities
|
|
22
|
+
disabled: true })))));
|
|
20
23
|
}
|
|
21
|
-
static get is() { return "justifi-
|
|
24
|
+
static get is() { return "justifi-identity-address-form"; }
|
|
22
25
|
static get encapsulation() { return "shadow"; }
|
|
23
26
|
static get originalStyleUrls() {
|
|
24
27
|
return {
|
|
25
|
-
"$": ["
|
|
28
|
+
"$": ["identity-address-form.scss"]
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
static get styleUrls() {
|
|
29
32
|
return {
|
|
30
|
-
"$": ["
|
|
33
|
+
"$": ["identity-address-form.css"]
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
static get properties() {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe('justifi-identity-address-form', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<justifi-identity-address-form></justifi-identity-address-form>');
|
|
6
|
+
const element = await page.find('justifi-identity-address-form');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { newSpecPage } from "@stencil/core/testing";
|
|
3
|
-
import {
|
|
4
|
-
describe('
|
|
5
|
-
it('should render
|
|
3
|
+
import { IdentityAddressForm } from "../identity-address-form";
|
|
4
|
+
describe('identity-address', () => {
|
|
5
|
+
it('should render IdentityAddressForm component', async () => {
|
|
6
6
|
const page = await newSpecPage({
|
|
7
|
-
components: [
|
|
8
|
-
template: () => (h("justifi-
|
|
7
|
+
components: [IdentityAddressForm],
|
|
8
|
+
template: () => (h("justifi-identity-address-form", null)),
|
|
9
9
|
});
|
|
10
10
|
expect(page.root).toEqualHtml(`
|
|
11
|
-
<justifi-
|
|
11
|
+
<justifi-identity-address-form exportparts="label,input,input-invalid">
|
|
12
12
|
<mock:shadow-root>
|
|
13
13
|
<div class="row gy-3">
|
|
14
14
|
<div class="col-12 col-md-8">
|
|
@@ -28,14 +28,18 @@ describe('business-address', () => {
|
|
|
28
28
|
</div>
|
|
29
29
|
|
|
30
30
|
<div class="col-12 col-md-6">
|
|
31
|
-
<form-control-
|
|
31
|
+
<form-control-text label="Postal Code" maxlength="5" name="postal_code"></form-control-text>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="col-12">
|
|
35
|
+
<form-control-select disabled="" label="Country" name="country"></form-control-select>
|
|
32
36
|
</div>
|
|
33
37
|
</div>
|
|
34
38
|
</mock:shadow-root>
|
|
35
|
-
</justifi-
|
|
39
|
+
</justifi-identity-address-form>
|
|
36
40
|
`);
|
|
37
41
|
});
|
|
38
|
-
it('should render
|
|
42
|
+
it('should render IdentityAddressForm component with defaults', async () => {
|
|
39
43
|
const businessAddress = {
|
|
40
44
|
line1: 'Street 1',
|
|
41
45
|
line2: 'Apartment 1',
|
|
@@ -45,11 +49,11 @@ describe('business-address', () => {
|
|
|
45
49
|
country: 'Country',
|
|
46
50
|
};
|
|
47
51
|
const page = await newSpecPage({
|
|
48
|
-
components: [
|
|
49
|
-
template: () => (h("justifi-
|
|
52
|
+
components: [IdentityAddressForm],
|
|
53
|
+
template: () => (h("justifi-identity-address-form", { defaultValues: businessAddress })),
|
|
50
54
|
});
|
|
51
55
|
expect(page.root).toEqualHtml(`
|
|
52
|
-
<justifi-
|
|
56
|
+
<justifi-identity-address-form exportparts="label,input,input-invalid">
|
|
53
57
|
<mock:shadow-root>
|
|
54
58
|
<div class="gy-3 row">
|
|
55
59
|
<div class="col-12 col-md-8">
|
|
@@ -65,11 +69,14 @@ describe('business-address', () => {
|
|
|
65
69
|
<form-control-select defaultValue="State" label="State" name="state"></form-control-select>
|
|
66
70
|
</div>
|
|
67
71
|
<div class="col-12 col-md-6">
|
|
68
|
-
<form-control-
|
|
72
|
+
<form-control-text defaultvalue="12345" label="Postal Code" maxlength="5" name="postal_code"></form-control-text>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="col-12">
|
|
75
|
+
<form-control-select defaultValue="Country" disabled="" label="Country" name="country"></form-control-select>
|
|
69
76
|
</div>
|
|
70
77
|
</div>
|
|
71
78
|
</mock:shadow-root>
|
|
72
|
-
</justifi-
|
|
79
|
+
</justifi-identity-address-form>
|
|
73
80
|
`);
|
|
74
81
|
});
|
|
75
82
|
});
|
|
@@ -4,14 +4,16 @@ import { PHONE_MASKS } from "../../../utils/form-input-masks";
|
|
|
4
4
|
import { Api } from "../../../api";
|
|
5
5
|
import { Owner } from "../../../api/Identity";
|
|
6
6
|
import { parseIdentityInfo } from "../utils/payload-parsers";
|
|
7
|
-
import {
|
|
7
|
+
import { identitySchema } from "../schemas/business-identity-schema";
|
|
8
8
|
import { config } from "../../../../config";
|
|
9
9
|
import { LoadingSpinner } from "../../form/utils";
|
|
10
|
-
import { OwnerFormServerErrors } from "../utils/business-form-types";
|
|
10
|
+
import { OwnerFormServerErrors, OwnerFormClickActions } from "../utils/business-form-types";
|
|
11
11
|
export class BusinessOwnerForm {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.fetchData = async () => {
|
|
14
14
|
if (!this.ownerId) {
|
|
15
|
+
this.owner = Object.assign({}, new Owner({}));
|
|
16
|
+
this.formController.setInitialValues(this.owner);
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
17
19
|
this.isLoading = true;
|
|
@@ -55,6 +57,14 @@ export class BusinessOwnerForm {
|
|
|
55
57
|
this.onAddressFormUpdate = (values) => {
|
|
56
58
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
|
|
57
59
|
};
|
|
60
|
+
this.handleAddOwner = () => {
|
|
61
|
+
const eventName = this.ownerId ? OwnerFormClickActions.updateOwner : OwnerFormClickActions.addOwner;
|
|
62
|
+
this.clickEvent.emit({ name: eventName });
|
|
63
|
+
};
|
|
64
|
+
this.handleRemoveOwner = () => {
|
|
65
|
+
this.removeOwner(this.ownerId);
|
|
66
|
+
this.clickEvent.emit({ name: OwnerFormClickActions.removeOwner });
|
|
67
|
+
};
|
|
58
68
|
this.validateAndSubmit = (event) => {
|
|
59
69
|
event.preventDefault();
|
|
60
70
|
const isValid = this.formController.validate();
|
|
@@ -65,6 +75,7 @@ export class BusinessOwnerForm {
|
|
|
65
75
|
this.authToken = undefined;
|
|
66
76
|
this.ownerId = undefined;
|
|
67
77
|
this.businessId = undefined;
|
|
78
|
+
this.allowOptionalFields = undefined;
|
|
68
79
|
this.removeOwner = undefined;
|
|
69
80
|
this.newFormOpen = undefined;
|
|
70
81
|
this.ownersLength = undefined;
|
|
@@ -114,7 +125,7 @@ export class BusinessOwnerForm {
|
|
|
114
125
|
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
115
126
|
if (!this.authToken)
|
|
116
127
|
console.error(missingAuthTokenMessage);
|
|
117
|
-
this.formController = new FormController(
|
|
128
|
+
this.formController = new FormController(identitySchema('owner', this.allowOptionalFields));
|
|
118
129
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
119
130
|
this.fetchData();
|
|
120
131
|
}
|
|
@@ -130,11 +141,8 @@ export class BusinessOwnerForm {
|
|
|
130
141
|
}
|
|
131
142
|
render() {
|
|
132
143
|
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-
|
|
134
|
-
|
|
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)))));
|
|
144
|
+
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-text", { name: "title", label: "Title", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.title, 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-identity-address-form", { errors: this.errors.address, defaultValues: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate })), 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' : ''}`, onClick: () => this.handleAddOwner(), disabled: this.isLoading }, this.isLoading ? LoadingSpinner() : this.submitButtonText), this.showRemoveButton &&
|
|
145
|
+
h("button", { type: "button", class: "btn btn-danger", onClick: () => this.handleRemoveOwner() }, "Remove owner"))), h("hr", null)))));
|
|
138
146
|
}
|
|
139
147
|
static get is() { return "justifi-owner-form"; }
|
|
140
148
|
static get encapsulation() { return "shadow"; }
|
|
@@ -201,6 +209,23 @@ export class BusinessOwnerForm {
|
|
|
201
209
|
"attribute": "business-id",
|
|
202
210
|
"reflect": false
|
|
203
211
|
},
|
|
212
|
+
"allowOptionalFields": {
|
|
213
|
+
"type": "boolean",
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "boolean",
|
|
217
|
+
"resolved": "boolean",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": true,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": ""
|
|
225
|
+
},
|
|
226
|
+
"attribute": "allow-optional-fields",
|
|
227
|
+
"reflect": false
|
|
228
|
+
},
|
|
204
229
|
"removeOwner": {
|
|
205
230
|
"type": "unknown",
|
|
206
231
|
"mutable": false,
|
|
@@ -282,6 +307,27 @@ export class BusinessOwnerForm {
|
|
|
282
307
|
}
|
|
283
308
|
}
|
|
284
309
|
}
|
|
310
|
+
}, {
|
|
311
|
+
"method": "clickEvent",
|
|
312
|
+
"name": "click-event",
|
|
313
|
+
"bubbles": true,
|
|
314
|
+
"cancelable": true,
|
|
315
|
+
"composed": true,
|
|
316
|
+
"docs": {
|
|
317
|
+
"tags": [],
|
|
318
|
+
"text": ""
|
|
319
|
+
},
|
|
320
|
+
"complexType": {
|
|
321
|
+
"original": "OwnerFormClickEvent",
|
|
322
|
+
"resolved": "OwnerFormClickEvent",
|
|
323
|
+
"references": {
|
|
324
|
+
"OwnerFormClickEvent": {
|
|
325
|
+
"location": "import",
|
|
326
|
+
"path": "../utils/business-form-types",
|
|
327
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
285
331
|
}, {
|
|
286
332
|
"method": "formLoading",
|
|
287
333
|
"name": "formLoading",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { FormController } from "../../../form/form";
|
|
3
|
+
import { AdditionalQuestions } from "../../../../api/Business";
|
|
3
4
|
import { Api } from "../../../../api";
|
|
4
5
|
import { config } from "../../../../../config";
|
|
5
|
-
import {
|
|
6
|
+
import { additionalQuestionsSchema } from "../../schemas/business-additional-questions-schema";
|
|
6
7
|
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
7
8
|
/**
|
|
8
9
|
* @exportedPart label: Label for inputs
|
|
@@ -15,8 +16,8 @@ export class AdditionalQuestionsFormStep {
|
|
|
15
16
|
this.formLoading.emit(true);
|
|
16
17
|
try {
|
|
17
18
|
const response = await this.api.get(this.businessEndpoint);
|
|
18
|
-
this.additional_questions = response.data.additional_questions;
|
|
19
|
-
this.formController.setInitialValues(this.additional_questions);
|
|
19
|
+
this.additional_questions = new AdditionalQuestions(response.data.additional_questions || {});
|
|
20
|
+
this.formController.setInitialValues(Object.assign({}, this.additional_questions));
|
|
20
21
|
}
|
|
21
22
|
catch (error) {
|
|
22
23
|
this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
|
|
@@ -44,6 +45,7 @@ export class AdditionalQuestionsFormStep {
|
|
|
44
45
|
};
|
|
45
46
|
this.authToken = undefined;
|
|
46
47
|
this.businessId = undefined;
|
|
48
|
+
this.allowOptionalFields = undefined;
|
|
47
49
|
this.formController = undefined;
|
|
48
50
|
this.errors = {};
|
|
49
51
|
this.additional_questions = {};
|
|
@@ -71,7 +73,7 @@ export class AdditionalQuestionsFormStep {
|
|
|
71
73
|
console.error(missingAuthTokenMessage);
|
|
72
74
|
if (!this.businessId)
|
|
73
75
|
console.error(missingBusinessIdMessage);
|
|
74
|
-
this.formController = new FormController(
|
|
76
|
+
this.formController = new FormController(additionalQuestionsSchema(this.allowOptionalFields));
|
|
75
77
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
76
78
|
this.fetchData();
|
|
77
79
|
}
|
|
@@ -120,6 +122,23 @@ export class AdditionalQuestionsFormStep {
|
|
|
120
122
|
},
|
|
121
123
|
"attribute": "business-id",
|
|
122
124
|
"reflect": false
|
|
125
|
+
},
|
|
126
|
+
"allowOptionalFields": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "boolean",
|
|
131
|
+
"resolved": "boolean",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": ""
|
|
139
|
+
},
|
|
140
|
+
"attribute": "allow-optional-fields",
|
|
141
|
+
"reflect": false
|
|
123
142
|
}
|
|
124
143
|
};
|
|
125
144
|
}
|
|
@@ -54,6 +54,7 @@ export class BusinessCoreInfoFormStep {
|
|
|
54
54
|
};
|
|
55
55
|
this.authToken = undefined;
|
|
56
56
|
this.businessId = undefined;
|
|
57
|
+
this.allowOptionalFields = undefined;
|
|
57
58
|
this.formController = undefined;
|
|
58
59
|
this.errors = {};
|
|
59
60
|
this.coreInfo = {};
|
|
@@ -81,7 +82,7 @@ export class BusinessCoreInfoFormStep {
|
|
|
81
82
|
console.error(missingAuthTokenMessage);
|
|
82
83
|
if (!this.businessId)
|
|
83
84
|
console.error(missingBusinessIdMessage);
|
|
84
|
-
this.formController = new FormController(businessCoreInfoSchema);
|
|
85
|
+
this.formController = new FormController(businessCoreInfoSchema(this.allowOptionalFields));
|
|
85
86
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
86
87
|
this.fetchData();
|
|
87
88
|
}
|
|
@@ -141,6 +142,23 @@ export class BusinessCoreInfoFormStep {
|
|
|
141
142
|
},
|
|
142
143
|
"attribute": "business-id",
|
|
143
144
|
"reflect": false
|
|
145
|
+
},
|
|
146
|
+
"allowOptionalFields": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "boolean",
|
|
151
|
+
"resolved": "boolean",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": true,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": ""
|
|
159
|
+
},
|
|
160
|
+
"attribute": "allow-optional-fields",
|
|
161
|
+
"reflect": false
|
|
144
162
|
}
|
|
145
163
|
};
|
|
146
164
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
3
2
|
import { Api } from "../../../../api";
|
|
4
3
|
import { config } from "../../../../../config";
|
|
5
4
|
import { Owner } from "../../../../api/Identity";
|
|
5
|
+
import { BusinessFormServerErrors, OwnerFormClickActions } from "../../utils/business-form-types";
|
|
6
6
|
/**
|
|
7
7
|
* @exportedPart label: Label for inputs
|
|
8
8
|
* @exportedPart input: The input fields
|
|
@@ -55,10 +55,11 @@ export class BusinessOwnersFormStep {
|
|
|
55
55
|
this.formLoading.emit(false);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
this.addOwnerForm = () => {
|
|
58
|
+
this.addOwnerForm = (fireClick) => {
|
|
59
59
|
this.newFormOpen = true;
|
|
60
60
|
const newOwner = Object.assign({}, new Owner({}));
|
|
61
61
|
this.owners = [...this.owners, newOwner];
|
|
62
|
+
fireClick && this.clickEvent.emit({ name: OwnerFormClickActions.addOwnerForm });
|
|
62
63
|
};
|
|
63
64
|
this.removeOwnerForm = (id) => {
|
|
64
65
|
this.owners = this.owners.filter(owner => owner.id !== id);
|
|
@@ -78,6 +79,7 @@ export class BusinessOwnersFormStep {
|
|
|
78
79
|
};
|
|
79
80
|
this.authToken = undefined;
|
|
80
81
|
this.businessId = undefined;
|
|
82
|
+
this.allowOptionalFields = undefined;
|
|
81
83
|
this.owners = [];
|
|
82
84
|
this.newFormOpen = undefined;
|
|
83
85
|
this.refs = [];
|
|
@@ -130,9 +132,9 @@ export class BusinessOwnersFormStep {
|
|
|
130
132
|
}
|
|
131
133
|
render() {
|
|
132
134
|
return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: 'col-12' }, this.owners.map((owner) => {
|
|
133
|
-
return (h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.owners.length, onSubmitted: (e) => this.handleOwnerSubmit(e), onFormLoading: (e) => this.formLoading.emit(e.detail), ref: (ref) => { this.matchRef(ref, owner.id); } }));
|
|
135
|
+
return (h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.owners.length, onSubmitted: (e) => this.handleOwnerSubmit(e), onFormLoading: (e) => this.formLoading.emit(e.detail), allowOptionalFields: this.allowOptionalFields, ref: (ref) => { this.matchRef(ref, owner.id); } }));
|
|
134
136
|
})), this.showAddOwnerButton &&
|
|
135
|
-
h("div", { class: 'col-12' }, h("button", { class: 'btn btn-primary', onClick: this.addOwnerForm }, "Add Owner"))));
|
|
137
|
+
h("div", { class: 'col-12' }, h("button", { class: 'btn btn-primary', onClick: () => this.addOwnerForm(true) }, "Add Owner"))));
|
|
136
138
|
}
|
|
137
139
|
static get is() { return "justifi-business-owners-form-step"; }
|
|
138
140
|
static get originalStyleUrls() {
|
|
@@ -180,6 +182,23 @@ export class BusinessOwnersFormStep {
|
|
|
180
182
|
},
|
|
181
183
|
"attribute": "business-id",
|
|
182
184
|
"reflect": false
|
|
185
|
+
},
|
|
186
|
+
"allowOptionalFields": {
|
|
187
|
+
"type": "boolean",
|
|
188
|
+
"mutable": false,
|
|
189
|
+
"complexType": {
|
|
190
|
+
"original": "boolean",
|
|
191
|
+
"resolved": "boolean",
|
|
192
|
+
"references": {}
|
|
193
|
+
},
|
|
194
|
+
"required": false,
|
|
195
|
+
"optional": true,
|
|
196
|
+
"docs": {
|
|
197
|
+
"tags": [],
|
|
198
|
+
"text": ""
|
|
199
|
+
},
|
|
200
|
+
"attribute": "allow-optional-fields",
|
|
201
|
+
"reflect": false
|
|
183
202
|
}
|
|
184
203
|
};
|
|
185
204
|
}
|
|
@@ -212,6 +231,27 @@ export class BusinessOwnersFormStep {
|
|
|
212
231
|
}
|
|
213
232
|
}
|
|
214
233
|
}
|
|
234
|
+
}, {
|
|
235
|
+
"method": "clickEvent",
|
|
236
|
+
"name": "click-event",
|
|
237
|
+
"bubbles": true,
|
|
238
|
+
"cancelable": true,
|
|
239
|
+
"composed": true,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": ""
|
|
243
|
+
},
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "OwnerFormClickEvent",
|
|
246
|
+
"resolved": "OwnerFormClickEvent",
|
|
247
|
+
"references": {
|
|
248
|
+
"OwnerFormClickEvent": {
|
|
249
|
+
"location": "import",
|
|
250
|
+
"path": "../../utils/business-form-types",
|
|
251
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
215
255
|
}, {
|
|
216
256
|
"method": "formLoading",
|
|
217
257
|
"name": "formLoading",
|
|
@@ -3,17 +3,18 @@ import { FormController } from "../../../form/form";
|
|
|
3
3
|
import { PHONE_MASKS } from "../../../../utils/form-input-masks";
|
|
4
4
|
import Api from "../../../../api/Api";
|
|
5
5
|
import { parseIdentityInfo } from "../../utils/payload-parsers";
|
|
6
|
-
import {
|
|
6
|
+
import { identitySchema } from "../../schemas/business-identity-schema";
|
|
7
7
|
import { config } from "../../../../../config";
|
|
8
8
|
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
9
|
+
import { Representative } from "../../../../api/Identity";
|
|
9
10
|
export class BusinessRepresentativeFormStep {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.fetchData = async () => {
|
|
12
13
|
this.formLoading.emit(true);
|
|
13
14
|
try {
|
|
14
15
|
const response = await this.api.get(this.businessEndpoint);
|
|
15
|
-
this.representative = response.data.representative;
|
|
16
|
-
this.formController.setInitialValues(this.representative);
|
|
16
|
+
this.representative = new Representative(response.data.representative || {});
|
|
17
|
+
this.formController.setInitialValues(Object.assign({}, this.representative));
|
|
17
18
|
}
|
|
18
19
|
catch (error) {
|
|
19
20
|
this.serverError.emit({ data: error, message: BusinessFormServerErrors.fetchData });
|
|
@@ -44,6 +45,7 @@ export class BusinessRepresentativeFormStep {
|
|
|
44
45
|
};
|
|
45
46
|
this.authToken = undefined;
|
|
46
47
|
this.businessId = undefined;
|
|
48
|
+
this.allowOptionalFields = undefined;
|
|
47
49
|
this.formController = undefined;
|
|
48
50
|
this.errors = {};
|
|
49
51
|
this.representative = {};
|
|
@@ -71,7 +73,7 @@ export class BusinessRepresentativeFormStep {
|
|
|
71
73
|
console.error(missingAuthTokenMessage);
|
|
72
74
|
if (!this.businessId)
|
|
73
75
|
console.error(missingBusinessIdMessage);
|
|
74
|
-
this.formController = new FormController(
|
|
76
|
+
this.formController = new FormController(identitySchema('representative', this.allowOptionalFields));
|
|
75
77
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
76
78
|
this.fetchData();
|
|
77
79
|
}
|
|
@@ -81,10 +83,7 @@ export class BusinessRepresentativeFormStep {
|
|
|
81
83
|
}
|
|
82
84
|
render() {
|
|
83
85
|
const representativeDefaultValue = this.formController.getInitialValues();
|
|
84
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Representative"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-
|
|
85
|
-
{ label: 'Select Prefix', value: '' },
|
|
86
|
-
{ label: 'Mrs.', value: 'Mrs.' },
|
|
87
|
-
], 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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: values => this.onAddressFormUpdate(values) })))))));
|
|
86
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Representative"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "name", label: "Full Name", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, error: this.errors.name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-text", { name: "title", label: "Title", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, 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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.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: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, error: this.errors.identification_number, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("justifi-identity-address-form", { errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate })))))));
|
|
88
87
|
}
|
|
89
88
|
static get is() { return "justifi-business-representative-form-step"; }
|
|
90
89
|
static get originalStyleUrls() {
|
|
@@ -132,6 +131,23 @@ export class BusinessRepresentativeFormStep {
|
|
|
132
131
|
},
|
|
133
132
|
"attribute": "business-id",
|
|
134
133
|
"reflect": false
|
|
134
|
+
},
|
|
135
|
+
"allowOptionalFields": {
|
|
136
|
+
"type": "boolean",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "boolean",
|
|
140
|
+
"resolved": "boolean",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": true,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": ""
|
|
148
|
+
},
|
|
149
|
+
"attribute": "allow-optional-fields",
|
|
150
|
+
"reflect": false
|
|
135
151
|
}
|
|
136
152
|
};
|
|
137
153
|
}
|
|
@@ -3,9 +3,11 @@ import { FormController } from "../../../form/form";
|
|
|
3
3
|
import Api from "../../../../api/Api";
|
|
4
4
|
import { Address } from "../../../../api/Business";
|
|
5
5
|
import { parseAddressInfo } from "../../utils/payload-parsers";
|
|
6
|
-
import {
|
|
6
|
+
import { addressSchema } from "../../schemas/business-address-schema";
|
|
7
7
|
import { config } from "../../../../../config";
|
|
8
8
|
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
9
|
+
import StateOptions from "../../../../utils/state-options";
|
|
10
|
+
import { filterPostalInput } from "../../../form/utils";
|
|
9
11
|
/**
|
|
10
12
|
* @exportedPart label: Label for inputs
|
|
11
13
|
* @exportedPart input: The input fields
|
|
@@ -46,6 +48,7 @@ export class LegalAddressFormStep {
|
|
|
46
48
|
};
|
|
47
49
|
this.authToken = undefined;
|
|
48
50
|
this.businessId = undefined;
|
|
51
|
+
this.allowOptionalFields = undefined;
|
|
49
52
|
this.formController = undefined;
|
|
50
53
|
this.errors = {};
|
|
51
54
|
this.legal_address = {};
|
|
@@ -73,7 +76,7 @@ export class LegalAddressFormStep {
|
|
|
73
76
|
console.error(missingAuthTokenMessage);
|
|
74
77
|
if (!this.businessId)
|
|
75
78
|
console.error(missingBusinessIdMessage);
|
|
76
|
-
this.formController = new FormController(
|
|
79
|
+
this.formController = new FormController(addressSchema(this.allowOptionalFields));
|
|
77
80
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
78
81
|
this.fetchData();
|
|
79
82
|
}
|
|
@@ -82,9 +85,9 @@ export class LegalAddressFormStep {
|
|
|
82
85
|
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
83
86
|
}
|
|
84
87
|
render() {
|
|
85
|
-
var _a, _b, _c, _d, _e;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f;
|
|
86
89
|
const legalAddressDefaultValue = this.formController.getInitialValues();
|
|
87
|
-
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:
|
|
90
|
+
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: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.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: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.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: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.state })), h("div", { class: "col-12" }, h("form-control-text", { name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, error: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.postal_code, maxLength: 5, keyDownHandler: filterPostalInput })), 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: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.country,
|
|
88
91
|
// just for now so we skip handling country specificities
|
|
89
92
|
disabled: true })))))));
|
|
90
93
|
}
|
|
@@ -134,6 +137,23 @@ export class LegalAddressFormStep {
|
|
|
134
137
|
},
|
|
135
138
|
"attribute": "business-id",
|
|
136
139
|
"reflect": false
|
|
140
|
+
},
|
|
141
|
+
"allowOptionalFields": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "boolean",
|
|
146
|
+
"resolved": "boolean",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": true,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"attribute": "allow-optional-fields",
|
|
156
|
+
"reflect": false
|
|
137
157
|
}
|
|
138
158
|
};
|
|
139
159
|
}
|