@justifi/webcomponents 4.9.1 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Business-64dffab7.js → Business-663db337.js} +13 -1
- package/dist/cjs/Identity-1c4528b8.js +49 -0
- package/dist/cjs/{SubAccount-f8144025.js → SubAccount-05867651.js} +1 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +4 -3
- package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
- package/dist/cjs/business-details-core.cjs.entry.js +2 -2
- package/dist/cjs/business-form-select-options-7ccd8dca.js +85 -0
- package/dist/cjs/business-form-types-3cdd5447.js +19 -0
- package/dist/cjs/form-control-datepart_3.cjs.entry.js +68 -78
- package/dist/cjs/form-control-monetary.cjs.entry.js +20 -18
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +50 -3
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +4 -3
- package/dist/cjs/{index-07ddbad2.js → index-69b9386b.js} +57 -0
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +506 -0
- package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +14 -42
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +5 -6
- package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
- package/dist/cjs/justifi-business-details.cjs.entry.js +5 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +18 -15
- package/dist/cjs/justifi-business-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +1 -1
- package/dist/cjs/justifi-owner-form.cjs.entry.js +162 -0
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +3 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +89 -0
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +3 -2
- package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +5 -4
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/payload-parsers-9e72e80f.js +99 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +4 -3
- package/dist/cjs/payments-list-core.cjs.entry.js +3 -2
- package/dist/cjs/payout-details-core.cjs.entry.js +4 -3
- package/dist/cjs/payouts-list-core.cjs.entry.js +3 -2
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +4 -3
- package/dist/cjs/subaccount-bank-details.cjs.entry.js +2 -2
- package/dist/cjs/subaccount-terms-details.cjs.entry.js +2 -2
- package/dist/cjs/{utils-5c3e442d.js → utils-23e70ef2.js} +1 -1
- package/dist/cjs/{utils-84208d99.js → utils-2b9940e1.js} +25 -0
- package/dist/cjs/utils-df5167a8.js +13 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/api/Business.js +10 -1
- package/dist/collection/api/Identity.js +43 -0
- package/dist/collection/collection-manifest.json +15 -8
- package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
- package/dist/collection/components/billing-form/billing-form.js +1 -1
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +4 -4
- package/dist/collection/components/business-details/owner-details/owner-details.js +2 -2
- package/dist/collection/components/business-details/representative-details/representative-details.js +2 -2
- package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
- package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.js +4 -4
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +77 -0
- package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
- package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
- package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
- package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.js +1 -1
- package/dist/collection/components/business-forms/owner-form/owner-form.css +7779 -0
- package/dist/collection/components/business-forms/owner-form/owner-form.js +367 -0
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +219 -0
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.css +2536 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/business-address-form-step.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-address/test/business-address-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +239 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/test/business-core-info-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.css +7779 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +284 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/test/business-owners-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +231 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/test/business-representative-form-step.spec.js +97 -0
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.css +2493 -0
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +233 -0
- package/dist/collection/components/{business-form/business-form-stepped.css → business-forms/payment-provisioning/payment-provisioning.css} +105 -0
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +199 -0
- package/dist/collection/components/business-forms/payment-provisioning/test/payment-provisioning.spec.js +61 -0
- package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +7 -0
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +16 -0
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +13 -0
- package/dist/collection/components/business-forms/schemas/business-form-schema.js +6 -0
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +35 -0
- package/dist/collection/components/business-forms/schemas/business-owners-schema.js +16 -0
- package/dist/collection/components/business-forms/utils/business-form-select-options.js +80 -0
- package/dist/collection/components/business-forms/utils/business-form-types.js +17 -0
- package/dist/collection/components/business-forms/utils/payload-parsers.js +37 -0
- package/dist/collection/components/form/form-control-datepart.js +39 -34
- package/dist/collection/components/form/form-control-monetary.js +22 -20
- package/dist/collection/components/form/form-control-number.js +1 -0
- package/dist/collection/components/form/form-control-select.js +3 -1
- package/dist/collection/components/form/form-control-text.js +2 -1
- package/dist/collection/components/form/test/form-control-datepart.spec.js +88 -0
- package/dist/collection/components/form/test/form-control-monetary.spec.js +69 -0
- package/dist/collection/components/form/test/form-control-number.spec.js +77 -0
- package/dist/collection/components/form/test/form-control-select.spec.js +84 -0
- package/dist/collection/components/form/test/form-control-text.spec.js +104 -0
- package/dist/collection/components/form/test/form.spec.js +60 -0
- package/dist/collection/components/form/utils.js +1 -0
- package/dist/collection/utils/utils.js +21 -0
- package/dist/docs.json +1943 -552
- package/dist/esm/{Business-9921d35f.js → Business-6cc4e473.js} +12 -2
- package/dist/esm/Identity-5f8f916f.js +46 -0
- package/dist/esm/{SubAccount-76f6d565.js → SubAccount-61ac70eb.js} +1 -1
- package/dist/esm/additional-questions-details_5.entry.js +4 -3
- package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
- package/dist/esm/business-details-core.entry.js +2 -2
- package/dist/esm/business-form-select-options-6b9293fe.js +82 -0
- package/dist/esm/business-form-types-de9f38cd.js +19 -0
- package/dist/esm/form-control-datepart_3.entry.js +68 -78
- package/dist/esm/form-control-monetary.entry.js +20 -18
- package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +50 -4
- package/dist/esm/gross-payment-chart-core.entry.js +4 -3
- package/dist/esm/{index-fb5ca346.js → index-df86d9a2.js} +57 -0
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +498 -0
- package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +14 -41
- package/dist/esm/justifi-bank-account-form.entry.js +1 -1
- package/dist/esm/justifi-billing-form_4.entry.js +4 -5
- package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
- package/dist/esm/justifi-business-details.entry.js +5 -3
- package/dist/esm/justifi-business-form.entry.js +17 -14
- package/dist/esm/justifi-business-list.entry.js +4 -3
- package/dist/esm/justifi-business-owners.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +1 -1
- package/dist/esm/justifi-checkout-core.entry.js +3 -2
- package/dist/esm/justifi-checkout.entry.js +1 -1
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-new-payment-method_3.entry.js +1 -1
- package/dist/esm/justifi-owner-form.entry.js +158 -0
- package/dist/esm/justifi-payment-balance-transactions.entry.js +3 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-form.entry.js +3 -2
- package/dist/esm/justifi-payment-method-selector.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +85 -0
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-proceeds-list.entry.js +3 -2
- package/dist/esm/justifi-refund-form.entry.js +1 -1
- package/dist/esm/justifi-subaccount-details.entry.js +5 -4
- package/dist/esm/justifi-subaccounts-list.entry.js +4 -3
- package/dist/esm/justifi-table_2.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/payload-parsers-caea809d.js +91 -0
- package/dist/esm/payment-details-core.entry.js +4 -3
- package/dist/esm/payments-list-core.entry.js +3 -2
- package/dist/esm/payout-details-core.entry.js +4 -3
- package/dist/esm/payouts-list-core.entry.js +3 -2
- package/dist/esm/subaccount-account-details_4.entry.js +4 -3
- package/dist/esm/subaccount-bank-details.entry.js +2 -2
- package/dist/esm/subaccount-terms-details.entry.js +2 -2
- package/dist/esm/utils-2828201a.js +10 -0
- package/dist/esm/{utils-a3e96d9f.js → utils-d01c5f3a.js} +1 -1
- package/dist/esm/{utils-5193fcd7.js → utils-d9e90399.js} +23 -1
- package/dist/esm/webcomponents.js +3 -3
- package/dist/module/Business.js +12 -2
- package/dist/module/Identity.js +46 -0
- package/dist/module/SubAccount.js +1 -1
- package/dist/module/billing-form.js +1 -1
- package/dist/module/business-additional-questions-form-step.js +121 -0
- package/dist/module/business-additional-questions-schema.js +10 -0
- package/dist/module/business-address-form.js +3 -3
- package/dist/module/business-address-schema.js +19 -0
- package/dist/module/business-core-info-form-step.js +141 -0
- package/dist/module/business-core-info-schema.js +16 -0
- package/dist/module/business-core-info.js +69 -0
- package/dist/module/business-form-select-options.js +82 -0
- package/dist/module/business-form-types.js +19 -0
- package/dist/module/business-identity-schema.js +38 -0
- package/dist/{webcomponents/p-f64a85cf.entry.js → module/business-owners-form-step.js} +214 -1
- package/dist/module/business-representative-form-step.js +158 -0
- package/dist/module/business-representative.js +1 -1
- package/dist/module/checkout-core.js +1 -1
- package/dist/module/form-control-datepart2.js +37 -33
- package/dist/module/form-control-monetary2.js +20 -18
- package/dist/module/form-control-number2.js +1 -0
- package/dist/module/form-control-select2.js +3 -1
- package/dist/module/form-control-text2.js +2 -1
- package/dist/module/justifi-additional-questions-form-step.d.ts +11 -0
- package/dist/module/justifi-additional-questions-form-step.js +6 -0
- package/dist/module/justifi-business-address-form-step.d.ts +11 -0
- package/dist/module/justifi-business-address-form-step.js +75 -0
- package/dist/module/justifi-business-core-info-form-step.d.ts +11 -0
- package/dist/module/justifi-business-core-info-form-step.js +6 -0
- package/dist/module/justifi-business-core-info.d.ts +11 -0
- package/dist/module/justifi-business-core-info.js +6 -0
- package/dist/module/justifi-business-form.js +19 -14
- package/dist/module/justifi-business-list.js +1 -1
- package/dist/module/justifi-business-owners-form-step.d.ts +11 -0
- package/dist/module/justifi-business-owners-form-step.js +6 -0
- package/dist/module/justifi-business-representative-form-step.d.ts +11 -0
- package/dist/module/justifi-business-representative-form-step.js +6 -0
- package/dist/module/justifi-legal-address-form-step.d.ts +11 -0
- package/dist/module/justifi-legal-address-form-step.js +6 -0
- package/dist/module/justifi-owner-form.d.ts +11 -0
- package/dist/module/justifi-owner-form.js +6 -0
- package/dist/module/justifi-payment-balance-transactions.js +1 -1
- package/dist/module/justifi-payment-provisioning.d.ts +11 -0
- package/dist/module/justifi-payment-provisioning.js +190 -0
- package/dist/module/justifi-proceeds-list.js +1 -1
- package/dist/module/justifi-subaccount-details.js +1 -1
- package/dist/module/justifi-subaccounts-list.js +1 -1
- package/dist/module/legal-address-form-step.js +137 -0
- package/dist/module/owner-form.js +222 -0
- package/dist/module/payload-parsers.js +39 -0
- package/dist/module/payment-details-core2.js +1 -1
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payments-list-core2.js +1 -1
- package/dist/module/payout-details-core2.js +1 -1
- package/dist/module/payouts-list-core2.js +1 -1
- package/dist/module/subaccount-merchant-details2.js +1 -1
- package/dist/module/utils2.js +23 -1
- package/dist/module/utils4.js +10 -0
- package/dist/types/api/Business.d.ts +11 -21
- package/dist/types/api/Identity.d.ts +60 -0
- package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
- package/dist/types/components/business-details/additional-questions-details/additional-questions-details.d.ts +2 -2
- package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -1
- package/dist/types/components/business-details/representative-details/representative-details.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/business-address/business-address-form.d.ts +1 -1
- package/dist/types/components/{business-form/business-generic-info/business-generic-info.d.ts → business-forms/business-form/business-core-info/business-core-info.d.ts} +5 -5
- package/dist/types/components/{business-form → business-forms/business-form}/business-form.d.ts +5 -10
- package/dist/types/components/{business-form → business-forms/business-form}/business-owners/business-owners.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/business-representative/business-representative.d.ts +1 -1
- package/dist/types/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.d.ts +2 -2
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +31 -0
- package/dist/types/components/business-forms/payment-provisioning/business-address/business-address-form-step.d.ts +9 -0
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +36 -0
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +27 -0
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +31 -0
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning.d.ts +45 -0
- package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +11 -0
- package/dist/types/components/{business-form/business-address/business-address-form-schema.d.ts → business-forms/schemas/business-address-schema.d.ts} +11 -8
- package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +19 -0
- package/dist/types/components/{business-form → business-forms/schemas}/business-form-schema.d.ts +2 -26
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +59 -0
- package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +33 -0
- package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +11 -0
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +39 -0
- package/dist/types/components/business-forms/utils/payload-parsers.d.ts +4 -0
- package/dist/types/components/form/form-control-datepart.d.ts +2 -1
- package/dist/types/components/form/form-control-monetary.d.ts +2 -1
- package/dist/types/components/form/form.d.ts +1 -1
- package/dist/types/components/form/utils.d.ts +1 -0
- package/dist/types/components.d.ts +463 -113
- package/dist/types/utils/utils.d.ts +3 -0
- package/dist/webcomponents/p-03b1d0d5.entry.js +1 -0
- package/dist/webcomponents/{p-adc96df1.entry.js → p-07b326d0.entry.js} +1 -1
- package/dist/webcomponents/p-0e189d6a.entry.js +1 -0
- package/dist/webcomponents/p-16dcf053.entry.js +1 -0
- package/dist/webcomponents/p-17d72f4a.js +1 -0
- package/dist/webcomponents/{p-97c42345.entry.js → p-1bfadb9f.entry.js} +1 -1
- package/dist/webcomponents/p-221b9504.entry.js +1 -0
- package/dist/webcomponents/p-2df32b4a.entry.js +1 -0
- package/dist/webcomponents/{p-baafa7f5.js → p-34352d04.js} +1 -1
- package/dist/webcomponents/p-38ba2848.entry.js +1 -0
- package/dist/webcomponents/p-3d4aaa4a.entry.js +1 -0
- package/dist/webcomponents/p-41870765.entry.js +1 -0
- package/dist/webcomponents/p-461f42b8.entry.js +1 -0
- package/dist/webcomponents/p-48c2400e.js +1 -0
- package/dist/webcomponents/p-491ca87f.js +1 -0
- package/dist/webcomponents/{p-dc05b5c5.entry.js → p-4d50d08a.entry.js} +1 -1
- package/dist/webcomponents/{p-09b94d22.entry.js → p-4df6174c.entry.js} +1 -1
- package/dist/webcomponents/{p-c032b216.entry.js → p-5be4e217.entry.js} +1 -1
- package/dist/webcomponents/p-60714f2a.entry.js +1 -0
- package/dist/webcomponents/p-60b2344a.js +1 -0
- package/dist/webcomponents/{p-9e3771b7.entry.js → p-65500b31.entry.js} +1 -1
- package/dist/webcomponents/p-688bb5da.js +2 -0
- package/dist/webcomponents/{p-92a55427.entry.js → p-6b51cf97.entry.js} +1 -1
- package/dist/webcomponents/p-6d39b8bc.entry.js +1 -0
- package/dist/webcomponents/p-7ec301b5.entry.js +1 -0
- package/dist/webcomponents/p-817211f2.entry.js +1 -0
- package/dist/webcomponents/{p-bb037696.js → p-8482c23f.js} +1 -1
- package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
- package/dist/webcomponents/p-975ab96e.js +1 -0
- package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
- package/dist/webcomponents/p-a141c531.js +1 -0
- package/dist/webcomponents/{p-e536a4c1.entry.js → p-a2dbe90f.entry.js} +1 -1
- package/dist/webcomponents/p-a4122c35.entry.js +1 -0
- package/dist/webcomponents/{p-591e29bf.entry.js → p-a46174e0.entry.js} +1 -1
- package/dist/webcomponents/{p-1cbdca15.entry.js → p-a68519e5.entry.js} +1 -1
- package/dist/webcomponents/p-af8363a1.entry.js +1 -0
- package/dist/webcomponents/{p-bb7f6095.entry.js → p-b1bc23af.entry.js} +1 -1
- package/dist/webcomponents/p-b37d6888.entry.js +1 -0
- package/dist/webcomponents/p-b5a3bf86.entry.js +1 -0
- package/dist/webcomponents/{p-7cd06ada.entry.js → p-b68f1dd9.entry.js} +1 -1
- package/dist/webcomponents/p-b8f22856.js +1 -0
- package/dist/webcomponents/p-cb8f9cb8.entry.js +1 -0
- package/dist/webcomponents/p-d0761829.entry.js +1 -0
- package/dist/webcomponents/{p-c2c3d5d1.entry.js → p-da34bba7.entry.js} +1 -1
- package/dist/webcomponents/p-dbe32e75.entry.js +1 -0
- package/dist/webcomponents/p-e0c1cba8.js +1 -0
- package/dist/webcomponents/{p-99a8b7d0.entry.js → p-e924f2e1.entry.js} +1 -1
- package/dist/webcomponents/p-ea03b424.entry.js +1 -0
- package/dist/webcomponents/{p-9c310f5c.entry.js → p-ebf7c70f.entry.js} +1 -1
- package/dist/webcomponents/p-ec230480.entry.js +1 -0
- package/dist/webcomponents/p-eed5f4ad.entry.js +1 -0
- package/dist/webcomponents/{p-9a63eec9.entry.js → p-fb49ef28.entry.js} +1 -1
- package/dist/webcomponents/{p-41490d96.entry.js → p-fe8a94c1.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/BusinessFormEventTypes-62990815.js +0 -42
- package/dist/cjs/business-form-schema-37e5381d.js +0 -148
- package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +0 -143
- package/dist/collection/components/business-form/BusinessFormEventTypes.js +0 -6
- package/dist/collection/components/business-form/business-address/business-address-form-schema.js +0 -13
- package/dist/collection/components/business-form/business-form-schema.js +0 -159
- package/dist/collection/components/business-form/business-form-stepped.js +0 -260
- package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +0 -77
- package/dist/collection/components/business-form/business-representative/business-representative-schema.js +0 -1
- package/dist/collection/components/business-form/helpers.js +0 -23
- package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +0 -10
- package/dist/esm/BusinessFormEventTypes-182e20be.js +0 -39
- package/dist/esm/business-form-schema-f8f554d1.js +0 -144
- package/dist/esm/justifi-business-form-stepped.entry.js +0 -139
- package/dist/module/BusinessFormEventTypes.js +0 -39
- package/dist/module/business-generic-info.js +0 -210
- package/dist/module/justifi-business-form-stepped.d.ts +0 -11
- package/dist/module/justifi-business-form-stepped.js +0 -231
- package/dist/module/justifi-business-generic-info.d.ts +0 -11
- package/dist/module/justifi-business-generic-info.js +0 -6
- package/dist/types/components/business-form/BusinessFormEventTypes.d.ts +0 -5
- package/dist/types/components/business-form/business-form-stepped.d.ts +0 -48
- package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +0 -17
- package/dist/types/components/business-form/helpers.d.ts +0 -1
- package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +0 -17
- package/dist/webcomponents/p-018b71f5.entry.js +0 -1
- package/dist/webcomponents/p-1b04d091.entry.js +0 -1
- package/dist/webcomponents/p-1bac1674.entry.js +0 -1
- package/dist/webcomponents/p-2f0653f4.entry.js +0 -1
- package/dist/webcomponents/p-3134ab82.entry.js +0 -1
- package/dist/webcomponents/p-34f9fe6b.js +0 -1
- package/dist/webcomponents/p-3bae0ed3.entry.js +0 -1
- package/dist/webcomponents/p-41031759.entry.js +0 -1
- package/dist/webcomponents/p-4ed3a9f5.entry.js +0 -1
- package/dist/webcomponents/p-4edd9721.js +0 -1
- package/dist/webcomponents/p-51b0bf2a.entry.js +0 -1
- package/dist/webcomponents/p-531844f6.entry.js +0 -1
- package/dist/webcomponents/p-5d5d7550.entry.js +0 -1
- package/dist/webcomponents/p-5ea274b8.js +0 -1
- package/dist/webcomponents/p-5f785ede.entry.js +0 -1
- package/dist/webcomponents/p-6d05174c.js +0 -2
- package/dist/webcomponents/p-72d1ad98.entry.js +0 -1
- package/dist/webcomponents/p-796cf44f.entry.js +0 -1
- package/dist/webcomponents/p-8f895ec3.entry.js +0 -1
- package/dist/webcomponents/p-a81229a5.entry.js +0 -1
- package/dist/webcomponents/p-b8a8b551.js +0 -1
- package/dist/webcomponents/p-babd292f.entry.js +0 -1
- package/dist/webcomponents/p-c8d51336.entry.js +0 -1
- package/dist/webcomponents/p-e6939585.entry.js +0 -1
- package/dist/webcomponents/p-ec358d69.entry.js +0 -1
- package/dist/webcomponents/p-f55ac955.entry.js +0 -1
- /package/dist/cjs/{state-options-96d05a98.js → state-options-4fbcb48a.js} +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.e2e.js +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.spec.js +0 -0
- /package/dist/collection/components/{business-form/business-generic-info/business-generic-info.css → business-forms/business-form/business-core-info/business-core-info.css} +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-form.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.css +0 -0
- /package/dist/collection/components/{business-form → business-forms/business-form}/test/business-form.spec.js +0 -0
- /package/dist/collection/{components/billing-form → utils}/state-options.js +0 -0
- /package/dist/esm/{state-options-fc1daf67.js → state-options-a356fb11.js} +0 -0
- /package/dist/types/{components/billing-form → utils}/state-options.d.ts +0 -0
- /package/dist/webcomponents/{p-8e2a88a8.js → p-6078a370.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { object, string } from "yup";
|
|
2
|
+
import { identityAddressSchema } from "./business-address-schema";
|
|
3
|
+
export const phoneRegex = /^[0-9]+$/;
|
|
4
|
+
export const representativeSchema = object({
|
|
5
|
+
name: string().required('Enter representative name'),
|
|
6
|
+
email: string()
|
|
7
|
+
.email('Enter valid representative email')
|
|
8
|
+
.required('Enter representative email'),
|
|
9
|
+
phone: string()
|
|
10
|
+
.required('Enter representative phone number')
|
|
11
|
+
.matches(phoneRegex, 'Phone number must contain only numbers')
|
|
12
|
+
.min(10, 'Phone number must contain 10 digits')
|
|
13
|
+
.max(10, 'Phone number must contain 10 digits'),
|
|
14
|
+
dob_day: string().required('Enter representative birth day'),
|
|
15
|
+
dob_month: string().required('Enter representative birth month'),
|
|
16
|
+
dob_year: string().required('Enter representative birth year'),
|
|
17
|
+
identification_number: string(),
|
|
18
|
+
address: identityAddressSchema,
|
|
19
|
+
});
|
|
20
|
+
export const ownerSchema = object({
|
|
21
|
+
name: string().required('Enter owner name'),
|
|
22
|
+
email: string()
|
|
23
|
+
.email('Enter valid owner email')
|
|
24
|
+
.required('Enter owner email'),
|
|
25
|
+
phone: string()
|
|
26
|
+
.required('Enter owner phone number')
|
|
27
|
+
.matches(phoneRegex, 'Phone number must contain only numbers')
|
|
28
|
+
.min(10, 'Phone number must contain 10 digits')
|
|
29
|
+
.max(10, 'Phone number must contain 10 digits'),
|
|
30
|
+
dob_day: string().required('Enter owner birth day'),
|
|
31
|
+
dob_month: string().required('Enter owner birth month'),
|
|
32
|
+
dob_year: string().required('Enter owner birth year'),
|
|
33
|
+
identification_number: string(),
|
|
34
|
+
address: identityAddressSchema,
|
|
35
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { object, string, boolean } from "yup";
|
|
2
|
+
import { identityAddressSchema } from "./business-address-schema";
|
|
3
|
+
export const ownerSchema = object({
|
|
4
|
+
name: string().required('Enter owner name'),
|
|
5
|
+
title: string().required('Enter owner title'),
|
|
6
|
+
email: string()
|
|
7
|
+
.email('Enter valid owner email')
|
|
8
|
+
.required('Enter owner email'),
|
|
9
|
+
phone: string().required('Enter owner phone number'),
|
|
10
|
+
dob_day: string().required('Enter owner birth day'),
|
|
11
|
+
dob_month: string().required('Enter owner birth month'),
|
|
12
|
+
dob_year: string().required('Enter owner birth year'),
|
|
13
|
+
identification_number: string(),
|
|
14
|
+
is_owner: boolean(),
|
|
15
|
+
address: identityAddressSchema,
|
|
16
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const BusinessTypeOptions = [
|
|
2
|
+
{
|
|
3
|
+
label: 'Choose business type',
|
|
4
|
+
value: '',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
label: 'Individual',
|
|
8
|
+
value: 'individual',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: 'For Profit',
|
|
12
|
+
value: 'for_profit',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: 'Non Profit',
|
|
16
|
+
value: 'non_profit',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'Government Entity',
|
|
20
|
+
value: 'government_entity',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
export const BusinessStructureOptions = [
|
|
24
|
+
{
|
|
25
|
+
label: 'Choose business structure',
|
|
26
|
+
value: '',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Sole Proprietorship',
|
|
30
|
+
value: 'sole_proprietorship',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'LLC (Single)',
|
|
34
|
+
value: 'single_llc',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'LLC (Multiple)',
|
|
38
|
+
value: 'multi_llc',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Private Partnership',
|
|
42
|
+
value: 'private_partnership',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'Private Corporation',
|
|
46
|
+
value: 'private_corporation',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'Unincorporated Association',
|
|
50
|
+
value: 'unincorporated_association',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Public Partnership',
|
|
54
|
+
value: 'public_partnership',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Public Corporation',
|
|
58
|
+
value: 'public_corporation',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Incorporated',
|
|
62
|
+
value: 'incorporated',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Unincorporated',
|
|
66
|
+
value: 'unincorporated',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'Government Unit',
|
|
70
|
+
value: 'government_unit',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'Government Instrumentality',
|
|
74
|
+
value: 'government_instrumentality',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'Tax Exempt Government Instrumentality',
|
|
78
|
+
value: 'tax_exempt_government_instrumentality',
|
|
79
|
+
},
|
|
80
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var BusinessFormServerErrors;
|
|
2
|
+
(function (BusinessFormServerErrors) {
|
|
3
|
+
BusinessFormServerErrors["fetchData"] = "Error retrieving business data";
|
|
4
|
+
BusinessFormServerErrors["patchData"] = "Error updating business data";
|
|
5
|
+
})(BusinessFormServerErrors || (BusinessFormServerErrors = {}));
|
|
6
|
+
export var BusinessFormClickActions;
|
|
7
|
+
(function (BusinessFormClickActions) {
|
|
8
|
+
BusinessFormClickActions["nextStep"] = "nextStep";
|
|
9
|
+
BusinessFormClickActions["previousStep"] = "previousStep";
|
|
10
|
+
BusinessFormClickActions["submit"] = "submit";
|
|
11
|
+
})(BusinessFormClickActions || (BusinessFormClickActions = {}));
|
|
12
|
+
export var OwnerFormServerErrors;
|
|
13
|
+
(function (OwnerFormServerErrors) {
|
|
14
|
+
OwnerFormServerErrors["fetchData"] = "Error retrieving owner data";
|
|
15
|
+
OwnerFormServerErrors["patchData"] = "Error updating owner data";
|
|
16
|
+
OwnerFormServerErrors["postData"] = "Error adding owner data";
|
|
17
|
+
})(OwnerFormServerErrors || (OwnerFormServerErrors = {}));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// These props should not be sent to the server
|
|
2
|
+
// This function is for the larger business form.
|
|
3
|
+
export const parseBusiness = (values, initialValues) => {
|
|
4
|
+
var _a;
|
|
5
|
+
parseCoreInfo(values);
|
|
6
|
+
parseAddressInfo(values.legal_address);
|
|
7
|
+
parseIdentityInfo(values.representative);
|
|
8
|
+
((_a = initialValues.owners) === null || _a === void 0 ? void 0 : _a.length) && delete values.owners;
|
|
9
|
+
return values;
|
|
10
|
+
};
|
|
11
|
+
// These functions are for the stepped business form.
|
|
12
|
+
export const parseCoreInfo = (values) => {
|
|
13
|
+
delete values.id;
|
|
14
|
+
delete values.documents;
|
|
15
|
+
delete values.bank_accounts;
|
|
16
|
+
delete values.product_categories;
|
|
17
|
+
delete values.created_at;
|
|
18
|
+
delete values.updated_at;
|
|
19
|
+
return values;
|
|
20
|
+
};
|
|
21
|
+
export const parseAddressInfo = (values) => {
|
|
22
|
+
delete values.id;
|
|
23
|
+
delete values.created_at;
|
|
24
|
+
delete values.updated_at;
|
|
25
|
+
return values;
|
|
26
|
+
};
|
|
27
|
+
export const parseIdentityInfo = (values) => {
|
|
28
|
+
delete values.id;
|
|
29
|
+
delete values.documents;
|
|
30
|
+
delete values.created_at;
|
|
31
|
+
delete values.updated_at;
|
|
32
|
+
delete values.address.id;
|
|
33
|
+
delete values.address.created_at;
|
|
34
|
+
delete values.address.updated_at;
|
|
35
|
+
delete values.business_id;
|
|
36
|
+
return values;
|
|
37
|
+
};
|
|
@@ -7,7 +7,7 @@ export class DatePartInput {
|
|
|
7
7
|
this.name = undefined;
|
|
8
8
|
this.error = undefined;
|
|
9
9
|
this.defaultValue = undefined;
|
|
10
|
-
this.type =
|
|
10
|
+
this.type = 'day';
|
|
11
11
|
this.inputHandler = undefined;
|
|
12
12
|
this.disabled = undefined;
|
|
13
13
|
}
|
|
@@ -15,45 +15,49 @@ export class DatePartInput {
|
|
|
15
15
|
this.updateInput(newValue);
|
|
16
16
|
}
|
|
17
17
|
componentDidLoad() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
maskOptions = {
|
|
29
|
-
mask: Number,
|
|
30
|
-
min: 1900,
|
|
31
|
-
max: new Date().getFullYear(),
|
|
32
|
-
};
|
|
33
|
-
break;
|
|
34
|
-
default:
|
|
35
|
-
throw new Error('Invalid type prop');
|
|
36
|
-
}
|
|
37
|
-
this.imask = IMask(this.textInput, maskOptions);
|
|
38
|
-
this.imask.on('accept', () => {
|
|
39
|
-
const rawValue = this.imask.unmaskedValue;
|
|
40
|
-
this.inputHandler(this.name, rawValue);
|
|
41
|
-
});
|
|
42
|
-
this.textInput.addEventListener('blur', () => {
|
|
43
|
-
this.formControlBlur.emit();
|
|
44
|
-
});
|
|
45
|
-
this.updateInput(this.defaultValue);
|
|
18
|
+
this.initializeMask();
|
|
19
|
+
this.updateInput(this.defaultValue);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
var _a;
|
|
23
|
+
(_a = this.imask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
24
|
+
}
|
|
25
|
+
initializeMask() {
|
|
26
|
+
if (!this.textInput) {
|
|
27
|
+
return;
|
|
46
28
|
}
|
|
29
|
+
let maskOptions;
|
|
30
|
+
switch (this.type) {
|
|
31
|
+
default:
|
|
32
|
+
case 'day':
|
|
33
|
+
maskOptions = { mask: Number, min: 1, max: 31 };
|
|
34
|
+
break;
|
|
35
|
+
case 'month':
|
|
36
|
+
maskOptions = { mask: Number, min: 1, max: 12 };
|
|
37
|
+
break;
|
|
38
|
+
case 'year':
|
|
39
|
+
maskOptions = {
|
|
40
|
+
mask: Number,
|
|
41
|
+
min: 1900,
|
|
42
|
+
max: new Date().getFullYear(),
|
|
43
|
+
};
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
this.imask = IMask(this.textInput, maskOptions);
|
|
47
|
+
this.imask.on('accept', () => {
|
|
48
|
+
const rawValue = this.imask.unmaskedValue;
|
|
49
|
+
this.inputHandler(this.name, rawValue);
|
|
50
|
+
this.formControlInput.emit({ name: this.name, value: rawValue });
|
|
51
|
+
});
|
|
52
|
+
this.textInput.addEventListener('blur', () => {
|
|
53
|
+
this.formControlBlur.emit();
|
|
54
|
+
});
|
|
47
55
|
}
|
|
48
56
|
updateInput(newValue) {
|
|
49
57
|
if (this.imask) {
|
|
50
58
|
this.imask.value = String(newValue);
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
|
-
disconnectedCallback() {
|
|
54
|
-
var _a;
|
|
55
|
-
(_a = this.imask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
56
|
-
}
|
|
57
61
|
render() {
|
|
58
62
|
return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label", htmlFor: this.name }, this.label), h("input", { ref: el => (this.textInput = el), id: this.name, name: this.name, onBlur: () => this.formControlBlur.emit(), part: `input ${this.error && 'input-invalid'}`, class: this.error ? 'form-control is-invalid' : 'form-control', type: "text", disabled: this.disabled }), this.error && h("div", { class: "invalid-feedback" }, this.error)));
|
|
59
63
|
}
|
|
@@ -154,7 +158,8 @@ export class DatePartInput {
|
|
|
154
158
|
"text": ""
|
|
155
159
|
},
|
|
156
160
|
"attribute": "type",
|
|
157
|
-
"reflect": false
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"defaultValue": "'day'"
|
|
158
163
|
},
|
|
159
164
|
"inputHandler": {
|
|
160
165
|
"type": "unknown",
|
|
@@ -13,29 +13,31 @@ export class MonetaryInput {
|
|
|
13
13
|
this.updateInput(newValue);
|
|
14
14
|
}
|
|
15
15
|
componentDidLoad() {
|
|
16
|
-
|
|
17
|
-
this.imask = IMask(this.textInput, {
|
|
18
|
-
mask: Number,
|
|
19
|
-
scale: 2,
|
|
20
|
-
thousandsSeparator: ',',
|
|
21
|
-
padFractionalZeros: true,
|
|
22
|
-
normalizeZeros: true,
|
|
23
|
-
radix: '.',
|
|
24
|
-
});
|
|
25
|
-
this.imask.on('accept', () => {
|
|
26
|
-
const rawValue = this.imask.unmaskedValue;
|
|
27
|
-
this.inputHandler(this.name, rawValue);
|
|
28
|
-
});
|
|
29
|
-
this.textInput.addEventListener('blur', () => {
|
|
30
|
-
this.formControlBlur.emit();
|
|
31
|
-
});
|
|
32
|
-
}
|
|
16
|
+
this.initializeIMask();
|
|
33
17
|
this.updateInput(this.defaultValue);
|
|
34
18
|
}
|
|
35
19
|
disconnectedCallback() {
|
|
36
20
|
var _a;
|
|
37
21
|
(_a = this.imask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
38
22
|
}
|
|
23
|
+
initializeIMask() {
|
|
24
|
+
if (!this.textInput)
|
|
25
|
+
return;
|
|
26
|
+
this.imask = IMask(this.textInput, {
|
|
27
|
+
mask: Number,
|
|
28
|
+
scale: 2,
|
|
29
|
+
thousandsSeparator: ',',
|
|
30
|
+
padFractionalZeros: true,
|
|
31
|
+
normalizeZeros: true,
|
|
32
|
+
radix: '.',
|
|
33
|
+
});
|
|
34
|
+
this.imask.on('accept', () => {
|
|
35
|
+
const rawValue = this.imask.unmaskedValue;
|
|
36
|
+
this.inputHandler(this.name, rawValue);
|
|
37
|
+
this.formControlInput.emit({ name: this.name, value: rawValue });
|
|
38
|
+
});
|
|
39
|
+
this.textInput.addEventListener('blur', () => this.formControlBlur.emit());
|
|
40
|
+
}
|
|
39
41
|
updateInput(newValue) {
|
|
40
42
|
if (this.imask) {
|
|
41
43
|
this.imask.value = String(newValue);
|
|
@@ -76,11 +78,11 @@ export class MonetaryInput {
|
|
|
76
78
|
"reflect": false
|
|
77
79
|
},
|
|
78
80
|
"name": {
|
|
79
|
-
"type": "
|
|
81
|
+
"type": "string",
|
|
80
82
|
"mutable": false,
|
|
81
83
|
"complexType": {
|
|
82
|
-
"original": "
|
|
83
|
-
"resolved": "
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
84
86
|
"references": {}
|
|
85
87
|
},
|
|
86
88
|
"required": false,
|
|
@@ -22,6 +22,7 @@ export class NumberInput {
|
|
|
22
22
|
const target = event.target;
|
|
23
23
|
const name = target.getAttribute('name');
|
|
24
24
|
this.inputHandler(name, target.value);
|
|
25
|
+
this.formControlInput.emit({ name, value: target.value });
|
|
25
26
|
}
|
|
26
27
|
componentDidLoad() {
|
|
27
28
|
this.updateInput(this.defaultValue);
|
|
@@ -19,12 +19,14 @@ export class SelectInput {
|
|
|
19
19
|
const target = event.target;
|
|
20
20
|
const name = target.getAttribute('name');
|
|
21
21
|
this.inputHandler(name, target.value);
|
|
22
|
+
this.formControlInput.emit(target.value);
|
|
22
23
|
}
|
|
23
24
|
componentDidLoad() {
|
|
24
25
|
this.updateInput(this.defaultValue);
|
|
25
26
|
}
|
|
26
27
|
render() {
|
|
27
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label", htmlFor: this.name }, this.label), h("select", { ref: el => (this.selectElement = el), id: this.name, name: this.name, onInput: (event) => this.handleFormControlInput(event), onBlur: () => this.formControlBlur.emit(), part: `input ${this.error ? 'input-invalid' : ''}`, class: this.error ? 'form-select is-invalid' : 'form-select', disabled: this.disabled }, (_a = this.options) === null || _a === void 0 ? void 0 : _a.map(option => (h("option", { value: option.value }, option.label)))), this.error && h("div", { class: "invalid-feedback" }, this.error)));
|
|
28
30
|
}
|
|
29
31
|
static get is() { return "form-control-select"; }
|
|
30
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -22,12 +22,13 @@ export class TextInput {
|
|
|
22
22
|
const target = event.target;
|
|
23
23
|
const name = target.getAttribute('name');
|
|
24
24
|
this.inputHandler(name, target.value);
|
|
25
|
+
this.formControlInput.emit(target.value);
|
|
25
26
|
}
|
|
26
27
|
componentDidLoad() {
|
|
27
28
|
this.updateInput(this.defaultValue);
|
|
28
29
|
}
|
|
29
30
|
render() {
|
|
30
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label", htmlFor: this.name }, this.label), h("input", { id: this.name, name: this.name, onInput: (event) => this.handleFormControlInput(event), onBlur: () => this.formControlBlur.emit(), part: `input ${this.error
|
|
31
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("label", { part: "label", class: "form-label", htmlFor: this.name }, this.label), h("input", { id: this.name, name: this.name, onInput: (event) => this.handleFormControlInput(event), onBlur: () => this.formControlBlur.emit(), part: `input ${this.error ? 'input-invalid ' : ''}${this.disabled ? ' input-disabled' : ''}`, class: this.error ? 'form-control is-invalid' : 'form-control', type: "text", disabled: this.disabled }), this.error && h("div", { class: "invalid-feedback" }, this.error)));
|
|
31
32
|
}
|
|
32
33
|
static get is() { return "form-control-text"; }
|
|
33
34
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { DatePartInput } from "../form-control-datepart";
|
|
3
|
+
import * as IMaskPackage from "imask";
|
|
4
|
+
jest.mock('imask', () => ({
|
|
5
|
+
default: jest.fn().mockImplementation(() => ({
|
|
6
|
+
on: jest.fn(),
|
|
7
|
+
destroy: jest.fn(),
|
|
8
|
+
value: '',
|
|
9
|
+
unmaskedValue: '',
|
|
10
|
+
})),
|
|
11
|
+
}));
|
|
12
|
+
const IMaskSpy = jest.spyOn(IMaskPackage, 'default');
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
jest.clearAllMocks();
|
|
15
|
+
});
|
|
16
|
+
describe('form-control-datepart', () => {
|
|
17
|
+
it('renders correctly with default props', async () => {
|
|
18
|
+
const page = await newSpecPage({
|
|
19
|
+
components: [DatePartInput],
|
|
20
|
+
html: `<form-control-datepart label="Date Part" name="datepart"></form-control-datepart>`,
|
|
21
|
+
});
|
|
22
|
+
expect(page.root).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
it('should initialize IMask with correct options for "day" type', async () => {
|
|
25
|
+
await newSpecPage({
|
|
26
|
+
components: [DatePartInput],
|
|
27
|
+
html: '<form-control-datepart type="day"></form-control-datepart>',
|
|
28
|
+
});
|
|
29
|
+
expect(IMaskSpy).toHaveBeenCalled();
|
|
30
|
+
expect(IMaskSpy.mock.calls[0][1]).toEqual({ mask: Number, min: 1, max: 31 });
|
|
31
|
+
});
|
|
32
|
+
it('should initialize IMask with correct options for "month" type', async () => {
|
|
33
|
+
// Clear mocks to reset the calls count
|
|
34
|
+
jest.clearAllMocks();
|
|
35
|
+
await newSpecPage({
|
|
36
|
+
components: [DatePartInput],
|
|
37
|
+
html: '<form-control-datepart type="month"></form-control-datepart>',
|
|
38
|
+
});
|
|
39
|
+
expect(IMaskSpy).toHaveBeenCalled();
|
|
40
|
+
expect(IMaskSpy.mock.calls[0][1]).toEqual({ mask: Number, min: 1, max: 12 });
|
|
41
|
+
});
|
|
42
|
+
it('should initialize IMask with correct options for "year" type', async () => {
|
|
43
|
+
// Clear mocks to reset the calls count
|
|
44
|
+
jest.clearAllMocks();
|
|
45
|
+
await newSpecPage({
|
|
46
|
+
components: [DatePartInput],
|
|
47
|
+
html: '<form-control-datepart type="year"></form-control-datepart>',
|
|
48
|
+
});
|
|
49
|
+
expect(IMaskSpy).toHaveBeenCalled();
|
|
50
|
+
expect(IMaskSpy.mock.calls[0][1]).toEqual({ mask: Number, min: 1900, max: new Date().getFullYear() });
|
|
51
|
+
});
|
|
52
|
+
it('emits formControlBlur on input blur', async () => {
|
|
53
|
+
const page = await newSpecPage({
|
|
54
|
+
components: [DatePartInput],
|
|
55
|
+
html: `<form-control-datepart></form-control-datepart>`,
|
|
56
|
+
});
|
|
57
|
+
const blurSpy = jest.fn();
|
|
58
|
+
page.win.addEventListener('formControlBlur', blurSpy);
|
|
59
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
60
|
+
input.dispatchEvent(new Event('blur', { bubbles: true }));
|
|
61
|
+
await page.waitForChanges();
|
|
62
|
+
expect(blurSpy).toHaveBeenCalled();
|
|
63
|
+
});
|
|
64
|
+
it('calls inputHandler and emits formControlInput on user input', async () => {
|
|
65
|
+
const inputHandlerMock = jest.fn();
|
|
66
|
+
const page = await newSpecPage({
|
|
67
|
+
components: [DatePartInput],
|
|
68
|
+
html: `<form-control-datepart type="day" name="day"></form-control-datepart>`,
|
|
69
|
+
});
|
|
70
|
+
page.rootInstance.inputHandler = inputHandlerMock;
|
|
71
|
+
await page.waitForChanges();
|
|
72
|
+
const inputSpy = jest.fn();
|
|
73
|
+
page.win.addEventListener('formControlInput', inputSpy);
|
|
74
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
75
|
+
input.value = '15'; // Assuming 'day' type for simplicity
|
|
76
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
77
|
+
await page.waitForChanges();
|
|
78
|
+
expect(inputHandlerMock).toHaveBeenCalledWith('day', '15');
|
|
79
|
+
expect(inputSpy).toHaveBeenCalled();
|
|
80
|
+
});
|
|
81
|
+
it('displays error message correctly', async () => {
|
|
82
|
+
const page = await newSpecPage({
|
|
83
|
+
components: [DatePartInput],
|
|
84
|
+
html: `<form-control-datepart error="Error message"></form-control-datepart>`,
|
|
85
|
+
});
|
|
86
|
+
expect(page.root).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { MonetaryInput } from "../form-control-monetary";
|
|
3
|
+
describe('form-control-monetary', () => {
|
|
4
|
+
it('renders correctly with default props', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [MonetaryInput],
|
|
7
|
+
html: `<form-control-monetary></form-control-monetary>`,
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
it('handles props correctly', async () => {
|
|
12
|
+
const page = await newSpecPage({
|
|
13
|
+
components: [MonetaryInput],
|
|
14
|
+
html: `
|
|
15
|
+
<form-control-monetary
|
|
16
|
+
label="Amount"
|
|
17
|
+
name="amount"
|
|
18
|
+
error="Invalid amount"
|
|
19
|
+
defaultValue="1000"
|
|
20
|
+
></form-control-monetary>
|
|
21
|
+
`,
|
|
22
|
+
});
|
|
23
|
+
await page.waitForChanges();
|
|
24
|
+
const label = page.root.shadowRoot.querySelector('label');
|
|
25
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
26
|
+
const errorDiv = page.root.shadowRoot.querySelector('.invalid-feedback');
|
|
27
|
+
expect(label.textContent).toBe('Amount');
|
|
28
|
+
expect(input.getAttribute('name')).toBe('amount');
|
|
29
|
+
expect(errorDiv.textContent).toBe('Invalid amount');
|
|
30
|
+
});
|
|
31
|
+
it('calls inputHandler and emits formControlInput on user input', async () => {
|
|
32
|
+
const inputHandlerMock = jest.fn();
|
|
33
|
+
const page = await newSpecPage({
|
|
34
|
+
components: [MonetaryInput],
|
|
35
|
+
html: `<form-control-monetary></form-control-monetary>`,
|
|
36
|
+
});
|
|
37
|
+
page.rootInstance.inputHandler = inputHandlerMock;
|
|
38
|
+
await page.waitForChanges();
|
|
39
|
+
const inputSpy = jest.fn();
|
|
40
|
+
page.win.addEventListener('formControlInput', inputSpy);
|
|
41
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
42
|
+
input.value = '1234.56';
|
|
43
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
44
|
+
await page.waitForChanges();
|
|
45
|
+
expect(inputHandlerMock).toHaveBeenCalled();
|
|
46
|
+
expect(inputSpy).toHaveBeenCalled();
|
|
47
|
+
});
|
|
48
|
+
it('emits formControlBlur on input blur', async () => {
|
|
49
|
+
const page = await newSpecPage({
|
|
50
|
+
components: [MonetaryInput],
|
|
51
|
+
html: `<form-control-monetary></form-control-monetary>`,
|
|
52
|
+
});
|
|
53
|
+
const blurSpy = jest.fn();
|
|
54
|
+
page.win.addEventListener('formControlBlur', blurSpy);
|
|
55
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
56
|
+
input.dispatchEvent(new Event('blur', { bubbles: true }));
|
|
57
|
+
await page.waitForChanges();
|
|
58
|
+
expect(blurSpy).toHaveBeenCalled();
|
|
59
|
+
});
|
|
60
|
+
it('displays error message when error prop is set', async () => {
|
|
61
|
+
const page = await newSpecPage({
|
|
62
|
+
components: [MonetaryInput],
|
|
63
|
+
html: `<form-control-monetary error="Invalid amount"></form-control-monetary>`,
|
|
64
|
+
});
|
|
65
|
+
const errorDiv = page.root.shadowRoot.querySelector('.invalid-feedback');
|
|
66
|
+
expect(errorDiv.textContent).toBe('Invalid amount');
|
|
67
|
+
expect(page.root).toMatchSnapshot();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { NumberInput } from "../form-control-number";
|
|
3
|
+
describe('form-control-number', () => {
|
|
4
|
+
it('renders with default props', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [NumberInput],
|
|
7
|
+
html: `<form-control-number label="Age"></form-control-number>`,
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
it('renders with an error message', async () => {
|
|
12
|
+
const page = await newSpecPage({
|
|
13
|
+
components: [NumberInput],
|
|
14
|
+
html: `<form-control-number label="Age" error="Invalid input"></form-control-number>`,
|
|
15
|
+
});
|
|
16
|
+
expect(page.root).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
it('handles the disabled state', async () => {
|
|
19
|
+
const page = await newSpecPage({
|
|
20
|
+
components: [NumberInput],
|
|
21
|
+
html: `<form-control-number label="Age" disabled></form-control-number>`,
|
|
22
|
+
});
|
|
23
|
+
expect(page.root).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
it('updates the input value when defaultValue changes', async () => {
|
|
26
|
+
const page = await newSpecPage({
|
|
27
|
+
components: [NumberInput],
|
|
28
|
+
html: `<form-control-number label="Age"></form-control-number>`,
|
|
29
|
+
});
|
|
30
|
+
let input = page.root.shadowRoot.querySelector('input');
|
|
31
|
+
expect(input.value).toBe(''); // Default should be empty
|
|
32
|
+
page.root.defaultValue = '30';
|
|
33
|
+
await page.waitForChanges();
|
|
34
|
+
input = page.root.shadowRoot.querySelector('input');
|
|
35
|
+
expect(input.value).toBe('30');
|
|
36
|
+
});
|
|
37
|
+
it('calls inputHandler on user input', async () => {
|
|
38
|
+
const inputHandlerMock = jest.fn();
|
|
39
|
+
const page = await newSpecPage({
|
|
40
|
+
components: [NumberInput],
|
|
41
|
+
html: `<form-control-number name="age"></form-control-number>`,
|
|
42
|
+
});
|
|
43
|
+
page.rootInstance.inputHandler = inputHandlerMock;
|
|
44
|
+
await page.waitForChanges();
|
|
45
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
46
|
+
input.value = '25';
|
|
47
|
+
await input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
48
|
+
expect(inputHandlerMock).toHaveBeenCalledWith('age', '25');
|
|
49
|
+
});
|
|
50
|
+
it('emits formControlBlur on input blur', async () => {
|
|
51
|
+
const page = await newSpecPage({
|
|
52
|
+
components: [NumberInput],
|
|
53
|
+
html: `<form-control-number></form-control-number>`,
|
|
54
|
+
});
|
|
55
|
+
const blurSpy = jest.fn();
|
|
56
|
+
page.win.addEventListener('formControlBlur', blurSpy);
|
|
57
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
58
|
+
await input.dispatchEvent(new CustomEvent('blur'));
|
|
59
|
+
expect(blurSpy).toHaveBeenCalled();
|
|
60
|
+
});
|
|
61
|
+
it('emits formControlInput on input', async () => {
|
|
62
|
+
const page = await newSpecPage({
|
|
63
|
+
components: [NumberInput],
|
|
64
|
+
html: `<form-control-number name="age"></form-control-number>`,
|
|
65
|
+
});
|
|
66
|
+
page.rootInstance.inputHandler = jest.fn();
|
|
67
|
+
await page.waitForChanges();
|
|
68
|
+
const inputSpy = jest.fn();
|
|
69
|
+
page.win.addEventListener('formControlInput', inputSpy);
|
|
70
|
+
const input = page.root.shadowRoot.querySelector('input');
|
|
71
|
+
input.value = '25';
|
|
72
|
+
const mockEvent = new Event('input', { bubbles: true });
|
|
73
|
+
Object.defineProperty(mockEvent, 'target', { value: input, enumerable: true });
|
|
74
|
+
await input.dispatchEvent(mockEvent);
|
|
75
|
+
expect(inputSpy).toHaveBeenCalled();
|
|
76
|
+
});
|
|
77
|
+
});
|