@justifi/webcomponents 4.20.1 → 4.22.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/{Analytics-3c89cfb4.js → Analytics-9db96975.js} +2 -2
- package/dist/cjs/{Api-b98b256f.js → Api-f5280a80.js} +6 -4
- package/dist/cjs/Checkout-a528241d.js +85 -0
- package/dist/cjs/{Payment-1a8a8ca6.js → Payment-04a842f4.js} +15 -0
- package/dist/cjs/SubAccount-cc95a4a0.js +106 -0
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-26b0eecb.js → business-additional-questions-schema-19f08938.js} +2 -2
- package/dist/cjs/business-details-core.cjs.entry.js +2 -2
- package/dist/cjs/{business-form-types-6e1fcda3.js → business-form-types-719b7f52.js} +11 -0
- package/dist/cjs/{business-identity-schema-503ecb77.js → business-identity-schema-a8bb2276.js} +2 -2
- package/dist/cjs/{business.service-031c0084.js → business.service-7faffa0b.js} +1 -1
- package/dist/cjs/{check-pkg-version-4fa0367d.js → check-pkg-version-23a1cabd.js} +1 -1
- package/dist/cjs/checkout.service-160f3a9c.js +36 -0
- package/dist/cjs/checkouts-list-core.cjs.entry.js +181 -0
- package/dist/cjs/checkouts-list-filters.cjs.entry.js +35 -0
- package/dist/cjs/{custom-popper.cjs.entry.js → custom-popper_4.cjs.entry.js} +106 -2
- package/dist/cjs/dispute-30c806f6.js +10 -0
- package/dist/cjs/form-alert_5.cjs.entry.js +3 -3
- package/dist/cjs/form-control-checkbox_9.cjs.entry.js +56 -33
- package/dist/cjs/form-control-date.cjs.entry.js +83 -0
- package/dist/cjs/form-control-error-text.cjs.entry.js +21 -0
- package/dist/cjs/form-control-file.cjs.entry.js +1 -1
- package/dist/cjs/form-control-help-text.cjs.entry.js +21 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number-masked_2.cjs.entry.js +99 -0
- package/dist/cjs/form-control-number.cjs.entry.js +1 -1
- package/dist/cjs/form-control-radio.cjs.entry.js +44 -0
- package/dist/cjs/form-control-textarea.cjs.entry.js +49 -0
- package/dist/cjs/{get-payout-csv-3a3260ec.js → get-payout-csv-12dc9540.js} +4 -3
- package/dist/cjs/get-subaccounts-8f7a930f.js +54 -0
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +30 -17
- package/dist/cjs/justifi-additional-statement_11.cjs.entry.js +173 -0
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1679 -14
- package/dist/cjs/justifi-business-details.cjs.entry.js +6 -6
- package/dist/cjs/justifi-business-form.cjs.entry.js +14 -13
- package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +5 -10
- package/dist/cjs/justifi-checkout.cjs.entry.js +13 -28
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +119 -0
- package/dist/cjs/justifi-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +28 -0
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +16 -0
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +5 -5
- package/dist/cjs/{justifi-new-payment-method_4.cjs.entry.js → justifi-new-payment-method_5.cjs.entry.js} +23 -6
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payment-details.cjs.entry.js +9 -8
- package/dist/cjs/justifi-payment-form.cjs.entry.js +12 -11
- package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +11 -12
- package/dist/cjs/justifi-payout-details.cjs.entry.js +10 -9
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +12 -14
- package/dist/cjs/justifi-refund-form.cjs.entry.js +7 -6
- package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +4 -4
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +8 -7
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +137 -0
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +59 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/{esm/payments-list-filters_2.entry.js → cjs/lodash-dbf6a6a4.js} +2 -57
- package/dist/cjs/{package-3a9ac89d.js → package-41c8f38c.js} +1 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +11 -10
- package/dist/cjs/{payment.service-47e2d84e.js → payment.service-83da752a.js} +4 -3
- package/dist/cjs/payments-list-core.cjs.entry.js +17 -17
- package/dist/cjs/payments-list-filters.cjs.entry.js +35 -0
- package/dist/cjs/payments-status-58e45b2e.js +26 -0
- package/dist/cjs/payout-details-core.cjs.entry.js +5 -4
- package/dist/cjs/payouts-list-core.cjs.entry.js +8 -24
- package/dist/cjs/payouts-status-2f7be07d.js +24 -0
- package/dist/cjs/{schema-validations-0a7e46a3.js → schema-validations-184a4356.js} +1 -1
- package/dist/cjs/styled-host-1adf46c3.js +14 -0
- package/dist/cjs/table-bb114e2f.js +20 -0
- package/dist/cjs/table-filters-menu.cjs.entry.js +35 -0
- package/dist/cjs/terminals-list-core.cjs.entry.js +166 -0
- package/dist/cjs/terminals-list-filters.cjs.entry.js +32 -0
- package/dist/cjs/{utils-af1b60a9.js → utils-3d84442d.js} +3 -44
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Api.js +6 -4
- package/dist/collection/api/Checkout.js +77 -1
- package/dist/collection/api/Payment.js +15 -0
- package/dist/collection/api/SubAccount.js +33 -0
- package/dist/collection/api/Terminal.js +25 -0
- package/dist/collection/api/get-subaccounts.js +31 -0
- package/dist/collection/api/index.js +2 -0
- package/dist/collection/api/services/checkout.service.js +10 -1
- package/dist/collection/api/services/subaccounts.service.js +13 -0
- package/dist/collection/api/services/terminal.service.js +20 -0
- package/dist/collection/collection-manifest.json +37 -14
- package/dist/collection/components/billing-form/billing-form.js +3 -3
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +1 -1
- package/dist/collection/components/business-details/business-details-core.js +1 -1
- package/dist/collection/components/business-details/business-details.js +1 -1
- package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +1 -1
- package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +1 -1
- package/dist/collection/components/business-details/owner-details/owner-details.js +1 -1
- package/dist/collection/components/business-details/representative-details/representative-details.js +1 -1
- package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +3 -3
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +2 -2
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -4
- package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +2 -2
- package/dist/collection/components/business-forms/owner-form/owner-form-core.js +2 -2
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +3 -3
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +43 -3
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +33 -5
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +26 -3
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +25 -3
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +3 -3
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +25 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +26 -3
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-input-group.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/input-configurations.js +17 -17
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +26 -3
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +25 -3
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-text.js +1 -1
- package/dist/collection/components/business-forms/utils/business-form-types.js +11 -0
- package/dist/collection/components/card-form/card-form.js +1 -1
- package/dist/collection/components/checkout/checkout-core.js +2 -2
- package/dist/collection/components/checkout/checkout.js +2 -2
- package/dist/collection/components/checkout/new-payment-method.js +1 -1
- package/dist/collection/components/checkout/payment-method-options.js +1 -1
- package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
- package/dist/collection/components/checkout/saved-payment-method.js +1 -1
- package/dist/collection/components/checkout/sezzle-payment-method.js +1 -1
- package/dist/collection/components/checkouts-list/checkouts-list-core.js +257 -0
- package/dist/collection/components/checkouts-list/checkouts-list-filters.js +84 -0
- package/dist/collection/components/checkouts-list/checkouts-list.js +208 -0
- package/dist/collection/components/checkouts-list/checkouts-status.js +13 -0
- package/dist/collection/components/checkouts-list/checkouts-table.js +20 -0
- package/dist/collection/components/checkouts-list/get-checkouts.js +31 -0
- package/dist/collection/components/dispute-management/counter-dispute/additional-statement.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/cancellation-policy.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/counter-dispute.js +90 -0
- package/dist/collection/components/dispute-management/counter-dispute/customer-details.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/dispute-reason.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/duplicate-charge.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/electronic-evidence.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/product-or-service.js +16 -0
- package/dist/collection/components/dispute-management/counter-dispute/refund-policy.js +8 -0
- package/dist/collection/components/dispute-management/counter-dispute/shipping-details.js +12 -0
- package/dist/collection/components/dispute-management/dispute-management-core.js +53 -0
- package/dist/collection/components/dispute-management/dispute-management.js +8 -0
- package/dist/collection/components/dispute-management/dispute-notification.js +48 -0
- package/dist/collection/components/dispute-management/dispute.js +8 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +2 -2
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +1 -1
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance-core.js +2 -2
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +1 -1
- package/dist/collection/components/payment-details/payment-details-core.js +10 -9
- package/dist/collection/components/payment-details/payment-details.js +1 -1
- package/dist/collection/components/payment-form/payment-form.js +3 -3
- package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
- package/dist/collection/components/payments-list/payments-list-core.js +14 -14
- package/dist/collection/components/payments-list/payments-list-filters.js +1 -1
- package/dist/collection/components/payments-list/payments-list.js +3 -5
- package/dist/collection/components/payments-list/payments-status.js +23 -0
- package/dist/collection/components/payout-details/payout-details-core.js +4 -3
- package/dist/collection/components/payout-details/payout-details.js +1 -1
- package/dist/collection/components/payouts-list/payouts-list-core.js +6 -22
- package/dist/collection/components/payouts-list/payouts-list.js +4 -7
- package/dist/collection/components/payouts-list/payouts-status.js +21 -0
- package/dist/collection/components/refund-form/refund-form.js +2 -2
- package/dist/collection/components/terminals-list/get-terminal-detail.js +29 -0
- package/dist/collection/components/terminals-list/get-terminals.js +31 -0
- package/dist/collection/components/terminals-list/terminals-list-core.js +257 -0
- package/dist/collection/components/terminals-list/terminals-list-filters.js +81 -0
- package/dist/collection/components/terminals-list/terminals-list.js +209 -0
- package/dist/collection/components/terminals-list/terminals-status.js +11 -0
- package/dist/collection/components/terminals-list/terminals-table.js +15 -0
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.css +9 -0
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +276 -0
- package/dist/collection/ui-components/custom-popper/custom-popper.js +8 -4
- package/dist/collection/{components → ui-components}/details/details.js +1 -1
- package/dist/collection/ui-components/filters/table-filters-menu.js +1 -1
- package/dist/collection/{components → ui-components}/form/form-control-checkbox.js +1 -1
- package/dist/collection/ui-components/form/form-control-date.js +284 -0
- package/dist/collection/{components → ui-components}/form/form-control-file.js +1 -1
- package/dist/collection/{components → ui-components}/form/form-control-monetary.js +1 -1
- package/dist/collection/{components → ui-components}/form/form-control-number-masked.js +1 -1
- package/dist/collection/{components → ui-components}/form/form-control-number.js +1 -1
- package/dist/collection/{components/form/form-control-date.js → ui-components/form/form-control-radio.js} +54 -36
- package/dist/collection/{components → ui-components}/form/form-control-select.js +1 -1
- package/dist/collection/{components → ui-components}/form/form-control-text.js +1 -1
- package/dist/collection/ui-components/form/form-control-textarea.js +229 -0
- package/dist/collection/ui-components/form/form-helpers/form-control-tooltip/form-control-tooltip.js +63 -0
- package/dist/collection/ui-components/index.js +1 -0
- package/dist/collection/utils/table.js +16 -0
- package/dist/collection/utils/utils.js +3 -42
- package/dist/docs.json +9561 -6219
- package/dist/esm/{Analytics-b0f6936a.js → Analytics-777962a4.js} +2 -2
- package/dist/esm/{Api-c8abc2e0.js → Api-391d00e2.js} +6 -4
- package/dist/esm/Checkout-0b4086f8.js +83 -0
- package/dist/esm/{Payment-6bf26fe2.js → Payment-30790721.js} +15 -0
- package/dist/esm/SubAccount-7f7e4c56.js +102 -0
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-a5583cf8.js → business-additional-questions-schema-97f52255.js} +2 -2
- package/dist/esm/business-details-core.entry.js +2 -2
- package/dist/esm/{business-form-types-1bc5fe08.js → business-form-types-8fd61b0e.js} +12 -1
- package/dist/esm/{business-identity-schema-9e3269fb.js → business-identity-schema-434e16bc.js} +2 -2
- package/dist/esm/{business.service-1f589b6e.js → business.service-97a3da69.js} +1 -1
- package/dist/esm/{check-pkg-version-10cadb08.js → check-pkg-version-bac8fac0.js} +1 -1
- package/dist/esm/checkout.service-ef1549c6.js +34 -0
- package/dist/esm/checkouts-list-core.entry.js +177 -0
- package/dist/esm/checkouts-list-filters.entry.js +31 -0
- package/dist/esm/{custom-popper.entry.js → custom-popper_4.entry.js} +105 -4
- package/dist/esm/dispute-4d2e0a04.js +10 -0
- package/dist/esm/form-alert_5.entry.js +3 -3
- package/dist/esm/form-control-checkbox_9.entry.js +56 -33
- package/dist/esm/form-control-date.entry.js +79 -0
- package/dist/esm/form-control-error-text.entry.js +17 -0
- package/dist/esm/form-control-file.entry.js +1 -1
- package/dist/esm/form-control-help-text.entry.js +17 -0
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/form-control-number-masked_2.entry.js +94 -0
- package/dist/esm/form-control-number.entry.js +1 -1
- package/dist/esm/form-control-radio.entry.js +40 -0
- package/dist/esm/form-control-textarea.entry.js +45 -0
- package/dist/esm/{get-payout-csv-93427146.js → get-payout-csv-70974763.js} +4 -3
- package/dist/esm/get-subaccounts-16c8ce40.js +51 -0
- package/dist/esm/gross-payment-chart-core.entry.js +3 -3
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +30 -17
- package/dist/esm/justifi-additional-statement_11.entry.js +159 -0
- package/dist/esm/justifi-bank-account-form.entry.js +3 -3
- package/dist/esm/justifi-billing-form_2.entry.js +1680 -15
- package/dist/esm/justifi-business-details.entry.js +6 -6
- package/dist/esm/justifi-business-form.entry.js +14 -13
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +4 -4
- package/dist/esm/justifi-checkout-core.entry.js +4 -9
- package/dist/esm/justifi-checkout.entry.js +11 -26
- package/dist/esm/justifi-checkouts-list.entry.js +115 -0
- package/dist/esm/justifi-details.entry.js +3 -3
- package/dist/esm/justifi-dispute-management-core.entry.js +24 -0
- package/dist/esm/justifi-dispute-management.entry.js +12 -0
- package/dist/esm/justifi-gross-payment-chart.entry.js +5 -5
- package/dist/esm/{justifi-new-payment-method_4.entry.js → justifi-new-payment-method_5.entry.js} +23 -7
- package/dist/esm/justifi-owner-form_3.entry.js +8 -8
- package/dist/esm/justifi-payment-details.entry.js +9 -8
- package/dist/esm/justifi-payment-form.entry.js +12 -11
- package/dist/esm/justifi-payment-method-selector.entry.js +4 -3
- package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -5
- package/dist/esm/justifi-payments-list.entry.js +11 -12
- package/dist/esm/justifi-payout-details.entry.js +9 -8
- package/dist/esm/justifi-payouts-list.entry.js +12 -14
- package/dist/esm/justifi-refund-form.entry.js +7 -6
- package/dist/esm/justifi-season-interruption-insurance-core.entry.js +4 -4
- package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -7
- package/dist/esm/justifi-terminals-list.entry.js +133 -0
- package/dist/esm/justifi-tokenize-payment-method.entry.js +55 -0
- package/dist/esm/loader.js +1 -1
- package/dist/{cjs/payments-list-filters_2.cjs.entry.js → esm/lodash-faeb5a52.js} +1 -63
- package/dist/esm/{package-2ef16e2c.js → package-5144835c.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +11 -10
- package/dist/esm/{payment.service-21a3e2d3.js → payment.service-2f67410b.js} +4 -3
- package/dist/esm/payments-list-core.entry.js +16 -16
- package/dist/esm/payments-list-filters.entry.js +31 -0
- package/dist/esm/payments-status-4937a170.js +24 -0
- package/dist/esm/payout-details-core.entry.js +5 -4
- package/dist/esm/payouts-list-core.entry.js +8 -24
- package/dist/esm/payouts-status-cd58e525.js +22 -0
- package/dist/esm/{schema-validations-e725d701.js → schema-validations-c1728516.js} +1 -1
- package/dist/esm/styled-host-e0ddb759.js +12 -0
- package/dist/esm/table-75364107.js +18 -0
- package/dist/esm/table-filters-menu.entry.js +31 -0
- package/dist/esm/terminals-list-core.entry.js +162 -0
- package/dist/esm/terminals-list-filters.entry.js +28 -0
- package/dist/esm/{utils-e66d8bca.js → utils-3daada24.js} +4 -43
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Api.js +6 -4
- package/dist/module/Checkout.js +83 -0
- package/dist/module/Payment.js +15 -0
- package/dist/module/SubAccount.js +102 -0
- package/dist/module/additional-questions.js +22 -10
- package/dist/module/additional-statement.js +63 -0
- package/dist/module/billing-form.js +14 -8
- package/dist/module/business-additional-questions-form-step-core.js +42 -11
- package/dist/module/business-additional-questions-form-step.js +23 -11
- package/dist/module/business-bank-account-form-step.js +25 -11
- package/dist/module/business-core-info-form-step-core.js +19 -10
- package/dist/module/business-core-info-form-step.js +16 -10
- package/dist/module/business-core-info.js +16 -10
- package/dist/module/business-document-upload-form-step.js +14 -5
- package/dist/module/business-document-upload-input-group.js +28 -22
- package/dist/module/business-documents-on-file.js +1 -1
- package/dist/module/business-form-types.js +12 -1
- package/dist/module/business-owners-form-step-core.js +20 -12
- package/dist/module/business-owners-form-step.js +16 -10
- package/dist/module/business-representative-form-inputs.js +16 -10
- package/dist/module/business-representative-form-step-core.js +19 -10
- package/dist/module/business-representative-form-step.js +16 -10
- package/dist/module/business-representative.js +15 -9
- package/dist/module/business-terms-conditions-form-step.js +6 -3
- package/dist/module/business-terms-conditions-text.js +1 -1
- package/dist/module/cancellation-policy.js +63 -0
- package/dist/module/checkout-core.js +16 -15
- package/dist/module/checkout.service.js +34 -0
- package/dist/module/checkouts-list-core.d.ts +11 -0
- package/dist/module/checkouts-list-core.js +6 -0
- package/dist/module/checkouts-list-core2.js +249 -0
- package/dist/module/checkouts-list-filters.d.ts +11 -0
- package/dist/module/checkouts-list-filters.js +6 -0
- package/dist/module/checkouts-list-filters2.js +80 -0
- package/dist/module/counter-dispute.js +189 -0
- package/dist/module/custom-popper2.js +2 -2
- package/dist/module/customer-details.js +69 -0
- package/dist/module/details.js +1 -1
- package/dist/module/dispute-management-core.js +160 -0
- package/dist/module/dispute-notification.js +36 -0
- package/dist/module/dispute-reason.js +45 -0
- package/dist/module/duplicate-charge.js +69 -0
- package/dist/module/electronic-evidence.js +63 -0
- package/dist/module/exported-parts.js +1 -34
- package/dist/module/form-control-checkbox2.js +1 -1
- package/dist/module/form-control-date2.js +59 -10
- package/dist/module/form-control-file2.js +10 -4
- package/dist/module/form-control-monetary2.js +1 -1
- package/dist/module/form-control-number-masked2.js +10 -4
- package/dist/module/form-control-number.js +1 -1
- package/dist/module/form-control-radio.d.ts +11 -0
- package/dist/module/form-control-radio.js +6 -0
- package/dist/module/form-control-radio2.js +78 -0
- package/dist/module/form-control-select2.js +10 -4
- package/dist/module/form-control-text2.js +10 -4
- package/dist/module/form-control-textarea.d.ts +11 -0
- package/dist/module/form-control-textarea.js +6 -0
- package/dist/module/form-control-textarea2.js +84 -0
- package/dist/module/form-control-tooltip.d.ts +11 -0
- package/dist/module/form-control-tooltip.js +6 -0
- package/dist/module/form-control-tooltip2.js +49 -0
- package/dist/module/get-payout-csv.js +2 -1
- package/dist/module/get-subaccounts.js +51 -0
- package/dist/module/gross-payment-chart-core2.js +2 -2
- package/dist/module/identity-address-form.js +14 -8
- package/dist/module/justifi-additional-statement.d.ts +11 -0
- package/dist/module/justifi-additional-statement.js +6 -0
- package/dist/module/justifi-business-form.js +32 -19
- package/dist/module/justifi-cancellation-policy.d.ts +11 -0
- package/dist/module/justifi-cancellation-policy.js +6 -0
- package/dist/module/justifi-card-form.js +1 -1
- package/dist/module/justifi-checkout.js +16 -31
- package/dist/module/justifi-checkouts-list.d.ts +11 -0
- package/dist/module/justifi-checkouts-list.js +191 -0
- package/dist/module/justifi-counter-dispute.d.ts +11 -0
- package/dist/module/justifi-counter-dispute.js +6 -0
- package/dist/module/justifi-customer-details.d.ts +11 -0
- package/dist/module/justifi-customer-details.js +6 -0
- package/dist/module/justifi-dispute-management-core.d.ts +11 -0
- package/dist/module/justifi-dispute-management-core.js +6 -0
- package/dist/module/justifi-dispute-management.d.ts +11 -0
- package/dist/module/justifi-dispute-management.js +157 -0
- package/dist/module/justifi-dispute-notification.d.ts +11 -0
- package/dist/module/justifi-dispute-notification.js +6 -0
- package/dist/module/justifi-dispute-reason.d.ts +11 -0
- package/dist/module/justifi-dispute-reason.js +6 -0
- package/dist/module/justifi-duplicate-charge.d.ts +11 -0
- package/dist/module/justifi-duplicate-charge.js +6 -0
- package/dist/module/justifi-electronic-evidence.d.ts +11 -0
- package/dist/module/justifi-electronic-evidence.js +6 -0
- package/dist/module/justifi-payment-details.js +2 -1
- package/dist/module/justifi-payment-form.js +18 -11
- package/dist/module/justifi-payment-provisioning.js +30 -18
- package/dist/module/justifi-payments-list.js +12 -13
- package/dist/module/justifi-payout-details.js +2 -1
- package/dist/module/justifi-payouts-list.js +14 -10
- package/dist/module/justifi-product-or-service.d.ts +11 -0
- package/dist/module/justifi-product-or-service.js +6 -0
- package/dist/module/justifi-refund-form.js +23 -10
- package/dist/module/justifi-refund-policy.d.ts +11 -0
- package/dist/module/justifi-refund-policy.js +6 -0
- package/dist/module/justifi-season-interruption-insurance.js +3 -2
- package/dist/module/justifi-shipping-details.d.ts +11 -0
- package/dist/module/justifi-shipping-details.js +6 -0
- package/dist/module/justifi-terminals-list.d.ts +11 -0
- package/dist/module/justifi-terminals-list.js +216 -0
- package/dist/module/justifi-tokenize-payment-method.d.ts +11 -0
- package/dist/module/justifi-tokenize-payment-method.js +153 -0
- package/dist/module/legal-address-form-step-core.js +17 -8
- package/dist/module/legal-address-form-step.js +14 -8
- package/dist/module/legal-address-form.js +14 -8
- package/dist/module/lodash.js +17204 -0
- package/dist/module/new-payment-method.js +14 -8
- package/dist/module/owner-form-core2.js +17 -11
- package/dist/module/owner-form-inputs2.js +16 -10
- package/dist/module/owner-form.js +15 -9
- package/dist/module/package.js +1 -1
- package/dist/module/payment-details-core2.js +9 -8
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/payment-method-options.js +14 -8
- package/dist/module/payment-method-selector.js +3 -2
- package/dist/module/payment-provisioning-core.js +31 -19
- package/dist/module/payment-provisioning-form-buttons.js +1 -1
- package/dist/module/payment-provisioning-form-steps.js +30 -18
- package/dist/module/payment.service.js +2 -1
- package/dist/module/payments-list-core2.js +23 -22
- package/dist/module/payments-list-filters2.js +9 -17211
- package/dist/module/payments-status.js +24 -0
- package/dist/module/payout-details-core2.js +3 -2
- package/dist/module/payouts-list-core2.js +17 -26
- package/dist/module/payouts-status.js +22 -0
- package/dist/module/product-or-service.js +60 -0
- package/dist/module/refund-policy.js +63 -0
- package/dist/module/save-new-payment-method.js +1 -1
- package/dist/module/saved-payment-method.js +2 -2
- package/dist/module/season-interruption-insurance-core.js +3 -3
- package/dist/module/sezzle-payment-method.js +2 -2
- package/dist/module/shipping-details.js +79 -0
- package/dist/module/styled-host.js +1 -1
- package/dist/module/table-filters-menu2.js +1 -1
- package/dist/module/table-loading-state.js +34 -0
- package/dist/module/table.js +18 -0
- package/dist/module/terminals-list-core.d.ts +11 -0
- package/dist/module/terminals-list-core.js +6 -0
- package/dist/module/terminals-list-core2.js +240 -0
- package/dist/module/terminals-list-filters.d.ts +11 -0
- package/dist/module/terminals-list-filters.js +6 -0
- package/dist/module/terminals-list-filters2.js +83 -0
- package/dist/module/utils2.js +4 -43
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Checkout.d.ts +74 -2
- package/dist/types/api/Payment.d.ts +7 -0
- package/dist/types/api/SubAccount.d.ts +51 -0
- package/dist/types/api/Terminal.d.ts +48 -0
- package/dist/types/api/get-subaccounts.d.ts +10 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/services/checkout.service.d.ts +3 -1
- package/dist/types/api/services/subaccounts.service.d.ts +7 -0
- package/dist/types/api/services/terminal.service.d.ts +9 -0
- package/dist/types/components/billing-form/billing-form.d.ts +1 -1
- package/dist/types/components/business-forms/business-form/additional-questions/additional-questions.d.ts +1 -1
- package/dist/types/components/business-forms/business-form/business-core-info/business-core-info.d.ts +1 -1
- package/dist/types/components/business-forms/business-form/business-representative/business-representative.d.ts +1 -1
- package/dist/types/components/business-forms/business-form/legal-address-form/legal-address-form.d.ts +1 -1
- package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +1 -1
- package/dist/types/components/business-forms/owner-form/owner-form-inputs.d.ts +1 -1
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +5 -2
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +3 -2
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +3 -2
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.d.ts +2 -1
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.d.ts +1 -1
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +3 -2
- package/dist/types/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.d.ts +3 -2
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +3 -2
- package/dist/types/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.d.ts +3 -2
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +15 -0
- package/dist/types/components/business-forms/utils/input-handlers.d.ts +1 -1
- package/dist/types/components/checkouts-list/checkouts-list-core.d.ts +35 -0
- package/dist/types/components/checkouts-list/checkouts-list-filters.d.ts +15 -0
- package/dist/types/components/checkouts-list/checkouts-list.d.ts +44 -0
- package/dist/types/components/checkouts-list/checkouts-status.d.ts +1 -0
- package/dist/types/components/checkouts-list/checkouts-table.d.ts +17 -0
- package/dist/types/components/checkouts-list/get-checkouts.d.ts +10 -0
- package/dist/types/components/dispute-management/counter-dispute/additional-statement.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/cancellation-policy.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/counter-dispute.d.ts +14 -0
- package/dist/types/components/dispute-management/counter-dispute/customer-details.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/dispute-reason.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/duplicate-charge.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/electronic-evidence.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/product-or-service.d.ts +4 -0
- package/dist/types/components/dispute-management/counter-dispute/refund-policy.d.ts +3 -0
- package/dist/types/components/dispute-management/counter-dispute/shipping-details.d.ts +3 -0
- package/dist/types/components/dispute-management/dispute-management-core.d.ts +7 -0
- package/dist/types/components/dispute-management/dispute-management.d.ts +3 -0
- package/dist/types/components/dispute-management/dispute-notification.d.ts +8 -0
- package/dist/types/components/dispute-management/dispute.d.ts +7 -0
- package/dist/types/components/payments-list/payments-status.d.ts +1 -0
- package/dist/types/components/payouts-list/payouts-list-core.d.ts +1 -2
- package/dist/types/components/payouts-list/payouts-status.d.ts +1 -0
- package/dist/types/components/terminals-list/get-terminal-detail.d.ts +8 -0
- package/dist/types/components/terminals-list/get-terminals.d.ts +10 -0
- package/dist/types/components/terminals-list/terminals-list-core.d.ts +35 -0
- package/dist/types/components/terminals-list/terminals-list-filters.d.ts +13 -0
- package/dist/types/components/terminals-list/terminals-list.d.ts +44 -0
- package/dist/types/components/terminals-list/terminals-status.d.ts +1 -0
- package/dist/types/components/terminals-list/terminals-table.d.ts +13 -0
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +22 -0
- package/dist/types/components.d.ts +779 -16
- package/dist/types/ui-components/custom-popper/custom-popper.d.ts +1 -1
- package/dist/types/{components → ui-components}/form/form-control-date.d.ts +6 -0
- package/dist/types/ui-components/form/form-control-radio.d.ts +19 -0
- package/dist/types/ui-components/form/form-control-textarea.d.ts +20 -0
- package/dist/types/ui-components/form/form-helpers/form-control-tooltip/form-control-tooltip.d.ts +8 -0
- package/dist/types/ui-components/index.d.ts +1 -0
- package/dist/types/utils/table.d.ts +13 -0
- package/dist/types/utils/utils.d.ts +1 -3
- package/dist/webcomponents/p-037e3545.entry.js +1 -0
- package/dist/webcomponents/{p-232016ba.entry.js → p-04d12939.entry.js} +1 -1
- package/dist/webcomponents/p-0ac35b39.entry.js +1 -0
- package/dist/webcomponents/p-0b686ada.entry.js +1 -0
- package/dist/webcomponents/p-0c79e368.entry.js +1 -0
- package/dist/webcomponents/p-0de9e97b.entry.js +1 -0
- package/dist/webcomponents/{p-7d3be485.js → p-0e180654.js} +1 -1
- package/dist/webcomponents/{p-056e75be.entry.js → p-11ff46df.entry.js} +1 -1
- package/dist/webcomponents/p-16d2932d.js +1 -0
- package/dist/webcomponents/p-206fde40.js +1 -0
- package/dist/webcomponents/p-24392a86.entry.js +1 -0
- package/dist/webcomponents/p-269ba6fe.entry.js +1 -0
- package/dist/webcomponents/{p-1eee25f3.entry.js → p-286a4e72.entry.js} +2 -2
- package/dist/webcomponents/p-2c2b57b3.js +1 -0
- package/dist/webcomponents/{p-d76002d5.entry.js → p-2c8c214f.entry.js} +1 -1
- package/dist/webcomponents/p-2de65000.entry.js +1 -0
- package/dist/webcomponents/{p-277aee05.js → p-3d3468a8.js} +1 -1
- package/dist/webcomponents/p-47dbe17d.js +1 -0
- package/dist/webcomponents/p-4b14abbf.entry.js +1 -0
- package/dist/webcomponents/p-4c0c88e4.entry.js +1 -0
- package/dist/webcomponents/p-52ca72cd.entry.js +1 -0
- package/dist/webcomponents/{p-707bdf68.js → p-56bda985.js} +1 -1
- package/dist/webcomponents/p-56d84fb3.entry.js +1 -0
- package/dist/webcomponents/p-638c6285.entry.js +1 -0
- package/dist/webcomponents/p-69ea7334.entry.js +1 -0
- package/dist/webcomponents/p-6caf6f09.entry.js +1 -0
- package/dist/webcomponents/{p-da1d174d.entry.js → p-72819173.entry.js} +1 -1
- package/dist/webcomponents/p-74da98da.js +1 -0
- package/dist/webcomponents/p-7fec2bcb.js +1 -0
- package/dist/webcomponents/p-8480e3ab.entry.js +1 -0
- package/dist/webcomponents/p-869ae0c7.entry.js +1 -0
- package/dist/webcomponents/p-8ec550d7.entry.js +1 -0
- package/dist/webcomponents/p-8f212554.entry.js +1 -0
- package/dist/webcomponents/p-907ba963.js +1 -0
- package/dist/webcomponents/p-919e6e67.entry.js +1 -0
- package/dist/webcomponents/p-927a147c.entry.js +1 -0
- package/dist/webcomponents/p-935188c8.entry.js +1 -0
- package/dist/webcomponents/p-9bd13e22.js +1 -0
- package/dist/webcomponents/p-9f56ad71.js +1 -0
- package/dist/webcomponents/p-a2be972d.entry.js +1 -0
- package/dist/webcomponents/p-a3143d62.entry.js +1 -0
- package/dist/webcomponents/p-a76ece26.js +1 -0
- package/dist/webcomponents/{p-5e2c9ec8.js → p-a8f22d4d.js} +1 -1
- package/dist/webcomponents/p-ad443df5.entry.js +1 -0
- package/dist/webcomponents/p-b0686897.entry.js +1 -0
- package/dist/webcomponents/p-b1aacd6b.entry.js +1 -0
- package/dist/webcomponents/p-b4a7307b.entry.js +1 -0
- package/dist/webcomponents/p-bfb990fc.entry.js +1 -0
- package/dist/webcomponents/p-c1bf9285.entry.js +1 -0
- package/dist/webcomponents/{p-35846553.js → p-c1cf7d5b.js} +1 -1
- package/dist/webcomponents/p-c30c8f39.entry.js +1 -0
- package/dist/webcomponents/p-c5c6e61d.js +1 -0
- package/dist/webcomponents/{p-d99a5f30.entry.js → p-c63825d8.entry.js} +1 -1
- package/dist/webcomponents/{p-5022f21c.js → p-c65b78cf.js} +1 -1
- package/dist/webcomponents/p-c6be72b0.js +10 -0
- package/dist/webcomponents/p-c717646f.entry.js +1 -0
- package/dist/webcomponents/{p-d9579cd6.entry.js → p-cb79f06c.entry.js} +1 -1
- package/dist/webcomponents/p-ccbff4fa.entry.js +1 -0
- package/dist/webcomponents/p-cd4eaeb7.js +1 -0
- package/dist/webcomponents/p-cd7e866c.entry.js +1 -0
- package/dist/webcomponents/p-d1248039.entry.js +1 -0
- package/dist/webcomponents/{p-c64ce69d.entry.js → p-d2eb61e6.entry.js} +1 -1
- package/dist/webcomponents/p-d516e700.js +1 -0
- package/dist/webcomponents/p-dae9b10e.entry.js +1 -0
- package/dist/webcomponents/p-e412a713.entry.js +1 -0
- package/dist/webcomponents/p-e69b2ff8.entry.js +1 -0
- package/dist/webcomponents/p-e6be8845.entry.js +1 -0
- package/dist/webcomponents/{p-b91bcbfc.js → p-e7d6609d.js} +1 -1
- package/dist/webcomponents/p-e8797be0.entry.js +1 -0
- package/dist/webcomponents/p-eb9ba917.entry.js +1 -0
- package/dist/webcomponents/p-ec7e69eb.entry.js +1 -0
- package/dist/webcomponents/p-eeb70281.entry.js +1 -0
- package/dist/webcomponents/{p-e31f0f3e.entry.js → p-efb56234.entry.js} +1 -1
- package/dist/webcomponents/p-f4a8215b.entry.js +1 -0
- package/dist/webcomponents/{p-401d6607.js → p-f6f8dabc.js} +1 -1
- package/dist/webcomponents/{p-1c04aacd.entry.js → p-f7077f93.entry.js} +1 -1
- package/dist/webcomponents/p-fc4de0d2.js +1 -0
- package/dist/webcomponents/{p-3c7fac29.entry.js → p-ffe27126.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Payout-a2dd7b01.js +0 -45
- package/dist/cjs/form-control-date_3.cjs.entry.js +0 -136
- package/dist/cjs/form-control-error-text_4.cjs.entry.js +0 -118
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +0 -1688
- package/dist/cjs/styled-host-9e0b67b3.js +0 -14
- package/dist/esm/Payout-dfe15b00.js +0 -43
- package/dist/esm/form-control-date_3.entry.js +0 -130
- package/dist/esm/form-control-error-text_4.entry.js +0 -111
- package/dist/esm/justifi-payment-method-form.entry.js +0 -1684
- package/dist/esm/styled-host-3171ae1f.js +0 -12
- package/dist/module/Payout.js +0 -43
- package/dist/webcomponents/p-034fc302.entry.js +0 -1
- package/dist/webcomponents/p-37888614.entry.js +0 -1
- package/dist/webcomponents/p-430f81c6.entry.js +0 -1
- package/dist/webcomponents/p-44055818.js +0 -1
- package/dist/webcomponents/p-538fd427.entry.js +0 -1
- package/dist/webcomponents/p-55182a59.js +0 -1
- package/dist/webcomponents/p-570a0f02.entry.js +0 -1
- package/dist/webcomponents/p-57d7534f.entry.js +0 -1
- package/dist/webcomponents/p-59cf5391.entry.js +0 -1
- package/dist/webcomponents/p-60d3571e.entry.js +0 -1
- package/dist/webcomponents/p-6ac806ff.entry.js +0 -1
- package/dist/webcomponents/p-75139399.entry.js +0 -1
- package/dist/webcomponents/p-7771f64b.entry.js +0 -1
- package/dist/webcomponents/p-7ddfce86.entry.js +0 -1
- package/dist/webcomponents/p-7ff329b1.js +0 -1
- package/dist/webcomponents/p-8a7112a0.entry.js +0 -1
- package/dist/webcomponents/p-9add7d3e.entry.js +0 -1
- package/dist/webcomponents/p-9b154d98.entry.js +0 -1
- package/dist/webcomponents/p-ab92abb1.entry.js +0 -1
- package/dist/webcomponents/p-ad47f37c.entry.js +0 -1
- package/dist/webcomponents/p-aedb421f.entry.js +0 -1
- package/dist/webcomponents/p-b14da2fd.entry.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-bdc91c61.entry.js +0 -1
- package/dist/webcomponents/p-c1772671.entry.js +0 -1
- package/dist/webcomponents/p-c740b6ca.entry.js +0 -1
- package/dist/webcomponents/p-ce5fe369.entry.js +0 -10
- package/dist/webcomponents/p-d8355f91.entry.js +0 -1
- package/dist/webcomponents/p-d89bad72.js +0 -1
- package/dist/webcomponents/p-dc048c3c.entry.js +0 -1
- package/dist/webcomponents/p-df21aaad.js +0 -1
- package/dist/webcomponents/p-e2c88817.entry.js +0 -1
- package/dist/webcomponents/p-e3fab0e2.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f2924369.js +0 -1
- package/dist/webcomponents/p-fb7f7a8c.entry.js +0 -1
- package/dist/webcomponents/p-ffddac99.entry.js +0 -1
- /package/dist/cjs/{exported-parts-b18c68c2.js → exported-parts-a994d693.js} +0 -0
- /package/dist/cjs/{index.esm-52757963.js → index.esm-97cf6825.js} +0 -0
- /package/dist/cjs/{utils-c1d2e426.js → utils-189dc30d.js} +0 -0
- /package/dist/cjs/{utils-ddacfc44.js → utils-bc03ca40.js} +0 -0
- /package/dist/collection/{components → ui-components}/details/utils.js +0 -0
- /package/dist/collection/{components → ui-components}/form/form-helpers/form-alert/form-alert.js +0 -0
- /package/dist/collection/{components → ui-components}/form/form-helpers/form-control-error-text/form-control-error-text.js +0 -0
- /package/dist/collection/{components → ui-components}/form/form-helpers/form-control-help-text/form-control-help-text.js +0 -0
- /package/dist/collection/{components → ui-components}/form/form.js +0 -0
- /package/dist/collection/{components → ui-components}/form/utils.js +0 -0
- /package/dist/collection/{components → ui-components}/table/exported-parts.js +0 -0
- /package/dist/esm/{exported-parts-abd4c027.js → exported-parts-70e7a12b.js} +0 -0
- /package/dist/esm/{index.esm-fc4f5c0c.js → index.esm-ed37201b.js} +0 -0
- /package/dist/esm/{utils-3bb6347a.js → utils-20cdf321.js} +0 -0
- /package/dist/esm/{utils-01413a95.js → utils-218275b7.js} +0 -0
- /package/dist/types/{components → ui-components}/details/details.d.ts +0 -0
- /package/dist/types/{components → ui-components}/details/utils.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-checkbox.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-file.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-monetary.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-number-masked.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-number.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-select.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-control-text.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-helpers/form-alert/form-alert.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-helpers/form-control-error-text/form-control-error-text.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form-helpers/form-control-help-text/form-control-help-text.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/form.d.ts +0 -0
- /package/dist/types/{components → ui-components}/form/utils.d.ts +0 -0
- /package/dist/types/{components → ui-components}/table/exported-parts.d.ts +0 -0
- /package/dist/webcomponents/{p-2eab3c90.js → p-3c654c07.js} +0 -0
- /package/dist/webcomponents/{p-2b6c9c4f.js → p-6cc30da2.js} +0 -0
- /package/dist/webcomponents/{p-dce846bf.js → p-a8b4f429.js} +0 -0
- /package/dist/webcomponents/{p-8df7bde8.js → p-e3c22aa9.js} +0 -0
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-fb499e95.js');
|
|
6
|
-
const index_esm = require('./index.esm-
|
|
7
|
-
const schemaValidations = require('./schema-validations-
|
|
6
|
+
const index_esm = require('./index.esm-97cf6825.js');
|
|
7
|
+
const schemaValidations = require('./schema-validations-184a4356.js');
|
|
8
8
|
const stateOptions = require('./state-options-4fbcb48a.js');
|
|
9
|
-
const utils = require('./utils-
|
|
10
|
-
const styledHost = require('./styled-host-
|
|
9
|
+
const utils = require('./utils-bc03ca40.js');
|
|
10
|
+
const styledHost = require('./styled-host-1adf46c3.js');
|
|
11
|
+
const _package = require('./package-41c8f38c.js');
|
|
12
|
+
const utils$1 = require('./utils-3d84442d.js');
|
|
11
13
|
require('./business-form-options-5db0bd5e.js');
|
|
12
14
|
require('./Business-aa799fec.js');
|
|
13
15
|
require('./helpers-602962eb.js');
|
|
@@ -56,26 +58,1689 @@ const BillingForm = class {
|
|
|
56
58
|
}
|
|
57
59
|
render() {
|
|
58
60
|
const billingFormDefaultValue = this.formController.getInitialValues();
|
|
59
|
-
return (index.h(styledHost.StyledHost, { key: '
|
|
61
|
+
return (index.h(styledHost.StyledHost, { key: '221838c3ba8255b62db0f2feee7b227b0d240627', exportparts: "label,input,input-invalid" }, index.h("form", { key: '87377d7776c3fdf7ffa351f25522921b233dd16f' }, index.h("fieldset", { key: '821487e408ec634dd23417604f02f1aa212dcb2a' }, this.legend && index.h("legend", { key: 'c042f51480e23ad455a6d3fc420f494c33d93f2c' }, this.legend), index.h("div", { key: '6a9f2c0fd10c7786b132f7208036cf878e3fe8c1', class: "row gy-3" }, index.h("div", { key: 'b375c19faeb23927e290c4a60b4347dc64868840', class: "col-12" }, index.h("form-control-text", { key: 'be3b78234607f996efe8971082ff457e63767e22', name: 'name', label: 'Full Name', defaultValue: billingFormDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), index.h("div", { key: '95d3f3bb6ff7df39deb2967db11017e8f80ca5a9', class: "col-12" }, index.h("form-control-text", { key: '9e719038219bf7b7651679b617b2131ab5336289', name: 'address_line1', label: 'Street Address', defaultValue: billingFormDefaultValue.address_line1, errorText: this.errors.address_line1, inputHandler: this.inputHandler })), index.h("div", { key: '0945bca70a70abfdce40c8d52537eb06479aface', class: "col-12" }, index.h("form-control-text", { key: '59b9b87c005609daf501b0d7d6a8d640297c75c4', name: 'address_line2', label: "Apartment, Suite, etc. (optional)", defaultValue: billingFormDefaultValue.address_line2, errorText: this.errors.address_line2, inputHandler: this.inputHandler })), index.h("div", { key: 'f3e9d8297e9e4009a0b16f331eeffb1316a92030', class: "col-12" }, index.h("form-control-text", { key: '158a4d2e3e85700a5c80304e0316391090b52f74', name: 'address_city', label: "City", defaultValue: billingFormDefaultValue.address_city, errorText: this.errors.address_city, inputHandler: this.inputHandler })), index.h("div", { key: '67110a816d76d4c98062859733def72e88f1a3d9', class: "col-12" }, index.h("form-control-select", { key: 'd26b22251d6da9d8f7b8bb109126e804cdfbccb0', name: 'address_state', label: 'State', options: stateOptions.StateOptions, defaultValue: billingFormDefaultValue.address_state, errorText: this.errors.address_state, inputHandler: this.inputHandler })), index.h("div", { key: 'a248ef0a4860d9d634f46e96cc953c8ca0ee64f1', class: "col-12" }, index.h("form-control-text", { key: '36f96a7e94088dd140ca9774903387ae2be3cad8', name: 'address_postal_code', label: "ZIP", defaultValue: billingFormDefaultValue.address_postal_code, errorText: this.errors.address_postal_code, inputHandler: this.inputHandler, maxLength: 5, keyDownHandler: utils.numberOnlyHandler })))))));
|
|
60
62
|
}
|
|
61
63
|
};
|
|
62
64
|
BillingForm.style = JustifiBillingFormStyle0;
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
var iframeResizer = {exports: {}};
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* File: iframeResizer.js
|
|
70
|
+
* Desc: Force iframes to size to content.
|
|
71
|
+
* Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
|
|
72
|
+
* Doc: https://iframe-resizer.com
|
|
73
|
+
* Author: David J. Bradshaw - info@iframe-resizer.com
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
(function (module) {
|
|
77
|
+
console.info(`
|
|
78
|
+
IFRAME-RESIZER
|
|
79
|
+
|
|
80
|
+
Iframe-Resizer 5 is now available via the following two packages:
|
|
81
|
+
|
|
82
|
+
* @iframe-resizer/parent
|
|
83
|
+
* @iframe-resizer/child
|
|
84
|
+
|
|
85
|
+
Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery.
|
|
86
|
+
|
|
87
|
+
Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.
|
|
88
|
+
|
|
89
|
+
Please see https://iframe-resizer.com/upgrade for more details.
|
|
90
|
+
`)
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
|
|
93
|
+
;(function (undefined$1) {
|
|
94
|
+
if (typeof window === 'undefined') return // don't run for server side render
|
|
95
|
+
|
|
96
|
+
// var VERSION = '4.3.11'
|
|
97
|
+
|
|
98
|
+
var count = 0,
|
|
99
|
+
destroyObserver,
|
|
100
|
+
logEnabled = false,
|
|
101
|
+
hiddenCheckEnabled = false,
|
|
102
|
+
msgHeader = 'message',
|
|
103
|
+
msgHeaderLen = msgHeader.length,
|
|
104
|
+
msgId = '[iFrameSizer]', // Must match iframe msg ID
|
|
105
|
+
msgIdLen = msgId.length,
|
|
106
|
+
pagePosition = null,
|
|
107
|
+
requestAnimationFrame = window.requestAnimationFrame,
|
|
108
|
+
resetRequiredMethods = Object.freeze({
|
|
109
|
+
max: 1,
|
|
110
|
+
scroll: 1,
|
|
111
|
+
bodyScroll: 1,
|
|
112
|
+
documentElementScroll: 1
|
|
113
|
+
}),
|
|
114
|
+
settings = {},
|
|
115
|
+
timer = null,
|
|
116
|
+
defaults = Object.freeze({
|
|
117
|
+
autoResize: true,
|
|
118
|
+
bodyBackground: null,
|
|
119
|
+
bodyMargin: null,
|
|
120
|
+
bodyMarginV1: 8,
|
|
121
|
+
bodyPadding: null,
|
|
122
|
+
checkOrigin: true,
|
|
123
|
+
inPageLinks: false,
|
|
124
|
+
enablePublicMethods: true,
|
|
125
|
+
heightCalculationMethod: 'bodyOffset',
|
|
126
|
+
id: 'iFrameResizer',
|
|
127
|
+
interval: 32,
|
|
128
|
+
license: '1jqr0si6pnt',
|
|
129
|
+
log: false,
|
|
130
|
+
maxHeight: Infinity,
|
|
131
|
+
maxWidth: Infinity,
|
|
132
|
+
minHeight: 0,
|
|
133
|
+
minWidth: 0,
|
|
134
|
+
mouseEvents: true,
|
|
135
|
+
resizeFrom: 'parent',
|
|
136
|
+
scrolling: false,
|
|
137
|
+
sizeHeight: true,
|
|
138
|
+
sizeWidth: false,
|
|
139
|
+
warningTimeout: 5000,
|
|
140
|
+
tolerance: 0,
|
|
141
|
+
widthCalculationMethod: 'scroll',
|
|
142
|
+
onClose: function () {
|
|
143
|
+
return true
|
|
144
|
+
},
|
|
145
|
+
onClosed: function () {},
|
|
146
|
+
onInit: function () {},
|
|
147
|
+
onMessage: function () {
|
|
148
|
+
warn('onMessage function not defined');
|
|
149
|
+
},
|
|
150
|
+
onMouseEnter: function () {},
|
|
151
|
+
onMouseLeave: function () {},
|
|
152
|
+
onResized: function () {},
|
|
153
|
+
onScroll: function () {
|
|
154
|
+
return true
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
function getMutationObserver() {
|
|
159
|
+
return (
|
|
160
|
+
window.MutationObserver ||
|
|
161
|
+
window.WebKitMutationObserver ||
|
|
162
|
+
window.MozMutationObserver
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function addEventListener(el, evt, func) {
|
|
167
|
+
el.addEventListener(evt, func, false);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function removeEventListener(el, evt, func) {
|
|
171
|
+
el.removeEventListener(evt, func, false);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function setupRequestAnimationFrame() {
|
|
175
|
+
var vendors = ['moz', 'webkit', 'o', 'ms'];
|
|
176
|
+
var x;
|
|
177
|
+
|
|
178
|
+
// Remove vendor prefixing if prefixed and break early if not
|
|
179
|
+
for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
|
|
180
|
+
requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (requestAnimationFrame) {
|
|
184
|
+
// Firefox extension content-scripts have a globalThis object that is not the same as window.
|
|
185
|
+
// Binding `requestAnimationFrame` to window allows the function to work and prevents errors
|
|
186
|
+
// being thrown when run in that context, and should be a no-op in every other context.
|
|
187
|
+
requestAnimationFrame = requestAnimationFrame.bind(window);
|
|
188
|
+
} else {
|
|
189
|
+
log('setup', 'RequestAnimationFrame not supported');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function getMyID(iframeId) {
|
|
194
|
+
var retStr = 'Host page: ' + iframeId;
|
|
195
|
+
|
|
196
|
+
if (window.top !== window.self) {
|
|
197
|
+
retStr =
|
|
198
|
+
window.parentIFrame && window.parentIFrame.getId
|
|
199
|
+
? window.parentIFrame.getId() + ': ' + iframeId
|
|
200
|
+
: 'Nested host page: ' + iframeId;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return retStr
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function formatLogHeader(iframeId) {
|
|
207
|
+
return msgId + '[' + getMyID(iframeId) + ']'
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function isLogEnabled(iframeId) {
|
|
211
|
+
return settings[iframeId] ? settings[iframeId].log : logEnabled
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function log(iframeId, msg) {
|
|
215
|
+
output('log', iframeId, msg, isLogEnabled(iframeId));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function info(iframeId, msg) {
|
|
219
|
+
output('info', iframeId, msg, isLogEnabled(iframeId));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function warn(iframeId, msg) {
|
|
223
|
+
output('warn', iframeId, msg, true);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function output(type, iframeId, msg, enabled) {
|
|
227
|
+
if (true === enabled && 'object' === typeof window.console) {
|
|
228
|
+
// eslint-disable-next-line no-console
|
|
229
|
+
console[type](formatLogHeader(iframeId), msg);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function iFrameListener(event) {
|
|
234
|
+
function resizeIFrame() {
|
|
235
|
+
function resize() {
|
|
236
|
+
setSize(messageData);
|
|
237
|
+
setPagePosition(iframeId);
|
|
238
|
+
on('onResized', messageData);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
ensureInRange('Height');
|
|
242
|
+
ensureInRange('Width');
|
|
243
|
+
|
|
244
|
+
syncResize(resize, messageData, 'init');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function processMsg() {
|
|
248
|
+
var data = msg.slice(msgIdLen).split(':');
|
|
249
|
+
var height = data[1] ? parseInt(data[1], 10) : 0;
|
|
250
|
+
var iframe = settings[data[0]] && settings[data[0]].iframe;
|
|
251
|
+
var compStyle = getComputedStyle(iframe);
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
iframe: iframe,
|
|
255
|
+
id: data[0],
|
|
256
|
+
height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
|
|
257
|
+
width: data[2],
|
|
258
|
+
type: data[3]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function getPaddingEnds(compStyle) {
|
|
263
|
+
if (compStyle.boxSizing !== 'border-box') {
|
|
264
|
+
return 0
|
|
265
|
+
}
|
|
266
|
+
var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
|
|
267
|
+
var bot = compStyle.paddingBottom
|
|
268
|
+
? parseInt(compStyle.paddingBottom, 10)
|
|
269
|
+
: 0;
|
|
270
|
+
return top + bot
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function getBorderEnds(compStyle) {
|
|
274
|
+
if (compStyle.boxSizing !== 'border-box') {
|
|
275
|
+
return 0
|
|
276
|
+
}
|
|
277
|
+
var top = compStyle.borderTopWidth
|
|
278
|
+
? parseInt(compStyle.borderTopWidth, 10)
|
|
279
|
+
: 0;
|
|
280
|
+
var bot = compStyle.borderBottomWidth
|
|
281
|
+
? parseInt(compStyle.borderBottomWidth, 10)
|
|
282
|
+
: 0;
|
|
283
|
+
return top + bot
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function ensureInRange(Dimension) {
|
|
287
|
+
var max = Number(settings[iframeId]['max' + Dimension]),
|
|
288
|
+
min = Number(settings[iframeId]['min' + Dimension]),
|
|
289
|
+
dimension = Dimension.toLowerCase(),
|
|
290
|
+
size = Number(messageData[dimension]);
|
|
291
|
+
|
|
292
|
+
log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
|
|
293
|
+
|
|
294
|
+
if (size < min) {
|
|
295
|
+
size = min;
|
|
296
|
+
log(iframeId, 'Set ' + dimension + ' to min value');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (size > max) {
|
|
300
|
+
size = max;
|
|
301
|
+
log(iframeId, 'Set ' + dimension + ' to max value');
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
messageData[dimension] = '' + size;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function isMessageFromIFrame() {
|
|
308
|
+
function checkAllowedOrigin() {
|
|
309
|
+
function checkList() {
|
|
310
|
+
var i = 0,
|
|
311
|
+
retCode = false;
|
|
312
|
+
|
|
313
|
+
log(
|
|
314
|
+
iframeId,
|
|
315
|
+
'Checking connection is from allowed list of origins: ' +
|
|
316
|
+
checkOrigin
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
for (; i < checkOrigin.length; i++) {
|
|
320
|
+
if (checkOrigin[i] === origin) {
|
|
321
|
+
retCode = true;
|
|
322
|
+
break
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return retCode
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function checkSingle() {
|
|
329
|
+
var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
|
|
330
|
+
log(iframeId, 'Checking connection is from: ' + remoteHost);
|
|
331
|
+
return origin === remoteHost
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return checkOrigin.constructor === Array ? checkList() : checkSingle()
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
var origin = event.origin,
|
|
338
|
+
checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
|
|
339
|
+
|
|
340
|
+
if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
|
|
341
|
+
throw new Error(
|
|
342
|
+
'Unexpected message received from: ' +
|
|
343
|
+
origin +
|
|
344
|
+
' for ' +
|
|
345
|
+
messageData.iframe.id +
|
|
346
|
+
'. Message was: ' +
|
|
347
|
+
event.data +
|
|
348
|
+
'. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return true
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function isMessageForUs() {
|
|
356
|
+
return (
|
|
357
|
+
msgId === ('' + msg).slice(0, msgIdLen) &&
|
|
358
|
+
msg.slice(msgIdLen).split(':')[0] in settings
|
|
359
|
+
) // ''+Protects against non-string msg
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function isMessageFromMetaParent() {
|
|
363
|
+
// Test if this message is from a parent above us. This is an ugly test, however, updating
|
|
364
|
+
// the message format would break backwards compatibility.
|
|
365
|
+
var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
|
|
366
|
+
|
|
367
|
+
if (retCode) {
|
|
368
|
+
log(iframeId, 'Ignoring init message from meta parent page');
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return retCode
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function getMsgBody(offset) {
|
|
375
|
+
return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function forwardMsgFromIFrame(msgBody) {
|
|
379
|
+
log(
|
|
380
|
+
iframeId,
|
|
381
|
+
'onMessage passed: {iframe: ' +
|
|
382
|
+
messageData.iframe.id +
|
|
383
|
+
', message: ' +
|
|
384
|
+
msgBody +
|
|
385
|
+
'}'
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
on('onMessage', {
|
|
389
|
+
iframe: messageData.iframe,
|
|
390
|
+
message: JSON.parse(msgBody)
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
log(iframeId, '--');
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function getPageInfo() {
|
|
397
|
+
var bodyPosition = document.body.getBoundingClientRect(),
|
|
398
|
+
iFramePosition = messageData.iframe.getBoundingClientRect();
|
|
399
|
+
|
|
400
|
+
return JSON.stringify({
|
|
401
|
+
iframeHeight: iFramePosition.height,
|
|
402
|
+
iframeWidth: iFramePosition.width,
|
|
403
|
+
clientHeight: Math.max(
|
|
404
|
+
document.documentElement.clientHeight,
|
|
405
|
+
window.innerHeight || 0
|
|
406
|
+
),
|
|
407
|
+
clientWidth: Math.max(
|
|
408
|
+
document.documentElement.clientWidth,
|
|
409
|
+
window.innerWidth || 0
|
|
410
|
+
),
|
|
411
|
+
offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
|
|
412
|
+
offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
|
|
413
|
+
scrollTop: window.pageYOffset,
|
|
414
|
+
scrollLeft: window.pageXOffset,
|
|
415
|
+
documentHeight: document.documentElement.clientHeight,
|
|
416
|
+
documentWidth: document.documentElement.clientWidth,
|
|
417
|
+
windowHeight: window.innerHeight,
|
|
418
|
+
windowWidth: window.innerWidth
|
|
419
|
+
})
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function sendPageInfoToIframe(iframe, iframeId) {
|
|
423
|
+
function debouncedTrigger() {
|
|
424
|
+
trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
|
|
425
|
+
}
|
|
426
|
+
debounceFrameEvents(debouncedTrigger, 32, iframeId);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function startPageInfoMonitor() {
|
|
430
|
+
function setListener(type, func) {
|
|
431
|
+
function sendPageInfo() {
|
|
432
|
+
if (settings[id]) {
|
|
433
|
+
sendPageInfoToIframe(settings[id].iframe, id);
|
|
434
|
+
} else {
|
|
435
|
+
stop();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
['scroll', 'resize'].forEach(function (evt) {
|
|
439
|
+
log(id, type + evt + ' listener for sendPageInfo');
|
|
440
|
+
func(window, evt, sendPageInfo);
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function stop() {
|
|
445
|
+
setListener('Remove ', removeEventListener);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function start() {
|
|
449
|
+
setListener('Add ', addEventListener);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
var id = iframeId; // Create locally scoped copy of iFrame ID
|
|
453
|
+
|
|
454
|
+
start();
|
|
455
|
+
|
|
456
|
+
if (settings[id]) {
|
|
457
|
+
settings[id].stopPageInfo = stop;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function stopPageInfoMonitor() {
|
|
462
|
+
if (settings[iframeId] && settings[iframeId].stopPageInfo) {
|
|
463
|
+
settings[iframeId].stopPageInfo();
|
|
464
|
+
delete settings[iframeId].stopPageInfo;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function checkIFrameExists() {
|
|
469
|
+
var retBool = true;
|
|
470
|
+
|
|
471
|
+
if (null === messageData.iframe) {
|
|
472
|
+
warn(iframeId, 'IFrame (' + messageData.id + ') not found');
|
|
473
|
+
retBool = false;
|
|
474
|
+
}
|
|
475
|
+
return retBool
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function getElementPosition(target) {
|
|
479
|
+
var iFramePosition = target.getBoundingClientRect();
|
|
480
|
+
|
|
481
|
+
getPagePosition(iframeId);
|
|
482
|
+
|
|
483
|
+
return {
|
|
484
|
+
x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
|
|
485
|
+
y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function scrollRequestFromChild(addOffset) {
|
|
490
|
+
/* istanbul ignore next */ // Not testable in Karma
|
|
491
|
+
function reposition() {
|
|
492
|
+
pagePosition = newPosition;
|
|
493
|
+
scrollTo();
|
|
494
|
+
log(iframeId, '--');
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function calcOffset() {
|
|
498
|
+
return {
|
|
499
|
+
x: Number(messageData.width) + offset.x,
|
|
500
|
+
y: Number(messageData.height) + offset.y
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function scrollParent() {
|
|
505
|
+
if (window.parentIFrame) {
|
|
506
|
+
window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
|
|
507
|
+
newPosition.x,
|
|
508
|
+
newPosition.y
|
|
509
|
+
);
|
|
510
|
+
} else {
|
|
511
|
+
warn(
|
|
512
|
+
iframeId,
|
|
513
|
+
'Unable to scroll to requested position, window.parentIFrame not found'
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
var offset = addOffset
|
|
519
|
+
? getElementPosition(messageData.iframe)
|
|
520
|
+
: { x: 0, y: 0 },
|
|
521
|
+
newPosition = calcOffset();
|
|
522
|
+
|
|
523
|
+
log(
|
|
524
|
+
iframeId,
|
|
525
|
+
'Reposition requested from iFrame (offset x:' +
|
|
526
|
+
offset.x +
|
|
527
|
+
' y:' +
|
|
528
|
+
offset.y +
|
|
529
|
+
')'
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
if (window.top === window.self) {
|
|
533
|
+
reposition();
|
|
534
|
+
} else {
|
|
535
|
+
scrollParent();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function scrollTo() {
|
|
540
|
+
if (false === on('onScroll', pagePosition)) {
|
|
541
|
+
unsetPagePosition();
|
|
542
|
+
} else {
|
|
543
|
+
setPagePosition(iframeId);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function findTarget(location) {
|
|
548
|
+
function jumpToTarget() {
|
|
549
|
+
var jumpPosition = getElementPosition(target);
|
|
550
|
+
|
|
551
|
+
log(
|
|
552
|
+
iframeId,
|
|
553
|
+
'Moving to in page link (#' +
|
|
554
|
+
hash +
|
|
555
|
+
') at x: ' +
|
|
556
|
+
jumpPosition.x +
|
|
557
|
+
' y: ' +
|
|
558
|
+
jumpPosition.y
|
|
559
|
+
);
|
|
560
|
+
pagePosition = {
|
|
561
|
+
x: jumpPosition.x,
|
|
562
|
+
y: jumpPosition.y
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
scrollTo();
|
|
566
|
+
log(iframeId, '--');
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function jumpToParent() {
|
|
570
|
+
if (window.parentIFrame) {
|
|
571
|
+
window.parentIFrame.moveToAnchor(hash);
|
|
572
|
+
} else {
|
|
573
|
+
log(
|
|
574
|
+
iframeId,
|
|
575
|
+
'In page link #' +
|
|
576
|
+
hash +
|
|
577
|
+
' not found and window.parentIFrame not found'
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
var hash = location.split('#')[1] || '',
|
|
583
|
+
hashData = decodeURIComponent(hash),
|
|
584
|
+
target =
|
|
585
|
+
document.getElementById(hashData) ||
|
|
586
|
+
document.getElementsByName(hashData)[0];
|
|
587
|
+
|
|
588
|
+
if (target) {
|
|
589
|
+
jumpToTarget();
|
|
590
|
+
} else if (window.top === window.self) {
|
|
591
|
+
log(iframeId, 'In page link #' + hash + ' not found');
|
|
592
|
+
} else {
|
|
593
|
+
jumpToParent();
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function onMouse(event) {
|
|
598
|
+
var mousePos = {};
|
|
599
|
+
|
|
600
|
+
if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
|
|
601
|
+
var data = getMsgBody(9).split(':');
|
|
602
|
+
mousePos = {
|
|
603
|
+
x: data[1],
|
|
604
|
+
y: data[0]
|
|
605
|
+
};
|
|
606
|
+
} else {
|
|
607
|
+
mousePos = {
|
|
608
|
+
x: messageData.width,
|
|
609
|
+
y: messageData.height
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
on(event, {
|
|
614
|
+
iframe: messageData.iframe,
|
|
615
|
+
screenX: Number(mousePos.x),
|
|
616
|
+
screenY: Number(mousePos.y),
|
|
617
|
+
type: messageData.type
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
function on(funcName, val) {
|
|
622
|
+
return chkEvent(iframeId, funcName, val)
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
function actionMsg() {
|
|
626
|
+
if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
|
|
627
|
+
|
|
628
|
+
switch (messageData.type) {
|
|
629
|
+
case 'close': {
|
|
630
|
+
closeIFrame(messageData.iframe);
|
|
631
|
+
break
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
case 'message': {
|
|
635
|
+
forwardMsgFromIFrame(getMsgBody(6));
|
|
636
|
+
break
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
case 'mouseenter': {
|
|
640
|
+
onMouse('onMouseEnter');
|
|
641
|
+
break
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
case 'mouseleave': {
|
|
645
|
+
onMouse('onMouseLeave');
|
|
646
|
+
break
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
case 'autoResize': {
|
|
650
|
+
settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
|
|
651
|
+
break
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
case 'scrollTo': {
|
|
655
|
+
scrollRequestFromChild(false);
|
|
656
|
+
break
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
case 'scrollToOffset': {
|
|
660
|
+
scrollRequestFromChild(true);
|
|
661
|
+
break
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
case 'pageInfo': {
|
|
665
|
+
sendPageInfoToIframe(
|
|
666
|
+
settings[iframeId] && settings[iframeId].iframe,
|
|
667
|
+
iframeId
|
|
668
|
+
);
|
|
669
|
+
startPageInfoMonitor();
|
|
670
|
+
break
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
case 'pageInfoStop': {
|
|
674
|
+
stopPageInfoMonitor();
|
|
675
|
+
break
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
case 'inPageLink': {
|
|
679
|
+
findTarget(getMsgBody(9));
|
|
680
|
+
break
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
case 'reset': {
|
|
684
|
+
resetIFrame(messageData);
|
|
685
|
+
break
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
case 'init': {
|
|
689
|
+
resizeIFrame();
|
|
690
|
+
on('onInit', messageData.iframe);
|
|
691
|
+
break
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
default: {
|
|
695
|
+
if (
|
|
696
|
+
Number(messageData.width) === 0 &&
|
|
697
|
+
Number(messageData.height) === 0
|
|
698
|
+
) {
|
|
699
|
+
warn(
|
|
700
|
+
'Unsupported message received (' +
|
|
701
|
+
messageData.type +
|
|
702
|
+
'), this is likely due to the iframe containing a later ' +
|
|
703
|
+
'version of iframe-resizer than the parent page'
|
|
704
|
+
);
|
|
705
|
+
} else {
|
|
706
|
+
resizeIFrame();
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
function hasSettings(iframeId) {
|
|
713
|
+
var retBool = true;
|
|
714
|
+
|
|
715
|
+
if (!settings[iframeId]) {
|
|
716
|
+
retBool = false;
|
|
717
|
+
warn(
|
|
718
|
+
messageData.type +
|
|
719
|
+
' No settings for ' +
|
|
720
|
+
iframeId +
|
|
721
|
+
'. Message was: ' +
|
|
722
|
+
msg
|
|
723
|
+
);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
return retBool
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function iFrameReadyMsgReceived() {
|
|
730
|
+
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
|
731
|
+
for (var iframeId in settings) {
|
|
732
|
+
trigger(
|
|
733
|
+
'iFrame requested init',
|
|
734
|
+
createOutgoingMsg(iframeId),
|
|
735
|
+
settings[iframeId].iframe,
|
|
736
|
+
iframeId
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function firstRun() {
|
|
742
|
+
if (settings[iframeId]) {
|
|
743
|
+
settings[iframeId].firstRun = false;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
var msg = event.data,
|
|
748
|
+
messageData = {},
|
|
749
|
+
iframeId = null;
|
|
750
|
+
|
|
751
|
+
if ('[iFrameResizerChild]Ready' === msg) {
|
|
752
|
+
iFrameReadyMsgReceived();
|
|
753
|
+
} else if (isMessageForUs()) {
|
|
754
|
+
messageData = processMsg();
|
|
755
|
+
iframeId = messageData.id;
|
|
756
|
+
if (settings[iframeId]) {
|
|
757
|
+
settings[iframeId].loaded = true;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
|
|
761
|
+
log(iframeId, 'Received: ' + msg);
|
|
762
|
+
|
|
763
|
+
if (checkIFrameExists() && isMessageFromIFrame()) {
|
|
764
|
+
actionMsg();
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
} else {
|
|
768
|
+
info(iframeId, 'Ignored: ' + msg);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
function chkEvent(iframeId, funcName, val) {
|
|
773
|
+
var func = null,
|
|
774
|
+
retVal = null;
|
|
775
|
+
|
|
776
|
+
if (settings[iframeId]) {
|
|
777
|
+
func = settings[iframeId][funcName];
|
|
778
|
+
|
|
779
|
+
if ('function' === typeof func) {
|
|
780
|
+
retVal = func(val);
|
|
781
|
+
} else {
|
|
782
|
+
throw new TypeError(
|
|
783
|
+
funcName + ' on iFrame[' + iframeId + '] is not a function'
|
|
784
|
+
)
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
return retVal
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
function removeIframeListeners(iframe) {
|
|
792
|
+
var iframeId = iframe.id;
|
|
793
|
+
delete settings[iframeId];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function closeIFrame(iframe) {
|
|
797
|
+
var iframeId = iframe.id;
|
|
798
|
+
if (chkEvent(iframeId, 'onClose', iframeId) === false) {
|
|
799
|
+
log(iframeId, 'Close iframe cancelled by onClose event');
|
|
800
|
+
return
|
|
801
|
+
}
|
|
802
|
+
log(iframeId, 'Removing iFrame: ' + iframeId);
|
|
803
|
+
|
|
804
|
+
try {
|
|
805
|
+
// Catch race condition error with React
|
|
806
|
+
if (iframe.parentNode) {
|
|
807
|
+
iframe.parentNode.removeChild(iframe);
|
|
808
|
+
}
|
|
809
|
+
} catch (error) {
|
|
810
|
+
warn(error);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
chkEvent(iframeId, 'onClosed', iframeId);
|
|
814
|
+
log(iframeId, '--');
|
|
815
|
+
removeIframeListeners(iframe);
|
|
816
|
+
if (destroyObserver) {
|
|
817
|
+
destroyObserver.disconnect();
|
|
818
|
+
destroyObserver = null;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function getPagePosition(iframeId) {
|
|
823
|
+
if (null === pagePosition) {
|
|
824
|
+
pagePosition = {
|
|
825
|
+
x:
|
|
826
|
+
window.pageXOffset === undefined$1
|
|
827
|
+
? document.documentElement.scrollLeft
|
|
828
|
+
: window.pageXOffset,
|
|
829
|
+
y:
|
|
830
|
+
window.pageYOffset === undefined$1
|
|
831
|
+
? document.documentElement.scrollTop
|
|
832
|
+
: window.pageYOffset
|
|
833
|
+
};
|
|
834
|
+
log(
|
|
835
|
+
iframeId,
|
|
836
|
+
'Get page position: ' + pagePosition.x + ',' + pagePosition.y
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
function setPagePosition(iframeId) {
|
|
842
|
+
if (null !== pagePosition) {
|
|
843
|
+
window.scrollTo(pagePosition.x, pagePosition.y);
|
|
844
|
+
log(
|
|
845
|
+
iframeId,
|
|
846
|
+
'Set page position: ' + pagePosition.x + ',' + pagePosition.y
|
|
847
|
+
);
|
|
848
|
+
unsetPagePosition();
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
function unsetPagePosition() {
|
|
853
|
+
pagePosition = null;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function resetIFrame(messageData) {
|
|
857
|
+
function reset() {
|
|
858
|
+
setSize(messageData);
|
|
859
|
+
trigger('reset', 'reset', messageData.iframe, messageData.id);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
log(
|
|
863
|
+
messageData.id,
|
|
864
|
+
'Size reset requested by ' +
|
|
865
|
+
('init' === messageData.type ? 'host page' : 'iFrame')
|
|
866
|
+
);
|
|
867
|
+
getPagePosition(messageData.id);
|
|
868
|
+
syncResize(reset, messageData, 'reset');
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
function setSize(messageData) {
|
|
872
|
+
function setDimension(dimension) {
|
|
873
|
+
if (!messageData.id) {
|
|
874
|
+
log('undefined', 'messageData id not set');
|
|
875
|
+
return
|
|
876
|
+
}
|
|
877
|
+
messageData.iframe.style[dimension] = messageData[dimension] + 'px';
|
|
878
|
+
log(
|
|
879
|
+
messageData.id,
|
|
880
|
+
'IFrame (' +
|
|
881
|
+
iframeId +
|
|
882
|
+
') ' +
|
|
883
|
+
dimension +
|
|
884
|
+
' set to ' +
|
|
885
|
+
messageData[dimension] +
|
|
886
|
+
'px'
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
function chkZero(dimension) {
|
|
891
|
+
// FireFox sets dimension of hidden iFrames to zero.
|
|
892
|
+
// So if we detect that set up an event to check for
|
|
893
|
+
// when iFrame becomes visible.
|
|
894
|
+
|
|
895
|
+
/* istanbul ignore next */ // Not testable in PhantomJS
|
|
896
|
+
if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
|
|
897
|
+
hiddenCheckEnabled = true;
|
|
898
|
+
log(iframeId, 'Hidden iFrame detected, creating visibility listener');
|
|
899
|
+
fixHiddenIFrames();
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
function processDimension(dimension) {
|
|
904
|
+
setDimension(dimension);
|
|
905
|
+
chkZero(dimension);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
var iframeId = messageData.iframe.id;
|
|
909
|
+
|
|
910
|
+
if (settings[iframeId]) {
|
|
911
|
+
if (settings[iframeId].sizeHeight) {
|
|
912
|
+
processDimension('height');
|
|
913
|
+
}
|
|
914
|
+
if (settings[iframeId].sizeWidth) {
|
|
915
|
+
processDimension('width');
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function syncResize(func, messageData, doNotSync) {
|
|
921
|
+
/* istanbul ignore if */ // Not testable in PhantomJS
|
|
922
|
+
if (
|
|
923
|
+
doNotSync !== messageData.type &&
|
|
924
|
+
requestAnimationFrame &&
|
|
925
|
+
// including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
|
|
926
|
+
!window.jasmine
|
|
927
|
+
) {
|
|
928
|
+
log(messageData.id, 'Requesting animation frame');
|
|
929
|
+
requestAnimationFrame(func);
|
|
930
|
+
} else {
|
|
931
|
+
func();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
|
|
936
|
+
function postMessageToIFrame() {
|
|
937
|
+
var target = settings[id] && settings[id].targetOrigin;
|
|
938
|
+
log(
|
|
939
|
+
id,
|
|
940
|
+
'[' +
|
|
941
|
+
calleeMsg +
|
|
942
|
+
'] Sending msg to iframe[' +
|
|
943
|
+
id +
|
|
944
|
+
'] (' +
|
|
945
|
+
msg +
|
|
946
|
+
') targetOrigin: ' +
|
|
947
|
+
target
|
|
948
|
+
);
|
|
949
|
+
iframe.contentWindow.postMessage(msgId + msg, target);
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
function iFrameNotFound() {
|
|
953
|
+
warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
function chkAndSend() {
|
|
957
|
+
if (
|
|
958
|
+
iframe &&
|
|
959
|
+
'contentWindow' in iframe &&
|
|
960
|
+
null !== iframe.contentWindow
|
|
961
|
+
) {
|
|
962
|
+
// Null test for PhantomJS
|
|
963
|
+
postMessageToIFrame();
|
|
964
|
+
} else {
|
|
965
|
+
iFrameNotFound();
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function warnOnNoResponse() {
|
|
970
|
+
function warning() {
|
|
971
|
+
if (settings[id] && !settings[id].loaded && !errorShown) {
|
|
972
|
+
errorShown = true;
|
|
973
|
+
warn(
|
|
974
|
+
id,
|
|
975
|
+
'IFrame has not responded within ' +
|
|
976
|
+
settings[id].warningTimeout / 1000 +
|
|
977
|
+
' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
if (
|
|
983
|
+
!!noResponseWarning &&
|
|
984
|
+
settings[id] &&
|
|
985
|
+
!!settings[id].warningTimeout
|
|
986
|
+
) {
|
|
987
|
+
settings[id].msgTimeout = setTimeout(
|
|
988
|
+
warning,
|
|
989
|
+
settings[id].warningTimeout
|
|
990
|
+
);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
var errorShown = false;
|
|
995
|
+
|
|
996
|
+
id = id || iframe.id;
|
|
997
|
+
|
|
998
|
+
if (settings[id]) {
|
|
999
|
+
chkAndSend();
|
|
1000
|
+
warnOnNoResponse();
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
function createOutgoingMsg(iframeId) {
|
|
1005
|
+
return (
|
|
1006
|
+
iframeId +
|
|
1007
|
+
':' +
|
|
1008
|
+
settings[iframeId].bodyMarginV1 +
|
|
1009
|
+
':' +
|
|
1010
|
+
settings[iframeId].sizeWidth +
|
|
1011
|
+
':' +
|
|
1012
|
+
settings[iframeId].log +
|
|
1013
|
+
':' +
|
|
1014
|
+
settings[iframeId].interval +
|
|
1015
|
+
':' +
|
|
1016
|
+
settings[iframeId].enablePublicMethods +
|
|
1017
|
+
':' +
|
|
1018
|
+
settings[iframeId].autoResize +
|
|
1019
|
+
':' +
|
|
1020
|
+
settings[iframeId].bodyMargin +
|
|
1021
|
+
':' +
|
|
1022
|
+
settings[iframeId].heightCalculationMethod +
|
|
1023
|
+
':' +
|
|
1024
|
+
settings[iframeId].bodyBackground +
|
|
1025
|
+
':' +
|
|
1026
|
+
settings[iframeId].bodyPadding +
|
|
1027
|
+
':' +
|
|
1028
|
+
settings[iframeId].tolerance +
|
|
1029
|
+
':' +
|
|
1030
|
+
settings[iframeId].inPageLinks +
|
|
1031
|
+
':' +
|
|
1032
|
+
settings[iframeId].resizeFrom +
|
|
1033
|
+
':' +
|
|
1034
|
+
settings[iframeId].widthCalculationMethod +
|
|
1035
|
+
':' +
|
|
1036
|
+
settings[iframeId].mouseEvents
|
|
1037
|
+
)
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
function isNumber(value) {
|
|
1041
|
+
return typeof value === 'number'
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
function setupIFrame(iframe, options) {
|
|
1045
|
+
function setLimits() {
|
|
1046
|
+
function addStyle(style) {
|
|
1047
|
+
var styleValue = settings[iframeId][style];
|
|
1048
|
+
if (Infinity !== styleValue && 0 !== styleValue) {
|
|
1049
|
+
iframe.style[style] = isNumber(styleValue)
|
|
1050
|
+
? styleValue + 'px'
|
|
1051
|
+
: styleValue;
|
|
1052
|
+
log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
function chkMinMax(dimension) {
|
|
1057
|
+
if (
|
|
1058
|
+
settings[iframeId]['min' + dimension] >
|
|
1059
|
+
settings[iframeId]['max' + dimension]
|
|
1060
|
+
) {
|
|
1061
|
+
throw new Error(
|
|
1062
|
+
'Value for min' +
|
|
1063
|
+
dimension +
|
|
1064
|
+
' can not be greater than max' +
|
|
1065
|
+
dimension
|
|
1066
|
+
)
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
chkMinMax('Height');
|
|
1071
|
+
chkMinMax('Width');
|
|
1072
|
+
|
|
1073
|
+
addStyle('maxHeight');
|
|
1074
|
+
addStyle('minHeight');
|
|
1075
|
+
addStyle('maxWidth');
|
|
1076
|
+
addStyle('minWidth');
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
function newId() {
|
|
1080
|
+
var id = (options && options.id) || defaults.id + count++;
|
|
1081
|
+
if (null !== document.getElementById(id)) {
|
|
1082
|
+
id += count++;
|
|
1083
|
+
}
|
|
1084
|
+
return id
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
function ensureHasId(iframeId) {
|
|
1088
|
+
if (typeof iframeId !== 'string') {
|
|
1089
|
+
throw new TypeError('Invaild id for iFrame. Expected String')
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if ('' === iframeId) {
|
|
1093
|
+
// eslint-disable-next-line no-multi-assign
|
|
1094
|
+
iframe.id = iframeId = newId();
|
|
1095
|
+
logEnabled = (options || {}).log;
|
|
1096
|
+
log(
|
|
1097
|
+
iframeId,
|
|
1098
|
+
'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
|
|
1099
|
+
);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
return iframeId
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function setScrolling() {
|
|
1106
|
+
log(
|
|
1107
|
+
iframeId,
|
|
1108
|
+
'IFrame scrolling ' +
|
|
1109
|
+
(settings[iframeId] && settings[iframeId].scrolling
|
|
1110
|
+
? 'enabled'
|
|
1111
|
+
: 'disabled') +
|
|
1112
|
+
' for ' +
|
|
1113
|
+
iframeId
|
|
1114
|
+
);
|
|
1115
|
+
iframe.style.overflow =
|
|
1116
|
+
false === (settings[iframeId] && settings[iframeId].scrolling)
|
|
1117
|
+
? 'hidden'
|
|
1118
|
+
: 'auto';
|
|
1119
|
+
switch (settings[iframeId] && settings[iframeId].scrolling) {
|
|
1120
|
+
case 'omit': {
|
|
1121
|
+
break
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
case true: {
|
|
1125
|
+
iframe.scrolling = 'yes';
|
|
1126
|
+
break
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
case false: {
|
|
1130
|
+
iframe.scrolling = 'no';
|
|
1131
|
+
break
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
default: {
|
|
1135
|
+
iframe.scrolling = settings[iframeId]
|
|
1136
|
+
? settings[iframeId].scrolling
|
|
1137
|
+
: 'no';
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// The V1 iFrame script expects an int, where as in V2 expects a CSS
|
|
1143
|
+
// string value such as '1px 3em', so if we have an int for V2, set V1=V2
|
|
1144
|
+
// and then convert V2 to a string PX value.
|
|
1145
|
+
function setupBodyMarginValues() {
|
|
1146
|
+
if (
|
|
1147
|
+
'number' ===
|
|
1148
|
+
typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
|
|
1149
|
+
'0' === (settings[iframeId] && settings[iframeId].bodyMargin)
|
|
1150
|
+
) {
|
|
1151
|
+
settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
|
|
1152
|
+
settings[iframeId].bodyMargin =
|
|
1153
|
+
'' + settings[iframeId].bodyMargin + 'px';
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
function checkReset() {
|
|
1158
|
+
// Reduce scope of firstRun to function, because IE8's JS execution
|
|
1159
|
+
// context stack is borked and this value gets externally
|
|
1160
|
+
// changed midway through running this function!!!
|
|
1161
|
+
var firstRun = settings[iframeId] && settings[iframeId].firstRun,
|
|
1162
|
+
resetRequertMethod =
|
|
1163
|
+
settings[iframeId] &&
|
|
1164
|
+
settings[iframeId].heightCalculationMethod in resetRequiredMethods;
|
|
1165
|
+
|
|
1166
|
+
if (!firstRun && resetRequertMethod) {
|
|
1167
|
+
resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
function setupIFrameObject() {
|
|
1172
|
+
if (settings[iframeId]) {
|
|
1173
|
+
settings[iframeId].iframe.iFrameResizer = {
|
|
1174
|
+
close: closeIFrame.bind(null, settings[iframeId].iframe),
|
|
1175
|
+
|
|
1176
|
+
removeListeners: removeIframeListeners.bind(
|
|
1177
|
+
null,
|
|
1178
|
+
settings[iframeId].iframe
|
|
1179
|
+
),
|
|
1180
|
+
|
|
1181
|
+
resize: trigger.bind(
|
|
1182
|
+
null,
|
|
1183
|
+
'Window resize',
|
|
1184
|
+
'resize',
|
|
1185
|
+
settings[iframeId].iframe
|
|
1186
|
+
),
|
|
1187
|
+
|
|
1188
|
+
moveToAnchor: function (anchor) {
|
|
1189
|
+
trigger(
|
|
1190
|
+
'Move to anchor',
|
|
1191
|
+
'moveToAnchor:' + anchor,
|
|
1192
|
+
settings[iframeId].iframe,
|
|
1193
|
+
iframeId
|
|
1194
|
+
);
|
|
1195
|
+
},
|
|
1196
|
+
|
|
1197
|
+
sendMessage: function (message) {
|
|
1198
|
+
message = JSON.stringify(message);
|
|
1199
|
+
trigger(
|
|
1200
|
+
'Send Message',
|
|
1201
|
+
'message:' + message,
|
|
1202
|
+
settings[iframeId].iframe,
|
|
1203
|
+
iframeId
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// We have to call trigger twice, as we can not be sure if all
|
|
1211
|
+
// iframes have completed loading when this code runs. The
|
|
1212
|
+
// event listener also catches the page changing in the iFrame.
|
|
1213
|
+
function init(msg) {
|
|
1214
|
+
function iFrameLoaded() {
|
|
1215
|
+
trigger('iFrame.onload', msg, iframe, undefined$1, true);
|
|
1216
|
+
checkReset();
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
function createDestroyObserver(MutationObserver) {
|
|
1220
|
+
if (!iframe.parentNode) {
|
|
1221
|
+
return null
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
var destroyObserver = new MutationObserver(function (mutations) {
|
|
1225
|
+
mutations.forEach(function (mutation) {
|
|
1226
|
+
var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
|
|
1227
|
+
removedNodes.forEach(function (removedNode) {
|
|
1228
|
+
if (removedNode === iframe) {
|
|
1229
|
+
closeIFrame(iframe);
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
});
|
|
1233
|
+
});
|
|
1234
|
+
destroyObserver.observe(iframe.parentNode, {
|
|
1235
|
+
childList: true
|
|
1236
|
+
});
|
|
1237
|
+
return destroyObserver
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
var MutationObserver = getMutationObserver();
|
|
1241
|
+
if (MutationObserver) {
|
|
1242
|
+
destroyObserver = createDestroyObserver(MutationObserver);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
addEventListener(iframe, 'load', iFrameLoaded);
|
|
1246
|
+
trigger('init', msg, iframe, undefined$1, true);
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function checkOptions(options) {
|
|
1250
|
+
if ('object' !== typeof options) {
|
|
1251
|
+
throw new TypeError('Options is not an object')
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
function copyOptions(options) {
|
|
1256
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1257
|
+
for (var option in defaults) {
|
|
1258
|
+
if (Object.prototype.hasOwnProperty.call(defaults, option)) {
|
|
1259
|
+
settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
|
|
1260
|
+
options,
|
|
1261
|
+
option
|
|
1262
|
+
)
|
|
1263
|
+
? options[option]
|
|
1264
|
+
: defaults[option];
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
function getTargetOrigin(remoteHost) {
|
|
1270
|
+
return '' === remoteHost ||
|
|
1271
|
+
null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
|
|
1272
|
+
? '*'
|
|
1273
|
+
: remoteHost
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
function depricate(key) {
|
|
1277
|
+
var splitName = key.split('Callback');
|
|
1278
|
+
|
|
1279
|
+
if (splitName.length === 2) {
|
|
1280
|
+
var name =
|
|
1281
|
+
'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
|
|
1282
|
+
this[name] = this[key];
|
|
1283
|
+
delete this[key];
|
|
1284
|
+
warn(
|
|
1285
|
+
iframeId,
|
|
1286
|
+
"Deprecated: '" +
|
|
1287
|
+
key +
|
|
1288
|
+
"' has been renamed '" +
|
|
1289
|
+
name +
|
|
1290
|
+
"'. The old method will be removed in the next major version."
|
|
1291
|
+
);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
function processOptions(options) {
|
|
1296
|
+
options = options || {};
|
|
1297
|
+
|
|
1298
|
+
settings[iframeId] = Object.create(null); // Protect against prototype attacks
|
|
1299
|
+
settings[iframeId].iframe = iframe;
|
|
1300
|
+
settings[iframeId].firstRun = true;
|
|
1301
|
+
settings[iframeId].remoteHost =
|
|
1302
|
+
iframe.src && iframe.src.split('/').slice(0, 3).join('/');
|
|
1303
|
+
|
|
1304
|
+
checkOptions(options);
|
|
1305
|
+
Object.keys(options).forEach(depricate, options);
|
|
1306
|
+
copyOptions(options);
|
|
1307
|
+
|
|
1308
|
+
if (settings[iframeId]) {
|
|
1309
|
+
settings[iframeId].targetOrigin =
|
|
1310
|
+
true === settings[iframeId].checkOrigin
|
|
1311
|
+
? getTargetOrigin(settings[iframeId].remoteHost)
|
|
1312
|
+
: '*';
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
function beenHere() {
|
|
1317
|
+
return iframeId in settings && 'iFrameResizer' in iframe
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
var iframeId = ensureHasId(iframe.id);
|
|
1321
|
+
|
|
1322
|
+
if (beenHere()) {
|
|
1323
|
+
warn(iframeId, 'Ignored iFrame, already setup.');
|
|
1324
|
+
} else {
|
|
1325
|
+
processOptions(options);
|
|
1326
|
+
setScrolling();
|
|
1327
|
+
setLimits();
|
|
1328
|
+
setupBodyMarginValues();
|
|
1329
|
+
init(createOutgoingMsg(iframeId));
|
|
1330
|
+
setupIFrameObject();
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
function debouce(fn, time) {
|
|
1335
|
+
if (null === timer) {
|
|
1336
|
+
timer = setTimeout(function () {
|
|
1337
|
+
timer = null;
|
|
1338
|
+
fn();
|
|
1339
|
+
}, time);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
var frameTimer = {};
|
|
1344
|
+
function debounceFrameEvents(fn, time, frameId) {
|
|
1345
|
+
if (!frameTimer[frameId]) {
|
|
1346
|
+
frameTimer[frameId] = setTimeout(function () {
|
|
1347
|
+
frameTimer[frameId] = null;
|
|
1348
|
+
fn();
|
|
1349
|
+
}, time);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
// Not testable in PhantomJS
|
|
1354
|
+
/* istanbul ignore next */
|
|
1355
|
+
|
|
1356
|
+
function fixHiddenIFrames() {
|
|
1357
|
+
function checkIFrames() {
|
|
1358
|
+
function checkIFrame(settingId) {
|
|
1359
|
+
function chkDimension(dimension) {
|
|
1360
|
+
return (
|
|
1361
|
+
'0px' ===
|
|
1362
|
+
(settings[settingId] && settings[settingId].iframe.style[dimension])
|
|
1363
|
+
)
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
function isVisible(el) {
|
|
1367
|
+
return null !== el.offsetParent
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
if (
|
|
1371
|
+
settings[settingId] &&
|
|
1372
|
+
isVisible(settings[settingId].iframe) &&
|
|
1373
|
+
(chkDimension('height') || chkDimension('width'))
|
|
1374
|
+
) {
|
|
1375
|
+
trigger(
|
|
1376
|
+
'Visibility change',
|
|
1377
|
+
'resize',
|
|
1378
|
+
settings[settingId].iframe,
|
|
1379
|
+
settingId
|
|
1380
|
+
);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
Object.keys(settings).forEach(function (key) {
|
|
1385
|
+
checkIFrame(key);
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
function mutationObserved(mutations) {
|
|
1390
|
+
log(
|
|
1391
|
+
'window',
|
|
1392
|
+
'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
|
|
1393
|
+
);
|
|
1394
|
+
debouce(checkIFrames, 16);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
function createMutationObserver() {
|
|
1398
|
+
var target = document.querySelector('body'),
|
|
1399
|
+
config = {
|
|
1400
|
+
attributes: true,
|
|
1401
|
+
attributeOldValue: false,
|
|
1402
|
+
characterData: true,
|
|
1403
|
+
characterDataOldValue: false,
|
|
1404
|
+
childList: true,
|
|
1405
|
+
subtree: true
|
|
1406
|
+
},
|
|
1407
|
+
observer = new MutationObserver(mutationObserved);
|
|
1408
|
+
|
|
1409
|
+
observer.observe(target, config);
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
var MutationObserver = getMutationObserver();
|
|
1413
|
+
if (MutationObserver) {
|
|
1414
|
+
createMutationObserver();
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
function resizeIFrames(event) {
|
|
1419
|
+
function resize() {
|
|
1420
|
+
sendTriggerMsg('Window ' + event, 'resize');
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
log('window', 'Trigger event: ' + event);
|
|
1424
|
+
debouce(resize, 16);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// Not testable in PhantomJS
|
|
1428
|
+
/* istanbul ignore next */
|
|
1429
|
+
function tabVisible() {
|
|
1430
|
+
function resize() {
|
|
1431
|
+
sendTriggerMsg('Tab Visible', 'resize');
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
if ('hidden' !== document.visibilityState) {
|
|
1435
|
+
log('document', 'Trigger event: Visibility change');
|
|
1436
|
+
debouce(resize, 16);
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
function sendTriggerMsg(eventName, event) {
|
|
1441
|
+
function isIFrameResizeEnabled(iframeId) {
|
|
1442
|
+
return (
|
|
1443
|
+
settings[iframeId] &&
|
|
1444
|
+
'parent' === settings[iframeId].resizeFrom &&
|
|
1445
|
+
settings[iframeId].autoResize &&
|
|
1446
|
+
!settings[iframeId].firstRun
|
|
1447
|
+
)
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
Object.keys(settings).forEach(function (iframeId) {
|
|
1451
|
+
if (isIFrameResizeEnabled(iframeId)) {
|
|
1452
|
+
trigger(eventName, event, settings[iframeId].iframe, iframeId);
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
function setupEventListeners() {
|
|
1458
|
+
addEventListener(window, 'message', iFrameListener);
|
|
1459
|
+
|
|
1460
|
+
addEventListener(window, 'resize', function () {
|
|
1461
|
+
resizeIFrames('resize');
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
addEventListener(document, 'visibilitychange', tabVisible);
|
|
1465
|
+
|
|
1466
|
+
addEventListener(document, '-webkit-visibilitychange', tabVisible);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
function factory() {
|
|
1470
|
+
function init(options, element) {
|
|
1471
|
+
function chkType() {
|
|
1472
|
+
if (!element.tagName) {
|
|
1473
|
+
throw new TypeError('Object is not a valid DOM element')
|
|
1474
|
+
} else if ('IFRAME' !== element.tagName.toUpperCase()) {
|
|
1475
|
+
throw new TypeError(
|
|
1476
|
+
'Expected <IFRAME> tag, found <' + element.tagName + '>'
|
|
1477
|
+
)
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
if (element) {
|
|
1482
|
+
chkType();
|
|
1483
|
+
setupIFrame(element, options);
|
|
1484
|
+
iFrames.push(element);
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
function warnDeprecatedOptions(options) {
|
|
1489
|
+
if (options && options.enablePublicMethods) {
|
|
1490
|
+
warn(
|
|
1491
|
+
'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
|
|
1492
|
+
);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
var iFrames;
|
|
1497
|
+
|
|
1498
|
+
setupRequestAnimationFrame();
|
|
1499
|
+
setupEventListeners();
|
|
1500
|
+
|
|
1501
|
+
return function iFrameResizeF(options, target) {
|
|
1502
|
+
iFrames = []; // Only return iFrames past in on this call
|
|
1503
|
+
|
|
1504
|
+
warnDeprecatedOptions(options);
|
|
1505
|
+
|
|
1506
|
+
switch (typeof target) {
|
|
1507
|
+
case 'undefined':
|
|
1508
|
+
case 'string': {
|
|
1509
|
+
Array.prototype.forEach.call(
|
|
1510
|
+
document.querySelectorAll(target || 'iframe'),
|
|
1511
|
+
init.bind(undefined$1, options)
|
|
1512
|
+
);
|
|
1513
|
+
break
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
case 'object': {
|
|
1517
|
+
init(options, target);
|
|
1518
|
+
break
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
default: {
|
|
1522
|
+
throw new TypeError('Unexpected data type (' + typeof target + ')')
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
return iFrames
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
function createJQueryPublicMethod($) {
|
|
1531
|
+
if (!$.fn) {
|
|
1532
|
+
info('', 'Unable to bind to jQuery, it is not fully loaded.');
|
|
1533
|
+
} else if (!$.fn.iFrameResize) {
|
|
1534
|
+
$.fn.iFrameResize = function $iFrameResizeF(options) {
|
|
1535
|
+
function init(index, element) {
|
|
1536
|
+
setupIFrame(element, options);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
return this.filter('iframe').each(init).end()
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
if (window.jQuery !== undefined$1) {
|
|
1545
|
+
createJQueryPublicMethod(window.jQuery);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
|
1549
|
+
undefined$1([], factory);
|
|
1550
|
+
} else {
|
|
1551
|
+
// Node for browserfy
|
|
1552
|
+
module.exports = factory();
|
|
1553
|
+
}
|
|
1554
|
+
window.iFrameResize = window.iFrameResize || factory();
|
|
1555
|
+
})();
|
|
1556
|
+
}(iframeResizer));
|
|
1557
|
+
|
|
1558
|
+
const iFrameResize = iframeResizer.exports;
|
|
1559
|
+
|
|
1560
|
+
const MessageEventType = {
|
|
1561
|
+
card: {
|
|
1562
|
+
ready: 'justifi.card.ready',
|
|
1563
|
+
tokenize: 'justifi.card.tokenize',
|
|
1564
|
+
validate: 'justifi.card.validate',
|
|
1565
|
+
resize: 'justifi.card.resize',
|
|
1566
|
+
styleOverrides: 'justifi.card.styleOverrides',
|
|
1567
|
+
},
|
|
1568
|
+
bankAccount: {
|
|
1569
|
+
ready: 'justifi.bankAccount.ready',
|
|
1570
|
+
tokenize: 'justifi.bankAccount.tokenize',
|
|
1571
|
+
validate: 'justifi.bankAccount.validate',
|
|
1572
|
+
resize: 'justifi.bankAccount.resize',
|
|
1573
|
+
styleOverrides: 'justifi.bankAccount.styleOverrides',
|
|
1574
|
+
},
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
const getComputedTheme = () => {
|
|
1578
|
+
const computedStyles = getComputedStyle(document.body);
|
|
1579
|
+
const computedTheme = {
|
|
1580
|
+
loadGoogleFont: computedStyles.getPropertyValue('--jfi-load-google-font'),
|
|
1581
|
+
layout: {
|
|
1582
|
+
fontFamily: computedStyles.getPropertyValue('--jfi-layout-font-family'),
|
|
1583
|
+
padding: computedStyles.getPropertyValue('--jfi-layout-padding'),
|
|
1584
|
+
formControlSpacingHorizontal: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-x'),
|
|
1585
|
+
formControlSpacingVertical: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-y'),
|
|
1586
|
+
},
|
|
1587
|
+
formControl: {
|
|
1588
|
+
backgroundColor: computedStyles.getPropertyValue('--jfi-form-control-background-color'),
|
|
1589
|
+
borderColor: computedStyles.getPropertyValue('--jfi-form-control-border-color'),
|
|
1590
|
+
borderColorFocus: computedStyles.getPropertyValue('--jfi-form-control-border-color-focus'),
|
|
1591
|
+
borderColorError: computedStyles.getPropertyValue('--jfi-form-control-border-color-error'),
|
|
1592
|
+
borderWidth: computedStyles.getPropertyValue('--jfi-form-control-border-width'),
|
|
1593
|
+
borderBottomWidth: computedStyles.getPropertyValue('--jfi-form-control-border-bottom-width'),
|
|
1594
|
+
borderLeftWidth: computedStyles.getPropertyValue('--jfi-form-control-border-left-width'),
|
|
1595
|
+
borderRightWidth: computedStyles.getPropertyValue('--jfi-form-control-border-right-width'),
|
|
1596
|
+
borderTopWidth: computedStyles.getPropertyValue('--jfi-form-control-border-top-width'),
|
|
1597
|
+
borderRadius: computedStyles.getPropertyValue('--jfi-form-control-border-radius'),
|
|
1598
|
+
borderStyle: computedStyles.getPropertyValue('--jfi-form-control-border-style'),
|
|
1599
|
+
boxShadow: computedStyles.getPropertyValue('--jfi-form-control-box-shadow'),
|
|
1600
|
+
boxShadowError: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error'),
|
|
1601
|
+
boxShadowErrorFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error-focus'),
|
|
1602
|
+
boxShadowFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-focus'),
|
|
1603
|
+
color: computedStyles.getPropertyValue('--jfi-form-control-color'),
|
|
1604
|
+
colorFocus: computedStyles.getPropertyValue('--jfi-form-control-color-focus'),
|
|
1605
|
+
fontSize: computedStyles.getPropertyValue('--jfi-form-control-font-size'),
|
|
1606
|
+
fontWeight: computedStyles.getPropertyValue('--jfi-form-control-font-weight'),
|
|
1607
|
+
lineHeight: computedStyles.getPropertyValue('--jfi-form-control-line-height'),
|
|
1608
|
+
margin: computedStyles.getPropertyValue('--jfi-form-control-margin'),
|
|
1609
|
+
padding: computedStyles.getPropertyValue('--jfi-form-control-padding'),
|
|
1610
|
+
},
|
|
1611
|
+
formLabel: {
|
|
1612
|
+
color: computedStyles.getPropertyValue('--jfi-form-label-color'),
|
|
1613
|
+
fontFamily: computedStyles.getPropertyValue('--jfi-form-label-font-family'),
|
|
1614
|
+
fontSize: computedStyles.getPropertyValue('--jfi-form-label-font-size'),
|
|
1615
|
+
fontWeight: computedStyles.getPropertyValue('--jfi-form-label-font-weight'),
|
|
1616
|
+
margin: computedStyles.getPropertyValue('--jfi-form-label-margin'),
|
|
1617
|
+
},
|
|
1618
|
+
errorMessage: {
|
|
1619
|
+
color: computedStyles.getPropertyValue('--jfi-error-message-color'),
|
|
1620
|
+
margin: computedStyles.getPropertyValue('--jfi-error-message-margin'),
|
|
1621
|
+
fontSize: computedStyles.getPropertyValue('--jfi-error-message-font-size'),
|
|
1622
|
+
},
|
|
1623
|
+
};
|
|
1624
|
+
return computedTheme;
|
|
1625
|
+
};
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* This approach decouples the communication logic from PaymentMethodForm component,
|
|
1629
|
+
* making it cleaner, more maintainable, and easier to test
|
|
1630
|
+
*/
|
|
1631
|
+
class FrameCommunicationService {
|
|
1632
|
+
constructor(iframe, iframeOrigin) {
|
|
1633
|
+
this.iframe = iframe;
|
|
1634
|
+
this.iframeOrigin = iframeOrigin;
|
|
1635
|
+
}
|
|
1636
|
+
postMessage(eventType, payload) {
|
|
1637
|
+
const message = Object.assign({ eventType }, payload);
|
|
1638
|
+
this.iframe.contentWindow.postMessage(message, this.iframeOrigin);
|
|
1639
|
+
}
|
|
1640
|
+
addMessageListener(callback) {
|
|
1641
|
+
window.addEventListener('message', callback);
|
|
1642
|
+
}
|
|
1643
|
+
removeMessageListener(callback) {
|
|
1644
|
+
window.removeEventListener('message', callback);
|
|
1645
|
+
}
|
|
1646
|
+
postMessageWithResponseListener(eventType, payload) {
|
|
1647
|
+
return new Promise((resolve) => {
|
|
1648
|
+
const responseListener = (event) => {
|
|
1649
|
+
if (event.data.eventType !== eventType)
|
|
1650
|
+
return;
|
|
1651
|
+
window.removeEventListener('message', responseListener);
|
|
1652
|
+
resolve(event.data.data);
|
|
1653
|
+
};
|
|
1654
|
+
window.addEventListener('message', responseListener);
|
|
1655
|
+
this.postMessage(eventType, payload);
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";
|
|
1661
|
+
const JustifiPaymentMethodFormStyle0 = paymentMethodFormCss;
|
|
1662
|
+
|
|
1663
|
+
const PaymentMethodForm = class {
|
|
65
1664
|
constructor(hostRef) {
|
|
66
1665
|
index.registerInstance(this, hostRef);
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
1666
|
+
this.paymentMethodFormReady = index.createEvent(this, "paymentMethodFormReady", 7);
|
|
1667
|
+
this.paymentMethodFormValidated = index.createEvent(this, "paymentMethodFormValidated", 7);
|
|
1668
|
+
this.paymentMethodFormTokenized = index.createEvent(this, "paymentMethodFormTokenized", 7);
|
|
1669
|
+
this.computedTheme = getComputedTheme();
|
|
1670
|
+
this.dispatchMessageEvent = (messageEvent) => {
|
|
1671
|
+
const { eventType, data } = messageEvent.data;
|
|
1672
|
+
const eventTypeMessage = MessageEventType[this.paymentMethodFormType];
|
|
1673
|
+
if (eventType === eventTypeMessage.ready) {
|
|
1674
|
+
this.paymentMethodFormReady.emit(data);
|
|
1675
|
+
this.sendStyleOverrides();
|
|
1676
|
+
}
|
|
1677
|
+
else if (eventType === eventTypeMessage.tokenize) {
|
|
1678
|
+
this.paymentMethodFormTokenized.emit(data);
|
|
1679
|
+
}
|
|
1680
|
+
else if (eventType === eventTypeMessage.validate) {
|
|
1681
|
+
this.paymentMethodFormValidated.emit(data);
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
this.postMessage = (eventType, payload) => {
|
|
1685
|
+
this.frameService.postMessage(eventType, payload);
|
|
1686
|
+
};
|
|
1687
|
+
this.paymentMethodFormType = undefined;
|
|
1688
|
+
this.paymentMethodFormValidationMode = undefined;
|
|
1689
|
+
this.iframeOrigin = undefined;
|
|
1690
|
+
this.singleLine = undefined;
|
|
1691
|
+
}
|
|
1692
|
+
disconnectedCallback() {
|
|
1693
|
+
this.frameService.removeMessageListener(this.dispatchMessageEvent);
|
|
1694
|
+
}
|
|
1695
|
+
async resize() {
|
|
1696
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
|
|
1697
|
+
}
|
|
1698
|
+
async tokenize(clientId, paymentMethodMetadata, account) {
|
|
1699
|
+
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
1700
|
+
return this.frameService.postMessageWithResponseListener(eventType, {
|
|
1701
|
+
clientId,
|
|
1702
|
+
paymentMethodMetadata,
|
|
1703
|
+
account,
|
|
1704
|
+
componentVersion: _package.packageJson.version,
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
async validate() {
|
|
1708
|
+
const eventType = MessageEventType[this.paymentMethodFormType].validate;
|
|
1709
|
+
return this.frameService.postMessageWithResponseListener(eventType);
|
|
1710
|
+
}
|
|
1711
|
+
sendStyleOverrides() {
|
|
1712
|
+
if (this.computedTheme) {
|
|
1713
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
getIframeSrc() {
|
|
1717
|
+
let paramsList = [];
|
|
1718
|
+
if (this.paymentMethodFormValidationMode) {
|
|
1719
|
+
paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);
|
|
1720
|
+
}
|
|
1721
|
+
if (this.singleLine) {
|
|
1722
|
+
paramsList.push(`singleLine=${this.singleLine}`);
|
|
1723
|
+
}
|
|
1724
|
+
let iframeSrc = `${this.iframeOrigin}/${this.paymentMethodFormType}${utils$1.composeQueryParams(paramsList)}`;
|
|
1725
|
+
return iframeSrc;
|
|
69
1726
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
1727
|
+
initializeFrameCommunicationService() {
|
|
1728
|
+
var _a;
|
|
1729
|
+
this.frameService = new FrameCommunicationService(this.iframeElement, this.iframeOrigin);
|
|
1730
|
+
(_a = this.frameService) === null || _a === void 0 ? void 0 : _a.addMessageListener(this.dispatchMessageEvent);
|
|
74
1731
|
}
|
|
75
1732
|
render() {
|
|
76
|
-
return (index.h(
|
|
1733
|
+
return (index.h(index.Host, { key: '10987c92745fbff8bb85367db69b76e2bc786c88' }, index.h("iframe", { key: '0622dd0201a04a3c918fd3d175d2a29f24609759', id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
|
|
1734
|
+
this.iframeElement = el;
|
|
1735
|
+
this.initializeFrameCommunicationService();
|
|
1736
|
+
}, onLoad: () => {
|
|
1737
|
+
iFrameResize({
|
|
1738
|
+
scrollbars: false,
|
|
1739
|
+
}, this.iframeElement);
|
|
1740
|
+
} })));
|
|
77
1741
|
}
|
|
78
1742
|
};
|
|
1743
|
+
PaymentMethodForm.style = JustifiPaymentMethodFormStyle0;
|
|
79
1744
|
|
|
80
1745
|
exports.justifi_billing_form = BillingForm;
|
|
81
|
-
exports.
|
|
1746
|
+
exports.justifi_payment_method_form = PaymentMethodForm;
|