@saasquatch/mint-components 1.11.1-0 → 1.12.0-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/{ShadowViewAddon-2c6026c3.js → ShadowViewAddon-88821c64.js} +229 -154
- package/dist/cjs/{global-02e50f09.js → global-c3637175.js} +2 -2
- package/dist/cjs/{index.module-df530553.js → index.module-b8d9d0ba.js} +55 -18
- package/dist/cjs/keys-cff24974.js +11 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mint-components.cjs.js +3 -3
- package/dist/cjs/{re-render-1976e05e.js → re-render-5bde3d2e.js} +4 -4
- package/dist/cjs/sqm-asset-card.cjs.entry.js +2 -2
- package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +211 -105
- package/dist/cjs/{sqm-big-stat_38.cjs.entry.js → sqm-big-stat_39.cjs.entry.js} +278 -178
- package/dist/cjs/sqm-close-button.cjs.entry.js +3 -3
- package/dist/cjs/sqm-code-verification.cjs.entry.js +352 -0
- package/dist/cjs/sqm-context-router.cjs.entry.js +2 -2
- package/dist/cjs/sqm-email-verification.cjs.entry.js +137 -0
- package/dist/cjs/sqm-empty_4.cjs.entry.js +3 -3
- package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +5 -5
- package/dist/cjs/sqm-instant-access-registration.cjs.entry.js +5 -5
- package/dist/cjs/{sqm-invoice-table-view-e3b03a00.js → sqm-invoice-table-view-ce9a34ac.js} +20 -1
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +5 -5
- package/dist/cjs/sqm-logout-current-user.cjs.entry.js +5 -5
- package/dist/cjs/{sqm-navigation-sidebar-item-view-4e90b6f5.js → sqm-navigation-sidebar-item-view-a2135064.js} +3 -3
- package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +5 -5
- package/dist/cjs/sqm-navigation-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/sqm-password-field.cjs.entry.js +4 -4
- package/dist/cjs/sqm-popup-container.cjs.entry.js +4 -4
- package/dist/cjs/{sqm-portal-email-verification-view-bff9783d.js → sqm-portal-email-verification-view-050dbe0f.js} +2 -2
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +9 -9
- package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +6 -6
- package/dist/cjs/sqm-portal-logout.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-fde54e35.js → sqm-portal-profile-view-d97086bc.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +9 -9
- package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +5 -5
- package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +8 -8
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +9 -9
- package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +9 -9
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +8 -8
- package/dist/cjs/sqm-referred-registration.cjs.entry.js +5 -5
- package/dist/cjs/sqm-rewards-table-customer-note-column.cjs.entry.js +2 -2
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +13 -13
- package/dist/cjs/sqm-scroll.cjs.entry.js +109 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +225 -272
- package/dist/cjs/sqm-tab.cjs.entry.js +2 -2
- package/dist/cjs/sqm-tabs.cjs.entry.js +4 -4
- package/dist/cjs/sqm-widget-verification-internal.cjs.entry.js +33 -0
- package/dist/cjs/sqm-widget-verification.cjs.entry.js +127 -0
- package/dist/cjs/{useChildElements-e0d44916.js → useChildElements-410d2435.js} +2 -2
- package/dist/cjs/useEmailVerification-30a1c7f6.js +75 -0
- package/dist/cjs/{useInstantAccessRegistration-bbe746d1.js → useInstantAccessRegistration-ccf81eae.js} +3 -3
- package/dist/cjs/{useReferralTable-a76adb0d.js → useReferralTable-824ac152.js} +9 -9
- package/dist/cjs/{useRegistrationFormState-876ed65d.js → useRegistrationFormState-f9ce55be.js} +2 -2
- package/dist/cjs/{utilities-cec9dd36.js → utilities-f7de6c04.js} +1 -1
- package/dist/collection/collection-manifest.json +6 -10
- package/dist/collection/components/sqm-coupon-code/sqm-coupon-code.js +1 -1
- package/dist/collection/components/sqm-logout-current-user/sqm-logout-current-user.js +1 -1
- package/dist/collection/components/sqm-payout-button-scroll/PayoutButtonScroll.stories.js +9 -0
- package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.js +22 -0
- package/dist/collection/components/sqm-payout-button-scroll/sqm-payout-button-scroll.js +105 -0
- package/dist/collection/components/sqm-payout-button-scroll/usePayoutButton.js +44 -0
- package/dist/collection/components/sqm-referral-card/ReferralCard.stories.js +0 -20
- package/dist/collection/components/sqm-share-button/useShareButton.js +16 -15
- package/dist/collection/components/sqm-share-code/sqm-share-code.js +1 -1
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +1 -1
- package/dist/collection/components/sqm-share-link/useShareLink.js +3 -5
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +8 -6
- package/dist/collection/components/sqm-widget-verification/keys.js +4 -0
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.js +29 -0
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.js +118 -0
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.js +330 -0
- package/dist/collection/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.js +144 -0
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.js +22 -0
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.js +78 -0
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.js +172 -0
- package/dist/collection/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.js +70 -0
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js +27 -0
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +132 -0
- package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +3 -0
- package/dist/collection/components/tax-and-cash/BankingForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +18 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js +4 -1
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/useBankingInfoForm.js +94 -38
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +16 -2
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.js +12 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.js +72 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.js +217 -0
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +50 -0
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/data.js +1 -0
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.js +16 -0
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +80 -1
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +2 -2
- package/dist/collection/components/views/copy-text-view.js +2 -16
- package/dist/esm/{ShadowViewAddon-5bb2b69a.js → ShadowViewAddon-65c8679e.js} +227 -153
- package/dist/esm/{global-b89b6edc.js → global-6306a9b8.js} +2 -2
- package/dist/esm/{index.module-f122af7b.js → index.module-6c840c4e.js} +40 -3
- package/dist/esm/keys-a1496e39.js +6 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mint-components.js +3 -3
- package/dist/esm/{re-render-c64289f3.js → re-render-1bcfd0de.js} +4 -4
- package/dist/esm/sqm-asset-card.entry.js +2 -2
- package/dist/esm/sqm-banking-info-form_16.entry.js +211 -105
- package/dist/esm/{sqm-big-stat_38.entry.js → sqm-big-stat_39.entry.js} +275 -176
- package/dist/esm/sqm-close-button.entry.js +3 -3
- package/dist/esm/sqm-code-verification.entry.js +348 -0
- package/dist/esm/sqm-context-router.entry.js +2 -2
- package/dist/esm/sqm-email-verification.entry.js +133 -0
- package/dist/esm/sqm-empty_4.entry.js +3 -3
- package/dist/esm/sqm-graphql-client-provider.entry.js +5 -5
- package/dist/esm/sqm-instant-access-registration.entry.js +5 -5
- package/dist/esm/{sqm-invoice-table-view-09cc28d6.js → sqm-invoice-table-view-08c03ba7.js} +20 -1
- package/dist/esm/sqm-leaderboard-rank.entry.js +5 -5
- package/dist/esm/sqm-logout-current-user.entry.js +5 -5
- package/dist/esm/{sqm-navigation-sidebar-item-view-14114804.js → sqm-navigation-sidebar-item-view-f8e78810.js} +3 -3
- package/dist/esm/sqm-navigation-sidebar-item.entry.js +5 -5
- package/dist/esm/sqm-navigation-sidebar.entry.js +3 -3
- package/dist/esm/sqm-password-field.entry.js +4 -4
- package/dist/esm/sqm-popup-container.entry.js +4 -4
- package/dist/esm/{sqm-portal-email-verification-view-ced567c9.js → sqm-portal-email-verification-view-c6ac5430.js} +2 -2
- package/dist/esm/sqm-portal-email-verification.entry.js +9 -9
- package/dist/esm/sqm-portal-forgot-password.entry.js +6 -6
- package/dist/esm/sqm-portal-logout.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-d72dd5ac.js → sqm-portal-profile-view-15ddbec8.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +9 -9
- package/dist/esm/sqm-portal-protected-route.entry.js +5 -5
- package/dist/esm/sqm-portal-registration-form.entry.js +8 -8
- package/dist/esm/sqm-portal-reset-password.entry.js +9 -9
- package/dist/esm/sqm-portal-verify-email.entry.js +9 -9
- package/dist/esm/sqm-referral-table_11.entry.js +8 -8
- package/dist/esm/sqm-referred-registration.entry.js +5 -5
- package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +2 -2
- package/dist/esm/sqm-rewards-table_9.entry.js +13 -13
- package/dist/esm/sqm-scroll.entry.js +105 -0
- package/dist/esm/sqm-stencilbook.entry.js +212 -259
- package/dist/esm/sqm-tab.entry.js +2 -2
- package/dist/esm/sqm-tabs.entry.js +4 -4
- package/dist/esm/sqm-widget-verification-internal.entry.js +29 -0
- package/dist/esm/sqm-widget-verification.entry.js +123 -0
- package/dist/esm/stencil-hooks.module-ac12ca1c.js +1 -1
- package/dist/esm/{useChildElements-37daf533.js → useChildElements-fc84e640.js} +2 -2
- package/dist/esm/useEmailVerification-7135732c.js +72 -0
- package/dist/esm/{useInstantAccessRegistration-9d4cb797.js → useInstantAccessRegistration-8b0a4556.js} +3 -3
- package/dist/esm/{useReferralTable-42f99ea2.js → useReferralTable-f6ffa103.js} +9 -9
- package/dist/esm/{useRegistrationFormState-53c71782.js → useRegistrationFormState-849e27f7.js} +2 -2
- package/dist/esm/{utilities-18d10876.js → utilities-443732be.js} +1 -1
- package/dist/esm-es5/{GenericTableView-bf154727.js → GenericTableView-d59d8ab4.js} +1 -1
- package/dist/esm-es5/ShadowViewAddon-65c8679e.js +1 -0
- package/dist/esm-es5/{email-registration-view-12793040.js → email-registration-view-a89a88bf.js} +1 -1
- package/dist/esm-es5/{global-b89b6edc.js → global-6306a9b8.js} +2 -2
- package/dist/esm-es5/index.module-6c840c4e.js +1 -0
- package/dist/esm-es5/keys-a1496e39.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/{re-render-c64289f3.js → re-render-1bcfd0de.js} +1 -1
- package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_39.entry.js +1 -0
- package/dist/esm-es5/{sqm-close-button-view-b24c708b.js → sqm-close-button-view-dc65b4e3.js} +1 -1
- package/dist/esm-es5/sqm-close-button.entry.js +1 -1
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -0
- package/dist/esm-es5/sqm-context-router.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -0
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
- package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-08c03ba7.js +1 -0
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm-es5/{sqm-navigation-sidebar-item-view-14114804.js → sqm-navigation-sidebar-item-view-f8e78810.js} +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
- package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
- package/dist/esm-es5/sqm-password-field.entry.js +1 -1
- package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-email-verification-view-ced567c9.js → sqm-portal-email-verification-view-c6ac5430.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-forgot-password-view-95cd454f.js → sqm-portal-forgot-password-view-c2ed8fed.js} +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-d72dd5ac.js → sqm-portal-profile-view-15ddbec8.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-reset-password-view-f1454d43.js → sqm-portal-reset-password-view-79a85e02.js} +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-verify-email-view-3739f523.js → sqm-portal-verify-email-view-d7ea2c56.js} +1 -1
- package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-referred-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-scroll.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-tab.entry.js +1 -1
- package/dist/esm-es5/sqm-tabs.entry.js +1 -1
- package/dist/esm-es5/sqm-widget-verification-internal.entry.js +1 -0
- package/dist/esm-es5/sqm-widget-verification.entry.js +1 -0
- package/dist/esm-es5/stencil-hooks.module-ac12ca1c.js +1 -1
- package/dist/esm-es5/{useChildElements-37daf533.js → useChildElements-fc84e640.js} +1 -1
- package/dist/esm-es5/useEmailVerification-7135732c.js +1 -0
- package/dist/esm-es5/useInstantAccessRegistration-8b0a4556.js +1 -0
- package/dist/esm-es5/{useReferralTable-42f99ea2.js → useReferralTable-f6ffa103.js} +1 -1
- package/dist/esm-es5/useRegistrationFormState-849e27f7.js +1 -0
- package/dist/esm-es5/{utilities-18d10876.js → utilities-443732be.js} +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/p-0121e044.js +1 -0
- package/dist/mint-components/{p-12c56ba6.entry.js → p-012daf3c.entry.js} +1 -1
- package/dist/mint-components/{p-1b1d10e5.entry.js → p-03dbe2ce.entry.js} +1 -1
- package/dist/mint-components/{p-8077e9c6.js → p-04348a9b.js} +1 -1
- package/dist/mint-components/{p-8c97bfb1.system.entry.js → p-04ced592.system.entry.js} +1 -1
- package/dist/mint-components/{p-7962ab58.system.entry.js → p-0527d90b.system.entry.js} +1 -1
- package/dist/mint-components/{p-01434e4a.entry.js → p-0893073b.entry.js} +1 -1
- package/dist/mint-components/p-0c9ad5f3.system.entry.js +1 -0
- package/dist/mint-components/p-117b4705.system.js +1 -0
- package/dist/mint-components/p-11d1b212.js +1 -0
- package/dist/mint-components/{p-dc41ff27.entry.js → p-1b861be5.entry.js} +1 -1
- package/dist/mint-components/{p-32cf8417.js → p-1b9e6fc6.js} +1 -1
- package/dist/mint-components/p-1bd0cda8.system.entry.js +1 -0
- package/dist/mint-components/{p-991c9787.js → p-1d27da33.js} +2 -2
- package/dist/mint-components/p-1ee62d9f.system.entry.js +1 -0
- package/dist/mint-components/{p-de2a8fae.system.entry.js → p-1f7d7524.system.entry.js} +1 -1
- package/dist/mint-components/p-1f9a9b70.system.entry.js +1 -0
- package/dist/mint-components/{p-5c845bc2.system.entry.js → p-22425c71.system.entry.js} +1 -1
- package/dist/mint-components/p-23fdd44e.entry.js +1 -0
- package/dist/mint-components/{p-3373d84e.js → p-2816bf6a.js} +1 -1
- package/dist/mint-components/p-2868f475.entry.js +1 -0
- package/dist/mint-components/p-2a414b2e.system.js +2 -2
- package/dist/mint-components/{p-a474b0ec.system.entry.js → p-36e9296e.system.entry.js} +1 -1
- package/dist/mint-components/p-36f7caec.system.entry.js +1 -0
- package/dist/mint-components/{p-b334bde8.entry.js → p-3925bcd6.entry.js} +2 -2
- package/dist/mint-components/p-39397731.entry.js +1 -0
- package/dist/mint-components/p-39af4acd.entry.js +240 -0
- package/dist/mint-components/{p-e2bb72eb.system.entry.js → p-3e7ec0f3.system.entry.js} +1 -1
- package/dist/mint-components/{p-59c141a2.system.js → p-3ed71bef.system.js} +1 -1
- package/dist/mint-components/{p-bf834367.system.js → p-43621f12.system.js} +1 -1
- package/dist/mint-components/{p-110dddfe.entry.js → p-4671e644.entry.js} +1 -1
- package/dist/mint-components/{p-0f028514.system.js → p-4babe350.system.js} +1 -1
- package/dist/mint-components/p-4c9b6fbe.system.js +1 -0
- package/dist/mint-components/p-4e373c3d.system.js +1 -0
- package/dist/mint-components/{p-03a647c2.system.js → p-4e48267b.system.js} +1 -1
- package/dist/mint-components/{p-9deac406.system.js → p-4eae91a9.system.js} +1 -1
- package/dist/mint-components/{p-0806343b.js → p-509e29e6.js} +1 -1
- package/dist/mint-components/{p-53ff8bd0.system.entry.js → p-51d53165.system.entry.js} +1 -1
- package/dist/mint-components/{p-246a2827.entry.js → p-5291891c.entry.js} +2 -2
- package/dist/mint-components/{p-c1ba2ad0.system.entry.js → p-59818690.system.entry.js} +1 -1
- package/dist/mint-components/{p-55588b46.system.js → p-5becb2ff.system.js} +1 -1
- package/dist/mint-components/{p-c39f9dc1.system.entry.js → p-5fba1a04.system.entry.js} +1 -1
- package/dist/mint-components/{p-22de9f73.system.entry.js → p-64491210.system.entry.js} +1 -1
- package/dist/mint-components/p-65e2c043.system.js +1 -0
- package/dist/mint-components/p-663303b7.entry.js +8 -0
- package/dist/mint-components/p-66a04cca.system.entry.js +1 -0
- package/dist/mint-components/{p-1df19ea2.js → p-68747d88.js} +1 -1
- package/dist/mint-components/{p-96cb9c17.entry.js → p-6c928c7d.entry.js} +1 -1
- package/dist/mint-components/p-6cae44d7.js +1 -0
- package/dist/mint-components/{p-b0ce005d.entry.js → p-721a89c6.entry.js} +2 -2
- package/dist/mint-components/{p-6e62f207.entry.js → p-76392386.entry.js} +1 -1
- package/dist/mint-components/{p-bb6f6681.system.js → p-7d5e0645.system.js} +1 -1
- package/dist/mint-components/{p-daba8cd2.system.entry.js → p-7dd1ff31.system.entry.js} +1 -1
- package/dist/mint-components/p-7f5c7bf7.system.entry.js +1 -0
- package/dist/mint-components/{p-ec8a9e91.system.entry.js → p-83c9f37b.system.entry.js} +1 -1
- package/dist/mint-components/{p-d3d281ff.entry.js → p-84b25a46.entry.js} +1 -1
- package/dist/mint-components/{p-82e09b8d.system.entry.js → p-88bf51b7.system.entry.js} +1 -1
- package/dist/mint-components/p-8a337864.js +7 -0
- package/dist/mint-components/{p-73decce7.system.js → p-8d554a89.system.js} +1 -1
- package/dist/mint-components/p-93576222.system.js +1 -0
- package/dist/mint-components/p-94454880.entry.js +1 -0
- package/dist/mint-components/p-947fe79b.entry.js +1 -0
- package/dist/mint-components/p-99c15c5e.entry.js +1 -0
- package/dist/mint-components/{p-9288cca6.system.entry.js → p-9cdbd1ac.system.entry.js} +1 -1
- package/dist/mint-components/p-9d34f4f0.entry.js +33 -0
- package/dist/mint-components/p-9e0230c3.entry.js +1 -0
- package/dist/mint-components/{p-476182e7.system.entry.js → p-9ec008cb.system.entry.js} +1 -1
- package/dist/mint-components/p-a02afa72.system.js +1 -0
- package/dist/mint-components/p-a4282d02.system.entry.js +1 -0
- package/dist/mint-components/{p-798ed3a2.entry.js → p-a45b03d2.entry.js} +1 -1
- package/dist/mint-components/{p-523ed056.system.js → p-a51533cb.system.js} +1 -1
- package/dist/mint-components/p-a5a9aa07.entry.js +189 -0
- package/dist/mint-components/p-a85f57bb.entry.js +1 -0
- package/dist/mint-components/{p-21d4f6ce.system.js → p-ac51940e.system.js} +1 -1
- package/dist/mint-components/p-b1e8a802.entry.js +1 -0
- package/dist/mint-components/{p-fec0ac31.js → p-b651706a.js} +24 -24
- package/dist/mint-components/{p-14dac608.system.entry.js → p-bc826117.system.entry.js} +1 -1
- package/dist/mint-components/p-bdd6bb13.js +1 -0
- package/dist/mint-components/{p-67846dce.system.entry.js → p-be1ae1ed.system.entry.js} +1 -1
- package/dist/mint-components/{p-3cc5474d.entry.js → p-bee1e573.entry.js} +1 -1
- package/dist/mint-components/{p-fb2c0ce4.system.entry.js → p-c1f4fb6d.system.entry.js} +1 -1
- package/dist/mint-components/p-c3b37bbf.js +1 -0
- package/dist/mint-components/{p-ff41c804.system.entry.js → p-c3babfa4.system.entry.js} +1 -1
- package/dist/mint-components/{p-18a19cb5.system.js → p-c5577dd7.system.js} +1 -1
- package/dist/mint-components/{p-02f6cda4.js → p-c5d2e4ba.js} +1 -1
- package/dist/mint-components/p-c763c0b2.js +1 -0
- package/dist/mint-components/{p-ed161025.js → p-c8610d0c.js} +1 -1
- package/dist/mint-components/p-c92a743e.entry.js +1 -0
- package/dist/mint-components/p-c9fb6102.entry.js +1 -0
- package/dist/mint-components/p-ca809fdd.system.js +1 -0
- package/dist/mint-components/{p-f52c3aec.system.entry.js → p-cb433855.system.entry.js} +1 -1
- package/dist/mint-components/{p-f44d88fa.system.js → p-cd44de66.system.js} +1 -1
- package/dist/mint-components/p-d35d8c06.entry.js +11 -0
- package/dist/mint-components/{p-cfbe2f86.entry.js → p-d468925f.entry.js} +1 -1
- package/dist/mint-components/{p-15dee492.js → p-d49e2f7a.js} +1 -1
- package/dist/mint-components/{p-9c3d78e9.js → p-d83b0cf3.js} +1 -1
- package/dist/mint-components/{p-6e7e8af6.system.js → p-def516b8.system.js} +1 -1
- package/dist/mint-components/{p-e41cb11f.js → p-e0e7635a.js} +1 -1
- package/dist/mint-components/{p-a1150633.system.entry.js → p-e12d3414.system.entry.js} +1 -1
- package/dist/mint-components/{p-ce746af8.system.js → p-e8dde8f4.system.js} +1 -1
- package/dist/mint-components/p-e93e5740.entry.js +1 -0
- package/dist/mint-components/p-e9ca48fc.system.entry.js +1 -0
- package/dist/mint-components/p-ead27698.system.entry.js +1 -0
- package/dist/mint-components/{p-1c6e4a5f.entry.js → p-f36e33ff.entry.js} +2 -2
- package/dist/mint-components/{p-1ce4fa30.system.entry.js → p-f450654b.system.entry.js} +1 -1
- package/dist/mint-components/{p-1c710e16.entry.js → p-f4cbbe47.entry.js} +1 -1
- package/dist/mint-components/{p-d68ed4a6.system.entry.js → p-f531a5c9.system.entry.js} +1 -1
- package/dist/mint-components/{p-acc93caa.system.entry.js → p-f56348dc.system.entry.js} +1 -1
- package/dist/mint-components/p-f655a7df.js +1 -0
- package/dist/mint-components/{p-855ae1b5.js → p-fb93c962.js} +1 -1
- package/dist/mint-components/{p-46ca288c.system.js → p-fc422446.system.js} +1 -1
- package/dist/mint-components/{p-fae82751.entry.js → p-fd21ae8f.entry.js} +1 -1
- package/dist/mint-components/p-fd2c5407.js +2 -2
- package/dist/types/components/{sqm-pagination/Pagination.stories.d.ts → sqm-payout-button-scroll/PayoutButtonScroll.stories.d.ts} +1 -0
- package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll-view.d.ts +10 -0
- package/dist/types/components/sqm-payout-button-scroll/sqm-payout-button-scroll.d.ts +19 -0
- package/dist/types/components/sqm-payout-button-scroll/usePayoutButton.d.ts +7 -0
- package/dist/types/components/sqm-referral-card/ReferralCard.stories.d.ts +0 -1
- package/dist/types/components/sqm-share-link/useShareLink.d.ts +0 -1
- package/dist/types/components/sqm-widget-verification/keys.d.ts +4 -0
- package/dist/types/components/sqm-widget-verification/sqm-code-verification/WidgetCodeVerification.stories.d.ts +8 -0
- package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification-view.d.ts +26 -0
- package/dist/types/components/sqm-widget-verification/sqm-code-verification/sqm-code-verification.d.ts +60 -0
- package/dist/types/components/sqm-widget-verification/sqm-code-verification/useCodeVerification.d.ts +23 -0
- package/dist/types/components/sqm-widget-verification/sqm-email-verification/WidgetEmailVerification.stories.d.ts +7 -0
- package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification-view.d.ts +16 -0
- package/dist/types/components/sqm-widget-verification/sqm-email-verification/sqm-email-verification.d.ts +32 -0
- package/dist/types/components/sqm-widget-verification/sqm-email-verification/useEmailVerification.d.ts +9 -0
- package/dist/types/components/sqm-widget-verification/sqm-widget-verification-internal.d.ts +5 -0
- package/dist/types/components/sqm-widget-verification/sqm-widget-verification.d.ts +8 -0
- package/dist/types/components/sqm-widget-verification/useWidgetVerification.d.ts +1 -0
- package/dist/types/components/tax-and-cash/TaxForm.stories.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.d.ts +1 -0
- package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +1 -1
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/PayoutStatusAlert.stories.d.ts +8 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert-view.d.ts +18 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/sqm-payout-status-alert.d.ts +21 -0
- package/dist/types/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.d.ts +9 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard-view.d.ts +5 -0
- package/dist/types/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.d.ts +16 -0
- package/dist/types/components/views/copy-text-view.d.ts +0 -2
- package/dist/types/components.d.ts +296 -164
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/copy-text-view-a22ad7e7.js +0 -173
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +0 -313
- package/dist/collection/components/sqm-pagination/Pagination.stories.js +0 -12
- package/dist/collection/components/sqm-pagination/sqm-pagination-view.js +0 -30
- package/dist/collection/components/sqm-pagination/sqm-pagination.js +0 -85
- package/dist/collection/components/sqm-pagination/usePagination.js +0 -8
- package/dist/collection/components/sqm-referral-code/ReferralCode.stories.js +0 -60
- package/dist/collection/components/sqm-referral-code/sqm-referral-code.js +0 -315
- package/dist/collection/components/sqm-referral-code/useReferralCode.js +0 -51
- package/dist/collection/components/sqm-referral-codes/ReferralCodes.stories.js +0 -35
- package/dist/collection/components/sqm-referral-codes/sqm-referral-codes-view.js +0 -59
- package/dist/collection/components/sqm-referral-codes/sqm-referral-codes.js +0 -93
- package/dist/collection/components/sqm-referral-codes/useReferralCodes.js +0 -75
- package/dist/esm/copy-text-view-bf55abeb.js +0 -168
- package/dist/esm/sqm-pagination_3.entry.js +0 -307
- package/dist/esm-es5/ShadowViewAddon-5bb2b69a.js +0 -1
- package/dist/esm-es5/copy-text-view-bf55abeb.js +0 -1
- package/dist/esm-es5/index.module-f122af7b.js +0 -1
- package/dist/esm-es5/sqm-big-stat_38.entry.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-09cc28d6.js +0 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +0 -1
- package/dist/esm-es5/useInstantAccessRegistration-9d4cb797.js +0 -1
- package/dist/esm-es5/useRegistrationFormState-53c71782.js +0 -1
- package/dist/mint-components/p-00be5090.js +0 -1
- package/dist/mint-components/p-1099290c.system.js +0 -1
- package/dist/mint-components/p-1537b6ef.system.entry.js +0 -1
- package/dist/mint-components/p-18a7f543.system.entry.js +0 -1
- package/dist/mint-components/p-26306ac4.system.entry.js +0 -1
- package/dist/mint-components/p-2e16db11.entry.js +0 -1
- package/dist/mint-components/p-41499327.entry.js +0 -1
- package/dist/mint-components/p-43a990b6.system.js +0 -1
- package/dist/mint-components/p-4856b234.system.entry.js +0 -1
- package/dist/mint-components/p-48b7d703.entry.js +0 -174
- package/dist/mint-components/p-494e407e.entry.js +0 -1
- package/dist/mint-components/p-5b7e2d53.entry.js +0 -1
- package/dist/mint-components/p-5d37482d.entry.js +0 -1
- package/dist/mint-components/p-5fc8d87c.system.js +0 -1
- package/dist/mint-components/p-646d302a.system.js +0 -1
- package/dist/mint-components/p-6628bc0e.system.js +0 -1
- package/dist/mint-components/p-66aac0fb.entry.js +0 -13
- package/dist/mint-components/p-6b0e6a6c.js +0 -1
- package/dist/mint-components/p-73c6b26d.entry.js +0 -223
- package/dist/mint-components/p-89a760ea.js +0 -1
- package/dist/mint-components/p-942d1c22.entry.js +0 -33
- package/dist/mint-components/p-b4eb9c46.entry.js +0 -11
- package/dist/mint-components/p-b5176703.entry.js +0 -1
- package/dist/mint-components/p-b71c0e2d.system.entry.js +0 -1
- package/dist/mint-components/p-bd4e9c2b.js +0 -1
- package/dist/mint-components/p-c37137cd.js +0 -2
- package/dist/mint-components/p-c7ce2c1e.system.js +0 -1
- package/dist/mint-components/p-ca17d998.entry.js +0 -1
- package/dist/mint-components/p-d666b326.js +0 -1
- package/dist/mint-components/p-ea88142c.js +0 -1
- package/dist/mint-components/p-ecefeaa9.system.entry.js +0 -1
- package/dist/mint-components/p-f1ec1180.entry.js +0 -1
- package/dist/types/components/sqm-pagination/sqm-pagination-view.d.ts +0 -7
- package/dist/types/components/sqm-pagination/sqm-pagination.d.ts +0 -17
- package/dist/types/components/sqm-pagination/usePagination.d.ts +0 -15
- package/dist/types/components/sqm-referral-code/ReferralCode.stories.d.ts +0 -18
- package/dist/types/components/sqm-referral-code/sqm-referral-code.d.ts +0 -70
- package/dist/types/components/sqm-referral-code/useReferralCode.d.ts +0 -9
- package/dist/types/components/sqm-referral-codes/ReferralCodes.stories.d.ts +0 -9
- package/dist/types/components/sqm-referral-codes/sqm-referral-codes-view.d.ts +0 -10
- package/dist/types/components/sqm-referral-codes/sqm-referral-codes.d.ts +0 -18
- package/dist/types/components/sqm-referral-codes/useReferralCodes.d.ts +0 -59
- package/dist/cjs/{GenericTableView-a3f48e15.js → GenericTableView-80d7642e.js} +1 -1
- package/dist/cjs/{email-registration-view-4c5d9379.js → email-registration-view-248652bb.js} +1 -1
- package/dist/cjs/{sqm-close-button-view-217239b7.js → sqm-close-button-view-fd6e8f60.js} +1 -1
- package/dist/cjs/{sqm-portal-forgot-password-view-3cd69fe7.js → sqm-portal-forgot-password-view-969c49ed.js} +1 -1
- package/dist/cjs/{sqm-portal-reset-password-view-34771d2c.js → sqm-portal-reset-password-view-96f329ed.js} +1 -1
- package/dist/cjs/{sqm-portal-verify-email-view-c8f91506.js → sqm-portal-verify-email-view-7ffcc0d4.js} +1 -1
- package/dist/esm/{GenericTableView-bf154727.js → GenericTableView-d59d8ab4.js} +1 -1
- package/dist/esm/{email-registration-view-12793040.js → email-registration-view-a89a88bf.js} +1 -1
- package/dist/esm/{sqm-close-button-view-b24c708b.js → sqm-close-button-view-dc65b4e3.js} +1 -1
- package/dist/esm/{sqm-portal-forgot-password-view-95cd454f.js → sqm-portal-forgot-password-view-c2ed8fed.js} +1 -1
- package/dist/esm/{sqm-portal-reset-password-view-f1454d43.js → sqm-portal-reset-password-view-79a85e02.js} +1 -1
- package/dist/esm/{sqm-portal-verify-email-view-3739f523.js → sqm-portal-verify-email-view-d7ea2c56.js} +1 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { withHooks } from "@saasquatch/stencil-hooks";
|
|
2
|
+
import { Component, h, Prop } from "@stencil/core";
|
|
3
|
+
import { useWidgetEmailVerification } from "./useEmailVerification";
|
|
4
|
+
import { WidgetEmailVerificationView, } from "./sqm-email-verification-view";
|
|
5
|
+
import { getProps } from "../../../utils/utils";
|
|
6
|
+
import { isDemo } from "@saasquatch/component-boilerplate";
|
|
7
|
+
import deepmerge from "deepmerge";
|
|
8
|
+
/**
|
|
9
|
+
* @uiName Widget Verification Gate
|
|
10
|
+
*/
|
|
11
|
+
export class WidgetEmailVerification {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* @uiName Verify email widget header text
|
|
15
|
+
*/
|
|
16
|
+
this.verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
|
|
17
|
+
/**
|
|
18
|
+
* @uiName Verify email error text
|
|
19
|
+
*/
|
|
20
|
+
this.errorText = "Failed to send an email. If this continues, contact Support with impact.com";
|
|
21
|
+
/**
|
|
22
|
+
* @uiName Email input label
|
|
23
|
+
*/
|
|
24
|
+
this.emailLabel = "Email";
|
|
25
|
+
/**
|
|
26
|
+
* @uiName Send code button text
|
|
27
|
+
*/
|
|
28
|
+
this.sendCodeText = "Send code";
|
|
29
|
+
withHooks(this);
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() { }
|
|
32
|
+
getTextProps() {
|
|
33
|
+
return getProps(this);
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
const props = isDemo()
|
|
37
|
+
? useDemoWidgetEmailVerification(this)
|
|
38
|
+
: useWidgetEmailVerification(this);
|
|
39
|
+
return h(WidgetEmailVerificationView, Object.assign({}, props));
|
|
40
|
+
}
|
|
41
|
+
static get is() { return "sqm-email-verification"; }
|
|
42
|
+
static get encapsulation() { return "shadow"; }
|
|
43
|
+
static get properties() { return {
|
|
44
|
+
"verifyEmailHeaderText": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"mutable": false,
|
|
47
|
+
"complexType": {
|
|
48
|
+
"original": "string",
|
|
49
|
+
"resolved": "string",
|
|
50
|
+
"references": {}
|
|
51
|
+
},
|
|
52
|
+
"required": false,
|
|
53
|
+
"optional": false,
|
|
54
|
+
"docs": {
|
|
55
|
+
"tags": [{
|
|
56
|
+
"text": "Verify email widget header text",
|
|
57
|
+
"name": "uiName"
|
|
58
|
+
}],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "verify-email-header-text",
|
|
62
|
+
"reflect": false,
|
|
63
|
+
"defaultValue": "\"Start by verifying your email. We\u2019ll send you a code through our referral provider, impact.com.\""
|
|
64
|
+
},
|
|
65
|
+
"errorText": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "string",
|
|
70
|
+
"resolved": "string",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [{
|
|
77
|
+
"text": "Verify email error text",
|
|
78
|
+
"name": "uiName"
|
|
79
|
+
}],
|
|
80
|
+
"text": ""
|
|
81
|
+
},
|
|
82
|
+
"attribute": "error-text",
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"defaultValue": "\"Failed to send an email. If this continues, contact Support with impact.com\""
|
|
85
|
+
},
|
|
86
|
+
"emailLabel": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "string",
|
|
91
|
+
"resolved": "string",
|
|
92
|
+
"references": {}
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"optional": false,
|
|
96
|
+
"docs": {
|
|
97
|
+
"tags": [{
|
|
98
|
+
"text": "Email input label",
|
|
99
|
+
"name": "uiName"
|
|
100
|
+
}],
|
|
101
|
+
"text": ""
|
|
102
|
+
},
|
|
103
|
+
"attribute": "email-label",
|
|
104
|
+
"reflect": false,
|
|
105
|
+
"defaultValue": "\"Email\""
|
|
106
|
+
},
|
|
107
|
+
"sendCodeText": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [{
|
|
119
|
+
"text": "Send code button text",
|
|
120
|
+
"name": "uiName"
|
|
121
|
+
}],
|
|
122
|
+
"text": ""
|
|
123
|
+
},
|
|
124
|
+
"attribute": "send-code-text",
|
|
125
|
+
"reflect": false,
|
|
126
|
+
"defaultValue": "\"Send code\""
|
|
127
|
+
},
|
|
128
|
+
"demoData": {
|
|
129
|
+
"type": "unknown",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "DemoData<WidgetEmailVerificationViewProps>",
|
|
133
|
+
"resolved": "{ states?: { error: string; loading: boolean; email: string; }; }",
|
|
134
|
+
"references": {
|
|
135
|
+
"DemoData": {
|
|
136
|
+
"location": "import",
|
|
137
|
+
"path": "../../../global/demo"
|
|
138
|
+
},
|
|
139
|
+
"WidgetEmailVerificationViewProps": {
|
|
140
|
+
"location": "import",
|
|
141
|
+
"path": "./sqm-email-verification-view"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": true,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [{
|
|
149
|
+
"text": undefined,
|
|
150
|
+
"name": "undocumented"
|
|
151
|
+
}, {
|
|
152
|
+
"text": "object",
|
|
153
|
+
"name": "uiType"
|
|
154
|
+
}],
|
|
155
|
+
"text": ""
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}; }
|
|
159
|
+
}
|
|
160
|
+
function useDemoWidgetEmailVerification(props) {
|
|
161
|
+
return deepmerge({
|
|
162
|
+
states: {
|
|
163
|
+
error: "",
|
|
164
|
+
loading: false,
|
|
165
|
+
email: "",
|
|
166
|
+
},
|
|
167
|
+
callbacks: {
|
|
168
|
+
submitEmail: async () => { },
|
|
169
|
+
},
|
|
170
|
+
text: props.getTextProps(),
|
|
171
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
172
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useMutation, useParent, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
|
+
import { useState } from "@saasquatch/universal-hooks";
|
|
3
|
+
import { gql } from "graphql-request";
|
|
4
|
+
import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE } from "../keys";
|
|
5
|
+
export const VerificationEmailMutation = gql `
|
|
6
|
+
mutation requestUserEmailVerification($user: UserIdInput!) {
|
|
7
|
+
requestUserEmailVerification(user: $user) {
|
|
8
|
+
success
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
// TODO: Move to component-boilerplate
|
|
13
|
+
export function useVerificationEmailMutation() {
|
|
14
|
+
const user = useUserIdentity();
|
|
15
|
+
const [request, { loading, data, errors }] = useMutation(VerificationEmailMutation);
|
|
16
|
+
const sendVerificationEmailMutation = async () => {
|
|
17
|
+
try {
|
|
18
|
+
const result = await request({
|
|
19
|
+
user: {
|
|
20
|
+
id: user.id,
|
|
21
|
+
accountId: user.accountId,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
if (result instanceof Error || !result)
|
|
25
|
+
throw new Error();
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
console.error("Could not send verification email", e);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return [
|
|
34
|
+
sendVerificationEmailMutation,
|
|
35
|
+
{
|
|
36
|
+
loading,
|
|
37
|
+
data,
|
|
38
|
+
errors,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
export function useWidgetEmailVerification(props) {
|
|
43
|
+
const [_, setShowCode] = useParent(SHOW_CODE_NAMESPACE);
|
|
44
|
+
const [email, setEmail] = useParent(VERIFICATION_EMAIL_NAMESPACE);
|
|
45
|
+
const [error, setError] = useState(false);
|
|
46
|
+
const [sendVerificationEmailMutation, { loading, data, errors }] = useVerificationEmailMutation();
|
|
47
|
+
const submitEmail = async (e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
const formData = e.detail.formData;
|
|
50
|
+
const toAddress = formData.get("email").toString();
|
|
51
|
+
const result = await sendVerificationEmailMutation();
|
|
52
|
+
if (!result || !result.requestUserEmailVerification.success)
|
|
53
|
+
setError(true);
|
|
54
|
+
else {
|
|
55
|
+
setEmail(toAddress);
|
|
56
|
+
setShowCode(true);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
callbacks: {
|
|
61
|
+
submitEmail,
|
|
62
|
+
},
|
|
63
|
+
states: {
|
|
64
|
+
loading,
|
|
65
|
+
error: error && props.errorText,
|
|
66
|
+
email,
|
|
67
|
+
},
|
|
68
|
+
text: props.getTextProps(),
|
|
69
|
+
};
|
|
70
|
+
}
|
package/dist/collection/components/sqm-widget-verification/sqm-widget-verification-internal.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useParentState, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
|
+
import { withHooks } from "@saasquatch/stencil-hooks";
|
|
3
|
+
import { Component, h } from "@stencil/core";
|
|
4
|
+
import { SHOW_CODE_NAMESPACE, VERIFICATION_EMAIL_NAMESPACE } from "./keys";
|
|
5
|
+
export class WidgetVerificationInternal {
|
|
6
|
+
constructor() {
|
|
7
|
+
withHooks(this);
|
|
8
|
+
}
|
|
9
|
+
disconnectedCallback() { }
|
|
10
|
+
render() {
|
|
11
|
+
const userIdentity = useUserIdentity();
|
|
12
|
+
const [showCode, setShowCode] = useParentState({
|
|
13
|
+
namespace: SHOW_CODE_NAMESPACE,
|
|
14
|
+
initialValue: false,
|
|
15
|
+
});
|
|
16
|
+
const [email, setEmail] = useParentState({
|
|
17
|
+
namespace: VERIFICATION_EMAIL_NAMESPACE,
|
|
18
|
+
initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
|
|
19
|
+
});
|
|
20
|
+
if (showCode) {
|
|
21
|
+
return h("sqm-code-verification", null);
|
|
22
|
+
}
|
|
23
|
+
return h("sqm-email-verification", null);
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "sqm-widget-verification-internal"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { useParentState } from "@saasquatch/component-boilerplate";
|
|
2
|
+
import { useHost, withHooks } from "@saasquatch/stencil-hooks";
|
|
3
|
+
import { useCallback, useEffect, useState } from "@saasquatch/universal-hooks";
|
|
4
|
+
import { Component, h, Host } from "@stencil/core";
|
|
5
|
+
import debugFn from "debug";
|
|
6
|
+
import { VERIFICATION_EVENT_KEY, VERIFICATION_PARENT_NAMESPACE } from "./keys";
|
|
7
|
+
const debug = debugFn("sq:widget-verification");
|
|
8
|
+
function useTemplateChildren({ parent, callback }) {
|
|
9
|
+
const parentObserver = new MutationObserver(listenForTemplateChanges);
|
|
10
|
+
const childTemplateObserver = new MutationObserver(callback);
|
|
11
|
+
parentObserver.observe(parent, {
|
|
12
|
+
childList: true,
|
|
13
|
+
// We only care about immediate children templates
|
|
14
|
+
subtree: false,
|
|
15
|
+
});
|
|
16
|
+
listenForTemplateChanges({ addedNodes: parent.querySelectorAll("template") });
|
|
17
|
+
function listenForTemplateChanges(mutationList) {
|
|
18
|
+
var _a;
|
|
19
|
+
// Be smart, only look at the mutation list
|
|
20
|
+
(_a = mutationList.addedNodes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
|
|
21
|
+
childTemplateObserver.observe(t.content, {
|
|
22
|
+
childList: true,
|
|
23
|
+
attributes: true,
|
|
24
|
+
// Look deep into the templates for re-rendering
|
|
25
|
+
subtree: true,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
parentObserver.disconnect();
|
|
31
|
+
childTemplateObserver.disconnect();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @uiName Widget Verification Gate
|
|
36
|
+
*/
|
|
37
|
+
export class WidgetVerification {
|
|
38
|
+
constructor() {
|
|
39
|
+
withHooks(this);
|
|
40
|
+
}
|
|
41
|
+
disconnectedCallback() { }
|
|
42
|
+
render() {
|
|
43
|
+
const [context, setContext] = useParentState({
|
|
44
|
+
namespace: VERIFICATION_PARENT_NAMESPACE,
|
|
45
|
+
initialValue: undefined,
|
|
46
|
+
});
|
|
47
|
+
const authToken = context === null || context === void 0 ? void 0 : context.token;
|
|
48
|
+
const [container, setContainer] = useState(undefined);
|
|
49
|
+
const [slot, setSlot] = useState(undefined);
|
|
50
|
+
if (!authToken)
|
|
51
|
+
debug("No user identity available");
|
|
52
|
+
const updateTemplates = useCallback(() => {
|
|
53
|
+
const isAuth = !!authToken;
|
|
54
|
+
const templates = slot.querySelectorAll(`template`);
|
|
55
|
+
const template = Array.from(templates).find((t) => t.slot === (isAuth ? "verified" : "not-verified"));
|
|
56
|
+
if (template) {
|
|
57
|
+
// use outerHTML if template's innerHTML is unset (only happens in Stencilbook)
|
|
58
|
+
const newContent = template.innerHTML || template.firstElementChild.outerHTML;
|
|
59
|
+
// if template contents are an exact match
|
|
60
|
+
if (newContent === container.innerHTML) {
|
|
61
|
+
debug("don't rerender");
|
|
62
|
+
}
|
|
63
|
+
else if (template) {
|
|
64
|
+
container.innerHTML = newContent;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const plopTargets = Array.from(slot.children).filter((el) => el.tagName === "RAISINS-PLOP-TARGET");
|
|
68
|
+
// if editing in raisins
|
|
69
|
+
if (plopTargets.length) {
|
|
70
|
+
const loggedInPlopTargets = plopTargets.filter((el) => el.slot === "verified");
|
|
71
|
+
const loggedOutPlopTargets = plopTargets.filter((el) => el.slot === "not-verified");
|
|
72
|
+
loggedOutPlopTargets.forEach((target, i) => {
|
|
73
|
+
if (isAuth) {
|
|
74
|
+
target.style.display = "none";
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Place last plop target at the bottom of the parent
|
|
78
|
+
if (i === loggedOutPlopTargets.length - 1) {
|
|
79
|
+
target.style.bottom = "0px";
|
|
80
|
+
target.style.left = "0px";
|
|
81
|
+
target.style.right = "0px";
|
|
82
|
+
target.style.position = "absolute";
|
|
83
|
+
}
|
|
84
|
+
target.style.height = "25px";
|
|
85
|
+
});
|
|
86
|
+
loggedInPlopTargets.forEach((target, i) => {
|
|
87
|
+
if (!isAuth) {
|
|
88
|
+
target.style.display = "none";
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// Place last plop target at the bottom of the parent
|
|
92
|
+
if (i === loggedInPlopTargets.length - 1) {
|
|
93
|
+
target.style.bottom = "0px";
|
|
94
|
+
target.style.left = "0px";
|
|
95
|
+
target.style.right = "0px";
|
|
96
|
+
target.style.position = "absolute";
|
|
97
|
+
}
|
|
98
|
+
target.style.height = "25px";
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [container, slot, authToken]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!container || !slot) {
|
|
104
|
+
debug("DOM not ready:");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
// Run on first render
|
|
108
|
+
updateTemplates();
|
|
109
|
+
return useTemplateChildren({ parent: slot, callback: updateTemplates });
|
|
110
|
+
}, [slot, container, authToken]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
const host = useHost();
|
|
113
|
+
const callback = (e) => {
|
|
114
|
+
e.stopPropagation();
|
|
115
|
+
setContext({ token: e.detail.token });
|
|
116
|
+
};
|
|
117
|
+
host.addEventListener(VERIFICATION_EVENT_KEY, callback);
|
|
118
|
+
return () => {
|
|
119
|
+
host.removeEventListener(VERIFICATION_EVENT_KEY, callback);
|
|
120
|
+
};
|
|
121
|
+
}, []);
|
|
122
|
+
return (h(Host, null,
|
|
123
|
+
h("div", { ref: setSlot, style: { display: "contents" } },
|
|
124
|
+
h("template", { slot: "not-verified" },
|
|
125
|
+
h("sqm-widget-verification-internal", null)),
|
|
126
|
+
h("slot", { name: "not-verified" }),
|
|
127
|
+
h("slot", { name: "verified" })),
|
|
128
|
+
h("div", { ref: setContainer },
|
|
129
|
+
h("slot", { name: "shown" }))));
|
|
130
|
+
}
|
|
131
|
+
static get is() { return "sqm-widget-verification"; }
|
|
132
|
+
}
|
|
@@ -194,6 +194,7 @@ const stepTwoProps = {
|
|
|
194
194
|
};
|
|
195
195
|
const stepFourProps = {
|
|
196
196
|
states: {
|
|
197
|
+
showVerification: false,
|
|
197
198
|
step: "4",
|
|
198
199
|
hideSteps: false,
|
|
199
200
|
disabled: false,
|
|
@@ -967,6 +968,23 @@ export const TaxAndCashDashboardIndirectTaxNotRegistered = () => {
|
|
|
967
968
|
},
|
|
968
969
|
} }));
|
|
969
970
|
};
|
|
971
|
+
export const TaxAndCashDashboardIdentityVerifcationRequired = () => {
|
|
972
|
+
return (h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
973
|
+
...dashboardProps,
|
|
974
|
+
states: {
|
|
975
|
+
showIdentityVerificationDialog: true,
|
|
976
|
+
identiyRequired: true,
|
|
977
|
+
canEditPayoutInfo: true,
|
|
978
|
+
status: "ACTIVE",
|
|
979
|
+
documentType: "W8BEN",
|
|
980
|
+
documentTypeString: taxTypeToName("W8BEN"),
|
|
981
|
+
dateSubmitted: "Jan 18th, 2025",
|
|
982
|
+
noFormNeeded: false,
|
|
983
|
+
notRegistered: true,
|
|
984
|
+
showNewFormDialog: false,
|
|
985
|
+
},
|
|
986
|
+
} }));
|
|
987
|
+
};
|
|
970
988
|
export const TaxAndCashDashboardNewTaxForm = () => {
|
|
971
989
|
return (h("sqm-tax-and-cash-dashboard", { demoData: {
|
|
972
990
|
...dashboardProps,
|
package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form.js
CHANGED
|
@@ -313,6 +313,9 @@ export class BankingInfoForm {
|
|
|
313
313
|
padding: "var(--sl-spacing-x-small)",
|
|
314
314
|
},
|
|
315
315
|
};
|
|
316
|
+
if (props.states.isPartner && props.states.showVerification) {
|
|
317
|
+
return h("sqm-code-verification", null);
|
|
318
|
+
}
|
|
316
319
|
return (h(Host, null,
|
|
317
320
|
h(BankingInfoFormView, { callbacks: props.callbacks, text: props.text, states: props.states, refs: props.refs, slots: {
|
|
318
321
|
formInputsSlot: inputFields === null || inputFields === void 0 ? void 0 : inputFields.map(({ input }) => input),
|
|
@@ -1497,7 +1500,7 @@ export class BankingInfoForm {
|
|
|
1497
1500
|
"mutable": false,
|
|
1498
1501
|
"complexType": {
|
|
1499
1502
|
"original": "DemoData<BankingInfoFormViewProps>",
|
|
1500
|
-
"resolved": "{ states?: { step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; }; slots?: { formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1503
|
+
"resolved": "{ states?: { showVerification: boolean; step?: string; locale?: string; loading: boolean; saveLoading?: boolean; disabled: boolean; saveDisabled: boolean; hideSteps?: boolean; hasPayPal: boolean; hideBanking?: boolean; hidePayPal?: boolean; hideBalanceThreshold?: boolean; hideFixedDay?: boolean; hideBackButton: boolean; feeCap?: string; isPartner: boolean; paymentMethodFeeLabel?: string; loadingError: boolean; formState: BankingInfoFormData & { paymentMethodChecked?: \"toBankAccount\" | \"toPayPalAccount\"; paymentScheduleChecked?: \"BALANCE_THRESHOLD\" | \"FIXED_DAY\"; errors?: { general?: boolean; inputErrors?: { [field: string]: { type: \"required\" | \"invalid\"; }; }; }; }; bitset?: number; currency?: string; thresholds: string[]; countries?: { countryCode: string; displayName: string; }[]; allCountries?: { countryCode: string; displayName: string; }[]; currentPaymentOption?: any; showInputs?: boolean; bankCountry?: string; countrySearch?: string; }; slots?: { formInputsSlot?: VNode[]; countryInputSlot?: VNode; paymentMethodSlot?: VNode; paymentThresholdSelectSlot?: VNode; paymentFixedDaySelectSlot?: VNode; paypalInputSlot?: VNode; }; refs?: { formRef: any; }; }",
|
|
1501
1504
|
"references": {
|
|
1502
1505
|
"DemoData": {
|
|
1503
1506
|
"location": "import",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useLocale, useMutation, useParent, useParentQueryValue, useParentValue, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
1
|
+
import { useHost, useLocale, useMutation, useParent, useParentQueryValue, useParentValue, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useEffect, useRef, useState } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { gql } from "graphql-request";
|
|
4
4
|
import JSONPointer from "jsonpointer";
|
|
5
5
|
import { intl } from "../../../global/global";
|
|
6
6
|
import { FINANCE_NETWORK_SETTINGS_NAMESPACE, SORTED_COUNTRIES_NAMESPACE, TAX_CONTEXT_NAMESPACE, TAX_FORM_CONTEXT_NAMESPACE, USER_QUERY_NAMESPACE, } from "../sqm-tax-and-cash/data";
|
|
7
|
+
import { VERIFICATION_EVENT_KEY } from "../../sqm-widget-verification/keys";
|
|
7
8
|
// Hardcoded in Impact backend
|
|
8
9
|
export const paypalFeeMap = {
|
|
9
10
|
USD: "USD20.00",
|
|
@@ -50,6 +51,21 @@ const SAVE_WITHDRAWAL_SETTINGS = gql `
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
`;
|
|
54
|
+
const UPDATE_WITHDRAWAL_SETTINGS = gql `
|
|
55
|
+
mutation updateImpactPublisherWithdrawalSettings(
|
|
56
|
+
$updateImpactPublisherWithdrawalSettingsInput: UpdateImpactPublisherWithdrawalSettingsInput!
|
|
57
|
+
) {
|
|
58
|
+
updateImpactPublisherWithdrawalSettings(
|
|
59
|
+
updateImpactPublisherWithdrawalSettingsInput: $updateImpactPublisherWithdrawalSettingsInput
|
|
60
|
+
) {
|
|
61
|
+
success
|
|
62
|
+
validationErrors {
|
|
63
|
+
field
|
|
64
|
+
message
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
53
69
|
function getPaymentMethod(paymentOption) {
|
|
54
70
|
if (paymentOption.defaultFinancePaymentMethodId === 3 ||
|
|
55
71
|
paymentOption.defaultFinancePaymentMethodId === 5)
|
|
@@ -67,6 +83,7 @@ function parseImpactThreshold(threshold) {
|
|
|
67
83
|
}
|
|
68
84
|
export function useBankingInfoForm(props) {
|
|
69
85
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
86
|
+
const host = useHost();
|
|
70
87
|
const locale = useLocale();
|
|
71
88
|
const user = useUserIdentity();
|
|
72
89
|
const [step, setStep] = useParent(TAX_CONTEXT_NAMESPACE);
|
|
@@ -76,6 +93,9 @@ export function useBankingInfoForm(props) {
|
|
|
76
93
|
const { data: paymentOptionsData, loading: paymentOptionsLoading, errors: paymentOptionsError, } = useParentQueryValue(FINANCE_NETWORK_SETTINGS_NAMESPACE);
|
|
77
94
|
const { data: userData, refetch, errors: userError, } = useParentQueryValue(USER_QUERY_NAMESPACE);
|
|
78
95
|
const [saveWithdrawalSettings] = useMutation(SAVE_WITHDRAWAL_SETTINGS);
|
|
96
|
+
const [updateWithdrawalSettings] = useMutation(UPDATE_WITHDRAWAL_SETTINGS);
|
|
97
|
+
const [showVerification, setShowVerification] = useState(false);
|
|
98
|
+
const [currentFormData, setCurrentFormData] = useState(null);
|
|
79
99
|
const [formState, setFormState] = useState({});
|
|
80
100
|
const [currentPaymentOption, setCurrentPaymentOption] = useState(null);
|
|
81
101
|
const [loading, setLoading] = useState(false);
|
|
@@ -85,8 +105,9 @@ export function useBankingInfoForm(props) {
|
|
|
85
105
|
const [countrySearch, setCountrySearch] = useState("");
|
|
86
106
|
const [filteredCountries, setFilteredCountries] = useState(countries || []);
|
|
87
107
|
const currency = ((_c = (_b = (_a = userData === null || userData === void 0 ? void 0 : userData.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher) === null || _c === void 0 ? void 0 : _c.currency) || "";
|
|
108
|
+
const isPartner = !!((_f = (_e = (_d = userData === null || userData === void 0 ? void 0 : userData.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher) === null || _f === void 0 ? void 0 : _f.withdrawalSettings);
|
|
88
109
|
const feeCap = paypalFeeMap[currency] || "";
|
|
89
|
-
const paymentOptions = (
|
|
110
|
+
const paymentOptions = (_g = paymentOptionsData === null || paymentOptionsData === void 0 ? void 0 : paymentOptionsData.impactFinanceNetworkSettings) === null || _g === void 0 ? void 0 : _g.data;
|
|
90
111
|
const paymentMethodFeeMap = {
|
|
91
112
|
[ACH_PAYMENT_METHOD]: props.eftWithdrawalLabel,
|
|
92
113
|
[WIRE_PAYMENT_METHOD]: intl.formatMessage({
|
|
@@ -165,49 +186,50 @@ export function useBankingInfoForm(props) {
|
|
|
165
186
|
setFormState((p) => ({ ...p, bankCountry }));
|
|
166
187
|
setCurrentPaymentOption(currentPaymentOption);
|
|
167
188
|
};
|
|
168
|
-
const
|
|
169
|
-
var _a, _b, _c, _d;
|
|
170
|
-
let formData = {};
|
|
171
|
-
let validationErrors = {};
|
|
172
|
-
const controls = event.target.getFormControls();
|
|
173
|
-
controls.forEach((control) => {
|
|
174
|
-
if (!control.name || !control.id)
|
|
175
|
-
return;
|
|
176
|
-
const key = control.name;
|
|
177
|
-
const value = control.value;
|
|
178
|
-
JSONPointer.set(formData, key, value);
|
|
179
|
-
if (control.required && !value) {
|
|
180
|
-
JSONPointer.set(validationErrors, key, { type: "required" });
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
setErrors({ inputErrors: validationErrors });
|
|
184
|
-
if (Object.keys(validationErrors).length) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
189
|
+
const runMutation = async (formData, token) => {
|
|
190
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
187
191
|
setLoading(true);
|
|
188
192
|
try {
|
|
189
193
|
if (!currentPaymentOption)
|
|
190
194
|
throw new Error("No currentPaymentOption");
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
accountId: user.accountId,
|
|
196
|
-
},
|
|
197
|
-
...formData,
|
|
198
|
-
paymentMethod: getPaymentMethod(currentPaymentOption),
|
|
199
|
-
paymentSchedulingType: paymentScheduleChecked,
|
|
195
|
+
const body = {
|
|
196
|
+
user: {
|
|
197
|
+
id: user.id,
|
|
198
|
+
accountId: user.accountId,
|
|
200
199
|
},
|
|
200
|
+
...formData,
|
|
201
|
+
paymentMethod: getPaymentMethod(currentPaymentOption),
|
|
202
|
+
paymentSchedulingType: paymentScheduleChecked,
|
|
201
203
|
};
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
let response = null;
|
|
205
|
+
let success = null;
|
|
206
|
+
let validationErrors = null;
|
|
207
|
+
// Call difference mutations based on whether the user is updating
|
|
208
|
+
// the info for setting it for the first time
|
|
209
|
+
if (isPartner) {
|
|
210
|
+
response = await updateWithdrawalSettings({
|
|
211
|
+
updateImpactPublisherWithdrawalSettingsInput: {
|
|
212
|
+
...body,
|
|
213
|
+
accessKey: token,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
success = (_b = (_a = response) === null || _a === void 0 ? void 0 : _a.updateImpactPublisherWithdrawalSettings) === null || _b === void 0 ? void 0 : _b.success;
|
|
217
|
+
validationErrors = (_d = (_c = response) === null || _c === void 0 ? void 0 : _c.updateImpactPublisherWithdrawalSettings) === null || _d === void 0 ? void 0 : _d.validationErrors;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
response = await saveWithdrawalSettings({
|
|
221
|
+
setImpactPublisherWithdrawalSettingsInput: {
|
|
222
|
+
...body,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
success = (_f = (_e = response) === null || _e === void 0 ? void 0 : _e.setImpactPublisherWithdrawalSettings) === null || _f === void 0 ? void 0 : _f.success;
|
|
226
|
+
validationErrors = (_h = (_g = response) === null || _g === void 0 ? void 0 : _g.setImpactPublisherWithdrawalSettings) === null || _h === void 0 ? void 0 : _h.validationErrors;
|
|
227
|
+
}
|
|
228
|
+
if (!response || ((_j = response) === null || _j === void 0 ? void 0 : _j.message)) {
|
|
204
229
|
throw new Error();
|
|
205
230
|
}
|
|
206
|
-
else if (!
|
|
207
|
-
.
|
|
208
|
-
console.error("Validation failed: ", (_c = response
|
|
209
|
-
.setImpactPublisherWithdrawalSettings) === null || _c === void 0 ? void 0 : _c.validationErrors);
|
|
210
|
-
const validationErrors = (_d = response.setImpactPublisherWithdrawalSettings) === null || _d === void 0 ? void 0 : _d.validationErrors;
|
|
231
|
+
else if (!success) {
|
|
232
|
+
console.error("Validation failed: ", validationErrors);
|
|
211
233
|
const mappedValidationErrors = validationErrors === null || validationErrors === void 0 ? void 0 : validationErrors.reduce((agg, error) => {
|
|
212
234
|
return {
|
|
213
235
|
...agg,
|
|
@@ -233,6 +255,39 @@ export function useBankingInfoForm(props) {
|
|
|
233
255
|
setLoading(false);
|
|
234
256
|
}
|
|
235
257
|
};
|
|
258
|
+
const onSubmit = async (event) => {
|
|
259
|
+
let formData = {};
|
|
260
|
+
let validationErrors = {};
|
|
261
|
+
const controls = event.target.getFormControls();
|
|
262
|
+
controls.forEach((control) => {
|
|
263
|
+
if (!control.name || !control.id)
|
|
264
|
+
return;
|
|
265
|
+
const key = control.name;
|
|
266
|
+
const value = control.value;
|
|
267
|
+
JSONPointer.set(formData, key, value);
|
|
268
|
+
if (control.required && !value) {
|
|
269
|
+
JSONPointer.set(validationErrors, key, { type: "required" });
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
setErrors({ inputErrors: validationErrors });
|
|
273
|
+
if (Object.keys(validationErrors).length) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
let token = undefined;
|
|
277
|
+
if (isPartner) {
|
|
278
|
+
setShowVerification(true);
|
|
279
|
+
token = await new Promise((res) => {
|
|
280
|
+
const cb = (e) => {
|
|
281
|
+
e.stopPropagation();
|
|
282
|
+
host.removeEventListener(VERIFICATION_EVENT_KEY, cb);
|
|
283
|
+
res(e.detail.token);
|
|
284
|
+
};
|
|
285
|
+
host.addEventListener(VERIFICATION_EVENT_KEY, cb);
|
|
286
|
+
});
|
|
287
|
+
setShowVerification(false);
|
|
288
|
+
}
|
|
289
|
+
await runMutation(formData, token);
|
|
290
|
+
};
|
|
236
291
|
function setPaymentMethodChecked(paymentMethod) {
|
|
237
292
|
_setPaymentMethodChecked(paymentMethod);
|
|
238
293
|
if (paymentMethod === "toPayPalAccount") {
|
|
@@ -259,11 +314,12 @@ export function useBankingInfoForm(props) {
|
|
|
259
314
|
setCountrySearch,
|
|
260
315
|
},
|
|
261
316
|
states: {
|
|
317
|
+
showVerification,
|
|
262
318
|
step: step === null || step === void 0 ? void 0 : step.replace("/", ""),
|
|
263
319
|
hideSteps: !!context.hideSteps,
|
|
264
320
|
saveDisabled: !paymentMethodChecked || !paymentScheduleChecked,
|
|
265
321
|
locale,
|
|
266
|
-
isPartner
|
|
322
|
+
isPartner,
|
|
267
323
|
feeCap,
|
|
268
324
|
paymentMethodFeeLabel,
|
|
269
325
|
disabled: loading,
|