@justifi/webcomponents 4.10.0 → 4.12.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-f8e37adb.js +144 -0
- package/dist/cjs/{Payment-89a8bc21.js → Payment-eceed10f.js} +1 -0
- package/dist/cjs/{SubAccount-05867651.js → SubAccount-b3902202.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +5 -6
- package/dist/cjs/business-additional-questions-schema-bdfd29c3.js +78 -0
- package/dist/cjs/business-details-core.cjs.entry.js +9 -4
- package/dist/cjs/{business-form-types-3cdd5447.js → business-form-types-61b8196a.js} +33 -0
- package/dist/cjs/{form-control-datepart_3.cjs.entry.js → form-control-date_4.cjs.entry.js} +70 -56
- package/dist/cjs/form-control-datepart.cjs.entry.js +80 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/{form-control-number_3.cjs.entry.js → form-control-select_2.cjs.entry.js} +4 -46
- package/dist/cjs/{form-input-masks-e3bf2614.js → form-input-masks-baa06faf.js} +1 -1
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +10 -5
- package/dist/cjs/{index-69b9386b.js → index-5d5f2219.js} +3 -0
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +38 -26
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +20 -21
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +5 -5
- package/dist/cjs/justifi-business-details.cjs.entry.js +23 -7
- package/dist/cjs/justifi-business-form.cjs.entry.js +71 -54
- package/dist/cjs/justifi-business-list.cjs.entry.js +4 -6
- package/dist/cjs/justifi-business-owners.cjs.entry.js +2 -2
- package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +34 -24
- package/dist/cjs/justifi-checkout.cjs.entry.js +15 -11
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +30 -6
- package/dist/cjs/{justifi-new-payment-method_3.cjs.entry.js → justifi-new-payment-method_4.cjs.entry.js} +95 -11
- package/dist/cjs/justifi-owner-form.cjs.entry.js +42 -20
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +29 -8
- package/dist/cjs/justifi-payment-form.cjs.entry.js +19 -7
- package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +25 -18
- package/dist/cjs/justifi-payments-list.cjs.entry.js +29 -9
- package/dist/cjs/justifi-payout-details.cjs.entry.js +31 -11
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +30 -10
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +5 -6
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +4 -5
- package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/payload-parsers-32c43c76.js +144 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +10 -5
- package/dist/cjs/{payment.service-0b0086dc.js → payment.service-9db24ab9.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +11 -6
- package/dist/cjs/payout-details-core.cjs.entry.js +11 -7
- package/dist/cjs/{payout.service-5cc3b4e9.js → payout.service-a0efb71a.js} +1 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +11 -6
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +5 -6
- 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-23e70ef2.js → utils-6e35fa70.js} +1 -1
- package/dist/cjs/{utils-2b9940e1.js → utils-6f62f7a1.js} +0 -7
- package/dist/cjs/utils-f8079741.js +41 -0
- package/dist/cjs/{utils-df5167a8.js → utils-fc72268d.js} +8 -1
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Business.js +3 -20
- package/dist/collection/api/Checkout.js +6 -1
- package/dist/collection/api/ComponentError.js +14 -0
- package/dist/collection/api/Identity.js +7 -4
- package/dist/collection/api/Payment.js +1 -0
- package/dist/collection/api/services/checkout.service.js +7 -3
- package/dist/collection/api/services/utils.js +11 -0
- package/dist/collection/api/shared.js +11 -1
- package/dist/collection/collection-manifest.json +3 -2
- 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/generic-info-details.js +2 -2
- 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-core-info/business-core-info.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-form.js +124 -50
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +12 -12
- 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/business-address/business-address-form.js → owner-form/identity-address/identity-address-form.js} +13 -10
- 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 +75 -13
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +20 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +21 -4
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +44 -4
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +31 -6
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +23 -4
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +74 -15
- 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 +40 -14
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +55 -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 +40 -34
- package/dist/collection/components/business-forms/schemas/schema-helpers.js +8 -0
- package/dist/collection/components/business-forms/utils/business-form-types.js +30 -0
- package/dist/collection/components/business-forms/utils/helpers.js +22 -0
- package/dist/collection/components/business-forms/utils/payload-parsers.js +1 -0
- package/dist/collection/components/business-list/business-list.js +0 -2
- package/dist/collection/components/checkout/checkout-actions.js +2 -2
- package/dist/collection/components/checkout/checkout-core.css +361 -0
- package/dist/collection/components/checkout/checkout-core.js +32 -27
- package/dist/collection/components/checkout/checkout.js +5 -5
- package/dist/collection/components/checkout/new-payment-method.js +12 -6
- package/dist/collection/components/checkout/payment-method-options.css +18 -2
- package/dist/collection/components/checkout/payment-method-options.js +62 -5
- package/dist/collection/components/checkout/payment-method-payload.js +1 -0
- package/dist/collection/components/checkout/saved-payment-method.js +11 -6
- package/dist/collection/components/checkout/sezzel-payment-method.js +247 -0
- package/dist/collection/components/form/form-control-date.css +1803 -0
- package/dist/collection/components/form/form-control-date.js +192 -0
- package/dist/collection/components/form/form-control-text.js +35 -1
- 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/payment-method-selector.js +1 -1
- package/dist/collection/components/payment-form/test/payment-form.spec.js +60 -1
- package/dist/collection/components/payment-method-form/payment-method-form.js +1 -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/components/select-input/select-input.js +1 -1
- package/dist/collection/components/select-input/test/select-input.spec.js +4 -4
- package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +3 -3
- package/dist/collection/components/text-input/test/text-input.spec.js +4 -4
- package/dist/collection/components/text-input/text-input.js +1 -1
- package/dist/collection/utils/form-input-masks.js +1 -1
- package/dist/collection/utils/utils.js +0 -5
- package/dist/docs.json +1583 -607
- package/dist/esm/Business-2410f7e3.js +136 -0
- package/dist/esm/{Payment-55886c86.js → Payment-ef9fc1ae.js} +1 -0
- package/dist/esm/{SubAccount-61ac70eb.js → SubAccount-f4ae9809.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +5 -6
- package/dist/esm/business-additional-questions-schema-5571d40f.js +75 -0
- package/dist/esm/business-details-core.entry.js +9 -4
- package/dist/esm/business-form-types-46ecd908.js +50 -0
- package/dist/esm/{form-control-datepart_3.entry.js → form-control-date_4.entry.js} +68 -55
- package/dist/esm/form-control-datepart.entry.js +76 -0
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/{form-control-number_3.entry.js → form-control-select_2.entry.js} +5 -46
- package/dist/esm/{form-input-masks-a8187c77.js → form-input-masks-850c8cd4.js} +1 -1
- package/dist/esm/gross-payment-chart-core.entry.js +10 -5
- package/dist/esm/{index-df86d9a2.js → index-83dcf934.js} +3 -0
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +36 -24
- package/dist/esm/justifi-additional-questions_4.entry.js +20 -21
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/justifi-billing-form_4.entry.js +5 -5
- package/dist/esm/justifi-business-details.entry.js +23 -7
- package/dist/esm/justifi-business-form.entry.js +71 -54
- package/dist/esm/justifi-business-list.entry.js +4 -6
- package/dist/esm/justifi-business-owners.entry.js +2 -2
- package/dist/esm/justifi-card-form.entry.js +1 -1
- package/dist/esm/justifi-checkout-core.entry.js +34 -24
- package/dist/esm/justifi-checkout.entry.js +15 -11
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +29 -5
- package/dist/esm/{justifi-new-payment-method_3.entry.js → justifi-new-payment-method_4.entry.js} +95 -12
- package/dist/esm/justifi-owner-form.entry.js +42 -20
- package/dist/esm/justifi-payment-balance-transactions.entry.js +3 -4
- package/dist/esm/justifi-payment-details.entry.js +29 -8
- package/dist/esm/justifi-payment-form.entry.js +19 -7
- package/dist/esm/justifi-payment-method-selector.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +25 -18
- package/dist/esm/justifi-payments-list.entry.js +29 -9
- package/dist/esm/justifi-payout-details.entry.js +31 -11
- package/dist/esm/justifi-payouts-list.entry.js +30 -10
- package/dist/esm/justifi-proceeds-list.entry.js +3 -4
- package/dist/esm/justifi-refund-form.entry.js +2 -2
- package/dist/esm/justifi-subaccount-details.entry.js +5 -6
- package/dist/esm/justifi-subaccounts-list.entry.js +4 -5
- package/dist/esm/justifi-table_2.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/payload-parsers-192e0c3e.js +131 -0
- package/dist/esm/payment-details-core.entry.js +10 -5
- package/dist/esm/{payment.service-f274ef98.js → payment.service-ec28a959.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +11 -6
- package/dist/esm/payout-details-core.entry.js +11 -7
- package/dist/esm/{payout.service-af293f61.js → payout.service-5fd5986c.js} +1 -1
- package/dist/esm/payouts-list-core.entry.js +11 -6
- package/dist/esm/subaccount-account-details_4.entry.js +5 -6
- package/dist/esm/subaccount-bank-details.entry.js +2 -2
- package/dist/esm/subaccount-terms-details.entry.js +2 -2
- package/dist/esm/{utils-d01c5f3a.js → utils-210fdf39.js} +1 -1
- package/dist/esm/{utils-d9e90399.js → utils-243abdb4.js} +1 -7
- package/dist/esm/utils-4609f32c.js +38 -0
- package/dist/esm/{utils-2828201a.js → utils-6f05d9d7.js} +8 -2
- package/dist/esm/webcomponents.js +3 -3
- package/dist/module/Business.js +48 -21
- package/dist/module/Payment.js +1 -0
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +4 -2
- package/dist/module/business-additional-questions-schema.js +16 -7
- package/dist/module/business-address-schema.js +42 -16
- package/dist/module/business-core-info-form-step.js +5 -4
- package/dist/module/business-core-info-schema.js +56 -13
- package/dist/module/business-core-info.js +2 -2
- package/dist/module/business-details-core2.js +8 -3
- package/dist/module/business-form-types.js +32 -1
- package/dist/module/business-identity-schema.js +41 -35
- package/dist/module/business-owners-form-step.js +14 -10
- package/dist/module/business-representative-form-step.js +22 -13
- package/dist/module/business-representative.js +17 -17
- package/dist/module/checkout-core.js +50 -33
- package/dist/module/form-control-date.d.ts +11 -0
- package/dist/module/form-control-date.js +6 -0
- package/dist/module/form-control-date2.js +68 -0
- package/dist/module/form-control-text2.js +5 -1
- package/dist/module/form-input-masks.js +1 -1
- package/dist/module/generic-info-details2.js +2 -2
- package/dist/module/gross-payment-chart-core2.js +8 -2
- package/dist/module/helpers.js +25 -0
- package/dist/module/{business-address-form.js → identity-address-form.js} +17 -20
- package/dist/module/justifi-business-details.js +22 -5
- package/dist/module/justifi-business-form.js +81 -61
- package/dist/module/justifi-business-list.js +1 -3
- package/dist/module/justifi-checkout.js +31 -21
- 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.js +35 -27
- 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-sezzel-payment-method.d.ts +11 -0
- package/dist/module/justifi-sezzel-payment-method.js +6 -0
- 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 -13
- package/dist/module/legal-address-form.js +5 -9
- package/dist/module/new-payment-method.js +5 -4
- package/dist/module/owner-form.js +46 -20
- package/dist/module/payload-parsers.js +11 -1
- package/dist/module/payment-details-core2.js +9 -3
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payment-method-options.js +34 -12
- 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/saved-payment-method.js +4 -4
- package/dist/module/select-input2.js +1 -1
- package/dist/module/sezzel-payment-method.js +99 -0
- package/dist/module/subaccount-merchant-details2.js +3 -3
- package/dist/module/text-input2.js +1 -1
- package/dist/module/utils2.js +1 -7
- package/dist/module/utils3.js +31 -1
- package/dist/module/utils4.js +7 -1
- package/dist/types/api/Business.d.ts +0 -19
- package/dist/types/api/Checkout.d.ts +63 -2
- package/dist/types/api/ComponentError.d.ts +18 -0
- package/dist/types/api/Identity.d.ts +2 -0
- package/dist/types/api/Payment.d.ts +2 -1
- package/dist/types/api/SubAccount.d.ts +0 -2
- package/dist/types/api/services/checkout.service.d.ts +8 -2
- 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/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 +9 -2
- package/dist/types/components/business-forms/business-form/business-representative/business-representative.d.ts +3 -3
- 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 +9 -3
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +3 -1
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +2 -0
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +1 -0
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +6 -2
- 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 +3 -3
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +11 -11
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +7 -37
- package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +6 -0
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +15 -0
- package/dist/types/components/business-forms/utils/helpers.d.ts +8 -0
- package/dist/types/components/checkout/checkout-actions.d.ts +3 -3
- package/dist/types/components/checkout/checkout-core.d.ts +5 -4
- package/dist/types/components/checkout/checkout.d.ts +1 -1
- package/dist/types/components/checkout/new-payment-method.d.ts +2 -1
- package/dist/types/components/checkout/payment-method-options.d.ts +5 -1
- package/dist/types/components/checkout/payment-method-payload.d.ts +8 -0
- package/dist/types/components/checkout/saved-payment-method.d.ts +2 -1
- package/dist/types/components/checkout/sezzel-payment-method.d.ts +23 -0
- package/dist/types/components/form/form-control-date.d.ts +18 -0
- 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 +329 -52
- package/dist/types/utils/utils.d.ts +0 -1
- package/dist/webcomponents/p-02fa533c.js +1 -0
- package/dist/webcomponents/p-0315876e.entry.js +1 -0
- package/dist/webcomponents/p-0c269feb.entry.js +1 -0
- package/dist/webcomponents/p-0eb56b44.entry.js +1 -0
- package/dist/webcomponents/p-0eb77101.entry.js +1 -0
- package/dist/webcomponents/p-1334f776.entry.js +1 -0
- package/dist/webcomponents/p-19001cc5.entry.js +1 -0
- package/dist/webcomponents/p-2319abaf.entry.js +1 -0
- package/dist/webcomponents/p-26fe62d6.entry.js +1 -0
- package/dist/webcomponents/p-28b38699.js +1 -0
- package/dist/webcomponents/{p-4df6174c.entry.js → p-29376518.entry.js} +1 -1
- package/dist/webcomponents/p-2bee72bd.entry.js +1 -0
- package/dist/webcomponents/p-3302bc76.js +1 -0
- package/dist/webcomponents/p-3adc0688.entry.js +1 -0
- package/dist/webcomponents/p-3fe05c4a.entry.js +1 -0
- package/dist/webcomponents/p-41b1ad3a.entry.js +1 -0
- package/dist/webcomponents/p-4616768c.entry.js +1 -0
- package/dist/webcomponents/p-56780f10.entry.js +1 -0
- package/dist/webcomponents/p-5c269619.js +1 -0
- package/dist/webcomponents/p-5ff7826e.entry.js +1 -0
- package/dist/webcomponents/{p-8482c23f.js → p-65510838.js} +1 -1
- package/dist/webcomponents/p-6f294d5d.js +1 -0
- package/dist/webcomponents/{p-4d50d08a.entry.js → p-7d8d2984.entry.js} +1 -1
- package/dist/webcomponents/p-7da249b8.entry.js +1 -0
- package/dist/webcomponents/p-84b9ffc9.entry.js +1 -0
- package/dist/webcomponents/{p-07b326d0.entry.js → p-8657128b.entry.js} +1 -1
- package/dist/webcomponents/p-8abba4c2.entry.js +1 -0
- package/dist/webcomponents/p-8c9d9812.entry.js +1 -0
- package/dist/webcomponents/p-910bb656.js +1 -0
- package/dist/webcomponents/p-9245777b.js +1 -0
- package/dist/webcomponents/{p-221b9504.entry.js → p-927150b4.entry.js} +1 -1
- package/dist/webcomponents/p-96cebc8b.entry.js +1 -0
- package/dist/webcomponents/{p-0e189d6a.entry.js → p-99d6b67e.entry.js} +1 -1
- package/dist/webcomponents/p-9e3f9e05.entry.js +1 -0
- package/dist/webcomponents/{p-688bb5da.js → p-9ee8ad4d.js} +1 -1
- package/dist/webcomponents/{p-a46174e0.entry.js → p-9f3facf1.entry.js} +1 -1
- package/dist/webcomponents/p-9f529959.entry.js +1 -0
- package/dist/webcomponents/{p-fb49ef28.entry.js → p-a6f170ba.entry.js} +1 -1
- package/dist/webcomponents/p-a8caec98.entry.js +1 -0
- package/dist/webcomponents/p-a90f7ca0.js +1 -0
- package/dist/webcomponents/p-abc03d5a.entry.js +1 -0
- package/dist/webcomponents/p-b318b899.js +1 -0
- package/dist/webcomponents/{p-1bfadb9f.entry.js → p-c1b92cec.entry.js} +1 -1
- package/dist/webcomponents/{p-a68519e5.entry.js → p-c556deda.entry.js} +1 -1
- package/dist/webcomponents/{p-3d4aaa4a.entry.js → p-c6e207f6.entry.js} +1 -1
- package/dist/webcomponents/{p-b68f1dd9.entry.js → p-cdfde1ca.entry.js} +1 -1
- package/dist/webcomponents/p-d69a485a.entry.js +1 -0
- package/dist/webcomponents/p-e2ba8d84.entry.js +1 -0
- package/dist/webcomponents/{p-ebf7c70f.entry.js → p-e4342f49.entry.js} +1 -1
- package/dist/webcomponents/p-ed72a5cc.js +1 -0
- package/dist/webcomponents/{p-6b51cf97.entry.js → p-f0698778.entry.js} +1 -1
- package/dist/webcomponents/p-f4ae621e.entry.js +1 -0
- package/dist/webcomponents/p-f76283a5.entry.js +19 -0
- package/dist/webcomponents/p-fce2b224.entry.js +1 -0
- package/dist/webcomponents/p-fd60d5af.js +1 -0
- package/dist/webcomponents/p-ff211f76.js +1 -0
- package/dist/webcomponents/webcomponents.css +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Business-663db337.js +0 -92
- package/dist/cjs/Identity-1c4528b8.js +0 -49
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +0 -26
- package/dist/cjs/business-form-select-options-7ccd8dca.js +0 -85
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +0 -35
- package/dist/cjs/payload-parsers-9e72e80f.js +0 -99
- 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/test/business-address.e2e.js +0 -9
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +0 -2536
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +0 -97
- package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +0 -97
- package/dist/collection/components/business-forms/schemas/business-owners-schema.js +0 -16
- package/dist/collection/components/business-forms/utils/business-form-select-options.js +0 -80
- package/dist/collection/components/card-form/test/card-form.e2e.js +0 -13
- package/dist/esm/Business-6cc4e473.js +0 -87
- package/dist/esm/Identity-5f8f916f.js +0 -46
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +0 -23
- package/dist/esm/business-form-select-options-6b9293fe.js +0 -82
- package/dist/esm/business-form-types-de9f38cd.js +0 -19
- package/dist/esm/justifi-business-address-form-step.entry.js +0 -31
- package/dist/esm/payload-parsers-caea809d.js +0 -91
- package/dist/esm/utils-546ca6aa.js +0 -8
- package/dist/module/Identity.js +0 -46
- package/dist/module/business-form-select-options.js +0 -82
- 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/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/payment-provisioning/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/types/components/business-forms/utils/business-form-select-options.d.ts +0 -11
- package/dist/webcomponents/p-03b1d0d5.entry.js +0 -1
- package/dist/webcomponents/p-0923e39c.js +0 -1
- package/dist/webcomponents/p-16dcf053.entry.js +0 -1
- package/dist/webcomponents/p-17d72f4a.js +0 -1
- package/dist/webcomponents/p-2df32b4a.entry.js +0 -1
- package/dist/webcomponents/p-34352d04.js +0 -1
- package/dist/webcomponents/p-38ba2848.entry.js +0 -1
- package/dist/webcomponents/p-41870765.entry.js +0 -1
- package/dist/webcomponents/p-461f42b8.entry.js +0 -1
- package/dist/webcomponents/p-48c2400e.js +0 -1
- package/dist/webcomponents/p-491ca87f.js +0 -1
- package/dist/webcomponents/p-5be4e217.entry.js +0 -1
- package/dist/webcomponents/p-60714f2a.entry.js +0 -1
- package/dist/webcomponents/p-60b2344a.js +0 -1
- package/dist/webcomponents/p-63296409.js +0 -1
- package/dist/webcomponents/p-65500b31.entry.js +0 -19
- package/dist/webcomponents/p-6d39b8bc.entry.js +0 -1
- package/dist/webcomponents/p-6ed680e9.js +0 -1
- package/dist/webcomponents/p-7b2cddc7.js +0 -1
- package/dist/webcomponents/p-7ec301b5.entry.js +0 -1
- package/dist/webcomponents/p-817211f2.entry.js +0 -1
- package/dist/webcomponents/p-9207ccb2.entry.js +0 -1
- package/dist/webcomponents/p-975ab96e.js +0 -1
- package/dist/webcomponents/p-9b99370e.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-a4122c35.entry.js +0 -1
- package/dist/webcomponents/p-af8363a1.entry.js +0 -1
- package/dist/webcomponents/p-b1bc23af.entry.js +0 -1
- package/dist/webcomponents/p-b37d6888.entry.js +0 -1
- package/dist/webcomponents/p-b5a3bf86.entry.js +0 -1
- package/dist/webcomponents/p-b8f22856.js +0 -1
- package/dist/webcomponents/p-cb8f9cb8.entry.js +0 -1
- package/dist/webcomponents/p-d0761829.entry.js +0 -1
- package/dist/webcomponents/p-da34bba7.entry.js +0 -1
- package/dist/webcomponents/p-dbe32e75.entry.js +0 -1
- package/dist/webcomponents/p-e0c1cba8.js +0 -1
- package/dist/webcomponents/p-e924f2e1.entry.js +0 -1
- package/dist/webcomponents/p-ea03b424.entry.js +0 -1
- package/dist/webcomponents/p-ec230480.entry.js +0 -1
- package/dist/webcomponents/p-eed5f4ad.entry.js +0 -1
- package/dist/webcomponents/p-fe8a94c1.entry.js +0 -1
- /package/dist/collection/components/business-forms/{business-form/business-address/business-address-form.css → owner-form/identity-address/identity-address-form.css} +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
|
@@ -13,6 +13,60 @@ import { Business } from "../../../api/Business";
|
|
|
13
13
|
* @exportedPart input-invalid: Invalid state for inputfs
|
|
14
14
|
*/
|
|
15
15
|
export class BusinessForm {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.instantiateBusiness = (data) => {
|
|
18
|
+
const business = new Business(data);
|
|
19
|
+
this.formController.setInitialValues(Object.assign({}, business));
|
|
20
|
+
};
|
|
21
|
+
this.sendData = async () => {
|
|
22
|
+
this.isLoading = true;
|
|
23
|
+
try {
|
|
24
|
+
const values = this.formController.values.getValue();
|
|
25
|
+
const initialValues = this.formController.getInitialValues();
|
|
26
|
+
const payload = parseBusiness(values, initialValues);
|
|
27
|
+
const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
|
|
28
|
+
this.handleReponse(response);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
this.errorMessage = BusinessFormServerErrors.patchData;
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
this.isLoading = false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
this.fetchData = async () => {
|
|
38
|
+
this.isLoading = true;
|
|
39
|
+
try {
|
|
40
|
+
const response = await this.api.get(this.businessEndpoint);
|
|
41
|
+
this.instantiateBusiness(response.data);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.errorMessage = BusinessFormServerErrors.fetchData;
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
this.isLoading = false;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
this.validateAndSubmit = (event) => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
this.formController.validateAndSubmit(this.sendData);
|
|
53
|
+
};
|
|
54
|
+
this.authToken = undefined;
|
|
55
|
+
this.businessId = undefined;
|
|
56
|
+
this.hideErrors = false;
|
|
57
|
+
this.formTitle = 'Business Information';
|
|
58
|
+
this.removeTitle = false;
|
|
59
|
+
this.isLoading = false;
|
|
60
|
+
this.errorMessage = undefined;
|
|
61
|
+
}
|
|
62
|
+
fireClickEvents(event) {
|
|
63
|
+
console.warn('`clickEvent` is deprecated and will be removed in the next major release. Please use `click-event` instead.');
|
|
64
|
+
this.clickEventNew.emit(event);
|
|
65
|
+
this.clickEventOld.emit(event);
|
|
66
|
+
}
|
|
67
|
+
get title() {
|
|
68
|
+
return this.removeTitle ? '' : this.formTitle;
|
|
69
|
+
}
|
|
16
70
|
get disabledState() {
|
|
17
71
|
return this.isLoading;
|
|
18
72
|
}
|
|
@@ -22,16 +76,6 @@ export class BusinessForm {
|
|
|
22
76
|
get businessEndpoint() {
|
|
23
77
|
return `entities/business/${this.businessId}`;
|
|
24
78
|
}
|
|
25
|
-
constructor() {
|
|
26
|
-
this.authToken = undefined;
|
|
27
|
-
this.businessId = undefined;
|
|
28
|
-
this.hideErrors = false;
|
|
29
|
-
this.isLoading = false;
|
|
30
|
-
this.errorMessage = undefined;
|
|
31
|
-
this.sendData = this.sendData.bind(this);
|
|
32
|
-
this.fetchData = this.fetchData.bind(this);
|
|
33
|
-
this.validateAndSubmit = this.validateAndSubmit.bind(this);
|
|
34
|
-
}
|
|
35
79
|
componentWillLoad() {
|
|
36
80
|
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
37
81
|
const missingBusinessIdMessage = 'Warning: Missing business-id. The form requires an existing business-id to function.';
|
|
@@ -43,42 +87,15 @@ export class BusinessForm {
|
|
|
43
87
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
44
88
|
this.fetchData();
|
|
45
89
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
const values = this.formController.values.getValue();
|
|
50
|
-
const initialValues = this.formController.getInitialValues();
|
|
51
|
-
const payload = parseBusiness(values, initialValues);
|
|
52
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
|
|
53
|
-
this.submitted.emit({ data: response });
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
90
|
+
handleReponse(response) {
|
|
91
|
+
if (response.error) {
|
|
56
92
|
this.errorMessage = BusinessFormServerErrors.patchData;
|
|
57
93
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async fetchData() {
|
|
63
|
-
this.isLoading = true;
|
|
64
|
-
try {
|
|
65
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
66
|
-
const business = new Business(response.data);
|
|
67
|
-
this.formController.setInitialValues(Object.assign({}, business));
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
this.errorMessage = BusinessFormServerErrors.fetchData;
|
|
71
|
-
}
|
|
72
|
-
finally {
|
|
73
|
-
this.isLoading = false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
validateAndSubmit(event) {
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
this.formController.validateAndSubmit(this.sendData);
|
|
94
|
+
this.submitted.emit({ data: response });
|
|
95
|
+
this.instantiateBusiness(response.data);
|
|
79
96
|
}
|
|
80
97
|
render() {
|
|
81
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("div", { class: "row gap-3" }, h("div", { class: "col-12 mb-4" }, h("h1", null,
|
|
98
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", { onSubmit: this.validateAndSubmit }, h("div", { class: "row gap-3" }, h("div", { class: "col-12 mb-4" }, h("h1", null, this.title)), this.showErrors && FormAlert(this.errorMessage), h("div", { class: "col-12 mb-4" }, h("justifi-business-core-info", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-legal-address-form", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-additional-questions", { formController: this.formController })), h("div", { class: "col-12 mb-4" }, h("justifi-business-representative", { formController: this.formController })), h("div", { class: "col-12 d-flex flex-row-reverse" }, h("button", { type: "submit", class: "btn btn-primary jfi-submit-button", disabled: this.disabledState, onClick: () => this.fireClickEvents({ name: BusinessFormClickActions.submit }) }, this.isLoading ? 'Loading...' : 'Submit'))))));
|
|
82
99
|
}
|
|
83
100
|
static get is() { return "justifi-business-form"; }
|
|
84
101
|
static get originalStyleUrls() {
|
|
@@ -144,6 +161,42 @@ export class BusinessForm {
|
|
|
144
161
|
"attribute": "hide-errors",
|
|
145
162
|
"reflect": false,
|
|
146
163
|
"defaultValue": "false"
|
|
164
|
+
},
|
|
165
|
+
"formTitle": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"mutable": false,
|
|
168
|
+
"complexType": {
|
|
169
|
+
"original": "string",
|
|
170
|
+
"resolved": "string",
|
|
171
|
+
"references": {}
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"optional": true,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
},
|
|
179
|
+
"attribute": "form-title",
|
|
180
|
+
"reflect": false,
|
|
181
|
+
"defaultValue": "'Business Information'"
|
|
182
|
+
},
|
|
183
|
+
"removeTitle": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "boolean",
|
|
188
|
+
"resolved": "boolean",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": ""
|
|
196
|
+
},
|
|
197
|
+
"attribute": "remove-title",
|
|
198
|
+
"reflect": false,
|
|
199
|
+
"defaultValue": "false"
|
|
147
200
|
}
|
|
148
201
|
};
|
|
149
202
|
}
|
|
@@ -155,8 +208,29 @@ export class BusinessForm {
|
|
|
155
208
|
}
|
|
156
209
|
static get events() {
|
|
157
210
|
return [{
|
|
158
|
-
"method": "
|
|
159
|
-
"name": "
|
|
211
|
+
"method": "submitted",
|
|
212
|
+
"name": "submitted",
|
|
213
|
+
"bubbles": true,
|
|
214
|
+
"cancelable": true,
|
|
215
|
+
"composed": true,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": ""
|
|
219
|
+
},
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "BusinessFormSubmitEvent",
|
|
222
|
+
"resolved": "BusinessFormSubmitEvent",
|
|
223
|
+
"references": {
|
|
224
|
+
"BusinessFormSubmitEvent": {
|
|
225
|
+
"location": "import",
|
|
226
|
+
"path": "../utils/business-form-types",
|
|
227
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormSubmitEvent"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
"method": "clickEventNew",
|
|
233
|
+
"name": "click-event",
|
|
160
234
|
"bubbles": true,
|
|
161
235
|
"cancelable": true,
|
|
162
236
|
"composed": true,
|
|
@@ -176,8 +250,8 @@ export class BusinessForm {
|
|
|
176
250
|
}
|
|
177
251
|
}
|
|
178
252
|
}, {
|
|
179
|
-
"method": "
|
|
180
|
-
"name": "
|
|
253
|
+
"method": "clickEventOld",
|
|
254
|
+
"name": "clickEvent",
|
|
181
255
|
"bubbles": true,
|
|
182
256
|
"cancelable": true,
|
|
183
257
|
"composed": true,
|
|
@@ -186,13 +260,13 @@ export class BusinessForm {
|
|
|
186
260
|
"text": ""
|
|
187
261
|
},
|
|
188
262
|
"complexType": {
|
|
189
|
-
"original": "
|
|
190
|
-
"resolved": "
|
|
263
|
+
"original": "BusinessFormClickEvent",
|
|
264
|
+
"resolved": "BusinessFormClickEvent",
|
|
191
265
|
"references": {
|
|
192
|
-
"
|
|
266
|
+
"BusinessFormClickEvent": {
|
|
193
267
|
"location": "import",
|
|
194
268
|
"path": "../utils/business-form-types",
|
|
195
|
-
"id": "src/components/business-forms/utils/business-form-types.ts::
|
|
269
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::BusinessFormClickEvent"
|
|
196
270
|
}
|
|
197
271
|
}
|
|
198
272
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { PHONE_MASKS } from "../../../../utils/form-input-masks";
|
|
3
|
+
import { deconstructDate } from "../../utils/helpers";
|
|
3
4
|
export class BusinessRepresentative {
|
|
4
5
|
constructor() {
|
|
6
|
+
this.inputHandler = (name, value) => {
|
|
7
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { [name]: value }) }));
|
|
8
|
+
};
|
|
9
|
+
this.onAddressFormUpdate = (values) => {
|
|
10
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { address: Object.assign(Object.assign({}, this.formController.values.getValue().representative.address), values) }) }));
|
|
11
|
+
};
|
|
12
|
+
this.onDateOfBirthUpdate = (event) => {
|
|
13
|
+
const dob_values = deconstructDate(event.detail);
|
|
14
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }) }));
|
|
15
|
+
};
|
|
5
16
|
this.formController = undefined;
|
|
6
17
|
this.errors = {};
|
|
7
18
|
this.representative = {};
|
|
8
|
-
this.inputHandler = this.inputHandler.bind(this);
|
|
9
|
-
this.onAddressFormUpdate = this.onAddressFormUpdate.bind(this);
|
|
10
19
|
}
|
|
11
20
|
componentDidLoad() {
|
|
12
21
|
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors.representative)));
|
|
13
22
|
this.formController.values.subscribe(values => (this.representative = Object.assign({}, values.representative)));
|
|
14
23
|
}
|
|
15
|
-
inputHandler(name, value) {
|
|
16
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { [name]: value }) }));
|
|
17
|
-
}
|
|
18
|
-
onAddressFormUpdate(values) {
|
|
19
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { representative: Object.assign(Object.assign({}, this.formController.values.getValue().representative), { address: Object.assign(Object.assign({}, this.formController.values.getValue().representative.address), values) }) }));
|
|
20
|
-
}
|
|
21
24
|
render() {
|
|
22
25
|
const representativeDefaultValue = this.formController.getInitialValues().representative;
|
|
23
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, 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-
|
|
24
|
-
{ label: 'Select Prefix', value: '' },
|
|
25
|
-
{ label: 'Mrs.', value: 'Mrs.' },
|
|
26
|
-
], 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: "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) }))))));
|
|
26
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, 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 col-md-4" }, h("form-control-date", { name: "dob_full", label: "Birth Date", defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_full, error: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), h("div", { class: "col-12 col-md-8" }, h("form-control-number", { name: "identification_number", label: "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 }))))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "justifi-business-representative"; }
|
|
29
29
|
static get originalStyleUrls() {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import StateOptions from "../../../../utils/state-options";
|
|
3
|
+
import { filterPostalInput } from "../../../form/utils";
|
|
2
4
|
/**
|
|
3
5
|
* @exportedPart label: Label for inputs
|
|
4
6
|
* @exportedPart input: The input fields
|
|
@@ -19,9 +21,9 @@ export class LegalAddressForm {
|
|
|
19
21
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { legal_address: Object.assign(Object.assign({}, this.formController.values.getValue().legal_address), { [name]: value }) }));
|
|
20
22
|
}
|
|
21
23
|
render() {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
23
25
|
const legalAddressDefaultValue = this.formController.getInitialValues().legal_address;
|
|
24
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, 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: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.line1 })), h("div", { class: "col-12" }, h("form-control-text", { name: "line2", label: "Address Line 2", inputHandler:
|
|
26
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, 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: (_b = (_a = this.errors) === null || _a === void 0 ? void 0 : _a.legal_address) === null || _b === void 0 ? void 0 : _b.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: (_d = (_c = this.errors) === null || _c === void 0 ? void 0 : _c.legal_address) === null || _d === void 0 ? void 0 : _d.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: (_f = (_e = this.errors) === null || _e === void 0 ? void 0 : _e.legal_address) === null || _f === void 0 ? void 0 : _f.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: (_h = (_g = this.errors) === null || _g === void 0 ? void 0 : _g.legal_address) === null || _h === void 0 ? void 0 : _h.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: (_k = (_j = this.errors) === null || _j === void 0 ? void 0 : _j.legal_address) === null || _k === void 0 ? void 0 : _k.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: (_m = (_l = this.errors) === null || _l === void 0 ? void 0 : _l.legal_address) === null || _m === void 0 ? void 0 : _m.country,
|
|
25
27
|
// just for now so we skip handling country specificities
|
|
26
28
|
disabled: true }))))));
|
|
27
29
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import StateOptions from "../../../../utils/state-options";
|
|
3
|
-
|
|
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 BusinessAddressForm {
|
|
|
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,21 +4,26 @@ 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 {
|
|
10
|
+
import { deconstructDate } from "../utils/helpers";
|
|
11
|
+
import { OwnerFormServerErrors, OwnerFormClickActions } from "../utils/business-form-types";
|
|
11
12
|
export class BusinessOwnerForm {
|
|
12
13
|
constructor() {
|
|
14
|
+
this.instantiateOwner = (data) => {
|
|
15
|
+
this.owner = Object.assign({}, new Owner(data));
|
|
16
|
+
this.formController.setInitialValues(this.owner);
|
|
17
|
+
};
|
|
13
18
|
this.fetchData = async () => {
|
|
14
19
|
if (!this.ownerId) {
|
|
20
|
+
this.instantiateOwner({});
|
|
15
21
|
return;
|
|
16
22
|
}
|
|
17
23
|
this.isLoading = true;
|
|
18
24
|
try {
|
|
19
25
|
const response = await this.api.get(this.identityEndpoint);
|
|
20
|
-
this.
|
|
21
|
-
this.formController.setInitialValues(this.owner);
|
|
26
|
+
this.instantiateOwner(response.data);
|
|
22
27
|
}
|
|
23
28
|
catch (error) {
|
|
24
29
|
this.serverError.emit({ data: error, message: OwnerFormServerErrors.fetchData });
|
|
@@ -55,9 +60,26 @@ export class BusinessOwnerForm {
|
|
|
55
60
|
this.onAddressFormUpdate = (values) => {
|
|
56
61
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
|
|
57
62
|
};
|
|
58
|
-
this.
|
|
63
|
+
this.onDateOfBirthUpdate = (event) => {
|
|
64
|
+
if (event.detail === '') {
|
|
65
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: null, dob_month: null, dob_year: null }));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const dob_values = deconstructDate(event.detail);
|
|
69
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
this.handleAddOwner = () => {
|
|
73
|
+
const eventName = this.ownerId ? OwnerFormClickActions.updateOwner : OwnerFormClickActions.addOwner;
|
|
74
|
+
this.clickEvent.emit({ name: eventName });
|
|
75
|
+
};
|
|
76
|
+
this.handleRemoveOwner = () => {
|
|
77
|
+
this.removeOwner(this.ownerId);
|
|
78
|
+
this.clickEvent.emit({ name: OwnerFormClickActions.removeOwner });
|
|
79
|
+
};
|
|
80
|
+
this.validateAndSubmit = async (event) => {
|
|
59
81
|
event.preventDefault();
|
|
60
|
-
const isValid = this.
|
|
82
|
+
const isValid = await this.validate();
|
|
61
83
|
if (isValid) {
|
|
62
84
|
this.submit();
|
|
63
85
|
}
|
|
@@ -65,6 +87,7 @@ export class BusinessOwnerForm {
|
|
|
65
87
|
this.authToken = undefined;
|
|
66
88
|
this.ownerId = undefined;
|
|
67
89
|
this.businessId = undefined;
|
|
90
|
+
this.allowOptionalFields = undefined;
|
|
68
91
|
this.removeOwner = undefined;
|
|
69
92
|
this.newFormOpen = undefined;
|
|
70
93
|
this.ownersLength = undefined;
|
|
@@ -107,6 +130,7 @@ export class BusinessOwnerForm {
|
|
|
107
130
|
return false;
|
|
108
131
|
}
|
|
109
132
|
else {
|
|
133
|
+
this.instantiateOwner(response.data);
|
|
110
134
|
return true;
|
|
111
135
|
}
|
|
112
136
|
}
|
|
@@ -114,7 +138,7 @@ export class BusinessOwnerForm {
|
|
|
114
138
|
const missingAuthTokenMessage = 'Warning: Missing auth-token. The form will not be functional without it.';
|
|
115
139
|
if (!this.authToken)
|
|
116
140
|
console.error(missingAuthTokenMessage);
|
|
117
|
-
this.formController = new FormController(
|
|
141
|
+
this.formController = new FormController(identitySchema('owner', this.allowOptionalFields));
|
|
118
142
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
119
143
|
this.fetchData();
|
|
120
144
|
}
|
|
@@ -126,15 +150,15 @@ export class BusinessOwnerForm {
|
|
|
126
150
|
return this.formController.validate();
|
|
127
151
|
}
|
|
128
152
|
async submit() {
|
|
129
|
-
|
|
153
|
+
const isValid = await this.validate();
|
|
154
|
+
if (isValid) {
|
|
155
|
+
return this.sendData();
|
|
156
|
+
}
|
|
130
157
|
}
|
|
131
158
|
render() {
|
|
132
159
|
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)))));
|
|
160
|
+
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 col-md-4" }, h("form-control-date", { name: "dob_full", label: "Birth Date", defaultValue: ownerDefaultValue === null || ownerDefaultValue === void 0 ? void 0 : ownerDefaultValue.dob_full, error: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), h("div", { class: "col-12 col-md-8" }, h("form-control-number", { name: "identification_number", label: "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 &&
|
|
161
|
+
h("button", { type: "button", class: "btn btn-danger", onClick: () => this.handleRemoveOwner() }, "Remove owner"))), h("hr", null)))));
|
|
138
162
|
}
|
|
139
163
|
static get is() { return "justifi-owner-form"; }
|
|
140
164
|
static get encapsulation() { return "shadow"; }
|
|
@@ -201,6 +225,23 @@ export class BusinessOwnerForm {
|
|
|
201
225
|
"attribute": "business-id",
|
|
202
226
|
"reflect": false
|
|
203
227
|
},
|
|
228
|
+
"allowOptionalFields": {
|
|
229
|
+
"type": "boolean",
|
|
230
|
+
"mutable": false,
|
|
231
|
+
"complexType": {
|
|
232
|
+
"original": "boolean",
|
|
233
|
+
"resolved": "boolean",
|
|
234
|
+
"references": {}
|
|
235
|
+
},
|
|
236
|
+
"required": false,
|
|
237
|
+
"optional": true,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [],
|
|
240
|
+
"text": ""
|
|
241
|
+
},
|
|
242
|
+
"attribute": "allow-optional-fields",
|
|
243
|
+
"reflect": false
|
|
244
|
+
},
|
|
204
245
|
"removeOwner": {
|
|
205
246
|
"type": "unknown",
|
|
206
247
|
"mutable": false,
|
|
@@ -282,6 +323,27 @@ export class BusinessOwnerForm {
|
|
|
282
323
|
}
|
|
283
324
|
}
|
|
284
325
|
}
|
|
326
|
+
}, {
|
|
327
|
+
"method": "clickEvent",
|
|
328
|
+
"name": "click-event",
|
|
329
|
+
"bubbles": true,
|
|
330
|
+
"cancelable": true,
|
|
331
|
+
"composed": true,
|
|
332
|
+
"docs": {
|
|
333
|
+
"tags": [],
|
|
334
|
+
"text": ""
|
|
335
|
+
},
|
|
336
|
+
"complexType": {
|
|
337
|
+
"original": "OwnerFormClickEvent",
|
|
338
|
+
"resolved": "OwnerFormClickEvent",
|
|
339
|
+
"references": {
|
|
340
|
+
"OwnerFormClickEvent": {
|
|
341
|
+
"location": "import",
|
|
342
|
+
"path": "../utils/business-form-types",
|
|
343
|
+
"id": "src/components/business-forms/utils/business-form-types.ts::OwnerFormClickEvent"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
285
347
|
}, {
|
|
286
348
|
"method": "formLoading",
|
|
287
349
|
"name": "formLoading",
|