@justifi/webcomponents 4.4.0 → 4.5.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/{Api-7303478d.js → Api-d2df6e84.js} +16 -4
- package/dist/cjs/Api-d2df6e84.js.map +1 -0
- package/dist/cjs/Payout-4906a445.js +116 -0
- package/dist/cjs/Payout-4906a445.js.map +1 -0
- package/dist/cjs/{business-form-schema-63b311b2.js → business-form-schema-725ec6f5.js} +40 -22
- package/dist/cjs/business-form-schema-725ec6f5.js.map +1 -0
- package/dist/cjs/form-control-datepart_2.cjs.entry.js +107 -0
- package/dist/cjs/form-control-datepart_2.cjs.entry.js.map +1 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js +65 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js.map +1 -0
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +99 -12
- package/dist/cjs/form-control-number_3.cjs.entry.js.map +1 -0
- package/dist/cjs/form-control-select.cjs.entry.js +47 -0
- package/dist/cjs/form-control-select.cjs.entry.js.map +1 -0
- package/dist/cjs/{index-83b2ec02.js → index-4ffc90c0.js} +10 -1
- package/dist/cjs/index-4ffc90c0.js.map +1 -0
- package/dist/cjs/index-5a880722.js +3233 -0
- package/dist/cjs/index-5a880722.js.map +1 -0
- package/dist/cjs/{index.esm-7e12ce07.js → index.esm-84a0a7a8.js} +1 -19
- package/dist/cjs/index.esm-84a0a7a8.js.map +1 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +396 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +98 -16
- package/dist/cjs/justifi-business-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-business-list.cjs.entry.js +189 -0
- package/dist/cjs/justifi-business-list.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +30 -0
- package/dist/cjs/justifi-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-details.cjs.entry.js +63 -0
- package/dist/cjs/justifi-payment-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +7 -5
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +49 -47
- package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payout-details.cjs.entry.js +61 -0
- package/dist/cjs/justifi-payout-details.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +64 -54
- package/dist/cjs/justifi-payouts-list.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +156 -0
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-table.cjs.entry.js +68 -0
- package/dist/cjs/justifi-table.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select-input_2.cjs.entry.js +1 -1
- package/dist/cjs/table-utils-617126e5.js +13 -0
- package/dist/cjs/table-utils-617126e5.js.map +1 -0
- package/dist/cjs/{utils-4ee7e080.js → utils-0fd61dbd.js} +43 -104
- package/dist/cjs/utils-0fd61dbd.js.map +1 -0
- package/dist/cjs/utils-a5b5bfdf.js +35 -0
- package/dist/cjs/utils-a5b5bfdf.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/cjs/webcomponents.cjs.js.map +1 -1
- package/dist/collection/api/Api.js +15 -3
- package/dist/collection/api/Api.js.map +1 -1
- package/dist/collection/api/Business.js +50 -0
- package/dist/collection/api/Business.js.map +1 -0
- package/dist/collection/api/Payment.js.map +1 -1
- package/dist/collection/api/Payout.js +9 -0
- package/dist/collection/api/Payout.js.map +1 -1
- package/dist/collection/api/Proceed.js +42 -0
- package/dist/collection/api/Proceed.js.map +1 -0
- package/dist/collection/api/shared.js +2 -0
- package/dist/collection/api/shared.js.map +1 -0
- package/dist/collection/collection-manifest.json +13 -1
- package/dist/collection/components/business-form/additional-questions/additional-questions.js +59 -0
- package/dist/collection/components/business-form/additional-questions/additional-questions.js.map +1 -0
- package/dist/collection/components/business-form/business-address/business-address-form.js +1 -1
- package/dist/collection/components/business-form/business-address/business-address-form.js.map +1 -1
- package/dist/collection/components/business-form/business-address/test/business-address.spec.js +22 -18
- package/dist/collection/components/business-form/business-address/test/business-address.spec.js.map +1 -1
- package/dist/collection/components/business-form/business-form-schema.js +48 -37
- package/dist/collection/components/business-form/business-form-schema.js.map +1 -1
- package/dist/collection/components/business-form/business-form.css +5283 -43
- package/dist/collection/components/business-form/business-form.js +83 -6
- package/dist/collection/components/business-form/business-form.js.map +1 -1
- package/dist/collection/components/business-form/{businessForm.stories.js → business-form.stories.js} +8 -8
- package/dist/collection/components/business-form/business-form.stories.js.map +1 -0
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +10 -17
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map +1 -1
- package/dist/collection/components/business-form/business-owners/business-owners.css +5283 -0
- package/dist/collection/components/business-form/business-owners/business-owners.js +48 -37
- package/dist/collection/components/business-form/business-owners/business-owners.js.map +1 -1
- package/dist/collection/components/business-form/business-representative/business-representative.js +12 -17
- package/dist/collection/components/business-form/business-representative/business-representative.js.map +1 -1
- package/dist/collection/components/business-form/test/business-form.spec.js +44 -0
- package/dist/collection/components/business-form/test/business-form.spec.js.map +1 -0
- package/dist/collection/components/business-list/business-list.css +576 -0
- package/dist/collection/components/business-list/business-list.js +209 -0
- package/dist/collection/components/business-list/business-list.js.map +1 -0
- package/dist/collection/components/business-list/business-list.stories.js +68 -0
- package/dist/collection/components/business-list/business-list.stories.js.map +1 -0
- package/dist/collection/components/business-list/example.js +12 -0
- package/dist/collection/components/details/details.css +7983 -0
- package/dist/collection/components/details/details.js +66 -0
- package/dist/collection/components/details/details.js.map +1 -0
- package/dist/collection/components/details/utils.js +10 -0
- package/dist/collection/components/details/utils.js.map +1 -0
- package/dist/collection/components/form/form-control-datepart.js +233 -0
- package/dist/collection/components/form/form-control-datepart.js.map +1 -0
- package/dist/collection/components/form/form-control-monetary.js +186 -0
- package/dist/collection/components/form/form-control-monetary.js.map +1 -0
- package/dist/collection/components/form/form-control-number-masked.js +217 -0
- package/dist/collection/components/form/form-control-number-masked.js.map +1 -0
- package/dist/collection/components/form/form-control-number.css +1818 -0
- package/dist/collection/components/form/form-control-number.js +194 -0
- package/dist/collection/components/form/form-control-number.js.map +1 -0
- package/dist/collection/components/form/form-control-select.css +6 -0
- package/dist/collection/components/form/form-control-select.js +36 -4
- package/dist/collection/components/form/form-control-select.js.map +1 -1
- package/dist/collection/components/form/form-control-text.css +7 -0
- package/dist/collection/components/form/form-control-text.js +45 -3
- package/dist/collection/components/form/form-control-text.js.map +1 -1
- package/dist/collection/components/form/form.js +16 -8
- package/dist/collection/components/form/form.js.map +1 -1
- package/dist/collection/components/legal-address-form/legal-address-form-schema.js +11 -0
- package/dist/collection/components/legal-address-form/legal-address-form-schema.js.map +1 -0
- package/dist/collection/components/legal-address-form/legal-address-form.css +2489 -0
- package/dist/collection/components/legal-address-form/legal-address-form.js +90 -0
- package/dist/collection/components/legal-address-form/legal-address-form.js.map +1 -0
- package/dist/collection/components/payment-details/example.js +12 -0
- package/dist/collection/components/payment-details/payment-details.css +7983 -0
- package/dist/collection/components/payment-details/payment-details.js +129 -0
- package/dist/collection/components/payment-details/payment-details.js.map +1 -0
- package/dist/collection/components/payment-details/payment-details.stories.js +47 -0
- package/dist/collection/components/payment-details/payment-details.stories.js.map +1 -0
- package/dist/collection/components/payments-list/payments-list.css +0 -7380
- package/dist/collection/components/payments-list/payments-list.js +69 -43
- package/dist/collection/components/payments-list/payments-list.js.map +1 -1
- package/dist/collection/components/payments-list/payments-list.stories.js +10 -10
- package/dist/collection/components/payments-list/payments-list.stories.js.map +1 -1
- package/dist/collection/components/payments-list/test/payments-list.spec.js +3 -54
- package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -1
- package/dist/collection/components/payout-details/example.js +12 -0
- package/dist/collection/components/payout-details/payout-details.css +7983 -0
- package/dist/collection/components/payout-details/payout-details.js +126 -0
- package/dist/collection/components/payout-details/payout-details.js.map +1 -0
- package/dist/collection/components/payout-details/payout-details.stories.js +47 -0
- package/dist/collection/components/payout-details/payout-details.stories.js.map +1 -0
- package/dist/collection/components/payouts-list/example.js +12 -0
- package/dist/collection/components/payouts-list/payouts-list.css +0 -7407
- package/dist/collection/components/payouts-list/payouts-list.js +82 -48
- package/dist/collection/components/payouts-list/payouts-list.js.map +1 -1
- package/dist/collection/components/payouts-list/payouts-list.stories.js +10 -10
- package/dist/collection/components/payouts-list/payouts-list.stories.js.map +1 -1
- package/dist/collection/components/proceeds-list/example.js +12 -0
- package/dist/collection/components/proceeds-list/proceeds-list.css +576 -0
- package/dist/collection/components/proceeds-list/proceeds-list.js +207 -0
- package/dist/collection/components/proceeds-list/proceeds-list.js.map +1 -0
- package/dist/collection/components/proceeds-list/proceeds-list.stories.js +69 -0
- package/dist/collection/components/proceeds-list/proceeds-list.stories.js.map +1 -0
- package/dist/collection/components/table/table-utils.js +8 -0
- package/dist/collection/components/table/table-utils.js.map +1 -0
- package/dist/collection/components/table/table.css +8077 -0
- package/dist/collection/components/table/table.js +215 -0
- package/dist/collection/components/table/table.js.map +1 -0
- package/dist/collection/components/table/test/table.spec.js +59 -0
- package/dist/collection/components/table/test/table.spec.js.map +1 -0
- package/dist/collection/utils/country-options.js +202 -0
- package/dist/collection/utils/country-options.js.map +1 -0
- package/dist/collection/utils/phone-masks.js +4 -0
- package/dist/collection/utils/phone-masks.js.map +1 -0
- package/dist/collection/utils/utils.js +40 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/Api.js +15 -3
- package/dist/components/Api.js.map +1 -1
- package/dist/components/Payout.js +113 -0
- package/dist/components/Payout.js.map +1 -0
- package/dist/components/additional-questions.js +51 -0
- package/dist/components/additional-questions.js.map +1 -0
- package/dist/components/business-address-form.js +8 -2
- package/dist/components/business-address-form.js.map +1 -1
- package/dist/components/business-generic-info.js +61 -35
- package/dist/components/business-generic-info.js.map +1 -1
- package/dist/components/business-owners.js +52 -36
- package/dist/components/business-owners.js.map +1 -1
- package/dist/components/business-representative.js +31 -15
- package/dist/components/business-representative.js.map +1 -1
- package/dist/components/details.js +66 -0
- package/dist/components/details.js.map +1 -0
- package/dist/components/form-control-datepart.d.ts +11 -0
- package/dist/components/form-control-datepart.js +8 -0
- package/dist/components/form-control-datepart.js.map +1 -0
- package/dist/components/form-control-datepart2.js +97 -0
- package/dist/components/form-control-datepart2.js.map +1 -0
- package/dist/components/form-control-monetary.d.ts +11 -0
- package/dist/components/form-control-monetary.js +8 -0
- package/dist/components/form-control-monetary.js.map +1 -0
- package/dist/components/form-control-monetary2.js +82 -0
- package/dist/components/form-control-monetary2.js.map +1 -0
- package/dist/components/form-control-number-masked.d.ts +11 -0
- package/dist/components/form-control-number-masked.js +8 -0
- package/dist/components/form-control-number-masked.js.map +1 -0
- package/dist/components/form-control-number-masked2.js +81 -0
- package/dist/components/form-control-number-masked2.js.map +1 -0
- package/dist/components/form-control-number.d.ts +11 -0
- package/dist/components/form-control-number.js +8 -0
- package/dist/components/form-control-number.js.map +1 -0
- package/dist/components/form-control-number2.js +70 -0
- package/dist/components/form-control-number2.js.map +1 -0
- package/dist/components/form-control-select.js +2 -2
- package/dist/components/form-control-select2.js +20 -7
- package/dist/components/form-control-select2.js.map +1 -1
- package/dist/components/form-control-text2.js +23 -4
- package/dist/components/form-control-text2.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.esm.js +1 -18
- package/dist/components/index.esm.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +3231 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/justifi-additional-questions.d.ts +11 -0
- package/dist/components/justifi-additional-questions.js +8 -0
- package/dist/components/justifi-additional-questions.js.map +1 -0
- package/dist/components/justifi-business-form.js +146 -28
- package/dist/components/justifi-business-form.js.map +1 -1
- package/dist/components/justifi-business-generic-info.js +1 -1
- package/dist/components/justifi-business-list.d.ts +11 -0
- package/dist/components/justifi-business-list.js +215 -0
- package/dist/components/justifi-business-list.js.map +1 -0
- package/dist/components/justifi-details.d.ts +11 -0
- package/dist/components/justifi-details.js +8 -0
- package/dist/components/justifi-details.js.map +1 -0
- package/dist/components/justifi-legal-address-form.d.ts +11 -0
- package/dist/components/justifi-legal-address-form.js +8 -0
- package/dist/components/justifi-legal-address-form.js.map +1 -0
- package/dist/components/justifi-payment-details.d.ts +11 -0
- package/dist/components/justifi-payment-details.js +88 -0
- package/dist/components/justifi-payment-details.js.map +1 -0
- package/dist/components/justifi-payment-form.js +2 -1
- package/dist/components/justifi-payment-form.js.map +1 -1
- package/dist/components/justifi-payments-list.js +52 -45
- package/dist/components/justifi-payments-list.js.map +1 -1
- package/dist/components/justifi-payout-details.d.ts +11 -0
- package/dist/components/justifi-payout-details.js +86 -0
- package/dist/components/justifi-payout-details.js.map +1 -0
- package/dist/components/justifi-payouts-list.js +65 -50
- package/dist/components/justifi-payouts-list.js.map +1 -1
- package/dist/components/justifi-proceeds-list.d.ts +11 -0
- package/dist/components/justifi-proceeds-list.js +182 -0
- package/dist/components/justifi-proceeds-list.js.map +1 -0
- package/dist/components/justifi-table.d.ts +11 -0
- package/dist/components/justifi-table.js +8 -0
- package/dist/components/justifi-table.js.map +1 -0
- package/dist/components/legal-address-form.js +271 -0
- package/dist/components/legal-address-form.js.map +1 -0
- package/dist/components/payment-method-form.js +6 -4
- package/dist/components/payment-method-form.js.map +1 -1
- package/dist/components/phone-masks.js +7 -0
- package/dist/components/phone-masks.js.map +1 -0
- package/dist/components/table.js +94 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/utils.js +41 -102
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/{Api-436dfa09.js → Api-a95f17ac.js} +16 -4
- package/dist/esm/Api-a95f17ac.js.map +1 -0
- package/dist/esm/Payout-9a1f2859.js +113 -0
- package/dist/esm/Payout-9a1f2859.js.map +1 -0
- package/dist/esm/{business-form-schema-30c48693.js → business-form-schema-5885d3d6.js} +40 -22
- package/dist/esm/business-form-schema-5885d3d6.js.map +1 -0
- package/dist/esm/form-control-datepart_2.entry.js +102 -0
- package/dist/esm/form-control-datepart_2.entry.js.map +1 -0
- package/dist/esm/form-control-monetary.entry.js +61 -0
- package/dist/esm/form-control-monetary.entry.js.map +1 -0
- package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +98 -12
- package/dist/esm/form-control-number_3.entry.js.map +1 -0
- package/dist/esm/form-control-select.entry.js +43 -0
- package/dist/esm/form-control-select.entry.js.map +1 -0
- package/dist/esm/index-5ed53c20.js +3231 -0
- package/dist/esm/index-5ed53c20.js.map +1 -0
- package/dist/esm/{index-c8f391de.js → index-609a2c67.js} +10 -2
- package/dist/esm/index-609a2c67.js.map +1 -0
- package/dist/esm/{index.esm-be2cd327.js → index.esm-89fe6af9.js} +2 -19
- package/dist/esm/index.esm-89fe6af9.js.map +1 -0
- package/dist/esm/justifi-additional-questions_5.entry.js +388 -0
- package/dist/esm/justifi-additional-questions_5.entry.js.map +1 -0
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/justifi-billing-form_2.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +98 -16
- package/dist/esm/justifi-business-form.entry.js.map +1 -1
- package/dist/esm/justifi-business-list.entry.js +185 -0
- package/dist/esm/justifi-business-list.entry.js.map +1 -0
- package/dist/esm/justifi-card-form.entry.js +1 -1
- package/dist/esm/justifi-details.entry.js +26 -0
- package/dist/esm/justifi-details.entry.js.map +1 -0
- package/dist/esm/justifi-payment-details.entry.js +59 -0
- package/dist/esm/justifi-payment-details.entry.js.map +1 -0
- package/dist/esm/justifi-payment-form.entry.js +3 -2
- package/dist/esm/justifi-payment-form.entry.js.map +1 -1
- package/dist/esm/justifi-payment-method-form.entry.js +7 -5
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
- package/dist/esm/justifi-payments-list.entry.js +47 -45
- package/dist/esm/justifi-payments-list.entry.js.map +1 -1
- package/dist/esm/justifi-payout-details.entry.js +57 -0
- package/dist/esm/justifi-payout-details.entry.js.map +1 -0
- package/dist/esm/justifi-payouts-list.entry.js +60 -50
- package/dist/esm/justifi-payouts-list.entry.js.map +1 -1
- package/dist/esm/justifi-proceeds-list.entry.js +152 -0
- package/dist/esm/justifi-proceeds-list.entry.js.map +1 -0
- package/dist/esm/justifi-table.entry.js +64 -0
- package/dist/esm/justifi-table.entry.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select-input_2.entry.js +1 -1
- package/dist/esm/table-utils-6cdcaa8c.js +11 -0
- package/dist/esm/table-utils-6cdcaa8c.js.map +1 -0
- package/dist/esm/{utils-e7782126.js → utils-ad0bbe03.js} +42 -103
- package/dist/esm/utils-ad0bbe03.js.map +1 -0
- package/dist/esm/utils-cdf0b984.js +28 -0
- package/dist/esm/utils-cdf0b984.js.map +1 -0
- package/dist/esm/webcomponents.js +4 -4
- package/dist/esm/webcomponents.js.map +1 -1
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Business.d.ts +133 -0
- package/dist/types/api/Payment.d.ts +1 -0
- package/dist/types/api/Payout.d.ts +10 -12
- package/dist/types/api/Proceed.d.ts +60 -0
- package/dist/types/api/shared.d.ts +11 -0
- package/dist/types/components/business-form/additional-questions/additional-questions.d.ts +15 -0
- package/dist/types/components/business-form/business-form-schema.d.ts +47 -21
- package/dist/types/components/business-form/business-form.d.ts +7 -2
- package/dist/types/components/business-form/business-generic-info/business-generic-info.d.ts +1 -2
- package/dist/types/components/business-form/business-owners/business-owners.d.ts +3 -2
- package/dist/types/components/business-form/business-representative/business-representative.d.ts +1 -2
- package/dist/types/components/business-list/business-list.d.ts +35 -0
- package/dist/types/components/business-list/business-list.stories.d.ts +9 -0
- package/dist/types/components/details/details.d.ts +7 -0
- package/dist/types/components/details/utils.d.ts +19 -0
- package/dist/types/components/form/form-control-datepart.d.ts +19 -0
- package/dist/types/components/form/form-control-monetary.d.ts +17 -0
- package/dist/types/components/form/form-control-number-masked.d.ts +19 -0
- package/dist/types/components/form/form-control-number.d.ts +18 -0
- package/dist/types/components/form/form-control-select.d.ts +6 -1
- package/dist/types/components/form/form-control-text.d.ts +6 -0
- package/dist/types/components/form/form.d.ts +5 -4
- package/dist/types/components/legal-address-form/legal-address-form-schema.d.ts +17 -0
- package/dist/types/components/legal-address-form/legal-address-form.d.ts +16 -0
- package/dist/types/components/payment-details/payment-details.d.ts +28 -0
- package/dist/types/components/payment-details/payment-details.stories.d.ts +8 -0
- package/dist/types/components/payments-list/payments-list.d.ts +6 -14
- package/dist/types/components/payments-list/payments-list.stories.d.ts +1 -8
- package/dist/types/components/payout-details/payout-details.d.ts +28 -0
- package/dist/types/components/payout-details/payout-details.stories.d.ts +8 -0
- package/dist/types/components/payouts-list/payouts-list.d.ts +7 -15
- package/dist/types/components/payouts-list/payouts-list.stories.d.ts +1 -8
- package/dist/types/components/proceeds-list/proceeds-list.d.ts +37 -0
- package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +9 -0
- package/dist/types/components/table/table-utils.d.ts +14 -0
- package/dist/types/components/table/table.d.ts +28 -0
- package/dist/types/components.d.ts +635 -12
- package/dist/types/stencil-public-runtime.d.ts +2 -0
- package/dist/types/utils/country-options.d.ts +5 -0
- package/dist/types/utils/phone-masks.d.ts +3 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/dist/webcomponents/{p-33d69eb5.entry.js → p-0237a6bc.entry.js} +2 -2
- package/dist/webcomponents/p-0237a6bc.entry.js.map +1 -0
- package/dist/webcomponents/{p-7041a637.entry.js → p-0d6e9f76.entry.js} +2 -2
- package/dist/webcomponents/p-126146d4.js +2 -0
- package/dist/webcomponents/p-126146d4.js.map +1 -0
- package/dist/webcomponents/p-239564c6.entry.js +2 -0
- package/dist/webcomponents/p-239564c6.entry.js.map +1 -0
- package/dist/webcomponents/p-27b15fe8.entry.js +2 -0
- package/dist/webcomponents/p-27b15fe8.entry.js.map +1 -0
- package/dist/webcomponents/p-2c2cde2d.js +2 -0
- package/dist/webcomponents/p-2c2cde2d.js.map +1 -0
- package/dist/webcomponents/p-308b6784.js +3 -0
- package/dist/webcomponents/p-308b6784.js.map +1 -0
- package/dist/webcomponents/p-391b8f1d.entry.js +2 -0
- package/dist/webcomponents/p-391b8f1d.entry.js.map +1 -0
- package/dist/webcomponents/p-439fc294.entry.js +2 -0
- package/dist/webcomponents/p-439fc294.entry.js.map +1 -0
- package/dist/webcomponents/p-66f010e5.entry.js +2 -0
- package/dist/webcomponents/{p-d5bc9f22.entry.js.map → p-66f010e5.entry.js.map} +1 -1
- package/dist/webcomponents/p-7abb092c.entry.js +2 -0
- package/dist/webcomponents/{p-309a886f.entry.js.map → p-7abb092c.entry.js.map} +1 -1
- package/dist/webcomponents/{p-d5cadc78.entry.js → p-7e3bbe32.entry.js} +2 -2
- package/dist/webcomponents/p-86464cab.entry.js +2 -0
- package/dist/webcomponents/p-86464cab.entry.js.map +1 -0
- package/dist/webcomponents/p-8f421dc6.js +2 -0
- package/dist/webcomponents/p-8f421dc6.js.map +1 -0
- package/dist/webcomponents/p-9346ae33.js +2 -0
- package/dist/webcomponents/p-9346ae33.js.map +1 -0
- package/dist/webcomponents/p-ab0756ff.js +2 -0
- package/dist/webcomponents/p-ab0756ff.js.map +1 -0
- package/dist/webcomponents/p-b042bf80.entry.js +2 -0
- package/dist/webcomponents/p-b042bf80.entry.js.map +1 -0
- package/dist/webcomponents/{p-1953797f.entry.js → p-b967262f.entry.js} +2 -2
- package/dist/webcomponents/p-bf9c2be2.entry.js +2 -0
- package/dist/webcomponents/p-bf9c2be2.entry.js.map +1 -0
- package/dist/webcomponents/p-c18d876e.entry.js +2 -0
- package/dist/webcomponents/p-c18d876e.entry.js.map +1 -0
- package/dist/webcomponents/p-c1e4288d.entry.js +2 -0
- package/dist/webcomponents/p-c1e4288d.entry.js.map +1 -0
- package/dist/webcomponents/{p-0fd4aae2.js → p-c46241ba.js} +2 -2
- package/dist/webcomponents/p-c46241ba.js.map +1 -0
- package/dist/webcomponents/p-ccb0e1c5.js +2 -0
- package/dist/webcomponents/p-ccb0e1c5.js.map +1 -0
- package/dist/webcomponents/p-d1bbf409.entry.js +2 -0
- package/dist/webcomponents/p-d1bbf409.entry.js.map +1 -0
- package/dist/webcomponents/p-e26d7eea.entry.js +2 -0
- package/dist/webcomponents/p-e26d7eea.entry.js.map +1 -0
- package/dist/webcomponents/{p-23e9c7d4.entry.js → p-e77d8c6e.entry.js} +2 -2
- package/dist/webcomponents/p-f0acb27e.entry.js +2 -0
- package/dist/webcomponents/p-f0acb27e.entry.js.map +1 -0
- package/dist/webcomponents/p-f8d49acb.entry.js +2 -0
- package/dist/webcomponents/p-f8d49acb.entry.js.map +1 -0
- package/dist/webcomponents/p-f9e127a5.js +2 -0
- package/dist/webcomponents/p-f9e127a5.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +7 -5
- package/dist/cjs/Api-7303478d.js.map +0 -1
- package/dist/cjs/business-form-schema-63b311b2.js.map +0 -1
- package/dist/cjs/form-control-select_2.cjs.entry.js.map +0 -1
- package/dist/cjs/index-83b2ec02.js.map +0 -1
- package/dist/cjs/index.esm-7e12ce07.js.map +0 -1
- package/dist/cjs/justifi-business-address-form.cjs.entry.js +0 -37
- package/dist/cjs/justifi-business-address-form.cjs.entry.js.map +0 -1
- package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js +0 -148
- package/dist/cjs/justifi-business-generic-info_3.cjs.entry.js.map +0 -1
- package/dist/cjs/utils-4ee7e080.js.map +0 -1
- package/dist/collection/components/business-form/businessForm.stories.js.map +0 -1
- package/dist/esm/Api-436dfa09.js.map +0 -1
- package/dist/esm/business-form-schema-30c48693.js.map +0 -1
- package/dist/esm/form-control-select_2.entry.js.map +0 -1
- package/dist/esm/index-c8f391de.js.map +0 -1
- package/dist/esm/index.esm-be2cd327.js.map +0 -1
- package/dist/esm/justifi-business-address-form.entry.js +0 -33
- package/dist/esm/justifi-business-address-form.entry.js.map +0 -1
- package/dist/esm/justifi-business-generic-info_3.entry.js +0 -142
- package/dist/esm/justifi-business-generic-info_3.entry.js.map +0 -1
- package/dist/esm/utils-e7782126.js.map +0 -1
- package/dist/webcomponents/p-0fd4aae2.js.map +0 -1
- package/dist/webcomponents/p-1a1f2196.js +0 -2
- package/dist/webcomponents/p-1a1f2196.js.map +0 -1
- package/dist/webcomponents/p-309a886f.entry.js +0 -2
- package/dist/webcomponents/p-33d69eb5.entry.js.map +0 -1
- package/dist/webcomponents/p-3a80a2ec.entry.js +0 -2
- package/dist/webcomponents/p-3a80a2ec.entry.js.map +0 -1
- package/dist/webcomponents/p-45fea6a8.entry.js +0 -2
- package/dist/webcomponents/p-45fea6a8.entry.js.map +0 -1
- package/dist/webcomponents/p-79456add.js +0 -2
- package/dist/webcomponents/p-79456add.js.map +0 -1
- package/dist/webcomponents/p-af080b21.js +0 -2
- package/dist/webcomponents/p-af080b21.js.map +0 -1
- package/dist/webcomponents/p-bc969904.js +0 -3
- package/dist/webcomponents/p-bc969904.js.map +0 -1
- package/dist/webcomponents/p-cd097ce9.entry.js +0 -2
- package/dist/webcomponents/p-cd097ce9.entry.js.map +0 -1
- package/dist/webcomponents/p-d5bc9f22.entry.js +0 -2
- package/dist/webcomponents/p-dd1ebc0b.entry.js +0 -2
- package/dist/webcomponents/p-dd1ebc0b.entry.js.map +0 -1
- package/dist/webcomponents/p-e05e0c6b.entry.js +0 -2
- package/dist/webcomponents/p-e05e0c6b.entry.js.map +0 -1
- /package/dist/types/components/business-form/{businessForm.stories.d.ts → business-form.stories.d.ts} +0 -0
- /package/dist/webcomponents/{p-7041a637.entry.js.map → p-0d6e9f76.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-d5cadc78.entry.js.map → p-7e3bbe32.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-1953797f.entry.js.map → p-b967262f.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-23e9c7d4.entry.js.map → p-e77d8c6e.entry.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { FormController } from "../form/form";
|
|
3
|
-
import
|
|
3
|
+
import businessFormSchema from "./business-form-schema";
|
|
4
|
+
import { Api } from "../../api";
|
|
4
5
|
/**
|
|
5
6
|
* @exportedPart label: Label for inputs
|
|
6
7
|
* @exportedPart input: The input fields
|
|
@@ -10,20 +11,91 @@ export class BusinessForm {
|
|
|
10
11
|
constructor() {
|
|
11
12
|
this.authToken = undefined;
|
|
12
13
|
this.businessId = undefined;
|
|
13
|
-
this.
|
|
14
|
+
this.isLoading = false;
|
|
15
|
+
this.sendData = this.sendData.bind(this);
|
|
16
|
+
this.fetchData = this.fetchData.bind(this);
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
componentWillLoad() {
|
|
19
|
+
if (!this.authToken) {
|
|
20
|
+
console.warn('Warning: Missing auth-token. The form will not be functional without it.');
|
|
21
|
+
}
|
|
22
|
+
this.formController = new FormController(businessFormSchema);
|
|
23
|
+
this.api = Api(this.authToken, process.env.ENTITIES_ENDPOINT);
|
|
24
|
+
if (this.businessId) {
|
|
25
|
+
this.fetchData(this.businessId);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.formController.setInitialValues({
|
|
29
|
+
legal_address: {
|
|
30
|
+
country: 'US',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// These props should not be sent to the server
|
|
36
|
+
parseForPatching(data) {
|
|
37
|
+
delete data.id;
|
|
38
|
+
delete data.documents;
|
|
39
|
+
delete data.bank_accounts;
|
|
40
|
+
delete data.product_categories;
|
|
41
|
+
delete data.created_at;
|
|
42
|
+
delete data.updated_at;
|
|
43
|
+
delete data.legal_address.id;
|
|
44
|
+
delete data.legal_address.created_at;
|
|
45
|
+
delete data.legal_address.updated_at;
|
|
46
|
+
delete data.representative.id;
|
|
47
|
+
delete data.representative.documents;
|
|
48
|
+
delete data.representative.created_at;
|
|
49
|
+
delete data.representative.updated_at;
|
|
50
|
+
delete data.representative.address.id;
|
|
51
|
+
delete data.representative.address.created_at;
|
|
52
|
+
delete data.representative.address.updated_at;
|
|
53
|
+
delete data.owners;
|
|
54
|
+
return data;
|
|
55
|
+
}
|
|
56
|
+
async sendData() {
|
|
57
|
+
this.isLoading = true;
|
|
58
|
+
try {
|
|
59
|
+
const data = this.formController.values.getValue();
|
|
60
|
+
// Conditionally making either POST or PATCH request
|
|
61
|
+
if (this.businessId) {
|
|
62
|
+
const payload = this.parseForPatching(data);
|
|
63
|
+
const response = await this.api.patch(`entities/business/${this.businessId}`, JSON.stringify(payload));
|
|
64
|
+
console.log('Server response from PATCH:', response);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const response = await this.api.post('entities/business', JSON.stringify(data));
|
|
68
|
+
console.log('Server response from POST:', response);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error('Error sending data:', error);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
this.isLoading = false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async fetchData(businessId) {
|
|
79
|
+
this.isLoading = true;
|
|
80
|
+
try {
|
|
81
|
+
const response = await this.api.get(`entities/business/${businessId}`);
|
|
82
|
+
this.formController.setInitialValues(response.data);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Error fetching data:', error);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
this.isLoading = false;
|
|
89
|
+
}
|
|
17
90
|
}
|
|
18
91
|
validateAndSubmit(event) {
|
|
19
92
|
event.preventDefault();
|
|
20
93
|
this.formController.validateAndSubmit(this.sendData);
|
|
21
94
|
}
|
|
22
95
|
render() {
|
|
23
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("h1", null, "Business Information"), h("form", { onSubmit:
|
|
96
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("h1", null, "Business Information"), h("form", { onSubmit: event => this.validateAndSubmit(event) }, h("div", { class: "row gy-6 gap-3" }, h("div", { class: "col-12" }, h("justifi-business-generic-info", { formController: this.formController })), h("div", { class: "col-12" }, h("justifi-legal-address-form", { formController: this.formController, legend: "Legal Address" })), h("div", { class: "col-12" }, h("justifi-additional-questions", { formController: this.formController })), h("div", { class: "col-12" }, h("justifi-business-representative", { formController: this.formController })), h("div", { class: "col-12" }, h("justifi-business-owners", { isEditing: !!this.businessId, 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.authToken || this.isLoading }, this.isLoading ? 'Loading...' : 'Submit'))))));
|
|
24
97
|
}
|
|
25
98
|
static get is() { return "justifi-business-form"; }
|
|
26
|
-
static get encapsulation() { return "shadow"; }
|
|
27
99
|
static get originalStyleUrls() {
|
|
28
100
|
return {
|
|
29
101
|
"$": ["business-form.scss"]
|
|
@@ -72,5 +144,10 @@ export class BusinessForm {
|
|
|
72
144
|
}
|
|
73
145
|
};
|
|
74
146
|
}
|
|
147
|
+
static get states() {
|
|
148
|
+
return {
|
|
149
|
+
"isLoading": {}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
75
152
|
}
|
|
76
153
|
//# sourceMappingURL=business-form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business-form.js","sourceRoot":"","sources":["../../../../src/components/business-form/business-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"business-form.js","sourceRoot":"","sources":["../../../../src/components/business-form/business-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhC;;;;GAIG;AAKH,MAAM,OAAO,YAAY;EAQvB;;;qBAL8B,KAAK;IAMjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GAC5C;EAED,iBAAiB;IACf,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;MACnB,OAAO,CAAC,IAAI,CACV,0EAA0E,CAC3E,CAAC;KACH;IAED,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAE7D,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE9D,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACjC;SAAM;MACL,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;QACnC,aAAa,EAAE;UACb,OAAO,EAAE,IAAI;SACd;OACF,CAAC,CAAC;KACJ;EACH,CA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AK,CAAC;QACpD,WAAK,KAAK,EAAC,gBAAgB;UACzB,WAAK,KAAK,EAAC,QAAQ;YACjB,qCACE,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE;UACN,WAAK,KAAK,EAAC,QAAQ;YACjB,kCACE,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,MAAM,EAAC,eAAe,GACtB,CACE;UACN,WAAK,KAAK,EAAC,QAAQ;YACjB,oCACE,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE;UACN,WAAK,KAAK,EAAC,QAAQ;YACjB,uCACE,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE;UACN,WAAK,KAAK,EAAC,QAAQ;YACjB,+BACE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,EAC5B,cAAc,EAAE,IAAI,CAAC,cAAc,GACnC,CACE;UACN,WAAK,KAAK,EAAC,gCAAgC;YACzC,cACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,mCAAmC,EACzC,QAAQ,EAAE,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,IAE1C,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAClC,CACL,CACF,CACD,CACF,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State } from '@stencil/core';\nimport { FormController } from '../form/form';\nimport businessFormSchema from './business-form-schema';\nimport { Api } from '../../api';\n\n/**\n * @exportedPart label: Label for inputs\n * @exportedPart input: The input fields\n * @exportedPart input-invalid: Invalid state for inputfs\n */\n@Component({\n tag: 'justifi-business-form',\n styleUrl: 'business-form.scss',\n})\nexport class BusinessForm {\n @Prop() authToken: string;\n @Prop() businessId?: string;\n @State() isLoading: boolean = false;\n\n private formController: FormController;\n private api: any;\n\n constructor() {\n this.sendData = this.sendData.bind(this);\n this.fetchData = this.fetchData.bind(this);\n }\n\n componentWillLoad() {\n if (!this.authToken) {\n console.warn(\n 'Warning: Missing auth-token. The form will not be functional without it.',\n );\n }\n\n this.formController = new FormController(businessFormSchema);\n\n this.api = Api(this.authToken, process.env.ENTITIES_ENDPOINT);\n\n if (this.businessId) {\n this.fetchData(this.businessId);\n } else {\n this.formController.setInitialValues({\n legal_address: {\n country: 'US',\n },\n });\n }\n }\n\n // These props should not be sent to the server\n private parseForPatching(data) {\n delete data.id;\n delete data.documents;\n delete data.bank_accounts;\n delete data.product_categories;\n delete data.created_at;\n delete data.updated_at;\n delete data.legal_address.id;\n delete data.legal_address.created_at;\n delete data.legal_address.updated_at;\n delete data.representative.id;\n delete data.representative.documents;\n delete data.representative.created_at;\n delete data.representative.updated_at;\n delete data.representative.address.id;\n delete data.representative.address.created_at;\n delete data.representative.address.updated_at;\n delete data.owners;\n\n return data;\n }\n\n private async sendData() {\n this.isLoading = true;\n try {\n const data = this.formController.values.getValue();\n\n // Conditionally making either POST or PATCH request\n if (this.businessId) {\n const payload = this.parseForPatching(data);\n const response = await this.api.patch(\n `entities/business/${this.businessId}`,\n JSON.stringify(payload),\n );\n console.log('Server response from PATCH:', response);\n } else {\n const response = await this.api.post(\n 'entities/business',\n JSON.stringify(data),\n );\n console.log('Server response from POST:', response);\n }\n } catch (error) {\n console.error('Error sending data:', error);\n } finally {\n this.isLoading = false;\n }\n }\n\n private async fetchData(businessId) {\n this.isLoading = true;\n try {\n const response = await this.api.get(`entities/business/${businessId}`);\n this.formController.setInitialValues(response.data);\n } catch (error) {\n console.error('Error fetching data:', error);\n } finally {\n this.isLoading = false;\n }\n }\n\n private validateAndSubmit(event: any) {\n event.preventDefault();\n this.formController.validateAndSubmit(this.sendData);\n }\n\n render() {\n return (\n <Host exportparts=\"label,input,input-invalid\">\n <h1>Business Information</h1>\n <form onSubmit={event => this.validateAndSubmit(event)}>\n <div class=\"row gy-6 gap-3\">\n <div class=\"col-12\">\n <justifi-business-generic-info\n formController={this.formController}\n />\n </div>\n <div class=\"col-12\">\n <justifi-legal-address-form\n formController={this.formController}\n legend=\"Legal Address\"\n />\n </div>\n <div class=\"col-12\">\n <justifi-additional-questions\n formController={this.formController}\n />\n </div>\n <div class=\"col-12\">\n <justifi-business-representative\n formController={this.formController}\n />\n </div>\n <div class=\"col-12\">\n <justifi-business-owners\n isEditing={!!this.businessId}\n formController={this.formController}\n />\n </div>\n <div class=\"col-12 d-flex flex-row-reverse\">\n <button\n type=\"submit\"\n class=\"btn btn-primary jfi-submit-button\"\n disabled={!this.authToken || this.isLoading}\n >\n {this.isLoading ? 'Loading...' : 'Submit'}\n </button>\n </div>\n </div>\n </form>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title: 'Components/BusinessForm',
|
|
2
|
+
title: 'dev/Components/BusinessForm',
|
|
3
3
|
component: 'justifi-business-form',
|
|
4
4
|
argTypes: {
|
|
5
5
|
'auth-token': {
|
|
@@ -21,8 +21,8 @@ const Template = (args) => {
|
|
|
21
21
|
return `
|
|
22
22
|
<div>
|
|
23
23
|
<justifi-business-form
|
|
24
|
-
auth-token
|
|
25
|
-
business-id=
|
|
24
|
+
auth-token="${args['auth-token']}"
|
|
25
|
+
business-id="${args['business-id']}"
|
|
26
26
|
/>
|
|
27
27
|
</div>
|
|
28
28
|
<style>
|
|
@@ -34,13 +34,13 @@ const Template = (args) => {
|
|
|
34
34
|
};
|
|
35
35
|
export const Basic = Template.bind({});
|
|
36
36
|
Basic.args = {
|
|
37
|
-
'auth-token': '
|
|
38
|
-
'business-id': '
|
|
37
|
+
'auth-token': '',
|
|
38
|
+
'business-id': '',
|
|
39
39
|
};
|
|
40
40
|
export const Styled = Template.bind({});
|
|
41
41
|
Styled.args = {
|
|
42
|
-
'auth-token': '
|
|
43
|
-
'business-id': '
|
|
42
|
+
'auth-token': '',
|
|
43
|
+
'business-id': '',
|
|
44
44
|
'cssVariables': `
|
|
45
45
|
--jfi-primary-color: #212529;
|
|
46
46
|
--jfi-load-google-font: 'Roboto Mono:wght@200;400;700;900';
|
|
@@ -112,4 +112,4 @@ Styled.args = {
|
|
|
112
112
|
--jfi-radio-button-group-width: 100%;
|
|
113
113
|
`,
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=
|
|
115
|
+
//# sourceMappingURL=business-form.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business-form.stories.js","sourceRoot":"","sources":["../../../../src/components/business-form/business-form.stories.tsx"],"names":[],"mappings":"AAMA,eAAe;EACb,KAAK,EAAE,6BAA6B;EACpC,SAAS,EAAE,uBAAuB;EAClC,QAAQ,EAAE;IACR,YAAY,EAAE;MACZ,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,aAAa,EAAE;MACb,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;OAClB;KACF;GACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAA2B,EAAE,EAAE;EAC/C,wFAAwF;EACxF,OAAO;;;sBAGa,IAAI,CAAC,YAAY,CAAC;uBACjB,IAAI,CAAC,aAAa,CAAC;;;;;UAKhC,IAAI,CAAC,YAAY;;;GAGxB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;EACX,YAAY,EAAE,EAAE;EAChB,aAAa,EAAE,EAAE;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,YAAY,EAAE,EAAE;EAChB,aAAa,EAAE,EAAE;EACjB,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEf;CACF,CAAC","sourcesContent":["interface BusinessFormStoryArgs {\n authToken: string;\n businessId: string;\n cssVariables: string;\n}\n\nexport default {\n title: 'dev/Components/BusinessForm',\n component: 'justifi-business-form',\n argTypes: {\n 'auth-token': {\n control: 'text',\n table: {\n category: 'props',\n },\n },\n 'business-id': {\n control: 'text',\n table: {\n category: 'props',\n },\n },\n },\n};\n\nconst Template = (args: BusinessFormStoryArgs) => {\n // The <div> here should be replaced by a `display` property in the cardForm potentially\n return `\n <div>\n <justifi-business-form\n auth-token=\"${args['auth-token']}\"\n business-id=\"${args['business-id']}\"\n />\n </div>\n <style>\n :root {\n ${args.cssVariables}\n }\n </style>\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'auth-token': '',\n 'business-id': '',\n};\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'auth-token': '',\n 'business-id': '',\n 'cssVariables': `\n --jfi-primary-color: #212529;\n --jfi-load-google-font: 'Roboto Mono:wght@200;400;700;900';\n --jfi-layout-font-family: Roboto Mono, Calibri, sans-serif;\n --jfi-layout-padding: 4px;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 700;\n --jfi-form-label-font-family: Calibri, sans-serif;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n\n --jfi-submit-button-color: white;\n --jfi-submit-button-background-color: #3F3F47;\n --jfi-submit-button-border-color: var(--jfi-primary-color);\n --jfi-submit-button-padding: 0.375rem 0.75rem;\n --jfi-submit-button-font-size: 1rem;\n --jfi-submit-button-border-radius: 1px;\n --jfi-submit-button-color-hover: white;\n --jfi-submit-button-background-color-hover: var(--jfi-primary-color);\n --jfi-submit-button-border-color-hover: var(--jfi-primary-color);\n --jfi-submit-button-color-focus: white;\n --jfi-submit-button-background-color-focus: var(--jfi-primary-color);\n --jfi-submit-button-border-color-focus: var(--jfi-primary-color);\n --jfi-submit-button-color-active: white;\n --jfi-submit-button-background-color-active: var(--jfi-primary-color);\n --jfi-submit-button-border-color-active: var(--jfi-primary-color);\n --jfi-submit-button-width: 100%;\n --jfi-submit-button-box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px;\n\n --jfi-radio-button-color: var(--jfi-primary-color);\n --jfi-radio-button-background-color: transparent;\n --jfi-radio-button-color-selected: white;\n --jfi-radio-button-background-color-selected: var(--jfi-primary-color);\n --jfi-radio-button-border-color: var(--jfi-primary-color);\n --jfi-radio-button-border-color-selected: var(--jfi-primary-color);\n --jfi-radio-button-padding: 0.375rem 0.75rem;\n --jfi-radio-button-font-size: 1rem;\n --jfi-radio-button-color-hover: var(--jfi-primary-color);\n --jfi-radio-button-color-selected-hover: white;\n --jfi-radio-button-background-color-hover: transparent;\n --jfi-radio-button-background-color-selected-hover: var(--jfi-primary-color);\n --jfi-radio-button-border-color-selected-hover: var(--jfi-primary-color);\n --jfi-radio-button-border-color-hover: var(--jfi-primary-color);\n --jfi-radio-button-group-width: 100%;\n `,\n};\n"]}
|
package/dist/collection/components/business-form/business-generic-info/business-generic-info.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { BusinessStructureOptions, BusinessTypeOptions } from "../business-form-schema";
|
|
2
|
+
import { BusinessStructureOptions, BusinessTypeOptions, } from "../business-form-schema";
|
|
3
|
+
import { PHONE_MASKS } from "../../../utils/phone-masks";
|
|
3
4
|
/**
|
|
4
5
|
* @exportedPart label: Label for inputs
|
|
5
6
|
* @exportedPart input: The input fields
|
|
@@ -9,22 +10,21 @@ export class BusinessGenericInfo {
|
|
|
9
10
|
constructor() {
|
|
10
11
|
this.formController = undefined;
|
|
11
12
|
this.errors = {};
|
|
12
|
-
this.defaultValues = {};
|
|
13
13
|
this.business = {};
|
|
14
|
-
|
|
15
|
-
handleRepresentativeChange(newValues) {
|
|
16
|
-
this.formController.setValues(newValues);
|
|
14
|
+
this.inputHandler = this.inputHandler.bind(this);
|
|
17
15
|
}
|
|
18
16
|
componentDidLoad() {
|
|
19
|
-
this.formController.errors.subscribe(
|
|
20
|
-
|
|
17
|
+
this.formController.errors.subscribe(errors => {
|
|
18
|
+
this.errors = Object.assign({}, errors);
|
|
19
|
+
});
|
|
20
|
+
this.formController.values.subscribe(values => (this.business = Object.assign({}, values)));
|
|
21
21
|
}
|
|
22
22
|
inputHandler(name, value) {
|
|
23
|
-
this.
|
|
23
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
24
24
|
}
|
|
25
|
-
;
|
|
26
25
|
render() {
|
|
27
|
-
|
|
26
|
+
const genericInfoDefaultValue = this.formController.getInitialValues();
|
|
27
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: genericInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: genericInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: BusinessTypeOptions, defaultValue: genericInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: BusinessStructureOptions, defaultValue: genericInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: genericInfoDefaultValue.industry, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-number", { name: "tax_id", label: "Tax ID", defaultValue: genericInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: genericInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: genericInfoDefaultValue.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: genericInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })))));
|
|
28
28
|
}
|
|
29
29
|
static get is() { return "justifi-business-generic-info"; }
|
|
30
30
|
static get originalStyleUrls() {
|
|
@@ -65,15 +65,8 @@ export class BusinessGenericInfo {
|
|
|
65
65
|
static get states() {
|
|
66
66
|
return {
|
|
67
67
|
"errors": {},
|
|
68
|
-
"defaultValues": {},
|
|
69
68
|
"business": {}
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
static get watchers() {
|
|
73
|
-
return [{
|
|
74
|
-
"propName": "business",
|
|
75
|
-
"methodName": "handleRepresentativeChange"
|
|
76
|
-
}];
|
|
77
|
-
}
|
|
78
71
|
}
|
|
79
72
|
//# sourceMappingURL=business-generic-info.js.map
|
package/dist/collection/components/business-form/business-generic-info/business-generic-info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"business-generic-info.js","sourceRoot":"","sources":["../../../../../src/components/business-form/business-generic-info/business-generic-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"business-generic-info.js","sourceRoot":"","sources":["../../../../../src/components/business-form/business-generic-info/business-generic-info.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;;GAIG;AAKH,MAAM,OAAO,mBAAmB;EAK9B;;kBAHuB,EAAE;oBACA,EAAE;IAGzB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;GAClD;EAED,gBAAgB;IACd,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;MAC5C,IAAI,CAAC,MAAM,qBAAQ,MAAM,CAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,S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I,CAAC,MAAM,CAAC,KAAK,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/B,IAAI,EAAE,WAAW,CAAC,EAAE,GACpB,CACE,CACF,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State } from '@stencil/core';\n\nimport {\n BusinessStructureOptions,\n BusinessTypeOptions,\n} from '../business-form-schema';\nimport { FormController } from '../../form/form';\nimport { PHONE_MASKS } from '../../../utils/phone-masks';\n\n/**\n * @exportedPart label: Label for inputs\n * @exportedPart input: The input fields\n * @exportedPart input-invalid: Invalid state for inputfs\n */\n@Component({\n tag: 'justifi-business-generic-info',\n styleUrl: 'business-generic-info.scss',\n})\nexport class BusinessGenericInfo {\n @Prop() formController: FormController;\n @State() errors: any = {};\n @State() business: any = {};\n\n constructor() {\n this.inputHandler = this.inputHandler.bind(this);\n }\n\n componentDidLoad() {\n this.formController.errors.subscribe(errors => {\n this.errors = { ...errors };\n });\n this.formController.values.subscribe(\n values => (this.business = { ...values }),\n );\n }\n\n inputHandler(name: string, value: string) {\n this.formController.setValues({\n ...this.formController.values.getValue(),\n [name]: value,\n });\n }\n\n render() {\n const genericInfoDefaultValue = this.formController.getInitialValues();\n\n return (\n <Host exportparts=\"label,input,input-invalid\">\n <div class=\"row gy-3\">\n <div class=\"col-12 col-md-6\">\n <form-control-text\n name=\"legal_name\"\n label=\"Legal Name\"\n defaultValue={genericInfoDefaultValue.legal_name}\n error={this.errors.legal_name}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12 col-md-6\">\n <form-control-text\n name=\"doing_business_as\"\n label=\"Doing Business As (DBA)\"\n defaultValue={genericInfoDefaultValue.doing_business_as}\n error={this.errors.doing_business_as}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12 col-md-6\">\n <form-control-select\n name=\"business_type\"\n label=\"Business Type\"\n options={BusinessTypeOptions}\n defaultValue={genericInfoDefaultValue.business_type}\n error={this.errors.business_type}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12 col-md-6\">\n <form-control-select\n name=\"business_structure\"\n label=\"Business Structure\"\n options={BusinessStructureOptions}\n defaultValue={genericInfoDefaultValue.business_structure}\n error={this.errors.business_structure}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12\">\n <form-control-text\n name=\"industry\"\n label=\"Industry\"\n defaultValue={genericInfoDefaultValue.industry}\n error={this.errors.business_structure}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12\">\n <form-control-number\n name=\"tax_id\"\n label=\"Tax ID\"\n defaultValue={genericInfoDefaultValue.tax_id}\n error={this.errors.tax_id}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12\">\n <form-control-text\n name=\"website_url\"\n label=\"Website URL\"\n defaultValue={genericInfoDefaultValue.website_url}\n error={this.errors.website_url}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12 col-md-6\">\n <form-control-text\n name=\"email\"\n label=\"Email Address\"\n defaultValue={genericInfoDefaultValue.email}\n error={this.errors.email}\n inputHandler={this.inputHandler}\n />\n </div>\n <div class=\"col-12 col-md-6\">\n <form-control-number-masked\n name=\"phone\"\n label=\"Phone Number\"\n defaultValue={genericInfoDefaultValue.phone}\n error={this.errors.phone}\n inputHandler={this.inputHandler}\n mask={PHONE_MASKS.US}\n />\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|